before
stringlengths
33
3.21M
after
stringlengths
63
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
public static int arrayPairSum2(int[] nums) { Arrays.sort(nums); int sum = 0; for (int i = 0; i < nums.length; i = i + 2) { sum = sum + nums[i]; } return sum; }
public static int arrayPairSum2(int[] nums) { Arrays.sort(nums); <DeepExtract> int sum = 0; for (int i = 0; i < nums.length; i = i + 2) { sum = sum + nums[i]; } return sum; </DeepExtract> }
Java-Note
positive
440,878
public synchronized void removeDrawAction(DrawAction action) { actions.remove(action); redoActions.add(action); valid = false; fireEvent(null, EVENT_DRAWING_INVALIDATED); DrawingEvent evt = new DrawingEvent(EVENT_DRAW_ACTION_REMOVED, this, action); for (DrawingListener listener : listeners) { listener.eventFired(evt); } }
public synchronized void removeDrawAction(DrawAction action) { actions.remove(action); redoActions.add(action); valid = false; fireEvent(null, EVENT_DRAWING_INVALIDATED); <DeepExtract> DrawingEvent evt = new DrawingEvent(EVENT_DRAW_ACTION_REMOVED, this, action); for (DrawingListener listener : listeners) { listener.eventFired(evt); } </DeepExtract> }
Stacks-Flashcards
positive
440,879
@Test @Deployment(resources = { "org/camunda/bpm/scenario/test/timers/EventSubprocessInterruptingTimerTest.bpmn" }) public void testTakeMuchTooLongForTask() { when(scenario.waitsAtUserTask("UserTask")).thenReturn(new UserTaskAction() { @Override public void execute(final TaskDelegate task) { task.defer("PT6M", new Deferred() { @Override public void execute() { task.complete(); } }); } }); task.complete(); verify(scenario, times(1)).hasStarted("UserTask"); verify(scenario, times(1)).hasFinished("UserTask"); verify(scenario, never()).hasFinished("EndEventCompleted"); verify(scenario, times(1)).hasFinished("EndEventCanceled"); }
@Test @Deployment(resources = { "org/camunda/bpm/scenario/test/timers/EventSubprocessInterruptingTimerTest.bpmn" }) public void testTakeMuchTooLongForTask() { when(scenario.waitsAtUserTask("UserTask")).thenReturn(new UserTaskAction() { @Override public void execute(final TaskDelegate task) { task.defer("PT6M", new Deferred() { @Override public void execute() { <DeepExtract> task.complete(); </DeepExtract> } }); } }); <DeepExtract> task.complete(); </DeepExtract> verify(scenario, times(1)).hasStarted("UserTask"); verify(scenario, times(1)).hasFinished("UserTask"); verify(scenario, never()).hasFinished("EndEventCompleted"); verify(scenario, times(1)).hasFinished("EndEventCanceled"); }
camunda-platform-scenario
positive
440,881
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bitmap inBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.dog); Bitmap outBitmap = inBitmap.copy(inBitmap.getConfig(), true); ImageView normalImage = (ImageView) findViewById(R.id.image_normal); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); final RenderScript rs = RenderScript.create(this); final Allocation input = Allocation.createFromBitmap(rs, inBitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); final Allocation output = Allocation.createTyped(rs, input.getType()); final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); script.setRadius(4f); script.setInput(input); script.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_blurred); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); final ScriptIntrinsicColorMatrix scriptColor = ScriptIntrinsicColorMatrix.create(rs, Element.U8_4(rs)); scriptColor.setGreyscale(); scriptColor.forEach(input, output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_greyscale); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); ScriptIntrinsicConvolve3x3 scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.SHARPEN)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_sharpen); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.EDGE_DETECT)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_edge); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.EMBOSS)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_emboss); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); rs.destroy(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bitmap inBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.dog); Bitmap outBitmap = inBitmap.copy(inBitmap.getConfig(), true); ImageView normalImage = (ImageView) findViewById(R.id.image_normal); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); final RenderScript rs = RenderScript.create(this); final Allocation input = Allocation.createFromBitmap(rs, inBitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); final Allocation output = Allocation.createTyped(rs, input.getType()); final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); script.setRadius(4f); script.setInput(input); script.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_blurred); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); final ScriptIntrinsicColorMatrix scriptColor = ScriptIntrinsicColorMatrix.create(rs, Element.U8_4(rs)); scriptColor.setGreyscale(); scriptColor.forEach(input, output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_greyscale); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); ScriptIntrinsicConvolve3x3 scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.SHARPEN)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_sharpen); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.EDGE_DETECT)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); ImageView normalImage = (ImageView) findViewById(R.id.image_edge); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); scriptC = ScriptIntrinsicConvolve3x3.create(rs, Element.U8_4(rs)); scriptC.setCoefficients(getCoefficients(ConvolutionFilter.EMBOSS)); scriptC.setInput(input); scriptC.forEach(output); output.copyTo(outBitmap); <DeepExtract> ImageView normalImage = (ImageView) findViewById(R.id.image_emboss); normalImage.setImageBitmap(outBitmap.copy(outBitmap.getConfig(), false)); </DeepExtract> rs.destroy(); }
android-recipes-5ed
positive
440,882
@Override public void start() throws Exception { conn = DriverManager.getConnection("jdbc:hsqldb:mem:test?shutdown=true"); executeStatement("drop table if exists user;"); executeStatement("drop table if exists user_roles;"); executeStatement("drop table if exists roles_perms;"); executeStatement("create table user (username varchar(255), password varchar(255), password_salt varchar(255) );"); executeStatement("create table user_roles (username varchar(255), role varchar(255));"); executeStatement("create table roles_perms (role varchar(255), perm varchar(255));"); executeStatement("insert into user values ('tim', 'EC0D6302E35B7E792DF9DA4A5FE0DB3B90FCAB65A6215215771BF96D498A01DA8234769E1CE8269A105E9112F374FDAB2158E7DA58CDC1348A732351C38E12A0', 'C59EB438D1E24CACA2B1A48BC129348589D49303863E493FBE906A9158B7D5DC');"); executeStatement("insert into user_roles values ('tim', 'dev');"); executeStatement("insert into user_roles values ('tim', 'admin');"); executeStatement("insert into roles_perms values ('dev', 'commit_code');"); executeStatement("insert into roles_perms values ('dev', 'eat_pizza');"); executeStatement("insert into roles_perms values ('admin', 'merge_pr');"); JDBCClient client = JDBCClient.createShared(vertx, new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true").put("driver_class", "org.hsqldb.jdbcDriver")); Router router = Router.router(vertx); router.route().handler(CookieHandler.create()); router.route().handler(BodyHandler.create()); router.route().handler(SessionHandler.create(LocalSessionStore.create(vertx))); AuthProvider authProvider = JDBCAuth.create(vertx, client); router.route().handler(UserSessionHandler.create(authProvider)); router.route("/private/*").handler(RedirectAuthHandler.create(authProvider, "/loginpage.html")); router.route("/private/*").handler(StaticHandler.create().setCachingEnabled(false).setWebRoot("private")); router.route("/loginhandler").handler(FormLoginHandler.create(authProvider)); router.route("/logout").handler(context -> { context.clearUser(); context.response().putHeader("location", "/").setStatusCode(302).end(); }); router.route().handler(StaticHandler.create()); vertx.createHttpServer().requestHandler(router).listen(8080); }
@Override public void start() throws Exception { <DeepExtract> conn = DriverManager.getConnection("jdbc:hsqldb:mem:test?shutdown=true"); executeStatement("drop table if exists user;"); executeStatement("drop table if exists user_roles;"); executeStatement("drop table if exists roles_perms;"); executeStatement("create table user (username varchar(255), password varchar(255), password_salt varchar(255) );"); executeStatement("create table user_roles (username varchar(255), role varchar(255));"); executeStatement("create table roles_perms (role varchar(255), perm varchar(255));"); executeStatement("insert into user values ('tim', 'EC0D6302E35B7E792DF9DA4A5FE0DB3B90FCAB65A6215215771BF96D498A01DA8234769E1CE8269A105E9112F374FDAB2158E7DA58CDC1348A732351C38E12A0', 'C59EB438D1E24CACA2B1A48BC129348589D49303863E493FBE906A9158B7D5DC');"); executeStatement("insert into user_roles values ('tim', 'dev');"); executeStatement("insert into user_roles values ('tim', 'admin');"); executeStatement("insert into roles_perms values ('dev', 'commit_code');"); executeStatement("insert into roles_perms values ('dev', 'eat_pizza');"); executeStatement("insert into roles_perms values ('admin', 'merge_pr');"); </DeepExtract> JDBCClient client = JDBCClient.createShared(vertx, new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true").put("driver_class", "org.hsqldb.jdbcDriver")); Router router = Router.router(vertx); router.route().handler(CookieHandler.create()); router.route().handler(BodyHandler.create()); router.route().handler(SessionHandler.create(LocalSessionStore.create(vertx))); AuthProvider authProvider = JDBCAuth.create(vertx, client); router.route().handler(UserSessionHandler.create(authProvider)); router.route("/private/*").handler(RedirectAuthHandler.create(authProvider, "/loginpage.html")); router.route("/private/*").handler(StaticHandler.create().setCachingEnabled(false).setWebRoot("private")); router.route("/loginhandler").handler(FormLoginHandler.create(authProvider)); router.route("/logout").handler(context -> { context.clearUser(); context.response().putHeader("location", "/").setStatusCode(302).end(); }); router.route().handler(StaticHandler.create()); vertx.createHttpServer().requestHandler(router).listen(8080); }
vertx-examples
positive
440,883
public Criteria andScopeBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "scope" + " cannot be null"); } criteria.add(new Criterion("scope between", value1, value2)); return (Criteria) this; }
public Criteria andScopeBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "scope" + " cannot be null"); } criteria.add(new Criterion("scope between", value1, value2)); </DeepExtract> return (Criteria) this; }
oauth4j
positive
440,884
@Override protected void run() throws Exception { Timer timer = new Timer(); int readTime = 0, remapTime = 0, writeTime = 0; int readTime = 0, remapTime = 0, writeTime = 0; int readTime = 0, remapTime = 0, writeTime = 0; System.out.println("Loading MCP configuration"); String mcVer = MappingLoader_MCP.getMCVer(mcpDir); MappingFactory.registerMCPInstance(mcVer, side, mcpDir, null); int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; MinecraftNameSet inputNS = new MinecraftNameSet(fromType, side, mcVer); MinecraftNameSet outputNS = new MinecraftNameSet(toType, side, mcVer); List<ReferenceDataCollection> refs = new ArrayList<>(); for (RefOption ro : refOptsParsed) { MinecraftNameSet refNS = new MinecraftNameSet(ro.type, side, mcVer); System.out.println("Loading " + ro.file); ClassCollection refCC = ClassCollectionFactory.loadClassCollection(refNS, ro.file, null); readTime += timer.flip(); if (!refNS.equals(inputNS)) { System.out.println("Remapping " + ro.file + " (" + refNS + " -> " + inputNS + ")"); refCC = Remapper.remap(refCC, MappingFactory.getMapping((MinecraftNameSet) refCC.getNameSet(), inputNS, null), Collections.<ReferenceDataCollection>emptyList(), null); remapTime += timer.flip(); } refs.add(ReferenceDataCollection.fromClassCollection(refCC)); } System.out.println("Loading " + inFile); ClassCollection inputCC = ClassCollectionFactory.loadClassCollection(inputNS, inFile, null); int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; System.out.println("Remapping " + inFile + " (" + inputNS + " -> " + outputNS + ")"); ClassCollection outputCC = Remapper.remap(inputCC, MappingFactory.getMapping((MinecraftNameSet) inputCC.getNameSet(), outputNS, null), refs, null); int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; System.out.println("Writing " + outFile); JarWriter.write(outFile, outputCC, null); int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; System.out.printf("Completed in %d ms\n", readTime + remapTime + writeTime); }
@Override protected void run() throws Exception { Timer timer = new Timer(); int readTime = 0, remapTime = 0, writeTime = 0; int readTime = 0, remapTime = 0, writeTime = 0; int readTime = 0, remapTime = 0, writeTime = 0; System.out.println("Loading MCP configuration"); String mcVer = MappingLoader_MCP.getMCVer(mcpDir); MappingFactory.registerMCPInstance(mcVer, side, mcpDir, null); <DeepExtract> int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; </DeepExtract> MinecraftNameSet inputNS = new MinecraftNameSet(fromType, side, mcVer); MinecraftNameSet outputNS = new MinecraftNameSet(toType, side, mcVer); List<ReferenceDataCollection> refs = new ArrayList<>(); for (RefOption ro : refOptsParsed) { MinecraftNameSet refNS = new MinecraftNameSet(ro.type, side, mcVer); System.out.println("Loading " + ro.file); ClassCollection refCC = ClassCollectionFactory.loadClassCollection(refNS, ro.file, null); readTime += timer.flip(); if (!refNS.equals(inputNS)) { System.out.println("Remapping " + ro.file + " (" + refNS + " -> " + inputNS + ")"); refCC = Remapper.remap(refCC, MappingFactory.getMapping((MinecraftNameSet) refCC.getNameSet(), inputNS, null), Collections.<ReferenceDataCollection>emptyList(), null); remapTime += timer.flip(); } refs.add(ReferenceDataCollection.fromClassCollection(refCC)); } System.out.println("Loading " + inFile); ClassCollection inputCC = ClassCollectionFactory.loadClassCollection(inputNS, inFile, null); <DeepExtract> int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; </DeepExtract> System.out.println("Remapping " + inFile + " (" + inputNS + " -> " + outputNS + ")"); ClassCollection outputCC = Remapper.remap(inputCC, MappingFactory.getMapping((MinecraftNameSet) inputCC.getNameSet(), outputNS, null), refs, null); <DeepExtract> int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; </DeepExtract> System.out.println("Writing " + outFile); JarWriter.write(outFile, outputCC, null); <DeepExtract> int rv = (int) (System.currentTimeMillis() - start); start = System.currentTimeMillis(); return rv; </DeepExtract> System.out.printf("Completed in %d ms\n", readTime + remapTime + writeTime); }
bearded-octo-nemesis
positive
440,885
@DebugSetter(ID = "paddingRight", creator = IntegerSpinnerCreator.class) public CoordSysRenderer setPaddingRight(int padding) { this.paddingRight = padding; this.isDirty = true; return this; }
@DebugSetter(ID = "paddingRight", creator = IntegerSpinnerCreator.class) public CoordSysRenderer setPaddingRight(int padding) { this.paddingRight = padding; <DeepExtract> this.isDirty = true; </DeepExtract> return this; }
JPlotter
positive
440,886
public Map.Entry<K, V> next() { if (modCount != expectedModCount) throw new ConcurrentModificationException(); if (nextKey == null && !hasNext()) throw new NoSuchElementException(); lastReturned = entry; entry = entry.next; currentKey = nextKey; nextKey = null; return lastReturned; }
public Map.Entry<K, V> next() { <DeepExtract> if (modCount != expectedModCount) throw new ConcurrentModificationException(); if (nextKey == null && !hasNext()) throw new NoSuchElementException(); lastReturned = entry; entry = entry.next; currentKey = nextKey; nextKey = null; return lastReturned; </DeepExtract> }
xmltool
positive
440,887
@Override public List<TDBulkImportSession> listBulkImportSessions() { requireNonNull(buildUrl("/v3/bulk_import/list"), "path is null"); requireNonNull(new TypeReference<List<TDBulkImportSession>>() { }, "resultTypeClass is null"); TDApiRequest request = TDApiRequest.Builder.GET(buildUrl("/v3/bulk_import/list")).build(); return httpClient.call(request, apiKeyCache, new TypeReference<List<TDBulkImportSession>>() { }); }
@Override public List<TDBulkImportSession> listBulkImportSessions() { <DeepExtract> requireNonNull(buildUrl("/v3/bulk_import/list"), "path is null"); requireNonNull(new TypeReference<List<TDBulkImportSession>>() { }, "resultTypeClass is null"); TDApiRequest request = TDApiRequest.Builder.GET(buildUrl("/v3/bulk_import/list")).build(); return httpClient.call(request, apiKeyCache, new TypeReference<List<TDBulkImportSession>>() { }); </DeepExtract> }
td-client-java
positive
440,888
@Override public void componentSelected(ButtonEvent ce) { if (validateFields()) { doUnblockIP(Utils.safeString(ipaddress.getValue())); } }
@Override public void componentSelected(ButtonEvent ce) { <DeepExtract> if (validateFields()) { doUnblockIP(Utils.safeString(ipaddress.getValue())); } </DeepExtract> }
webpasswordsafe
positive
440,889
@Override public void setRole(Participant.Role role) throws ConnectionException, NoPermissionException { if (!(getChat() instanceof GroupChat)) throw new NoPermissionException(); Endpoints.MODIFY_MEMBER_URL.open(getClient(), getChat().getIdentity(), getId()).on(400, (connection) -> { throw new NoPermissionException(); }).expect(200, "While updating role").put(new JsonObject().add("role", role.name().toLowerCase())); this.role = role; }
@Override public void setRole(Participant.Role role) throws ConnectionException, NoPermissionException { if (!(getChat() instanceof GroupChat)) throw new NoPermissionException(); Endpoints.MODIFY_MEMBER_URL.open(getClient(), getChat().getIdentity(), getId()).on(400, (connection) -> { throw new NoPermissionException(); }).expect(200, "While updating role").put(new JsonObject().add("role", role.name().toLowerCase())); <DeepExtract> this.role = role; </DeepExtract> }
Skype4J
positive
440,890
@Test void shouldCreateForceIpV6() { List<String> command = YoutubeDlCommandBuilder.newInstance().forceIpV6().buildAsList(); assertThat(command).hasSize(2); assertThat(command).contains("--force-ipv6", atIndex(1)); }
@Test void shouldCreateForceIpV6() { List<String> command = YoutubeDlCommandBuilder.newInstance().forceIpV6().buildAsList(); <DeepExtract> assertThat(command).hasSize(2); assertThat(command).contains("--force-ipv6", atIndex(1)); </DeepExtract> }
vdl
positive
440,892
public void stateChanged(javax.swing.event.ChangeEvent evt) { JSlider slider = (JSlider) evt.getSource(); if (Math.abs(slider.getValue() - prevValue) >= smallChange) { prevValue = slider.getValue(); this.firePropertyChange(VALUE_CHANGED, null, slider.getValue()); } }
public void stateChanged(javax.swing.event.ChangeEvent evt) { <DeepExtract> JSlider slider = (JSlider) evt.getSource(); if (Math.abs(slider.getValue() - prevValue) >= smallChange) { prevValue = slider.getValue(); this.firePropertyChange(VALUE_CHANGED, null, slider.getValue()); } </DeepExtract> }
VietOCR3
positive
440,893
public SELF copy(AsmrNode<?> newParent) { SELF copy = newInstance(newParent); int length = this.children().size(); for (int i = 0; i < length; i++) { copyFieldFrom(getThis(), i); } return copy; }
public SELF copy(AsmrNode<?> newParent) { SELF copy = newInstance(newParent); <DeepExtract> int length = this.children().size(); for (int i = 0; i < length; i++) { copyFieldFrom(getThis(), i); } </DeepExtract> return copy; }
asmr-processor-prototype
positive
440,895
public static String white(String value) { if (Constant.devMode) { return String.valueOf(Ansi.ansi().eraseScreen().render("@|" + "white" + " " + value + "|@")); } else { return value; } }
public static String white(String value) { <DeepExtract> if (Constant.devMode) { return String.valueOf(Ansi.ansi().eraseScreen().render("@|" + "white" + " " + value + "|@")); } else { return value; } </DeepExtract> }
ICERest
positive
440,897
private int jjMoveStringLiteralDfa12_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(10, old0); try { curChar = input_stream.readChar(); } catch (java.io.IOException e) { jjStopStringLiteralDfa_0(11, active0); return 12; } switch(curChar) { case 51: return jjMoveStringLiteralDfa13_0(active0, 0x8000000000000L); case 59: if ((active0 & 0x4000000000000L) != 0L) return jjStopAtPos(12, 50); break; default: break; } return jjMoveNfa_0(jjStopStringLiteralDfa_0(11, active0), 11 + 1); }
private int jjMoveStringLiteralDfa12_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_0(10, old0); try { curChar = input_stream.readChar(); } catch (java.io.IOException e) { jjStopStringLiteralDfa_0(11, active0); return 12; } switch(curChar) { case 51: return jjMoveStringLiteralDfa13_0(active0, 0x8000000000000L); case 59: if ((active0 & 0x4000000000000L) != 0L) return jjStopAtPos(12, 50); break; default: break; } <DeepExtract> return jjMoveNfa_0(jjStopStringLiteralDfa_0(11, active0), 11 + 1); </DeepExtract> }
BuildingSMARTLibrary
positive
440,900
@DisplayName("Search for 'weisse s'") @Test void suggest4() { final String weißeSommerhoseMaster = "weiße sommerhose"; final String weißeSchuheMaster = "weiße schuhe"; final String weißeSneakerMaster = "weiße sneaker"; final String weißeSockenMaster = "weiße socken"; final String weißeSpitzenbluseMaster = "weiße spitzenbluse"; final String weißeStoffhoseMaster = "weiße stoffhose"; final String weisseStrickjackeMaster = "weisse strickjacke"; final String weisseShortsMaster = "weisse shorts"; final String weißesSpitzenkleidMaster = "weißes spitzenkleid"; final String weißeTshirtsDamenMaster = "weiße tshirts damen"; final String weißesSommerkleidMaster = "weißes sommerkleid"; final String weissesHemdMaster = "weisses hemd"; final String tShirtWeißMaster = "t shirt weiß"; List<SuggestRecord> toIndex = new ArrayList<SuggestRecord>(asList(asSuggestRecord(weißeSommerhoseMaster, setOf("weisse sommerhose", "weisse sommerhosse"), 3400), asSuggestRecord(weißeSchuheMaster, setOf("weise schue", "weiße schuhe", "weise schuhe"), 6600), asSuggestRecord(weißeSneakerMaster, setOf("weise sneaker", "weise sneakers", "weisse sneaker", "weiße sneakers"), 0), asSuggestRecord(weißeSockenMaster, setOf("weise socken", "weisse socken.", "weissem socken", "weiße socke", "weißer socken", "weißes socken"), 6600), asSuggestRecord(weißeSpitzenbluseMaster, setOf("weise spitzenbluse", "weisse spitzenbluse", "weiße spitzen blusen", "weiße spitzenblus"), 0), asSuggestRecord(weißeStoffhoseMaster, setOf("weiße stoffhosen", "weisse stoffhose", "weisse stoffhosen", "weiße stoff hosen"), 1800), asSuggestRecord(weisseStrickjackeMaster, setOf("weisse strickjacke", "weise strickjacke", "weiße strickjacken", "weisestrickjacke", "weisse strick jacke", "weisse strickjacken", "weiße strickjacke.", "weißes strickjacke.", "weißestrickjacke"), 9843), asSuggestRecord(weisseShortsMaster, setOf("weisse shorts", "weiße short", "weisse short", "weiße short,", "weißer shortst", "weise short,", "weiße shorts.", "weiße tshorts"), 19408), asSuggestRecord(weißesSpitzenkleidMaster, setOf("weißes spitzen kleid", "weiss es spitzenkleid", "weisse spitzenkleid", "weisses spitzenkleid", "weißes spitzenkleid"), 1800), asSuggestRecord(weißeTshirtsDamenMaster, setOf("weiße t-shirts damen", "weisse shirts damen", "weiße t shirts damen", "weise shirts damen", "weise t shirts damen", "weisse t shirts damen", "weiße shirts damen", "weiße tshirts damen"), 6600), asSuggestRecord(weißesSommerkleidMaster, setOf("weißes sommerkleid", "weiße sommerkleider", "weise sommer kleid", "weises sommerkleid", "weiße sommer kleider", "weißes sommer kleid", "weisse sommerkleid", "weisses sommerkleid", "weißes sommerkleid", "weißes sommerkleider"), 14599), asSuggestRecord(weissesHemdMaster, setOf("weisses hemd", "hemd weiss", "weiß hemd", "weiße hemd", "weiss es hemd", "weißes hemd", "weiss hemd", "weise hemd", "weisse hemd", "weisseshemd", "weiseß hemd", "weisser hemd", "weiße hemde", "hemd weiss", "hemd, weiss", "hemd, weiß", "weise hemde", "weißehemd", "weißer hemd", "weißeshemd", "hemd weiß", "hemd wei", "hemd weiss s", "hemd weisss", "hemd wweiss", "hemd,weiß", "hemdchen weiß", "we isses hemd", "weisehemd", "weisen hemd", "weishemd", "weiss hemd", "weisse hemde", "weisse shemd", "weisses hemd", "weisses <hemd", "weisße hemd", "weiße hemd s", "weiße hemdchen", "weißen hemd", "weißes hemd s", "weißes hemde", "weißhemd"), 500418), asSuggestRecord(tShirtWeißMaster, setOf("weiße shirts", "weisse shirt", "weisse shirts"), 851928))); underTest.index(toIndex).join(); List<Suggestion> results = underTest.suggest("weisse s", 20, Collections.emptySet()); assertThat(results).hasSizeGreaterThanOrEqualTo(2); assertThat(results).hasSize(13); assertThat(results.get(0).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.BEST_MATCHES_GROUP_NAME); assertThat(results.get(7).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.BEST_MATCHES_GROUP_NAME); assertThat(results.get(0).getLabel()).isEqualTo(weisseShortsMaster); assertThat(results.get(1).getLabel()).isEqualTo(weisseStrickjackeMaster); assertThat(results.get(2).getLabel()).isEqualTo(weißeSockenMaster); assertThat(results.get(3).getLabel()).isEqualTo(weißeSchuheMaster); assertThat(results.get(4).getLabel()).isEqualTo(weißeSommerhoseMaster); assertThat(results.get(5).getLabel()).isEqualTo(weißeStoffhoseMaster); assertThat(results.get(6).getLabel()).isEqualTo(weißeSpitzenbluseMaster); assertThat(results.get(7).getLabel()).isEqualTo(weißeSneakerMaster); assertThat(results.get(8).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.TYPO_MATCHES_GROUP_NAME); assertThat(results.get(12).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.TYPO_MATCHES_GROUP_NAME); assertThat(results.get(8).getLabel()).isEqualTo(tShirtWeißMaster); assertThat(results.get(9).getLabel()).isEqualTo(weissesHemdMaster); assertThat(results.get(10).getLabel()).isEqualTo(weißesSommerkleidMaster); assertThat(results.get(11).getLabel()).isEqualTo(weißeTshirtsDamenMaster); assertThat(results.get(12).getLabel()).isEqualTo(weißesSpitzenkleidMaster); }
@DisplayName("Search for 'weisse s'") @Test void suggest4() { final String weißeSommerhoseMaster = "weiße sommerhose"; final String weißeSchuheMaster = "weiße schuhe"; final String weißeSneakerMaster = "weiße sneaker"; final String weißeSockenMaster = "weiße socken"; final String weißeSpitzenbluseMaster = "weiße spitzenbluse"; final String weißeStoffhoseMaster = "weiße stoffhose"; final String weisseStrickjackeMaster = "weisse strickjacke"; final String weisseShortsMaster = "weisse shorts"; final String weißesSpitzenkleidMaster = "weißes spitzenkleid"; final String weißeTshirtsDamenMaster = "weiße tshirts damen"; final String weißesSommerkleidMaster = "weißes sommerkleid"; final String weissesHemdMaster = "weisses hemd"; final String tShirtWeißMaster = "t shirt weiß"; List<SuggestRecord> toIndex = new ArrayList<SuggestRecord>(asList(asSuggestRecord(weißeSommerhoseMaster, setOf("weisse sommerhose", "weisse sommerhosse"), 3400), asSuggestRecord(weißeSchuheMaster, setOf("weise schue", "weiße schuhe", "weise schuhe"), 6600), asSuggestRecord(weißeSneakerMaster, setOf("weise sneaker", "weise sneakers", "weisse sneaker", "weiße sneakers"), 0), asSuggestRecord(weißeSockenMaster, setOf("weise socken", "weisse socken.", "weissem socken", "weiße socke", "weißer socken", "weißes socken"), 6600), asSuggestRecord(weißeSpitzenbluseMaster, setOf("weise spitzenbluse", "weisse spitzenbluse", "weiße spitzen blusen", "weiße spitzenblus"), 0), asSuggestRecord(weißeStoffhoseMaster, setOf("weiße stoffhosen", "weisse stoffhose", "weisse stoffhosen", "weiße stoff hosen"), 1800), asSuggestRecord(weisseStrickjackeMaster, setOf("weisse strickjacke", "weise strickjacke", "weiße strickjacken", "weisestrickjacke", "weisse strick jacke", "weisse strickjacken", "weiße strickjacke.", "weißes strickjacke.", "weißestrickjacke"), 9843), asSuggestRecord(weisseShortsMaster, setOf("weisse shorts", "weiße short", "weisse short", "weiße short,", "weißer shortst", "weise short,", "weiße shorts.", "weiße tshorts"), 19408), asSuggestRecord(weißesSpitzenkleidMaster, setOf("weißes spitzen kleid", "weiss es spitzenkleid", "weisse spitzenkleid", "weisses spitzenkleid", "weißes spitzenkleid"), 1800), asSuggestRecord(weißeTshirtsDamenMaster, setOf("weiße t-shirts damen", "weisse shirts damen", "weiße t shirts damen", "weise shirts damen", "weise t shirts damen", "weisse t shirts damen", "weiße shirts damen", "weiße tshirts damen"), 6600), asSuggestRecord(weißesSommerkleidMaster, setOf("weißes sommerkleid", "weiße sommerkleider", "weise sommer kleid", "weises sommerkleid", "weiße sommer kleider", "weißes sommer kleid", "weisse sommerkleid", "weisses sommerkleid", "weißes sommerkleid", "weißes sommerkleider"), 14599), asSuggestRecord(weissesHemdMaster, setOf("weisses hemd", "hemd weiss", "weiß hemd", "weiße hemd", "weiss es hemd", "weißes hemd", "weiss hemd", "weise hemd", "weisse hemd", "weisseshemd", "weiseß hemd", "weisser hemd", "weiße hemde", "hemd weiss", "hemd, weiss", "hemd, weiß", "weise hemde", "weißehemd", "weißer hemd", "weißeshemd", "hemd weiß", "hemd wei", "hemd weiss s", "hemd weisss", "hemd wweiss", "hemd,weiß", "hemdchen weiß", "we isses hemd", "weisehemd", "weisen hemd", "weishemd", "weiss hemd", "weisse hemde", "weisse shemd", "weisses hemd", "weisses <hemd", "weisße hemd", "weiße hemd s", "weiße hemdchen", "weißen hemd", "weißes hemd s", "weißes hemde", "weißhemd"), 500418), asSuggestRecord(tShirtWeißMaster, setOf("weiße shirts", "weisse shirt", "weisse shirts"), 851928))); underTest.index(toIndex).join(); List<Suggestion> results = underTest.suggest("weisse s", 20, Collections.emptySet()); assertThat(results).hasSizeGreaterThanOrEqualTo(2); assertThat(results).hasSize(13); assertThat(results.get(0).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.BEST_MATCHES_GROUP_NAME); assertThat(results.get(7).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.BEST_MATCHES_GROUP_NAME); assertThat(results.get(0).getLabel()).isEqualTo(weisseShortsMaster); assertThat(results.get(1).getLabel()).isEqualTo(weisseStrickjackeMaster); assertThat(results.get(2).getLabel()).isEqualTo(weißeSockenMaster); assertThat(results.get(3).getLabel()).isEqualTo(weißeSchuheMaster); assertThat(results.get(4).getLabel()).isEqualTo(weißeSommerhoseMaster); assertThat(results.get(5).getLabel()).isEqualTo(weißeStoffhoseMaster); assertThat(results.get(6).getLabel()).isEqualTo(weißeSpitzenbluseMaster); assertThat(results.get(7).getLabel()).isEqualTo(weißeSneakerMaster); assertThat(results.get(8).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.TYPO_MATCHES_GROUP_NAME); assertThat(results.get(12).getPayload().get(LuceneQuerySuggester.PAYLOAD_GROUPMATCH_KEY)).isEqualTo(LuceneQuerySuggester.TYPO_MATCHES_GROUP_NAME); assertThat(results.get(8).getLabel()).isEqualTo(tShirtWeißMaster); assertThat(results.get(9).getLabel()).isEqualTo(weissesHemdMaster); assertThat(results.get(10).getLabel()).isEqualTo(weißesSommerkleidMaster); assertThat(results.get(11).getLabel()).isEqualTo(weißeTshirtsDamenMaster); <DeepExtract> assertThat(results.get(12).getLabel()).isEqualTo(weißesSpitzenkleidMaster); </DeepExtract> }
open-commerce-search
positive
440,903
private static String[] parseNameSheetModeArgs(String[] args) throws IOException { if (args.length < 2) { return null; } if (args[0].equalsIgnoreCase("-searge")) { NameProvider.currentMode = NameProvider.DEOBFUSCATION_MODE; } else if (args[0].equalsIgnoreCase("-notch")) { NameProvider.currentMode = NameProvider.REOBFUSCATION_MODE; NameProvider.repackage = true; } else { return null; } String configFileName = args[1]; File configFile = new File(configFileName); if (!configFile.exists() || !configFile.isFile()) { throw new FileNotFoundException("Could not find config file " + configFileName); } String reobinput = null; String reoboutput = null; FileReader fileReader = null; BufferedReader reader = null; String[] newArgs = new String[4]; try { fileReader = new FileReader(configFile); reader = new BufferedReader(fileReader); String line = ""; while (line != null) { line = reader.readLine(); if ((line == null) || line.trim().startsWith("#")) { continue; } String[] defines = line.split("="); if (defines.length > 1) { defines[1] = line.substring(defines[0].length() + 1).trim(); defines[0] = defines[0].trim(); if (defines[0].equalsIgnoreCase("deob")) { File obfFile = new File(defines[1]); if (obfFile.isFile()) { NameProvider.obfFiles.add(obfFile); } else { throw new FileNotFoundException("Could not find obf file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("packages")) { File packagesFile = new File(defines[1]); if (packagesFile.isFile()) { NameProvider.obfFiles.add(packagesFile); } else { throw new FileNotFoundException("Could not find packages file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("classes")) { File classesFile = new File(defines[1]); if (classesFile.isFile()) { NameProvider.obfFiles.add(classesFile); } else { throw new FileNotFoundException("Could not find classes file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("methods")) { File methodsFile = new File(defines[1]); if (methodsFile.isFile()) { NameProvider.obfFiles.add(methodsFile); } else { throw new FileNotFoundException("Could not find methods file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("fields")) { File fieldsFile = new File(defines[1]); if (fieldsFile.isFile()) { NameProvider.obfFiles.add(fieldsFile); } else { throw new FileNotFoundException("Could not find fields file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("reob")) { File reobFile = new File(defines[1]); if (reobFile.isFile()) { NameProvider.reobFiles.add(reobFile); } else { if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { throw new FileNotFoundException("Could not find reob file " + defines[1]); } } } else if (defines[0].equalsIgnoreCase("input")) { newArgs[0] = defines[1]; } else if (defines[0].equalsIgnoreCase("output")) { newArgs[1] = defines[1]; } else if (defines[0].equalsIgnoreCase("reobinput")) { reobinput = defines[1]; } else if (defines[0].equalsIgnoreCase("reoboutput")) { reoboutput = defines[1]; } else if (defines[0].equalsIgnoreCase("script")) { newArgs[2] = defines[1]; } else if (defines[0].equalsIgnoreCase("log")) { newArgs[3] = defines[1]; } else if (defines[0].equalsIgnoreCase("nplog")) { NameProvider.npLog = new File(defines[1]); if (NameProvider.npLog.exists() && !NameProvider.npLog.isFile()) { NameProvider.npLog = null; } } else if (defines[0].equalsIgnoreCase("rolog")) { NameProvider.roLog = new File(defines[1]); if (NameProvider.roLog.exists() && !NameProvider.roLog.isFile()) { NameProvider.roLog = null; } } else if (defines[0].equalsIgnoreCase("startindex")) { try { int start = Integer.parseInt(defines[1]); NameProvider.uniqueStart = start; } catch (NumberFormatException e) { throw new NumberFormatException("Invalid start index: " + defines[1]); } } else if (defines[0].equalsIgnoreCase("protectedpackage")) { NameProvider.protectedPackages.add(defines[1]); } else if (defines[0].equalsIgnoreCase("quiet")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.quiet = true; } } else if (defines[0].equalsIgnoreCase("oldhash")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.oldHash = true; } } else if (defines[0].equalsIgnoreCase("fixshadowed")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("0") || value.equalsIgnoreCase("f") || value.equalsIgnoreCase("n")) { NameProvider.fixShadowed = false; } } else if (defines[0].equalsIgnoreCase("incremental")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.repackage = false; } } else if (defines[0].equalsIgnoreCase("multipass")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("0") || value.equalsIgnoreCase("f") || value.equalsIgnoreCase("n")) { NameProvider.multipass = false; } } else if (defines[0].equalsIgnoreCase("verbose")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.verbose = true; } } else if (defines[0].equalsIgnoreCase("fullmap")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.fullMap = true; } } else if (defines[0].equalsIgnoreCase("identifier")) { Version.setClassIdString(defines[1].trim()); } } } } finally { try { if (reader != null) { reader.close(); } if (fileReader != null) { fileReader.close(); } } catch (IOException e) { } } if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { newArgs[0] = reobinput; newArgs[1] = reoboutput; } if ((newArgs[0] == null) || (newArgs[1] == null) || (newArgs[2] == null) || (newArgs[3] == null)) { return null; } File logFile = null; if (NameProvider.currentMode == NameProvider.DEOBFUSCATION_MODE) { logFile = NameProvider.npLog; } else if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { logFile = NameProvider.roLog; } if (logFile != null) { FileWriter writer = null; try { writer = new FileWriter(logFile); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { } } } } if (NameProvider.currentMode == NameProvider.DEOBFUSCATION_MODE) { for (File f : NameProvider.obfFiles) { NameProvider.readSRGFile(f); } } else if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { for (File f : NameProvider.reobFiles) { NameProvider.readSRGFile(f); } } return newArgs; }
private static String[] parseNameSheetModeArgs(String[] args) throws IOException { if (args.length < 2) { return null; } if (args[0].equalsIgnoreCase("-searge")) { NameProvider.currentMode = NameProvider.DEOBFUSCATION_MODE; } else if (args[0].equalsIgnoreCase("-notch")) { NameProvider.currentMode = NameProvider.REOBFUSCATION_MODE; NameProvider.repackage = true; } else { return null; } String configFileName = args[1]; File configFile = new File(configFileName); if (!configFile.exists() || !configFile.isFile()) { throw new FileNotFoundException("Could not find config file " + configFileName); } String reobinput = null; String reoboutput = null; FileReader fileReader = null; BufferedReader reader = null; String[] newArgs = new String[4]; try { fileReader = new FileReader(configFile); reader = new BufferedReader(fileReader); String line = ""; while (line != null) { line = reader.readLine(); if ((line == null) || line.trim().startsWith("#")) { continue; } String[] defines = line.split("="); if (defines.length > 1) { defines[1] = line.substring(defines[0].length() + 1).trim(); defines[0] = defines[0].trim(); if (defines[0].equalsIgnoreCase("deob")) { File obfFile = new File(defines[1]); if (obfFile.isFile()) { NameProvider.obfFiles.add(obfFile); } else { throw new FileNotFoundException("Could not find obf file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("packages")) { File packagesFile = new File(defines[1]); if (packagesFile.isFile()) { NameProvider.obfFiles.add(packagesFile); } else { throw new FileNotFoundException("Could not find packages file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("classes")) { File classesFile = new File(defines[1]); if (classesFile.isFile()) { NameProvider.obfFiles.add(classesFile); } else { throw new FileNotFoundException("Could not find classes file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("methods")) { File methodsFile = new File(defines[1]); if (methodsFile.isFile()) { NameProvider.obfFiles.add(methodsFile); } else { throw new FileNotFoundException("Could not find methods file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("fields")) { File fieldsFile = new File(defines[1]); if (fieldsFile.isFile()) { NameProvider.obfFiles.add(fieldsFile); } else { throw new FileNotFoundException("Could not find fields file " + defines[1]); } } else if (defines[0].equalsIgnoreCase("reob")) { File reobFile = new File(defines[1]); if (reobFile.isFile()) { NameProvider.reobFiles.add(reobFile); } else { if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { throw new FileNotFoundException("Could not find reob file " + defines[1]); } } } else if (defines[0].equalsIgnoreCase("input")) { newArgs[0] = defines[1]; } else if (defines[0].equalsIgnoreCase("output")) { newArgs[1] = defines[1]; } else if (defines[0].equalsIgnoreCase("reobinput")) { reobinput = defines[1]; } else if (defines[0].equalsIgnoreCase("reoboutput")) { reoboutput = defines[1]; } else if (defines[0].equalsIgnoreCase("script")) { newArgs[2] = defines[1]; } else if (defines[0].equalsIgnoreCase("log")) { newArgs[3] = defines[1]; } else if (defines[0].equalsIgnoreCase("nplog")) { NameProvider.npLog = new File(defines[1]); if (NameProvider.npLog.exists() && !NameProvider.npLog.isFile()) { NameProvider.npLog = null; } } else if (defines[0].equalsIgnoreCase("rolog")) { NameProvider.roLog = new File(defines[1]); if (NameProvider.roLog.exists() && !NameProvider.roLog.isFile()) { NameProvider.roLog = null; } } else if (defines[0].equalsIgnoreCase("startindex")) { try { int start = Integer.parseInt(defines[1]); NameProvider.uniqueStart = start; } catch (NumberFormatException e) { throw new NumberFormatException("Invalid start index: " + defines[1]); } } else if (defines[0].equalsIgnoreCase("protectedpackage")) { NameProvider.protectedPackages.add(defines[1]); } else if (defines[0].equalsIgnoreCase("quiet")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.quiet = true; } } else if (defines[0].equalsIgnoreCase("oldhash")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.oldHash = true; } } else if (defines[0].equalsIgnoreCase("fixshadowed")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("0") || value.equalsIgnoreCase("f") || value.equalsIgnoreCase("n")) { NameProvider.fixShadowed = false; } } else if (defines[0].equalsIgnoreCase("incremental")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.repackage = false; } } else if (defines[0].equalsIgnoreCase("multipass")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("0") || value.equalsIgnoreCase("f") || value.equalsIgnoreCase("n")) { NameProvider.multipass = false; } } else if (defines[0].equalsIgnoreCase("verbose")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.verbose = true; } } else if (defines[0].equalsIgnoreCase("fullmap")) { String value = defines[1].substring(0, 1); if (value.equalsIgnoreCase("1") || value.equalsIgnoreCase("t") || value.equalsIgnoreCase("y")) { NameProvider.fullMap = true; } } else if (defines[0].equalsIgnoreCase("identifier")) { Version.setClassIdString(defines[1].trim()); } } } } finally { try { if (reader != null) { reader.close(); } if (fileReader != null) { fileReader.close(); } } catch (IOException e) { } } if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { newArgs[0] = reobinput; newArgs[1] = reoboutput; } if ((newArgs[0] == null) || (newArgs[1] == null) || (newArgs[2] == null) || (newArgs[3] == null)) { return null; } File logFile = null; if (NameProvider.currentMode == NameProvider.DEOBFUSCATION_MODE) { logFile = NameProvider.npLog; } else if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { logFile = NameProvider.roLog; } if (logFile != null) { FileWriter writer = null; try { writer = new FileWriter(logFile); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { } } } } <DeepExtract> if (NameProvider.currentMode == NameProvider.DEOBFUSCATION_MODE) { for (File f : NameProvider.obfFiles) { NameProvider.readSRGFile(f); } } else if (NameProvider.currentMode == NameProvider.REOBFUSCATION_MODE) { for (File f : NameProvider.reobFiles) { NameProvider.readSRGFile(f); } } </DeepExtract> return newArgs; }
Retroguard
positive
440,905
public Criteria andSurgeryweekNotIn(List<String> values) { if (values == null) { throw new RuntimeException("Value for " + "surgeryweek" + " cannot be null"); } criteria.add(new Criterion("surgeryWeek not in", values)); return (Criteria) this; }
public Criteria andSurgeryweekNotIn(List<String> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "surgeryweek" + " cannot be null"); } criteria.add(new Criterion("surgeryWeek not in", values)); </DeepExtract> return (Criteria) this; }
Hospital
positive
440,906
protected void onCreate(Bundle saveBundle) { super.onCreate(saveBundle); activityDeviceCheckBinding = DataBindingUtil.setContentView(this, R.layout.activity_device_check); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ArrayList<TutorialData> tutorialDataList = new ArrayList<>(); tutorialDataList.add(new TutorialData(R.drawable.tutorial1, getString(R.string.device_check1), getString(R.string.device_check11), getString(R.string.device_check12), 0)); tutorialDataList.add(new TutorialData(0, getString(R.string.device_check2), "", "", 1)); tutorialDataList.add(new TutorialData(R.drawable.device_check3, getString(R.string.device_check3), "", "", 2)); tutorialDataList.add(new TutorialData(R.drawable.device_check4, getString(R.string.device_check4), "", getString(R.string.device_check42), 3)); return tutorialDataList; fragments = new ArrayList<>(); issues = new ArrayList<>(); FragmentAdapter adapter = new FragmentAdapter(getSupportFragmentManager()); for (int i = 0; i < dataList.size(); i++) { DeviceCheckFragment fragment = DeviceCheckFragment.newInstance(dataList.get(i)); fragments.add(fragment); adapter.addFragment(fragment, "tutorial" + (i + 1)); } activityDeviceCheckBinding.viewPager.setAdapter(adapter); activityDeviceCheckBinding.viewPager.setOffscreenPageLimit(4); activityDeviceCheckBinding.viewPager.setSwipeEnabled(false); }
protected void onCreate(Bundle saveBundle) { super.onCreate(saveBundle); activityDeviceCheckBinding = DataBindingUtil.setContentView(this, R.layout.activity_device_check); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); <DeepExtract> ArrayList<TutorialData> tutorialDataList = new ArrayList<>(); tutorialDataList.add(new TutorialData(R.drawable.tutorial1, getString(R.string.device_check1), getString(R.string.device_check11), getString(R.string.device_check12), 0)); tutorialDataList.add(new TutorialData(0, getString(R.string.device_check2), "", "", 1)); tutorialDataList.add(new TutorialData(R.drawable.device_check3, getString(R.string.device_check3), "", "", 2)); tutorialDataList.add(new TutorialData(R.drawable.device_check4, getString(R.string.device_check4), "", getString(R.string.device_check42), 3)); return tutorialDataList; </DeepExtract> fragments = new ArrayList<>(); issues = new ArrayList<>(); FragmentAdapter adapter = new FragmentAdapter(getSupportFragmentManager()); for (int i = 0; i < dataList.size(); i++) { DeviceCheckFragment fragment = DeviceCheckFragment.newInstance(dataList.get(i)); fragments.add(fragment); adapter.addFragment(fragment, "tutorial" + (i + 1)); } activityDeviceCheckBinding.viewPager.setAdapter(adapter); activityDeviceCheckBinding.viewPager.setOffscreenPageLimit(4); activityDeviceCheckBinding.viewPager.setSwipeEnabled(false); }
cgm-scanner
positive
440,907
public static CenterListActionSheetFragment newCenterListActionSheetFragmentInstance(FragmentActivity activity, String tag, String title, int titleColor, String cancelTitle, int cancelTitleColor, String[] items, OnItemClickListener onItemClickListener, ActionSheetFragment.OnCancelListener onCancelListener) { CenterListActionSheetFragment fragment = new CenterListActionSheetFragment(); Bundle bundle = new Bundle(); bundle.putString("title", title); bundle.putInt("titleColor", titleColor); bundle.putString("cancelTitle", cancelTitle); bundle.putInt("cancelTitleColor", cancelTitleColor); bundle.putStringArray("items", items); fragment.setArguments(bundle); this.onItemClickListener = onItemClickListener; fragment.setOnCancelListener(onCancelListener); fragment.show(activity, tag); return fragment; }
public static CenterListActionSheetFragment newCenterListActionSheetFragmentInstance(FragmentActivity activity, String tag, String title, int titleColor, String cancelTitle, int cancelTitleColor, String[] items, OnItemClickListener onItemClickListener, ActionSheetFragment.OnCancelListener onCancelListener) { CenterListActionSheetFragment fragment = new CenterListActionSheetFragment(); Bundle bundle = new Bundle(); bundle.putString("title", title); bundle.putInt("titleColor", titleColor); bundle.putString("cancelTitle", cancelTitle); bundle.putInt("cancelTitleColor", cancelTitleColor); bundle.putStringArray("items", items); fragment.setArguments(bundle); <DeepExtract> this.onItemClickListener = onItemClickListener; </DeepExtract> fragment.setOnCancelListener(onCancelListener); fragment.show(activity, tag); return fragment; }
AndroidCommonLibrary
positive
440,908
private void handleComprehension(exprType e, String scopeName, java.util.List<comprehensionType> generators, exprType elt, exprType value) { boolean isGenerator = e instanceof GeneratorExp; boolean needsTmp = !isGenerator; comprehensionType outermost = generators.get(0); if (outermost.iter instanceof BoolOp) { for (exprType expr : ((BoolOp) outermost.iter).values) { this.visitExpr(expr); } } else if (outermost.iter instanceof BinOp) { BinOp b = (BinOp) outermost.iter; this.visitExpr(b.left); this.visitExpr(b.right); } else if (outermost.iter instanceof UnaryOp) { this.visitExpr(((UnaryOp) outermost.iter).operand); } else if (outermost.iter instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) outermost.iter; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, outermost.iter, outermost.iter.lineno, outermost.iter.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(outermost.iter); } else if (outermost.iter instanceof IfExp) { IfExp ifExp = (IfExp) outermost.iter; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (outermost.iter instanceof Dict) { Dict d = (Dict) outermost.iter; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (outermost.iter instanceof Set) { for (exprType expr : ((Set) outermost.iter).elts) { this.visitExpr(expr); } } else if (outermost.iter instanceof GeneratorExp) { this.visitGenexp(outermost.iter); } else if (outermost.iter instanceof ListComp) { this.visitListcomp(outermost.iter); } else if (outermost.iter instanceof SetComp) { this.visitSetcomp(outermost.iter); } else if (outermost.iter instanceof DictComp) { this.visitDictcomp(outermost.iter); } else if (outermost.iter instanceof Yield) { Yield y = (Yield) outermost.iter; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (outermost.iter instanceof YieldFrom) { this.visitExpr(((YieldFrom) outermost.iter).value); this.stCur.steGenerator = true; } else if (outermost.iter instanceof Await) { this.visitExpr(((Await) outermost.iter).value); this.stCur.steGenerator = true; } else if (outermost.iter instanceof Compare) { Compare c = (Compare) outermost.iter; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (outermost.iter instanceof Call) { Call c = (Call) outermost.iter; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (outermost.iter instanceof Num || outermost.iter instanceof Str || outermost.iter instanceof Bytes || outermost.iter instanceof Ellipsis || outermost.iter instanceof NameConstant) { return; } else if (outermost.iter instanceof Attribute) { this.visitExpr(((Attribute) outermost.iter).value); } else if (outermost.iter instanceof Subscript) { Subscript subs = (Subscript) outermost.iter; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (outermost.iter instanceof Starred) { this.visitExpr(((Starred) outermost.iter).value); } else if (outermost.iter instanceof Name) { Name n = (Name) outermost.iter; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (outermost.iter instanceof List) { List l = (List) outermost.iter; if (l.elts != null) { for (exprType expr : ((List) outermost.iter).elts) { this.visitExpr(expr); } } } else if (outermost.iter instanceof Tuple) { Tuple t = (Tuple) outermost.iter; if (t.elts != null) { for (exprType expr : ((Tuple) outermost.iter).elts) { this.visitExpr(expr); } } } if (scopeName == null) { throw new PyExceptions(ErrorType.SYMTABLE_ERROR, "scope name is null"); } PySTEntryObject prev = null, ste; ste = new PySTEntryObject(this, scopeName, BlockType.FunctionBlock, e, e.lineno, e.col_offset); this.stStack.append(ste); prev = this.stCur; this.stCur = ste; if (BlockType.FunctionBlock == BlockType.ModuleBlock) { this.stGlobal = this.stCur.steSymbols; } if (prev != null) { prev.steChildren.append(ste); } this.stCur.steGenerator = isGenerator; String id = String.valueOf(0); this.addDef(id, DEF_PARAM); if (needsTmp) { this.newTmpname(); } if (outermost.target instanceof BoolOp) { for (exprType expr : ((BoolOp) outermost.target).values) { this.visitExpr(expr); } } else if (outermost.target instanceof BinOp) { BinOp b = (BinOp) outermost.target; this.visitExpr(b.left); this.visitExpr(b.right); } else if (outermost.target instanceof UnaryOp) { this.visitExpr(((UnaryOp) outermost.target).operand); } else if (outermost.target instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) outermost.target; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, outermost.target, outermost.target.lineno, outermost.target.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(outermost.target); } else if (outermost.target instanceof IfExp) { IfExp ifExp = (IfExp) outermost.target; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (outermost.target instanceof Dict) { Dict d = (Dict) outermost.target; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (outermost.target instanceof Set) { for (exprType expr : ((Set) outermost.target).elts) { this.visitExpr(expr); } } else if (outermost.target instanceof GeneratorExp) { this.visitGenexp(outermost.target); } else if (outermost.target instanceof ListComp) { this.visitListcomp(outermost.target); } else if (outermost.target instanceof SetComp) { this.visitSetcomp(outermost.target); } else if (outermost.target instanceof DictComp) { this.visitDictcomp(outermost.target); } else if (outermost.target instanceof Yield) { Yield y = (Yield) outermost.target; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (outermost.target instanceof YieldFrom) { this.visitExpr(((YieldFrom) outermost.target).value); this.stCur.steGenerator = true; } else if (outermost.target instanceof Await) { this.visitExpr(((Await) outermost.target).value); this.stCur.steGenerator = true; } else if (outermost.target instanceof Compare) { Compare c = (Compare) outermost.target; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (outermost.target instanceof Call) { Call c = (Call) outermost.target; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (outermost.target instanceof Num || outermost.target instanceof Str || outermost.target instanceof Bytes || outermost.target instanceof Ellipsis || outermost.target instanceof NameConstant) { return; } else if (outermost.target instanceof Attribute) { this.visitExpr(((Attribute) outermost.target).value); } else if (outermost.target instanceof Subscript) { Subscript subs = (Subscript) outermost.target; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (outermost.target instanceof Starred) { this.visitExpr(((Starred) outermost.target).value); } else if (outermost.target instanceof Name) { Name n = (Name) outermost.target; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (outermost.target instanceof List) { List l = (List) outermost.target; if (l.elts != null) { for (exprType expr : ((List) outermost.target).elts) { this.visitExpr(expr); } } } else if (outermost.target instanceof Tuple) { Tuple t = (Tuple) outermost.target; if (t.elts != null) { for (exprType expr : ((Tuple) outermost.target).elts) { this.visitExpr(expr); } } } if (outermost.ifs != null) { for (exprType expr : outermost.ifs) { this.visitExpr(expr); } } for (int i = 1; i < generators.size(); i++) { this.visitComprehension(generators.get(i)); } if (value != null) { this.visitExpr(value); } if (elt instanceof BoolOp) { for (exprType expr : ((BoolOp) elt).values) { this.visitExpr(expr); } } else if (elt instanceof BinOp) { BinOp b = (BinOp) elt; this.visitExpr(b.left); this.visitExpr(b.right); } else if (elt instanceof UnaryOp) { this.visitExpr(((UnaryOp) elt).operand); } else if (elt instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) elt; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, elt, elt.lineno, elt.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(elt); } else if (elt instanceof IfExp) { IfExp ifExp = (IfExp) elt; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (elt instanceof Dict) { Dict d = (Dict) elt; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (elt instanceof Set) { for (exprType expr : ((Set) elt).elts) { this.visitExpr(expr); } } else if (elt instanceof GeneratorExp) { this.visitGenexp(elt); } else if (elt instanceof ListComp) { this.visitListcomp(elt); } else if (elt instanceof SetComp) { this.visitSetcomp(elt); } else if (elt instanceof DictComp) { this.visitDictcomp(elt); } else if (elt instanceof Yield) { Yield y = (Yield) elt; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (elt instanceof YieldFrom) { this.visitExpr(((YieldFrom) elt).value); this.stCur.steGenerator = true; } else if (elt instanceof Await) { this.visitExpr(((Await) elt).value); this.stCur.steGenerator = true; } else if (elt instanceof Compare) { Compare c = (Compare) elt; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (elt instanceof Call) { Call c = (Call) elt; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (elt instanceof Num || elt instanceof Str || elt instanceof Bytes || elt instanceof Ellipsis || elt instanceof NameConstant) { return; } else if (elt instanceof Attribute) { this.visitExpr(((Attribute) elt).value); } else if (elt instanceof Subscript) { Subscript subs = (Subscript) elt; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (elt instanceof Starred) { this.visitExpr(((Starred) elt).value); } else if (elt instanceof Name) { Name n = (Name) elt; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (elt instanceof List) { List l = (List) elt; if (l.elts != null) { for (exprType expr : ((List) elt).elts) { this.visitExpr(expr); } } } else if (elt instanceof Tuple) { Tuple t = (Tuple) elt; if (t.elts != null) { for (exprType expr : ((Tuple) elt).elts) { this.visitExpr(expr); } } } int size; this.stCur = null; size = this.stStack.getSize(); if (size > 0) { this.stStack.setSlice(size - 1, size, null); if (--size > 0) { this.stCur = (PySTEntryObject) this.stStack.getItem(size - 1); } } }
private void handleComprehension(exprType e, String scopeName, java.util.List<comprehensionType> generators, exprType elt, exprType value) { boolean isGenerator = e instanceof GeneratorExp; boolean needsTmp = !isGenerator; comprehensionType outermost = generators.get(0); if (outermost.iter instanceof BoolOp) { for (exprType expr : ((BoolOp) outermost.iter).values) { this.visitExpr(expr); } } else if (outermost.iter instanceof BinOp) { BinOp b = (BinOp) outermost.iter; this.visitExpr(b.left); this.visitExpr(b.right); } else if (outermost.iter instanceof UnaryOp) { this.visitExpr(((UnaryOp) outermost.iter).operand); } else if (outermost.iter instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) outermost.iter; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, outermost.iter, outermost.iter.lineno, outermost.iter.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(outermost.iter); } else if (outermost.iter instanceof IfExp) { IfExp ifExp = (IfExp) outermost.iter; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (outermost.iter instanceof Dict) { Dict d = (Dict) outermost.iter; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (outermost.iter instanceof Set) { for (exprType expr : ((Set) outermost.iter).elts) { this.visitExpr(expr); } } else if (outermost.iter instanceof GeneratorExp) { this.visitGenexp(outermost.iter); } else if (outermost.iter instanceof ListComp) { this.visitListcomp(outermost.iter); } else if (outermost.iter instanceof SetComp) { this.visitSetcomp(outermost.iter); } else if (outermost.iter instanceof DictComp) { this.visitDictcomp(outermost.iter); } else if (outermost.iter instanceof Yield) { Yield y = (Yield) outermost.iter; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (outermost.iter instanceof YieldFrom) { this.visitExpr(((YieldFrom) outermost.iter).value); this.stCur.steGenerator = true; } else if (outermost.iter instanceof Await) { this.visitExpr(((Await) outermost.iter).value); this.stCur.steGenerator = true; } else if (outermost.iter instanceof Compare) { Compare c = (Compare) outermost.iter; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (outermost.iter instanceof Call) { Call c = (Call) outermost.iter; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (outermost.iter instanceof Num || outermost.iter instanceof Str || outermost.iter instanceof Bytes || outermost.iter instanceof Ellipsis || outermost.iter instanceof NameConstant) { return; } else if (outermost.iter instanceof Attribute) { this.visitExpr(((Attribute) outermost.iter).value); } else if (outermost.iter instanceof Subscript) { Subscript subs = (Subscript) outermost.iter; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (outermost.iter instanceof Starred) { this.visitExpr(((Starred) outermost.iter).value); } else if (outermost.iter instanceof Name) { Name n = (Name) outermost.iter; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (outermost.iter instanceof List) { List l = (List) outermost.iter; if (l.elts != null) { for (exprType expr : ((List) outermost.iter).elts) { this.visitExpr(expr); } } } else if (outermost.iter instanceof Tuple) { Tuple t = (Tuple) outermost.iter; if (t.elts != null) { for (exprType expr : ((Tuple) outermost.iter).elts) { this.visitExpr(expr); } } } if (scopeName == null) { throw new PyExceptions(ErrorType.SYMTABLE_ERROR, "scope name is null"); } PySTEntryObject prev = null, ste; ste = new PySTEntryObject(this, scopeName, BlockType.FunctionBlock, e, e.lineno, e.col_offset); this.stStack.append(ste); prev = this.stCur; this.stCur = ste; if (BlockType.FunctionBlock == BlockType.ModuleBlock) { this.stGlobal = this.stCur.steSymbols; } if (prev != null) { prev.steChildren.append(ste); } this.stCur.steGenerator = isGenerator; String id = String.valueOf(0); this.addDef(id, DEF_PARAM); if (needsTmp) { this.newTmpname(); } if (outermost.target instanceof BoolOp) { for (exprType expr : ((BoolOp) outermost.target).values) { this.visitExpr(expr); } } else if (outermost.target instanceof BinOp) { BinOp b = (BinOp) outermost.target; this.visitExpr(b.left); this.visitExpr(b.right); } else if (outermost.target instanceof UnaryOp) { this.visitExpr(((UnaryOp) outermost.target).operand); } else if (outermost.target instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) outermost.target; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, outermost.target, outermost.target.lineno, outermost.target.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(outermost.target); } else if (outermost.target instanceof IfExp) { IfExp ifExp = (IfExp) outermost.target; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (outermost.target instanceof Dict) { Dict d = (Dict) outermost.target; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (outermost.target instanceof Set) { for (exprType expr : ((Set) outermost.target).elts) { this.visitExpr(expr); } } else if (outermost.target instanceof GeneratorExp) { this.visitGenexp(outermost.target); } else if (outermost.target instanceof ListComp) { this.visitListcomp(outermost.target); } else if (outermost.target instanceof SetComp) { this.visitSetcomp(outermost.target); } else if (outermost.target instanceof DictComp) { this.visitDictcomp(outermost.target); } else if (outermost.target instanceof Yield) { Yield y = (Yield) outermost.target; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (outermost.target instanceof YieldFrom) { this.visitExpr(((YieldFrom) outermost.target).value); this.stCur.steGenerator = true; } else if (outermost.target instanceof Await) { this.visitExpr(((Await) outermost.target).value); this.stCur.steGenerator = true; } else if (outermost.target instanceof Compare) { Compare c = (Compare) outermost.target; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (outermost.target instanceof Call) { Call c = (Call) outermost.target; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (outermost.target instanceof Num || outermost.target instanceof Str || outermost.target instanceof Bytes || outermost.target instanceof Ellipsis || outermost.target instanceof NameConstant) { return; } else if (outermost.target instanceof Attribute) { this.visitExpr(((Attribute) outermost.target).value); } else if (outermost.target instanceof Subscript) { Subscript subs = (Subscript) outermost.target; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (outermost.target instanceof Starred) { this.visitExpr(((Starred) outermost.target).value); } else if (outermost.target instanceof Name) { Name n = (Name) outermost.target; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (outermost.target instanceof List) { List l = (List) outermost.target; if (l.elts != null) { for (exprType expr : ((List) outermost.target).elts) { this.visitExpr(expr); } } } else if (outermost.target instanceof Tuple) { Tuple t = (Tuple) outermost.target; if (t.elts != null) { for (exprType expr : ((Tuple) outermost.target).elts) { this.visitExpr(expr); } } } if (outermost.ifs != null) { for (exprType expr : outermost.ifs) { this.visitExpr(expr); } } for (int i = 1; i < generators.size(); i++) { this.visitComprehension(generators.get(i)); } if (value != null) { this.visitExpr(value); } if (elt instanceof BoolOp) { for (exprType expr : ((BoolOp) elt).values) { this.visitExpr(expr); } } else if (elt instanceof BinOp) { BinOp b = (BinOp) elt; this.visitExpr(b.left); this.visitExpr(b.right); } else if (elt instanceof UnaryOp) { this.visitExpr(((UnaryOp) elt).operand); } else if (elt instanceof Lambda) { lambda = lambda == null ? lambda : "lambda"; Lambda l = (Lambda) elt; if (l.args.defaults != null) { for (exprType expr : l.args.defaults) { this.visitExpr(expr); } } if (l.args.kw_defaults != null) { for (exprType expr : l.args.kw_defaults) { if (expr == null) continue; this.visitExpr(expr); } } this.enterBlock(lambda, BlockType.FunctionBlock, elt, elt.lineno, elt.col_offset); this.visitArguments(l.args); this.visitExpr(l.body); this.exitBlock(elt); } else if (elt instanceof IfExp) { IfExp ifExp = (IfExp) elt; this.visitExpr(ifExp.test); this.visitExpr(ifExp.body); this.visitExpr(ifExp.orelse); } else if (elt instanceof Dict) { Dict d = (Dict) elt; if (d.keys != null) { for (exprType expr : d.keys) { if (expr == null) continue; this.visitExpr(expr); } } if (d.values != null) { for (exprType expr : d.values) { this.visitExpr(expr); } } } else if (elt instanceof Set) { for (exprType expr : ((Set) elt).elts) { this.visitExpr(expr); } } else if (elt instanceof GeneratorExp) { this.visitGenexp(elt); } else if (elt instanceof ListComp) { this.visitListcomp(elt); } else if (elt instanceof SetComp) { this.visitSetcomp(elt); } else if (elt instanceof DictComp) { this.visitDictcomp(elt); } else if (elt instanceof Yield) { Yield y = (Yield) elt; if (y.value != null) { this.visitExpr(y.value); } this.stCur.steGenerator = true; } else if (elt instanceof YieldFrom) { this.visitExpr(((YieldFrom) elt).value); this.stCur.steGenerator = true; } else if (elt instanceof Await) { this.visitExpr(((Await) elt).value); this.stCur.steGenerator = true; } else if (elt instanceof Compare) { Compare c = (Compare) elt; this.visitExpr(c.left); for (exprType expr : c.comparators) { this.visitExpr(expr); } } else if (elt instanceof Call) { Call c = (Call) elt; this.visitExpr(c.func); if (c.args != null) { for (exprType expr : c.args) { this.visitExpr(expr); } } if (c.keywords != null) { for (keywordType k : c.keywords) { if (k == null) continue; this.visitKeyword(k); } } } else if (elt instanceof Num || elt instanceof Str || elt instanceof Bytes || elt instanceof Ellipsis || elt instanceof NameConstant) { return; } else if (elt instanceof Attribute) { this.visitExpr(((Attribute) elt).value); } else if (elt instanceof Subscript) { Subscript subs = (Subscript) elt; this.visitExpr(subs.value); this.visitSlice(subs.slice); } else if (elt instanceof Starred) { this.visitExpr(((Starred) elt).value); } else if (elt instanceof Name) { Name n = (Name) elt; this.addDef(n.id, n.ctx == expr_contextType.Load ? USE : DEF_LOCAL); if (n.ctx == expr_contextType.Load && n.id.equals("super")) { __class__ = __class__ != null ? __class__ : "__class__"; this.addDef(__class__, USE); } } else if (elt instanceof List) { List l = (List) elt; if (l.elts != null) { for (exprType expr : ((List) elt).elts) { this.visitExpr(expr); } } } else if (elt instanceof Tuple) { Tuple t = (Tuple) elt; if (t.elts != null) { for (exprType expr : ((Tuple) elt).elts) { this.visitExpr(expr); } } } <DeepExtract> int size; this.stCur = null; size = this.stStack.getSize(); if (size > 0) { this.stStack.setSlice(size - 1, size, null); if (--size > 0) { this.stCur = (PySTEntryObject) this.stStack.getItem(size - 1); } } </DeepExtract> }
JPython
positive
440,910
@Override public Collection<V> values() { if (!initialized.get()) { throw new CacheException("Illegal state. Cache for " + clientId + " not initialized yet"); } return readOnly ? Collections.unmodifiableCollection(localCache.values()) : localCache.values(); }
@Override public Collection<V> values() { <DeepExtract> if (!initialized.get()) { throw new CacheException("Illegal state. Cache for " + clientId + " not initialized yet"); } </DeepExtract> return readOnly ? Collections.unmodifiableCollection(localCache.values()) : localCache.values(); }
kcache
positive
440,913
public void show() { Stage stage = new Stage(); FXMLLoader loader = loaderProvider.get(); Parent root = ViewFxml.ABOUT.loadNode(loader, i18nManager); AboutController controller = loader.getController(); controller.initialise(stage); stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.UNDECORATED); stage.setScene(new Scene(root)); stage.showAndWait(); }
public void show() { Stage stage = new Stage(); FXMLLoader loader = loaderProvider.get(); Parent root = ViewFxml.ABOUT.loadNode(loader, i18nManager); AboutController controller = loader.getController(); controller.initialise(stage); <DeepExtract> stage.initModality(Modality.APPLICATION_MODAL); stage.initStyle(StageStyle.UNDECORATED); stage.setScene(new Scene(root)); stage.showAndWait(); </DeepExtract> }
Santulator
positive
440,914
@Override public SemanticNode deepClone() { TerminalNode clone = new TerminalNode(this.getNodeID(), this.needToMerge(), this.getNodeType(), this.getDisplayName(), this.getQualifiedName(), this.getOriginalSignature(), this.getComment(), this.getAnnotations(), this.getModifiers(), this.getBody(), this.getRange()); clone.followingEOL = this.followingEOL; return clone; }
@Override public SemanticNode deepClone() { <DeepExtract> TerminalNode clone = new TerminalNode(this.getNodeID(), this.needToMerge(), this.getNodeType(), this.getDisplayName(), this.getQualifiedName(), this.getOriginalSignature(), this.getComment(), this.getAnnotations(), this.getModifiers(), this.getBody(), this.getRange()); clone.followingEOL = this.followingEOL; return clone; </DeepExtract> }
IntelliMerge
positive
440,915
public static void main(String[] args) { String testID = "com/aspose/pdf/examples/AsposePdf/Conversion/htmltopdf/"; String dataDir = Utils.getDataDir(testID); String outputDir = Utils.getOutDir(testID); System.out.println("============================"); System.out.println("Example renderHTMLwithSVGData start"); renderHTMLwithSVGData(dataDir, outputDir); System.out.println("Example renderHTMLwithSVGData end"); System.out.println("============================"); System.out.println("Example convertHTMLFileToPDF start"); convertHTMLFileToPDF(dataDir, outputDir); System.out.println("Example convertHTMLFileToPDF end"); System.out.println("============================"); System.out.println("Example renderContentToSamePage start"); renderContentToSamePage(dataDir, outputDir); System.out.println("Example renderContentToSamePage end"); }
public static void main(String[] args) { <DeepExtract> String testID = "com/aspose/pdf/examples/AsposePdf/Conversion/htmltopdf/"; String dataDir = Utils.getDataDir(testID); String outputDir = Utils.getOutDir(testID); System.out.println("============================"); System.out.println("Example renderHTMLwithSVGData start"); renderHTMLwithSVGData(dataDir, outputDir); System.out.println("Example renderHTMLwithSVGData end"); System.out.println("============================"); System.out.println("Example convertHTMLFileToPDF start"); convertHTMLFileToPDF(dataDir, outputDir); System.out.println("Example convertHTMLFileToPDF end"); System.out.println("============================"); System.out.println("Example renderContentToSamePage start"); renderContentToSamePage(dataDir, outputDir); System.out.println("Example renderContentToSamePage end"); </DeepExtract> }
Aspose.PDF-for-Java
positive
440,916
public void setLogInfo(UnaLog log, OperLog operLog) { operLog.setType(log.type().getText()); operLog.setTitle(log.title()); Map<String, String[]> map = ServletUtils.getRequest().getParameterMap(); String params = JSONObject.toJSONString(map); operLog.setParams(StringUtils.substring(params, 0, 2000)); }
public void setLogInfo(UnaLog log, OperLog operLog) { operLog.setType(log.type().getText()); operLog.setTitle(log.title()); <DeepExtract> Map<String, String[]> map = ServletUtils.getRequest().getParameterMap(); String params = JSONObject.toJSONString(map); operLog.setParams(StringUtils.substring(params, 0, 2000)); </DeepExtract> }
UnaBoot
positive
440,917
public void onRestoreInstanceState(Parcelable parcelable) { Bundle bundle = (Bundle) parcelable; super.onRestoreInstanceState(bundle.getParcelable(STATE_PARENT)); int i2; int i3; if (this.mOrientation) { i3 = this.mBarLength + this.mBarPointerHaloRadius; i2 = this.mBarThickness; } else { i3 = this.mBarThickness; i2 = this.mBarLength + this.mBarPointerHaloRadius; } Color.colorToHSV(Color.HSVToColor(bundle.getFloatArray(STATE_COLOR)), this.mHSVColor); LinearGradient linearGradient = new LinearGradient((float) this.mBarPointerHaloRadius, 0.0f, (float) i3, (float) i2, new int[] { -1, Color.HSVToColor(bundle.getFloatArray(STATE_COLOR)) }, null, TileMode.CLAMP); this.shader = linearGradient; this.mBarPaint.setShader(this.shader); calculateColor(this.mBarPointerPosition); this.mBarPointerPaint.setColor(this.mColor); if (this.mPicker != null) { this.mPicker.setNewCenterColor(this.mColor); if (this.mPicker.hasValueBar()) { this.mPicker.changeValueBarColor(this.mColor); } else if (this.mPicker.hasOpacityBar()) { this.mPicker.changeOpacityBarColor(this.mColor); } } invalidate(); this.mBarPointerPosition = Math.round(this.mSatToPosFactor * bundle.getFloat(STATE_SATURATION)) + this.mBarPointerHaloRadius; calculateColor(this.mBarPointerPosition); this.mBarPointerPaint.setColor(this.mColor); if (this.mPicker != null) { this.mPicker.setNewCenterColor(this.mColor); this.mPicker.changeValueBarColor(this.mColor); this.mPicker.changeOpacityBarColor(this.mColor); } invalidate(); }
public void onRestoreInstanceState(Parcelable parcelable) { Bundle bundle = (Bundle) parcelable; super.onRestoreInstanceState(bundle.getParcelable(STATE_PARENT)); int i2; int i3; if (this.mOrientation) { i3 = this.mBarLength + this.mBarPointerHaloRadius; i2 = this.mBarThickness; } else { i3 = this.mBarThickness; i2 = this.mBarLength + this.mBarPointerHaloRadius; } Color.colorToHSV(Color.HSVToColor(bundle.getFloatArray(STATE_COLOR)), this.mHSVColor); LinearGradient linearGradient = new LinearGradient((float) this.mBarPointerHaloRadius, 0.0f, (float) i3, (float) i2, new int[] { -1, Color.HSVToColor(bundle.getFloatArray(STATE_COLOR)) }, null, TileMode.CLAMP); this.shader = linearGradient; this.mBarPaint.setShader(this.shader); calculateColor(this.mBarPointerPosition); this.mBarPointerPaint.setColor(this.mColor); if (this.mPicker != null) { this.mPicker.setNewCenterColor(this.mColor); if (this.mPicker.hasValueBar()) { this.mPicker.changeValueBarColor(this.mColor); } else if (this.mPicker.hasOpacityBar()) { this.mPicker.changeOpacityBarColor(this.mColor); } } invalidate(); <DeepExtract> this.mBarPointerPosition = Math.round(this.mSatToPosFactor * bundle.getFloat(STATE_SATURATION)) + this.mBarPointerHaloRadius; calculateColor(this.mBarPointerPosition); this.mBarPointerPaint.setColor(this.mColor); if (this.mPicker != null) { this.mPicker.setNewCenterColor(this.mColor); this.mPicker.changeValueBarColor(this.mColor); this.mPicker.changeOpacityBarColor(this.mColor); } invalidate(); </DeepExtract> }
Photo-Mixer-Poto-Blender
positive
440,918
@Override public void setId(Integer id) { this.providerScheduleId = id; }
@Override public void setId(Integer id) { <DeepExtract> this.providerScheduleId = id; </DeepExtract> }
openmrs-module-appointmentscheduling
positive
440,919
public void diskScoringState() { RequestList state = new RequestList(Arrays.asList(diskScorer.ejectRequest(elevator.getHeight()), swerve.trajectoryRequest(new Translation2d(-24.0, 0.0), swerve.getPose().getRotation().getUnboundedDegrees(), 36.0)), false); setActiveRequests(new RequestList(Arrays.asList(state), false)); setQueuedRequests(new RequestList()); }
public void diskScoringState() { RequestList state = new RequestList(Arrays.asList(diskScorer.ejectRequest(elevator.getHeight()), swerve.trajectoryRequest(new Translation2d(-24.0, 0.0), swerve.getPose().getRotation().getUnboundedDegrees(), 36.0)), false); <DeepExtract> setActiveRequests(new RequestList(Arrays.asList(state), false)); setQueuedRequests(new RequestList()); </DeepExtract> }
2019DeepSpace
positive
440,922
public void actionPerformed(java.awt.event.ActionEvent evt) { txt_TenNhanVien.setText(""); date_ngaySinh.setDate(null); txt_DiaChi.setText(""); txt_SDT.setText(""); txt_Email.setText(""); txt_TaiKhoan.setText(""); txt_MatKhau.setText(""); bgGioiTinh.clearSelection(); lbl_ngaySinh_Hint.setVisible(false); lbl_sdt_Hint.setVisible(false); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> txt_TenNhanVien.setText(""); date_ngaySinh.setDate(null); txt_DiaChi.setText(""); txt_SDT.setText(""); txt_Email.setText(""); txt_TaiKhoan.setText(""); txt_MatKhau.setText(""); bgGioiTinh.clearSelection(); lbl_ngaySinh_Hint.setVisible(false); lbl_sdt_Hint.setVisible(false); </DeepExtract> }
StoreManager
positive
440,923
@Override public Event doApplyZSetListPack(RedisInputStream in, int version, byte[] key, int type, ContextKeyValuePair context) throws IOException { escaper.encode(key, out); delimiter(out); if (context.getExpiredType() != NONE) { escaper.encode(context.getExpiredType().toString().getBytes(), out); delimiter(out); escaper.encode(context.getExpiredValue(), out); delimiter(out); } version = getVersion(version); try (DumpRawByteListener listener = new DumpRawByteListener(replicator, version, out, escaper)) { listener.write((byte) type); super.doApplyZSetListPack(in, version, key, type, context); } Outputs.write('\n', out); return context.valueOf(new DummyKeyValuePair()); }
@Override public Event doApplyZSetListPack(RedisInputStream in, int version, byte[] key, int type, ContextKeyValuePair context) throws IOException { escaper.encode(key, out); delimiter(out); <DeepExtract> if (context.getExpiredType() != NONE) { escaper.encode(context.getExpiredType().toString().getBytes(), out); delimiter(out); escaper.encode(context.getExpiredValue(), out); delimiter(out); } </DeepExtract> version = getVersion(version); try (DumpRawByteListener listener = new DumpRawByteListener(replicator, version, out, escaper)) { listener.write((byte) type); super.doApplyZSetListPack(in, version, key, type, context); } Outputs.write('\n', out); return context.valueOf(new DummyKeyValuePair()); }
redis-rdb-cli
positive
440,925
@Override public void uploadFile(Path tempFileAbsolutePath, String objectName) { try { if (!PathUtil.exists(tempFileAbsolutePath, false)) { return; } baseOssService.printOperation(getPlatform().getKey(), "upload", objectName); PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, objectName, tempFileAbsolutePath.toFile()); PutObjectResult putObjectResult = this.cosClient.putObject(putObjectRequest); if (putObjectResult.getRequestId() != null) { baseOssService.onUploadSuccess(objectName, tempFileAbsolutePath); } } catch (CosClientException e) { log.error(e.getMessage(), e); } }
@Override public void uploadFile(Path tempFileAbsolutePath, String objectName) { <DeepExtract> try { if (!PathUtil.exists(tempFileAbsolutePath, false)) { return; } baseOssService.printOperation(getPlatform().getKey(), "upload", objectName); PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, objectName, tempFileAbsolutePath.toFile()); PutObjectResult putObjectResult = this.cosClient.putObject(putObjectRequest); if (putObjectResult.getRequestId() != null) { baseOssService.onUploadSuccess(objectName, tempFileAbsolutePath); } } catch (CosClientException e) { log.error(e.getMessage(), e); } </DeepExtract> }
jmal-cloud-server
positive
440,929
@Override public void removeEnvVariable(String appName, String envKey) throws HerokuServiceException { if (!isValid()) { throw new HerokuServiceException(HerokuServiceException.INVALID_SESSION, "The session is invalid", null); } try { api.removeConfig(appName, envKey); } catch (RequestFailedException e) { throw checkException(e); } }
@Override public void removeEnvVariable(String appName, String envKey) throws HerokuServiceException { <DeepExtract> if (!isValid()) { throw new HerokuServiceException(HerokuServiceException.INVALID_SESSION, "The session is invalid", null); } </DeepExtract> try { api.removeConfig(appName, envKey); } catch (RequestFailedException e) { throw checkException(e); } }
heroku-eclipse-plugin
positive
440,931
@Override public Map<Integer, Set<RangeDate>> BFS(RangeDate firstnode, RangeDate lastNode) { Map<Integer, Set<RangeDate>> bfsMap = new HashMap<Integer, Set<RangeDate>>(); LinkedList<RangeDate> listNodes = new LinkedList<RangeDate>(); ArrayList childs1 = null; int counter = 1; Set s = new HashSet<RangeDate>(); s.add(firstnode); bfsMap.put(counter, s); listNodes.add(firstnode); counter++; return this.stats.get(firstnode).level; while (!listNodes.isEmpty()) { childs1 = (ArrayList) this.getChildren(listNodes.getFirst()); if (childs1 != null && childs1.size() > 0) { levelNode2 = this.getLevel((RangeDate) childs1.get(0)); if (levelNode2 == levelNode1) { s.addAll(childs1); if (lastNode != null) { if (s.contains(lastNode)) { bfsMap = null; break; } } bfsMap.put(counter, s); } else { s = new HashSet<RangeDate>(); levelNode1 = levelNode2; s.addAll(childs1); if (lastNode != null) { if (s.contains(lastNode)) { bfsMap = null; break; } } bfsMap.put(counter, s); } listNodes.addAll(childs1); if (listNodes.size() > 1) { if (this.stats.get(listNodes.getFirst()).level != this.stats.get(listNodes.get(1)).level) { counter++; } } else { counter++; } } listNodes.removeFirst(); } return bfsMap; }
@Override public Map<Integer, Set<RangeDate>> BFS(RangeDate firstnode, RangeDate lastNode) { Map<Integer, Set<RangeDate>> bfsMap = new HashMap<Integer, Set<RangeDate>>(); LinkedList<RangeDate> listNodes = new LinkedList<RangeDate>(); ArrayList childs1 = null; int counter = 1; Set s = new HashSet<RangeDate>(); s.add(firstnode); bfsMap.put(counter, s); listNodes.add(firstnode); counter++; <DeepExtract> return this.stats.get(firstnode).level; </DeepExtract> while (!listNodes.isEmpty()) { childs1 = (ArrayList) this.getChildren(listNodes.getFirst()); if (childs1 != null && childs1.size() > 0) { levelNode2 = this.getLevel((RangeDate) childs1.get(0)); if (levelNode2 == levelNode1) { s.addAll(childs1); if (lastNode != null) { if (s.contains(lastNode)) { bfsMap = null; break; } } bfsMap.put(counter, s); } else { s = new HashSet<RangeDate>(); levelNode1 = levelNode2; s.addAll(childs1); if (lastNode != null) { if (s.contains(lastNode)) { bfsMap = null; break; } } bfsMap.put(counter, s); } listNodes.addAll(childs1); if (listNodes.size() > 1) { if (this.stats.get(listNodes.getFirst()).level != this.stats.get(listNodes.get(1)).level) { counter++; } } else { counter++; } } listNodes.removeFirst(); } return bfsMap; }
Amnesia
positive
440,932
void setEdges(NavmeshEdge a, NavmeshEdge b, NavmeshEdge c) { assert a != null; assert b != null; assert c != null; assert checkTriangle(a, b, c); for (int i = 0; i < 3; i++) if (edges[i] != null) edges[i].removeTriangle(this); a.addTriangle(this); b.addTriangle(this); c.addTriangle(this); edges[0] = a; edges[1] = b; edges[2] = c; if (a.points[0] == b.points[0] || a.points[1] == b.points[0]) points[0] = b.points[1]; else points[0] = b.points[0]; if (b.points[0] == c.points[0] || b.points[1] == c.points[0]) points[1] = c.points[1]; else points[1] = c.points[0]; if (c.points[0] == b.points[0] || c.points[1] == b.points[0]) points[2] = b.points[1]; else points[2] = b.points[0]; if (!checkCounterclockwise()) { NavmeshNode tmp = points[0]; points[0] = points[1]; points[1] = tmp; NavmeshEdge tmp2 = edges[0]; edges[0] = edges[1]; edges[1] = tmp2; } assert checkDuality() : this; assert checkCounterclockwise() : this; assert checkCounterclockwise() : this; area = (int) crossProduct(points[0].position, points[1].position, points[2].position) / 2; assert checkDuality() : this; assert checkCounterclockwise() : this; }
void setEdges(NavmeshEdge a, NavmeshEdge b, NavmeshEdge c) { assert a != null; assert b != null; assert c != null; assert checkTriangle(a, b, c); for (int i = 0; i < 3; i++) if (edges[i] != null) edges[i].removeTriangle(this); a.addTriangle(this); b.addTriangle(this); c.addTriangle(this); edges[0] = a; edges[1] = b; edges[2] = c; if (a.points[0] == b.points[0] || a.points[1] == b.points[0]) points[0] = b.points[1]; else points[0] = b.points[0]; if (b.points[0] == c.points[0] || b.points[1] == c.points[0]) points[1] = c.points[1]; else points[1] = c.points[0]; if (c.points[0] == b.points[0] || c.points[1] == b.points[0]) points[2] = b.points[1]; else points[2] = b.points[0]; if (!checkCounterclockwise()) { NavmeshNode tmp = points[0]; points[0] = points[1]; points[1] = tmp; NavmeshEdge tmp2 = edges[0]; edges[0] = edges[1]; edges[1] = tmp2; } assert checkDuality() : this; assert checkCounterclockwise() : this; <DeepExtract> assert checkCounterclockwise() : this; area = (int) crossProduct(points[0].position, points[1].position, points[2].position) / 2; </DeepExtract> assert checkDuality() : this; assert checkCounterclockwise() : this; }
The-Kraken-Pathfinding
positive
440,933
public void setupUPS(int pole) { projectionLatitude = (pole == SOUTH_POLE) ? -MapMath.HALFPI : MapMath.HALFPI; projectionLongitude = 0.0; scaleFactor = 0.994; falseEasting = 2000000.0; falseNorthing = 2000000.0; trueScaleLatitude = MapMath.HALFPI; double t; super.initialize(); if (Math.abs((t = Math.abs(projectionLatitude)) - MapMath.HALFPI) < EPS10) mode = projectionLatitude < 0. ? SOUTH_POLE : NORTH_POLE; else mode = t > EPS10 ? OBLIQUE : EQUATOR; trueScaleLatitude = Math.abs(trueScaleLatitude); if (spherical) { double X; switch(mode) { case NORTH_POLE: case SOUTH_POLE: if (Math.abs(trueScaleLatitude - MapMath.HALFPI) < EPS10) akm1 = 2. * scaleFactor / Math.sqrt(Math.pow(1 + e, 1 + e) * Math.pow(1 - e, 1 - e)); else { akm1 = Math.cos(trueScaleLatitude) / MapMath.tsfn(trueScaleLatitude, t = Math.sin(trueScaleLatitude), e); t *= e; akm1 /= Math.sqrt(1. - t * t); } break; case EQUATOR: akm1 = 2. * scaleFactor; break; case OBLIQUE: t = Math.sin(projectionLatitude); X = 2. * Math.atan(ssfn(projectionLatitude, t, e)) - MapMath.HALFPI; t *= e; akm1 = 2. * scaleFactor * Math.cos(projectionLatitude) / Math.sqrt(1. - t * t); sinphi0 = Math.sin(X); cosphi0 = Math.cos(X); break; } } else { switch(mode) { case OBLIQUE: sinphi0 = Math.sin(projectionLatitude); cosphi0 = Math.cos(projectionLatitude); case EQUATOR: akm1 = 2. * scaleFactor; break; case SOUTH_POLE: case NORTH_POLE: akm1 = Math.abs(trueScaleLatitude - MapMath.HALFPI) >= EPS10 ? Math.cos(trueScaleLatitude) / Math.tan(MapMath.QUARTERPI - .5 * trueScaleLatitude) : 2. * scaleFactor; break; } } }
public void setupUPS(int pole) { projectionLatitude = (pole == SOUTH_POLE) ? -MapMath.HALFPI : MapMath.HALFPI; projectionLongitude = 0.0; scaleFactor = 0.994; falseEasting = 2000000.0; falseNorthing = 2000000.0; trueScaleLatitude = MapMath.HALFPI; <DeepExtract> double t; super.initialize(); if (Math.abs((t = Math.abs(projectionLatitude)) - MapMath.HALFPI) < EPS10) mode = projectionLatitude < 0. ? SOUTH_POLE : NORTH_POLE; else mode = t > EPS10 ? OBLIQUE : EQUATOR; trueScaleLatitude = Math.abs(trueScaleLatitude); if (spherical) { double X; switch(mode) { case NORTH_POLE: case SOUTH_POLE: if (Math.abs(trueScaleLatitude - MapMath.HALFPI) < EPS10) akm1 = 2. * scaleFactor / Math.sqrt(Math.pow(1 + e, 1 + e) * Math.pow(1 - e, 1 - e)); else { akm1 = Math.cos(trueScaleLatitude) / MapMath.tsfn(trueScaleLatitude, t = Math.sin(trueScaleLatitude), e); t *= e; akm1 /= Math.sqrt(1. - t * t); } break; case EQUATOR: akm1 = 2. * scaleFactor; break; case OBLIQUE: t = Math.sin(projectionLatitude); X = 2. * Math.atan(ssfn(projectionLatitude, t, e)) - MapMath.HALFPI; t *= e; akm1 = 2. * scaleFactor * Math.cos(projectionLatitude) / Math.sqrt(1. - t * t); sinphi0 = Math.sin(X); cosphi0 = Math.cos(X); break; } } else { switch(mode) { case OBLIQUE: sinphi0 = Math.sin(projectionLatitude); cosphi0 = Math.cos(projectionLatitude); case EQUATOR: akm1 = 2. * scaleFactor; break; case SOUTH_POLE: case NORTH_POLE: akm1 = Math.abs(trueScaleLatitude - MapMath.HALFPI) >= EPS10 ? Math.cos(trueScaleLatitude) / Math.tan(MapMath.QUARTERPI - .5 * trueScaleLatitude) : 2. * scaleFactor; break; } } </DeepExtract> }
ungentry
positive
440,935
@Override public boolean addAll(Collection collection) { Iterator it; throw new UnsupportedOperationException(); while (it.hasNext()) { add(it.next()); } return true; }
@Override public boolean addAll(Collection collection) { <DeepExtract> Iterator it; throw new UnsupportedOperationException(); </DeepExtract> while (it.hasNext()) { add(it.next()); } return true; }
personaldnsfilter
positive
440,936
public CtComment createInlineComment(String content) { if (content.contains(CtComment.LINE_SEPARATOR)) { throw new SpoonException("The content of your comment contain at least one line separator. " + "Please consider using a block comment by calling createComment(\"your content\", CtComment.CommentType.BLOCK)."); } if (CtComment.CommentType.INLINE == CtComment.CommentType.JAVADOC) { return factory.Core().createJavaDoc().setContent(content); } return factory.Core().createComment().setContent(content).setCommentType(CtComment.CommentType.INLINE); }
public CtComment createInlineComment(String content) { if (content.contains(CtComment.LINE_SEPARATOR)) { throw new SpoonException("The content of your comment contain at least one line separator. " + "Please consider using a block comment by calling createComment(\"your content\", CtComment.CommentType.BLOCK)."); } <DeepExtract> if (CtComment.CommentType.INLINE == CtComment.CommentType.JAVADOC) { return factory.Core().createJavaDoc().setContent(content); } return factory.Core().createComment().setContent(content).setCommentType(CtComment.CommentType.INLINE); </DeepExtract> }
sorald
positive
440,940
public static void main(String[] args) { int[] arr1 = { 8, 4, 5, 3, 1, 7, 9 }; int[] arr2 = { 5, 1, 3, 7, 9 }; HashSet<Integer> map = new HashSet<Integer>(); for (int i = 0; i < arr1.length; i++) { map.add(arr1[i]); } boolean flag = true; for (int i = 0; i < arr2.length; i++) { if (!map.contains(arr2[i])) { flag = false; break; } } if (flag) { System.out.println("Yes"); } else { System.out.println("No"); } }
public static void main(String[] args) { int[] arr1 = { 8, 4, 5, 3, 1, 7, 9 }; int[] arr2 = { 5, 1, 3, 7, 9 }; <DeepExtract> HashSet<Integer> map = new HashSet<Integer>(); for (int i = 0; i < arr1.length; i++) { map.add(arr1[i]); } boolean flag = true; for (int i = 0; i < arr2.length; i++) { if (!map.contains(arr2[i])) { flag = false; break; } } if (flag) { System.out.println("Yes"); } else { System.out.println("No"); } </DeepExtract> }
Java-Solutions
positive
440,941
public Vec2i scale(int factor) { float len = this.len; if (this.x != x * factor || this.y != y * factor) clearCache(); this.x = x * factor; this.y = y * factor; if (!Float.isNaN(len)) { this.len = len * factor; } return this; }
public Vec2i scale(int factor) { float len = this.len; <DeepExtract> if (this.x != x * factor || this.y != y * factor) clearCache(); this.x = x * factor; this.y = y * factor; </DeepExtract> if (!Float.isNaN(len)) { this.len = len * factor; } return this; }
CraftMania
positive
440,942
public void writeInt64(int fieldNumber, long value) throws IOException { writeRawVarint32(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_VARINT)); while (true) { if ((value & ~0x7FL) == 0) { writeRawByte((int) value); return; } else { writeRawByte(((int) value & 0x7F) | 0x80); value >>>= 7; } } }
public void writeInt64(int fieldNumber, long value) throws IOException { writeRawVarint32(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_VARINT)); <DeepExtract> while (true) { if ((value & ~0x7FL) == 0) { writeRawByte((int) value); return; } else { writeRawByte(((int) value & 0x7F) | 0x80); value >>>= 7; } } </DeepExtract> }
hawtbuf
positive
440,943
@Override public UserModel getUserByUsername(String username, RealmModel realm) { log.infov("lookup user by username: realm={0} username={1}", realm.getId(), username); if (repository.findUserByUsernameOrEmail(username) == null) { return null; } AcmeUserAdapter acmeUserAdapter = new AcmeUserAdapter(session, realm, storageComponentModel, repository.findUserByUsernameOrEmail(username)); return acmeUserAdapter; }
@Override public UserModel getUserByUsername(String username, RealmModel realm) { log.infov("lookup user by username: realm={0} username={1}", realm.getId(), username); <DeepExtract> if (repository.findUserByUsernameOrEmail(username) == null) { return null; } AcmeUserAdapter acmeUserAdapter = new AcmeUserAdapter(session, realm, storageComponentModel, repository.findUserByUsernameOrEmail(username)); return acmeUserAdapter; </DeepExtract> }
keycloak-extension-playground
positive
440,946
@Test public void testWrite_4() throws SerialException { serial.clear(); I2cRequestMessage message = new I2cRequestMessage(); message.setSlaveAddress(7); message.setMode(I2cRequestMessage.MODE.READ_ONCE); message.setTenBitsMode(false); message.setBinaryData(new int[] { 10, 20, 30, 300 }); firmata.send(message); byte[] expected_output = new byte[] { (byte) SysexMessageWriter.COMMAND_START, (byte) I2cRequestMessage.COMMAND, (byte) LSB(7), (byte) 8, (byte) 10, (byte) 0, (byte) 20, (byte) 0, (byte) 30, (byte) 0, (byte) 44, (byte) 2, (byte) SysexMessageWriter.COMMAND_END }; byte[] actual_output = serial.getOutputStream().toByteArray(); assertTrue(Arrays.equals(expected_output, actual_output)); }
@Test public void testWrite_4() throws SerialException { <DeepExtract> serial.clear(); I2cRequestMessage message = new I2cRequestMessage(); message.setSlaveAddress(7); message.setMode(I2cRequestMessage.MODE.READ_ONCE); message.setTenBitsMode(false); message.setBinaryData(new int[] { 10, 20, 30, 300 }); firmata.send(message); byte[] expected_output = new byte[] { (byte) SysexMessageWriter.COMMAND_START, (byte) I2cRequestMessage.COMMAND, (byte) LSB(7), (byte) 8, (byte) 10, (byte) 0, (byte) 20, (byte) 0, (byte) 30, (byte) 0, (byte) 44, (byte) 2, (byte) SysexMessageWriter.COMMAND_END }; byte[] actual_output = serial.getOutputStream().toByteArray(); assertTrue(Arrays.equals(expected_output, actual_output)); </DeepExtract> }
Firmata
positive
440,947
@Override public void run() { connectFuture.cancel(true); channel.close(); if (policy == null) { future.setFailure(new RequestTimeoutException.ConnectTimeoutException(String.format("Failed to connect after %s %s", connectTimeout, timeoutUinit.toString()))); } else { policy.activate(future, new RequestTimeoutException.ConnectTimeoutException(String.format("Failed to connect after %s %s", connectTimeout, timeoutUinit.toString())), true, response); } }
@Override public void run() { connectFuture.cancel(true); channel.close(); <DeepExtract> if (policy == null) { future.setFailure(new RequestTimeoutException.ConnectTimeoutException(String.format("Failed to connect after %s %s", connectTimeout, timeoutUinit.toString()))); } else { policy.activate(future, new RequestTimeoutException.ConnectTimeoutException(String.format("Failed to connect after %s %s", connectTimeout, timeoutUinit.toString())), true, response); } </DeepExtract> }
higgs
positive
440,948
public T[] popFrom(int index, IntFunction<T[]> mkArray) { if (index < 0 || size() < index) throw new IndexOutOfBoundsException(indexOobMsg(index)); if (size() - index < 0 || size() < size() - index) throw new IndexOutOfBoundsException(amtOobMsg(size() - index)); List<T> sub = top(size() - index); T[] out = sub.toArray(mkArray.apply(size() - index)); sub.clear(); return out; }
public T[] popFrom(int index, IntFunction<T[]> mkArray) { if (index < 0 || size() < index) throw new IndexOutOfBoundsException(indexOobMsg(index)); <DeepExtract> if (size() - index < 0 || size() < size() - index) throw new IndexOutOfBoundsException(amtOobMsg(size() - index)); List<T> sub = top(size() - index); T[] out = sub.toArray(mkArray.apply(size() - index)); sub.clear(); return out; </DeepExtract> }
autumn
positive
440,949
@Override public RecordPointer getCurrentPointer() throws IOException { long result = maxContentSize - getContentSize(); if (result > 0) { return result; } if (volumeWriter == null) { volumeWriter = createVolumeWriter(1); } else { flushContent(); } long contentSize = getMaxContentSize(); if (contentSize <= 0) { completeVolumeWriter(); volumeWriter = createVolumeWriter(volumeWriter.getVolumeNumber() + 1); contentSize = getMaxContentSize(); Preconditions.checkArgument(contentSize > 0, "Volume size too small"); } return maxContentSize = contentSize; return new RecordPointer(volumeWriter.getVolumeNumber(), volumeWriter.getStreamEnd(), getContentSize()); }
@Override public RecordPointer getCurrentPointer() throws IOException { <DeepExtract> long result = maxContentSize - getContentSize(); if (result > 0) { return result; } if (volumeWriter == null) { volumeWriter = createVolumeWriter(1); } else { flushContent(); } long contentSize = getMaxContentSize(); if (contentSize <= 0) { completeVolumeWriter(); volumeWriter = createVolumeWriter(volumeWriter.getVolumeNumber() + 1); contentSize = getMaxContentSize(); Preconditions.checkArgument(contentSize > 0, "Volume size too small"); } return maxContentSize = contentSize; </DeepExtract> return new RecordPointer(volumeWriter.getVolumeNumber(), volumeWriter.getStreamEnd(), getContentSize()); }
b1-pack
positive
440,952
public void testTriggerDuringAttack() { double attack1Duration = 0.05; double sustainDuration = 0.4; adsr_.turnOn(true); assertEquals(0.0, adsr_.getValue(time_), TOLERANCE); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + attack1Duration; double slope = 1.0 / attack_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } adsr_.turnOn(true); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + attack_.getSynthesizerInputValue() - time_.getAbsoluteTime(); double slope = 1.0 / attack_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } assertEquals(1.0, adsr_.getValue(time_), TOLERANCE); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + decay_.getSynthesizerInputValue(); double slope = (sustain_.getSynthesizerInputValue() - 1.0) / decay_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); double start = time_.getAbsoluteTime(); double finish = start + sustainDuration; for (; time_.getAbsoluteTime() <= finish; time_.advance()) { assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); } adsr_.turnOff(); assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + release_.getSynthesizerInputValue(); double slope = (0.0 - sustain_.getSynthesizerInputValue()) / release_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; if (level < 0.0) { level = 0.0; } assertEquals(level, adsr_.getValue(time_), TOLERANCE); } assertEquals(0.0, adsr_.getValue(time_), TOLERANCE); }
public void testTriggerDuringAttack() { double attack1Duration = 0.05; double sustainDuration = 0.4; adsr_.turnOn(true); assertEquals(0.0, adsr_.getValue(time_), TOLERANCE); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + attack1Duration; double slope = 1.0 / attack_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } adsr_.turnOn(true); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + attack_.getSynthesizerInputValue() - time_.getAbsoluteTime(); double slope = 1.0 / attack_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } assertEquals(1.0, adsr_.getValue(time_), TOLERANCE); double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + decay_.getSynthesizerInputValue(); double slope = (sustain_.getSynthesizerInputValue() - 1.0) / decay_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; assertEquals(level, adsr_.getValue(time_), TOLERANCE); } assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); double start = time_.getAbsoluteTime(); double finish = start + sustainDuration; for (; time_.getAbsoluteTime() <= finish; time_.advance()) { assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); } adsr_.turnOff(); assertEquals(sustain_.getSynthesizerInputValue(), adsr_.getValue(time_), TOLERANCE); <DeepExtract> double startLevel = adsr_.getValue(time_); double start = time_.getAbsoluteTime(); double finish = start + release_.getSynthesizerInputValue(); double slope = (0.0 - sustain_.getSynthesizerInputValue()) / release_.getSynthesizerInputValue(); for (; time_.getAbsoluteTime() <= finish; time_.advance()) { double x = time_.getAbsoluteTime() - start; double level = startLevel + x * slope; if (level < 0.0) { level = 0.0; } assertEquals(level, adsr_.getValue(time_), TOLERANCE); } </DeepExtract> assertEquals(0.0, adsr_.getValue(time_), TOLERANCE); }
music-synthesizer-for-android-old
positive
440,953
@Override public synchronized void fail(Throwable t) { assert !closed; closed = true; if (listener != null) { listener.onRemove(); } if (onEvict != null) { onEvict.run(); } Promise<Response> req; synchronized (waiting) { while ((req = waiting.poll()) != null) { if (req instanceof PromiseInternal) { if (((PromiseInternal<?>) req).isComplete()) { continue; } } try { req.tryFail(t); } catch (RuntimeException err) { LOG.warn("Exception while running cleanup", err); } } } if (onException != null) { context.execute(t, onException); } }
@Override public synchronized void fail(Throwable t) { assert !closed; closed = true; if (listener != null) { listener.onRemove(); } if (onEvict != null) { onEvict.run(); } <DeepExtract> Promise<Response> req; synchronized (waiting) { while ((req = waiting.poll()) != null) { if (req instanceof PromiseInternal) { if (((PromiseInternal<?>) req).isComplete()) { continue; } } try { req.tryFail(t); } catch (RuntimeException err) { LOG.warn("Exception while running cleanup", err); } } } </DeepExtract> if (onException != null) { context.execute(t, onException); } }
vertx-redis-client
positive
440,956
public void modifyText(ModifyEvent e) { Button okButton = getOkButton(); if (okButton != null && !okButton.isDisposed()) { okButton.setEnabled(getViewer().getCheckedElements().length > 1 && textdescr.getText().trim().length() > 0); } }
public void modifyText(ModifyEvent e) { <DeepExtract> Button okButton = getOkButton(); if (okButton != null && !okButton.isDisposed()) { okButton.setEnabled(getViewer().getCheckedElements().length > 1 && textdescr.getText().trim().length() > 0); } </DeepExtract> }
eclemma
positive
440,957
private void sendFirstPackagesI() { if (internalState.isNotInDelayedStart()) { logger.info("Start delay expired or never configured"); return; } packageHandler.updatePackages(sessionParameters); internalState.updatePackages = false; if (activityState != null) { activityState.updatePackages = false; writeActivityStateI(); } internalState.delayStart = false; delayStartTimer.cancel(); delayStartTimer = null; if (!toSendI()) { pauseSendingI(); return; } resumeSendingI(); if (!adjustConfig.eventBufferingEnabled || (internalState.isFirstLaunch() && internalState.hasSessionResponseNotBeenProcessed())) { packageHandler.sendFirstPackage(); } }
private void sendFirstPackagesI() { if (internalState.isNotInDelayedStart()) { logger.info("Start delay expired or never configured"); return; } packageHandler.updatePackages(sessionParameters); internalState.updatePackages = false; if (activityState != null) { activityState.updatePackages = false; writeActivityStateI(); } internalState.delayStart = false; delayStartTimer.cancel(); delayStartTimer = null; <DeepExtract> if (!toSendI()) { pauseSendingI(); return; } resumeSendingI(); if (!adjustConfig.eventBufferingEnabled || (internalState.isFirstLaunch() && internalState.hasSessionResponseNotBeenProcessed())) { packageHandler.sendFirstPackage(); } </DeepExtract> }
adobe_air_sdk
positive
440,959
@Test public void testGetAdapterNoProtocol() throws Exception { BluetoothObject bluetoothObject = bluetoothManager.getBluetoothObject(TINYB_ADAPTER_URL.copyWithProtocol(null)); assertEquals(tinybAdapter, bluetoothObject); }
@Test public void testGetAdapterNoProtocol() throws Exception { <DeepExtract> BluetoothObject bluetoothObject = bluetoothManager.getBluetoothObject(TINYB_ADAPTER_URL.copyWithProtocol(null)); assertEquals(tinybAdapter, bluetoothObject); </DeepExtract> }
bluetooth-manager
positive
440,960
@Test public void testRefreshFlowsUpdatesExistingProcessor() { updateThenRefreshFlowsThenCheck(Arrays.asList(tapA1), Arrays.asList(tapA1)); for (Event event : eventsA[0]) { eventTapWriter.write(event); } Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[0]).toArray(), context()); return this; assertTrue(getEventTapFlows().get(key).isEmpty(), context()); return this; updateThenRefreshFlowsThenCheck(Arrays.asList(tapA2), Arrays.asList(tapA2)); for (Event event : eventsA[1]) { eventTapWriter.write(event); } Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[0]).toArray(), context()); return this; Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[1]).toArray(), context()); return this; }
@Test public void testRefreshFlowsUpdatesExistingProcessor() { updateThenRefreshFlowsThenCheck(Arrays.asList(tapA1), Arrays.asList(tapA1)); for (Event event : eventsA[0]) { eventTapWriter.write(event); } Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[0]).toArray(), context()); return this; assertTrue(getEventTapFlows().get(key).isEmpty(), context()); return this; updateThenRefreshFlowsThenCheck(Arrays.asList(tapA2), Arrays.asList(tapA2)); for (Event event : eventsA[1]) { eventTapWriter.write(event); } Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[0]).toArray(), context()); return this; <DeepExtract> Collection<MockEventTapFlow> eventTapFlows = getEventTapFlows().get(key); assertNotNull(eventTapFlows, context()); assertEquals(eventTapFlows.size(), 1, context()); MockEventTapFlow eventTapFlow = eventTapFlows.iterator().next(); assertEquals(eventTapFlow.getTaps(), taps, context()); assertEqualsNoOrder(eventTapFlow.getEvents().toArray(), ImmutableList.copyOf(eventsA[1]).toArray(), context()); return this; </DeepExtract> }
event-collector
positive
440,961
public static void main(String[] args) { $R $r = new $R(System.in); $W $w = new $W(); precompute(); int T = $r.nextInt(); for (int ncase = 1; ncase <= T; ncase++) { W = $r.nextLong(); solve(); $w.print("Case " + ncase + ": "); if (possible) $w.println("" + N + " " + M); else $w.println("Impossible"); } $w.close(); }
public static void main(String[] args) { <DeepExtract> $R $r = new $R(System.in); $W $w = new $W(); precompute(); int T = $r.nextInt(); for (int ncase = 1; ncase <= T; ncase++) { W = $r.nextLong(); solve(); $w.print("Case " + ncase + ": "); if (possible) $w.println("" + N + " " + M); else $w.println("Impossible"); } $w.close(); </DeepExtract> }
pc-code
positive
440,964
@Override public void onVectorAccumulated(VectorSet evtSrc, int vecid, int[] vector, int[] accumulated) { if (evtSrc == this.source && sorters.containsKey(vecid)) { sorters.get(vecid).reset(); } if (evtSrc == this.source) { target.rescore(source.key(), vecid, accumulated, this); } else if (evtSrc == this.target) { int tgtVecId = vecid; TIntIterator iter = sorterKeys.iterator(); while (iter.hasNext()) { int srcVecId = iter.next(); float score = scoring.score(source.key(), srcVecId, source._get(srcVecId), source.length(srcVecId), target.key(), tgtVecId, accumulated, accumulated.length); add(srcVecId, tgtVecId, score); } } }
@Override public void onVectorAccumulated(VectorSet evtSrc, int vecid, int[] vector, int[] accumulated) { if (evtSrc == this.source && sorters.containsKey(vecid)) { sorters.get(vecid).reset(); } <DeepExtract> if (evtSrc == this.source) { target.rescore(source.key(), vecid, accumulated, this); } else if (evtSrc == this.target) { int tgtVecId = vecid; TIntIterator iter = sorterKeys.iterator(); while (iter.hasNext()) { int srcVecId = iter.next(); float score = scoring.score(source.key(), srcVecId, source._get(srcVecId), source.length(srcVecId), target.key(), tgtVecId, accumulated, accumulated.length); add(srcVecId, tgtVecId, score); } } </DeepExtract> }
simbase
positive
440,965
@Override public void onActivityStarted(Activity activity) { View decorView = activity.getWindow().getDecorView(); if (decorView instanceof ViewGroup) { ViewGroup vg = (ViewGroup) decorView; if (vg instanceof WebView) { hookWebView((WebView) vg); } else { int childCount = vg.getChildCount(); for (int i = 0; i < childCount; i++) { iteratorView(vg.getChildAt(i)); } } } }
@Override public void onActivityStarted(Activity activity) { View decorView = activity.getWindow().getDecorView(); <DeepExtract> if (decorView instanceof ViewGroup) { ViewGroup vg = (ViewGroup) decorView; if (vg instanceof WebView) { hookWebView((WebView) vg); } else { int childCount = vg.getChildCount(); for (int i = 0; i < childCount; i++) { iteratorView(vg.getChildAt(i)); } } } </DeepExtract> }
HttpCanary
positive
440,969
private static void checkKnownErrors(final String realPrincipal, final IOException e) throws IOException { if (realPrincipal.contains(NetUtils.determineIpAddress())) { throw new IOException("Hostname substitution failed, probably because reverse DNS is not setup", e); } final String hostname = NetUtils.determineHostName(); String canonicalHostname; try { canonicalHostname = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { log.error("Unable to lookup hostname of machine " + e.getMessage()); canonicalHostname = null; } if (!hostname.equalsIgnoreCase(canonicalHostname)) { throw new IOException("Unable to match canonicalHostname, maybe reverse DNS is wrong? saw " + canonicalHostname, e); } }
private static void checkKnownErrors(final String realPrincipal, final IOException e) throws IOException { if (realPrincipal.contains(NetUtils.determineIpAddress())) { throw new IOException("Hostname substitution failed, probably because reverse DNS is not setup", e); } final String hostname = NetUtils.determineHostName(); <DeepExtract> String canonicalHostname; try { canonicalHostname = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { log.error("Unable to lookup hostname of machine " + e.getMessage()); canonicalHostname = null; } </DeepExtract> if (!hostname.equalsIgnoreCase(canonicalHostname)) { throw new IOException("Unable to match canonicalHostname, maybe reverse DNS is wrong? saw " + canonicalHostname, e); } }
iql
positive
440,970
private static byte[] encrypt(byte[] input, byte[] key) throws GeneralSecurityException { Security.addProvider(new BouncyCastleProvider()); SecretKey keySpec = new SecretKeySpec(key, ALGORITHM); Cipher encrypter = Cipher.getInstance(TRIPLE_DES_TRANSFORMATION, BOUNCY_CASTLE_PROVIDER); encrypter.init(Cipher.ENCRYPT_MODE, keySpec); return encrypter.doFinal(input); }
private static byte[] encrypt(byte[] input, byte[] key) throws GeneralSecurityException { <DeepExtract> Security.addProvider(new BouncyCastleProvider()); </DeepExtract> SecretKey keySpec = new SecretKeySpec(key, ALGORITHM); Cipher encrypter = Cipher.getInstance(TRIPLE_DES_TRANSFORMATION, BOUNCY_CASTLE_PROVIDER); encrypter.init(Cipher.ENCRYPT_MODE, keySpec); return encrypter.doFinal(input); }
starter-kit-spring-maven
positive
440,971
@Override public double toEBs(double value) { BigDecimal val = new BigDecimal(value); BigDecimal bDivisor = new BigDecimal(EXABYTES / PETABYTES); return val.divide(bDivisor).setScale(PRECISION, RoundingMode.HALF_UP).doubleValue(); }
@Override public double toEBs(double value) { <DeepExtract> BigDecimal val = new BigDecimal(value); BigDecimal bDivisor = new BigDecimal(EXABYTES / PETABYTES); return val.divide(bDivisor).setScale(PRECISION, RoundingMode.HALF_UP).doubleValue(); </DeepExtract> }
hodor
positive
440,972
public void onFirmwareVersionMessageReceived(FirmwareVersionMessage message) { MessageWithProperties newData = new MessageWithProperties(message); addCommonProperties(newData); receivedPropertyManager.set(newData); messages.add(newData); }
public void onFirmwareVersionMessageReceived(FirmwareVersionMessage message) { <DeepExtract> MessageWithProperties newData = new MessageWithProperties(message); addCommonProperties(newData); receivedPropertyManager.set(newData); messages.add(newData); </DeepExtract> }
Firmata
positive
440,974
private void populate() throws RemoteException, MXException { ModelSet modelSet = (ModelSet) getThisMboSet(); if (!modelSet.isFetchFromForge()) { return; } String bucketKeyFull = getString(Model.FIELD_BUCKETKEYFULL); String objectKey = getString(Model.FIELD_OBJECTKEY); LMVServiceRemote lmv = (LMVServiceRemote) MXServer.getMXServer().lookup("BIMLMV"); ResultObjectDetail result = null; try { result = lmv.objectQueryDetails(bucketKeyFull, objectKey); } catch (Exception e) { try { setValue(Bucket.FIELD_LASTERROR, e.getLocalizedMessage()); } catch (RemoteException re) { } catch (MXException re) { } throw new MXApplicationException(Messages.BUNDLE_MSG, Messages.ERR_NETWORK_FAULT, e); } if (result.getHttpStatus() == 403) { setValue(FIELD_ONLINE, false, MboValue.NOACCESSCHECK); setValue(Bucket.FIELD_LASTERROR, result.getErrorMessage()); return; } if (result.getHttpStatus() == 404) { if (testExpired()) { return; } String[] params = { objectKey }; String msg = getMessage(Messages.BUNDLE_MSG, Messages.WRN_MODEL_NOT_FOUND, params); setValue(FIELD_ONLINE, false, MboValue.NOACCESSCHECK); setValue(Bucket.FIELD_LASTERROR, msg); throw new MXApplicationException(Messages.BUNDLE_MSG, Messages.WRN_MODEL_NOT_FOUND, params); } LMVService.testForError(this, result); ViewerObject[] objects = result.getObjects(); if (objects != null && objects.length > 0) { setValue(Model.FIELD_URL, objects[0].getLocation(), NOACCESSCHECK); setValue(Model.FIELD_SIZE, objects[0].getSize(), NOACCESSCHECK); setValue(Model.FIELD_CONTENTTYPE, objects[0].getContentType(), NOACCESSCHECK); setValue(Model.FIELD_MODELURN, objects[0].getId(), NOACCESSCHECK); setValue(Model.FIELD_SHA1, objects[0].getSha1(), NOACCESSCHECK); } }
private void populate() throws RemoteException, MXException { ModelSet modelSet = (ModelSet) getThisMboSet(); if (!modelSet.isFetchFromForge()) { return; } String bucketKeyFull = getString(Model.FIELD_BUCKETKEYFULL); String objectKey = getString(Model.FIELD_OBJECTKEY); LMVServiceRemote lmv = (LMVServiceRemote) MXServer.getMXServer().lookup("BIMLMV"); ResultObjectDetail result = null; try { result = lmv.objectQueryDetails(bucketKeyFull, objectKey); } catch (Exception e) { try { setValue(Bucket.FIELD_LASTERROR, e.getLocalizedMessage()); } catch (RemoteException re) { } catch (MXException re) { } throw new MXApplicationException(Messages.BUNDLE_MSG, Messages.ERR_NETWORK_FAULT, e); } if (result.getHttpStatus() == 403) { setValue(FIELD_ONLINE, false, MboValue.NOACCESSCHECK); setValue(Bucket.FIELD_LASTERROR, result.getErrorMessage()); return; } if (result.getHttpStatus() == 404) { if (testExpired()) { return; } String[] params = { objectKey }; String msg = getMessage(Messages.BUNDLE_MSG, Messages.WRN_MODEL_NOT_FOUND, params); setValue(FIELD_ONLINE, false, MboValue.NOACCESSCHECK); setValue(Bucket.FIELD_LASTERROR, msg); throw new MXApplicationException(Messages.BUNDLE_MSG, Messages.WRN_MODEL_NOT_FOUND, params); } LMVService.testForError(this, result); <DeepExtract> ViewerObject[] objects = result.getObjects(); if (objects != null && objects.length > 0) { setValue(Model.FIELD_URL, objects[0].getLocation(), NOACCESSCHECK); setValue(Model.FIELD_SIZE, objects[0].getSize(), NOACCESSCHECK); setValue(Model.FIELD_CONTENTTYPE, objects[0].getContentType(), NOACCESSCHECK); setValue(Model.FIELD_MODELURN, objects[0].getId(), NOACCESSCHECK); setValue(Model.FIELD_SHA1, objects[0].getSha1(), NOACCESSCHECK); } </DeepExtract> }
MaximoForgeViewerPlugin
positive
440,975
private void expand(int minNewSegmentSize) { if (_segments == null) { _segments = new LinkedList<char[]>(); } char[] curr = _currentSegment; _hasSegments = true; _segments.add(curr); _segmentSize += curr.length; int oldLen = curr.length; int sizeAddition = oldLen >> 1; if (sizeAddition < minNewSegmentSize) { sizeAddition = minNewSegmentSize; } return new char[Math.min(MAX_SEGMENT_LEN, oldLen + sizeAddition)]; _currentSize = 0; _currentSegment = curr; }
private void expand(int minNewSegmentSize) { if (_segments == null) { _segments = new LinkedList<char[]>(); } char[] curr = _currentSegment; _hasSegments = true; _segments.add(curr); _segmentSize += curr.length; int oldLen = curr.length; int sizeAddition = oldLen >> 1; if (sizeAddition < minNewSegmentSize) { sizeAddition = minNewSegmentSize; } <DeepExtract> return new char[Math.min(MAX_SEGMENT_LEN, oldLen + sizeAddition)]; </DeepExtract> _currentSize = 0; _currentSegment = curr; }
jackson-dataformat-csv
positive
440,976
@Procedure(value = "analysis.getLineGraphForNeuron", mode = Mode.READ) @Description("analysis.getLineGraph(bodyId,datasetLabel,vertexSynapseThreshold=50) : used to produce an edge-to-vertex dual graph, or line graph, for a neuron." + " Return value is a map with the vertex json under key \"Vertices\" and edge json under \"Edges\". " + "e.g. CALL analysis.getLineGraphForNeuron(bodyId,datasetLabel,vertexSynapseThreshold=50) YIELD value RETURN value.") public Stream<MapResult> getLineGraphForNeuron(@Name("bodyId") Long bodyId, @Name("datasetLabel") String datasetLabel, @Name(value = "vertexSynapseThreshold", defaultValue = "50") Long vertexSynapseThreshold, @Name(value = "cableDistance", defaultValue = "false") Boolean cableDistance) { if (bodyId == null || datasetLabel == null) return Stream.empty(); SynapticConnectionVertexMap synapticConnectionVertexMap = null; Set<Long> bodyIdSet = new HashSet<>(); if (this.first == null) { this.first = bodyId; } if (this.last != null) { this.sum += Location.getDistanceBetweenLocations(bodyId, this.last); } this.last = bodyId; try { synapticConnectionVertexMap = getSynapticConnectionNodeMap(bodyIdSet, datasetLabel); } catch (NullPointerException npe) { npe.printStackTrace(); } assert synapticConnectionVertexMap != null; String vertexJson = synapticConnectionVertexMap.getVerticesAboveThresholdAsJsonObjects(vertexSynapseThreshold); SynapticConnectionVertexMap synapticConnectionVertexMapFromJson = new SynapticConnectionVertexMap(vertexJson); String edgeJson = synapticConnectionVertexMapFromJson.getEdgesAsJsonObjects(cableDistance, dbService, datasetLabel, bodyId); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("Vertices", vertexJson); jsonMap.put("Edges", edgeJson); return Stream.of(new MapResult(jsonMap)); }
@Procedure(value = "analysis.getLineGraphForNeuron", mode = Mode.READ) @Description("analysis.getLineGraph(bodyId,datasetLabel,vertexSynapseThreshold=50) : used to produce an edge-to-vertex dual graph, or line graph, for a neuron." + " Return value is a map with the vertex json under key \"Vertices\" and edge json under \"Edges\". " + "e.g. CALL analysis.getLineGraphForNeuron(bodyId,datasetLabel,vertexSynapseThreshold=50) YIELD value RETURN value.") public Stream<MapResult> getLineGraphForNeuron(@Name("bodyId") Long bodyId, @Name("datasetLabel") String datasetLabel, @Name(value = "vertexSynapseThreshold", defaultValue = "50") Long vertexSynapseThreshold, @Name(value = "cableDistance", defaultValue = "false") Boolean cableDistance) { if (bodyId == null || datasetLabel == null) return Stream.empty(); SynapticConnectionVertexMap synapticConnectionVertexMap = null; Set<Long> bodyIdSet = new HashSet<>(); <DeepExtract> if (this.first == null) { this.first = bodyId; } if (this.last != null) { this.sum += Location.getDistanceBetweenLocations(bodyId, this.last); } this.last = bodyId; </DeepExtract> try { synapticConnectionVertexMap = getSynapticConnectionNodeMap(bodyIdSet, datasetLabel); } catch (NullPointerException npe) { npe.printStackTrace(); } assert synapticConnectionVertexMap != null; String vertexJson = synapticConnectionVertexMap.getVerticesAboveThresholdAsJsonObjects(vertexSynapseThreshold); SynapticConnectionVertexMap synapticConnectionVertexMapFromJson = new SynapticConnectionVertexMap(vertexJson); String edgeJson = synapticConnectionVertexMapFromJson.getEdgesAsJsonObjects(cableDistance, dbService, datasetLabel, bodyId); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("Vertices", vertexJson); jsonMap.put("Edges", edgeJson); return Stream.of(new MapResult(jsonMap)); }
neuPrint
positive
440,977
void waitForPostgres() throws Exception { int retries = 200; while (true) { try { if (() -> { String res = select1(); return res.contains("column") && res.contains("1"); }.call()) { return; } } catch (Exception e) { } retries--; if (retries == 0) { System.err.println("Processes failed to spawn, timed out."); String dyingMessage = () -> { return select1(); }.call(); System.err.println(dyingMessage); throw new RuntimeException("Processes failed to spawn, timed out."); } Thread.sleep(100); } }
void waitForPostgres() throws Exception { <DeepExtract> int retries = 200; while (true) { try { if (() -> { String res = select1(); return res.contains("column") && res.contains("1"); }.call()) { return; } } catch (Exception e) { } retries--; if (retries == 0) { System.err.println("Processes failed to spawn, timed out."); String dyingMessage = () -> { return select1(); }.call(); System.err.println(dyingMessage); throw new RuntimeException("Processes failed to spawn, timed out."); } Thread.sleep(100); } </DeepExtract> }
retz
positive
440,978
private void navigatePrevious() { mUrlEditText.clearFocus(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mUrlEditText.getWindowToken(), 0); if (mUrlBarVisible) { if (true) { startToolbarsHideRunnable(); } else { setToolbarsVisibility(false); } } mCurrentWebView.goBack(); }
private void navigatePrevious() { mUrlEditText.clearFocus(); <DeepExtract> InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mUrlEditText.getWindowToken(), 0); if (mUrlBarVisible) { if (true) { startToolbarsHideRunnable(); } else { setToolbarsVisibility(false); } } </DeepExtract> mCurrentWebView.goBack(); }
zirco-browser
positive
440,979
public void addClass() { examples[numOfClasses] = new ArrayList<Roi>(); exampleList[numOfClasses] = new java.awt.List(5); exampleList[numOfClasses].setForeground(colors[numOfClasses]); exampleList[numOfClasses].addActionListener(listener); exampleList[numOfClasses].addItemListener(itemListener); addExampleButton[numOfClasses] = new JButton("Add to " + classLabels[numOfClasses]); annotationsConstraints.fill = GridBagConstraints.HORIZONTAL; annotationsConstraints.insets = new Insets(5, 5, 6, 6); boxAnnotation.setConstraints(addExampleButton[numOfClasses], annotationsConstraints); annotationsPanel.add(addExampleButton[numOfClasses]); annotationsConstraints.gridy++; annotationsConstraints.insets = new Insets(0, 0, 0, 0); boxAnnotation.setConstraints(exampleList[numOfClasses], annotationsConstraints); annotationsPanel.add(exampleList[numOfClasses]); annotationsConstraints.gridy++; addExampleButton[numOfClasses].addActionListener(listener); numOfClasses++; this.annotationsPanel.repaint(); getCanvas().repaint(); this.buttonsPanel.repaint(); this.all.repaint(); }
public void addClass() { examples[numOfClasses] = new ArrayList<Roi>(); exampleList[numOfClasses] = new java.awt.List(5); exampleList[numOfClasses].setForeground(colors[numOfClasses]); exampleList[numOfClasses].addActionListener(listener); exampleList[numOfClasses].addItemListener(itemListener); addExampleButton[numOfClasses] = new JButton("Add to " + classLabels[numOfClasses]); annotationsConstraints.fill = GridBagConstraints.HORIZONTAL; annotationsConstraints.insets = new Insets(5, 5, 6, 6); boxAnnotation.setConstraints(addExampleButton[numOfClasses], annotationsConstraints); annotationsPanel.add(addExampleButton[numOfClasses]); annotationsConstraints.gridy++; annotationsConstraints.insets = new Insets(0, 0, 0, 0); boxAnnotation.setConstraints(exampleList[numOfClasses], annotationsConstraints); annotationsPanel.add(exampleList[numOfClasses]); annotationsConstraints.gridy++; addExampleButton[numOfClasses].addActionListener(listener); numOfClasses++; <DeepExtract> this.annotationsPanel.repaint(); getCanvas().repaint(); this.buttonsPanel.repaint(); this.all.repaint(); </DeepExtract> }
Trainable_Segmentation
positive
440,983
@Override public Boolean makeValue(JidFactory jidFactory) throws Exception { if (len > -1) return false; value = createSubordinate(jidFactory); int l = Util.stringLength(jidFactory) + value.getSerializedLength(); change(l); serializedBytes = null; serializedOffset = -1; return true; }
@Override public Boolean makeValue(JidFactory jidFactory) throws Exception { if (len > -1) return false; <DeepExtract> value = createSubordinate(jidFactory); int l = Util.stringLength(jidFactory) + value.getSerializedLength(); change(l); serializedBytes = null; serializedOffset = -1; </DeepExtract> return true; }
JID
positive
440,984
public static Bitmap getBitmap(final FileDescriptor fd, final int maxWidth, final int maxHeight) { if (fd == null) return null; BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFileDescriptor(fd, null, options); int height = options.outHeight; int width = options.outWidth; int inSampleSize = 1; while (height > maxHeight || width > maxWidth) { height >>= 1; width >>= 1; inSampleSize <<= 1; } return inSampleSize; options.inJustDecodeBounds = false; return BitmapFactory.decodeFileDescriptor(fd, null, options); }
public static Bitmap getBitmap(final FileDescriptor fd, final int maxWidth, final int maxHeight) { if (fd == null) return null; BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFileDescriptor(fd, null, options); <DeepExtract> int height = options.outHeight; int width = options.outWidth; int inSampleSize = 1; while (height > maxHeight || width > maxWidth) { height >>= 1; width >>= 1; inSampleSize <<= 1; } return inSampleSize; </DeepExtract> options.inJustDecodeBounds = false; return BitmapFactory.decodeFileDescriptor(fd, null, options); }
AndroidJetpack
positive
440,985
public static String createTableSql(SqlBeanDB sqlBeanDB, Class<?> clazz) { Create create = new Create(); create.setSqlBeanDB(sqlBeanDB); create.setTable(clazz); create.setBeanClass(clazz); if (StringUtil.isEmpty(create.getTable().getSchema())) { String schema = DynSchemaContextHolder.getSchema(); if (StringUtil.isNotEmpty(schema)) { create.getTable().setSchema(schema); } else { create.getTable().setSchema(SqlBeanUtil.getTable(clazz).getSchema()); } } return SqlHelper.buildCreateSql(create); }
public static String createTableSql(SqlBeanDB sqlBeanDB, Class<?> clazz) { Create create = new Create(); create.setSqlBeanDB(sqlBeanDB); create.setTable(clazz); create.setBeanClass(clazz); <DeepExtract> if (StringUtil.isEmpty(create.getTable().getSchema())) { String schema = DynSchemaContextHolder.getSchema(); if (StringUtil.isNotEmpty(schema)) { create.getTable().setSchema(schema); } else { create.getTable().setSchema(SqlBeanUtil.getTable(clazz).getSchema()); } } </DeepExtract> return SqlHelper.buildCreateSql(create); }
vonce-sqlbean
positive
440,987
@Override protected void act() { DAbout dAbout = new DAbout(this); dAbout.setLocationRelativeTo(this); SwingHelper.showAndWait(dAbout); }
@Override protected void act() { <DeepExtract> DAbout dAbout = new DAbout(this); dAbout.setLocationRelativeTo(this); SwingHelper.showAndWait(dAbout); </DeepExtract> }
portecle
positive
440,988
public Criteria andTextIsNull() { if ("text is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("text is null")); return (Criteria) this; }
public Criteria andTextIsNull() { <DeepExtract> if ("text is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("text is null")); </DeepExtract> return (Criteria) this; }
Tmall_SSM
positive
440,989
public synchronized void update(Canvas canvas, float addX, float addY) { if (null == canvas) throw new NullPointerException(); if (null == cam) cam = new CameraModel(canvas.getWidth(), canvas.getHeight()); else cam.set(canvas.getWidth(), canvas.getHeight()); cam.setViewAngle(Constants.DEFAULT_CAMERA_VIEW_ANGLE); if (null == cam) throw new NullPointerException(); tmpSymbolVector.set(symbolVector); tmpSymbolVector.add(locationXYZRelative2PhysicalLocation); tmpSymbolVector.prod(ARData.getInstance().getRotationMatrix()); tmpTextVector.set(textVector); tmpTextVector.add(locationXYZRelative2PhysicalLocation); tmpTextVector.prod(ARData.getInstance().getRotationMatrix()); cam.projectPoint(tmpSymbolVector, tmpVector, addX, addY); symbolXYZRelative2CameraView.set(tmpVector); cam.projectPoint(tmpTextVector, tmpVector, addX, addY); textXYZRelative2CameraView.set(tmpVector); isOnRadar = false; float range = ARData.getInstance().getRadius(); float scale = range / Radar.RADIUS; locationXYZRelative2PhysicalLocation.get(locationArray); float x = locationArray[0] / scale; float y = locationArray[2] / scale; float[] tmpArrays = new float[3]; if (isNeedIcon) { symbolXYZRelative2CameraView.get(tmpArrays); } else { textXYZRelative2CameraView.get(tmpArrays); } if ((tmpArrays[2] < -1f) && (x * x + y * y) < (Radar.RADIUS * Radar.RADIUS)) { isOnRadar = true; } isInView = false; float[] tmpArrays = new float[3]; if (isNeedIcon) { symbolXYZRelative2CameraView.get(tmpArrays); } else { textXYZRelative2CameraView.get(tmpArrays); } float x1 = tmpArrays[0] + (getWidth() / 2); float y1 = tmpArrays[1] + (getHeight() / 2); float x2 = tmpArrays[0] - (getWidth() / 2); float y2 = tmpArrays[1] - (getHeight() / 2); if (x1 >= -1 && x2 <= (cam.getWidth()) && y1 >= -1 && y2 <= (cam.getHeight())) { isInView = true; } }
public synchronized void update(Canvas canvas, float addX, float addY) { if (null == canvas) throw new NullPointerException(); if (null == cam) cam = new CameraModel(canvas.getWidth(), canvas.getHeight()); else cam.set(canvas.getWidth(), canvas.getHeight()); cam.setViewAngle(Constants.DEFAULT_CAMERA_VIEW_ANGLE); if (null == cam) throw new NullPointerException(); tmpSymbolVector.set(symbolVector); tmpSymbolVector.add(locationXYZRelative2PhysicalLocation); tmpSymbolVector.prod(ARData.getInstance().getRotationMatrix()); tmpTextVector.set(textVector); tmpTextVector.add(locationXYZRelative2PhysicalLocation); tmpTextVector.prod(ARData.getInstance().getRotationMatrix()); cam.projectPoint(tmpSymbolVector, tmpVector, addX, addY); symbolXYZRelative2CameraView.set(tmpVector); cam.projectPoint(tmpTextVector, tmpVector, addX, addY); textXYZRelative2CameraView.set(tmpVector); isOnRadar = false; float range = ARData.getInstance().getRadius(); float scale = range / Radar.RADIUS; locationXYZRelative2PhysicalLocation.get(locationArray); float x = locationArray[0] / scale; float y = locationArray[2] / scale; float[] tmpArrays = new float[3]; if (isNeedIcon) { symbolXYZRelative2CameraView.get(tmpArrays); } else { textXYZRelative2CameraView.get(tmpArrays); } if ((tmpArrays[2] < -1f) && (x * x + y * y) < (Radar.RADIUS * Radar.RADIUS)) { isOnRadar = true; } <DeepExtract> isInView = false; float[] tmpArrays = new float[3]; if (isNeedIcon) { symbolXYZRelative2CameraView.get(tmpArrays); } else { textXYZRelative2CameraView.get(tmpArrays); } float x1 = tmpArrays[0] + (getWidth() / 2); float y1 = tmpArrays[1] + (getHeight() / 2); float x2 = tmpArrays[0] - (getWidth() / 2); float y2 = tmpArrays[1] - (getHeight() / 2); if (x1 >= -1 && x2 <= (cam.getWidth()) && y1 >= -1 && y2 <= (cam.getHeight())) { isInView = true; } </DeepExtract> }
Go
positive
440,990
public long readBigEndian(int startBit, int bitLength) { long result = 0; int currentByte = startBit / 8; int currentBit; for (int i = startBit; i < startBit + bitLength; ) { int offsetBit = i % 8; byte bitSize = (byte) Math.min(8 - offsetBit, bitLength - i + startBit); currentByte = i / 8; if (bitSize == 8) { result <<= 8; result |= this.data[currentByte] & 0xFF; } else { result <<= bitSize; result |= (byte) ((this.data[currentByte] >> (8 - bitSize - offsetBit)) & ((1 << bitSize) - 1)); } i += bitSize; } if (ByteOrder.BIG_ENDIAN == ByteOrder.LITTLE_ENDIAN) { if (bitLength <= 8) { return (byte) result & 0xFF; } else if (bitLength <= 16) { return Short.reverseBytes((short) result) & 0xFFFF; } else if (bitLength <= 32) { return Integer.reverseBytes((int) result) & 0xFFFFFFFFL; } else { return Long.reverseBytes(result); } } return result; }
public long readBigEndian(int startBit, int bitLength) { <DeepExtract> long result = 0; int currentByte = startBit / 8; int currentBit; for (int i = startBit; i < startBit + bitLength; ) { int offsetBit = i % 8; byte bitSize = (byte) Math.min(8 - offsetBit, bitLength - i + startBit); currentByte = i / 8; if (bitSize == 8) { result <<= 8; result |= this.data[currentByte] & 0xFF; } else { result <<= bitSize; result |= (byte) ((this.data[currentByte] >> (8 - bitSize - offsetBit)) & ((1 << bitSize) - 1)); } i += bitSize; } if (ByteOrder.BIG_ENDIAN == ByteOrder.LITTLE_ENDIAN) { if (bitLength <= 8) { return (byte) result & 0xFF; } else if (bitLength <= 16) { return Short.reverseBytes((short) result) & 0xFFFF; } else if (bitLength <= 32) { return Integer.reverseBytes((int) result) & 0xFFFFFFFFL; } else { return Long.reverseBytes(result); } } return result; </DeepExtract> }
cardroid
positive
440,991
public void onCancel() { this.responseObserver = null; this.cancelled = true; if (!this.isCancelled()) { this.responseObserver.onCompleted(); } }
public void onCancel() { this.responseObserver = null; this.cancelled = true; <DeepExtract> if (!this.isCancelled()) { this.responseObserver.onCompleted(); } </DeepExtract> }
FightingICE
positive
440,992
public int getActualInstanceCount(String role) { String val = getRoleOpt(role, RoleKeys.ROLE_ACTUAL_INSTANCES, Integer.toString(0)); return Integer.decode(val); }
public int getActualInstanceCount(String role) { <DeepExtract> String val = getRoleOpt(role, RoleKeys.ROLE_ACTUAL_INSTANCES, Integer.toString(0)); return Integer.decode(val); </DeepExtract> }
hoya
positive
440,995
@Test public void testInheritanceClassNotNullablePackConvert() throws Exception { super.testInheritanceClassNotNullable(); }
@Test public void testInheritanceClassNotNullablePackConvert() throws Exception { <DeepExtract> super.testInheritanceClassNotNullable(); </DeepExtract> }
msgpack-java
positive
440,998
@Override public Future<?> finishProvision(Deployment d) { calls.add("finishProvision"); return Futures.immediateFuture("finishProvision"); }
@Override public Future<?> finishProvision(Deployment d) { <DeepExtract> calls.add("finishProvision"); return Futures.immediateFuture("finishProvision"); </DeepExtract> }
atlas
positive
440,999
@OnClick(R.id.rl_show_image) public void onViewClicked() { finish(); overridePendingTransition(R.anim.activity_banner_left_in, R.anim.activity_banner_right_out); }
@OnClick(R.id.rl_show_image) public void onViewClicked() { <DeepExtract> finish(); overridePendingTransition(R.anim.activity_banner_left_in, R.anim.activity_banner_right_out); </DeepExtract> }
BlackFish
positive
441,001
@Override public Point[] intersect(MultiPolyline a, LineSegment b) { LineSegment[] aLS = a.toLineSegments(); LineSegment[] bLS = new LineSegment[] { b }; List<Point> intersections = new ArrayList<>(); for (int i = 0; i < aLS.length; i++) { for (int j = 0; j < bLS.length; j++) { Point newIntersection = super.intersect(aLS[i], bLS[j]); if (newIntersection != null) { addPoint(intersections, newIntersection); if (false) { return intersections.toArray(new Point[0]); } } } } return intersections.toArray(new Point[0]); }
@Override public Point[] intersect(MultiPolyline a, LineSegment b) { LineSegment[] aLS = a.toLineSegments(); LineSegment[] bLS = new LineSegment[] { b }; <DeepExtract> List<Point> intersections = new ArrayList<>(); for (int i = 0; i < aLS.length; i++) { for (int j = 0; j < bLS.length; j++) { Point newIntersection = super.intersect(aLS[i], bLS[j]); if (newIntersection != null) { addPoint(intersections, newIntersection); if (false) { return intersections.toArray(new Point[0]); } } } } return intersections.toArray(new Point[0]); </DeepExtract> }
spatial-algorithms
positive
441,002
public final Optional<T> max(Comparator<? super T> cmp) { class BoxMax extends Box<T> implements Yield<T> { @Override public final void ret(T item) { if (!isPresent()) turnPresent(item); else if (cmp.compare(item, value) > 0) value = item; } } BoxMax b = new BoxMax(); this.trav.traverse(b); return b.isPresent() ? Optional.of(b.getValue()) : Optional.empty(); }
public final Optional<T> max(Comparator<? super T> cmp) { class BoxMax extends Box<T> implements Yield<T> { @Override public final void ret(T item) { if (!isPresent()) turnPresent(item); else if (cmp.compare(item, value) > 0) value = item; } } BoxMax b = new BoxMax(); <DeepExtract> this.trav.traverse(b); </DeepExtract> return b.isPresent() ? Optional.of(b.getValue()) : Optional.empty(); }
jayield
positive
441,003
public void setShadowRadius(final float shadowRadius) { mShadowRadius = Math.max(MIN_RADIUS, shadowRadius); if (isInEditMode()) return; mPaint.setMaskFilter(new BlurMaskFilter(mShadowRadius, BlurMaskFilter.Blur.NORMAL)); mShadowDx = (float) ((mShadowDistance) * Math.cos(mShadowAngle / 180.0F * Math.PI)); mShadowDy = (float) ((mShadowDistance) * Math.sin(mShadowAngle / 180.0F * Math.PI)); requestLayout(); }
public void setShadowRadius(final float shadowRadius) { mShadowRadius = Math.max(MIN_RADIUS, shadowRadius); if (isInEditMode()) return; mPaint.setMaskFilter(new BlurMaskFilter(mShadowRadius, BlurMaskFilter.Blur.NORMAL)); <DeepExtract> mShadowDx = (float) ((mShadowDistance) * Math.cos(mShadowAngle / 180.0F * Math.PI)); mShadowDy = (float) ((mShadowDistance) * Math.sin(mShadowAngle / 180.0F * Math.PI)); requestLayout(); </DeepExtract> }
UIUtil
positive
441,004
@Test public void testDebug_whenDebugLevel() throws Exception { for (int level = Log.VERBOSE; level <= Log.ASSERT; level++) { when(mMockLockWrap.isLoggable(Logger.LOG_TAG, level)).thenReturn(level >= Log.DEBUG); } when(mMockLockWrap.getStackTraceString(any(Throwable.class))).thenReturn("STACK"); Logger.setInstance(new Logger(mMockLockWrap)); Logger.debug("Test"); verify(mMockLockWrap).println(Log.DEBUG, Logger.LOG_TAG, "Test"); }
@Test public void testDebug_whenDebugLevel() throws Exception { <DeepExtract> for (int level = Log.VERBOSE; level <= Log.ASSERT; level++) { when(mMockLockWrap.isLoggable(Logger.LOG_TAG, level)).thenReturn(level >= Log.DEBUG); } when(mMockLockWrap.getStackTraceString(any(Throwable.class))).thenReturn("STACK"); Logger.setInstance(new Logger(mMockLockWrap)); </DeepExtract> Logger.debug("Test"); verify(mMockLockWrap).println(Log.DEBUG, Logger.LOG_TAG, "Test"); }
active-directory-b2c-android-native-appauth
positive
441,005
private void stopDrag(MotionEvent ev) { mTouchMode = TOUCH_MODE_IDLE; final boolean commitChange = ev.getAction() == MotionEvent.ACTION_UP && isEnabled(); final boolean oldState = isChecked(); if (commitChange) { mVelocityTracker.computeCurrentVelocity(1000); final float xvel = mVelocityTracker.getXVelocity(); if (Math.abs(xvel) > CHANGE_FLING_VELOCITY || (Math.abs(xvel) > MIN_FLING_VELOCITY || mThumbPosition != 0.0f || mThumbPosition != 1.0f)) { newState = ViewUtils.isLayoutRtl(this) ? (xvel < 0) : (xvel > 0); } else { newState = getTargetCheckedState(); } } else { newState = oldState; } if (newState != oldState) { playSoundEffect(SoundEffectConstants.CLICK); } super.setChecked(newState); boolean checked2 = isChecked(); if (getWindowToken() != null && ViewCompat.isLaidOut(this)) { animateThumbToCheckedState(checked2); } else { cancelPositionAnimator(); setThumbPosition(checked2 ? 1 : 0); } MotionEvent cancel = MotionEvent.obtain(ev); cancel.setAction(MotionEvent.ACTION_CANCEL); super.onTouchEvent(cancel); cancel.recycle(); }
private void stopDrag(MotionEvent ev) { mTouchMode = TOUCH_MODE_IDLE; final boolean commitChange = ev.getAction() == MotionEvent.ACTION_UP && isEnabled(); final boolean oldState = isChecked(); if (commitChange) { mVelocityTracker.computeCurrentVelocity(1000); final float xvel = mVelocityTracker.getXVelocity(); if (Math.abs(xvel) > CHANGE_FLING_VELOCITY || (Math.abs(xvel) > MIN_FLING_VELOCITY || mThumbPosition != 0.0f || mThumbPosition != 1.0f)) { newState = ViewUtils.isLayoutRtl(this) ? (xvel < 0) : (xvel > 0); } else { newState = getTargetCheckedState(); } } else { newState = oldState; } if (newState != oldState) { playSoundEffect(SoundEffectConstants.CLICK); } super.setChecked(newState); boolean checked2 = isChecked(); if (getWindowToken() != null && ViewCompat.isLaidOut(this)) { animateThumbToCheckedState(checked2); } else { cancelPositionAnimator(); setThumbPosition(checked2 ? 1 : 0); } <DeepExtract> MotionEvent cancel = MotionEvent.obtain(ev); cancel.setAction(MotionEvent.ACTION_CANCEL); super.onTouchEvent(cancel); cancel.recycle(); </DeepExtract> }
SamsungOneUi
positive
441,008
@Override public void onClick(View v, BaseAlertDialog dialog) { try { camera.stopPreview(); } catch (NullPointerException e) { e.printStackTrace(); } dialog.dismiss(); }
@Override public void onClick(View v, BaseAlertDialog dialog) { <DeepExtract> try { camera.stopPreview(); } catch (NullPointerException e) { e.printStackTrace(); } dialog.dismiss(); </DeepExtract> }
crofis-android-uikit
positive
441,009
public void startWithOrder() { system = new MenuSystem(); display = new MenuGUI((MenuSystem) system); system.start(); ((MenuSystem) this.system).showOrderMenu(); }
public void startWithOrder() { <DeepExtract> system = new MenuSystem(); display = new MenuGUI((MenuSystem) system); system.start(); </DeepExtract> ((MenuSystem) this.system).showOrderMenu(); }
FF1-Battle-System
positive
441,010
public static boolean isExtension(String filename, Collection extensions) { if (filename == null) { return false; } if (extensions == null || extensions.isEmpty()) { return (indexOfExtension(filename) == -1); } String fileExt; if (filename == null) { fileExt = null; } int index = indexOfExtension(filename); if (index == -1) { fileExt = ""; } else { fileExt = filename.substring(index + 1); } for (Iterator it = extensions.iterator(); it.hasNext(); ) { if (fileExt.equals(it.next())) { return true; } } return false; }
public static boolean isExtension(String filename, Collection extensions) { if (filename == null) { return false; } if (extensions == null || extensions.isEmpty()) { return (indexOfExtension(filename) == -1); } <DeepExtract> String fileExt; if (filename == null) { fileExt = null; } int index = indexOfExtension(filename); if (index == -1) { fileExt = ""; } else { fileExt = filename.substring(index + 1); } </DeepExtract> for (Iterator it = extensions.iterator(); it.hasNext(); ) { if (fileExt.equals(it.next())) { return true; } } return false; }
spring-file-storage-service
positive
441,011
public static Builder newBuilder(com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq prototype) { if (prototype instanceof com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq) { return mergeFrom((com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq) prototype); } else { super.mergeFrom(prototype); return this; } }
public static Builder newBuilder(com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq prototype) { <DeepExtract> if (prototype instanceof com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq) { return mergeFrom((com.fuchuan.customerservice.common.FetchAccountListBaseInfoReq) prototype); } else { super.mergeFrom(prototype); return this; } </DeepExtract> }
customer-service
positive
441,012
public GenericObject getCountry(String tag) { GenericObject hist = ctryHistoryCache.get(tag); if (hist == null) { final String histFile = resolveCountryHistoryFile(tag); if (histFile == null) { System.err.println("Cannot find country history file for " + tag); return null; } hist = EUGFileIO.load(histFile, settings); if (hist == null) { System.err.println("Failed to load country history file for " + tag); } else { ctryHistoryCache.put(tag, hist); } } return hist; }
public GenericObject getCountry(String tag) { <DeepExtract> GenericObject hist = ctryHistoryCache.get(tag); if (hist == null) { final String histFile = resolveCountryHistoryFile(tag); if (histFile == null) { System.err.println("Cannot find country history file for " + tag); return null; } hist = EUGFileIO.load(histFile, settings); if (hist == null) { System.err.println("Failed to load country history file for " + tag); } else { ctryHistoryCache.put(tag, hist); } } return hist; </DeepExtract> }
vic2_economy_analyzer
positive
441,015
@Override public SignatureKeyPairRecord value5(LocalDateTime value) { set(4, value); return this; }
@Override public SignatureKeyPairRecord value5(LocalDateTime value) { <DeepExtract> set(4, value); </DeepExtract> return this; }
openvsx
positive
441,017
public Criteria andBz108LessThanOrEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "bz108" + " cannot be null"); } criteria.add(new Criterion("`bz108` <=", value)); return (Criteria) this; }
public Criteria andBz108LessThanOrEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "bz108" + " cannot be null"); } criteria.add(new Criterion("`bz108` <=", value)); </DeepExtract> return (Criteria) this; }
blockhealth
positive
441,018
public char get(char key) { if (key == 0) { return hasZeroValue ? zeroValue : defaultReturnValue; } int i; char[] keyTable = this.keyTable; for (int i = place(key); ; i = i + 1 & mask) { char other = keyTable[i]; if (other == 0) { i = ~i; } if (other == key) { i = i; } } return i < 0 ? defaultReturnValue : valueTable[i]; }
public char get(char key) { if (key == 0) { return hasZeroValue ? zeroValue : defaultReturnValue; } <DeepExtract> int i; char[] keyTable = this.keyTable; for (int i = place(key); ; i = i + 1 & mask) { char other = keyTable[i]; if (other == 0) { i = ~i; } if (other == key) { i = i; } } </DeepExtract> return i < 0 ? defaultReturnValue : valueTable[i]; }
RegExodus
positive
441,019
private void writeTerm(InMemoryTerm term, int offset) throws IOException { if (termSize.isConstant()) ByteBufferUtil.write(term, buffer); else ByteBufferUtil.writeWithShortLength(term, buffer); buffer.writeByte(0x0); buffer.writeInt(offset); }
private void writeTerm(InMemoryTerm term, int offset) throws IOException { <DeepExtract> if (termSize.isConstant()) ByteBufferUtil.write(term, buffer); else ByteBufferUtil.writeWithShortLength(term, buffer); </DeepExtract> buffer.writeByte(0x0); buffer.writeInt(offset); }
sasi
positive
441,020
public static long readInt(InputStream inputStream) throws IOException { byte[] data = new byte[INT_SIZE]; int nbBytesToRead = data.length; int nbBytesRead = 0; while (nbBytesRead < nbBytesToRead) { int nbBytesActuallyRead = inputStream.read(data, nbBytesRead, nbBytesToRead - nbBytesRead); if (nbBytesActuallyRead < 0) throw new EOFException(); nbBytesRead += nbBytesActuallyRead; } return ((data[0] & 0xFF) << 8) + data[1]; }
public static long readInt(InputStream inputStream) throws IOException { byte[] data = new byte[INT_SIZE]; <DeepExtract> int nbBytesToRead = data.length; int nbBytesRead = 0; while (nbBytesRead < nbBytesToRead) { int nbBytesActuallyRead = inputStream.read(data, nbBytesRead, nbBytesToRead - nbBytesRead); if (nbBytesActuallyRead < 0) throw new EOFException(); nbBytesRead += nbBytesActuallyRead; } </DeepExtract> return ((data[0] & 0xFF) << 8) + data[1]; }
SetupBuilder
positive
441,023
@Override public void open() throws Exception { logger.debug("Opening SSH connection to {}@{}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname()); JSch jsch = new JSch(); Session session = jsch.getSession(fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname(), fsSettings.getServer().getPort()); java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); if (fsSettings.getServer().getPemPath() != null) { jsch.addIdentity(fsSettings.getServer().getPemPath()); } session.setConfig(config); if (fsSettings.getServer().getPassword() != null) { session.setPassword(fsSettings.getServer().getPassword()); } try { session.connect(); } catch (JSchException e) { logger.warn("Cannot connect with SSH to {}@{}: {}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname(), e.getMessage()); throw e; } Channel channel = session.openChannel("sftp"); channel.connect(); if (!channel.isConnected()) { logger.warn("Cannot connect with SSH to {}@{}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname()); throw new RuntimeException("Can not connect to " + fsSettings.getServer().getUsername() + "@" + fsSettings.getServer().getHostname()); } logger.debug("SSH connection successful"); return (ChannelSftp) channel; }
@Override public void open() throws Exception { <DeepExtract> logger.debug("Opening SSH connection to {}@{}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname()); JSch jsch = new JSch(); Session session = jsch.getSession(fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname(), fsSettings.getServer().getPort()); java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); if (fsSettings.getServer().getPemPath() != null) { jsch.addIdentity(fsSettings.getServer().getPemPath()); } session.setConfig(config); if (fsSettings.getServer().getPassword() != null) { session.setPassword(fsSettings.getServer().getPassword()); } try { session.connect(); } catch (JSchException e) { logger.warn("Cannot connect with SSH to {}@{}: {}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname(), e.getMessage()); throw e; } Channel channel = session.openChannel("sftp"); channel.connect(); if (!channel.isConnected()) { logger.warn("Cannot connect with SSH to {}@{}", fsSettings.getServer().getUsername(), fsSettings.getServer().getHostname()); throw new RuntimeException("Can not connect to " + fsSettings.getServer().getUsername() + "@" + fsSettings.getServer().getHostname()); } logger.debug("SSH connection successful"); return (ChannelSftp) channel; </DeepExtract> }
fscrawler
positive
441,024
public String subPathToString(AbstractPath<V> path) { StringBuilder result = new StringBuilder(); if (path instanceof SequencePath) { SequencePath<V> seq = (SequencePath<V>) path; Iterator<AbstractPath<V>> it = seq.subPaths.iterator(); if (it.hasNext()) { AbstractPath<V> subPath = it.next(); result.append(subPathToString(subPath)); while (it.hasNext()) { subPath = it.next(); result.append(", " + subPathToString(subPath)); } } } else { Iterator<Node<V>> itNodes = path.iterator(); result.append(itNodes.next()); while (itNodes.hasNext()) result.append(", " + itNodes.next()); } if (path instanceof CyclePath || path instanceof InfinitePath) result.append(", ..., " + path.from()); StringBuilder s = new StringBuilder(); s.append("["); s.append(subPathToString(this)); s.append("]"); return s.toString(); }
public String subPathToString(AbstractPath<V> path) { StringBuilder result = new StringBuilder(); if (path instanceof SequencePath) { SequencePath<V> seq = (SequencePath<V>) path; Iterator<AbstractPath<V>> it = seq.subPaths.iterator(); if (it.hasNext()) { AbstractPath<V> subPath = it.next(); result.append(subPathToString(subPath)); while (it.hasNext()) { subPath = it.next(); result.append(", " + subPathToString(subPath)); } } } else { Iterator<Node<V>> itNodes = path.iterator(); result.append(itNodes.next()); while (itNodes.hasNext()) result.append(", " + itNodes.next()); } if (path instanceof CyclePath || path instanceof InfinitePath) result.append(", ..., " + path.from()); <DeepExtract> StringBuilder s = new StringBuilder(); s.append("["); s.append(subPathToString(this)); s.append("]"); return s.toString(); </DeepExtract> }
PESTT
positive
441,025
public int getAverageSignalStrength(int cellID) { String query = String.format(Locale.US, "SELECT avg(rx_signal) FROM DBi_measure WHERE bts_id= %d", cellID); Cursor c = mDb.rawQuery(query, null); c.moveToFirst(); int lAnswer = c.getInt(0); mDb.close(); return lAnswer; }
public int getAverageSignalStrength(int cellID) { String query = String.format(Locale.US, "SELECT avg(rx_signal) FROM DBi_measure WHERE bts_id= %d", cellID); Cursor c = mDb.rawQuery(query, null); c.moveToFirst(); int lAnswer = c.getInt(0); <DeepExtract> mDb.close(); </DeepExtract> return lAnswer; }
AIMSICDL
positive
441,027
public void backupToStream(OutputStreamData streamData) { if (taskBackup != null) { return; } if (backupProgress == null) { backupProgress = new ProgressDialog(CategoryList.this); backupProgress.setMessage(getString(R.string.backup_progress) + " " + PreferenceActivity.getBackupPath(CategoryList.this)); backupProgress.setIndeterminate(false); backupProgress.setCancelable(false); } backupProgress.show(); taskBackup = new backupTask(); currentActivity = this; taskBackup.execute(streamData); }
public void backupToStream(OutputStreamData streamData) { if (taskBackup != null) { return; } if (backupProgress == null) { backupProgress = new ProgressDialog(CategoryList.this); backupProgress.setMessage(getString(R.string.backup_progress) + " " + PreferenceActivity.getBackupPath(CategoryList.this)); backupProgress.setIndeterminate(false); backupProgress.setCancelable(false); } backupProgress.show(); taskBackup = new backupTask(); <DeepExtract> currentActivity = this; </DeepExtract> taskBackup.execute(streamData); }
safe
positive
441,028
public void pass(String name, String address) { this.counter++; this.name = name; this.address = address; if (name.charAt(0) != address.charAt(0)) { System.out.println("***** BROKEN ***** " + toString()); } }
public void pass(String name, String address) { this.counter++; this.name = name; this.address = address; <DeepExtract> if (name.charAt(0) != address.charAt(0)) { System.out.println("***** BROKEN ***** " + toString()); } </DeepExtract> }
ijmtdp
positive
441,030
public Drawable getAsDrawable(Context context, String key) { if (getAsBinary(key) == null) { return null; } if (Utils.bytesToBitmap(getAsBinary(key)) == null) { return null; } return new BitmapDrawable(context.getResources(), Utils.bytesToBitmap(getAsBinary(key))); }
public Drawable getAsDrawable(Context context, String key) { if (getAsBinary(key) == null) { return null; } <DeepExtract> if (Utils.bytesToBitmap(getAsBinary(key)) == null) { return null; } return new BitmapDrawable(context.getResources(), Utils.bytesToBitmap(getAsBinary(key))); </DeepExtract> }
SimpleProject
positive
441,034