auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void collectClassesAndInterfaces(Set<String> classesAndInterfaces, ClassLoader classLoader, String className) { if (className == null || "java/lang/Object".equals(className)) { return; } InputStream is = null; try { <START> is = classLoader.getResourceAsStream(className.replace('.', '/') + ".class"); <END> ClassReader classReader = new ClassReader(is); classReader.accept(new ClassVisitor(useASM7 ? Opcodes.ASM7 : Opcodes.ASM6) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { if (interfaces != null) { for (String interfaceName : interfaces) { classesAndInterfaces.add(interfaceName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, interfaceName); } } classesAndInterfaces.add(superName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, superName); } @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { if (innerName != null) { classesAndInterfaces.add(innerName); } } }, 0); } catch (IOException e) { logger.debugf("Unable to open class file %s, due to exception %s", className, e); } finally { try { if (is != null) { is.close(); } } catch (IOException ignored) { } } }</code><technical_language>Is a reason try-with-resources replaced a finally? a big deal, unnecessary</technical_language>

Target:
private void collectClassesAndInterfaces(Set<String> classesAndInterfaces, ClassLoader classLoader, String className) { if (className == null || "java/lang/Object".equals(className)) { return; } try (InputStream is = classLoader.getResourceAsStream(className.replace('.', '/') + ".class")) { ClassReader classReader = new ClassReader(is); classReader.accept(new ClassVisitor(useASM7 ? Opcodes.ASM7 : Opcodes.ASM6) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { if (interfaces != null) { for (String interfaceName : interfaces) { classesAndInterfaces.add(interfaceName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, interfaceName); } } classesAndInterfaces.add(superName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, superName); } @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { if (innerName != null) { classesAndInterfaces.add(innerName); } } }, 0); } catch (IOException e) { logger.debugf("Unable to open class file %s, due to exception %s", className, e); } }
Source:
<code>private void writeFileWithPurge(Bucket bucket, BucketFileMeta meta, RangeSet<Slice> rset, HashSet<String> filesToDelete, BucketMeta bmeta) throws IOException { LOG.debug("Writing file because of purge operation {}", meta); if (rset.containsFully(new Range<>(meta.startKey, getEndKey(bucket.bucketKey, meta)))) { LOG.info("File being deleted because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); return; } <START> TreeMap<Slice, byte[]> fileData = readFile(bucket, meta); <END> boolean rewrite = false; Iterator<Slice> iter = fileData.keySet().iterator(); while(iter.hasNext()) { Slice key = iter.next(); for (Range r : rset) { if (r.contains(key, keyComparator)) { iter.remove(); rewrite = true; } } } if (rewrite && fileData.size() > 0) { LOG.info("Rewriting file because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); writeFile(bucket, bmeta, fileData); } }</code><technical_language>is this HDSFileReader seek/next instead</technical_language>

Target:
private void writeFileWithPurge(Bucket bucket, BucketFileMeta meta, RangeSet<Slice> rset, HashSet<String> filesToDelete, BucketMeta bmeta) throws IOException { LOG.debug("Writing file because of purge operation {}", meta); if (rset.containsFully(new Range<>(meta.startKey, getEndKey(bucket.bucketKey, meta, rset)))) { LOG.info("File being deleted because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); return; } TreeMap<Slice, byte[]> fileData = readDataExcludingPurge(bucket, meta, rset); if (fileData.size() > 0) { LOG.info("Rewriting file because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); writeFile(bucket, bmeta, fileData); } }
Source:
<code>protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Collection<EObject> openables = getMovedOpenablesFromRequest(); try { SashWindowsMngr sashMng = createSashWindowsMngr(openables); Resource sashResourceResource = getSashResource(); if (sashResourceResource == null) { return CommandResult.newErrorCommandResult(SASH_RESOURCE_ERROR); } sashResourceResource.getContents().add(sashMng); } catch (SashEditorException e) { <START> e.printStackTrace(); <END> return CommandResult.newErrorCommandResult(e); } catch (ServiceException e) { e.printStackTrace(); return CommandResult.newErrorCommandResult(e); } return CommandResult.newOKCommandResult(); }</code><technical_language>LogHelper</technical_language>

Target:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Collection<EObject> openables = getMovedOpenablesFromRequest(); try { SashWindowsMngr sashMng = createSashWindowsMngr(openables); Resource sashResourceResource = getSashResource(); if (sashResourceResource == null) { return CommandResult.newErrorCommandResult(SASH_RESOURCE_ERROR); } sashResourceResource.getContents().add(sashMng); } catch (SashEditorException e) { ControlModePlugin.log.error(e); return CommandResult.newErrorCommandResult(e); } catch (ServiceException e) { ControlModePlugin.log.error(e); return CommandResult.newErrorCommandResult(e); } return CommandResult.newOKCommandResult(); }
Source:
<code>public static void startPeergos(Args a) { try { PublicSigningKey.addProvider(PublicSigningKey.Type.Ed25519, new Ed25519.Java()); int webPort = a.getInt("port"); URL coreAddress = new URI(a.getArg("corenodeURL")).toURL(); String domain = a.getArg("domain"); InetSocketAddress userAPIAddress = new InetSocketAddress(domain, webPort); boolean useIPFS = a.getBoolean("useIPFS"); int dhtCacheEntries = 1000; int maxValueSizeToCache = 50 * 1024; ContentAddressedStorage dht = useIPFS ? new CachingStorage(new IpfsDHT(), dhtCacheEntries, maxValueSizeToCache) : RAMStorage.getSingleton(); String hostname = a.getArg("domain"); CoreNode core = HTTPCoreNode.getInstance(coreAddress); MutablePointers mutable = HttpMutablePointers.getInstance(coreAddress); <START> String blacklistPath = "blacklist.txt"; <END> PublicKeyBlackList blacklist = new UserBasedBlackList(Paths.get(blacklistPath), core, mutable, dht); MutablePointers pinner = new BlockingMutablePointers(new PinningMutablePointers(mutable, dht), blacklist); InetSocketAddress httpsMessengerAddress = new InetSocketAddress(hostname, userAPIAddress.getPort()); new UserService(httpsMessengerAddress, Logger.getLogger("IPFS"), dht, core, pinner, a); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } }</code><technical_language>this parameterized</technical_language>

Target:
public static void startPeergos(Args a) { try { PublicSigningKey.addProvider(PublicSigningKey.Type.Ed25519, new Ed25519.Java()); int webPort = a.getInt("port"); URL coreAddress = new URI(a.getArg("corenodeURL")).toURL(); String domain = a.getArg("domain"); InetSocketAddress userAPIAddress = new InetSocketAddress(domain, webPort); boolean useIPFS = a.getBoolean("useIPFS"); int dhtCacheEntries = 1000; int maxValueSizeToCache = 50 * 1024; ContentAddressedStorage dht = useIPFS ? new CachingStorage(new IpfsDHT(), dhtCacheEntries, maxValueSizeToCache) : RAMStorage.getSingleton(); String hostname = a.getArg("domain"); CoreNode core = HTTPCoreNode.getInstance(coreAddress); MutablePointers mutable = HttpMutablePointers.getInstance(coreAddress); String blacklistPath = "blacklist.txt"; PublicKeyBlackList blacklist = new UserBasedBlacklist(Paths.get(blacklistPath), core, mutable, dht); MutablePointers pinner = new BlockingMutablePointers(new PinningMutablePointers(mutable, dht), blacklist); InetSocketAddress httpsMessengerAddress = new InetSocketAddress(hostname, userAPIAddress.getPort()); new UserService(httpsMessengerAddress, Logger.getLogger("IPFS"), dht, core, pinner, a); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } }
Source:
<code>List<CompositeT> allBetween(CompositeT from, CompositeT to) { List<CompositeT> res = new ArrayList<>(); <START> res.add(from); <END> if (to != from) { includeClosed(from, to, res); } return res; }</code><technical_language>I is exclude "from" "to" objects resulting list</technical_language>

Target:
List<CompositeT> allBetween(CompositeT from, CompositeT to) { List<CompositeT> res = new ArrayList<>(); if (to != from) { includeClosed(from, to, res); } return res; }
Source:
<code>public String getJavaString(final ExpressionOperatorParameter parameters) { final Type castFrom = getLeft().getOutputType(parameters); final Type castTo = getRight().getOutputType(parameters); switch (getCastType(castFrom, castTo)) { case LONGTOINT: return getLeftFunctionCallString("com.google.common.primitives.Ints.checkedCast", parameters); case FLOATSTOINT: return getLeftFunctionCallWithParemeterString("com.google.common.math.DoubleMath.roundToInt", parameters, "java.math.RoundingMode.DOWN"); case NUMTOFLOAT: <START> return getPrimitiveTypeCastString("float", parameters); <END> case NUMTODOUBLE: return getPrimitiveTypeCastString("double", parameters); case INTTOLONG: return getPrimitiveTypeCastString("long", parameters); case FLOATSTOLONG: return getLeftFunctionCallWithParemeterString("com.google.common.math.DoubleMath.roundToLong", parameters, "java.math.RoundingMode.DOWN"); case TOSTR: return getLeftFunctionCallString("String.valueOf", parameters); case STRTOINT: return getLeftFunctionCallString("Integer.parseInt", parameters); case STRTOFLOAT: return getLeftFunctionCallString("Float.parseFloat", parameters); case STRTODOUBLE: return getLeftFunctionCallString("Double.parseDouble", parameters); case STRTOLONG: return getLeftFunctionCallString("Long.parseLong", parameters); default: throw new IllegalStateException("should not reach here."); } }</code><technical_language>this check throw error if is larger [Float.MAX_VALUE](<LINK_0> smaller Float.MIN_VALUE</technical_language>

Target:
public String getJavaString(final ExpressionOperatorParameter parameters) { final Type castFrom = getLeft().getOutputType(parameters); final Type castTo = getRight().getOutputType(parameters); switch (getCastType(castFrom, castTo)) { case LONG_TO_INT: return getLeftFunctionCallString("com.google.common.primitives.Ints.checkedCast", parameters); case FLOATS_TO_INT: return getLeftFunctionCallWithParameterString("com.google.common.math.DoubleMath.roundToInt", parameters, "java.math.RoundingMode.DOWN"); case INT_OR_LONG_TO_FLOAT: return getPrimitiveTypeCastString("float", parameters); case DOUBLE_TO_FLOAT: return getLeftFunctionCallString("edu.washington.escience.myria.util.MathUtils.castDoubleToFloat", parameters); case NUM_TO_DOUBLE: return getPrimitiveTypeCastString("double", parameters); case INT_TO_LONG: return getPrimitiveTypeCastString("long", parameters); case FLOATS_TO_LONG: return getLeftFunctionCallWithParameterString("com.google.common.math.DoubleMath.roundToLong", parameters, "java.math.RoundingMode.DOWN"); case TO_STR: return getLeftFunctionCallString("String.valueOf", parameters); case STR_TO_INT: return getLeftFunctionCallString("Integer.parseInt", parameters); case STR_TO_FLOAT: return getLeftFunctionCallString("Float.parseFloat", parameters); case STR_TO_DOUBLE: return getLeftFunctionCallString("Double.parseDouble", parameters); case STR_TO_LONG: return getLeftFunctionCallString("Long.parseLong", parameters); default: throw new IllegalStateException("should not reach here."); } }
Source:
<code>public Navigate toPage(String pageName) { String query = getQueryParams(pageName); <START> driver.get(urlBuilder.getUrlForWiki() + "/wiki/" + pageName + query); <END> return this; }</code><technical_language>Get /wiki/ URLsContent class (WIKI_DIR) put a const urlbuilder</technical_language>

Target:
public Navigate toPage(String pageName) { String query = getQueryParams(pageName); driver.get(urlBuilder.getUrlForWiki() + URLsContent.WIKI_DIR + pageName + query); return this; }
Source:
<code><START> private Boolean shouldIncludeUnavailableModifier(final SwiftParser.CodeBlockContext ctx) { <END> if (ctx == null || ctx.statements() == null) { return false; } final List<SwiftParser.StatementContext> statements = ctx.statements().statement(); return statements.size() == 1 && FATAL_ERROR.equals(statements.get(0).getStart().getText()); }</code><technical_language>do need a boxed primitive here</technical_language>

Target:
private boolean shouldIncludeUnavailableModifier(final SwiftParser.CodeBlockContext ctx) { if (ctx == null || ctx.statements() == null) { return false; } final List<SwiftParser.StatementContext> statements = ctx.statements().statement(); return statements.size() == 1 && FATAL_ERROR.equals(statements.get(0).getStart().getText()); }
Source:
<code>private void visitIfStatement(IfStatementTree ifTree) { <START> if (!fieldNotInitializedTest(ifTree.condition())) { <END> return; } ifConditionStack.add(ifTree.condition()); if (!insideCriticalSection() || !isNestedIfStatement()) { return; } patternDetected(ifTree); }</code><technical_language>Double negation is hard. I Test means in this context (if talking equality test, is confusing). Moreover, declairation of method is line 180 usages line 79 88. I rename method isFieldInitialized</technical_language>

Target:
private void visitIfStatement(IfStatementTree ifTree) { if (insideCriticalSection()) { CheckedLocking parentIf = sameFieldAlreadyOnStack(ifConditionSymbolStack.peek()); if (parentIf.ifTree == ifTree) { return; } if (thenStmtInitializeField(ifTree.thenStatement(), parentIf.field) && !parentIf.field.isVolatile() && !isAssignedAtomically(parentIf.field)) { ImmutableList<JavaFileScannerContext.Location> flow = ImmutableList.of(new JavaFileScannerContext.Location("Double-checked locking", ifTree.ifKeyword())); reportIssue(parentIf.ifTree.ifKeyword(), "Remove this dangerous instance of double-checked locking.", flow, null); } } }
Source:
<code>private void internalEndWithFailure() { log.error("Ending command '{}' with failure.", getClass().getName()); endWithFailure(); rollbackQuota(); <START> if (getCommandCompensationPhase() == CommandCompensationPhase.END_COMMAND) { <END> compensate(); } }</code><technical_language>similar approach here, condition is simpler: try { endWithFailure(); } finally { if (getCommandCompensationPhase() == CommandCompensationPhase.END_COMMAND) { compensate(); } }</technical_language>

Target:
private void internalEndWithFailure() { log.error("Ending command '{}' with failure.", getClass().getName()); try { endWithFailure(); } finally { if (getCommandCompensationPhase() == CommandCompensationPhase.END_COMMAND) { compensate(); } } rollbackQuota(); }
Source:
<code>public static Class<?> toInternalConversionClass(LogicalType type) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return StringData.class; case BOOLEAN: return Boolean.class; case BINARY: case VARBINARY: return byte[].class; case DECIMAL: return DecimalData.class; case TINYINT: return Byte.class; case SMALLINT: return Short.class; case INTEGER: case DATE: case TIME_WITHOUT_TIME_ZONE: case INTERVAL_YEAR_MONTH: return Integer.class; case BIGINT: case INTERVAL_DAY_TIME: return Long.class; case FLOAT: return Float.class; case DOUBLE: return Double.class; case TIMESTAMP_WITHOUT_TIME_ZONE: case TIMESTAMP_WITH_LOCAL_TIME_ZONE: return TimestampData.class; case TIMESTAMP_WITH_TIME_ZONE: throw new UnsupportedOperationException(); case ARRAY: return ArrayData.class; case MULTISET: case MAP: return MapData.class; case ROW: case STRUCTURED_TYPE: return RowData.class; case DISTINCT_TYPE: return toInternalConversionClass(((DistinctType) type).getSourceType()); case RAW: return RawValueData.class; case NULL: case SYMBOL: case UNRESOLVED: default: <START> throw new IllegalArgumentException(); <END> } }</code><technical_language>add type error message</technical_language>

Target:
public static Class<?> toInternalConversionClass(LogicalType type) { switch (type.getTypeRoot()) { case CHAR: case VARCHAR: return StringData.class; case BOOLEAN: return Boolean.class; case BINARY: case VARBINARY: return byte[].class; case DECIMAL: return DecimalData.class; case TINYINT: return Byte.class; case SMALLINT: return Short.class; case INTEGER: case DATE: case TIME_WITHOUT_TIME_ZONE: case INTERVAL_YEAR_MONTH: return Integer.class; case BIGINT: case INTERVAL_DAY_TIME: return Long.class; case FLOAT: return Float.class; case DOUBLE: return Double.class; case TIMESTAMP_WITHOUT_TIME_ZONE: case TIMESTAMP_WITH_LOCAL_TIME_ZONE: return TimestampData.class; case TIMESTAMP_WITH_TIME_ZONE: throw new UnsupportedOperationException("Unsupported type: " + type); case ARRAY: return ArrayData.class; case MULTISET: case MAP: return MapData.class; case ROW: case STRUCTURED_TYPE: return RowData.class; case DISTINCT_TYPE: return toInternalConversionClass(((DistinctType) type).getSourceType()); case RAW: return RawValueData.class; case NULL: case SYMBOL: case UNRESOLVED: default: throw new IllegalArgumentException("Illegal type: " + type); } }
Source:
<code>private ProduceWindowResults() { <START> pageBuilder = new PageBuilder(outputTypes); <END> }</code><technical_language>reusing PageBuilder is valuable (because predict allocations' size better?) safely assume this a case here</technical_language>

Target:
ProduceWindowResults() { pageBuilder = new PageBuilder(outputTypes); }
Source:
<code>public int hashCode() { return <START> Objects.hash(chainId, <END> matchForwardFlow, matchReturnFlow, portGroup, invPortGroup, ipAddrGroupSrc, invIpAddrGroupSrc, ipAddrGroupDst, invIpAddrGroupDst, traversedDevice, invTraversedDevice, dlType, invDlType, dlSrc, dlSrcMask, invDlSrc, dlDst, dlDstMask, invDlDst, nwTos, invNwTos, nwProto, invNwProto, nwSrcAddress, nwSrcLength, invNwSrc, nwDstAddress, nwDstLength, invNwDst, fragmentPolicy, tpSrc, invTpSrc, tpDst, invTpDst, type, jumpChainName, jumpChainId, flowAction, natTargets, meterName, vlan, noVlan, popVlan, pushVlan, targetPortId, ingress, failOpen); }</code><technical_language>condInvert is missing</technical_language>

Target:
public int hashCode() { return Objects.hash(chainId, condInvert, matchForwardFlow, matchReturnFlow, portGroup, invPortGroup, ipAddrGroupSrc, invIpAddrGroupSrc, ipAddrGroupDst, invIpAddrGroupDst, traversedDevice, invTraversedDevice, dlType, invDlType, dlSrc, dlSrcMask, invDlSrc, dlDst, dlDstMask, invDlDst, nwTos, invNwTos, nwProto, invNwProto, nwSrcAddress, nwSrcLength, invNwSrc, nwDstAddress, nwDstLength, invNwDst, fragmentPolicy, tpSrc, invTpSrc, tpDst, invTpDst, type, jumpChainName, jumpChainId, flowAction, natTargets, meterName, vlan, noVlan, popVlan, pushVlan, targetPortId, ingress, failOpen); }
Source:
<code>public List<ReplicaId> getReplicaIds(DataNodeId dataNodeId) { ArrayList<ReplicaId> replicaIdsToReturn = new ArrayList<>(); for (PartitionId partitionId : partitions.values()) { List<? extends ReplicaId> replicaIds = partitionId.getReplicaIds(); for (ReplicaId replicaId : replicaIds) { <START> if (replicaId.getDataNodeId().getHostname().equals(dataNodeId.getHostname()) <END> && replicaId.getDataNodeId().getPort() == dataNodeId.getPort()) { replicaIdsToReturn.add(replicaId); } } } return replicaIdsToReturn; }</code><technical_language>latest commit changed compareTo is implemented for datanode. replicaId.getDataNodeId().compareTo(dataNodeId.getHostName()) == 0</technical_language>

Target:
public List<ReplicaId> getReplicaIds(DataNodeId dataNodeId) { ArrayList<ReplicaId> replicaIdsToReturn = new ArrayList<>(); for (PartitionId partitionId : partitions.values()) { List<? extends ReplicaId> replicaIds = partitionId.getReplicaIds(); for (ReplicaId replicaId : replicaIds) { if (replicaId.getDataNodeId().compareTo(dataNodeId) == 0) { replicaIdsToReturn.add(replicaId); } } } return replicaIdsToReturn; }
Source:
<code>protected void processBlockContent(String line) { if (!line.trim().isEmpty()) { if (colsAttribute.isEmpty() || cellsCount % colsAttribute.size() == 0) { TableRowAttributes tableRowAttributes = new TableRowAttributes(); builder.beginBlock(BlockType.TABLE_ROW, tableRowAttributes); } for (String cell : ROW_CELL_SPLITTER.split(line)) { String cellContent = cell.trim(); <START> if (!cellContent.isEmpty()) { <END> String blockContent = cellContent.replaceAll("\\\\\\|", "|"); TableCellAttributes attributes; if (colsAttribute.isEmpty()) { attributes = new TableCellAttributes(); } else { attributes = colsAttribute.get(cellsCount % colsAttribute.size()); } builder.beginBlock(BlockType.TABLE_CELL_NORMAL, attributes); builder.characters(blockContent); builder.endBlock(); cellsCount = cellsCount + 1; } } if (colsAttribute.isEmpty() || cellsCount % colsAttribute.size() == 0) { builder.endBlock(); } } }</code><technical_language>I guess this is avoid a spurious empty cell beginning of row, prevents empty cells in table e.g.: |=== |one|two|three |lorem||ipsum |=== result in empty cell in row 2, col 2</technical_language>

Target:
protected void processBlockContent(String line) { if (!line.trim().isEmpty()) { if (colsAttribute.isEmpty() || cellsCount % colsAttribute.size() == 0) { TableRowAttributes tableRowAttributes = new TableRowAttributes(); builder.beginBlock(BlockType.TABLE_ROW, tableRowAttributes); } for (String cell : ROW_CELL_SPLITTER.split(line)) { String cellContent = cell.trim(); if (!cellContent.isEmpty()) { String blockContent = cellContent.replaceAll("\\\\\\|", "|"); TableCellAttributes attributes; if (colsAttribute.isEmpty()) { attributes = new TableCellAttributes(); } else { attributes = colsAttribute.get(cellsCount % colsAttribute.size()); } builder.beginBlock(BlockType.TABLE_CELL_NORMAL, attributes); builder.characters(blockContent); builder.endBlock(); cellsCount = cellsCount + 1; } } if (colsAttribute.isEmpty()) { builder.endBlock(); colsAttribute = LanguageSupport.createDefaultColumnsAttributeList(cellsCount); } else if (cellsCount % colsAttribute.size() == 0) { builder.endBlock(); } } }
Source:
<code>Table getTable(Class<? extends RealmModel> clazz) { Table table = classToTable.get(clazz); if (table == null) { Class<? extends RealmModel> originalClass = Util.getOriginalModelClass(clazz); if (originalClass != clazz) { table = classToTable.get(originalClass); } if (table == null) { table = transaction.getTable(realm.configuration.getSchemaMediator().getTableName(originalClass)); classToTable.put(originalClass, table); } <START> if (originalClass != clazz) { <END> classToTable.put(clazz, table); } } return table; }</code><technical_language>This lines useless. added line 230 anyway</technical_language>

Target:
Table getTable(Class<? extends RealmModel> clazz) { Table table = classToTable.get(clazz); if (table == null) { Class<? extends RealmModel> originalClass = Util.getOriginalModelClass(clazz); if (isProxyClass(originalClass, clazz)) { table = classToTable.get(originalClass); } if (table == null) { table = transaction.getTable(realm.configuration.getSchemaMediator().getTableName(originalClass)); classToTable.put(originalClass, table); } if (isProxyClass(originalClass, clazz)) { classToTable.put(clazz, table); } } return table; }
Source:
<code>public String getVersion() { if (mIsValid) { return toString(); } else { <START> return "0.0.0"; <END> } }</code><technical_language>A constant for this good</technical_language>

Target:
public String getVersion() { if (mIsValid) { return toString(); } else { return INVALID_ZERO_VERSION; } }
Source:
<code>public ReleaseRemovalRequest( final String repositoryId, final int numberOfVersionsToKeep, final String targetId ) { <START> this.repositoryId = repositoryId; <END> this.numberOfVersionsToKeep = numberOfVersionsToKeep; this.targetId = targetId; }</code><technical_language>some nullchecks asserts maybe</technical_language>

Target:
public ReleaseRemovalRequest( final String repositoryId, final int numberOfVersionsToKeep, final String targetId ) { this.repositoryId = checkNotNull(repositoryId); this.numberOfVersionsToKeep = checkNotNull(numberOfVersionsToKeep); this.targetId = targetId; }
Source:
<code>public static void main(String[] args) { <START> MonitoringService obj = new MonitoringService(); CircuitBreaker circuitBreaker = new CircuitBreaker(3000, 1, 2000 * 1000 * 1000); long serverStartTime = System.nanoTime(); <END> while (true) { LOGGER.info(obj.localResourceResponse()); LOGGER.info(obj.remoteResourceResponse(circuitBreaker, serverStartTime)); LOGGER.info(circuitBreaker.getState()); try { Thread.sleep(5 * 1000); } catch (InterruptedException e) { LOGGER.error(e.getMessage()); } } }</code><technical_language>local-variable type inference (var)</technical_language>

Target:
public static void main(String[] args) { var obj = new MonitoringService(); var circuitBreaker = new CircuitBreaker(3000, 1, 2000 * 1000 * 1000); var serverStartTime = System.nanoTime(); while (true) { LOGGER.info(obj.localResourceResponse()); LOGGER.info(obj.remoteResourceResponse(circuitBreaker, serverStartTime)); LOGGER.info(circuitBreaker.getState()); try { Thread.sleep(5 * 1000); } catch (InterruptedException e) { LOGGER.error(e.getMessage()); } } }
Source:
<code>private static List<Object> deserializeList(JsonParser jp) throws IOException { ImmutableList.Builder<Object> builder = ImmutableList.builder(); JsonToken token; while ((token = jp.nextToken()) != JsonToken.END_ARRAY) { Object obj = deserializeRecursive(jp, token); if (obj != null) { builder.add(obj); } else { StringBuilder message = new StringBuilder(); message.append("null value can't be added to ["); for (Object element: builder.build()) { message.append("'").append(element).append("'").append(", "); } message.append("]"); <START> throw new JsonParseException(null, message.toString()); <END> } } if (token != JsonToken.END_ARRAY) { throw new JsonParseException(jp, "Missing expected END_ARRAY"); } return builder.build(); }</code><technical_language>This a JSON parse exception, is it? sounds JSON is valid, do null</technical_language>

Target:
private static List<Object> deserializeList(JsonParser jp) throws IOException { ImmutableList.Builder<Object> builder = ImmutableList.builder(); JsonToken token; while ((token = jp.nextToken()) != JsonToken.END_ARRAY) { Object obj = deserializeRecursive(jp, token); if (obj != null) { builder.add(obj); } else { StringBuilder message = new StringBuilder(); message.append("null value can't be added to ["); for (Object element: builder.build()) { message.append("'").append(element).append("'").append(", "); } message.append("]"); throw new IllegalArgumentException(message.toString()); } } if (token != JsonToken.END_ARRAY) { throw new JsonParseException(jp, "Missing expected END_ARRAY"); } return builder.build(); }
Source:
<code>private Discover findDiscoveryMode(Resource beansResource) { if (beansResource == null) { return Discover.none; } Document document = readXMLResource(beansResource); if (!document.hasAttributes() && !document.hasChildNodes()) { return Discover.all; } try { Object versionResult = versionExpression.evaluate(document, XPathConstants.STRING); Version version = Version.valueOf(versionResult.toString()); if ((version.equals(Version.LOWEST)) || CDIAnnotationReader.CDI_ARCHIVE_VERSION.compareTo(version) <= 0) { try { Object beanDiscoveryMode = discoveryModeExpression.evaluate(document, XPathConstants.STRING); return Discover.parse(beanDiscoveryMode.toString()); <START> } catch (NullPointerException | XPathExpressionException e) { <END> return Discover.annotated; } } return Discover.all; } catch (NullPointerException | XPathExpressionException e) { return Discover.all; } }</code><technical_language>Also, catch IllegalArgumentException thrown Enum.valueOf, no? XML corrupt explode</technical_language>

Target:
private Discover findDiscoveryMode(Resource beansResource) { if (beansResource == null) { return Discover.none; } Document document = readXMLResource(beansResource); if (!document.hasAttributes() && !document.hasChildNodes()) { return Discover.all; } try { Object versionResult = versionExpression.evaluate(document, XPathConstants.STRING); Version version = Version.valueOf(versionResult.toString()); if ((version.equals(Version.LOWEST)) || CDIAnnotationReader.CDI_ARCHIVE_VERSION.compareTo(version) <= 0) { try { Object beanDiscoveryMode = discoveryModeExpression.evaluate(document, XPathConstants.STRING); return Discover.parse(beanDiscoveryMode.toString()); } catch (IllegalArgumentException | NullPointerException | XPathExpressionException e) { return Discover.annotated; } } return Discover.all; } catch (NullPointerException | XPathExpressionException e) { return Discover.all; } }
Source:
<code>public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { Map<String,String> headerMap = new HashMap<>(); String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } execute(Method.PUT, US_EAST_1, bucketName, null, headerMap, null, <START> "application/octet-stream", configString, 0); <END> }</code><technical_language>Avoid execute()</technical_language>

Target:
public void makeBucket(String bucketName, String region) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { String configString; if (region == null || US_EAST_1.equals(region)) { configString = ""; } else { CreateBucketConfiguration config = new CreateBucketConfiguration(region); configString = config.toString(); } executePut(bucketName, null, null, null, US_EAST_1, configString, 0); }
Source:
<code>private void performPaymentWorksApprovalProcessingForVendor(VendorDetail vendorDetail, String kfsDocumentNumber, String maintenanceAction) { if (isExistingPaymentWorksVendor(kfsDocumentNumber) && isMaintenanceActionNewOrNewWithExisting(maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: isExistingPaymentWorksVendor"); this.saveBusinessObject(); processExistingPaymentWorksVendorApproval(kfsDocumentNumber, vendorDetail); } else if (isMaintenanceActionNewOrNewWithExisting(maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: new action resulting from AVf or hand keying"); this.saveBusinessObject(); processKfsVendorNewActionApproval(kfsDocumentNumber, vendorDetail); } else if (StringUtils.equals(KRADConstants.MAINTENANCE_EDIT_ACTION, maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: edit action"); processKfsVendorEditActionApproval(kfsDocumentNumber, vendorDetail); <START> } <END> }</code><technical_language>Is a plain "else" block needed log cases PaymentWorks processing is needed</technical_language>

Target:
private void performPaymentWorksApprovalProcessingForVendor(VendorDetail vendorDetail, String kfsDocumentNumber, String maintenanceAction) { if (isExistingPaymentWorksVendor(kfsDocumentNumber) && isMaintenanceActionNewOrNewWithExisting(maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: isExistingPaymentWorksVendor"); this.saveBusinessObject(); processExistingPaymentWorksVendorApproval(kfsDocumentNumber, vendorDetail); } else if (isMaintenanceActionNewOrNewWithExisting(maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: new action resulting from AVf or hand keying"); this.saveBusinessObject(); processKfsVendorNewActionApproval(kfsDocumentNumber, vendorDetail); } else if (StringUtils.equals(KRADConstants.MAINTENANCE_EDIT_ACTION, maintenanceAction)) { LOG.debug("performPaymentWorksApprovalProcessingForVendor: edit action"); processKfsVendorEditActionApproval(kfsDocumentNumber, vendorDetail); } else { LOG.info("performPaymentWorksApprovalProcessingForVendor: No PVEN Approval processing performed for PMW because not existing PMW vendor -OR- KFS PVEN maintenance action not currently being tracked for PMW."); } }
Source:
<code>BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) { Assert.notNull(registry, "Registry must not be null"); Assert.notEmpty(sources, "Sources must not be empty"); this.sources = sources; this.annotatedReader = new AnnotatedBeanDefinitionReader(registry); if (IS_XML_ENABLED) { this.xmlReader = new XmlBeanDefinitionReader(registry); <START> this.groovyReader = isGroovyPresent() ? new GroovyBeanDefinitionReader(registry) : null; <END> } else { this.xmlReader = null; this.groovyReader = null; } this.scanner = new ClassPathBeanDefinitionScanner(registry); this.scanner.addExcludeFilter(new ClassExcludeFilter(sources)); }</code><technical_language>This broad me. I a spring.xml.ignore property effect .groovy bean definitions loaded</technical_language>

Target:
BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) { Assert.notNull(registry, "Registry must not be null"); Assert.notEmpty(sources, "Sources must not be empty"); this.sources = sources; this.annotatedReader = new AnnotatedBeanDefinitionReader(registry); this.xmlReader = (IS_XML_ENABLED ? new XmlBeanDefinitionReader(registry) : null); this.groovyReader = (isGroovyPresent() ? new GroovyBeanDefinitionReader(registry) : null); this.scanner = new ClassPathBeanDefinitionScanner(registry); this.scanner.addExcludeFilter(new ClassExcludeFilter(sources)); }
Source:
<code>protected void setup(Context context) throws IOException, InterruptedException { config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration()); List<AggregatorFactory> combiningAggsList = Lists.newArrayList(); for (AggregatorFactory factory : config.getSchema().getDataSchema().getAggregators()) { combiningAggsList.add(factory.getCombiningFactory()); } <START> combiningAggs = combiningAggsList.toArray(new AggregatorFactory[0]); <END> }</code><technical_language>This pattern generate a _lot_ of garbage. add() List result in binary growth of underlying array in end **_another**_ array is created copy stuff it. While hurt here, this is a bad code pattern follow in general. way, in this case, I faster less-wasteful code is clearer: AggregatorFactory[] aggs = config.getSchema().getDataSchema().getAggregators(); combiningAggs = new AggregatorFactory[aggs.length]; for (int i = 0; i < aggs.length; ++i) { combiningAggs[i] = aggs[i].getCombiningFactory(); }</technical_language>

Target:
protected void setup(Context context) throws IOException, InterruptedException { config = HadoopDruidIndexerConfig.fromConfiguration(context.getConfiguration()); aggregators = config.getSchema().getDataSchema().getAggregators(); combiningAggs = new AggregatorFactory[aggregators.length]; for (int i = 0; i < aggregators.length; ++i) { combiningAggs[i] = aggregators[i].getCombiningFactory(); } }
Source:
<code>public SessionManagementMethod loadMethodFromSession(Session session, int contextId) throws DatabaseException { ScriptBasedSessionManagementMethod method = new ScriptBasedSessionManagementMethod(); this.loadMethod( method, <START> session.getContextDataStrings(contextId, RecordContext.TYPE_AUTH_METHOD_FIELD_1) <END> .get(0), session.getContextDataStrings(contextId, RecordContext.TYPE_AUTH_METHOD_FIELD_2)); return method; }</code><technical_language>constants auth instead of session</technical_language>

Target:
public SessionManagementMethod loadMethodFromSession(Session session, int contextId) throws DatabaseException { ScriptBasedSessionManagementMethod method = new ScriptBasedSessionManagementMethod(); List<String> scripts = session.getContextDataStrings( contextId, RecordContext.TYPE_SESSION_MANAGEMENT_FIELD_1); if (scripts.size() > 0) { this.loadMethod( method, scripts.get(0), session.getContextDataStrings( contextId, RecordContext.TYPE_SESSION_MANAGEMENT_FIELD_2)); } return method; }
Source:
<code>public void forEachPixel( final T action ) { Objects.requireNonNull( action ); if ( Intervals.numElements( dimensions ) == 0 ) return; <START> if ( allAreNativeImages() ) <END> runUsingCursors( action ); else runUsingRandomAccesses( action ); }</code><technical_language>This is a good criterion decide for/against Cursors. Views fast Cursors, for example if do a transformations ArrayImg concatenate identity, get a ArrayImg Cursor (although input image is a IntervalView that). Cursor types</technical_language>

Target:
public void forEachPixel( final T action ) { Objects.requireNonNull( action ); if ( Intervals.numElements( dimensions ) == 0 ) return; List< IterableInterval< ? > > iterableIntervals = imagesAsIterableIntervals(); if ( allCursorsAreFast( iterableIntervals ) ) runUsingCursors( iterableIntervals, action ); else runUsingRandomAccesses( action ); }
Source:
<code>@Override public Call<Void> accept(List<Span> spans) { Call<Void> call = delegate.accept(spans); <START> if (isSpanReporterThread()) return call; <END> return new TracedCall<>(tracer, delegate.accept(spans), "accept-spans"); }</code><technical_language>wrong I thought sample client spans, calls span reporter thread sampled anyways, originate flush thread server requests. is this check necessary</technical_language>

Target:
@Override public Call<Void> accept(List<Span> spans) { return new TracedCall<>(tracer, delegate.accept(spans), "accept-spans"); }
Source:
<code>protected Warning createWarning(final Matcher matcher) { String fileName = matcher.group(1); int lineNumber = getLineNumber(matcher.group(2)); String message = matcher.group(7); Priority priority; <START> StringBuilder category = new StringBuilder(); <END> if (matcher.group(4).equalsIgnoreCase("err")) { priority = Priority.HIGH; category.append("ERROR"); } else { priority = Priority.NORMAL; category.append("Warning"); } Warning warning = createWarning(fileName, lineNumber, category.toString(), message, priority); return warning; }</code><technical_language>String</technical_language>

Target:
protected Warning createWarning(final Matcher matcher) { String fileName = matcher.group(1); int lineNumber = getLineNumber(matcher.group(2)); String message = matcher.group(7); Priority priority; String category; if ("err".equalsIgnoreCase(matcher.group(4))) { priority = Priority.HIGH; category = "ERROR"; } else { priority = Priority.NORMAL; category = "Warning"; } return createWarning(fileName, lineNumber, category, message, priority); }
Source:
<code>protected void warn(String message, Exception ex) { if(logger.isDebugEnabled()) { <START> logger.warn(message, ex); <END> } else { logger.warn(message); } }</code><technical_language>debug()</technical_language>

Target:
protected void warn(String message, Exception ex) { logger.warn(message); if (logger.isDebugEnabled()) { logger.debug("Stacktrace for: " + message, ex); } }
Source:
<code>private List<CrewMember> getDirectors(Element directionElement) { Elements directorElements = directionElement.getChildElements("director"); List<CrewMember> actors = Lists.newArrayList(); for (int i = 0; i < directorElements.size(); i++) { Element directorElement = directorElements.get(i); String role = directorElement.getFirstChildElement("role").getValue(); role = role.trim().replace(" ", "_").toLowerCase(); String name = name(directorElement); <START> if (name != null) { <END> if (CrewMember.Role.fromPossibleKey(role).isNothing()) { log.record(new AdapterLogEntry( AdapterLogEntry.Severity.WARN ).withSource(getClass()).withDescription( "Ignoring crew member with unrecognised role: " + role) ); } else { actors.add(CrewMember.crewMemberWithoutId(name, role, Publisher.RADIO_TIMES)); } } } return actors; }</code><technical_language>check .isEmpty() well</technical_language>

Target:
private List<CrewMember> getDirectors(Element directionElement) { Elements directorElements = directionElement.getChildElements(DIRECTOR); List<CrewMember> actors = Lists.newArrayList(); for (int i = 0; i < directorElements.size(); i++) { Element directorElement = directorElements.get(i); String role = directorElement.getFirstChildElement(ROLE).getValue(); role = role.trim().replace(" ", "_").toLowerCase(); Optional<String> optionalName = makeName(directorElement); if (optionalName.isPresent()) { if (CrewMember.Role.fromPossibleKey(role).isNothing()) { log.record(new AdapterLogEntry( AdapterLogEntry.Severity.WARN ).withSource(getClass()).withDescription(String.format( "Ignoring crew member with unrecognised role: %s", role )) ); } else { actors.add(CrewMember.crewMemberWithoutId( optionalName.get(), role, Publisher.RADIO_TIMES )); } } } return actors; }
Source:
<code>public Type getType() { String name = name(clazz, fieldIfPresent); Type.Repetition repetition = (clazz.isPrimitive()) ? Type.Repetition.REQUIRED : Type.Repetition.OPTIONAL; <START> if (clazz == boolean.class || clazz == Boolean.class) { <END> return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.BOOLEAN, name); } else if (clazz == char.class || clazz == Character.class || clazz == byte.class || clazz == Byte.class || clazz == short.class || clazz == Short.class || clazz == int.class || clazz == Integer.class) { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.INT32, name); } else if (clazz == long.class || clazz == Long.class) { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.INT64, name); } else if (clazz == float.class || clazz == Float.class) { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.FLOAT, name); } else if (clazz == double.class || clazz == Double.class) { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.DOUBLE, name); } else if (clazz.isEnum()) { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.BINARY, name); } else { return new PrimitiveType(repetition, PrimitiveType.PrimitiveTypeName.BINARY, name); } }</code><technical_language>suited factor a map</technical_language>

Target:
public Type getType() { String name = name(clazz, fieldIfPresent); Type.Repetition repetition = (clazz.isPrimitive()) ? Type.Repetition.REQUIRED : Type.Repetition.OPTIONAL; PrimitiveType.PrimitiveTypeName typeName; if(clazz.isEnum()) { typeName = PrimitiveType.PrimitiveTypeName.BINARY; } else { typeName = typesToTypeNames.get(clazz); } return new PrimitiveType(repetition, typeName, name); }
Source:
<code>public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset, boolean integrityOnFlush, boolean integrityOnClose) throws IOException { if (charset == null) { throw new IllegalArgumentException("charset is null"); } this.destPath = destinationPath; Path dir = this.destPath.getParent(); if (Files.exists(dir) && !Files.isDirectory(dir)) { throw new IOException(dir + " exists and is neither a directory nor a symlink to a directory"); } else { if (Files.isSymbolicLink(dir)) { LOGGER.log(Level.CONFIG, "{0} is a symlink to a directory", dir); } else { Files.createDirectories(dir); } } try { tmpPath = Files.createTempFile(dir, "atomic", "tmp"); } catch (IOException e) { throw new IOException("Failed to create a temporary file in "+ dir,e); } if (LOSE_INTEGRITY) { <START> LOGGER.log(Level.FINE, "WARNING: YOU SET A FLAG THAT COULD LEAD TO DATA LOSS."); <END> integrityOnFlush = false; integrityOnClose = false; } core = new FileChannelWriter(tmpPath, charset, integrityOnFlush, integrityOnClose, StandardOpenOption.WRITE); }</code><technical_language>Seriously, need warn write. data loss yanking storage/OS out software -- applications expected behave in scenario</technical_language>

Target:
public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset, boolean integrityOnFlush, boolean integrityOnClose) throws IOException { if (charset == null) { throw new IllegalArgumentException("charset is null"); } this.destPath = destinationPath; Path dir = this.destPath.getParent(); if (Files.exists(dir) && !Files.isDirectory(dir)) { throw new IOException(dir + " exists and is neither a directory nor a symlink to a directory"); } else { if (Files.isSymbolicLink(dir)) { LOGGER.log(Level.CONFIG, "{0} is a symlink to a directory", dir); } else { Files.createDirectories(dir); } } try { tmpPath = Files.createTempFile(dir, "atomic", "tmp"); } catch (IOException e) { throw new IOException("Failed to create a temporary file in "+ dir,e); } if (DISABLE_FORCED_FLUSH) { integrityOnFlush = false; integrityOnClose = false; } core = new FileChannelWriter(tmpPath, charset, integrityOnFlush, integrityOnClose, StandardOpenOption.WRITE); }
Source:
<code>protected void executeVmCommand() { if (diskShouldBeUnPlugged()) { performPlugCommand(VDSCommandType.HotUnPlugDisk, disk, vmDevice); } getVmDeviceDao().remove(vmDevice.getId()); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { <START> getImageDao().updateImageVmSnapshotId(((DiskImage) disk).getImageId(), Guid.Empty); <END> } VmHandler.updateDisksFromDb(getVm()); VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB(getVm().getStaticData()); setSucceeded(true); }</code><technical_language>please null instead of Guid.Empty, happen if AddDiskCommand vmId=null</technical_language>

Target:
protected void executeVmCommand() { if (diskShouldBeUnPlugged()) { performPlugCommand(VDSCommandType.HotUnPlugDisk, disk, vmDevice); } getVmDeviceDao().remove(vmDevice.getId()); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { getImageDao().updateImageVmSnapshotId(((DiskImage) disk).getImageId(), null); } VmHandler.updateDisksFromDb(getVm()); VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB(getVm().getStaticData()); setSucceeded(true); }
Source:
<code>public HelixClusterManager getClusterMap() throws IOException { if (helixClusterManager == null) { <START> ZkClient zkClient = <END> new ZkClient(helixPropertyStoreConfig.zkClientConnectString, helixPropertyStoreConfig.zkClientSessionTimeoutMs, helixPropertyStoreConfig.zkClientConnectionTimeoutMs, new ZNRecordSerializer()); List<String> subscribedPaths = Collections.singletonList(helixPropertyStoreConfig.rootPath); helixPropertyStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<>(zkClient), helixPropertyStoreConfig.rootPath, subscribedPaths); helixClusterManager = new HelixClusterManager(clusterMapConfig, helixPropertyStore, instanceName, helixFactory, metricRegistry); } return helixClusterManager; }</code><technical_language>I HelixClusterManager needs passed in a HelixPropertyStore instance. Also, property store path in HelixPropertyStoreConfig frontend refer wrong path config is HelixAccountService</technical_language>

Target:
public HelixClusterManager getClusterMap() throws IOException { if (helixClusterManager == null) { helixClusterManager = new HelixClusterManager(clusterMapConfig, instanceName, helixFactory, metricRegistry); } return helixClusterManager; }
Source:
<code>protected void fillLocalToolBar(IToolBarManager manager) { manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new CollapseAction(Messages.CollapseButton)); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new ExpandAction(Messages.ExpandButton)); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new FilterAction(Messages.FilterButton)); <START> <END> manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getResetScaleAction()); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getPreviousEventAction()); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getNextEventAction()); }</code><technical_language>Please add a separator</technical_language>

Target:
protected void fillLocalToolBar(IToolBarManager manager) { manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new CollapseAction(Messages.CollapseButton)); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new ExpandAction(Messages.ExpandButton)); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new FilterAction(Messages.FilterButton)); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator()); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getResetScaleAction()); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getPreviousEventAction()); manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getNextEventAction()); }