auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized void onLocationChanged(Location location) { Log.d(TAG, "Location Updated"); if (mLastLocation == null) { mNavProvider.locationUpdated(location); } else if (!LocationUtils.isDuplicate(mLastLocation, location)) { mNavProvider.locationUpdated(location); } if ((BuildConfig.NAV_GPS_LOGGING) &&(mNavProvider.sectoCurDistance <= 300)) { writeToLog(location); } mLastLocation = location; if (mNavProvider.getFinished()) { if (BuildConfig.NAV_GPS_LOGGING) { if (mFinishedTime == 0) { mFinishedTime = System.currentTimeMillis(); } else if (System.currentTimeMillis() - mFinishedTime >= 30000) { stopSelf(); } } else { stopSelf(); } } }

Target:
public synchronized void onLocationChanged(Location location) { Log.d(TAG, "Location Updated"); if (mLastLocation == null) { mNavProvider.locationUpdated(location); } else if (!LocationUtils.isDuplicate(mLastLocation, location)) { mNavProvider.locationUpdated(location); } if (BuildConfig.NAV_GPS_LOGGING && mNavProvider.mSectoCurDistance <= RECORDING_THRESHOLD) { writeToLog(location); } mLastLocation = location; if (mNavProvider.getFinished()) { if (BuildConfig.NAV_GPS_LOGGING) { if (mFinishedTime == 0) { mFinishedTime = System.currentTimeMillis(); } else if (System.currentTimeMillis() - mFinishedTime >= 30000) { stopSelf(); } } else { stopSelf(); } } }
Source:
public AsyncDocumentClient build() { ifThrowIllegalArgException(this.serviceEndpoint == null, "cannot build client without service endpoint"); ifThrowIllegalArgException( this.masterKeyOrResourceToken == null && (permissionFeed == null || permissionFeed.isEmpty()) && this.tokenResolver == null && this.cosmosKeyCredential == null, "cannot build client without any one of masterKey, " + "resource token, permissionFeed, tokenResolver and cosmos key credential"); ifThrowIllegalArgException(cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.getMasterKey()), "cannot build client without key credential"); RxDocumentClientImpl client = new RxDocumentClientImpl(serviceEndpoint, masterKeyOrResourceToken, permissionFeed, connectionPolicy, desiredConsistencyLevel, configs, tokenResolver, cosmosKeyCredential); client.init(); return client; }

Target:
public AsyncDocumentClient build() { ifThrowIllegalArgException(this.serviceEndpoint == null, "cannot build client without service endpoint"); ifThrowIllegalArgException( this.masterKeyOrResourceToken == null && (permissionFeed == null || permissionFeed.isEmpty()) && this.tokenResolver == null && this.cosmosKeyCredential == null, "cannot build client without any one of masterKey, " + "resource token, permissionFeed, tokenResolver and cosmos key credential"); ifThrowIllegalArgException(cosmosKeyCredential != null && StringUtils.isEmpty(cosmosKeyCredential.key()), "cannot build client without key credential"); RxDocumentClientImpl client = new RxDocumentClientImpl(serviceEndpoint, masterKeyOrResourceToken, permissionFeed, connectionPolicy, desiredConsistencyLevel, configs, tokenResolver, cosmosKeyCredential); client.init(); return client; }
Source:
public void onLeavePrepare() { log.debug("Executing onLeavePrepare with generation and memberId {}", generation(), memberId()); Set<TopicPartition> droppedPartitions = new HashSet<>(subscriptions.assignedPartitions()); if (subscriptions.partitionsAutoAssigned() && !droppedPartitions.isEmpty()) { final Exception e; if (generation() != Generation.NO_GENERATION) { e = invokePartitionsRevoked(droppedPartitions); } else { e = invokePartitionsLost(droppedPartitions); } subscriptions.assignFromSubscribed(Collections.emptySet()); if (e != null) { throw new KafkaException("User rebalance callback throws an error", e); } } }

Target:
public void onLeavePrepare() { final Generation currentGeneration = generation(); final String memberId = currentGeneration.memberId; log.debug("Executing onLeavePrepare with generation and memberId {}", currentGeneration, memberId); Set<TopicPartition> droppedPartitions = new HashSet<>(subscriptions.assignedPartitions()); if (subscriptions.partitionsAutoAssigned() && !droppedPartitions.isEmpty()) { final Exception e; if (generation() != Generation.NO_GENERATION) { e = invokePartitionsRevoked(droppedPartitions); } else { e = invokePartitionsLost(droppedPartitions); } subscriptions.assignFromSubscribed(Collections.emptySet()); if (e != null) { throw new KafkaException("User rebalance callback throws an error", e); } } }
Source:
Mono<Response<AppendBlobItem>> appendBlockFromUrlWithResponse(String sourceUrl, BlobRange sourceRange, byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions, SourceModifiedAccessConditions sourceAccessConditions, Context context) { sourceRange = sourceRange == null ? new BlobRange(0) : sourceRange; destAccessConditions = destAccessConditions == null ? new AppendBlobAccessConditions() : destAccessConditions; URL url; try { url = new URL(sourceUrl); } catch (MalformedURLException ex) { throw logger.logExceptionAsError(new IllegalArgumentException(ex)); } return this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null, url, 0, sourceRange.toString(), sourceContentMD5, null, null, null, null, getCustomerProvidedKey(), destAccessConditions.getLeaseAccessConditions(), destAccessConditions.getAppendPositionAccessConditions(), destAccessConditions.getModifiedAccessConditions(), sourceAccessConditions, context) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.getDeserializedHeaders()))); }

Target:
Mono<Response<AppendBlobItem>> appendBlockFromUrlWithResponse(String sourceUrl, BlobRange sourceRange, byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions, SourceModifiedAccessConditions sourceAccessConditions, Context context) { sourceRange = sourceRange == null ? new BlobRange(0) : sourceRange; destAccessConditions = destAccessConditions == null ? new AppendBlobAccessConditions() : destAccessConditions; URL url; try { url = new URL(sourceUrl); } catch (MalformedURLException ex) { throw logger.logExceptionAsError(new IllegalArgumentException("'sourceUrl' is not a valid url.")); } return this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null, url, 0, sourceRange.toString(), sourceContentMD5, null, null, null, null, getCustomerProvidedKey(), destAccessConditions.getLeaseAccessConditions(), destAccessConditions.getAppendPositionAccessConditions(), destAccessConditions.getModifiedAccessConditions(), sourceAccessConditions, context) .map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.getDeserializedHeaders()))); }
Source:
protected boolean isBetweenInclusiveOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String tempOperator = temp.getOperator(); try { if (prevOperator.equals(BLCOperator.GREATER_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.LESS_OR_EQUAL.name())) { return Long.parseLong(temp.getValue()) > Long.parseLong(prev.getValue()); } else if (prevOperator.equals(BLCOperator.LESS_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.GREATER_OR_EQUAL.name())) { return Long.parseLong(prev.getValue()) > Long.parseLong(temp.getValue()); } return false; } catch (NumberFormatException e) { return false; } }

Target:
protected boolean isBetweenInclusiveOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String prevVal = prev.getValue(); String tempOperator = temp.getOperator(); String tempVal = temp.getValue(); try { if (prevOperator.equals(BLCOperator.GREATER_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.LESS_OR_EQUAL.name())) { return Long.parseLong(tempVal) > Long.parseLong(prevVal); } else if (prevOperator.equals(BLCOperator.LESS_OR_EQUAL.name()) && tempOperator.equals(BLCOperator.GREATER_OR_EQUAL.name())) { return Long.parseLong(prevVal) > Long.parseLong(tempVal); } return false; } catch (NumberFormatException e) { LOG.warn(String.format("Used string values in expression %s %s && %s %s", prevOperator, prevVal, tempOperator, tempVal)); return false; } }
Source:
public Cube getCube(int cubeX, int cubeY, int cubeZ, Requirement req) { if (req == Requirement.GET_WATCHED){ PlayerCubeMap playerCubeMap = ((PlayerCubeMap)this.world.getPlayerChunkMap()); CubeWatcher cubeWatcher = playerCubeMap.getCubeWatcher(cubeX, cubeY, cubeZ); if(cubeWatcher == null) return null; else return cubeWatcher.getCube(); } Cube cube = cubeMap.get(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { return cube; } IColumn column = getColumn(cubeX, cubeZ, req); if (column == null) { return cube; } if (cube == null) { cube = AsyncWorldIOExecutor.syncCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ); onCubeLoaded(cube, column); } return postCubeLoadAttempt(cubeX, cubeY, cubeZ, cube, column, req); }

Target:
public Cube getCube(int cubeX, int cubeY, int cubeZ, Requirement req) { Cube cube = getLoadedCube(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { return cube; } IColumn column = getColumn(cubeX, cubeZ, req); if (column == null) { return cube; } if (cube == null) { cube = AsyncWorldIOExecutor.syncCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ); onCubeLoaded(cube, column); } return postCubeLoadAttempt(cubeX, cubeY, cubeZ, cube, column, req); }
Source:
public Scope scope() { return this.scope; }

Target:
public RuleScope scope() { return this.scope; }
Source:
public void removeAndRestoreLogMessage() { gaeSimulation.loginAsAdmin("admin"); gaeSimulation.clearLogs(); Instant twoDaysAgo = TimeHelper.getInstantDaysOffsetFromNow(-2); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TWO_DAYS_AGO), twoDaysAgo.toEpochMilli()); Instant yesterday = TimeHelper.getInstantDaysOffsetFromNow(-1); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_YESTERDAY), yesterday.toEpochMilli()); Instant today = TimeHelper.getInstantDaysOffsetFromNow(0); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TODAY), today.toEpochMilli()); }

Target:
public void removeAndRestoreLogMessage() { gaeSimulation.loginAsAdmin("admin"); gaeSimulation.clearLogs(); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TWO_DAYS_AGO), TWO_DAYS_AGO.toEpochMilli()); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_YESTERDAY), YESTERDAY.toEpochMilli()); insertLogMessagesAtTime(logMessages.get(LOG_MESSAGE_INDEX_TODAY), TODAY.toEpochMilli()); }
Source:
public boolean appliesTo(Object selection) { EObject eo = EMFHelper.getEObject(selection); if (eo != null && eo instanceof Element) { return UMLRTProfileUtils.isUMLRTProfileApplied((Element) eo); } return false; }

Target:
public boolean appliesTo(Object selection) { EObject eo = EMFHelper.getEObject(selection); if (eo instanceof Element) { return UMLRTProfileUtils.isUMLRTProfileApplied((Element) eo); } return false; }
Source:
protected Result pushDownDereferences(Context context, JoinNode joinNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { Assignments.Builder leftSideDereferences = Assignments.builder(); Assignments.Builder rightSideDereferences = Assignments.builder(); for (Map.Entry<VariableReferenceExpression, DereferenceExpression> entry : expressions.inverse().entrySet()) { VariableReferenceExpression baseSymbol = getBase(entry.getValue(), context.getVariableAllocator().getTypes()); if (joinNode.getLeft().getOutputVariables().contains(baseSymbol)) { leftSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } else { rightSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } } PlanNode leftNode = createProjectBelow(joinNode.getLeft(), leftSideDereferences.build(), context.getIdAllocator()); PlanNode rightNode = createProjectBelow(joinNode.getRight(), rightSideDereferences.build(), context.getIdAllocator()); return Result.ofPlanNode(new JoinNode( context.getIdAllocator().getNextId(), joinNode.getType(), leftNode, rightNode, joinNode.getCriteria(), ImmutableList.<VariableReferenceExpression>builder().addAll(leftNode.getOutputVariables()).addAll(rightNode.getOutputVariables()).build(), joinNode.getFilter(), joinNode.getLeftHashVariable(), joinNode.getRightHashVariable(), joinNode.getDistributionType())); }

Target:
protected Result pushDownDereferences(Context context, JoinNode joinNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { Assignments.Builder leftSideDereferences = Assignments.builder(); Assignments.Builder rightSideDereferences = Assignments.builder(); for (Map.Entry<VariableReferenceExpression, DereferenceExpression> entry : expressions.inverse().entrySet()) { VariableReferenceExpression baseSymbol = getBase(entry.getValue(), context.getVariableAllocator().getTypes()); if (joinNode.getLeft().getOutputVariables().contains(baseSymbol)) { leftSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } else { rightSideDereferences.put(entry.getKey(), castToRowExpression(entry.getValue())); } } PlanNode leftNode = createProject(joinNode.getLeft(), leftSideDereferences.build(), context.getIdAllocator()); PlanNode rightNode = createProject(joinNode.getRight(), rightSideDereferences.build(), context.getIdAllocator()); return Result.ofPlanNode(new JoinNode( context.getIdAllocator().getNextId(), joinNode.getType(), leftNode, rightNode, joinNode.getCriteria(), ImmutableList.<VariableReferenceExpression>builder() .addAll(leftNode.getOutputVariables()) .addAll(rightNode.getOutputVariables()) .build(), joinNode.getFilter(), joinNode.getLeftHashVariable(), joinNode.getRightHashVariable(), joinNode.getDistributionType())); }
Source:
public void addHostsAndBlockWeight(String[] hosts, long weight, StorageType[] storageTypes) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); for (int i = 0; i < hosts.length; i++) { long weightForSsd = 0; if (storageTypes != null && storageTypes.length == hosts.length && storageTypes[i] == StorageType.SSD) { weightForSsd = weight; } addHostAndBlockWeight(hosts[i], weight, weightForSsd); } }

Target:
public void addHostsAndBlockWeight(String[] hosts, long weight, StorageType[] storageTypes) { if (hosts == null || hosts.length == 0) { return; } addUniqueWeight(weight); if (storageTypes != null && storageTypes.length == hosts.length) { for (int i = 0; i < hosts.length; i++) { long weightForSsd = 0; if (storageTypes[i] == StorageType.SSD) { weightForSsd = weight; } addHostAndBlockWeight(hosts[i], weight, weightForSsd); } } else { for (String hostname : hosts) { addHostAndBlockWeight(hostname, weight, 0); } } }
Source:
public ResponseEntity<?> removeSession(@RequestHeader("X-Auth-Token") String xAuth) { if (!Strings.isNullOrEmpty(xAuth)) { Optional<AuthenticationToken> tokenOptional = tokenRepository.findByToken(xAuth); AuthenticationToken token = tokenOptional.orElseThrow(XAuthTokenNotFoundException::new); if (!token.isValid()) { throw new InvalidTokenException(); } else { token.revoke(); tokenRepository.saveAndFlush(token); return createResponseEntity(HttpStatus.OK, "Successfully logged out"); } } else { throw new IllegalArgumentException("No X-Auth-Token present"); } }

Target:
public ResponseEntity<?> removeSession(@RequestHeader("X-Auth-Token") String xAuth) { authenticationService.removeAuthToken(xAuth); return createResponseEntity(HttpStatus.OK, "Successfully logged out"); }
Source:
private List<String> getPackageFileList(String downloadedTestProject1PackageName) throws IOException { IOException lastException = null; for (int i = 0; i < MAX_ATTEMPTS; i++) { try { return downloadedFileUtil .getPackageFileList(seleniumWebDriver, downloadedTestProject1PackageName) .stream() .filter(s -> !s.contains("target")) .collect(Collectors.toList()); } catch (IOException e) { lastException = e; sleepQuietly(TestTimeoutsConstants.MINIMUM_SEC); } } throw lastException; }

Target:
private List<String> getPackageFileList(String downloadedTestProject1PackageName) throws IOException { IOException lastException = null; for (int i = 0; i < MAX_ATTEMPTS; i++) { try { return downloadedFileUtil .getPackageFileList(seleniumWebDriver, downloadedTestProject1PackageName) .stream() .filter(s -> !s.contains("target/") && !s.startsWith(".che")) .collect(Collectors.toList()); } catch (IOException e) { lastException = e; sleepQuietly(TestTimeoutsConstants.MINIMUM_SEC); } } throw lastException; }
Source:
public void testIsDefaultCallScreeningAppFailure() throws Exception { boolean exceptionThrown = false; ComponentName componentName = new ComponentName("com.android.unknown", "com.android.unknown.callscreeningserviceimpl"); try { mTSIBinder.isDefaultCallScreeningApp(componentName); } catch (SecurityException e) { exceptionThrown = true; } assertTrue(exceptionThrown); }

Target:
public void testIsDefaultCallScreeningAppFailure() throws Exception { boolean exceptionThrown = false; ComponentName unknownComponentName = new ComponentName("com.android.unknown", "com.android.unknown.callscreeningserviceimpl"); Settings.Secure.putStringForUser(mContentResolver, Settings.Secure .ALL_SCREENING_DEFAULT_APPLICATION, mThirdPartyCallScreening.flattenToString(), 0); try { mTSIBinder.isDefaultCallScreeningApp(unknownComponentName); } catch (SecurityException e) { exceptionThrown = true; } assertTrue(exceptionThrown); }
Source:
public MethodOutcome updatePatientConditional( @ResourceParam Person thePerson, @IdParam IdDt theId) { MethodOutcome retVal = new MethodOutcome(); retVal.setId(new IdDt(FHIRConstants.PERSON, thePerson.getId().getIdPart())); OperationOutcome outcome = new OperationOutcome(); try{ Person person=personResource.updateFHIRPerson(thePerson,theId.getIdPart()); }catch(Exception e){ outcome.addIssue().setDetails("No Person is associated with the given UUID to update. Please" + " make sure you have set at lease one non-delete name to create a new Person with the given UUID"); retVal.setOperationOutcome(outcome); return retVal; } outcome.addIssue().setDetails("Person is successfully updated"); retVal.setOperationOutcome(outcome); return retVal; }

Target:
public MethodOutcome updatePatientConditional(@ResourceParam Person thePerson, @IdParam IdDt theId) { MethodOutcome retVal = new MethodOutcome(); OperationOutcome outcome = new OperationOutcome(); try { Person person = personResource.updateFHIRPerson(thePerson, theId.getIdPart()); } catch (Exception e) { outcome.addIssue() .setDetails( "No Person is associated with the given UUID to update. Please" + " make sure you have set at lease one non-delete name, Gender and Birthdate to create a new Person with the given UUID"); retVal.setOperationOutcome(outcome); return retVal; } outcome.addIssue().setDetails("Person is successfully updated"); retVal.setOperationOutcome(outcome); return retVal; }
Source:
public void onStopProfiler() { enableStoppedCommands(); ProfileOperationRequest request = ProfileOperationRequest .create(response_.getFileName()); server_.stopProfiling(request, new ServerRequestCallback<ProfileOperationResponse>() { @Override public void onResponseReceived(ProfileOperationResponse response) { if (response.getErrorMessage() != null) { globalDisplay_.showErrorMessage("Profiler Error", response.getErrorMessage()); return; } } @Override public void onError(ServerError error) { globalDisplay_.showErrorMessage("Failed to Stop Profiler", error.getMessage()); } }); }

Target:
public void onStopProfiler() { ProfileOperationRequest request = ProfileOperationRequest .create(response_ != null ? response_.getFileName() : null); response_ = null; server_.stopProfiling(request, new ServerRequestCallback<ProfileOperationResponse>() { @Override public void onResponseReceived(ProfileOperationResponse response) { if (response.getErrorMessage() != null) { globalDisplay_.showErrorMessage("Profiler Error", response.getErrorMessage()); return; } } @Override public void onError(ServerError error) { globalDisplay_.showErrorMessage("Failed to Stop Profiler", error.getMessage()); } }); }
Source:
public static ChangeKind getChangeKind(MergeUtil.Factory mergeUtilFactory, ProjectState project, Repository git, RevCommit prior, RevCommit next) { if (next.getTree() == prior.getTree() && isSameParents(prior, next)) { return ChangeKind.NO_CODE_CHANGE; } if (prior.getParentCount() != 1 || next.getParentCount() != 1) { return ChangeKind.REWORK; } if (next.getTree() == prior.getTree() && isSameParents(prior, next)) { return ChangeKind.TRIVIAL_REBASE; } try { MergeUtil mergeUtil = mergeUtilFactory.create(project); ThreeWayMerger merger = mergeUtil.newThreeWayMerger(git, mergeUtil.createDryRunInserter()); merger.setBase(prior.getParent(0)); if (merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree())) { return ChangeKind.TRIVIAL_REBASE; } else { return ChangeKind.REWORK; } } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.getProject().getName(), err); return ChangeKind.REWORK; } }

Target:
public static ChangeKind getChangeKind(MergeUtil.Factory mergeUtilFactory, ProjectState project, Repository git, RevCommit prior, RevCommit next) { if (next.getTree() == prior.getTree() && isSameParents(prior, next)) { return ChangeKind.NO_CODE_CHANGE; } if (prior.getParentCount() != 1 || next.getParentCount() != 1) { return ChangeKind.REWORK; } try { MergeUtil mergeUtil = mergeUtilFactory.create(project); ThreeWayMerger merger = mergeUtil.newThreeWayMerger(git, mergeUtil.createDryRunInserter()); merger.setBase(prior.getParent(0)); if (merger.merge(next.getParent(0), prior) && merger.getResultTreeId().equals(next.getTree())) { return ChangeKind.TRIVIAL_REBASE; } else { return ChangeKind.REWORK; } } catch (IOException err) { log.warn("Cannot check trivial rebase of new patch set " + next.name() + " in " + project.getProject().getName(), err); return ChangeKind.REWORK; } }
Source:
private MaterialRevisions fanInOn(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig, CaseInsensitiveString targetPipelineName) { LOGGER.debug("[Revision Resolution] Fan-In Resolution is active for pipeline " + pipelineName); return pipelineService.getRevisionsBasedOnDependencies(originalMaterialRevisions, cruiseConfig, targetPipelineName); }

Target:
private MaterialRevisions fanInOn(MaterialRevisions originalMaterialRevisions, CruiseConfig cruiseConfig, CaseInsensitiveString targetPipelineName) { LOGGER.debug("[Revision Resolution] Fan-In Resolution is active for pipeline {}", pipelineName); return pipelineService.getRevisionsBasedOnDependencies(originalMaterialRevisions, cruiseConfig, targetPipelineName); }
Source:
public Map<String, String> getGenericInformation() { return this.genericInformation; }

Target:
public Map<String, String> getGenericInformation() { Set<Entry<String, String>> entries = this.genericInformation.entrySet(); Map<String, String> result = new HashMap<>(entries.size()); for (Entry<String, String> entry : entries) { result.put(entry.getKey(), entry.getValue()); } return result; }
Source:
public static final HttpClient createHttpClient() { SocketConfig socketConfig = SocketConfig.copy(SocketConfig.DEFAULT).setSoTimeout(SERVER_CONNECTION_TIMEOUT).build(); List<String> targetPreferredAuthSchemes = new ArrayList<String>(); targetPreferredAuthSchemes.add(AuthSchemes.DIGEST); targetPreferredAuthSchemes.add(AuthSchemes.BASIC); RequestConfig requestConfig = RequestConfig.copy(RequestConfig.DEFAULT) .setConnectTimeout(SERVER_CONNECTION_TIMEOUT) .setAuthenticationEnabled(true) .setRedirectsEnabled(true) .setMaxRedirects(1) .setCircularRedirectsAllowed(true) .setTargetPreferredAuthSchemes(targetPreferredAuthSchemes) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setConnectionManager(connectionManager) .setConnectionManagerShared(true) .setDefaultSocketConfig(socketConfig) .setDefaultRequestConfig(requestConfig); HttpHost proxy = BriefcasePreferences.getBriefCaseProxyConnection(); if (proxy != null) { clientBuilder.setRoutePlanner(new DefaultProxyRoutePlanner(proxy)).build(); } return clientBuilder.build(); }

Target:
public static final HttpClient createHttpClient() { SocketConfig socketConfig = SocketConfig.copy(SocketConfig.DEFAULT).setSoTimeout(SERVER_CONNECTION_TIMEOUT).build(); List<String> targetPreferredAuthSchemes = new ArrayList<String>(); targetPreferredAuthSchemes.add(AuthSchemes.DIGEST); targetPreferredAuthSchemes.add(AuthSchemes.BASIC); RequestConfig requestConfig = RequestConfig.copy(RequestConfig.DEFAULT) .setConnectTimeout(SERVER_CONNECTION_TIMEOUT) .setAuthenticationEnabled(true) .setRedirectsEnabled(true) .setMaxRedirects(1) .setCircularRedirectsAllowed(true) .setTargetPreferredAuthSchemes(targetPreferredAuthSchemes) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setConnectionManager(connectionManager) .setConnectionManagerShared(true) .setDefaultSocketConfig(socketConfig) .setDefaultRequestConfig(requestConfig); HttpHost proxy = BriefcasePreferences.getBriefCaseProxyConnection(); if (proxy != null) { clientBuilder.setRoutePlanner(new DefaultProxyRoutePlanner(proxy)); } return clientBuilder.build(); }
Source:
private URIish createURI(byte[] keyFingerprint) { URIish uri = new URIish(); uri = uri.setPath(MessageFormat.format(JGitText.get().gpgKeyUrish, Hex.toHexString(keyFingerprint))); return uri; }

Target:
private URIish createURI(byte[] keyFingerprint) { return new URIish().setScheme("gpgkey") .setPath(Hex.toHexString(keyFingerprint)); }
Source:
public static void viewAccountSettings(Activity activity) { AccountHelper.getDefaultAccount().fetchAccountSettings(); Intent intent = new Intent(activity, SettingsActivity.class); AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_ACCOUNT_SETTINGS); slideInFromRightForResult(activity, intent, RequestCodes.ACCOUNT_SETTINGS); }

Target:
public static void viewAccountSettings(Activity activity) { Intent intent = new Intent(activity, AccountSettingsActivity.class); AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_ACCOUNT_SETTINGS); slideInFromRightForResult(activity, intent, RequestCodes.ACCOUNT_SETTINGS); }
Source:
GetBlobInfoOperation(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, ClusterMap clusterMap, ResponseHandler responseHandler, String blobIdStr, GetBlobOptionsInternal options, Callback<GetBlobResultInternal> callback, Time time) throws RouterException { super(routerConfig, routerMetrics, clusterMap, responseHandler, blobIdStr, options, callback, time); operationTracker = new AdaptiveOperationTracker(routerConfig.routerDatacenterName, blobId.getPartition(), routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism, time, routerMetrics.getBlobInfoLocalColoLatency, routerMetrics.getBlobInfoCrossColoLatency, routerConfig.routerLatencyToleranceQuantile); }

Target:
GetBlobInfoOperation(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, ClusterMap clusterMap, ResponseHandler responseHandler, String blobIdStr, GetBlobOptionsInternal options, Callback<GetBlobResultInternal> callback, Time time) throws RouterException { super(routerConfig, routerMetrics, clusterMap, responseHandler, blobIdStr, options, callback, time); operationTracker = new AdaptiveOperationTracker(routerConfig.routerDatacenterName, blobId.getPartition(), routerConfig.routerGetCrossDcEnabled, routerConfig.routerGetSuccessTarget, routerConfig.routerGetRequestParallelism, time, routerMetrics.getBlobInfoLocalColoLatencyMs, routerMetrics.getBlobInfoCrossColoLatencyMs, routerMetrics.getBlobInfoPastDueCount, routerConfig.routerLatencyToleranceQuantile); }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { BuildData buildData = build.getAction(BuildData.class); if (buildData == null) { throw new IOException(Messages.GitHubCommitNotifier_NoBuildDataError()); } final Revision lastBuildRevision = buildData.getLastBuiltRevision(); final ObjectId sha1 = lastBuildRevision != null ? lastBuildRevision.getSha1() : null; if (sha1 == null) { throw new IOException(Messages.GitHubCommitNotifier_NoLastRevisionError()); } for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { GHCommitState state; String msg; final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis()); Result result = build.getResult(); if (result.isBetterOrEqualTo(SUCCESS)) { state = GHCommitState.SUCCESS; msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration); } else if (result.isBetterOrEqualTo(UNSTABLE)) { state = GHCommitState.FAILURE; msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration); } else { state = GHCommitState.ERROR; msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration); } listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(ObjectId.toString(sha1), state, build.getAbsoluteUrl(), msg); } } return true; }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { try { updateCommitStatus(build, listener); return true; } catch (IOException error) { final Result buildResult = getEffectiveResultOnFailure(); if (buildResult.equals(Result.FAILURE)) { throw error; } else { listener.error("[GitHub Commit Notifier] - " + error.getMessage()); if (buildResult.isWorseThan(build.getResult())) { listener.getLogger().println("[GitHub Commit Notifier] - Build result will be set to " + buildResult); build.setResult(buildResult); } } } return true; }
Source:
public void before() throws Exception { MockitoAnnotations.initMocks(this); when(masterServices.skipRegionManagementAction(any())).thenReturn(false); testingUtility = new HBaseCommonTestingUtility(); queue = new RegionNormalizerWorkQueue<>(); workerThreadThrowable.set(null); final String threadNameFmt = TestRegionNormalizerWorker.class.getSimpleName() + "-" + testName.getMethodName() + "-%d"; final ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(threadNameFmt) .setDaemon(true) .setUncaughtExceptionHandler((t, e) -> workerThreadThrowable.set(e)) .build(); workerPool = Executors.newFixedThreadPool(1, threadFactory); }

Target:
public void before() throws Exception { MockitoAnnotations.initMocks(this); when(masterServices.skipRegionManagementAction(any())).thenReturn(false); testingUtility = new HBaseCommonTestingUtility(); queue = new RegionNormalizerWorkQueue<>(); workerThreadThrowable.set(null); final String threadNameFmt = TestRegionNormalizerWorker.class.getSimpleName() + "-" + testName.getMethodName() + "-%d"; final ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(threadNameFmt) .setDaemon(true) .setUncaughtExceptionHandler((t, e) -> workerThreadThrowable.set(e)) .build(); workerPool = Executors.newSingleThreadExecutor(threadFactory); }
Source:
public void testExecuteAndPostProcess() { ______TS("case: view instructor account details"); InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor1OfCourse1.googleId }; final String adminUserId = "admin.user"; gaeSimulation.loginAsAdmin(adminUserId); AdminAccountDetailsPageAction action = getAction(submissionParams); ShowPageResult result = getShowPageResult(action); assertEquals("", result.getStatusMessage()); assertEquals(getPageResultDestination("/jsp/adminAccountDetails.jsp", false, "admin.user"), result.getDestinationWithParams()); assertFalse(result.isError); AdminAccountDetailsPageData data = (AdminAccountDetailsPageData) result.data; assertEquals(instructor1OfCourse1.googleId, data.getAccountInformation().googleId); }

Target:
public void testExecuteAndPostProcess() { ______TS("case: view instructor account details"); InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor1OfCourse1.googleId }; final String adminUserId = "admin.user"; gaeSimulation.loginAsAdmin(adminUserId); AdminAccountDetailsPageAction action = getAction(submissionParams); ShowPageResult result = getShowPageResult(action); assertEquals("", result.getStatusMessage()); assertEquals( getPageResultDestination(Const.ViewURIs.ADMIN_ACCOUNT_DETAILS, false, adminUserId), result.getDestinationWithParams()); assertFalse(result.isError); AdminAccountDetailsPageData data = (AdminAccountDetailsPageData) result.data; assertEquals(instructor1OfCourse1.googleId, data.getAccountInformation().googleId); }
Source:
public void testStatsForValuesNodeWithJustNulls() { PlanNodeStatsEstimate nullAStats = PlanNodeStatsEstimate.builder() .setOutputRowCount(1) .addSymbolStatistics(new Symbol("a"), SymbolStatsEstimate.builder() .setDistinctValuesCount(0) .setNullsFraction(NaN) .setAverageRowSize(NaN) .setHighValue(NaN) .setLowValue(NaN) .build()) .build(); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of( ImmutableList.of(expression("3 + null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of( ImmutableList.of(expression("null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", UNKNOWN)), ImmutableList.of( ImmutableList.of(expression("null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); }

Target:
public void testStatsForValuesNodeWithJustNulls() { PlanNodeStatsEstimate nullAStats = PlanNodeStatsEstimate.builder() .setOutputRowCount(1) .addSymbolStatistics(new Symbol("a"), SymbolStatsEstimate.zero()) .build(); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of( ImmutableList.of(expression("3 + null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", BIGINT)), ImmutableList.of( ImmutableList.of(expression("null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); tester().assertStatsFor(pb -> pb .values(ImmutableList.of(pb.symbol("a", UNKNOWN)), ImmutableList.of( ImmutableList.of(expression("null"))))) .check(outputStats -> outputStats.equalTo(nullAStats)); }
Source:
boolean includeClosed(CompositeT left, CompositeT to, List<CompositeT> res) { for (CompositeT next = left.nextSibling(); next != null; next = next.nextSibling()) { if (includeOpen(next, to, res)) { return true; } } if (left.getParent() == null) { throw new IllegalArgumentException("Right bound not found in left's bound hierarchy. to=" + to); } return includeClosed(left.getParent(), to, res); }

Target:
void includeClosed(CompositeT left, CompositeT to, List<CompositeT> res) { for (CompositeT next = left.nextSibling(); next != null; next = next.nextSibling()) { if (includeOpen(next, to, res)) { return; } } if (left.getParent() == null) { throw new IllegalArgumentException("Right bound not found in left's bound hierarchy. to=" + to); } includeClosed(left.getParent(), to, res); }
Source:
public void visit(LwM2mResourceInstance instance) { throw new UnsupportedOperationException("not yet implemented"); }

Target:
public void visit(LwM2mResourceInstance instance) { LOG.trace("Encoding resource instance into JSON", instance); if (!requestPath.isResourceInstance()) { throw new CodecException("Invalid request path %s for JSON resource instance encoding", requestPath); } baseName = requestPath.toString(); ResourceModel rSpec = model.getResourceModel(objectId, instance.getId()); Type expectedType = rSpec != null ? rSpec.type : instance.getType(); JsonArrayEntry jsonArrayEntry = createJsonArrayEntry(null, timestamp, instance.getType(), expectedType, instance.getValue()); resourceList = new ArrayList<>(); resourceList.add(jsonArrayEntry); }
Source:
public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; synchronized (saving) { saving.add(this); } try { getConfigFile().write(this); } finally { synchronized (saving) { saving.remove(this); } } SaveableListener.fireOnChange(this, getConfigFile()); }

Target:
public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getConfigFile().write(this); SaveableListener.fireOnChange(this, getConfigFile()); }
Source:
private void updateEnablement() { boolean upEnabled = false; boolean newFolderEnabled = false; boolean connectionOpen = fConnection.isOpen(); if (connectionOpen) { if (fResources.size() == 1) { IFileStore store = fResources.get(0); if (store.fetchInfo().isDirectory()) { newFolderEnabled = true; } if (store.getParent() != null) { upEnabled = true; } } } if (fUpButton != null) { fUpButton.setEnabled(upEnabled); } if (fNewFolderButton != null) { fNewFolderButton.setEnabled(newFolderEnabled); } if (fRemotePathText != null) { fRemotePathText.setEnabled(connectionOpen); } if (fTreeViewer != null) { fTreeViewer.getTree().setEnabled(connectionOpen); } if (fShowHiddenButton != null) { fShowHiddenButton.setEnabled(connectionOpen); } }

Target:
private void updateEnablement() { boolean upEnabled = false; boolean newFolderEnabled = false; boolean connectionOpen = fConnection != null && fConnection.isOpen(); if (connectionOpen) { if (fResources.size() == 1) { IFileStore store = fResources.get(0); if (store.fetchInfo().isDirectory()) { newFolderEnabled = true; } if (store.getParent() != null) { upEnabled = true; } } } if (fUpButton != null) { fUpButton.setEnabled(upEnabled); } if (fNewFolderButton != null) { fNewFolderButton.setEnabled(newFolderEnabled); } if (fRemotePathText != null) { fRemotePathText.setEnabled(connectionOpen); } if (fTreeViewer != null) { fTreeViewer.getTree().setEnabled(connectionOpen); } if (fShowHiddenButton != null) { fShowHiddenButton.setEnabled(connectionOpen); } }
Source:
protected void doSensorStateChanged(@Nullable HueBridge bridge, @NonNull FullSensor sensor, Configuration config) { Object tmp = sensor.getState().get("temperature"); BigDecimal value = new BigDecimal(String.valueOf(tmp)); DecimalType temperature = new DecimalType(value.divide(new BigDecimal(100))); updateState(HueBindingConstants.CHANNEL_TEMPERATURE, temperature); }

Target:
protected void doSensorStateChanged(@Nullable HueBridge bridge, @NonNull FullSensor sensor, Configuration config) { Object tmp = sensor.getState().get("temperature"); BigDecimal value = new BigDecimal(String.valueOf(tmp)); QuantityType<Temperature> temperature = new QuantityType<>(value.divide(new BigDecimal(100)), SIUnits.CELSIUS); updateState(HueBindingConstants.CHANNEL_TEMPERATURE, temperature); }
Source:
private SubscriptionDescriptor toDescriptor(Subscription subscription, SecurityContext securityContext, Set<String> resolvedRoles) { List<Link> links; if (!"sas-community".equals(subscription.getPlanId())) { final UriBuilder uriBuilder = getServiceContext().getServiceUriBuilder(); links = new ArrayList<>(3); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionById") .build(subscription.getId()) .toString() )); if (securityContext.isUserInRole("account/owner") || securityContext.isUserInRole("system/admin") || securityContext.isUserInRole("system/manager") || (securityContext.isUserInRole("user") && resolvedRoles != null && resolvedRoles.contains("account/owner"))) { links.add(createLink(HttpMethod.DELETE, Constants.LINK_REL_REMOVE_SUBSCRIPTION, null, null, uriBuilder.clone() .path(getClass(), "removeSubscription") .build(subscription.getId()) .toString() )); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION_ATTRIBUTES, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionAttributes") .build(subscription.getId()) .toString() )); } } else { links = Collections.emptyList(); } return DtoFactory.getInstance().createDto(SubscriptionDescriptor.class) .withId(subscription.getId()) .withAccountId(subscription.getAccountId()) .withServiceId(subscription.getServiceId()) .withProperties(subscription.getProperties()) .withPlanId(subscription.getPlanId()) .withLinks(links); }

Target:
private SubscriptionDescriptor toDescriptor(Subscription subscription, SecurityContext securityContext, Set<String> resolvedRoles) { List<Link> links = new ArrayList<>(0); if (!"sas-community".equals(subscription.getPlanId())) { final UriBuilder uriBuilder = getServiceContext().getServiceUriBuilder(); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionById") .build(subscription.getId()) .toString() )); if (securityContext.isUserInRole("account/owner") || securityContext.isUserInRole("system/admin") || securityContext.isUserInRole("system/manager") || (securityContext.isUserInRole("user") && resolvedRoles != null && resolvedRoles.contains("account/owner"))) { links.add(createLink(HttpMethod.DELETE, Constants.LINK_REL_REMOVE_SUBSCRIPTION, null, null, uriBuilder.clone() .path(getClass(), "removeSubscription") .build(subscription.getId()) .toString() )); links.add(createLink(HttpMethod.GET, Constants.LINK_REL_GET_SUBSCRIPTION_ATTRIBUTES, null, MediaType.APPLICATION_JSON, uriBuilder.clone() .path(getClass(), "getSubscriptionAttributes") .build(subscription.getId()) .toString() )); } } return DtoFactory.getInstance().createDto(SubscriptionDescriptor.class) .withId(subscription.getId()) .withAccountId(subscription.getAccountId()) .withServiceId(subscription.getServiceId()) .withProperties(subscription.getProperties()) .withPlanId(subscription.getPlanId()) .withLinks(links); }
Source:
public void shouldGenerateDevfileForFactoryWithNoDevfileOrJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateDevfileFactory(); when(urlFactoryBuilder.buildDefaultDevfile(any())).thenReturn(computedFactory.getDevfile()); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.empty()); when(urlFactoryBuilder.createFactoryFromDevfile(any(RemoteFactoryUrl.class), any(), anyMap())) .thenReturn(Optional.empty()); Map<String, String> params = new HashMap<>(); params.put(URL_PARAMETER_NAME, githubUrl); FactoryDto factory = githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).buildDefaultDevfile(eq("che")); assertEquals(factory, computedFactory); }

Target:
public void shouldGenerateDevfileForFactoryWithNoDevfileOrJson() throws Exception { String githubUrl = "<LINK_0>"; FactoryDto computedFactory = generateDevfileFactory(); when(urlFactoryBuilder.buildDefaultDevfile(any())).thenReturn(computedFactory.getDevfile()); when(urlFactoryBuilder.createFactoryFromJson(any(RemoteFactoryUrl.class))) .thenReturn(Optional.empty()); when(urlFactoryBuilder.createFactoryFromDevfile(any(RemoteFactoryUrl.class), any(), anyMap())) .thenReturn(Optional.empty()); Map<String, String> params = ImmutableMap.of(URL_PARAMETER_NAME, githubUrl); FactoryDto factory = githubFactoryParametersResolver.createFactory(params); verify(urlFactoryBuilder).buildDefaultDevfile(eq("che")); assertEquals(factory, computedFactory); }
Source:
public void setup() { Robolectric.getBackgroundThreadScheduler().pause(); formController = mock(FormController.class); logger = mock(AuditEventLogger.class); formSaver = mock(FormSaver.class); mediaUtils = mock(MediaUtils.class); Analytics analytics = mock(Analytics.class); when(formController.getAuditEventLogger()).thenReturn(logger); when(logger.isChangeReasonRequired()).thenReturn(false); Map<String, String> originalFiles = new HashMap<>(); Map<String, String> recentFiles = new HashMap<>(); originalFiles.put("questionIndex", "blah"); recentFiles.put("questionIndex", "blah"); viewModel = new FormSaveViewModel(savedStateHandle, () -> CURRENT_TIME, formSaver, mediaUtils, analytics); viewModel.formLoaded(formController); }

Target:
public void setup() { Robolectric.getBackgroundThreadScheduler().pause(); formController = mock(FormController.class); logger = mock(AuditEventLogger.class); mediaUtils = mock(MediaUtils.class); Analytics analytics = mock(Analytics.class); when(formController.getAuditEventLogger()).thenReturn(logger); when(logger.isChangeReasonRequired()).thenReturn(false); viewModel = new FormSaveViewModel(savedStateHandle, () -> CURRENT_TIME, formSaver, mediaUtils, analytics); viewModel.formLoaded(formController); }
Source:
public void unsubscribe() { if (once.compareAndSet(false, true)) { threadWorker.schedule(new Action0() { @Override public void call() { pool.release(threadWorker); } }); } innerSubscription.unsubscribe(); }

Target:
public void unsubscribe() { if (once.compareAndSet(false, true)) { threadWorker.schedule(this); } innerSubscription.unsubscribe(); }
Source:
public void testSRTMWithTunnelInterpolation() throws Exception { GraphHopper tmpHopper = new GraphHopperOSM(). setOSMFile(osmFile). setStoreOnFlush(true). setCHEnabled(false). setGraphHopperLocation(tmpGraphFile). setEncodingManager(new EncodingManager("generic," + importVehicles, 8)); tmpHopper.setElevationProvider(new SRTMProvider().setCacheDir(new File(DIR))); tmpHopper.importOrLoad(); GHResponse rsp = tmpHopper.route(new GHRequest(43.74056471749763, 7.4299266210693755, 43.73790260334179, 7.427984089259056). setAlgorithm(ASTAR).setVehicle(vehicle).setWeighting(weightCalcStr)); PathWrapper arsp = rsp.getBest(); assertEquals(351.38545671859913, arsp.getDistance(), .1); assertEquals(6, arsp.getPoints().getSize()); assertTrue(arsp.getPoints().is3D()); assertEquals(Helper.createPointList3D( 43.7405648173518, 7.429926635993867, 17.0, 43.74016602501644, 7.42986703134776, 19.042999267578125, 43.73963796510483, 7.429757507810537, 21.667999267578125, 43.739005969591574, 7.429468797805953, 25.024999618530273, 43.73845425408604, 7.428933846107137, 28.64699935913086, 43.73790260334179, 7.427984089259055, 31.32349967956543 ), arsp.getPoints()); }

Target:
public void testSRTMWithTunnelInterpolation() throws Exception { GraphHopper tmpHopper = new GraphHopperOSM().setOSMFile(osmFile).setStoreOnFlush(true) .setCHEnabled(false).setGraphHopperLocation(tmpGraphFile) .setEncodingManager(new EncodingManager(genericImportVehicles, 8)); tmpHopper.setElevationProvider(new SRTMProvider().setCacheDir(new File(DIR))); tmpHopper.importOrLoad(); GHResponse rsp = tmpHopper.route(new GHRequest(43.74056471749763, 7.4299266210693755, 43.73790260334179, 7.427984089259056).setAlgorithm(ASTAR) .setVehicle(vehicle).setWeighting(weightCalcStr)); PathWrapper arsp = rsp.getBest(); assertEquals(351.39, arsp.getDistance(), PRECISION); PointList pointList = arsp.getPoints(); assertEquals(6, pointList.getSize()); assertTrue(pointList.is3D()); assertEquals(17, pointList.getEle(0), PRECISION); assertEquals(19.04, pointList.getEle(1), PRECISION); assertEquals(21.67, pointList.getEle(2), PRECISION); assertEquals(25.03, pointList.getEle(3), PRECISION); assertEquals(28.65, pointList.getEle(4), PRECISION); assertEquals(31.32, pointList.getEle(5), PRECISION); }
Source:
protected boolean hasIncomingChanges() { TaskAttribute attribute = getModel().getTaskData().getRoot().getAttribute(getTaskAttribute().getId()); if (attribute == null) { return false; } return getModel().hasIncomingChanges(attribute); }

Target:
protected boolean hasIncomingChanges() { TaskAttribute attribute = getModel().getTaskData().getRoot().getMappedAttribute(getTaskAttribute().getPath()); if (attribute == null) { return false; } return getModel().hasIncomingChanges(attribute); }