auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) throws Exception { LOGGER.info("Assembling indexing topology"); Config config = new Config(); if (args.length <= 2) { String providedIndexingPropertiesFile = ""; String providedPropertyFile = ""; if (args.length == 1) providedPropertyFile = args[0]; else if (args.length == 2) { providedPropertyFile = args[0]; providedIndexingPropertiesFile = args[1]; } IndexingTopology indexingTopology = new IndexingTopology(TOPOLOGY_PROPERTIES_FILE, providedPropertyFile, INDEXING_PROPERTIES_FILE, providedIndexingPropertiesFile); String topologyName = topologyProperties.getProperty(TopologyPropertyKeys.TOPOLOGY_NAME); String kafkaTopic = topologyName; String ecloudMcsAddress = topologyProperties.getProperty(TopologyPropertyKeys.MCS_URL); StormTopology stormTopology = indexingTopology.buildTopology(kafkaTopic, ecloudMcsAddress); config.setNumWorkers(Integer.parseInt(topologyProperties.getProperty(TopologyPropertyKeys.WORKER_COUNT))); config.setMaxTaskParallelism( Integer.parseInt(topologyProperties.getProperty(TopologyPropertyKeys.MAX_TASK_PARALLELISM))); LOGGER.info("Submitting indexing topology"); StormSubmitter.submitTopology(topologyName, config, stormTopology); } }

Target:
public static void main(String[] args) { try { LOGGER.info("Assembling indexing topology"); Config config = new Config(); if (args.length <= 2) { String providedIndexingPropertiesFile = ""; String providedPropertyFile = ""; if (args.length == 1) providedPropertyFile = args[0]; else if (args.length == 2) { providedPropertyFile = args[0]; providedIndexingPropertiesFile = args[1]; } IndexingTopology indexingTopology = new IndexingTopology(TOPOLOGY_PROPERTIES_FILE, providedPropertyFile, INDEXING_PROPERTIES_FILE, providedIndexingPropertiesFile); String topologyName = topologyProperties.getProperty(TOPOLOGY_NAME); String ecloudMcsAddress = topologyProperties.getProperty(MCS_URL); StormTopology stormTopology = indexingTopology.buildTopology(topologyName, ecloudMcsAddress); config.setNumWorkers(getAnInt(WORKER_COUNT)); config.setMaxTaskParallelism(getAnInt(MAX_TASK_PARALLELISM)); LOGGER.info("Submitting indexing topology"); StormSubmitter.submitTopology(topologyName, config, stormTopology); } } catch (Exception e) { LOGGER.error(Throwables.getStackTraceAsString(e)); } }
Source:
public static void updateMaxMemorySize(VmBase vmBase, Version effectiveCompatibilityVersion) { final int maxOfMaxMemorySize = VmCommonUtils.maxMemorySizeWithHotplugInMb(vmBase.getOsId(), effectiveCompatibilityVersion); if (vmBase.getMaxMemorySizeMb() > maxOfMaxMemorySize) { vmBase.setMaxMemorySizeMb(maxOfMaxMemorySize); return; } if (vmBase.getMaxMemorySizeMb() == 0) { vmBase.setMaxMemorySizeMb(VmCommonUtils.getMaxMemorySizeDefault(vmBase.getMemSizeMb())); } }

Target:
public static void updateMaxMemorySize(VmBase vmBase, Version effectiveCompatibilityVersion) { final int maxOfMaxMemorySize = VmCommonUtils.maxMemorySizeWithHotplugInMb(vmBase.getOsId(), effectiveCompatibilityVersion); if (vmBase.getMaxMemorySizeMb() > maxOfMaxMemorySize) { vmBase.setMaxMemorySizeMb(maxOfMaxMemorySize); return; } if (vmBase.getMaxMemorySizeMb() == 0) { final int maxMemorySize = Math.min( VmCommonUtils.getMaxMemorySizeDefault(vmBase.getMemSizeMb()), maxOfMaxMemorySize); vmBase.setMaxMemorySizeMb(maxMemorySize); } }
Source:
private void writeGitPatchHeader(StringBuilder sb) { String template = headerFormat.getTemplate(); String[] segments = template.split("\\$\\{"); Stack<String> evaluated = new Stack<String>(); evaluated.add(segments[0]); for (int i = 1; i < segments.length; i++) { String segment = segments[i]; String value = null; int brace = segment.indexOf('}'); if (brace > 0) { String keyword = segment.substring(0, brace); keyword = keyword.toUpperCase(Locale.ROOT).replaceAll(" ", "_"); value = processKeyword(commit, DiffHeaderKeyword.valueOf(keyword)); } String trailingCharacters = segment.substring(brace + 1); if (value != null) { evaluated.add(value); evaluated.add(trailingCharacters); } else if (!evaluated.isEmpty()) evaluated.add(trailingCharacters); } StringBuilder buffer = new StringBuilder(); for (String string : evaluated) buffer.append(string); sb.append(buffer); }

Target:
private void writeGitPatchHeader(StringBuilder sb) { String template = headerFormat.getTemplate(); String[] segments = template.split("\\$\\{"); Stack<String> evaluated = new Stack<String>(); evaluated.add(segments[0]); for (int i = 1; i < segments.length; i++) { String segment = segments[i]; String value = null; int brace = segment.indexOf('}'); if (brace > 0) { String keyword = segment.substring(0, brace); keyword = keyword.toUpperCase(Locale.ROOT).replaceAll(" ", "_"); value = processKeyword(commit, DiffHeaderKeyword.valueOf(keyword)); } String trailingCharacters = segment.substring(brace + 1); if (value != null) { evaluated.add(value); evaluated.add(trailingCharacters); } else if (!evaluated.isEmpty()) evaluated.add(trailingCharacters); } for (String string : evaluated) { sb.append(string); } }
Source:
public void storeToken(TrackingToken token, String processorName, int segment) throws UnableToClaimTokenException { RedisTokenEntry redisTokenEntry = new RedisTokenEntry(token, serializer, processorName, segment); redisTokenEntry.claim(nodeId, claimTimeout); boolean storedWithClaim = redisTokenRepository.storeTokenEntry(redisTokenEntry, redisTokenEntry.timestamp().minus(claimTimeout)); if(!storedWithClaim) { throw new UnableToClaimTokenException("Unable to claim token."); } }

Target:
public void storeToken(TrackingToken token, String processorName, int segment) throws UnableToClaimTokenException { RedisTokenEntry redisTokenEntry = new RedisTokenEntry(token, serializer, processorName, segment); redisTokenEntry.claim(nodeId, claimTimeout); RedisTokenEntry redisTokenEntryResponse = redisTokenRepository.storeTokenEntry(redisTokenEntry, redisTokenEntry.timestamp().minus(claimTimeout)); if(redisTokenEntryResponse != null) { if(!nodeId.equals(redisTokenEntryResponse.getOwner())) { throw new UnableToClaimTokenException( format("Unable to claim token '%s[%s]'. It is owned by '%s'", processorName, segment, redisTokenEntryResponse.getOwner())); } } else { throw new UnableToClaimTokenException(format("Unable to claim token '%s[%s]'.", processorName, segment)); } }
Source:
public void addDownload(String download){ if(!downloads.contains(download)) { downloads.add(download); } }

Target:
public void addDownload(String download) { downloads.add(download); }
Source:
public FlowIdentifier backupDatabase(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); List<FlowLog> flowLogs = flowLogService.findAllByResourceIdAndFinalizedIsFalseOrderByCreatedDesc(stack.getId()); if (!CollectionUtils.isEmpty(flowLogs)) { String errorMsg = String.format("Database backup cannot be performed because there is an active flow running: %s", flowLogs.stream().map(FlowLog::toString)); eventService.fireCloudbreakEvent( stack.getId(), DATALAKE_DATABASE_BACKUP, ResourceEvent.DATALAKE_DATABASE_BACKUP_COULD_NOT_START, List.of(errorMsg)); throw new BadRequestException(errorMsg); } else { return flowManager.triggerDatalakeDatabaseBackup(stack.getId(), location, backupId); } }

Target:
public FlowIdentifier backupDatabase(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); LOGGER.info("Initiating database backup flow for stack {}", stack.getId()); return flowManager.triggerDatalakeDatabaseBackup(stack.getId(), location, backupId); }
Source:
public void testCollisionPolygon() { MockGame mockGame = new MockGame(); GameLoop gameLoop = mockGame.getGameLoop(); mockGame.act(); gameLoop.loadScene("collision"); mockGame.act(); SceneEngineObject scene = gameLoop.getGameView().getCurrentScene(); SceneElementEngineObject actor = (SceneElementEngineObject) scene.hit( 45, 45, true); assertTrue(actor.getSchema().getTags().contains("collisioned")); assertNotSame(actor, scene.hit(10, 80, true)); float xOffset = 100; actor = (SceneElementEngineObject) scene.hit(xOffset + 45, 45, true); assertTrue(actor.getSchema().getTags().contains("collisioned2")); assertEquals(actor, scene.hit(xOffset + 10, 80, true)); }

Target:
public void testCollisionPolygon() { MockGame mockGame = new MockGame(); GameLoop gameLoop = mockGame.getGameLoop(); mockGame.act(); gameLoop.loadScene("collision"); mockGame.act(); SceneEngineObject scene = gameLoop.getGameView().getCurrentScene(); SceneElementEngineObject actor = (SceneElementEngineObject) scene.hit( 45, 45, true); assertTrue(actor.getSchema().getTags().contains("collisioned")); assertNotSame(actor, scene.hit(10, 80, true)); assertNull(scene.hit(10, 80, true)); float xOffset = 100; actor = (SceneElementEngineObject) scene.hit(xOffset + 45, 45, true); assertTrue(actor.getSchema().getTags().contains("collisioned2")); assertEquals(actor, scene.hit(xOffset + 10, 80, true)); }
Source:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); AbstractEvent priorityEvent = parsePriorityEvent(buffer); if (priorityEvent != null) { receivedBuffers.addPriorityElement(buffer); final int pos = receivedBuffers.getNumPriorityElements(); if (priorityEvent instanceof CheckpointBarrier) { final long barrierId = ((CheckpointBarrier) priorityEvent).getId(); if (!pendingCheckpointBarriers.remove(barrierId)) { numBuffersOvertaken.put(barrierId, receivedBuffers.size() - pos); } } firstPriorityEvent = pos == 1; } else { receivedBuffers.add(buffer); if (buffer.isBuffer()) { for (final long checkpointId : pendingCheckpointBarriers) { channelStateWriter.addInputData( checkpointId, channelInfo, sequenceNumber, CloseableIterator.ofElement(buffer.retainBuffer(), Buffer::recycleBuffer)); } } } } recycleBuffer = false; ++expectedSequenceNumber; if (firstPriorityEvent) { notifyPriorityEvent(); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }

Target:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); if (buffer.getDataType().hasPriority()) { receivedBuffers.addPriorityElement(new SequenceBuffer(buffer, sequenceNumber)); if (channelStatePersister.checkForBarrier(buffer)) { numBuffersOvertaken = receivedBuffers.getNumUnprioritizedElements(); } firstPriorityEvent = receivedBuffers.getNumPriorityElements() == 1; } else { receivedBuffers.add(new SequenceBuffer(buffer, sequenceNumber)); channelStatePersister.maybePersist(buffer); } ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }
Source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); CommandStack commandStack = domain.getCommandStack(); GlobalContext globalContext = new GlobalContext(session.getModelAccessor(), session.getInterpreter(), session.getSemanticResources()); if (expand) { monitor.beginTask("Tree item expandion", 1); CompoundCommand expandDTreeItemCmd = new CompoundCommand("Expand " + dTreeItem.getName() + " tree item"); expandDTreeItemCmd.append(new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, true)); if (!Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false, null)) { SiriusCommand result = new SiriusCommand(domain); result.getTasks().add(new RefreshTreeElementTask(dTreeItem)); expandDTreeItemCmd.append(result); } commandStack.execute(expandDTreeItemCmd); } else { monitor.beginTask("Tree item collabsing", 1); Command collapseDTreeItemCmd = new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, false); commandStack.execute(collapseDTreeItemCmd); } } finally { monitor.done(); } }

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); CommandStack commandStack = domain.getCommandStack(); GlobalContext globalContext = new GlobalContext(session.getModelAccessor(), session.getInterpreter(), session.getSemanticResources()); if (expand) { monitor.beginTask("Tree item expanding", 1); CompoundCommand expandDTreeItemCmd = new CompoundCommand("Expand " + dTreeItem.getName() + " tree item"); expandDTreeItemCmd.append(new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, true)); if (!Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false, null)) { SiriusCommand result = new SiriusCommand(domain); result.getTasks().add(new RefreshTreeElementTask(dTreeItem)); expandDTreeItemCmd.append(result); } commandStack.execute(expandDTreeItemCmd); } else { monitor.beginTask("Tree item collapsing", 1); Command collapseDTreeItemCmd = new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, false); commandStack.execute(collapseDTreeItemCmd); } } finally { monitor.done(); } }
Source:
public String createSocketBinding() { String name = "UndertowSocketBinding_" + RandomStringUtils.randomAlphanumeric(6); try (OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient()) { client.apply(new AddSocketBinding.Builder(name) .port(ThreadLocalRandom.current().nextInt(1000, 9999)) .build()); } catch (CommandFailedException e) { e.getStackTrace(); } catch (IOException e) { e.printStackTrace(); } return name; }

Target:
public String createSocketBinding() throws CommandFailedException, IOException { String name = "UndertowSocketBinding_" + RandomStringUtils.randomAlphanumeric(6); try (OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient()) { client.apply(new AddSocketBinding.Builder(name) .port(ThreadLocalRandom.current().nextInt(10000, 19999)) .build()); } return name; }
Source:
public final int hashCode() { return HASH_CODE; }

Target:
public final int hashCode() { int hashCode = 0; hashCode = PRIME * linesFromCursor + hashCode; hashCode = PRIME * resultSize + hashCode; hashCode = PRIME * topCount + hashCode; return hashCode; }
Source:
public static String getSocketConnectString(InetSocketAddress socketAddress) { String host; InetAddress address = socketAddress.getAddress(); if (address.isAnyLocalAddress() || address.isLoopbackAddress()) { host = address.getCanonicalHostName(); } else { host = address.getHostName(); } return host + ":" + socketAddress.getPort(); }

Target:
public static String getSocketConnectString(InetSocketAddress socketAddress) { String host; InetAddress address = socketAddress.getAddress(); if (address == null) { host = socketAddress.getHostString(); } else if (address.isAnyLocalAddress() || address.isLoopbackAddress()) { host = address.getCanonicalHostName(); } else { host = address.getHostName(); } return host + ":" + socketAddress.getPort(); }
Source:
public ResultSet<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); ResultSet<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source); for (PatchSetApproval a : patchSetApprovals) { if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals; }

Target:
public List<PatchSetApproval> copyVetosToLatestPatchSet(Change change) throws OrmException, IOException { PatchSet.Id source; if (change.getNumberOfPatchSets() > 1) { source = new PatchSet.Id(change.getId(), change.getNumberOfPatchSets() - 1); } else { throw new IOException("Previous patch set could not be found"); } PatchSet.Id dest = change.currPatchSetId(); ResultSet<PatchSetApproval> patchSetApprovals = db.patchSetApprovals().byPatchSet(source); for (PatchSetApproval a : patchSetApprovals) { if (!ApprovalCategory.SUBMIT.equals(a.getCategoryId())) { final ApprovalType type = approvalTypes.byId(a.getCategoryId()); if (type.getCategory().isCopyMinScore() && type.isMaxNegative(a)) { db.patchSetApprovals().insert( Collections.singleton(new PatchSetApproval(dest, a))); } } } return patchSetApprovals.toList(); }
Source:
public boolean couldMatch(ScriptPath path) { return (path.eventLower.startsWith("mythicmob") && (path.eventArgLowerAt(2).equals("spawns"))); }

Target:
public boolean couldMatch(ScriptPath path) { if (!path.eventLower.startsWith("mythicmob")) { return false; } if (!path.eventArgLowerAt(2).equals("spawns")) { return false; } return true; }
Source:
private void assertAllInstructorSessionsMatch(FeedbackSessionsData sessionsData, List<FeedbackSessionAttributes> expectedSessions) { for (FeedbackSessionData sessionData : sessionsData.getFeedbackSessions()) { List<FeedbackSessionAttributes> matchedSessions = expectedSessions.stream().filter(session -> session.getFeedbackSessionName().equals( sessionData.getFeedbackSessionName()) && session.getCourseId().equals(sessionData.getCourseId())).collect(Collectors.toList()); assertEquals(1, matchedSessions.size()); assertAllInformationMatch(sessionData, matchedSessions.get(0)); } }

Target:
private void assertAllInstructorSessionsMatch(FeedbackSessionsData sessionsData, List<FeedbackSessionAttributes> expectedSessions) { assertEquals(sessionsData.getFeedbackSessions().size(), expectedSessions.size()); for (FeedbackSessionData sessionData : sessionsData.getFeedbackSessions()) { List<FeedbackSessionAttributes> matchedSessions = expectedSessions.stream().filter(session -> session.getFeedbackSessionName().equals( sessionData.getFeedbackSessionName()) && session.getCourseId().equals(sessionData.getCourseId())).collect(Collectors.toList()); assertEquals(1, matchedSessions.size()); assertAllInformationMatch(sessionData, matchedSessions.get(0)); } }
Source:
public void deserializeColumn(final ByteBuffer buffer, final ColumnBuilder builder) { final GenericIndexed<DoublesSketch> column = GenericIndexed.read(buffer, strategy); builder.setComplexColumn(new ComplexColumnPartSupplier(getTypeName(), column)); }

Target:
public void deserializeColumn(final ByteBuffer buffer, final ColumnBuilder builder) { final GenericIndexed<DoublesSketch> column = GenericIndexed.read(buffer, strategy, builder.getFileMapper()); builder.setComplexColumn(new ComplexColumnPartSupplier(getTypeName(), column)); }
Source:
private LoginContext createLoginContext(final String loginConfig, final Subject subject, final CallbackHandler handler) throws RealmUnavailableException { if (WildFlySecurityManager.isChecking()) { try { return AccessController.doPrivileged(new CreateLoginContextAction(loginConfig, subject, handler)); } catch (PrivilegedActionException pae) { throw ElytronMessages.log.failedToCreateLoginContext(pae.getCause()); } } else { try { return new LoginContext(loginConfig, subject, handler); } catch (LoginException le) { throw ElytronMessages.log.failedToCreateLoginContext(le); } } }

Target:
private LoginContext createLoginContext(final String loginConfig, final Subject subject, final CallbackHandler handler) throws RealmUnavailableException { if (WildFlySecurityManager.isChecking()) { try { return AccessController.doPrivileged((PrivilegedExceptionAction<LoginContext>) () -> new LoginContext(loginConfig, subject, handler)); } catch (PrivilegedActionException pae) { throw ElytronMessages.log.failedToCreateLoginContext(pae.getCause()); } } else { try { return new LoginContext(loginConfig, subject, handler); } catch (LoginException le) { throw ElytronMessages.log.failedToCreateLoginContext(le); } } }
Source:
public int run(TestScenario testScenario) { if (testScenario.getEnvironment().getDockerCompose() != null && testScenario.getEnvironment().getImage() != null) { throw new IllegalArgumentException("Ambiguous environment: defined docker image and docker-compose"); } System.out.println("Starting test scenario: " + testScenario); int successfulTestCases = 0; for (TestCase test: testScenario.getTests()) { if (test.isSkip()) { continue; } TestEnvironmentExecutor testEnvironmentExecutor = testEnvironmentExecutor(testScenario); try { runTestCase(testScenario, test, testEnvironmentExecutor); successfulTestCases++; } catch (TestFailException ex) { System.out.println("Test case failed: " + ex.toString()); System.out.println(ex.getMessage()); ex.printStackTrace(); } testEnvironmentExecutor.close(); } return successfulTestCases; }

Target:
public int run(TestScenario testScenario) { if (testScenario.getEnvironment().getDockerCompose() != null && testScenario.getEnvironment().getImage() != null) { throw new IllegalArgumentException("Ambiguous environment: defined docker image and docker-compose" + ", but we expect only one of them to be defined!"); } log.info(String.format("Starting test scenario: %s", testScenario)); int successfulTestCases = 0; for (TestCase test: testScenario.getTests()) { if (test.isSkip()) { continue; } TestEnvironmentExecutor testEnvironmentExecutor = createTestEnvironmentExecutor(testScenario); try { runTestCase(testScenario, test, testEnvironmentExecutor); successfulTestCases++; } catch (TestFailException ex) { log.severe(String.format("Test case failed: %s\n%s", ex.toString(), ex.getMessage())); ex.printStackTrace(); } testEnvironmentExecutor.close(); } return successfulTestCases; }
Source:
protected boolean clearLastAddedTripPattern(String feedId) { return lastAddedTripPattern.keySet().removeAll(lastAddedTripPattern.keySet().stream() .filter(lastAddedTripPattern -> feedId.equals(lastAddedTripPattern.getFeedId())) .collect(Collectors.toSet())); }

Target:
protected boolean clearLastAddedTripPattern(String feedId) { return lastAddedTripPattern.keySet().removeIf(lastAddedTripPattern -> feedId.equals(lastAddedTripPattern.getFeedId())); }
Source:
public PdpFeedPayeeIdEntry buildPayeeIdEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedPayeeIdEntry payeeIdEntry = new PdpFeedPayeeIdEntry(); payeeIdEntry.setContent(line.getEmployeeId()); if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } return payeeIdEntry; }

Target:
public PdpFeedPayeeIdEntry buildPayeeIdEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedPayeeIdEntry payeeIdEntry = new PdpFeedPayeeIdEntry(); payeeIdEntry.setContent(line.getEmployeeId()); if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else { LOG.error("buildPayeeIdEntry, Unable to to set the payee ID type based do the line's employee status " + line.getEmployeeStatus()); } return payeeIdEntry; }
Source:
public List<EmpiLink> findEmpiLinksByTarget(Patient theTargetResource) { @Nullable Long pid = myIdHelperService.getPidOrNull(theTargetResource); if (pid == null) { return Collections.emptyList(); } EmpiLink empiLink = new EmpiLink().setTargetPid(pid); Example<EmpiLink> example = Example.of(empiLink); return myEmpiLinkDao.findAll(example); }

Target:
public List<EmpiLink> findEmpiLinksByTarget(Patient theTargetResource) { Long pid = myIdHelperService.getPidOrNull(theTargetResource); if (pid == null) { return Collections.emptyList(); } EmpiLink empiLink = new EmpiLink().setTargetPid(pid); Example<EmpiLink> example = Example.of(empiLink); return myEmpiLinkDao.findAll(example); }
Source:
protected void executeCommand() { boolean succeeded = true; final SetUpMountBrokerParameters parameters = getParameters(); final List<Callable<VDSReturnValue>> mountBrokerSetupReturnStatuses = new ArrayList<>(); for(final Guid currentRemoteServerId : getParameters().getRemoteServerIds()) { mountBrokerSetupReturnStatuses.add(new Callable<VDSReturnValue>() { @Override public VDSReturnValue call() throws Exception { return getCurrentMountBrokerSetUpCallable(currentRemoteServerId, parameters.getRemoteUserName(), parameters.getRemoteUserGroup(), parameters.getRemoteVolumeName(), parameters.isPartial()); } }); } List<VDSReturnValue> returnValues = ThreadPoolUtil.invokeAll(mountBrokerSetupReturnStatuses); List<String> errors = new ArrayList<String>(); for (VDSReturnValue currentReturnValue : returnValues) { if (!currentReturnValue.getSucceeded()) { succeeded = false; errors.add(getVdsDAO().get(currentReturnValue.getVdsError().getVdsId()).getName() + " " + currentReturnValue.getVdsError().getMessage()); } } if (!errors.isEmpty()) { propagateFailure(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, errors); } setSucceeded(succeeded); }

Target:
protected void executeCommand() { boolean succeeded = true; final SetUpMountBrokerParameters parameters = getParameters(); final List<Callable<VDSReturnValue>> mountBrokerSetupReturnStatuses = new ArrayList<>(); for (final Guid currentRemoteServerId : getParameters().getRemoteServerIds()) { mountBrokerSetupReturnStatuses.add(new Callable<VDSReturnValue>() { @Override public VDSReturnValue call() throws Exception { return setUpMountBrokerPartial(currentRemoteServerId, parameters.getRemoteUserName(), parameters.getRemoteUserGroup(), parameters.getRemoteVolumeName(), parameters.isPartial()); } }); } List<VDSReturnValue> returnValues = ThreadPoolUtil.invokeAll(mountBrokerSetupReturnStatuses); List<String> errors = new ArrayList<String>(); for (VDSReturnValue currentReturnValue : returnValues) { if (!currentReturnValue.getSucceeded()) { succeeded = false; errors.add(currentReturnValue.getVdsError().getMessage()); } } if (!errors.isEmpty()) { propagateFailure(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, errors); } setSucceeded(succeeded); }
Source:
public final void onOpen(final SocketSession iSession) { failedStarts = 0; started = true; reachedEof = false; connected = true; queing = false; this.session = iSession; LOG.info("Connection was succesful for: ", this.getClass().getSimpleName()); }

Target:
public final void onOpen(final SocketSession iSession) { failedStarts = 0; started = true; reachedEof = false; connected = true; queing = false; this.session = iSession; LOG.info("Connection was succesful for: {}", this.getClass().getSimpleName()); }
Source:
protected void keepBackwardCompatibility() { if (classifications == null) { classifications = new LinkedList<>(); } if (sortingMethod == null) { sortingMethod = SortingMethod.NATURAL.name(); } if (reportTitle == null) { reportTitle = ""; } if (StringUtils.isEmpty(directoryQualifier)) { directoryQualifier = CucumberReportPublisher.DEFAULT_DIRECTORY_QUALIFIER; } }

Target:
protected void keepBackwardCompatibility() { if (classifications == null) { classifications = new ArrayList<>(); } if (sortingMethod == null) { sortingMethod = SortingMethod.NATURAL.name(); } reportTitle = StringUtils.defaultString(reportTitle); }
Source:
public void initialise() { setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation()); ColumnLayout mainLayout = new ColumnLayout(); mainLayout.setHorizontalSpacing(8); mainLayout.setVerticalSpacing(8); Map<TelemetryCategory, Class> telemetryCategories = Maps.newHashMap(); DependencyResolver resolver = new DependencyResolver(moduleManager.getRegistry()); for (Name moduleId : moduleManager.getRegistry().getModuleIds()) { Module module = moduleManager.getRegistry().getLatestModuleVersion(moduleId); if (module.isCodeModule()) { ResolutionResult result = resolver.resolve(moduleId); if (result.isSuccess()) { try (ModuleEnvironment environment = moduleManager.loadEnvironment(result.getModules(), false)) { for (Class<?> holdingType : environment.getTypesAnnotatedWith(TelemetryCategory.class, new FromModule(environment, moduleId))) { TelemetryCategory telemetryCategory = holdingType.getAnnotation(TelemetryCategory.class); telemetryCategories.put(telemetryCategory, holdingType); } } } } } for (TelemetryCategory telemetryCategory: telemetryCategories.keySet()) { Class metricClass = telemetryCategories.get(telemetryCategory); Metric metricType = metric.getMap().get(metricClass); Map<String,Object> map = metricType.getMap(); addTelemetrySection(telemetryCategory,mainLayout,map); } ScrollableArea area = find("area", ScrollableArea.class); area.setContent(mainLayout); WidgetUtil.trySubscribe(this, "back", button -> triggerBackAnimation()); WidgetUtil.tryBindCheckbox(this, "enableTelemetry", BindHelper.bindBeanProperty("enableTelemetry", config.getTelemetryConfig(), Boolean.TYPE)); }

Target:
public void initialise() { setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation()); ColumnLayout mainLayout = new ColumnLayout(); mainLayout.setHorizontalSpacing(8); mainLayout.setVerticalSpacing(8); Map<TelemetryCategory, Class> telemetryCategories = fetchTelemetryCategoriesFromEnvironment(); for (Map.Entry<TelemetryCategory, Class> telemetryCategory: telemetryCategories.entrySet()) { Class metricClass = telemetryCategory.getValue(); Optional<Metric> optional = metrics.getMetric(metricClass); if (optional.isPresent()) { Metric metric = optional.get(); Map<String, Object> map = metric.getFieldValueMap(); addTelemetrySection(telemetryCategory.getKey(), mainLayout, map); } } ScrollableArea area = find("area", ScrollableArea.class); area.setContent(mainLayout); WidgetUtil.trySubscribe(this, "back", button -> triggerBackAnimation()); WidgetUtil.tryBindCheckBoxWithListener(this, "telemetryEnabled", BindHelper.bindBeanProperty("telemetryEnabled", config.getTelemetryConfig(), Boolean.TYPE),(checkbox) -> { if (config.getTelemetryConfig().isTelemetryEnabled()) { pushAddServerPopupAndStartEmitter(); } }); WidgetUtil.tryBindCheckBoxWithListener(this, "errorReportingEnabled", BindHelper.bindBeanProperty("errorReportingEnabled", config.getTelemetryConfig(), Boolean.TYPE), (checkbox) -> { if (config.getTelemetryConfig().isErrorReportingEnabled()) { pushAddServerPopupAndStartLogBackAppender(); } else { TelemetryLogstashAppender telemetryLogstashAppender = TelemetryUtils.fetchTelemetryLogstashAppender(); telemetryLogstashAppender.stop(); } }); }
Source:
private SIPDialog findSIPDialogFromInjectionListeners(String dialogId) { SIPDialog dialog = null; synchronized (dialogInjectionListeners) { for(SIPDialogInjectionListener listener : dialogInjectionListeners) { SIPDialog tempDialog = listener.getExternalSIPDialog(dialogId); if(tempDialog != null && tempDialog.getDialogId().equals(dialogId)) { dialog = tempDialog; break; } } } return dialog; }

Target:
private SIPDialog findSIPDialogFromInjectionListeners(String dialogId) { SIPDialog dialog = null; for(SIPDialogInjectionListener listener : dialogInjectionListeners) { SIPDialog tempDialog = listener.getExternalSIPDialog(dialogId); if(tempDialog != null && tempDialog.getDialogId().equals(dialogId)) { dialog = tempDialog; break; } } return dialog; }
Source:
public void run(TaskSource taskSource, Schema schema, FileInput input, PageOutput output) { PluginTask task = taskSource.loadTask(PluginTask.class); final boolean stopOnInvalidRecord = task.getStopOnInvalidRecord(); final Column column = schema.getColumn(0); try (PageBuilder pageBuilder = newPageBuilder(schema, output); FileInputInputStream in = new FileInputInputStream(input)) { while (in.nextFile()) { Exec.getLogger(JsonParserPlugin.class).info("Loading file [{}]", input.hintOfInputFileNameForLogging().orElse("-")); boolean evenOneJsonParsed = false; try (JsonParser.Stream stream = newJsonStream(in, task)) { Value value; while ((value = stream.next()) != null) { try { if (!value.isMapValue()) { throw new JsonRecordValidateException( String.format("A Json record must not represent map value but it's %s", value.getValueType().name())); } pageBuilder.setJson(column, value); pageBuilder.addRecord(); evenOneJsonParsed = true; } catch (JsonRecordValidateException e) { if (stopOnInvalidRecord) { throw new DataException(String.format("Invalid record: %s", value.toJson()), e); } log.warn(String.format("Skipped record (%s): %s", e.getMessage(), value.toJson())); } } } catch (IOException | JsonParseException e) { if (Exec.isPreview() && evenOneJsonParsed) { break; } throw new DataException(e); } } pageBuilder.finish(); } }

Target:
public void run(TaskSource taskSource, Schema schema, FileInput input, PageOutput output) { PluginTask task = taskSource.loadTask(PluginTask.class); final boolean stopOnInvalidRecord = task.getStopOnInvalidRecord(); final Column column = schema.getColumn(0); try (PageBuilder pageBuilder = newPageBuilder(schema, output); FileInputInputStream in = new FileInputInputStream(input)) { while (in.nextFile()) { final String fileName = input.hintOfCurrentInputFileNameForLogging().orElse("-"); boolean evenOneJsonParsed = false; try (JsonParser.Stream stream = newJsonStream(in, task)) { Value value; while ((value = stream.next()) != null) { try { if (!value.isMapValue()) { throw new JsonRecordValidateException( String.format("A Json record must not represent map value but it's %s", value.getValueType().name())); } pageBuilder.setJson(column, value); pageBuilder.addRecord(); evenOneJsonParsed = true; } catch (JsonRecordValidateException e) { if (stopOnInvalidRecord) { throw new DataException(String.format("Invalid record in %s: %s", fileName, value.toJson()), e); } log.warn(String.format("Skipped record in %s (%s): %s", fileName, e.getMessage(), value.toJson())); } } } catch (IOException | JsonParseException e) { if (Exec.isPreview() && evenOneJsonParsed) { break; } throw new DataException(String.format("Failed to parse JSON: %s", fileName), e); } } pageBuilder.finish(); } }
Source:
public void verifyOperationClientSecretBasic() { val request = new MockHttpServletRequest(); val response = new MockHttpServletResponse(); request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertTrue(this.validator.validate(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); assertFalse(this.validator.supports(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); request.removeHeader("Authorization"); request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.NON_SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertFalse(this.validator.validate(new JEEContext(request, response))); }

Target:
public void verifyOperationClientSecretBasic() { val request = new MockHttpServletRequest(); val response = new MockHttpServletResponse(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertTrue(this.validator.validate(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); assertFalse(this.validator.supports(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.NON_SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertFalse(this.validator.validate(new JEEContext(request, response))); }
Source:
public Result addOrUpdate() { final Alert alert; final Organization organization = _organizationProvider.getOrganization(request()); try { final JsonNode jsonBody = request().body().asJson(); if (jsonBody == null) { return badRequest("empty request body."); } final models.view.Alert viewAlert = OBJECT_MAPPER.treeToValue(jsonBody, models.view.Alert.class); alert = viewAlert.toInternal(organization, OBJECT_MAPPER); } catch (final IOException | ConstraintsViolatedException e) { LOGGER.error() .setMessage("Failed to build an alert.") .setThrowable(e) .log(); return badRequest("Invalid request body."); } try { _alertRepository.addOrUpdateAlert(alert, _organizationProvider.getOrganization(request())); } catch (final Exception e) { LOGGER.error() .setMessage("Failed to add an alert.") .setThrowable(e) .log(); return internalServerError(); } return noContent(); }

Target:
public Result addOrUpdate() { final Alert alert; final Organization organization = _organizationProvider.getOrganization(request()); try { final JsonNode jsonBody = request().body().asJson(); if (jsonBody == null) { return badRequest("empty request body."); } final models.view.Alert viewAlert = OBJECT_MAPPER.treeToValue(jsonBody, models.view.Alert.class); alert = viewAlert.toInternal(organization, OBJECT_MAPPER); } catch (final IOException | ConstraintsViolatedException e) { LOGGER.error() .setMessage("Failed to build an alert.") .setThrowable(e) .log(); return badRequest("Invalid request body."); } try { _alertRepository.addOrUpdateAlert(alert, organization); } catch (final Exception e) { LOGGER.error() .setMessage("Failed to add an alert.") .setThrowable(e) .log(); return internalServerError(); } return noContent(); }
Source:
protected HashMap<ServerFormDetails, String> doInBackground(ArrayList<ServerFormDetails>... values) { HashMap<ServerFormDetails, String> results = new HashMap<>(); int index = 1; for (ServerFormDetails serverFormDetails : values[0]) { try { String currentFormNumber = String.valueOf(index); String totalForms = String.valueOf(values[0].size()); publishProgress(serverFormDetails.getFormName(), currentFormNumber, totalForms); formDownloader.downloadForm(serverFormDetails, count -> { String message = Collect.getInstance().getString(R.string.form_download_progress, serverFormDetails.getFormName(), String.valueOf(count), String.valueOf(serverFormDetails.getManifest().getMediaFiles().size()) ); publishProgress(message, currentFormNumber, totalForms); }, this::isCancelled); results.put(serverFormDetails, Collect.getInstance().getString(R.string.success)); } catch (FormDownloadException e) { results.put(serverFormDetails, Collect.getInstance().getString(R.string.failure)); } index++; } return results; }

Target:
protected Map<ServerFormDetails, String> doInBackground(ArrayList<ServerFormDetails>... values) { HashMap<ServerFormDetails, String> results = new HashMap<>(); int index = 1; for (ServerFormDetails serverFormDetails : values[0]) { try { String currentFormNumber = String.valueOf(index); String totalForms = String.valueOf(values[0].size()); publishProgress(serverFormDetails.getFormName(), currentFormNumber, totalForms); formDownloader.downloadForm(serverFormDetails, count -> { String message = Collect.getInstance().getString(R.string.form_download_progress, serverFormDetails.getFormName(), String.valueOf(count), String.valueOf(serverFormDetails.getManifest().getMediaFiles().size()) ); publishProgress(message, currentFormNumber, totalForms); }, this::isCancelled); results.put(serverFormDetails, Collect.getInstance().getString(R.string.success)); } catch (FormDownloadException e) { results.put(serverFormDetails, Collect.getInstance().getString(R.string.failure)); } catch (InterruptedException e) { return emptyMap(); } index++; } return results; }
Source:
ChromeCacheExtractor(Content dataSource, IngestJobContext context ) { moduleName = NbBundle.getMessage(ChromeCacheExtractor.class, "ChromeCacheExtractor.moduleName"); this.dataSource = dataSource; this.context = context; }

Target:
ChromeCacheExtractor(Content dataSource, IngestJobContext context ) { moduleName = Bundle.ChromeCacheExtractor_moduleName(); this.dataSource = dataSource; this.context = context; }
Source:
public Map<String, Integer> getNumberOpenedSocketsByUri() { Map<String, Integer> numberOpenedSocketByUri = new LinkedHashMap<>(); for (WebSocketDispatcher dispatcher : dispatchers) { for (Map.Entry<String, Integer> socketByUri : dispatcher.getNumberOpenedSockets().entrySet()) { if (!numberOpenedSocketByUri.containsKey(socketByUri.getKey())) { numberOpenedSocketByUri.put(socketByUri.getKey(), socketByUri.getValue()); } else { numberOpenedSocketByUri.put(socketByUri.getKey(), numberOpenedSocketByUri.get(socketByUri.getKey()) + socketByUri.getValue()); } } } return numberOpenedSocketByUri; }

Target:
public Map<String, Integer> getNumberOpenedSocketsByUri() { Map<String, Integer> numberOpenedSocketByUri = new LinkedHashMap<>(); synchronized (this) { for (WebSocketDispatcher dispatcher : dispatchers) { for (Map.Entry<String, Integer> socketByUri : dispatcher.getNumberOpenedSockets().entrySet()) { if (!numberOpenedSocketByUri.containsKey(socketByUri.getKey())) { numberOpenedSocketByUri.put(socketByUri.getKey(), socketByUri.getValue()); } else { numberOpenedSocketByUri.put(socketByUri.getKey(), numberOpenedSocketByUri.get(socketByUri.getKey()) + socketByUri.getValue()); } } } } return numberOpenedSocketByUri; }
Source:
public List<String> getUsages() { return Arrays.asList(new String[] { buildCommandUsage(SUBCMD_PLAY + " <sink> <filename> <volume>", "plays a sound file from the sounds folder through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_STREAM + " <sink> <url> <volume>", "streams the sound from the url through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_SOURCES, "lists the audio sources"), buildCommandUsage(SUBCMD_SINKS, "lists the audio sinks") }); }

Target:
public List<String> getUsages() { return Arrays.asList(new String[] { buildCommandUsage(SUBCMD_PLAY + " [<sink>] <filename>", "plays a sound file from the sounds folder through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_PLAY + " <sink> <filename> <volume>", "plays a sound file from the sounds folder through the specified audio sink(s) with the specified volume"), buildCommandUsage(SUBCMD_STREAM + " [<sink>] <url>", "streams the sound from the url through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_SOURCES, "lists the audio sources"), buildCommandUsage(SUBCMD_SINKS, "lists the audio sinks") }); }
Source:
private void unindent() { indent--; }

Target:
private void unindent() { indent--; checkState(indent >= 0, "indentation level below zero"); }
Source:
private ClientResponse makeRemoteCallWithFollowRedirect(Action action, String serviceUrl) throws Throwable { URI targetUrl = new URI(serviceUrl); for(int followRedirectCount = 0; followRedirectCount < 10; followRedirectCount++) { ClientResponse clientResponse = makeRemoteCall(action, targetUrl.toString()); if(clientResponse.getStatus() < 300) { if(followRedirectCount > 0) { Matcher pathMatcher = REDIRECT_PATH_REGEX.matcher(targetUrl.getPath()); if(pathMatcher.matches()) { URI baseUri = UriBuilder.fromUri(targetUrl).replacePath(pathMatcher.group(1)).replaceQuery(null).build(); lastRedirect.set(baseUri.toString()); } else { logger.warn("Invalid redirect URL {}; ignoring it", targetUrl); } } return clientResponse; } targetUrl = clientResponse.getLocation(); } String message = "Follow redirect limit crossed for URI " + serviceUrl; logger.warn(message); throw new IOException(message); }

Target:
private ClientResponse makeRemoteCallWithFollowRedirect(Action action, String serviceUrl) throws Throwable { URI targetUrl = new URI(serviceUrl); for (int followRedirectCount = 0; followRedirectCount < MAX_FOLLOWED_REDIRECTS; followRedirectCount++) { ClientResponse clientResponse = makeRemoteCall(action, targetUrl.toString()); if (clientResponse.getStatus() != 302) { if (followRedirectCount > 0) { if(isQueryAction(action)) { lastQueryRedirect.set(targetUrl.toString()); } else { lastRegisterRedirect.set(targetUrl.toString()); } } return clientResponse; } targetUrl = getRedirectBaseUri(clientResponse.getLocation()); if (targetUrl == null) { throw new IOException("Invalid redirect URL " + clientResponse.getLocation()); } } String message = "Follow redirect limit crossed for URI " + serviceUrl; logger.warn(message); throw new IOException(message); }
Source:
public void testGetCommandLineNonNullModSeq() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ 1\r\n", "Expected result mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }

Target:
public void testGetCommandLineNonNullModSeq() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ 1\r\n", "getCommandLine() mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }
Source:
public static void wipeCacheForCurrentApp() { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); userDb.beginTransaction(); try { userDb.delete(TABLE_NAME, COL_APP_ID + " = ?", new String[]{ReportingUtils.getAppId()}); String uuid = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); setEntityCacheWipedPref(uuid, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); userDb.setTransactionSuccessful(); } finally { userDb.endTransaction(); } }

Target:
public static void wipeCacheForCurrentApp() { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); userDb.beginTransaction(); try { userDb.delete(TABLE_NAME, COL_APP_ID + " = ?", new String[]{AppUtils.getCurrentAppId()}); String uuid = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); setEntityCacheWipedPref(uuid, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); userDb.setTransactionSuccessful(); } finally { userDb.endTransaction(); } }