auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void applyUpdater(INDArray gradient, int iteration) { if (m == null || v == null) throw new IllegalStateException("Updater has not been initialized with view state"); double beta1 = config.getBeta1(); double beta2 = config.getBeta2(); double learningRate = config.getLearningRate(); double epsilon = config.getEpsilon(); INDArray oneMinusBeta1Grad = gradient.mul(1.0 - beta1); m.muli(beta1).addi(oneMinusBeta1Grad); INDArray oneMinusBeta2GradSquared = gradient.mul(gradient).muli(1.0 - beta2); v.muli(beta2).addi(oneMinusBeta2GradSquared); double beta1t = FastMath.pow(beta1, iteration + 1); INDArray biasCorrectedEstimateOfMomentum = m.muli(beta1).divi(1.0 - beta1t); INDArray secondTerm = oneMinusBeta1Grad.divi(1 - beta1t); INDArray alphat = biasCorrectedEstimateOfMomentum.add(secondTerm).muli(learningRate); INDArray sqrtV = Transforms.sqrt(v.dup(gradientReshapeOrder), false).addi(epsilon); gradient.assign(alphat).divi(sqrtV); }

Target:
public void applyUpdater(INDArray gradient, int iteration) { if (m == null || v == null) throw new IllegalStateException("Updater has not been initialized with view state"); double beta1 = config.getBeta1(); double beta2 = config.getBeta2(); double learningRate = config.getLearningRate(); double epsilon = config.getEpsilon(); INDArray oneMinusBeta1Grad = gradient.mul(1.0 - beta1); m.muli(beta1).addi(oneMinusBeta1Grad); INDArray oneMinusBeta2GradSquared = gradient.mul(gradient).muli(1.0 - beta2); v.muli(beta2).addi(oneMinusBeta2GradSquared); double beta1t = FastMath.pow(beta1, iteration + 1); INDArray biasCorrectedEstimateOfMomentum = m.mul(beta1).divi(1.0 - beta1t); INDArray secondTerm = oneMinusBeta1Grad.divi(1 - beta1t); INDArray alphat = biasCorrectedEstimateOfMomentum.add(secondTerm).muli(learningRate); INDArray sqrtV = Transforms.sqrt(v.dup(gradientReshapeOrder), false).addi(epsilon); gradient.assign(alphat).divi(sqrtV); }
Source:
public boolean hasTableDefined() { if (aliasToTabs.size() == 0) { return true; } for (String alias : aliasToTabs.keySet()) { if (!SemanticAnalyzer.DUMMY_TABLE.equals(alias)) { return true; } } return false; }

Target:
public boolean hasTableDefined() { return !(aliases.size() == 1 && aliases.get(0).equals(SemanticAnalyzer.DUMMY_TABLE)); }
Source:
public OmMultipartUploadList listMultipartUploads(String volumeName, String bucketName, String prefix) throws OMException { Preconditions.checkNotNull(volumeName); Preconditions.checkNotNull(bucketName); metadataManager.getLock().acquireLock(BUCKET_LOCK, volumeName, bucketName); try { List<String> multipartUploadKeys = metadataManager .getMultipartUploadKeys(volumeName, bucketName, prefix); List<OmMultipartUpload> collect = multipartUploadKeys.stream() .map(OmMultipartUpload::from) .map(upload -> { String dbKey = metadataManager .getOzoneKey(upload.getVolumeName(), upload.getBucketName(), upload.getKeyName()); try { Table<String, OmKeyInfo> openKeyTable = metadataManager.getOpenKeyTable(); OmKeyInfo omKeyInfo = openKeyTable.get(upload.getDbKey()); upload.setCreationTime( Instant.ofEpochMilli(omKeyInfo.getCreationTime())); } catch (IOException e) { LOG.warn( "Open key entry for multipart upload record can be read {}", dbKey); } return upload; }) .collect(Collectors.toList()); OmMultipartUploadList omMultipartUploadList = new OmMultipartUploadList(collect); return omMultipartUploadList; } catch (IOException ex) { LOG.error("List Multipart Uploads Failed: volume: " + volumeName + "bucket: " + bucketName + "prefix: " + prefix, ex); throw new OMException(ex.getMessage(), ResultCodes .LIST_MULTIPART_UPLOAD_PARTS_FAILED); } finally { metadataManager.getLock().releaseLock(BUCKET_LOCK, volumeName, bucketName); } }

Target:
public OmMultipartUploadList listMultipartUploads(String volumeName, String bucketName, String prefix) throws OMException { Preconditions.checkNotNull(volumeName); Preconditions.checkNotNull(bucketName); metadataManager.getLock().acquireLock(BUCKET_LOCK, volumeName, bucketName); try { List<String> multipartUploadKeys = metadataManager .getMultipartUploadKeys(volumeName, bucketName, prefix); List<OmMultipartUpload> collect = multipartUploadKeys.stream() .map(OmMultipartUpload::from) .map(upload -> { String dbKey = metadataManager .getOzoneKey(upload.getVolumeName(), upload.getBucketName(), upload.getKeyName()); try { Table<String, OmKeyInfo> openKeyTable = metadataManager.getOpenKeyTable(); OmKeyInfo omKeyInfo = openKeyTable.get(upload.getDbKey()); upload.setCreationTime( Instant.ofEpochMilli(omKeyInfo.getCreationTime())); upload.setReplicationType(omKeyInfo.getType()); upload.setReplicationFactor(omKeyInfo.getFactor()); } catch (IOException e) { LOG.warn( "Open key entry for multipart upload record can be read {}", dbKey); } return upload; }) .collect(Collectors.toList()); return new OmMultipartUploadList(collect); } catch (IOException ex) { LOG.error("List Multipart Uploads Failed: volume: " + volumeName + "bucket: " + bucketName + "prefix: " + prefix, ex); throw new OMException(ex.getMessage(), ResultCodes .LIST_MULTIPART_UPLOAD_PARTS_FAILED); } finally { metadataManager.getLock().releaseLock(BUCKET_LOCK, volumeName, bucketName); } }
Source:
private static String getHexEncodedSha256Hash(byte[] bytes) { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); return BaseEncoding.base16().lowerCase().encode(digest.digest(bytes)); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException("Failed to compute SHA-256 hash.", e); } }

Target:
private static String getHexEncodedSha256Hash(byte[] bytes) { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); return BaseEncoding.base16().lowerCase().encode(digest.digest(bytes)); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Failed to compute SHA-256 hash.", e); } }
Source:
public static void main(String args[]) throws Exception { b17411468(); b2296099Test(); b2302318Test(); b2487514Test(); b5884080Test(); b13679511Test(); b16177324TestWrapper(); b16230771TestWrapper(); b17689750Test(); largeFrameTest(); largeFrameTestFloat(); mulBy1Test(); constantPropagationTest(); getterSetterTest(); identityTest(); wideGetterSetterTest(); wideIdentityTest(); returnConstantTest(); setterTestWithReturnArgIgnoreReturn(); setterTestWithReturnArgUseReturn(); wideSetterTestWithReturnArgIgnoreReturn(); wideSetterTestWithReturnArgUseReturn(); LVNTests.testNPE1(); LVNTests.testNPE2(); ZeroTests.longDivTest(); ZeroTests.longModTest(); MirOpSelectTests.testIfCcz(); ManyFloatArgs(); atomicLong(); LiveFlags.test(); minDoubleWith3ConstsTest(); }

Target:
public static void main(String args[]) throws Exception { b17411468(); b2296099Test(); b2302318Test(); b2487514Test(); b5884080Test(); b13679511Test(); b16177324TestWrapper(); b16230771TestWrapper(); largeFrameTest(); largeFrameTestFloat(); mulBy1Test(); constantPropagationTest(); getterSetterTest(); identityTest(); wideGetterSetterTest(); wideIdentityTest(); returnConstantTest(); setterTestWithReturnArgIgnoreReturn(); setterTestWithReturnArgUseReturn(); wideSetterTestWithReturnArgIgnoreReturn(); wideSetterTestWithReturnArgUseReturn(); LVNTests.testNPE1(); LVNTests.testNPE2(); ZeroTests.longDivTest(); ZeroTests.longModTest(); MirOpSelectTests.testIfCcz(); ManyFloatArgs(); atomicLong(); LiveFlags.test(); minDoubleWith3ConstsTest(); }
Source:
public void visitSynchronizedStatement(SynchronizedStatementTree tree) { super.visitSynchronizedStatement(tree); hasSynchronizedStmt = true; }

Target:
public void visitSynchronizedStatement(SynchronizedStatementTree tree) { moreThanSingleLock = true; }
Source:
private boolean isFileExecutable(File archiveSrc) throws IOException { if(archiveSrc.exists()) { String startClass = new JarFile(archiveSrc).getManifest().getMainAttributes().getValue("Start-Class"); if(startClass != null) { return true; } } return false; }

Target:
private boolean isFileExecutable(File archiveSrc) throws IOException { if(archiveSrc.exists()) { Manifest manifest = new JarFile(archiveSrc).getManifest(); if(manifest != null) { String startClass = manifest.getMainAttributes().getValue("Start-Class"); if(startClass != null) { return true; } } } return false; }
Source:
public void run() { updateHappened = false; Logger.getLog().clearUserFacingLog(); Client client = new Client(config.SERVER_IP, config.SERVER_PORT); server = Server.forClient(client); if (!server.connect()) { errorInUpdates = true; closeWorker(); return; } ServerInfo serverInfo = server.info; switch (config.SYNC_MODE) { case 1: Mode1Sync.forServer(server).run(); break; case 2: Mode2Sync.forServer(server).run(); break; case 3: CheckUpdate.forServer(server).run(); break; default: Logger.error(String.format("Unknown server mode: %d", serverInfo.syncMode)); errorInUpdates = true; updateHappened = false; closeWorker(); return; } updateHappened = true; closeWorker(); if (ServerSync.clientGUI != null) { config.updateServerDetails(ServerSync.clientGUI.getIPAddress(), ServerSync.clientGUI.getPort()); } Logger.log(ServerSync.strings.getString("update_complete")); }

Target:
public void run() { updateHappened = false; Logger.getLog().clearUserFacingLog(); Client client = new Client(config.SERVER_IP, config.SERVER_PORT); server = Server.forClient(client); if (!server.connect()) { errorInUpdates = true; closeWorker(); return; } ServerInfo serverInfo = server.info; Mode2Sync sync = Mode2Sync.forServer(server); try { List<ActionEntry> actions = sync.generateActionList(sync.fetchManifest()); sync.executeActionList(actions); } catch (IOException e) { e.printStackTrace(); } updateHappened = true; closeWorker(); if (ServerSync.clientGUI != null) { config.updateServerDetails(ServerSync.clientGUI.getIPAddress(), ServerSync.clientGUI.getPort()); } Logger.log(ServerSync.strings.getString("update_complete")); }
Source:
public Source resolve(final String href, final String base) throws TransformerException { InputStream stream = this.getClass().getResourceAsStream( String.format(PATTERN, this.prefix, href) ); if (stream == null) { stream = this.getClass().getResourceAsStream( String.format(PATTERN, base, href) ); if (stream == null) { throw new TransformerException( String.format( "resource \"%s\" not found in classpath" + " with prefix \"%s\" and base \"%s\"", href, this.prefix, base ) ); } } return new StreamSource(stream); }

Target:
public Source resolve(final String href, final String base) throws TransformerException { InputStream stream = this.getClass().getResourceAsStream( String.format(ClasspathSources.PATTERN, this.prefix, href) ); if (stream == null) { stream = this.getClass().getResourceAsStream( String.format(ClasspathSources.PATTERN, base, href) ); if (stream == null) { throw new TransformerException( String.format( "resource \"%s\" not found in classpath with prefix \"%s\" and base \"%s\"", href, this.prefix, base ) ); } } return new StreamSource(stream); }
Source:
public void tearDown() { final NetworkSecurityGroup nsg = createGroup(); final NetworkSecurityGroupApi nsgApi = api.getNetworkSecurityGroupApi(resourcegroup); URI uri = nsgApi.delete(DEFAULT_NSG_NAME); if (uri != null) { boolean jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri); } }, 60 * 2 * 1000 ).apply(uri); } super.tearDown(); }

Target:
public void tearDown() { final NetworkSecurityGroupApi nsgApi = api.getNetworkSecurityGroupApi(resourcegroup); URI uri = nsgApi.delete(DEFAULT_NSG_NAME); if (uri != null) { boolean jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri); } }, 60 * 2 * 1000 ).apply(uri); } super.tearDown(); }
Source:
private ClassReader typeInfo(final String type) throws IOException, NullPointerException { logger.info("Computing type info for: {}", type); InputStream is = l.getResourceAsStream(type + ".class"); logger.debug("Loaded stream-is: {}",is); logger.debug("Current thread: {}",Thread.currentThread().getName()); try { if(is == null) throw new NullPointerException("Class not found "+type); return new ClassReader(is); } finally { if(is != null) is.close(); } }

Target:
private ClassReader typeInfo(final String type) throws IOException, NullPointerException { InputStream is = l.getResourceAsStream(type + ".class"); try { if(is == null) throw new NullPointerException("Class not found "+type); return new ClassReader(is); } finally { if(is != null) is.close(); } }
Source:
public void accept(IPDOMVisitor visitor) throws CoreException { Database db = linkage.getDB(); for (int item = 0; item < nextMemberPosition; item++) { final long memberRecord = db.getRecPtr(getMemberRecord(item)); if (record == 0) { throw new NullPointerException(); } PDOMNode node = linkage.getNode(memberRecord); if (visitor.visit(node) && node != null) { node.accept(visitor); } visitor.leave(node); } PDOMCPPMemberBlock nextBlock = getNextBlock(); if (nextBlock != null) { nextBlock.accept(visitor); } }

Target:
public void accept(IPDOMVisitor visitor) throws CoreException { PDOMCPPMemberBlock current = this; do { current.visitBlock(visitor); } while ((current = current.getNextBlock()) != null); }
Source:
public TaskStatus call() { final long startTime = System.currentTimeMillis(); final File taskDir = toolbox.getTaskWorkDir(); TaskStatus status; try { log.info("Running task: %s", task.getId()); status = task.run(toolbox); } catch (InterruptedException e) { log.error(e, "Interrupted while running task[%s]", task); throw Throwables.propagate(e); } catch (Exception e) { log.error(e, "Exception while running task[%s]", task); status = TaskStatus.failure(task.getId()); } catch (Throwable t) { t.printStackTrace(); log.error(t, "Uncaught Throwable while running task[%s]", task); throw Throwables.propagate(t); } try { if (taskDir.exists()) { log.info("Removing task directory: %s", taskDir); FileUtils.deleteDirectory(taskDir); } } catch (Exception e) { log.makeAlert(e, "Failed to delete task directory") .addData("taskDir", taskDir.toString()) .addData("task", task.getId()) .emit(); } try { return status.withDuration(System.currentTimeMillis() - startTime); } catch (Exception e) { log.error(e, "Uncaught Exception during callback for task[%s]", task); throw Throwables.propagate(e); } }

Target:
public TaskStatus call() { final long startTime = System.currentTimeMillis(); TaskStatus status; try { log.info("Running task: %s", task.getId()); TaskRunnerUtils.notifyLocationChanged( listeners, task.getId(), location ); TaskRunnerUtils.notifyStatusChanged(listeners, task.getId(), TaskStatus.running(task.getId())); status = task.run(toolbox); } catch (InterruptedException e) { if (stopping) { log.debug(e, "Interrupted while running task[%s] during graceful shutdown.", task); } else { log.warn(e, "Interrupted while running task[%s]", task); } status = TaskStatus.failure(task.getId()); } catch (Exception e) { log.error(e, "Exception while running task[%s]", task); status = TaskStatus.failure(task.getId()); } catch (Throwable t) { log.error(t, "Uncaught Throwable while running task[%s]", task); throw t; } status = status.withDuration(System.currentTimeMillis() - startTime); TaskRunnerUtils.notifyStatusChanged(listeners, task.getId(), status); return status; }
Source:
public Integer deleteVideoByVideoId(VideoModel video, DataCallback<Integer> callback, String username) { DbOperationDelete op = new DbOperationDelete(DbStructure.Table.DOWNLOADS, DbStructure.Column.VIDEO_ID + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{video.getVideoId(), username}); return enqueue(op); }

Target:
public Integer deleteVideoByVideoId(VideoModel video, DataCallback<Integer> callback, String username) { DbOperationDelete op = new DbOperationDelete(DbStructure.Table.DOWNLOADS, DbStructure.Column.VIDEO_ID + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{video.getVideoId(), username}); op.setCallback(callback); return enqueue(op); }
Source:
public void initialise() { this.playerCamera = worldRenderer.getActiveCamera(); this.shadowMapShader = worldRenderer.getMaterial("engine:prog.shadowMap"); this.renderingConfig = config.getRendering(); renderableWorld.setShadowMapCamera(shadowMapCamera); addDesiredStateChange(new BindFBO(SCENE_SHADOW_MAP)); addDesiredStateChange(new SetViewportSizeOf(SCENE_SHADOW_MAP)); addDesiredStateChange(new Clear(true, true, false)); addDesiredStateChange(new DisableCapability(GL_CULL_FACE)); }

Target:
public void initialise() { this.playerCamera = worldRenderer.getActiveCamera(); this.shadowMapShader = worldRenderer.getMaterial("engine:prog.shadowMap"); this.renderingConfig = config.getRendering(); renderableWorld.setShadowMapCamera(shadowMapCamera); requiresFBO(new FBOConfig(SHADOW_MAP, FBO.Type.NO_COLOR).useDepthBuffer(), shadowMapResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SHADOW_MAP, shadowMapResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(SHADOW_MAP, shadowMapResolutionDependentFBOs)); }
Source:
void simpleDeleteException(ClusterMap clusterMap) throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException { for (ServerErrorCode deleteErrorCode : deleteErrorMappings.keySet()) { MockConnectionPool.mockCluster = new MockCluster(clusterMap); induceDeleteFailure(TOTAL_HOST_COUNT, deleteErrorCode); AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap); for (int i = 0; i < 20; ++i) { BlobProperties putBlobProperties = new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time); ByteBuffer putUserMetadata = ByteBuffer.allocate(10); for (byte b = 0; b < 10; b++) { putUserMetadata.put(b); } ByteBuffer putContent = ByteBuffer.allocate(100); for (byte b = 0; b < 100; b++) { putContent.put(b); } putContent.flip(); String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent); getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent); try { deleteBlobAndGet(ac, blobId); fail("Deletion should have failed for " + deleteErrorCode); } catch (CoordinatorException e) { assertEquals(e.getErrorCode(), deleteErrorMappings.get(deleteErrorCode)); } } ac.close(); } }

Target:
void simpleDeleteException(ClusterMap clusterMap) throws JSONException, InterruptedException, StoreException, IOException, CoordinatorException { for (ServerErrorCode deleteErrorCode : deleteErrorMappings.keySet()) { MockConnectionPool.mockCluster = new MockCluster(clusterMap); induceDeleteFailure(TOTAL_HOST_COUNT, deleteErrorCode); AmbryCoordinator ac = new AmbryCoordinator(getVProps(), clusterMap); for (int i = 0; i < 20; ++i) { BlobProperties putBlobProperties = new BlobProperties(100, "serviceId", "memberId", "contentType", false, Utils.Infinite_Time); ByteBuffer putUserMetadata = getByteBuffer(10, false); ByteBuffer putContent = getByteBuffer(100, true); String blobId = putBlob(ac, putBlobProperties, putUserMetadata, putContent); getBlob(ac, blobId, putBlobProperties, putUserMetadata, putContent); try { deleteBlobAndGet(ac, blobId); fail("Deletion should have failed for " + deleteErrorCode); } catch (CoordinatorException e) { assertEquals(e.getErrorCode(), deleteErrorMappings.get(deleteErrorCode)); } } ac.close(); } }
Source:
public void onBindViewHolder(@NonNull PortalItemViewHolder holder, int position) { holder.bind(mPortalItemList.get(position), mOnItemClickListener); Log.d("stuff", mPortalItemList.get(position).getTitle()); }

Target:
public void onBindViewHolder(@NonNull PortalItemViewHolder holder, int position) { holder.bind(mPortalItemList.get(position), mOnItemClickListener); }
Source:
private void execute() throws ExecutionException { IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); operationHistory.execute(this, new NullProgressMonitor(), null ); }

Target:
private void execute() throws ExecutionException { IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory(); operationHistory.execute(this, new NullProgressMonitor(), info); }
Source:
public static NameMetadataDescription hydrateFromProto(TableMetadataPersistence.NameMetadataDescription message) { List<NameComponentDescription> list = Lists.newArrayList(); for (TableMetadataPersistence.NameComponentDescription part : message.getNamePartsList()) { list.add(NameComponentDescription.hydrateFromProto(part)); } int numberOfComponentsHashed = 0; if (message.getHasFirstComponentHash()) { numberOfComponentsHashed = 1; } else { numberOfComponentsHashed = message.getNumberOfComponentsHashed(); } return new NameMetadataDescription(list, numberOfComponentsHashed); }

Target:
public static NameMetadataDescription hydrateFromProto(TableMetadataPersistence.NameMetadataDescription message) { List<NameComponentDescription> list = Lists.newArrayList(); for (TableMetadataPersistence.NameComponentDescription part : message.getNamePartsList()) { list.add(NameComponentDescription.hydrateFromProto(part)); } return new NameMetadataDescription(list, getNumberOfComponentsHashedFromProto(message)); }
Source:
default List<T> append(T element) { final ArrayList<T> results = new ArrayList<>(size() + 1); for (T t : this) { results.add(t); } results.add(element); return ofAll(results); }

Target:
default List<T> append(T element) { return foldRight(of(element), (x, xs) -> xs.prepend(x)); }
Source:
public void testScalabilityOfLargeTrivialInitializer_253690() throws Exception { sValidateCopy= false; final int AMOUNT= 250000; final CharSequence[] input = getContents(3); StringBuilder buf= new StringBuilder(); buf.append(input[0].toString()); final String line= input[1].toString(); for (int i = 0; i < AMOUNT/10; i++) { buf.append(line); } buf.append(input[2].toString()); final String code= buf.toString(); for (ParserLanguage lang : ParserLanguage.values()) { long mem= memoryUsed(); IASTTranslationUnit tu= parse(code, lang, false, true, 0); long diff= memoryUsed()-mem; final int expected = code.length()*2 + AMOUNT + AMOUNT/2; assertTrue(String.valueOf(diff) + " expected < " + expected, diff < expected); assertTrue(tu.isFrozen()); } }

Target:
public void testScalabilityOfLargeTrivialInitializer_253690() throws Exception { sValidateCopy= false; final int AMOUNT= 250000; final CharSequence[] input = getContents(3); final String code= concatInput(input, new int[]{1, AMOUNT/10,1}); for (ParserLanguage lang : ParserLanguage.values()) { long mem= memoryUsed(); IASTTranslationUnit tu= parse(code, lang, false, true, 0); long diff= memoryUsed()-mem; final int expected = code.length()*2 + AMOUNT + AMOUNT/2; assertTrue(String.valueOf(diff) + " expected < " + expected, diff < expected); assertTrue(tu.isFrozen()); } }
Source:
void connect() { Preconditions.checkState(!client.isOpen()); Preconditions.checkState(!closed); Interruptibles.await( () -> client.connectBlocking(DEFAULT_CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)); }

Target:
void connect() { Preconditions.checkState(!client.isOpen()); Preconditions.checkState(!closed); final Result<Boolean> connectionAttempt = Interruptibles.awaitResult( () -> client.connectBlocking(DEFAULT_CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)); if (!connectionAttempt.completed || !connectionAttempt.result.orElse(false)) { throw new CouldNotConnect(client.getURI()); } }
Source:
private BasicInvocationStage primaryOwnerWrite(InvocationContext context, DataWriteCommand command, final DistributionInfo distributionInfo) { if (command.hasFlag(Flag.COMMAND_RETRY)) { command.setValueMatcher(command.getValueMatcher().matcherForRetry()); } return invokeNext(context, command).thenAccept((rCtx, rCommand, rv) -> { final DataWriteCommand dwCommand = (DataWriteCommand) rCommand; final CommandInvocationId id = dwCommand.getCommandInvocationId(); if (!dwCommand.isSuccessful()) { if (trace) { log.tracef("Command %s not successful in primary owner.", id); } return; } stateTransferLock.acquireSharedTopologyLock(); try { checkTopologyId(dwCommand); if (distributionInfo.owners().size() > 1) { Collection<Address> backupOwners = distributionInfo.backups(); if (rCtx.isOriginLocal() && (isSynchronous(dwCommand) || dwCommand.isReturnValueExpected())) { commandAckCollector.create(id, rv, distributionInfo.owners(), dwCommand.getTopologyId()); } if (trace) { log.tracef("Command %s send to backup owner %s.", dwCommand.getCommandInvocationId(), backupOwners); } rpcManager.sendToMany(backupOwners, commandsFactory.buildBackupWriteRcpCommand(dwCommand), DeliverOrder.PER_SENDER); } } finally { stateTransferLock.releaseSharedTopologyLock(); } }); }

Target:
private BasicInvocationStage primaryOwnerWrite(InvocationContext context, DataWriteCommand command, final DistributionInfo distributionInfo) { if (command.hasFlag(Flag.COMMAND_RETRY)) { command.setValueMatcher(command.getValueMatcher().matcherForRetry()); } return invokeNext(context, command).thenAccept((rCtx, rCommand, rv) -> { final DataWriteCommand dwCommand = (DataWriteCommand) rCommand; final CommandInvocationId id = dwCommand.getCommandInvocationId(); if (!dwCommand.isSuccessful()) { if (trace) { log.tracef("Command %s not successful in primary owner.", id); } return; } if (distributionInfo.owners().size() > 1) { Collection<Address> backupOwners = distributionInfo.backups(); if (rCtx.isOriginLocal() && (isSynchronous(dwCommand) || dwCommand.isReturnValueExpected())) { commandAckCollector.create(id, rv, distributionInfo.owners(), dwCommand.getTopologyId()); checkTopologyId(dwCommand); } if (trace) { log.tracef("Command %s send to backup owner %s.", dwCommand.getCommandInvocationId(), backupOwners); } rpcManager.sendToMany(backupOwners, commandsFactory.buildBackupWriteRcpCommand(dwCommand), DeliverOrder.PER_SENDER); } }); }
Source:
private void doPostCleanup(BibEntry entry) { new PageFieldCleanup().cleanup(entry); new FieldFormatterCleanup(StandardField.PAGES, new NormalizePagesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.URL, new ClearFormatter()).cleanup(entry); }

Target:
private void doPostCleanup(BibEntry entry) { new FieldFormatterCleanup(StandardField.PAGES, new NormalizePagesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.URL, new ClearFormatter()).cleanup(entry); }
Source:
public static EnumSet<WriteFlag> getWriteFlags(int flagValue) { EnumSet<WriteFlag> writeFlags = EnumSet.noneOf(WriteFlag.class); if ((flagValue & DEFERRED_SYNC.value) == DEFERRED_SYNC.value) { writeFlags.add(DEFERRED_SYNC); } if ((flagValue & DIGEST_TYPE_DUMMY.value) == DIGEST_TYPE_DUMMY.value) { writeFlags.add(DIGEST_TYPE_DUMMY); } else if ((flagValue & DIGEST_TYPE_CRC32.value) == DIGEST_TYPE_CRC32.value) { writeFlags.add(DIGEST_TYPE_CRC32); } else if ((flagValue & DIGEST_TYPE_CRC32C.value) == DIGEST_TYPE_CRC32C.value) { writeFlags.add(DIGEST_TYPE_CRC32C); } else if ((flagValue & DIGEST_TYPE_MAC.value) == DIGEST_TYPE_MAC.value) { writeFlags.add(DIGEST_TYPE_MAC); } return writeFlags; }

Target:
public static EnumSet<WriteFlag> getWriteFlags(int flagValue) { EnumSet<WriteFlag> writeFlags = EnumSet.noneOf(WriteFlag.class); if ((flagValue & DEFERRED_SYNC.value) == DEFERRED_SYNC.value) { writeFlags.add(DEFERRED_SYNC); } if ((flagValue & DIGEST_TYPE_BITS) == DIGEST_TYPE_DUMMY.value) { writeFlags.add(DIGEST_TYPE_DUMMY); } else if ((flagValue & DIGEST_TYPE_BITS) == DIGEST_TYPE_CRC32.value) { writeFlags.add(DIGEST_TYPE_CRC32); } else if ((flagValue & DIGEST_TYPE_BITS) == DIGEST_TYPE_CRC32C.value) { writeFlags.add(DIGEST_TYPE_CRC32C); } else if ((flagValue & DIGEST_TYPE_BITS) == DIGEST_TYPE_MAC.value) { writeFlags.add(DIGEST_TYPE_MAC); } return writeFlags; }
Source:
public CustomIcons get() { CustomIcons customIcons = new CustomIcons(projectIcons); return customIcons; }

Target:
public CustomIcons get() { return new CustomIcons(projectIcons); }
Source:
public List<MongoConfiguration> getConfigurations() { List<MongoConfiguration> mongoConfigurations = new ArrayList<>(); for (MongoConfiguration cfg : datasources.values()) { mongoConfigurations.add(cfg); } return Collections.unmodifiableList(mongoConfigurations); }

Target:
public Collection<MongoConfiguration> getConfigurations() { return Collections.unmodifiableCollection(datasources.values()); }
Source:
private static PackingPlan generatePacking(Map<Integer, List<InstanceId>> basePacking) { Resource resource = new Resource(2.0, 6 * Constants.GB, 25 * Constants.GB); Set<PackingPlan.ContainerPlan> containerPlans = new HashSet<>(); for (int containerId : basePacking.keySet()) { List<InstanceId> instanceList = basePacking.get(containerId); Set<PackingPlan.InstancePlan> instancePlans = new HashSet<>(); for (InstanceId instanceId : instanceList) { String componentName = instanceId.getComponentName(); Resource instanceResource; if ("bolt".equals(componentName)) { instanceResource = new Resource(1.0, 2 * Constants.GB, 10 * Constants.GB); } else { instanceResource = new Resource(1.0, 3 * Constants.GB, 10 * Constants.GB); } instancePlans.add(new PackingPlan.InstancePlan(instanceId, instanceResource)); } PackingPlan.ContainerPlan containerPlan = new PackingPlan.ContainerPlan(containerId, instancePlans, resource); containerPlans.add(containerPlan); } return new PackingPlan("", containerPlans); }

Target:
private static PackingPlan generatePacking(Map<Integer, List<InstanceId>> basePacking) throws RuntimeException { Resource resource = new Resource(2.0, 6 * Constants.GB, 25 * Constants.GB); Set<PackingPlan.ContainerPlan> containerPlans = new HashSet<>(); for (int containerId : basePacking.keySet()) { List<InstanceId> instanceList = basePacking.get(containerId); Set<PackingPlan.InstancePlan> instancePlans = new HashSet<>(); for (InstanceId instanceId : instanceList) { String componentName = instanceId.getComponentName(); Resource instanceResource; switch (componentName) { case "bolt": instanceResource = new Resource(1.0, 2 * Constants.GB, 10 * Constants.GB); break; case "spout": instanceResource = new Resource(1.0, 3 * Constants.GB, 10 * Constants.GB); break; default: throw new RuntimeException(String.format("%s is not a valid component name", componentName)); } instancePlans.add(new PackingPlan.InstancePlan(instanceId, instanceResource)); } PackingPlan.ContainerPlan containerPlan = new PackingPlan.ContainerPlan(containerId, instancePlans, resource); containerPlans.add(containerPlan); } return new PackingPlan("", containerPlans); }
Source:
public static Datum createFromString(DataType dataType, String value) { switch (dataType.getType()) { case BOOLEAN: return createBool(value.equals(BooleanDatum.TRUE_STRING)); case INT2: return createInt2(value); case INT4: return createInt4(value); case INT8: return createInt8(value); case FLOAT4: return createFloat4(value); case FLOAT8: return createFloat8(value); case CHAR: return createChar(value); case TEXT: return createText(value); case DATE: return createDate(value); case TIME: return createTime(value); case TIMESTAMP: return createTimestamp(value); case INTERVAL: return createInterval(value); case BLOB: return createBlob(value); case INET4: return createInet4(value); default: throw new TajoRuntimeException(Errors.ResultCode.UNSUPPORTED_DATATYPE, dataType.toString()); } }

Target:
public static Datum createFromString(DataType dataType, String value) { switch (dataType.getType()) { case BOOLEAN: return createBool(value.equals(BooleanDatum.TRUE_STRING)); case INT2: return createInt2(value); case INT4: return createInt4(value); case INT8: return createInt8(value); case FLOAT4: return createFloat4(value); case FLOAT8: return createFloat8(value); case CHAR: return createChar(value); case TEXT: return createText(value); case DATE: return createDate(value); case TIME: return createTime(value); case TIMESTAMP: return createTimestamp(value); case INTERVAL: return createInterval(value); case BLOB: return createBlob(value); case INET4: return createInet4(value); default: throw new TajoRuntimeException(new UnsupportedDataTypeException(dataType.toString())); } }
Source:
public static @NonNull String startTime() { return Objects.requireNonNull(Messages.TmfTime_StartTime); }

Target:
public static @NonNull String startTime() { return Objects.requireNonNull(Messages.TmfStrings_StartTime); }
Source:
protected void launchCurrentAppOnPlayStore() { String appPackageName = getPackageName(); if(BuildConfig.DEBUG) { appPackageName = appPackageName.replace(".debug", ""); } try { startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)), DO_AN_UPDATE); } catch (android.content.ActivityNotFoundException e) { startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>" + appPackageName)), DO_AN_UPDATE); } }

Target:
protected void launchCurrentAppOnPlayStore() { String appPackageName = getPackageName(); if (BuildConfig.DEBUG) { appPackageName = "org.commcare.dalvik"; } try { startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)), DO_AN_UPDATE); } catch (android.content.ActivityNotFoundException e) { startActivityForResult(new Intent(Intent.ACTION_VIEW, Uri.parse("<LINK_0>" + appPackageName)), DO_AN_UPDATE); } }
Source:
private void processPipelineReport(PipelineReport report, DatanodeDetails dn) throws IOException { PipelineID pipelineID = PipelineID.getFromProtobuf(report.getPipelineID()); Pipeline pipeline; try { pipeline = pipelineManager.getPipeline(pipelineID); } catch (PipelineNotFoundException e) { RatisPipelineUtils.destroyPipeline(dn, pipelineID, conf, pipelineManager.getGrpcTlsConfig()); return; } if (report.hasLeaderID()) { Map<UUID, ByteString> ids = reportedLeadersForPipeline.computeIfAbsent(pipelineID, k -> new HashMap<>()); ids.put(dn.getUuid(), report.getLeaderID()); } if (pipeline.getPipelineState() == Pipeline.PipelineState.ALLOCATED) { LOGGER.info("Pipeline reported by with leaderId {}", pipeline.getId(), dn, report.getLeaderID().toStringUtf8()); Map<UUID, ByteString> leaderIdPairs = reportedLeadersForPipeline.get(pipelineID); if (leaderIdPairs.size() == pipeline.getFactor().getNumber() && leaderIdPairs.values().stream().distinct().count() == 1) { pipelineManager.openPipeline(pipelineID); pipeline.setLeaderId( RaftPeerId.valueOf(report.getLeaderID().toString())); } } else { pipeline.reportDatanode(dn); } }

Target:
private void processPipelineReport(PipelineReport report, DatanodeDetails dn) throws IOException { PipelineID pipelineID = PipelineID.getFromProtobuf(report.getPipelineID()); Pipeline pipeline; try { pipeline = pipelineManager.getPipeline(pipelineID); } catch (PipelineNotFoundException e) { RatisPipelineUtils.destroyPipeline(dn, pipelineID, conf, pipelineManager.getGrpcTlsConfig()); return; } if (report.hasLeaderID()) { Map<UUID, ByteString> ids = reportedLeadersForPipeline.computeIfAbsent(pipelineID, k -> new HashMap<>()); ids.put(dn.getUuid(), report.getLeaderID()); pipeline.setLeaderId(pipeline.getLeaderId()); } if (pipeline.getPipelineState() == Pipeline.PipelineState.ALLOCATED) { LOGGER.info("Pipeline reported by with leaderId {}", pipeline.getId(), dn, report.getLeaderID().toStringUtf8()); Map<UUID, ByteString> leaderIdPairs = reportedLeadersForPipeline.get(pipelineID); if (leaderIdPairs.size() == pipeline.getFactor().getNumber() && leaderIdPairs.values().stream().distinct().count() == 1) { pipelineManager.openPipeline(pipelineID); } } else { pipeline.reportDatanode(dn); } }
Source:
public VdcActionParametersBase() { shouldbelogged = true; transctionOption = TransactionScopeOption.Required; setTaskGroupSuccess(true); setParentCommand(VdcActionType.Unknown); executionReason = CommandExecutionReason.REGULAR_FLOW; compensationEnabled = false; parentCommand = VdcActionType.Unknown; commandType = VdcActionType.Unknown; imagesParameters = new ArrayList<VdcActionParametersBase>(); lifeInMinutes = Config.<Integer>getValue(ConfigValues.CoCoCommandLifeInMinutes); }

Target:
public VdcActionParametersBase() { shouldbelogged = true; transctionOption = TransactionScopeOption.Required; setTaskGroupSuccess(true); setParentCommand(VdcActionType.Unknown); executionReason = CommandExecutionReason.REGULAR_FLOW; compensationEnabled = false; parentCommand = VdcActionType.Unknown; commandType = VdcActionType.Unknown; imagesParameters = new ArrayList<VdcActionParametersBase>(); }
Source:
protected static String getLineDelimiterPreference(IFile file) { IScopeContext[] scopeContext; if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } scopeContext = new IScopeContext[] { InstanceScope.INSTANCE }; return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, scopeContext); }

Target:
protected static String getLineDelimiterPreference(IFile file) { if (file != null) { ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager(); ITextFileBuffer buffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE); if (buffer != null) { return TextUtilities.getDefaultLineDelimiter(buffer.getDocument()); } } return Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, null, null); }
Source:
protected void prepareTestData() { testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); course = testData.courses.get("anotherCourse"); newSession = FeedbackSessionAttributes .builder("New Session ##", course.getId(), "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) .withCreatedTime(Const.TIME_REPRESENTS_NOW) .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriodMinutes(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(course.getTimeZone()) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }

Target:
protected void prepareTestData() { testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); course = testData.courses.get("anotherCourse"); newSession = FeedbackSessionAttributes .builder("New Session ##", course.getId(), "teammates.test1@gmail.tmt") .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) .withCreatedTime(Const.TIME_REPRESENTS_NEVER) .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .withGracePeriodMinutes(0) .withInstructions(new Text("Please fill in the new feedback session.")) .withSentOpenEmail(false) .withSentPublishedEmail(false) .withTimeZone(course.getTimeZone()) .withClosingEmailEnabled(true) .withPublishedEmailEnabled(true) .build(); }
Source:
private void onBoardNew() { logger.info("Menu: Boards > New"); if (confirmNewBoardCreation()) { panels.closeAllPanels(); onBoardSaveAs(); } else { logger.info("New board creation cancelled"); } }

Target:
private void onBoardNew() { logger.info("Menu: Boards > New"); if (!isNewBoardCreationDialogConfirmed()) { logger.info("New board creation cancelled"); return; } panels.closeAllPanels(); onBoardSaveAs(); }
Source:
public void removeTag(String tag) { tags.remove(tags.stream().filter(t -> t.equalsIgnoreCase(tag)).findFirst().orElse("")); }

Target:
public void removeTag(String tag) { tags.remove(tags.stream().filter(t -> t.equalsIgnoreCase(tag)).findFirst().orElse(tag)); }
Source:
protected final boolean mustCheckName(DetailAST ast) { final DetailAST modifiersAST = ast.findFirstToken(TokenTypes.MODIFIERS); boolean isStatic = false; if (!ScopeUtil.isInPatternDefinition(ast)) { isStatic = modifiersAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null; } return modifiersAST != null && !isStatic && !ScopeUtil.isInInterfaceOrAnnotationBlock(ast) && !ScopeUtil.isLocalVariableDef(ast) && shouldCheckInScope(modifiersAST); }

Target:
protected final boolean mustCheckName(DetailAST ast) { final DetailAST modifiersAST = ast.findFirstToken(TokenTypes.MODIFIERS); final boolean isStatic = modifiersAST != null && modifiersAST.findFirstToken(TokenTypes.LITERAL_STATIC) != null; return modifiersAST != null && !isStatic && !ScopeUtil.isInInterfaceOrAnnotationBlock(ast) && !ScopeUtil.isLocalVariableDef(ast) && shouldCheckInScope(modifiersAST); }
Source:
public QueryRequest createQueryRequest(String localSource, FilterBuilder filterBuilder) { List<SortBy> sortBys = sorts .stream() .filter( s -> StringUtils.isNotEmpty(s.getAttribute()) && StringUtils.isNotEmpty(s.getDirection())) .map(s -> parseSort(s.getAttribute(), s.getDirection())) .collect(Collectors.toList()); if (sortBys.isEmpty()) { sortBys.add(new SortByImpl(Result.TEMPORAL, DEFAULT_SORT_ORDER)); } Query query = new QueryImpl(createFilter(filterBuilder), start, count, sortBys.get(0), true, timeout); QueryRequest queryRequest; if (srcs != null && srcs.length != 0) { parseSrcs(localSource); queryRequest = new QueryRequestImpl(query, Arrays.asList(srcs)); queryRequest.getProperties().put(MODE, "update"); } else { String source = parseSrc(localSource); if (CACHE_SOURCE.equals(source)) { queryRequest = new QueryRequestImpl(query, true); queryRequest.getProperties().put(MODE, CACHE_SOURCE); } else { queryRequest = new QueryRequestImpl(query, Collections.singleton(source)); queryRequest.getProperties().put(MODE, "update"); } } if (excludeUnnecessaryAttributes) { queryRequest .getProperties() .put("excludeAttributes", Sets.newHashSet(Metacard.METADATA, "lux")); } if (sortBys.size() > 1) { queryRequest .getProperties() .put(ADDITIONAL_SORT_BYS, sortBys.subList(1, sortBys.size()).toArray(new SortBy[0])); } queryRequest.getProperties().put("requestId", id); if (StringUtils.isNotEmpty(batchId)) { queryRequest.getProperties().put("batchId", batchId); } if (StringUtils.isNotEmpty(queryType)) { queryRequest.getProperties().put("queryType", queryType); } return queryRequest; }

Target:
public QueryRequest createQueryRequest(String localSource, FilterBuilder filterBuilder) { List<SortBy> sortBys = sorts .stream() .filter( s -> StringUtils.isNotEmpty(s.getAttribute()) && StringUtils.isNotEmpty(s.getDirection())) .map(s -> parseSort(s.getAttribute(), s.getDirection())) .collect(Collectors.toList()); if (sortBys.isEmpty()) { sortBys.add(new SortByImpl(Result.TEMPORAL, DEFAULT_SORT_ORDER)); } Query query = new QueryImpl(createFilter(filterBuilder), start, count, sortBys.get(0), true, timeout); QueryRequest queryRequest; if (!CollectionUtils.isEmpty(srcs)) { parseSrcs(localSource); queryRequest = new QueryRequestImpl(query, srcs); queryRequest.getProperties().put(MODE, UPDATE); } else { String source = parseSrc(localSource); if (CACHE_SOURCE.equals(source)) { queryRequest = new QueryRequestImpl(query, true); queryRequest.getProperties().put(MODE, CACHE_SOURCE); } else { queryRequest = new QueryRequestImpl(query, Collections.singleton(source)); queryRequest.getProperties().put(MODE, UPDATE); } } if (excludeUnnecessaryAttributes) { queryRequest .getProperties() .put("excludeAttributes", Sets.newHashSet(Metacard.METADATA, "lux")); } if (sortBys.size() > 1) { queryRequest .getProperties() .put(ADDITIONAL_SORT_BYS, sortBys.subList(1, sortBys.size()).toArray(new SortBy[0])); } queryRequest.getProperties().put("requestId", id); if (StringUtils.isNotEmpty(batchId)) { queryRequest.getProperties().put("batchId", batchId); } if (StringUtils.isNotEmpty(queryType)) { queryRequest.getProperties().put("queryType", queryType); } return queryRequest; }
Source:
private void updateCommentList(CommentAttributes comment, boolean isCurrentInstructorGiver, List<CommentAttributes> commentList) { if (isViewingDraft || isCurrentInstructorGiver) { commentList.add(comment); } else { if (isInstructorAllowedForPrivilegeOnComment(comment, instructor, courseId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS)) { commentList.add(comment); } } }

Target:
private void updateCommentList(CommentAttributes comment, boolean isCurrentInstructorGiver, List<CommentAttributes> commentList) { if (isViewingDraft || isCurrentInstructorGiver) { commentList.add(comment); } else if (isInstructorAllowedForPrivilegeOnComment(comment, instructor, courseId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS)) { commentList.add(comment); } }
Source:
private void notifyErrorContext(Connection connection, ErrorCondition condition) { if (connection == null || connection.getRemoteState() == EndpointState.CLOSED) { return; } if (condition == null) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "connectionId[%s] notifyErrorContext does not have an ErrorCondition.", getConnectionId()))); } final Throwable exception = ExceptionUtil.toException(condition.getCondition().toString(), condition.getDescription(), getErrorContext()); onNext(exception); }

Target:
private void notifyErrorContext(Connection connection, ErrorCondition condition) { if (connection == null || connection.getRemoteState() == EndpointState.CLOSED) { return; } if (condition == null) { throw logger.logExceptionAsError(new IllegalStateException(String.format( "connectionId[%s]: notifyErrorContext does not have an ErrorCondition.", getConnectionId()))); } final Throwable exception = ExceptionUtil.toException(condition.getCondition().toString(), condition.getDescription(), getErrorContext()); onNext(exception); }
Source:
void record(int statusCode, long micros) { switch (statusCode / 100) { case 1: informational.update(micros, MICROS); break; case 2: successful.update(micros, MICROS); break; case 3: redirection.update(micros, MICROS); break; case 4: clientError.update(micros, MICROS); break; case 5: serverError.update(micros, MICROS); break; default: other.update(micros, MICROS); break; } lastUpdate = Instant.now(clock); }

Target:
void record(int statusCode, long micros) { switch (statusCode / 100) { case 1: informational.update(micros, MICROS); break; case 2: successful.update(micros, MICROS); break; case 3: redirection.update(micros, MICROS); break; case 4: clientError.update(micros, MICROS); break; case 5: serverError.update(micros, MICROS); break; default: other.update(micros, MICROS); break; } lastUpdateEpochMillis = clock.millis(); }
Source:
public static void load(File file) { try { LineIterator it = IOUtils.lineIterator(new FileInputStream(file), "UTF-8"); while (it.hasNext()) { String line = it.next(); if (!line.startsWith("#") && !line.trim().isEmpty()) { add(line); } } } catch (Exception e) { throw new WindupException("Failed loading archive ignore patterns from [" + file.toString() + "]", e); } }

Target:
public static void load(File file) { try(FileInputStream inputStream = new FileInputStream(file)) { LineIterator it = IOUtils.lineIterator(inputStream, "UTF-8"); while (it.hasNext()) { String line = it.next(); if (!line.startsWith("#") && !line.trim().isEmpty()) { add(line); } } } catch (Exception e) { throw new WindupException("Failed loading archive ignore patterns from [" + file.toString() + "]", e); } }