auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { if (args.length < 2 || !NumberUtil.isInt(args[1])) { throw new NotEnoughArgumentsException(); } Block target = user.getBase().getTargetBlock(null, 5); if (!(target.getState() instanceof Sign)) { throw new Exception(tl("editsignCommandTarget")); } Sign sign = (Sign) target.getState(); int line = Integer.parseInt(args[1]) - 1; try { if (args[0].equalsIgnoreCase("set") && args.length > 2) { String text = FormatUtil.formatString(user, "essentials.editsign", getFinalArg(args, 2)).trim(); if (ChatColor.stripColor(text).length() > 15 && !user.isAuthorized("essentials.editsign.unlimited")) { throw new Exception(tl("editsignCommandLimit")); } sign.setLine(line, text); sign.update(); user.sendMessage(tl("editsignCommandSetSuccess", line + 1, text)); <START> } else if (args[0].equalsIgnoreCase("reset")) { <END> sign.setLine(line, ""); sign.update(); user.sendMessage(tl("editsignCommandResetLine", line + 1)); } else { throw new NotEnoughArgumentsException(); } } catch (IndexOutOfBoundsException e) { throw new Exception(tl("editsignCommandNoLine")); } }</code><technical_language>suggestion } else if (args[0].equalsIgnoreCase("clear")) {</technical_language>

Target:
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { if (args.length == 0 || (args.length > 1 && !NumberUtil.isInt(args[1]))) { throw new NotEnoughArgumentsException(); } Block target = user.getBase().getTargetBlock(null, 5); if (!(target.getState() instanceof Sign)) { throw new Exception(tl("editsignCommandTarget")); } Sign sign = (Sign) target.getState(); try { if (args[0].equalsIgnoreCase("set") && args.length > 2) { int line = Integer.parseInt(args[1]) - 1; String text = FormatUtil.formatString(user, "essentials.editsign", getFinalArg(args, 2)).trim(); if (ChatColor.stripColor(text).length() > 15 && !user.isAuthorized("essentials.editsign.unlimited")) { throw new Exception(tl("editsignCommandLimit")); } sign.setLine(line, text); sign.update(); user.sendMessage(tl("editsignCommandSetSuccess", line + 1, text)); } else if (args[0].equalsIgnoreCase("clear")) { if (args.length == 1) { for (int i = 0; i < 4; i++) { sign.setLine(i, ""); } sign.update(); user.sendMessage(tl("editsignCommandClear")); } else { int line = Integer.parseInt(args[1]) - 1; sign.setLine(line, ""); sign.update(); user.sendMessage(tl("editsignCommandClearLine", line + 1)); } } else { throw new NotEnoughArgumentsException(); } } catch (IndexOutOfBoundsException e) { throw new Exception(tl("editsignCommandNoLine")); } }
Source:
<code>public static boolean folderContains(File folder, String filename) { if (folder == null) { return false; } if (!folder.isDirectory()) { return false; } <START> File[] fileList = folder.listFiles(); <END> if (fileList == null) { return false; } for (File f : fileList) { if (f.getName().equals(filename)) { return true; } } return false; }</code><technical_language>Fix formatting. Run formatter phase in maven. fileList==null doesnt do folder.isDirectory is checked listFiles returns null if File is a directory. return empty if directory files</technical_language>

Target:
public static boolean folderContains(File folder, String filename) { if (folder == null) { return false; } File[] fileList = folder.listFiles(); if (fileList == null) { return false; } for (File f : fileList) { if (f.getName().equals(filename)) { return true; } } return false; }
Source:
<code>public InternalCDORevision removeRevision(CDOID id, CDOBranchVersion branchVersion) { Object key = createKey(id, branchVersion.getBranch()); synchronized (revisionLists) { RevisionList list = revisionLists.getIfPresent(key); if (list != null) { list.removeRevision(branchVersion.getVersion()); if (list.isEmpty()) { revisionLists.invalidate(key); <START> typeRefDecrease(id); <END> } } } return null; }</code><technical_language>..but counter is decremented removal of revision, once</technical_language>

Target:
public InternalCDORevision removeRevision(CDOID id, CDOBranchVersion branchVersion) { Object key = createKey(id, branchVersion.getBranch()); synchronized (revisionLists) { RevisionList list = revisionLists.getIfPresent(key); if (list != null) { if (list.removeRevision(branchVersion.getVersion())) { typeRefDecrease(id); } if (list.isEmpty()) { revisionLists.invalidate(key); } } } return null; }
Source:
<code>public <T> T getSinkConfiguration(final String sinkName, final Class <? extends T> sinkClass) { final SinkConfiguration sinkConfiguration = sinks.get(sinkName); Preconditions.checkArgument(null != sinkConfiguration, "No sink configuration with name: %s", sinkName); <START> Preconditions.checkArgument(sinkClass.isAssignableFrom(sinkConfiguration.getClass()), <END> "Sink configuration '%s' is not a %s sink", sinkName, sinkClass.getSimpleName()); return sinkClass.cast(sinkConfiguration); }</code><technical_language>here? This change required, I think</technical_language>

Target:
public <T> T getSinkConfiguration(final String sinkName, final Class <? extends T> sinkClass) { final SinkConfiguration sinkConfiguration = sinks.get(sinkName); Preconditions.checkArgument(null != sinkConfiguration, "No sink configuration with name: %s", sinkName); Preconditions.checkArgument(sinkClass.isInstance(sinkConfiguration), "Sink configuration '%s' is not a %s sink", sinkName, sinkClass.getSimpleName()); return sinkClass.cast(sinkConfiguration); }
Source:
<code><START> public AbstractTupleDomainFilter(boolean nullAllowed) <END> { this.nullAllowed = nullAllowed; }</code><technical_language>I guess want is effectively sealed class, Java native support for. mimic reducing visibility of constructor making this child constructors private, exposing factory for creation</technical_language>

Target:
private AbstractTupleDomainFilter(boolean nullAllowed) { this.nullAllowed = nullAllowed; }
Source:
<code>public GoogleComputeProvider(Configured configuration, GoogleCredentials credentials) { super(configuration); this.credentials = credentials; Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String zone = getConfigurationValue(GoogleComputeProviderConfigurationProperty.ZONE); try { compute.zones().get(projectId, zone).execute(); } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == 404) { System.out.println("Zone '" + zone + "' not found."); } } catch (IOException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>exception propagate</technical_language>

Target:
public GoogleComputeProvider(Configured configuration, GoogleCredentials credentials) { super(configuration); this.credentials = credentials; Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String zone = getConfigurationValue(GoogleComputeInstanceTemplateConfigurationProperty.ZONE); try { compute.zones().get(projectId, zone).execute(); } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == 404) { throw new IllegalArgumentException("Zone '" + zone + "' not found."); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public void preparePack(ProgressMonitor countingMonitor, @NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have, @NonNull Set<? extends ObjectId> shallow) throws IOException { ObjectWalk ow = null; try { <START> if (shallowPack) { ow = new DepthWalk.ObjectWalk(reader, depth - 1); } else { ow = new ObjectWalk(reader); } <END> ow.assumeShallow(shallow); preparePack(countingMonitor, ow, want, have); } finally { if (ow != null) { ow.close(); } } }</code><technical_language>If this part is factored out a method, invoked in a try-with-resource block. i.e.: private ObjectWalk getObjectWalk() { return shallowPack ? new DepthWalk.ObjectWalk(reader, depth - 1) : new ObjectWalk(reader); } public void preparePack(ProgressMonitor countingMonitor, @NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have, @NonNull Set<? extends ObjectId> shallow) throws IOException { try (ObjectWalk ow = getObjectWalk()) { ow.assumeShallow(shallow); preparePack(countingMonitor, ow, want, have); } }</technical_language>

Target:
public void preparePack(ProgressMonitor countingMonitor, @NonNull Set<? extends ObjectId> want, @NonNull Set<? extends ObjectId> have, @NonNull Set<? extends ObjectId> shallow) throws IOException { try (ObjectWalk ow = getObjectWalk()) { ow.assumeShallow(shallow); preparePack(countingMonitor, ow, want, have); } }
Source:
<code>public void printBody(final OutputStream output) throws IOException { final InputStream input = new RqLengthAware(this).body(); final byte[] buf = new byte[4096]; while (true) { <START> final int actual = input.read(buf); <END> if (actual < 0) { break; } output.write(buf, 0, actual); } }</code><technical_language>@dmzaytsev call bytes for clarity</technical_language>

Target:
public void printBody(final OutputStream output) throws IOException { final InputStream input = new RqLengthAware(this).body(); final byte[] buf = new byte[4096]; while (true) { final int bytes = input.read(buf); if (bytes < 0) { break; } output.write(buf, 0, bytes); } }
Source:
<code>public JRDataSource getDataSource() { String sessionId = getSessionIdProvider().getSessionId(); <START> DataService dataService = new DefaultDataService(databaseService); <END> Set<TestEntity> testEntities = dataService.getTests(sessionId); List<TestDetailsDTO> result = new ArrayList<TestDetailsDTO>(); for(TestEntity testEntity : testEntities) { TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestName(testEntity.getName()); testDetailsDTO.setId(testEntity.getId().toString()); result.add(testDetailsDTO); } return new JRBeanCollectionDataSource(result); }</code><technical_language>do need new DefaultDataService time. is enough, is</technical_language>

Target:
public JRDataSource getDataSource() { String sessionId = getSessionIdProvider().getSessionId(); Set<TestEntity> testEntities = dataService.getTests(sessionId); List<TestDetailsDTO> result = new ArrayList<TestDetailsDTO>(); for(TestEntity testEntity : testEntities) { TestDetailsDTO testDetailsDTO = new TestDetailsDTO(); testDetailsDTO.setTestName(testEntity.getName()); testDetailsDTO.setId(testEntity.getId().toString()); result.add(testDetailsDTO); } return new JRBeanCollectionDataSource(result); }
Source:
<code>public PlayerNetworkComponent getNetwork() { <START> return getExact(PlayerNetworkComponent.class); <END> }</code><technical_language>This kills ability for Vanilla extend PlayerNetworkComponent</technical_language>

Target:
public PlayerNetworkComponent getNetwork() { return get(PlayerNetworkComponent.class); }
Source:
<code>public void enableExportButton(boolean state) { if ( state ) { if (comboBoxForm.getSelectedIndex() == -1) { btnPemFileChooseButton.setEnabled(false); btnExport.setEnabled(false); return; } BriefcaseFormDefinition lfd = (BriefcaseFormDefinition) comboBoxForm.getSelectedItem(); if ( lfd == null ) { btnPemFileChooseButton.setEnabled(false); btnExport.setEnabled(false); return; } if ( lfd.isFileEncryptedForm() || lfd.isFieldEncryptedForm() ) { btnPemFileChooseButton.setEnabled(true); File pemFile = new File(pemPrivateKeyFilePath.getText()); if ( !pemFile.exists()) { btnExport.setEnabled(false); return; } } else { btnPemFileChooseButton.setEnabled(false); } if (comboBoxExportType.getSelectedIndex() == -1) { btnExport.setEnabled(false); return; } String exportDir = txtExportDirectory.getText(); if ( exportDir == null || exportDir.trim().length() == 0 ) { btnExport.setEnabled(false); return; } <START> if ( checkDates.isSelected() && (pickStartDate.getDate() == null || pickEndDate.getDate() == null)) { <END> btnExport.setEnabled(false); return; } boolean enabled = true; File exportDirectory = new File(exportDir.trim()); if ( exportDirectory == null || !exportDirectory.exists() ) { enabled = false; } if ( !exportDirectory.isDirectory() ) { enabled = false; } if ( FileSystemUtils.isUnderODKFolder(exportDirectory) ) { enabled = false; } else if ( FileSystemUtils.isUnderBriefcaseFolder(exportDirectory)) { enabled = false; } btnExport.setEnabled(enabled); } else { btnExport.setEnabled(false); } }</code><technical_language>I putting a space "if ("</technical_language>

Target:
public void enableExportButton(boolean state) { if ( state ) { if (comboBoxForm.getSelectedIndex() == -1) { btnPemFileChooseButton.setEnabled(false); btnExport.setEnabled(false); return; } BriefcaseFormDefinition lfd = (BriefcaseFormDefinition) comboBoxForm.getSelectedItem(); if ( lfd == null ) { btnPemFileChooseButton.setEnabled(false); btnExport.setEnabled(false); return; } if ( lfd.isFileEncryptedForm() || lfd.isFieldEncryptedForm() ) { btnPemFileChooseButton.setEnabled(true); File pemFile = new File(pemPrivateKeyFilePath.getText()); if ( !pemFile.exists()) { btnExport.setEnabled(false); return; } } else { btnPemFileChooseButton.setEnabled(false); } if (comboBoxExportType.getSelectedIndex() == -1) { btnExport.setEnabled(false); return; } String exportDir = txtExportDirectory.getText(); if ( exportDir == null || exportDir.trim().length() == 0 ) { btnExport.setEnabled(false); return; } boolean enabled = true; File exportDirectory = new File(exportDir.trim()); if ( exportDirectory == null || !exportDirectory.exists() ) { enabled = false; } if ( !exportDirectory.isDirectory() ) { enabled = false; } if ( FileSystemUtils.isUnderODKFolder(exportDirectory) ) { enabled = false; } else if ( FileSystemUtils.isUnderBriefcaseFolder(exportDirectory)) { enabled = false; } btnExport.setEnabled(enabled); } else { btnExport.setEnabled(false); } }
Source:
<code>public SubscriptionCalculator(double price, List<CalcSubscription> subscriptions) { this.price = price; <START> this.subscriptions = subscriptions; <END> }</code><technical_language>If nullable, add checkNotNull checks</technical_language>

Target:
public SubscriptionCalculator(double price, List<CalcSubscription> subscriptions) { this.price = checkNotNull(price, "price"); this.subscriptions = checkNotNull(subscriptions, "subscriptions"); }
Source:
<code>public void testCorrectHeaderFormatWithInstanceId() { UserAgent baseUserAgent = UserAgent.of("service", "instanceId", "1.0.0"); assertThat(UserAgents.format(baseUserAgent)).isEqualTo("service/instanceId (1.0.0)"); UserAgent derivedAgent = baseUserAgent.merge(UserAgent.of("remoting", "2.0.0")); <START> assertThat(UserAgents.format(derivedAgent)).isEqualTo("service/instanceId (1.0.0), remoting (2.0.0)"); <END> }</code><technical_language>formatting method in UserAgent</technical_language>

Target:
public void testCorrectHeaderFormatWithInstanceId() { UserAgent baseUserAgent = UserAgent.of(UserAgent.Agent.of("service", "1.0.0"), "instanceId"); assertThat(UserAgents.format(baseUserAgent)).isEqualTo("service/instanceId (1.0.0)"); UserAgent derivedAgent = baseUserAgent.addAgent(UserAgent.Agent.of("remoting", "2.0.0")); assertThat(UserAgents.format(derivedAgent)).isEqualTo("service/instanceId (1.0.0), remoting (2.0.0)"); }
Source:
<code>public PutOperation<K, V> decode(ByteBuffer buffer) throws ClassNotFoundException { BaseOperation.Code opCode = BaseOperation.Code.valueOf(buffer.get()); if (opCode != PUT) { throw new AssertionError(this.getClass().getName() + " can not decode operation of type " + opCode); } <START> byte[] keyBlob = new byte[buffer.getInt()]; <END> buffer.get(keyBlob); byte[] valueBlob = new byte[buffer.getInt()]; buffer.get(valueBlob); return new PutOperation<K, V>( keySerializer.read(ByteBuffer.wrap(keyBlob)), valueSerializer.read(ByteBuffer.wrap(valueBlob))); }</code><technical_language>Consider slicing ByteBuffer instead of allocating another byte[], a bit more math compute bounds, allocations in end</technical_language>

Target:
public PutOperation<K, V> decode(ByteBuffer buffer) throws ClassNotFoundException { OperationCode opCode = OperationCode.valueOf(buffer.get()); if (opCode != PUT) { throw new IllegalArgumentException(this.getClass().getName() + " can not decode operation of type " + opCode); } int keySize = buffer.getInt(); buffer.limit(buffer.position() + keySize); ByteBuffer keyBlob = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); int valueSize = buffer.getInt(); buffer.limit(buffer.position() + valueSize); ByteBuffer valueBlob = buffer.slice(); return new PutOperation<K, V>( keySerializer.read(keyBlob), valueSerializer.read(valueBlob)); }
Source:
<code>private void doLog(LogicalMessageContext smc) { if (!(Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)) { try { TransformerFactory tff = TransformerFactory.newInstance(); Transformer tf = tff.newTransformer(); tf.setOutputProperty(OutputKeys.INDENT, "yes"); tf.setOutputProperty("{<LINK_0>}indent-amount", "2"); Source sc = smc.getMessage().getPayload(); StreamResult result = new StreamResult(outputStream); tf.transform(sc, result); } catch (Exception e) { PrintWriter ps = new PrintWriter(outputStream); ps.println("Exception getting response message log: "); <START> log.error(e); <END> } } }</code><technical_language>e.printStackTrace(ps) printing stacktrace provided outputStream; printing logger breaking this functionality</technical_language>

Target:
private void doLog(LogicalMessageContext smc) { if (!(Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)) { try { TransformerFactory tff = TransformerFactory.newInstance(); Transformer tf = tff.newTransformer(); tf.setOutputProperty(OutputKeys.INDENT, "yes"); tf.setOutputProperty("{<LINK_0>}indent-amount", "2"); Source sc = smc.getMessage().getPayload(); StreamResult result = new StreamResult(outputStream); tf.transform(sc, result); } catch (Exception e) { PrintWriter ps = new PrintWriter(outputStream); ps.println("Exception getting response message log: "); e.printStackTrace(ps); } } }
Source:
<code>private void servePageOrFragment(App app, HttpRequest request, HttpResponse response) { DebugLogger.startRequest(request); try { setResponseSecurityHeaders(app, response); if (request.isFragmentRequest()) { JsonObject renderedFragment = app.renderFragment(request, response); response.setContent(STATUS_OK, renderedFragment.toString(), CONTENT_TYPE_APPLICATION_JSON); } else { Configuration configuration = app.getConfiguration(); for (Filter filter : filters) { FilterResult result = filter.doFilter(configuration, request, response); if (!result.isContinue()) { <START> serveDefaultErrorPage(result.getStatusCode().orElse(STATUS_INTERNAL_SERVER_ERROR), <END> result.getMessage().orElse("Internal Server Error"), response); return; } } String html = app.renderPage(request, response); response.setContent(STATUS_OK, html, CONTENT_TYPE_TEXT_HTML); } } catch (UUFException e) { throw e; } catch (Exception e) { Throwable th = e; while ((th = th.getCause()) != null) { if (th instanceof UUFException) { throw (UUFException) th; } } throw e; } finally { DebugLogger.endRequest(request); } }</code><technical_language>Instead of rendering default error page, render configured error pages in app app.renderErrorPage</technical_language>

Target:
private void servePageOrFragment(App app, HttpRequest request, HttpResponse response) { DebugLogger.startRequest(request); try { setResponseSecurityHeaders(app, response); if (request.isFragmentRequest()) { JsonObject renderedFragment = app.renderFragment(request, response); response.setContent(STATUS_OK, renderedFragment.toString(), CONTENT_TYPE_APPLICATION_JSON); } else { Configuration configuration = app.getConfiguration(); for (Filter filter : filters) { FilterResult result = filter.doFilter(request, configuration); if (!result.isContinue()) { serveDefaultErrorPage(result.getHttpStatusCode(), result.getMessage(), response); return; } } String html = app.renderPage(request, response); response.setContent(STATUS_OK, html, CONTENT_TYPE_TEXT_HTML); } } catch (UUFException e) { throw e; } catch (Exception e) { Throwable th = e; while ((th = th.getCause()) != null) { if (th instanceof UUFException) { throw (UUFException) th; } } throw e; } finally { DebugLogger.endRequest(request); } }
Source:
<code>public NamedFields get() { LOGGER.debug("Retrieving RDF representation for: {}", uri); try { final Model rdf = rdfr.get(); if (!rdf.contains(createResource(uri.toString()), INDEXING_TRANSFORM_PREDICATE)) { LOGGER.info("Looking up property locating LDPath transform for: {}", uri); final HttpHead headRequest = new HttpHead(uri); final HttpResponse headResponse = httpClient.execute(headRequest); URI descriptionURI = null; final Header[] links = headResponse.getHeaders("Link"); if ( links != null ) { for ( Header h : headResponse.getHeaders("Link") ) { final Link link = Link.valueOf(h.getValue()); if (link.getRel().equals("describedby")) { descriptionURI = link.getUri(); LOGGER.debug("Using URI from Link header: {}", descriptionURI); } } } if (descriptionURI == null) { <START> throw new AbsentTransformPropertyException("Property lookup failed"); <END> } return getNamedFields(rdf, descriptionURI); } return getNamedFields(rdf, uri); } catch (IOException | HttpException e) { throw propagate(e); } }</code><technical_language>debugging if AbsentTransformPropertyException includes URI of target resource</technical_language>

Target:
public NamedFields get() { LOGGER.debug("Retrieving RDF representation for: {}", uri); try { final Model rdf = rdfr.get(); if (!rdf.contains(createResource(uri.toString()), INDEXING_TRANSFORM_PREDICATE)) { LOGGER.info("Looking up property locating LDPath transform for: {}", uri); final HttpHead headRequest = new HttpHead(uri); final HttpResponse headResponse = httpClient.execute(headRequest); URI descriptionURI = null; final Header[] links = headResponse.getHeaders("Link"); if ( links != null ) { for ( Header h : headResponse.getHeaders("Link") ) { final Link link = Link.valueOf(h.getValue()); if (link.getRel().equals("describedby")) { descriptionURI = link.getUri(); LOGGER.debug("Using URI from Link header: {}", descriptionURI); } } } if (descriptionURI == null) { throw new AbsentTransformPropertyException("Property lookup failed for uri: " + uri); } return getNamedFields(rdf, descriptionURI); } return getNamedFields(rdf, uri); } catch (IOException | HttpException e) { throw propagate(e); } }
Source:
<code>public Optional<Long> getPreviousOutOfBedTime(final SleepPeriod.Period period, final MainEventTimes prevNightMainEventTimes) { if ( period == SleepPeriod.Period.MORNING) { if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } else { return Optional.absent(); } } if (period == SleepPeriod.Period.AFTERNOON) { if (this.morningResults.processed && this.morningResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.morningResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); }else if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); }else { <START> return Optional.absent(); <END> } } if (period == SleepPeriod.Period.NIGHT) { if (this.afternoonResults.processed && this.afternoonResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.afternoonResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } else if (this.morningResults.processed && this.morningResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.morningResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); }else if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } else { return Optional.absent(); } } return Optional.absent(); }</code><technical_language>need else</technical_language>

Target:
public Optional<Long> getPreviousOutOfBedTime(final SleepPeriod.Period period, final MainEventTimes prevNightMainEventTimes) { if ( period == SleepPeriod.Period.MORNING) { if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } return Optional.absent(); } if (period == SleepPeriod.Period.AFTERNOON) { if (this.morningResults.processed && this.morningResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.morningResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); }else if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } return Optional.absent(); } if (period == SleepPeriod.Period.NIGHT) { if (this.afternoonResults.processed && this.afternoonResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.afternoonResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } else if (this.morningResults.processed && this.morningResults.mainEventTimes.hasValidEventTimes()) { return Optional.of(this.morningResults.mainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); }else if (prevNightMainEventTimes.hasValidEventTimes()) { return Optional.of(prevNightMainEventTimes.eventTimeMap.get(Event.Type.OUT_OF_BED).time); } return Optional.absent(); } return Optional.absent(); }
Source:
<code>static SanitizedLockRequestProgress create(LockServiceStateDebugger.LockRequestProgress progress, LockDescriptorMapper descriptorMapper, String clientId) { return ImmutableSanitizedLockRequestProgress.builder() .totalNumLocks(progress.getTotalNumLocks()) .numLocksAcquired(progress.getNumLocksAcquired()) .nextLock(progress.getNextLock().map(descriptorMapper::getDescriptorMapping) .orElse(UNKNOWN_NEXT_LOCK_MESSAGE)) .requests( StreamSupport.stream(progress.getRequest().getLockDescriptors().entries().spliterator(), false) <START> .map(descriptor -> SimpleLockRequest.of( <END> progress.getRequest(), descriptorMapper.getDescriptorMapping(descriptor.getKey()), descriptor.getValue(), clientId)) .collect(Collectors.toList())) .build(); }</code><technical_language>Need backport SimpleLockRequest :(</technical_language>

Target:
static SanitizedLockRequestProgress create(LockServiceStateDebugger.LockRequestProgress progress, LockDescriptorMapper descriptorMapper, String clientId) { return ImmutableSanitizedLockRequestProgress.builder() .totalNumLocks(progress.getTotalNumLocks()) .numLocksAcquired(progress.getNumLocksAcquired()) .nextLock(progress.getNextLock().map(descriptorMapper::getDescriptorMapping) .orElse(UNKNOWN_NEXT_LOCK_MESSAGE)) .requests( StreamSupport.stream(progress.getRequest().getLockDescriptors().entries().spliterator(), false) .map(descriptor -> SimpleLockRequest.of( progress.getRequest(), descriptorMapper.getDescriptorMapping(descriptor.getKey()), clientId)) .collect(Collectors.toList())) .build(); }
Source:
<code>ClientsClassDefinition(Class<?> clazz) { <START> argumentIsNotNull(clazz); <END> this.clazz = clazz; this.ignoredProperties = Collections.emptyList(); }</code><technical_language>this(clazz, Collections.EMPTY_LIST)</technical_language>

Target:
ClientsClassDefinition(Class<?> clazz) { this(clazz, Collections.EMPTY_LIST); }
Source:
<code>public void transform(StructuredRecord input, Emitter<KeyValue<NullWritable, AbstractFileMetadata>> emitter) throws Exception { AbstractFileMetadata output; switch ((String) input.get(AbstractFileMetadata.Credentials.DATA_BASE_TYPE)) { case S3FileMetadata.DATA_BASE_NAME : <START> output = new S3FileMetadata((String) input.get(AbstractFileMetadata.FILE_NAME), <END> (String) input.get(AbstractFileMetadata.FULL_PATH), (long) input.get(AbstractFileMetadata.TIMESTAMP), (String) input.get(AbstractFileMetadata.OWNER), (long) input.get(AbstractFileMetadata.FILE_SIZE), (Boolean) input.get(AbstractFileMetadata.IS_FOLDER), (String) input.get(AbstractFileMetadata.BASE_PATH), (short) input.get(AbstractFileMetadata.PERMISSION), new S3FileMetadata.S3Credentials((String) input.get(S3Credentials.ACCESS_KEY_ID), (String) input.get(S3Credentials.SECRET_KEY_ID), (String) input.get(S3Credentials.REGION), (String) input.get(S3Credentials.BUCKET_NAME)) ); break; default: throw new IllegalArgumentException("unrecognized database type"); } emitter.emit(new KeyValue<NullWritable, AbstractFileMetadata>(null, output)); }</code><technical_language>I put AbstractFileMetadata StructuredRecord conversion logic AbstractFileMetadata class, a toRecord() method a static fromRecord(StructuredRecord record) method. logic is in a single place, re-used in other classes, field names private</technical_language>

Target:
public void transform(StructuredRecord input, Emitter<KeyValue<NullWritable, AbstractFileMetadata>> emitter) throws Exception { AbstractFileMetadata output; String fsScheme = URI.create((String) input.get(AbstractFileMetadata.HOST_URI)).getScheme(); switch (fsScheme) { case "s3n" : case "s3a" : output = new S3FileMetadata(input); break; default: throw new IllegalArgumentException(fsScheme + "is not supported."); } emitter.emit(new KeyValue<NullWritable, AbstractFileMetadata>(null, output)); }
Source:
<code>private static String flattenVectorOfStrings(Vector<String> v) { String s = ""; for (String caseId : v) { s = s + caseId + ", "; } <START> s = s.substring(0, s.length()-2); <END> return s; }</code><technical_language>This throw exception if strings in vector. I honestly space separate worry hanging space end</technical_language>

Target:
private static String flattenVectorOfStrings(Vector<String> v) { StringBuilder builder = new StringBuilder(); for (String caseId : v) { builder.append(caseId + " "); } return builder.toString(); }
Source:
<code><START> public static java.util.Date parseDate(String newDate) throws PerforceException { <END> try { return dateParser.parse(newDate); } catch(ParseException e) { throw new PerforceException("Could not parse changelist timestamp " + "returned by server : " + newDate); } }</code><technical_language>a compatibility loss</technical_language>

Target:
public static java.util.Date parseDate(String newDate) { if(newDate == null || newDate.equals("")) { return null; } String parts[] = newDate.split(" "); String date[] = parts[0].split("/"); String time[] = null; if(parts.length > 1) { time = parts[1].split(":"); time[2] = time[2].replaceAll("\\.0", ""); } else { time = "00:00:00".split(":"); } GregorianCalendar cal = (GregorianCalendar) Calendar.getInstance(); cal.clear(); cal.set(new Integer(date[0]).intValue(), (new Integer(date[1]).intValue() - 1), new Integer(date[2]).intValue(), new Integer( time[0]).intValue(), new Integer(time[1]).intValue(), new Integer(time[2]).intValue()); return cal.getTime(); }
Source:
<code><START> private static JwtDecoder getJwtDecoder() { <END> return token -> { Map<String, Object> claims = new HashMap<>(); claims.put(IdTokenClaimNames.SUB, "sub123"); claims.put(IdTokenClaimNames.ISS, "http://localhost/iss"); claims.put(IdTokenClaimNames.AUD, Arrays.asList("clientId", "a", "u", "d")); claims.put(IdTokenClaimNames.AZP, "clientId"); return new Jwt("token123", Instant.now(), Instant.now().plusSeconds(3600), Collections.singletonMap("header1", "value1"), claims); }; }</code><technical_language>sense return a mock testing is easier</technical_language>

Target:
private static JwtDecoder getJwtDecoder() { Map<String, Object> claims = new HashMap<>(); claims.put(IdTokenClaimNames.SUB, "sub123"); claims.put(IdTokenClaimNames.ISS, "http://localhost/iss"); claims.put(IdTokenClaimNames.AUD, Arrays.asList("clientId", "a", "u", "d")); claims.put(IdTokenClaimNames.AZP, "clientId"); Jwt jwt = new Jwt("token123", Instant.now(), Instant.now().plusSeconds(3600), Collections.singletonMap("header1", "value1"), claims); JwtDecoder jwtDecoder = mock(JwtDecoder.class); when(jwtDecoder.decode(any())).thenReturn(jwt); return jwtDecoder; }
Source:
<code>public static Object[][] getTestData() throws IOException, ClassNotFoundException { <START> Object[][] searchTerms = XlsFileReader.getAllRowsFromXlsSheet("OrderSearchTerms"); <END> return new Object[][]{new Object[]{DBUtility.getMerchandiser(), searchTerms[0][0]}, new Object[]{DBUtility.getMerchandiser(), searchTerms[1][0]}, new Object[]{DBUtility.getMerchandiser(), searchTerms[2][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[0][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[1][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[2][0]}}; }</code><technical_language>final</technical_language>

Target:
public static Object[][] getTestData() throws IOException, ClassNotFoundException { final Object[][] searchTerms = XlsFileReader.getAllRowsFromXlsSheet("OrderSearchTerms"); return new Object[][]{new Object[]{DBUtility.getMerchandiser(), searchTerms[0][0]}, new Object[]{DBUtility.getMerchandiser(), searchTerms[1][0]}, new Object[]{DBUtility.getMerchandiser(), searchTerms[2][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[0][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[1][0]}, new Object[]{DBUtility.getCustomer(), searchTerms[2][0]}}; }
Source:
<code>public void removeDynamicMenuContributions(MenuManager menuManager, MMenu menuModel) { for (Entry<MMenuElement, IContributionItem> entry : modelToContribution.entrySet()) { <START> if (entry.getKey() instanceof MDynamicMenuContribution) { <END> final IContributionItem contributionItem = entry.getValue(); if (contributionItem instanceof DynamicContributionContributionItem) { final DynamicContributionContributionItem dynamicContributionItem = (DynamicContributionContributionItem) contributionItem; if ((dynamicContributionItem.getParent() instanceof MenuManager) && dynamicContributionItem.getParent().equals(menuManager)) { final ArrayList<MMenuElement> childElements = (ArrayList<MMenuElement>) entry.getKey() .getTransientData().get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); if (childElements != null) { removeDynamicMenuContributions(menuManager, menuModel, childElements); } } } } } }</code><technical_language>For readability, please assign entry.getKey() menuElement variable</technical_language>

Target:
public void removeDynamicMenuContributions(MenuManager menuManager, MMenu menuModel) { for (Entry<MMenuElement, IContributionItem> entry : modelToContribution.entrySet()) { MMenuElement menuElement = entry.getKey(); if (menuElement instanceof MDynamicMenuContribution) { final IContributionItem contributionItem = entry.getValue(); if (contributionItem instanceof DynamicContributionContributionItem) { final DynamicContributionContributionItem dynamicContributionItem = (DynamicContributionContributionItem) contributionItem; if ((dynamicContributionItem.getParent() instanceof MenuManager) && dynamicContributionItem.getParent().equals(menuManager)) { final ArrayList<MMenuElement> childElements = (ArrayList<MMenuElement>) menuElement .getTransientData().get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); if (childElements != null) { removeDynamicMenuContributions(menuManager, menuModel, childElements); } } } } } }
Source:
<code>public void register(ServiceEndPoint endPoint) { checkNotNull(endPoint); Timer.Context context = _registerTimer.time(); doRegister(endPoint); <START> context.stop(); <END> }</code><technical_language>Typically want wrap time a try/finally block stop timer in finally. timer stops if code timing throws exceptions. code calling fail, bother. In this case, ServiceFactory method called fail</technical_language>

Target:
public void register(ServiceEndPoint endPoint) { checkNotNull(endPoint); Timer.Context context = _registerTimer.time(); try { doRegister(endPoint); } catch (Exception ex) { LOG.error("Error registering service handle", ex); } finally { context.stop(); } }
Source:
<code><START> public void setError(@NonNull Throwable e, @Nullable String customErrorText) { <END> messageTextView.setVisibility(View.GONE); Throwable inner = getInnermostThrowable(e); String errorText; String messageText = null; if (inner instanceof ApiException) { errorText = getResources().getString(R.string.error_server_response); ApiException apiEx = (ApiException) inner; if (apiEx.getInfo() != null) { messageText = String.format(getResources().getString(R.string.error_server_message), apiEx.getInfo()); } else if (apiEx.getCode() != null) { messageText = String.format(getResources().getString(R.string.error_server_code), apiEx.getCode()); } } else if (throwableContainsException(e, HttpRequest.HttpRequestException.class) || throwableContainsException(e, UnknownHostException.class) || throwableContainsException(e, TimeoutException.class) || throwableContainsException(e, SSLException.class)) { errorText = getResources().getString(R.string.error_network_error); messageText = String.format(getResources().getString(R.string.error_server_message), inner.getLocalizedMessage()); } else if (throwableContainsException(e, JSONException.class)) { errorText = getResources().getString(R.string.error_response_malformed); } else { errorText = getResources().getString(R.string.error_unknown); messageText = inner.getLocalizedMessage(); } if (customErrorText != null) { errorText = customErrorText; } errorTextView.setText(errorText); if (messageText != null) { messageTextView.setText(messageText); messageTextView.setVisibility(View.VISIBLE); } }</code><technical_language>This method is a long. break this out multiple overloaded methods? for ApiException for Throwable</technical_language>

Target:
public void setError(@NonNull Throwable e, @Nullable String customErrorText) { messageTextView.setVisibility(View.GONE); Throwable inner = ThrowableUtil.getInnermostThrowable(e); String errorText; String messageText = null; if (inner instanceof ApiException) { errorText = getResources().getString(R.string.error_server_response); messageText = getApiErrorMessage((ApiException) inner); } else if (ThrowableUtil.throwableContainsException(e, HttpRequest.HttpRequestException.class) || ThrowableUtil.throwableContainsException(e, UnknownHostException.class) || ThrowableUtil.throwableContainsException(e, TimeoutException.class) || ThrowableUtil.throwableContainsException(e, SSLException.class)) { errorText = getResources().getString(R.string.error_network_error); messageText = String.format(getResources().getString(R.string.format_error_server_message), inner.getLocalizedMessage()); } else if (ThrowableUtil.throwableContainsException(e, JSONException.class)) { errorText = getResources().getString(R.string.error_response_malformed); } else { errorText = getResources().getString(R.string.error_unknown); messageText = inner.getLocalizedMessage(); } if (!TextUtils.isEmpty(customErrorText)) { errorText = customErrorText; } errorTextView.setText(errorText); if (!TextUtils.isEmpty(messageText)) { messageTextView.setText(messageText); messageTextView.setVisibility(View.VISIBLE); } }
Source:
<code>Optional<InputStreamReader> loadPath(final Path path) { try { final byte[] bytes = ioService.readAllBytes(Paths.convert(path)); final ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); return Optional.of(new InputStreamReader(inputStream)); } catch (final Exception e) { <START> return Optional.empty(); <END> } }</code><technical_language>InputStreamReader constructor throws exception possibly if is UnsupportedEncodingException. in case return Optional.empty(), inputStream stay unclosed</technical_language>

Target:
Optional<InputStreamReader> loadPath(final Path path) { InputStreamReader mutableInputStream = null; try { final byte[] bytes = ioService.readAllBytes(convertPath(path)); final ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); mutableInputStream = new InputStreamReader(inputStream); return Optional.of(mutableInputStream); } catch (final Exception e) { closeInputStreamReader(mutableInputStream); return Optional.empty(); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); mSearchFiltersHeader = view.findViewById(R.id.filterResultsHeader); mSearchFiltersHeader.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startFilterActivity(); } }); setupSearchFiltersHeader(); <START> search(); <END> return view; }</code><technical_language>Move onResume</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); mSearchFiltersHeader = view.findViewById(R.id.filterResultsHeader); mSearchFiltersHeader.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startFilterActivity(); } }); setupSearchFiltersHeader(); return view; }
Source:
<code>public static void premain(String agentArgument, Instrumentation instrumentation) throws Exception { String[] args = agentArgument.split(":"); if (args.length < 2 || args.length > 3) { System.err.println("Usage: -javaagent:/path/to/JavaAgent.jar=[host:]<port>:<yaml configuration file>"); System.exit(1); } String host; int port; String file; if (args.length == 3) { port = Integer.parseInt(args[1]); host = args[0]; file = args[2]; } else { port = Integer.parseInt(args[0]); host = "0.0.0.0"; file = args[1]; } new JmxCollector(new File(file)).register(); DefaultExports.initialize(); QueuedThreadPool pool = new QueuedThreadPool(); pool.setDaemon(true); pool.setMaxThreads(10); pool.setName("jmx_exporter"); server = new Server(pool); ServerConnector connector = new ServerConnector(server); connector.setReuseAddress(true); connector.setHost(host); connector.setPort(port); server.setConnectors(new Connector[]{connector}); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.addFilter(GzipFilter.class, "/*", null); server.setHandler(context); context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); final int delayInSecs = Integer.parseInt(System.getProperty("jmx_exporter.agent.startdelay", "0")); <START> if (delayInSecs > 0) { <END> new Thread("jmx_exporter-agent-delayed-starter-" + delayInSecs + "secs") { @Override public void run() { try { Thread.sleep(delayInSecs * 1000); server.start(); } catch (InterruptedException e) { Thread.interrupted(); return; } catch (Exception e) { e.printStackTrace(); return; } } }.start(); } else { server.start(); } }</code><technical_language>thread.Sleep simpler</technical_language>

Target:
public static void premain(String agentArgument, Instrumentation instrumentation) throws Exception { String[] args = agentArgument.split(":"); if (args.length < 2 || args.length > 3) { System.err.println("Usage: -javaagent:/path/to/JavaAgent.jar=[host:]<port>:<yaml configuration file>"); System.exit(1); } String host; int port; String file; if (args.length == 3) { port = Integer.parseInt(args[1]); host = args[0]; file = args[2]; } else { port = Integer.parseInt(args[0]); host = "0.0.0.0"; file = args[1]; } new JmxCollector(new File(file)).register(); DefaultExports.initialize(); QueuedThreadPool pool = new QueuedThreadPool(); pool.setDaemon(true); pool.setMaxThreads(10); pool.setName("jmx_exporter"); server = new Server(pool); ServerConnector connector = new ServerConnector(server); connector.setReuseAddress(true); connector.setHost(host); connector.setPort(port); server.setConnectors(new Connector[]{connector}); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.addFilter(GzipFilter.class, "/*", null); server.setHandler(context); context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); server.start(); }
Source:
<code>private static long dmlDoInsert(UpdatePlan plan, Iterable<List<?>> cursor, int pageSize) throws IgniteCheckedException { GridCacheContext cctx = plan.cacheContext(); if (plan.rowCount() == 1) { IgniteBiTuple t = plan.processRow(cursor.iterator().next()); try ( MTC.TraceSurroundings ignored = MTC.support(cctx.kernalContext().tracing() .create(SQL_CACHE_UPDATE, MTC.span()) <START> .addTag(SQL_CACHE_UPDATES, () -> Integer.toString(1))) <END> ) { if (cctx.cache().putIfAbsent(t.getKey(), t.getValue())) return 1; else throw new TransactionDuplicateKeyException("Duplicate key during INSERT [key=" + t.getKey() + ']'); } } else { DmlBatchSender sender = new DmlBatchSender(cctx, pageSize, 1); for (List<?> row : cursor) { final IgniteBiTuple keyValPair = plan.processRow(row); sender.add(keyValPair.getKey(), new DmlStatementsProcessor.InsertEntryProcessor(keyValPair.getValue()), 0); } sender.flush(); SQLException resEx = sender.error(); if (!F.isEmpty(sender.failedKeys())) { String msg = "Failed to INSERT some keys because they are already in cache " + "[keys=" + sender.failedKeys() + ']'; SQLException dupEx = new SQLException(msg, SqlStateCode.CONSTRAINT_VIOLATION); if (resEx == null) resEx = dupEx; else resEx.setNextException(dupEx); } if (resEx != null) throw new IgniteSQLException(resEx); return sender.updateCount(); } }</code><technical_language>Constant</technical_language>

Target:
private static long dmlDoInsert(UpdatePlan plan, Iterable<List<?>> cursor, int pageSize) throws IgniteCheckedException { GridCacheContext cctx = plan.cacheContext(); if (plan.rowCount() == 1) { IgniteBiTuple t = plan.processRow(cursor.iterator().next()); try ( MTC.TraceSurroundings ignored = MTC.support(cctx.kernalContext().tracing() .create(SQL_CACHE_UPDATE, MTC.span()) .addTag(SQL_CACHE_UPDATES, () -> "1")) ) { if (cctx.cache().putIfAbsent(t.getKey(), t.getValue())) return 1; else throw new TransactionDuplicateKeyException("Duplicate key during INSERT [key=" + t.getKey() + ']'); } } else { DmlBatchSender sender = new DmlBatchSender(cctx, pageSize, 1); for (List<?> row : cursor) { final IgniteBiTuple keyValPair = plan.processRow(row); sender.add(keyValPair.getKey(), new DmlStatementsProcessor.InsertEntryProcessor(keyValPair.getValue()), 0); } sender.flush(); SQLException resEx = sender.error(); if (!F.isEmpty(sender.failedKeys())) { String msg = "Failed to INSERT some keys because they are already in cache " + "[keys=" + sender.failedKeys() + ']'; SQLException dupEx = new SQLException(msg, SqlStateCode.CONSTRAINT_VIOLATION); if (resEx == null) resEx = dupEx; else resEx.setNextException(dupEx); } if (resEx != null) throw new IgniteSQLException(resEx); return sender.updateCount(); } }
Source:
<code>public void testClusterHealth() { final String server1 = "server1"; final String server2 = "server2"; final String server3 = "server3"; final List<String> servers = Arrays.asList(server1, server2, server3); final Layout layout = layoutUtil.getLayout(servers); layout.setUnresponsiveServers(Arrays.asList(server3)); ClusterHealth clusterHealth = new ClusterHealth(); ClusterStatus status = clusterHealth.getClusterHealth( layout, layout.getAllActiveServers() ); <START> assertThat(status).isEqualTo(ClusterStatus.STABLE); <END> }</code><technical_language>This test is failing in CI. timing related? reliable</technical_language>

Target:
public void testClusterHealth() { Layout layout = layoutUtil.getLayout(servers); layout.setUnresponsiveServers(Collections.singletonList(server3)); ClusterStatus status = clusterHealth.getClusterHealth( layout, layout.getAllActiveServers() ); assertThat(status).isEqualTo(ClusterStatus.UNAVAILABLE); layout.getFirstSegment().getFirstStripe().getLogServers().remove(server3); status = clusterHealth.getClusterHealth( layout, layout.getAllActiveServers() ); assertThat(status).isEqualTo(ClusterStatus.DEGRADED); }
Source:
<code>public void stop() { stop.set(true); <START> if (DEBUG) <END> LOGGER.debug("ScopAutoSuggestProvider got signal stop"); }</code><technical_language>get rid of DEBUG variable altogether LOGGER.isDebugEnabled(). solution is DEBUG LOGGER.debug statements directly</technical_language>

Target:
public void stop() { stop.set(true); LOGGER.debug("ScopAutoSuggestProvider got signal stop"); }