auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int hdel(List<ByteArrayWrapper> subList) { AtomicLong numDeleted = new AtomicLong(); region().computeIfPresent(key, (_unused_, oldHash) -> { HashMap<ByteArrayWrapper, ByteArrayWrapper> newHash = new HashMap<>(oldHash); for (ByteArrayWrapper fieldToRemove : subList) { newHash.remove(fieldToRemove); } numDeleted.set(oldHash.size() - newHash.size()); return newHash; }); if (hgetall().size() == 0) { RedisDataType type = context.getKeyRegistrar().getType(key); context.getRegionProvider().removeKey(key, type); } return numDeleted.intValue(); }

Target:
public int hdel(List<ByteArrayWrapper> subList) { AtomicLong numDeleted = new AtomicLong(); region().computeIfPresent(key, (_unused_, oldHash) -> { HashMap<ByteArrayWrapper, ByteArrayWrapper> newHash = new HashMap<>(oldHash); for (ByteArrayWrapper fieldToRemove : subList) { newHash.remove(fieldToRemove); } numDeleted.set(oldHash.size() - newHash.size()); return newHash; }); if (hgetall().isEmpty()) { RedisDataType type = context.getKeyRegistrar().getType(key); if (type == RedisDataType.REDIS_HASH) { context.getRegionProvider().removeKey(key, type); } } return numDeleted.intValue(); }
Source:
private boolean hasAlternativeInstructor(String courseId, String instructorToDeleteEmail) { List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); for (InstructorAttributes instr : instructors) { boolean isAlternativeInstructor = instr.isRegistered() && !instr.getEmail().equals(instructorToDeleteEmail) && instr.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR) && instr.isDisplayedToStudents(); if (isAlternativeInstructor) { return true; } } return false; }

Target:
private boolean hasAlternativeInstructor(String courseId, String instructorToDeleteEmail) { List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); boolean isAlternativeInstructorWithModifyInstructorPermissionPresent = false; boolean isAlternativeVisibleInstructorPresent = false; for (InstructorAttributes instr : instructors) { isAlternativeInstructorWithModifyInstructorPermissionPresent = instr.isRegistered() && !instr.getEmail().equals(instructorToDeleteEmail) && instr.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); if (isAlternativeInstructorWithModifyInstructorPermissionPresent) { break; } } for (InstructorAttributes instr : instructors) { isAlternativeVisibleInstructorPresent = instr.isDisplayedToStudents() && !instr.getEmail().equals(instructorToDeleteEmail); if (isAlternativeVisibleInstructorPresent) { break; } } return isAlternativeInstructorWithModifyInstructorPermissionPresent && isAlternativeVisibleInstructorPresent; }
Source:
public RenderPipelineTask generateTask() { task = new BindFBOTask(fboId); return task; }

Target:
public RenderPipelineTask generateTask() { if (task == null) { task = new BindFBOTask(fboId, fboName); if (fboId != DEFAULT_FRAME_BUFFER_ID) { frameBuffersManager.subscribe(this); } } else { if (fboId != DEFAULT_FRAME_BUFFER_ID) { update(); } } return task; }
Source:
public List<Pair<Integer, Integer>> getMatchedSequences() { if (matchedIndices == null) { throw new RuntimeException("getMatchedSequences() called with matchedIndices == null"); } List<Pair<Integer, Integer>> positions = new ArrayList<>(this.matchedIndices.size()); int start = this.matchedIndices.get(0); int end = start + 1; for (int i = 1; i < this.matchedIndices.size(); i += 1) { if (end == this.matchedIndices.get(i)) { end += 1; } else { positions.add(new Pair<>(start, end)); start = this.matchedIndices.get(i); end = start + 1; } } positions.add(new Pair<>(start, end)); return positions; }

Target:
public List<Pair<Integer, Integer>> getMatchedSequences() { assert this.matchedIndices != null; List<Pair<Integer, Integer>> positions = new ArrayList<>(this.matchedIndices.size()); int start = this.matchedIndices.get(0); int end = start + 1; for (int i = 1; i < this.matchedIndices.size(); i += 1) { if (end == this.matchedIndices.get(i)) { end += 1; } else { positions.add(new Pair<>(start, end)); start = this.matchedIndices.get(i); end = start + 1; } } positions.add(new Pair<>(start, end)); return positions; }
Source:
public void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes questionAttributes = logic.getFeedbackQuestion(feedbackQuestionId); if (questionAttributes == null) { throw new UnauthorizedAccessException("Unknown question id"); } gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(questionAttributes.getCourseId(), userInfo.getId()), logic.getFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }

Target:
public void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes questionAttributes = logic.getFeedbackQuestion(feedbackQuestionId); if (questionAttributes == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Unknown question id")); } gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(questionAttributes.getCourseId(), userInfo.getId()), logic.getFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }
Source:
private List<Row> doJoin(Row outerRow, List<Row> innerRows, JoinRelType joinRelType) throws InterruptedException { boolean outerRowOnLeft = joinRelType != JoinRelType.RIGHT; copyToContext(outerRow, outerRowOnLeft); List<Row> matchInnerRows = new ArrayList<>(); for (Row innerRow: innerRows) { copyToContext(innerRow, !outerRowOnLeft); final Boolean execute = (Boolean) condition.execute(context); if (execute != null && execute) { matchInnerRows.add(innerRow); } } doSend(outerRow, matchInnerRows, joinRelType); return ImmutableList.copyOf(matchInnerRows); }

Target:
private List<Row> doJoin(Row outerRow, List<Row> innerRows, JoinRelType joinRelType) throws InterruptedException { boolean outerRowOnLeft = joinRelType != JoinRelType.RIGHT; copyToContext(outerRow, outerRowOnLeft); List<Row> matchInnerRows = new ArrayList<>(); for (Row innerRow: innerRows) { copyToContext(innerRow, !outerRowOnLeft); final Boolean execute = (Boolean) condition.execute(context); if (execute != null && execute) { matchInnerRows.add(innerRow); } } doSend(outerRow, matchInnerRows, joinRelType); return matchInnerRows; }
Source:
Object[][] data_badDates() { return new Object[][] { { 0, 1, 1 }, { 1900, 0, 0 }, { 1900, -1, 1 }, { 1900, 0, 1 }, { 1900, 15, 1 }, { 1900, 16, 1 }, { 1900, 1, -1 }, { 1900, 1, 0 }, { 1900, 1, 29 }, { 1900, 13, -1 }, { 1900, 13, 0 }, { 1900, 13, 88 }, { 1900, 14, -1 }, { 1900, 14, 0 }, { 1900, 14, 29 }, { 1900, 14, 30 }, { 1898, 13, -1 }, { 1898, 13, 0 }, { 1898, 14, 29 }, { 1898, 14, 30 }, { 1898, 14, 1 }, { 1898, 14, 2 }, { 1900, 14, -1 }, { 1900, 14, 0 }, { 1900, 14, 29 }, { 1900, 2, 29 }, { 1900, 3, 29 }, { 1900, 4, 29 }, { 1900, 5, 29 }, { 1900, 6, 29 }, { 1900, 7, 29 }, { 1900, 8, 29 }, { 1900, 9, 29 }, { 1900, 10, 29 }, { 1900, 11, 29 }, { 1900, 12, 29 }, }; }

Target:
Object[][] data_badDates() { return new Object[][] { {-1, 13, 28}, {-1, 0, 0}, {0, 1, 1}, {1900, -2, 1}, {1900, 14, 1}, {1900, 15, 1}, {1900, 1, -1}, {1900, 1, 0}, {1900, 1, 29}, {1904, -1, -2}, {1904, -1, 0}, {1904, -1, 1}, {1900, -1, -1}, {1900, -1, 0}, {1900, -1, -2}, {1900, 0, -1}, {1900, 0, 1}, {1900, 0, 2}, {1900, 2, 29}, {1900, 3, 29}, {1900, 4, 29}, {1900, 5, 29}, {1900, 6, 29}, {1900, 7, 29}, {1900, 8, 29}, {1900, 9, 29}, {1900, 10, 29}, {1900, 11, 29}, {1900, 12, 29}, {1900, 13, 29}, }; }
Source:
public void getNettyServerTest() { Properties properties = new Properties(); VerifiableProperties verifiableProperties = new VerifiableProperties(properties); RestRequestHandler restRequestHandler = new MockRestRequestResponseHandler(); PublicAccessLogger publicAccessLogger = new PublicAccessLogger(new String[]{}, new String[]{}); VIPHealthCheckService vipHealthCheckService = new VIPHealthCheckService("/ambry-frontend/admin"); NettyServerFactory nettyServerFactory = new NettyServerFactory(verifiableProperties, new MetricRegistry(), restRequestHandler, publicAccessLogger, vipHealthCheckService); NioServer nioServer = nettyServerFactory.getNioServer(); assertNotNull("No NioServer returned", nioServer); assertEquals("Did not receive a NettyServer instance", NettyServer.class.getCanonicalName(), nioServer.getClass().getCanonicalName()); }

Target:
public void getNettyServerTest() { Properties properties = new Properties(); VerifiableProperties verifiableProperties = new VerifiableProperties(properties); RestRequestHandler restRequestHandler = new MockRestRequestResponseHandler(); PublicAccessLogger publicAccessLogger = new PublicAccessLogger(new String[]{}, new String[]{}); RestServerState restServerState = new RestServerState("/healthCheck"); NettyServerFactory nettyServerFactory = new NettyServerFactory(verifiableProperties, new MetricRegistry(), restRequestHandler, publicAccessLogger, restServerState); NioServer nioServer = nettyServerFactory.getNioServer(); assertNotNull("No NioServer returned", nioServer); assertEquals("Did not receive a NettyServer instance", NettyServer.class.getCanonicalName(), nioServer.getClass().getCanonicalName()); }
Source:
public void checkFieldPresence() throws IOException { List<Region> regions = new ArrayList<>(); regions.add(new Region("11", 183000, 183300)); List<String> exclude = new ArrayList<>(); List<VariantEntity> variantEntityList = variantEntityRepository .findByRegionsAndComplexFilters(regions, new ArrayList<>(), exclude, new PageRequest(0, 100000000)); for (VariantEntity currVariantEntity : variantEntityList) { assertFalse(currVariantEntity.getSourceEntries().isEmpty()); assertFalse(currVariantEntity.getIds().isEmpty()); for (Map.Entry<String, VariantSourceEntry> sourceEntryEntry : currVariantEntity.getSourceEntries().entrySet()){ assertFalse(sourceEntryEntry.getValue().getAttributes().isEmpty()); } } }

Target:
public void checkFieldPresence() throws IOException { List<Region> regions = new ArrayList<>(); regions.add(new Region("11", 183000, 183300)); List<VariantEntityRepositoryFilter> filters = new ArrayList<>(); List<String> exclude = new ArrayList<>(); List<VariantEntity> variantEntityList = variantEntityRepository .findByRegionsAndComplexFilters(regions, filters, exclude, new PageRequest(0, 100000000)); for (VariantEntity currVariantEntity : variantEntityList) { assertFalse(currVariantEntity.getSourceEntries().isEmpty()); assertFalse(currVariantEntity.getIds().isEmpty()); for (Map.Entry<String, VariantSourceEntry> sourceEntryEntry : currVariantEntity.getSourceEntries().entrySet()){ assertFalse(sourceEntryEntry.getValue().getAttributes().isEmpty()); } } }
Source:
public void testSelectionAfterCreateLineTool() { DLine dLine = tableClasses.getLines().get(0); final String tool_Name = "Create Class"; final AbstractToolDescription tool = getTool(tool_Name); changeSelectionExpression(tool, "[instance/]", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, null, 1); changeSelectionExpression(tool, "", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, null, 1); changeSelectionExpression(tool, "[/]", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, null, 0); }

Target:
public void testSelectionAfterCreateLineTool() { DLine dLine = tableClasses.getLines().get(0); final String tool_Name = "Create Class"; final AbstractToolDescription tool = getTool(tool_Name); changeSelectionExpression(tool, "[instance/]", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, Lists.newArrayList("NewEClass"), 1, true); changeSelectionExpression(tool, "", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, Lists.newArrayList("NewEClass"), 1, true); changeSelectionExpression(tool, "[/]", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, null, 0); changeSelectionExpression(tool, "service:stdEmptyCollection", false); TestsUtil.synchronizationWithUIThread(); applyCreateLineTool(tool_Name, dLine.getContainer(), dLine.getTarget()); TestsUtil.synchronizationWithUIThread(); checkExpectedElementsInSelection(editor, null, 0); }
Source:
protected DiskImage getImageInfoFromIRS(final DiskImage targetImage) { try { VDSReturnValue ret = runVdsCommand( VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(targetImage.getStoragePoolId(), targetImage.getStorageIds().get(0), targetImage.getId(), targetImage.getImageId())); return (DiskImage) ret.getReturnValue(); } catch (EngineException e) { log.error("Failed to connect to vdsm to get image info", e); return null; } }

Target:
protected DiskImage getImageInfoFromIRS(final DiskImage targetImage) { try { VDSReturnValue ret = runVdsCommand( VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(targetImage.getStoragePoolId(), targetImage.getStorageIds().get(0), targetImage.getId(), targetImage.getImageId())); return (DiskImage) ret.getReturnValue(); } catch (EngineException e) { log.error("Failed to get info of volume '{0}' using GetImageInfo", targetImage.getImageId(), e); return null; } }
Source:
public static void toStringSqlArgs(final StringBuilder sb, Object[] args) { if (args instanceof Object[][]) { for (Object[] rowOfArgs : (Object[][]) args) { toStringSqlArgs(sb, rowOfArgs); } } else { sb.append("("); for (int i = 0; i < args.length; i++) { Object arg = args[i]; if (arg == null) { sb.append("NULL: 'null'"); } else { sb.append(arg.getClass().getName()); sb.append(": '"); if (arg instanceof ByteArrayInputStream) { @SuppressWarnings("resource") ByteArrayInputStream bais = (ByteArrayInputStream) arg; byte[] bytes = new byte[bais.available()]; ByteStreams.readFully(bais, bytes, 0, bais.available()); sb.append(Arrays.toString(bytes)); } else { sb.append(arg.toString()); } sb.append("'"); } if (i != args.length - 1) { sb.append(", "); } } sb.append(")\n"); } }

Target:
public static void toStringSqlArgs(final StringBuilder sb, Object[] args) { if (args instanceof Object[][]) { for (Object[] rowOfArgs : (Object[][]) args) { toStringSqlArgs(sb, rowOfArgs); } } else { sb.append("("); for (int i = 0; i < args.length; i++) { Object arg = args[i]; if (arg == null) { sb.append("NULL: 'null'"); } else { sb.append(arg.getClass().getName()); sb.append(": '"); if (arg instanceof ByteArrayInputStream) { @SuppressWarnings("resource") ByteArrayInputStream bais = (ByteArrayInputStream) arg; byte[] bytes = new byte[bais.available()]; bais.read(bytes, 0, bais.available()); sb.append(Arrays.toString(bytes)); } else { sb.append(arg.toString()); } sb.append("'"); } if (i != args.length - 1) { sb.append(", "); } } sb.append(")\n"); } }
Source:
public void testGet(){ SameDiff sd = SameDiff.create(); INDArray arr = Nd4j.create(10, 10, 10); SDVariable x = sd.var(arr); INDArray expOut1 = arr.get(NDArrayIndex.point(4), NDArrayIndex.point(5)); SDVariable result1 = x.get(SDIndex.point(4), SDIndex.point(5)); assertEquals(expOut1, result1); INDArray expOut2 = arr.get(NDArrayIndex.point(4), NDArrayIndex.all()); SDVariable result2 = x.get(SDIndex.point(4), SDIndex.all()); assertEquals(expOut2, result2); INDArray expOut3 = arr.get(NDArrayIndex.interval(3, 8), NDArrayIndex.point(2)); SDVariable result3 = x.get(SDIndex.interval(3, 8), SDIndex.point(5)); assertEquals(expOut3, result3); INDArray expOut4 = arr.get(NDArrayIndex.point(4), NDArrayIndex.interval(2, 2, 9), NDArrayIndex.all()); SDVariable result4 = x.get(SDIndex.point(4), SDIndex.interval(2, 2, 9), SDIndex.all()); assertEquals(expOut4, result4); }

Target:
public void testGet(){ SameDiff sd = SameDiff.create(); INDArray arr = Nd4j.create(10, 10); SDVariable x = sd.var(arr); INDArray expOut1 = arr.get(NDArrayIndex.point(4), NDArrayIndex.point(5)); SDVariable result1 = x.get(SDIndex.point(4), SDIndex.point(5)); assertEquals(expOut1, result1.eval()); INDArray expOut2 = arr.get(NDArrayIndex.point(4), NDArrayIndex.all()); SDVariable result2 = x.get(SDIndex.point(4), SDIndex.all()); assertEquals(expOut2, result2.eval()); INDArray expOut3 = arr.get(NDArrayIndex.interval(3, 8)); SDVariable result3 = x.get(SDIndex.interval(3, 8)); System.out.println(ArrayUtils.toString(expOut3.shape())); System.out.println(ArrayUtils.toString(result3.eval().shape())); assertArrayEquals(expOut3.shape(), result3.eval().shape()); assertEquals(expOut3, result3.eval()); }
Source:
public static ArtifactClient getTestInstance(String username, String password) { String host = System.getProperty("strongbox.host") != null ? System.getProperty("strongbox.host") : "localhost"; int port = System.getProperty("strongbox.port") != null ? Integer.parseInt(System.getProperty("strongbox.port")) : 48080; ArtifactClient client = new ArtifactClient(); client.setUsername(username != null ? username : "admin"); client.setPassword(password != null ? password : "password"); client.setPort(port); client.setContextBaseUrl("http://" + host + ":" + client.getPort()); return client; }

Target:
public static ArtifactClient getTestInstance(String username, String password) { String host = System.getProperty("strongbox.host") != null ? System.getProperty("strongbox.host") : "localhost"; int port = System.getProperty("strongbox.port") != null ? Integer.parseInt(System.getProperty("strongbox.port")) : 48080; ArtifactClient client = new ArtifactClient(); client.setUsername(username != null ? username : "deployer"); client.setPassword(password != null ? password : "password"); client.setPort(port); client.setContextBaseUrl("http://" + host + ":" + client.getPort()); return client; }
Source:
public SplitSource getSplits(Session session, TableHandle table, SplitSchedulingStrategy splitSchedulingStrategy) { ConnectorId connectorId = table.getConnectorId(); ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); ConnectorSplitSource source; if (table.getLayout().isPresent()) { source = splitManager.getSplits( table.getTransaction(), connectorSession, table.getLayout().get(), splitSchedulingStrategy); } else { try { source = splitManager.getSplits(table.getConnectorHandle(), table.getTransaction(), connectorSession, splitSchedulingStrategy); } catch (UnsupportedOperationException e) { source = splitManager.getSplits( table.getTransaction(), connectorSession, metadata.getLayout(session, table, Constraint.alwaysTrue(), Optional.empty()).get().getLayout().getHandle().getConnectorHandle(), splitSchedulingStrategy); } } SplitSource splitSource = new ConnectorAwareSplitSource(connectorId, table.getTransaction(), source); if (minScheduleSplitBatchSize > 1) { splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize); } return splitSource; }

Target:
public SplitSource getSplits(Session session, TableHandle table, SplitSchedulingStrategy splitSchedulingStrategy) { ConnectorId connectorId = table.getConnectorId(); ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId); ConnectorSession connectorSession = session.toConnectorSession(connectorId); ConnectorTableLayoutHandle layout; if (!table.getLayout().isPresent()) { TableLayoutResult result = metadata.getLayout(session, table, Constraint.alwaysTrue(), Optional.empty()); layout = result.getLayout().getLayoutHandle(); } else { layout = table.getLayout().get(); } ConnectorSplitSource source = splitManager.getSplits( table.getTransaction(), connectorSession, layout, splitSchedulingStrategy); SplitSource splitSource = new ConnectorAwareSplitSource(connectorId, table.getTransaction(), source); if (minScheduleSplitBatchSize > 1) { splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize); } return splitSource; }
Source:
public ConsoleWarningsPrinter(ConsolePrinter console) { this.console = requireNonNull(console, "console is null"); }

Target:
ConsoleWarningsPrinter(ConsolePrinter console) { super(OptionalInt.of(DISPLAYED_WARNINGS)); this.console = requireNonNull(console, "console is null"); }
Source:
public void expand() { try { ui.testCase.setImplicitWait(1, TimeUnit.SECONDS); getElement().findElement(By.xpath(" } catch (NoSuchElementException e) { } finally { ui.testCase.setImplicitWait(); } waitForTransition(); }

Target:
public void expand() throws NoSuchElementException { try { ui.testCase.setImplicitWait(1, TimeUnit.SECONDS); getElement().findElement(By.xpath(" waitForTransition(); } finally { ui.testCase.setImplicitWait(); } }
Source:
boolean commitPrimaryColumn(CommitData cd, long commitTs) throws AccumuloException, AccumuloSecurityException { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = cd.prow.equals(triggerRow) && cd.pcol.equals(triggerColumn); Condition lockCheck = new Condition(cd.pcol.getFamily().toArray(), cd.pcol.getQualifier().toArray()).setIterators(iterConf).setVisibility(cd.pcol.getVisibility()) .setValue(LockValue.encode(cd.prow, cd.pcol, cd.pval != null, cd.pval == DELETE, isTrigger, getTransactorID())); ConditionalMutation delLockMutation = new ConditionalMutation(cd.prow.toArray(), lockCheck); ColumnUtil.commitColumn(isTrigger, true, cd.pcol, cd.pval != null, cd.pval == DELETE, startTs, commitTs, observedColumns, delLockMutation); Status mutationStatus = cd.cw.write(delLockMutation).getStatus(); while (mutationStatus == Status.UNKNOWN) { MutableLong mcts = new MutableLong(-1); TxStatus txStatus = TxStatus.getTransactionStatus(config, cd.prow, cd.pcol, startTs, mcts, null); switch (txStatus) { case COMMITTED: if (mcts.longValue() != commitTs) throw new IllegalStateException(cd.prow + " " + cd.pcol + " " + mcts.longValue() + "!=" + commitTs); mutationStatus = Status.ACCEPTED; break; case LOCKED: mutationStatus = cd.cw.write(delLockMutation).getStatus(); break; default: mutationStatus = Status.REJECTED; } } if (mutationStatus != Status.ACCEPTED) { return false; } return true; }

Target:
boolean commitPrimaryColumn(CommitData cd, long commitTs) throws AccumuloException, AccumuloSecurityException { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = cd.prow.equals(triggerRow) && cd.pcol.equals(triggerColumn); Condition lockCheck = new Condition(ByteUtil.toByteSequence(cd.pcol.getFamily()), ByteUtil.toByteSequence(cd.pcol.getQualifier())).setIterators(iterConf).setVisibility(cd.pcol.getVisibility()) .setValue(LockValue.encode(cd.prow, cd.pcol, cd.pval != null, cd.pval == DELETE, isTrigger, getTransactorID())); ConditionalMutation delLockMutation = new ConditionalMutation(ByteUtil.toByteSequence(cd.prow), lockCheck); ColumnUtil.commitColumn(isTrigger, true, cd.pcol, cd.pval != null, cd.pval == DELETE, startTs, commitTs, observedColumns, delLockMutation); Status mutationStatus = cd.cw.write(delLockMutation).getStatus(); while (mutationStatus == Status.UNKNOWN) { MutableLong mcts = new MutableLong(-1); TxStatus txStatus = TxStatus.getTransactionStatus(config, cd.prow, cd.pcol, startTs, mcts, null); switch (txStatus) { case COMMITTED: if (mcts.longValue() != commitTs) throw new IllegalStateException(cd.prow + " " + cd.pcol + " " + mcts.longValue() + "!=" + commitTs); mutationStatus = Status.ACCEPTED; break; case LOCKED: mutationStatus = cd.cw.write(delLockMutation).getStatus(); break; default: mutationStatus = Status.REJECTED; } } if (mutationStatus != Status.ACCEPTED) { return false; } return true; }
Source:
public static void show(UIFacade uiFacade) { JLabel label = new JLabel(GanttLanguage.getInstance().formatText("restartApplication")); JPanel panel = new JPanel(); panel.add(label); OkAction okAction = new OkAction() { @Override public void actionPerformed(ActionEvent e) { ScheduledExecutorService schedulerExecutor = Executors.newScheduledThreadPool(2); Callable<Process> callable = () -> { ProcessBuilder builder = new ProcessBuilder( SystemUtils.IS_OS_WINDOWS? "cmd /c start \"\" ganttproject.bat" : "ganttproject"); return builder.start(); }; FutureTask<Process> futureTask = new FutureTask<>(callable); schedulerExecutor.submit(futureTask); System.exit(0); } }; UIFacade.Dialog dlg = uiFacade.createDialog(panel, new Action[]{okAction, CancelAction.EMPTY}, ""); dlg.show(); }

Target:
public static void show(UIFacade uiFacade) { OkAction okAction = new OkAction() { @Override public void actionPerformed(ActionEvent e) { uiFacade.getMainFrame().dispatchEvent(new WindowEvent(uiFacade.getMainFrame(), WindowEvent.WINDOW_CLOSING)); } }; uiFacade.showOptionDialog(QUESTION_MESSAGE, GanttLanguage.getInstance().formatText("restartApplication"), new Action[]{okAction, CancelAction.EMPTY}); }
Source:
private void stopCacheSafely(GridCacheContext<?, ?> cctx, boolean clearDbObjects) { sharedCtx.database().checkpointReadLock(); try { prepareCacheStop(cctx.name(), false, clearDbObjects); if (!cctx.group().hasCaches()) stopCacheGroup(cctx.group().groupId(), clearDbObjects); } finally { sharedCtx.database().checkpointReadUnlock(); } }

Target:
private void stopCacheSafely(GridCacheContext<?, ?> cctx, boolean clearDbObjects) { sharedCtx.database().checkpointReadLock(); try { prepareCacheStop(cctx.name(), false, clearDbObjects); if (!cctx.group().hasCaches()) stopCacheGroup(cctx.group().groupId(), false); } finally { sharedCtx.database().checkpointReadUnlock(); } }
Source:
public boolean validateParam(String expectedType) { clearError(); String value = view.getValue(); if (isEmpty(value)) { setError(translationService.getValue(PARAM_MUST_BE_COMPLETED_ERROR)); return false; } if (Short.class.getName().equals(expectedType)) { try { Short.parseShort(value); } catch (NumberFormatException e) { setError(translationService.getValue(SHORT_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (Integer.class.getName().equals(expectedType)) { try { Integer.parseInt(value); } catch (NumberFormatException e) { setError(translationService.getValue(INTEGER_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (Long.class.getName().equals(expectedType)) { try { Long.parseLong(value); } catch (NumberFormatException e) { setError(translationService.getValue(LONG_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (Float.class.getName().equals(expectedType)) { try { Float.parseFloat(value); } catch (NumberFormatException e) { setError(translationService.getValue(FLOAT_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (Double.class.getName().equals(expectedType)) { try { Double.parseDouble(value); } catch (NumberFormatException e) { setError(translationService.getValue(DOUBLE_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (BigDecimal.class.getName().equals(expectedType)) { try { new BigDecimal(value); } catch (NumberFormatException e) { setError(translationService.getValue(BIG_DECIMAL_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } if (BigInteger.class.getName().equals(expectedType)) { try { new BigInteger(value); } catch (NumberFormatException e) { setError(translationService.getValue(BIG_INTEGER_NUMERIC_VALUE_EXPECTED_ERROR)); return false; } } return true; }

Target:
public boolean validateParam(String expectedType) { clearError(); String value = view.getValue(); if (isEmpty(value)) { setError(translationService.getValue(PARAM_MUST_BE_COMPLETED_ERROR)); return false; } if (Short.class.getName().equals(expectedType)) { return validateNumber(value, Short::parseShort, SHORT_NUMERIC_VALUE_EXPECTED_ERROR); } if (Integer.class.getName().equals(expectedType)) { return validateNumber(value, Integer::parseInt, INTEGER_NUMERIC_VALUE_EXPECTED_ERROR); } if (Long.class.getName().equals(expectedType)) { return validateNumber(value, Long::parseLong, LONG_NUMERIC_VALUE_EXPECTED_ERROR); } if (Float.class.getName().equals(expectedType)) { return validateNumber(value, Float::parseFloat, FLOAT_NUMERIC_VALUE_EXPECTED_ERROR); } if (Double.class.getName().equals(expectedType)) { return validateNumber(value, Double::parseDouble, DOUBLE_NUMERIC_VALUE_EXPECTED_ERROR); } if (BigDecimal.class.getName().equals(expectedType)) { return validateNumber(value, BigDecimal::new, BIG_DECIMAL_NUMERIC_VALUE_EXPECTED_ERROR); } if (BigInteger.class.getName().equals(expectedType)) { return validateNumber(value, BigInteger::new, BIG_INTEGER_NUMERIC_VALUE_EXPECTED_ERROR); } return true; }
Source:
public void writeFilter(InputStream input, OutputStream output, String charset, HashMap<String, String> otherParams, FilterCallback cb) throws DataFilterException, IOException { output.write(input.read()); return; }

Target:
public void writeFilter(InputStream input, OutputStream output, String charset, HashMap<String, String> otherParams, FilterCallback cb) throws DataFilterException, IOException { output.write(input.read()); }
Source:
public Object invoke(Object proxy, final Method method, Object[] args) { try { if (method.isAnnotationPresent(ResumeOperation.class)) { throw logger.logExceptionAsError(Exceptions.propagate( new Exception("The resume operation isn't supported."))); } final SwaggerMethodParser methodParser = getMethodParser(method); final HttpRequest request = createHttpRequest(methodParser, args); Context context = methodParser.setContext(args) .addData("caller-method", methodParser.getFullyQualifiedMethodName()) .addData("eagerly-read-response", isReturnTypeDecodable(methodParser.getReturnType())); context = startTracingSpan(method, context); if (request.getBody() != null) { request.setBody(validateLength(request)); } final Mono<HttpResponse> asyncResponse = send(request, context); Mono<HttpDecodedResponse> asyncDecodedResponse = this.decoder.decode(asyncResponse, methodParser); return handleRestReturnType(asyncDecodedResponse, methodParser, methodParser.getReturnType(), context); } catch (IOException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }

Target:
public Object invoke(Object proxy, final Method method, Object[] args) { try { if (method.isAnnotationPresent(ResumeOperation.class)) { throw logger.logExceptionAsError(Exceptions.propagate( new Exception("The resume operation isn't supported."))); } final SwaggerMethodParser methodParser = getMethodParser(method); final HttpRequest request = createHttpRequest(methodParser, args); Context context = methodParser.setContext(args) .addData("caller-method", methodParser.getFullyQualifiedMethodName()) .addData(EAGERLY_READ_RESPONSE_CONTEXT_KEY, isReturnTypeDecodable(methodParser.getReturnType())); context = startTracingSpan(method, context); if (request.getBody() != null) { request.setBody(validateLength(request)); } final Mono<HttpResponse> asyncResponse = send(request, context); Mono<HttpDecodedResponse> asyncDecodedResponse = this.decoder.decode(asyncResponse, methodParser); return handleRestReturnType(asyncDecodedResponse, methodParser, methodParser.getReturnType(), context); } catch (IOException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }
Source:
public void showClassificationConfigurationDialog(Model model) { final DialogClassificationConfiguration dialog = new DialogClassificationConfiguration(shell, model, controller); dialog.open(); }

Target:
public boolean showClassificationConfigurationDialog(Model model) { final DialogClassificationConfiguration dialog = new DialogClassificationConfiguration(shell, model.getClassificationModel().getCurrentConfiguration()); dialog.create(); return dialog.open() == Window.OK; }
Source:
long panel_shouldShowFilename (long id, long sel, long arg0, long arg1) { NSString path = new NSString(arg1); if (filterExtensions != null && filterExtensions.length != 0) { NSFileManager manager = NSFileManager.defaultManager(); long ptr = OS.malloc(1); boolean found = manager.fileExistsAtPath(path, ptr); byte[] isDirectory = new byte[1]; OS.memmove(isDirectory, ptr, 1); OS.free(ptr); if (found) { if (isDirectory[0] != 0) { return 1; } else { String fileName = path.lastPathComponent().getString(); if (popup != null) { int filterIndex = (int) popup.indexOfSelectedItem(); String extensions = filterExtensions [filterIndex]; int start = 0, length = extensions.length (); while (start < length) { int index = extensions.indexOf (EXTENSION_SEPARATOR, start); if (index == -1) index = length; String filter = extensions.substring (start, index).trim (); if (filter.equalsIgnoreCase (fileName)) return 1; if (filter.equals ("*") || filter.equals ("*.*")) return 1; if (filter.startsWith ("*.")) filter = filter.substring (2); if ((fileName.toLowerCase ()).endsWith("." + filter.toLowerCase ())) return 1; start = index + 1; } return 0; } } } } return 1; }

Target:
long panel_shouldShowFilename (long id, long sel, long arg0, long arg1) { NSString path = new NSString(arg1); if (filterExtensions != null && filterExtensions.length != 0) { NSFileManager manager = NSFileManager.defaultManager(); long ptr = OS.malloc(1); boolean found = manager.fileExistsAtPath(path, ptr); byte[] isDirectory = new byte[1]; OS.memmove(isDirectory, ptr, 1); OS.free(ptr); if (found) { if (isDirectory[0] != 0) { return 1; } else if (popup != null) { String fileName = path.lastPathComponent().getString(); int filterIndex = (int) popup.indexOfSelectedItem(); String extensions = filterExtensions [filterIndex]; int start = 0, length = extensions.length (); while (start < length) { int index = extensions.indexOf (EXTENSION_SEPARATOR, start); if (index == -1) index = length; String filter = extensions.substring (start, index).trim (); if (filter.equalsIgnoreCase (fileName)) return 1; if (filter.equals ("*") || filter.equals ("*.*")) return 1; if (filter.startsWith ("*.")) filter = filter.substring (2); if ((fileName.toLowerCase ()).endsWith("." + filter.toLowerCase ())) return 1; start = index + 1; } return 0; } } } return 1; }
Source:
public int getRequiredPermissionLevel() { int level = 0; for (ICommand command : getSubCommands()) { if (command instanceof CommandBase) { level = Math.max(level, ((CommandBase) command).getRequiredPermissionLevel()); } } return level; }

Target:
public int getRequiredPermissionLevel() { int level = super.getRequiredPermissionLevel(); for (ICommand command : getSortedCommandList()) { if (command instanceof CommandBase) { level = Math.min(level, ((CommandBase) command).getRequiredPermissionLevel()); } } return level; }
Source:
public InfluxDBImpl(final String url, final String username, final String password, final OkHttpClient.Builder client, final ResponseFormat responseFormat) { this.hostAddress = parseHostAddress(url); this.username = username; this.password = password; this.loggingInterceptor = new HttpLoggingInterceptor(); setLogLevel(LOG_LEVEL); this.gzipRequestInterceptor = new GzipRequestInterceptor(); client.addInterceptor(loggingInterceptor).addInterceptor(gzipRequestInterceptor); Factory converterFactory = null; switch (responseFormat) { case MSGPACK: client.addInterceptor(chain -> { Request request = chain.request().newBuilder().addHeader("Accept", APPLICATION_MSGPACK) .addHeader("Accept-Encoding", "identity").build(); return chain.proceed(request); }); converterFactory = MessagePackConverterFactory.create(); chunkProccesor = new MessagePackChunkProccesor(); break; case JSON: default: converterFactory = MoshiConverterFactory.create(); Moshi moshi = new Moshi.Builder().build(); JsonAdapter<QueryResult> adapter = moshi.adapter(QueryResult.class); chunkProccesor = new JSONChunkProccesor(adapter); break; } this.retrofit = new Retrofit.Builder().baseUrl(url).client(client.build()).addConverterFactory(converterFactory) .build(); this.influxDBService = this.retrofit.create(InfluxDBService.class); if (ResponseFormat.MSGPACK.equals(responseFormat)) { String[] versionNumbers = version().split("\\."); final int major = Integer.parseInt(versionNumbers[0]); final int minor = Integer.parseInt(versionNumbers[1]); final int fromMinor = 4; if ((major < 2) && ((major != 1) || (minor < fromMinor))) { throw new InfluxDBException("MessagePack format is only supported from InfluxDB version 1.4 and later"); } } }

Target:
public InfluxDBImpl(final String url, final String username, final String password, final OkHttpClient.Builder client, final ResponseFormat responseFormat) { this.messagePack = ResponseFormat.MSGPACK.equals(responseFormat); this.hostAddress = parseHostAddress(url); this.username = username; this.password = password; this.loggingInterceptor = new HttpLoggingInterceptor(); setLogLevel(LOG_LEVEL); this.gzipRequestInterceptor = new GzipRequestInterceptor(); client.addInterceptor(loggingInterceptor).addInterceptor(gzipRequestInterceptor); Factory converterFactory = null; switch (responseFormat) { case MSGPACK: client.addInterceptor(chain -> { Request request = chain.request().newBuilder().addHeader("Accept", APPLICATION_MSGPACK) .addHeader("Accept-Encoding", "identity").build(); return chain.proceed(request); }); converterFactory = MessagePackConverterFactory.create(); chunkProccesor = new MessagePackChunkProccesor(); break; case JSON: default: converterFactory = MoshiConverterFactory.create(); Moshi moshi = new Moshi.Builder().build(); JsonAdapter<QueryResult> adapter = moshi.adapter(QueryResult.class); chunkProccesor = new JSONChunkProccesor(adapter); break; } this.retrofit = new Retrofit.Builder().baseUrl(url).client(client.build()).addConverterFactory(converterFactory) .build(); this.influxDBService = this.retrofit.create(InfluxDBService.class); }
Source:
private void handleYieldExpression(SubscriptionContext ctx, PyYieldExpressionTree yieldExpr) { if (yieldExpr.fromKeyword() == null && yieldExpr.expressions().size() == 1) { yieldExpr.expressions().forEach(e -> checkExpr(e, ctx, "yield")); } }

Target:
private static void handleYieldExpression(SubscriptionContext ctx, PyYieldExpressionTree yieldExpr) { if (yieldExpr.fromKeyword() == null && yieldExpr.expressions().size() == 1) { yieldExpr.expressions().forEach(e -> checkExpr(e, ctx, "yield")); } }
Source:
private MyModel[] createModel() { MyModel[] elements = new MyModel[10]; for (int i = 0; i < elements.length; i++) { elements[i] = new MyModel(i); } return elements; }

Target:
private List<MyModel> createModel() { List<MyModel> elements = new ArrayList<MyModel>(); for (int i = 0; i < 10; i++) { elements.add(new MyModel(i)); } return elements; }
Source:
public int hashCode() { int hash = 7; hash = hash * 31 + (name != null ? name.hashCode() : 0); hash = hash * 31 + (type != null ? type.hashCode() : 0); hash = hash * 31 + (toCommandLine() != null ? toCommandLine().hashCode() : 0); return hash; }

Target:
public int hashCode() { return Objects.hash(getName(), getType().getId(), toCommandLine()); }
Source:
public synchronized void startup() throws DatastreamException { if (_jmxReporter != null) { _jmxReporter.start(); } if (_coordinator != null) { _coordinator.start(); } try { _jettyLauncher.start(); _httpPort = _jettyLauncher.getPort(); _isStarted = true; } catch (IOException ex) { String errorMessage = "Failed to start netty."; ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, ex); } catch (Exception e) { e.printStackTrace(); } }

Target:
public synchronized void startup() throws DatastreamException { if (_jmxReporter != null) { _jmxReporter.start(); } if (_coordinator != null) { _coordinator.start(); } try { _jettyLauncher.start(); _httpPort = _jettyLauncher.getPort(); _isStarted = true; } catch (Exception ex) { String errorMessage = "Failed to start netty."; ErrorLogger.logAndThrowDatastreamRuntimeException(LOG, errorMessage, ex); } }
Source:
private TreeMap<String, String> mapGiverNameToGiverEmail(String courseId, Set<String> giverEmails) { TreeMap<String, String> giverEmailToGiverNameMap = new TreeMap<String, String>(); giverEmailToGiverNameMap.put(InstructorStudentRecordsPageData.COMMENT_GIVER_NAME_THAT_COMES_FIRST, Const.DISPLAYED_NAME_FOR_SELF_IN_COMMENTS); giverEmailToGiverNameMap.put("Anonymous", "Anonymous"); for (String giverEmail : giverEmails) { if (!giverEmailToGiverNameMap.containsKey(giverEmail)) { InstructorAttributes giverInstructor = logic.getInstructorForEmail(courseId, giverEmail); Assumption.assertNotNull(giverInstructor); giverEmailToGiverNameMap.put(giverEmail, giverInstructor.displayedName + " " + giverInstructor.name); } } return giverEmailToGiverNameMap; }

Target:
private Map<String, String> mapGiverNameToGiverEmail(String courseId, Set<String> giverEmails) { Map<String, String> giverEmailToGiverNameMap = new HashMap<String, String>(); giverEmailToGiverNameMap.put(InstructorStudentRecordsPageData.COMMENT_GIVER_NAME_THAT_COMES_FIRST, Const.DISPLAYED_NAME_FOR_SELF_IN_COMMENTS); giverEmailToGiverNameMap.put(Const.DISPLAYED_NAME_FOR_ANONYMOUS_COMMENT_PARTICIPANT, Const.DISPLAYED_NAME_FOR_ANONYMOUS_COMMENT_PARTICIPANT); for (String giverEmail : giverEmails) { if (!giverEmailToGiverNameMap.containsKey(giverEmail)) { InstructorAttributes giverInstructor = logic.getInstructorForEmail(courseId, giverEmail); Assumption.assertNotNull(giverInstructor); giverEmailToGiverNameMap.put(giverEmail, giverInstructor.displayedName + " " + giverInstructor.name); } } return giverEmailToGiverNameMap; }
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final ProgressLogger progress = new ProgressLogger(log, 50000000, "Processed", "read pairs"); final SamReader reader = SamReaderFactory.makeDefault().open(INPUT); final PeekableIterator<SAMRecord> iterator = new PeekableIterator<>(reader.iterator()); final IntermediateMetrics usableMetrics = new IntermediateMetrics(); usableMetrics.metrics.TYPE = FILTERING_STRINGENCY.USABLE; final IntermediateMetrics rawMetrics = new IntermediateMetrics(); rawMetrics.metrics.TYPE = FILTERING_STRINGENCY.RAW; QuerySortedReadPairIteratorUtil.ReadPair pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); while (pairToAnalyze != null) { calculateMetricsForRead(pairToAnalyze, usableMetrics, MINIMUM_USABLE_MAPPING_QUALITY, MINIMUM_USABLE_BASE_QUALITY); calculateMetricsForRead(pairToAnalyze, rawMetrics, MINIMUM_RAW_MAPPING_QUALITY, MINIMUM_RAW_BASE_QUALITY); progress.record(pairToAnalyze.read1); pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); } final long genomeTerritory = (GENOME_TERRITORY == null) ? reader.getFileHeader().getSequenceDictionary().getReferenceLength() : GENOME_TERRITORY; usableMetrics.metrics.GENOME_TERRITORY = genomeTerritory; finalizeMetrics(usableMetrics); rawMetrics.metrics.GENOME_TERRITORY = genomeTerritory; finalizeMetrics(rawMetrics); final MetricsFile<QuerySortedSeqMetrics, Integer> out = getMetricsFile(); out.addMetric(usableMetrics.metrics); out.addMetric(rawMetrics.metrics); out.write(OUTPUT); return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); final ProgressLogger progress = new ProgressLogger(log, 50000000, "Processed", "read pairs"); final SamReader reader = SamReaderFactory.makeDefault().open(INPUT); final PeekableIterator<SAMRecord> iterator = new PeekableIterator<>(reader.iterator()); final IntermediateMetrics usableMetrics = new IntermediateMetrics(); usableMetrics.metrics.TYPE = FILTERING_STRINGENCY.USABLE; final IntermediateMetrics rawMetrics = new IntermediateMetrics(); rawMetrics.metrics.TYPE = FILTERING_STRINGENCY.RAW; QuerySortedReadPairIteratorUtil.ReadPair pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); while (pairToAnalyze != null) { calculateMetricsForRead(pairToAnalyze, usableMetrics, MINIMUM_USABLE_MAPPING_QUALITY, MINIMUM_USABLE_BASE_QUALITY); calculateMetricsForRead(pairToAnalyze, rawMetrics, MINIMUM_RAW_MAPPING_QUALITY, MINIMUM_RAW_BASE_QUALITY); progress.record(pairToAnalyze.read1); pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); } final long genomeTerritory = (GENOME_TERRITORY == null || GENOME_TERRITORY < 1L) ? reader.getFileHeader().getSequenceDictionary().getReferenceLength() : GENOME_TERRITORY; usableMetrics.metrics.GENOME_TERRITORY = genomeTerritory; finalizeMetrics(usableMetrics); rawMetrics.metrics.GENOME_TERRITORY = genomeTerritory; finalizeMetrics(rawMetrics); final MetricsFile<QuerySortedSeqMetrics, Integer> out = getMetricsFile(); out.addMetric(usableMetrics.metrics); out.addMetric(rawMetrics.metrics); out.write(OUTPUT); return 0; }
Source:
public void processAllMessages() throws MessageMonitoringDAOException { LOG.debug("Inside Message Monitoring API checkAndUpdateMessageStatus() method."); List<MonitoredMessage> failedMessages = getAllFailedMessages(); for (MonitoredMessage trackMessage : failedMessages) { sendFailedEdgeNotification(trackMessage); messageMonitoringCache.remove(trackMessage.getMessageid()); if (getDirectTestFlag(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DIRECTTESTING_FLAG)) { trackMessage.setStatus(STATUS_ARCHIVED); getMessageMonitoringDAO().updateOutgoingMessage(trackMessage); } else { deleteFromMessageMonitoringDB(trackMessage); } } List<MonitoredMessage> completedMessages = getAllCompletedMessages(); for (MonitoredMessage trackMessage : completedMessages) { sendSuccessEdgeNotification(trackMessage); messageMonitoringCache.remove(trackMessage.getMessageid()); if (getDirectTestFlag(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DIRECTTESTING_FLAG)) { trackMessage.setStatus(STATUS_ARCHIVED); getMessageMonitoringDAO().updateOutgoingMessage(trackMessage); } else { deleteFromMessageMonitoringDB(trackMessage); } } deleteElapsedArchivedMessage(); LOG.debug("Exiting Message Monitoring API checkAndUpdateMessageStatus() method."); }

Target:
public void processAllMessages() throws MessageMonitoringDAOException { LOG.debug("Inside Message Monitoring API checkAndUpdateMessageStatus() method."); List<MonitoredMessage> failedMessages = getAllFailedMessages(); for (MonitoredMessage trackMessage : failedMessages) { sendFailedEdgeNotification(trackMessage); messageMonitoringCache.remove(trackMessage.getMessageid()); if (getDirectTestFlag(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DIRECTTESTING_FLAG)) { deleteElapsedArchivedMessageList(); trackMessage.setStatus(STATUS_ARCHIVED); getMessageMonitoringDAO().updateOutgoingMessage(trackMessage); } else { deleteFromMessageMonitoringDB(trackMessage); } } List<MonitoredMessage> completedMessages = getAllCompletedMessages(); for (MonitoredMessage trackMessage : completedMessages) { sendSuccessEdgeNotification(trackMessage); messageMonitoringCache.remove(trackMessage.getMessageid()); if (getDirectTestFlag(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.DIRECTTESTING_FLAG)) { deleteElapsedArchivedMessageList(); trackMessage.setStatus(STATUS_ARCHIVED); getMessageMonitoringDAO().updateOutgoingMessage(trackMessage); } else { deleteFromMessageMonitoringDB(trackMessage); } } LOG.debug("Exiting Message Monitoring API checkAndUpdateMessageStatus() method."); }
Source:
protected void shutdownService() { scheduler.clearTasks(); selector.wakeup(); selector.wakeup(); try { if(selector != null && selector.isOpen()) { selector.close(); } } catch (Exception e) { } clients.clear(); servers.clear(); }

Target:
protected void shutdownService() { scheduler.clearTasks(); selector.wakeup(); selector.wakeup(); try { if(selector != null && selector.isOpen()) { selector.close(); } } catch (Exception e) { ExceptionUtils.handleException(e); } clients.clear(); servers.clear(); }
Source:
protected boolean isToSkip(FactMapping factMapping) { return OTHER.equals(factMapping.getExpressionIdentifier().getType()) || EMPTY.equals(factMapping.getFactIdentifier()) || factMapping.getExpressionElements().size() == 0; }

Target:
public static boolean isToSkip(FactMapping factMapping) { return OTHER.equals(factMapping.getExpressionIdentifier().getType()) || EMPTY.equals(factMapping.getFactIdentifier()) || factMapping.getExpressionElements().isEmpty(); }