auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setDefaultSystem(SystemDescriptor<?> defaultSystemDescriptor) { Preconditions.checkNotNull(defaultSystemDescriptor, "Provided defaultSystemDescriptor must not be null."); String defaultSystemName = defaultSystemDescriptor.getSystemName(); Preconditions.checkState(inputOperators.isEmpty() && outputStreams.isEmpty(), "Default system must be set before creating any input or output streams."); Preconditions.checkState(!systemDescriptors.containsKey(defaultSystemName) || systemDescriptors.get(defaultSystemName) == defaultSystemDescriptor, "Must not use different system descriptor instances for the same system name: " + defaultSystemName); systemDescriptors.put(defaultSystemName, defaultSystemDescriptor); this.defaultSystemDescriptorOptional = Optional.of(defaultSystemDescriptor); }

Target:
public void setDefaultSystem(SystemDescriptor<?> defaultSystemDescriptor) { Preconditions.checkNotNull(defaultSystemDescriptor, "Provided defaultSystemDescriptor must not be null."); String defaultSystemName = defaultSystemDescriptor.getSystemName(); Preconditions.checkState(inputOperators.isEmpty() && outputStreams.isEmpty(), "Default system must be set before creating any input or output streams."); checkSystemDescriptorUniqueness(defaultSystemDescriptor, defaultSystemName); systemDescriptors.put(defaultSystemName, defaultSystemDescriptor); this.defaultSystemDescriptorOptional = Optional.of(defaultSystemDescriptor); }
Source:
protected void setFrameFocus(final IFrameDMContext newFrame, RequestMonitor rm) { if (newFrame == null) { GdbPlugin.logErrorMessage("GdbSynchronizer unable to resolve frame context for the selected element"); rm.done(); return; } if (isThreadSuspended(getThreadFromFrame(newFrame))) { ICommand<MIInfo> command = fCommandFactory.createMIStackSelectFrame(getThreadFromFrame(newFrame), newFrame.getLevel()); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo>(rm) {}); } else { rm.done(); } }

Target:
protected void setFrameFocus(final IFrameDMContext newFrame, RequestMonitor rm) { if (newFrame == null) { rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "GdbSynchronizer unable to resolve frame context for the selected element", null)); return; } if (isThreadSuspended(getThreadFromFrame(newFrame))) { ICommand<MIInfo> command = fCommandFactory.createMIStackSelectFrame(getThreadFromFrame(newFrame), newFrame.getLevel()); fGdbcontrol.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo>(rm) {}); } else { rm.done(); } }
Source:
private KieModuleModel getKieModuleModelWithAlphaNetworkCompiler() { KieModuleModel kproj = KieServices.get().newKieModuleModel(); kproj.setConfigurationProperty( "drools.alphaNetworkCompiler", "true" ); return kproj; }

Target:
private KieModuleModel getKieModuleModelWithAlphaNetworkCompiler() { KieModuleModel kproj = KieServices.get().newKieModuleModel(); kproj.setConfigurationProperty( org.drools.compiler.kie.builder.impl.KieContainerImpl.ALPHA_NETWORK_COMPILER_OPTION, "true" ); return kproj; }
Source:
public static void setTickTupleFrequency(Map<String, Object> conf, int seconds) { setTickTupleFrequency(conf, (long) (seconds * 1000)); }

Target:
public static void setTickTupleFrequency(Map<String, Object> conf, int seconds) { setTickTupleFrequencyMs(conf, (long) (seconds * 1000)); }
Source:
public JsonElement serialize(JsonSerializationContext context) { JsonObject serialized = new JsonObject(); serialized.addProperty("doi", article.getDoi()); this.latestRevision.ifPresent(latestRevision -> { serialized.addProperty("revisionNumber", latestRevision.getRevisionNumber()); ArticleIngestion ingestion = latestRevision.getIngestion(); serialized.add("journal", context.serialize(ingestion.getJournal())); serialized.addProperty("ingestionNumber", ingestion.getIngestionNumber()); serialized.addProperty("title", ingestion.getTitle()); serialized.addProperty("publicationDate", ingestion.getPublicationDate().toLocalDate().toString()); serialized.addProperty("revisionDate", ingestion.getRevisionDate().toLocalDate().toString()); serialized.addProperty("articleType", ingestion.getArticleType()); }); return serialized; }

Target:
public JsonElement serialize(JsonSerializationContext context) { JsonObject serialized = new JsonObject(); serialized.addProperty("doi", article.getDoi()); this.latestRevision.ifPresent(latestRevision -> { serialized.addProperty("revisionNumber", latestRevision.getRevisionNumber()); ArticleIngestion ingestion = latestRevision.getIngestion(); JournalOutputView journalOutputView = journalOutputViewFactory.getView(ingestion.getJournal()); serialized.add("journal", context.serialize(journalOutputView)); serialized.addProperty("ingestionNumber", ingestion.getIngestionNumber()); serialized.addProperty("title", ingestion.getTitle()); serialized.addProperty("publicationDate", ingestion.getPublicationDate().toLocalDate().toString()); if (ingestion.getRevisionDate() != null) { serialized.addProperty("revisionDate", ingestion.getRevisionDate().toLocalDate().toString()); } serialized.addProperty("articleType", ingestion.getArticleType()); }); return serialized; }
Source:
private boolean existsFile(URI uri) throws IOException { try { URI base = getBase(uri); String path = sanitizePath(base.relativize(uri).getPath()); HeadObjectRequest headObjectRequest = HeadObjectRequest.builder() .bucket(uri.getHost()) .key(path) .build(); s3Client.headObject(headObjectRequest); return true; }catch(NoSuchKeyException e){ return false; }catch(S3Exception e){ throw new IOException(e); } }

Target:
private boolean existsFile(URI uri) throws IOException { try { URI base = getBase(uri); String path = sanitizePath(base.relativize(uri).getPath()); HeadObjectRequest headObjectRequest = HeadObjectRequest.builder().bucket(uri.getHost()).key(path).build(); _s3Client.headObject(headObjectRequest); return true; } catch (NoSuchKeyException e) { return false; } catch (S3Exception e) { throw new IOException(e); } }
Source:
public Response getAllComments( @PathParam("uuid") String uuid, @QueryParam("offset") int offSet, @ QueryParam("limit") int limit) { CommentsManager commentsManager = APIUtil.getCommentsManager(); List<Comment> comments = new ArrayList<>(); try { PaginationRequest request = new PaginationRequest(offSet, limit); if (uuid == null) { return Response.status(Response.Status.NOT_FOUND).entity("Comments not found").build(); } else if (request.validatePaginationRequest(offSet, limit)) { commentsManager.getAllComments(request, uuid); return Response.status(Response.Status.OK).entity(comments).build(); } } catch (CommentManagementException e) { String msg = "Error occurred while retrieving comments."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(" Internal server error occurs") .build(); } return null; }

Target:
public Response getAllComments( @PathParam("uuid") String uuid, @QueryParam("offset") int offSet, @ QueryParam("limit") int limit) { CommentsManager commentsManager = APIUtil.getCommentsManager(); List<Comment> comments = new ArrayList<>(); try { PaginationRequest request = new PaginationRequest(offSet, limit); if (uuid == null) { return Response.status(Response.Status.NOT_FOUND).entity("Comments not found").build(); } else if (request.validatePaginationRequest(offSet, limit)) { commentsManager.getAllComments(request, uuid); return Response.status(Response.Status.OK).entity(comments).build(); } } catch (CommentManagementException e) { String msg = "Error occurred while retrieving comments."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg) .build(); } return Response.status(Response.Status.OK).entity(comments).build(); }
Source:
protected void deleteAnchors() { @SuppressWarnings("unchecked") Collection<File> anchors = listFiles(appsDir, ANCHOR_FILTER, null); for (File anchor : anchors) { try { forceDelete(anchor); } catch (IOException e) { throw new MuleControllerException(String.format(ANCHOR_DELETE_ERROR, anchor), e); } } }

Target:
protected void deleteAnchors() { Collection<File> anchors = listFiles(appsDir, ANCHOR_FILTER, null); for (File anchor : anchors) { try { forceDelete(anchor); } catch (IOException e) { throw new MuleControllerException(String.format(ANCHOR_DELETE_ERROR, anchor), e); } } }
Source:
public IStatus runInUIThread(IProgressMonitor monitor) { String binaryPath = fProcessNameToBinaryMap.get(fProcName); if (binaryPath == null) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); if (shell != null) { FileDialog fd = new FileDialog(shell, SWT.NONE); fd.setText(fTitle); binaryPath = fd.open(); } } if (binaryPath == null) { fRm.done(); } else { final String finalBinaryPath = binaryPath; fExecutor.execute(new DsfRunnable() { @Override public void run() { IGDBProcesses procService = fTracker.getService(IGDBProcesses.class); ICommandControlService commandControl = fTracker.getService(ICommandControlService.class); if (procService != null && commandControl != null) { IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid); procService.attachDebuggerToProcess(procDmc, finalBinaryPath, new DataRequestMonitor<IDMContext>(fExecutor, fRm) { @Override protected void handleSuccess() { if (fProcName != null && !fProcName.isEmpty()) { fProcessNameToBinaryMap.put(fProcName, finalBinaryPath); } fRm.done(); }; }); } else { fRm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find services", null)); fRm.done(); } } }); } return Status.OK_STATUS; }

Target:
public IStatus runInUIThread(IProgressMonitor monitor) { String binaryPath = fProcessNameToBinaryMap.get(fProcName); if (binaryPath == null) { Shell shell = GdbUIPlugin.getShell(); if (shell != null) { FileDialog fd = new FileDialog(shell, SWT.NONE); fd.setText(fTitle); binaryPath = fd.open(); } } if (binaryPath == null) { fRm.done(); } else { final String finalBinaryPath = binaryPath; fExecutor.execute(new DsfRunnable() { @Override public void run() { IGDBProcesses procService = fTracker.getService(IGDBProcesses.class); ICommandControlService commandControl = fTracker.getService(ICommandControlService.class); if (procService != null && commandControl != null) { IProcessDMContext procDmc = procService.createProcessContext(commandControl.getContext(), fPid); procService.attachDebuggerToProcess(procDmc, finalBinaryPath, new DataRequestMonitor<IDMContext>(fExecutor, fRm) { @Override protected void handleSuccess() { if (fProcName != null && !fProcName.isEmpty()) { fProcessNameToBinaryMap.put(fProcName, finalBinaryPath); } fRm.done(); }; }); } else { fRm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find services", null)); fRm.done(); } } }); } return Status.OK_STATUS; }
Source:
private void computeNullStatus(FlowInfo flowInfo, FlowContext flowContext) { int status = 0; int combinedStatus = 0; for (Expression re : this.resultExpressions) { combinedStatus |= re.nullStatus(flowInfo, flowContext); } if ((combinedStatus & (FlowInfo.NULL|FlowInfo.POTENTIALLY_NULL)) != 0) status |= FlowInfo.POTENTIALLY_NULL; if ((combinedStatus & (FlowInfo.NON_NULL|FlowInfo.POTENTIALLY_NON_NULL)) != 0) status |= FlowInfo.POTENTIALLY_NON_NULL; if ((combinedStatus & (FlowInfo.UNKNOWN|FlowInfo.POTENTIALLY_UNKNOWN)) != 0) status |= FlowInfo.POTENTIALLY_UNKNOWN; if (status > 0) this.nullStatus = status; }

Target:
private void computeNullStatus(FlowInfo flowInfo, FlowContext flowContext) { int status = this.resultExpressions.get(0).nullStatus(flowInfo, flowContext); int combinedStatus = status; boolean identicalStatus = true; for (int i = 1, l = this.resultExpressions.size(); i < l; ++i) { int tmp = this.resultExpressions.get(i).nullStatus(flowInfo, flowContext); identicalStatus &= status == tmp; combinedStatus |= tmp; } if (identicalStatus) { this.nullStatus = status; return; } status = Expression.computeNullStatus(0, combinedStatus); if (status > 0) this.nullStatus = status; }
Source:
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ValidationResult that = (ValidationResult) o; if (privateSuccess != that.privateSuccess) return false; if (!privateReasons.equals(that.privateReasons)) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ValidationResult that = (ValidationResult) o; return Objects.equals(privateSuccess, that.privateSuccess) && Objects.equals(privateReasons, that.privateReasons); }
Source:
public ExcludedPath(String path) { this(); this.setPath(path); }

Target:
public ExcludedPath(String path) { this.jsonSerializable = new JsonSerializable(); this.setPath(path); }
Source:
public void leaderChangeClearsCaches() { eventCache.processStartTransactionsUpdate(TIMESTAMPS, SNAPSHOT); eventCache.processStartTransactionsUpdate(TIMESTAMPS_2, LockWatchStateUpdate.success(EVENT2_UUID, 4L, ImmutableList.of())); verifyStage(); }

Target:
public void leaderChangeClearsCaches() { setupInitialState(); eventCache.processStartTransactionsUpdate(TIMESTAMPS_2, LockWatchStateUpdate.success(EVENT2_UUID, 4L, ImmutableList.of())); verifyStage(); }
Source:
static DMNRuntimeFluent create(CommandBasedExecutable executable) { try { return (DMNRuntimeFluent) Class.forName("org.kie.dmn.core.fluent.DMNRuntimeFluentImpl") .getConstructor(CommandBasedExecutable.class).newInstance(executable); } catch (Exception e) { throw new RuntimeException("Unable to instance DMNRuntimeFluent", e); } }

Target:
static DMNRuntimeFluent create(CommandBasedExecutable executable) { try { return (DMNRuntimeFluent) ClassLoaderUtil.getClassLoader(null, null, true) .loadClass("org.kie.dmn.core.fluent.DMNRuntimeFluentImpl") .getConstructor(CommandBasedExecutable.class).newInstance(executable); } catch (Exception e) { throw new RuntimeException("Unable to instance DMNRuntimeFluent", e); } }
Source:
private void drainQueue() { if (isTerminated()) { return; } currentWork = workQueue.poll(); if (currentWork == null) { return; } subscription.request(currentWork.getNumberOfEvents()); timeoutOperation = Mono.delay(currentWork.getTimeout()) .subscribe(l -> { if (!currentWork.isTerminal()) { completeCurrentWork(currentWork); } }); }

Target:
private void drainQueue() { if (isTerminated()) { return; } synchronized (currentWorkLock) { if (currentWork != null && currentWork.isTerminal()) { workQueue.remove(currentWork); if (currentTimeoutOperation != null && !currentTimeoutOperation.isDisposed()) { currentTimeoutOperation.dispose(); } currentTimeoutOperation = null; } while ((currentWork = workQueue.peek()) != null && (!currentWork.isProcessingStarted() || bufferMessages.size() > 0)) { if (currentWork.isTerminal()) { workQueue.remove(currentWork); if (currentTimeoutOperation != null && !currentTimeoutOperation.isDisposed()) { currentTimeoutOperation.dispose(); } continue; } if (!currentWork.isProcessingStarted()) { currentTimeoutOperation = getTimeoutOperation(currentWork); currentWork.startedProcessing(); } while (bufferMessages.size() > 0 && !currentWork.isTerminal()) { currentWork.next(bufferMessages.poll()); remaining.decrementAndGet(); } if (currentWork.isTerminal()) { if (currentWork.getError() == null) { currentWork.complete(); } workQueue.remove(currentWork); if (currentTimeoutOperation != null && !currentTimeoutOperation.isDisposed()) { currentTimeoutOperation.dispose(); } logger.verbose("The work is complete.", currentWork.getId()); } else { long creditToAdd = currentWork.getRemaining() - (remaining.get() + bufferMessages.size()); if (creditToAdd > 0) { remaining.addAndGet(creditToAdd); subscription.request(creditToAdd); logger.verbose("Requesting from upstream for work [{}].", creditToAdd, currentWork.getId()); } } } } }
Source:
Connection createProxyConnection(final ProxyLeakTask leakTask, final long now) { ProxyConnection pc = ProxyFactory.getProxyConnection(this, connection, openStatements, leakTask, now); hikariPool.initProxyConnection(pc); return pc; }

Target:
Connection createProxyConnection(final ProxyLeakTask leakTask, final long now) { return ProxyFactory.getProxyConnection(this, connection, openStatements, leakTask, now, hikariPool.getReadOnly(), hikariPool.getAutoCommit()); }
Source:
public void waitHttpAsAction() { String server = String.format("http://localhost:%s", serverPort); httpServer.setPort(serverPort); start(httpServer); parallel().actions( sequential().actions( waitFor() .execution() .action(send(http -> http.endpoint(server))) ), sequential().actions( http(http -> http.server(httpServer).receive().post()), http(http -> http.server(httpServer).receive().post()), http(http -> http.server(httpServer).respond(HttpStatus.OK)) ) ); doFinally().actions(stop(httpServer)); }

Target:
public void waitHttpAsAction() { String server = startHttpServerAndGetUrl(); parallel().actions( sequential().actions( waitFor() .execution() .action(send(http -> http.endpoint(server))) ), sequential().actions( http(http -> http.server(httpServer).receive().post()), http(http -> http.server(httpServer).receive().post()), http(http -> http.server(httpServer).respond(HttpStatus.OK)) ) ); doFinally().actions(stop(httpServer)); }
Source:
private synchronized void doRefreshProgress(int id, int progress, boolean fromUser, boolean callBackToApp, boolean animate) { int range = mMax - mMin; final float scale = range > 0 ? (progress - mMin) / (float) range : 0; final boolean isPrimary = id == R.id.progress; if (isPrimary && animate) { final ObjectAnimator animator = ObjectAnimator.ofFloat(this, VISUAL_PROGRESS, scale); animator.setAutoCancel(true); animator.setDuration(PROGRESS_ANIM_DURATION); animator.setInterpolator(PROGRESS_ANIM_INTERPOLATOR); animator.start(); mLastProgressAnimator = animator; } else { if (isPrimary && mLastProgressAnimator != null) { mLastProgressAnimator.cancel(); mLastProgressAnimator = null; } setVisualProgress(id, scale); } if (isPrimary && callBackToApp) { onProgressRefresh(scale, fromUser, progress); } }

Target:
private synchronized void doRefreshProgress(int id, int progress, boolean fromUser, boolean callBackToApp, boolean animate) { int range = mMax - mMin; final float scale = range > 0 ? (progress - mMin) / (float) range : 0; final boolean isPrimary = id == R.id.progress; if (isPrimary && animate) { final ObjectAnimator animator = ObjectAnimator.ofFloat(this, VISUAL_PROGRESS, scale); animator.setAutoCancel(true); animator.setDuration(PROGRESS_ANIM_DURATION); animator.setInterpolator(PROGRESS_ANIM_INTERPOLATOR); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mLastProgressAnimator = null; } }); animator.start(); mLastProgressAnimator = animator; } else { if (isPrimary && mLastProgressAnimator != null) { mLastProgressAnimator.cancel(); mLastProgressAnimator = null; } setVisualProgress(id, scale); } if (isPrimary && callBackToApp) { onProgressRefresh(scale, fromUser, progress); } }
Source:
private void validateScheduleNameForPlatform(String type, String scheduleName) { if(type.equals(KUBERNETES)) { if(scheduleName.length() > MAX_SCHEDULE_NAME_LEN) { throw new IllegalArgumentException(String.format("the name specified " + "exceeds the maximum schedule name length of %s. A SCDF " + "schedule name is an aggregate of <task-definition-name>-%s" + "<schedule-name>. Consider using fewer characters for task definition" + "name or the schedule-name.", MAX_SCHEDULE_NAME_LEN, taskConfigurationProperties.getScheduleNamePrefix() )); } } }

Target:
private String validateScheduleNameForPlatform(String type, String scheduleName) { if(type.equals(TaskPlatformFactory.KUBERNETES_PLATFORM_TYPE)) { if(scheduleName.length() > MAX_SCHEDULE_NAME_LEN) { throw new IllegalArgumentException(String.format("the name specified " + "exceeds the maximum schedule name length of %s. A SCDF " + "schedule name is an aggregate of <task-definition-name>-%s" + "<schedule-name>. Consider using fewer characters for task definition" + "name or the schedule-name.", MAX_SCHEDULE_NAME_LEN, this.taskConfigurationProperties.getScheduleNamePrefix() )); } scheduleName = scheduleName.toLowerCase(); } return scheduleName; }
Source:
public List<IDValue> get( @PathParam("userID") List<PathSegment> pathSegmentsList, @DefaultValue("10") @QueryParam("howMany") int howMany, @DefaultValue("0") @QueryParam("offset") int offset, @DefaultValue("false") @QueryParam("considerKnownItems") boolean considerKnownItems, @QueryParam("rescorerParams") List<String> rescorerParams) throws OryxServingException { check(!pathSegmentsList.isEmpty() && pathSegmentsList.size() > 0, "Need atleast 1 user"); check(howMany > 0, "howMany must be positive"); check(offset >= 0, "offset must be non-negative"); ALSServingModel alsServingModel = getALSServingModel(); List<double[]> userFeaturesList = new ArrayList<>(pathSegmentsList.size()); ObjectSet<String> userKnownItems = new ObjectOpenHashSet<>(); for (PathSegment pathSegment : pathSegmentsList) { float[] userFeatureVector = alsServingModel.getUserVector(pathSegment.getPath()); if (userFeatureVector != null) { userFeaturesList.add(VectorMath.toDoubles(userFeatureVector)); } if (!considerKnownItems) { ObjectSet<String> knownItems = alsServingModel.getKnownItems(pathSegment.getPath()); if (knownItems != null && !knownItems.isEmpty()) { synchronized (knownItems) { for (ObjectCursor<String> knownItem : knownItems) { userKnownItems.add(knownItem.value); } } } } } List<Pair<String,Double>> topIDDots = alsServingModel.topN( new DotsFunction(userFeaturesList), howMany + offset, new NotKnownPredicate(userKnownItems)); return toIDValueResponse(topIDDots, howMany, offset); }

Target:
public List<IDValue> get( @PathParam("userID") List<PathSegment> pathSegmentsList, @DefaultValue("10") @QueryParam("howMany") int howMany, @DefaultValue("0") @QueryParam("offset") int offset, @DefaultValue("false") @QueryParam("considerKnownItems") boolean considerKnownItems, @QueryParam("rescorerParams") List<String> rescorerParams) throws OryxServingException { check(!pathSegmentsList.isEmpty() && pathSegmentsList.size() > 0, "Need atleast 1 user"); check(howMany > 0, "howMany must be positive"); check(offset >= 0, "offset must be non-negative"); ALSServingModel alsServingModel = getALSServingModel(); List<double[]> userFeaturesList = new ArrayList<>(pathSegmentsList.size()); ObjectSet<String> userKnownItems = new ObjectOpenHashSet<>(); for (PathSegment pathSegment : pathSegmentsList) { String userID = pathSegment.getPath(); float[] userFeatureVector = alsServingModel.getUserVector(userID); if (userFeatureVector != null) { userFeaturesList.add(VectorMath.toDoubles(userFeatureVector)); } if (!considerKnownItems) { ObjectSet<String> knownItems = alsServingModel.getKnownItems(userID); if (knownItems != null && !knownItems.isEmpty()) { synchronized (knownItems) { for (ObjectCursor<String> knownItem : knownItems) { userKnownItems.add(knownItem.value); } } } } } List<Pair<String,Double>> topIDDots = alsServingModel.topN( new DotsFunction(userFeaturesList), howMany + offset, new NotKnownPredicate(userKnownItems)); return toIDValueResponse(topIDDots, howMany, offset); }
Source:
protected boolean validateAndAddListenerInvocations(Object listener, AbstractInvocationBuilder builder) { Listener l = testListenerClassValidity(listener.getClass()); boolean foundMethods = false; builder.setTarget(listener); Subject subject; if (System.getSecurityManager() == null) { subject = Security.getSubject(); } else { subject = AccessController.doPrivileged((PrivilegedAction<Subject>) () -> Security.getSubject()); } builder.setSubject(subject); builder.setSync(l.sync()); Map<Class<? extends Annotation>, Class<?>> allowedListeners = getAllowedMethodAnnotations(l); for (Method m : listener.getClass().getMethods()) { if (!m.isSynthetic() || !m.isBridge()) { for (Map.Entry<Class<? extends Annotation>, Class<?>> annotationEntry : allowedListeners.entrySet()) { final Class<? extends Annotation> annotationClass = annotationEntry.getKey(); if (m.isAnnotationPresent(annotationClass)) { final Class<?> eventClass = annotationEntry.getValue(); testListenerMethodValidity(m, eventClass, annotationClass.getName()); if (System.getSecurityManager() == null) { m.setAccessible(true); } else { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { m.setAccessible(true); return null; }); } builder.setMethod(m); builder.setAnnotation(annotationClass); L invocation = builder.build(); getListenerCollectionForAnnotation(annotationClass).add(invocation); foundMethods = true; } } } } if (!foundMethods) getLog().noAnnotateMethodsFoundInListener(listener.getClass()); return foundMethods; }

Target:
protected boolean validateAndAddListenerInvocations(Object listener, AbstractInvocationBuilder builder) { Listener l = testListenerClassValidity(listener.getClass()); boolean foundMethods = false; builder.setTarget(listener); builder.setSubject(Security.getSubject()); builder.setSync(l.sync()); Map<Class<? extends Annotation>, Class<?>> allowedListeners = getAllowedMethodAnnotations(l); for (Method m : listener.getClass().getMethods()) { if (!m.isSynthetic() || !m.isBridge()) { for (Map.Entry<Class<? extends Annotation>, Class<?>> annotationEntry : allowedListeners.entrySet()) { final Class<? extends Annotation> annotationClass = annotationEntry.getKey(); if (m.isAnnotationPresent(annotationClass)) { final Class<?> eventClass = annotationEntry.getValue(); testListenerMethodValidity(m, eventClass, annotationClass.getName()); if (System.getSecurityManager() == null) { m.setAccessible(true); } else { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { m.setAccessible(true); return null; }); } builder.setMethod(m); builder.setAnnotation(annotationClass); L invocation = builder.build(); getListenerCollectionForAnnotation(annotationClass).add(invocation); foundMethods = true; } } } } if (!foundMethods) getLog().noAnnotateMethodsFoundInListener(listener.getClass()); return foundMethods; }
Source:
public void factoryTest() throws Exception { Properties properties = new Properties(); JSONObject jsonObject = new JSONObject().put("POST", UPLOAD_ENDPOINT).put("GET", DOWNLOAD_ENDPOINT); properties.setProperty(FrontendConfig.URL_SIGNER_ENDPOINTS, jsonObject.toString()); properties.setProperty("frontend.url.signer.default.url.ttl.secs", Long.toString(DEFAULT_URL_TTL_SECS)); properties.setProperty("frontend.url.signer.default.max.upload.size.bytes", Long.toString(DEFAULT_MAX_UPLOAD_SIZE)); properties.setProperty("frontend.url.signer.max.url.ttl.secs", Long.toString(MAX_URL_TTL_SECS)); UrlSigningService signer = new AmbryUrlSigningServiceFactory(new VerifiableProperties(properties), new MetricRegistry()).getUrlSigningService(); assertNotNull("UrlSigningService is null", signer); assertTrue("UrlSigningService is AmbryUrlSigningService", signer instanceof AmbryUrlSigningService); assertTrue(((AmbryUrlSigningService) signer).getUploadEndpoint().contains(UPLOAD_ENDPOINT)); assertTrue(((AmbryUrlSigningService) signer).getDownloadEndpoint().contains(DOWNLOAD_ENDPOINT)); }

Target:
public void factoryTest() { Properties properties = new Properties(); JSONObject jsonObject = new JSONObject().put("POST", UPLOAD_ENDPOINT).put("GET", DOWNLOAD_ENDPOINT); properties.setProperty(FrontendConfig.URL_SIGNER_ENDPOINTS, jsonObject.toString()); properties.setProperty("frontend.url.signer.default.url.ttl.secs", Long.toString(DEFAULT_URL_TTL_SECS)); properties.setProperty("frontend.url.signer.default.max.upload.size.bytes", Long.toString(DEFAULT_MAX_UPLOAD_SIZE)); properties.setProperty("frontend.url.signer.max.url.ttl.secs", Long.toString(MAX_URL_TTL_SECS)); UrlSigningService signer = new AmbryUrlSigningServiceFactory(new VerifiableProperties(properties), new MetricRegistry()).getUrlSigningService(); assertNotNull("UrlSigningService is null", signer); assertTrue("UrlSigningService is AmbryUrlSigningService", signer instanceof AmbryUrlSigningService); assertTrue(((AmbryUrlSigningService) signer).getUploadEndpoint().contains(UPLOAD_ENDPOINT)); assertTrue(((AmbryUrlSigningService) signer).getDownloadEndpoint().contains(DOWNLOAD_ENDPOINT)); }
Source:
public KafkaContainer withNetwork(Network network) { implicitNetwork = false; return super.withNetwork(network); }

Target:
public KafkaContainer withNetwork(Network network) { useImplicitNetwork = false; return super.withNetwork(network); }
Source:
private boolean validatePage() { fileMatch = null; url = null; if (fileMatchText.getText().trim().length() <= 0) { setErrorMessage(JSONUIMessages.The_name_field_is_required); return updateButton(false); } Set<UserEntry> list = entries.getEntries(); for(UserEntry entry:list) { if (entry != selectedEntry && fileMatchText.getText().equals(entry.getFileMatch())) { setErrorMessage(JSONUIMessages.The_entry_already_exists); return updateButton(false); } } if (urlText.getText().trim().length() <= 0) { setErrorMessage(JSONUIMessages.The_url_field_is_required); return updateButton(false); } try { @SuppressWarnings("unused") URL url = new URL(urlText.getText()); } catch (MalformedURLException e) { setErrorMessage(JSONUIMessages.Invalid_URL); return updateButton(false); } setErrorMessage(null); fileMatch = fileMatchText.getText(); try { url = new URL(urlText.getText()).toURI(); } catch (MalformedURLException | URISyntaxException ignore) return updateButton(true); }

Target:
private boolean validatePage() { fileMatch = null; url = null; if (fileMatchText.getText().trim().length() <= 0) { setErrorMessage(JSONUIMessages.The_name_field_is_required); return updateButton(false); } Set<UserEntry> list = entries.getEntries(); for(UserEntry entry:list) { if (entry != selectedEntry && fileMatchText.getText().equals(entry.getFileMatch())) { setErrorMessage(JSONUIMessages.The_entry_already_exists); return updateButton(false); } } if (urlText.getText().trim().length() <= 0) { setErrorMessage(JSONUIMessages.The_url_field_is_required); return updateButton(false); } try { @SuppressWarnings("unused") URL url = new URL(urlText.getText()); } catch (MalformedURLException e) { setErrorMessage(JSONUIMessages.Invalid_URL); return updateButton(false); } setErrorMessage(null); fileMatch = fileMatchText.getText(); try { url = new URL(urlText.getText()).toURI(); } catch (MalformedURLException ignore) { } catch (URISyntaxException ignore) { } return updateButton(true); }
Source:
public String encode(String parentStringSeparator) { if (FIELD_SEPARATOR.equals(parentStringSeparator)) { throw new IllegalArgumentException("The string separator must not be the same as Field Separator (~)."); } if (username == null) { return NULL_CREDENTIALS; } StringBuilder out = new StringBuilder(); out.append(Base64.encodeBase64String(username.getBytes())).append(FIELD_SEPARATOR); out.append(Base64.encodeBase64String(password.getBytes())).append(FIELD_SEPARATOR); return out.toString(); }

Target:
public String encode(String parentStringSeparator) { if (FIELD_SEPARATOR.equals(parentStringSeparator)) { throw new IllegalArgumentException( "The string separator must not be the same as Field Separator (" + FIELD_SEPARATOR + ")."); } if (username == null) { return NULL_CREDENTIALS; } StringBuilder out = new StringBuilder(); out.append(Base64.encodeBase64String(username.getBytes())).append(FIELD_SEPARATOR); out.append(Base64.encodeBase64String(password.getBytes())).append(FIELD_SEPARATOR); return out.toString(); }
Source:
public CoordinatorStats run( DruidCoordinator coordinator, DruidCoordinatorRuntimeParams params, DataSegment segment ) { final List<ServerHolder> targetServerHolders = params .getDruidCluster().getAllServers().stream() .filter(eachHolder -> eachHolder.getServer().getDataSource(getColocatedDatasource()) != null) .collect(Collectors.toList()); final CoordinatorStats assignStats = assign( targetServerHolders, segment ); final CoordinatorStats stats = new CoordinatorStats(); stats.accumulate(assignStats); return stats; }

Target:
public CoordinatorStats run( DruidCoordinator coordinator, DruidCoordinatorRuntimeParams params, DataSegment segment ) { final Set<ServerHolder> loadServerHolders = new HashSet<>(); final Set<ServerHolder> dropServerHolders = new HashSet<>(); final List<String> colocatedDataSources = getColocatedDataSources(); if (colocatedDataSources == null || colocatedDataSources.isEmpty()) { loadServerHolders.addAll(params.getDruidCluster().getAllServers()); } else { params.getDruidCluster().getAllServers().forEach( eachHolder -> { if (colocatedDataSources.stream() .anyMatch(source -> eachHolder.getServer().getDataSource(source) != null)) { loadServerHolders.add(eachHolder); } else if (eachHolder.isServingSegment(segment)) { if (!eachHolder.getPeon().getSegmentsToDrop().contains(segment)) { dropServerHolders.add(eachHolder); } } } ); } final CoordinatorStats stats = new CoordinatorStats(); return stats.accumulate(assign(loadServerHolders, segment)) .accumulate(drop(dropServerHolders, segment)); }
Source:
private Path getProFile(Path basePath) { Path proFile = new File(basePath.toFile().getName() + ".pro").toPath(); return basePath.resolve(proFile); }

Target:
private Path getProFile(Path basePath) { return Paths.get(basePath.toString() + "/" + basePath.getFileName() + ".pro"); }
Source:
private UniqueId(UniqueIdFormat uniqueIdFormat, Segment segment) { this.uniqueIdFormat = uniqueIdFormat; this.segments = singletonList(segment); this.hashCode = this.segments.hashCode(); this.toString = this.uniqueIdFormat.format(this); }

Target:
private UniqueId(UniqueIdFormat uniqueIdFormat, Segment segment) { this.uniqueIdFormat = uniqueIdFormat; this.segments = singletonList(segment); }
Source:
private static <T> void retryOperation( final CompletableFuture<T> resultFuture, final Supplier<CompletableFuture<T>> operation, final int retries, final Predicate<Throwable> retryPredicate, final Executor executor) { if (!resultFuture.isDone()) { final CompletableFuture<T> operationFuture = operation.get(); operationFuture.whenCompleteAsync( (t, throwable) -> { if (throwable != null) { if (throwable instanceof CancellationException) { resultFuture.completeExceptionally(new RetryException("Operation future was cancelled.", throwable)); } else { throwable = ExceptionUtils.stripExecutionException(throwable); if (!retryPredicate.test(throwable)) { resultFuture.completeExceptionally(throwable); } else { if (retries > 0) { retryOperation( resultFuture, operation, retries - 1, retryPredicate, executor); } else { resultFuture.completeExceptionally( new RetryException("Could not complete the operation. Number of retries " + "has been exhausted.", throwable)); } } } } else { resultFuture.complete(t); } }, executor); resultFuture.whenComplete( (t, throwable) -> operationFuture.cancel(false)); } }

Target:
private static <T> void retryOperation( final CompletableFuture<T> resultFuture, final Supplier<CompletableFuture<T>> operation, final int retries, final Predicate<Throwable> retryPredicate, final Executor executor) { if (!resultFuture.isDone()) { final CompletableFuture<T> operationFuture = operation.get(); operationFuture.whenCompleteAsync( (t, throwable) -> { if (throwable != null) { if (throwable instanceof CancellationException) { resultFuture.completeExceptionally(new RetryException("Operation future was cancelled.", throwable)); } else { throwable = ExceptionUtils.stripExecutionException(throwable); if (!retryPredicate.test(throwable)) { resultFuture.completeExceptionally( new RetryException("Stopped retrying the operation because the error is not " + "retryable.", throwable)); } else { if (retries > 0) { retryOperation( resultFuture, operation, retries - 1, retryPredicate, executor); } else { resultFuture.completeExceptionally( new RetryException("Could not complete the operation. Number of retries " + "has been exhausted.", throwable)); } } } } else { resultFuture.complete(t); } }, executor); resultFuture.whenComplete( (t, throwable) -> operationFuture.cancel(false)); } }
Source:
public TestMvcClient(MockMvc mvc, LinkDiscoverers discoverers) { Assert.notNull(mvc, "MockMvc must not be null!"); Assert.notNull(discoverers, "LinkDiscoverers must not be null!"); this.mvc = mvc; this.discoverers = discoverers; }

Target:
public TestMvcClient(MockMvc mvc, LinkDiscoverers discoverers) { assertThat(mvc).isNotNull(); assertThat(discoverers).isNotNull(); this.mvc = mvc; this.discoverers = discoverers; }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); PanStampBindingConfig<?> config; try { config = parse(item.getName(), bindingConfig); addBindingConfig(item, config); logger.debug("Created binding config '{}'", config); } catch (ValueException e) { throw new BindingConfigParseException(e.getMessage()); } }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { PanStampBindingConfig<?> config; try { config = parse(item.getName(), bindingConfig); addBindingConfig(item, config); logger.debug("Created binding config '{}'", config); } catch (ValueException e) { throw new BindingConfigParseException(e.getMessage()); } super.processBindingConfiguration(context, item, bindingConfig); }
Source:
private static VoiceStepOption createVoiceStepOption() { final VoiceStepOption voiceStepOption = new VoiceStepOption(); voiceStepOption.setDestination("31612345678"); return voiceStepOption; }

Target:
private static VoiceStepOption createVoiceStepOption() { final VoiceStepOption voiceStepOption = new VoiceStepOption(); voiceStepOption.setDestination("123"); voiceStepOption.setPayload("Test payload Update"); voiceStepOption.setLanguage("en-US"); voiceStepOption.setVoice("female"); voiceStepOption.setRepeat("5"); voiceStepOption.setMedia("test.wav"); voiceStepOption.setLength(10); voiceStepOption.setMaxLength(20); voiceStepOption.setTimeout(30); voiceStepOption.setFinishOnKey("#"); voiceStepOption.setTranscribe(true); voiceStepOption.setTranscribeLanguage("en-US"); voiceStepOption.setRecord("in"); voiceStepOption.setUrl("http://www."); voiceStepOption.setIfMachine("machine1"); voiceStepOption.setMachineTimeout(2000); voiceStepOption.setOnFinish("http://www."); voiceStepOption.setMask(false); return voiceStepOption; }
Source:
protected final void output(HttpServletRequest request, ServletResponse response, List<TranslatedRecommendedItem> items) throws IOException { PrintWriter writer = response.getWriter(); writer.write('['); boolean first = true; for (TranslatedRecommendedItem item : items) { if (first) { first = false; } else { writer.write(','); } writer.write("[\""); writer.write(item.getItemID()); writer.write("\","); writer.write(Float.toString(item.getValue())); writer.write(']'); } writer.write(']'); writer.flush(); System.out.println("BDGFNMGJKNMSRKG"); }

Target:
protected final void output(HttpServletRequest request, ServletResponse response, List<TranslatedRecommendedItem> items) throws IOException { PrintWriter writer = response.getWriter(); writer.write('['); boolean first = true; for (TranslatedRecommendedItem item : items) { if (first) { first = false; } else { writer.write(','); } writer.write("[\""); writer.write(item.getItemID()); writer.write("\","); writer.write(Float.toString(item.getValue())); writer.write(']'); } writer.write(']'); writer.flush(); }
Source:
public Collection<Holiday> get(HolidayType holidayType, ExternalIdBundle regionOrExchangeIds) { Set<Holiday> holidays = new HashSet<>(); for (ExternalId id : regionOrExchangeIds.getExternalIds()) { if (_calendarHolidays.containsKey(id) && (_calendarHolidays.get(id).getType().compareTo(holidayType) == 0)) { holidays.add(_calendarHolidays.get(id)); } } return holidays; }

Target:
public Set<Holiday> get(HolidayType holidayType, ExternalIdBundle regionOrExchangeIds) { Set<Holiday> holidays = new HashSet<>(); for (ExternalId id : regionOrExchangeIds.getExternalIds()) { Pair<ExternalId, HolidayType> key = Pairs.of(id, holidayType); if (_calendarHolidays.containsKey(key)) { holidays.add(_calendarHolidays.get(key)); } } return holidays; }
Source:
public void testConvertDs3RequestWithoutRequestPayload() { final Request testRequest = RequestConverter.toRequest(Ds3ModelFixtures.createBucketRequest(), new Ds3DocSpecImpl( ImmutableMap.of(), ImmutableMap.of())); assertFalse(testRequest.hasRequestPayload()); assertEquals(testRequest.getRequestPayload(), null); }

Target:
public void testConvertDs3RequestWithoutRequestPayload() { final Request testRequest = RequestConverter.toRequest(Ds3ModelFixtures.createBucketRequest(), new Ds3DocSpecEmptyImpl()); assertFalse(testRequest.hasRequestPayload()); assertEquals(testRequest.getRequestPayload(), null); }
Source:
UrlFactory getUrlFactory() { if (urlFactory != null) { return urlFactory; } else { return DEFAULT_URL_FACTORY; } }

Target:
private UrlFactory getUrlFactory() { if (urlFactory != null) { return urlFactory; } else { return DEFAULT_URL_FACTORY; } }
Source:
public boolean isSimpleType(Class<?> type) { Assert.notNull(type, "Type must not be null!"); Map<Class<?>, Boolean> localSimpleTypes = this.simpleTypes; Boolean isSimpleType = localSimpleTypes.get(type); if (Object.class.equals(type) || Enum.class.isAssignableFrom(type)) { return true; } if (isSimpleType != null) { return isSimpleType; } if (type.getName().startsWith("java.lang") | type.getName().startsWith("java.time")) { return true; } for (Class<?> simpleType : localSimpleTypes.keySet()) { if (simpleType.isAssignableFrom(type)) { isSimpleType = localSimpleTypes.get(simpleType); this.simpleTypes = put(localSimpleTypes, type, isSimpleType); return isSimpleType; } } this.simpleTypes = put(localSimpleTypes, type, false); return false; }

Target:
public boolean isSimpleType(Class<?> type) { Assert.notNull(type, "Type must not be null!"); Map<Class<?>, Boolean> localSimpleTypes = this.simpleTypes; Boolean isSimpleType = localSimpleTypes.get(type); if (Object.class.equals(type) || Enum.class.isAssignableFrom(type)) { return true; } if (isSimpleType != null) { return isSimpleType; } if (type.getName().startsWith("java.lang") || type.getName().startsWith("java.time")) { return true; } for (Class<?> simpleType : localSimpleTypes.keySet()) { if (simpleType.isAssignableFrom(type)) { isSimpleType = localSimpleTypes.get(simpleType); this.simpleTypes = put(localSimpleTypes, type, isSimpleType); return isSimpleType; } } this.simpleTypes = put(localSimpleTypes, type, false); return false; }
Source:
private void processCurrentMessages(final ActorProcessingThread currentThread, final WebDebugger dbg) { if (VmSettings.ACTOR_TRACING) { baseMessageId = currentThread.generateMessageBaseId(size); currentThread.currentMessageId = baseMessageId; } if (size > 0) { actor.logMessageBeingExecuted(current); currentThread.currentMessage = current; if (VmSettings.TRUFFLE_DEBUGGER_ENABLED && current.isBreakpoint()) { dbg.prepareSteppingUntilNextRootNode(); } current.execute(); if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } int i = 0; if (size > 1) { for (EventualMessage msg : moreCurrent) { actor.logMessageBeingExecuted(msg); currentThread.currentMessage = msg; if (VmSettings.TRUFFLE_DEBUGGER_ENABLED) { if (msg.isBreakpoint()) { dbg.prepareSteppingUntilNextRootNode(); } } if (VmSettings.MESSAGE_TIMESTAMPS) { executionTimeStamps[i] = System.currentTimeMillis(); i++; } msg.execute(); if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } } } } if (VmSettings.ACTOR_TRACING) { ActorExecutionTrace.mailboxExecuted(current, moreCurrent, baseMessageId, sendTimeStamp, moreSendTimeStamps, executionTimeStamps, actor); } }

Target:
private void processCurrentMessages(final ActorProcessingThread currentThread, final WebDebugger dbg) { if (VmSettings.ACTOR_TRACING) { baseMessageId = currentThread.generateMessageBaseId(size); currentThread.currentMessageId = baseMessageId; } if (size > 0) { actor.logMessageBeingExecuted(firstMessage); currentThread.currentMessage = firstMessage; if (VmSettings.TRUFFLE_DEBUGGER_ENABLED && firstMessage.isBreakpoint()) { dbg.prepareSteppingUntilNextRootNode(); } firstMessage.execute(); if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } int i = 0; if (size > 1) { for (EventualMessage msg : mailboxExtension) { actor.logMessageBeingExecuted(msg); currentThread.currentMessage = msg; if (VmSettings.TRUFFLE_DEBUGGER_ENABLED) { if (msg.isBreakpoint()) { dbg.prepareSteppingUntilNextRootNode(); } } if (VmSettings.MESSAGE_TIMESTAMPS) { executionTimeStamps[i] = System.currentTimeMillis(); i++; } msg.execute(); if (VmSettings.ACTOR_TRACING) { currentThread.currentMessageId += 1; } } } } if (VmSettings.ACTOR_TRACING) { ActorExecutionTrace.mailboxExecuted(firstMessage, mailboxExtension, baseMessageId, firstMessageTimeStamp, mailboxExtensionTimeStamps, executionTimeStamps, actor); } }
Source:
public static String getHdfsStorageDir(DataSegment segment) { return JOINER.join( getHdfsStorageDirUptoVersion(segment), segment.getShardSpec().getPartitionNum() ); }

Target:
public static String getHdfsStorageDir(DataSegment segment) { return JOINER.join( segment.getDataSource(), String.format( "%s_%s", segment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()), segment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime()) ), segment.getVersion().replaceAll(":", "_") ); }
Source:
public static OffsetDate now(ZoneOffset zoneOffset) { final LocalDate localDate = LocalDates.now(); final OffsetDate result = OffsetDate.newBuilder() .setDate(localDate) .setOffset(zoneOffset) .build(); return result; }

Target:
public static OffsetDate now(ZoneOffset zoneOffset) { checkNotNull(zoneOffset); final Calendar cal = nowAt(zoneOffset); final LocalDate localDate = toLocalDate(cal); final OffsetDate result = OffsetDate.newBuilder() .setDate(localDate) .setOffset(zoneOffset) .build(); return result; }
Source:
public ConfigKey<?>[] getConfigKeys() { return new ConfigKey<?>[] {SystemVMUseLocalStorage, iopsMaximumRateLength}; }

Target:
public ConfigKey<?>[] getConfigKeys() { return new ConfigKey<?>[] {SystemVMUseLocalStorage, IOPS_MAX_READ_LENGTH, IOPS_MAX_WRITE_LENGTH, BYTES_MAX_READ_LENGTH, BYTES_MAX_WRITE_LENGTH}; }
Source:
private void openStagingViewLinkClicked() { IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); try { StagingView view = (StagingView) workbenchPage .showView(StagingView.VIEW_ID); view.reload(repository); String message = commitMessageComponent.getCommitMessage(); if (message != null && message.length() > 0) view.setCommitMessage(message); close(); } catch (PartInitException e) { Activator.handleError(UIText.CommitDialog_OpenStagingViewError, e, true); } }

Target:
private void openStagingViewLinkClicked() { IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); try { StagingView view = (StagingView) workbenchPage .showView(StagingView.VIEW_ID); view.reload(repository); String message = commitMessageComponent.getCommitMessage(); if (message != null && message.length() > 0) view.setCommitMessage(message); setReturnCode(CANCEL); close(); } catch (PartInitException e) { Activator.handleError(UIText.CommitDialog_OpenStagingViewError, e, true); } }
Source:
public Change perform(IProgressMonitor pm) throws CoreException { Resource roomRes = rs.getResources().get(0); for(Resource res : rs.getResources()) if(res != roomRes) EcoreUtil.resolveAll(res); roomRes.setURI(newURI); Change undoChange = super.perform(pm); return undoChange; }

Target:
public Change perform(IProgressMonitor pm) throws CoreException { Resource roomRes = rs.getResources().get(0); EcoreUtil.resolveAll(rs); roomRes.setURI(newURI); Change undoChange = super.perform(pm); return undoChange; }