auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public File provisionInputFiles() { Map<String, String> wdlInputs = null; WdlBridge wdlBridge = new WdlBridge(); try { wdlInputs = wdlBridge.getInputFiles(localPrimaryDescriptorFile.getAbsolutePath()); } catch (Exception ex) { exceptionMessage(ex, "Problem parsing WDL file: " + ex.getMessage(), API_ERROR); } WDLFileProvisioning wdlFileProvisioning = new WDLFileProvisioning(abstractEntryClient.getConfigFile()); Gson gson = new Gson(); String jsonString = null; try { jsonString = abstractEntryClient.fileToJSON(selectedParameterFile); } catch (IOException ex) { errorMessage(ex.getMessage(), IO_ERROR); } Map<String, Object> inputJson = gson.fromJson(jsonString, HashMap.class); if (!isLocalEntry) { workingDirectory = tempLaunchDirectory.getAbsolutePath(); } else { workingDirectory = Paths.get(entry).toAbsolutePath().normalize().getParent().toString(); } System.out.println("Creating directories for run of Dockstore launcher in current working directory: " + workingDirectory); notificationsClient.sendMessage(NotificationsClient.PROVISION_INPUT, true); try { Map<String, Object> fileMap = wdlFileProvisioning.pullFiles(inputJson, wdlInputs); return new File(wdlFileProvisioning.createUpdatedInputsJson(inputJson, fileMap)); } catch (Exception e) { notificationsClient.sendMessage(NotificationsClient.PROVISION_INPUT, false); throw e; } }

Target:
public File provisionInputFiles() { Map<String, String> wdlInputs = null; WdlBridge wdlBridge = new WdlBridge(); try { wdlInputs = wdlBridge.getInputFiles(localPrimaryDescriptorFile.getAbsolutePath()); } catch (WdlParser.SyntaxError ex) { exceptionMessage(ex, "Problem parsing WDL file: " + ex.getMessage(), API_ERROR); } WDLFileProvisioning wdlFileProvisioning = new WDLFileProvisioning(abstractEntryClient.getConfigFile()); Gson gson = new Gson(); String jsonString = null; try { jsonString = abstractEntryClient.fileToJSON(selectedParameterFile); } catch (IOException ex) { errorMessage(ex.getMessage(), IO_ERROR); } Map<String, Object> inputJson = gson.fromJson(jsonString, HashMap.class); if (!isLocalEntry) { workingDirectory = tempLaunchDirectory.getAbsolutePath(); } else { workingDirectory = Paths.get(entry).toAbsolutePath().normalize().getParent().toString(); } System.out.println("Creating directories for run of Dockstore launcher in current working directory: " + workingDirectory); notificationsClient.sendMessage(NotificationsClient.PROVISION_INPUT, true); try { Map<String, Object> fileMap = wdlFileProvisioning.pullFiles(inputJson, wdlInputs); return new File(wdlFileProvisioning.createUpdatedInputsJson(inputJson, fileMap)); } catch (Exception e) { notificationsClient.sendMessage(NotificationsClient.PROVISION_INPUT, false); throw e; } }
Source:
public void subscribeToAllPollEventStopPollingAfterNSecondsTest() { Duration pollInterval = Duration.ofSeconds(1); Duration waitTime = Duration.ofSeconds(3); PollResponse<Response> success = new PollResponse<>(OperationStatus.SUCCESSFULLY_COMPLETED, new Response("Created: Cert A")); PollResponse<Response> inProgress = new PollResponse<>(OperationStatus.IN_PROGRESS, new Response("Starting : Cert A")); when(pollOperation.apply(any())).thenReturn(Mono.just(inProgress), Mono.just(inProgress), Mono.just(success)); Poller<Response> poller = new Poller<>(pollInterval, pollOperation, null, ignored -> new PollResponse<Response>(OperationStatus.USER_CANCELLED, null)); StepVerifier.create(poller.getObserver()) .expectNext(inProgress) .then(() -> poller.setAutoPollingEnabled(false)) .expectNoEvent(waitTime) .then(() -> poller.cancelOperation()) .verifyError(); Assert.assertEquals(OperationStatus.IN_PROGRESS, poller.getStatus()); Assert.assertFalse(poller.isAutoPollingEnabled()); }

Target:
public void subscribeToAllPollEventStopPollingAfterNSecondsTest() { Duration pollInterval = Duration.ofSeconds(1); Duration waitTime = Duration.ofSeconds(3); PollResponse<Response> success = new PollResponse<>(OperationStatus.SUCCESSFULLY_COMPLETED, new Response("Created: Cert A")); PollResponse<Response> inProgress = new PollResponse<>(OperationStatus.IN_PROGRESS, new Response("Starting : Cert A")); when(pollOperation.apply(any())).thenReturn(Mono.just(inProgress), Mono.just(inProgress), Mono.just(success)); Poller<Response> poller = new Poller<>(pollInterval, pollOperation, null, ignored -> new PollResponse<Response>(OperationStatus.USER_CANCELLED, null)); StepVerifier.create(poller.getObserver()) .expectNext(inProgress) .then(() -> poller.setAutoPollingEnabled(false)) .expectNoEvent(waitTime) .thenCancel() .verify(); Assert.assertEquals(OperationStatus.IN_PROGRESS, poller.getStatus()); Assert.assertFalse(poller.isAutoPollingEnabled()); }
Source:
public Call<MwQueryResponse<QueryResult>> request(@NonNull Service service, @NonNull List<PageTitle> titles, @NonNull final Callback cb) { Call<MwQueryResponse<QueryResult>> call = service.request(TextUtils.join("|", titles), titles.size()); call.enqueue(new retrofit2.Callback<MwQueryResponse<QueryResult>>() { @Override public void onResponse(Call<MwQueryResponse<QueryResult>> call, Response<MwQueryResponse<QueryResult>> response) { if (response.isSuccessful()) { if (response.body().success()) { cb.success(call, response.body().query().pages()); } else if (response.body().hasError()) { cb.failure(call, new MwException(response.body().getError())); } else { cb.failure(call, new IOException("An unknown error occurred.")); } } else { cb.failure(call, RetrofitException.httpError(response, cachedService.retrofit())); } } @Override public void onFailure(Call<MwQueryResponse<QueryResult>> call, Throwable t) { cb.failure(call, t); } }); return call; }

Target:
public Call<MwQueryResponse<QueryResult>> request(@NonNull Service service, @NonNull List<PageTitle> titles, @NonNull final Callback cb) { Call<MwQueryResponse<QueryResult>> call = service.request(TextUtils.join("|", titles), titles.size()); call.enqueue(new retrofit2.Callback<MwQueryResponse<QueryResult>>() { @Override public void onResponse(Call<MwQueryResponse<QueryResult>> call, Response<MwQueryResponse<QueryResult>> response) { if (response.isSuccessful()) { if (response.body().success()) { cb.success(call, response.body().query().pages()); } else if (response.body().hasError()) { cb.failure(call, new MwException(response.body().getError())); } else { cb.failure(call, new IOException("An unknown error occurred.")); } } else { cb.failure(call, RetrofitException.httpError(response)); } } @Override public void onFailure(Call<MwQueryResponse<QueryResult>> call, Throwable t) { cb.failure(call, t); } }); return call; }
Source:
public void onVideoCallScreenUiReady() { LogUtil.v("VideoCallPresenter.onVideoCallScreenUiReady", ""); Assert.checkState(!isVideoCallScreenUiReady); if (!CompatUtils.isVideoCompatible()) { return; } mDeviceOrientation = InCallOrientationEventListener.getCurrentOrientation(); InCallPresenter.getInstance().addListener(this); InCallPresenter.getInstance().addDetailsListener(this); InCallPresenter.getInstance().addIncomingCallListener(this); InCallPresenter.getInstance().addOrientationListener(this); InCallPresenter.getInstance().addInCallEventListener(this); InCallPresenter.getInstance().getLocalVideoSurfaceTexture().setDelegate(new LocalDelegate()); InCallPresenter.getInstance().getRemoteVideoSurfaceTexture().setDelegate(new RemoteDelegate()); InCallVideoCallCallbackNotifier.getInstance().addSurfaceChangeListener(this); mCurrentVideoState = VideoProfile.STATE_AUDIO_ONLY; mCurrentCallState = DialerCall.State.INVALID; isVideoCallScreenUiReady = true; InCallPresenter.InCallState inCallState = InCallPresenter.getInstance().getInCallState(); onStateChange(inCallState, inCallState, CallList.getInstance()); }

Target:
public void onVideoCallScreenUiReady() { LogUtil.v("VideoCallPresenter.onVideoCallScreenUiReady", ""); Assert.checkState(!isVideoCallScreenUiReady); if (!CompatUtils.isVideoCompatible()) { return; } mDeviceOrientation = InCallOrientationEventListener.getCurrentOrientation(); InCallPresenter.getInstance().addListener(this); InCallPresenter.getInstance().addDetailsListener(this); InCallPresenter.getInstance().addIncomingCallListener(this); InCallPresenter.getInstance().addOrientationListener(this); InCallPresenter.getInstance().addInCallEventListener(this); InCallPresenter.getInstance().getLocalVideoSurfaceTexture().setDelegate(new LocalDelegate()); InCallPresenter.getInstance().getRemoteVideoSurfaceTexture().setDelegate(new RemoteDelegate()); InCallVideoCallCallbackNotifier.getInstance().addSurfaceChangeListener(this); mCurrentVideoState = VideoProfile.STATE_AUDIO_ONLY; mCurrentCallState = DialerCall.State.INVALID; InCallPresenter.InCallState inCallState = InCallPresenter.getInstance().getInCallState(); onStateChange(inCallState, inCallState, CallList.getInstance()); isVideoCallScreenUiReady = true; }
Source:
private boolean isInLayoutingMode(GraphicalEditPart graphicalEditPart) { View notationView = graphicalEditPart.getNotationView(); if (notationView != null) { Diagram diagram = notationView.getDiagram(); if (diagram != null) { EObject element = diagram.getElement(); if (element instanceof DDiagram && ((DDiagram) element).isIsInLayoutingMode()) { return true; } } } return false; }

Target:
private boolean isInLayoutingMode(GraphicalEditPart graphicalEditPart) { View notationView = graphicalEditPart.getNotationView(); if (notationView != null) { Diagram diagram = notationView.getDiagram(); if (diagram != null) { EObject element = diagram.getElement(); return element instanceof DDiagram && ((DDiagram) element).isIsInLayoutingMode(); } } return false; }
Source:
private Boolean checkCanSyncSolr(String studyStr, String sessionId) throws CatalogException { String userId = catalogManager.getUserManager().getUserId(sessionId); if ("admin".equals(userId)) { return true; } return authorizationManager.checkCanSyncSolr(studyStr, userId); }

Target:
private Boolean checkCanSyncSolr(String studyStr, String sessionId) throws CatalogException { String userId = catalogManager.getUserManager().getUserId(sessionId); return authorizationManager.checkCanSyncSolr(studyStr, userId); }
Source:
public Object getValueAt(int rowIndex, int columnIndex) { if(columnIndex == KEY_COLUMN) { return getKeyAt(rowIndex); } else if(columnIndex == PREVIEW_COLUMN){ return getPreviewAt(rowIndex); } else if(columnIndex == INTERVAL_COLUMN){ SortedSet<Double> ts = getMappedLegend().keySet(); Double d = getKeyAt(rowIndex); SortedSet<Double> tail = ts.tailSet(d); StringBuilder sb = new StringBuilder(); sb.append("["); if(Double.isInfinite(d)){ sb.append("-").append(Character.toString('\u221e')) ; }else { sb.append(d); } sb.append(";"); if(tail.size() == 1){ sb.append("+").append(Character.toString('\u221e')); } else { Iterator<Double> it = tail.iterator(); it.next(); sb.append(+it.next()); } sb.append("["); return sb.toString(); } throw new IndexOutOfBoundsException("We did not found a column at index "+columnIndex+" !"); }

Target:
public Object getValueAt(int rowIndex, int columnIndex) { if(columnIndex == KEY_COLUMN) { return getKeyAt(rowIndex); } else if(columnIndex == PREVIEW_COLUMN){ return getPreviewAt(rowIndex); } else if(columnIndex == INTERVAL_COLUMN){ SortedSet<Double> ts = getMappedLegend().keySet(); Double d = getKeyAt(rowIndex); SortedSet<Double> tail = ts.tailSet(d); StringBuilder sb = new StringBuilder(); if(Double.isInfinite(d)){ sb.append("]"); sb.append("-").append(Character.toString('\u221e')) ; }else { sb.append("["); String numS = Math.abs(d) < 1.0 ? Double.toString(KeyCellRenderer.getRounded(d,DIGITS_NUMBER)): formatter.format(d); sb.append(numS); } sb.append("; "); if(tail.size() == 1){ sb.append("+").append(Character.toString('\u221e')); } else { Iterator<Double> it = tail.iterator(); it.next(); Double nd = it.next(); String numS = Math.abs(nd) < 1.0 ? Double.toString(KeyCellRenderer.getRounded(nd,DIGITS_NUMBER)): formatter.format(nd); sb.append(numS); } sb.append("["); return sb.toString(); } throw new IndexOutOfBoundsException("We did not found a column at index "+columnIndex+" !"); }
Source:
public void testServices() { final List<Service> resultServices = this.kubernetesJobManagerSpecification.getAccompanyingResources() .stream() .filter(x -> x instanceof Service) .map(x -> (Service) x) .collect(Collectors.toList()); assertEquals(2, resultServices.size()); final List<Service> internalServiceCandidates = resultServices .stream() .filter(x -> x.getMetadata().getName().equals(KubernetesUtils.getInternalServiceName(CLUSTER_ID))) .collect(Collectors.toList()); assertEquals(1, internalServiceCandidates.size()); final List<Service> restServiceCandidates = resultServices .stream() .filter(x -> x.getMetadata().getName().equals(KubernetesUtils.getRestServiceName(CLUSTER_ID))) .collect(Collectors.toList()); assertEquals(1, restServiceCandidates.size()); final Service resultInternalService = internalServiceCandidates.get(0); assertEquals(2, resultInternalService.getMetadata().getLabels().size()); assertNull(resultInternalService.getSpec().getType()); assertEquals("None", resultInternalService.getSpec().getClusterIP()); assertEquals(2, resultInternalService.getSpec().getPorts().size()); assertEquals(5, resultInternalService.getSpec().getSelector().size()); final Service resultRestService = restServiceCandidates.get(0); assertEquals(2, resultRestService.getMetadata().getLabels().size()); assertEquals(resultRestService.getSpec().getType(), "LoadBalancer"); assertEquals(1, resultRestService.getSpec().getPorts().size()); assertEquals(5, resultRestService.getSpec().getSelector().size()); }

Target:
public void testServices() { final List<Service> resultServices = this.kubernetesJobManagerSpecification.getAccompanyingResources() .stream() .filter(x -> x instanceof Service) .map(x -> (Service) x) .collect(Collectors.toList()); assertEquals(2, resultServices.size()); final List<Service> internalServiceCandidates = resultServices .stream() .filter(x -> x.getMetadata().getName().equals(KubernetesUtils.getInternalServiceName(CLUSTER_ID))) .collect(Collectors.toList()); assertEquals(1, internalServiceCandidates.size()); final List<Service> restServiceCandidates = resultServices .stream() .filter(x -> x.getMetadata().getName().equals(KubernetesUtils.getRestServiceName(CLUSTER_ID))) .collect(Collectors.toList()); assertEquals(1, restServiceCandidates.size()); final Service resultInternalService = internalServiceCandidates.get(0); assertEquals(2, resultInternalService.getMetadata().getLabels().size()); assertNull(resultInternalService.getSpec().getType()); assertEquals(Constants.HEADLESS_SERVICE_CLUSTER_IP, resultInternalService.getSpec().getClusterIP()); assertEquals(2, resultInternalService.getSpec().getPorts().size()); assertEquals(5, resultInternalService.getSpec().getSelector().size()); final Service resultRestService = restServiceCandidates.get(0); assertEquals(2, resultRestService.getMetadata().getLabels().size()); assertEquals(resultRestService.getSpec().getType(), "LoadBalancer"); assertEquals(1, resultRestService.getSpec().getPorts().size()); assertEquals(5, resultRestService.getSpec().getSelector().size()); }
Source:
public AgentFilterService.InspectionReport inspect(@Valid final AgentClientMetadata agentClientMetadata) { final String minimumVersionString = this.agentFilterProperties.getMinimumVersion(); if (StringUtils.isNotBlank(minimumVersionString)) { final String agentVersionString = agentClientMetadata.getVersion().orElse(null); if (StringUtils.isNotBlank(agentVersionString)) { final ArtifactVersion minimumVersion = new DefaultArtifactVersion(minimumVersionString); final ArtifactVersion agentVersion = new DefaultArtifactVersion(agentVersionString); System.out.println( "" + minimumVersion + " vs " + agentVersion + " -> " + minimumVersion.compareTo(agentVersion) ); if (minimumVersion.compareTo(agentVersion) > 0) { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.REJECT, "Agent version " + agentVersionString + " is lower than minimum " + minimumVersionString ); } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.INCONCLUSIVE, "Agent version " + agentVersionString + " meets minimum " + minimumVersionString ); } } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.REJECT, "Agent version not set, minimum is: " + minimumVersionString ); } } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.INCONCLUSIVE, "Minimum version not set" ); } }

Target:
public AgentFilterService.InspectionReport inspect(@Valid final AgentClientMetadata agentClientMetadata) { final String minimumVersionString = this.agentFilterProperties.getMinimumVersion(); if (StringUtils.isNotBlank(minimumVersionString)) { final String agentVersionString = agentClientMetadata.getVersion().orElse(null); if (StringUtils.isNotBlank(agentVersionString)) { final ArtifactVersion minimumVersion = new DefaultArtifactVersion(minimumVersionString); final ArtifactVersion agentVersion = new DefaultArtifactVersion(agentVersionString); System.out.println( "" + minimumVersion + " vs " + agentVersion + " -> " + minimumVersion.compareTo(agentVersion) ); if (minimumVersion.compareTo(agentVersion) > 0) { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.REJECT, "Agent version " + agentVersionString + " is lower than minimum " + minimumVersionString ); } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.CONTINUE, "Agent version " + agentVersionString + " meets minimum " + minimumVersionString ); } } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.REJECT, "Agent version not set, minimum is: " + minimumVersionString ); } } else { return new AgentFilterService.InspectionReport( AgentFilterService.InspectionReport.InspectionDecision.CONTINUE, "Minimum version not set" ); } }
Source:
private InputStream createFileInputStream(Path path) throws FileNotFoundException, IOException { final java.nio.file.Path nioPath = createJavaNioPath(path); final String name = path.toString(); if (profiler.isActive() && (profiler.isProfiling(ProfilerTask.VFS_READ) || profiler.isProfiling(ProfilerTask.VFS_OPEN))) { long startTime = Profiler.nanoTimeMaybe(); try { return new ProfiledInputStream(Files.newInputStream(nioPath), name); } finally { profiler.logSimpleTask(startTime, ProfilerTask.VFS_OPEN, name); } } else { return Files.newInputStream(nioPath, java.nio.file.StandardOpenOption.READ); } }

Target:
protected InputStream createFileInputStream(Path path) throws FileNotFoundException, IOException { return new FileInputStream(path.toString()); }
Source:
public void disableOkButton() { okButton.classList.add("disabled"); }

Target:
public void disableOkButton() { okButton.classList.add(DISABLED_CLASS); }
Source:
public DownloadRequest into(ImageView imageView) { final DownloadRequestImpl downloadRequestImpl = new DownloadRequestImpl(downloadRequestBuilderStrategy, imageView); if (source instanceof String) { if (isCloudinaryPublicIdSource) { Url url = MediaManager.get().url().publicId(source).transformation(transformation); if (responsive != null) { responsive.generate(url, imageView, new ResponsiveUrl.Callback() { @Override public void onUrlReady(Url url) { setUrl(downloadRequestImpl, url.generate()); } }); } else { setUrl(downloadRequestImpl, url.generate()); } } else { setUrl(downloadRequestImpl, (String) source); } } else if (source instanceof Integer) { downloadRequestBuilderStrategy.load((Integer) source); } else { throw new IllegalStateException("load must be called before calling into!"); } if (placeholder != 0) { downloadRequestBuilderStrategy.placeholder(placeholder); } return downloadRequestImpl.start(); }

Target:
public DownloadRequest into(ImageView imageView) { final DownloadRequestImpl downloadRequestImpl = new DownloadRequestImpl(downloadRequestBuilderStrategy, imageView); if (source == null) { throw new IllegalStateException("Source is null."); } if (source instanceof String) { if (isCloudinaryPublicIdSource) { Url url = MediaManager.get().url().publicId(source).transformation(transformation); if (responsive != null) { responsive.generate(url, imageView, new ResponsiveUrl.Callback() { @Override public void onUrlReady(Url url) { downloadRequestImpl.setSource(url.generate()); } }); } else { downloadRequestImpl.setSource(url.generate()); } } else { downloadRequestImpl.setSource(source); } } else if (source instanceof Integer) { downloadRequestImpl.setSource(source); } else { throw new IllegalArgumentException("Load source is not an instance of a correct type."); } if (placeholder != 0) { downloadRequestBuilderStrategy.placeholder(placeholder); } if (callback != null) { downloadRequestBuilderStrategy.callback(callback); } return downloadRequestImpl.start(); }
Source:
public TimestampService createTimestampService(KeyValueService rawKvs, Optional<TableReference> timestampTable) { AtlasDbVersion.ensureVersionReported(); return PersistentTimestampService.create(JdbcTimestampBoundStore.create((JdbcKeyValueService) rawKvs)); }

Target:
public TimestampService createTimestampService(KeyValueService rawKvs, Optional<TableReference> timestampTable) { Preconditions.checkArgument(!timestampTable.isPresent() || timestampTable.get().equals(AtlasDbConstants.TIMESTAMP_TABLE), "***ERROR:This can cause severe data corruption.***\nUnexpected timestamp table found: " + timestampTable.map(TableReference::getQualifiedName).orElse("unknown table") + "\nThis can happen if you configure the timelock server to use JDBC KVS for timestamp" + " persistence, which is unsupported.\nWe recommend using the default paxos timestamp" + " persistence. However, if you are need to persist the timestamp service state in the" + " database, please specify a valid DbKvs config in the timestampBoundPersister block." + "\nNote that if the service has already been running, you will have to migrate the timestamp" + " table to Postgres/Oracle and rename it to %s.", AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE); AtlasDbVersion.ensureVersionReported(); return PersistentTimestampService.create(JdbcTimestampBoundStore.create((JdbcKeyValueService) rawKvs)); }
Source:
public static void MakeUser() throws SQLException { Connection conn = null; PreparedStatement stmt = null; ResultSet res = null; try { conn = DriverManager.getConnection("jdbc:default:connection"); String sql = "INSERT INTO Users (Name, UserName) VALUES ('user1', 'fromproc')"; stmt = conn.prepareStatement(sql); stmt.execute(); } finally { if (stmt != null) { stmt.close(); } if (conn != null) { conn.close(); } } }

Target:
public static void MakeUser() throws SQLException { try ( Connection conn = DriverManager.getConnection("jdbc:default:connection"); Statement stmt = conn.createStatement(); ) { String sql = "INSERT INTO Users (Name, UserName) VALUES ('user1', 'fromproc')"; stmt.execute(sql); } }
Source:
private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORT_STATE) { log.warnFormat("Cannot remove memory volumes, invalid format: {0}", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { AsyncTaskManager.getInstance().StartPollingTask(memoryImageRemovalTaskId); } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { AsyncTaskManager.getInstance().StartPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }

Target:
private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORY_STATE) { log.warnFormat("Cannot remove memory volumes, invalid format: {0}", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { AsyncTaskManager.getInstance().StartPollingTask(memoryImageRemovalTaskId); } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { AsyncTaskManager.getInstance().StartPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }
Source:
public Iterable<String> getEdgeIds(Vertex otherVertex, Direction direction, String label, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction); return getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labelToArrayOrNull(label), authorizations); }

Target:
public Iterable<String> getEdgeIds(Vertex otherVertex, Direction direction, String label, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction, label); return getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labelToArrayOrNull(label), authorizations); }
Source:
private String getImageName() throws MojoExecutionException { List<ImageConfiguration> images = getResolvedImages(); if (saveName == null && saveAlias == null) { List<ImageConfiguration> buildImages = getImagesWithBuildConfig(images); if (buildImages.isEmpty()) { log.info("No images have a build configuration defined: save skipped"); return null; } if (buildImages.size() == 1) { return buildImages.get(0).getName(); } throw new MojoExecutionException("More than one image with build configuration is defined. Please specify the image with 'docker.name' or 'docker.alias'."); } if (saveName != null && saveAlias != null) { throw new MojoExecutionException("Cannot specify both name and alias."); } for (ImageConfiguration ic : images) { if (equalName(ic) || equalAlias(ic)) { return ic.getName(); } } throw new MojoExecutionException(saveName != null ? "Can not find image with name '" + saveName + "'" : "Can not find image with alias '"+ saveAlias + "'"); }

Target:
private String getImageName() throws MojoExecutionException { List<ImageConfiguration> images = getResolvedImages(); if (saveName == null && saveAlias == null) { List<ImageConfiguration> buildImages = getImagesWithBuildConfig(images); if (buildImages.size() == 1) { return buildImages.get(0).getName(); } throw new MojoExecutionException("More than one image with build configuration is defined. Please specify the image with 'docker.name' or 'docker.alias'."); } if (saveName != null && saveAlias != null) { throw new MojoExecutionException("Cannot specify both name and alias."); } for (ImageConfiguration ic : images) { if (equalName(ic) || equalAlias(ic)) { return ic.getName(); } } throw new MojoExecutionException(saveName != null ? "Can not find image with name '" + saveName + "'" : "Can not find image with alias '"+ saveAlias + "'"); }
Source:
private void notifyListeners() { for (LifecycleListener lifecycleListener : context.getLifecycleListeners()) { try { lifecycleListener.onSessionReady(); } catch (Throwable t) { Loggers.warnWithException( LOG, "[{}] Error while notifying of session ready", logPrefix, lifecycleListener, t); } } NodeStateListener nodeStateListener = context.getNodeStateListener(); if (nodeStateListener instanceof SessionAwareNodeStateListener) { ((SessionAwareNodeStateListener) nodeStateListener).onSessionReady(DefaultSession.this); } }

Target:
private void notifyListeners() { for (LifecycleListener lifecycleListener : context.getLifecycleListeners()) { try { lifecycleListener.onSessionReady(); } catch (Throwable t) { Loggers.warnWithException( LOG, "[{}] Error while notifying of session ready", logPrefix, lifecycleListener, t); } } context.getNodeStateListener().onSessionReady(DefaultSession.this); schemaListenerNotifier.onSessionReady(DefaultSession.this); context.getRequestTracker().onSessionReady(DefaultSession.this); }
Source:
public String getLocation() { return bundle != null ? bundle.getLocation() : ""; }

Target:
public String getLocation() { return bundle.getLocation(); }
Source:
private static void waitInitialized() { ListenableFuture<Void> future; synchronized (sInitDeinitLock) { future = sInitDeinitFuture; } if (!future.isDone()) { try { future.get(WAIT_INITIALIZED_TIMEOUT, TimeUnit.SECONDS); } catch (ExecutionException | InterruptedException | TimeoutException e) { e.printStackTrace(); } } }

Target:
private static CameraX waitInitialized() { ListenableFuture<Void> future; CameraX cameraX; synchronized (sInitDeinitLock) { if (!sTargetInitialized) { return null; } future = sInitDeinitFuture; cameraX = sInstance; } if (!future.isDone()) { try { future.get(WAIT_INITIALIZED_TIMEOUT, TimeUnit.SECONDS); } catch (ExecutionException e) { throw new IllegalStateException(e); } catch (TimeoutException e) { throw new IllegalStateException(e); } catch (InterruptedException e) { throw new IllegalStateException(e); } } return cameraX; }
Source:
public void commitFiles(ConnectorSession session, String schemaName, String tableName, List<PartitionUpdate> partitionUpdates) { HdfsContext context = new HdfsContext(session, schemaName, tableName); List<CompletableFuture<?>> fileRenameFutures = new ArrayList<>(); for (PartitionUpdate partitionUpdate : partitionUpdates) { Path path = partitionUpdate.getWritePath(); FileSystem fileSystem; try { fileSystem = hdfsEnvironment.getFileSystem(context, path); } catch (IOException e) { throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Error moving data files to final location. Error listing directory " + path, e); } for (StagingFileInfo stagingFileInfo : partitionUpdate.getStagingFileInfos()) { fileRenameFutures.add(CompletableFuture.runAsync(() -> renameFile(fileSystem, path, stagingFileInfo), renameExecutor)); } } for (Future<?> fileRenameFuture : fileRenameFutures) { getFutureValue(fileRenameFuture, PrestoException.class); } }

Target:
public void commitFiles(ConnectorSession session, String schemaName, String tableName, List<PartitionUpdate> partitionUpdates) { HdfsContext context = new HdfsContext(session, schemaName, tableName); List<ListenableFuture<?>> commitFutures = new ArrayList<>(); for (PartitionUpdate partitionUpdate : partitionUpdates) { Path path = partitionUpdate.getWritePath(); FileSystem fileSystem = getFileSystem(hdfsEnvironment, context, path); for (FileWriteInfo fileWriteInfo : partitionUpdate.getFileWriteInfos()) { checkState(!fileWriteInfo.getWriteFileName().equals(fileWriteInfo.getTargetFileName())); Path source = new Path(path, fileWriteInfo.getWriteFileName()); Path target = new Path(path, fileWriteInfo.getTargetFileName()); commitFutures.add(commitExecutor.submit(() -> renameFile(fileSystem, source, target))); } } waitForListenableFutures(commitFutures); }
Source:
public static <T> T getMapper(Class<T> clazz) { try { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if ( classLoader == null ) { classLoader = Mappers.class.getClassLoader(); } ServiceLoader<T> loader = ServiceLoader.load( clazz, classLoader ); if ( loader != null ) { for ( T mapper : loader ) { if ( mapper != null ) { return mapper; } } } @SuppressWarnings("unchecked") T mapper = (T) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ).newInstance(); return mapper; } catch ( Exception e ) { throw new RuntimeException( e ); } }

Target:
public static <T> T getMapper(Class<T> clazz) { try { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if ( classLoader == null ) { classLoader = Mappers.class.getClassLoader(); } try { @SuppressWarnings("unchecked") T mapper = (T) classLoader.loadClass( clazz.getName() + IMPLEMENTATION_SUFFIX ).newInstance(); return mapper; } catch (ClassNotFoundException e) { ServiceLoader<T> loader = ServiceLoader.load( clazz, classLoader ); if ( loader != null ) { for ( T mapper : loader ) { if ( mapper != null ) { return mapper; } } } throw new ClassNotFoundException("Cannot find implementation for " + clazz.getName()); } } catch ( Exception e ) { throw new RuntimeException( e ); } }
Source:
public void testAfterNoTimezone() throws IOException { BundleFilterTimeRange filter1 = Configs.decodeObject(BundleFilterTimeRange.class, AFTER_160921); BundleFilterTimeRange filter2 = Configs.decodeObject(BundleFilterTimeRange.class, AFTER_170921); assertTrue("Expected true since filtered out earlier than 160921", filter1.filter(bundle)); assertFalse("Expected false since filtered out earlier than 170921", filter2.filter(bundle)); }

Target:
public void testAfterNoTimezone() throws IOException { BundleFilterTimeRange filter1 = Configs.decodeObject(BundleFilterTimeRange.class, AFTER_160921); BundleFilterTimeRange filter2 = Configs.decodeObject(BundleFilterTimeRange.class, AFTER_170921); assertTrue("Expected true since 160922 is later than 160921", filter1.filter(bundle)); assertFalse("Expected false since 160922 is earlier than 170921", filter2.filter(bundle)); }
Source:
protected BeanManager lookupBeanManager() { final BeanManager bmgr = CDI.current() .getBeanManager(); Logger logger = LoggerFactory.getLogger( getClass() ); logger.info( "\n\n\n\nRESTEasy Using BeanManager: {}\n\n\n\n", bmgr ); Set<Bean<?>> mappers = bmgr.getBeans( ObjectMapper.class ); mappers.forEach( bean -> { CreationalContext ctx = bmgr.createCreationalContext( null ); logger.debug( "Found ObjectMapper: {}", bean.create( ctx ) ); ctx.release(); } ); return bmgr; }

Target:
protected BeanManager lookupBeanManager() { final BeanManager bmgr = CDI.current() .getBeanManager(); Logger logger = LoggerFactory.getLogger( getClass() ); if ( logger.isDebugEnabled() ) { Set<Bean<?>> mappers = bmgr.getBeans( ObjectMapper.class ); mappers.forEach( bean -> { CreationalContext ctx = bmgr.createCreationalContext( null ); logger.debug( "Found ObjectMapper: {}", bean.create( ctx ) ); ctx.release(); } ); logger.debug( "\n\n\n\nRESTEasy CDI Injector Factory Using BeanManager: (@{})\n\n\n\n", bmgr, bmgr.hashCode() ); } return bmgr; }
Source:
public DeveloperDTO create(final DeveloperDTO dto) throws EntityRetrievalException, EntityCreationException, JsonProcessingException { if (dto.getWebsite() != null && !StringUtils.isEmpty(dto.getWebsite())) { if (!ValidationUtils.isWellFormedUrl(dto.getWebsite())) { String msg = msgUtil.getMessage("developer.websiteIsInvalid"); throw new EntityCreationException(msg); } } DeveloperDTO created = developerDao.create(dto); List<CertificationBodyDTO> availableAcbs = acbManager.getAllForUser(false); if (availableAcbs != null && availableAcbs.size() > 0) { for (CertificationBodyDTO acb : availableAcbs) { for (DeveloperACBMapDTO attMap : dto.getTransparencyAttestationMappings()) { if (acb.getId().longValue() == attMap.getAcbId().longValue() && !StringUtils.isEmpty(attMap.getTransparencyAttestation())) { attMap.setDeveloperId(created.getId()); developerDao.createTransparencyMapping(attMap); } } } } activityManager.addActivity(ActivityConcept.ACTIVITY_CONCEPT_DEVELOPER, created.getId(), "Developer " + created.getName() + " has been created.", null, created); return created; }

Target:
public DeveloperDTO create(final DeveloperDTO dto) throws EntityRetrievalException, EntityCreationException, JsonProcessingException { if (!StringUtils.isEmpty(dto.getWebsite())) { if (!ValidationUtils.isWellFormedUrl(dto.getWebsite())) { String msg = msgUtil.getMessage("developer.websiteIsInvalid"); throw new EntityCreationException(msg); } } DeveloperDTO created = developerDao.create(dto); List<CertificationBodyDTO> availableAcbs = acbManager.getAllForUser(false); if (availableAcbs != null && availableAcbs.size() > 0) { for (CertificationBodyDTO acb : availableAcbs) { for (DeveloperACBMapDTO attMap : dto.getTransparencyAttestationMappings()) { if (acb.getId().longValue() == attMap.getAcbId().longValue() && !StringUtils.isEmpty(attMap.getTransparencyAttestation())) { attMap.setDeveloperId(created.getId()); developerDao.createTransparencyMapping(attMap); } } } } activityManager.addActivity(ActivityConcept.ACTIVITY_CONCEPT_DEVELOPER, created.getId(), "Developer " + created.getName() + " has been created.", null, created); return created; }
Source:
public boolean hasNext() { if (tuple == null) { try { tuple = loadFunc.getNext(); } catch (IOException e) { throw new RuntimeException(e); } } if (tuple != null) { return true; } return false; }

Target:
public boolean hasNext() { if (!hasNextCalled) { hasNextCalled = true; if (tuple == null) { try { tuple = loadFunc.getNext(); } catch (IOException e) { throw new RuntimeException(e); } } } return tuple != null; }
Source:
public void stop() { if (!started) { throw new IllegalStateException("calling `stop` without first calling `start`."); } if (stopped) { return; } synchronized (startStopLock) { if (stopped) { return; } pool.shutdownNow(); regionNormalizerTracker.stop(); stopped = true; } }

Target:
public void stop() { synchronized (startStopLock) { if (!started) { throw new IllegalStateException("calling `stop` without first calling `start`."); } if (stopped) { return; } pool.shutdownNow(); regionNormalizerTracker.stop(); stopped = true; } }
Source:
public void testSourceStoppedOnFlumeExceptionIfPortUsed() throws InterruptedException, IOException { final String loopbackIPv4 = "127.0.0.1"; final int port = 10500; try (ServerSocketChannel dummyServerSocket = ServerSocketChannel.open()) { dummyServerSocket.socket().setReuseAddress(true); dummyServerSocket.socket().bind(new InetSocketAddress(loopbackIPv4, port)); Context context = new Context(); context.put("port", String.valueOf(port)); context.put("bind", loopbackIPv4); Configurables.configure(source, context); try { source.start(); Assert.fail("Expected an exception during startup caused by binding on a used port"); } catch (FlumeException e) { logger.info("Received an expected exception.", e); Assert.assertTrue("Expected a bind related root cause", e.getMessage().contains("Failed to bind to")); } } Assert.assertEquals("Server is stopped", LifecycleState.STOP, source.getLifecycleState()); }

Target:
public void testSourceStoppedOnFlumeExceptionIfPortUsed() throws InterruptedException, IOException { final String loopbackIPv4 = "127.0.0.1"; final int port = 10500; try (ServerSocketChannel dummyServerSocket = ServerSocketChannel.open()) { dummyServerSocket.socket().setReuseAddress(true); dummyServerSocket.socket().bind(new InetSocketAddress(loopbackIPv4, port)); Context context = new Context(); context.put("port", String.valueOf(port)); context.put("bind", loopbackIPv4); Configurables.configure(source, context); try { source.start(); Assert.fail("Expected an exception during startup caused by binding on a used port"); } catch (FlumeException e) { logger.info("Received an expected exception.", e); Assert.assertTrue("Expected a server socket setup related root cause", e.getMessage().contains("server socket")); } } Assert.assertEquals("Server is stopped", LifecycleState.STOP, source.getLifecycleState()); }
Source:
private boolean isPIDAlive(String pid) { if (pid != null) { ProcessBuilder pb = new ProcessBuilder().command("ps", "-o", "pid=", "-p", pid); pb.redirectError(ProcessBuilder.Redirect.INHERIT); pb.redirectInput(ProcessBuilder.Redirect.INHERIT); try { Process process = pb.start(); StringBuilder sb = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { if (reader.readLine() != null) return true; } return false; } catch (IOException e) { log.error("Failed to test if service " + pid + " is running", e); return false; } } return false; }

Target:
private boolean isPIDAlive(String pid) { if (pid != null) { ProcessBuilder pb = new ProcessBuilder().command(prefix + "is_alive" + extension, pid); pb.redirectError(ProcessBuilder.Redirect.INHERIT); pb.redirectInput(ProcessBuilder.Redirect.INHERIT); try { Process process = pb.start(); StringBuilder sb = new StringBuilder(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { String line = reader.readLine(); if (line != null && !line.isEmpty()) { return true; } } return false; } catch (IOException e) { log.error("Failed to test if service " + pid + " is running", e); return false; } } return false; }
Source:
private BlobId unwrapChunkInfo(ChunkInfo chunkInfo, long intermediateChunkSize, boolean lastChunk) throws RouterException { long chunkSize = chunkInfo.getChunkSizeInBytes(); long chunkExpirationTimeInMs = chunkInfo.getExpirationTimeInMs(); if (chunkSize == 0 || (lastChunk ? chunkSize > intermediateChunkSize : chunkSize != intermediateChunkSize)) { throw new RouterException("Invalid chunkSize: " + chunkSize + "; intermediateChunkSize: " + intermediateChunkSize, RouterErrorCode.InvalidPutArgument); } long metadataExpirationTimeInMs = Utils.addSecondsToEpochTime(passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getTimeToLiveInSeconds()); if (Utils.compareTimes(chunkExpirationTimeInMs, metadataExpirationTimeInMs) < 0) { throw new RouterException("Chunk expiration time (" + chunkExpirationTimeInMs + ") < metadata expiration time (" + metadataExpirationTimeInMs + ")", RouterErrorCode.InvalidPutArgument); } BlobId blobId = RouterUtils.getBlobIdFromString(chunkInfo.getBlobId(), clusterMap); if (blobId.getBlobDataType() != BlobDataType.DATACHUNK) { throw new RouterException("Cannot stitch together multiple composite blobs", RouterErrorCode.InvalidBlobId); } return blobId; }

Target:
private BlobId unwrapChunkInfo(ChunkInfo chunkInfo, long intermediateChunkSize, boolean lastChunk) throws RouterException { long chunkSize = chunkInfo.getChunkSizeInBytes(); long chunkExpirationTimeInMs = chunkInfo.getExpirationTimeInMs(); if (chunkSize == 0 || chunkSize > intermediateChunkSize || (!lastChunk && chunkSize < intermediateChunkSize)) { throw new RouterException( "Invalid chunkSize for " + (lastChunk ? "last" : "intermediate") + " chunk: " + chunkSize + "; intermediateChunkSize: " + intermediateChunkSize, RouterErrorCode.InvalidPutArgument); } long metadataExpirationTimeInMs = Utils.addSecondsToEpochTime(passedInBlobProperties.getCreationTimeInMs(), passedInBlobProperties.getTimeToLiveInSeconds()); if (Utils.compareTimes(chunkExpirationTimeInMs, metadataExpirationTimeInMs) < 0) { throw new RouterException("Chunk expiration time (" + chunkExpirationTimeInMs + ") < metadata expiration time (" + metadataExpirationTimeInMs + ")", RouterErrorCode.InvalidPutArgument); } BlobId blobId = RouterUtils.getBlobIdFromString(chunkInfo.getBlobId(), clusterMap); if (blobId.getBlobDataType() != BlobDataType.DATACHUNK) { throw new RouterException("Cannot stitch together multiple composite blobs", RouterErrorCode.InvalidBlobId); } return blobId; }
Source:
public Builder toBuilder() { Builder builder = new Builder(type); builder.members.putAll(members); for (Map.Entry<String, List<CodeBlock>> entry : builder.members.entrySet()) { entry.setValue(new ArrayList<>(entry.getValue())); } return builder; }

Target:
public Builder toBuilder() { Builder builder = new Builder(type); for (Map.Entry<String, List<CodeBlock>> entry : members.entrySet()) { builder.members.put(entry.getKey(), new ArrayList<>(entry.getValue())); } return builder; }
Source:
private void handleMessageFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args) { String newFormatString = cleanupDoubleQuote(formatString); Set<Integer> indexes = getMessageFormatIndexes(newFormatString); List<ExpressionTree> newArgs = args; if (newArgs.size() == 1) { ExpressionTree firstArg = args.get(0); if (firstArg.symbolType().isArray()) { if (isNewArrayWithInitializers(firstArg)) { newArgs = ((NewArrayTree) firstArg).initializers(); } else { return; } } } if (checkEmptyParams(mit, indexes) || checkArgumentNumber(mit, indexes.size(), newArgs.size()) || checkUnbalancedQuotes(mit, newFormatString) || checkUnbalancedBraces(mit, newFormatString)) { return; } checkToStringInvocation(newArgs); verifyParameters(mit, newArgs, indexes); }

Target:
private void handleMessageFormat(MethodInvocationTree mit, String formatString, List<ExpressionTree> args) { String newFormatString = cleanupDoubleQuote(formatString); Set<Integer> indexes = getMessageFormatIndexes(newFormatString); List<ExpressionTree> newArgs = args; if (newArgs.size() == 1) { ExpressionTree firstArg = newArgs.get(0); if (firstArg.symbolType().isArray()) { if (isNewArrayWithInitializers(firstArg)) { newArgs = ((NewArrayTree) firstArg).initializers(); } else { return; } } } if (checkEmptyParams(mit, indexes) || checkArgumentNumber(mit, indexes.size(), newArgs.size()) || checkUnbalancedQuotes(mit, newFormatString) || checkUnbalancedBraces(mit, newFormatString)) { return; } checkToStringInvocation(newArgs); verifyParameters(mit, newArgs, indexes); }
Source:
private File doExport(SnomedRefSetDSVExportModel exportModel) throws Exception { SnomedRefSetDSVExportClientRequest dsvRequest = new SnomedRefSetDSVExportClientRequest(SnomedClientProtocol.getInstance(), exportModel); IProgressMonitor submonitor = SubMonitor.convert(new NullProgressMonitor(), "Performing SNOMED CT export to DSV format...", 1000).newChild(1000, SubMonitor.SUPPRESS_ALL_LABELS); File exportFile = dsvRequest.send(new EclipseMonitor(submonitor)); SnomedExportResult result = dsvRequest.getExportResult(); exportModel.getExportResult().setResultAndMessage(result.getResult(), result.getMessage()); return exportFile; }

Target:
private File doExport(SnomedRefSetDSVExportModel exportModel) throws Exception { SnomedRefSetDSVExportClientRequest dsvRequest = new SnomedRefSetDSVExportClientRequest(SnomedClientProtocol.getInstance(), exportModel); File exportFile = dsvRequest.send(new Monitor()); SnomedExportResult result = dsvRequest.getExportResult(); exportModel.getExportResult().setResultAndMessage(result.getResult(), result.getMessage()); return exportFile; }
Source:
private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder .addChildResource(UndertowExtension.PATH_APPLICATION_SECURITY_DOMAIN) .getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, ENABLE_JASPI, INTEGRATED_JASPI) .setDiscard(DiscardAttributeChecker.ALWAYS, ENABLE_JASPI, INTEGRATED_JASPI) .end(); ResourceTransformationDescriptionBuilder builder = subsystemBuilder.addChildResource(UndertowExtension.PATH_FILTERS) .addChildResource(PathElement.pathElement(Constants.MOD_CLUSTER)); builder.discardChildResource(NoAffinityResourceDefinition.PATH); builder.discardChildResource(SingleAffinityResourceDefinition.PATH); builder.discardChildResource(RankedAffinityResourceDefinition.PATH); }

Target:
private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder .addChildResource(UndertowExtension.PATH_APPLICATION_SECURITY_DOMAIN) .getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, ENABLE_JASPI, INTEGRATED_JASPI) .setDiscard(DiscardAttributeChecker.ALWAYS, ENABLE_JASPI, INTEGRATED_JASPI) .end(); ResourceTransformationDescriptionBuilder builder = subsystemBuilder.addChildResource(UndertowExtension.PATH_FILTERS) .addChildResource(PathElement.pathElement(Constants.MOD_CLUSTER)); builder.rejectChildResource(NoAffinityResourceDefinition.PATH); builder.discardChildResource(SingleAffinityResourceDefinition.PATH); builder.rejectChildResource(RankedAffinityResourceDefinition.PATH); }
Source:
public Iterable<Object> orderedKeys() { return Collections.list(keys()); }

Target:
Set<Object> orderedKeys() { return keys; }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; Optional<CaseLabelTree> defaultLabel = getDefaultLabel(switchStatementTree); if (!defaultLabel.isPresent()) { if (!isSwitchOnEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Add a default case to this switch."); } else if (missingCasesOfEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Complete cases by adding the missing enum constants or add a default case to this switch."); } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; if (getDefaultLabel(switchStatementTree)) { if (!isSwitchOnEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Add a default case to this switch."); } else if (missingCasesOfEnum(switchStatementTree)) { reportIssue(switchStatementTree.switchKeyword(), "Complete cases by adding the missing enum constants or add a default case to this switch."); } } }