auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected ValidationInfo doValidate() { Pattern pattern = Pattern.compile("^[\\w\\d\\-_]+([\\.\\/][\\w\\d\\-_]+)*$"); if(!pattern.matcher(viewNameEditor.getText()).find()) return new ValidationInfo("Wrong view name", viewNameEditor.getComponent()); return null; }

Target:
protected ValidationInfo doValidate() { if(!viewNamePattern.matcher(viewNameEditor.getText()).find()) { return new ValidationInfo("Wrong view name", viewNameEditor.getComponent()); } return null; }
Source:
private boolean needsInitialisation() { return loginService == null && chatService == null && channelService == null && firebaseAnalytics == null; }

Target:
private boolean needsInitialisation() { return loginService == null || chatService == null || channelService == null || firebaseAnalytics == null; }
Source:
public List<EnrolledCoursesResponse> getUserEnrolledCourses(@NonNull String username, boolean tryCache) throws RetroHttpException { List<EnrolledCoursesResponse> ret = null; String json = null; final String cacheKey = config.getApiHostURL() + "/api/mobile/v0.5/users/" + username + "/course_enrollments"; if (tryCache) { try { json = cache.get(cacheKey); } catch (IOException | NoSuchAlgorithmException e) { logger.debug(e.toString()); } } if (json == null) { Response response = null; try { response = userService.getUserEnrolledCourses(username); } catch (Throwable e) { logger.debug(e.toString()); } if (response != null) { TypedInput input = response.getBody(); if (input != null) { try { InputStream is = input.in(); json = fromStream(is); is.close(); } catch (IOException e) { json = null; logger.debug(e.toString()); } } } } if (json != null) { try { cache.put(cacheKey, json); } catch (IOException | NoSuchAlgorithmException e) { logger.debug(e.toString()); } ret = new ArrayList<>(); JsonArray ary = gson.fromJson(json, JsonArray.class); for (int cnt=0; cnt<ary.size(); ++cnt) { ret.add(gson.fromJson(ary.get(cnt), EnrolledCoursesResponse.class)); } } return ret; }

Target:
public List<EnrolledCoursesResponse> getUserEnrolledCourses(@NonNull String username, boolean tryCache) throws RetroHttpException { List<EnrolledCoursesResponse> ret = null; String json = null; final String cacheKey = getUserEnrolledCoursesURL(username); if (tryCache) { try { json = cache.get(cacheKey); } catch (IOException | NoSuchAlgorithmException e) { logger.debug(e.toString()); } } if (json == null) { Response response = userService.getUserEnrolledCourses(username); if (response != null) { TypedInput input = response.getBody(); if (input != null) { try { json = IOUtils.toString(input.in()); } catch (IOException e) { json = null; logger.debug(e.toString()); } } } } if (json != null) { try { cache.put(cacheKey, json); } catch (IOException | NoSuchAlgorithmException e) { logger.debug(e.toString()); } JsonArray ary = gson.fromJson(json, JsonArray.class); ret = new ArrayList<>(ary.size()); for (int cnt=0; cnt<ary.size(); ++cnt) { ret.add(gson.fromJson(ary.get(cnt), EnrolledCoursesResponse.class)); } } return ret; }
Source:
private void init() { try (InputStream stream = EE.class.getResourceAsStream(name() + ".properties")) { if (stream == null) { packages = new Parameters(); modules = new Parameters(); } UTF8Properties props = new UTF8Properties(); props.load(stream); String packagesProp = props.getProperty("org.osgi.framework.system.packages"); packages = new Parameters(packagesProp); String modulesProp = props.getProperty("jpms.modules"); modules = new Parameters(modulesProp); } catch (IOException ioe) { throw Exceptions.duck(ioe); } }

Target:
private void init() { try (InputStream stream = EE.class.getResourceAsStream(name() + ".properties")) { if (stream == null) { packages = new Parameters(); modules = new Parameters(); return; } UTF8Properties props = new UTF8Properties(); props.load(stream); String packagesProp = props.getProperty("org.osgi.framework.system.packages"); packages = new Parameters(packagesProp); String modulesProp = props.getProperty("jpms.modules"); modules = new Parameters(modulesProp); } catch (IOException ioe) { throw Exceptions.duck(ioe); } }
Source:
private void handleHandshakeAttempt(Optional<VersionMessage> optionalVersionMessage) { if (!optionalVersionMessage.isPresent()) { detected = Optional.of(false); wellConfigured = Optional.of(false); log.info("No local Bitcoin node detected on port {}," + " or the connection was prematurely closed" + " (before a version messages could be coerced)", port); } else { detected = Optional.of(true); log.info("Local Bitcoin node detected on port {}", port); var versionMessage = optionalVersionMessage.get(); var configurationCheckResult = checkWellConfigured(versionMessage); if (configurationCheckResult) { wellConfigured = Optional.of(true); log.info("Local Bitcoin node found to be well configured" + " (not pruning and allows bloom filters)"); } else { wellConfigured = Optional.of(false); log.info("Local Bitcoin node badly configured" + " (it is pruning and/or bloom filters are disabled)"); } } }

Target:
private void handleHandshakeAttempt(Optional<VersionMessage> optionalVersionMessage) { if (!optionalVersionMessage.isPresent()) { detected = false; wellConfigured = false; log.info("No local Bitcoin node detected on port {}, or the connection was prematurely closed" + " (before a version messages could be coerced)", port); } else { detected = true; log.info("Local Bitcoin node detected on port {}", port); var versionMessage = optionalVersionMessage.get(); var configurationCheckResult = checkWellConfigured(versionMessage); if (configurationCheckResult) { wellConfigured = true; log.info("Local Bitcoin node found to be well configured (not pruning and allows bloom filters)"); } else { wellConfigured = false; log.info("Local Bitcoin node badly configured (it is pruning and/or bloom filters are disabled)"); } } }
Source:
public static void main(String[] args) throws IOException { if (args.length == 1) { execute(args[0], "javascript-checks-testkit/target/expected.txt", "its/sources/src"); } else if (args.length == 3) { execute(args[0], args[1], args[2]); } else { LOGGER.error("First argument = fully-qualified check class name. Second argument (optional) = ignored issues file. Second argument (optional) = JS files directory"); } }

Target:
public static void main(String[] args) throws IOException { if (args.length == 1) { execute(args[0], "javascript-checks-testkit/target/expected.txt", "its/sources/src"); } else if (args.length == 3) { execute(args[0], args[1], args[2]); } else { LOGGER.error("First argument = fully-qualified check class name. Second argument (optional) = ignored issues file. Third argument (optional) = JS files directory"); } }
Source:
private boolean performOperation(final IComment comment) { final IReviewItem item = reviewitem; final AtomicReference<IStatus> result = new AtomicReference<IStatus>(); if (isSave == true || isDiscard == true) { final Job job = new Job(Messages.CommandServerOperation) { @Override protected IStatus run(IProgressMonitor monitor) { IStatus status = null; if (isSave == true) { status = reviewBehavior.addComment(item, comment, monitor); if (status.isOK()) { result.set(status); updateClient(comment, item); return Status.OK_STATUS; } } else if (isDiscard == true) { status = reviewBehavior.discardComment(item, comment, monitor); if (status.isOK()) { result.set(status); updateClient(comment, item); return Status.OK_STATUS; } } processServerError(status.getException().getCause().toString()); return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); } return true; }

Target:
private boolean performOperation(final IComment comment) { final IReviewItem item = reviewitem; final AtomicReference<IStatus> result = new AtomicReference<IStatus>(); if (isSave || isDiscard) { final Job job = new Job(Messages.CommandServerOperation) { @Override protected IStatus run(IProgressMonitor monitor) { IStatus status = null; if (isSave) { status = reviewBehavior.addComment(item, comment, monitor); if (status.isOK()) { result.set(status); updateClient(comment, item); return Status.OK_STATUS; } } else if (isDiscard) { status = reviewBehavior.discardComment(item, comment, monitor); if (status.isOK()) { result.set(status); updateClient(comment, item); return Status.OK_STATUS; } } processServerError(status.getException().getCause().toString()); return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); } return true; }
Source:
public ClusterSpectator getClusterSpectator(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig) { return new VcrHelixClusterSpectator(cloudConfig, clusterMapConfig); }

Target:
public ClusterSpectator getClusterSpectator(CloudConfig cloudConfig, ClusterMapConfig clusterMapConfig) { return new HelixClusterSpectator(cloudConfig, clusterMapConfig); }
Source:
public void dispose() { Iterator<AbstractAttributeEditor> editorIterator = editors.iterator(); while (editorIterator.hasNext()) { AbstractAttributeEditor editor = editorIterator.next(); editor.getControl().dispose(); editorIterator.remove(); } }

Target:
public void dispose() { Iterator<AbstractAttributeEditor> editorIterator = editors.iterator(); while (editorIterator.hasNext()) { AbstractAttributeEditor editor = editorIterator.next(); editor.dispose(); } }
Source:
private static String truncateText(String text, int length, int lastWordAllowance) { if (length < 0) { throw new IndexOutOfBoundsException(); } if (text == null || text.length() <= length) { return text; } String truncated; if (length < text.length()) { truncated = text.substring(0, length); } else { truncated = text; } if (truncated.length() > lastWordAllowance * LAST_WORD_ALLOWANCE_MIN_LENGTH_FACTOR) { String[] parts = truncated.split("\\b(?=\\w*$)"); if (parts.length > 1) { int lastBoundryIndex = parts[0].length(); if (truncated.length() - lastBoundryIndex < lastWordAllowance) { truncated = parts[0].trim(); } } } return truncated; }

Target:
private static String truncateText(String text, int length, int lastWordAllowance) { if (length < 0) { throw new IndexOutOfBoundsException(); } if (text == null || text.length() <= length) { return text; } String truncated; if (length < text.length()) { truncated = text.substring(0, length); } else { truncated = text; } if (truncated.length() > lastWordAllowance * LAST_WORD_ALLOWANCE_MIN_LENGTH_FACTOR) { String[] parts = truncated.split("\\b(?=\\w*$)"); if (parts.length > 1) { int lastBoundaryIndex = parts[0].length(); if (truncated.length() - lastBoundaryIndex < lastWordAllowance) { truncated = parts[0].trim(); } } } return truncated; }
Source:
private void visitClassOrInterface(String name, FunctionType ftype) { final boolean emitInstance = !ftype.isInterface(); if (emitInstance) { emit("class"); emit(name); visitTemplateTypes(ftype); emit("extends"); emit(name + INSTANCE_CLASS_SUFFIX); visitTemplateTypes(ftype); emit("{"); indent(); emitBreak(); visitProperties(ftype, true); unindent(); emit("}"); emitBreak(); } if (ftype.isConstructor()) { emit("class"); } else if (ftype.isInterface()) { emit("interface"); } else { checkState(false, "Unexpected function type " + ftype); } emit(emitInstance ? name + INSTANCE_CLASS_SUFFIX : name); visitTemplateTypes(ftype); if (ftype.getExtendedInterfacesCount() > 0) { emit("extends"); Iterator<ObjectType> it = ftype.getExtendedInterfaces().iterator(); emitCommaSeparatedInterfaces(it); } ObjectType superType = getSuperType(ftype); if (superType != null) { emit("extends"); if (isPrivate(superType.getJSDocInfo())) { emit(Constants.INTERNAL_NAMESPACE + ".PrivateClass"); } else { boolean emitInstanceForObject = emitInstance && (opts.allowPlatformExterns || !isDefinedInPlatformExterns(superType)); Visitor<Void> visitor = new ExtendsImplementsTypeVisitor(emitInstanceForObject); superType.visit(visitor); } } Iterator<ObjectType> it = ftype.getOwnImplementedInterfaces().iterator(); if (it.hasNext()) { emit("implements"); emitCommaSeparatedInterfaces(it); } boolean implementsIArrayLike = any(ftype.getAllImplementedInterfaces(), IS_IARRYLIKE); visitObjectType(ftype, ftype.getPrototype(), implementsIArrayLike || ftype.isDict()); }

Target:
private void visitClassOrInterface(String name, FunctionType ftype) { final boolean emitInstance = !ftype.isInterface(); if (emitInstance) { emit("class"); emit(name); visitTemplateTypes(ftype); emit("extends"); emit(name + INSTANCE_CLASS_SUFFIX); visitTemplateTypes(ftype); emit("{"); indent(); emitBreak(); visitProperties(ftype, true); unindent(); emit("}"); emitBreak(); } if (ftype.isConstructor()) { emit("class"); } else if (ftype.isInterface()) { emit("interface"); } else { checkState(false, "Unexpected function type " + ftype); } emit(emitInstance ? name + INSTANCE_CLASS_SUFFIX : name); visitTemplateTypes(ftype); if (ftype.getExtendedInterfacesCount() > 0) { emit("extends"); Iterator<ObjectType> it = ftype.getExtendedInterfaces().iterator(); emitCommaSeparatedInterfaces(it); } ObjectType superType = getSuperType(ftype); if (superType != null) { emit("extends"); if (isPrivate(superType.getJSDocInfo())) { emit(Constants.INTERNAL_NAMESPACE + ".PrivateClass"); } else { boolean emitInstanceForObject = emitInstance && (opts.emitPlatformExterns || !isDefinedInPlatformExterns(superType)); Visitor<Void> visitor = new ExtendsImplementsTypeVisitor(emitInstanceForObject); superType.visit(visitor); } } Iterator<ObjectType> it = ftype.getOwnImplementedInterfaces().iterator(); if (it.hasNext()) { emit("implements"); emitCommaSeparatedInterfaces(it); } boolean implementsIArrayLike = any(ftype.getAllImplementedInterfaces(), IS_IARRYLIKE); visitObjectType(ftype, ftype.getPrototype(), implementsIArrayLike || ftype.isDict()); }
Source:
private void updateHoverBehavior() { SourceViewerConfiguration configuration = getSourceViewerConfiguration(); String[] types = configuration.getConfiguredContentTypes(getSourceViewer()); for (int i = 0; i < types.length; i++) { String t = types[i]; ISourceViewer sourceViewer = getSourceViewer(); if (sourceViewer == null) { return; } if (sourceViewer instanceof ITextViewerExtension2) { ((ITextViewerExtension2) sourceViewer).removeTextHovers(t); int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t); if (stateMasks != null) { for (int j = 0; j < stateMasks.length; j++) { int stateMask = stateMasks[j]; ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask); ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask); } } else { ITextHover textHover = configuration.getTextHover(sourceViewer, t); ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK); } } else { sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t); } } }

Target:
private void updateHoverBehavior() { ISourceViewer sourceViewer = getSourceViewer(); if (sourceViewer == null) { return; } SourceViewerConfiguration configuration = getSourceViewerConfiguration(); String[] types = configuration.getConfiguredContentTypes(getSourceViewer()); for (int i = 0; i < types.length; i++) { String t = types[i]; if (sourceViewer instanceof ITextViewerExtension2) { ((ITextViewerExtension2) sourceViewer).removeTextHovers(t); int[] stateMasks = configuration.getConfiguredTextHoverStateMasks(getSourceViewer(), t); if (stateMasks != null) { for (int j = 0; j < stateMasks.length; j++) { int stateMask = stateMasks[j]; ITextHover textHover = configuration.getTextHover(sourceViewer, t, stateMask); ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, stateMask); } } else { ITextHover textHover = configuration.getTextHover(sourceViewer, t); ((ITextViewerExtension2) sourceViewer).setTextHover(textHover, t, ITextViewerExtension2.DEFAULT_HOVER_STATE_MASK); } } else { sourceViewer.setTextHover(configuration.getTextHover(sourceViewer, t), t); } } }
Source:
private static <T> T writeAtomically(final File file, final File tmpDir, OutputStreamConsumer<T> f) throws IOException { final File tmpFile = new File(tmpDir, StringUtils.format(".%s.%s", file.getName(), UUID.randomUUID())); try { final T retVal; try (final FileOutputStream out = new FileOutputStream(tmpFile)) { retVal = f.apply(uncloseable(out)); out.flush(); out.getChannel().force(true); } java.nio.file.Files.move( tmpFile.toPath(), file.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING ); try (final FileChannel directory = FileChannel.open(file.getParentFile().toPath(), StandardOpenOption.READ)) { directory.force(true); } return retVal; } finally { if (tmpFile.exists()) { if (!tmpFile.delete()) { log.warn("Could not delete tmpFile[%s]", tmpFile); } } } }

Target:
private static <T> T writeAtomically(final File file, final File tmpDir, OutputStreamConsumer<T> f) throws IOException { final File tmpFile = new File(tmpDir, StringUtils.format(".%s.%s", file.getName(), UUID.randomUUID())); try (final Closeable deleter = () -> java.nio.file.Files.deleteIfExists(tmpFile.toPath())) { final T retVal; try ( final FileChannel fileChannel = FileChannel.open( tmpFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW ); final OutputStream out = Channels.newOutputStream(fileChannel) ) { retVal = f.apply(uncloseable(out)); fileChannel.force(true); } java.nio.file.Files.move( tmpFile.toPath(), file.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING ); try (final FileChannel directory = FileChannel.open(file.getParentFile().toPath(), StandardOpenOption.READ)) { directory.force(true); } return retVal; } }
Source:
public OAuth2RequestAuthenticator(ClientCredentials<OAuth2AccessToken> clientCredentials) { this.clientCredentials = clientCredentials; }

Target:
public OAuth2RequestAuthenticator(ClientCredentials<OAuth2AccessToken> clientCredentials) { Assert.notNull(clientCredentials, "clientCredentials may not be null"); this.clientCredentials = clientCredentials; }
Source:
public CRAMFileReader(final File cramFile, final InputStream inputStream, final CRAMReferenceSource referenceSource) { if (cramFile == null && inputStream == null) { throw new IllegalArgumentException("Either file or input stream is required."); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.cramFile = cramFile; this.inputStream = inputStream; this.referenceSource = referenceSource; if (cramFile != null) initIndexFile(null); getIterator(); }

Target:
public CRAMFileReader(final File cramFile, final InputStream inputStream, final CRAMReferenceSource referenceSource) { if (cramFile == null && inputStream == null) { throw new IllegalArgumentException("Either file or input stream is required."); } if (referenceSource == null) { throw new IllegalArgumentException("A reference is required for CRAM readers"); } this.cramFile = cramFile; this.inputStream = inputStream; this.referenceSource = referenceSource; if (cramFile != null) { mIndexFile = findIndexForFile(null, cramFile); } getIterator(); }
Source:
private boolean isWordWrapPreferenceAllowed() { return Boolean.getBoolean("eclipse.workaround.bug488162"); }

Target:
private boolean isWordWrapPreferenceAllowed() { return Boolean.getBoolean("eclipse.show.wrapByDefaultPreference"); }
Source:
public static RepositoryMapping getMapping(final IResource resource) { if (isNonWorkspace(resource)) return null; if (resource.isLinked(IResource.CHECK_ANCESTORS)) return getMapping(resource.getRawLocation()); IProject project = resource.getProject(); if (project == null) return null; final RepositoryProvider rp = RepositoryProvider.getProvider(project); if (!(rp instanceof GitProvider)) return null; if (((GitProvider)rp).getData() == null) return null; return ((GitProvider)rp).getData().getRepositoryMapping(resource); }

Target:
public static RepositoryMapping getMapping(final IResource resource) { if (isNonWorkspace(resource)) return null; if (resource.isLinked(IResource.CHECK_ANCESTORS)) return getMapping(resource.getLocation()); IProject project = resource.getProject(); if (project == null) return null; final RepositoryProvider rp = RepositoryProvider.getProvider(project); if (!(rp instanceof GitProvider)) return null; if (((GitProvider)rp).getData() == null) return null; return ((GitProvider)rp).getData().getRepositoryMapping(resource); }
Source:
private IVersionedApiResource endpointFor(String version, String kind) { String[] split = StringUtils.isBlank(version) ? new String[] : version.split(FWD_SLASH); Optional<? extends IVersionedApiResource> result = null; if (split.length <= 1) { result = resourceEndpoints.stream().filter(e -> { return e.getName().equals(ResourceKind.pluralize(kind, true, true)) && (split.length == 0 || e.getVersion().equals(split[split.length - 1])) && (split.length < 2 || e.getApiGroupName().equals(split[0])); }).findFirst(); } else { result = Optional.of(formatEndpointFor(API_GROUPS_API, version, kind)); } if (result.isPresent()) { int index = resourceEndpoints.indexOf(result.get()); if (index > -1) { return resourceEndpoints.get(index); } } return null; }

Target:
private IVersionedApiResource endpointFor(String version, String kind) { String[] split = StringUtils.isBlank(version) ? new String[] : version.split(FWD_SLASH); Optional<? extends IVersionedApiResource> result = null; if (split.length <= 1) { result = resourceEndpoints.stream().filter(e -> isResourceCompatible(kind, split, e) ).findFirst(); } else { result = Optional.of(formatEndpointFor(API_GROUPS_API, version, kind)); } if (result.isPresent()) { int index = resourceEndpoints.indexOf(result.get()); if (index > -1) { return resourceEndpoints.get(index); } } return null; }
Source:
private static AWSCredentialsProvider overwriteBasicCredentials(AwsCredentialsConfig task, final AWSCredentials creds) { task.setAuthMethod("default"); task.setAccessKeyId(Optional.of(creds.getAWSAccessKeyId())); task.setSecretAccessKey(Optional.of(creds.getAWSSecretKey())); return new AWSCredentialsProvider() { public AWSCredentials getCredentials() { return creds; } public void refresh() { } }; }

Target:
private static AWSCredentialsProvider overwriteBasicCredentials(AwsCredentialsConfig task, final AWSCredentials creds) { task.setAuthMethod("basic"); task.setAccessKeyId(Optional.of(creds.getAWSAccessKeyId())); task.setSecretAccessKey(Optional.of(creds.getAWSSecretKey())); return new AWSCredentialsProvider() { public AWSCredentials getCredentials() { return creds; } public void refresh() { } }; }
Source:
private void testAddTemplateQuestionLink() throws Exception { ______TS("add template question link"); feedbackEditPage = getFeedbackEditPage(); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.clickTemplateModalButton(); feedbackEditPage.verifyHtmlPart(By.id("addTemplateQuestionModal"), "/instructorFeedbackTemplateQuestionExpandedModal.html"); assertFalse("Unable to submit when there is no question selected", feedbackEditPage.isAddTemplateQuestionButtonEnabled()); }

Target:
private void testAddTemplateQuestionLink() throws Exception { ______TS("add template question link"); feedbackEditPage.clickNewQuestionButton(); feedbackEditPage.clickTemplateModalButton(); feedbackEditPage.verifyHtmlPart(By.id("addTemplateQuestionModal"), "/instructorFeedbackTemplateQuestionExpandedModal.html"); assertFalse("Should not be able to submit when there is no question selected", feedbackEditPage.isAddTemplateQuestionButtonEnabled()); }
Source:
protected void okPressed() { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openWarning(getShell(), UIText.CommitDialog_ErrorNoItemsSelected, UIText.CommitDialog_ErrorNoItemsSelectedToBeCommitted); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!getSeverityItems().isEmpty()) { int warnings = 0; int errors = 0; if ((getSeverityItems().get(IMarker.SEVERITY_WARNING) != null)) { warnings = getSeverityItems().get(IMarker.SEVERITY_WARNING) .size(); } if (getSeverityItems().get(IMarker.SEVERITY_ERROR) != null) { errors = getSeverityItems().get(IMarker.SEVERITY_ERROR).size(); } CommitWarningDialog dialog = new CommitWarningDialog(PlatformUI .getWorkbench().getActiveWorkbenchWindow().getShell(), warnings, errors); if (dialog.open() == Window.CANCEL) { return; } } Object[] checkedElements = filesViewer.getCheckedElements(); selectedFiles.clear(); for (Object obj : checkedElements) selectedFiles.add(((CommitItem) obj).path); amending = commitMessageComponent.isAmending(); commitMessage = commitMessageComponent.getCommitMessage(); author = commitMessageComponent.getAuthor(); committer = commitMessageComponent.getCommitter(); createChangeId = changeIdItem.getSelection(); IDialogSettings settings = org.eclipse.egit.ui.Activator .getDefault().getDialogSettings(); settings.put(SHOW_UNTRACKED_PREF, showUntracked); CommitMessageHistory.saveCommitHistory(getCommitMessage()); super.okPressed(); }

Target:
protected void okPressed() { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openWarning(getShell(), UIText.CommitDialog_ErrorNoItemsSelected, UIText.CommitDialog_ErrorNoItemsSelectedToBeCommitted); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!getSeverityItems().isEmpty() && getPreferenceStore() .getBoolean(UIPreferences.CHECK_BEFORE_COMMITTING)) { CommitWarningDialog dialog = new CommitWarningDialog(PlatformUI .getWorkbench().getActiveWorkbenchWindow().getShell(), getSeverityItems()); if (dialog.open() == Window.CANCEL) { return; } } Object[] checkedElements = filesViewer.getCheckedElements(); selectedFiles.clear(); for (Object obj : checkedElements) selectedFiles.add(((CommitItem) obj).path); amending = commitMessageComponent.isAmending(); commitMessage = commitMessageComponent.getCommitMessage(); author = commitMessageComponent.getAuthor(); committer = commitMessageComponent.getCommitter(); createChangeId = changeIdItem.getSelection(); IDialogSettings settings = org.eclipse.egit.ui.Activator .getDefault().getDialogSettings(); settings.put(SHOW_UNTRACKED_PREF, showUntracked); CommitMessageHistory.saveCommitHistory(getCommitMessage()); super.okPressed(); }
Source:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(jobs); for (String job_s: hs) { AbstractItem job = null; try { job = (AbstractItem) jenkins.getItemByFullName(job_s); if(job == null) { AbstractProject project = AbstractProject.findNearest(job_s); if(project == null) { stderr.format("No such job \u2018%s\u2019 exists.\n", job_s); } else { stderr.format("No such job ‘%s’ exists. Perhaps you meant ‘never_created’?", job_s, project.getFullName()); } errorOccurred = true; continue; } try { job.checkPermission(AbstractItem.CONFIGURE); } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } job.doReload(); } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during reloading of job '%s': %s", job == null ? "(null)" : job.getFullName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? 1 : 0; }

Target:
protected int run() throws Exception { boolean errorOccurred = false; final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { stderr.println("The Jenkins instance has not been started, or was already shut down!"); return -1; } final HashSet<String> hs = new HashSet<String>(); hs.addAll(jobs); for (String job_s: hs) { AbstractItem job = null; try { Item item = jenkins.getItemByFullName(job_s); if (item instanceof AbstractItem) { job = (AbstractItem) item; } else if (item != null) { LOGGER.log(Level.WARNING, "Unsupported item type: {0}", item.getClass().getName()); } if(job == null) { AbstractProject project = AbstractProject.findNearest(job_s); if(project == null) { stderr.format("No such job \u2018%s\u2019 exists.\n", job_s); } else { stderr.format("No such job \u2018%s\u2019 exists. Perhaps you meant \u2018%s\u2019?", job_s, project.getFullName()); } errorOccurred = true; continue; } try { job.checkPermission(AbstractItem.CONFIGURE); } catch (Exception e) { stderr.println(e.getMessage()); errorOccurred = true; continue; } job.doReload(); } catch (Exception e) { final String errorMsg = String.format("Unexpected exception occurred during reloading of job '%s': %s", job == null ? "(null)" : job.getFullName(), e.getMessage()); stderr.println(errorMsg); LOGGER.warning(errorMsg); errorOccurred = true; continue; } } return errorOccurred ? 1 : 0; }
Source:
public List<Variant> create(String fileId, String studyId, String line) throws IllegalArgumentException, NonVariantException, IncompleteInformationException { String[] fields = line.split("\t"); if (fields.length < 8) { throw new IllegalArgumentException("Not enough fields provided (min 8)"); } String chromosome = getChromosomeWithoutPrefix(fields); long position = getPosition(fields); String reference = getReference(fields); String[] alternateAlleles = getAlternateAlleles(fields); float quality = getQuality(fields); String filter = getFilter(fields); String info = getInfo(fields); String format = getFormat(fields); List<VariantCoreFields> generatedKeyFields = buildVariantCoreFields(chromosome, position, reference, alternateAlleles); List<Variant> variants = new LinkedList<>(); for (int altAlleleIdx = 0; altAlleleIdx < alternateAlleles.length; altAlleleIdx++) { VariantCoreFields keyFields = generatedKeyFields.get(altAlleleIdx); Variant variant = new Variant(chromosome, keyFields.getStart(), keyFields.getEnd(), keyFields.getReference(), keyFields.getAlternate(), null); String[] secondaryAlternates = getSecondaryAlternates(altAlleleIdx, alternateAlleles); VariantSourceEntry file = new VariantSourceEntry(fileId, studyId, secondaryAlternates, format); variant.addSourceEntry(file); parseSplitSampleData(file, fields, altAlleleIdx); setOtherFields(variant, fileId, studyId, quality, filter, info, altAlleleIdx, alternateAlleles, line); checkVariantInformation(variant, fileId, studyId); variants.add(variant); } return variants; }

Target:
public List<Variant> create(String fileId, String studyId, String line) throws IllegalArgumentException, NonVariantException, IncompleteInformationException { String[] fields = line.split("\t"); if (fields.length < 8) { throw new IllegalArgumentException("Not enough fields provided (min 8)"); } String chromosome = getChromosomeWithoutPrefix(fields); long position = getPosition(fields); String reference = getReference(fields); String[] alternateAlleles = getAlternateAlleles(fields); float quality = getQuality(fields); String filter = getFilter(fields); String info = getInfo(fields); String format = getFormat(fields); List<VariantCoreFields> generatedKeyFields = buildVariantCoreFields(chromosome, position, reference, alternateAlleles); List<Variant> variants = new LinkedList<>(); for (int altAlleleIdx = 0; altAlleleIdx < alternateAlleles.length; altAlleleIdx++) { VariantCoreFields keyFields = generatedKeyFields.get(altAlleleIdx); Variant variant = new Variant(chromosome, keyFields.getStart(), keyFields.getEnd(), keyFields.getReference(), keyFields.getAlternate()); String[] secondaryAlternates = getSecondaryAlternates(altAlleleIdx, alternateAlleles); VariantSourceEntry file = new VariantSourceEntry(fileId, studyId, secondaryAlternates, format); variant.addSourceEntry(file); parseSplitSampleData(file, fields, altAlleleIdx); setOtherFields(variant, fileId, studyId, quality, filter, info, altAlleleIdx, alternateAlleles, line); checkVariantInformation(variant, fileId, studyId); variants.add(variant); } return variants; }
Source:
private byte[] convertXMLToHTML(InputStream xml, InputStream xsl) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource(xsl)); transformer.transform(new javax.xml.transform.stream.StreamSource(xml), new javax.xml.transform.stream.StreamResult(output)); } catch (TransformerException e) { LOG.error("Exception in transforming from xml to html", e); } return output.toByteArray(); }

Target:
private byte[] convertXMLToHTML(InputStream xml, InputStream xsl) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(xsl)); transformer.transform(new javax.xml.transform.stream.StreamSource(xml), new javax.xml.transform.stream.StreamResult(output)); } catch (TransformerException e) { LOG.error("Exception in transforming from xml to html", e); } return output.toByteArray(); }
Source:
public static long crc32(String data) { if (data == null) { return -1; } try { byte bytes[] = data.getBytes("UTF-8"); Checksum checksum = new CRC32(); checksum.update(bytes, 0, bytes.length); return checksum.getValue(); } catch (UnsupportedEncodingException e) { return -1; } }

Target:
public static long crc32(String data) { if (data == null) { return -1; } try { byte bytes[] = data.getBytes("UTF-8"); Checksum checksum = new CRC32(); checksum.update(bytes, 0, bytes.length); return checksum.getValue(); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
Source:
public Optional<ImmutableWorkerInfo> findWorkerForTask( WorkerTaskRunnerConfig config, ImmutableMap<String, ImmutableWorkerInfo> zkWorkers, Task task ) { final TreeSet<ImmutableWorkerInfo> sortedWorkers = Sets.newTreeSet( new Comparator<ImmutableWorkerInfo>() { @Override public int compare( ImmutableWorkerInfo zkWorker, ImmutableWorkerInfo zkWorker2 ) { int retVal = Ints.compare(zkWorker2.getWorker().getCapacity() - zkWorker2.getCurrCapacityUsed(), zkWorker.getWorker().getCapacity() - zkWorker.getCurrCapacityUsed()); if(retVal == 0) { retVal = zkWorker2.getWorker().getVersion().compareTo(zkWorker.getWorker().getVersion()); } return retVal; } } ); sortedWorkers.addAll(zkWorkers.values()); final String minWorkerVer = config.getMinWorkerVersion(); for (ImmutableWorkerInfo zkWorker : sortedWorkers) { if (zkWorker.canRunTask(task) && zkWorker.isValidVersion(minWorkerVer)) { return Optional.of(zkWorker); } } return Optional.absent(); }

Target:
public Optional<ImmutableWorkerInfo> findWorkerForTask( WorkerTaskRunnerConfig config, ImmutableMap<String, ImmutableWorkerInfo> zkWorkers, Task task ) { final TreeSet<ImmutableWorkerInfo> sortedWorkers = Sets.newTreeSet( Comparator.comparing(ImmutableWorkerInfo::getAvailableCapacity).reversed() .thenComparing(zkWorker -> zkWorker.getWorker().getVersion())); sortedWorkers.addAll(zkWorkers.values()); final String minWorkerVer = config.getMinWorkerVersion(); for (ImmutableWorkerInfo zkWorker : sortedWorkers) { if (zkWorker.canRunTask(task) && zkWorker.isValidVersion(minWorkerVer)) { return Optional.of(zkWorker); } } return Optional.absent(); }
Source:
public List<String> getSearchDomains() { Object serviceLabels = ServiceDiscoveryUtil.getLaunchConfigObject(service, launchConfigName, InstanceConstants.FIELD_LABELS); if (serviceLabels != null) { String setSearchDomain = ((Map<String, String>) serviceLabels) .get(SystemLabels.LABEL_RANCHER_CONTAINER_DNS_PRIORITY); if (setSearchDomain != null && !setSearchDomain.isEmpty() && StringUtils.equals(setSearchDomain.trim(), "None")) { return Arrays.asList(); } } String stackNamespace = ServiceDiscoveryDnsUtil.getStackNamespace(this.stack, this.service); String serviceNamespace = ServiceDiscoveryDnsUtil .getServiceNamespace(this.stack, this.service); return Arrays.asList(stackNamespace, serviceNamespace); }

Target:
public List<String> getSearchDomains() { Object serviceLabels = ServiceDiscoveryUtil.getLaunchConfigObject(service, launchConfigName, InstanceConstants.FIELD_LABELS); if (serviceLabels != null) { String setSearchDomain = ((Map<String, String>) serviceLabels) .get(SystemLabels.LABEL_RANCHER_CONTAINER_DNS_PRIORITY); if (setSearchDomain != null && !setSearchDomain.isEmpty() && StringUtils.equalsIgnoreCase(setSearchDomain.trim(), "None")) { return Arrays.asList(); } } String stackNamespace = ServiceDiscoveryDnsUtil.getStackNamespace(this.stack, this.service); String serviceNamespace = ServiceDiscoveryDnsUtil .getServiceNamespace(this.stack, this.service); return Arrays.asList(stackNamespace, serviceNamespace); }
Source:
public BreakIteratorSentenceDetector(Locale locale) { breakIterator = BreakIterator.getSentenceInstance(Locale.US); }

Target:
public BreakIteratorSentenceDetector(Locale locale) { breakIterator = BreakIterator.getSentenceInstance(locale); }
Source:
public Set<String> getFreeVariables() { return new HashSet<String>(); }

Target:
public Set<String> getFreeVariables() { Set<String> freeVars = new HashSet<String>(); for (Effect e : effectSet) { freeVars.add(e.getPath().getName()); } return freeVars; }
Source:
private void testChangeFeedbackRecipient() { ______TS("click on Edit visibility then change recipient"); feedbackEditPage = getFeedbackEditPage(); WebElement editLabel = feedbackEditPage.getEditLabel(1); WebElement previewLabel = feedbackEditPage.getPreviewLabel(1); feedbackEditPage.clickQuestionEditForQuestion1(); editLabel.click(); feedbackEditPage.selectRecipientTypeForQuestion1("Other teams in the course"); boolean isPreviewButtonActive = previewLabel.getAttribute("class").contains("active"); assertTrue(!isPreviewButtonActive); boolean isEditButtonActive = editLabel.getAttribute("class").contains("active"); assertTrue(isEditButtonActive); WebElement visibilityMessage = feedbackEditPage.getVisibilityMessage(1); assertTrue(!visibilityMessage.isDisplayed()); WebElement visibilityOptions = feedbackEditPage.getVisibilityOptions(1); assertTrue(visibilityOptions.isDisplayed()); }

Target:
private void testChangeFeedbackRecipient() { ______TS("click on Edit visibility then change recipient"); feedbackEditPage = getFeedbackEditPage(); assertTrue(feedbackEditPage.verifyPreviewLabelIsActive(1)); assertFalse(feedbackEditPage.verifyEditLabelIsActive(1)); assertTrue(feedbackEditPage.verifyVisibilityMessageIsDisplayed(1)); assertFalse(feedbackEditPage.verifyVisibilityOptionsIsDisplayed(1)); feedbackEditPage.clickQuestionEditForQuestion1(); feedbackEditPage.clickEditLabel(1); feedbackEditPage.selectRecipientTypeForQuestion1("Other teams in the course"); assertFalse(feedbackEditPage.verifyPreviewLabelIsActive(1)); assertTrue(feedbackEditPage.verifyEditLabelIsActive(1)); assertFalse(feedbackEditPage.verifyVisibilityMessageIsDisplayed(1)); assertTrue(feedbackEditPage.verifyVisibilityOptionsIsDisplayed(1)); }
Source:
private RemoteTransaction getOrCreateRemoteTransaction(GlobalTransaction globalTx, WriteCommand[] modifications, int topologyId) { RemoteTransaction remoteTransaction = remoteTransactions.get(globalTx); if (remoteTransaction != null) return remoteTransaction; if (!running) { throw log.cacheIsStopping(cacheName); } return remoteTransactions.compute(globalTx, (gtx, existing) -> { if (existing != null) { if (trace) log.tracef("Remote transaction already registered: %s", existing); return existing; } else { if (isTransactionCompleted(globalTx)) { throw new IllegalStateException("Cannot create remote transaction " + globalTx + ", already completed"); } if (!rpcManager.getTransport().getMembers().contains(gtx.getAddress())) { throw new IllegalStateException( "Cannot create remote transaction " + globalTx + ", the originator is not in the cluster view"); } RemoteTransaction newTransaction = modifications == null ? txFactory.newRemoteTransaction(globalTx, topologyId) : txFactory.newRemoteTransaction(modifications, globalTx, topologyId); if (trace) log.tracef("Created and registered remote transaction %s", newTransaction); if (topologyId < minTxTopologyId) { if (trace) log.tracef("Changing minimum topology ID from %d to %d", minTxTopologyId, topologyId); minTxTopologyId = topologyId; } return newTransaction; } }); }

Target:
private RemoteTransaction getOrCreateRemoteTransaction(GlobalTransaction globalTx, WriteCommand[] modifications, int topologyId) { RemoteTransaction existingTransaction = remoteTransactions.get(globalTx); if (existingTransaction != null) return existingTransaction; if (!running) { throw log.cacheIsStopping(cacheName); } int viewId = rpcManager.getTransport().getViewId(); if (!rpcManager.getTransport().getMembers().contains(globalTx.getAddress())) { throw new IllegalStateException( "Cannot create remote transaction " + globalTx + ", the originator is not in the cluster view"); } RemoteTransaction newTransaction = modifications == null ? txFactory.newRemoteTransaction(globalTx, topologyId) : txFactory.newRemoteTransaction(modifications, globalTx, topologyId); RemoteTransaction remoteTransaction = remoteTransactions.compute(globalTx, (gtx, existing) -> { if (existing != null) { if (trace) log.tracef("Remote transaction already registered: %s", existing); return existing; } else { if (isTransactionCompleted(gtx)) { throw new IllegalStateException("Cannot create remote transaction " + gtx + ", already completed"); } if (trace) log.tracef("Created and registered remote transaction %s", newTransaction); if (topologyId < minTxTopologyId) { if (trace) log.tracef("Changing minimum topology ID from %d to %d", minTxTopologyId, topologyId); minTxTopologyId = topologyId; } return newTransaction; } }); if (rpcManager.getTransport().getViewId() != viewId && !rpcManager.getTransport().getMembers().contains(globalTx.getAddress())) { if (partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(globalTx)) { log.debugf("Rolling back transaction %s because originator %s left the cluster", globalTx, globalTx.getAddress()); killTransaction(globalTx); } return remoteTransaction; } return remoteTransaction; }
Source:
private String removeUserInfo(String url) { String userInfo = ""; try { userInfo = new URL(url).getUserInfo(); } catch (MalformedURLException e) { logger.warn("Suppressed exception", e); } return url.replace(userInfo, "XXXX:XXXX"); }

Target:
public static String removeUserInfo(String url) { Logger logger = LoggerFactory.getLogger("HttpClient"); String userInfo = ""; try { userInfo = new URL(url).getUserInfo(); } catch (MalformedURLException e) { logger.warn("Suppressed exception", e); } if (null == userInfo || userInfo.isEmpty()){ return url; } return url.replace(userInfo, "XXXX:XXXX"); }
Source:
public EnergyNet(@Nonnull Location l) { super(SlimefunPlugin.getNetworkManager(), l); }

Target:
protected EnergyNet(@Nonnull Location l) { super(SlimefunPlugin.getNetworkManager(), l); }
Source:
private static boolean isSamsungS5() { return (Build.MANUFACTURER.equals("Samsung") && (((Build.DEVICE.startsWith("k") || Build.DEVICE.startsWith("l")) && (Build.MODEL.contains("SM-G"))) || (Build.DEVICE.contains("SCL23")))); }

Target:
private static boolean isSamsungS5() { return (Build.MANUFACTURER.equalsIgnoreCase("samsung") && (((Build.DEVICE.startsWith("k") || Build.DEVICE.startsWith("l")) && (Build.MODEL.contains("SM-G"))) || (Build.DEVICE.contains("SCL23")))); }
Source:
protected static LicenseInfoParsingResult getLicenseInfoFromSpdx(AttachmentContent attachmentContent, SpdxDocument doc) { LicenseInfo licenseInfo = new LicenseInfo().setFilenames(Arrays.asList(attachmentContent.getFilename())); if(! licenseInfo.isSetLicenseNamesWithTexts()){ licenseInfo.setLicenseNamesWithTexts(new HashSet<>()); } if(! licenseInfo.isSetCopyrights()){ licenseInfo.setCopyrights(new HashSet<>()); } try { for (SpdxItem spdxItem : doc.getDocumentDescribes()) { licenseInfo.getLicenseNamesWithTexts() .addAll(getAllLicenseTexts(spdxItem, true) .collect(Collectors.toSet())); licenseInfo.getCopyrights() .addAll(getAllCopyrights(spdxItem) .collect(Collectors.toSet())); } } catch (UncheckedInvalidSPDXAnalysisException e) { return new LicenseInfoParsingResult() .setStatus(LicenseInfoRequestStatus.FAILURE) .setMessage(e.getInvalidSPDXAnalysisExceptionCause().getMessage()); } catch (InvalidSPDXAnalysisException e) { return new LicenseInfoParsingResult() .setStatus(LicenseInfoRequestStatus.FAILURE) .setMessage(e.getMessage()); } return new LicenseInfoParsingResult() .setLicenseInfo(licenseInfo) .setStatus(LicenseInfoRequestStatus.SUCCESS); }

Target:
protected static LicenseInfoParsingResult getLicenseInfoFromSpdx(AttachmentContent attachmentContent, SpdxDocument doc) { LicenseInfo licenseInfo = new LicenseInfo().setFilenames(Arrays.asList(attachmentContent.getFilename())); licenseInfo.setLicenseNamesWithTexts(new HashSet<>()); licenseInfo.setCopyrights(new HashSet<>()); try { for (SpdxItem spdxItem : doc.getDocumentDescribes()) { licenseInfo.getLicenseNamesWithTexts() .addAll(getAllLicenseTexts(spdxItem, true) .collect(Collectors.toSet())); licenseInfo.getCopyrights() .addAll(getAllCopyrights(spdxItem) .collect(Collectors.toSet())); } } catch (UncheckedInvalidSPDXAnalysisException e) { return new LicenseInfoParsingResult() .setStatus(LicenseInfoRequestStatus.FAILURE) .setMessage(e.getInvalidSPDXAnalysisExceptionCause().getMessage()); } catch (InvalidSPDXAnalysisException e) { return new LicenseInfoParsingResult() .setStatus(LicenseInfoRequestStatus.FAILURE) .setMessage(e.getMessage()); } return new LicenseInfoParsingResult() .setLicenseInfo(licenseInfo) .setStatus(LicenseInfoRequestStatus.SUCCESS); }
Source:
AbstractBuilder(int initialCapacity) { this.list = new ArrayList<T>(initialCapacity); }

Target:
AbstractBuilder(int initialCapacity) { this.list = new ArrayList<>(initialCapacity); }
Source:
public static ObjectId read(InputStream in) throws IOException { switch (in.read()) { case 0: return null; case 1: final byte[] b = new byte[20]; IO.readFully(in, b, 0, 20); return ObjectId.fromRaw(b); default: throw new IOException("Invalid flag before ObjectId"); } }

Target:
public static ObjectId read(InputStream in) throws IOException { switch (in.read()) { case 0: return null; case 1: final byte[] b = new byte[OBJECT_ID_LENGTH]; IO.readFully(in, b, 0, OBJECT_ID_LENGTH); return ObjectId.fromRaw(b); default: throw new IOException("Invalid flag before ObjectId"); } }
Source:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { return false; } return true; }

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { return false; } Quota quota = getQuotaDAO().getById(getParameters().getQuotaId()); if (getStoragePool().getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED && quota.getIsDefaultQuota()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_CAN_NOT_HAVE_DEFAULT_INDICATION); } List<Quota> quotaList = getQuotaDAO().getQuotaByStoragePoolGuid(getParameters().getStoragePoolId()); if (quotaList.size() <= 1) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_MUST_HAVE_AT_LEAST_ONE_QUOTA); } return true; }
Source:
private void handleSecurityException(Exception e) { sslInfrastructureService.invalidateAgentCertificate(); LOG.error("There has been a problem with one of Go's SSL certificates." + " This can be caused by a man-in-the-middle attack, or by pointing the agent to a new e, or by" + " deleting and re-installing Go Server. Go will ask for a new certificate. If this" + " fails to solve the problem, try deleting config/trust.jks in Go Agent's home directory.", e); }

Target:
private void handleSecurityException(Exception e) { sslInfrastructureService.invalidateAgentCertificate(); LOG.error("There has been a problem with one of Go's SSL certificates." + " This can be caused by a man-in-the-middle attack, or by pointing the agent to a new server, or by" + " deleting and re-installing Go Server. Go will ask for a new certificate. If this" + " fails to solve the problem, try deleting config/trust.jks in Go Agent's home directory.", e); }