auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance) && !ContainerFactory.isEmptyContainer(containerInstance)) { if (SpaceFactory.isHeating(spaceInstance) && ContainerFactory.isHeatingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { <START> ObjectInstance ing = state.getObject(name); <END> if (!IngredientFactory.isMeltedAtRoomTemperature(ing)) { IngredientFactory.meltIngredient(ing); } } } else if (SpaceFactory.isBaking(spaceInstance) && ContainerFactory.isBakingContainer(containerInstance)) { for (String name : ContainerFactory.getContentNames(containerInstance)) { ObjectInstance ing = state.getObject(name); IngredientFactory.bakeIngredient(ing); } } } }</code><technical_language>This is a lot of indented code, more readable if broke out some stuff methods</technical_language>

Target:
private static void move(State state, ObjectInstance containerInstance, ObjectInstance spaceInstance) { String oldSpace = ContainerFactory.getSpaceName(containerInstance); ObjectInstance oldSpaceObject = state.getObject(oldSpace); ContainerFactory.changeContainerSpace(containerInstance, spaceInstance.getName()); SpaceFactory.addContainer(spaceInstance, containerInstance); SpaceFactory.removeContainer(oldSpaceObject, containerInstance); if (SpaceFactory.getOnOff(spaceInstance)) { if (SpaceFactory.isBaking(spaceInstance)) { MoveAction.movingToBakingSpace(state, spaceInstance, containerInstance); } if (SpaceFactory.isHeating(spaceInstance)) { MoveAction.movingToHeatingSpace(state, spaceInstance, containerInstance); } } }
Source:
<code>public int getMaxIntermediateSize() { <START> return Doubles.BYTES; <END> }</code><technical_language>Double.BYTES</technical_language>

Target:
public int getMaxIntermediateSize() { return Double.BYTES; }
Source:
<code>void notifiedWithCorrectNamesWhenClassExecutionSkipped() throws Exception { ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass(ReportEntry.class); TestPlan testPlan = TestPlan.from(Collections.singletonList(new EngineDescriptor(newId(), "Luke's Plan"))); adapter.testPlanExecutionStarted(testPlan); TestIdentifier classIdentifier = newClassIdentifierOnTestPlan(testPlan); adapter.executionSkipped(classIdentifier, "test"); verify(listener).testSkipped(entryCaptor.capture()); ReportEntry entry = entryCaptor.getValue(); assertTrue(MyTestClass.class.getTypeName().contains(entry.getName())); <START> assertEquals("<unrooted>", entry.getSourceName()); <END> }</code><technical_language>I in this case omit classname completely. schema allow that</technical_language>

Target:
void notifiedWithCorrectNamesWhenClassExecutionSkipped() throws Exception { ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass(ReportEntry.class); TestPlan testPlan = TestPlan.from(Collections.singletonList(new EngineDescriptor(newId(), "Luke's Plan"))); adapter.testPlanExecutionStarted(testPlan); TestIdentifier classIdentifier = identifiersAsParentOnTestPlan(testPlan, newEngineDescriptor(), newClassDescriptor()); adapter.executionSkipped(classIdentifier, "test"); verify(listener).testSkipped(entryCaptor.capture()); ReportEntry entry = entryCaptor.getValue(); assertTrue(MyTestClass.class.getTypeName().contains(entry.getName())); assertEquals("engine", entry.getSourceName()); }
Source:
<code>findBindingsForOneIndexedExpression(ExpressionOrColumn nextStatementEOC, ExpressionOrColumn indexEntry) { assert(nextStatementEOC.m_expr != null); AbstractExpression nextStatementExpr = nextStatementEOC.m_expr; if (indexEntry.m_colRef != null) { ColumnRef indexColRef = indexEntry.m_colRef; if (matchExpressionAndColumnRef(nextStatementExpr, indexColRef, indexEntry.m_tableScan)) { <START> return m_emptyBindings; <END> } return null; } List<AbstractExpression> moreBindings = nextStatementEOC.m_expr.bindingToIndexedExpression(indexEntry.m_expr); if (moreBindings != null) { return moreBindings; } return null; }</code><technical_language>existing s_reusableImmutableEmptyBinding defined for this purpose. drop redundant m_emptyBindings</technical_language>

Target:
findBindingsForOneIndexedExpression(ExpressionOrColumn nextStatementEOC, ExpressionOrColumn indexEntry) { assert(nextStatementEOC.m_expr != null); AbstractExpression nextStatementExpr = nextStatementEOC.m_expr; if (indexEntry.m_colRef != null) { ColumnRef indexColRef = indexEntry.m_colRef; if (matchExpressionAndColumnRef(nextStatementExpr, indexColRef, indexEntry.m_tableScan)) { return s_reusableImmutableEmptyBinding; } return null; } List<AbstractExpression> moreBindings = nextStatementEOC.m_expr.bindingToIndexedExpression(indexEntry.m_expr); if (moreBindings != null) { return moreBindings; } return null; }
Source:
<code>public List<String> findDistinctChromosomes() { return (List<String>) mongoTemplate.getCollection(mongoTemplate.getCollectionName(VariantEntity.class)) <START> .distinct("chr", new Query().getQueryObject()); <END> }</code><technical_language>necessary create object for empty query (at level API allows distinct field)</technical_language>

Target:
public List<String> findDistinctChromosomes() { return (List<String>) mongoTemplate.getCollection(mongoTemplate.getCollectionName(VariantEntity.class)) .distinct("chr"); }
Source:
<code>public int getMax() { if (isCake()) { return getCake().getMaximumBites(); } <START> if (isSnow()) { <END> return getSnow().getMaximumLayers(); } else if (isHive()) { return getMaxHoneyLevel(); } return getLevelled().getMaximumLevel(); }</code><technical_language>This else</technical_language>

Target:
public int getMax() { if (isCake()) { return getCake().getMaximumBites(); } else if (isSnow()) { return getSnow().getMaximumLayers(); } else if (isHive()) { return getMaxHoneyLevel(); } return getLevelled().getMaximumLevel(); }
Source:
<code>private void addNewColumToSystables(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); <START> TableDescriptor td = getTableDescriptor(SYSTABLEPERMSRowFactory.TABLENAME_STRING, sd, tc); <END> ColumnDescriptor cd = td.getColumnDescriptor(SYSTABLESRowFactory.PURGE_DELETED_ROWS); if (cd == null) { tc.elevate("dictionary"); dropTableDescriptor(td, sd, tc); td.setColumnSequence(td.getColumnSequence() + 1); addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc); DataValueDescriptor storableDV = getDataValueFactory().getNullBoolean(null); int colNumber = td.getNumberOfColumns() + 1; DataTypeDescriptor dtd = DataTypeDescriptor.getBuiltInDataTypeDescriptor((Types.BOOLEAN)); tc.addColumnToConglomerate(td.getHeapConglomerateId(), colNumber, storableDV, dtd.getCollationType()); UUID uuid = getUUIDFactory().createUUID(); ColumnDescriptor columnDescriptor = new ColumnDescriptor( SYSTABLESRowFactory.PURGE_DELETED_ROWS, colNumber, colNumber, dtd, new SQLBoolean(false), null, td, uuid, 0, 0, td.getColumnSequence()); addDescriptor(columnDescriptor, td, DataDictionary.SYSCOLUMNS_CATALOG_NUM, false, tc); td.getColumnDescriptorList().add(columnDescriptor); updateSYSCOLPERMSforAddColumnToUserTable(td.getUUID(), tc); SpliceLogUtils.info(LOG, "SYS.SYSTABLES upgraded: added a new column %s.", SYSTABLESRowFactory.PURGE_DELETED_ROWS); } }</code><technical_language>do need change "SYSTABLEs" "SYSTABLEPERMS"</technical_language>

Target:
private void addNewColumToSystables(TransactionController tc) throws StandardException { SchemaDescriptor sd = getSystemSchemaDescriptor(); TableDescriptor td = getTableDescriptor(SYSTABLESRowFactory.TABLENAME_STRING, sd, tc); ColumnDescriptor cd = td.getColumnDescriptor(SYSTABLESRowFactory.PURGE_DELETED_ROWS); if (cd == null) { tc.elevate("dictionary"); dropTableDescriptor(td, sd, tc); td.setColumnSequence(td.getColumnSequence() + 1); addDescriptor(td, sd, DataDictionary.SYSTABLES_CATALOG_NUM, false, tc); DataValueDescriptor storableDV = getDataValueFactory().getNullBoolean(null); int colNumber = td.getNumberOfColumns() + 1; DataTypeDescriptor dtd = DataTypeDescriptor.getBuiltInDataTypeDescriptor((Types.BOOLEAN)); tc.addColumnToConglomerate(td.getHeapConglomerateId(), colNumber, storableDV, dtd.getCollationType()); UUID uuid = getUUIDFactory().createUUID(); ColumnDescriptor columnDescriptor = new ColumnDescriptor( SYSTABLESRowFactory.PURGE_DELETED_ROWS, colNumber, colNumber, dtd, new SQLBoolean(false), null, td, uuid, 0, 0, td.getColumnSequence()); addDescriptor(columnDescriptor, td, DataDictionary.SYSCOLUMNS_CATALOG_NUM, false, tc); td.getColumnDescriptorList().add(columnDescriptor); updateSYSCOLPERMSforAddColumnToUserTable(td.getUUID(), tc); SpliceLogUtils.info(LOG, "SYS.SYSTABLES upgraded: added a new column %s.", SYSTABLESRowFactory.PURGE_DELETED_ROWS); } }
Source:
<code>public CenterStage(final AssetManager assets, final float width, final float height) { this.setBounds(0, 0, width, height); this.TOTALHEIGHT = height; this.TOTALWIDTH = width; RiverBanksActor background = new RiverBanksActor(assets, 0, 0, width, height); this.addActor(background); WoodenBackground floor = new WoodenBackground(assets, 100, 50, width -200, height -100); DividingLine line = new DividingLine(assets,300,30,width/2,height); leftBoat = new LittleBoat(assets,TOTALWIDTH / 5 ,30,TOTALHEIGHT - 80 - TOTALWIDTH / 10, TOTALHEIGHT / 4, TOTALWIDTH / 10); <START> rightBoat = new LittleBoat(assets,TOTALWIDTH / 5 * 3,30,TOTALHEIGHT - 80 - TOTALWIDTH / 10, TOTALHEIGHT / 4, TOTALWIDTH / 10); <END> this.addActor(floor); this.addActor(line); this.addActor(leftBoat); this.addActor(rightBoat); }</code><technical_language>clear parameters parameter means</technical_language>

Target:
public CenterStage(final AssetManager assets, final float width, final float height) { this.setBounds(0, 0, width, height); this.TOTALHEIGHT = height; this.TOTALWIDTH = width; RiverBanksActor background = new RiverBanksActor(assets, 0, 0, width, height); this.addActor(background); WoodenBackground floor = new WoodenBackground(assets, 100, 50, width - 200, height - 100); DividingLine line = new DividingLine(assets, 300, 30, width / 2, height); float top_y = TOTALHEIGHT - 2 * BOAT_HEIGHT - 30; leftBoat = new LittleBoat(assets, TOTALWIDTH / 5, BOAT_HEIGHT, top_y, TOTALHEIGHT / 4, TOTALWIDTH / 10); rightBoat = new LittleBoat(assets, TOTALWIDTH / 5 * 3, BOAT_HEIGHT, top_y, TOTALHEIGHT / 4, TOTALWIDTH / 10); this.addActor(floor); this.addActor(line); this.addActor(leftBoat); this.addActor(rightBoat); }
Source:
<code>static String format(ValueData val) throws UnsupportedEncodingException, RegistryParseException { StringBuilder sb = new StringBuilder(); switch (val.getValueType()) { case REG_SZ: case REG_EXPAND_SZ: { String valString = val.getAsString(); if (valString.length() == 0) { sb.append(Bundle.RegeditExeValueFormatter_valueNotSet_text()); } else { sb.append(valString); } <START> if (sb.length() > 48) { <END> sb.setLength(45); sb.append("..."); } break; } case REG_MULTI_SZ: { Iterator<String> it = val.getAsStringList().iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); } } if (sb.length() > 48) { sb.setLength(45); sb.append("..."); } break; } case REG_DWORD: case REG_BIG_ENDIAN: { sb.append(String.format("0x%08x (%d)", val.getAsNumber(), val.getAsNumber())); break; } case REG_QWORD: { sb.append(String.format("0x%016x (%d)", val.getAsNumber(), val.getAsNumber())); break; } default: { ByteBuffer valData = val.getAsRawData(); valData.position(0x0); for (int i = 0; i < Math.min(16, valData.limit()); i++) { byte b = valData.get(); sb.append(HexDump.toHexString(b)); if (i != 15) { sb.append(' '); } } if (valData.limit() > 16) { sb.append("..."); } break; } } return sb.toString(); }</code><technical_language>I constants out of these, I idea 45 48 is if I debug code</technical_language>

Target:
static String format(ValueData val) throws UnsupportedEncodingException, RegistryParseException { StringBuilder sb = new StringBuilder(); switch (val.getValueType()) { case REG_SZ: case REG_EXPAND_SZ: { String valString = val.getAsString(); if (valString.length() == 0) { sb.append(Bundle.RegeditExeValueFormatter_valueNotSet_text()); } else { sb.append(valString); } if (sb.length() > MAX_STRING_LENGTH) { sb.setLength(MAX_STRING_LENGTH - OVER_MAX_LENGTH_ENDING.length()); sb.append(OVER_MAX_LENGTH_ENDING); } break; } case REG_MULTI_SZ: { Iterator<String> it = val.getAsStringList().iterator(); while (it.hasNext()) { sb.append(it.next()); if (it.hasNext()) { sb.append(", "); } } if (sb.length() > MAX_STRING_LENGTH) { sb.setLength(MAX_STRING_LENGTH - OVER_MAX_LENGTH_ENDING.length()); sb.append(OVER_MAX_LENGTH_ENDING); } break; } case REG_DWORD: case REG_BIG_ENDIAN: { sb.append(String.format("0x%08x (%d)", val.getAsNumber(), val.getAsNumber())); break; } case REG_QWORD: { sb.append(String.format("0x%016x (%d)", val.getAsNumber(), val.getAsNumber())); break; } default: { ByteBuffer valData = val.getAsRawData(); valData.position(0x0); for (int i = 0; i < Math.min(MAX_BUFFER_SIZE, valData.limit()); i++) { byte b = valData.get(); sb.append(HexDump.toHexString(b)); if (i != MAX_BUFFER_SIZE - 1) { sb.append(' '); } } if (valData.limit() > MAX_BUFFER_SIZE) { sb.append(OVER_MAX_LENGTH_ENDING); } break; } } return sb.toString(); }
Source:
<code>public Image getImage(Object element) { RepositoryTreeNode node = (RepositoryTreeNode) element; RepositoryTreeNodeType type = node.getType(); if (type == RepositoryTreeNodeType.TAG) { RevObject any; RevWalk walk = new RevWalk(node.getRepository()); try { ObjectId id = node.getRepository().resolve( ((Ref) node.getObject()).getName()); if (id == null) return null; any = walk.parseAny(id); } catch (MissingObjectException e) { Activator.logError(e.getMessage(), e); return null; } catch (IOException e) { Activator.logError(e.getMessage(), e); return null; } finally { walk.release(); } if (any instanceof RevTag) return decorateImage(annotatedTagImage, element); } else if (type == RepositoryTreeNodeType.FILE) { Object object = node.getObject(); if (object instanceof File) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry() .getImageDescriptor(((File) object).getName()); return decorateImage((Image) resourceManager.get(descriptor), element); } } else if (type == RepositoryTreeNodeType.REPO) { Object object = node.getObject(); if (object instanceof Repository) { Repository r = (Repository) object; if (ResourcePropertyTester.testRepositoryState(r, <START> "hasGerritConfiguration")) END> return gerritRepoImage; } } return decorateImage(node.getType().getIcon(), element); }</code><technical_language>hasGerritConfiguration method (by making public)? I nicer magic string. if prefer it, ok me</technical_language>

Target:
public Image getImage(Object element) { RepositoryTreeNode node = (RepositoryTreeNode) element; RepositoryTreeNodeType type = node.getType(); if (type == RepositoryTreeNodeType.TAG) { RevObject any; RevWalk walk = new RevWalk(node.getRepository()); try { ObjectId id = node.getRepository().resolve( ((Ref) node.getObject()).getName()); if (id == null) return null; any = walk.parseAny(id); } catch (MissingObjectException e) { Activator.logError(e.getMessage(), e); return null; } catch (IOException e) { Activator.logError(e.getMessage(), e); return null; } finally { walk.release(); } if (any instanceof RevTag) return decorateImage(annotatedTagImage, element); } else if (type == RepositoryTreeNodeType.FILE) { Object object = node.getObject(); if (object instanceof File) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry() .getImageDescriptor(((File) object).getName()); return decorateImage((Image) resourceManager.get(descriptor), element); } } else if (type == RepositoryTreeNodeType.REPO) { Object object = node.getObject(); if (object instanceof Repository) { Repository r = (Repository) object; if (ResourcePropertyTester.hasGerritConfiguration(r)) return gerritRepoImage; } } return decorateImage(node.getType().getIcon(), element); }
Source:
<code>private void updatePlaybackSpeedPreference() { ListPreference feedPlaybackSpeedPreference = (ListPreference) findPreference(PREF_FEED_PLAYBACK_SPEED); String speedValue = feedPreferences.getFeedPlaybackSpeed(); <START> feedPlaybackSpeedPreference.setValue(speedValue); <END> }</code><technical_language>this inconsistent now? displays description changing for time displays value. I prefer decide of (or both)</technical_language>

Target:
private void updatePlaybackSpeedPreference() { ListPreference feedPlaybackSpeedPreference = findPreference(PREF_FEED_PLAYBACK_SPEED); float speedValue = feedPreferences.getFeedPlaybackSpeed(); feedPlaybackSpeedPreference.setValue(decimalFormat.format(speedValue)); }
Source:
<code>private static void parseDynamicValue(final ParseContext context, ObjectMapper parentMapper, String currentFieldName, XContentParser.Token token) throws IOException { ObjectMapper.Dynamic dynamic = dynamicOrDefault(parentMapper, context); if (dynamic == ObjectMapper.Dynamic.STRICT) { throw new StrictDynamicMappingException(parentMapper.fullPath(), currentFieldName); } if (dynamic == ObjectMapper.Dynamic.FALSE) { return; } final String path = context.path().pathAsText(currentFieldName); final Mapper.BuilderContext builderContext = new Mapper.BuilderContext(context.indexSettings().getSettings(), context.path()); final MappedFieldType existingFieldType = context.mapperService().fieldType(path); final Mapper.Builder builder; if (existingFieldType != null) { builder = createBuilderFromFieldType(context, existingFieldType, currentFieldName); } else { builder = createBuilderFromDynamicValue(context, token, currentFieldName); } Mapper mapper = builder.build(builderContext); <START> context.addDynamicMapper(mapper); <END> parseObjectOrField(context, mapper); }</code><technical_language>If understanding correctly, assume existingFieldType null, is type. In case remove logic too, including method createBuilderFromFieldType</technical_language>

Target:
private static void parseDynamicValue(final ParseContext context, ObjectMapper parentMapper, String currentFieldName, XContentParser.Token token) throws IOException { ObjectMapper.Dynamic dynamic = dynamicOrDefault(parentMapper, context); if (dynamic == ObjectMapper.Dynamic.STRICT) { throw new StrictDynamicMappingException(parentMapper.fullPath(), currentFieldName); } if (dynamic == ObjectMapper.Dynamic.FALSE) { return; } final Mapper.BuilderContext builderContext = new Mapper.BuilderContext(context.indexSettings().getSettings(), context.path()); final Mapper.Builder<?> builder = createBuilderFromDynamicValue(context, token, currentFieldName); Mapper mapper = builder.build(builderContext); context.addDynamicMapper(mapper); parseObjectOrField(context, mapper); }
Source:
<code>public void testStackedMLP() { int firstLayerNeuronsCnt = 3; int secondLayerNeuronsCnt = 2; MLPConstInitializer initer = new MLPConstInitializer(1, 2); MLPArchitecture conf = new MLPArchitecture(4). withAddedLayer(firstLayerNeuronsCnt, false, Activators.SIGMOID). withAddedLayer(secondLayerNeuronsCnt, false, Activators.SIGMOID); MLP mlp = new MLP(conf, initer); MLPArchitecture mlpLayer1Conf = new MLPArchitecture(4). withAddedLayer(firstLayerNeuronsCnt, false, Activators.SIGMOID); MLPArchitecture mlpLayer2Conf = new MLPArchitecture(firstLayerNeuronsCnt). withAddedLayer(secondLayerNeuronsCnt, false, Activators.SIGMOID); MLP mlp1 = new MLP(mlpLayer1Conf, initer); MLP mlp2 = new MLP(mlpLayer2Conf, initer); MLP stackedMLP = mlp1.add(mlp2); <START> Matrix predict = mlp.apply(new DenseLocalOnHeapMatrix(new double[][] {{1, 2, 3, 4}}).transpose()); <END> Matrix stackedPredict = stackedMLP.apply(new DenseLocalOnHeapMatrix(new double[][] {{1, 2, 3, 4}}).transpose()); Assert.assertEquals(predict, stackedPredict); }</code><technical_language>new variable add readable name explain transpose action matrix</technical_language>

Target:
public void testStackedMLP() { int firstLayerNeuronsCnt = 3; int secondLayerNeuronsCnt = 2; MLPConstInitializer initer = new MLPConstInitializer(1, 2); MLPArchitecture conf = new MLPArchitecture(4). withAddedLayer(firstLayerNeuronsCnt, false, Activators.SIGMOID). withAddedLayer(secondLayerNeuronsCnt, false, Activators.SIGMOID); MultilayerPerceptron mlp = new MultilayerPerceptron(conf, initer); MLPArchitecture mlpLayer1Conf = new MLPArchitecture(4). withAddedLayer(firstLayerNeuronsCnt, false, Activators.SIGMOID); MLPArchitecture mlpLayer2Conf = new MLPArchitecture(firstLayerNeuronsCnt). withAddedLayer(secondLayerNeuronsCnt, false, Activators.SIGMOID); MultilayerPerceptron mlp1 = new MultilayerPerceptron(mlpLayer1Conf, initer); MultilayerPerceptron mlp2 = new MultilayerPerceptron(mlpLayer2Conf, initer); MultilayerPerceptron stackedMLP = mlp1.add(mlp2); Matrix predict = mlp.apply(new DenseLocalOnHeapMatrix(new double[][] {{1, 2, 3, 4}}).transpose()); Matrix stackedPredict = stackedMLP.apply(new DenseLocalOnHeapMatrix(new double[][] {{1, 2, 3, 4}}).transpose()); Assert.assertEquals(predict, stackedPredict); }
Source:
<code>private Object objectInstance(String singleValue, List<String> multiValues) { Object obj = null; try { Class clazz = getEntityClass(); obj = clazz.newInstance(); PropertyUtil.setProperty(obj, CB_FIELD_SINGLE_NAME, singleValue); if (multiValues != null) { PropertyUtil.setProperty(obj, CB_FIELD_MULTI_NAME, new ArrayList<>(multiValues)); } } catch (Exception e) { <START> LOGGER.error("Cannot create instance", e); <END> return null; } return obj; }</code><technical_language>point in this catch, expecting this</technical_language>

Target:
private Object objectInstance(String singleValue, List<String> multiValues) throws Exception { Class clazz = getEntityClass(); Object obj = clazz.newInstance(); PropertyUtil.setProperty(obj, CB_FIELD_SINGLE_NAME, singleValue); if (multiValues != null) { PropertyUtil.setProperty(obj, CB_FIELD_MULTI_NAME, new ArrayList<>(multiValues)); } return obj; }
Source:
<code>public void prepareRun(BatchSinkContext context) throws DatasetManagementException { super.prepareRun(context); String schemaString = tableSinkConfig.getSchemaStr(); if (schemaString != null) { try { Schema schema = Schema.parseJson(schemaString); if (schema.getFields() != null) { FieldOperation operation = new FieldWriteOperation("Write", "Writing to CDAP Table", EndPoint.of(context.getNamespace(), tableSinkConfig.getName()), schema.getFields().stream().map(Schema.Field::getName) .collect(Collectors.toList())); context.record(Collections.singletonList(operation)); } } catch (IOException e) { <START> throw new IllegalStateException("Failed to parse schema", e); <END> } } }</code><technical_language>add a period end consistent others</technical_language>

Target:
public void prepareRun(BatchSinkContext context) throws DatasetManagementException { super.prepareRun(context); String schemaString = tableSinkConfig.getSchemaStr(); if (schemaString != null) { try { Schema schema = Schema.parseJson(schemaString); if (schema.getFields() != null) { FieldOperation operation = new FieldWriteOperation("Write", "Wrote to CDAP Table", EndPoint.of(context.getNamespace(), tableSinkConfig.getName()), schema.getFields().stream().map(Schema.Field::getName) .collect(Collectors.toList())); context.record(Collections.singletonList(operation)); } } catch (IOException e) { throw new IllegalStateException("Failed to parse schema.", e); } } }
Source:
<code>public boolean isDeleteQuery() { <START> return getName().toLowerCase().startsWith("delete"); <END> }</code><technical_language>Locale.ROOT in toLowerCase</technical_language>

Target:
public boolean isDeleteQuery() { return getName().toLowerCase(Locale.ROOT).startsWith("delete"); }
Source:
<code>public static <TClass, TAnnotation extends Annotation> void scanClasspath(Class<TClass> superClass, Class<TAnnotation> annotationClass, String requirePackage, Consumer<Class<? extends TClass>> consumer) { FastClasspathScanner fcs; if (requirePackage != null) { fcs = new FastClasspathScanner(requirePackage); } else { fcs = new FastClasspathScanner(); } List<String> matches = fcs.scan() <START> .getNamesOfClassesWithAnnotation(annotationClass.getName()); <END> for (String className : matches) { Class<?> clazz; try { System.setErr(NULL_PRINT_STREAM); clazz = Class.forName(className); System.setErr(ERR_PRINT_STREAM); } catch (ClassNotFoundException e) { log.trace("Cannot load class " + className, e); return; } catch (NoClassDefFoundError e) { log.trace("Cannot load class " + className, e); return; } catch (LinkageError e) { log.trace("Cannot load class " + className, e); return; } catch (Throwable e) { log.trace("Cannot load class " + className, e); return; } TAnnotation annotation = clazz.getAnnotation(annotationClass); if (annotation != null) { if (!superClass.isAssignableFrom(clazz)) { return; } consumer.accept((Class<? extends TClass>) clazz); } } }</code><technical_language>include check for superclass filtering (so classload file want it)</technical_language>

Target:
public static <TClass, TAnnotation extends Annotation> void scanClasspath(Class<TClass> superClass, Class<TAnnotation> annotationClass, String requirePackage, Consumer<Class<? extends TClass>> consumer) { FastClasspathScanner fcs; if (requirePackage != null) { fcs = new FastClasspathScanner(requirePackage, superClass.getName()); } else { fcs = new FastClasspathScanner(superClass.getName()); } List<String> matches = fcs.scan() .getNamesOfClassesWithAnnotation(annotationClass.getName()); log.debug("Found " + matches.size() + " classes with annotation '" + annotationClass.getName() + "'"); for (String className : matches) { Class<?> clazz; try { clazz = Class.forName(className); consumer.accept((Class<? extends TClass>) clazz); } catch (Throwable e) { log.trace("Cannot load class " + className, e); return; } } }
Source:
<code>public Builder explicitlySetWebsocketEndpointAndDiscovery(URI endpoint, boolean performWebsocketEndpointDiscovery) { <START> if (endpoint == null) { <END> throw new IllegalArgumentException("Provided endpoint URI must not be null"); } this.uri = endpoint; this.performWebsocketEndpointDiscovery = performWebsocketEndpointDiscovery; return this; }</code><technical_language>Objects.requireNonNull()</technical_language>

Target:
public Builder explicitlySetWebsocketEndpointAndDiscovery(URI endpoint, boolean performWebsocketEndpointDiscovery) { Objects.requireNonNull(endpoint, "Provided endpoint URI must not be null"); this.uri = endpoint; this.performWebsocketEndpointDiscovery = performWebsocketEndpointDiscovery; return this; }
Source:
<code>public String getUuidPathLikeIncludingSelf() { <START> return DaoDatabaseUtils.buildLikeValue(formatUuidPathFromParent(this), WildcardPosition.AFTER); <END> }</code><technical_language>minor: static import</technical_language>

Target:
public String getUuidPathLikeIncludingSelf() { return buildLikeValue(formatUuidPathFromParent(this), WildcardPosition.AFTER); }
Source:
<code>public final void issueResourceRequest(SamzaResourceRequest request) { resourceRequestState.addResourceRequest(request); state.containerRequests.incrementAndGet(); if (ResourceRequestState.ANY_HOST.equals(request.getPreferredHost())) { state.anyHostRequests.incrementAndGet(); } else { state.preferredHostRequests.incrementAndGet(); } <START> if (request.getFaultDomains() != null && !request.getFaultDomains().isEmpty()) { <END> state.faultDomainAwareContainerRequests.incrementAndGet(); } }</code><technical_language>null check redundant ensure faultDomains empty present</technical_language>

Target:
public final void issueResourceRequest(SamzaResourceRequest request) { resourceRequestState.addResourceRequest(request); state.containerRequests.incrementAndGet(); if (ResourceRequestState.ANY_HOST.equals(request.getPreferredHost())) { state.anyHostRequests.incrementAndGet(); } else { state.preferredHostRequests.incrementAndGet(); } if (!request.getFaultDomains().isEmpty()) { state.faultDomainAwareContainerRequests.incrementAndGet(); } }
Source:
<code>public void testBingTilesWithRadiusBadInput() { assertInvalidFunction("bing_tiles_around(30.12, 60.0, 1, -1)", "Radius must be >= 0"); assertInvalidFunction("bing_tiles_around(30.12, 60.0, 1, 2000)", "Radius must be <= 1,000 km"); assertInvalidFunction("bing_tiles_around(30.12, 60.0, 20, 100)", <START> "The number of tiles covering input rectangle exceeds the limit of 1M. Number of tiles: 36699364. Radius_km: 100.0. Zoom level: 20."); <END> }</code><technical_language>*more proper* English for Radius_km: 100.0: Radius: 100.0 km</technical_language>

Target:
public void testBingTilesWithRadiusBadInput() { assertInvalidFunction("bing_tiles_around(30.12, 60.0, 1, -1)", "Radius must be >= 0"); assertInvalidFunction("bing_tiles_around(30.12, 60.0, 1, 2000)", "Radius must be <= 1,000 km"); assertInvalidFunction("bing_tiles_around(30.12, 60.0, 20, 100)", "The number of tiles covering input rectangle exceeds the limit of 1M. Number of tiles: 36699364. Radius: 100.0 km. Zoom level: 20."); }
Source:
<code>public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { if (ListenableFuture.class != TypeToken.of(returnType).getRawType()) { return null; } if (!(returnType instanceof ParameterizedType)) { throw new IllegalStateException("ListenableFuture return type must be parameterized" + " as ListenableFuture<Foo> or ListenableFuture<? extends Foo>"); } Type innerType = ((ParameterizedType) returnType).getActualTypeArguments()[0]; if (innerType instanceof WildcardType) { innerType = ((WildcardType) innerType).getUpperBounds()[0]; } if (Response.class != TypeToken.of(innerType).getRawType()) { return new BodyCallAdapter(innerType); } if (!(innerType instanceof ParameterizedType)) { throw new IllegalStateException("Response must be parameterized" + " as Response<Foo> or Response<? extends Foo>"); } <START> Type responseType = ((ParameterizedType) innerType).getActualTypeArguments()[0]; <END> if (responseType instanceof WildcardType) { responseType = ((WildcardType) responseType).getUpperBounds()[0]; } return new ResponseCallAdapter(responseType); }</code><technical_language>is worth a helper method get lone type parameter & remove wildcard</technical_language>

Target:
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { if (TypeToken.of(returnType).getRawType() != ListenableFuture.class) { return null; } if (!(returnType instanceof ParameterizedType)) { throw new IllegalStateException("ListenableFuture return type must be parameterized" + " as ListenableFuture<Foo> or ListenableFuture<? extends Foo>"); } Type innerType = ((ParameterizedType) returnType).getActualTypeArguments()[0]; if (innerType instanceof WildcardType) { innerType = ((WildcardType) innerType).getUpperBounds()[0]; } if (TypeToken.of(innerType).getRawType() != Response.class) { return new BodyCallAdapter(innerType); } if (!(innerType instanceof ParameterizedType)) { throw new IllegalStateException("Response must be parameterized" + " as Response<Foo> or Response<? extends Foo>"); } Type responseType = ((ParameterizedType) innerType).getActualTypeArguments()[0]; if (responseType instanceof WildcardType) { responseType = ((WildcardType) responseType).getUpperBounds()[0]; } return new ResponseCallAdapter(responseType); }
Source:
<code>public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.valueOf(deprefixed)); } catch (NumberFormatException e) { <START> throw new IllegalStateException("Unable to deprefix invalid identifier", e); <END> } }</code><technical_language>exception message id for easier debugging</technical_language>

Target:
public BeanIdentifier deprefix(String id) { String deprefixed = id.substring(getPrefix().length() + getDelimiter().length()); if (deprefixed.startsWith(FALLBACK_FLAG)) { return new StringBeanIdentifier(deprefixed.substring(FALLBACK_FLAG.length())); } try { return index.getIdentifier(Integer.valueOf(deprefixed)); } catch (NumberFormatException e) { throw new IllegalStateException("Unable to deprefix id:" + id, e); } }
Source:
<code>public synchronized T obtain(Map flags) throws NoMachinesAvailableException { if (singleLocation == null) { if (provisioningLocation == null) provisioningLocation = (MachineProvisioningLocation) getManagementContext().getLocationRegistry().resolve( location); singleLocation = provisioningLocation.obtain(flags); inUse.add(singleLocation); } else { if (flags != null && locationFlags == null) { <START> locationFlags = ImmutableMap.builder().putAll(flags).build(); <END> } if (!Objects.equal(flags, locationFlags)) { log.warn("Flags passed to subsequent call to newLocationFromString will be ignored, using {}", flags, locationFlags); } } referenceCount++; return singleLocation; }</code><technical_language>This wrong. want set locationFlags previous if - if statement (i.e. flags is used). code warn if call flags is second, I think. some minor for future reference: - Declare field Map ImmutableMap (because users of field care). - For future reference, ImmutableMap.copyOf(flags) builder for. - This code is a bit dangerous if flags contains a null key null blow up. prefer complain if flags want null. do Collections.unmodifiableMap(Maps.newLinkedHashMap(flags))</technical_language>

Target:
public synchronized T obtain(Map flags) throws NoMachinesAvailableException { log.info("Flags passed to newLocationFromString will be ignored, using {}", flags, locationFlags); return obtain(); }
Source:
<code>private ResponseEntity<?> createSubscription(final SubscriptionBase subscriptionBase, final NativeWebRequest request, final Client client) throws InternalNakadiException, DuplicatedSubscriptionException, ServiceUnavailableException { if (featureToggleService.isFeatureEnabled(CHECK_OWNING_APPLICATION) && !applicationService.exists(subscriptionBase.getOwningApplication())) { return Responses.create(Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, "owning_application doesn't exist"), request); } final Map<String, Optional<EventType>> eventTypeMapping = subscriptionBase.getEventTypes().stream() .collect(Collectors.toMap(Function.identity(), ExceptionWrapper.wrapFunction(eventTypeRepository::findByNameO))); final List<String> missingEventTypes = eventTypeMapping.entrySet().stream() .filter(entry -> !entry.getValue().isPresent()) .map(Map.Entry::getKey) .collect(Collectors.toList()); if (!missingEventTypes.isEmpty()) { return create(UNPROCESSABLE_ENTITY, createErrorMessage(missingEventTypes), request); } eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(eventType -> client.checkScopes(eventType.getReadScopes())); final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); <START> UriComponents components = SUBSCRIPTION_PATH.buildAndExpand(subscription.getId()); <END> return status(HttpStatus.CREATED) .location(components.toUri()) .header(HttpHeaders.CONTENT_LOCATION, components.toString()) .body(subscription); }</code><technical_language>final</technical_language>

Target:
private ResponseEntity<?> createSubscription(final SubscriptionBase subscriptionBase, final NativeWebRequest request, final Client client) throws InternalNakadiException, DuplicatedSubscriptionException, ServiceUnavailableException { if (featureToggleService.isFeatureEnabled(CHECK_OWNING_APPLICATION) && !applicationService.exists(subscriptionBase.getOwningApplication())) { return Responses.create(Problem.valueOf(MoreStatus.UNPROCESSABLE_ENTITY, "owning_application doesn't exist"), request); } final Map<String, Optional<EventType>> eventTypeMapping = subscriptionBase.getEventTypes().stream() .collect(Collectors.toMap(Function.identity(), ExceptionWrapper.wrapFunction(eventTypeRepository::findByNameO))); final List<String> missingEventTypes = eventTypeMapping.entrySet().stream() .filter(entry -> !entry.getValue().isPresent()) .map(Map.Entry::getKey) .collect(Collectors.toList()); if (!missingEventTypes.isEmpty()) { return create(UNPROCESSABLE_ENTITY, createErrorMessage(missingEventTypes), request); } eventTypeMapping.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(eventType -> client.checkScopes(eventType.getReadScopes())); final Subscription subscription = subscriptionRepository.createSubscription(subscriptionBase); final UriComponents location = SUBSCRIPTION_PATH.buildAndExpand(subscription.getId()); return status(HttpStatus.CREATED) .location(location.toUri()) .header(HttpHeaders.CONTENT_LOCATION, location.toString()) .body(subscription); }
Source:
<code>public String toString() { StringBuilder result = new StringBuilder(); <START> for (String key : keySet()) { <END> result.append(key); result.append(": \""); result.append(get(key)); result.append("\"\n"); } return result.toString(); }</code><technical_language>Minor suggestion: valueSet iterate key/value pairs needing call get(key) for key</technical_language>

Target:
public String toString() { StringBuilder result = new StringBuilder(getClass().getSimpleName()); result.append(": {\n"); for (Map.Entry<String, Object> entry : valueSet()) { result.append(entry.getKey()); result.append(": \""); result.append(entry.getValue()); result.append("\"\n"); } result.append("}\n"); return result.toString(); }
Source:
<code>public void canParseNamedCaptureGroupsFromPattern() { assertThat(RegexUtils.getNamedCaptureGroupsFromPattern(""), hasSize(0)); assertThat(RegexUtils.getNamedCaptureGroupsFromPattern("(?<user>.*)"), contains("user")); assertThat(RegexUtils.getNamedCaptureGroupsFromPattern("Node /(?<poolName>.*?)/(?<poolMember>\\S+) address (?<poolAddr>\\S+) monitor status down. .*\\(slot(?<slotNum>[0-9]+)\\)"), <START> containsInAnyOrder("poolName", "poolMember", "poolAddr", "slotNum")); <END> }</code><technical_language>revert this order deterministic</technical_language>

Target:
public void canParseNamedCaptureGroupsFromPattern() { assertThat(RegexUtils.getNamedCaptureGroupsFromPattern(""), hasSize(0)); assertThat(RegexUtils.getNamedCaptureGroupsFromPattern("(?<user>.*)"), contains("user")); assertThat(RegexUtils.getNamedCaptureGroupsFromPattern("Node /(?<poolName>.*?)/(?<poolMember>\\S+) address (?<poolAddr>\\S+) monitor status down. .*\\(slot(?<slotNum>[0-9]+)\\)"), contains("poolName", "poolMember", "poolAddr", "slotNum")); }
Source:
<code>private Callable<Boolean> canCreateKeyValueService() { return () -> { <START> ConnectionManagerAwareDbKvs kvs = null; try { kvs = createKvs(); try (Connection connection = kvs.getConnectionManager().getConnection()) { return connection.isValid(FIVE_SECONDS); } } catch (Exception ex) { if (ex.getMessage().contains("The connection attempt failed.") || ex.getMessage().contains("the database system is starting up")) { return false; } else { throw ex; } } finally { if (kvs != null) { kvs.close(); } } <END> }; }</code><technical_language>suggestion try (ConnectionManagerAwareDbKvs kvs = createKvs()) { try (Connection connection = kvs.getConnectionManager().getConnection()) { return connection.isValid(FIVE_SECONDS); } } catch (Exception ex) { if (ex.getMessage().contains("The connection attempt failed.") || ex.getMessage().contains("the database system is starting up")) { return false; } else { throw ex; } }</technical_language>

Target:
private Callable<Boolean> canCreateKeyValueService() { return () -> { try (ConnectionManagerAwareDbKvs kvs = createKvs()) { try (Connection connection = kvs.getConnectionManager().getConnection()) { return connection.isValid(FIVE_SECONDS); } } catch (Exception ex) { if (ex.getMessage().contains("The connection attempt failed.") || ex.getMessage().contains("the database system is starting up")) { return false; } else { throw ex; } } }; }
Source:
<code>private void addNewPaymentDetailToGroupIfTotalIsPositive(PdpFeedGroupEntry newGroupEntry, PdpFeedDetailEntry newDetailEntry, KualiDecimal originalDetailTransactionTotal) { if (LOG.isDebugEnabled()) { <START> LOG.debug("addNewPaymentDetailToGroup, total transaction for " + newDetailEntry.getSourceDocNbr() + " detail: " + originalDetailTransactionTotal); <END> } if (originalDetailTransactionTotal.isPositive()) { newGroupEntry.getDetail().add(newDetailEntry); } else { if (LOG.isDebugEnabled()) { StringBuilder sb = new StringBuilder("addNewPaymentDetailToGroup SAE transactions summed to"); if (originalDetailTransactionTotal.isNegative()) { sb.append(" a negative amount in PDP, so it will be handled by collector."); } else { sb.append(" a zero amount in PDP, so no payment needs to be issued"); } LOG.debug(sb.toString()); } } }</code><technical_language>method name updated in log message</technical_language>

Target:
private void addNewPaymentDetailToGroupIfTotalIsPositive(PdpFeedGroupEntry newGroupEntry, PdpFeedDetailEntry newDetailEntry, KualiDecimal originalDetailTransactionTotal) { if (LOG.isDebugEnabled()) { LOG.debug("addNewPaymentDetailToGroupIfTotalIsPositive, total transaction for " + newDetailEntry.getSourceDocNbr() + " detail: " + originalDetailTransactionTotal); } if (originalDetailTransactionTotal.isPositive()) { newGroupEntry.getDetail().add(newDetailEntry); } else { if (LOG.isDebugEnabled()) { StringBuilder sb = new StringBuilder("addNewPaymentDetailToGroupIfTotalIsPositive SAE transactions summed to"); if (originalDetailTransactionTotal.isNegative()) { sb.append(" a negative amount in PDP, so it will be handled by collector."); } else { sb.append(" a zero amount in PDP, so no payment needs to be issued"); } LOG.debug(sb.toString()); } } }
Source:
<code>public void setUp() throws Exception { MockitoAnnotations.initMocks(this); InterceptorMethodParametersResolver parametersResolver = new InterceptorMethodParametersResolver(container); CacheStore<Class<?>, InterceptorHandler> cachedHandlers = new DefaultCacheStore<>(); <START> factory = new DefaultInterceptorHandlerFactory(container, stepInvoker, parametersResolver, cachedHandlers, null); <END> }</code><technical_language>a mock here, instead of null</technical_language>

Target:
public void setUp() throws Exception { MockitoAnnotations.initMocks(this); InterceptorMethodParametersResolver parametersResolver = new InterceptorMethodParametersResolver(container); CacheStore<Class<?>, InterceptorHandler> cachedHandlers = new DefaultCacheStore<>(); factory = new DefaultInterceptorHandlerFactory(container, stepInvoker, parametersResolver, cachedHandlers, simpleStack); }
Source:
<code>void addRow(List<WebElement> tableRows, String title, WebElement dialog) { for (WebElement tableRow : tableRows) { if (Browser.getCellDataByRow(tableRow, 0).equals(title)) { clickLinkOfTableRow(tableRow); try { Thread.sleep(1*1000); } catch (InterruptedException e) { Logger logger = LogManager.getLogger(Browser.class); <START> logger.error(e.getMessage()); <END> } Browser.closeDialog(dialog); return; } } throw new NoSuchElementException("No row for given value found: " + title); }</code><technical_language>Stacktrace useful: logger.error(e.getMessage()), e;</technical_language>

Target:
void addRow(List<WebElement> tableRows, String title, WebElement dialog) { for (WebElement tableRow : tableRows) { if (Browser.getCellDataByRow(tableRow, 0).equals(title)) { clickLinkOfTableRow(tableRow); try { Thread.sleep(3 * 1000); } catch (InterruptedException e) { Logger logger = LogManager.getLogger(EditPage.class); logger.error(e.getMessage(), e); } Browser.closeDialog(dialog); return; } } throw new NoSuchElementException("No row for given value found: " + title); }
Source:
<code>private byte[] toJSONStringCompressed() { String str = m_configJSON.get(); if (str == null || str.length() == 0) { return new byte[0] ; } byte[] outStr; try { outStr = compressJSONString(str); } catch (IOException e) { <START> throw new RuntimeException("Failed to serialized Hashinator Configuration to Compressed JSON .", e); <END> } return outStr; }</code><technical_language>"Failed serialize..."</technical_language>

Target:
private byte[] toJSONStringCompressed() { String str = toJSONString(); if (str == null || str.length() == 0) { return new byte[0] ; } byte[] outStr; try { outStr = compressJSONString(str); } catch (IOException e) { throw new RuntimeException("Failed to serialize Hashinator Configuration to Compressed JSON .", e); } return outStr; }
Source:
<code>public static ZonedDateTime toZonedDateTime(Date date) { <START> if (date == null) { <END> return null; } return ofInstant(date.toInstant(), ZoneId.of("UTC")); }</code><technical_language>formatting ISO offset, OffsetDateTime instead of ZonedDateTime</technical_language>

Target:
public static ZonedDateTime toZonedDateTime(Date date) { if (date == null) { return null; } return ZonedDateTime.ofInstant(date.toInstant(), ZoneOffset.UTC); }
Source:
<code>public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (item.getClass() == SwitchItem.class) { return; } if (item.getClass() == ContactItem.class) { return; } if (item.getClass() == NumberItem.class) { return; } if (item.getClass() == RollershutterItem.class) { return; } throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() <START> + "', only Switch, RS, Contact or Number are allowed - please check your *.items configuration"); <END> }</code><technical_language>please open this abbreviation please</technical_language>

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (item.getClass() == SwitchItem.class) { return; } if (item.getClass() == ContactItem.class) { return; } if (item.getClass() == NumberItem.class) { return; } if (item.getClass() == RollershutterItem.class) { return; } throw new BindingConfigParseException("item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only Switch, Rollershutter, Contact or Number are allowed - please check your *.items configuration"); }
Source:
<code>public void run() { if (isSuspending()) { suspended(); return; } if (SequenceTracer.isEnabled()) { SequenceTracer.startFrom(callerThread, "Work " + getTitleOr("unknown"), " #7acde9"); } RuntimeException suppressed = null; int retryCount = getRetryCount(); for (int i = 0; i <= retryCount; i++) { if (i > 0) { log.debug("Retrying work due to concurrent update (" + i + "): " + this); log.trace("Concurrent update", suppressed); } if (ExceptionUtils.hasInterruptedCause(suppressed)) { log.debug("No need to retry the work with id=" + getId() + ", work manager is shutting down"); break; } try { runWorkWithTransaction(); SequenceTracer.stop("Work done " + (completionTime - startTime) + " ms"); return; } catch (RuntimeException e) { if (suppressed == null) { suppressed = e; } else { suppressed.addSuppressed(e); } } } <START> workFailed(suppressed, retryCount); <END> }</code><technical_language>pass retryCount, a getter</technical_language>

Target:
public void run() { if (isSuspending()) { suspended(); return; } if (SequenceTracer.isEnabled()) { SequenceTracer.startFrom(callerThread, "Work " + getTitleOr("unknown"), " #7acde9"); } RuntimeException suppressed = null; int retryCount = getRetryCount(); for (int i = 0; i <= retryCount; i++) { if (i > 0) { log.debug("Retrying work due to concurrent update (" + i + "): " + this); log.trace("Concurrent update", suppressed); } if (ExceptionUtils.hasInterruptedCause(suppressed)) { log.debug("No need to retry the work with id=" + getId() + ", work manager is shutting down"); break; } try { runWorkWithTransaction(); SequenceTracer.stop("Work done " + (completionTime - startTime) + " ms"); return; } catch (RuntimeException e) { if (suppressed == null) { suppressed = e; } else { suppressed.addSuppressed(e); } } } workFailed(suppressed); }