auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> BlobData getBlobData() { <END> return blobData; }</code><technical_language>this public too, consistent getVersion() other classes. (Not if public, class is package private)</technical_language>

Target:
public BlobData getBlobData() { return blobData; }
Source:
<code>public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode && ((FileItemNode) input).getFileItem() != null) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); } <START> ToolBarManager tbm = CompareViewerPane.getToolBarManager(parent); <END> UIUtils.insertAnnotationNavigationCommands(CompareViewerPane.getToolBarManager(parent)); return contentViewer; }</code><technical_language>a null check added if this null</technical_language>

Target:
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) { Viewer contentViewer = super.findContentViewer(oldViewer, input, parent); if (input instanceof FileItemNode && ((FileItemNode) input).getFileItem() != null) { ReviewCompareAnnotationSupport support = ReviewCompareAnnotationSupport.getAnnotationSupport(contentViewer); support.setReviewItem(((FileItemNode) input).getFileItem(), behavior); } insertAnnotationNavigationCommands(CompareViewerPane.getToolBarManager(parent)); return contentViewer; }
Source:
<code>public void testForARoomDisabledTheTabletDoesNotScheduleMeetings() { HomeAdminPage homePage = new HomeAdminPage(); RoomsPage confRoomPage = homePage.clickConferenceRoomsLink(); <START> if(confRoomPage.stateEnableDisableBtn(roomName)) { <END> confRoomPage.enableDisableIcon(roomName); } else { HomeTabletPage homeTablet = new HomeTabletPage(); SearchPage searchPage = homeTablet.clickSearchBtn(); searchPage.clickCollapseAdvancedBtn(); searchPage.setName(roomName); Assert.assertFalse(searchPage.roomIsDiplayed(roomName)); } }</code><technical_language>observation in previous test case. is neccesary ask if room is</technical_language>

Target:
public void testForARoomDisabledTheTabletDoesNotScheduleMeetings() { HomeTabletPage homeTabletPage = new HomeTabletPage(); SearchPage searchPage = homeTabletPage.clickSearchBtn() .clickCollapseAdvancedBtn() .setName(roomName); Assert.assertFalse(searchPage.roomIsDiplayed(roomName)); }
Source:
<code>private boolean isCandidate(Map<ColumnHandle, NullableValue> bindings) { if (intersection(bindings.keySet(), arguments).isEmpty()) { return true; } LookupSymbolResolver inputs = new LookupSymbolResolver(assignments, bindings); Object optimized; try { optimized = evaluator.optimize(inputs); } catch (PrestoException e) { TryFunction.propagateIfUnhandled(e); <START> return true; <END> } if (Boolean.FALSE.equals(optimized) || optimized == null || optimized instanceof NullLiteral) { return false; } return true; }</code><technical_language>return true (and TryFunction.propagateIfUnhandled(e);) here? Pick table layout is iterate partitions filtered out. partitions a failure here, participate in actual execution. do think</technical_language>

Target:
private boolean isCandidate(Map<ColumnHandle, NullableValue> bindings) { if (intersection(bindings.keySet(), arguments).isEmpty()) { return true; } LookupSymbolResolver inputs = new LookupSymbolResolver(assignments, bindings); Object optimized = TryFunction.evaluate(() -> evaluator.optimize(inputs), true); if (Boolean.FALSE.equals(optimized) || optimized == null || optimized instanceof NullLiteral) { return false; } return true; }
Source:
<code>public NodeAvailabilityStatus getNodeAvailabilityStatus() { <START> try { <END> readAtSpecifiedConsistency(ConsistencyLevel.ALL); return NodeAvailabilityStatus.ALL_AVAILABLE; } catch (Exception e) { try { readAtSpecifiedConsistency(ConsistencyLevel.EACH_QUORUM); return NodeAvailabilityStatus.EACH_QUORUM_AVAILABLE; } catch (Exception e1) { return tryReadWithLocalQuorum(); } } }</code><technical_language>This method of availability status works in standard configuration (3 nodes, RF3, more generally numNodes = RF). However, if more nodes RF, checking do reads for _locks table - get lucky return EACH_QUORUM_AVAILABLE 2 out of 6 nodes up. In general case, determine nodes up/down, a similar healthcheck is in CassandraClientPool</technical_language>

Target:
public NodeAvailabilityStatus getNodeAvailabilityStatus() { if (!doesConfigReplicationFactorMatchWithCluster()) { return NodeAvailabilityStatus.TERMINAL; } return getStatusByRunningOperationsOnEachHost(); }
Source:
<code><START> private void recreateZKConnection() throws Exception{ try { zk.close(); } catch (InterruptedException e) { LOG.error("Error closing ZK connection : " + e); throw new RuntimeException(e) ; } finally { try { createZKConnection(newTaskCreatedWatcher); createEphemeralZNode(ChaosConstants.CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE + ChaosConstants.ZNODE_PATH_SEPARATOR + agentName, new byte[0]); } catch (IOException e) { LOG.error("Error creating new ZK COnnection for agent: " + agentName + e); throw new RuntimeException(e); } } } <END></code><technical_language>Throwing RTE finally complicate debugging. in try block: private void recreateZKConnection() throws Exception { try { zk.close(); createZKConnection(newTaskCreatedWatcher); createEphemeralZNode(ChaosConstants.CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE + ChaosConstants.ZNODE_PATH_SEPARATOR + agentName, new byte[0]); } catch (InterruptedException | IOException e) { LOG.error("Error recreating new ZK Connection for agent: {}", agentName, e); throw e; } }</technical_language>

Target:
private void recreateZKConnection() throws Exception{ try { zk.close(); createZKConnection(newTaskCreatedWatcher); createEphemeralZNode(ChaosConstants.CHAOS_AGENT_REGISTRATION_EPIMERAL_ZNODE + ChaosConstants.ZNODE_PATH_SEPARATOR + agentName, new byte[0]); } catch (IOException e) { LOG.error("Error creating new ZK COnnection for agent: {}", agentName + e); throw e; } }
Source:
<code>public static synchronized void acquireCore() { if (!SUPPORTED) { throw new RuntimeException("CPU Affinity not supported in current environment"); } if (!CpuAffinityJni.isRoot()) { <START> throw new RuntimeException("CPU Affinity can only be set if the process is running as root"); <END> } try { int cpu = pickAvailableCpu(); CpuAffinityJni.setAffinity(cpu); log.info("Thread has successfully acquired ownership of cpu {}", Thread.currentThread().getName(), cpu); } catch (IOException e) { throw new RuntimeException("Failed to acquire CPU core: " + e.getMessage()); } }</code><technical_language>Is CAPABILITY get this access root</technical_language>

Target:
public static synchronized void acquireCore() { if (!isInitialized) { init(); } if (!isSupported) { throw new RuntimeException("CPU Affinity not supported in current environment"); } if (!CpuAffinityJni.isRoot()) { throw new RuntimeException("CPU Affinity can only be set if the process is running as root"); } try { int cpu = pickAvailableCpu(); CpuAffinityJni.setAffinity(cpu); log.info("Thread has successfully acquired ownership of cpu {}", Thread.currentThread().getName(), cpu); } catch (IOException e) { throw new RuntimeException("Failed to acquire CPU core: " + e.getMessage()); } }
Source:
<code>private void openCase(Path caseMetadataFilePath) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { StartupWindowProvider.getInstance().close(); CueBannerPanel.closeMultiUserCasesWindow(); <START> CaseOpenMultiUserAction.closeMultiUserCasesWindow(); <END> MultiUserCaseManager.getInstance().openCase(caseMetadataFilePath); } catch (CaseActionException | MultiUserCaseManager.MultiUserCaseManagerException ex) { if (null != ex.getCause() && !(ex.getCause() instanceof CaseActionCancelledException)) { LOGGER.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseMetadataFilePath), ex); MessageNotifyUtil.Message.error(ex.getCause().getLocalizedMessage()); } StartupWindowProvider.getInstance().open(); } finally { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }</code><technical_language>public APIs for closing open multi-user cases dialog, called other here. of methods deleted. awkward error prone - imitate done CueBannerPanel.recentCasesWindow. Instead, add a constructor this class takes a reference a JDialog called parentDialog save reference. call parentDialog.setVisible(false) if parentDialog is null. Note I prefer this calling MultiUserCaseDialog.getInstance.setVisible(false) leaves door open for reuse of this panel coupling MultiUserCaseDialog</technical_language>

Target:
private void openCase(Path caseMetadataFilePath) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { StartupWindowProvider.getInstance().close(); if (parentDialog != null) { parentDialog.setVisible(false); } MultiUserCaseManager.getInstance().openCase(caseMetadataFilePath); } catch (CaseActionException | MultiUserCaseManager.MultiUserCaseManagerException ex) { if (null != ex.getCause() && !(ex.getCause() instanceof CaseActionCancelledException)) { LOGGER.log(Level.SEVERE, String.format("Error opening case with metadata file path %s", caseMetadataFilePath), ex); MessageNotifyUtil.Message.error(ex.getCause().getLocalizedMessage()); } StartupWindowProvider.getInstance().open(); } finally { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }
Source:
<code>public static LfsPointer parseLfsPointer(InputStream in) throws IOException { boolean v = false; LongObjectId id = null; long si = -1; try (BufferedReader br = new BufferedReader( new InputStreamReader(in))) { for (String s = br.readLine(); s != null; s = br.readLine()) { <START> if (s.startsWith("#") || s.length() == 0) END> continue; if (s.startsWith("version") && s.length() > 8 && s.substring(8).trim().equals(VERSION)) { v = true; } else if (s.startsWith("oid") && s.length() > 4) { if (s.startsWith("oid sha256:")) { id = LongObjectId.fromString(s.substring(11).trim()); } else { id = LongObjectId.fromString(s.substring(4).trim()); } } else if (s.startsWith("size") && s.length() > 5) { si = Long.parseLong(s.substring(5).trim()); } else { return null; } } if (v && id != null && si > -1) { return new LfsPointer(id, si); } } return null; }</code><technical_language>missing braces</technical_language>

Target:
public static LfsPointer parseLfsPointer(InputStream in) throws IOException { boolean versionLine = false; LongObjectId id = null; long si = -1; try (BufferedReader br = new BufferedReader( new InputStreamReader(in))) { for (String s = br.readLine(); s != null; s = br.readLine()) { if (s.startsWith("#") || s.length() == 0) { continue; } else if (s.startsWith("version") && s.length() > 8 && s.substring(8).trim().equals(VERSION)) { versionLine = true; } else if (s.startsWith("oid sha256:")) { id = LongObjectId.fromString(s.substring(11).trim()); } else if (s.startsWith("size") && s.length() > 5) { si = Long.parseLong(s.substring(5).trim()); } else { return null; } } if (versionLine && id != null && si > -1) { return new LfsPointer(id, si); } } return null; }
Source:
<code>public void autoService() { assert_().about(javaSources()) .that(Arrays.asList( JavaFileObjects.forResource("test/SomeService.java"), JavaFileObjects.forResource("test/SomeServiceProvider1.java"), JavaFileObjects.forResource("test/SomeServiceProvider2.java"), JavaFileObjects.forResource("test/Enclosing.java"), <START> JavaFileObjects.forResource("test/MultiServiceProvider.java"), <END> JavaFileObjects.forResource("test/AnotherService.java"), JavaFileObjects.forResource("test/AnotherServiceProvider.java"))) .processedWith(new AutoServiceProcessor()) .compilesWithoutError() .and().generatesFiles( JavaFileObjects.forResource("META-INF/services/test.SomeService"), JavaFileObjects.forResource("META-INF/services/test.AnotherService")); }</code><technical_language>I this a separate test SomeService+AnotherService get generated. that, get contents assert expect</technical_language>

Target:
public void autoService() { assertThat( JavaFileObjects.forResource("test/SomeService.java"), JavaFileObjects.forResource("test/SomeServiceProvider1.java"), JavaFileObjects.forResource("test/SomeServiceProvider2.java"), JavaFileObjects.forResource("test/Enclosing.java"), JavaFileObjects.forResource("test/AnotherService.java"), JavaFileObjects.forResource("test/AnotherServiceProvider.java")) .processedWith(new AutoServiceProcessor()) .compilesWithoutError() .and().generatesFiles( JavaFileObjects.forResource("META-INF/services/test.SomeService"), JavaFileObjects.forResource("META-INF/services/test.AnotherService")); }
Source:
<code>public void put(byte[] key, byte[] value) { validateMessageSize(value); <START> if (!isLargeMessage(value)) { <END> store.put(key, value); } }</code><technical_language>Need a metric for large messages rate. log them, ignore silently</technical_language>

Target:
public void put(byte[] key, byte[] value) { validateMessageSize(value); if (!isLargeMessage(value)) { store.put(key, value); } else { LOG.info("Ignoring a large message with size " + value.length + " since it is greater than " + "the maximum allowed value of " + maxMessageSize); largeMessageSafeStoreMetrics.ignoredLargeMessages().inc(); } }
Source:
<code>private void connect() throws SQLException { if (conn != null) { try { conn.prepareStatement("SELECT 1;").execute(); } catch (SQLException ex) { <START> if ("08S01".equals(ex.getSQLState())) { <END> conn.close(); } } } if (conn == null || conn.isClosed()) { conn = DriverManager.getConnection(config.sqlDsn, config.sqlUsername, config.sqlPassword); } }</code><technical_language>I write this, neat if extract a constant name, while :)</technical_language>

Target:
private void connect() throws SQLException { if (conn != null) { try { conn.prepareStatement("SELECT 1;").execute(); } catch (SQLException ex) { if (COMM_LINK_FAILURE.equals(ex.getSQLState())) { conn.close(); } } } if (conn == null || conn.isClosed()) { conn = DriverManager.getConnection(config.sqlDsn, config.sqlUsername, config.sqlPassword); } }
Source:
<code>public void addOscoreContext(BootstrapConfig config) { HashMapCtxDB db = OscoreHandler.getContextDB(); LOG.trace("Adding OSCORE context information to the context database"); BootstrapConfig.OscoreObject osc = null; for (Map.Entry<Integer, BootstrapConfig.OscoreObject> o : config.oscore.entrySet()) { osc = o.getValue(); try { AlgorithmID hkdfAlg; if (osc.oscoreHmacAlgorithm.matches("-?\\d+")) { hkdfAlg = AlgorithmID.FromCBOR(CBORObject.FromObject(Integer.parseInt(osc.oscoreHmacAlgorithm))); } else { hkdfAlg = AlgorithmID.valueOf(osc.oscoreHmacAlgorithm); } AlgorithmID aeadAlg; if (osc.oscoreAeadAlgorithm.matches("-?\\d+")) { aeadAlg = AlgorithmID.FromCBOR(CBORObject.FromObject(Integer.parseInt(osc.oscoreAeadAlgorithm))); } else { aeadAlg = AlgorithmID.valueOf(osc.oscoreAeadAlgorithm); } if (osc.oscoreMasterSalt.length == 0) { osc.oscoreMasterSalt = null; } if (osc.oscoreIdContext.length == 0) { osc.oscoreIdContext = null; } OSCoreCtx ctx = new OSCoreCtx(osc.oscoreMasterSecret, false, aeadAlg, osc.oscoreSenderId, osc.oscoreRecipientId, hkdfAlg, 32, osc.oscoreMasterSalt, osc.oscoreIdContext); <START> db.addContext(ctx); <END> } catch (OSException | CoseException e) { LOG.error("Failed to add OSCORE context to context database."); e.printStackTrace(); } } }</code><technical_language>disturb this static kind of OSCORE store guess this priority get a rid of this this impact organize code. previous conversation this : <LINK_0> this is currently coded work if restart server (db.addContext is called) get : 2020-06-30 16:16:04,071 ERROR RequestDecryptor - Security context 2020-06-30 16:16:04,071 ERROR ObjectSecurityLayer - Error while receiving OSCore request: Security context</technical_language>

Target:
public void addOscoreContext(BootstrapConfig config) { HashMapCtxDB db = OscoreHandler.getContextDB(); LOG.trace("Adding OSCORE context information to the context database"); BootstrapConfig.OscoreObject osc = null; for (Map.Entry<Integer, BootstrapConfig.OscoreObject> o : config.oscore.entrySet()) { osc = o.getValue(); try { byte[] masterSecret = Hex.decodeHex(osc.oscoreMasterSecret.toCharArray()); byte[] senderId = Hex.decodeHex(osc.oscoreSenderId.toCharArray()); byte[] recipientId = Hex.decodeHex(osc.oscoreRecipientId.toCharArray()); byte[] masterSalt = Hex.decodeHex(osc.oscoreMasterSalt.toCharArray()); if (masterSalt.length == 0) { masterSalt = null; } AlgorithmID aeadAlg = AlgorithmID.FromCBOR(CBORObject.FromObject(osc.oscoreAeadAlgorithm)); AlgorithmID hkdfAlg = AlgorithmID.FromCBOR(CBORObject.FromObject(osc.oscoreHmacAlgorithm)); byte[] idContext = null; int replayWindow = 32; OSCoreCtx ctx = new OSCoreCtx(masterSecret, false, aeadAlg, senderId, recipientId, hkdfAlg, replayWindow, masterSalt, idContext); db.addContext(ctx); } catch (OSException | CoseException e) { LOG.error("Failed to add OSCORE context to context database.", e); } } }
Source:
<code>static List<String> splitUserInput(String userInput) { List<String> splitWithWhiteSpaces = splitWithWhiteSpace(userInput); List<String> furtherSplitWithEquals = new ArrayList<>(); boolean doNotRemoveEqualsInNextToken = false; for (String token : splitWithWhiteSpaces) { if (doNotRemoveEqualsInNextToken) { furtherSplitWithEquals.add(token); doNotRemoveEqualsInNextToken = false; } else { int indexOfFirstEqual = token.indexOf('='); if (indexOfFirstEqual < 0) { furtherSplitWithEquals.add(token); } else { String left = token.substring(0, indexOfFirstEqual); String right = token.substring(indexOfFirstEqual + 1); if (left.length() > 0) { furtherSplitWithEquals.add(left); } if (right.length() > 0) { furtherSplitWithEquals.add(right); } } } <START> if (token.equals("--query") || token.equals("--J")) { <END> doNotRemoveEqualsInNextToken = true; } } return furtherSplitWithEquals; }</code><technical_language>hardcode conditions? based decision "do remove = sign if in quotes"</technical_language>

Target:
static List<String> splitUserInput(String userInput) { List<String> splitWithWhiteSpaces = splitWithWhiteSpace(userInput); List<String> furtherSplitWithEquals = new ArrayList<>(); for (String token : splitWithWhiteSpaces) { if (token.startsWith("'") || token.startsWith("\"") || token.startsWith("-D")) { furtherSplitWithEquals.add(token); continue; } int indexOfFirstEqual = token.indexOf('='); if (indexOfFirstEqual < 0) { furtherSplitWithEquals.add(token); continue; } String left = token.substring(0, indexOfFirstEqual); String right = token.substring(indexOfFirstEqual + 1); if (left.length() > 0) { furtherSplitWithEquals.add(left); } if (right.length() > 0) { furtherSplitWithEquals.add(right); } } return furtherSplitWithEquals; }
Source:
<code>public IconvEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar) { super(cs, averageBytesPerChar, maxBytesPerChar); <START> this.iconv_tPointer = IconvProvider.initConversion("UTF-16LE", ((IconvCharset) cs).getIconvName()); <END> }</code><technical_language>I talked this lazily</technical_language>

Target:
public IconvEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar) { super(cs, averageBytesPerChar, maxBytesPerChar); }
Source:
<code>static String left(String str, int len) { <START> if (str == null || str.isEmpty() || len == 0) { <END> return ""; } if (len > 0) { return str.substring(0, Math.min(len, str.length())); } final int finalLen = str.length() + len; return finalLen > 0 ? str.substring(0, finalLen) : ""; }</code><technical_language>str == null true this checked upfront <LINK_0> (it correctly results in null there). move this empty string 0 length check for functions</technical_language>

Target:
private static String left(String str, int len) { if (len > 0) { return str.substring(0, Math.min(len, str.length())); } final int finalLen = str.length() + len; return finalLen > 0 ? str.substring(0, finalLen) : ""; }
Source:
<code>protected Dimension constructDimension(String dimensionField, Class<?> cls, EntityDictionary entityDictionary) { Meta metaData = entityDictionary.getAttributeOrRelationAnnotation(cls, Meta.class, dimensionField); <START> Class<?> fieldType = entityDictionary.getType(cls, dimensionField); <END> String friendlyName = EntityDimension.getFriendlyNameField(cls, entityDictionary); CardinalitySize cardinality = EntityDimension.getEstimatedCardinality(dimensionField, cls, entityDictionary); if (entityDictionary.isRelation(cls, dimensionField)) { return new EntityDimension( dimensionField, metaData, fieldType, cardinality, friendlyName ); } else if (!getEntityDictionary().attributeOrRelationAnnotationExists(cls, dimensionField, Temporal.class)) { return new DegenerateDimension( dimensionField, metaData, fieldType, cardinality, friendlyName, DegenerateDimension.parseColumnType(dimensionField, cls, entityDictionary) ); } else { Temporal temporal = getEntityDictionary().getAttributeOrRelationAnnotation( cls, Temporal.class, dimensionField ); return new TimeDimension( dimensionField, metaData, fieldType, cardinality, friendlyName, TimeZone.getTimeZone(temporal.timeZone()), temporal.timeGrain() ); } }</code><technical_language>getType methods in dictionary: getType getParamterizedType. This work for Set<Player> for example. test this</technical_language>

Target:
protected Dimension constructDimension(String dimensionField, Class<?> cls, EntityDictionary entityDictionary) { if (getEntityDictionary().getRelationshipType(cls, dimensionField).isToMany()) { String message = String.format("ToMany relationship is not supported in '%s'", cls.getCanonicalName()); log.error(message); throw new IllegalStateException(message); } Meta metaData = entityDictionary.getAttributeOrRelationAnnotation(cls, Meta.class, dimensionField); Class<?> fieldType = entityDictionary.getType(cls, dimensionField); String friendlyName = EntityDimension.getFriendlyNameField(cls, entityDictionary); CardinalitySize cardinality = EntityDimension.getEstimatedCardinality(dimensionField, cls, entityDictionary); if (entityDictionary.isRelation(cls, dimensionField)) { return new EntityDimension( dimensionField, metaData, fieldType, cardinality, friendlyName ); } else if (!getEntityDictionary().attributeOrRelationAnnotationExists(cls, dimensionField, Temporal.class)) { return new DegenerateDimension( dimensionField, metaData, fieldType, cardinality, friendlyName, DegenerateDimension.parseColumnType(dimensionField, cls, entityDictionary) ); } else { Temporal temporal = getEntityDictionary().getAttributeOrRelationAnnotation( cls, Temporal.class, dimensionField ); return new TimeDimension( dimensionField, metaData, fieldType, cardinality, friendlyName, TimeZone.getTimeZone(temporal.timeZone()), temporal.timeGrain() ); } }
Source:
<code>private I18n(File langFile) throws FileNotFoundException { <START> this(new FileInputStream(langFile), langFile.getName().substring(0, langFile.getName().length() - 5)); <END> }</code><technical_language>Avoid magic numbers. 5 a constant, LANG_FILE_EXT_LENGTH, length of a string defined in a constant LANG_FILE_EXT. I opt for second, especially in load()</technical_language>

Target:
private I18n(File langFile) throws FileNotFoundException { this(new FileInputStream(langFile), langFile.getName().substring(0, langFile.getName().length() - LANG_FILE_EXT.length())); }
Source:
<code>private static String computeEntryName(Type type, int id) { if (Type.SOFT_IRQ.equals(type)) { <START> return type.toString() + " " + SoftirqLabelProvider.getSoftIrq(id); END> } return type.toString() + " " + id; }</code><technical_language>want number label? do (and others) think</technical_language>

Target:
private static String computeEntryName(Type type, int id) { if (Type.SOFT_IRQ.equals(type)) { return type.toString() + ' ' + id + ' ' + SoftIrqLabelProvider.getSoftIrq(id); } return type.toString() + ' ' + id; }
Source:
<code>private void updateActionAvailability() { List<DiskImage> disks = getSelectedItems() != null ? getSelectedItems() : new ArrayList<>(); getRemoveCommand().setIsExecutionAllowed(disks.size() > 0 && isRemoveCommandAvailable(disks)); getUploadCommand().setIsExecutionAllowed(isUploadCommandAvailable()); getCancelUploadCommand().setIsExecutionAllowed(UploadImageModel.isCancelAllowed(disks)); getPauseUploadCommand().setIsExecutionAllowed(UploadImageModel.isPauseAllowed(disks)); getResumeUploadCommand().setIsExecutionAllowed(UploadImageModel.isResumeAllowed(disks)); getDownloadCommand().setIsExecutionAllowed(DownloadImageHandler.isDownloadAllowed(disks)); <START> updateCopyAndMoveCommandAvailability(disks); <END> }</code><technical_language>updateMoveCommandAvailability</technical_language>

Target:
private void updateActionAvailability() { List<DiskImage> disks = getSelectedItems() != null ? getSelectedItems() : new ArrayList<>(); getRemoveCommand().setIsExecutionAllowed(disks.size() > 0 && isRemoveCommandAvailable(disks)); getUploadCommand().setIsExecutionAllowed(isUploadCommandAvailable()); getCancelUploadCommand().setIsExecutionAllowed(UploadImageModel.isCancelAllowed(disks)); getPauseUploadCommand().setIsExecutionAllowed(UploadImageModel.isPauseAllowed(disks)); getResumeUploadCommand().setIsExecutionAllowed(UploadImageModel.isResumeAllowed(disks)); getDownloadCommand().setIsExecutionAllowed(DownloadImageHandler.isDownloadAllowed(disks)); diskOperationsHelper.updateMoveAndCopyCommandAvailability(disks, getMoveCommand(), getCopyCommand()); }
Source:
<code>private void updateStateOfReplicas(List<InstanceConfig> instanceConfigs) { for (InstanceConfig instanceConfig : instanceConfigs) { int schemaVersion = getSchemaVersion(instanceConfig); switch (schemaVersion) { case 0: String instanceName = instanceConfig.getInstanceName(); long instanceXid = getXid(instanceConfig); AmbryDataNode node = instanceNameToAmbryDataNode.get(instanceName); if (instanceXid <= currentXid) { if (node == null) { logger.info("Dynamic addition of new nodes is not yet supported, ignoring InstanceConfig {}", instanceConfig); } else { HashSet<String> sealedReplicas = new HashSet<>(getSealedReplicas(instanceConfig)); HashSet<String> stoppedReplicas = new HashSet<>(getStoppedReplicas(instanceConfig)); for (AmbryReplica replica : ambryDataNodeToAmbryReplicas.get(node)) { replica.setSealedState(sealedReplicas.contains(replica.getPartitionId().toPathString())); replica.setStoppedState(stoppedReplicas.contains(replica.getPartitionId().toPathString())); } } <START> break; <END> } else { logger.info( "Ignoring instanceConfig change for because the xid associated with it ({}) is later than current xid ({})", instanceName, instanceXid, currentXid); } default: logger.error("Unknown InstanceConfig schema version: {}, ignoring.", schemaVersion); } } }</code><technical_language>place break right default</technical_language>

Target:
private void updateStateOfReplicas(List<InstanceConfig> instanceConfigs) { for (InstanceConfig instanceConfig : instanceConfigs) { int schemaVersion = getSchemaVersion(instanceConfig); switch (schemaVersion) { case 0: String instanceName = instanceConfig.getInstanceName(); long instanceXid = getXid(instanceConfig); AmbryDataNode node = instanceNameToAmbryDataNode.get(instanceName); if (instanceXid <= currentXid) { if (node == null) { logger.info("Dynamic addition of new nodes is not yet supported, ignoring InstanceConfig {}", instanceConfig); } else { Set<String> sealedReplicas = new HashSet<>(getSealedReplicas(instanceConfig)); Set<String> stoppedReplicas = new HashSet<>(getStoppedReplicas(instanceConfig)); for (AmbryReplica replica : ambryDataNodeToAmbryReplicas.get(node)) { replica.setSealedState(sealedReplicas.contains(replica.getPartitionId().toPathString())); replica.setStoppedState(stoppedReplicas.contains(replica.getPartitionId().toPathString())); } } } else { logger.trace( "Ignoring instanceConfig change for because the xid associated with it ({}) is later than current xid ({})", instanceName, instanceXid, currentXid); helixClusterManagerMetrics.ignoredUpdatesCount.inc(); } break; default: logger.error("Unknown InstanceConfig schema version: {}, ignoring.", schemaVersion); } } }
Source:
<code>private void addInterestingFiles(Map<String, List<Long>> interestingFileMap) throws IOException, TskCoreException { int lineNumber = 0; List<BlackboardArtifact> artifacts = new ArrayList<>(); Iterator<Map.Entry<String, List<Long>>> iterator = interestingFileMap.entrySet().iterator(); while (iterator.hasNext()) { if (cancelled) { break; } Map.Entry<String, List<Long>> entry = iterator.next(); String key = entry.getKey(); String ruleSetName; String ruleName; String[] split = key.split("\t"); ruleSetName = split[0]; ruleName = split[1]; List<Long> fileIds = entry.getValue(); <START> for (Long fileId: fileIds) { <END> if (lineNumber % REPORT_PROGRESS_INTERVAL == 0) { progressMonitor.setProgressText(Bundle.AddLogicalImageTask_addingInterestingFile(lineNumber, totalFiles)); } if (lineNumber % POST_ARTIFACT_INTERVAL == 0) { postArtifacts(artifacts); artifacts.clear(); } addInterestingFileToArtifacts(fileId, ruleSetName, ruleName, artifacts); lineNumber++; } iterator.remove(); } postArtifacts(artifacts); }</code><technical_language>need a cancellation check in this loop</technical_language>

Target:
private void addInterestingFiles(Map<String, List<Long>> interestingFileMap) throws IOException, TskCoreException { int lineNumber = 0; List<BlackboardArtifact> artifacts = new ArrayList<>(); Iterator<Map.Entry<String, List<Long>>> iterator = interestingFileMap.entrySet().iterator(); while (iterator.hasNext()) { if (cancelled) { break; } Map.Entry<String, List<Long>> entry = iterator.next(); String key = entry.getKey(); String ruleSetName; String ruleName; String[] split = key.split("\t"); ruleSetName = split[0]; ruleName = split[1]; List<Long> fileIds = entry.getValue(); for (Long fileId: fileIds) { if (cancelled) { postArtifacts(artifacts); return; } if (lineNumber % REPORT_PROGRESS_INTERVAL == 0) { progressMonitor.setProgressText(Bundle.AddLogicalImageTask_addingInterestingFile(lineNumber, totalFiles)); } if (lineNumber % POST_ARTIFACT_INTERVAL == 0) { postArtifacts(artifacts); artifacts.clear(); } addInterestingFileToArtifacts(fileId, ruleSetName, ruleName, artifacts); lineNumber++; } iterator.remove(); } postArtifacts(artifacts); }
Source:
<code><START> public void testFooBar() { <END> }</code><technical_language>@Before / @After overwrite System.out :-P</technical_language>

Target:
public void testFooBar() throws IOException { File logfile = new File(FILE_NAME); BufferedReader bfr = null; try { bfr = new BufferedReader(new FileReader(logfile)); String line = bfr.readLine(); StringBuilder builder = new StringBuilder(); while (line != null) { builder.append(line); line = bfr.readLine(); } Assert.assertFalse("There should be no warnign produced by FieldAccessValidatorEnricher!", builder.toString().contains(PART_OF_WARNING)); } catch (Exception ex) { Assert.fail("Something gone wrong with test setup, please correct it!"); } finally { fileHandler.close(); LOGGER.removeHandler(fileHandler); logfile.delete(); bfr.close(); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = super.hashCode(); <START> result = prime * result + (usingScsiReservation ? 1231 : 1237); <END> result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }</code><technical_language>if null npe occur</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (Boolean.TRUE.equals(usingScsiReservation) ? 1231 : 1237); result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }
Source:
<code>public void pullConflictsTest() throws IOException { String javaFileChange = "JavaCommentsTest"; String textFileChange = "GitPullTest.txt"; String changeContent_2 = " projectExplorer.waitProjectExplorer(); String repoUrl = String.format("<LINK_0>", gitHubUsername, REPO_NAME); git.importJavaApp(repoUrl, PROJECT_NAME, MAVEN); changeContentOnGithubSide( String.format("%s/%s.java", pathToJavaFile, javaFileChange), CHANGE_STRING_1); changeContentOnGithubSide(textFileChange, CHANGE_STRING_1); changeJavaFileForTest(javaFileChange, changeContent_2); changeTextFileForTest(textFileChange, changeContent_2); performPull(); events.clickEventLogBtn(); events.waitExpectedMessage(firstMergeConflictMessage); commitFiles(); performPull(); events.clickEventLogBtn(); events.waitExpectedMessage(secondMergeConflictMessage); <START> <END> editor.selectTabByName(javaFileChange); editor.waitActive(); editor.waitTextIntoEditor(headConfPrefixConfMess); editor.selectTabByName(textFileChange); editor.waitActive(); editor.waitTextIntoEditor(headConfPrefixConfMess); }</code><technical_language>do check 2 conflicts? 1 checking is enough</technical_language>

Target:
public void pullConflictsTest() throws Exception { String javaFileChange = "AppController"; String textFileChange = "README.md"; String changeContent2 = " String pathJavaFile = String.format("%s/%s/%s.java", PROJECT_NAME, PATH_TO_JAVA_FILE, javaFileChange); String pathTextFile = String.format("%s/%s", PROJECT_NAME, textFileChange); projectExplorer.waitProjectExplorer(); String repoUrl = String.format("<LINK_0>", gitHubUsername, REPO_NAME); git.importJavaApp(repoUrl, PROJECT_NAME, MAVEN); changeContentOnGithubSide( String.format("%s/%s.java", PATH_TO_JAVA_FILE, javaFileChange), CHANGE_STRING_1); changeContentOnGithubSide(textFileChange, CHANGE_STRING_1); testProjectServiceClient.updateFile(ws.getId(), pathJavaFile, changeContent2); testProjectServiceClient.updateFile(ws.getId(), pathTextFile, changeContent2); performPull(); eventsPanel.clickEventLogBtn(); eventsPanel.waitExpectedMessage(FIRST_MERGE_CONFLICT_MESSAGE); commitFiles(); performPull(); eventsPanel.clickEventLogBtn(); eventsPanel.waitExpectedMessage(SECOND_MERGE_CONFLICT_MESSAGE); projectExplorer.quickExpandWithJavaScript(); projectExplorer.openItemByPath(pathJavaFile); editor.waitActive(); editor.waitTextIntoEditor(HEAD_CONF_PREFIX_CONF_MESS); projectExplorer.openItemByPath(pathTextFile); editor.waitActive(); editor.waitTextIntoEditor(HEAD_CONF_PREFIX_CONF_MESS); }
Source:
<code>public int getLicenseIcon() { if (isLicensePD()) { return R.drawable.ic_license_pd; } else if (isLicenseCC()) { return R.drawable.ic_license_cc; <START> } else { <END> return R.drawable.ic_license_cite; } }</code><technical_language>minor: elses unnecessary</technical_language>

Target:
public int getLicenseIcon() { if (isLicensePD()) { return R.drawable.ic_license_pd; } if (isLicenseCC()) { return R.drawable.ic_license_cc; } return R.drawable.ic_license_cite; }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; <END> if (o == null || getClass() != o.getClass()) return false; EntryPoint that = (EntryPoint) o; if (pointer != null ? !pointer.equals(that.pointer) : that.pointer != null) return false; if (ownerName != null ? !ownerName.equals(that.ownerName) : that.ownerName != null) return false; if (readers != null ? !readers.equals(that.readers) : that.readers != null) return false; return writers != null ? writers.equals(that.writers) : that.writers == null; }</code><technical_language>matter comparing owner (PublicKeyHash)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EntryPoint that = (EntryPoint) o; return Objects.equals(pointer, that.pointer) && Objects.equals(ownerName, that.ownerName); }
Source:
<code>public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String key = null; String clientIdParam = request.getParameter("api_key"); String clientIdHeader = request.getHeader("API-Key"); <START> if (clientIdHeader == clientIdParam) { <END> key = clientIdHeader; } else { if (clientIdHeader == null) { key = clientIdParam; } else if (clientIdParam == null) { key = clientIdHeader; } else { return false; } } if (whitelist.contains(key)) { return true; } SimpleRateLimiter rateLimiter = getRateLimiter(key); boolean allowRequest = rateLimiter.tryAcquire(); if (!allowRequest) { response.sendError(HttpStatus.TOO_MANY_REQUESTS.value(), getMessage("apikey.limit", String.valueOf(limit), timeUnit)); logger.info("Client with API KEY: " + key + " went over API KEY limit of " + limit + "."); } response.addHeader("X-RateLimit-Limit", String.valueOf(limit)); return allowRequest; }</code><technical_language>== strings, .equals()</technical_language>

Target:
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String key = null; String clientIdParam = request.getParameter("api_key"); String clientIdHeader = request.getHeader("API-Key"); if (!StringUtils.isEmpty(clientIdParam)) { key = clientIdParam; } else if (!StringUtils.isEmpty(clientIdHeader)) { key = clientIdHeader; } else { return false; } List<ApiKeyDTO> keyDtos = apiKeyDao.findAllWhitelisted(); for (ApiKeyDTO dto : keyDtos) { whitelist.add(dto.getApiKey()); } if (whitelist.contains(key)) { return true; } SimpleRateLimiter rateLimiter = getRateLimiter(key); boolean allowRequest = rateLimiter.tryAcquire(); if (!allowRequest) { response.sendError(HttpStatus.TOO_MANY_REQUESTS.value(), errorUtil.getMessage("apikey.limit", String.valueOf(limit), timeUnit)); LOGGER.info("Client with API KEY: " + key + " went over API KEY limit of " + limit + "."); } response.addHeader("X-RateLimit-Limit", String.valueOf(limit)); return allowRequest; }
Source:
<code>public CacheConfig(CompleteConfiguration<K, V> configuration) { super(configuration); if (configuration instanceof CacheConfig) { final CacheConfig config = (CacheConfig) configuration; this.name = config.name; this.managerPrefix = config.managerPrefix; this.uriString = config.uriString; this.asyncBackupCount = config.asyncBackupCount; this.backupCount = config.backupCount; this.inMemoryFormat = config.inMemoryFormat; this.hotRestartConfig = new HotRestartConfig(config.hotRestartConfig); this.eventJournalConfig = new EventJournalConfig(config.eventJournalConfig); if (config.evictionConfig != null) { this.evictionConfig = new EvictionConfig(config.evictionConfig); } if (config.wanReplicationRef != null) { this.wanReplicationRef = new WanReplicationRef(config.wanReplicationRef); } if (config.partitionLostListenerConfigs != null) { this.partitionLostListenerConfigs = new ArrayList<CachePartitionLostListenerConfig>( config.partitionLostListenerConfigs); } this.quorumName = config.quorumName; <START> this.mergePolicyConfig = config.mergePolicyConfig; <END> this.disablePerEntryInvalidationEvents = config.disablePerEntryInvalidationEvents; this.serializationService = config.serializationService; this.classLoader = config.classLoader; } }</code><technical_language>a copy constructor here, instead of sharing reference</technical_language>

Target:
public CacheConfig(CompleteConfiguration<K, V> configuration) { super(configuration); if (configuration instanceof CacheConfig) { final CacheConfig config = (CacheConfig) configuration; this.name = config.name; this.managerPrefix = config.managerPrefix; this.uriString = config.uriString; this.asyncBackupCount = config.asyncBackupCount; this.backupCount = config.backupCount; this.inMemoryFormat = config.inMemoryFormat; this.hotRestartConfig = new HotRestartConfig(config.hotRestartConfig); this.eventJournalConfig = new EventJournalConfig(config.eventJournalConfig); if (config.evictionConfig != null) { this.evictionConfig = new EvictionConfig(config.evictionConfig); } if (config.wanReplicationRef != null) { this.wanReplicationRef = new WanReplicationRef(config.wanReplicationRef); } if (config.partitionLostListenerConfigs != null) { this.partitionLostListenerConfigs = new ArrayList<CachePartitionLostListenerConfig>( config.partitionLostListenerConfigs); } this.quorumName = config.quorumName; this.mergePolicyConfig = new MergePolicyConfig(config.mergePolicyConfig); this.disablePerEntryInvalidationEvents = config.disablePerEntryInvalidationEvents; this.serializationService = config.serializationService; this.classLoader = config.classLoader; } }
Source:
<code>protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(JettyServerInit.class).in(LazySingleton.class); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); <START> binder.bind(AuthorizationManager.class).toInstance(new AuthorizationManager() <END> { @Override public Access authorize( String identity, Resource resource, Action action ) { return new Access(true); } }); JettyBindings.addQosFilter(binder, "/slow/*", 2); final ServerConfig serverConfig = new ObjectMapper().convertValue( ImmutableMap.of("numThreads", "10"), ServerConfig.class ); binder.bind(ServerConfig.class).toInstance(serverConfig); LifecycleModule.register(binder, Server.class); } } ) ); }</code><technical_language>replaced NoopAuthorizationManager</technical_language>

Target:
protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(JettyServerInit.class).in(LazySingleton.class); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); binder.bind(AuthorizerMapper.class).toInstance(AuthTestUtils.TEST_AUTHORIZER_MAPPER); JettyBindings.addQosFilter(binder, "/slow/*", 2); final ServerConfig serverConfig = new ObjectMapper().convertValue( ImmutableMap.of("numThreads", "10"), ServerConfig.class ); binder.bind(ServerConfig.class).toInstance(serverConfig); LifecycleModule.register(binder, Server.class); } } ) ); }
Source:
<code>public T valueForInsert(Object value) { <START> return implicitCast(value); <END> }</code><technical_language>I default implementation return as-is unchanged. a overhead is closer prior behavior introduction of method. easier reason is happening</technical_language>

Target:
public T valueForInsert(Object value) { return (T) value; }
Source:
<code>private void resetOffsets() throws ConnectException { if (!recovered) { readOffset(); if (offset > 0) { <START> long seekOffset = offset; <END> log.debug("Resetting offset for to {}", tp, seekOffset); context.offset(tp, seekOffset); } else { log.debug("Resetting offset for based upon consumer's 'auto.offset.reset'", tp); } recovered = true; } }</code><technical_language>Now, this refactoring, safe offset (it's a primitive) in this branch. I simpler declaring seekOffset. WDYT</technical_language>

Target:
private void resetOffsets() throws ConnectException { if (!recovered) { readOffset(); if (offset > 0) { log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); } else { log.debug("Resetting offset for based upon existing consumer group offsets or, if " + "there are none, the consumer's 'auto.offset.reset' value.", tp); } recovered = true; } }
Source:
<code>void onClose(ClickEvent e) { <START> onCancel(null); <END> }</code><technical_language>If want do event in onCancel, pass e null</technical_language>

Target:
void onClose(ClickEvent e) { onCancel(e); }
Source:
<code>public static TagObject from(TagModel model) { <START> if (model != null) { <END> TagObject result = JavaScriptObject.createObject().cast(); JsArray<TagObject> children = JavaScriptObject.createArray().cast(); result.setValueAsString("description", model.getDescription().getEntity()); result.setValueAsString("name", model.getName().getEntity()); result.setValueAsBoolean("selected", model.getSelection()); if (model.getParent() == null) { result.setValueAsDouble("selectedTagCount", calculateSelectedTagCount(model)); } for(TagModel child: model.getChildren()) { children.push(TagObject.from(child)); } result.setValueAsJavaScriptObject("children", children); return result; } else { return null; } }</code><technical_language>model null here, simply remove null check ensure calling code null check instead</technical_language>

Target:
public static TagObject from(TagModel model) { return from(model, true); }
Source:
<code>public void testIgnoreLinesSorted() throws Exception { final HeaderCheck check = new HeaderCheck(); check.setIgnoreLines(5, 9, 9, 11, 2); <START> int[] ignoreLines = (int[]) Whitebox.getInternalState(check, "ignoreLines"); <END> assertArrayEquals(new int[]{2, 5, 9, 9, 11}, ignoreLines); }</code><technical_language>final</technical_language>

Target:
public void testIgnoreLinesSorted() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(HeaderCheck.class); checkConfig.addAttribute("headerFile", getConfigPath("java.header")); checkConfig.addAttribute("ignoreLines", "4,2,3"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getConfigPath("java3.header"), expected); }
Source:
<code>private void testBoth(String origin, List<Object> headerValue) { CorsFilter filter = new CorsFilter(); ContainerRequestContext request = mock(ContainerRequestContext.class); <START> when(request.getHeaderString("Origin")).thenReturn(origin); <END> ContainerResponseContext response = mock(ContainerResponseContext.class); MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>(); when(response.getHeaders()).thenReturn(headers); filter.filter(request, response); assertEquals(headerValue, headers.get(ALLOW_CORS_HEADER)); }</code><technical_language>CORS_REQUEST_HEADER</technical_language>

Target:
private void testBoth(String origin, List<Object> headerValue) { CorsFilter filter = new CorsFilter(); ContainerRequestContext request = mock(ContainerRequestContext.class); when(request.getHeaderString(CORS_REQUEST_HEADER)).thenReturn(origin); ContainerResponseContext response = mock(ContainerResponseContext.class); MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>(); when(response.getHeaders()).thenReturn(headers); filter.filter(request, response); assertEquals(headerValue, headers.get(ALLOW_CORS_HEADER)); }
Source:
<code>public void writeClasses(ReplCompileResult.CompiledClasses classes) { if (outputDir == null) { return; } for (CompiledClassData compiledClass: classes.getClasses()) { String filePath = compiledClass.getPath(); <START> if (filePath.contains("/")) { <END> continue; } String classWritePath = outputDir + File.separator + filePath; writeClass(compiledClass.getBytes(), classWritePath); } writeModuleInMemory(classes); }</code><technical_language>Is this condition relevant Windows</technical_language>

Target:
public void writeClasses(ReplCompileResult.CompiledClasses classes) { if (outputDir == null) { return; } for (CompiledClassData compiledClass: classes.getClasses()) { String filePath = compiledClass.getPath(); if (!filePath.contains(File.separator)) { String classWritePath = outputDir + File.separator + filePath; writeClass(compiledClass.getBytes(), classWritePath); } } writeModuleInMemory(classes); }
Source:
<code>public void testSameRevisionForAggregateAndPayload() { assertTrue(testSubject.decide(createEntry(WithAnnotation.class.getName(), <START> "2.3-TEST"))); <END> }</code><technical_language>Nit: is revision name set line? fits right</technical_language>

Target:
public void testSameRevisionForAggregateAndPayload() { assertTrue(testSubject.decide(createEntry(WithAnnotationAggregate.class.getName(), "2.3-TEST"))); }
Source:
<code>public void runActionOnPoll() { <START> LOG.info("Checking upstreams"); <END> upstreamChecker.syncUpstreams(); }</code><technical_language>add in a configuration param for this poller is enabled short circuit if needed? easier turn functionality in case wrong it. (vs rolling builds/etc)</technical_language>

Target:
public void runActionOnPoll() { if (!disasterManager.isDisabled(SingularityAction.RUN_UPSTREAM_POLLER)) { LOG.info("Running SingularityUpstreamPoller"); upstreamChecker.syncUpstreams(); } else { LOG.warn("SingularityUpstreamPoller is currently disabled"); } }