auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void dispose() { super.dispose(); }

Target:
public void dispose() { super.dispose(); shapeRenderer.dispose(); }
Source:
void migrateWorkspaces() { LOGGER.trace("Beginning workspace query data migration"); Filter workspaceFilter = filterBuilder.allOf( filterBuilder.attribute(Core.METACARD_TAGS).like().text(WORKSPACE_TAG), filterBuilder.attribute(WORKSPACE_QUERIES).is().like().text("*")); Query query = new QueryImpl(workspaceFilter); QueryRequest queryRequest = new QueryRequestImpl(query); ResultIterable.resultIterable(catalogFramework::query, queryRequest) .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .forEach(this::migrateWorkspaceMetacard); LOGGER.trace("Completed workspace query data migration"); }

Target:
private void migrateWorkspaces() { LOGGER.trace("Beginning workspace query data migration"); Filter workspaceFilter = filterBuilder.allOf( filterBuilder.attribute(Core.METACARD_TAGS).like().text(WORKSPACE_TAG), filterBuilder.attribute(WORKSPACE_QUERIES).is().like().text("*")); Query query = new QueryImpl(workspaceFilter); QueryRequest queryRequest = new QueryRequestImpl(query); ResultIterable.resultIterable(catalogFramework::query, queryRequest) .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .forEach(this::migrateWorkspaceMetacard); LOGGER.trace("Completed workspace query data migration"); }
Source:
static Set<String> getDisabledTests(Path testMappingsRootPath, String testGroup) { Set<String> disabledTests = new HashSet<>(); if (testGroup.equals(PRESUBMIT)) { File disabledPresubmitTestsFile = new File(testMappingsRootPath.toString(), DISABLED_PRESUBMIT_TESTS); try { disabledTests.addAll( Arrays.asList( FileUtil.readStringFromFile(disabledPresubmitTestsFile) .split("\\r?\\n"))); } catch (IOException e) { RuntimeException runtimeException = new RuntimeException( String.format( "IO error (%s) when reading disabled tests from file (%s)", e.getMessage(), disabledPresubmitTestsFile.getAbsolutePath()), e); throw runtimeException; } } return disabledTests; }

Target:
static Set<String> getDisabledTests(Path testMappingsRootPath, String testGroup) { Set<String> disabledTests = new HashSet<>(); if (!testGroup.equals(PRESUBMIT)) { return disabledTests; } File disabledPresubmitTestsFile = new File(testMappingsRootPath.toString(), DISABLED_PRESUBMIT_TESTS); try { disabledTests.addAll( Arrays.asList( FileUtil.readStringFromFile(disabledPresubmitTestsFile) .split("\\r?\\n"))); } catch (IOException e) { RuntimeException runtimeException = new RuntimeException( String.format( "IO error (%s) when reading disabled tests from file (%s)", e.getMessage(), disabledPresubmitTestsFile.getAbsolutePath()), e); throw runtimeException; } return disabledTests; }
Source:
public ZNRecord computePartitionAssignment(final List<String> allNodes, final List<String> liveNodes, final Map<String, Map<String, String>> currentMapping, ResourceControllerDataProvider clusterData) { Topology allNodeTopology = new Topology(allNodes, allNodes, clusterData.getInstanceConfigMap(), clusterData.getClusterConfig()); List<String> allNodesWithSpaces = allNodeTopology.getAllNodesWithAvailableSpaces(); return computeBestPartitionAssignment(allNodesWithSpaces, liveNodes, currentMapping, clusterData); }

Target:
public ZNRecord computePartitionAssignment(final List<String> allNodes, final List<String> liveNodes, final Map<String, Map<String, String>> currentMapping, ResourceControllerDataProvider clusterData) { Map<String, InstanceConfig> instanceConfigMap = clusterData.getInstanceConfigMap(); if (instanceConfigMap == null || !instanceConfigMap.keySet().containsAll(allNodes)) { throw new HelixException(String.format("Config for instances %s is not found!", allNodes.removeAll(instanceConfigMap.keySet()))); } return computeBestPartitionAssignment(getNonZeroWeightNodes(allNodes, instanceConfigMap), liveNodes, currentMapping, clusterData); }
Source:
public void testTimerStreamCallingWithNullHandlerCancelsTheTimer() throws Exception { ReadStream<Long> timer = vertx.timerStream(10); AtomicInteger count = new AtomicInteger(); timer.handler(l -> { if (count.incrementAndGet() == 1) { timer.handler(null); vertx.setTimer(200, id -> { assertEquals(1, count.get()); testComplete(); }); } else { fail(); } }); await(); }

Target:
public void testTimerStreamCallingWithNullHandlerCancelsTheTimer() throws Exception { vertx.runOnContext(v -> { ReadStream<Long> timer = vertx.timerStream(200); AtomicInteger count = new AtomicInteger(); timer.handler(l -> { if (count.incrementAndGet() == 1) { timer.handler(null); vertx.setTimer(200, id -> { assertEquals(1, count.get()); testComplete(); }); } else { fail(); } }); }); await(); }
Source:
public String readLine() throws IOException { String output = new String(outStream.toByteArray(), StandardCharsets.UTF_8); processLine(index, output); String ret = args[index++]; outStream.reset(); return ret; }

Target:
public String readLine() throws IOException { String output = new String(outStream.toByteArray(), StandardCharsets.UTF_8); processLine(stepIndex, output); String ret = steps[stepIndex++]; outStream.reset(); return ret; }
Source:
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(Constants.ENG_GUI_TEXTURES); int k = (width - xSize) / 2; int l = (height - ySize) / 2; GL11.glEnable(3042); drawTexturedModalRect(k, l, 0, 0, xSize, ySize); IItemHandler itemHandler = tileEntity.getCapability(ITEM_HANDLER_CAPABILITY, null); assert itemHandler != null; Item engineeringItem = itemHandler.getStackInSlot(0).getItem(); if (engineeringItem instanceof Engineerable) { Engineerable item = (Engineerable) engineeringItem; item.drawBackground(this, 0, k + 52, l + 8); int i = 0; for (Pair<Integer, Integer> pair : item.engineerCoordinates()) { int x = pair.getLeft(); int y = pair.getRight(); item.drawSlot(this, i, k + x + 52, l + y + 8); i++; } } }

Target:
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(Constants.ENG_GUI_TEXTURES); int k = (width - xSize) / 2; int l = (height - ySize) / 2; GL11.glEnable(3042); drawTexturedModalRect(k, l, 0, 0, xSize, ySize); IItemHandler itemHandler = tileEntity.getCapability(ITEM_HANDLER_CAPABILITY, null); if (itemHandler == null) { return; } Item engineeringItem = itemHandler.getStackInSlot(0).getItem(); if (engineeringItem instanceof Engineerable) { Engineerable item = (Engineerable) engineeringItem; item.drawBackground(this, 0, k + 52, l + 8); int i = 0; for (Pair<Integer, Integer> pair : item.engineerCoordinates()) { int x = pair.getLeft(); int y = pair.getRight(); item.drawSlot(this, i, k + x + 52, l + y + 8); i++; } } }
Source:
public void getConstraintEntryFromSimplePredicates() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>(); String fieldName = "FIELD_NAME"; List<SimplePredicate> simplePredicates = IntStream.range(0, 2) .mapToObj(index -> KiePMMLASTTestUtils.getSimplePredicate(fieldName, DataType.STRING, "VALUE-" + index, SimplePredicate.Operator.LESS_THAN, fieldTypeMap)).collect(Collectors.toList()); final KiePMMLFieldOperatorValue retrieved = KiePMMLASTFactoryUtils.getConstraintEntryFromSimplePredicates(fieldName, "or", simplePredicates, fieldTypeMap); assertEquals(fieldName, retrieved.getName()); assertNotNull(retrieved.getConstraintsAsString()); String expected = "value < \"VALUE-0\" or value < \"VALUE-1\""; assertEquals(expected, retrieved.getConstraintsAsString()); }

Target:
public void getConstraintEntryFromSimplePredicates() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>(); String fieldName = "FIELD_NAME"; List<SimplePredicate> simplePredicates = IntStream.range(0, 2) .mapToObj(index -> KiePMMLASTTestUtils .getSimplePredicate(fieldName, DataType.STRING, "VALUE-" + index, SimplePredicate.Operator.LESS_THAN, fieldTypeMap)).collect(Collectors.toList()); final KiePMMLFieldOperatorValue retrieved = KiePMMLASTFactoryUtils .getConstraintEntryFromSimplePredicates(fieldName, BOOLEAN_OPERATOR.OR, simplePredicates, fieldTypeMap); assertEquals(fieldName, retrieved.getName()); assertNotNull(retrieved.getConstraintsAsString()); String expected = "value < \"VALUE-0\" || value < \"VALUE-1\""; assertEquals(expected, retrieved.getConstraintsAsString()); }
Source:
public BigDecimal convert(Object value) throws TalendRuntimeException { if (value == null) { return returnDefaultValue(); } else { if (value instanceof BigDecimal) { BigDecimal castedValue = (BigDecimal) value; if (properties.containsKey(BigDecimalConverter.SCALE)) { if (properties.containsKey(BigDecimalConverter.ROUNDING_MODE)) { return castedValue.setScale(getScale(), getRoundingMode()); } else { return castedValue.setScale(getScale()); } } else { return castedValue; } } else { if (properties.containsKey(BigDecimalConverter.DECIMAL_FORMAT)){ Number convertedValue = null; try { convertedValue = getDecimalFormat().parse(value.toString()); } catch (ParseException e) { throw TalendRuntimeException.createUnexpectedException("Unable to parse " + value); } return new BigDecimal(convertedValue.toString()); } else if (properties.containsKey(BigDecimalConverter.PRECISION)) { if (properties.containsKey(BigDecimalConverter.ROUNDING_MODE)) { return convertValue(value, new MathContext(getPrecision(), getRoundingMode())); } else { return convertValue(value, new MathContext(getPrecision())); } } else { return convertValue(value); } } } }

Target:
public BigDecimal convert(Object value) { if (value == null) { return returnDefaultValue(); } else { if (value instanceof BigDecimal) { BigDecimal castedValue = (BigDecimal) value; if (properties.containsKey(BigDecimalConverter.SCALE)) { if (properties.containsKey(BigDecimalConverter.ROUNDING_MODE)) { return castedValue.setScale(getScale(), getRoundingMode()); } else { return castedValue.setScale(getScale()); } } else { return castedValue; } } else { if (properties.containsKey(BigDecimalConverter.DECIMAL_FORMAT)) { Number convertedValue = null; try { convertedValue = getDecimalFormat().parse(value.toString()); } catch (ParseException e) { throw TalendRuntimeException.createUnexpectedException("Unable to parse " + value); } return new BigDecimal(convertedValue.toString()); } else if (properties.containsKey(BigDecimalConverter.PRECISION)) { if (properties.containsKey(BigDecimalConverter.ROUNDING_MODE)) { return convertValue(value, new MathContext(getPrecision(), getRoundingMode())); } else { return convertValue(value, new MathContext(getPrecision())); } } else { return convertValue(value); } } } }
Source:
boolean updateGame(final ApiKey apiKey, final String gameId, final LobbyGame lobbyGame) { final GameId listedGameId = new GameId(apiKey, gameId); return Optional.ofNullable(games.getIfPresent(listedGameId)) .map( game -> { games.put(listedGameId, lobbyGame); return true; }) .orElse(false); }

Target:
boolean updateGame(final ApiKey apiKey, final String gameId, final LobbyGame lobbyGame) { final var listedGameId = new GameId(apiKey, gameId); final var existingValue = games.asMap().replace(listedGameId, lobbyGame); return existingValue != null; }
Source:
private boolean isMaintenanceOrDerivative(final String methodType) { return methodType.equals("DER") || methodType.equals("MAN"); }

Target:
private boolean isMaintenanceOrDerivative(final String methodType) { return methodType.equals(MethodType.DERIVATIVE.getCode()) || methodType.equals(MethodType.MAINTENANCE.getCode()); }
Source:
public void testValidRequest() throws Exception { String serviceId = setupTestService(); while(baragonServiceClient.getRequest(serviceId).get().getLoadBalancerState().equals(BaragonRequestState.WAITING)) { } if(baragonServiceClient.getRequest(serviceId).get().getLoadBalancerState().equals(BaragonRequestState.SUCCESS)) { testGetService(); testState(); testClusterBasePaths(); removeService(serviceId); } else { BaragonResponse resp = baragonServiceClient.getRequest(serviceId).get(); throw new Exception("Request did not succeed: " + resp.getMessage().get().toString() + "\nState: " + resp.getLoadBalancerState()); } }

Target:
public void testValidRequest() throws Exception { String serviceId = setupTestService(); waitForStatus(serviceId, BaragonRequestState.SUCCESS); testGetService(serviceId); testState(serviceId); testClusterBasePaths(serviceId); }
Source:
public SpeechSynthesis startMouth() { if (speechSynthesizer.getSpeechEngine() != null) { if (mouth == null) { mouth = (SpeechSynthesis) Runtime.loadAndStart(this.getIntanceName() + ".mouth", speechSynthesizer.getSpeechEngine()); } this.attach((Attachable) mouth); speakBlocking(languagePack.get("STARTINGMOUTH")); speakBlocking(languagePack.get("WHATISTHISLANGUAGE")); } else { speakAlert(languagePack.get("MYVOICETYPE")); } return mouth; }

Target:
public SpeechSynthesis startMouth() { if (mouth == null) { mouth = (SpeechSynthesis) startPeer("mouth"); } this.attach((Attachable) mouth); speakBlocking(languagePack.get("STARTINGMOUTH")); speakBlocking(languagePack.get("WHATISTHISLANGUAGE")); return mouth; }
Source:
public void setManagementContext(ManagementContextInternal val) { if (val == null && (val instanceof NonDeploymentManagementContext)) { System.out.println("fafe"); } this.initialManagementContext = checkNotNull(val, "initialManagementContext"); this.entityManager = new NonDeploymentEntityManager(val); this.locationManager = new NonDeploymentLocationManager(val); this.accessManager = new NonDeploymentAccessManager(val); this.usageManager = new NonDeploymentUsageManager(val); }

Target:
public void setManagementContext(ManagementContextInternal val) { this.initialManagementContext = checkNotNull(val, "initialManagementContext"); this.entityManager = new NonDeploymentEntityManager(val); this.locationManager = new NonDeploymentLocationManager(val); this.accessManager = new NonDeploymentAccessManager(val); this.usageManager = new NonDeploymentUsageManager(val); }
Source:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyLoggedInUserPrivileges(); data = new StudentHomePageData(account); String recentlyJoinedCourseId = getRequestParamValue(Const.ParamsNames.CHECK_PERSISTENCE_COURSE); List<CourseDetailsBundle> courses = new ArrayList<CourseDetailsBundle>(); Map<String, Boolean> sessionSubmissionStatusMap = new HashMap<String, Boolean>(); try { courses = logic.getCourseDetailsListForStudent(account.googleId); sessionSubmissionStatusMap = generateFeedbackSessionSubmissionStatusMap(courses, account.googleId); CourseDetailsBundle.sortDetailedCourses(courses); statusToAdmin = "studentHome Page Load<br>" + "Total courses: " + courses.size(); boolean isDataConsistent = checkEventualConsistency(recentlyJoinedCourseId, courses); if (!isDataConsistent) { addPlaceholderCourse(courses, recentlyJoinedCourseId, account.googleId, sessionSubmissionStatusMap); } for (CourseDetailsBundle course : courses) { FeedbackSessionDetailsBundle.sortFeedbackSessionsByCreationTime(course.feedbackSessions); } } catch (EntityDoesNotExistException e) { if (recentlyJoinedCourseId != null) { addPlaceholderCourse(courses, recentlyJoinedCourseId, account.googleId, sessionSubmissionStatusMap); } else { statusToUser.add(Const.StatusMessages.STUDENT_FIRST_TIME); statusToAdmin = Const.ACTION_RESULT_FAILURE + " :" + e.getMessage(); } } data.init(courses, sessionSubmissionStatusMap); ShowPageResult response = createShowPageResult(Const.ViewURIs.STUDENT_HOME, data); return response; }

Target:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyLoggedInUserPrivileges(); String recentlyJoinedCourseId = getRequestParamValue(Const.ParamsNames.CHECK_PERSISTENCE_COURSE); List<CourseDetailsBundle> courses = new ArrayList<CourseDetailsBundle>(); Map<FeedbackSessionAttributes, Boolean> sessionSubmissionStatusMap = new HashMap<>(); try { courses = logic.getCourseDetailsListForStudent(account.googleId); sessionSubmissionStatusMap = generateFeedbackSessionSubmissionStatusMap(courses, account.googleId); CourseDetailsBundle.sortDetailedCourses(courses); statusToAdmin = "studentHome Page Load<br>" + "Total courses: " + courses.size(); boolean isDataConsistent = isCourseIncluded(recentlyJoinedCourseId, courses); if (!isDataConsistent) { addPlaceholderCourse(courses, recentlyJoinedCourseId, account.googleId, sessionSubmissionStatusMap); } for (CourseDetailsBundle course : courses) { FeedbackSessionDetailsBundle.sortFeedbackSessionsByCreationTime(course.feedbackSessions); } } catch (EntityDoesNotExistException e) { if (recentlyJoinedCourseId != null) { addPlaceholderCourse(courses, recentlyJoinedCourseId, account.googleId, sessionSubmissionStatusMap); } else { statusToUser.add(Const.StatusMessages.STUDENT_FIRST_TIME); statusToAdmin = Const.ACTION_RESULT_FAILURE + " :" + e.getMessage(); } } data = new StudentHomePageData(account, courses, sessionSubmissionStatusMap); ShowPageResult response = createShowPageResult(Const.ViewURIs.STUDENT_HOME, data); return response; }
Source:
public RuleResult validate(final PasswordData passwordData) { final List<Rule> rulesByLength = getRulesByLength(passwordData.getPassword().length()); if (rulesByLength == null || rulesByLength.isEmpty()) { throw new IllegalStateException( "No rules have been configured for password length " + passwordData.getPassword().length()); } int successCount = 0; final RuleResult result = new RuleResult(true); for (Rule rule : rulesByLength) { final RuleResult rr = rule.validate(passwordData); if (!rr.isValid()) { if (reportRuleFailures) { result.getDetails().addAll(rr.getDetails()); } } else { successCount++; } } if (successCount < rulesByLength.size()) { result.setValid(false); result.getDetails().add( new RuleResultDetail(ERROR_CODE, createRuleResultDetailParameters(successCount, rulesByLength.size()))); } return result; }

Target:
public RuleResult validate(final PasswordData passwordData) { final int passwordLength = passwordData.getPassword().length(); final List<Rule> rulesByLength = getRulesByLength(passwordLength); if (rulesByLength == null) { return new RuleResult( false, new RuleResultDetail(ERROR_CODE_RULES, createRuleResultDetailParameters(passwordLength, 0, 0))); } int successCount = 0; final RuleResult result = new RuleResult(true); for (Rule rule : rulesByLength) { final RuleResult rr = rule.validate(passwordData); if (!rr.isValid()) { if (reportRuleFailures) { result.getDetails().addAll(rr.getDetails()); } } else { successCount++; } } if (successCount < rulesByLength.size()) { result.setValid(false); result.getDetails().add( new RuleResultDetail( ERROR_CODE, createRuleResultDetailParameters(passwordLength, successCount, rulesByLength.size()))); } return result; }
Source:
public Project getProjectByAlias(String projectAlias) throws IOException { if (projectStore != null) { return projectStore.getByAlias(projectAlias); } else { throw new IOException("No projectStore available. Check that it has been declared in the Spring config."); } }

Target:
public Project getProjectByAlias(String projectAlias) throws IOException { Project project = projectStore.getByAlias(projectAlias); authorizationManager.throwIfNotReadable(project); return project; }
Source:
public StructuredRecord joinOn(String stageName, StructuredRecord record) { List<Schema.Field> fields = new ArrayList<>(); Schema schema = record.getSchema(); List<String> joinKeys = perStageJoinKeys.get(stageName); int i = 1; for (String joinKey : joinKeys) { Schema.Field field = schema.getField(joinKey); if (field == null) { collector.addFailure( String.format("Join key field '%s' is not present in input stage of '%s'.", joinKey, stageName), null) .withConfigProperty(conf.JOIN_KEYS); collector.getOrThrowException(); return null; } Schema.Field joinField = Schema.Field.of(String.valueOf(i++), field.getSchema()); fields.add(joinField); } Schema keySchema = Schema.recordOf("join.key", fields); StructuredRecord.Builder keyRecordBuilder = StructuredRecord.builder(keySchema); i = 1; for (String joinKey : joinKeys) { keyRecordBuilder.set(String.valueOf(i++), record.get(joinKey)); } return keyRecordBuilder.build(); }

Target:
public StructuredRecord joinOn(String stageName, StructuredRecord record) { List<Schema.Field> fields = new ArrayList<>(); Schema schema = record.getSchema(); List<String> joinKeys = perStageJoinKeys.get(stageName); int i = 1; for (String joinKey : joinKeys) { Schema.Field field = schema.getField(joinKey); if (field == null) { throw new IllegalArgumentException(String.format("Join key field '%s' does not exist in schema from '%s'.", joinKey, stageName)); } Schema.Field joinField = Schema.Field.of(String.valueOf(i++), field.getSchema()); fields.add(joinField); } Schema keySchema = Schema.recordOf("join.key", fields); StructuredRecord.Builder keyRecordBuilder = StructuredRecord.builder(keySchema); i = 1; for (String joinKey : joinKeys) { keyRecordBuilder.set(String.valueOf(i++), record.get(joinKey)); } return keyRecordBuilder.build(); }
Source:
private static PartitionsSpec getDefaultPartitionsSpec( boolean forceGuaranteedRollup, @Nullable PartitionsSpec partitionsSpec, @Nullable Integer maxRowsPerSegment, @Nullable Long maxTotalRows, @Nullable Integer numShards, @Nullable List<String> partitionDimensions ) { if (partitionsSpec == null) { if (forceGuaranteedRollup) { if (maxRowsPerSegment != null || numShards != null || (partitionDimensions != null && !partitionDimensions.isEmpty())) { return new HashedPartitionsSpec(maxRowsPerSegment, numShards, partitionDimensions); } else { return null; } } else { if (maxRowsPerSegment != null || maxTotalRows != null) { return new DynamicPartitionsSpec(maxRowsPerSegment, maxTotalRows); } else { return null; } } } else { if (forceGuaranteedRollup) { if (!(partitionsSpec instanceof HashedPartitionsSpec)) { throw new ISE("HashedPartitonsSpec must be used for perfect rollup"); } } else { if (!(partitionsSpec instanceof DynamicPartitionsSpec)) { throw new ISE("DynamicPartitionsSpec must be used for best-effort rollup"); } } return partitionsSpec; } }

Target:
private static PartitionsSpec getDefaultPartitionsSpec( boolean forceGuaranteedRollup, @Nullable PartitionsSpec partitionsSpec, @Nullable Integer maxRowsPerSegment, @Nullable Long maxTotalRows, @Nullable Integer numShards, @Nullable List<String> partitionDimensions ) { if (partitionsSpec == null) { if (forceGuaranteedRollup) { if (maxRowsPerSegment != null || numShards != null || (partitionDimensions != null && !partitionDimensions.isEmpty())) { return new HashedPartitionsSpec(maxRowsPerSegment, numShards, partitionDimensions); } else { return null; } } else { if (maxRowsPerSegment != null || maxTotalRows != null) { return new DynamicPartitionsSpec(maxRowsPerSegment, maxTotalRows); } else { return null; } } } else { if (forceGuaranteedRollup) { if (!(partitionsSpec instanceof HashedPartitionsSpec)) { throw new ISE("HashedPartitionsSpec must be used for perfect rollup"); } } else { if (!(partitionsSpec instanceof DynamicPartitionsSpec)) { throw new ISE("DynamicPartitionsSpec must be used for best-effort rollup"); } } return partitionsSpec; } }
Source:
private boolean drainQueue() { boolean busy = false; while (true) { try { long cursor; while ((cursor = sequence.next()) < 0) { if (cursor == -1) { return busy; } } busy = true; LineTcpMeasurementEvent event = queue.get(cursor); boolean eventProcessed; try { if (event.threadId == id) { eventProcessed = processNextEvent(event); } else { if (event.isRebalanceEvent()) { eventProcessed = processRebalance(event); } else { eventProcessed = true; } } } catch (RuntimeException ex) { LOG.error().$(ex).$(); eventProcessed = true; } if (eventProcessed) { sequence.done(cursor); } } catch (RuntimeException ex) { LOG.error().$(ex).$(); } } }

Target:
private boolean drainQueue() { boolean busy = false; while (true) { long cursor; while ((cursor = sequence.next()) < 0) { if (cursor == -1) { return busy; } } busy = true; LineTcpMeasurementEvent event = queue.get(cursor); boolean eventProcessed; if (event.threadId == id) { eventProcessed = processNextEvent(event); } else { if (event.isRebalanceEvent()) { eventProcessed = processRebalance(event); } else { eventProcessed = true; } } if (eventProcessed) { sequence.done(cursor); } } }
Source:
public GeneEvidence(Evidence e) { this.setGene(e.getGene()); this.setEvidenceId(e.getEvidenceId()); this.setEvidenceType(e.getEvidenceType()); this.setStatus(e.getStatus()); this.setLastEdit(e.getLastEdit()); this.setArticles(e.getArticles()); this.setShortDesc(e.getShortDescription()); this.setDesc(e.getDescription()); }

Target:
public GeneEvidence(Evidence e) { this.setGene(e.getGene()); this.setEvidenceId(e.getEvidenceId()); this.setEvidenceType(e.getEvidenceType()); this.setStatus(e.getStatus()); this.setLastEdit(e.getLastEdit()); this.setArticles(e.getArticles()); this.setDesc(e.getDescription()); }
Source:
public MandateConnectorResponseBuilder withLinks(List<PaymentConnectorResponseLink> links) { this.links = links; return this; }

Target:
public MandateConnectorResponseBuilder withLinks(List<PaymentConnectorResponseLink> links) { this.links = List.copyOf(links); return this; }
Source:
private HttpResponse executePost(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, Object data) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { updateRegionCache(bucketName); int len = -1; if (data instanceof String) { len = ((String) data).length(); } if (data instanceof CompleteMultipartUpload) { len = ((CompleteMultipartUpload) data).toString().length(); } return execute(Method.POST, BucketRegionCache.INSTANCE.region(bucketName), bucketName, objectName, headerMap, queryParamMap, null, data, len); }

Target:
private HttpResponse executePost(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, Object data) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { updateRegionCache(bucketName); return execute(Method.POST, BucketRegionCache.INSTANCE.region(bucketName), bucketName, objectName, headerMap, queryParamMap, data, 0); }
Source:
private void select() { Intent i = new Intent(EntitySelectActivity.this.getIntent()); i.putExtra(SessionFrame.STATE_DATUM_VAL, selectedIntent.getStringExtra(SessionFrame.STATE_DATUM_VAL)); ACRAUtil.addCustomData(ACRAUtil.CURRENT_CASE, selectedIntent.getStringExtra(SessionFrame.STATE_DATUM_VAL)); setResult(RESULT_OK, i); finish(); }

Target:
private void select() { Intent i = new Intent(EntitySelectActivity.this.getIntent()); i.putExtra(SessionFrame.STATE_DATUM_VAL, selectedIntent.getStringExtra(SessionFrame.STATE_DATUM_VAL)); setResult(RESULT_OK, i); finish(); }
Source:
public int hashCode() { return new HashCodeBuilder(17, 37) .append(id) .append(gatewayName) .append(credentials) .toHashCode(); }

Target:
public int hashCode() { return Objects.hash(id, gatewayName, credentials); }
Source:
Queue<ReplicaId> orderReplicaIds(String datacenterName, List<ReplicaId> replicaIds, boolean crossDCProxyCallEnabled) { Queue<ReplicaId> orderedReplicaIds = new ArrayDeque<ReplicaId>(replicaIdCount); List<ReplicaId> localReplicaIds = new ArrayList<ReplicaId>(replicaIdCount); for (ReplicaId replicaId : replicaIds) { String dcName = replicaId.getDataNodeId().getDatacenterName(); if (dcName.equals(datacenterName)) { localReplicaIds.add(replicaId); this.localRequests.add(replicaId); } else if (crossDCProxyCallEnabled) { if(remoteReplicasPerDatacentre.containsKey(dcName)){ remoteReplicasPerDatacentre.get(dcName).add(replicaId); } else{ List<ReplicaId> replicaIdList = new ArrayList<ReplicaId>(); replicaIdList.add(replicaId); remoteReplicasPerDatacentre.put(dcName, replicaIdList); dataCentreCount++; } } } Collections.shuffle(localReplicaIds); orderedReplicaIds.addAll(localReplicaIds); for(String remoteDataCentre : remoteReplicasPerDatacentre.keySet()) { List<ReplicaId> remoteReplicaList = remoteReplicasPerDatacentre.get(remoteDataCentre); Collections.shuffle(remoteReplicaList); orderedReplicaIds.addAll(remoteReplicaList); } return orderedReplicaIds; }

Target:
Queue<ReplicaId> orderReplicaIds(String datacenterName, List<ReplicaId> replicaIds, boolean crossDCProxyCallEnabled) { Queue<ReplicaId> orderedReplicaIds = new ArrayDeque<ReplicaId>(replicaIdCount); List<ReplicaId> localReplicaIds = new ArrayList<ReplicaId>(replicaIdCount); List<ReplicaId> remoteReplicaIds = new ArrayList<ReplicaId>(replicaIdCount); List<ReplicaId> downReplicaIds = new ArrayList<ReplicaId>(replicaIdCount); for (ReplicaId replicaId : replicaIds) { if (replicaId.isDown()) { downReplicaIds.add(replicaId); } else if (replicaId.getDataNodeId().getDatacenterName().equals(datacenterName)) { localReplicaIds.add(replicaId); } else if (crossDCProxyCallEnabled) { remoteReplicaIds.add(replicaId); } } Collections.shuffle(localReplicaIds); orderedReplicaIds.addAll(localReplicaIds); Collections.shuffle(remoteReplicaIds); orderedReplicaIds.addAll(remoteReplicaIds); Collections.shuffle(downReplicaIds); orderedReplicaIds.addAll(downReplicaIds); return orderedReplicaIds; }
Source:
public String toString() { final StringBuilder sb = new StringBuilder( "S3AFileSystem{"); sb.append("uri=").append(uri); sb.append(", workingDir=").append(workingDir); sb.append(", inputPolicy=").append(inputPolicy); sb.append(", partSize=").append(partSize); sb.append(", enableMultiObjectsDelete=").append(enableMultiObjectsDelete); sb.append(", maxKeys=").append(maxKeys); if (cannedACL != null) { sb.append(", cannedACL=").append(cannedACL.toString()); } sb.append(", readAhead=").append(readAhead); sb.append(", blockSize=").append(getDefaultBlockSize()); sb.append(", multiPartThreshold=").append(multiPartThreshold); if (serverSideEncryptionAlgorithm != null) { sb.append(", serverSideEncryptionAlgorithm='") .append(serverSideEncryptionAlgorithm) .append('\''); } if (S3AUtils.getServerSideEncryptionKey(getConf()) != null) { sb.append(", serverSideEncryptionKey='*********'"); } if (blockFactory != null) { sb.append(", blockFactory=").append(blockFactory); } sb.append(", executor=").append(threadPoolExecutor); sb.append(", statistics {") .append(statistics) .append("}"); sb.append(", metrics {") .append(instrumentation.dump("{", "=", "} ", true)) .append("}"); sb.append('}'); return sb.toString(); }

Target:
public String toString() { final StringBuilder sb = new StringBuilder( "S3AFileSystem{"); sb.append("uri=").append(uri); sb.append(", workingDir=").append(workingDir); sb.append(", inputPolicy=").append(inputPolicy); sb.append(", partSize=").append(partSize); sb.append(", enableMultiObjectsDelete=").append(enableMultiObjectsDelete); sb.append(", maxKeys=").append(maxKeys); if (cannedACL != null) { sb.append(", cannedACL=").append(cannedACL.toString()); } sb.append(", readAhead=").append(readAhead); sb.append(", blockSize=").append(getDefaultBlockSize()); sb.append(", multiPartThreshold=").append(multiPartThreshold); if (serverSideEncryptionAlgorithm != null) { sb.append(", serverSideEncryptionAlgorithm='") .append(serverSideEncryptionAlgorithm) .append('\''); } if (blockFactory != null) { sb.append(", blockFactory=").append(blockFactory); } sb.append(", executor=").append(threadPoolExecutor); sb.append(", statistics {") .append(statistics) .append("}"); sb.append(", metrics {") .append(instrumentation.dump("{", "=", "} ", true)) .append("}"); sb.append('}'); return sb.toString(); }
Source:
@Test public void verifyThrowsOffMainThread() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { try { MainThreadSubscription.verifyMainThread(); fail(); } catch (IllegalStateException e) { latch.countDown(); } } }).start(); assertTrue(latch.await(1, SECONDS)); }

Target:
@Test public void verifyThrowsOffMainThread() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); new Thread(new Runnable() { @Override public void run() { try { MainThreadSubscription.verifyMainThread(); fail(); } catch (IllegalStateException e) { assertTrue(e.getMessage().startsWith("Expected to be called on the main thread")); latch.countDown(); } } }).start(); assertTrue(latch.await(1, SECONDS)); }
Source:
private void flushErrorReport(File errorFile) { try { Report report; if (config.getBeforeSendTasks().isEmpty()) { report = new Report(config.getApiKey(), errorFile); } else { Error error = ErrorReader.readError(config, errorFile); report = new Report(config.getApiKey(), error); for (BeforeSend beforeSend : config.getBeforeSendTasks()) { try { if (!beforeSend.run(report)) { deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting cancelled error file " + errorFile.getName()); return; } } catch (Throwable ex) { Logger.warn("BeforeSend threw an Exception", ex); } } } config.getDelivery().deliver(report, config); deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting sent error file " + errorFile.getName()); } catch (DeliveryFailureException exception) { cancelQueuedFiles(Collections.singleton(errorFile)); Logger.warn("Could not send previously saved error(s)" + " to Bugsnag, will try again later", exception); } catch (Exception exception) { if (delegate != null && !(exception instanceof FileNotFoundException)) { delegate.onErrorReadFailure(exception, errorFile); } deleteStoredFiles(Collections.singleton(errorFile)); } }

Target:
private void flushErrorReport(File errorFile) { try { Report report; if (config.getBeforeSendTasks().isEmpty()) { report = new Report(config.getApiKey(), errorFile); } else { Error error = ErrorReader.readError(config, errorFile); report = new Report(config.getApiKey(), error); for (BeforeSend beforeSend : config.getBeforeSendTasks()) { try { if (!beforeSend.run(report)) { deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting cancelled error file " + errorFile.getName()); return; } } catch (Throwable ex) { Logger.warn("BeforeSend threw an Exception", ex); } } } config.getDelivery().deliver(report, config); deleteStoredFiles(Collections.singleton(errorFile)); Logger.info("Deleting sent error file " + errorFile.getName()); } catch (DeliveryFailureException exception) { cancelQueuedFiles(Collections.singleton(errorFile)); Logger.warn("Could not send previously saved error(s)" + " to Bugsnag, will try again later", exception); } catch (FileNotFoundException exc) { Logger.warn("Ignoring empty file - oldest report on disk was deleted", exc); } catch (Exception exception) { if (delegate != null) { delegate.onErrorIOFailure(exception, errorFile, "Crash Report Deserialization"); } deleteStoredFiles(Collections.singleton(errorFile)); } }
Source:
private void setUpSeekBar() { seekBar.setMax(elementCount); seekBar.setProgress(progress); seekBar.setOnSeekBarChangeListener(this); if (isRTL()) { float rotate = seekBar.getRotation(); if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { seekBar.setRotation(180 - rotate); } else { seekBar.setRotation(360 - rotate); } } seekBar.setOnTouchListener(new SeekBar.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { seekBar.getThumb().mutate().setAlpha(255); int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: v.getParent().requestDisallowInterceptTouchEvent(true); break; case MotionEvent.ACTION_UP: v.getParent().requestDisallowInterceptTouchEvent(false); if (actualValue == null) { actualValue = rangeStart; setUpActualValueLabel(); } break; } v.onTouchEvent(event); return true; } }); }

Target:
private void setUpSeekBar() { seekBar.setMax(elementCount); seekBar.setProgress(progress); seekBar.setOnSeekBarChangeListener(this); if (isRTL()) { float rotate = seekBar.getRotation(); seekBar.setRotation(360 - rotate); } seekBar.setOnTouchListener(new SeekBar.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { seekBar.getThumb().mutate().setAlpha(255); int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: v.getParent().requestDisallowInterceptTouchEvent(true); break; case MotionEvent.ACTION_UP: v.getParent().requestDisallowInterceptTouchEvent(false); if (actualValue == null) { actualValue = rangeStart; setUpActualValueLabel(); } break; } v.onTouchEvent(event); return true; } }); }
Source:
public void testVerseThree() { String expectedVerseThree = "On the third day of Christmas my true love gave to me, " + "three French Hens, " + "two Turtle Doves, " + "and a Partridge in a Pear Tree.\n"; assertEquals(expectedVerseThree, twelveDays.verse(3)); }

Target:
public void testVerseThree() { String expectedVerseThree = "On the third day of Christmas my true love gave to me, three French Hens, " + "two Turtle Doves, and a Partridge in a Pear Tree.\n"; assertEquals(expectedVerseThree, twelveDays.verse(3)); }
Source:
public MultipleStorageDomainsValidator(NGuid spId, Collection<Guid> sdIds) { this.spId = spId; domainValidators = new HashMap<Guid, StorageDomainValidator>(sdIds.size()); for (Guid id : sdIds) { domainValidators.put(id, null); } }

Target:
public MultipleStorageDomainsValidator(NGuid spId, Collection<Guid> sdIds) { this.storagePoolId = spId; domainValidators = new HashMap<Guid, StorageDomainValidator>(sdIds.size()); for (Guid id : sdIds) { domainValidators.put(id, null); } }
Source:
public void testCheckWithDescription() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(JavadocTagContinuationIndentationCheck.class); final String[] expected = { "8: " + getCheckMessage(MSG_KEY, 4), "10: " + getCheckMessage(MSG_KEY, 4), "9: " + getCheckMessage(MSG_KEY, 4), }; verify(checkConfig, getPath("InputJavadocTagContinuationIndentationDescription.java"), expected); }

Target:
public void testCheckWithDescription() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(JavadocTagContinuationIndentationCheck.class); final String[] expected = { "9: " + getCheckMessage(MSG_KEY, 4), "10: " + getCheckMessage(MSG_KEY, 4), "11: " + getCheckMessage(MSG_KEY, 4), "40: " + getCheckMessage(MSG_KEY, 4), "42: " + getCheckMessage(MSG_KEY, 4), "43: " + getCheckMessage(MSG_KEY, 4), }; verify(checkConfig, getPath("InputJavadocTagContinuationIndentationDescription.java"), expected); }
Source:
@Test public void testDuplicatesWithLocation() { Policy p; ArrayList<Notice> notices = new ArrayList<>(); p = ParserWithLocation.parse("img-src a ;;; img-src b", "<LINK_0>", notices); assertEquals(1, notices.size()); assertEquals("1:23: Policy contains more than one img-src directive. All but the first instance will be ignored.", notices.get(0).show()); }

Target:
@Test public void testDuplicatesWithLocation() { Policy p; ArrayList<Notice> notices = new ArrayList<>(); p = ParserWithLocation.parse("img-src a ;;; img-src b", "<LINK_0>", notices); assertEquals(1, notices.size()); assertEquals("1:15: Policy contains more than one img-src directive. All but the first instance will be ignored.", notices.get(0).show()); }
Source:
public void testPageOrderingBefore() { initOnePageProvider(PositioningKind.BEFORE, DefaultSessionEditorPage.PAGE_ID, PAGE2_ID); List<IFormPage> pagesOrdered = sessionEditor.getPages(); assertEquals("The page order is wrong.", idToPageMap.get(PAGE2_ID), pagesOrdered.get(0)); assertTrue("The page order is wrong.", pagesOrdered.get(1) instanceof DefaultSessionEditorPage); assertEquals("The number of page in the editor is wrong.", 2, pagesOrdered.size()); }

Target:
public void testPageOrderingBefore() { initOnePageProvider(PositioningKind.BEFORE, DefaultSessionEditorPage.PAGE_ID, PAGE2_ID); assertRightPageOrdering(2, PAGE2_ID, DefaultSessionEditorPage.PAGE_ID); }
Source:
private void testBrokerNamedQueue(AbstractMessageListenerContainer container, CountDownLatch latch1, CountDownLatch latch2, Queue queue) throws Exception { container.start(); String firstDeclaredName = queue.getDeclaredName(); this.template.convertAndSend(firstDeclaredName, "foo"); assertThat(latch1.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("foo".getBytes()); final CountDownLatch newConnectionLatch = new CountDownLatch(2); cf.addConnectionListener(c -> newConnectionLatch.countDown()); cf.resetConnection(); assertThat(newConnectionLatch.await(10, TimeUnit.SECONDS)).isTrue(); String secondDeclaredName = queue.getDeclaredName(); assertThat(secondDeclaredName).isNotEqualTo(firstDeclaredName); this.template.convertAndSend(secondDeclaredName, "bar"); assertThat(latch2.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("bar".getBytes()); container.stop(); }

Target:
private void testBrokerNamedQueue(AbstractMessageListenerContainer container, CountDownLatch latch1, CountDownLatch latch2, Queue queue) throws Exception { container.start(); String firstActualName = queue.getActualName(); this.message.set(null); this.template.convertAndSend(firstActualName, "foo"); assertThat(latch1.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("foo".getBytes()); final CountDownLatch newConnectionLatch = new CountDownLatch(2); cf.addConnectionListener(c -> newConnectionLatch.countDown()); cf.resetConnection(); assertThat(newConnectionLatch.await(10, TimeUnit.SECONDS)).isTrue(); String secondActualName = queue.getActualName(); assertThat(secondActualName).isNotEqualTo(firstActualName); this.message.set(null); this.template.convertAndSend(secondActualName, "bar"); assertThat(latch2.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(this.message.get().getBody()).isEqualTo("bar".getBytes()); container.stop(); }
Source:
public boolean isEmpty(Node compartment) { boolean empty = true; if (compartment != null) { for (Object property : compartment.getChildren()) { if (isStereotypeProperty(property) || isStereotypeBraceProperty(property)) { if (isDisplayed((Node) property)) { empty &= false; } } } } return empty; }

Target:
public boolean isEmpty(Node compartment) { boolean empty = true; if (compartment != null) { Iterator<?> childrenIterator = compartment.getChildren().iterator(); while (childrenIterator.hasNext() && empty) { Object property = childrenIterator.next(); if (isStereotypeProperty(property) || isStereotypeBraceProperty(property)) { if (isDisplayed((Node) property)) { empty &= false; } } } } return empty; }
Source:
public boolean tryLock(long time, TimeUnit unit, String... names) throws InterruptedException { long start = System.nanoTime(); boolean result = false; while (!(result = db.lockForWriting(names)) && TimeUnit.MILLISECONDS.convert((System.nanoTime() - start), TimeUnit.NANOSECONDS) < time) { Thread.sleep(1000); } return result; }

Target:
public boolean tryLock(long time, TimeUnit unit, String... names) throws InterruptedException { long start = System.nanoTime(); boolean result = false; long timeInMills = TimeUnit.MILLISECONDS.convert(time, unit); while (!(result = db.lockForWriting(names)) && TimeUnit.MILLISECONDS.convert((System.nanoTime() - start), TimeUnit.NANOSECONDS) < timeInMills) { long sleepDurationMillis = 50 + RANDOM.nextInt(251); Thread.sleep(sleepDurationMillis); } return result; }
Source:
public synchronized int joinLRA(StringBuilder recoveryUrl, URL lra, long timeLimit, String compensatorUrl, String linkHeader, String recoveryUrlBase, String compensatorData) { if (lra == null) lraTrace(null, "Error missing LRA header in join request"); lraTrace(lra, "join LRA"); Transaction transaction = getTransaction(lra); if (timeLimit < 0) timeLimit = 0; if (!transaction.isActive()) return Response.Status.PRECONDITION_FAILED.getStatusCode(); LRARecord participant; try { participant = transaction.enlistParticipant(lra, linkHeader != null ? linkHeader : compensatorUrl, recoveryUrlBase, timeLimit, compensatorData); } catch (GenericLRAException e) { LRALogger.logger.infof(e, e.getMessage()); throw new GenericLRAException(lra, Response.Status.PRECONDITION_FAILED.getStatusCode(), e.getMessage(), e.getCause()); } catch (UnsupportedEncodingException e) { return Response.Status.PRECONDITION_FAILED.getStatusCode(); } if (participant == null || participant.getRecoveryCoordinatorURL() == null) return Response.Status.PRECONDITION_FAILED.getStatusCode(); String recoveryURL = participant.getRecoveryCoordinatorURL().toExternalForm(); updateRecoveryURL(lra, participant.getParticipantURL(), recoveryURL, false); recoveryUrl.append(recoveryURL); return Response.Status.OK.getStatusCode(); }

Target:
public synchronized int joinLRA(StringBuilder recoveryUrl, URL lra, long timeLimit, String compensatorUrl, String linkHeader, String recoveryUrlBase, String compensatorData) { if (lra == null) lraTrace(null, "Error missing LRA header in join request"); lraTrace(lra, "join LRA"); Transaction transaction = getTransaction(lra); if (timeLimit < 0) timeLimit = 0; if (!transaction.isActive()) return Response.Status.PRECONDITION_FAILED.getStatusCode(); LRARecord participant; try { participant = transaction.enlistParticipant(lra, linkHeader != null ? linkHeader : compensatorUrl, recoveryUrlBase, timeLimit, compensatorData); } catch (UnsupportedEncodingException e) { return Response.Status.PRECONDITION_FAILED.getStatusCode(); } if (participant == null || participant.getRecoveryCoordinatorURL() == null) return Response.Status.PRECONDITION_FAILED.getStatusCode(); String recoveryURL = participant.getRecoveryCoordinatorURL().toExternalForm(); updateRecoveryURL(lra, participant.getParticipantURL(), recoveryURL, false); recoveryUrl.append(recoveryURL); return Response.Status.OK.getStatusCode(); }
Source:
public boolean enlistResource(final XAResource xaRes) throws RollbackException, IllegalStateException, SystemException { Assert.checkNotNullParam("xaRes", xaRes); final int estimatedRemainingTime = getEstimatedRemainingTime(); if(estimatedRemainingTime == 0) throw Log.log.cannotEnlistToTimeoutedTransaction(xaRes, this); try { xaRes.setTransactionTimeout(estimatedRemainingTime); } catch (XAException e) { throw Log.log.setTimeoutFailed(estimatedRemainingTime, e); } return transaction.enlistResource(xaRes); }

Target:
public boolean enlistResource(final XAResource xaRes) throws RollbackException, IllegalStateException, SystemException { Assert.checkNotNullParam("xaRes", xaRes); final int estimatedRemainingTime = getEstimatedRemainingTime(); if(estimatedRemainingTime == 0) throw Log.log.cannotEnlistToTimeOutTransaction(xaRes, this); try { xaRes.setTransactionTimeout(estimatedRemainingTime); } catch (XAException e) { throw Log.log.setTimeoutFailed(estimatedRemainingTime, e); } return transaction.enlistResource(xaRes); }
Source:
public BlobDetail call() throws Exception { Blob blob = storage.blobBuilder(toBeUploadedBlobDetail.getRemoteBlobName()) .payload(toBeUploadedBlobDetail.getLocalFile()) .contentType("") .build(); String eTag = storage.putBlob(container, blob); BlobDetail uploadedBlobDetail = new BlobDetail( toBeUploadedBlobDetail.getRemoteBlobName(), toBeUploadedBlobDetail.getLocalFile(), eTag); return uploadedBlobDetail; }

Target:
public BlobDetail call() throws Exception { Blob blob = storage.blobBuilder(toBeUploadedBlobDetail.getRemoteBlobName()) .payload(toBeUploadedBlobDetail.getLocalFile()) .build(); String eTag = storage.putBlob(container, blob); BlobDetail uploadedBlobDetail = new BlobDetail( toBeUploadedBlobDetail.getRemoteBlobName(), toBeUploadedBlobDetail.getLocalFile(), eTag); return uploadedBlobDetail; }
Source:
public void addAccount(final Account account) { final SqlSession session = sessions.openSession(); try { session.insert(namespace + "addAccount", toMap(account)); session.commit(); } finally { session.close(); } Iterator<AuthToken> iterator = account.getAuthToken().iterator(); while(iterator.hasNext()){ AuthToken token = iterator.next(); System.out.println("Adding Account tokens token:"+token); addAuthToken(new AuthToken(account.getSid(), token.getAuthToken(), token.getDescription())); } }

Target:
public void addAccount(final Account account) { final SqlSession session = sessions.openSession(); try { session.insert(namespace + "addAccount", toMap(account)); session.commit(); } finally { session.close(); } Iterator<AuthToken> iterator = account.getAuthToken().iterator(); while(iterator.hasNext()){ AuthToken token = iterator.next(); addAuthToken(new AuthToken(account.getSid(), token.getAuthToken(), token.getDescription())); } }