auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String postBlobAndVerify(HttpHeaders headers, ByteBuffer content) throws ExecutionException, InterruptedException { FullHttpRequest httpRequest = buildRequest(HttpMethod.POST, "/", headers, content); Queue<HttpObject> responseParts = nettyClient.sendRequest(httpRequest, null, null).get(); HttpResponse response = (HttpResponse) responseParts.poll(); discardContent(responseParts); assertEquals("Unexpected response status", HttpResponseStatus.CREATED, response.getStatus()); assertTrue("No Date header", HttpHeaders.getDateHeader(response, HttpHeaders.Names.DATE, null) != null); assertTrue("No " + RestUtils.Headers.CREATION_TIME, HttpHeaders.getHeader(response, RestUtils.Headers.CREATION_TIME, null) != null); assertEquals("Content-Length is not 0", 0, HttpHeaders.getContentLength(response)); String blobId = HttpHeaders.getHeader(response, HttpHeaders.Names.LOCATION, null); if (blobId == null) { fail("postBlobAndVerify did not return a blob ID"); } return blobId; }

Target:
private String postBlobAndVerify(HttpHeaders headers, ByteBuffer content) throws ExecutionException, InterruptedException { FullHttpRequest httpRequest = buildRequest(HttpMethod.POST, "/", headers, content); Queue<HttpObject> responseParts = nettyClient.sendRequest(httpRequest, null, null).get(); HttpResponse response = (HttpResponse) responseParts.poll(); discardContent(responseParts, 1); assertEquals("Unexpected response status", HttpResponseStatus.CREATED, response.getStatus()); assertTrue("No Date header", HttpHeaders.getDateHeader(response, HttpHeaders.Names.DATE, null) != null); assertTrue("No " + RestUtils.Headers.CREATION_TIME, HttpHeaders.getHeader(response, RestUtils.Headers.CREATION_TIME, null) != null); assertEquals("Content-Length is not 0", 0, HttpHeaders.getContentLength(response)); String blobId = HttpHeaders.getHeader(response, HttpHeaders.Names.LOCATION, null); if (blobId == null) { fail("postBlobAndVerify did not return a blob ID"); } return blobId; }
Source:
public boolean isLeaf() { return isTest(); }

Target:
public boolean isLeaf() { return !isContainer(); }
Source:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int indice; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); for (int j = 0; j < internalAggs.size(); ++j) { internalAggs.get(j).initState(groupStates.getData()); } indice = groupStates.getData().numTuples() - 1; } else { indice = iter.next(); } for (int j = 0; j < internalAggs.size(); ++j) { internalAggs.get(j).addRow(tb, row, groupStates.getData(), indice); } } tb = child.nextReady(); } if (child.eos()) { generateResult(); return resultBuffer.popAny(); } return null; }

Target:
protected TupleBatch fetchNextReady() throws DbException { final Operator child = getChild(); TupleBatch tb = child.nextReady(); while (tb != null) { for (int row = 0; row < tb.numTuples(); ++row) { IntIterator iter = groupStates.getIndices(tb, gfields, row).intIterator(); int index; if (!iter.hasNext()) { groupStates.addTuple(tb, gfields, row, true); int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.initState(groupStates.getData(), offset); offset += agg.getStateSize(); } index = groupStates.getData().numTuples() - 1; } else { index = iter.next(); } int offset = gfields.length; for (Aggregator agg : internalAggs) { agg.addRow(tb, row, groupStates.getData(), index, offset); offset += agg.getStateSize(); } } tb = child.nextReady(); } if (child.eos()) { generateResult(); return resultBuffer.popAny(); } return null; }
Source:
public BoundedNettyByteBufReceive replace(ByteBuf content) { BoundedNettyByteBufReceive receive = new BoundedNettyByteBufReceive(content, sizeToRead); return receive; }

Target:
public BoundedNettyByteBufReceive replace(ByteBuf content) { return new BoundedNettyByteBufReceive(content, sizeToRead); }
Source:
public String getPath() { return organization + "/" + repository; }

Target:
public String getPath() { return String.format("%s/%s", organization, repositoryName); }
Source:
private static AsyncWriteChannelOptions getWriteChannelOptions(Configuration config) { return AsyncWriteChannelOptions.builder() .setBufferSize(GCS_OUTPUT_STREAM_BUFFER_SIZE.get(config, config::getInt)) .setPipeBufferSize(GCS_OUTPUT_STREAM_PIPE_BUFFER_SIZE.get(config, config::getInt)) .setPipeType(GCS_OUTPUT_STREAM_PIPE_TYPE.get(config, config::getEnum)) .setUploadChunkSize(GCS_OUTPUT_STREAM_UPLOAD_CHUNK_SIZE.get(config, config::getInt)) .setUploadCacheSize(GCS_OUTPUT_STREAM_UPLOAD_CACHE_SIZE.get(config, config::getInt)) .setDirectUploadEnabled( GCS_OUTPUT_STREAM_DIRECT_UPLOAD_ENABLE.get(config, config::getBoolean)) .setGrpcChecksumsEnabled(GCS_GRPC_CHECKSUMS_ENABLE.get(config, config::getBoolean)) .setGenerationMismatchForOverwriteMutationsIgnored( GCS_OVERWRITE_GENERATION_MISMATCH_IGNORE.get(config, config::getBoolean)) .build(); }

Target:
private static AsyncWriteChannelOptions getWriteChannelOptions(Configuration config) { return AsyncWriteChannelOptions.builder() .setBufferSize(GCS_OUTPUT_STREAM_BUFFER_SIZE.get(config, config::getInt)) .setPipeBufferSize(GCS_OUTPUT_STREAM_PIPE_BUFFER_SIZE.get(config, config::getInt)) .setPipeType(GCS_OUTPUT_STREAM_PIPE_TYPE.get(config, config::getEnum)) .setUploadChunkSize(GCS_OUTPUT_STREAM_UPLOAD_CHUNK_SIZE.get(config, config::getInt)) .setUploadCacheSize(GCS_OUTPUT_STREAM_UPLOAD_CACHE_SIZE.get(config, config::getInt)) .setDirectUploadEnabled( GCS_OUTPUT_STREAM_DIRECT_UPLOAD_ENABLE.get(config, config::getBoolean)) .setGrpcChecksumsEnabled(GCS_GRPC_CHECKSUMS_ENABLE.get(config, config::getBoolean)) .build(); }
Source:
public void init(String attributeName, Attribute.Type attributeType) { Attribute set; Expression setInitialValue; if (attributeType.equals(Attribute.Type.FLOAT) || attributeType.equals(Attribute.Type.DOUBLE) || attributeType.equals(Attribute.Type.INT) || attributeType.equals(Attribute.Type.LONG) || attributeType.equals(Attribute.Type.STRING) || attributeType.equals(Attribute.Type.BOOL)) { set = new Attribute("AGG_SET_".concat(attributeName), Attribute.Type.OBJECT); setInitialValue = Expression.function("createSet", Expression.variable(attributeName)); } else { throw new SiddhiAppRuntimeException( "Distinct count aggregation cannot be executed on attribute type " + attributeType.toString()); } this.baseAttributes = new Attribute[]{set}; this.baseAttributesInitialValues = new Expression[]{setInitialValue}; assert baseAttributes.length == baseAttributesInitialValues.length; }

Target:
public void init(String attributeName, Attribute.Type attributeType) { Attribute set; Expression setInitialValue; if (attributeType.equals(Attribute.Type.FLOAT) || attributeType.equals(Attribute.Type.DOUBLE) || attributeType.equals(Attribute.Type.INT) || attributeType.equals(Attribute.Type.LONG) || attributeType.equals(Attribute.Type.STRING) || attributeType.equals(Attribute.Type.BOOL)) { set = new Attribute("AGG_SET_".concat(attributeName), Attribute.Type.OBJECT); setInitialValue = Expression.function("createSet", Expression.variable(attributeName)); } else { throw new SiddhiAppRuntimeException( "Distinct count aggregation cannot be executed on attribute type " + attributeType.toString()); } this.baseAttributes = new Attribute[]{set}; this.baseAttributesInitialValues = new Expression[]{setInitialValue}; }
Source:
public void onPostValidation(boolean valid) { View errorView = findViewById(R.id.error_view); if (errorView != null) { errorView.setVisibility(valid ? GONE : VISIBLE); } int max = getGridLinearLayout().getChildCount(); for (int i = 0; i < max; i++) { DDMFieldGridRowView gridRowView = (DDMFieldGridRowView) getGridLinearLayout().getChildAt(i); Drawable drawable; drawable = getContext().getResources().getDrawable(R.drawable.lexicon_grid_row_view_error_drawable); FormViewUtil.setupBackground(valid ? null : drawable, gridRowView); DDLFieldSelectView columnSelectView = gridRowView.getColumnSelectView(); if (valid) { drawable = getContext().getResources().getDrawable(R.drawable.default_grid_edit_text_selector); } else { drawable = getContext().getResources().getDrawable(R.drawable.lexicon_grid_select_error_drawable); } FormViewUtil.setupBackground(drawable, columnSelectView.getTextEditText()); } }

Target:
public void onPostValidation(boolean valid) { FormViewUtil.setupErrorView(valid, findViewById(R.id.error_view)); int max = getGridLinearLayout().getChildCount(); Drawable backgroundErrorDrawable = getContext().getResources().getDrawable(R.drawable.lexicon_grid_row_view_error_drawable); Drawable editTextDefaultDrawable = getContext().getResources().getDrawable(R.drawable.default_grid_edit_text_selector); Drawable editTextErrorDrawable = getContext().getResources().getDrawable(R.drawable.lexicon_grid_select_error_drawable); for (int i = 0; i < max; i++) { DDMFieldGridRowView gridRowView = (DDMFieldGridRowView) getGridLinearLayout().getChildAt(i); EditText columnEditText = gridRowView.getColumnSelectView().getTextEditText(); if (valid) { gridRowView.setBackground(null); columnEditText.setBackground(editTextDefaultDrawable); } else { gridRowView.setBackground(backgroundErrorDrawable); columnEditText.setBackground(editTextErrorDrawable); } } }
Source:
public Header(long id, String shortName, String name, Form form, int index) { setId(required(id,"id is required")); setShortName(required(shortName,"shortName is required")); setName(required(name,"name is required")); setForm(required(form,"form is required")); setIndex(required(index,"index is required")); }

Target:
public Header(long id, String shortName, String name, Form form, int index) { this.id = required(id, "id is required"); this.shortName = required(shortName, "shortName is required"); this.name = required(name, "name is required"); this.form = required(form, "form is required"); this.index = required(index, "index is required"); }
Source:
public EvalBinding(IBinding binding, IType type, IBinding templateDefinition) { super(templateDefinition); fParameterPosition = -1; fBinding= binding; fType= type; fFixedType= type != null; if (fBinding == null) { CCorePlugin.log(new NullPointerException()); } }

Target:
public EvalBinding(IBinding binding, IType type, IBinding templateDefinition) { super(templateDefinition); fParameterPosition = -1; fBinding= binding; fType= type; fFixedType= type != null; }
Source:
public void initialize(URL location, ResourceBundle resources) { metricResultsListView.setCellFactory(param -> new MetricResultListCell()); scopeHierarchyTreeView.setCellFactory(param -> new ScopeHierarchyTreeCell()); scopeHierarchyTreeView.getSelectionModel().selectedItemProperty().addListener((obs, oldVal, newVal) -> { if (newVal != null && newVal.getValue() instanceof NameDeclaration) { parent.onNameDeclarationSelected((NameDeclaration) newVal.getValue()); } }); }

Target:
public void initialize(URL location, ResourceBundle resources) { scopeHierarchyTreeView.getSelectionModel().selectedItemProperty().addListener((obs, oldVal, newVal) -> { if (newVal != null && newVal.getValue() instanceof NameDeclaration) { parent.onNameDeclarationSelected((NameDeclaration) newVal.getValue()); } }); }
Source:
public void testQueryFromCode() { final String drl = "import org.drools.compiler.oopath.model.Thing;\n" + "query isContainedIn( Thing $x, Thing $y )\n" + " $y := /$x/children\n" + "or\n" + " ( $z := /$x/children and isContainedIn( $z, $y; ) )\n" + "end\n"; final List<String> itemList = Arrays.asList(new String[] { "display", "keyboard", "processor" }); final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); Thing smartphone = new Thing("smartphone"); for ( String item : itemList ) { Thing component = new Thing(item); smartphone.addChild(component); } ksession.insert(smartphone); QueryResults queryResults = ksession.getQueryResults("isContainedIn", new Object[] { smartphone, Variable.v }); List<String> resultList = new ArrayList<>(); for(QueryResultsRow row : queryResults) { Thing component = (Thing) row.get("$y"); resultList.add(component.getName()); } assertThat(resultList).as("Querry does not contain all items").containsAll(itemList); ksession.dispose(); }

Target:
public void testQueryFromCode() { final String drl = "import org.drools.compiler.oopath.model.Thing;\n" + "query isContainedIn( Thing $x, Thing $y )\n" + " $y := /$x/children\n" + "or\n" + " ( $z := /$x/children and isContainedIn( $z, $y; ) )\n" + "end\n"; final Thing smartphone = new Thing("smartphone"); final List<String> itemList = Arrays.asList(new String[] { "display", "keyboard", "processor" }); itemList.stream().map(item -> new Thing(item)).forEach((thing) -> smartphone.addChild(thing)); final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); ksession.insert(smartphone); final QueryResults queryResults = ksession.getQueryResults("isContainedIn", new Object[] { smartphone, Variable.v }); final List<String> resultList = StreamSupport.stream(queryResults.spliterator(), false) .map(row -> ((Thing) row.get("$y")).getName()).collect(Collectors.toList()); assertThat(resultList).as("Query does not contain all items").containsAll(itemList); ksession.dispose(); }
Source:
public Geometry extractAggregationResult(AggregationResultHolder aggregationResultHolder) { return aggregationResultHolder.getResult(); }

Target:
public Geometry extractAggregationResult(AggregationResultHolder aggregationResultHolder) { Geometry geometry = aggregationResultHolder.getResult(); return geometry == null ? GeometryUtils.EMPTY_POINT : geometry; }
Source:
private Disposable testSubscribeOn() { Disposable subscribeOn = realm.asFlowable() .map(realm -> realm.where(Person.class).findAllSorted("name").get(0)) .subscribeOn(Schedulers.io()) .subscribe( person -> {}, throwable -> showStatus("subscribeOn: " + throwable.toString()) ); Disposable asyncSubscribeOn = realm.where(Person.class).findAllSortedAsync("name").get(0).<Person>asFlowable() .subscribe( person -> showStatus("subscribeOn/async: " + person.getName() + ":" + person.getAge()), throwable -> showStatus("subscribeOn/async: " +throwable.toString()) ); return new CompositeDisposable(subscribeOn, asyncSubscribeOn); }

Target:
private void testSubscribeOn() { Disposable subscribeOnDisposable = realm.asFlowable() .map(realm -> realm.where(Person.class).findAllSorted("name").get(0)) .subscribeOn(Schedulers.io()) .subscribe( person -> {}, throwable -> showStatus("subscribeOn: " + throwable.toString()) ); compositeDisposable.add(subscribeOnDisposable); Disposable asyncSubscribeOnDisposable = realm.where(Person.class).findAllSortedAsync("name").get(0).<Person>asFlowable() .subscribe( person -> showStatus("subscribeOn/async: " + person.getName() + ":" + person.getAge()), throwable -> showStatus("subscribeOn/async: " +throwable.toString()) ); compositeDisposable.add(asyncSubscribeOnDisposable); }
Source:
public List<Class> getSupportedTypes() { return new ArrayList<>(Arrays.asList(BigInteger.class)); }

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(BigInteger.class); }
Source:
public void test_controlled_access_non_expired_study_scope_succeeds() { val choices = List.of(false, true); boolean everythingPassed = true; for (val hasOther : choices) { val result = run_test(false, true, false, true, hasOther); if (!result) { System.err.printf("Access wasn't granted to non-expired token (scopes='%s')", getScopes(false, true, hasOther)); everythingPassed = false; } } assertTrue(everythingPassed); }

Target:
public void test_controlled_access_non_expired_study_scope_succeeds() { val choices = List.of(false, true); boolean everythingPassed = true; for (val hasOther : choices) { val result = run_test(false, false, false, true, hasOther); if (!result) { System.err.printf("Access wasn't granted to non-expired token (scopes='%s')", getScopes(false, true, hasOther)); everythingPassed = false; } } assertTrue(everythingPassed); }
Source:
public void canDoActionUpdateDescriptionVmDown() { canDoActionUpdateWipeAfterDelete(VMStatus.Down); }

Target:
public void canDoActionUpdateDescriptionVmDown() { canDoActionUpdateDescription(VMStatus.Down); }
Source:
public void runOnMainThreadLater(DaemonManager dm, final Runnable r) { if(!CommandHelperPlugin.self.isEnabled()) { throw new CancelCommandException("CommandHelper tried to schedule a task while the plugin was disabled (is the server shutting down?).", Target.UNKNOWN); } Bukkit.getServer().getScheduler().callSyncMethod(CommandHelperPlugin.self, new Callable<Object>() { @Override public Object call() throws Exception { r.run(); return null; } }); }

Target:
public void runOnMainThreadLater(DaemonManager dm, final Runnable r) { if(!CommandHelperPlugin.self.isEnabled()) { throw new CancelCommandException(Implementation.GetServerType().getBranding() + " tried to schedule a task while the plugin was disabled (is the server shutting down?).", Target.UNKNOWN); } Bukkit.getServer().getScheduler().callSyncMethod(CommandHelperPlugin.self, new Callable<Object>() { @Override public Object call() throws Exception { r.run(); return null; } }); }
Source:
public <T> CodeWriter writeArray(String delimiter, List<T> l, Function<T, String> map) { if (l.size() == 0) return this; int i = 0; for (; i < l.size() - 1; i++) { write(map.apply(l.get(i)) + delimiter); } write(map.apply(l.get(i))); return this; }

Target:
public <T> CodeWriter writeArray(String delimiter, List<T> l, Function<T, String> map) { return writeArray(delimiter, l.stream().map(map)); }
Source:
private void initLabel(PatchSetPublishDetail r, String labelName, Panel body) { JsArrayString nativeValues = change.permitted_values(labelName); if (nativeValues == null || nativeValues.length() == 0) { return; } List<String> values = new ArrayList<String>(nativeValues.length()); for (int i = 0; i < nativeValues.length(); i++) { values.add(nativeValues.get(i)); } Collections.reverse(values); LabelInfo label = change.label(labelName); body.add(new SmallHeading(label.name() + ":")); VerticalPanel vp = new VerticalPanel(); vp.setStyleName(Gerrit.RESOURCES.css().approvalCategoryList()); Short prior = null; for (ApprovalInfo app : label.all().asList()) { if (app._account_id() == Gerrit.getUserAccount().getId().get()) { prior = app.value(); break; } } for (String value : values) { ValueRadioButton b = new ValueRadioButton(label, value); SafeHtml buf = new SafeHtmlBuilder().append(b.format()); buf = CommentLinkProcessor.apply(buf); SafeHtml.set(b, buf); if (lastState != null && patchSetId.equals(lastState.patchSetId) && lastState.approvals.containsKey(label.name())) { b.setValue(lastState.approvals.get(label.name()) == value); } else { b.setValue(b.parseValue() == (prior != null ? prior : 0)); } approvalButtons.add(b); vp.add(b); } body.add(vp); }

Target:
private void initLabel(PatchSetPublishDetail r, String labelName, Panel body) { JsArrayString nativeValues = change.permitted_values(labelName); if (nativeValues == null || nativeValues.length() == 0) { return; } List<String> values = new ArrayList<String>(nativeValues.length()); for (int i = 0; i < nativeValues.length(); i++) { values.add(nativeValues.get(i)); } Collections.reverse(values); LabelInfo label = change.label(labelName); body.add(new SmallHeading(label.name() + ":")); VerticalPanel vp = new VerticalPanel(); vp.setStyleName(Gerrit.RESOURCES.css().approvalCategoryList()); Short prior = null; for (ApprovalInfo app : Natives.asList(label.all())) { if (app._account_id() == Gerrit.getUserAccount().getId().get()) { prior = app.value(); break; } } for (String value : values) { ValueRadioButton b = new ValueRadioButton(label, value); SafeHtml buf = new SafeHtmlBuilder().append(b.format()); buf = CommentLinkProcessor.apply(buf); SafeHtml.set(b, buf); if (lastState != null && patchSetId.equals(lastState.patchSetId) && lastState.approvals.containsKey(label.name())) { b.setValue(lastState.approvals.get(label.name()) == value); } else { b.setValue(b.parseValue() == (prior != null ? prior : 0)); } approvalButtons.add(b); vp.add(b); } body.add(vp); }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitCompositeLit(@NotNull GoCompositeLit o) { super.visitCompositeLit(o); if (PsiTreeUtil.getParentOfType(o, GoReturnStatement.class, GoShortVarDeclaration.class, GoAssignmentStatement.class) == null) return; GoType type = o.getType(); if (!(type instanceof GoStructType) && !(GoPsiImplUtil.findBaseTypeFromRef(o.getTypeReferenceExpression()) instanceof GoSpecType)) { return; } for (GoElement element : o.getLiteralValue().getElementList()) { if (element.getKey() == null) { holder.registerProblem(o, "Structure has unnamed field initialization", ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return; } } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitCompositeLit(@NotNull GoCompositeLit o) { super.visitCompositeLit(o); if (PsiTreeUtil.getParentOfType(o, GoReturnStatement.class, GoShortVarDeclaration.class, GoAssignmentStatement.class) == null) return; GoType type = o.getType(); if (!(type instanceof GoStructType) && !(GoPsiImplUtil.findBaseTypeFromRef(o.getTypeReferenceExpression()) instanceof GoSpecType)) { return; } for (GoElement element : o.getLiteralValue().getElementList()) { if (element.getKey() == null) { holder.registerProblem(element, "Unnamed field initialization", ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } } }; }
Source:
public void testlogAllRefUpdates() throws Exception { long commitTime = 1154236443000L; int tz = -4 * 60; assertTrue(db.getReflogReader(Constants.HEAD).getReverseEntries() .isEmpty()); final FileBasedConfig cfg = db.getConfig(); cfg.setBoolean("core", null, "logallrefupdates", false); cfg.save(); commit("A Commit\n", commitTime, tz); commitTime += 60 * 1000; assertTrue("Reflog for HEAD still contains no entry", db .getReflogReader(Constants.HEAD).getReverseEntries().isEmpty()); cfg.setBoolean("core", null, "logallrefupdates", true); cfg.save(); assertTrue(cfg.get(CoreConfig.KEY).isLogAllRefUpdates()); commit("A Commit\n", commitTime, tz); commitTime += 60 * 1000; assertTrue("Reflog for HEAD should contain one entry", db.getReflogReader(Constants.HEAD).getReverseEntries() .size() == 1); cfg.setBoolean("core", null, "logallrefupdates", false); cfg.save(); assertFalse(cfg.get(CoreConfig.KEY).isLogAllRefUpdates()); commit("A Commit\n", commitTime, tz); assertTrue("Reflog for HEAD should contain two entries", db.getReflogReader(Constants.HEAD).getReverseEntries() .size() == 2); }

Target:
public void testlogAllRefUpdates() throws Exception { long commitTime = 1154236443000L; int tz = -4 * 60; assertTrue(db.getReflogReader(Constants.HEAD).getReverseEntries() .isEmpty()); final FileBasedConfig cfg = db.getConfig(); cfg.setBoolean("core", null, "logallrefupdates", false); cfg.save(); commit("A Commit\n", commitTime, tz); commitTime += 60 * 1000; assertTrue("Reflog for HEAD still contain no entry", db .getReflogReader(Constants.HEAD).getReverseEntries().isEmpty()); cfg.setBoolean("core", null, "logallrefupdates", true); cfg.save(); assertTrue(cfg.get(CoreConfig.KEY).isLogAllRefUpdates()); commit("A Commit\n", commitTime, tz); commitTime += 60 * 1000; assertTrue( "Reflog for HEAD should contain one entry", db.getReflogReader(Constants.HEAD).getReverseEntries().size() == 1); cfg.setBoolean("core", null, "logallrefupdates", false); cfg.save(); assertFalse(cfg.get(CoreConfig.KEY).isLogAllRefUpdates()); commit("A Commit\n", commitTime, tz); assertTrue( "Reflog for HEAD should contain two entries", db.getReflogReader(Constants.HEAD).getReverseEntries().size() == 2); }
Source:
private void onDebugInitialized(Debugger debugger) { Storage localStorage = Storage.getLocalStorageIfSupported(); if (localStorage == null) { return; } String data = localStorage.getItem(LOCAL_STORAGE_BREAKPOINTS_KEY); if (data == null || data.isEmpty()) { return; } List<BreakpointDto> allDtoBreakpoints = dtoFactory.createListDtoFromJson(data, BreakpointDto.class); for (final BreakpointDto dto : allDtoBreakpoints) { VirtualFileInfo virtualFileInfo = VirtualFileInfo.newBuilder() .setPath(dto.getPath()) .setMediaType(dto.getFileMediaType()) .setProject(new HasProjectConfig() { @Override public ProjectConfigDto getProjectConfig() { return dto.getFileProjectConfig(); } @Override public void setProjectConfig( ProjectConfigDto projectConfig) { } }) .build(); VirtualFile file = new VirtualFileImpl(virtualFileInfo); if (dto.getType() == Type.CURRENT) { doSetCurrentBreakpoint(file, dto.getLineNumber()); } else { addBreakpoint(file, debugger, dto.getLineNumber()); } } }

Target:
private void onDebugInitialized(Debugger debugger) { Storage localStorage = Storage.getLocalStorageIfSupported(); if (localStorage == null) { return; } String data = localStorage.getItem(LOCAL_STORAGE_BREAKPOINTS_KEY); if (data == null || data.isEmpty()) { return; } List<BreakpointDto> allDtoBreakpoints = dtoFactory.createListDtoFromJson(data, BreakpointDto.class); for (final BreakpointDto dto : allDtoBreakpoints) { VirtualFileInfo virtualFileInfo = VirtualFileInfo.newBuilder() .setPath(dto.getPath()) .setMediaType(dto.getFileMediaType()) .setProject(new ProjectConfig(dto.getFileProjectConfig())) .build(); VirtualFile file = new VirtualFileImpl(virtualFileInfo); if (dto.getType() == Type.CURRENT) { doSetCurrentBreakpoint(file, dto.getLineNumber()); } else { addBreakpoint(file, debugger, dto.getLineNumber()); } } }
Source:
public DataStore getDataStore() { MetaDataStore metaDataStore = new MetaDataStore(ClassScanner.getAnnotatedClasses(METADATA_STORE_ANNOTATIONS)); QueryEngine sqlQueryEngine = new SQLQueryEngine(metaDataStore, entityManagerFactory); AggregationDataStore aggregationDataStore = new AggregationDataStore(sqlQueryEngine); DataStore jpaStore = new JpaDataStore( () -> entityManagerFactory.createEntityManager(), NonJtaTransaction::new ); return new MultiplexManager(jpaStore, metaDataStore, aggregationDataStore); }

Target:
public DataStore getDataStore() { MetaDataStore metaDataStore = new MetaDataStore(); QueryEngine sqlQueryEngine = new SQLQueryEngine(metaDataStore, entityManagerFactory); AggregationDataStore aggregationDataStore = new AggregationDataStore(sqlQueryEngine); DataStore jpaStore = new JpaDataStore( () -> entityManagerFactory.createEntityManager(), NonJtaTransaction::new ); return new MultiplexManager(jpaStore, metaDataStore, aggregationDataStore); }
Source:
public ActionForward replaceToken(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME); boolean revokeOldToken; if (ObjectUtils.isNull(question)) { if (getConcurAccessTokenService().currentAccessTokenExists()) { String questionText = getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.MESSAGE_CONCUR_TOKEN_REPLACE_QUESTION); return performQuestionWithoutInput(mapping, form, request, response, ConcurConstants.REPLACE_ACCESS_TOKEN_QUESTION, questionText, KFSConstants.CONFIRMATION_QUESTION, ConcurConstants.REPLACE_TOKEN_METHOD_TO_CALL, StringUtils.EMPTY); } else { revokeOldToken = false; } } else { Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON); revokeOldToken = userClickedYes(buttonClicked); } if (revokeOldToken) { getConcurAccessTokenService().revokeAndReplaceAccessToken(); GlobalVariables.getMessageMap().putInfo(KFSConstants.GLOBAL_MESSAGES, ConcurKeyConstants.MESSAGE_CONCUR_TOKEN_REVOKE_AND_REPLACE_SUCCESS); } else { getConcurAccessTokenService().requestNewAccessToken(); GlobalVariables.getMessageMap().putInfo(KFSConstants.GLOBAL_MESSAGES, ConcurKeyConstants.MESSAGE_CONCUR_TOKEN_REPLACE_SUCCESS); } return mapping.findForward(KFSConstants.MAPPING_BASIC); }

Target:
public ActionForward replaceToken(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if (getConcurAccessTokenService().currentAccessTokenExists()) { getConcurAccessTokenService().revokeAndReplaceAccessToken(); GlobalVariables.getMessageMap().putInfo(KFSConstants.GLOBAL_MESSAGES, ConcurKeyConstants.MESSAGE_CONCUR_TOKEN_REVOKE_AND_REPLACE_SUCCESS); } else { getConcurAccessTokenService().requestNewAccessToken(); GlobalVariables.getMessageMap().putInfo(KFSConstants.GLOBAL_MESSAGES, ConcurKeyConstants.MESSAGE_CONCUR_TOKEN_REPLACE_SUCCESS); } return mapping.findForward(KFSConstants.MAPPING_BASIC); }
Source:
private void showCheckBoxes(List<T> seletedItems) { for (Entry<T, CheckBox> currentEntry : checkBoxes.entrySet()) { wrapperPanel.add(currentEntry.getValue()); if (seletedItems.contains(currentEntry.getKey())) { currentEntry.getValue().setValue(true, false); } } }

Target:
private void showCheckBoxes(List<T> seletedItems) { for (Entry<T, CheckBox> currentEntry : checkBoxes.entrySet()) { wrapperPanel.add(currentEntry.getValue()); if (seletedItems.contains(currentEntry.getKey())) { currentEntry.getValue().setValue(true); } } }
Source:
boolean validateComitter(Job job){ String ignoreComitters = job.getIgnoreComitters(); if(ignoreComitters.isEmpty()){ return true; } else{ String[] ignoreComitterList = job.getIgnoreComitters().toLowerCase().split(","); CommitRequest commitRequest = new CommitRequest.Builder( repository, refChange.getToHash()).build(); String author = commitService.getCommit(commitRequest).getAuthor().getName(); boolean authorIgnored = Arrays.stream(ignoreComitterList).anyMatch(t -> t.equals(author.toLowerCase())); return !authorIgnored; } }

Target:
boolean validateComitter(Job job){ String ignoreComitters = job.getIgnoreComitters(); if(ignoreComitters.isEmpty()){ return true; } else{ String[] ignoreComitterList = job.getIgnoreComitters().toLowerCase().split("\\r?\\n"); CommitRequest commitRequest = new CommitRequest.Builder( repository, refChange.getToHash()).build(); String author = commitService.getCommit(commitRequest).getAuthor().getName(); boolean authorIgnored = Arrays.stream(ignoreComitterList).anyMatch(t -> t.equals(author.toLowerCase())); return !authorIgnored; } }
Source:
public static TransferDiskImageParameters createInitParams(DiskImage diskImage) { TransferDiskImageParameters parameters = new TransferDiskImageParameters(); parameters.setTransferType(TransferType.Download); parameters.setImageGroupID(diskImage.getId()); String fileExtension = diskImage.getVolumeFormat() == VolumeFormat.COW ? ".qcow2" : ".raw"; parameters.setDownloadFilename(diskImage.getDiskAlias() + fileExtension); parameters.setTransferSize(diskImage.getActualSizeInBytes()); parameters.setTransferringViaBrowser(true); return parameters; }

Target:
static TransferDiskImageParameters createInitParams(DiskImage diskImage) { TransferDiskImageParameters parameters = new TransferDiskImageParameters(); parameters.setTransferType(TransferType.Download); parameters.setImageGroupID(diskImage.getId()); String fileExtension = diskImage.getVolumeFormat() == VolumeFormat.COW ? ".qcow2" : ".raw"; parameters.setDownloadFilename(diskImage.getDiskAlias() + fileExtension); parameters.setTransferSize(diskImage.getActualSizeInBytes()); parameters.setTransferringViaBrowser(true); return parameters; }
Source:
public void onSuccess(final LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Override public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError requestError = response.getError(); if (requestError != null) { Log.e(TAG, "Received Facebook error: " + requestError.getErrorMessage()); onFailure(new Bundle()); return; } if (object == null) { Log.w(TAG, "Received null response from Facebook GraphRequest"); onFailure(new Bundle()); } else { try { String email = object.getString("email"); FacebookProvider.this.onSuccess(email, loginResult); } catch (JSONException e) { Log.e(TAG, "JSON Exception reading from Facebook GraphRequest", e); onFailure(new Bundle()); } } } }); Bundle parameters = new Bundle(); parameters.putString("fields", "id,name,email"); request.setParameters(parameters); request.executeAsync(); }

Target:
public void onSuccess(final LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Override public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError requestError = response.getError(); if (requestError != null) { Log.e(TAG, "Received Facebook error: " + requestError.getErrorMessage()); onFailure(new Bundle()); return; } if (object == null) { Log.w(TAG, "Received null response from Facebook GraphRequest"); onFailure(new Bundle()); } else { try { String email = object.getString("email"); onSuccess(email, loginResult); } catch (JSONException e) { Log.e(TAG, "JSON Exception reading from Facebook GraphRequest", e); onFailure(new Bundle()); } } } }); Bundle parameters = new Bundle(); parameters.putString("fields", "id,name,email"); request.setParameters(parameters); request.executeAsync(); }
Source:
public static IProject getLastActiveEditorProject() { final IEditorPart editor = getLastActiveEditor(); if (editor == null) return null; final IEditorInput editorInput = editor.getEditorInput(); if (editorInput instanceof IFileEditorInput) { final IFileEditorInput input = (IFileEditorInput) editorInput; return input.getFile().getProject(); } else if (editorInput instanceof URIEditorInput) { final URI uri = ((URIEditorInput) editorInput).getURI(); if (uri.isPlatformResource()) { final String segment = uri.segment(1); final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(segment); if (project.exists()) { return project; } } } return null; }

Target:
public static IProject getLastActiveEditorProject() { final IEditorPart editor = getLastActiveEditor(); if (editor == null) return null; final IEditorInput editorInput = editor.getEditorInput(); if (editorInput instanceof IFileEditorInput) { final IFileEditorInput input = (IFileEditorInput) editorInput; return input.getFile().getProject(); } else if (editorInput instanceof URIEditorInput) { final URI uri = ((URIEditorInput) editorInput).getURI(); if (uri.isPlatformResource()) { final String platformString = uri.toPlatformString(true); return ResourcesPlugin.getWorkspace().getRoot().findMember(platformString).getProject(); } } return null; }
Source:
public HdfsDataInputSource( DataInputSourceId id, FSDataInputStream inputStream, long size) { this.id = requireNonNull(id, "id is null"); this.inputStream = requireNonNull(inputStream, "inputStream is null"); this.size = requireNonNull(size, "size is null"); }

Target:
public HdfsDataInputSource( DataInputSourceId id, FSDataInputStream inputStream, long size) { this.id = requireNonNull(id, "id is null"); this.inputStream = requireNonNull(inputStream, "inputStream is null"); this.size = size; }
Source:
private ObjectId insertMergeResult(MergeResult<RawText> result) throws IOException { TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( db != null ? nonNullRepo().getDirectory() : null, inCoreLimit << 20); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), CHARACTER_ENCODING); buf.close(); try (InputStream in = buf.openInputStream()) { return getObjectInserter().insert(OBJ_BLOB, buf.length(), in); } } finally { buf.destroy(); } }

Target:
private ObjectId insertMergeResult(MergeResult<RawText> result) throws IOException { TemporaryBuffer.LocalFile buf = new TemporaryBuffer.LocalFile( db != null ? nonNullRepo().getDirectory() : null, inCoreLimit); try { new MergeFormatter().formatMerge(buf, result, Arrays.asList(commitNames), CHARACTER_ENCODING); buf.close(); try (InputStream in = buf.openInputStream()) { return getObjectInserter().insert(OBJ_BLOB, buf.length(), in); } } finally { buf.destroy(); } }
Source:
WindowsShareCopyConfig(String netBiosDomainName, String netBiosHostname, String netBiosUsername, String netBiosPassword, String netBiosSharename, String sourceDirectory, String destinationDirectory, Integer bufferSize, Integer numThreads, String overwrite) { this.netBiosDomainName = netBiosDomainName; this.netBiosHostname = netBiosHostname; this.netBiosUsername = netBiosUsername; this.netBiosPassword = netBiosPassword; this.netBiosSharename = netBiosSharename; this.sourceDirectory = sourceDirectory; this.destinationDirectory = destinationDirectory; this.bufferSize = (bufferSize == null) && (bufferSize < MIN_BUFFER_SIZE) ? MIN_BUFFER_SIZE : bufferSize; this.numThreads = (numThreads == null) && (numThreads < MIN_NUM_THREADS) ? MIN_NUM_THREADS : numThreads; this.overwrite = !("false".equals(overwrite)); }

Target:
WindowsShareCopyConfig(String netBiosDomainName, String netBiosHostname, String netBiosUsername, String netBiosPassword, String netBiosSharename, String sourceDirectory, String destinationDirectory, Integer bufferSize, Integer numThreads, String overwrite) { this.netBiosDomainName = netBiosDomainName; this.netBiosHostname = netBiosHostname; this.netBiosUsername = netBiosUsername; this.netBiosPassword = netBiosPassword; this.netBiosSharename = netBiosSharename; this.sourceDirectory = sourceDirectory; this.destinationDirectory = destinationDirectory; this.bufferSize = bufferSize; this.numThreads = numThreads; this.overwrite = !("false".equals(overwrite)); }
Source:
public SpringSecurityPasswordEncoder(final org.springframework.security.crypto.password.PasswordEncoder delegate) { this.delegate = delegate; }

Target:
public SpringSecurityPasswordEncoder(final org.springframework.security.crypto.password.PasswordEncoder delegate) { CommonHelper.assertNotNull("delegate", delegate); this.delegate = delegate; }
Source:
public void testCallPublicMethodWithUUIDParams(String containerType, String endpoint) { UUID value = UUID.randomUUID(); performActionForUUID(containerType, endpoint, PUBLIC_WITH_UUID_PARAM_ACTION, value, new Param(PARAM_NAME, value)); }

Target:
public void testCallPublicMethodWithUUIDParams(String containerType, String endpoint) { final UUID value = UUID.randomUUID(); performActionForUUID(containerType, endpoint, PUBLIC_WITH_UUID_PARAM_ACTION, value, new Param(PARAM_NAME, value)); }
Source:
public String getTheme() { return mSharedPreferences.getString(Pref.THEME, "light"); }

Target:
public String getTheme() { return mSharedPreferences.getString(Pref.THEME, Pref.Theme.LIGHT); }
Source:
private static byte[] withCorrectBlockSize(final byte[] key) { if (key.length != CcAes.BLOCK) { throw new IllegalArgumentException( String.format( "the length of the AES key must be exactly %d asBytes", CcAes.BLOCK ) ); } return key; }

Target:
private static byte[] withCorrectBlockSize(final byte[] key) { if (key.length != CcAes.BLOCK) { throw new IllegalArgumentException( String.format( "the length of the AES key must be exactly %d bytes", CcAes.BLOCK ) ); } return key; }
Source:
private Object getBuildConfigValue(Context context, String fieldName) { try { Class<?> clazz = Class.forName(context.getPackageName() + ".BuildConfig"); Field field = clazz.getField(fieldName); return field.get(null); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchFieldException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; }

Target:
private Object getBuildConfigValue(Context context, String fieldName) { try { Class<?> clazz = Class.forName(context.getPackageName() + ".BuildConfig"); Field field = clazz.getField(fieldName); return field.get(null); } catch (ClassNotFoundException e) { SalesforceSDKLogger.e(TAG, "getBuildConfigValue failed", e); } catch (NoSuchFieldException e) { SalesforceSDKLogger.e(TAG, "getBuildConfigValue failed", e); } catch (IllegalAccessException e) { SalesforceSDKLogger.e(TAG, "getBuildConfigValue failed", e); } return null; }
Source:
private boolean verify(HttpServletRequest req, HttpServletResponseWrapper rsp) throws IOException { if (!authConfig.isTrustContainerAuth()) return true; final String username = req.getRemoteUser(); final AccountState who = accountCache.getByUsername(username); if (who == null || ! who.getAccount().isActive()) { rsp.sendError(SC_UNAUTHORIZED); return false; } session.get().setUserAccountId(who.getAccount().getId()); return true; }

Target:
private boolean verify(HttpServletRequest req, HttpServletResponseWrapper rsp) throws IOException { final String username = req.getRemoteUser(); final AccountState who = (username == null) ? null : accountCache.getByUsername(username); if (who == null || !who.getAccount().isActive()) { rsp.sendError(SC_UNAUTHORIZED); return false; } session.get().setUserAccountId(who.getAccount().getId()); return true; }
Source:
public static SpectraUser createUser(final Ds3Client client, final String username) throws IOException { DelegateCreateUserSpectraS3Response response = client.delegateCreateUserSpectraS3(new DelegateCreateUserSpectraS3Request(username)); return response.getSpectraUserResult(); }

Target:
public static SpectraUser createUser(final Ds3Client client, final String username) throws IOException { final DelegateCreateUserSpectraS3Response response = client.delegateCreateUserSpectraS3(new DelegateCreateUserSpectraS3Request(username)); return response.getSpectraUserResult(); }
Source:
public void edit(final GridBodyCellEditContext context) { if (readOnly) { return; } if (!isEditingMode) { factory.attachDomElement(context, (e) -> { e.getWidget().setText(getTitle()); if (e instanceof ScenarioHeaderTextAreaDOMElement) { ((ScenarioHeaderTextAreaDOMElement) e).setScenarioHeaderMetaData(this); } }, (e) -> e.getWidget().setFocus(true)); isEditingMode = true; } }

Target:
public void edit(final GridBodyCellEditContext context) { if (readOnly) { throw new IllegalStateException("A read only header cannot be edited"); } if (!isEditingMode) { factory.attachDomElement(context, (e) -> { e.getWidget().setText(getTitle()); if (e instanceof ScenarioHeaderTextAreaDOMElement) { ((ScenarioHeaderTextAreaDOMElement) e).setScenarioHeaderMetaData(this); } }, (e) -> e.getWidget().setFocus(true)); isEditingMode = true; } }
Source:
public void innerStaticInGenericType() throws Exception { Method staticInGeneric = getClass().getDeclaredMethod("testNestedNonGeneric"); TypeName.get(staticInGeneric.getReturnType()); TypeName.get(staticInGeneric.getGenericReturnType()); }

Target:
@Test public void innerStaticInGenericType() throws Exception { Method staticInGeneric = getClass().getDeclaredMethod("testNestedNonGeneric"); TypeName.get(staticInGeneric.getReturnType()); TypeName typeName = TypeName.get(staticInGeneric.getGenericReturnType()); assertThat(typeName.toString()).doesNotContain("<"); }
Source:
protected void doExecute() { BasicCompartment compartmentComment = helper.getStereotypeCompartment(appliedStereotypeComment, originalCompartment.getElement()); if (helper.isStereotypeCompartment(originalCompartment)) { if (compartmentComment == null) { boolean visibility = !isCommentEmpty((BasicCompartment) originalCompartment); BasicCompartment compartmentCopy = EcoreUtil.copy((BasicCompartment) originalCompartment); compartmentCopy.setVisible(visibility); ViewUtil.insertChildView(appliedStereotypeComment, compartmentCopy, ViewUtil.APPEND, true); } else { } } else { if (compartmentComment != null) { Activator.log.warn("The Node " + compartmentComment.toString() + " : wouldn't exist"); } } }

Target:
protected void doExecute() { BasicCompartment compartmentComment = helper.getStereotypeCompartment(appliedStereotypeComment, originalCompartment.getElement()); if (helper.isStereotypeCompartment(originalCompartment)) { if (compartmentComment == null) { boolean visibility = !isCommentEmpty((BasicCompartment) originalCompartment); BasicCompartment compartmentCopy = EcoreUtil.copy((BasicCompartment) originalCompartment); compartmentCopy.setVisible(visibility); ViewUtil.insertChildView(appliedStereotypeComment, compartmentCopy, ViewUtil.APPEND, true); } } }
Source:
private Object tryFindValue(String expr, Class asType) throws OgnlException { Object value = null; try { expr = lookupForOverrides(expr); value = getValue(expr, asType); if (value == null) { value = findInContext(expr); final XWorkConverter conv = ((Container)getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class); return conv.convertValue(getContext(), value, asType); } } finally { context.remove(THROW_EXCEPTION_ON_FAILURE); } return value; }

Target:
private Object tryFindValue(String expr, Class asType) throws OgnlException { Object value = null; try { expr = lookupForOverrides(expr); value = getValue(expr, asType); if (value == null) { value = findInContext(expr); return converter.convertValue(getContext(), value, asType); } } finally { context.remove(THROW_EXCEPTION_ON_FAILURE); } return value; }
Source:
public void setNum(UniqueID id) { if (uID.equals(id)) { return; } try { boolean fullReset = uID.pokeNum != id.pokeNum; uID = id; if (fullReset) { nick = PokemonInfo.name(id); shiny = false; item = 15; } if (id.pokeNum == 487) { item = (short) (id.subNum == 1 ? 213 : 15); } else if (id.pokeNum == 493) { item = id.subNum != 0 ? ItemInfo.plateForType(id.subNum) : 15; } else if (id.pokeNum == 773) { item = id.subNum != 0 ? ItemInfo.memoryChipForType(id.subNum) : 15; } if (fullReset) { gender = 1; nature = 0; } if (gen.num > 2) { ability = PokemonInfo.abilities(id, gen.num)[0]; } if (fullReset) { happiness = 0; hiddenPowerType = 16; level = 100; moves[0] = new TeamMove(0); moves[1] = new TeamMove(0); moves[2] = new TeamMove(0); moves[3] = new TeamMove(0); if (gen.num > 2) { DVs[0] = DVs[1] = DVs[2] = DVs[3] = DVs[4] = DVs[5] = 31; } else { DVs[0] = DVs[1] = DVs[2] = DVs[3] = DVs[4] = DVs[5] = 15; } if (gen.num > 2) { EVs[0] = EVs[1] = EVs[2] = EVs[3] = EVs[4] = EVs[5] = 0; } else { EVs[0] = EVs[1] = EVs[2] = EVs[3] = EVs[4] = EVs[5] = (byte) 252; } } } catch (Exception e) { reset(); } }

Target:
public void setNum(UniqueID id) { if (uID.equals(id)) { return; } try { boolean fullReset = uID.pokeNum != id.pokeNum; uID = id; if (fullReset) { nick = PokemonInfo.name(id); shiny = false; item = 15; } if (id.pokeNum == 487) { item = (short) (id.subNum == 1 ? 213 : 15); } else if (id.pokeNum == 493) { item = id.subNum != 0 ? ItemInfo.plateForType(id.subNum) : 15; } else if (id.pokeNum == 773) { item = id.subNum != 0 ? ItemInfo.memoryChipForType(id.subNum) : 15; } if (fullReset) { gender = 1; nature = 0; } if (gen.num > 2) { ability = PokemonInfo.abilities(id, gen.num)[0]; } if (fullReset) { happiness = 0; hiddenPowerType = (byte)TypeInfo.Type.Dark.ordinal(); level = 100; moves[0] = new TeamMove(0); moves[1] = new TeamMove(0); moves[2] = new TeamMove(0); moves[3] = new TeamMove(0); if (gen.num > 2) { DVs[0] = DVs[1] = DVs[2] = DVs[3] = DVs[4] = DVs[5] = 31; } else { DVs[0] = DVs[1] = DVs[2] = DVs[3] = DVs[4] = DVs[5] = 15; } if (gen.num > 2) { EVs[0] = EVs[1] = EVs[2] = EVs[3] = EVs[4] = EVs[5] = 0; } else { EVs[0] = EVs[1] = EVs[2] = EVs[3] = EVs[4] = EVs[5] = (byte) 252; } } } catch (Exception e) { reset(); } }
Source:
private void onError(Throwable t) { try { session.onError(t).get(5, TimeUnit.MINUTES); } catch (Exception e) { } }

Target:
private void onError(Throwable t) { try { session.onError(t).get(DEFAULT_CLOSE_WAIT_IN_MILLIS, TimeUnit.MILLISECONDS); } catch (Exception e) { } }