auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void visitIdentifier(IdentifierTree tree) { <START> Iterator<Set<IdentifierTree>> iterator = writeUsagesOfCounters.descendingIterator(); <END> while (iterator.hasNext()) { Set<IdentifierTree> currentLoopCounterUsages = iterator.next(); if (currentLoopCounterUsages.contains(tree)) { raiseIssue(tree); return; } } }</code><technical_language>@vilchik-elena do care order of iteration here</technical_language>

Target:
public void visitIdentifier(IdentifierTree tree) { for (Map<IdentifierTree, IdentifierTree> currentLoopCounterUsages : writeUsagesOfCounters) { IdentifierTree identifierUsedInUpdateClause = currentLoopCounterUsages.get(tree); if (identifierUsedInUpdateClause != null) { raiseIssue(tree, identifierUsedInUpdateClause); return; } } }
Source:
<code>@Override public <K, V> StackedModel<IS, IA, O, AM> update(StackedModel<IS, IA, O, AM> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return runOnSubmodels( ensemble -> { int i = 0; List<IgniteSupplier<Model<IS, IA>>> res = new ArrayList<>(); <START> for (Model<IS, IA> submodel : mdl.submodels()) { <END> int j = i; res.add(() -> ensemble.get(j).update(submodel, datasetBuilder, featureExtractor, lbExtractor)); i++; } return res; }, (at, extr) -> at.fit(datasetBuilder, extr, lbExtractor), featureExtractor ); }</code><technical_language>merge update fit logic</technical_language>

Target:
@Override public <K, V> StackedModel<IS, IA, O, AM> update(StackedModel<IS, IA, O, AM> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return runOnSubmodels( ensemble -> { List<IgniteSupplier<Model<IS, IA>>> res = new ArrayList<>(); for (int i = 0; i < ensemble.size(); i++) { final int j = i; res.add(() -> { DatasetTrainer<Model<IS, IA>, L> trainer = ensemble.get(j); return mdl == null ? trainer.fit(datasetBuilder, featureExtractor, lbExtractor) : trainer.update(mdl.submodels().get(j), datasetBuilder, featureExtractor, lbExtractor); }); } return res; }, (at, extr) -> mdl == null ? at.fit(datasetBuilder, extr, lbExtractor) : at.update(mdl.aggregatorModel(), datasetBuilder, extr, lbExtractor), featureExtractor ); }
Source:
<code>private static byte[] getQualifierForDynamicColumnMetaDataCell(PTableProtos.PColumn dynColProto) throws IOException { PColumn dynCol = PColumnImpl.createFromProto(dynColProto); ByteArrayOutputStream qual = new ByteArrayOutputStream(); qual.write(DYN_COLS_METADATA_CELL_QUALIFIER); qual.write(dynCol.getColumnQualifierBytes()); <START> if (LOG.isDebugEnabled()) { <END> LOG.debug("Storing shadow cell for dynamic column metadata for dynamic column : " + dynCol.getFamilyName().getString() + "." + dynCol.getName().getString()); } return qual.toByteArray(); }</code><technical_language>This end a lot of logs, change TRACE level</technical_language>

Target:
private static byte[] getQualifierForDynamicColumnMetaDataCell(PTableProtos.PColumn dynColProto) throws IOException { PColumn dynCol = PColumnImpl.createFromProto(dynColProto); ByteArrayOutputStream qual = new ByteArrayOutputStream(); qual.write(DYN_COLS_METADATA_CELL_QUALIFIER); qual.write(dynCol.getColumnQualifierBytes()); if (LOG.isTraceEnabled()) { LOG.trace("Storing shadow cell for dynamic column metadata for dynamic column : " + dynCol.getFamilyName().getString() + "." + dynCol.getName().getString()); } return qual.toByteArray(); }
Source:
<code>public void refresh(final Diagram diagram) { clearDecisionComponents(); <START> enableLoading(); <END> client.loadNodesByNamespaces(getNamespaces(diagram), getNodesConsumer()); }</code><technical_language>implementation more startLoading enableLoading</technical_language>

Target:
public void refresh(final Diagram diagram) { clearDecisionComponents(); startLoading(); client.loadNodesFromImports(getDMNIncludedModels(diagram), getNodesConsumer()); }
Source:
<code><START> private List<String> getAppThemePossiblePaths(String themePath) { String themePathInMetaInfResources = String.join("/", APPLICATION_META_INF_RESOURCES, themePath); String themePathInStaticResources = String.join("/", APPLICATION_STATIC_RESOURCES, themePath); String themePathInClassPathResources = FrontendUtils.NODE_MODULES + FrontendUtils.FLOW_NPM_PACKAGE_NAME + themePath; return Arrays.asList(themePathInMetaInfResources, themePathInStaticResources, themePathInClassPathResources); } <END></code><technical_language>suggestion private List<String> getAppThemePossiblePaths(String themePath) { String frontendTheme = String.join("/", npmFolder.toPath().relativize(frontendDirectory.toPath()) .toString(), themePath); String themePathInMetaInfResources = String.join("/", APPLICATION_META_INF_RESOURCES, themePath); String themePathInStaticResources = String.join("/", APPLICATION_STATIC_RESOURCES, themePath); String themePathInClassPathResources = String .join("", FrontendUtils.NODE_MODULES, FrontendUtils.FLOW_NPM_PACKAGE_NAME, themePath); return Arrays.asList(frontendTheme, themePathInMetaInfResources, themePathInStaticResources, themePathInClassPathResources); }</technical_language>

Target:
private List<String> getAppThemePossiblePaths(String themePath) { String frontendTheme = String.join("/", npmFolder.toPath() .relativize(frontendDirectory.toPath()).toString(), themePath); String themePathInMetaInfResources = String.join("/", APPLICATION_META_INF_RESOURCES, themePath); String themePathInStaticResources = String.join("/", APPLICATION_STATIC_RESOURCES, themePath); String themePathInClassPathResources = String.join("", FrontendUtils.NODE_MODULES, FrontendUtils.FLOW_NPM_PACKAGE_NAME, themePath); return Arrays.asList(frontendTheme, themePathInMetaInfResources, themePathInStaticResources, themePathInClassPathResources); }
Source:
<code>private List<JdbcLiteral> replacePlaceholder(StringBuilder sb, String rawQuery, JdbcSchema querySchema, List<Integer> incrementalColumnIndexes, List<JsonNode> incrementalValues) { ImmutableList.Builder<JdbcLiteral> parameters = ImmutableList.builder(); for (int n = 0; n < incrementalColumnIndexes.size(); n++) { int columnIndex = incrementalColumnIndexes.get(n); String columnName = querySchema.getColumnName(columnIndex); JsonNode value = incrementalValues.get(n); <START> rawQuery = rawQuery.replaceAll(":" + columnName, "?"); <END> parameters.add(new JdbcLiteral(columnIndex, value)); } sb.append(rawQuery); return parameters.build(); }</code><technical_language>In some cases work correctly. - column names string literals replaced. For example, incremental column name is a, sql select a, b some_table a > :a b = ':a' replaced select a, b some_table a > ? b = '?'. -> Is is easy parse SQL exactly... users a string literal, tolerate problem. add annotation README. - If incremental column name contains another incremental column name, replaced incorrectly. For example, incremental column names ab a, sql select * some_table ab > :ab a > :a replaced select * some_table ab > ?b a > ?. -> replace longer column names previously</technical_language>

Target:
private List<JdbcLiteral> replacePlaceholder(StringBuilder sb, String rawQuery, JdbcSchema querySchema, List<Integer> incrementalColumnIndexes, List<JsonNode> incrementalValues) { TreeMap<String, Integer> columnNames = new TreeMap<>(new Comparator<String>() { @Override public int compare(String val1, String val2) { return val2.length() - val1.length(); } }); ImmutableList.Builder<JdbcLiteral> parameters = ImmutableList.builder(); for (int n = 0; n < incrementalColumnIndexes.size(); n++) { int columnIndex = incrementalColumnIndexes.get(n); String columnName = querySchema.getColumnName(columnIndex); columnNames.put(columnName, columnIndex); } for (Map.Entry<Integer, Integer> columnPosition: generateColumnPositionList(rawQuery, columnNames).entrySet()) { int columnIndex = columnPosition.getValue(); JsonNode value = incrementalValues.get(columnIndex); parameters.add(new JdbcLiteral(columnIndex, value)); } for (Entry<String, Integer> column : columnNames.entrySet()) { String columnName = column.getKey(); while (rawQuery.contains(":" + columnName)) { rawQuery = rawQuery.replaceFirst(":" + columnName, "?"); } } sb.append(rawQuery); return parameters.build(); }
Source:
<code>public static CharSequence decodeMimeTypeFromMimeBuffer(ByteBuf flyweightMimeBuffer) { if (flyweightMimeBuffer.readableBytes() < 2) { return null; } <START> flyweightMimeBuffer.skipBytes(1); <END> int mimeStringLength = flyweightMimeBuffer.readableBytes(); return flyweightMimeBuffer.readCharSequence(mimeStringLength, CharsetUtil.US_ASCII); }</code><technical_language>this adjust readIndex? RSocket frames do is adjust read index call leads weird problems frames else. I thought bit byte in determined length- if bit is 0 do need skip anything</technical_language>

Target:
public static CharSequence decodeMimeTypeFromMimeBuffer(ByteBuf flyweightMimeBuffer) { if (flyweightMimeBuffer.readableBytes() < 2) { throw new IllegalStateException("unable to decode explicit MIME type"); } flyweightMimeBuffer.skipBytes(1); int mimeStringLength = flyweightMimeBuffer.readableBytes(); return flyweightMimeBuffer.readCharSequence(mimeStringLength, CharsetUtil.US_ASCII); }
Source:
<code>public final void sourceOnlyConfiguration(Configuration configuration) { Preconditions.checkNotNull(configuration); Preconditions.checkArgument( configuration.isCanBeResolved(), "May only add sourceOnlyConfiguration if it is resolvable: %s", <START> configuration); <END> this.sourceOnlyConfigurations.add(Objects.requireNonNull(configuration)); }</code><technical_language>fair this method exist, I in situation users it. name is confusing implies source-only configurations need added, add (ignore) compileOnly configurations source sets. for now, throw eagerly if user gave a bad configuration</technical_language>

Target:
public final void sourceOnlyConfiguration(Configuration configuration) { Preconditions.checkNotNull(configuration, "This method requires a non-null configuration"); Preconditions.checkArgument( configuration.isCanBeResolved(), "May only add sourceOnlyConfiguration if it is resolvable: %s", configuration); this.sourceOnlyConfigurations.add(Objects.requireNonNull(configuration)); }
Source:
<code>public void catchUp(Timestamp since, @Nullable Set<I> ids) throws <START> CatchUpAlreadyStartedException { <END> checkCatchUpTargets(ids); checkCatchUpStartTime(since); withCurrentTenant(context().isMultitenant()).run( () -> catchUpProcess.startCatchUp(since, ids) ); }</code><technical_language>throws name of exception class next line</technical_language>

Target:
public CatchUpId catchUp(Timestamp since, @Nullable Set<I> ids) throws CatchUpAlreadyStartedException { checkCatchUpTargets(ids); checkCatchUpStartTime(since); CatchUpId catchUpId = withCurrentTenant(context().isMultitenant()) .evaluate(() -> catchUpProcess.startCatchUp(since, ids)); return catchUpId; }
Source:
<code>public static void input(@AggregationState GeometryState state, @SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = GeometrySerde.deserialize(input); if (state.getGeometry() == null) { state.setGeometry(geometry.convexHull()); } else if (!geometry.isEmpty()) { state.addMemoryUsage(-state.estimateGeometryMemorySize()); state.setGeometry(state.getGeometry().union(geometry).convexHull()); } <START> state.addMemoryUsage(state.estimateGeometryMemorySize()); <END> }</code><technical_language>a setMemoryUsage(N) method do state.setMemoryUsage(state.estimateGeometryMemorySize()) end of this method instead of subtract-and-then-add</technical_language>

Target:
public static void input(@AggregationState GeometryState state, @SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = GeometrySerde.deserialize(input); if (state.getGeometry() == null) { state.setGeometry(geometry.convexHull(), 0); } else if (!geometry.isEmpty()) { long previousMemorySize = state.getGeometry().estimateMemorySize(); state.setGeometry(state.getGeometry().union(geometry).convexHull(), previousMemorySize); } }
Source:
<code>public final String raw( @NotNull(message = "Markdown can't be NULL") final String text ) throws IOException { <START> throw new NotImplementedException("MkMarkdown#raw()"); <END> }</code><technical_language>I this implementation is render(), need a puzzle of - copy line above</technical_language>

Target:
public final String raw( @NotNull(message = "Markdown can't be NULL") final String text ) { return text; }
Source:
<code>protected static void removeProject(Logger log) { log.info("Removing " + PROJECT_NAME); try { org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException runtimeExc) { log.info("Runtime exception appeared, re-trying deleting of project"); <START> org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); <END> } new WaitWhile(new JobIsRunning()); }</code><technical_language>RedDeer's Project.delete is calling method this change is in long run</technical_language>

Target:
protected static void removeProject(Logger log) { log.info("Removing " + PROJECT_NAME); try { new WaitUntil(new JobIsRunning(), TimePeriod.NORMAL); org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException exc) { log.error("RuntimeException occured during deleting project"); exc.printStackTrace(); log.info("Deleting project second time ..."); try { org.jboss.reddeer.direct.project.Project.delete(PROJECT_NAME, true, true); } catch (RuntimeException e) { throw new RuntimeException("Was not possible to delete project: " + PROJECT_NAME, e); } } new WaitWhile(new JobIsRunning()); }
Source:
<code>default void fetchInstallableApplications(Consumer<RepositoryDTO> callback, Consumer<Exception> errorCallback) { try { callback.accept(fetchInstallableApplications()); } catch (Exception e) { <START> e.printStackTrace(); <END> errorCallback.accept(e); } }</code><technical_language>Please a logger here. In addition catch Exception a more specific subclass</technical_language>

Target:
default void fetchInstallableApplications(Consumer<RepositoryDTO> callback, Consumer<Exception> errorCallback) { try { callback.accept(fetchInstallableApplications()); } catch (Exception e) { LOGGER.error("Fetching installable applications failed!", e); errorCallback.accept(e); } }
Source:
<code>public String identifySimple() { <START> return "bigdoor@" + door.getDoorUID(); <END> }</code><technical_language>this a call identify()</technical_language>

Target:
public String identifySimple() { return identify(); }
Source:
<code><START> public R record() { <END> return record; }</code><technical_language>final</technical_language>

Target:
public final R record() { return record; }
Source:
<code>private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return <START> CollectionUtils .isNotEmpty(vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, <END> VmDeviceGeneralType.HOSTDEV, vfName)); }</code><technical_language>dao return empty list populated one, null</technical_language>

Target:
private boolean shouldBeDirectlyAttached(String vfName, Guid vmId) { return !vmDeviceDao.getVmDeviceByVmIdTypeAndDevice(vmId, VmDeviceGeneralType.HOSTDEV, vfName).isEmpty(); }
Source:
<code>public YarnRestJobStatusProvider(JobsResourceConfig config) { YarnJobResourceConfig yarnConfig = new YarnJobResourceConfig(config); this._objectMapper = new ObjectMapper(); <START> this._objectMapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true); <END> this._httpClient = new HttpClient(); this._apiEndpoint = String.format("http://%s/ws/v1/cluster/apps?states=RUNNING,NEW,NEW_SAVING,SUBMITTED,ACCEPTED", yarnConfig.getYarnResourceManagerEndpoint()); }</code><technical_language>is this required</technical_language>

Target:
public YarnRestJobStatusProvider(JobsResourceConfig config) { YarnJobResourceConfig yarnConfig = new YarnJobResourceConfig(config); this.httpClient = new HttpClient(); OBJECT_MAPPER.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true); this.apiEndpoint = String.format("http://%s/ws/v1/cluster/apps", yarnConfig.getYarnResourceManagerEndpoint()); }
Source:
<code>private void scanErrorLogs(String errFilePath) throws IOException { File regfile = new File(errFilePath); try (BufferedReader reader = new BufferedReader(new FileReader(regfile))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.contains("Error") || line.contains("@INC")) { <START> logger.log(Level.WARNING, "Regripper file {0} contains errors from run", errFilePath); END> } line = reader.readLine(); } } }</code><technical_language>worth sending a notification user know? is fact running regripper explicitly stated in Activity module description</technical_language>

Target:
private void scanErrorLogs(String errFilePath) throws IOException { File regfile = new File(errFilePath); try (BufferedReader reader = new BufferedReader(new FileReader(regfile))) { String line = reader.readLine(); while (line != null) { line = line.trim(); if (line.toLowerCase().contains("error") || line.toLowerCase().contains("@inc")) { logger.log(Level.WARNING, "Regripper file {0} contains errors from run", errFilePath); } line = reader.readLine(); } } }
Source:
<code>public int hashCode() { int hash = 0; for (String editor : editors) { hash = hash * 37 + editor.hashCode(); } for (IEditorInput <START> element : <END> input) { hash = hash * 37 + element.hashCode(); } return hash; }</code><technical_language>rename 'editorInput'</technical_language>

Target:
public int hashCode() { int hash = 0; for (String editor : editors) { hash = hash * 37 + editor.hashCode(); } for (IEditorInput editorInput : input) { hash = hash * 37 + editorInput.hashCode(); } return hash; }
Source:
<code><START> public short getFlag() { <END> return flag; }</code><technical_language>return a byte</technical_language>

Target:
public byte getFlag() { return flag; }
Source:
<code>private String getExpectedBeanName(String domain, String instanceName, String grp, String name) { StringBuffer sb = new StringBuffer(); sb.append(domain + ":"); <START> if (getBoolean(IGNITE_MBEAN_APPEND_CLASS_LOADER_ID, true)) { <END> String clsLdrHash = Integer.toHexString(Ignite.class.getClassLoader().hashCode()); sb.append("clsLdr=").append(clsLdrHash).append(','); } if (getBoolean(IGNITE_MBEAN_APPEND_JVM_ID)) { String jvmId = ManagementFactory.getRuntimeMXBean().getName(); sb.append("jvmId=").append(jvmId).append(','); } sb.append("group=").append(grp).append(","); sb.append("igniteInstanceName=").append(instanceName).append(","); sb.append("name=").append(name); return sb.toString(); }</code><technical_language>set IGNITE_MBEAN_APPEND_CLASS_LOADER_ID IGNITE_MBEAN_APPEND_JVM_ID false, hardcode entire name string "igniteInstanceName=mygrid,group=Thread Pools,name=GridSystemExecutor"? I guess check names in checkBean() test instead of makeMBeanName() call (basically, get rid of makeMBeanName() in this test)</technical_language>

Target:
private String getExpectedBeanName(String domain, String instanceName, String grp, String name) { StringBuffer sb = new StringBuffer(); sb.append(domain + ":"); sb.append("group=").append(grp).append(","); sb.append("igniteInstanceName=").append(instanceName).append(","); sb.append("name=").append(name); return sb.toString(); }
Source:
<code>public void addPageTerminalControl(ITerminalControl terminalControl) { if (fHistoryBuffer.size() > 0) { new WriteHistoryJob(terminalControl).schedule(); } <START> fTerminalPageControls.add(terminalControl); <END> }</code><technical_language>this new order help? WriteHistoryJob is finished schedule() call returns, asked run some point. In likelyhood, WriteHistoryJob finish, add new terminalControl fTerminalPageControls. OutputReadJob start writing WriteHistoryJob is finished. I need WriteHistoryJob is finished OutputReadJob write terminalControl. if do that, happen if OutputReadJob adds history buffer, while WriteHistoryJob is running? I output written console in a case. simplest prevent OutputReadJob running WriteHistoryJob is finished. worried WriteHistoryJob long though, if GDB is sending a lot of output, block if OutputReadJob is reading. need this a bit</technical_language>

Target:
public void addPageTerminalControl(ITerminalControl terminalControl) { new WriteHistoryJob(terminalControl).schedule(); }
Source:
<code>public RequestSpecBacking(MutableHeaders headers, URI uri, ByteBufAllocator byteBufAllocator, RequestParams requestParams) { this.headers = headers; this.uri = uri; this.byteBufAllocator = byteBufAllocator; this.requestParams = requestParams; this.bodyByteBuf = byteBufAllocator.buffer(0, 0); <START> this.decompressResponse = false; <END> }</code><technical_language>I default true, this common case</technical_language>

Target:
public RequestSpecBacking(MutableHeaders headers, URI uri, ByteBufAllocator byteBufAllocator, RequestParams requestParams) { this.headers = headers; this.uri = uri; this.byteBufAllocator = byteBufAllocator; this.requestParams = requestParams; this.bodyByteBuf = byteBufAllocator.buffer(0, 0); this.decompressResponse = true; }
Source:
<code>@Override protected <T> T parse(HttpEntity entity, Type type) throws ConversionException { try { InputStream in = entity.getContent(); try { ByteSink out = destination.newSink(); final int total = (int) entity.getContentLength(); int totalRead = 0; try { byte[] buffer = new byte[4096]; int read; <START> while ((read = in.read(buffer)) > -1) { <END> out.write(buffer, read); if (progressListener != null) { totalRead += read; int percent = totalRead * 100 / total; if (percent - progressUpdate.percent > PROGRESS_GRANULARITY) { progressUpdate.percent = percent; mainThread.execute(progressUpdate); } } } } finally { out.close(); } } finally { in.close(); } } catch (IOException e) { throw new ConversionException(e); } return null; }</code><technical_language>Nit: != -1 > -1. > -1 is precise, implies a bunch of impossible scenarios happen, read() returning 0 -2</technical_language>

Target:
@Override protected Object parse(HttpEntity entity, Type type) throws ConversionException { try { InputStream in = entity.getContent(); try { ByteSink out = destination.newSink(); final int total = (int) entity.getContentLength(); int totalRead = 0; try { byte[] buffer = new byte[4096]; int read; while ((read = in.read(buffer)) > -1) { out.write(buffer, read); if (progressListener != null) { totalRead += read; int percent = totalRead * 100 / total; if (percent - progressUpdate.percent > PROGRESS_GRANULARITY) { progressUpdate.percent = percent; mainThread.execute(progressUpdate); } } } } finally { out.close(); } } finally { in.close(); } } catch (IOException e) { throw new ConversionException(e); } return null; }
Source:
<code>public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(POST).path("/v2/counters/{counterName}").handleWith(this::createCounter) .invocation().methods(DELETE).path("/v2/counters/{counterName}").handleWith(this::deleteCounter) .invocation().methods(GET).path("/v2/counters/{counterName}/config").handleWith(this::getConfig) .invocation().methods(GET).path("/v2/counters/{counterName}").handleWith(this::getCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("reset").handleWith(this::resetCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("increment").handleWith(this::incrementWeak) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrement").handleWith(this::decrementWeak) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("add").handleWith(this::addValueWeak) <START> .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("incrementAndGet").handleWith(this::incrementStrong) <END> .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrementAndGet").handleWith(this::decrementStrong) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("addAndGet").handleWith(this::addValueStrong) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSet").handleWith(this::compareSet) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSwap").handleWith(this::compareSwap) .create(); }</code><technical_language>@pruivo Is define a strong a weak counter name? If current URL scheme is sufficient</technical_language>

Target:
public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(POST).path("/v2/counters/{counterName}").handleWith(this::createCounter) .invocation().methods(DELETE).path("/v2/counters/{counterName}").handleWith(this::deleteCounter) .invocation().methods(GET).path("/v2/counters/{counterName}/config").handleWith(this::getConfig) .invocation().methods(GET).path("/v2/counters/{counterName}").handleWith(this::getCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("reset").handleWith(this::resetCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("increment").handleWith(this::incrementCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrement").handleWith(this::decrementCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("add").handleWith(this::addValue) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSet").handleWith(this::compareSet) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSwap").handleWith(this::compareSwap) .create(); }
Source:
<code><START> private void getTopic(RowMap r){ <END> String original_topic_per_table = this.context.getKafkaTopicPerTableFormat(); if(original_topic_per_table.contains("%{database}") || original_topic_per_table.contains("%{table}")) { String db_name = r.getDatabase(); String kafkaTopicWithFormat = original_topic_per_table.replaceAll("%\\{database\\}", db_name); String table_name = r.getTable(); this.topic = kafkaTopicWithFormat.replaceAll("%\\{table\\}", table_name); List<PartitionInfo> partitions_for_kafka; try { partitions_for_kafka = this.kafka.partitionsFor(this.topic); } catch(TimeoutException e) { LOGGER.error("This topic name does not exist: " + this.topic + ": " + e.getLocalizedMessage()); throw (e); } } }</code><technical_language>this function return topic a String (rather mutating this.topic)</technical_language>

Target:
private String getTopic(RowMap r){ String finalKafkaTopicWithFormat = ""; String original_topic_per_table = this.context.getKafkaTopicPerTableFormat(); if(original_topic_per_table.contains("%{database}") || original_topic_per_table.contains("%{table}")) { String db_name = r.getDatabase(); String kafkaTopicWithFormat = original_topic_per_table.replaceAll("%\\{database\\}", db_name); String table_name = r.getTable(); finalKafkaTopicWithFormat = kafkaTopicWithFormat.replaceAll("%\\{table\\}", table_name); } return finalKafkaTopicWithFormat; }
Source:
<code>void create() { statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { <START> throw new RuntimeException("Couldn't destroy Cache", e); <END> } }</code><technical_language>wrong exception message</technical_language>

Target:
void create() { statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { throw new RuntimeException("Couldn't create Cache", e); } }
Source:
<code><START> public void createFolderWithSlash() throws IOException { <END> final String folderName = "FolderNameWithSlash/"; try { final Ds3Object ds3Object = new Ds3Object(folderName, 0); final PutBulkJobSpectraS3Response jobResponse = client.putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(BUCKET_NAME, ImmutableList.of(ds3Object))); client.putFolder(new PutFolderRequest(BUCKET_NAME, folderName, jobResponse.getMasterObjectList().getJobId())); } finally { deleteAllContents(client, BUCKET_NAME); } }</code><technical_language>this test fail? I missing though</technical_language>

Target:
public void createFolderWithSlash() throws IOException { final String folderName = "FolderNameWithSlash/"; try { final PutFolderResponse response = HELPERS.createFolder(BUCKET_NAME, folderName); assertNotNull(response); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
<code>public List<LunModel> getLunsToRemove() { if (getIsGrouppedByTarget()) { List<LunModel> luns = Collections.emptyList(); List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { <START> luns = sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); <END> } return luns; } return ((List<LunModel>) getItems()).stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); }</code><technical_language>overriding luns iteration instead of adding it. Perhpas meant stream sanTargetModel, flatMap getLuns()</technical_language>

Target:
public Set<String> getLunsToRemove() { if (getIsGrouppedByTarget()) { return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::isRemoveLunSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); } return ((List<LunModel>) getItems()).stream() .filter(LunModel::isRemoveLunSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); }
Source:
<code>protected void initUnregisteredDisksToDB(Guid storageDomainId) { Set<DiskImage> existingDisks = new HashSet<>(diskImageDao.getAllForStorageDomain(storageDomainId)); List<UnregisteredDisk> unregisteredDisksToSave = new LinkedList<>(); for (Object unregisteredDiskObj : unregisteredDisks) { UnregisteredDisk unregisteredDisk = (UnregisteredDisk) unregisteredDiskObj; if (existingDisks.contains(unregisteredDisk.getDiskImage())) { log.info("Disk with id '{}' already exists in the engine, therefore will not be " + "part of the unregistered disks.", unregisteredDisk.getDiskAlias(), unregisteredDisk.getDiskImage().getId()); continue; } unregisteredDisksToSave.add(unregisteredDisk); log.info("Adding unregistered disk of disk id '{}' and disk alias '{}'", unregisteredDisk.getDiskImage().getId(), unregisteredDisk.getDiskAlias()); } <START> unregisteredDisksDao.saveAllInBatch(unregisteredDisksToSave); <END> }</code><technical_language>I understand remove is place now? I eventually get duplicate key error</technical_language>

Target:
protected void initUnregisteredDisksToDB(Guid storageDomainId) { Set<DiskImage> existingDisks = new HashSet<>(diskImageDao.getAllForStorageDomain(storageDomainId)); for (Object unregisteredDiskObj : unregisteredDisks) { UnregisteredDisk unregisteredDisk = (UnregisteredDisk) unregisteredDiskObj; if (existingDisks.contains(unregisteredDisk.getDiskImage())) { log.info("Disk with id '{}' already exists in the engine, therefore will not be " + "part of the unregistered disks.", unregisteredDisk.getDiskAlias(), unregisteredDisk.getDiskImage().getId()); continue; } unregisteredDisksDao.removeUnregisteredDisk(unregisteredDisk.getId().getDiskId(), storageDomainId); unregisteredDisksDao.saveUnregisteredDisk(unregisteredDisk); log.info("Adding unregistered disk of disk id '{}' and disk alias '{}'", unregisteredDisk.getDiskImage().getId(), unregisteredDisk.getDiskAlias()); } }
Source:
<code><START> public static Builder builder() { <END> return new Builder(); }</code><technical_language>adding builders, please [this](<LINK_0></technical_language>

Target:
public static Builder builder() { return new AutoValue_NetworkSettings_Details.Builder(); }
Source:
<code>public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); protectedContexts = new ArrayList<>(); protectedContexts.add(JOLOKIA_CONTEXT); protectedContexts.add(INTRIGUE_CONTEXT); protectedContexts.add(WEBSOCKET_CONTEXT); String internalHostname = SystemBaseUrl.INTERNAL.getHost(); String internalHttpPort = SystemBaseUrl.INTERNAL.getHttpPort(); String internalHttpsPort = SystemBaseUrl.INTERNAL.getHttpsPort(); String externalHostname = SystemBaseUrl.EXTERNAL.getHost(); String externalHttpPort = SystemBaseUrl.EXTERNAL.getHttpPort(); String externalHttpsPort = SystemBaseUrl.EXTERNAL.getHttpsPort(); if (trustedAuthorities == null) { <START> trustedAuthorities = new ArrayList<>(); <END> } trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); }</code><technical_language>Nit, move thetrustedAuthorities protectedContexts initialization a default constructor</technical_language>

Target:
public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); String internalHostname = SystemBaseUrl.INTERNAL.getHost(); String internalHttpPort = SystemBaseUrl.INTERNAL.getHttpPort(); String internalHttpsPort = SystemBaseUrl.INTERNAL.getHttpsPort(); String externalHostname = SystemBaseUrl.EXTERNAL.getHost(); String externalHttpPort = SystemBaseUrl.EXTERNAL.getHttpPort(); String externalHttpsPort = SystemBaseUrl.EXTERNAL.getHttpsPort(); trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); BROWSER_PROTECTION_WHITELIST.add( Pattern.compile(WEBSOCKET_CONTEXT_REGEX), HttpMethod.GET.asString()); BROWSER_PROTECTION_WHITELIST.add(Pattern.compile(CATALOG_CONTEXT), HttpMethod.GET.asString()); USER_AGENT_WHITELIST.add(Pattern.compile(APACHE_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(APACHE_CLIENT_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(JAVA_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(JAVA_CLIENT_USER_AGENT)); }
Source:
<code>protected IStateHistoryBackend getBackendForBuilding(long startTime) throws IOException { File historyTreeFile = File.createTempFile("HistoryTreeBackendTest", ".ht"); fHistoryTreeFiles.add(historyTreeFile); <START> HistoryTreeBackend backend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION, startTime, fBlockSize, fMaxChildren); <END> fBackendMap.put(backend, historyTreeFile); return backend; }</code><technical_language>While this file, fix warnings well</technical_language>

Target:
protected IStateHistoryBackend getBackendForBuilding(long startTime) throws IOException { File historyTreeFile = checkNotNull(File.createTempFile("HistoryTreeBackendTest", ".ht")); fHistoryTreeFiles.add(historyTreeFile); HistoryTreeBackend backend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION, startTime, fBlockSize, fMaxChildren); fBackendMap.put(backend, historyTreeFile); return backend; }
Source:
<code>public void translateSingle_SUPREME_COURT_defective_court_chamber() { SolrDocument doc = new SolrDocument(); doc.addField("courtChamber", "11"); JudgmentSearchResult result = resultsTranslator.translateSingle(doc); <START> Assert.assertTrue(result.getCourtChambers().equals(Lists.newArrayList())); <END> }</code><technical_language>talked once: assertEquals(0, result.getCourtChambers().size())</technical_language>

Target:
public void translateSingle_SUPREME_COURT_defective_court_chamber() { SolrDocument doc = new SolrDocument(); doc.addField("courtChamber", "11"); JudgmentSearchResult result = resultsTranslator.translateSingle(doc); Assert.assertEquals(0, result.getCourtChambers().size()); }
Source:
<code>private void loadAndPreflightPdf() throws NuxeoException { if (pdfDoc != null) { return; } pdfDoc = PDFUtils.load(pdfBlob, password); try { stripper = new PDFTextStripperByArea(); for (Object pageObject : pdfDoc.getDocumentCatalog().getAllPages()) { PDPage page = (PDPage) pageObject; List pageAnnotations = page.getAnnotations(); for (Object annotationObject : pageAnnotations) { PDAnnotation annot = (PDAnnotation) annotationObject; if (!(annot instanceof PDAnnotationLink)) { continue; } PDAnnotationLink link = (PDAnnotationLink) annot; PDRectangle rect = link.getRectangle(); float x = rect.getLowerLeftX(), y = rect.getUpperRightY(); float width = rect.getWidth(), height = rect.getHeight(); int rotation = page.findRotation(); if (rotation == 0) { PDRectangle pageSize = page.findMediaBox(); y = pageSize.getHeight() - y; } Rectangle2D.Float awtRect = new Rectangle2D.Float(x, y, width, height); <START> stripper.addRegion("" + pageAnnotations.indexOf(annot), awtRect); <END> } } } catch (IOException e) { throw new NuxeoException("Cannot prefilght and prepare regions", e); } }</code><technical_language>String.valueOf</technical_language>

Target:
private void loadAndPreflightPdf() throws NuxeoException { if (pdfDoc != null) { return; } pdfDoc = PDFUtils.load(pdfBlob, password); try { stripper = new PDFTextStripperByArea(); for (Object pageObject : pdfDoc.getDocumentCatalog().getAllPages()) { PDPage page = (PDPage) pageObject; List pageAnnotations = page.getAnnotations(); for (Object annotationObject : pageAnnotations) { PDAnnotation annot = (PDAnnotation) annotationObject; if (!(annot instanceof PDAnnotationLink)) { continue; } PDAnnotationLink link = (PDAnnotationLink) annot; PDRectangle rect = link.getRectangle(); float x = rect.getLowerLeftX(), y = rect.getUpperRightY(); float width = rect.getWidth(), height = rect.getHeight(); int rotation = page.findRotation(); if (rotation == 0) { PDRectangle pageSize = page.findMediaBox(); y = pageSize.getHeight() - y; } Rectangle2D.Float awtRect = new Rectangle2D.Float(x, y, width, height); stripper.addRegion(String.valueOf(pageAnnotations.indexOf(annot)), awtRect); } } } catch (IOException e) { throw new NuxeoException("Cannot preflight and prepare regions", e); } }
Source:
<code>public static @Nullable String getExecutableName(KernelAnalysisModule module, Integer threadId) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Integer execNameNode; try { execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME); List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime()); ITmfStateValue execNameValue; for (ITmfStateInterval interval : execNameIntervals) { execNameValue = interval.getStateValue(); <START> if(execNameValue.getType().equals(Type.STRING)) { <END> return execNameValue.unboxStr(); } } } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return null; }</code><technical_language>missing space :(</technical_language>

Target:
public static @Nullable String getExecutableName(KernelAnalysisModule module, Integer threadId) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Integer execNameNode; try { execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME); List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime()); ITmfStateValue execNameValue; String execName = null; for (ITmfStateInterval interval : execNameIntervals) { execNameValue = interval.getStateValue(); if (execNameValue.getType().equals(Type.STRING)) { execName = execNameValue.unboxStr(); } } return execName; } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return null; }
Source:
<code>public void onReceive(Context context, Intent intent) { Timber.tag(TAG).d(intent.toString()); if (intent.getAction() == null || !RESPONSIBILITIES.contains(intent.getAction())) { Timber.tag(TAG).w("Got called outside our responsibilities: %s", intent.getAction()); return; } if (intent.getBooleanExtra("forwarded", false)) { Timber.tag(TAG).d("Dropping forwarded intent"); return; } if (intent.getAction().equals(REFERRER_SOURCE_GPLAY)) { <START> String referrer = intent.getStringExtra(ARG_KEY_GPLAY_REFERRER); <END> if (referrer != null) { new Thread(() -> { Matomo.getInstance(context.getApplicationContext()).getPreferences().edit().putString(PREF_KEY_INSTALL_REFERRER_EXTRAS, referrer).apply(); Timber.tag(TAG).d("Stored Google Play referrer extras: %s", referrer); }).start(); } } intent.setComponent(null); intent.setPackage(context.getPackageName()); intent.putExtra("forwarded", true); context.sendBroadcast(intent); }</code><technical_language>Moving pref init IF scope is good :+1:</technical_language>

Target:
public void onReceive(Context context, Intent intent) { Timber.tag(TAG).d(intent.toString()); if (intent.getAction() == null || !RESPONSIBILITIES.contains(intent.getAction())) { Timber.tag(TAG).w("Got called outside our responsibilities: %s", intent.getAction()); return; } if (intent.getBooleanExtra("forwarded", false)) { Timber.tag(TAG).d("Dropping forwarded intent"); return; } if (intent.getAction().equals(REFERRER_SOURCE_GPLAY)) { String referrer = intent.getStringExtra(ARG_KEY_GPLAY_REFERRER); if (referrer != null) { final PendingResult result = goAsync(); new Thread(() -> { Matomo.getInstance(context.getApplicationContext()).getPreferences().edit().putString(PREF_KEY_INSTALL_REFERRER_EXTRAS, referrer).apply(); Timber.tag(TAG).d("Stored Google Play referrer extras: %s", referrer); result.finish(); }).start(); } } intent.setComponent(null); intent.setPackage(context.getPackageName()); intent.putExtra("forwarded", true); context.sendBroadcast(intent); }
Source:
<code>public synchronized void deregisterEvaluator(final String contextId) { final int memoryStoreId = getMemoryStoreId(contextId); final Set<Integer> remainingBlocks = storeIdToBlockIds.get(memoryStoreId); if (remainingBlocks == null) { throw new RuntimeException("The store " + memoryStoreId + " does not exist"); } else if (!remainingBlocks.isEmpty()) { throw new RuntimeException("This attempt tries to remove a non-empty store, resulting missing blocks."); } <START> storeIdToBlockIds.remove(memoryStoreId); <END> }</code><technical_language>out of curiosity, this change (L132, L139) work differently remove (as previously L132)? is for improving readability</technical_language>

Target:
synchronized void deregisterEvaluator(final String contextId) { final int memoryStoreId = getMemoryStoreId(contextId); final Set<Integer> remainingBlocks = storeIdToBlockIds.get(memoryStoreId); if (remainingBlocks == null) { throw new RuntimeException("The store " + memoryStoreId + " does not exist"); } else if (!remainingBlocks.isEmpty()) { throw new RuntimeException("This attempt tries to remove a non-empty store, resulting missing blocks."); } storeIdToBlockIds.remove(memoryStoreId); }
Source:
<code>public void doSaveProperties(long version) { if (version < lastCacheChanged.get()) { return; } if (file == null) { return; } try { File lockfile = new File(file.getAbsolutePath() + ".lock"); if (!lockfile.exists()) { lockfile.createNewFile(); } try (RandomAccessFile raf = new RandomAccessFile(lockfile, "rw"); FileChannel channel = raf.getChannel()) { FileLock lock = channel.tryLock(); if (lock == null) { throw new IOException("Can not lock the registry cache file " + file.getAbsolutePath() + ", ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties"); } try { if (!file.exists()) { file.createNewFile(); } try (FileOutputStream outputFile = new FileOutputStream(file)) { properties.store(outputFile, "Dubbo Registry Cache"); } } finally { lock.release(); } } } catch (Throwable e) { <START> if (e instanceof IOException) { END> logger.warn("Failed to save registry cache file, cause: " + e.getMessage(), e); return; } if (version < lastCacheChanged.get()) { return; } else { registryCacheExecutor.execute(new SaveProperties(lastCacheChanged.incrementAndGet())); } logger.warn("Failed to save registry cache file, cause: " + e.getMessage(), e); } }</code><technical_language>catch IOException directly</technical_language>

Target:
public void doSaveProperties(long version) { if (version < lastCacheChanged.get()) { return; } if (file == null) { return; } try { File lockfile = new File(file.getAbsolutePath() + ".lock"); if (!lockfile.exists()) { lockfile.createNewFile(); } try (RandomAccessFile raf = new RandomAccessFile(lockfile, "rw"); FileChannel channel = raf.getChannel()) { FileLock lock = channel.tryLock(); if (lock == null) { throw new IOException("Can not lock the registry cache file " + file.getAbsolutePath() + ", ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties"); } try { if (!file.exists()) { file.createNewFile(); } try (FileOutputStream outputFile = new FileOutputStream(file)) { properties.store(outputFile, "Dubbo Registry Cache"); } } finally { lock.release(); } } } catch (Throwable e) { savePropertiesRetryTimes.incrementAndGet(); if (savePropertiesRetryTimes.get() >= MAX_RETRY_TIMES_SAVE_PROPERTIES) { logger.warn("Failed to save registry cache file after retrying " + MAX_RETRY_TIMES_SAVE_PROPERTIES + " times, cause: " + e.getMessage(), e); savePropertiesRetryTimes.set(0); return; } if (version < lastCacheChanged.get()) { savePropertiesRetryTimes.set(0); return; } else { registryCacheExecutor.execute(new SaveProperties(lastCacheChanged.incrementAndGet())); } logger.warn("Failed to save registry cache file, will retry, cause: " + e.getMessage(), e); } }
Source:
<code>protected RouteBuilder createRouteBuilder() throws Exception { stubFor(get(urlEqualTo("/")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"Kie Server info\">\n" + " <kie-server-info>\n" + " <version>1.2.3</version>\n" + " </kie-server-info>\n" + "</response>"))); return new RouteBuilder() { @Override public void configure() { from("direct:start") <START> .to("kie:" + mockServerBaseUri + "?username=admin&password=admin") <END> .to("mock:result"); } }; }</code><technical_language>@mariofusco need discuss camel guys do in cases authentication is necessary</technical_language>

Target:
protected RouteBuilder createRouteBuilder() throws Exception { stubFor(get(urlEqualTo("/")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"Kie Server info\">\n" + " <kie-server-info>\n" + " <version>1.2.3</version>\n" + " </kie-server-info>\n" + "</response>"))); stubFor(get(urlEqualTo("/containers")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"List of created containers\">\n" + " <kie-containers>\n" + " <kie-container container-id=\"kjar1\" status=\"FAILED\"/>\n" + " <kie-container container-id=\"kjar2\" status=\"STARTED\"/>" + " </kie-containers>" + "</response>"))); return new RouteBuilder() { @Override public void configure() { from("direct:start") .to("kie:" + getAuthenticadUrl("admin", "admin")) .to("mock:result"); } }; }
Source:
<code>public void stateUpdated(Item item, State state) { State oldState = this.state; <START> if (null != function) { <END> setState(function.calculate(members)); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }</code><technical_language>I know, a matter of personal taste, other pretty consistently</technical_language>

Target:
public void stateUpdated(Item item, State state) { State oldState = this.state; if (function != null) { setState(function.calculate(members)); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }
Source:
<code>protected void <START> tearDown() <END> throws Exception { setWorkspaceAutoBuild(wasAutoBuildOn); logListener.clear(); Platform.removeLogListener(logListener); super.tearDown(); }</code><technical_language>Please project created in test is deleted here</technical_language>

Target:
protected void tearDown() throws Exception { Job.getJobManager().cancel(BuildTestProject.class); IProject testProject = getTestProject(); if (testProject.exists()) { testProject.delete(true, null); } setWorkspaceAutoBuild(wasAutoBuildOn); logListener.clear(); Platform.removeLogListener(logListener); super.tearDown(); }