auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateReferencedAnalysisReferences(final DAnalysis newDAnalysis) { EObject semanticParentRoot = getRootContainer(semanticObjectToControl.eContainer()); Set<DAnalysis> referencers = Sets.newLinkedHashSet(); for (Resource aird : session.getAllSessionResources()) { DAnalysis currentAnalysis = getDAnalysis(aird); Option<EObject> optionalMainModel = new DAnalysisQuery(currentAnalysis).getMainModel(); ArrayList<EObject> releventModels = Lists.<EObject> newArrayList(); if (optionalMainModel.some()) { releventModels.add(optionalMainModel.get()); for (EObject model : currentAnalysis.getModels()) { if (!AdapterFactoryEditingDomain.isControlled(model) && !(new EObjectQuery(optionalMainModel.get()).isContainedIn(model))) { releventModels.add(model); } } } if (Iterables.contains(releventModels, semanticParentRoot) && <START> !newDAnalysis.getReferencedAnalysis().contains(currentAnalysis)) { <END> List<DAnalysis> referencedAnalysis = new ArrayList<DAnalysis>(currentAnalysis.getReferencedAnalysis()); for (DAnalysis childrenAnalysis : referencedAnalysis) { Option<EObject> optionalChildrenMainModel = new DAnalysisQuery(childrenAnalysis).getMainModel(); if (optionalChildrenMainModel.some() && new EObjectQuery(optionalChildrenMainModel.get()).isContainedIn(semanticObjectToControl)) { currentAnalysis.getReferencedAnalysis().remove(childrenAnalysis); newDAnalysis.getReferencedAnalysis().add(childrenAnalysis); } } referencers.add(currentAnalysis); } } if (!referencers.isEmpty() && session instanceof DAnalysisSession) { ((DAnalysisSession) session).addReferencedAnalysis(newDAnalysis, referencers); } }</code><technical_language>this test done line 255</technical_language>

Target:
private void updateReferencedAnalysisReferences(final DAnalysis newDAnalysis) { EObject semanticParentRoot = getRootContainer(semanticObjectToControl.eContainer()); Set<DAnalysis> referencers = Sets.newLinkedHashSet(); for (Resource aird : session.getAllSessionResources()) { DAnalysis currentAnalysis = getDAnalysis(aird); Set<EObject> releventModels = new DAnalysisQuery(currentAnalysis).getMainModels(); if (Iterables.contains(releventModels, semanticParentRoot)) { List<DAnalysis> referencedAnalysis = new ArrayList<DAnalysis>(currentAnalysis.getReferencedAnalysis()); for (DAnalysis childrenAnalysis : referencedAnalysis) { Option<EObject> optionalChildrenMainModel = new DAnalysisQuery(childrenAnalysis).getMainModel(); if (optionalChildrenMainModel.some() && new EObjectQuery(optionalChildrenMainModel.get()).isContainedIn(semanticObjectToControl)) { currentAnalysis.getReferencedAnalysis().remove(childrenAnalysis); newDAnalysis.getReferencedAnalysis().add(childrenAnalysis); } } referencers.add(currentAnalysis); } } if (!referencers.isEmpty() && session instanceof DAnalysisSession) { ((DAnalysisSession) session).addReferencedAnalysis(newDAnalysis, referencers); } }
Source:
<code><START> public Class<SQLCodeListEntry> getEntryType() { <END> return SQLCodeListEntry.class; }</code><technical_language>s.a</technical_language>

Target:
protected Class<SQLCodeListEntry> getEntryType() { return SQLCodeListEntry.class; }
Source:
<code>public Set<String> getTagValues() { if (!isInitialized()) { doInitialize(); } String tagValues[] = {"#", "$", "''", "``", "'", "`", ",", ".", ":", "-LRB-", "-RRB-", "CC", "CD", "DT", "EX", "FW", "IN", "JJ", "JJR", "JJS", "LS", "MD", "NN", "NNS", "NNP", "NNPS", "PDT", "POS", "PRP", "PP$", "RB", "RBR", "RBS", "RP", "SYM", "TO", "UH", "VB", "VBD", "VBG", "VBN", <START> "VBP", "VBZ", "WDT", "WP", "WP$", "WRB"}; <END> return new HashSet<String>(Arrays.asList(tagValues)); }</code><technical_language>I great if collect this list automatically, listing all. I try tagger. getLabeler(). allowableValues(): <LINK_0></technical_language>

Target:
public Set<String> getTagValues() { if (!isInitialized()) { doInitialize(); } return tagger.getTagValues(); }
Source:
<code>protected void setActionMessageParameters() { <START> addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); <END> addCanDoActionMessage(VdcBllMessages.VAR__TYPE__QUOTA); }</code><technical_language>edit</technical_language>

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__QUOTA); }
Source:
<code>public OnmsNode act(final OnmsNode node) { try { final CompiledScript compiledScript = compileScript(getScript()); if (compiledScript == null) { LOG.warn("No compiled script available for execution."); } else { return sessionUtils.withTransaction(() -> { try { OnmsNode dbNode = node; if(node.getId() > 0) { dbNode = m_nodeDao.get(node.getId()); } final SimpleBindings globals = new SimpleBindings(); globals.put("node", dbNode); globals.put("LOG", LOG); dbNode = (OnmsNode) compiledScript.eval(globals); if(dbNode.getId() > 0) { <START> m_nodeDao.saveOrUpdate(dbNode); <END> } return dbNode; } catch (ScriptException e) { LOG.warn("Error applying ScriptPolicy.", e); } return node; }); } } catch (Exception ex) { LOG.warn("Error compiling script.", ex); } return node; }</code><technical_language>Saving entity design of provisiond done in chain a separate task (i.e. doPersistNodeInfo)</technical_language>

Target:
public OnmsNode act(final OnmsNode node) { try { final CompiledScript compiledScript = compileScript(getScript()); if (compiledScript == null) { LOG.warn("No compiled script available for execution."); } else { final SimpleBindings globals = new SimpleBindings(); globals.put("node", node); globals.put("LOG", LOG); return (OnmsNode) compiledScript.eval(globals); } } catch (Exception ex) { LOG.warn("Error applying ScriptPolicy.", ex); } return node; }
Source:
<code>private static long getFirstStrokeTime(final SrlUpdateList updateList) { long firstStrokeTime = 0; boolean isFoundFirstStroke = false; for (int i = 0; i < updateList.getListList().size() && !isFoundFirstStroke; i++) { final Commands.SrlUpdate tmpUpdate = updateList.getListList().get(i); for (int j = 0; j < tmpUpdate.getCommandsCount() && !isFoundFirstStroke; j++) { final Commands.SrlCommand tmpCommand = tmpUpdate.getCommandsList().get(j); if (tmpCommand.getCommandType() == Commands.CommandType.ADD_STROKE) { <START> firstStrokeTime = tmpUpdate.getTime(); <END> isFoundFirstStroke = true; } } } return firstStrokeTime; }</code><technical_language>a return statement</technical_language>

Target:
private static long getFirstStrokeTime(final SrlUpdateList updateList) { for (int i = 0; i < updateList.getListList().size(); i++) { final Commands.SrlUpdate tmpUpdate = updateList.getListList().get(i); for (int j = 0; j < tmpUpdate.getCommandsCount(); j++) { final Commands.SrlCommand tmpCommand = tmpUpdate.getCommandsList().get(j); if (tmpCommand.getCommandType() == Commands.CommandType.ADD_STROKE) { return tmpUpdate.getTime(); } } } return -1; }
Source:
<code>private void scheduleReconnect() { <START> new Thread() { <END> @Override public void run() { try { Thread.sleep(reconnectInterval); int attempt = 0; while (!running && !destroyed) { log.info("Reconnecting attempt #{} ...", ++attempt); connect(); if (!running) { Thread.sleep(reconnectInterval); } } if (running) { log.info("Successfully reconnect at attempt #{}", attempt); registerSessionCloseListener(); } } catch (InterruptedException e) { log.info("Interrupted when trying to connect to {}:{}", host, port); } } }.start(); }</code><technical_language>This Spring's TaskExecutor [1] support. [1] - <LINK_0></technical_language>

Target:
private void scheduleReconnect() { reconnectingExecutor.submit(new Runnable() { @Override public void run() { try { Thread.sleep(reconnectInterval); int attempt = 0; while (!running && !destroyed) { log.info("Reconnecting attempt #{} ...", ++attempt); connect(); if (!running) { Thread.sleep(reconnectInterval); } } if (running) { log.info("Successfully reconnect at attempt #{}", attempt); registerSessionCloseListener(); } } catch (InterruptedException e) { log.info("Interrupted when trying to connect to {}:{}", host, port); } } }); }
Source:
<code>public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); IComponentFilter componentFilter = new NameComponentFilter(COMPONENT_NAME); try { ModifyComponentsAction.searchAndModify(item, processType, componentFilter, Arrays.<IComponentConversion> asList(new IComponentConversion() { public void transform(NodeType node) { ElementParameterType quoteAllValues = ComponentUtilities.getNodeProperty(node, QUOTE_ALL_VALUES_PARAMETER_NAME); if (quoteAllValues == null) { ComponentUtilities.addNodeProperty(node, QUOTE_ALL_VALUES_PARAMETER_NAME, QUOTE_ALL_VALUES_PARAMETER_TYPE); <START> ComponentUtilities.getNodeProperty(node, QUOTE_ALL_VALUES_PARAMETER_NAME).setValue("true"); <END> } } })); } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } return ExecutionResult.SUCCESS_NO_ALERT; }</code><technical_language>ComponentUtilities.setNodeValue(node, propertyName, value); instead of</technical_language>

Target:
public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) { return ExecutionResult.NOTHING_TO_DO; } IComponentFilter componentFilter = new NameComponentFilter(COMPONENT_NAME); try { ModifyComponentsAction.searchAndModify(item, processType, componentFilter, Arrays.<IComponentConversion> asList(new IComponentConversion() { public void transform(NodeType node) { ElementParameterType quoteAllValues = ComponentUtilities.getNodeProperty(node, QUOTE_ALL_VALUES_PARAMETER_NAME); if (quoteAllValues == null) { ComponentUtilities.addNodeProperty(node, QUOTE_ALL_VALUES_PARAMETER_NAME, QUOTE_ALL_VALUES_PARAMETER_TYPE); ComponentUtilities.setNodeValue(node, QUOTE_ALL_VALUES_PARAMETER_NAME, "true"); } } })); } catch (PersistenceException e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } return ExecutionResult.SUCCESS_NO_ALERT; }
Source:
<code><START> public boolean isSupported(String feature) { <END> return true; }</code><technical_language>is purpose of this method</technical_language>

Target:
public boolean isSupported(String feature) { throwException(); return false; }
Source:
<code><START> public GitHubSCMSource bindResolve(StaplerRequest staplerRequest, JSONObject json) { <END> boolean configuredByUrl = json.getBoolean("configuredByUrl"); if(configuredByUrl) { this.setRepositoryUrl(json.get("repositoryUrl").toString()); } else { this.repositoryUrl = null; this.apiUri = json.get("apiUri").toString(); this.repoOwner = json.get("repoOwner").toString(); this.repository = json.get("repository").toString(); } return this; }</code><technical_language>Note myself: time I this method in a plugin</technical_language>

Target:
public GitHubSCMSource bindResolve(StaplerRequest staplerRequest, JSONObject json) { boolean configuredByUrl = json.getBoolean("configuredByUrl"); if (configuredByUrl) { this.setRepositoryUrl(json.get("repositoryUrl").toString()); } else { this.repositoryUrl = null; setApiUri(json.get("apiUri").toString()); setRepoOwner(json.get("repoOwner").toString()); setRepository(json.get("repository").toString()); } return this; }
Source:
<code>public static void main(String... args) throws IOException { parseArgs(args); <START> <END> Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }</code><technical_language>Unnecessary empty line</technical_language>

Target:
public static void main(String... args) throws IOException { if (Context.getJavaVersion() >= 9){ UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); System.exit(0); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }
Source:
<code>public Integer perform(InvocationContext ctx) throws Throwable { <START> long size = cache.getAdvancedCache().withEncoding(IdentityEncoder.class).keySet().stream().count(); <END> if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return (int) size; } }</code><technical_language>decorate cache in constructor</technical_language>

Target:
public Integer perform(InvocationContext ctx) throws Throwable { long size = cache.keySet().stream().count(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } else { return (int) size; } }
Source:
<code>public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); if (value != null <START> && ((value instanceof String && !((String) value).equals("")) || valueTypeCheck(value))) { END> T pasredValue = value instanceof String ? parse((String) value) : (T) value; String msg = ""; String prefixMsg = getNumberTypeErrorMessage(); if (pasredValue == null) { result.setSuccess(false); msg = getNumberRangeErrorMessage(prefixMsg); validationFailedWith(result, msg); } else if (belowMinimum(pasredValue)) { msg = getNumberBellowMinimumErrorMessage(prefixMsg); validationFailedWith(result, msg); } else if (aboveMaximum(pasredValue)) { msg = getNumberAboveMaximumErrorMessage(prefixMsg); validationFailedWith(result, msg); } } else { validationFailedWith(result, getNumberTypeErrorMessage()); } return result; }</code><technical_language>good split (logical) cases: * is String * is some Number Note in Java, instanceof FooClass return false is null, need for null check instanceof operator. Consider code: T parsedValue = null; if (value instanceof String && !StringUtils.isEmpty(value)) { parsedValue = parse((String) value); } else if (valueTypeCheck(value)) { parsedValue = (T) value; } String msg = ""; // rest of code</technical_language>

Target:
public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); T pasredValue = null; if ((value instanceof String && !StringUtils.isEmpty((String) value))) { pasredValue = parse((String) value); } else if (valueTypeCheck(value)) { pasredValue = (T) value; } else { validationFailedWith(result, getNumberTypeErrorMessage()); return result; } String message = ""; String prefixMsg = getNumberTypeErrorMessage(); if (pasredValue == null) { message = getNumberRangeErrorMessage(prefixMsg); validationFailedWith(result, message); } else if (belowMinimum(pasredValue)) { message = getNumberBellowMinimumErrorMessage(prefixMsg); validationFailedWith(result, message); } else if (aboveMaximum(pasredValue)) { message = getNumberAboveMaximumErrorMessage(prefixMsg); validationFailedWith(result, message); } return result; }
Source:
<code>private AggregationAnalyzer(List<Expression> groupByExpressions, Scope sourceScope, Optional<Scope> orderByScope, Metadata metadata, Analysis analysis) { requireNonNull(groupByExpressions, "groupByExpressions is null"); requireNonNull(sourceScope, "sourceScope is null"); requireNonNull(orderByScope, "orderByScope is null"); requireNonNull(metadata, "metadata is null"); requireNonNull(analysis, "analysis is null"); this.sourceScope = sourceScope; this.orderByScope = orderByScope; this.metadata = metadata; this.analysis = analysis; this.expressions = groupByExpressions.stream() .map(e -> ExpressionTreeRewriter.rewriteWith(new ParameterRewriter(analysis.getParameters()), e)) .collect(toImmutableList()); <START> this.columnReferences = NodeRefCollections.toIdentityMap(analysis.getColumnReferenceFields()); <END> this.groupingFields = groupByExpressions.stream() .filter(columnReferences::containsKey) .map(columnReferences::get) .collect(toImmutableSet()); this.groupingFields.forEach(fieldId -> { checkState(isFieldFromScope(fieldId, sourceScope), "Grouping field %s should originate from %s", fieldId, sourceScope.getRelationType()); }); }</code><technical_language>I suggest a static import class is leave is</technical_language>

Target:
private AggregationAnalyzer(List<Expression> groupByExpressions, Scope sourceScope, Optional<Scope> orderByScope, Metadata metadata, Analysis analysis) { requireNonNull(groupByExpressions, "groupByExpressions is null"); requireNonNull(sourceScope, "sourceScope is null"); requireNonNull(orderByScope, "orderByScope is null"); requireNonNull(metadata, "metadata is null"); requireNonNull(analysis, "analysis is null"); this.sourceScope = sourceScope; this.orderByScope = orderByScope; this.metadata = metadata; this.analysis = analysis; this.expressions = groupByExpressions.stream() .map(e -> ExpressionTreeRewriter.rewriteWith(new ParameterRewriter(analysis.getParameters()), e)) .collect(toImmutableList()); this.columnReferences = analysis.getColumnReferenceFields(); this.groupingFields = groupByExpressions.stream() .map(NodeRef::of) .filter(columnReferences::containsKey) .map(columnReferences::get) .collect(toImmutableSet()); this.groupingFields.forEach(fieldId -> { checkState(isFieldFromScope(fieldId, sourceScope), "Grouping field %s should originate from %s", fieldId, sourceScope.getRelationType()); }); }
Source:
<code>public ValidationResult isTemplateInUseByVmInStorageDomain(VmTemplate vmTemplate) { List<VM> vmsInExportDomain = getVmsFromExportDomain(storageDomain); List<String> problematicVmNames = new ArrayList<String>(); for (VM vm : vmsInExportDomain) { <START> if (vmTemplate.getId().equals(vm.getVmtGuid())) { <END> problematicVmNames.add(vm.getName()); } } if (!problematicVmNames.isEmpty()) { return new ValidationResult(VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM, String.format("$vmsList %1$s", StringUtils.join(problematicVmNames, ","))); } return ValidationResult.VALID; }</code><technical_language>vmTemplate null</technical_language>

Target:
public ValidationResult isTemplateInUseByVmInStorageDomain(VmTemplate vmTemplate) { if (vmTemplate != null) { List<VM> vmsInExportDomain = getVmsFromExportDomain(storageDomain); List<String> problematicVmNames = new ArrayList<String>(); for (VM vm : vmsInExportDomain) { if (vmTemplate.getId().equals(vm.getVmtGuid())) { problematicVmNames.add(vm.getName()); } } if (!problematicVmNames.isEmpty()) { return new ValidationResult(VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM, ReplacementUtils.replaceWith("vmsList", problematicVmNames)); } } return ValidationResult.VALID; }
Source:
<code><START> public boolean delete() { <END> boolean result = true; if (folder != null) { result = recursiveDelete(folder); } return result; }</code><technical_language>This method is in a non-final class, code out in wild override this method, change signature</technical_language>

Target:
public void delete() { if (!tryDelete()) { if (assureDeletion) { fail("Unable to clean up temporary folder " + folder); } } }
Source:
<code>public synchronized IdRange nextIdBatch( int size ) { IdRange idBatch = getReusableIdBatch( size ); if ( idBatch.totalSize() > 0 ) { return idBatch; } IdRange range = idQueue.nextIdBatch( size ); if ( range.totalSize() == 0 ) { acquireNextIdBatch(); range = idQueue.nextIdBatch( size ); } <START> return range; <END> }</code><technical_language>'nextId()' call step incrementing id generator highId, do here</technical_language>

Target:
public synchronized IdRange nextIdBatch( int size ) { IdRange idBatch = getReusableIdBatch( size ); if ( idBatch.totalSize() > 0 ) { return idBatch; } IdRange range = idQueue.nextIdBatch( size ); if ( range.totalSize() == 0 ) { acquireNextIdBatch(); range = idQueue.nextIdBatch( size ); setHighId( range.getHighId() ); } return range; }
Source:
<code>private WritableComparable convertToWritable(Schema.Field field, StructuredRecord input) throws UnsupportedTypeException { Object fieldVal = input.get(field.getName()); Schema fieldSchema = field.getSchema(); Schema.Type fieldType = fieldSchema.getType(); if (fieldSchema.isNullable()) { if (fieldVal == null) { return null; } fieldType = fieldSchema.getNonNullable().getType(); } switch (fieldType) { case NULL: return null; case STRING: return new Text((String) fieldVal); case ENUM: return new Text(fieldVal.toString()); case BOOLEAN: return new BooleanWritable((Boolean) fieldVal); case INT: return new IntWritable((Integer) fieldVal); case LONG: return new LongWritable((Long) fieldVal); case FLOAT: return new FloatWritable((Float) fieldVal); case DOUBLE: return new DoubleWritable((Double) fieldVal); case BYTES: if (fieldVal instanceof byte[]) { return new BytesWritable((byte[]) fieldVal); } else { return new BytesWritable(Bytes.getBytes((ByteBuffer) fieldVal)); } default: <START> throw new UnsupportedTypeException(String.format("%s type is currently not supported in ORC", <END> field.getSchema().getType().name())); } }</code><technical_language>throw new UnsupportedTypeException(String.format("Type '%s' of field '%s' is currently supported in ORC", fieldType.name(), field.getName()));</technical_language>

Target:
private WritableComparable convertToWritable(Schema.Field field, StructuredRecord input) throws UnsupportedTypeException { Object fieldVal = input.get(field.getName()); Schema fieldSchema = field.getSchema(); Schema.Type fieldType = fieldSchema.getType(); if (fieldSchema.isNullable()) { if (fieldVal == null) { return null; } fieldType = fieldSchema.getNonNullable().getType(); } switch (fieldType) { case NULL: return null; case STRING: return new Text((String) fieldVal); case ENUM: return new Text(fieldVal.toString()); case BOOLEAN: return new BooleanWritable((Boolean) fieldVal); case INT: return new IntWritable((Integer) fieldVal); case LONG: return new LongWritable((Long) fieldVal); case FLOAT: return new FloatWritable((Float) fieldVal); case DOUBLE: return new DoubleWritable((Double) fieldVal); case BYTES: if (fieldVal instanceof byte[]) { return new BytesWritable((byte[]) fieldVal); } else { return new BytesWritable(Bytes.getBytes((ByteBuffer) fieldVal)); } default: throw new UnsupportedTypeException(String.format("Type '%s' of field '%s' is currently not supported in ORC", fieldType.name(), field.getName())); } }
Source:
<code>public HashMap<Pair<Integer, Version>, Boolean> getNicHotplugSupportMap() { List<Version> versions = new ArrayList<Version>(Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)); <START> HashMap<Pair<Integer, Version>, Boolean> hotplugSupportOsIdVersionMap = <END> new HashMap<Pair<Integer, Version>, Boolean>(); for (Integer osId : getOsIds()) { for (Version version : versions) { hotplugSupportOsIdVersionMap.put( new Pair<Integer, Version>(osId, version), hasNicHotplugSupport(osId, version)); } } return hotplugSupportOsIdVersionMap; }</code><technical_language>type of hotplugSupportOsIdVersionMap reduced Map in this context</technical_language>

Target:
public Map<Pair<Integer, Version>, Boolean> getNicHotplugSupportMap() { List<Version> versions = new ArrayList<Version>(Config.<HashSet<Version>> GetValue(ConfigValues.SupportedClusterLevels)); Map<Pair<Integer, Version>, Boolean> hotplugSupportOsIdVersionMap = new HashMap<Pair<Integer, Version>, Boolean>(); for (Integer osId : getOsIds()) { for (Version version : versions) { hotplugSupportOsIdVersionMap.put( new Pair<Integer, Version>(osId, version), hasNicHotplugSupport(osId, version)); } } return hotplugSupportOsIdVersionMap; }
Source:
<code>protected void positionAndShowDialog(Command onCompleted) { super.center(); onCompleted.execute(); Element e = this.getElement(); Element child = e.getFirstChildElement(); if (child != null) { <START> int windowInnerHeight = Integer.parseInt(JsWindow.getProp("innerHeight").toString()); <END> if (windowInnerHeight <= 10) return; int eleTop = e.getAbsoluteTop(); if (eleTop < 0) { eleTop = 0; e.getStyle().setTop(0, Unit.PX); } int eleHeight = e.getOffsetHeight(); if (eleHeight + 30 >= windowInnerHeight) { child.getStyle().setProperty("overflowY", "auto"); String overflowX = child.getStyle().getProperty("overflowX"); if (overflowX == null || overflowX.length() < 1) { child.getStyle().setProperty("overflowX", "hidden"); } child.getStyle().setPropertyPx("maxHeight", windowInnerHeight - eleTop - 30); } } }</code><technical_language>I this is worth a conversation (maybe #rstudio-dev). board adding elemental elemental2 want some historical reason chose do so</technical_language>

Target:
protected void positionAndShowDialog(Command onCompleted) { super.center(); onCompleted.execute(); Element e = this.getElement(); Element child = e.getFirstChildElement(); if (child != null) { int windowInnerHeight = Browser.getWindow().getInnerHeight(); if (windowInnerHeight <= 10) return; int eleTop = e.getAbsoluteTop(); if (eleTop < 0) { eleTop = 0; e.getStyle().setTop(0, Unit.PX); } int eleHeight = e.getOffsetHeight(); if (eleHeight + 30 >= windowInnerHeight) { child.getStyle().setProperty("overflowY", "auto"); String overflowX = child.getStyle().getProperty("overflowX"); if (overflowX == null || overflowX.length() < 1) { child.getStyle().setProperty("overflowX", "hidden"); } child.getStyle().setPropertyPx("maxHeight", windowInnerHeight - eleTop - 30); } } }
Source:
<code>private void setSearchBannerState() { <START> if (!"".equals(adapter.getSearchQuery()) || adapter.isFilteringByCalloutResult()) { <END> showSearchBanner(); clearSearchButton.setVisibility(View.VISIBLE); } else { searchBanner.setVisibility(View.GONE); clearSearchButton.setVisibility(View.GONE); } }</code><technical_language>backspace? case list search functionality older devices</technical_language>

Target:
private void setSearchBannerState() { if (!"".equals(adapter.getSearchQuery())) { showSearchBanner(); clearSearchButton.setVisibility(View.GONE); } else if (adapter.isFilteringByCalloutResult()) { showSearchBanner(); clearSearchButton.setVisibility(View.VISIBLE); } else { searchBanner.setVisibility(View.GONE); clearSearchButton.setVisibility(View.GONE); } }
Source:
<code>public SortBlob() { <START> super(NAME, 1, 2); <END> }</code><technical_language>constants for 1 2</technical_language>

Target:
public SortBlob() { super(NAME, NB_OUTPUT_STREAMS); }
Source:
<code>public ExtensionJobList getExtensionJobs(String extensionName, String sortOrder, String doAsUser) { Comparator<ExtensionJobsBean> compareByJobName = new Comparator<ExtensionJobsBean>() { @Override public int compare(ExtensionJobsBean o1, ExtensionJobsBean o2) { return o1.getJobName().compareToIgnoreCase(o2.getJobName()); } }; <START> TreeMap<String, String> jobAndExtensionNames = new TreeMap<>(); <END> List<ExtensionJobsBean> extensionJobs = null; if (extensionName != null) { extensionJobs = ExtensionStore.getMetaStore().getJobsForAnExtension(extensionName); } else { extensionJobs = ExtensionStore.getMetaStore().getAllExtensionJobs(); } sortOrder = (sortOrder == null) ? ASCENDING_SORT_ORDER : sortOrder; switch (sortOrder.toLowerCase()) { case DESCENDING_SORT_ORDER: Collections.sort(extensionJobs, Collections.reverseOrder(compareByJobName)); break; default: Collections.sort(extensionJobs, compareByJobName); } for (ExtensionJobsBean job : extensionJobs) { jobAndExtensionNames.put(job.getJobName(), job.getExtensionName()); } return new ExtensionJobList(extensionJobs.size(), jobAndExtensionNames); }</code><technical_language>this jobs returned in ascending order user desc</technical_language>

Target:
public ExtensionJobList getExtensionJobs(String extensionName, String sortOrder, String doAsUser) { TreeMap<String, String> jobAndExtensionNames = new TreeMap<>(); List<ExtensionJobsBean> extensionJobs = null; if (extensionName != null) { extensionJobs = ExtensionStore.getMetaStore().getJobsForAnExtension(extensionName); } else { extensionJobs = ExtensionStore.getMetaStore().getAllExtensionJobs(); } for (ExtensionJobsBean job : extensionJobs) { jobAndExtensionNames.put(job.getJobName(), job.getExtensionName()); } sortOrder = (sortOrder == null) ? ASCENDING_SORT_ORDER : sortOrder; switch (sortOrder.toLowerCase()) { case DESCENDING_SORT_ORDER: return new ExtensionJobList(extensionJobs.size(), jobAndExtensionNames.descendingMap()); default: return new ExtensionJobList(extensionJobs.size(), jobAndExtensionNames); } }
Source:
<code>private int writeUnitsSection(final int currentRowNum, final HSSFWorkbook xlsBook, final HSSFSheet xlsSheet, final List<VariableDetails> units) { final CellStyle backgroundStyle = xlsBook.createCellStyle(); final HSSFFont blackFont = xlsBook.createFont(); blackFont.setFontName("calibri"); blackFont.setFontHeightInPoints((short) 11); blackFont.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); backgroundStyle.setFont(blackFont); int rowNumIndex = currentRowNum; int count = units.size(); <START> for (VariableDetails variableDetail : units) { <END> final HSSFRow row = xlsSheet.createRow(rowNumIndex++); row.setHeightInPoints(16); this.writeCell(LotExcelTemplateGenerator.CODES_SHEET_FIRST_COLUMN_INDEX, variableDetail.getName(), count, xlsBook,row); this.writeCell(LotExcelTemplateGenerator.CODES_SHEET_SECOND_COLUMN_INDEX, variableDetail.getDescription(), count, xlsBook,row); count--; } return rowNumIndex; }</code><technical_language>add final</technical_language>

Target:
private int writeUnitsSection(final int currentRowNum, final HSSFWorkbook xlsBook, final HSSFSheet xlsSheet, final List<VariableDetails> units) { final CellStyle backgroundStyle = xlsBook.createCellStyle(); final HSSFFont blackFont = xlsBook.createFont(); blackFont.setFontName("calibri"); blackFont.setFontHeightInPoints((short) 11); blackFont.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); backgroundStyle.setFont(blackFont); int rowNumIndex = currentRowNum; int count = units.size(); for (final VariableDetails variableDetail : units) { final HSSFRow row = xlsSheet.createRow(rowNumIndex++); row.setHeightInPoints(16); this.writeCell(LotExcelTemplateGenerator.CODES_SHEET_FIRST_COLUMN_INDEX, variableDetail.getName(), count, xlsBook,row); this.writeCell(LotExcelTemplateGenerator.CODES_SHEET_SECOND_COLUMN_INDEX, variableDetail.getDescription(), count, xlsBook,row); count--; } return rowNumIndex; }
Source:
<code>public void testSerializeDeserialize() throws IOException { ObjectMapper objectMapper = new ObjectMapper(); final OrderType type = OrderType.ASK; final BigDecimal originalAmount = new BigDecimal("100.501"); final CurrencyPair currencyPair = CurrencyPair.BTC_USD; final BigDecimal price = new BigDecimal("250.34"); final Date timestamp = new Date(); final String id = "id"; final String orderId = "OrderId"; final BigDecimal feeAmount = new BigDecimal("0"); final Currency feeCurrency = Currency.BTC; final UserTrade original = new UserTrade( type, originalAmount, currencyPair, price, timestamp, id, orderId, feeAmount, feeCurrency); <START> String json = objectMapper.writeValueAsString(original); <END> assertThat(json).contains("\"currencyPair\":\"BTC/USD\""); UserTrade jsonCopy = objectMapper.readValue(json, UserTrade.class); assertThat(jsonCopy).isEqualToComparingFieldByField(original); }</code><technical_language>ObjectMapperHelper.viaJSON</technical_language>

Target:
public void testSerializeDeserialize() throws IOException { final OrderType type = OrderType.ASK; final BigDecimal originalAmount = new BigDecimal("100.501"); final CurrencyPair currencyPair = CurrencyPair.BTC_USD; final BigDecimal price = new BigDecimal("250.34"); final Date timestamp = new Date(); final String id = "id"; final String orderId = "OrderId"; final BigDecimal feeAmount = new BigDecimal("0"); final Currency feeCurrency = Currency.BTC; final UserTrade original = new UserTrade( type, originalAmount, currencyPair, price, timestamp, id, orderId, feeAmount, feeCurrency); String json = ObjectMapperHelper.toCompactJSON(original); assertThat(json).contains("\"currencyPair\":\"BTC/USD\""); UserTrade jsonCopy = ObjectMapperHelper.readValueStrict(json, UserTrade.class); assertThat(jsonCopy).isEqualToComparingFieldByField(original); }
Source:
<code>public void sendSignInLinkToEmail(@NonNull final String email, @NonNull final ActionCodeSettings actionCodeSettings, @Nullable final IdpResponse idpResponseForLinking, final boolean forceSameDevice) { if (getAuth() == null) { return; } setResult(Resource.<String>forLoading()); final String anonymousUserId = AuthOperationManager.getInstance().canUpgradeAnonymous <START> (getAuth(), getArguments()) ? getAuth().getCurrentUser().getUid() : null; <END> final String sessionId = Utils.generateRandomAlphaNumericString(SESSION_ID_LENGTH); ActionCodeSettings mutatedSettings = addSessionInfoToActionCodeSettings(actionCodeSettings, sessionId, anonymousUserId, idpResponseForLinking, forceSameDevice); getAuth().sendSignInLinkToEmail(email, mutatedSettings) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { EmailLinkPersistenceManager.getInstance().saveEmail(getApplication(), email, sessionId, anonymousUserId); setResult(Resource.forSuccess(email)); } else { setResult(Resource.<String>forFailure(task.getException())); } } }); }</code><technical_language>nit: line break (</technical_language>

Target:
public void sendSignInLinkToEmail(@NonNull final String email, @NonNull final ActionCodeSettings actionCodeSettings, @Nullable final IdpResponse idpResponseForLinking, final boolean forceSameDevice) { if (getAuth() == null) { return; } setResult(Resource.<String>forLoading()); final String anonymousUserId = AuthOperationManager.getInstance().canUpgradeAnonymous(getAuth(), getArguments()) ? getAuth().getCurrentUser().getUid() : null; final String sessionId = SessionUtils.generateRandomAlphaNumericString(SESSION_ID_LENGTH); ActionCodeSettings mutatedSettings = addSessionInfoToActionCodeSettings(actionCodeSettings, sessionId, anonymousUserId, idpResponseForLinking, forceSameDevice); getAuth().sendSignInLinkToEmail(email, mutatedSettings) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { EmailLinkPersistenceManager.getInstance().saveEmail(getApplication(), email, sessionId, anonymousUserId); setResult(Resource.forSuccess(email)); } else { setResult(Resource.<String>forFailure(task.getException())); } } }); }
Source:
<code>public void open(String uId) throws IOException { successfulWrites = new ArrayList<>(); rejectedWrites = new ArrayList<>(); connection = sink.connect(container); try { if (usePreparedStatement) { statement = connection.prepareStatement(rowProperties.query.getValue()); } else { statement = connection.createStatement(); <START> } <END> } catch (SQLException e) { throw new IOException(e); } result = new Result(); }</code><technical_language>if Sink class responsible for keeping connection instance, code moved Sink.getPreparedStatement() method</technical_language>

Target:
public void open(String uId) throws IOException { successfulWrites = new ArrayList<>(); rejectedWrites = new ArrayList<>(); connection = sink.createConnection(container); mainSchema = sink.getRuntimeSchema(container); try { if (rowProperties.usePreparedStatement()) { statement = connection.prepareStatement(sink.getQuery()); } else { statement = connection.createStatement(); } } catch (SQLException e) { throw new IOException(e); } result = new Result(); }
Source:
<code>public void doLaunch(Context context, View v) { Intent intent = new Intent(settingPojo.settingName); if (!settingPojo.packageName.isEmpty()) { intent.setClassName(settingPojo.packageName, settingPojo.settingName); } <START> intent.setSourceBounds(v.getClipBounds()); <END> intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); }</code><technical_language>I this method is Android 18+, this a problem 14-17 supporting</technical_language>

Target:
public void doLaunch(Context context, View v) { Intent intent = new Intent(settingPojo.settingName); if (!settingPojo.packageName.isEmpty()) { intent.setClassName(settingPojo.packageName, settingPojo.settingName); } if(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { intent.setSourceBounds(v.getClipBounds()); } intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); }
Source:
<code>public void tagged() throws IOException { <START> Assert.assertEquals(null, this.client.getJobs().tagged(JobsTest.DEFAULT_NAME)); <END> final Map<String, Object> opts1 = new HashMap<>(); opts1.put(LuaConfigParameter.TAGS.toString(), Arrays.asList(JobsTest.DEFAULT_NAME)); final String jid1 = this.queue.put(JobsTest.DEFAULT_NAME, null, opts1); final Map<String, Object> opts2 = new HashMap<>(); opts2.put(LuaConfigParameter.TAGS.toString(), Arrays.asList(JobsTest.DEFAULT_NAME)); final String jid2 = this.queue.put(JobsTest.DEFAULT_NAME, null, opts2); Assert.assertNotNull(this.client.getJobs().get(jid1)); Assert.assertNotNull(this.client.getJobs().get(jid2)); Assert.assertEquals(2, this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).size()); Assert.assertTrue(this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).contains(jid1)); Assert.assertTrue(this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).contains(jid2)); }</code><technical_language>assertNull instead hamcrest version: java assertThat(client.getJobs().tagged(JobsTest.DEFAULT_NAME), is(nullValue());</technical_language>

Target:
public void tagged() throws IOException { Assert.assertNull(this.client.getJobs().tagged(JobsTest.DEFAULT_NAME)); final Map<String, Object> opts1 = new HashMap<>(); opts1.put(LuaConfigParameter.TAGS.toString(), Arrays.asList(JobsTest.DEFAULT_NAME)); final String jid1 = this.queue.put(JobsTest.DEFAULT_NAME, null, opts1); final Map<String, Object> opts2 = new HashMap<>(); opts2.put(LuaConfigParameter.TAGS.toString(), Arrays.asList(JobsTest.DEFAULT_NAME)); final String jid2 = this.queue.put(JobsTest.DEFAULT_NAME, null, opts2); Assert.assertNotNull(this.client.getJobs().get(jid1)); Assert.assertNotNull(this.client.getJobs().get(jid2)); Assert.assertEquals(2, this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).size()); Assert.assertTrue(this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).contains(jid1)); Assert.assertTrue(this.client.getJobs().tagged(JobsTest.DEFAULT_NAME).contains(jid2)); }
Source:
<code>private void initHttpClient() { try { URL hostUrl = getUrl(); if (isSecured()) { int hostPort = hostUrl.getPort() == -1 ? HttpsURL.DEFAULT_PORT : hostUrl.getPort(); Protocol httpsProtocol = new Protocol(String.valueOf(HttpsURL.DEFAULT_SCHEME), (ProtocolSocketFactory) new AuthSSLProtocolSocketFactory(ExternalTrustStoreInitializer.getTrustStore(), <START> Config.<String> getValue(ConfigValues.VdsmSLLProtocol)), <END> hostPort); httpClient.getHostConfiguration().setHost(hostUrl.getHost(), hostPort, httpsProtocol); } else { int hostPort = hostUrl.getPort() == -1 ? HttpURL.DEFAULT_PORT : hostUrl.getPort(); httpClient.getHostConfiguration().setHost(hostUrl.getHost(), hostPort); } objectMapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); if (hostProvider.getUsername() != null && hostProvider.getPassword() != null) { Credentials hostProviderCredentials = new UsernamePasswordCredentials(hostProvider.getUsername(), hostProvider.getPassword()); httpClient.getState().setCredentials(AuthScope.ANY, hostProviderCredentials); httpClient.getParams().setAuthenticationPreemptive(true); } } catch (RuntimeException e) { handleException(e); } }</code><technical_language>this is vdsm, another configuration setting database, kill this code anyway, important</technical_language>

Target:
private void initHttpClient() { try { URL hostUrl = getUrl(); if (isSecured()) { int hostPort = hostUrl.getPort() == -1 ? HttpsURL.DEFAULT_PORT : hostUrl.getPort(); Protocol httpsProtocol = new Protocol(String.valueOf(HttpsURL.DEFAULT_SCHEME), (ProtocolSocketFactory) new AuthSSLProtocolSocketFactory(ExternalTrustStoreInitializer.getTrustStore(), Config.<String> getValue(ConfigValues.VdsmSSLProtocol)), hostPort); httpClient.getHostConfiguration().setHost(hostUrl.getHost(), hostPort, httpsProtocol); } else { int hostPort = hostUrl.getPort() == -1 ? HttpURL.DEFAULT_PORT : hostUrl.getPort(); httpClient.getHostConfiguration().setHost(hostUrl.getHost(), hostPort); } objectMapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false); if (hostProvider.getUsername() != null && hostProvider.getPassword() != null) { Credentials hostProviderCredentials = new UsernamePasswordCredentials(hostProvider.getUsername(), hostProvider.getPassword()); httpClient.getState().setCredentials(AuthScope.ANY, hostProviderCredentials); httpClient.getParams().setAuthenticationPreemptive(true); } } catch (RuntimeException e) { handleException(e); } }
Source:
<code>public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); TopNNode topNNode = (TopNNode) node; if (topNNode.getCount() != count) { return NO_MATCH; } for (Ordering ordering : orderBy) { Symbol symbol = Symbol.from(symbolAliases.get(ordering.getField())); OrderingScheme nodeOrderingScheme = topNNode.getOrderingScheme(); <START> if (!ordering.getSortOrder().equals(nodeOrderingScheme.getOrderings().get(symbol))) { <END> return NO_MATCH; } } return match(); }</code><technical_language>I missed part check order of ordering symbols is correct</technical_language>

Target:
public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) { checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName()); TopNNode topNNode = (TopNNode) node; if (topNNode.getCount() != count) { return NO_MATCH; } for (int i = 0; i < orderBy.size(); ++i) { Ordering ordering = orderBy.get(i); Symbol symbol = Symbol.from(symbolAliases.get(ordering.getField())); OrderingScheme orderingScheme = topNNode.getOrderingScheme(); if (!symbol.equals(orderingScheme.getOrderBy().get(i))) { return NO_MATCH; } if (!ordering.getSortOrder().equals(orderingScheme.getOrdering(symbol))) { return NO_MATCH; } } return match(); }
Source:
<code>public VoltDBLLimit( RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode offset, RexNode limit) { super(cluster, traitSet, input); <START> assert VoltDBLRel.VOLTDB_LOGICAL.equals(getConvention()); <END> m_offset = offset; m_limit = limit; }</code><technical_language>consistent assert assert VoltDBLRel.VOLTDB_LOGICAL.equals(getConvention()); assert traitSet.contains(VoltDBLRel.VOLTDB_LOGICAL);</technical_language>

Target:
public VoltDBLLimit( RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode offset, RexNode limit) { super(cluster, traitSet, input); assert traitSet.contains(VoltDBLRel.VOLTDB_LOGICAL); m_offset = offset; m_limit = limit; }
Source:
<code><START> public ExtensionSpider getExtensionSpider() { <END> return this.extension; }</code><technical_language>protected instead (and defined nested class)</technical_language>

Target:
protected ExtensionSpider getExtensionSpider() { return this.extension; }
Source:
<code>public void actionPerformed(@Nonnull GuiButton guiButton) throws IOException { super.actionPerformed(guiButton); <START> if (guiButton.id == ID_META + buttonIdOffset) { <END> filter.setMatchMeta(useMetaB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_NBT + buttonIdOffset) { filter.setMatchNBT(useNbtB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_STICKY + buttonIdOffset) { filter.setSticky(stickyB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_ORE_DICT + buttonIdOffset) { filter.setUseOreDict(useOreDictB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_DAMAGE + buttonIdOffset) { filter.setDamageMode(damageB.getMode().getMode()); sendFilterChange(); } else if (guiButton.id == ID_WHITELIST + buttonIdOffset) { filter.setBlacklist(!filter.isBlacklist()); sendFilterChange(); } }</code><technical_language>a thought: If identity-compare parameter field, need IDs offset. need change want to, button IDs wrong. a bit of overkill ;)</technical_language>

Target:
public void actionPerformed(@Nonnull GuiButton guiButton) throws IOException { super.actionPerformed(guiButton); if (guiButton.id == ID_META) { filter.setMatchMeta(useMetaB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_NBT) { filter.setMatchNBT(useNbtB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_STICKY) { filter.setSticky(stickyB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_ORE_DICT) { filter.setUseOreDict(useOreDictB.isSelected()); sendFilterChange(); } else if (guiButton.id == ID_DAMAGE) { filter.setDamageMode(damageB.getMode().getMode()); sendFilterChange(); } else if (guiButton.id == ID_WHITELIST) { filter.setBlacklist(!filter.isBlacklist()); sendFilterChange(); } }
Source:
<code>MetaLocationCache(MasterServices master) { int syncIntervalSeconds = master.getConfiguration().getInt(SYNC_INTERVAL_SECONDS, DEFAULT_SYNC_INTERVAL_SECONDS); int fetchTimeoutMs = master.getConfiguration().getInt(FETCH_TIMEOUT_MS, DEFAULT_FETCH_TIMEOUT_MS); master.getChoreService().scheduleChore(new ScheduledChore( getClass().getSimpleName() + "-Sync-Chore", this, syncIntervalSeconds, 0, TimeUnit.SECONDS) { @Override protected void chore() { AsyncClusterConnection conn = master.getAsyncClusterConnection(); if (conn != null) { addListener(conn.getAllMetaRegionLocations(fetchTimeoutMs), (locs, error) -> { if (error != null) { LOG.warn("Failed to fetch all meta region locations from active master", error); return; } <START> CacheHolder ch = new CacheHolder(locs); holder = ch; <END> }); } } }); }</code><technical_language>nit: holder = new CacheHolder(locs)</technical_language>

Target:
MetaLocationCache(MasterServices master) { int syncIntervalSeconds = master.getConfiguration().getInt(SYNC_INTERVAL_SECONDS, DEFAULT_SYNC_INTERVAL_SECONDS); int fetchTimeoutMs = master.getConfiguration().getInt(FETCH_TIMEOUT_MS, DEFAULT_FETCH_TIMEOUT_MS); master.getChoreService().scheduleChore(new ScheduledChore( getClass().getSimpleName() + "-Sync-Chore", this, syncIntervalSeconds, 0, TimeUnit.SECONDS) { @Override protected void chore() { AsyncClusterConnection conn = master.getAsyncClusterConnection(); if (conn != null) { addListener(conn.getAllMetaRegionLocations(fetchTimeoutMs), (locs, error) -> { if (error != null) { LOG.warn("Failed to fetch all meta region locations from active master", error); return; } holder = new CacheHolder(locs); }); } } }); }