auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run() throws Exception { boolean hasInterceptor = mapServiceContext.hasInterceptor(name); List<Data> keyValueSequence = this.keyValueSequence; for (int i = 0; i < keyValueSequence.size(); i += 2) { Data key = keyValueSequence.get(i); Data dataValue = keyValueSequence.get(i + 1); checkNotNull(key, "Key loaded by a MapLoader cannot be null."); Object value = hasInterceptor ? mapServiceContext.toObject(dataValue) : dataValue; recordStore.putFromLoad(key, value, getCallerAddress()); if (value != null && !recordStore.existInMemory(key)) { continue; } if (value != null) { callAfterPutInterceptors(value); } Record record = recordStore.getRecord(key); if (isPostProcessing(recordStore)) { checkNotNull(record, "Value loaded by a MapLoader cannot be null."); value = record.getValue(); } publishWanUpdate(key, value); addInvalidation(key); } }

Target:
public void run() throws Exception { boolean hasInterceptor = mapServiceContext.hasInterceptor(name); List<Data> keyValueSequence = this.keyValueSequence; for (int i = 0; i < keyValueSequence.size(); i += 2) { Data key = keyValueSequence.get(i); Data dataValue = keyValueSequence.get(i + 1); checkNotNull(key, "Key loaded by a MapLoader cannot be null."); Object value = hasInterceptor ? mapServiceContext.toObject(dataValue) : dataValue; recordStore.putFromLoad(key, value, getCallerAddress()); if (value != null && !recordStore.existInMemory(key)) { continue; } if (value != null) { callAfterPutInterceptors(value); } if (isPostProcessing(recordStore)) { Record record = recordStore.getRecord(key); checkNotNull(record, "Value loaded by a MapLoader cannot be null."); value = record.getValue(); } publishWanUpdate(key, value); addInvalidation(key); } }
Source:
void initialize(ServerConfiguration conf, LedgerManager ledgerManager, LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager, StateManager stateManager, CheckpointSource checkpointSource, Checkpointer checkpointer, StatsLogger statsLogger) throws IOException; void start(); void shutdown() throws InterruptedException; boolean ledgerExists(long ledgerId) throws IOException; boolean setFenced(long ledgerId) throws IOException; boolean isFenced(long ledgerId) throws IOException; void setMasterKey(long ledgerId, byte[] masterKey) throws IOException; byte[] readMasterKey(long ledgerId) throws IOException, BookieException; long addEntry(ByteBuf entry) throws IOException, BookieException; ByteBuf getEntry(long ledgerId, long entryId) throws IOException, Bookie.NoEntryException; long getLastAddConfirmed(long ledgerId) throws IOException; boolean waitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException; void flush() throws IOException; void checkpoint(Checkpoint checkpoint) throws IOException; void deleteLedger(long ledgerId) throws IOException; interface LedgerDeletionListener { void ledgerDeleted(long ledgerId); }

Target:
void initialize(ServerConfiguration conf, LedgerManager ledgerManager, LedgerDirsManager ledgerDirsManager, LedgerDirsManager indexDirsManager, StateManager stateManager, CheckpointSource checkpointSource, Checkpointer checkpointer, StatsLogger statsLogger) throws IOException; void start(); void shutdown() throws InterruptedException; boolean ledgerExists(long ledgerId) throws IOException; boolean setFenced(long ledgerId) throws IOException; boolean isFenced(long ledgerId) throws IOException; void setMasterKey(long ledgerId, byte[] masterKey) throws IOException; byte[] readMasterKey(long ledgerId) throws IOException, BookieException; long addEntry(ByteBuf entry) throws IOException, BookieException; ByteBuf getEntry(long ledgerId, long entryId) throws IOException; long getLastAddConfirmed(long ledgerId) throws IOException; boolean waitForLastAddConfirmedUpdate(long ledgerId, long previousLAC, Watcher<LastAddConfirmedUpdateNotification> watcher) throws IOException; void flush() throws IOException; void checkpoint(Checkpoint checkpoint) throws IOException; void deleteLedger(long ledgerId) throws IOException; interface LedgerDeletionListener { void ledgerDeleted(long ledgerId); }
Source:
public void deleteRole(String username, String role) { throw new RuntimeException("Deleting a role is not supporting in LDAP"); }

Target:
public void deleteRole(String username, String role) { throw new UnsupportedOperationException("Deleting a role is not supporting in LDAP"); }
Source:
private void checkSpaceForStatement(Tree tree) { boolean shouldReportIssue = false; Iterator<Tree> it = ((PHPTree) tree).childrenIterator(); Tree next; Tree previous = null; while (it.hasNext()) { next = it.next(); if (isSemicolon(previous)) { SyntaxToken semicolonToken = (SyntaxToken) previous; SyntaxToken nextToken = ((PHPTree) next).getFirstToken(); int nbSpace = TokenUtils.getNbSpaceBetween(semicolonToken, nextToken); if (nbSpace != 1 && TokenUtils.isOnSameLine(semicolonToken, nextToken)) { shouldReportIssue = true; } } previous = next; } if (shouldReportIssue) { check.reportIssue(FOR_SEMICOLON_MESSAGE, tree); } }

Target:
private void checkSpaceForStatement(Tree tree) { Iterator<Tree> iterator = ((PHPTree) tree).childrenIterator(); Tree next; Tree previous = null; while (iterator.hasNext()) { next = iterator.next(); if (isSemicolon(previous)) { SyntaxToken semicolonToken = (SyntaxToken) previous; SyntaxToken nextToken = ((PHPTree) next).getFirstToken(); int nbSpace = TokenUtils.getNbSpaceBetween(semicolonToken, nextToken); if (nbSpace != 1 && TokenUtils.isOnSameLine(semicolonToken, nextToken)) { check.reportIssue(FOR_SEMICOLON_MESSAGE, tree); break; } } previous = next; } }
Source:
public void publishComments(final PatchSet.Id psid, final String message, final Set<ApprovalCategoryValue.Id> approvals, final AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException, Failure { final PublishResult r; r = db.run(new OrmRunnable<PublishResult, ReviewDb>() { public PublishResult run(ReviewDb db, Transaction txn, boolean retry) throws OrmException { return doPublishComments(psid, message, approvals, db, txn); } }); try { final CommentSender cm = new CommentSender(server, r.change); cm.setFrom(Common.getAccountId()); cm.setPatchSet(r.patchSet, PatchSetInfoFactory.patchSetInfoFromPatchSetId(psid)); cm.setChangeMessage(r.message); cm.setPatchLineComments(r.comments); cm.setReviewDb(db); cm.setHttpServletRequest(GerritJsonServlet.getCurrentCall() .getHttpServletRequest()); cm.send(); } catch (EmailException e) { log.error("Cannot send comments by email for patch set " + psid, e); throw new Failure(e); } catch (PatchSetInfoNotAvailableException e) { log.error("Failed to obtain PatchSetInfo for patch set " + psid, e); throw new Failure(e); } return VoidResult.INSTANCE; } }); }

Target:
public void publishComments(final PatchSet.Id psid, final String message, final Set<ApprovalCategoryValue.Id> approvals, final AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException, Failure { final PublishResult r; r = db.run(new OrmRunnable<PublishResult, ReviewDb>() { public PublishResult run(ReviewDb db, Transaction txn, boolean retry) throws OrmException { return doPublishComments(psid, message, approvals, db, txn); } }); try { final CommentSender cm = new CommentSender(server, r.change); cm.setFrom(Common.getAccountId()); cm.setPatchSet(r.patchSet, patchSetInfoFactory.patchSetInfoFromPatchSetId(psid)); cm.setChangeMessage(r.message); cm.setPatchLineComments(r.comments); cm.setReviewDb(db); cm.setHttpServletRequest(GerritJsonServlet.getCurrentCall() .getHttpServletRequest()); cm.send(); } catch (EmailException e) { log.error("Cannot send comments by email for patch set " + psid, e); throw new Failure(e); } catch (PatchSetInfoNotAvailableException e) { log.error("Failed to obtain PatchSetInfo for patch set " + psid, e); throw new Failure(e); } return VoidResult.INSTANCE; } }); }
Source:
public void end() throws Exception { super.init(); super.cleanup(); logViewer = null; }

Target:
public void end() throws Exception { super.cleanup(); logViewer = null; }
Source:
private static X509Certificate setupProviderCert() throws IOException, CertificateException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); return (X509Certificate) cf.generateCertificate(ProductBodyguard.class.getResourceAsStream("/com/eviware/soapui/plugins/pubkey_smartbear_codesigning-fromjks.key")); }

Target:
private static X509Certificate setupProviderCert() throws IOException, CertificateException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); return (X509Certificate) cf.generateCertificate(ProductBodyguard.class.getResourceAsStream("/com/eviware/soapui/plugins/PublicKey.key")); }
Source:
public AbstractRemoteFileOutboundGateway(RemoteFileTemplate<F> remoteFileTemplate, Command command, @Nullable String expressionArg) { Assert.notNull(remoteFileTemplate, "'remoteFileTemplate' cannot be null"); this.remoteFileTemplate = remoteFileTemplate; this.command = command; String expression = expressionArg; boolean noExpressionNeeded = Command.LS.equals(this.command) || Command.NLST.equals(this.command) || Command.PUT.equals(this.command) || Command.MPUT.equals(this.command); if ("++xsd.expression.default++".equals(expression)) { expression = noExpressionNeeded ? null : "payload"; } if (expression == null) { Assert.state(noExpressionNeeded, "Only LS, and NLST commands can rely on the working directory.\n" + "PUT and MPUT commands always use the payload.\n" + "All other commands must be supplied with a filename expression"); this.fileNameProcessor = null; } else { Expression parsedExpression = new SpelExpressionParser().parseExpression(expression); this.fileNameProcessor = new ExpressionEvaluatingMessageProcessor<>(parsedExpression); setPrimaryExpression(parsedExpression); } this.messageSessionCallback = null; remoteFileTemplateExplicitlySet(true); }

Target:
public AbstractRemoteFileOutboundGateway(RemoteFileTemplate<F> remoteFileTemplate, Command command, @Nullable String expressionArg) { Assert.notNull(remoteFileTemplate, "'remoteFileTemplate' cannot be null"); this.remoteFileTemplate = remoteFileTemplate; this.command = command; String expression = expressionArg; boolean expressionNeeded = !(Command.LS.equals(this.command) || Command.NLST.equals(this.command) || Command.PUT.equals(this.command) || Command.MPUT.equals(this.command)); if (!StringUtils.hasText(expression) && expressionNeeded) { expression = "payload"; } if (!StringUtils.hasText(expression)) { this.fileNameProcessor = null; } else { Expression parsedExpression = new SpelExpressionParser().parseExpression(expression); this.fileNameProcessor = new ExpressionEvaluatingMessageProcessor<>(parsedExpression); setPrimaryExpression(parsedExpression); } this.messageSessionCallback = null; remoteFileTemplateExplicitlySet(true); }
Source:
private String getGitPath(IFileRevision revision) { if (revision instanceof CommitFileRevision) { return ((CommitFileRevision) revision).getGitPath(); } IResourceVariant variant = Adapters.adapt((revision), IResourceVariant.class); if (variant instanceof GitRemoteResource) { return ((GitRemoteResource) variant).getPath(); } return null; }

Target:
private String getGitPath(IFileRevision revision) { if (revision instanceof CommitFileRevision) { return ((CommitFileRevision) revision).getGitPath(); } IResourceVariant variant = Adapters.adapt(revision, IResourceVariant.class); if (variant instanceof GitRemoteResource) { return ((GitRemoteResource) variant).getPath(); } return null; }
Source:
private <A> void setPrimitiveArray(int parameterIndex, A in) throws SQLException { final PrimitiveArraySupport.ArrayToString<A> arrayToString = PrimitiveArraySupport.getArrayToString(in); final int oid = arrayToString.getDefaultArrayTypeOid(); if (arrayToString.supportBinaryRepresentation() && connection.getPreferQueryMode() != PreferQueryMode.SIMPLE) { bindBytes(parameterIndex, arrayToString.toBinaryRepresentation(in), oid); } else { final char delim = connection.getTypeInfo().getArrayDelimiter(oid); setString(parameterIndex, arrayToString.toArrayString(delim, in), oid); } }

Target:
private <A> void setPrimitiveArray(int parameterIndex, A in) throws SQLException { final PrimitiveArraySupport<A> arrayToString = PrimitiveArraySupport.getArraySupport(in); final TypeInfo typeInfo = connection.getTypeInfo(); final int oid = arrayToString.getDefaultArrayTypeOid(typeInfo); if (arrayToString.supportBinaryRepresentation() && connection.getPreferQueryMode() != PreferQueryMode.SIMPLE) { bindBytes(parameterIndex, arrayToString.toBinaryRepresentation(connection, in), oid); } else { final char delim = typeInfo.getArrayDelimiter(oid); setString(parameterIndex, arrayToString.toArrayString(delim, in), oid); } }
Source:
private void fillResetPasswordForm(final RecoverPasswordPageContent viewModel, final Void input, final Form<? extends RecoverPasswordFormData> form) { viewModel.setPasswordRecoveryForm(form); }

Target:
protected void fillResetPasswordForm(final RecoverPasswordPageContent viewModel, final Void input, final Form<? extends RecoverPasswordFormData> form) { viewModel.setPasswordRecoveryForm(form); }
Source:
public final void endRecord() { getReceiver().process(builder.toString()); builder = new StringBuilder(); }

Target:
public void endRecord() { getReceiver().process(builder.toString()); this.entityOpen = false; }
Source:
void setHttpPath(final URL httpPath) { final String authority = httpPath.getAuthority(); final Discovery discovery = new Discovery(); if (!discovery.getValidHosts().contains(authority)) { return; } final String[] splitArray = httpPath.getPath().split("/"); final StringBuilder logPath = new StringBuilder(); logPath.append(httpPath.getProtocol()); logPath.append("://"); logPath.append(authority); logPath.append("/"); for (int i = 2; i < splitArray.length; i++) { logPath.append(splitArray[i]); logPath.append("/"); } setEvent(EventStrings.HTTP_PATH, logPath.toString()); }

Target:
void setHttpPath(final URL httpPath) { final String authority = httpPath.getAuthority(); final Discovery discovery = new Discovery(); if (!discovery.getValidHosts().contains(authority)) { return; } final String[] splitArray = httpPath.getPath().split("/"); final StringBuilder logPath = new StringBuilder(); logPath.append(httpPath.getProtocol()); logPath.append("://"); logPath.append(authority); logPath.append("/"); for (int i = 2; i < splitArray.length; i++) { logPath.append(splitArray[i]); logPath.append("/"); } setProperty(EventStrings.HTTP_PATH, logPath.toString()); }
Source:
public void testGetCompletionTimesSingleFragment() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(1234); trace1.getNodes().add(c1); tracePublisher.publish(null, Collections.singletonList(trace1)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(1234, times.get(0).getDuration()); }

Target:
public void testGetCompletionTimesSingleFragment() throws Exception { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(1234); trace1.getNodes().add(c1); tracePublisher.publish(null, Collections.singletonList(trace1)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(1234, times.get(0).getDuration()); }
Source:
private String readStringFromExtendedJson() { JsonToken patternToken = popToken(); if (patternToken.getType() != JsonTokenType.STRING && patternToken.getType() != JsonTokenType.UNQUOTED_STRING) { throw new JsonParseException("JSON reader expected a string but found '%s'.", patternToken.getValue()); } return patternToken.getValue(String.class); }

Target:
private String readStringFromExtendedJson() { JsonToken patternToken = popToken(); if (patternToken.getType() != JsonTokenType.STRING) { throw new JsonParseException("JSON reader expected a string but found '%s'.", patternToken.getValue()); } return patternToken.getValue(String.class); }
Source:
private Map<Class<? extends Event>, Map<String, RegisteredListener>> getListenersByEvent() { if (this.listenersByEvent == null) { initializeListeners(); } synchronized (this.listenersByEvent) { return this.listenersByEvent; } }

Target:
private Map<Class<? extends Event>, Map<String, RegisteredListener>> getListenersByEvent() { if (this.listenersByEvent == null) { initializeListeners(); } return this.listenersByEvent; }
Source:
private static SubclassLoader tryLookup() { try { Class<?> methodHandles = Class.forName("java.lang.invoke.MethodHandles"); Object lookup = methodHandles.getMethod("lookup").invoke(null); Method privateLookupIn = methodHandles.getMethod("privateLookupIn", Class.class, Class.forName("java.lang.invoke.MethodHandles$Lookup")); Object codegenLookup = privateLookupIn.invoke(null, InjectionBase.class, lookup); return new WithLookup(lookup, codegenLookup, privateLookupIn); } catch (Exception ignored) { throw mockingImpossible(); } }

Target:
private static SubclassLoader tryLookup() { try { Class<?> methodHandles = Class.forName("java.lang.invoke.MethodHandles"); Object lookup = methodHandles.getMethod("lookup").invoke(null); Method privateLookupIn = methodHandles.getMethod("privateLookupIn", Class.class, Class.forName("java.lang.invoke.MethodHandles$Lookup")); Object codegenLookup = privateLookupIn.invoke(null, InjectionBase.class, lookup); return new WithLookup(lookup, codegenLookup, privateLookupIn); } catch (Exception exception) { throw new MockitoException(join(ERROR_MESSAGE, "", Platform.describe()), exception); } }
Source:
public void testLiteralElse() throws Exception { final DefaultConfiguration configurationTestLiteralElse = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralElse.addAttribute("tokens", "LITERAL_ELSE"); final String[] expected = { "27:15: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "else"), }; verify(configurationTestLiteralElse, getPath("InputWhitespaceAfterConditions.java"), expected); }

Target:
public void testLiteralElse() throws Exception { final DefaultConfiguration configurationTestLiteralElse = createCheckConfig(WhitespaceAfterCheck.class); configurationTestLiteralElse.addAttribute("tokens", "LITERAL_ELSE"); final String[] expected = { "27:15: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "else"), }; verify(configurationTestLiteralElse, getPath("InputWhitespaceAfterLiteralElse.java"), expected); }
Source:
private void fireAddParameterEvents(ITestResult iTestResult) { Object[] parameters = iTestResult.getParameters(); Method nativeMethod = iTestResult.getMethod().getConstructorOrMethod().getMethod(); Annotation[][] parametersAnnotations = nativeMethod.getParameterAnnotations(); List<String> methodParameterNames = getMethodParameterNamesIfAvailable(nativeMethod); for (int i = 0; i < parameters.length; i++) { Parameter parameter = getParameterAnnotation(parametersAnnotations[i]); if (parameter == null) { continue; } String name = getNameForParameter(parameter.value(), methodParameterNames, i); String value = parameters[i] != null ? parameters[i].toString() : "null"; getLifecycle().fire(new AddParameterEvent(name, value, ParameterKind.ARGUMENT)); } }

Target:
private void fireAddParameterEvents(ITestResult iTestResult) { Object[] parameters = iTestResult.getParameters(); Method nativeMethod = iTestResult.getMethod().getConstructorOrMethod().getMethod(); Annotation[][] parametersAnnotations = nativeMethod.getParameterAnnotations(); List<String> methodParameterNames = getMethodParameterNamesIfAvailable(nativeMethod); for (int i = 0; i < parameters.length; i++) { Parameter parameter = getParameterAnnotation(parametersAnnotations[i]); if (parameter == null) { continue; } String name = getNameForParameter(parameter.value(), methodParameterNames, i); String value = Objects.toString(parameters[i]); getLifecycle().fire(new AddParameterEvent(name, value, ParameterKind.ARGUMENT)); } }
Source:
public Set<Long> getAvailableIps(Network network, String requestedIp) { if (network.getCidr() == null) { return null; } String[] cidr = network.getCidr().split("/"); List<String> ips = getUsedIpsInNetwork(network); Set<Long> usedIps = new TreeSet<Long>(); for (String ip : ips) { if (requestedIp != null && requestedIp.equals(ip)) { s_logger.warn("Requested ip address " + requestedIp + " is already in use in network" + network); return null; } usedIps.add(NetUtils.ip2Long(ip)); } Set<Long> allPossibleIps = NetUtils.getAllIpsFromCidr(cidr[0], Integer.parseInt(cidr[1]), usedIps); String gateway = network.getGateway(); if ((gateway != null) && (allPossibleIps.contains(NetUtils.ip2Long(gateway)))) allPossibleIps.remove(NetUtils.ip2Long(gateway)); return allPossibleIps; }

Target:
public Set<Long> getAvailableIps(Network network, String requestedIp) { if (network.getCidr() == null) { return Collections.emptySet(); } String[] cidr = network.getCidr().split("/"); List<String> ips = getUsedIpsInNetwork(network); Set<Long> usedIps = new TreeSet<Long>(); for (String ip : ips) { if (requestedIp != null && requestedIp.equals(ip)) { s_logger.warn("Requested ip address " + requestedIp + " is already in use in network" + network); return null; } usedIps.add(NetUtils.ip2Long(ip)); } Set<Long> allPossibleIps = NetUtils.getAllIpsFromCidr(cidr[0], Integer.parseInt(cidr[1]), usedIps); String gateway = network.getGateway(); if ((gateway != null) && (allPossibleIps.contains(NetUtils.ip2Long(gateway)))) allPossibleIps.remove(NetUtils.ip2Long(gateway)); return allPossibleIps; }
Source:
public static void main(String[] args) throws Exception { Properties serverProperties = getServerProperties(args); DatastreamServer server = new DatastreamServer(serverProperties); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { server.shutdown(); } }); server.startup(); while(true) { Thread.sleep(100); } }

Target:
public static void main(String[] args) throws Exception { Properties serverProperties = getServerProperties(args); DatastreamServer server = new DatastreamServer(serverProperties); Thread mainThread = Thread.currentThread(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { server.shutdown(); mainThread.notifyAll(); } }); server.startup(); mainThread.wait(); }
Source:
private static String urlDecode(String input) { if (input.contains("%")) { try { return URLDecoder.decode(input, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new SafeRuntimeException("Failed to decode path segment", e); } } return input; }

Target:
private static String urlDecode(String input) { try { return URLDecoder.decode(input, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new SafeRuntimeException("Failed to decode path segment", e, UnsafeArg.of("encoded", input)); } }
Source:
public LdapReturnValueBase execute() { try { log.debugFormat("Running LDAP command: {0}", getClass().getName()); String loginNameForKerberos = LdapBrokerUtils.modifyLoginNameForKerberos(getLoginName(), getAuthenticationDomain()); LdapCredentials ldapCredentials = new LdapCredentials(loginNameForKerberos, getPassword()); DirectorySearcher directorySearcher = new DirectorySearcher(ldapCredentials); executeQuery(directorySearcher); } catch (RuntimeException e) { String msg = String.format("Failed to run command %s. Domain is %s. User is %s.", getClass().getSimpleName(), getDomain(), getLoginName()); log.errorFormat(msg); _ldapReturnValue.setExceptionString(msg); } return _ldapReturnValue; }

Target:
public LdapReturnValueBase execute() { try { log.debugFormat("Running LDAP command: {0}", getClass().getName()); String loginNameForKerberos = LdapBrokerUtils.modifyLoginNameForKerberos(getLoginName(), getAuthenticationDomain()); LdapCredentials ldapCredentials = new LdapCredentials(loginNameForKerberos, getPassword()); DirectorySearcher directorySearcher = new DirectorySearcher(ldapCredentials); executeQuery(directorySearcher); } catch (RuntimeException e) { log.errorFormat(String.format("Failed to run command %s. Domain is %s. User is %s.", getClass().getSimpleName(), getDomain(), getLoginName())); _ldapReturnValue.setExceptionString(VdcBllMessages.FAILED_TO_RUN_LDAP_QUERY.name()); } return _ldapReturnValue; }
Source:
public String getPathForHadoop() { String hadoopPath = String.format( Locale.ENGLISH, "%s://%s@%s.blob.core.windows.net/", "wasb", config.getContainer(), config.getAccount() ); log.info("Using Azure blob storage Hadoop path: " + hadoopPath); return hadoopPath; }

Target:
public String getPathForHadoop() { String hadoopPath = StringUtils.format( "%s://%s@%s.%s/", AzureDataSegmentPuller.AZURE_STORAGE_HADOOP_PROTOCOL, config.getContainer(), config.getAccount(), AzureDataSegmentPuller.AZURE_STORAGE_HOST_ADDRESS ); log.info("Using Azure blob storage Hadoop path: %s", hadoopPath); return hadoopPath; }
Source:
protected void setRuleSettings(SimulationDescriptor simulationDescriptor) { view.getDmnSettings().getStyle().setDisplay(Style.Display.NONE); view.getRuleSettings().getStyle().setDisplay(Style.Display.INLINE); view.getKieSession().setValue(Optional.ofNullable(simulationDescriptor.getDmoSession()).orElse("")); view.getRuleFlowGroup().setValue(Optional.ofNullable(simulationDescriptor.getRuleFlowGroup()).orElse("")); }

Target:
protected void setRuleSettings(SimulationDescriptor simulationDescriptor) { view.getDmnSettings().getStyle().setDisplay(Style.Display.NONE); view.getRuleSettings().getStyle().setDisplay(Style.Display.INLINE); view.getDmoSession().setValue(Optional.ofNullable(simulationDescriptor.getDmoSession()).orElse("")); view.getRuleFlowGroup().setValue(Optional.ofNullable(simulationDescriptor.getRuleFlowGroup()).orElse("")); }
Source:
private String readInputFromStdIn() { Scanner in = new Scanner(System.in).useDelimiter("\\A"); String content = in.next(); in.close(); return content; }

Target:
private String readInputFromStdIn() { String content = IOUtils.readFull(System.in); try { System.in.close(); } catch (IOException e) { } return content; }
Source:
public void testHAProxyProtocolIdleTimeout() throws Exception { HAProxy proxy = new HAProxy(DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT, Buffer.buffer()); proxy.start(vertx); server.close(); server = vertx.createHttpServer(createBaseServerOptions(). setIdleTimeout(2). setSslHandshakeTimeout(2). setUseProxyProtocol(true)); server.requestHandler(req -> fail("Should not be called")); startServer(); vertx.createNetClient().connect(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, res -> { res.result().closeHandler(event -> testComplete()); }); try { await(); } finally { proxy.stop(); } }

Target:
public void testHAProxyProtocolIdleTimeout() throws Exception { HAProxy proxy = new HAProxy(DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT, Buffer.buffer()); proxy.start(vertx); server.close(); server = vertx.createHttpServer(createBaseServerOptions(). setProxyProtocolTimeout(2). setUseProxyProtocol(true)); server.requestHandler(req -> fail("Should not be called")); startServer(); vertx.createNetClient().connect(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, res -> { res.result().closeHandler(event -> testComplete()); }); try { await(); } finally { proxy.stop(); } }
Source:
public static double calculateSuppressionFactorFromPreAdapterQ(final double preAdapterQ, final double biasQP1, final double biasQP2) { ParamUtils.isPositive(preAdapterQ, "preAdatper Q score must be positive and not zero."); ParamUtils.isPositiveOrZero(biasQP1, "bias Q shape parameters must be positive."); ParamUtils.isPositiveOrZero(biasQP2, "bias Q shape parameters must be positive."); if ((biasQP2==0) && (preAdapterQ > biasQP1)) { return 0.0; } else if (biasQP2 == 0) { return 1.0; } return 1.0/(1.0 + Math.exp(biasQP2*(preAdapterQ-biasQP1))); }

Target:
public static double calculateSuppressionFactorFromPreAdapterQ(final double preAdapterQ, final double biasQP1, final double biasQP2) { ParamUtils.isPositive(preAdapterQ, "preAdapter Q score must be positive and not zero."); ParamUtils.isPositiveOrZero(biasQP1, "bias Q shape parameters must be positive."); ParamUtils.isPositiveOrZero(biasQP2, "bias Q shape parameters must be positive."); if (biasQP2 == 0) { return preAdapterQ > biasQP1 ? 0.0 : 1.0; } else { return 1.0/(1.0 + Math.exp(biasQP2*(preAdapterQ-biasQP1))); } }
Source:
public Obs saveObs(Obs obs, String changeMessage) throws APIException { if(obs == null){ throw new APIException("Obs.error.cannot.be.null", (Object[]) null); } if(obs.getId() != null && changeMessage == null){ throw new APIException("Obs.error.ChangeMessage.required", (Object[]) null); } if(obs.getPerson()!=obs.getEncounter().getPatient().getPerson()) { throw new ValidationException("obs person not matching with encounter person"); } handleExistingObsWithComplexConcept(obs); ensureRequirePrivilege(obs); if (obs.getObsId() == null || obs.getVoided()) { return saveNewOrVoidedObs(obs,changeMessage); } else if(!obs.isDirty()){ setPersonFromEncounter(obs); return saveObsNotDirty(obs, changeMessage); } else { setPersonFromEncounter(obs); return saveExistingObs(obs,changeMessage); } }

Target:
public Obs saveObs(Obs obs, String changeMessage) throws APIException { if(obs == null){ throw new APIException("Obs.error.cannot.be.null", (Object[]) null); } if(obs.getId() != null && changeMessage == null){ throw new APIException("Obs.error.ChangeMessage.required", (Object[]) null); } handleExistingObsWithComplexConcept(obs); ensureRequirePrivilege(obs); if (obs.getObsId() == null || obs.getVoided()) { return saveNewOrVoidedObs(obs,changeMessage); } else if(!obs.isDirty()){ setPersonFromEncounter(obs); return saveObsNotDirty(obs, changeMessage); } else { setPersonFromEncounter(obs); return saveExistingObs(obs,changeMessage); } }
Source:
private void logLoop() { if (!RuntimeEnvironment.getInstance().isPrintProgress()) { return; } while (true) { long currentCount = this.currentCount.get(); Level currentLevel; if (currentCount <= 1 || currentCount >= totalCount || currentCount % 100 == 0) { currentLevel = Level.INFO; } else if (currentCount % 50 == 0) { currentLevel = Level.FINE; } else if (currentCount % 10 == 0) { currentLevel = Level.FINER; } else { currentLevel = Level.FINEST; } if (logger.isLoggable(currentLevel)) { logger.log(currentLevel, "Progress: {0} ({1}%) for {2}", new Object[]{currentCount, currentCount * 100.0f / totalCount, prefix}); } try { synchronized (sync) { sync.wait(); } } catch (InterruptedException e) { logger.log(Level.WARNING, "logger thread interrupted"); } if (!run.get()) { return; } } }

Target:
private void logLoop() { long cachedCount = 0; while (true) { long currentCount = this.currentCount.get(); Level currentLevel; if (cachedCount < currentCount) { if (currentCount <= 1 || currentCount % 100 == 0) { currentLevel = Level.INFO; } else if (currentCount % 50 == 0) { currentLevel = Level.FINE; } else if (currentCount % 10 == 0) { currentLevel = Level.FINER; } else { currentLevel = Level.FINEST; } if (logger.isLoggable(currentLevel)) { logger.log(currentLevel, "Progress: {0} ({1}%) for {2}", new Object[]{currentCount, currentCount * 100.0f / totalCount, suffix}); } } if (!run) { return; } cachedCount = currentCount; try { synchronized (sync) { if (!run) { continue; } sync.wait(); } } catch (InterruptedException e) { logger.log(Level.WARNING, "logger thread interrupted"); } } }
Source:
public void update(QcType qcType) throws IOException { authorizationManager.throwIfNonAdmin(); QcType updatedQcType = get(qcType.getId()); updatedQcType.setName(qcType.getName()); updatedQcType.setDescription(qcType.getDescription() == null ? "" : qcType.getDescription()); updatedQcType.setQcTarget(qcType.getQcTarget()); updatedQcType.setUnits(qcType.getUnits() == null ? "" : qcType.getUnits()); updatedQcType.setPrecisionAfterDecimal(qcType.getPrecisionAfterDecimal()); qcTypeStore.update(updatedQcType); }

Target:
public void update(QcType qcType) throws IOException { authorizationManager.throwIfNonAdmin(); QcType updatedQcType = get(qcType.getId()); updatedQcType.setName(qcType.getName()); updatedQcType.setDescription(LimsUtils.isStringBlankOrNull(qcType.getDescription()) ? "" : qcType.getDescription()); updatedQcType.setQcTarget(qcType.getQcTarget()); updatedQcType.setUnits(LimsUtils.isStringBlankOrNull(qcType.getUnits()) ? "" : qcType.getUnits()); updatedQcType.setPrecisionAfterDecimal(qcType.getPrecisionAfterDecimal()); qcTypeStore.update(updatedQcType); }
Source:
public void init() { if (hasBeenInitialized) { throw new IllegalStateException("This map has already been initialized."); } List<Binding<?>> rootResourceBindings = new ArrayList<>(); for (final Binding<?> binding : injector.getBindings().values()) { final Type type = binding.getKey().getTypeLiteral().getType(); if (type instanceof Class) { final Class<?> beanClass = (Class) type; if (GetRestful.isRootResource(beanClass)) { rootResourceBindings.add(binding); } } } for (Binding<?> binding : rootResourceBindings) { Class<?> clazz = (Class) binding.getKey().getTypeLiteral().getType(); if (Proxy.isProxyClass(clazz)) { for (Class<?> intf : clazz.getInterfaces()) { ResourceClass resourceClass = ResourceBuilder.rootResourceFromAnnotations(intf); registerConcreteMethods(resourceClass, clazz); } } else { ResourceClass resourceClass = ResourceBuilder.rootResourceFromAnnotations(clazz); registerConcreteMethods(resourceClass, clazz); } } lock(); }

Target:
public synchronized void init() { if (hasBeenInitialized) { throw new IllegalStateException("This map has already been initialized."); } List<Binding<?>> rootResourceBindings = new ArrayList<>(); for (Binding<?> binding : injector.getBindings().values()) { Type type = binding.getKey().getTypeLiteral().getType(); if (type instanceof Class) { Class<?> beanClass = (Class) type; if (GetRestful.isRootResource(beanClass)) { rootResourceBindings.add(binding); } } } for (Binding<?> binding : rootResourceBindings) { Class<?> clazz = (Class) binding.getKey().getTypeLiteral().getType(); if (Proxy.isProxyClass(clazz)) { for (Class<?> intf : clazz.getInterfaces()) { ResourceClass resourceClass = ResourceBuilder.rootResourceFromAnnotations(intf); registerConcreteMethods(resourceClass, clazz); } } else { ResourceClass resourceClass = ResourceBuilder.rootResourceFromAnnotations(clazz); registerConcreteMethods(resourceClass, clazz); } } lock(); }
Source:
public void when_no_read_timeout_override_then_client_request_times_out() { thrown.expect(ProcessingException.class); thrown.expectCause(any(SocketTimeoutException.class)); Client client = createStandardClient(); client.target(TEST_URI + "/long_running") .request() .get(); }

Target:
public void when_no_read_timeout_override_then_client_request_times_out() { thrown.expect(ProcessingException.class); thrown.expectCause(any(SocketTimeoutException.class)); client.target(testUri + "/long_running") .request() .get(); }
Source:
private void processUpdateForBlockLocation(Vector3i blockLocation) { for (Side side : Side.values()) { Vector3i neighborLocation = new Vector3i(blockLocation); neighborLocation.add(side.getVector3i()); if (worldProvider.isBlockRelevant(neighborLocation)) { Block neighborBlock = worldProvider.getBlock(neighborLocation); final BlockFamily blockFamily = neighborBlock.getBlockFamily(); if (blockFamily instanceof BlockNeighborUpdateFamily) { BlockNeighborUpdateFamily neighboursFamily = (BlockNeighborUpdateFamily) blockFamily; Block neighborBlockAfterUpdate = neighboursFamily.getBlockForNeighborUpdate(neighborLocation, neighborBlock); if (neighborBlock != neighborBlockAfterUpdate) { worldProvider.setBlock(neighborLocation, neighborBlockAfterUpdate); } } } } }

Target:
private void processUpdateForBlockLocation(Vector3i blockLocation) { for (Side side : Side.values()) { Vector3i neighborLocation = new Vector3i(blockLocation); neighborLocation.add(side.getVector3i()); if (worldProvider.isBlockRelevant(neighborLocation)) { Block neighborBlock = worldProvider.getBlock(neighborLocation); final BlockFamily blockFamily = neighborBlock.getBlockFamily(); if (blockFamily instanceof UpdatesWithNeighboursFamily) { UpdatesWithNeighboursFamily neighboursFamily = (UpdatesWithNeighboursFamily) blockFamily; Block neighborBlockAfterUpdate = neighboursFamily.getBlockForNeighborUpdate(neighborLocation, neighborBlock); if (neighborBlock != neighborBlockAfterUpdate) { worldProvider.setBlock(neighborLocation, neighborBlockAfterUpdate); } } } } }
Source:
public List<OzoneAcl> getAcl(OzoneObj obj) throws IOException { if(isAclEnabled) { checkAcls(obj.getResourceType(), obj.getStoreType(), ACLType.WRITE_ACL, obj.getVolumeName(), obj.getBucketName(), obj.getKeyName()); } if(obj.getResourceType().equals(ResourceType.VOLUME)) { return volumeManager.getAcl(obj); } return Collections.emptyList(); }

Target:
public List<OzoneAcl> getAcl(OzoneObj obj) throws IOException { if(isAclEnabled) { checkAcls(obj.getResourceType(), obj.getStoreType(), ACLType.READ_ACL, obj.getVolumeName(), obj.getBucketName(), obj.getKeyName()); } if(obj.getResourceType().equals(ResourceType.VOLUME)) { return volumeManager.getAcl(obj); } return Collections.emptyList(); }
Source:
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (endpoint == null) { throw new NullPointerException(); } if (timeout < 0) { throw new IllegalArgumentException("Timeout may not be negative: " + timeout); } if (!(endpoint instanceof NpipeSocketAddress)) { throw new IllegalArgumentException("Unsupported address type: " + endpoint.getClass().getName()); } this.socketAddress = endpoint; this.socketPath = ((NpipeSocketAddress) endpoint).path(); synchronized (connectLock) { this.namedPipe = new RandomAccessFile(socketPath, "rw"); this.channel = this.namedPipe.getChannel(); } }

Target:
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (timeout < 0) { throw new IllegalArgumentException("Timeout may not be negative: " + timeout); } if (!(endpoint instanceof NpipeSocketAddress)) { throw new IllegalArgumentException("Unsupported address type: " + endpoint.getClass().getName()); } this.socketAddress = endpoint; this.socketPath = ((NpipeSocketAddress) endpoint).path(); synchronized (connectLock) { this.namedPipe = new RandomAccessFile(socketPath, "rw"); this.channel = this.namedPipe.getChannel(); } }
Source:
protected void blockDrawerFromOpening(){ DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); if (mDrawerLayout != null) { mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } }

Target:
protected void blockDrawerFromOpening(){ DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawerLayout != null) { drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } }
Source:
public static boolean isSolaris() { String osName = System.getProperty("os.name"); if (osName == null) { return false; } return (osName.indexOf("Solaris") > -1) || (osName.indexOf("solaris") > -1) || (osName.indexOf("SunOS") > -1); }

Target:
public static boolean isSolaris() { String osName = WildFlySecurityManager.getPropertyPrivileged("os.name", null); if (osName == null) { return false; } return (osName.indexOf("Solaris") > -1) || (osName.indexOf("solaris") > -1) || (osName.indexOf("SunOS") > -1); }
Source:
public MiniHBaseCluster startMiniHBaseCluster(StartMiniClusterOption option) throws IOException, InterruptedException { createRootDir(option.isCreateRootDir()); if (option.isCreateWALDir()) { createWALRootDir(); } setHBaseFsTmpDir(); if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1) == -1) { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, option.getNumRegionServers()); } if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, -1) == -1) { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers()); } Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO"); Configuration c = new Configuration(this.conf); TraceUtil.initTracer(c); this.hbaseCluster = new MiniHBaseCluster(c, option.getNumMasters(), option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(), option.getMasterClass(), option.getRsClass()); conf.set(HConstants.MASTER_ADDRS_KEY, MasterRegistry.getMasterAddr(c)); try (Table t = getConnection().getTable(TableName.META_TABLE_NAME); ResultScanner s = t.getScanner(new Scan())) { while (s.next() != null) { continue; } } getAdmin(); LOG.info("Minicluster is up; activeMaster={}", getHBaseCluster().getMaster()); return (MiniHBaseCluster) hbaseCluster; }

Target:
public MiniHBaseCluster startMiniHBaseCluster(StartMiniClusterOption option) throws IOException, InterruptedException { createRootDir(option.isCreateRootDir()); if (option.isCreateWALDir()) { createWALRootDir(); } setHBaseFsTmpDir(); if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1) == -1) { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, option.getNumRegionServers()); } if (conf.getInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, -1) == -1) { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers()); } Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO"); Configuration c = new Configuration(this.conf); TraceUtil.initTracer(c); this.hbaseCluster = new MiniHBaseCluster(c, option.getNumMasters(), option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(), option.getMasterClass(), option.getRsClass()); conf.set(HConstants.MASTER_ADDRS_KEY, MasterRegistry.getMasterAddr(c)); try (Table t = getConnection().getTable(TableName.META_TABLE_NAME); ResultScanner s = t.getScanner(new Scan())) { for (;;) { if (s.next() == null) { break; } } } getAdmin(); LOG.info("Minicluster is up; activeMaster={}", getHBaseCluster().getMaster()); return (MiniHBaseCluster) hbaseCluster; }
Source:
private static boolean hasMoreThanOneStatement(ForEachStatementTree forEach) { if (forEach.statements().size() > 1) { return true; } StatementTree body = forEach.statements().get(0); if (body.is(Tree.Kind.BLOCK)) { return ((BlockTree) body).statements().size() > 1; } return false; }

Target:
private static boolean hasMoreThanOneStatement(ForEachStatementTree forEach) { if (forEach.statements().size() > 1) { return true; } if (forEach.statements().isEmpty()) { return false; } StatementTree body = forEach.statements().get(0); if (body.is(Tree.Kind.BLOCK)) { return ((BlockTree) body).statements().size() > 1; } return false; }
Source:
private List<CourseAttributes> getAllCoursesWithoutTimeZone() { List<CourseAttributes> courseAttributes = new ArrayList<CourseAttributes>(); List<Course> courseEntities = getAllCourseEntities(); for (Course course : courseEntities) { if (course.getTimeZone() == null && !JDOHelper.isDeleted(course)) { courseAttributes.add(new CourseAttributes(course)); } } return courseAttributes; }

Target:
private List<CourseAttributes> getAllCoursesWithoutTimeZone() { List<CourseAttributes> coursesWithoutTimeZone = new ArrayList<CourseAttributes>(); List<Course> courseEntities = getAllCourseEntities(); for (Course courseEntity : courseEntities) { if (courseEntity.getTimeZone() == null && !JDOHelper.isDeleted(courseEntity)) { coursesWithoutTimeZone.add(new CourseAttributes(courseEntity)); } } return coursesWithoutTimeZone; }
Source:
private void injectErrorPage(ServletContext context, Bundle refBundle) { Field field = null; try { field = context.getClass().getDeclaredField("this$0"); field.setAccessible(true); } catch (NoSuchFieldException e) { LOGGER.warn( "Unable to find enclosing class of ServletContext for delegating the error page. The default jetty errors will display in the browser", e); return; } ServletHandler handler; ServletContextHandler httpServiceContext; try { httpServiceContext = (ServletContextHandler) field.get(context); } catch (IllegalAccessException e) { LOGGER.warn( "Unable to get the ServletContextHandler for {}. Jetty's default error page will be used for this context", refBundle.getSymbolicName(), e); return; } handler = httpServiceContext.getServletHandler(); ServletHolder errorServletHolder = new ServletHolder(new ErrorServlet()); errorServletHolder.setServletHandler(handler); try { errorServletHolder.start(); errorServletHolder.initialize(); } catch (Exception e) { LOGGER.warn( "Unable to initialize an errorServletHolder for {}", refBundle.getSymbolicName(), e); } handler.addServletWithMapping(errorServletHolder, errorPagePath); ErrorPageErrorHandler errorPageErrorHandler = new ErrorPageErrorHandler(); errorPageErrorHandler.setErrorPages(errorCodesMap); httpServiceContext.setErrorHandler(errorPageErrorHandler); }

Target:
private void injectErrorPage(ServletContext context, Bundle refBundle) { Optional<ServletContextHandler> optionalHttpServiceContext = getHTTPContext(context, refBundle); optionalHttpServiceContext.ifPresent(p -> createAndAddErrorPageHandler(p, refBundle)); }
Source:
default void check() { servers().check(); double evictionCheckProportion = proportionConnectionsToCheckPerEvictionRun(); Preconditions.checkArgument(evictionCheckProportion > 0.01 && evictionCheckProportion <= 1, "'proportionConnectionsToCheckPerEvictionRun' must be between 0.01 and 1"); }

Target:
default void check() { servers().visit((thriftServers, cqlServers) -> { Preconditions.checkState(!thriftServers.isEmpty(), "'thrift' must have at least one entry"); return null; }); double evictionCheckProportion = proportionConnectionsToCheckPerEvictionRun(); Preconditions.checkArgument(evictionCheckProportion > 0.01 && evictionCheckProportion <= 1, "'proportionConnectionsToCheckPerEvictionRun' must be between 0.01 and 1"); }
Source:
public List<Node> getChildren() { List<Node> children = new ArrayList<Node>(); children.addAll(statements); return children; }

Target:
public List<Node> getChildren() { return new ArrayList<Node>(expressions); }
Source:
public void testRetainedSize() throws Exception { SparseHll sparseHll = new SparseHll(10); int[] entries = new int[1]; long retainedSize = sizeOf(entries) + ClassLayout.parseClass(SparseHll.class).instanceSize(); for (int value = 0; value < 100; value++) { sparseHll.insertHash(Murmur3Hash128.hash64(value)); if (value % 10 == 1) { entries = new int[value + 10]; retainedSize = sizeOf(entries) + ClassLayout.parseClass(SparseHll.class).instanceSize(); } assertEquals(sparseHll.estimatedInMemorySize(), retainedSize); } }

Target:
public void testRetainedSize() { SparseHll sparseHll = new SparseHll(10); int[] entries = new int[1]; long retainedSize = sizeOf(entries) + SPARSE_HLL_INSTANCE_SIZE; for (int value = 0; value < 100; value++) { sparseHll.insertHash(Murmur3Hash128.hash64(value)); if (value % 10 == 1) { entries = new int[value + 10]; retainedSize = sizeOf(entries) + SPARSE_HLL_INSTANCE_SIZE; } assertEquals(sparseHll.estimatedInMemorySize(), retainedSize); } }