auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean fillPossiblePathsToTarget(Class<?> targetType, Class<?> currentType, Set<Class<?>> result, Map<Class<?>, Boolean> visitedTypes, boolean isStart) { if (targetType.equals(currentType)) { if (isStart) { if (!result.contains(currentType)) { result.add(currentType); } } return true; } List<Class<?>> options = CanonicalPath.VALID_PROGRESSIONS.get(currentType); if (options == null || options.isEmpty()) { return false; } if (options != null && options.contains(targetType) && isStart) { result.add(targetType); return true; } boolean matched = false; for (Class<?> option : options) { if (!visitedTypes.containsKey(option)) { visitedTypes.put(option, false); if (fillPossiblePathsToTarget(targetType, option, result, visitedTypes, false)) { if (isStart) { result.add(option); } visitedTypes.put(option, true); matched = true; } } else { matched |= visitedTypes.get(option); } } return matched; }

Target:
private boolean fillPossiblePathsToTarget(Class<?> targetType, Class<?> currentType, Set<Class<?>> result, Map<Class<?>, Boolean> visitedTypes, boolean isStart) { if (targetType.equals(currentType)) { if (isStart) { result.add(currentType); } return true; } List<Class<?>> options = CanonicalPath.VALID_PROGRESSIONS.get(currentType); if (options == null || options.isEmpty()) { return false; } if (options != null && options.contains(targetType) && isStart) { result.add(targetType); return true; } boolean matched = false; for (Class<?> option : options) { if (!visitedTypes.containsKey(option)) { visitedTypes.put(option, false); if (fillPossiblePathsToTarget(targetType, option, result, visitedTypes, false)) { if (isStart) { result.add(option); } visitedTypes.put(option, true); matched = true; } } else { matched |= visitedTypes.get(option); } } return matched; }
Source:
public short readHeader(Transport transport, HeaderParams params) { short magic = transport.readByte(); final Log localLog = getLog(); boolean isTrace = localLog.isTraceEnabled(); if (magic != HotRodConstants.RESPONSE_MAGIC) { String message = "Invalid magic number. Expected %#x and received %#x"; localLog.invalidMagicNumber(HotRodConstants.RESPONSE_MAGIC, magic); if (isTrace) localLog.tracef("Socket dump: %s", hexDump(transport.dumpStream())); throw new InvalidResponseException(String.format(message, HotRodConstants.RESPONSE_MAGIC, magic)); } long receivedMessageId = transport.readVLong(); if (receivedMessageId != params.messageId && receivedMessageId != 0) { String message = "Invalid message id. Expected %d and received %d"; localLog.invalidMessageId(params.messageId, receivedMessageId); if (isTrace) localLog.tracef("Socket dump: %s", hexDump(transport.dumpStream())); throw new InvalidResponseException(String.format(message, params.messageId, receivedMessageId)); } localLog.tracef("Received response for message id: %d", receivedMessageId); short receivedOpCode = transport.readByte(); short status = transport.readByte(); readNewTopologyIfPresent(transport, params); if (receivedOpCode != params.opRespCode) { if (receivedOpCode == HotRodConstants.ERROR_RESPONSE) { checkForErrorsInResponseStatus(transport, params, status); } throw new InvalidResponseException(String.format( "Invalid response operation. Expected %#x and received %#x", params.opRespCode, receivedOpCode)); } localLog.tracef("Received operation code is: %#04x", receivedOpCode); return status; }

Target:
public short readHeader(Transport transport, HeaderParams params) { short magic = transport.readByte(); final Log localLog = getLog(); if (magic != HotRodConstants.RESPONSE_MAGIC) { String message = "Invalid magic number. Expected %#x and received %#x"; localLog.invalidMagicNumber(HotRodConstants.RESPONSE_MAGIC, magic); if (trace) localLog.tracef("Socket dump: %s", hexDump(transport.dumpStream())); throw new InvalidResponseException(String.format(message, HotRodConstants.RESPONSE_MAGIC, magic)); } long receivedMessageId = transport.readVLong(); if (receivedMessageId != params.messageId && receivedMessageId != 0) { String message = "Invalid message id. Expected %d and received %d"; localLog.invalidMessageId(params.messageId, receivedMessageId); if (trace) localLog.tracef("Socket dump: %s", hexDump(transport.dumpStream())); throw new InvalidResponseException(String.format(message, params.messageId, receivedMessageId)); } if (trace) localLog.tracef("Received response for message id: %d", receivedMessageId); short receivedOpCode = transport.readByte(); short status = transport.readByte(); readNewTopologyIfPresent(transport, params); if (receivedOpCode != params.opRespCode) { if (receivedOpCode == HotRodConstants.ERROR_RESPONSE) { checkForErrorsInResponseStatus(transport, params, status); } throw new InvalidResponseException(String.format( "Invalid response operation. Expected %#x and received %#x", params.opRespCode, receivedOpCode)); } if (trace) localLog.tracef("Received operation code is: %#04x", receivedOpCode); return status; }
Source:
public void onActivityResumed(Activity activity) { if (isInBackground) { isInBackground = false; for (Pojo pojo : KissApplication.getApplication(activity).getDataHandler().getApplications()) { if (!(pojo instanceof AppPojo)) continue; AppPojo appPojo = (AppPojo) pojo; ComponentName componentName = new ComponentName(appPojo.packageName, appPojo.activityName); MemoryCacheHelper.cacheAppIconDrawable(activity, componentName, appPojo.userHandle); } } }

Target:
public void onActivityResumed(Activity activity) { for (Pojo pojo : KissApplication.getApplication(activity).getDataHandler().getApplications()) { if (!(pojo instanceof AppPojo)) continue; AppPojo appPojo = (AppPojo) pojo; ComponentName componentName = new ComponentName(appPojo.packageName, appPojo.activityName); MemoryCacheHelper.cacheAppIconDrawable(activity, componentName, appPojo.userHandle); } }
Source:
private void populateReviews(List<TaskReview> reviewContainers) { for (ITask review : reviews) { try { int codeReviewVal = Integer.parseInt(review.getAttribute(Messages.CodeReviewAttribute)); int verifiedVal = Integer.parseInt(review.getAttribute(Messages.VerifiedAttribute)); reviewContainers.add(new TaskReview(review.getSummary(), codeReviewVal, verifiedVal, "")); hasIncoming = true; } catch (NumberFormatException e) { StatusHandler .log(new Status(IStatus.ERROR, ID_TASK_EDITOR_REVIEWS_PART, "Error parsing to integer", e)); } } }

Target:
private void populateReviews(List<TaskReview> reviewContainers) throws NumberFormatException { for (ITask review : reviews) { int codeReviewVal = Integer .parseInt(review.getAttribute(Messages.TaskEditorReviewsPart_CodeReviewAttribute)); int verifiedVal = Integer.parseInt(review.getAttribute(Messages.TaskEditorReviewsPart_VerifiedAttribute)); boolean incoming = false; if (review.getSynchronizationState() == ITask.SynchronizationState.INCOMING) { hasIncoming = true; incoming = true; } reviewContainers.add( new TaskReview(review.getSummary(), codeReviewVal, verifiedVal, "", incoming, review.getUrl())); } }
Source:
public Response<Certificate> mergeCertificateWithResponse(MergeCertificateOptions mergeCertificateConfig, Context context) { Objects.requireNonNull(mergeCertificateConfig, "The merge certificate configuration cannot be null."); return client.mergeCertificateWithResponse(mergeCertificateConfig, context).block(); }

Target:
public Response<Certificate> mergeCertificateWithResponse(MergeCertificateOptions mergeCertificateConfig, Context context) { Objects.requireNonNull(mergeCertificateConfig, "'mergeCertificateConfig' cannot be null."); return client.mergeCertificateWithResponse(mergeCertificateConfig, context).block(); }
Source:
public static String modPtr(Element propertyOrParameter) { String ptr = ""; Ptr cppPtr = UMLUtil.getStereotypeApplication(propertyOrParameter, Ptr.class); if (cppPtr != null) { ptr = (cppPtr.getDeclaration() != null) ? cppPtr.getDeclaration() : "*"; } else { if (propertyOrParameter instanceof Property) { if (((Property) propertyOrParameter).getAggregation() == AggregationKind.SHARED_LITERAL) { ptr += "*"; } else { ptr = ""; } } else { ptr = ""; } } boolean ptrOrRef = GenUtils.hasStereotype(propertyOrParameter, Ref.class) || GenUtils.hasStereotype(propertyOrParameter, Ptr.class); if (propertyOrParameter instanceof Parameter) { ParameterDirectionKind directionKind = ((Parameter) propertyOrParameter).getDirection(); if (directionKind == ParameterDirectionKind.OUT_LITERAL || directionKind == ParameterDirectionKind.INOUT_LITERAL) { if (!ptrOrRef) { ptr += CppCodeGenUtils.getOutInoutOp(); } } } return ptr; }

Target:
public static String modPtr(Element propertyOrParameter) { String ptr; Ptr cppPtr = UMLUtil.getStereotypeApplication(propertyOrParameter, Ptr.class); if (cppPtr != null) { ptr = (cppPtr.getDeclaration() != null) ? cppPtr.getDeclaration() : "*"; } else { if (propertyOrParameter instanceof Property && ((Property) propertyOrParameter).getAggregation() == AggregationKind.SHARED_LITERAL) { ptr = "*"; } else { ptr = ""; } } boolean ptrOrRef = GenUtils.hasStereotype(propertyOrParameter, Ref.class) || GenUtils.hasStereotype(propertyOrParameter, Ptr.class); if (propertyOrParameter instanceof Parameter) { ParameterDirectionKind directionKind = ((Parameter) propertyOrParameter).getDirection(); if (directionKind == ParameterDirectionKind.OUT_LITERAL || directionKind == ParameterDirectionKind.INOUT_LITERAL) { if (!ptrOrRef) { ptr += CppCodeGenUtils.getOutInoutOp(); } } } return ptr; }
Source:
public void removeVariable(final String identifier) { Variable variable = getVariable(identifier); if (variable == null) throw new RuntimeException("variable identifier to remove <" + identifier + "> not found."); fVariables.remove(variable); }

Target:
public void removeVariable(final String identifier) { Variable variable = getVariable(identifier); if (variable == null) return; removeVariable(variable); }
Source:
public void cancel(@Nullable Call<?> call) { if (call == null) { return; } call.cancel(); call = null; }

Target:
public void cancel(@Nullable Call<?> call) { if (call == null) { return; } call.cancel(); }
Source:
@Override public void closeConnection() { try { if (subscription != null) subscription.close(); if (connection != null) connection.close(); } catch (Exception e) { log.error("An error occurred while closing the connection. ", e); } connection = null; subscription = null; }

Target:
@Override public void closeConnection() { try { if (subscription != null) { subscription.close(); } if (connection != null) { connection.close(); } } catch (InterruptedException | IOException | TimeoutException e) { log.error("An error occurred while closing the connection. ", e); } connection = null; subscription = null; }
Source:
public static List<String> extractTags(final List<String> repoTags) { if(repoTags.isEmpty()) { return Collections.emptyList(); } final List<String> tags = new ArrayList<>(); for(String repoTag : repoTags) { final int indexOfColonChar = repoTag.indexOf(':'); if(indexOfColonChar == -1) { continue; } tags.add(repoTag.substring(indexOfColonChar+1)); } Collections.sort(tags); return tags; }

Target:
public static List<String> extractTags(final List<String> repoTags) { if(repoTags.isEmpty()) { return Collections.emptyList(); } final List<String> tags = new ArrayList<>(); for(String repoTag : repoTags) { final int indexOfColonChar = repoTag.indexOf(':'); if(indexOfColonChar == -1) { continue; } tags.add(repoTag.substring(indexOfColonChar+1)); } return tags; }
Source:
public Optional<ConsumerGroup> describeConsumerGroup(SubscriptionName subscription) { ConsumerGroupId consumerGroupId = kafkaNamesMapper.toConsumerGroupId(subscription); try { return describeConsumerGroup(consumerGroupId); } catch (Exception e) { logger.error("Failed to describe group with id: " + consumerGroupId.asString(), e); return Optional.empty(); } }

Target:
public Optional<ConsumerGroup> describeConsumerGroup(SubscriptionName subscription) { ConsumerGroupId consumerGroupId = kafkaNamesMapper.toConsumerGroupId(subscription); try { return describeConsumerGroup(consumerGroupId); } catch (Exception e) { logger.error("Failed to describe group with id: {}", consumerGroupId.asString(), e); return Optional.empty(); } }
Source:
private void getAccessToken(String code) { OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .addHeader("User-Agent", "Android Dev Preview") .addHeader("Content-Type", "application/x-www-form-urlencoded") .url(ACCESS_TOKEN_URL) .post(RequestBody.create(MediaType.parse("application/x-www-form-urlencoded"), "grant_type=authorization_code&client_id=" + CLIENT_ID + "&client_secret=" + CLIENT_SECRET + "&redirect_uri=" + REDIRECT_URI + "&code=" + code)) .build(); client.newCall(request).enqueue(new okhttp3.Callback() { @Override public void onFailure(okhttp3.Call call, IOException exception) { } @Override public void onResponse(okhttp3.Call call, okhttp3.Response response) throws IOException { String json = response.body().string(); JSONObject data = null; try { data = new JSONObject(json); String accessToken = data.optString("access_token"); try { getUsernameFromJwt(accessToken); } catch (Exception exception) { exception.printStackTrace(); } getUserInfo(username, accessToken); } catch (JSONException exception) { exception.printStackTrace(); } } }); }

Target:
private void getAccessToken(String code) { String clientSecret = getString(R.string.mapbox_auth_flow_secret); Log.d("AccountRetrievalService", "getAccessToken: clientSecret = " + clientSecret); OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .addHeader("User-Agent", "Android Dev Preview") .addHeader("Content-Type", "application/x-www-form-urlencoded") .url(ACCESS_TOKEN_URL) .post(RequestBody.create(MediaType.parse("application/x-www-form-urlencoded"), "grant_type=authorization_code&client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=" + redirectUri + "&code=" + code)) .build(); client.newCall(request).enqueue(new okhttp3.Callback() { @Override public void onFailure(okhttp3.Call call, IOException exception) { Log.d("AccountRetrievalService", "onFailure: " + exception); } @Override public void onResponse(okhttp3.Call call, okhttp3.Response response) throws IOException { String json = response.body().string(); try { JSONObject data = new JSONObject(json); String accessToken = data.optString("access_token"); try { getUsernameFromJwt(accessToken); } catch (Exception exception) { exception.printStackTrace(); } getUserInfo(username, accessToken); } catch (JSONException exception) { exception.printStackTrace(); } } }); }
Source:
public JwtAuthenticationToken build() { final Jwt token = jwt.build(); return new JwtAuthenticationToken(token, authoritiesConverter.convert(token)); }

Target:
public JwtAuthenticationToken build() { final Jwt token = jwt.build(); return new JwtAuthenticationToken(token, getAuthorities(token)); }
Source:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { boolean isGet = request.getTargetCase() == ReadRowsRequest.TargetCase.ROW_KEY; PooledChannel reservedChannel = isGet ? null : channelPool.reserveChannel(); Channel channel = isGet ? channelPool : reservedChannel; if (isGet) { reservedChannel = null; channel = channelPool; } else { reservedChannel = channelPool.reserveChannel(); channel = reservedChannel; } ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = createCancellationToken(reservedChannel, readRowsCall); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); int streamingBufferSize = retryOptions.getStreamingBufferSize(); int batchRequestSize = retryOptions.getStreamingBatchSize(); ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, streamingBufferSize, batchRequestSize, batchRequestSize, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, createClientCallListener(reservedChannel, resultScanner)); if (batchRequestSize > 1) { readRowsCall.request(batchRequestSize - 1); } return resultScanner; }

Target:
private ResultScanner<Row> streamRows(ReadRowsRequest request) { boolean isGet = request.getTargetCase() == ReadRowsRequest.TargetCase.ROW_KEY; Channel channel = isGet ? channelPool : channelPool.reserveChannel(); ClientCall<ReadRowsRequest, ReadRowsResponse> readRowsCall = channel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS, CallOptions.DEFAULT); CancellationToken cancellationToken = createCancellationToken(channel, readRowsCall); int timeout = retryOptions.getReadPartialRowTimeoutMillis(); int streamingBufferSize = retryOptions.getStreamingBufferSize(); int batchRequestSize = retryOptions.getStreamingBatchSize(); ResponseQueueReader responseQueueReader = new ResponseQueueReader(timeout, streamingBufferSize, batchRequestSize, batchRequestSize, readRowsCall); StreamingBigtableResultScanner resultScanner = new StreamingBigtableResultScanner(responseQueueReader, cancellationToken); clientCallService.asyncServerStreamingCall( readRowsCall, request, createClientCallListener(channel, resultScanner)); if (batchRequestSize > 1) { readRowsCall.request(batchRequestSize - 1); } return resultScanner; }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View root = inflater.inflate(R.layout.nav_list, container, false); ListView navList = root.findViewById(R.id.nav_list); navAdapter = new NavListAdapter(itemAccess, getActivity()); navList.setAdapter(navAdapter); navList.setOnItemClickListener(this); navList.setOnItemLongClickListener(this); registerForContextMenu(navList); updateSelection(); root.findViewById(R.id.nav_settings).setOnClickListener(v -> startActivity(new Intent(getActivity(), PreferenceActivity.class))); getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) .registerOnSharedPreferenceChangeListener(this); progressBar = root.findViewById(R.id.progressBar); progressBar.bringToFront(); return root; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View root = inflater.inflate(R.layout.nav_list, container, false); progressBar = root.findViewById(R.id.progressBar); ListView navList = root.findViewById(R.id.nav_list); navAdapter = new NavListAdapter(itemAccess, getActivity()); navList.setAdapter(navAdapter); navList.setOnItemClickListener(this); navList.setOnItemLongClickListener(this); registerForContextMenu(navList); updateSelection(); root.findViewById(R.id.nav_settings).setOnClickListener(v -> startActivity(new Intent(getActivity(), PreferenceActivity.class))); getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) .registerOnSharedPreferenceChangeListener(this); return root; }
Source:
public void setMap(MapBean map) { this.map = map; Image image; if (map.getLargeThumbnailUrl() != null) { image = mapService.loadPreview(map.getLargeThumbnailUrl(), PreviewSize.LARGE); } else { image = IdenticonUtil.createIdenticon(map.getId()); } thumbnailImageView.setImage(image); nameLabel.setText(map.getDisplayName()); authorLabel.setText(Optional.ofNullable(map.getAuthor()).orElse(i18n.get("map.unknownAuthor"))); numberOfPlaysLabel.setText(i18n.number(map.getNumberOfPlays())); MapSize size = map.getSize(); sizeLabel.setText(i18n.get("mapPreview.size", size.getWidthInKm(), size.getHeightInKm())); maxPlayersLabel.setText(i18n.number(map.getPlayers())); if (mapService.isOfficialMap(map.getFolderName())) { installButton.setDisable(false); uninstallButton.setDisable(false); installButton.setVisible(false); uninstallButton.setVisible(false); } else { ObservableList<MapBean> installedMaps = mapService.getInstalledMaps(); JavaFxUtil.addListener(installedMaps, new WeakListChangeListener<>(installStatusChangeListener)); setInstalled(mapService.isInstalled(map.getFolderName())); } ObservableList<Review> reviews = map.getReviews(); JavaFxUtil.addListener(reviews, new WeakInvalidationListener(reviewsChangedListener)); reviewsChangedListener.invalidated(reviews); }

Target:
public void setMap(MapBean map) { this.map = map; Image image; if (map.getLargeThumbnailUrl() != null) { image = mapService.loadPreview(map.getLargeThumbnailUrl(), PreviewSize.LARGE); } else { image = IdenticonUtil.createIdenticon(map.getId()); } thumbnailImageView.setImage(image); nameLabel.setText(map.getDisplayName()); authorLabel.setText(Optional.ofNullable(map.getAuthor()).orElse(i18n.get("map.unknownAuthor"))); numberOfPlaysLabel.setText(i18n.number(map.getNumberOfPlays())); MapSize size = map.getSize(); sizeLabel.setText(i18n.get("mapPreview.size", size.getWidthInKm(), size.getHeightInKm())); maxPlayersLabel.setText(i18n.number(map.getPlayers())); if (mapService.isOfficialMap(map.getFolderName())) { installButton.setVisible(false); uninstallButton.setVisible(false); } else { ObservableList<MapBean> installedMaps = mapService.getInstalledMaps(); JavaFxUtil.addListener(installedMaps, new WeakListChangeListener<>(installStatusChangeListener)); setInstalled(mapService.isInstalled(map.getFolderName())); } ObservableList<Review> reviews = map.getReviews(); JavaFxUtil.addListener(reviews, new WeakInvalidationListener(reviewsChangedListener)); reviewsChangedListener.invalidated(reviews); }
Source:
private static void appendConditionalAttributes(Subject subject, StringBuilder messageBuilder) { String attributes = System.getProperty(EXTRA_ATTRIBUTES_PROP); if (subject == null) { subject = ThreadContext.getSubject(); } if (attributes != null) { List<String> attributeList = Arrays.asList(attributes.split(",")); for (String attribute : attributeList) { List<String> attributeValueList = SubjectUtils.getAttribute(subject, attribute); if (attributeValueList != null && !attributeValueList.isEmpty()) { messageBuilder.append(" " + attribute + " : " + attributeValueList.get(0)); } } } }

Target:
private static void appendConditionalAttributes(Subject subject, StringBuilder messageBuilder) { String attributes = System.getProperty(EXTRA_ATTRIBUTES_PROP); if (attributes == null) { return; } if (subject == null) { subject = ThreadContext.getSubject(); } List<String> attributeList = Arrays.asList(attributes.split(",")); for (String attribute : attributeList) { List<String> attributeValueList = SubjectUtils.getAttribute(subject, attribute); if (CollectionUtils.isNotEmpty(attributeValueList)) { messageBuilder.append(" ").append(attribute).append(" : "); if (attributeValueList.size() > 1) { messageBuilder.append(attributeValueList); } else { messageBuilder.append(attributeValueList.get(0)); } } } }
Source:
public boolean matches(Scan scan) { int offset = scanNumberRange == null ? 1 : scanNumberRange.lowerEndpoint(); return matches(scan, offset); }

Target:
public boolean matches(Scan scan) { int offset; if (scanNumberRange != null) offset = scanNumberRange.lowerEndpoint(); else { if (scan.getDataFile() != null && scan.getDataFile().getScanNumbers().length > 0) offset = scan.getDataFile().getScanNumbers()[0]; else offset = 1; } return matches(scan, offset); }
Source:
public synchronized ListenableFuture<Supplier<PagesSpatialIndex>> createPagesSpatialIndex() { activeProbeOperators.retain(); if (pagesSpatialIndex != null) { return immediateFuture(pagesSpatialIndex); } SettableFuture<Supplier<PagesSpatialIndex>> future = SettableFuture.create(); pagesSpatialIndexFutures.add(future); return future; }

Target:
public synchronized ListenableFuture<PagesSpatialIndex> createPagesSpatialIndex() { activeProbeOperators.retain(); if (pagesSpatialIndex != null) { return immediateFuture(pagesSpatialIndex.get()); } SettableFuture<PagesSpatialIndex> future = SettableFuture.create(); pagesSpatialIndexFutures.add(future); return future; }
Source:
public long startMillis() { return _startTime.getMillis(); }

Target:
private long startMillis() { return _startTime.getMillis(); }
Source:
public void executeTask() throws MojoExecutionException, MojoFailureException { serverId = wizard.promptForExistingServerIdIfMissing(serverId); Server server = Server.loadServer(serverId); if(server.hasWatchedProjects()){ boolean pullingError = false; Set<Project> watchedProjects = server.getWatchedProjects(); for(Project project: watchedProjects) { wizard.showMessage(String.format(UPDATING_MODULE_MESSAGE, project.getArtifactId())); if (pullLatestUpstream(project.getPath())) { wizard.showMessage(String.format(PULL_SUCCESS_MESSAGE, project.getArtifactId())); } else { getLog().error(String.format(PULL_ERROR_MESSAGE, project.getArtifactId(), failureReason)); getLog().error(UPDATE_MANUALLY_MESSAGE); pullingError = true; } } if(pullingError){ throw new MojoExecutionException("Some modules could not be updated automatically, please see error messages above"); } }else { wizard.showMessage(String.format(NO_WATCHED_MODULES_MESSAGE, serverId)); } }

Target:
public void executeTask() throws MojoExecutionException, MojoFailureException { serverId = wizard.promptForExistingServerIdIfMissing(serverId); Server server = Server.loadServer(serverId); if(server.hasWatchedProjects()){ Set<Project> watchedProjects = server.getWatchedProjects(); CompositeException allExceptions = new CompositeException("Could not updated latest changes"); for(Project project: watchedProjects) { try { pullLatestUpstream(project.getPath()); updatedModules.add(project.getArtifactId()); } catch (Exception e) { allExceptions.add(project.getPath(), e); try { cleanUp(project.getPath(), project.getArtifactId()); notUpdatedModules.add(project.getArtifactId() + DASH + String.format(CONFLICT_ERROR_MESSAGE, e.getMessage())); } catch (IllegalStateException e1) { allExceptions.add(project.getPath(), e1); notUpdatedModules.add(project.getArtifactId() + DASH + String.format(CONFLICT_ERROR_MESSAGE, e.getMessage()) + ". " + e1.getMessage()); } } } displayUpdatedModules(); displayNotUpdatedModules(); allExceptions.checkAndThrow(); }else { wizard.showMessage(String.format(NO_WATCHED_MODULES_MESSAGE, serverId)); } }
Source:
public void paint(final Graphics2D graphics, final GridCoverage2DReader gridCoverageReader, GeneralParameterValue[] readParams, final RasterSymbolizer symbolizer, Interpolation interpolation, final Color background) throws Exception { if (graphics == null) { throw new NullPointerException(Errors.format(ErrorKeys.NULL_ARGUMENT_$1, "graphics")); } if (gridCoverageReader == null) { throw new NullPointerException(Errors.format(ErrorKeys.NULL_ARGUMENT_$1, "gridCoverageReader")); } if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine(new StringBuilder("Drawing reader ").append(gridCoverageReader.toString()) .toString()); setupInterpolationHints(interpolation); int[] bandIndicesTmp = null; ChannelSelection channelSelection = symbolizer.getChannelSelection(); if (channelSelection!=null){ SelectedChannelType[] channels = channelSelection.getSelectedChannels(); if (channels!=null){ bandIndicesTmp = new int[channels.length]; for (int i=0;i<channels.length;i++){ bandIndicesTmp[i]= Integer.parseInt(channels[i].getChannelName())-1; } } } final int[] bandIndices = bandIndicesTmp; Parameter<int[]> bandIndicesParam = null; if (gridCoverageReader.getFormat().getReadParameters().getDescriptor().descriptors(). contains(AbstractGridFormat.BANDS) && bandIndices != null) { bandIndicesParam = (Parameter<int[]>) AbstractGridFormat.BANDS.createValue(); bandIndicesParam.setValue(bandIndices); List<GeneralParameterValue> paramList = new ArrayList<GeneralParameterValue>(); paramList.addAll(Arrays.asList(readParams)); paramList.add(bandIndicesParam); readParams = paramList.toArray(new GeneralParameterValue[paramList.size()]); } RenderedImage finalImage = renderImage(gridCoverageReader, readParams, symbolizer, interpolation, background); if (finalImage != null) { try { paintImage(graphics, finalImage); } finally { if (finalImage instanceof PlanarImage) { ImageUtilities.disposePlanarImageChain((PlanarImage) finalImage); } } } }

Target:
public void paint(final Graphics2D graphics, final GridCoverage2DReader gridCoverageReader, GeneralParameterValue[] readParams, final RasterSymbolizer symbolizer, Interpolation interpolation, final Color background) throws Exception { if (graphics == null) { throw new NullPointerException(Errors.format(ErrorKeys.NULL_ARGUMENT_$1, "graphics")); } if (gridCoverageReader == null) { throw new NullPointerException(Errors.format(ErrorKeys.NULL_ARGUMENT_$1, "gridCoverageReader")); } if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine(new StringBuilder("Drawing reader ").append(gridCoverageReader.toString()) .toString()); setupInterpolationHints(interpolation); RasterSymbolizer finalSymbolizer = symbolizer; if (isBandsSelectionApplicable(gridCoverageReader, symbolizer)){ applyBandsSelectionParameter(gridCoverageReader, readParams, symbolizer); finalSymbolizer = setupSymbolizerForBandsSelection(symbolizer); } RenderedImage finalImage = renderImage(gridCoverageReader, readParams, finalSymbolizer, interpolation, background); if (finalImage != null) { try { paintImage(graphics, finalImage); } finally { if (finalImage instanceof PlanarImage) { ImageUtilities.disposePlanarImageChain((PlanarImage) finalImage); } } } }
Source:
public void setOnlyReloadable(String parseOptionKey) { if (Boolean.parseBoolean(parseOptionKey)) { onlyReloadable = true; } else { onlyReloadable = false; } }

Target:
public void setOnlyReloadable(String parseOptionKey) { onlyReloadable = Boolean.parseBoolean(parseOptionKey); }
Source:
public void initialise() { sceneOpaqueFbo = displayResolutionDependentFBOs.get(SCENE_OPAQUE); playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(SCENE_OPAQUE, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL.toString())); }

Target:
public void initialise() { wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new EnableMaterial(DEFAULT_TEXTURED_MATERIAL.toString())); }
Source:
public void testPath() { Path path = new Path(Book.class, dictionary, "genre"); ImmutableList<PathElement> pathElements = ImmutableList.of( new PathElement(Book.class, String.class, "genre")); assertEquals("example_Book", path.getAlias()); assertEquals("genre", path.getFieldPath()); assertEquals(pathElements, path.getPathElements()); assertEquals(Optional.of(pathElements.get(0)), path.lastElement()); assertEquals("[Book].genre", path.toString()); path = new Path(Book.class, dictionary, "this.editor.firstName"); pathElements = ImmutableList.of( new PathElement(getClassType(Book.class), null, "this"), new PathElement(Book.class, Editor.class, "editor"), new PathElement(Editor.class, String.class, "firstName")); assertEquals("example_Book_editor", path.getAlias()); assertEquals("this.editor.firstName", path.getFieldPath()); assertEquals(pathElements, path.getPathElements()); assertEquals(Optional.of(pathElements.get(2)), path.lastElement()); assertEquals("[Book].this/[Book].editor/[Editor].firstName", path.toString()); }

Target:
public void testPath() { Path path = new Path(Book.class, dictionary, "genre"); ImmutableList<PathElement> pathElements = ImmutableList.of( new PathElement(Book.class, String.class, "genre")); assertEquals("example_Book", path.getAlias()); assertEquals("genre", path.getFieldPath()); assertEquals(pathElements, path.getPathElements()); assertEquals(Optional.of(pathElements.get(0)), path.lastElement()); assertEquals("[Book].genre", path.toString()); path = new Path(Book.class, dictionary, "this.editor.firstName"); pathElements = ImmutableList.of( new PathElement(Book.class, null, "this"), new PathElement(Book.class, Editor.class, "editor"), new PathElement(Editor.class, String.class, "firstName")); assertEquals("example_Book_editor", path.getAlias()); assertEquals("this.editor.firstName", path.getFieldPath()); assertEquals(pathElements, path.getPathElements()); assertEquals(Optional.of(pathElements.get(2)), path.lastElement()); assertEquals("[Book].this/[Book].editor/[Editor].firstName", path.toString()); }
Source:
public ViewBinder(@NonNull final RepositoryView view, @NonNull final RepositoryViewModel viewModel) { this.view = view; this.viewModel = viewModel; }

Target:
public ViewBinder(@NonNull final RepositoryView view, @NonNull final RepositoryViewModel viewModel) { Preconditions.checkNotNull(view, "View cannot be null."); Preconditions.checkNotNull(viewModel, "ViewModel cannot be null."); this.view = view; this.viewModel = viewModel; }
Source:
public HashCodeBuilder(final int prime) { super(); this.prime = prime; }

Target:
public HashCodeBuilder(final int prime) { this.prime = prime; }
Source:
private SortedSet<String> readTags(String itemName) { MetadataKey key = new MetadataKey(TAG_NAMESPACE, itemName); SortedSet<String> tags = new TreeSet<>(); if (metadataRegistry != null) { Metadata metadata = metadataRegistry.get(key); if (metadata != null) { tags.addAll(Arrays.asList(metadata.getValue().split("\\" + TAG_SEPARATOR))); } } return tags; }

Target:
private SortedSet<String> readTags(String itemName) { MetadataKey key = new MetadataKey(TAG_NAMESPACE, itemName); SortedSet<String> tags = new TreeSet<>(); Metadata metadata = metadataRegistry.get(key); if (metadata != null) { tags.addAll(Arrays.asList(metadata.getValue().split(TAG_SPLIT_REGEX))); } return tags; }
Source:
private static boolean enableDynamicCodeGeneration() { boolean enabled = !DalvikVmChecker.isDalvikVm(); String property = System.getProperty("msgpack.dynamic-codegen.enabled"); if (property != null) { enabled = Boolean.parseBoolean(property); } return enabled; }

Target:
private static boolean enableDynamicCodeGeneration() { return !DalvikVmChecker.isDalvikVm() && Boolean.parseBoolean(System.getProperties().getProperty("msgpack.dynamic-codegen.enabled", "true")); }
Source:
private List<NetworkSend> prepareSends(List<ResponseInfo> responseInfoList) { List<NetworkSend> sends = new ArrayList<NetworkSend>(); ListIterator<RequestMetadata> iter = pendingRequests.listIterator(); while (iter.hasNext()) { RequestMetadata requestMetadata = iter.next(); if (time.milliseconds() - requestMetadata.requestQueuedTimeMs > checkoutTimeoutMs) { responseInfoList.add( new ResponseInfo(requestMetadata.requestInfo.getRequest(), NetworkClientErrorCode.ConnectionUnavailable, null)); iter.remove(); } else { iter.previous(); break; } } while (iter.hasNext()) { RequestMetadata requestMetadata = iter.next(); try { String host = requestMetadata.requestInfo.getHost(); Port port = requestMetadata.requestInfo.getPort(); String connId = connectionTracker.checkOutConnection(host, port); if (connId == null) { if (connectionTracker.mayCreateNewConnection(host, port)) { connId = selector.connect(new InetSocketAddress(host, port.getPort()), networkConfig.socketSendBufferBytes, networkConfig.socketReceiveBufferBytes, port.getPortType()); connectionTracker.addNewConnection(host, port, connId); } } else { sends.add(new NetworkSend(connId, requestMetadata.requestInfo.getRequest(), networkRequestMetrics, time)); requestMetadata.connId = connId; connectionIdToRequestInFlight.put(connId, requestMetadata); iter.remove(); } } catch (IOException e) { logger.error("Received exception while checking out a connection", e); } } return sends; }

Target:
private List<NetworkSend> prepareSends(List<ResponseInfo> responseInfoList) { List<NetworkSend> sends = new ArrayList<NetworkSend>(); ListIterator<RequestMetadata> iter = pendingRequests.listIterator(); while (iter.hasNext()) { RequestMetadata requestMetadata = iter.next(); if (time.milliseconds() - requestMetadata.requestQueuedTimeMs > checkoutTimeoutMs) { responseInfoList.add( new ResponseInfo(requestMetadata.requestInfo.getRequest(), NetworkClientErrorCode.ConnectionUnavailable, null)); iter.remove(); } else { iter.previous(); break; } } while (iter.hasNext()) { RequestMetadata requestMetadata = iter.next(); try { String host = requestMetadata.requestInfo.getHost(); Port port = requestMetadata.requestInfo.getPort(); String connId = connectionTracker.checkOutConnection(host, port); if (connId == null) { if (connectionTracker.mayCreateNewConnection(host, port)) { connId = selector.connect(new InetSocketAddress(host, port.getPort()), networkConfig.socketSendBufferBytes, networkConfig.socketReceiveBufferBytes, port.getPortType()); connectionTracker.startTrackingInitiatedConnection(host, port, connId); } } else { sends.add(new NetworkSend(connId, requestMetadata.requestInfo.getRequest(), null, time)); connectionIdToRequestInFlight.put(connId, requestMetadata); iter.remove(); } } catch (IOException e) { logger.error("Received exception while checking out a connection", e); } } return sends; }
Source:
public List<LogrotateAdditionalFile> getExtrasFiles() { final List<SingularityExecutorLogrotateAdditionalFile> original = configuration.getLogrotateAdditionalFiles(); final List<LogrotateAdditionalFile> transformed = new ArrayList<>(original.size()); for (SingularityExecutorLogrotateAdditionalFile additionalFile : original) { String dateformat; if (additionalFile.getDateformat().isPresent()) { dateformat = additionalFile.getDateformat().get().startsWith("-") ? additionalFile.getDateformat().get().substring(1) : additionalFile.getDateformat().get(); } else { dateformat = configuration.getLogrotateExtrasDateformat().startsWith("-") ? configuration.getLogrotateExtrasDateformat().substring(1) : configuration.getLogrotateExtrasDateformat(); } transformed.add( new LogrotateAdditionalFile( taskDefinition.getTaskDirectoryPath().resolve(additionalFile.getFilename()).toString(), additionalFile.getExtension().or(Strings.emptyToNull(Files.getFileExtension(additionalFile.getFilename()))), dateformat, additionalFile.getLogrotateFrequencyOverride() )); } return transformed; }

Target:
public List<LogrotateAdditionalFile> getExtrasFiles() { return getAllExtraFiles().stream() .filter(p -> !p.getLogrotateFrequencyOverride().equals(SingularityExecutorLogrotateFrequency.HOURLY.getLogrotateValue())) .collect(Collectors.toList()); }
Source:
public static void viewBlogStats(Context context, SiteModel site) { if (site == null) { ToastUtils.showToast(context, R.string.stats_cannot_be_started, ToastUtils.Duration.SHORT); } else { Intent intent = new Intent(context, org.wordpress.android.ui.stats.refresh.StatsActivity.class); intent.putExtra(WordPress.SITE, site); context.startActivity(intent); } }

Target:
public static void viewBlogStats(Context context, SiteModel site) { if (site == null) { AppLog.e(T.STATS, "SiteModel is null when opening the stats."); AnalyticsTracker.track( STATS_ACCESS_ERROR, ActivityLauncher.class.getName(), "NullPointerException", "Failed to open Stats because of the null SiteModel" ); ToastUtils.showToast(context, R.string.stats_cannot_be_started, ToastUtils.Duration.SHORT); } else { Intent intent = new Intent(context, org.wordpress.android.ui.stats.refresh.StatsActivity.class); intent.putExtra(WordPress.SITE, site); context.startActivity(intent); } }
Source:
public void testQueryFullProcessImageName() { HANDLE h = Kernel32.INSTANCE.OpenProcess(0, false, Kernel32.INSTANCE.GetCurrentProcessId()); assertNotNull("Failed (" + Kernel32.INSTANCE.GetLastError() + ") to get process handle", h); char[] path = new char[WinDef.MAX_PATH]; IntByReference lpdwSize = new IntByReference(path.length); boolean b = Kernel32.INSTANCE.QueryFullProcessImageName(h, 0, path, lpdwSize); Kernel32.INSTANCE.CloseHandle(h); assertTrue("Failed (" + Kernel32.INSTANCE.GetLastError() + ") to query process image name", b); assertTrue("Failed to query process image name, empty path returned", lpdwSize.getValue() > 0); }

Target:
public void testQueryFullProcessImageName() { HANDLE h = Kernel32.INSTANCE.OpenProcess(0, false, Kernel32.INSTANCE.GetCurrentProcessId()); assertNotNull("Failed (" + Kernel32.INSTANCE.GetLastError() + ") to get process handle", h); try { char[] path = new char[WinDef.MAX_PATH]; IntByReference lpdwSize = new IntByReference(path.length); boolean b = Kernel32.INSTANCE.QueryFullProcessImageName(h, 0, path, lpdwSize); assertTrue("Failed (" + Kernel32.INSTANCE.GetLastError() + ") to query process image name", b); assertTrue("Failed to query process image name, empty path returned", lpdwSize.getValue() > 0); } finally { Kernel32.INSTANCE.CloseHandle(h); } }
Source:
public void setNickname(String nickname) { this.nickname = nickname; }

Target:
public void setNickname(String nickname) { this._nickname = nickname; }
Source:
public AuditLogType getAuditLogTypeValue() { addCustomValue("SessionID", StringUtils.isEmpty(sessionId) ? UNKNOWN : sessionId); addCustomValue("SourceIP", StringUtils.isEmpty(sourceIp) ? UNKNOWN : sourceIp); if (getActionReturnValue() == CreateUserSessionsError.NUM_OF_SESSIONS_EXCEEDED) { addCustomValue("NumMaxSessions", String.valueOf(EngineLocalConfig.getInstance().getInteger("ENGINE_MAX_USER_SESSIONS"))); return AuditLogType.USER_NUM_SESSIONS_EXCEEDED; } else { return getSucceeded() ? AuditLogType.USER_VDC_SESSION_TERMINATED : AuditLogType.USER_VDC_SESSION_TERMINATION_FAILED; } }

Target:
public AuditLogType getAuditLogTypeValue() { addCustomValue("SessionID", StringUtils.isEmpty(sessionId) ? UNKNOWN : sessionId); addCustomValue("SourceIP", StringUtils.isEmpty(sourceIp) ? UNKNOWN : sourceIp); return getSucceeded() ? AuditLogType.USER_VDC_SESSION_TERMINATED : AuditLogType.USER_VDC_SESSION_TERMINATION_FAILED; }
Source:
public void setNotificationUrl(String url) { if ((url.startsWith("http://") || url.startsWith("https://")) && url.contains(".")) { this.url = url; } }

Target:
public void setNotificationUrl(String url) { if (URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url)) { this.url = url; } }
Source:
public static String getStackTrace(Throwable throwable) { final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw, true); throwable.printStackTrace(pw); return sw.getBuffer().toString(); }

Target:
public static String getStackTrace(Throwable throwable) { StringWriter sw = null; PrintWriter pw = null; try { sw = new StringWriter(); pw = new PrintWriter(sw, true); throwable.printStackTrace(pw); return sw.getBuffer().toString(); } finally { Closeables.closeQuietly(sw, pw); } }
Source:
public void start() { URL log4jProperties = SarosServer.class .getResource(LOGGING_CONFIG_FILE); PropertyConfigurator.configure(log4jProperties); ArrayList<IContextFactory> factories = new ArrayList<IContextFactory>(); factories.add(new ServerContextFactory()); context = new ContainerContext(factories, null); context.initialize(); connectToXMPPServer(); context.getComponent(ISarosSessionManager.class).startSession(new HashMap<>()); }

Target:
public void start() { URL log4jProperties = SarosServer.class .getResource(LOGGING_CONFIG_FILE); PropertyConfigurator.configure(log4jProperties); lifecycle.start(); }
Source:
public ServerContext getServerContext() { try { return new ServerContext(config.getAccumuloSiteFile().toURI().toURL()); } catch (MalformedURLException e) { throw new IllegalStateException("Failed to create ServerContext", e); } }

Target:
public synchronized ServerContext getServerContext() { if (context == null) { context = new ServerContext(siteConfig); } return context; }
Source:
public static boolean keysContainCollationsOrderless( List<Integer> keys, List<RelCollation> collations) { final List<Integer> distinctKeys = Util.distinctList(keys); for (RelCollation collation : collations) { if (containsOrderless(distinctKeys, collation)) { return true; } } return false; }

Target:
public static boolean keysContainCollationsOrderless( List<Integer> keys, List<RelCollation> collations) { for (RelCollation collation : collations) { if (containsOrderless(keys, collation)) { return true; } } return false; }
Source:
public static PublicKey FromBytes(byte[] key) { Preconditions.checkArgument(key != null); Preconditions.checkArgument(key.length == PUBLIC_KEY_SIZE); return new PublicKey(JNI.PublicKey_FromBytes(key), true); }

Target:
public static PublicKey FromBytes(byte[] key) { Preconditions.checkNotNull(key); Preconditions.checkArgument(key.length == PUBLIC_KEY_SIZE); return new PublicKey(JNI.PublicKey_FromBytes(key), true); }
Source:
if (fsa == null) { fsa = new FSAccessJava(); }

Target:
if (fsa == null) fsa = new FSAccessJava(); INSTANCE = fsa; } public static final Throwable getNativeImplementationLoadException() { return nativeLoadError; }
Source:
public PaymentRequestEntity build() { PaymentRequestEntity entity = new PaymentRequestEntity(); entity.setId(this.id); entity.setReturnUrl(this.returnUrl); entity.setReference(this.reference); entity.setGatewayAccount(this.gatewayAccountEntity); entity.setExternalId(this.externalId); entity.setDescription(this.description); entity.setCreatedDate(this.createdDate); entity.setAmount(this.amount); return entity; }

Target:
public PaymentRequestEntity build() { PaymentRequestEntity entity = new PaymentRequestEntity(); entity.setReturnUrl(this.returnUrl); entity.setReference(this.reference); entity.setGatewayAccount(this.gatewayAccountEntity); entity.setExternalId(this.externalId); entity.setDescription(this.description); entity.setCreatedDate(this.createdDate); entity.setAmount(this.amount); return entity; }
Source:
public void testCreate() throws Exception { server.enqueue(jsonResponse("/createvirtualmachineresponse.json")); String id = "/subscriptions/SUBSCRIPTIONID/" + "resourceGroups/groupname/providers/Microsoft.Compute/virtualMachines/windowsmachine"; final VirtualMachineApi vmAPI = api.getVirtualMachineApi("groupname"); VirtualMachine vm = vmAPI.create("windowsmachine", id, "windowsmachine", "westus", getProperties()); assertEquals(vm, getVM()); assertSent(server, "PUT", "/subscriptions/SUBSCRIPTIONID/resourceGroups/groupname/providers/Microsoft.Compute" + "/virtualMachines/windowsmachine?api-version=2015-06-15&validating=false"); }

Target:
public void testCreate() throws Exception { server.enqueue(jsonResponse("/createvirtualmachineresponse.json")); final VirtualMachineApi vmAPI = api.getVirtualMachineApi("groupname"); VirtualMachine vm = vmAPI.create("windowsmachine", "westus", getProperties()); assertEquals(vm, getVM()); assertSent(server, "PUT", "/subscriptions/SUBSCRIPTIONID/resourceGroups/groupname/providers/Microsoft.Compute" + "/virtualMachines/windowsmachine?api-version=2015-06-15&validating=false", "{\"location\":\"westus\",\"properties\":" + "{\"vmId\":\"27ee085b-d707-xxxx-yyyy-2370e2eb1cc1\"," + "\"hardwareProfile\":{\"vmSize\":\"Standard_D1\"}," + "\"storageProfile\":{\"imageReference\":{\"publisher\":\"publisher\",\"offer\":\"offer\",\"sku\":\"sku\",\"version\":\"ver\"}," + "\"osDisk\":{\"osType\":\"Windows\",\"name\":\"windowsmachine\"," + "\"vhd\":{\"uri\":\"<LINK_0>\"},\"caching\":\"ReadWrite\",\"createOption\":\"FromImage\"},\"dataDisks\":[]}," + "\"osProfile\":{\"computerName\":\"windowsmachine\",\"adminUsername\":\"azureuser\",\"windowsConfiguration\":{\"provisionVMAgent\":false,\"enableAutomaticUpdates\":true}}," + "\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"/subscriptions/SUBSCRIPTIONID/resourceGroups/groupname/providers/Microsoft.Network/networkInterfaces/windowsmachine167\"}]}," + "\"diagnosticsProfile\":{\"bootDiagnostics\":{\"enabled\":true,\"storageUri\":\"<LINK_1>\"}},\"provisioningState\":\"Creating\"}}"); }
Source:
private void cancelAutomaticTransitionToHalfOpen() { if (transitionToHalfOpenFuture != null) { transitionToHalfOpenFuture.cancel(true); } }

Target:
private void cancelAutomaticTransitionToHalfOpen() { if (transitionToHalfOpenFuture != null && !transitionToHalfOpenFuture.isDone()) { transitionToHalfOpenFuture.cancel(true); } }