auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void writeInterval(ByteBuffer buffer, long nodeStart) { HTVarInt.writeLong(buffer, fStart - nodeStart); HTVarInt.writeLong(buffer, fDuration); buffer.putInt(fAttribute); if (fStateValue != null) { @NonNull Object value = fStateValue; if (value instanceof Integer) { buffer.put(TYPE_INTEGER); buffer.putInt((int) value); } else if (value instanceof Long) { buffer.put(TYPE_LONG); buffer.putLong((long) value); } else if (value instanceof Double) { buffer.put(TYPE_DOUBLE); buffer.putDouble((double) value); } else if (value instanceof CustomStateValue) { buffer.put(TYPE_CUSTOM); int size = ((CustomStateValue) value).getSerializedSize(); buffer.putShort((short) size); ISafeByteBufferWriter safeBuffer = SafeByteBufferFactory.wrapWriter(buffer, size); ((CustomStateValue) value).serialize(safeBuffer); } else { String <START> string; if (value instanceof String) { string = (String) value; } else { string = value.toString(); } <END> if (string == null) { throw new IllegalStateException("Type: " + value.getClass() + " is not implemented in the state system"); } buffer.put(TYPE_STRING); byte[] strArray = string.getBytes(CHARSET); buffer.putShort((short) strArray.length); buffer.put(strArray); buffer.put((byte) 0); } } else { buffer.put(TYPE_NULL); } }</code><technical_language>String.valueOf() handle null</technical_language>

Target:
public void writeInterval(ByteBuffer buffer, long nodeStart) { HTVarInt.writeLong(buffer, fStart - nodeStart); HTVarInt.writeLong(buffer, fDuration); buffer.putInt(fAttribute); if (fStateValue != null) { @NonNull Object value = fStateValue; if (value instanceof Integer) { buffer.put(TYPE_INTEGER); buffer.putInt((int) value); } else if (value instanceof Long) { buffer.put(TYPE_LONG); buffer.putLong((long) value); } else if (value instanceof Double) { buffer.put(TYPE_DOUBLE); buffer.putDouble((double) value); } else if (value instanceof CustomStateValue) { buffer.put(TYPE_CUSTOM); int size = ((CustomStateValue) value).getSerializedSize(); buffer.putShort((short) size); ISafeByteBufferWriter safeBuffer = SafeByteBufferFactory.wrapWriter(buffer, size); ((CustomStateValue) value).serialize(safeBuffer); } else { String string = String.valueOf(value); buffer.put(TYPE_STRING); byte[] strArray = string.getBytes(CHARSET); buffer.putShort((short) strArray.length); buffer.put(strArray); buffer.put((byte) 0); } } else { buffer.put(TYPE_NULL); } }
Source:
<code>private JcloudsLocation resolve(String spec) { <START> return (JcloudsLocation) managementContext.getLocationRegistry().resolve("jclouds:"+spec); <END> }</code><technical_language>variable reference is hard-coded string i</technical_language>

Target:
private JcloudsLocation resolve(String spec) { return (JcloudsLocation) managementContext.getLocationRegistry().resolve(new JcloudsLocationResolver().getPrefix() + ":" + spec); }
Source:
<code>private Set<Path> getTrackerDirCompletedFiles() throws IOException { final Set<Path> completedFiles = new HashSet<>(); if (TrackingPolicy.TRACKER_DIR != trackingPolicy) { return completedFiles; } <START> Path trackerDirPath = Paths.get(trackerDirectory.getPath()); <END> Files.walkFileTree(trackerDirPath, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path candidate, BasicFileAttributes attrs) throws IOException { String fileName = candidate.getFileName().toString(); if (fileName.endsWith(completedSuffix)) { completedFiles.add(candidate.toAbsolutePath()); } return FileVisitResult.CONTINUE; } }); return completedFiles; }</code><technical_language>trackerDirectory.toPath() simpler. for line 545</technical_language>

Target:
private Set<Path> getTrackerDirCompletedFiles() throws IOException { final Set<Path> completedFiles = new HashSet<>(); if (TrackingPolicy.TRACKER_DIR != trackingPolicy) { return completedFiles; } Path trackerDirPath = trackerDirectory.toPath(); Files.walkFileTree(trackerDirPath, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path candidate, BasicFileAttributes attrs) throws IOException { String fileName = candidate.getFileName().toString(); if (fileName.endsWith(completedSuffix)) { completedFiles.add(candidate.toAbsolutePath()); } return FileVisitResult.CONTINUE; } }); return completedFiles; }
Source:
<code>public void uploadServiceRecordDocument(MultipartHttpServletRequest request) throws IOException { <START> String recordId = request.getParameter("serviceRecordId"); <END> for (MultipartFile fileItem : getMultipartFiles(request)) { uploadFile(SequencerServiceRecord.class, recordId, fileItem); } }</code><technical_language>check this exists usage</technical_language>

Target:
public void uploadServiceRecordDocument(MultipartHttpServletRequest request) throws IOException { String recordId = request.getParameter("serviceRecordId"); if (recordId == null) { throw new IOException("Cannot upload file - serviceRecordId parameter missing or null"); } else if (requestManager.getSequencerServiceRecordById(Long.valueOf(recordId)) == null) { throw new IOException("Cannot upload file - service record does not exist"); } for (MultipartFile fileItem : getMultipartFiles(request)) { uploadFile(SequencerServiceRecord.class, recordId, fileItem); } }
Source:
<code>public List<Reminder> getReminders() { RealmResults<Reminder> results = realm.where(Reminder.class) .findAllSorted("alarmTime", Sort.DESCENDING); <START> ArrayList<Reminder> reminders = new ArrayList<>(); <END> for (int i = 0; i < results.size(); i++) { reminders.add(results.get(i)); } return reminders; }</code><technical_language>initiate RealmResult size</technical_language>

Target:
public List<Reminder> getReminders() { RealmResults<Reminder> results = realm.where(Reminder.class) .findAllSorted("alarmTime", Sort.DESCENDING); List<Reminder> reminders = new ArrayList<>(results.size()); for (int i = 0; i < results.size(); i++) { reminders.add(results.get(i)); } return reminders; }
Source:
<code>private void renderScene() { GameWindow.clearWorld(); GameWindow.clearOverlay(); final Box track = new Box(3, 0.1, 500); track.setMaterial(new PhongMaterial(Color.WHITESMOKE)); GameWindow.addWorld(track); final Group entities = renderEntities(); GameWindow.addWorld(entities); GameWindow.addOverlay(new Text(0, 16, "Score: " + State.getScore())); GameWindow.addOverlay(new Text(0, 32, "Distance: " <START> + State.getTrack().moduloDistance())); <END> GameWindow.addOverlay(new Text(0, 48, "Coins: " + State.getCoins())); }</code><technical_language>move moduloDistance() State? a bit weird public getDistance() is moved State this :P</technical_language>

Target:
private void renderScene() { GameWindow.clearWorld(); GameWindow.clearOverlay(); final Box track = new Box(3, 0.1, 500); track.setMaterial(new PhongMaterial(Color.WHITESMOKE)); GameWindow.addWorld(track); final Group entities = renderEntities(); GameWindow.addWorld(entities); GameWindow.addOverlay(new Text(0, 16, "Score: " + State.getScore())); GameWindow.addOverlay(new Text(0, 32, "Distance: " + State.moduloDistance())); GameWindow.addOverlay(new Text(0, 48, "Coins: " + State.getCoins())); }
Source:
<code>private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } <START> runVdsCommand(VDSCommandType.HotUnplugLease, <END> new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }</code><technical_language>need catch exception here</technical_language>

Target:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } boolean hotUnplugSucceeded = false; try { hotUnplugSucceeded = runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())).getSucceeded(); } catch (EngineException e) { log.error("Failure in hot unplugging a lease to VM {}, message: {}", oldVm.getId(), e.getMessage()); } if (!hotUnplugSucceeded) { auditLog(this, AuditLogType.HOT_UNPLUG_LEASE_FAILED); } } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }
Source:
<code>public static Instant expirationFromKeystore(String type, String password, byte[] content) { KeyStore ks; try { ks = KeyStore.getInstance(type); } catch (KeyStoreException e) { throw Throwables.propagate(e); } try { ks.load(new ByteArrayInputStream(content), password.toCharArray()); } catch (IOException | NoSuchAlgorithmException | CertificateException e) { return null; } Instant earliest = null; try { for (String alias : list(ks.aliases())) { Certificate[] chain = ks.getCertificateChain(alias); if (chain == null) { Certificate certificate = ks.getCertificate(alias); if (certificate == null) { continue; } chain = new Certificate[]{certificate}; } for (Certificate cert : chain) { if (cert instanceof X509Certificate) { X509Certificate c = (X509Certificate) cert; if (earliest == null || c.getNotAfter().toInstant().isBefore(earliest)) { earliest = c.getNotAfter().toInstant(); } } } } } catch (KeyStoreException e) { throw Throwables.propagate(e); } <START> return earliest; <END> }</code><technical_language>Is instant earliest is null? If do want annotate definition @Nullable</technical_language>

Target:
@Nullable public static Instant expirationFromKeystore(String type, String password, byte[] content) { KeyStore ks; try { ks = KeyStore.getInstance(type); } catch (KeyStoreException e) { throw Throwables.propagate(e); } try { ks.load(new ByteArrayInputStream(content), password.toCharArray()); } catch (IOException | NoSuchAlgorithmException | CertificateException e) { logger.info("Failed to parse keystore", e); return null; } Instant earliest = null; try { for (String alias : list(ks.aliases())) { Certificate[] chain = ks.getCertificateChain(alias); if (chain == null) { Certificate certificate = ks.getCertificate(alias); if (certificate == null) { continue; } chain = new Certificate[]{certificate}; } for (Certificate cert : chain) { if (cert instanceof X509Certificate) { X509Certificate c = (X509Certificate) cert; if (earliest == null || c.getNotAfter().toInstant().isBefore(earliest)) { earliest = c.getNotAfter().toInstant(); } } } } } catch (KeyStoreException e) { throw Throwables.propagate(e); } return earliest; }
Source:
<code>public <U, R> Queue<R> zipWith(Iterable<? extends U> that, BiFunction<? super T, ? super U, ? extends R> mapper) { Objects.requireNonNull(that, "that is null"); Objects.requireNonNull(mapper, "mapper is null"); <START> return ofAll(toList().zipWith((Iterable<U>) that, mapper)); <END> }</code><technical_language>a type-hint work instead of casting? return ofAll(toList().<U> zipWith(that, mapper)); (Probably not, a question.)</technical_language>

Target:
public <U, R> Queue<R> zipWith(Iterable<? extends U> that, BiFunction<? super T, ? super U, ? extends R> mapper) { Objects.requireNonNull(that, "that is null"); Objects.requireNonNull(mapper, "mapper is null"); return ofAll(toList().zipWith(that, mapper)); }
Source:
<code>public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { int numRetries = 0; <START> for ( ; ; ) { <END> try { putObjectTransferrer.transferItem(client, ds3Object); break; } catch (final Throwable t) { if(ExceptionClassifier.isUnrecoverableException(t) || ++numRetries >= NUM_TIMES_TO_RETRY) { throw t; } } } }</code><technical_language>while(true) is clearer</technical_language>

Target:
public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { int numRetries = 0; while(true) { try { putObjectTransferrer.transferItem(client, ds3Object); break; } catch (final Throwable t) { if (ExceptionClassifier.isUnrecoverableException(t) || ++numRetries >= NUM_TIMES_TO_RETRY) { throw t; } } } }
Source:
<code>public void transferFileDockerDaemon() { <START> GenericContainer container = new GenericContainer( <END> new ImageFromDockerfile() .withDockerfileFromBuilder(builder -> builder.from("alpine:3.3") .copy("bar", "/foo/") .cmd("ls", "-al", "/foo") .build() ).withFileFromFile("bar", new File("src/test/resources/mappable-resource/test-resource.txt"), 0754)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()); container.start(); String listing = container.getLogs(); assertThat("Listing shows that file is copied.", Arrays.asList(listing.split("\\n")), exactlyNItems(1, allOf(containsString("-rwxr-xr--"), containsString("bar")))); }</code><technical_language>please try-with-resources</technical_language>

Target:
public void transferFileDockerDaemon() { final File theFile = new File("src/test/resources/mappable-resource/test-resource.txt"); try (GenericContainer container = new GenericContainer( new ImageFromDockerfile() .withDockerfileFromBuilder(builder -> builder.from("alpine:3.3") .copy(".", "/foo/") .cmd("ls", "-al", "/foo") .build() ).withFileFromFile("bar1", theFile) .withFileFromFile("./bar2", theFile) .withFileFromFile("../bar3", theFile) .withFileFromFile(".bar4", theFile) .withFileFromFile("..bar5", theFile) .withFileFromFile("xxx/../bar6", theFile) .withFileFromFile("x7/./bar7", theFile) .withFileFromFile("x8/././bar8", theFile) .withFileFromFile("x9/../../bar9", theFile)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy())) { container.start(); final List<String> logLines = Arrays.asList(container.getLogs().split("\\n")); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar1"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar2"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar3"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" .bar4"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" ..bar5"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar6"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" x7"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" x8"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar9"))); } }
Source:
<code><START> public boolean handleApiPersistentConnection(HttpMessage msg, <END> HttpInputStream httpIn, HttpOutputStream httpOut, String name, JSONObject params) throws ApiException { throw new ApiException(ApiException.Type.BAD_PCONN, name); }</code><technical_language>This changed return void now</technical_language>

Target:
public void handleApiPersistentConnection(HttpMessage msg, HttpInputStream httpIn, HttpOutputStream httpOut, String name, JSONObject params) throws ApiException { throw new ApiException(ApiException.Type.BAD_PCONN, name); }
Source:
<code>protected Map[] getVmInfo(List<String> vmsToUpdate) { VDS vds = new VDS(); vds.setId(vdsManager.getVdsId()); return (Map[]) (getResourceManager().runVdsCommand(VDSCommandType.FullList, <START> new FullListVDSCommandParameters(vds, vmsToUpdate)).getReturnValue()); <END> }</code><technical_language>i is a difference in case of failure, calling execute throw exception in case of failure, calling runVdsCommand not</technical_language>

Target:
protected Map[] getVmInfo(List<String> vmsToUpdate) { VDS vds = new VDS(); vds.setId(vdsManager.getVdsId()); Map[] result = {}; try { VDSReturnValue vdsReturnValue = getResourceManager().runVdsCommand(VDSCommandType.FullList, new FullListVDSCommandParameters(vds, vmsToUpdate)); if (vdsReturnValue.getSucceeded()) { result = (Map[]) (vdsReturnValue.getReturnValue()); } } catch (Exception e) { } return result; }
Source:
<code>public boolean poll(MessageHandler handler) { Message<?> message = this.source.receive(); if (message == null) { return false; } AcknowledgmentCallback ackCallback = StaticMessageHeaderAccessor .getAcknowledgmentCallback(message); try { if (this.retryTemplate == null && this.errorChannel == null) { setAttributesIfNecessary(message); doHandleMessage(handler, message); } else if (this.retryTemplate == null) { try { setAttributesIfNecessary(message); doHandleMessage(handler, message); } catch (Exception e) { this.messagingTemplate.send(this.errorMessageStrategy.buildErrorMessage(e, null)); return false; } } else { this.retryTemplate.execute(context -> { setAttributesIfNecessary(message); doHandleMessage(handler, message); return null; }, this.recoveryCallback); } AckUtils.autoAck(ackCallback); return true; } catch (Exception e) { AckUtils.autoNack(ackCallback); <START> throw (MessageHandlingException) e; <END> } }</code><technical_language>do this instead of catch(. . ): finally { if (!ackCallback.isAcknowledged()) { AckUtils.autoNack(ackCallback); } . .</technical_language>

Target:
public boolean poll(MessageHandler handler) { Message<?> message = this.source.receive(); if (message == null) { return false; } AcknowledgmentCallback ackCallback = StaticMessageHeaderAccessor .getAcknowledgmentCallback(message); try { if (this.retryTemplate == null && this.errorChannel == null) { setAttributesIfNecessary(message); doHandleMessage(handler, message); } else if (this.retryTemplate == null) { try { setAttributesIfNecessary(message); doHandleMessage(handler, message); } catch (Exception e) { if (this.errorChannel != null) { this.messagingTemplate.send(this.errorChannel, this.errorMessageStrategy.buildErrorMessage(e, attributesHolder.get())); } else { throw e; } } } else { this.retryTemplate.execute(context -> { setAttributesIfNecessary(message); doHandleMessage(handler, message); return null; }, this.recoveryCallback); } return true; } catch (Exception e) { AckUtils.autoNack(ackCallback); if (e instanceof MessageHandlingException && ((MessageHandlingException) e).getFailedMessage().equals(message)) { throw (MessageHandlingException) e; } throw new MessageHandlingException(message, e); } finally { AckUtils.autoAck(ackCallback); } }
Source:
<code>public void setFooterView(View footer) { <START> mList.addFooterView(footer); <END> mList.invalidate(); }</code><technical_language>Check user clicks item (the info), is highlighted others because, maybe, is a good behaviour</technical_language>

Target:
public void setFooterView(View footer) { mList.addFooterView(footer, null, false); mList.invalidate(); }
Source:
<code>public Response createFromYaml( String data, @ApiParam(value = "Provide extended validation messages") @DefaultValue("false") @QueryParam("verbose") boolean verbose) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { WorkspaceConfigImpl workspaceConfig; try { workspaceConfig = devfileManager.validateAndConvert(data, verbose); } catch (DevfileFormatException e) { throw new BadRequestException(e.getMessage()); } catch (JsonProcessingException e) { throw new ServerException(e.getMessage()); } <START> final String namespace = EnvironmentContext.getCurrent().getSubject().getUserName(); <END> WorkspaceImpl workspace = workspaceManager.createWorkspace(findAvailableName(workspaceConfig), namespace, emptyMap()); return Response.status(201) .entity(asDto(workspace).withLinks(linksGenerator.genLinks(workspace, getServiceContext()))) .build(); }</code><technical_language>DevfileManager I move business logic is done DevfileService. DevfileService REST API specific stuffs: parse parameters, write response, map exception REST errors, resolve logged in user for manager. I in case manager perform: creating workspace in this method, fetching workspace converting Devilfe in createFromWorkspace method</technical_language>

Target:
public Response createFromYaml( String data, @ApiParam(value = "Provide extended validation messages") @DefaultValue("false") @QueryParam("verbose") boolean verbose) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { WorkspaceImpl workspace; try { Devfile devfile = devfileManager.parse(data, verbose); workspace = devfileManager.createWorkspace(devfile); } catch (DevfileFormatException e) { throw new BadRequestException(e.getMessage()); } catch (JsonProcessingException e) { throw new ServerException(e.getMessage()); } return Response.status(201) .entity(asDto(workspace).withLinks(linksGenerator.genLinks(workspace, getServiceContext()))) .build(); }
Source:
<code>public void run() { try { double value = getSafely(); if (justReset) { synchronized (justReset) { justReset = false; <START> } <END> return; } if (output != null && isEnabled()) { output.pidWrite(value); } } catch (Exception e) { mcException = e; } }</code><technical_language>Checking of a synchronized context, SETTING in synchronized context???????</technical_language>

Target:
public void run() { try { double value = getSafely(); synchronized (lock) { if (justReset) { justReset = false; return; } } if (output != null && isEnabled()) { output.pidWrite(value); } } catch (Exception e) { sensorException = e; } }
Source:
<code>public int[] getDefaultJavadocTokens() { return new int[] { <START> JavadocTokenTypes.JAVADOC, <END> }; }</code><technical_language>(not related this issue) AutomaticBean issue a warning a deprecated property is in configuration</technical_language>

Target:
public int[] getDefaultJavadocTokens() { return getRequiredJavadocTokens(); }
Source:
<code>VertxOptionsImpl(JsonObject json) { this.proxyOperationTimeout = json.getInteger("proxyOperationTimeout", DEFAULT_PROXYOPERATIONTIMEOUT); this.eventLoopPoolSize = json.getInteger("eventLoopPoolSize", DEFAULT_EVENTLOOPPOOLSIZE); this.workerPoolSize = json.getInteger("workerPoolSize", DEFAULT_WORKERPOOLSIZE); this.clustered = json.getBoolean("clustered", DEFAULT_CLUSTERED); this.clusterHost = json.getString("clusterHost", DEFAULT_CLUSTERHOST); this.clusterPort = json.getInteger("clusterPort", DEFAULT_CLUSTERPORT); this.internalBlockingPoolSize = json.getInteger("internalBlockingPoolSize", DEFAULT_INTERNALBLOCKINGPOOLSIZE); this.blockedThreadCheckPeriod = json.getLong("blockedThreadCheckPeriod", DEFAULT_BLOCKEDTHREADCHECKPERIOD); this.maxEventLoopExecuteTime = json.getLong("maxEventLoopExecuteTime", DEFAULT_MAXEVENTLOOPEXECUTETIME); this.maxWorkerExecuteTime = json.getLong("maxWorkerExecuteTime", DEFAULT_MAXWORKEREXECUTETIME); this.haEnabled = json.getBoolean("haEnabled", false); this.quorumSize = json.getInteger("quorumSize", DEFAULT_QUORUMSIZE); this.haGroup = json.getString("haGroup", null); this.metricsEnabled = json.getBoolean("metricsEnabled", DEFAULT_METRICS_ENABLED); <START> this.jmxEnabled = json.getBoolean("jmxEnabled", DEFAULT_METRICS_ENABLED); <END> this.jmxDomain = json.getString("jmxDomain"); }</code><technical_language>DEFAULT_JMX_ENABLED</technical_language>

Target:
VertxOptionsImpl(JsonObject json) { this.proxyOperationTimeout = json.getInteger("proxyOperationTimeout", DEFAULT_PROXYOPERATIONTIMEOUT); this.eventLoopPoolSize = json.getInteger("eventLoopPoolSize", DEFAULT_EVENTLOOPPOOLSIZE); this.workerPoolSize = json.getInteger("workerPoolSize", DEFAULT_WORKERPOOLSIZE); this.clustered = json.getBoolean("clustered", DEFAULT_CLUSTERED); this.clusterHost = json.getString("clusterHost", DEFAULT_CLUSTERHOST); this.clusterPort = json.getInteger("clusterPort", DEFAULT_CLUSTERPORT); this.internalBlockingPoolSize = json.getInteger("internalBlockingPoolSize", DEFAULT_INTERNALBLOCKINGPOOLSIZE); this.blockedThreadCheckPeriod = json.getLong("blockedThreadCheckPeriod", DEFAULT_BLOCKEDTHREADCHECKPERIOD); this.maxEventLoopExecuteTime = json.getLong("maxEventLoopExecuteTime", DEFAULT_MAXEVENTLOOPEXECUTETIME); this.maxWorkerExecuteTime = json.getLong("maxWorkerExecuteTime", DEFAULT_MAXWORKEREXECUTETIME); this.haEnabled = json.getBoolean("haEnabled", false); this.quorumSize = json.getInteger("quorumSize", DEFAULT_QUORUMSIZE); this.haGroup = json.getString("haGroup", null); this.metricsEnabled = json.getBoolean("metricsEnabled", DEFAULT_METRICS_ENABLED); this.jmxEnabled = json.getBoolean("jmxEnabled", DEFAULT_JMX_ENABLED); this.jmxDomain = json.getString("jmxDomain"); }
Source:
<code>public void shouldReturnStatsSections_givenStatsSectionParameter() { List<String> nonStatsProperties = ALL_PROPERTIES; <START> nonStatsProperties.removeAll(STATS_PROPERTIES); <END> String actualResult = jedis.info("stats"); assertThat(actualResult).contains(STATS_PROPERTIES); assertThat(actualResult).doesNotContain(nonStatsProperties); }</code><technical_language>This is modify ALL_PROPERTIES nonStatsProperties is a reference. suggest making ALL_PROPERTIES immutable .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); evident need a copy other places this is happening</technical_language>

Target:
public void shouldReturnStatsSections_givenStatsSectionParameter() { List<String> nonStatsProperties = new ArrayList<>(ALL_PROPERTIES); nonStatsProperties.removeAll(STATS_PROPERTIES); String actualResult = jedis.info("stats"); assertThat(actualResult).contains(STATS_PROPERTIES); assertThat(actualResult).doesNotContain(nonStatsProperties); }
Source:
<code><START> @Test public void testPrefixList() { this.roundtrip("[] a"); } <END></code><technical_language>roundtrip("[] a") succeed? I expect "[] a" out special cased haskell type "[a]"</technical_language>

Target:
@Test public void testPrefixList() { this.convert("[] a", "[a]"); }
Source:
<code>public Payload payload() { Payload p = new Payload(); <START> p.last_request_metrics = this; <END> return p; }</code><technical_language>I this a memory leak holding indefinite chain of references, GC garbage collect request metrics objects. create a new request metrics payload is a copy of current</technical_language>

Target:
public ClientTelemetryPayload payload() { ClientTelemetryPayload p = new ClientTelemetryPayload(); p.lastRequestMetrics = this; return p; }
Source:
<code>public Collection<ConfigStatusMessage> getConfigStatus() { logger.debug("IP configuration check started."); ConfigStatusInfo configStatus = new ConfigStatusInfo(); ConfigStatusMessage.Builder errBuilder = ConfigStatusMessage.Builder.error(HOST); final String bridgeIpAddress = (String) getThing().getConfiguration().get(HOST); if (bridgeIpAddress == null) { logger.error("No IP address has been provided."); <START> configStatus.add(errBuilder.withMessageKey(HueConfigStatusMessage.CONFIG_STATUS_ERROR_PREFIX <END> + HueConfigStatusMessage.IP_ADDRESS_MISSING.getCode()).build()); return configStatus.getConfigStatusMessages(); } if (!isReachable()) { logger.error("The bridge is not responding and is not reachable on {}.", bridgeIpAddress); configStatus.add(errBuilder.withMessageKey(HueConfigStatusMessage.CONFIG_STATUS_ERROR_PREFIX + HueConfigStatusMessage.BRIDGE_NOT_RESPONDING.getCode()).build()); return configStatus.getConfigStatusMessages(); } return configStatus.getConfigStatusMessages(); }</code><technical_language>introducing a method "getMessageKey" for HueConfigStatusMessage? HostConfigStatusMessage.IP_ADDRESS_MISSING.getMessageKey() instead of building prefix + code usage</technical_language>

Target:
public Collection<ConfigStatusMessage> getConfigStatus() { final String bridgeIpAddress = (String) getThing().getConfiguration().get(HOST); Collection<ConfigStatusMessage> configStatusMessages; if (bridgeIpAddress == null || bridgeIpAddress.isEmpty()) { configStatusMessages = Collections.singletonList(ConfigStatusMessage.Builder.error(HOST) .withMessageKeySuffix(HueConfigStatusMessage.IP_ADDRESS_MISSING.getMessageKey()).withArguments(HOST) .build()); } else { configStatusMessages = Collections.emptyList(); } return configStatusMessages; }
Source:
<code>private static void readSliceBlocks(final int major, final Slice slice, final InputStream inputStream) throws IOException { slice.external = new HashMap<>(); for (int i = 0; i < slice.nofBlocks; i++) { final Block block = Block.read(major, inputStream); switch (block.getContentType()) { case CORE: slice.coreBlock = block; break; case EXTERNAL: <START> final ExternalDataBlock extBlock = (ExternalDataBlock) block; <END> if (slice.embeddedRefBlockContentID == extBlock.getContentId()) { slice.embeddedRefBlock = extBlock; } slice.external.put(extBlock.getContentId(), extBlock); break; default: throw new RuntimeException("Not a slice block, content type id " + block.getContentType().name()); } } }</code><technical_language>This require a cast I think</technical_language>

Target:
private static void readSliceBlocks(final int major, final Slice slice, final InputStream inputStream) throws IOException { slice.external = new HashMap<>(); for (int i = 0; i < slice.nofBlocks; i++) { final Block block = Block.read(major, inputStream); switch (block.getContentType()) { case CORE: slice.coreBlock = block; break; case EXTERNAL: if (slice.embeddedRefBlockContentID == block.getContentId()) { slice.embeddedRefBlock = block; } slice.external.put(block.getContentId(), block); break; default: throw new RuntimeException("Not a slice block, content type id " + block.getContentType().name()); } } }
Source:
<code>private void writeSRC(GridCoverage2D gc, final String name, Object dest) throws FileNotFoundException, IOException { ImageOutputStream out = null; RenderedImage image = gc.getRenderedImage(); if (dest instanceof File) { <START> <END> final File file = new File((File) dest, new StringBuffer(name).append(".SRC").toString()); out = ImageIOExt.createImageOutputStream(image, file); } else { Utilities.isZipSlipVulnerable(gc.getName().toString()); final ZipOutputStream outZ = (ZipOutputStream) dest; final ZipEntry e = new ZipEntry(gc.getName().toString() + ".SRC"); outZ.putNextEntry(e); out = ImageIOExt.createImageOutputStream(image, outZ); } out.setByteOrder(java.nio.ByteOrder.BIG_ENDIAN); image = untileImage(image); final ParameterBlockJAI pbj = new ParameterBlockJAI("imagewrite"); pbj.addSource(image); pbj.setParameter("Format", "raw"); pbj.setParameter("Output", out); JAI.create("ImageWrite", pbj); out.flush(); out.close(); if (dest instanceof ZipOutputStream) { ((ZipOutputStream) dest).closeEntry(); } }</code><technical_language>changing/adding newlines seems? Avoid</technical_language>

Target:
private void writeSRC(GridCoverage2D gc, final String name, Object dest) throws FileNotFoundException, IOException { ImageOutputStream out = null; RenderedImage image = gc.getRenderedImage(); if (dest instanceof File) { final File file = new File((File) dest, new StringBuffer(name).append(".SRC").toString()); out = ImageIOExt.createImageOutputStream(image, file); } else { Utilities.assertNotZipSlipVulnerable(gc.getName().toString()); final ZipOutputStream outZ = (ZipOutputStream) dest; final ZipEntry e = new ZipEntry(gc.getName().toString() + ".SRC"); outZ.putNextEntry(e); out = ImageIOExt.createImageOutputStream(image, outZ); } out.setByteOrder(java.nio.ByteOrder.BIG_ENDIAN); image = untileImage(image); final ParameterBlockJAI pbj = new ParameterBlockJAI("imagewrite"); pbj.addSource(image); pbj.setParameter("Format", "raw"); pbj.setParameter("Output", out); JAI.create("ImageWrite", pbj); out.flush(); out.close(); if (dest instanceof ZipOutputStream) { ((ZipOutputStream) dest).closeEntry(); } }
Source:
<code>public void theSetAdministrativeStatusRequestIsReceived(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<>(); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); <START> settings.put(PlatformSmartmeteringKeys.ADMINISTRATIVE_STATUS_TYPE, <END> requestData.get(PlatformSmartmeteringKeys.ADMINISTRATIVE_STATUS_TYPE)); final SetAdministrativeStatusRequest setAdministrativeStatusRequest = SetAdministrativeStatusRequestFactory .fromParameterMap(settings); final SetAdministrativeStatusAsyncResponse setAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient .setAdministrativeStatus(setAdministrativeStatusRequest); LOGGER.info("Set administrative status response is received {}", setAdministrativeStatusAsyncResponse); assertNotNull("Set administrative status response should not be null", setAdministrativeStatusAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAdministrativeStatusAsyncResponse.getCorrelationUid()); }</code><technical_language>requestData administrative data parameter set, if not, add in scenario</technical_language>

Target:
public void theSetAdministrativeStatusRequestIsReceived(final Map<String, String> requestData) throws Throwable { final SetAdministrativeStatusRequest setAdministrativeStatusRequest = SetAdministrativeStatusRequestFactory .fromParameterMap(requestData); final SetAdministrativeStatusAsyncResponse setAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient .setAdministrativeStatus(setAdministrativeStatusRequest); LOGGER.info("Set administrative status response is received {}", setAdministrativeStatusAsyncResponse); assertNotNull("Set administrative status response should not be null", setAdministrativeStatusAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAdministrativeStatusAsyncResponse.getCorrelationUid()); }
Source:
<code>public Filter(String name, Map<String, String> parameters) { this.name = name; this.parameters = parameters; <START> } <END></code><technical_language>I of constructors provide examples of querystring's construct</technical_language>

Target:
public Filter(String name, Map<String, String> parameters) { this.name = name; ImmutableMap.Builder builder = new ImmutableMap.Builder<String, String>(); builder.putAll(parameters); this.parameters = builder.build(); }
Source:
<code>public String getText() { CharSequence[] typeNames = new String[getTypeList().size()]; for (int i = 0; i < getTypeList().size(); i++) { typeNames[i] = getTypeList().get(i).getText(); } <START> return String.join(", ", typeNames); <END> }</code><technical_language>avoid java 1.8 methods, reimplement StringUtil</technical_language>

Target:
public String getText() { return StringUtil.join(getTypeList(), GoPsiImplUtil.GET_TEXT_FUNCTION, ", "); }
Source:
<code><START> TransformerFactory secure_processing_true() { <END> TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.ACCESS_EXTERNAL_DTD, true); return factory; }</code><technical_language>line 63 this is setFeature, removed</technical_language>

Target:
TransformerFactory secure_processing_true() { TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); return factory; }
Source:
<code>public boolean repositoryAccessable(URL url) { if (url.toString().contains("svn.jboss.org")) { Utils.logWarnMessage(LOG, "svn repository : " + url + " is not supported."); return false; } RepositoryId id = RepositoryId.createFromUrl(url); RepositoryService rs = new RepositoryService(gitHubClient); try { rs.getBranches(id); } catch (IOException e) { Utils.logWarnMessage(LOG, <START> "repository : " + url + " is not accessable, check repository link and your account permission."); <END> return false; } return true; }</code><technical_language>I this if logged IOException and/or cause, user reason (HTTP code) of repository accessible</technical_language>

Target:
public boolean repositoryAccessable(URL url) { if (url.toString().contains("svn.jboss.org")) { Utils.logWarnMessage(LOG, "svn repository : " + url + " is not supported."); return false; } RepositoryId id = RepositoryId.createFromUrl(url); RepositoryService rs = new RepositoryService(gitHubClient); try { rs.getBranches(id); } catch (IOException e) { Utils.logWarnMessage(LOG, "repository : " + url + " is not accessable due to " + e.getMessage() + ". Check repository link and your account permission."); return false; } return true; }
Source:
<code>public Payload getPayload() { <START> return new SelfDescribingJson(TrackerConstants.APPLICATION_ERROR_SCHEMA, getData()); <END> }</code><technical_language>in minds this is correct schema for this if create a new one. application_crash schema created report applications tracker throw unhandled exceptions, in this case allowing customers turn diagnostics allow tracker emit log events - application crashed this inflate users crash statistics if counting this event type. I if a new iglu central schema more descriptive here, tracker_log tracker_diagnostic</technical_language>

Target:
public Payload getPayload() { return new SelfDescribingJson(TrackerConstants.SCHEMA_DIAGNOSTIC_ERROR, getData()); }
Source:
<code>public Set<String> getContentTypes() { <START> return new TreeSet<String>(contentTypeToTemplateEngineMap.keySet()); <END> }</code><technical_language>ImmutableSet.copyOf(contentTypeToTemplateEngineMap.keySet()); sense imho..</technical_language>

Target:
public Set<String> getContentTypes() { return ImmutableSet.copyOf(contentTypeToTemplateEngineMap.keySet()); }
Source:
<code>private void handleEndActionJobAndStep() { if (!hasTaskHandlers() || getExecutionIndex() == getTaskHandlers().size() - 1) { <START> if (!parentHasCallback() || getExecutionContext().getExecutionMethod() == ExecutionMethod.AsStep) { <END> startFinalizingStep(); } } }</code><technical_language>'if' needed - conditions added outer 'if'</technical_language>

Target:
private void handleEndActionJobAndStep() { if ((!hasTaskHandlers() || getExecutionIndex() == getTaskHandlers().size() - 1) && (!parentHasCallback() || getExecutionContext().getExecutionMethod() == ExecutionMethod.AsStep)) { startFinalizingStep(); } }
Source:
<code>public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); checkWorkspaceIsRunningOrStarting(workspace); if (!workspace.isTemporary()) { workspace.getAttributes().put(STOPPED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspace.getAttributes().put(STOPPED_ABNORMALLY_ATTRIBUTE_NAME, Boolean.toString(false)); workspaceDao.update(workspace); } String namespace = workspace.getAttributes().get(WORKSPACE_INFRASTRUCTURE_NAMESPACE_ATTRIBUTE); final String owner = workspace.getRuntime().getOwner(); runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { removeWorkspaceQuietly(workspace.getId()); } <START> if (!runtimes.isAnyActive()) { <END> recordLastWorkspaceStoppedTime(namespace, workspace.getId(), owner); } }); }</code><technical_language>records stopped time if workspaces stopped? user's workspaces</technical_language>

Target:
public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); checkWorkspaceIsRunningOrStarting(workspace); if (!workspace.isTemporary()) { workspace.getAttributes().put(STOPPED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspace.getAttributes().put(STOPPED_ABNORMALLY_ATTRIBUTE_NAME, Boolean.toString(false)); workspaceDao.update(workspace); } String namespace = workspace.getAttributes().get(WORKSPACE_INFRASTRUCTURE_NAMESPACE_ATTRIBUTE); final String owner = workspace.getRuntime().getOwner(); runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { removeWorkspaceQuietly(workspace.getId()); } try { if (runtimes.getActive(owner).isEmpty()) { recordLastWorkspaceStoppedTime(namespace, owner); } } catch (ServerException | InfrastructureException e) { LOG.error(e.getMessage(), e); } }); }
Source:
<code>private void parseAuthority(boolean forceServer) throws URISyntaxException { if (authority == null) { return; } String tempUserInfo = null; String temp = authority; int index = temp.indexOf('@'); int hostIndex = 0; if (index != -1) { tempUserInfo = temp.substring(0, index); validateUserInfo(authority, tempUserInfo, 0); temp = temp.substring(index + 1); hostIndex = index + 1; } index = temp.lastIndexOf(':'); int endIndex = temp.indexOf(']'); String tempHost; int tempPort = -1; if (index != -1 && endIndex < index) { tempHost = temp.substring(0, index); if (index < (temp.length() - 1)) { try { char firstPortChar = temp.charAt(index + 1); <START> if ('0' <= firstPortChar && firstPortChar <= '9') { <END> tempPort = Integer.parseInt(temp.substring(index + 1)); } else { if (forceServer) { throw new URISyntaxException(authority, "Invalid port number", hostIndex + index + 1); } return; } } catch (NumberFormatException e) { if (forceServer) { throw new URISyntaxException(authority, "Invalid port number", hostIndex + index + 1); } return; } } } else { tempHost = temp; } if (tempHost.isEmpty()) { if (forceServer) { throw new URISyntaxException(authority, "Expected host", hostIndex); } return; } if (!isValidHost(forceServer, tempHost)) { return; } userInfo = tempUserInfo; host = tempHost; port = tempPort; serverAuthority = true; }</code><technical_language>write this normal round? (x >= A && x <= B)? non-ASCII digits allowed for port numbers? i.e. this if (!Character.isDigit(temp.charAt(index + 1)) instead</technical_language>

Target:
private void parseAuthority(boolean forceServer) throws URISyntaxException { if (authority == null) { return; } String tempUserInfo = null; String temp = authority; int index = temp.indexOf('@'); int hostIndex = 0; if (index != -1) { tempUserInfo = temp.substring(0, index); validateUserInfo(authority, tempUserInfo, 0); temp = temp.substring(index + 1); hostIndex = index + 1; } index = temp.lastIndexOf(':'); int endIndex = temp.indexOf(']'); String tempHost; int tempPort = -1; if (index != -1 && endIndex < index) { tempHost = temp.substring(0, index); if (index < (temp.length() - 1)) { try { char firstPortChar = temp.charAt(index + 1); if (firstPortChar >= '0' && firstPortChar <= '9') { tempPort = Integer.parseInt(temp.substring(index + 1)); } else { if (forceServer) { throw new URISyntaxException(authority, "Invalid port number", hostIndex + index + 1); } return; } } catch (NumberFormatException e) { if (forceServer) { throw new URISyntaxException(authority, "Invalid port number", hostIndex + index + 1); } return; } } } else { tempHost = temp; } if (tempHost.isEmpty()) { if (forceServer) { throw new URISyntaxException(authority, "Expected host", hostIndex); } return; } if (!isValidHost(forceServer, tempHost)) { return; } userInfo = tempUserInfo; host = tempHost; port = tempPort; serverAuthority = true; }
Source:
<code>public <V> Map<K, V> getNextTrainingData() { final List<K> nextTrainingDataKeyList; synchronized (this) { if (trainingDataKeys.isEmpty()) { LOG.log(Level.INFO, "no more training data for current epoch"); return Collections.emptyMap(); } nextTrainingDataKeyList = new ArrayList<>( trainingDataKeys.subList(0, Math.min(miniBatchSize, trainingDataKeys.size()))); trainingDataKeys.removeAll(nextTrainingDataKeyList); } final Map<K, V> nextTrainingData = new HashMap<>(); for (final K key : nextTrainingDataKeyList) { final Pair<K, V> keyValuePair = memoryStore.get(key); if (keyValuePair == null) { continue; } nextTrainingData.put(keyValuePair.getFirst(), keyValuePair.getSecond()); } LOG.log(Level.INFO, "Size of training data for next mini-batch: {0}", nextTrainingData.size()); if (nextTrainingDataKeyList.size() != nextTrainingData.size()) { LOG.log(Level.INFO, "The number of assigned data keys for next mini-batch is {0}," + " but ths size of actually prepared training data is {1}", new Object[]{nextTrainingDataKeyList.size(), nextTrainingData.size()}); } <START> <END> return nextTrainingData; }</code><technical_language>'<V>' removed method signature of getNextTrainingData()</technical_language>

Target:
public Map<K, V> getNextTrainingData() { final List<K> nextTrainingDataKeyList; synchronized (this) { if (trainingDataKeys.isEmpty()) { LOG.log(Level.INFO, "no more training data for current epoch"); return Collections.emptyMap(); } nextTrainingDataKeyList = new ArrayList<>( trainingDataKeys.subList(0, Math.min(miniBatchSize, trainingDataKeys.size()))); trainingDataKeys.removeAll(nextTrainingDataKeyList); } final Map<K, V> nextTrainingData = new HashMap<>(); for (final K key : nextTrainingDataKeyList) { final Pair<K, V> keyValuePair = memoryStore.get(key); if (keyValuePair == null) { continue; } nextTrainingData.put(keyValuePair.getFirst(), keyValuePair.getSecond()); } LOG.log(Level.INFO, "Size of training data for next mini-batch: {0}", nextTrainingData.size()); if (nextTrainingDataKeyList.size() != nextTrainingData.size()) { LOG.log(Level.INFO, "The number of assigned data keys for next mini-batch is {0}," + " but ths size of actually prepared training data is {1}", new Object[]{nextTrainingDataKeyList.size(), nextTrainingData.size()}); } return nextTrainingData; }
Source:
<code>public void shutdown() { this.containerModel.getTasks().forEach((taskName, taskModel) -> getNonSideInputStores(taskName).forEach((storeName, store) -> store.stop()) ); if (sideInputsPresent()) { this.shouldShutdown = true; <START> sideInputsReadExecutor.shutdown(); <END> this.sideInputSystemConsumers.stop(); sideInputsFlushFuture.cancel(false); sideInputsFlushExecutor.shutdown(); try { sideInputsFlushExecutor.awaitTermination(SIDE_INPUT_FLUSH_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new SamzaException("Exception while shutting down side inputs", e); } this.getSideInputStorageManagers().forEach(sideInputStorageManager -> sideInputStorageManager.stop()); } LOG.info("Shutdown complete"); }</code><technical_language>executor.shutdownNow() likewise; for flush executor</technical_language>

Target:
public void shutdown() { this.containerModel.getTasks().forEach((taskName, taskModel) -> getNonSideInputStores(taskName).forEach((storeName, store) -> store.stop()) ); this.shouldShutdown = true; if (sideInputsPresent()) { sideInputsReadExecutor.shutdownNow(); this.sideInputSystemConsumers.stop(); sideInputsFlushFuture.cancel(false); sideInputsFlushExecutor.shutdown(); try { sideInputsFlushExecutor.awaitTermination(SIDE_INPUT_FLUSH_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new SamzaException("Exception while shutting down sideInputs", e); } this.getSideInputStorageManagers().forEach(sideInputStorageManager -> sideInputStorageManager.stop()); } LOG.info("Shutdown complete"); }
Source:
<code>public synchronized void setCrlByUrlEnabled(boolean crlByUrlEnabled) { if (this.crlByUrlEnabled && !crlByUrlEnabled) { scheduler.schedule( <START> this::removeCrlFileLocationInPropertiesFile, INITIAL_DELAY, TimeUnit.MINUTES); <END> } this.crlByUrlEnabled = crlByUrlEnabled; }</code><technical_language>scheduler.submit() instead of scheduling a delay of 0 seconds</technical_language>

Target:
public synchronized void setCrlByUrlEnabled(boolean crlByUrlEnabled) { if (this.crlByUrlEnabled && !crlByUrlEnabled) { if (removalHandle != null) { removalHandle.cancel(false); } removalHandle = scheduler.submit(this::removeCrlFileLocationInPropertiesFile); } this.crlByUrlEnabled = crlByUrlEnabled; }