auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start(BundleContext bc) throws Exception { if (webDavHandler == null) { webDavHandler = WebDavHandler.getInstance(); } webDavHandler.setBundleContext(bc); webDavHandler.start(); }

Target:
public void start(BundleContext bc) throws Exception { webDavHandler = WebDavHandler.getInstance(); webDavHandler.setBundleContext(bc); webDavHandler.start(); }
Source:
public void reportMetric(final IMetric<?> metric) throws Exception { String gangliaCommand = buildCommand(metric); synchronized (metric) { Process emission = Runtime.getRuntime().exec(gangliaCommand); int exitCode = emission.waitFor(); if (exitCode != 0) { throw new RuntimeException("Failed to report metric using gmetric"); } } }

Target:
public void reportMetric(final IMetric<?> metric) throws MetricException { String gangliaCommand = buildCommand(metric); if (gangliaCommand != null) { try { Process emission = Runtime.getRuntime().exec(gangliaCommand); int exitCode; exitCode = emission.waitFor(); if (exitCode != 0) { throw new MetricException("Failed to report metric using gmetric"); } } catch (Exception e) { throw new MetricException("Failed to report metric using gmetric"); } } else { throw new MetricException("Failed to build ganglia Command"); } }
Source:
public void addLdapAuthentication(UserEntity userEntity, String dn, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.LDAP, StringUtils.lowerCase(dn), new Validator() { @Override public void validate(UserEntity userEntity, String key) throws AmbariException { List<UserAuthenticationEntity> authenticationEntities = userEntity.getAuthenticationEntities(); for (UserAuthenticationEntity entity : authenticationEntities) { if ((entity.getAuthenticationType() == UserAuthenticationType.LDAP) && ((key == null) ? (entity.getAuthenticationKey() == null) : key.equalsIgnoreCase(entity.getAuthenticationKey()))) { throw new AmbariException("The authentication type already exists for this user"); } } } }, persist); }

Target:
public void addLdapAuthentication(UserEntity userEntity, String dn, boolean persist) throws AmbariException { addAuthentication(userEntity, UserAuthenticationType.LDAP, StringUtils.lowerCase(dn), (user, key) -> { List<UserAuthenticationEntity> authenticationEntities = user.getAuthenticationEntities(); for (UserAuthenticationEntity entity : authenticationEntities) { if ((entity.getAuthenticationType() == UserAuthenticationType.LDAP) && ((key == null) ? (entity.getAuthenticationKey() == null) : key.equalsIgnoreCase(entity.getAuthenticationKey()))) { throw new AmbariException("The authentication type already exists for this user"); } } }, persist); }
Source:
public RequestBuilder<T> withPath(String path) { String cleanPath = path.startsWith("/") && path.endsWith("/") ? path.substring(1, path.length() - 1) : path.startsWith("/") ? path.substring(1) : path.endsWith("/") ? path.substring(0, path.length() - 1) : path; URL newBaseUrl = url(baseUrl + "/" + cleanPath); return new RequestBuilder<>(method, newBaseUrl, responseMapper, credentials, headers, body, multipartMessages); }

Target:
public RequestBuilder<T> withPath(String path) { int startOffset = path.startsWith("/") ? 1 : 0; int endOffset = path.endsWith("/") ? 1 : 0; String cleanPath = path.substring(startOffset, path.length() - endOffset); URL newBaseUrl = url(baseUrl + "/" + cleanPath); return new RequestBuilder<>(method, newBaseUrl, responseMapper, credentials, headers, body, multipartMessages); }
Source:
private void complete(String msg) { long durationMillis = System.currentTimeMillis() - creationTimeMillis; if (msg == null) { String duration = DurationFormatUtils.formatDurationWords(durationMillis,true, true); msg = String.format("Repair command #%d finished in %s", cmd, duration); } fireProgressEvent(new ProgressEvent(ProgressEventType.COMPLETE, progressCounter.get(), totalProgress, msg)); if (ActiveRepairService.instance.hasParentRepairSession(parentSession)) ActiveRepairService.instance.removeParentRepairSession(parentSession); Context ctx = context; if (options.isTraced() && ctx != null && ctx.traceState != null) { for (ProgressListener listener : listeners) ctx.traceState.removeProgressListener(listener); Tracing.instance.set(ctx.traceState); Tracing.traceRepair(msg); Tracing.instance.stopSession(); } Keyspace.open(keyspace).metric.repairTime.update(durationMillis, TimeUnit.MILLISECONDS); }

Target:
private void complete(String msg) { long durationMillis = System.currentTimeMillis() - creationTimeMillis; if (msg == null) { String duration = DurationFormatUtils.formatDurationWords(durationMillis, true, true); msg = String.format("Repair command #%d finished in %s", cmd, duration); } fireProgressEvent(new ProgressEvent(ProgressEventType.COMPLETE, progressCounter.get(), totalProgress, msg)); logger.info(msg); ActiveRepairService.instance.removeParentRepairSession(parentSession); TraceState localState = traceState; if (options.isTraced() && localState != null) { for (ProgressListener listener : listeners) localState.removeProgressListener(listener); Tracing.instance.set(localState); Tracing.traceRepair(msg); Tracing.instance.stopSession(); } Keyspace.open(keyspace).metric.repairTime.update(durationMillis, TimeUnit.MILLISECONDS); }
Source:
private String getSequenceNumberInternal(StreamPartition<String> partition, String shardIterator) { long timeoutMillis = System.currentTimeMillis() + fetchSequenceNumberTimeout; while (shardIterator != null && System.currentTimeMillis() < timeoutMillis) { if (closed) { log.info("KinesisRecordSupplier closed while fetching sequenceNumber"); return null; } GetRecordsResult recordsResult; try { recordsResult = kinesis.getRecords(new GetRecordsRequest().withShardIterator(shardIterator).withLimit(1000)); } catch (ProvisionedThroughputExceededException e) { try { Thread.sleep(PROVISIONED_THROUGHPUT_EXCEEDED_BACKOFF_MS); continue; } catch (InterruptedException e1) { log.warn(e1, "Thread interrupted!"); Thread.currentThread().interrupt(); break; } } List<Record> records = recordsResult.getRecords(); if (!records.isEmpty()) { return records.get(0).getSequenceNumber(); } shardIterator = recordsResult.getNextShardIterator(); } if (shardIterator == null) { log.info("Partition[%s] returned a null shard iterator, is the shard closed?", partition.getPartitionId()); return OrderedPartitionableRecord.END_OF_SHARD_MARKER; } log.warn( "timed out while trying to fetch position for shard[%s], likely no more records in shard", partition.getPartitionId() ); return null; }

Target:
private String getSequenceNumberInternal(StreamPartition<String> partition, String shardIterator) { long timeoutMillis = System.currentTimeMillis() + fetchSequenceNumberTimeout; while (shardIterator != null && System.currentTimeMillis() < timeoutMillis) { if (closed) { log.info("KinesisRecordSupplier closed while fetching sequenceNumber"); return null; } GetRecordsResult recordsResult; try { recordsResult = kinesis.getRecords(new GetRecordsRequest().withShardIterator(shardIterator).withLimit(1000)); } catch (ProvisionedThroughputExceededException e) { log.warn( e, "encountered ProvisionedThroughputExceededException while fetching records, this means " + "that the request rate for the stream is too high, or the requested data is too large for " + "the available throughput. Reduce the frequency or size of your requests. Consider increasing " + "the number of shards to increase throughput." ); try { Thread.sleep(PROVISIONED_THROUGHPUT_EXCEEDED_BACKOFF_MS); continue; } catch (InterruptedException e1) { log.warn(e1, "Thread interrupted!"); Thread.currentThread().interrupt(); break; } } List<Record> records = recordsResult.getRecords(); if (!records.isEmpty()) { return records.get(0).getSequenceNumber(); } shardIterator = recordsResult.getNextShardIterator(); } if (shardIterator == null) { log.info("Partition[%s] returned a null shard iterator, is the shard closed?", partition.getPartitionId()); return KinesisSequenceNumber.END_OF_SHARD_MARKER; } log.warn( "timed out while trying to fetch position for shard[%s], likely no more records in shard", partition.getPartitionId() ); return null; }
Source:
public ClientBuilder setPrivateKey(PrivateKey privateKey) { if (isOAuth2Flow()) { Assert.notNull(privateKey, "Missing privateKeyFile"); String encodedString = "-----BEGIN PRIVATE KEY-----\n"; encodedString = encodedString + Base64.getEncoder().encodeToString(privateKey.getEncoded()) + "\n"; encodedString = encodedString + "-----END PRIVATE KEY-----\n"; this.clientConfig.setPrivateKey(encodedString); } return this; }

Target:
public ClientBuilder setPrivateKey(PrivateKey privateKey) { if (isOAuth2Flow()) { Assert.notNull(privateKey, "Missing privateKeyFile"); String algorithm = privateKey.getAlgorithm(); if (algorithm.equals("RSA")) { String encodedString = ConfigUtil.RSA_PRIVATE_KEY_HEADER + "\n" + Base64.getEncoder().encodeToString(privateKey.getEncoded()) + "\n" + ConfigUtil.RSA_PRIVATE_KEY_FOOTER; this.clientConfig.setPrivateKey(encodedString); } else if(algorithm.equals("EC")) { String encodedString = ConfigUtil.EC_PRIVATE_KEY_HEADER + "\n" + Base64.getEncoder().encodeToString(privateKey.getEncoded()) + "\n" + ConfigUtil.EC_PRIVATE_KEY_FOOTER; this.clientConfig.setPrivateKey(encodedString); } else { throw new IllegalArgumentException("Supplied privateKey is not an RSA or EC key - " + algorithm); } } return this; }
Source:
public void start() { super.workerPool = new TestWorkerService(numWorkerThreads); super.start(); try { Thread.sleep(50); } catch (Exception e){ } LOG.info("numWorkerThreads in Test is {}", numWorkerThreads); }

Target:
public void start() { super.workerPool = new TestWorkerService(numWorkerThreads); super.start(); Thread.State state = super.getState(); while (state != State.WAITING) { try { Thread.sleep(50); } catch (Exception e){ } state = super.getState(); } LOG.info("numWorkerThreads in Test is {}", numWorkerThreads); }
Source:
public void testNestedClass_284665() throws Exception { ICPPClassType b0 = getBindingFromASTName("B {", 1, ICPPClassType.class); assertFalse(b0 instanceof IIndexBinding); ICPPConstructor b1 = getBindingFromASTName("B(int x)", 1, ICPPConstructor.class); assertFalse(b1 instanceof IIndexBinding); ICPPClassType b2 = getBindingFromASTName("B(0)", 1, ICPPClassType.class); assertFalse(b2 instanceof IIndexBinding); assertEquals(b1, b2.getConstructors()[0]); ICPPMethod b3 = getBindingFromASTName("m(0)", 1, ICPPMethod.class); assertFalse(b3 instanceof IIndexBinding); }

Target:
public void testNestedClass_284665() throws Exception { ICPPClassType b0 = getBindingFromASTName("B {", 1, ICPPClassType.class); assertFalse(b0 instanceof IIndexBinding); ICPPConstructor b1 = getBindingFromASTName("B(int x)", 1, ICPPConstructor.class); assertFalse(b1 instanceof IIndexBinding); ICPPClassType b2 = getBindingFromASTName("B(0)", 1, ICPPClassType.class); ICPPMethod b3 = getBindingFromASTName("m(0)", 1, ICPPMethod.class); assertFalse(b3 instanceof IIndexBinding); }
Source:
public void visitJavadocToken(DetailNode detailNode) { DetailNode nextSibling = getNextNode(detailNode); while (nextSibling.getType() == JavadocTokenTypes.DESCRIPTION || nextSibling.getType() == JavadocTokenTypes.WS) { nextSibling = getNextNode(nextSibling); } if (!isLeadingAsterisk(nextSibling) && !isLastLine(nextSibling)) { log(nextSibling.getLineNumber(), MSG_MISSING_ASTERISK); } }

Target:
public void visitJavadocToken(DetailNode detailNode) { DetailNode nextSibling = getNextNode(detailNode); while (TokenUtil.isOfType(nextSibling.getType(), JavadocTokenTypes.DESCRIPTION, JavadocTokenTypes.WS)) { nextSibling = getNextNode(nextSibling); } if (!isLeadingAsterisk(nextSibling) && !isLastLine(nextSibling)) { log(nextSibling.getLineNumber(), MSG_MISSING_ASTERISK); } }
Source:
public void shouldReleaseLockForUnassignedTasksAfterRebalance() throws IOException { expectLockObtainedFor(taskId00, taskId01, taskId02); makeTaskFolders( "0_0", "0_1", "0_2" ); replay(stateDirectory); taskManager.handleRebalanceStart(singleton("topic")); assertThat(taskManager.lockedTaskDirectories(), is(mkSet(taskId00, taskId01, taskId02))); handleAssignment(taskId00Assignment, taskId01Assignment, emptyMap()); reset(consumer); expectConsumerAssignmentPaused(consumer); replay(consumer); taskManager.handleRebalanceComplete(); assertThat(taskManager.lockedTaskDirectories(), is(mkSet(taskId00, taskId01))); }

Target:
public void shouldReleaseLockForUnassignedTasksAfterRebalance() throws IOException { expectLockObtainedFor(taskId00, taskId01, taskId02); expectUnlockFor(taskId02); makeTaskFolders( taskId00.toString(), taskId01.toString(), taskId02.toString() ); replay(stateDirectory); taskManager.handleRebalanceStart(singleton("topic")); assertThat(taskManager.lockedTaskDirectories(), is(mkSet(taskId00, taskId01, taskId02))); handleAssignment(taskId00Assignment, taskId01Assignment, emptyMap()); reset(consumer); expectConsumerAssignmentPaused(consumer); replay(consumer); taskManager.handleRebalanceComplete(); assertThat(taskManager.lockedTaskDirectories(), is(mkSet(taskId00, taskId01))); verify(stateDirectory); }
Source:
public void isNodeEmpty() { ObjectNode objectNode = new ObjectNode(factory); assertTrue(expressionEvaluatorMock.isNodeEmpty(objectNode)); objectNode.set("key", new TextNode("value")); assertFalse(expressionEvaluatorMock.isNodeEmpty(objectNode)); ArrayNode arrayNode = new ArrayNode(factory); assertTrue(expressionEvaluatorMock.isNodeEmpty(arrayNode)); arrayNode.add(new TextNode("value")); assertFalse(expressionEvaluatorMock.isNodeEmpty(arrayNode)); assertTrue(expressionEvaluatorMock.isNodeEmpty(new TextNode(""))); assertTrue(expressionEvaluatorMock.isNodeEmpty(new TextNode(null))); assertFalse(expressionEvaluatorMock.isNodeEmpty(new TextNode("value"))); }

Target:
public void isNodeEmpty() { ObjectNode objectNode = new ObjectNode(factory); assertTrue(expressionEvaluatorMock.isNodeEmpty(objectNode)); objectNode.set("empty array", new ArrayNode(factory)); assertTrue(expressionEvaluatorMock.isNodeEmpty(objectNode)); objectNode.set("key", new TextNode("value")); assertFalse(expressionEvaluatorMock.isNodeEmpty(objectNode)); ArrayNode arrayNode = new ArrayNode(factory); assertTrue(expressionEvaluatorMock.isNodeEmpty(arrayNode)); arrayNode.add(new TextNode("value")); assertFalse(expressionEvaluatorMock.isNodeEmpty(arrayNode)); assertTrue(expressionEvaluatorMock.isNodeEmpty(new TextNode(""))); assertTrue(expressionEvaluatorMock.isNodeEmpty(new TextNode(null))); assertFalse(expressionEvaluatorMock.isNodeEmpty(new TextNode("value"))); }
Source:
public Response toResponse(SearchChargesException exception) { PaymentError paymentError = null; if (exception.getErrorStatus() == NOT_FOUND.getStatusCode()) { return buildResponse(exception, SEARCH_PAYMENTS_NOT_FOUND, NOT_FOUND); } return buildResponse(exception, SEARCH_PAYMENTS_CONNECTOR_ERROR, INTERNAL_SERVER_ERROR); }

Target:
public Response toResponse(SearchChargesException exception) { if (exception.getErrorStatus() == NOT_FOUND.getStatusCode()) { return buildResponse(exception, SEARCH_PAYMENTS_NOT_FOUND, NOT_FOUND); } return buildResponse(exception, SEARCH_PAYMENTS_CONNECTOR_ERROR, INTERNAL_SERVER_ERROR); }
Source:
private void setCanonicalQueryString() { Map<String,ArrayList<String>> signedQueryParams = new TreeMap<>(); String encodedQuery = this.url.encodedQuery(); if (encodedQuery == null) { this.canonicalQueryString = ""; return; } for (String queryParam : encodedQuery.split("&")) { String[] tokens = queryParam.split("="); ArrayList<String> vals = signedQueryParams.get(tokens[0]); if (vals == null) { vals = new ArrayList<String>(); signedQueryParams.put(tokens[0], vals); } if (tokens.length > 1) { vals.add(tokens[1]); } else { vals.add(""); } } ArrayList<String> canonicalSubQueries = new ArrayList<String>(); for (Map.Entry<String, ArrayList<String>> entry: signedQueryParams.entrySet()) { ArrayList<String> v = entry.getValue(); if (v.size() > 0) { List<String> subQueries = v.stream() .map(s -> entry.getKey() + "=" + s) .collect(Collectors.toList()); canonicalSubQueries.add(Joiner.on("&").join(subQueries)); } } this.canonicalQueryString = Joiner.on("&").join(canonicalSubQueries); }

Target:
private void setCanonicalQueryString() { String encodedQuery = this.url.encodedQuery(); if (encodedQuery == null) { this.canonicalQueryString = ""; return; } Multimap<String, String> signedQueryParams = MultimapBuilder.treeKeys().arrayListValues().build(); for (String queryParam : encodedQuery.split("&")) { String[] tokens = queryParam.split("="); if (tokens.length > 1) { signedQueryParams.put(tokens[0], tokens[1]); } else { signedQueryParams.put(tokens[0], ""); } } this.canonicalQueryString = Joiner.on("&").withKeyValueSeparator("=").join(signedQueryParams.entries()); }
Source:
protected String getAuthorizationBaseUrl() { return "<LINK_0>"; }

Target:
protected String getAuthorizationBaseUrl() { return "<LINK_1>"; }
Source:
public static ServerAggregators deserialize(byte[] b, Configuration conf) { if (b == null) { return ServerAggregators.EMPTY_AGGREGATORS; } ByteArrayInputStream stream = new ByteArrayInputStream(b); try { DataInputStream input = new DataInputStream(stream); int minNullableIndex = WritableUtils.readVInt(input); int len = WritableUtils.readVInt(input); Aggregator[] aggregators = new Aggregator[len]; Expression[] expressions = new Expression[len]; SingleAggregateFunction[] functions = new SingleAggregateFunction[len]; for (int i = 0; i < aggregators.length; i++) { SingleAggregateFunction aggFunc = (SingleAggregateFunction)ExpressionType.values()[WritableUtils.readVInt(input)].newInstance(); aggFunc.readFields(input); functions[i] = aggFunc; Aggregator aggregator = aggFunc.getAggregator(); if (aggregator instanceof Configurable) { ((Configurable)aggregator).setConf(conf); } aggregators[i] = aggregator; expressions[i] = aggFunc.getAggregatorExpression(); } return new ServerAggregators(functions, aggregators,expressions, minNullableIndex); } catch (IOException e) { throw new RuntimeException(e); } finally { try { stream.close(); } catch (IOException e) { throw new RuntimeException(e); } } }

Target:
public static ServerAggregators deserialize(byte[] b, Configuration conf) { if (b == null) { return ServerAggregators.EMPTY_AGGREGATORS; } ByteArrayInputStream stream = new ByteArrayInputStream(b); try { DataInputStream input = new DataInputStream(stream); int minNullableIndex = WritableUtils.readVInt(input); int len = WritableUtils.readVInt(input); Aggregator[] aggregators = new Aggregator[len]; Expression[] expressions = new Expression[len]; SingleAggregateFunction[] functions = new SingleAggregateFunction[len]; for (int i = 0; i < aggregators.length; i++) { SingleAggregateFunction aggFunc = (SingleAggregateFunction)ExpressionType.values()[WritableUtils.readVInt(input)].newInstance(); aggFunc.readFields(input, conf); functions[i] = aggFunc; aggregators[i] = aggFunc.getAggregator(); expressions[i] = aggFunc.getAggregatorExpression(); } return new ServerAggregators(functions, aggregators,expressions, minNullableIndex); } catch (IOException e) { throw new RuntimeException(e); } finally { try { stream.close(); } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
protected CommandStatus run() { try { status = CommandStatus.RUNNING; Files.copy(source, destination.resolve(source.getFileName()), REPLACE_EXISTING); } catch (IOException e) { status = CommandStatus.FAILED; e.printStackTrace(); return status; } return CommandStatus.SUCCESS; }

Target:
protected CommandStatus run() { logger.info("Copying " + source + " to " + destination); try { status = CommandStatus.RUNNING; Files.copy(source, destination.resolve(source.getFileName()), REPLACE_EXISTING); } catch (IOException e) { status = CommandStatus.FAILED; logger.error("Local copy failed! Returning failed.", e); return status; } return CommandStatus.SUCCESS; }
Source:
public int writeBatch(final OutputStream os, final Cursor cursor, final List<byte[]> events) throws IOException { int byteCount = B_FIXED_BYTE_COUNT; os.write(B_CURSOR_PARTITION_BEGIN); final byte[] partition = cursor.getPartition().getBytes(StandardCharsets.UTF_8); os.write(partition); byteCount += partition.length; os.write(B_OFFSET_BEGIN); final byte[] offset = cursor.getOffset().getBytes(StandardCharsets.UTF_8); os.write(offset); byteCount += offset.length; os.write(B_CURSOR_PARTITION_END); if (!events.isEmpty()) { os.write(B_EVENTS_ARRAY_BEGIN); for (int i = 0; i < events.size(); i++) { final byte[] event = events.get(i); os.write(event); byteCount += event.length; if (i < (events.size() - 1)) { os.write(B_COMMA_DELIM); } else { os.write(B_CLOSE_BRACKET); } } } os.write(B_CLOSE_CURLY_BRACKET); os.write(B_BATCH_SEPARATOR); os.flush(); return byteCount; }

Target:
public int writeBatch(final OutputStream os, final Cursor cursor, final List<byte[]> events) throws IOException { int byteCount = B_FIXED_BYTE_COUNT; os.write(B_CURSOR_PARTITION_BEGIN); final byte[] partition = cursor.getPartition().getBytes(UTF_8); os.write(partition); byteCount += partition.length; os.write(B_OFFSET_BEGIN); final byte[] offset = cursor.getOffset().getBytes(UTF_8); os.write(offset); byteCount += offset.length; os.write(B_CURSOR_PARTITION_END); if (!events.isEmpty()) { os.write(B_EVENTS_ARRAY_BEGIN); for (int i = 0; i < events.size(); i++) { final byte[] event = events.get(i); os.write(event); byteCount += event.length; if (i < (events.size() - 1)) { os.write(B_COMMA_DELIM); } else { os.write(B_CLOSE_BRACKET); } } } os.write(B_CLOSE_CURLY_BRACKET); os.write(B_BATCH_SEPARATOR); os.flush(); return byteCount; }
Source:
protected void createDefaultDiskProfile() { executeInNewTransaction(() -> { final DiskProfile diskProfile = diskProfileHelper.createDiskProfile(getStorageDomain().getId(), getStorageDomainName()); DiskProfileParameters diskProfileParameters = new DiskProfileParameters(diskProfile, true); runInternalAction(VdcActionType.AddDiskProfile, diskProfileParameters, cloneContextAndDetachFromParent()); getCompensationContext().snapshotNewEntity(diskProfile); getCompensationContext().stateChanged(); return null; }); }

Target:
protected void createDefaultDiskProfile() { executeInNewTransaction(() -> { final DiskProfile diskProfile = diskProfileHelper.createDiskProfile(getStorageDomain().getId(), getStorageDomainName()); DiskProfileParameters diskProfileParameters = new DiskProfileParameters(diskProfile, true); runInternalActionWithTasksContext(VdcActionType.AddDiskProfile, diskProfileParameters); getCompensationContext().snapshotNewEntity(diskProfile); getCompensationContext().stateChanged(); return null; }); }
Source:
public Cluster.Builder createClusterBuilderNoDebouncing() { return Cluster.builder() .withQueryOptions(new QueryOptions() .setRefreshNodeIntervalMillis(0) .setRefreshNodeListIntervalMillis(0) .setRefreshSchemaIntervalMillis(0)); }

Target:
public Cluster.Builder createClusterBuilderNoDebouncing() { return Cluster.builder().withQueryOptions(TestUtils.nonDebouncingQueryOptions()); }
Source:
public void checkoutEntry(File f, DirCacheEntry entry, boolean config_filemode) throws IOException { ObjectLoader ol = repo.openBlob(entry.getObjectId()); if (ol == null) throw new MissingObjectException(entry.getObjectId(), Constants.TYPE_BLOB); byte[] bytes = ol.getCachedBytes(); File parentDir = f.getParentFile(); parentDir.mkdirs(); File tmpFile = java.io.File .createTempFile(f.getName(), null, parentDir); FileChannel channel = new FileOutputStream(tmpFile).getChannel(); ByteBuffer buffer = ByteBuffer.wrap(bytes); try { int j = channel.write(buffer); if (j != bytes.length) throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile)); } finally { channel.close(); } FS fs = repo.getFS(); if (config_filemode && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { f.delete(); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); }

Target:
public void checkoutEntry(File f, DirCacheEntry entry, boolean config_filemode) throws IOException { ObjectLoader ol = repo.openBlob(entry.getObjectId()); if (ol == null) throw new MissingObjectException(entry.getObjectId(), Constants.TYPE_BLOB); byte[] bytes = ol.getCachedBytes(); File parentDir = f.getParentFile(); File tmpFile = java.io.File .createTempFile(f.getName(), null, parentDir); FileChannel channel = new FileOutputStream(tmpFile).getChannel(); ByteBuffer buffer = ByteBuffer.wrap(bytes); try { int j = channel.write(buffer); if (j != bytes.length) throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile)); } finally { channel.close(); } FS fs = repo.getFS(); if (config_filemode && fs.supportsExecute()) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true); } else { if (fs.canExecute(tmpFile)) fs.setExecute(tmpFile, false); } } if (!tmpFile.renameTo(f)) { f.delete(); if (!tmpFile.renameTo(f)) { throw new IOException(MessageFormat.format( JGitText.get().couldNotWriteFile, tmpFile.getPath(), f.getPath())); } } entry.setLastModified(f.lastModified()); entry.setLength((int) ol.getSize()); }
Source:
public Set<ConnectorCapabilities> getCapabilities() { return immutableEnumSet(NOT_NULL_COLUMNS); }

Target:
public Set<ConnectorCapabilities> getCapabilities() { return immutableEnumSet(NOT_NULL_COLUMN_CONSTRAINT); }
Source:
private void updateMemory(long memorySize) { if (partial || useSystemMemoryPool) { systemMemoryContext.setBytes(memorySize); } else { localUserMemoryContext.setBytes(memorySize); } }

Target:
private void updateMemory(long memorySize) { if (useSystemMemory) { systemMemoryContext.setBytes(memorySize); } else { localUserMemoryContext.setBytes(memorySize); } }
Source:
public String getId() { return projectType + ":" + name; }

Target:
public String getId() { return projectType + ':' + name; }
Source:
private void showFormatCompareConfirmWindow(String commandName) { StorageModel storageModel = (StorageModel) getWindow(); StoragePool dataCenter = storageModel.getDataCenter().getSelectedItem(); StorageDomain sd = Linq.firstOrNull(storageDomainsToAdd); UICommand okCommand = UICommand.createDefaultOkUiCommand(commandName, this); if (sd.getStorageFormat().compareTo(dataCenter.getStoragePoolFormatType()) < 0) { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().areYouSureTitle()); model.setMessage(ConstantsManager.getInstance().getMessages() .compareStorageFormatToDataCenterWarningMessage( sd.getStorageFormat().getValue(), dataCenter.getStoragePoolFormatType().getValue())); model.setHelpTag(HelpTag.import_storage_domain_confirmation); model.setHashName("import_storage_domain_confirmation"); UICommand cancelCommand = createCancelCommand("CancelImportConfirm"); model.getCommands().add(okCommand); model.getCommands().add(cancelCommand); formatConfirmModel = model; new UICommand("OnShowFormatConfirmWindow", this).execute(); } else { okCommand.execute(); } }

Target:
private void showFormatCompareConfirmWindow(String commandName) { StorageModel storageModel = (StorageModel) getWindow(); StoragePool dataCenter = storageModel.getDataCenter().getSelectedItem(); StorageDomain sd = Linq.firstOrNull(storageDomainsToAdd); UICommand okCommand = UICommand.createDefaultOkUiCommand(commandName, this); if (sd.getStorageFormat().compareTo(dataCenter.getStoragePoolFormatType()) < 0) { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().areYouSureTitle()); model.setMessage(ConstantsManager.getInstance().getMessages() .compareStorageFormatToDataCenterWarningMessage( dataCenter.getName(), sd.getName(), sd.getStorageFormat().getValue(), dataCenter.getStoragePoolFormatType().getValue())); model.setHelpTag(HelpTag.import_storage_domain_confirmation); model.setHashName("import_storage_domain_confirmation"); UICommand cancelCommand = createCancelCommand("CancelImportConfirm"); model.getCommands().add(okCommand); model.getCommands().add(cancelCommand); formatConfirmModel = model; new UICommand("OnShowFormatConfirmWindow", this).execute(); } else { okCommand.execute(); } }
Source:
private static Decoder createDecoder(ObjectMapper objectMapper, ObjectMapper cborObjectMapper) { return new RejectNullDecoder( new CoerceNullCollectionsDecoder( new Java8OptionalAwareDecoder( new GuavaOptionalAwareDecoder( new InputStreamDelegateDecoder( new TextDelegateDecoder( new CborDelegateDecoder( cborObjectMapper, new JacksonDecoder(objectMapper)))))))); }

Target:
private static Decoder createDecoder(ObjectMapper objectMapper, ObjectMapper cborObjectMapper) { return new NeverReturnNullDecoder( new CoerceNullCollectionsDecoder( new Java8OptionalAwareDecoder( new GuavaOptionalAwareDecoder( new InputStreamDelegateDecoder( new TextDelegateDecoder( new CborDelegateDecoder( cborObjectMapper, new JacksonDecoder(objectMapper)))))))); }
Source:
public String getSrcRecord() { return srcRecord; }

Target:
public String getSrcRecord() { return srcRecord.toString(); }
Source:
public static EventType fromInteger(int x) { switch (x) { case 1: return HOST_UPDATE; case 2: return PORT_UPDATE; case 3: return ACTIVATION; case 4: return INACTIVATION; case 5: return CREATED; case 128: return ERROR; default: return ERROR; } }

Target:
public static EventType fromInteger(int x) throws IllegalArgumentException { switch (x) { case 1: return HOST_UPDATE; case 2: return PORT_UPDATE; case 3: return ACTIVATION; case 4: return INACTIVATION; case 5: return CREATED; case 128: return ERROR; default: throw new IllegalArgumentException(String.format( "inalid status code %d", x)); } }
Source:
public int getMultiplier() { return 10; }

Target:
public int getMultiplier() { return this.multiplier; }
Source:
private static Configuration getLanguageConfig(@NonNull Configuration remoteConfig, @NonNull SharedPreferences prefs) { Configuration newConfig = new Configuration(remoteConfig); Locale newLocale = LanguageUtil.getLocale(prefs.getString(Preferences.LANGUAGE, ""), prefs); Timber.d("AnkiDroidApp::getLanguageConfig - setting locale to %s", newLocale.toString()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { String strLocaleList = newLocale.toLanguageTag(); if (!strLocaleList.contains(Locale.getDefault().toLanguageTag())) { strLocaleList = strLocaleList + "," + Locale.getDefault().toLanguageTag(); } LocaleList newLocaleList = LocaleList.forLanguageTags(strLocaleList); newConfig.setLocales(newLocaleList); } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { newConfig.setLocale(newLocale); } else { newConfig.locale = newLocale; } } return newConfig; }

Target:
private static Configuration getLanguageConfig(@NonNull Configuration remoteConfig, @NonNull SharedPreferences prefs) { Configuration newConfig = new Configuration(remoteConfig); Locale newLocale = LanguageUtil.getLocale(prefs.getString(Preferences.LANGUAGE, ""), prefs); Timber.d("AnkiDroidApp::getLanguageConfig - setting locale to %s", newLocale); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { String strLocaleList = newLocale.toLanguageTag(); if (!strLocaleList.contains(Locale.getDefault().toLanguageTag())) { strLocaleList = strLocaleList + "," + Locale.getDefault().toLanguageTag(); } LocaleList newLocaleList = LocaleList.forLanguageTags(strLocaleList); newConfig.setLocales(newLocaleList); } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { newConfig.setLocale(newLocale); } else { newConfig.locale = newLocale; } } return newConfig; }
Source:
public GeradorDeBoleto(Boleto... boletos) { this.boletos = boletos; try { templateJasper = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default.jasper"); parametros.put(JRParameter.REPORT_LOCALE, new Locale("pt", "BR")); InputStream template_sub = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default_instrucoes.jasper"); parametros.put("SUB_INSTRUCOES", JRLoader.loadObject(template_sub)); } catch (JRException e) { e.printStackTrace(); } }

Target:
public GeradorDeBoleto(Boleto... boletos) { this.boletos = boletos; try { templateJasper = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default.jasper"); parametros.put(JRParameter.REPORT_LOCALE, new Locale("pt", "BR")); InputStream template_sub = GeradorDeBoleto.class.getResourceAsStream("/br/com/caelum/stella/boleto/templates/boleto-default_instrucoes.jasper"); parametros.put("SUB_INSTRUCOES", JRLoader.loadObject(template_sub)); } catch (JRException e) { throw new GeracaoBoletoException(e); } }
Source:
public void closeDetailsPanel() { setSelectedShortcut(null); setSelectedDetailsPanelAction(new CloseAction()); }

Target:
public void closeDetailsPanel() { setSelectedShortcut(null); setOpenedDetailsPanel(new None()); }
Source:
public String writeToString() { String result = this.podcast + "\t" + this.episode + "\t" + this.deviceId + "\t" + this.action + "\t" + this.timestamp.getTime() + "\t" + String.valueOf(this.started) + "\t" + String.valueOf(this.position) + "\t" + String.valueOf(this.total); return result; }

Target:
public String writeToString() { return this.podcast + "\t" + this.episode + "\t" + this.deviceId + "\t" + this.action + "\t" + this.timestamp.getTime() + "\t" + String.valueOf(this.started) + "\t" + String.valueOf(this.position) + "\t" + String.valueOf(this.total); }
Source:
private void processFiles(List<File> files) throws CheckstyleException { for (final File file : files) { final String fileName = file.getAbsolutePath(); try { final long timestamp = file.lastModified(); if (cacheFile != null && cacheFile.isInCache(fileName, timestamp) || !acceptFileStarted(fileName)) { continue; } if (cacheFile != null) { cacheFile.put(fileName, timestamp); } fireFileStarted(fileName); final SortedSet<LocalizedMessage> fileMessages = processFile(file); fireErrors(fileName, fileMessages); fireFileFinished(fileName); } catch (Exception ex) { if (cacheFile != null) { cacheFile.remove(fileName); } throw new CheckstyleException("Exception was thrown while processing " + file.getPath(), ex); } catch (Error error) { if (cacheFile != null) { cacheFile.remove(fileName); } throw new Error("Error was thrown while processing " + file.getPath(), error); } } }

Target:
private void processFiles(List<File> files) throws CheckstyleException { for (final File file : files) { String fileName = null; try { fileName = file.getAbsolutePath(); final long timestamp = file.lastModified(); if (cacheFile != null && cacheFile.isInCache(fileName, timestamp) || !acceptFileStarted(fileName)) { continue; } if (cacheFile != null) { cacheFile.put(fileName, timestamp); } fireFileStarted(fileName); final SortedSet<LocalizedMessage> fileMessages = processFile(file); fireErrors(fileName, fileMessages); fireFileFinished(fileName); } catch (Exception ex) { if (fileName != null && cacheFile != null) { cacheFile.remove(fileName); } throw new CheckstyleException("Exception was thrown while processing " + file.getPath(), ex); } catch (Error error) { if (fileName != null && cacheFile != null) { cacheFile.remove(fileName); } throw new Error("Error was thrown while processing " + file.getPath(), error); } } }
Source:
public void testDiscardPendingWritesOnInactive() throws IOException { final AtomicBoolean closeWasCalled = new AtomicBoolean(false); ChunkedInput<ByteBuf> notifiableInput = new ChunkedInput<ByteBuf>() { private boolean done; private final ByteBuf buffer = Unpooled.copiedBuffer("Test", CharsetUtil.ISO_8859_1); @Override public boolean isEndOfInput() throws Exception { return done; } @Override public void close() throws Exception { buffer.release(); closeWasCalled.set(true); } @Deprecated @Override public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception { return readChunk(ctx.alloc()); } @Override public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception { if (done) { return null; } done = true; return buffer.retainedDuplicate(); } @Override public long length() { return -1; } @Override public long progress() { return 1; } }; EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler()); ChannelFuture r1 = ch.write(new ChunkedFile(TMP)); ChannelFuture r2 = ch.write(new ChunkedNioFile(TMP)); ch.write(notifiableInput); ch.close().awaitUninterruptibly(); assertFalse(r1.isSuccess()); assertFalse(r2.isSuccess()); assertTrue(closeWasCalled.get()); }

Target:
public void testDiscardPendingWritesOnInactive() throws IOException { final AtomicBoolean closeWasCalled = new AtomicBoolean(false); ChunkedInput<ByteBuf> notifiableInput = new ChunkedInput<ByteBuf>() { private boolean done; private final ByteBuf buffer = Unpooled.copiedBuffer("Test", CharsetUtil.ISO_8859_1); @Override public boolean isEndOfInput() throws Exception { return done; } @Override public void close() throws Exception { buffer.release(); closeWasCalled.set(true); } @Deprecated @Override public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception { return readChunk(ctx.alloc()); } @Override public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception { if (done) { return null; } done = true; return buffer.retainedDuplicate(); } @Override public long length() { return -1; } @Override public long progress() { return 1; } }; EmbeddedChannel ch = new EmbeddedChannel(new ChunkedWriteHandler()); ChannelFuture r1 = ch.write(new ChunkedFile(TMP)); ChannelFuture r2 = ch.write(new ChunkedNioFile(TMP)); ch.write(notifiableInput); assertFalse(ch.finish()); assertFalse(r1.isSuccess()); assertFalse(r2.isSuccess()); assertTrue(closeWasCalled.get()); }
Source:
default double rate() { return 0.0f; }

Target:
default double rate() { return 0d; }
Source:
@Test public void doubles() throws IOException { String json = "[-0.0," + "1.0," + "1.7976931348623157E308," + "4.9E-324," + "0.0," + "-0.5," + "2.2250738585072014E-308," + "3.141592653589793," + "2.718281828459045]"; JsonReader reader = newReader(json); reader.beginArray(); double expected1 = -0.0; assertThat(reader.nextDouble()).isEqualTo(expected1, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(1.0, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(1.7976931348623157E308, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(4.9E-324, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(0.0, Offset.offset(0d)); double expected = -0.5; assertThat(reader.nextDouble()).isEqualTo(expected, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(2.2250738585072014E-308, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(3.141592653589793, Offset.offset(0d)); assertThat(reader.nextDouble()).isEqualTo(2.718281828459045, Offset.offset(0d)); reader.endArray(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_DOCUMENT); }

Target:
@Test public void doubles() throws IOException { String json = "[-0.0," + "1.0," + "1.7976931348623157E308," + "4.9E-324," + "0.0," + "-0.5," + "2.2250738585072014E-308," + "3.141592653589793," + "2.718281828459045]"; JsonReader reader = newReader(json); reader.beginArray(); assertThat(reader.nextDouble()).isEqualTo(-0.0); assertThat(reader.nextDouble()).isEqualTo(1.0); assertThat(reader.nextDouble()).isEqualTo(1.7976931348623157E308); assertThat(reader.nextDouble()).isEqualTo(4.9E-324); assertThat(reader.nextDouble()).isEqualTo(0.0); assertThat(reader.nextDouble()).isEqualTo(-0.5); assertThat(reader.nextDouble()).isEqualTo(2.2250738585072014E-308); assertThat(reader.nextDouble()).isEqualTo(3.141592653589793); assertThat(reader.nextDouble()).isEqualTo(2.718281828459045); reader.endArray(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_DOCUMENT); }
Source:
public static String getAuthHeaderValue(StripeGatewayConfig stripeGatewayConfig) { return "Bearer " + stripeGatewayConfig.getAuthToken().getTest(); }

Target:
public static String getAuthHeaderValue(StripeGatewayConfig stripeGatewayConfig) { return "Bearer " + stripeGatewayConfig.getAuthTokens().getTest(); }
Source:
private Response doGetPriamConfig(String group, String name) { try { final Map<String, Object> result = new HashMap<>(); final Map<String, Object> value = priamServer.getConfiguration().getStructuredConfiguration(group); if (name != null && value.containsKey(name)) { result.put(name, value.get(name)); return Response.ok(GsonJsonSerializer.getGson().toJson(result)).build(); } else if (name != null) { result.put("message", String.format("No such structured config: [%s]", name)); logger.error(String.format("No such structured config: [%s]", name)); return Response.status(404) .entity(GsonJsonSerializer.getGson().toJson(result)) .type(MediaType.TEXT_PLAIN) .build(); } else { result.putAll(value); return Response.ok(GsonJsonSerializer.getGson().toJson(result)).build(); } } catch (Exception e) { logger.error("Error while executing getPriamConfig", e); return Response.serverError().build(); } }

Target:
private Response doGetPriamConfig(String group, String name) { try { final Map<String, Object> result = new HashMap<>(); final Map<String, Object> value = priamServer.getConfiguration().getStructuredConfiguration(group); if (name != null && value.containsKey(name)) { result.put(name, value.get(name)); return Response.ok(GsonJsonSerializer.getGson().toJson(result)).build(); } else if (name != null) { result.put("message", String.format("No such structured config: [%s]", name)); logger.error(String.format("No such structured config: [%s]", name)); return Response.status(404) .entity(GsonJsonSerializer.getGson().toJson(result)) .type(MediaType.APPLICATION_JSON) .build(); } else { result.putAll(value); return Response.ok(GsonJsonSerializer.getGson().toJson(result)).build(); } } catch (Exception e) { logger.error("Error while executing getPriamConfig", e); return Response.serverError().build(); } }
Source:
private void updateUIForOrientation(){ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { setActionBarVisible(false); } else { setActionBarVisible(true); } }

Target:
private void updateUIForOrientation(){ Fragment fragment = null; int currentItem = pager.getCurrentItem(); if (currentItem < pagerAdapter.getCount()) { fragment = pagerAdapter.getItem(currentItem); } boolean isCurrentFragmentVideoUnit = false; if (fragment != null && fragment instanceof CourseUnitVideoFragment) { isCurrentFragmentVideoUnit = true; } if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && isCurrentFragmentVideoUnit) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setActionBarVisible(false); findViewById(R.id.course_unit_nav_bar).setVisibility(View.GONE); pager.setEnabled(true); } else { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setActionBarVisible(true); findViewById(R.id.course_unit_nav_bar).setVisibility(View.VISIBLE); pager.setEnabled(true); } }
Source:
public static void onAction( ChangeInfo change, RevisionInfo revision, ActionInfo action, ActionButton button) { RestApi api = ChangeApi.revision( change.legacy_id().get(), revision.name()) .view(action.id()); JavaScriptObject f = get(action.id()); if (f != null) { ActionContext c = ActionContext.create(api); c.set(action); c.set(change); c.set(revision); c.button(button); ApiGlue.invoke(f, c); } else { ChangeGlue.simple(change, action, api); } }

Target:
public static void onAction( ChangeInfo change, RevisionInfo revision, ActionInfo action, ActionButton button) { RestApi api = ChangeApi.revision( change.legacy_id().get(), revision.name()) .view(action.id()); JavaScriptObject f = get(action.id()); if (f != null) { ActionContext c = ActionContext.create(api); c.set(action); c.set(change); c.set(revision); c.button(button); ApiGlue.invoke(f, c); } else { DefaultActions.invoke(change, action, api); } }
Source:
public void run() { logger.info("Starting."); try { workflowDefinitions.postProcessWorkflowDefinitions(); while (!shutdownRequested) { try { executor.waitUntilQueueSizeLowerThanThreshold(executorDao.getMaxWaitUntil()); if (!shutdownRequested) { if (executorDao.tick()) { workflowInstances.recoverWorkflowInstancesFromDeadNodes(); } int potentiallyStuckProcessors = stateProcessorFactory.getPotentiallyStuckProcessors(); if (potentiallyStuckProcessors > 0) { periodicLogger.warn("{} of state processor threads are potentially stuck (processing longer than seconds)", potentiallyStuckProcessors, executor.getThreadCount(), stuckThreadThresholdSeconds); } dispatch(getNextInstanceIds()); } } catch (PollingRaceConditionException pex) { logger.info(pex.getMessage()); sleep(true); } catch (@SuppressWarnings("unused") InterruptedException dropThrough) { } catch (Exception e) { logger.error("Exception in executing dispatcher - retrying after sleep period (" + e.getMessage() + ")", e); sleep(false); } } } catch (IOException | ReflectiveOperationException e) { logger.error("Exception in initializing workflow definitions", e); } finally { shutdownPool(); executorDao.markShutdown(); logger.info("Shutdown finished."); shutdownDone.countDown(); } }

Target:
public void run() { logger.info("Starting."); try { workflowDefinitions.postProcessWorkflowDefinitions(); while (!shutdownRequested) { try { executor.waitUntilQueueSizeLowerThanThreshold(executorDao.getMaxWaitUntil()); if (!shutdownRequested) { if (executorDao.tick()) { workflowInstances.recoverWorkflowInstancesFromDeadNodes(); } int potentiallyStuckProcessors = stateProcessorFactory.getPotentiallyStuckProcessors(); if (potentiallyStuckProcessors > 0) { periodicLogger.warn("{} of state processor threads are potentially stuck (processing longer than seconds)", potentiallyStuckProcessors, executor.getThreadCount(), stuckThreadThresholdSeconds); } dispatch(getNextInstanceIds()); } } catch (PollingRaceConditionException pex) { logger.info(pex.getMessage()); sleep(true); } catch (@SuppressWarnings("unused") InterruptedException dropThrough) { } catch (Exception e) { logger.error("Exception in executing dispatcher - retrying after sleep period (" + e.getMessage() + ")", e); sleep(false); } } } catch (IOException | ReflectiveOperationException e) { logger.error("Fetching workflow definitions failed", e); } finally { shutdownPool(); executorDao.markShutdown(); logger.info("Shutdown finished."); shutdownDone.countDown(); } }
Source:
void onReply(String msg) { if (popup != null) { popup.hide(); return; } if (replyBox == null) { replyBox = new ReplyBox( psId, revision, allLabels, permittedLabels, msg); allLabels = null; permittedLabels = null; } final PluginSafePopupPanel p = new PluginSafePopupPanel(true); if(style != null) { p.setStyleName(style.replyBox()); } else { p.setStyleName(style2.replyBox()); } p.addAutoHidePartner(replyButton.getElement()); p.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { if (popup == p) { popup = null; } } }); p.add(replyBox); p.showRelativeTo(replyButton); GlobalKey.dialog(p); popup = p; }

Target:
void onReply(String msg) { if (popup != null) { popup.hide(); return; } if (replyBox == null) { replyBox = new ReplyBox( psId, revision, allLabels, permittedLabels, msg); allLabels = null; permittedLabels = null; } final PluginSafePopupPanel p = new PluginSafePopupPanel(true); p.setStyleName(style != null ? style.replyBox() : style2.replyBox()); p.addAutoHidePartner(replyButton.getElement()); p.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { if (popup == p) { popup = null; } } }); p.add(replyBox); p.showRelativeTo(replyButton); GlobalKey.dialog(p); popup = p; }
Source:
public E previous() { int i = this.nextIndex - 1; if (i < 0) { logger.logAndThrow(new NoSuchElementException()); return null; } else if (i >= items.size()) { logger.logAndThrow(new ConcurrentModificationException()); return null; } else { try { this.nextIndex = i; this.lastRetIndex = i; return items.get(this.lastRetIndex); } catch (IndexOutOfBoundsException ex) { logger.logAndThrow(new ConcurrentModificationException()); return null; } } }

Target:
public E previous() { int i = this.nextIndex - 1; if (i < 0) { throw logger.logExceptionAsError(new NoSuchElementException()); } else if (i >= items.size()) { throw logger.logExceptionAsError(new ConcurrentModificationException()); } else { try { this.nextIndex = i; this.lastRetIndex = i; return items.get(this.lastRetIndex); } catch (IndexOutOfBoundsException ex) { throw logger.logExceptionAsError(new ConcurrentModificationException(ex)); } } }