auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void connect(MessageContext messageContext) throws ConnectException { String fileLocation = getParameter(messageContext, "filelocation") == null ? "" : getParameter( messageContext, "filelocation").toString(); String filename = getParameter(messageContext, "file") == null ? "" : getParameter( messageContext, "file").toString(); String content = getParameter(messageContext, "content") == null ? "" : getParameter( messageContext, "content").toString(); String newFileName = getParameter(messageContext, "newfilename") == null ? "" : getParameter( messageContext, "newfilename").toString(); String filebeforepprocess = getParameter(messageContext, "filebeforepprocess") == null ? "" : getParameter( messageContext, "filebeforepprocess").toString(); boolean isFileExist = false; try { isFileExist = isFileExist(fileLocation, filename, content); } catch (FileSystemException e) { <START> handleException(e.getMessage(),e, messageContext); <END> } generateResults(messageContext, isFileExist); }</code><technical_language>changing style here. In earlier cases printing error message</technical_language>

Target:
public void connect(MessageContext messageContext) throws ConnectException { String fileLocation = getParameter(messageContext, "filelocation") == null ? "" : getParameter( messageContext, "filelocation").toString(); String filename = getParameter(messageContext, "file") == null ? "" : getParameter( messageContext, "file").toString(); String content = getParameter(messageContext, "content") == null ? "" : getParameter( messageContext, "content").toString(); String newFileName = getParameter(messageContext, "newfilename") == null ? "" : getParameter( messageContext, "newfilename").toString(); String filebeforepprocess = getParameter(messageContext, "filebeforepprocess") == null ? "" : getParameter( messageContext, "filebeforepprocess").toString(); boolean isFileExist = false; try { isFileExist = isFileExist(fileLocation, filename, content); } catch (FileSystemException e) { handleException("Error while checking a file: " + e.getMessage(), e, messageContext); } generateResults(messageContext, isFileExist); }
Source:
<code>public void subscribe(Topic topic, StreamObserver<Subscription> responseObserver) { log().debug("Creating the subscription to a topic: {}", topic); try { final Target target = topic.getTarget(); final BoundedContext boundedContext = selectBoundedContext(target); final Stand stand = boundedContext.getStand(); final Subscription subscription = stand.subscribe(target); responseObserver.onNext(subscription); responseObserver.onCompleted(); } catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) { log().error("Error processing subscription request", e); responseObserver.onError(e); responseObserver.onCompleted(); } <START> <END> }</code><technical_language>Please remove redundant empty line</technical_language>

Target:
public void subscribe(Topic topic, StreamObserver<Subscription> responseObserver) { log().debug("Creating the subscription to a topic: {}", topic); try { final Target target = topic.getTarget(); final BoundedContext boundedContext = selectBoundedContext(target); final Stand stand = boundedContext.getStand(); final Subscription subscription = stand.subscribe(target); responseObserver.onNext(subscription); responseObserver.onCompleted(); } catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) { log().error("Error processing subscription request", e); responseObserver.onError(e); } }
Source:
<code>public void updateImagePath(List<Process> processes) { for (Process process : processes) { try { FileformatInterface rdf = serviceManager.getProcessService().readMetadataFile(process); MetadataTypeInterface mdt = UghHelper.getMetadataType(process, "pathimagefiles"); List<? extends MetadataInterface> allImagePaths = rdf.getDigitalDocument().getPhysicalDocStruct() .getAllMetadataByType(mdt); if (allImagePaths.size() > 0) { for (MetadataInterface md : allImagePaths) { rdf.getDigitalDocument().getPhysicalDocStruct().getAllMetadata().remove(md); } } MetadataInterface newMetadata = UghImplementation.INSTANCE.createMetadata(mdt); if (SystemUtils.IS_OS_WINDOWS) { newMetadata.setStringValue("file:/" + serviceManager.getFileService().getImagesDirectory(process) + process.getTitle() + DIRECTORY_SUFFIX); } else { newMetadata.setStringValue("file://" + serviceManager.getFileService().getImagesDirectory(process) + process.getTitle() + DIRECTORY_SUFFIX); } rdf.getDigitalDocument().getPhysicalDocStruct().addMetadata(newMetadata); serviceManager.getFileService().writeMetadataFile(rdf, process); Helper.setMeldung(KITODO_SCRIPT_FIELD, "ImagePath updated: ", process.getTitle()); } catch (DocStructHasNoTypeException | UghHelperException | MetadataTypeNotAllowedException e) { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung(e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while updating imagepath", e); } } Helper.setMeldung(KITODO_SCRIPT_FIELD, "", "updateImagePath finished"); }</code><technical_language>setErrorMessage</technical_language>

Target:
public void updateImagePath(List<Process> processes) { for (Process process : processes) { try { FileformatInterface rdf = serviceManager.getProcessService().readMetadataFile(process); MetadataTypeInterface mdt = UghHelper.getMetadataType(process, "pathimagefiles"); List<? extends MetadataInterface> allImagePaths = rdf.getDigitalDocument().getPhysicalDocStruct() .getAllMetadataByType(mdt); if (allImagePaths.size() > 0) { for (MetadataInterface md : allImagePaths) { rdf.getDigitalDocument().getPhysicalDocStruct().getAllMetadata().remove(md); } } MetadataInterface newMetadata = UghImplementation.INSTANCE.createMetadata(mdt); if (SystemUtils.IS_OS_WINDOWS) { newMetadata.setStringValue("file:/" + serviceManager.getFileService().getImagesDirectory(process) + process.getTitle() + DIRECTORY_SUFFIX); } else { newMetadata.setStringValue("file://" + serviceManager.getFileService().getImagesDirectory(process) + process.getTitle() + DIRECTORY_SUFFIX); } rdf.getDigitalDocument().getPhysicalDocStruct().addMetadata(newMetadata); serviceManager.getFileService().writeMetadataFile(rdf, process); Helper.setMeldung(KITODO_SCRIPT_FIELD, "ImagePath updated: ", process.getTitle()); } catch (UghHelperException | MetadataTypeNotAllowedException | PreferencesException | IOException | ReadException | WriteException | RuntimeException e) { Helper.setErrorMessage(KITODO_SCRIPT_FIELD, "Error while updating imagepath", logger, e); } } Helper.setMeldung(KITODO_SCRIPT_FIELD, "", "updateImagePath finished"); }
Source:
<code>private String getTemplatizedCreatedDate() { if (dateCreated != null) { if (UploadableFile.DateTimeWithSource.EXIF_SOURCE.equals(dateCreatedSource)) { <START> java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd"); <END> return String.format(Locale.ENGLISH, TEMPLATE_DATE_ACC_TO_EXIF, dateformat.format(dateCreated)) + "\n"; } else { java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd"); return String.format(Locale.ENGLISH, TEMPLATE_DATA_OTHER_SOURCE, dateformat.format(dateCreated)) + "\n"; } } return ""; }</code><technical_language>Please rename variable dateFormat, thanks</technical_language>

Target:
private String getTemplatizedCreatedDate() { if (dateCreated != null) { java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd"); if (UploadableFile.DateTimeWithSource.EXIF_SOURCE.equals(dateCreatedSource)) { return String.format(Locale.ENGLISH, TEMPLATE_DATE_ACC_TO_EXIF, dateFormat.format(dateCreated)) + "\n"; } else { return String.format(Locale.ENGLISH, TEMPLATE_DATA_OTHER_SOURCE, dateFormat.format(dateCreated)) + "\n"; } } return ""; }
Source:
<code>public Expression superInvoke(String methodName) { <START> SuperMethodInvocation superMethodInvocation = getAST().newSuperMethodInvocation(); <END> superMethodInvocation.setName(simpleName(methodName)); return superMethodInvocation; }</code><technical_language>superMethodInvocation => smi shorter method, shorter variable name</technical_language>

Target:
public Expression superInvoke(String methodName) { SuperMethodInvocation smi = getAST().newSuperMethodInvocation(); smi.setName(simpleName(methodName)); return smi; }
Source:
<code>private static AttachToTarget fromJson(JsonInput input) { <START> SessionId sessionId = new SessionId(input.nextString()); <END> TargetInfo targetInfo = null; Boolean waitForDebugger = null; while (input.hasNext()) { switch (input.nextName()) { case "targetInfo": targetInfo = input.read(TargetInfo.class); break; case "waitingForDebugger": waitForDebugger = input.nextBoolean(); break; default: input.skipValue(); break; } } return new AttachToTarget(sessionId, targetInfo, waitForDebugger); }</code><technical_language>this loop? I a call input.beginObject, a surprised this works...</technical_language>

Target:
private static AttachToTarget fromJson(JsonInput input) { SessionId sessionId = input.read(SessionId.class); TargetInfo targetInfo = null; Boolean waitForDebugger = null; while (input.hasNext()) { switch (input.nextName()) { case "targetInfo": targetInfo = input.read(TargetInfo.class); break; case "waitingForDebugger": waitForDebugger = input.nextBoolean(); break; default: input.skipValue(); break; } } return new AttachToTarget(sessionId, targetInfo, waitForDebugger); }
Source:
<code><START> public MsSpectrumType getSpectrumType() { <END> MsSpectrumType spectrumType = SpectrumTypeDetectionAlgorithm.detectSpectrumType(mzValues, intensityValues, getMzBinaryDataInfo().getArrayLength()); return spectrumType; }</code><technical_language>Actually, mzML specification CV terms for profile centroid spectra. read SpectrumType CV term, autodetection if in mzML file</technical_language>

Target:
public MsSpectrumType getSpectrumType() { if (getCVValue(MzMLCV.cvCentroidSpectrum) != null) return MsSpectrumType.CENTROIDED; if (getCVValue(MzMLCV.cvProfileSpectrum) != null) return MsSpectrumType.PROFILE; return null; }
Source:
<code>public String getUuidProperty() { <START> return RestTestConstants2_2.ORDER_UUID; <END> }</code><technical_language>This resource uuid of parent, in this case FulfillerDetails uuid property this possibly return null</technical_language>

Target:
public String getUuidProperty() { return null; }
Source:
<code>public LocalIOComponentFamilyDefinition() { super(NAME, new FixedDatastoreDefinition(), new FixedDatasetDefinition(), new FixedInputDefinition(), new DevNullOutputDefinition(), <START> new RowGeneratorDefinition(), new FixedFlowInputDefinition()); <END> }</code><technical_language>FixedFlowInputDefinition RowGeneratorDefintion removed. add DevNullDefinition too</technical_language>

Target:
public LocalIOComponentFamilyDefinition() { super(NAME, new FixedDatastoreDefinition(), new FixedDatasetDefinition(), new FixedInputDefinition(), new DevNullOutputDefinition(), new FixedFlowInputDefinition()); }
Source:
<code><START> private static String getWebsiteLinkWithFallback(Playable media) { <END> String link = null; if (media != null) { link = media.getWebsiteLink(); if (link == null) { if (media instanceof FeedMedia) { link = FeedItemUtil.getLinkWithFallback(((FeedMedia)media).getItem()); } } } return link; }</code><technical_language>In opinion, this function belongs FeedItemUtil</technical_language>

Target:
private static String getWebsiteLinkWithFallback(Playable media) { if (media == null) { return null; } else if (media.getWebsiteLink() != null) { return media.getWebsiteLink(); } else if (media instanceof FeedMedia) { return FeedItemUtil.getLinkWithFallback(((FeedMedia)media).getItem()); } return null; }
Source:
<code>public String createFunction( final String name, final String definition, final String outputType, final Boolean isMultiValued, final FunctionLanguage lang, final String binary, final Set<Integer> workers) throws DbException, InterruptedException { String response = ""; Set<Integer> actualWorkers = workers; if (workers == null) { actualWorkers = getWorkers().keySet(); } try { Map<Integer, SubQueryPlan> workerPlans = new HashMap<>(); for (Integer workerId : actualWorkers) { workerPlans.put( workerId, new SubQueryPlan( new DbCreateFunction( EmptyRelation.of(Schema.EMPTY_SCHEMA), name, definition, outputType, isMultiValued, lang, binary))); } ListenableFuture<Query> qf = queryManager.submitQuery( "create function", "create function", "create function", new SubQueryPlan(new EmptySink(new EOSSource())), workerPlans); try { qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } <START> if (response == "") { <END> try { catalog.registerFunction(name, definition, outputType, isMultiValued, lang); } catch (CatalogException e) { throw new DbException(e); } } else { response = "Function is not valid"; } return response; }</code><technical_language>changing of response. this check is necessary</technical_language>

Target:
public String createFunction( final String name, final String definition, final String outputType, final Boolean isMultiValued, final FunctionLanguage lang, final String binary, final Set<Integer> workers) throws DbException, InterruptedException { String response = ""; Set<Integer> actualWorkers = workers; if (workers == null) { actualWorkers = getWorkers().keySet(); } try { Map<Integer, SubQueryPlan> workerPlans = new HashMap<>(); for (Integer workerId : actualWorkers) { workerPlans.put( workerId, new SubQueryPlan( new DbCreateFunction( EmptyRelation.of(Schema.EMPTY_SCHEMA), name, definition, outputType, isMultiValued, lang, binary))); } ListenableFuture<Query> qf = queryManager.submitQuery( "create function", "create function", "create function", new SubQueryPlan(new EmptySink(new EOSSource())), workerPlans); try { qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } try { catalog.registerFunction(name, definition, outputType, isMultiValued, lang); } catch (CatalogException e) { throw new DbException(e); } return response; }
Source:
<code>public void lockSecret() throws Exception { Optional<String> absent = factory.begin(() -> secretControlStore.lockProjectSecret(projectId, SecretScopes.PROJECT, KEY1, (control, value) -> value)); assertThat(absent, is(Optional.absent())); factory.begin(() -> secretControlStore.setProjectSecret(projectId, SecretScopes.PROJECT, KEY1, VALUE1)); <START> Optional<String> present = factory.begin(() -> secretControlStore.lockProjectSecret(projectId, SecretScopes.PROJECT, KEY1, (control, value) -> value)); <END> assertThat(present, is(Optional.of(VALUE1))); }</code><technical_language>a test confirms if another thread is blocked method</technical_language>

Target:
public void lockSecret() throws Exception { factory.begin(() -> secretControlStore.setProjectSecret(projectId, SecretScopes.PROJECT, KEY1, VALUE1)); AtomicReference<Optional<String>> blockedGetValue = new AtomicReference<>(null); AtomicBoolean comitting = new AtomicBoolean(false); AtomicBoolean blockedCheckComitting = new AtomicBoolean(false); Thread thread = factory.begin(() -> secretControlStore.lockProjectSecret(projectId, SecretScopes.PROJECT, KEY1, (control, value) -> { try { AtomicBoolean started = new AtomicBoolean(false); Thread t = new Thread(() -> { started.set(true); try { blockedGetValue.set( factory.begin(() -> secretControlStore.lockProjectSecret(projectId, SecretScopes.PROJECT, KEY1, (c1, v1) -> v1))); } catch (Exception ex) { throw new RuntimeException(ex); } blockedCheckComitting.set(comitting.get()); }); t.setDaemon(true); t.start(); while (!started.get()) { Thread.sleep(500); } Thread.sleep(500); control.setProjectSecret(projectId, SecretScopes.PROJECT, KEY1, VALUE1 + ".changed"); comitting.set(true); return t; } catch (InterruptedException ex) { throw new AssertionError(ex); } })); thread.join(); assertThat(blockedGetValue.get(), is(Optional.of(VALUE1 + ".changed"))); assertThat(blockedCheckComitting.get(), is(true)); }
Source:
<code>protected Iterable<TreePath> getChildren(TreePath path, long id, TreeIterator i) { if (!path.getFileStatus().isDirectory()) { return Collections.emptyList(); } try { ArrayList<TreePath> ret = new ArrayList<>(); for (FileStatus s : fs.listStatus(path.getFileStatus().getPath())) { <START> ret.add(new TreePath(s, id, i, fs, getAclStatus(fs, s.getPath()))); <END> } return ret; } catch (FileNotFoundException e) { throw new ConcurrentModificationException("FS modified"); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>Extract for readability</technical_language>

Target:
protected Iterable<TreePath> getChildren(TreePath path, long id, TreeIterator i) { if (!path.getFileStatus().isDirectory()) { return Collections.emptyList(); } try { ArrayList<TreePath> ret = new ArrayList<>(); for (FileStatus s : fs.listStatus(path.getFileStatus().getPath())) { AclStatus aclStatus = getAclStatus(fs, s.getPath()); ret.add(new TreePath(s, id, i, fs, aclStatus)); } return ret; } catch (FileNotFoundException e) { throw new ConcurrentModificationException("FS modified"); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public void bindInputs(BindingService bindingService) { if (log.isDebugEnabled()) { log.debug(String.format("Binding inputs for %s:%s", this.channelNamespace, this.type)); } <START> for (Map.Entry<String, BoundElementHolder> channelHolderEntry : this.inputHolders.entrySet()) { <END> String inputChannelName = channelHolderEntry.getKey(); BoundElementHolder boundElementHolder = channelHolderEntry.getValue(); if (boundElementHolder.isBindable()) { if (log.isDebugEnabled()) { log.debug(String.format("Binding %s:%s:%s", this.channelNamespace, this.type, inputChannelName)); } bindingService.bindConsumer(boundElementHolder.getBoundElement(), inputChannelName); } } }</code><technical_language>change channelHolderEntry var name</technical_language>

Target:
public void bindInputs(BindingService bindingService) { if (log.isDebugEnabled()) { log.debug(String.format("Binding inputs for %s:%s", this.channelNamespace, this.type)); } for (Map.Entry<String, BoundTargetHolder> boundTargetHolderEntry : this.inputHolders.entrySet()) { String inputTargetName = boundTargetHolderEntry.getKey(); BoundTargetHolder boundTargetHolder = boundTargetHolderEntry.getValue(); if (boundTargetHolder.isBindable()) { if (log.isDebugEnabled()) { log.debug(String.format("Binding %s:%s:%s", this.channelNamespace, this.type, inputTargetName)); } bindingService.bindConsumer(boundTargetHolder.getBoundTarget(), inputTargetName); } } }
Source:
<code>public FragmentHelper(Fragment fragment) { <START> super(fragment.getContext(), <END> (FlowParameters) fragment.getArguments().getParcelable(ExtraConstants.EXTRA_FLOW_PARAMS)); mFragment = fragment; }</code><technical_language>change? This is a memory leak if SaveSmartLock fragment is rotated a setRetainInstance(true)</technical_language>

Target:
public FragmentHelper(Fragment fragment) { super(fragment.getContext().getApplicationContext(), (FlowParameters) fragment.getArguments().getParcelable(ExtraConstants.EXTRA_FLOW_PARAMS)); mFragment = fragment; }
Source:
<code>private String convertToFullyQualifiedClassName(final String factType) { if (factType.contains(".")) { return factType; } String fullyQualifiedClassName = null; for (Import imp : imports.getImports()) { if (imp.getType().endsWith(factType)) { fullyQualifiedClassName = imp.getType(); break; } <START> } <END> if (fullyQualifiedClassName == null) { fullyQualifiedClassName = packageName + "." + factType; } return fullyQualifiedClassName; }</code><technical_language>Oh, remove if getConsumedPackageImports I</technical_language>

Target:
private String convertToFullyQualifiedClassName(final String factType) { if (factType.contains(".")) { return factType; } final Optional<String> fullyQualifiedClassName = findFQCNFromImports(factType); if (fullyQualifiedClassName.isPresent()) { return fullyQualifiedClassName.get(); } else { return packageName + "." + factType; } }
Source:
<code>JSONObject toJson() throws JSONException { JSONObject metadata = new JSONObject(); switch (currentJsonVersion) { case JSON_VERSION_1: metadata.put(JSON_VERSION_KEY, JSON_VERSION_1); metadata.put(CONTAINER_ID_KEY, id); metadata.put(CONTAINER_NAME_KEY, name); metadata.put(STATUS_KEY, status.name()); metadata.put(DESCRIPTION_KEY, description); metadata.put(IS_PRIVATE_KEY, !cacheable); metadata.put(PARENT_ACCOUNT_ID_KEY, parentAccountId); break; case JSON_VERSION_2: metadata.put(Container.JSON_VERSION_KEY, JSON_VERSION_2); metadata.put(CONTAINER_ID_KEY, id); metadata.put(CONTAINER_NAME_KEY, name); metadata.put(Container.STATUS_KEY, status.name()); metadata.put(DESCRIPTION_KEY, description); metadata.put(ENCRYPTED_KEY, encrypted); metadata.put(PREVIOUSLY_ENCRYPTED_KEY, previouslyEncrypted); metadata.put(CACHEABLE_KEY, cacheable); metadata.put(MEDIA_SCAN_DISABLED_KEY, mediaScanDisabled); metadata.putOpt(REPLICATION_POLICY_KEY, replicationPolicy); metadata.put(TTL_REQUIRED_KEY, ttlRequired); <START> JSONArray contentTypeWhitelistForFilenamesOnDownloadJson = new JSONArray(); <END> contentTypeWhitelistForFilenamesOnDownload.forEach(contentTypeWhitelistForFilenamesOnDownloadJson::put); metadata.put(CONTENT_TYPE_WHITELIST_FOR_FILENAMES_ON_DOWNLOAD, contentTypeWhitelistForFilenamesOnDownloadJson); break; default: throw new IllegalStateException("Unsupported container json version=" + currentJsonVersion); } return metadata; }</code><technical_language>do feel putOpt json size increase for containers this set</technical_language>

Target:
JSONObject toJson() throws JSONException { JSONObject metadata = new JSONObject(); switch (currentJsonVersion) { case JSON_VERSION_1: metadata.put(JSON_VERSION_KEY, JSON_VERSION_1); metadata.put(CONTAINER_ID_KEY, id); metadata.put(CONTAINER_NAME_KEY, name); metadata.put(STATUS_KEY, status.name()); metadata.put(DESCRIPTION_KEY, description); metadata.put(IS_PRIVATE_KEY, !cacheable); metadata.put(PARENT_ACCOUNT_ID_KEY, parentAccountId); break; case JSON_VERSION_2: metadata.put(Container.JSON_VERSION_KEY, JSON_VERSION_2); metadata.put(CONTAINER_ID_KEY, id); metadata.put(CONTAINER_NAME_KEY, name); metadata.put(Container.STATUS_KEY, status.name()); metadata.put(DESCRIPTION_KEY, description); metadata.put(ENCRYPTED_KEY, encrypted); metadata.put(PREVIOUSLY_ENCRYPTED_KEY, previouslyEncrypted); metadata.put(CACHEABLE_KEY, cacheable); metadata.put(MEDIA_SCAN_DISABLED_KEY, mediaScanDisabled); metadata.putOpt(REPLICATION_POLICY_KEY, replicationPolicy); metadata.put(TTL_REQUIRED_KEY, ttlRequired); if (contentTypeWhitelistForFilenamesOnDownload != null && !contentTypeWhitelistForFilenamesOnDownload.isEmpty()) { JSONArray contentTypeWhitelistForFilenamesOnDownloadJson = new JSONArray(); contentTypeWhitelistForFilenamesOnDownload.forEach(contentTypeWhitelistForFilenamesOnDownloadJson::put); metadata.put(CONTENT_TYPE_WHITELIST_FOR_FILENAMES_ON_DOWNLOAD, contentTypeWhitelistForFilenamesOnDownloadJson); } break; default: throw new IllegalStateException("Unsupported container json version=" + currentJsonVersion); } return metadata; }
Source:
<code>public Seq<V> values() { <START> return Stream.ofAll(iterator()).map(Tuple2::_2); <END> }</code><technical_language>Dito: stay original impl</technical_language>

Target:
public Seq<V> values() { return iterator().map(Tuple2::_2).toStream(); }
Source:
<code><START> public final void addContextData( String key, <END> String value ) { this.context = context.with(key, value); this.cache.addContextData(key, value); }</code><technical_language>Woa, I this public</technical_language>

Target:
final void addContextData( String key, String value ) { this.context = context.with(key, value); this.cache.addContextData(key, value); }
Source:
<code>protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { Guid domainId = asGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (user.isSetUserName() && user.getUserName().contains("@")) { <START> return user.getUserName().substring(user.getUserName().lastIndexOf("@") + 1); <END> } return null; }</code><technical_language>isNameContainsDomain? single function split authz/user over</technical_language>

Target:
protected String getDomain(User user) { if (user.isSetDomain() && user.getDomain().isSetName()) { return user.getDomain().getName(); } else if (user.isSetDomain() && user.getDomain().isSetId()) { List<String> domains = getBackendCollection( String.class, VdcQueryType.GetDomainList, new VdcQueryParametersBase()); for (String domain :domains) { Guid domainId = asGuid(domain.getBytes(), true); if (domainId.toString().equals(user.getDomain().getId())) { return domain; } } throw new WebFaultException(null, "Domain: '" + user.getDomain().getId().toString() + "' does not exist.", Response.Status.BAD_REQUEST); } else if (isNameContainsDomain(user)) { return user.getUserName().substring(user.getUserName().lastIndexOf("@") + 1); } return null; }
Source:
<code>protected void showFileChooser() { final DCFileChooser fileChooser = new DCFileChooser(_userPreferences.getOpenDatastoreDirectory()); fileChooser.addChoosableFileFilter(FileFilters.ALL); fileChooser.setFileFilter(FileFilters.allDataFiles()); final int result = fileChooser.showOpenDialog(Dropzone.this); if (result == JFileChooser.APPROVE_OPTION) { final File file = fileChooser.getSelectedFile(); if (file.exists()) { final Datastore datastore; final String filename = file.getName(); <START> if (_datastoreCatalog.containsDatastore(filename)) { <END> datastore = _datastoreCatalog.getDatastore(filename); } else { datastore = DatastoreCreationUtil.createAndAddUniqueDatastoreFromFile(_datastoreCatalog, file); } _datastoreSelectListener.datastoreSelected(datastore); final File directory; if (file.isFile()) { directory = file.getParentFile(); } else if (file.isDirectory()) { directory = file; } else { directory = _userPreferences.getOpenDatastoreDirectory(); } _userPreferences.setOpenDatastoreDirectory(directory); } } }</code><technical_language>This checks if name of datastore is filename. if I this file in datastores already, I gave a custom name instead of a default filename-based name? check for path is file</technical_language>

Target:
protected void showFileChooser() { final DCFileChooser fileChooser = new DCFileChooser(_userPreferences.getOpenDatastoreDirectory()); fileChooser.addChoosableFileFilter(FileFilters.ALL); fileChooser.setFileFilter(FileFilters.allDataFiles()); final int result = fileChooser.showOpenDialog(Dropzone.this); if (result == JFileChooser.APPROVE_OPTION) { final File file = fileChooser.getSelectedFile(); if (file.exists()) { Datastore datastore = null; final String filename = file.getName(); final String filePath = file.getAbsolutePath(); final String[] datastoreNames = _datastoreCatalog.getDatastoreNames(); for (int i = 0; i < datastoreNames.length; i++) { final Datastore existingDatastore = _datastoreCatalog.getDatastore(datastoreNames[i]); if (existingDatastore instanceof FileDatastore) { FileDatastore fileDatastore = (FileDatastore) existingDatastore; final String datastoreFilename = fileDatastore.getFilename(); if (filename.equals(datastoreFilename) || filePath.equals(datastoreFilename)) { datastore = _datastoreCatalog.getDatastore(filename); } } } if (datastore == null) { datastore = DatastoreCreationUtil.createAndAddUniqueDatastoreFromFile(_datastoreCatalog, file); } _datastoreSelectListener.datastoreSelected(datastore); final File directory; if (file.isFile()) { directory = file.getParentFile(); } else if (file.isDirectory()) { directory = file; } else { directory = _userPreferences.getOpenDatastoreDirectory(); } _userPreferences.setOpenDatastoreDirectory(directory); } } }
Source:
<code>private SourceSystemId parseSource(String lahdeJarjestelmaId) { <START> if (StringUtils.isNotBlank(lahdeJarjestelmaId) && lahdeJarjestelmaId.contains(":")) { <END> KoskiStudyProgrammeHandler handler = KoskiStudyProgrammeHandler.valueOf(StringUtils.substringBefore(lahdeJarjestelmaId, ":")); Long studentId = Long.valueOf(StringUtils.substringAfter(lahdeJarjestelmaId, ":")); return new SourceSystemId(handler, studentId); } return null; }</code><technical_language>biggie StringUtils.contains(lahdeJarjestelmaId, ":") work same</technical_language>

Target:
private SourceSystemId parseSource(String lahdeJarjestelmaId) { if (StringUtils.contains(lahdeJarjestelmaId, ":")) { KoskiStudyProgrammeHandler handler = KoskiStudyProgrammeHandler.valueOf(StringUtils.substringBefore(lahdeJarjestelmaId, ":")); Long studentId = Long.valueOf(StringUtils.substringAfter(lahdeJarjestelmaId, ":")); return new SourceSystemId(handler, studentId); } return null; }
Source:
<code>public static String getWikiOwnerFromWikiId(String wikiId) { <START> if(PortalConfig.USER_TYPE.equals(getWikiTypeFromWikiId(wikiId)) || PortalConfig.PORTAL_TYPE.equals(getWikiTypeFromWikiId(wikiId))) { <END> wikiId = wikiId.substring(wikiId.lastIndexOf('/') + 1); } return wikiId; }</code><technical_language>If conditions checked, getWikiTypeFromWikiId is called twice. assign getWikiTypeFromWikiId result a variable, test : String wikiType = getWikiTypeFromWikiId(wikiId); if(PortalConfig.USER_TYPE.equals(wikiType) || PortalConfig.PORTAL_TYPE.equals(wikiType)) { ..</technical_language>

Target:
public static String getWikiOwnerFromWikiId(String wikiId) { String wikiType = getWikiTypeFromWikiId(wikiId); if(PortalConfig.USER_TYPE.equals(wikiType) || PortalConfig.PORTAL_TYPE.equals(wikiType)) { wikiId = wikiId.substring(wikiId.lastIndexOf('/') + 1); } return wikiId; }
Source:
<code>private static String propget(final File file, final String name) { final ProcessBuilder builder = new ProcessBuilder( "svn", "propget", name, file.getAbsolutePath() ); builder.redirectErrorStream(true); try { final Process process = builder.start(); process.waitFor(); <START> return IOUtils.toString( <END> process.getInputStream(), Charset.defaultCharset() ).trim(); } catch (final java.io.IOException ex) { throw new IllegalArgumentException(ex); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }</code><technical_language>@korthout TrimmedText cactoos</technical_language>

Target:
private static String propget(final File file, final String name) { final ProcessBuilder builder = new ProcessBuilder( "svn", "propget", name, file.getAbsolutePath() ); builder.redirectErrorStream(true); try { final Process process = builder.start(); process.waitFor(); return new UncheckedText( new TrimmedText( new TextOf( process.getInputStream() ) ) ).asString(); } catch (final java.io.IOException ex) { throw new IllegalArgumentException(ex); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }
Source:
<code>public byte[] encrypt(byte[] plainTextBytes, String cipherTransformation, boolean returnSelfContainedCipherText) throws CryptoException { if (plainTextBytes == null) { throw new CryptoException("Plaintext can't be null."); } byte[] encryptedKey; try { CryptoService cryptoService = CarbonCoreDataHolder.getInstance().getCryptoService(); if(cryptoService == null){ throw new CryptoException("A crypto service implementation has not been registered."); } boolean isSymmetricKeyEncryptionEnabled = isSymmetricKeyEncryptionEnabled(); String algorithm = getDefaultEncryptionAlgorithm(isSymmetricKeyEncryptionEnabled); if (!StringUtils.isBlank(cipherTransformation)) { algorithm = cipherTransformation; if (log.isDebugEnabled()) { log.debug(String.format("Cipher transformation is enabled. Crypto algorithm: '%s'", algorithm)); } } if (StringUtils.isNotBlank(cipherTransformation) && plainTextBytes.length == 0) { if (log.isDebugEnabled()) { log.debug("Plaintext is empty. An empty array will be used as the ciphertext bytes."); } encryptedKey = StringUtils.EMPTY.getBytes(); } else { encryptedKey = cryptoService.encrypt(plainTextBytes, algorithm, CRYPTO_API_PROVIDER_BC); } if (StringUtils.isNotBlank(cipherTransformation) && returnSelfContainedCipherText && !isSymmetricKeyEncryptionEnabled) { Certificate certificate = cryptoService.getCertificate(CryptoContext .buildEmptyContext(MultitenantConstants.SUPER_TENANT_ID, <START> MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)); <END> encryptedKey = createSelfContainedCiphertext(encryptedKey, algorithm, certificate); } } catch (Exception e) { throw new CryptoException("An error occurred while encrypting data.", e); } return encryptedKey; }</code><technical_language>code refactored</technical_language>

Target:
public byte[] encrypt(byte[] plainTextBytes, String cipherTransformation, boolean returnSelfContainedCipherText) throws CryptoException { if (plainTextBytes == null) { throw new CryptoException("Plaintext can't be null."); } byte[] encryptedKey; try { CryptoService cryptoService = CarbonCoreDataHolder.getInstance().getCryptoService(); if(cryptoService == null){ throw new CryptoException("A crypto service implementation has not been registered."); } String algorithm = null; if (!StringUtils.isBlank(cipherTransformation)) { algorithm = cipherTransformation; if (log.isDebugEnabled()) { log.debug(String.format("Cipher transformation is enabled. Crypto algorithm: '%s'", algorithm)); } } if (StringUtils.isNotBlank(cipherTransformation) && plainTextBytes.length == 0) { if (log.isDebugEnabled()) { log.debug("Plaintext is empty. An empty array will be used as the ciphertext bytes."); } encryptedKey = StringUtils.EMPTY.getBytes(); } else { encryptedKey = cryptoService .encrypt(plainTextBytes, algorithm, CRYPTO_API_PROVIDER_BC, returnSelfContainedCipherText); } } catch (Exception e) { throw new CryptoException("An error occurred while encrypting data.", e); } return encryptedKey; }
Source:
<code>private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig); }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } final long timeoutMillis = TimeUnit.SECONDS.toMillis(5); final long borderTime = System.currentTimeMillis() + timeoutMillis; boolean creationConfirmed = false; while (!creationConfirmed && borderTime >= System.currentTimeMillis()) { try (Consumer<byte[], byte[]> consumer = kafkaFactory.getConsumer()) { final List<PartitionInfo> partitions = consumer.partitionsFor(topic); creationConfirmed = null != partitions; } <START> } <END> if (!creationConfirmed) { throw new TopicCreationException("Failed to confirm topic creation within " + timeoutMillis + " millis"); } }</code><technical_language>I try reinvent executeWithRetry in other places</technical_language>

Target:
private void createTopic(final String topic, final int partitionsNum, final int replicaFactor, final long retentionMs, final long rotationMs) throws TopicCreationException { try { doWithZkUtils(zkUtils -> { final Properties topicConfig = new Properties(); topicConfig.setProperty("retention.ms", Long.toString(retentionMs)); topicConfig.setProperty("segment.ms", Long.toString(rotationMs)); AdminUtils.createTopic(zkUtils, topic, partitionsNum, replicaFactor, topicConfig); }); } catch (final TopicExistsException e) { throw new TopicCreationException("Topic with name " + topic + " already exists (or wasn't completely removed yet)", e); } catch (final Exception e) { throw new TopicCreationException("Unable to create topic " + topic, e); } final long timeoutMillis = TimeUnit.SECONDS.toMillis(5); final Boolean allowsConsumption = Retryer.executeWithRetry(() -> { try (Consumer<byte[], byte[]> consumer = kafkaFactory.getConsumer()) { return null != consumer.partitionsFor(topic); } }, new RetryForSpecifiedTimeStrategy<Boolean>(timeoutMillis) .withWaitBetweenEachTry(100L) .withResultsThatForceRetry(Boolean.FALSE)); if (!Boolean.TRUE.equals(allowsConsumption)) { throw new TopicCreationException("Failed to confirm topic creation within " + timeoutMillis + " millis"); } }
Source:
<code><START> private void ensureCallbackOrder(ChannelWriter channelWriter, int expectedCallbackId) { <END> for (int i = expectedCallbackId; i < channelWriter.writes.size(); i++) { WriteCallback writeCallback = channelWriter.writes.get(i).writeCallback; if (expectedCallbackId == i) { assertTrue("Callback for the expected oldest chunk not invoked", writeCallback.callbackInvoked.get()); } else { assertFalse("Callback for a chunk younger than the expected is invoked", writeCallback.callbackInvoked.get()); } } }</code><technical_language>this more readable if simply expected case of loop, loop run expectedCallbackId + 1 end</technical_language>

Target:
private void ensureCallbackOrder(ChannelWriter channelWriter, int expectedCallbackId) { WriteCallback writeCallback = channelWriter.writes.get(expectedCallbackId).writeCallback; assertTrue("Callback for the expected oldest chunk not invoked", writeCallback.callbackInvoked.get()); for (int i = expectedCallbackId + 1; i < channelWriter.writes.size(); i++) { writeCallback = channelWriter.writes.get(i).writeCallback; assertFalse("Callback for a chunk younger than the expected is invoked", writeCallback.callbackInvoked.get()); } }
Source:
<code>public DeleteSubRecord getDeleteSubRecord() { <START> if (subRecord.getType().equals(SubRecord.Type.DELETE)) return (DeleteSubRecord) subRecord; return null; <END> }</code><technical_language>nit: put if statement</technical_language>

Target:
public DeleteSubRecord getDeleteSubRecord() { if (subRecord.getType().equals(SubRecord.Type.DELETE)) { return (DeleteSubRecord) subRecord; } return null; }
Source:
<code><START> private void closeGroups(hdf5.Group[] groupArray) { <END> for (int i = 0; i < groupArray.length; i++) { groupArray[i].deallocate(); } }</code><technical_language>thoughts hdf5.Group thisGroup = groupArray[i]; thisGroup._close();</technical_language>

Target:
private void closeGroups(hdf5.Group[] groupArray) { for (int i = groupArray.length - 1; i >= 0; i--) { groupArray[i].deallocate(); } }
Source:
<code>public UserAPI(@NonNull Config config, @NonNull OkHttpClient client) { Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) <START> .setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create(); <END> RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(config.getApiHostURL()) .setConverter(new GsonConverter(gson)) .setErrorHandler(new RetroHttpExceptionHandler()) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); userService = restAdapter.create(UserService.class); }</code><technical_language>a globally shared Gson instance</technical_language>

Target:
public UserAPI(@NonNull Config config, @NonNull OkHttpClient client) { Gson gson = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setDateFormat(DateUtil.ISO_8601_DATE_TIME_FORMAT) .create(); RestAdapter restAdapter = new RestAdapter.Builder() .setClient(new OkClient(client)) .setEndpoint(config.getApiHostURL()) .setConverter(new GsonConverter(gson)) .setErrorHandler(new RetroHttpExceptionHandler()) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); userService = restAdapter.create(UserService.class); }
Source:
<code>@Override public void onStateFinishMessage(ChangeGlobalStateFinishMessage msg) { DiscoveryDataClusterState state = globalState; if (msg.requestId().equals(state.transitionRequestId())) { log.info("Received state change finish message: " + msg.clusterActive()); globalState = state.finish(msg.success()); afterStateChangeFinished(msg.id(), msg.success()); ctx.cache().onStateChangeFinish(msg); boolean prev = ctx.cache().context().readOnlyMode(); if (prev != globalState.readOnly()) { ctx.cache().context().readOnlyMode(globalState.readOnly()); <START> log.info("Read-only mode was changed! Was enabled: " + prev + ", now enabled: " + globalState.readOnly()); <END> } TransitionOnJoinWaitFuture joinFut = this.joinFut; if (joinFut != null) joinFut.onDone(false); GridFutureAdapter<Void> transitionFut = transitionFuts.remove(state.transitionRequestId()); if (transitionFut != null) { state.setTransitionResult(msg.requestId(), msg.clusterActive()); transitionFut.onDone(); } } else U.warn(log, "Received state finish message with unexpected ID: " + msg); }</code><technical_language>Please change message depending state value: Read-only mode is enabled Read-only mode is disabled</technical_language>

Target:
@Override public void onStateFinishMessage(ChangeGlobalStateFinishMessage msg) { DiscoveryDataClusterState state = globalState; if (msg.requestId().equals(state.transitionRequestId())) { log.info("Received state change finish message: " + msg.clusterActive()); globalState = state.finish(msg.success()); afterStateChangeFinished(msg.id(), msg.success()); ctx.cache().onStateChangeFinish(msg); boolean prev = ctx.cache().context().readOnlyMode(); if (prev != globalState.readOnly()) { ctx.cache().context().readOnlyMode(globalState.readOnly()); if (globalState.readOnly()) log.info("Read-only mode is enabled"); else log.info("Read-only mode is disabled"); } TransitionOnJoinWaitFuture joinFut = this.joinFut; if (joinFut != null) joinFut.onDone(false); GridFutureAdapter<Void> transitionFut = transitionFuts.remove(state.transitionRequestId()); if (transitionFut != null) { state.setTransitionResult(msg.requestId(), msg.clusterActive()); transitionFut.onDone(); } } else U.warn(log, "Received state finish message with unexpected ID: " + msg); }
Source:
<code>@Override public void stop(boolean cancel) { if (jobAlwaysActivate) <START> activeJobs.clear(); <END> else activeJobs = new JobsMap(1024, 0.75f, 256); activeJobsMetric.reset(); cancelledJobs.clear(); cancelReqs = new GridBoundedConcurrentLinkedHashMap<>(FINISHED_JOBS_COUNT, FINISHED_JOBS_COUNT < 128 ? FINISHED_JOBS_COUNT : 128, 0.75f, 16); if (log.isDebugEnabled()) log.debug("Job processor stopped."); }</code><technical_language>please put this logic in a method, do clear in cases? I.e. line 309 stop() logic create a fresh map</technical_language>

Target:
@Override public void stop(boolean cancel) { activeJobs = initJobsMap(jobAlwaysActivate); activeJobsMetric.reset(); cancelledJobs.clear(); cancelReqs = new GridBoundedConcurrentLinkedHashMap<>(FINISHED_JOBS_COUNT, FINISHED_JOBS_COUNT < 128 ? FINISHED_JOBS_COUNT : 128, 0.75f, 16); if (log.isDebugEnabled()) log.debug("Job processor stopped."); }
Source:
<code>public boolean isLive(BindableService service) { <START> return !isShutdown() && isScheduledForDeployment(service); <END> }</code><technical_language>Please extract variables</technical_language>

Target:
public boolean isLive(BindableService service) { final boolean inShutdownState = isShutdown(); final boolean scheduledForDeployment = isScheduledForDeployment(service); final boolean result = !inShutdownState && scheduledForDeployment; return result; }
Source:
<code>public void testSetNotesOnVirtualGuestWhenResponseIs2xx() { HttpRequest setNodesOnVirtualGuest = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==") .payload(payloadFromResourceWithContentType("/virtual_guest_set_notes.json", MediaType.APPLICATION_JSON)) .build(); HttpResponse setNotesOnVirtualGuestResponse = HttpResponse.builder().statusCode(200) <START> .payload(payloadFromResource("/virtual_guest_set_notes_response.json")).build(); <END> SoftLayerApi api = requestSendsResponse(setNodesOnVirtualGuest, setNotesOnVirtualGuestResponse); VirtualGuest virtualGuest = createVirtualGuest(); assertTrue(api.getVirtualGuestApi().setNotes(virtualGuest.getId(), "some notes")); }</code><technical_language>a file store a "true". pass String here</technical_language>

Target:
public void testSetNotesOnVirtualGuestWhenResponseIs2xx() { HttpRequest setNodesOnVirtualGuest = HttpRequest.builder().method("POST") .endpoint("<LINK_0>") .addHeader("Accept", "application/json") .addHeader("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==") .payload(payloadFromResourceWithContentType("/virtual_guest_set_notes.json", MediaType.APPLICATION_JSON)) .build(); HttpResponse setNotesOnVirtualGuestResponse = HttpResponse.builder().statusCode(200) .payload("true").build(); SoftLayerApi api = requestSendsResponse(setNodesOnVirtualGuest, setNotesOnVirtualGuestResponse); VirtualGuest virtualGuest = createVirtualGuest(); assertTrue(api.getVirtualGuestApi().setNotes(virtualGuest.getId(), "some notes")); }
Source:
<code>private List<String> getOcspUrlsFromCert(X509Certificate cert) { List<String> ocspUrls = new ArrayList<>(); try { byte[] authorityInfoAccess = cert.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityInfoAccess == null) { return ocspUrls; } AuthorityInformationAccess authorityInformationAccess = AuthorityInformationAccess.getInstance( X509ExtensionUtil.fromExtensionValue(authorityInfoAccess)); if (authorityInformationAccess == null) { return ocspUrls; } for (AccessDescription description : authorityInformationAccess.getAccessDescriptions()) { GeneralName accessLocation = description.getAccessLocation(); if (accessLocation.getTagNo() == GeneralName.uniformResourceIdentifier) ocspUrls.add(((DERIA5String) accessLocation.getName()).getString()); } } catch (IOException ignore) { <START> } <END> return ocspUrls; }</code><technical_language>Again, logging exception's information</technical_language>

Target:
private List<String> getOcspUrlsFromCert(X509Certificate cert) { List<String> ocspUrls = new ArrayList<>(); try { byte[] authorityInfoAccess = cert.getExtensionValue(Extension.authorityInfoAccess.getId()); if (authorityInfoAccess == null) { return ocspUrls; } AuthorityInformationAccess authorityInformationAccess = AuthorityInformationAccess.getInstance( X509ExtensionUtil.fromExtensionValue(authorityInfoAccess)); if (authorityInformationAccess == null) { return ocspUrls; } for (AccessDescription description : authorityInformationAccess.getAccessDescriptions()) { GeneralName accessLocation = description.getAccessLocation(); if (accessLocation.getTagNo() == GeneralName.uniformResourceIdentifier) ocspUrls.add(((DERIA5String) accessLocation.getName()).getString()); } } catch (IOException e) { LOGGER.debug( "Problem retrieving the OCSP server url(s) from the certificate." + CONTINUING_MSG, e); } return ocspUrls; }
Source:
<code>private void stopProxyServer(ProxyServer proxyServer) { <START> log.info("Stopping alt proxy server: " + proxyServer.getProxyParam().getProxyIp()); <END> Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class).unregisterProxy(proxyServer); proxyServer.stopServer(); }</code><technical_language>is worth include port</technical_language>

Target:
private void stopProxyServer(ProxyServer proxyServer) { log.info( "Stopping alt proxy server: " + proxyServer.getProxyParam().getProxyIp() + ":" + proxyServer.getProxyParam().getProxyPort()); Control.getSingleton().getExtensionLoader().getExtension(ExtensionHistory.class).unregisterProxy(proxyServer); proxyServer.stopServer(); }
Source:
<code>public void createArtifact(@Nullable ArtifactToken parent, ArtifactToken artifact) { <START> ArtifactToken art = createArtifact(artifact); <END> addChild(parent, art); }</code><technical_language>If parent null, need check setting parent. switch NonNullable</technical_language>

Target:
public void createArtifact(@Nullable ArtifactToken parent, ArtifactToken artifact) { ArtifactToken art = createArtifact(artifact); if (parent != null) { addChild(parent, art); } }