auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initialize() { for (DoubleSolenoid solenoid : solenoids) { try { solenoid.set(DoubleSolenoid.Value.kForward); } catch (Exception e) { updateStatus(solenoid.getName(), SystemStatus.FAIL, e); } } }

Target:
public void initialize() { for (DoubleSolenoid solenoid : solenoids) { try { solenoid.set(DoubleSolenoid.Value.kForward); } catch (Exception e) { updateStatusFail(solenoid.getName(), e); } } }
Source:
protected Result check() throws Exception { try { dockerClient.info(); return Result.healthy(); } catch (final Exception ex) { return Result.unhealthy(ex); } }

Target:
protected Result check() throws Exception { try { dockerClient.ping(); return Result.healthy(); } catch (final Exception ex) { return Result.unhealthy(ex); } }
Source:
static Map<String, Object> getAttributes(ManifestElement element, String[] definedAttrs) { Enumeration<String> keys = element.getKeys(); Map<String, Object> arbitraryAttrs = null; if (keys == null) return null; while (keys.hasMoreElements()) { boolean definedAttr = false; String key = keys.nextElement(); for (String definedAttr1 : definedAttrs) { if (definedAttr1.equals(key)) { definedAttr = true; break; } } String value = element.getAttribute(key); int colonIndex = key.indexOf(':'); String type = ATTR_TYPE_STRING; if (colonIndex > 0) { type = key.substring(colonIndex + 1).trim(); key = key.substring(0, colonIndex).trim(); } if (!definedAttr) { if (arbitraryAttrs == null) arbitraryAttrs = new HashMap<>(); arbitraryAttrs.put(key, convertValue(type, value)); } } return arbitraryAttrs; }

Target:
static Map<String, Object> getAttributes(ManifestElement element, String[] definedAttrs) { Enumeration<String> keys = element.getKeys(); Map<String, Object> arbitraryAttrs = null; if (keys == null) return null; while (keys.hasMoreElements()) { boolean definedAttr = false; String key = keys.nextElement(); for (String attr : definedAttrs) { if (attr.equals(key)) { definedAttr = true; break; } } String value = element.getAttribute(key); int colonIndex = key.indexOf(':'); String type = ATTR_TYPE_STRING; if (colonIndex > 0) { type = key.substring(colonIndex + 1).trim(); key = key.substring(0, colonIndex).trim(); } if (!definedAttr) { if (arbitraryAttrs == null) arbitraryAttrs = new HashMap<>(); arbitraryAttrs.put(key, convertValue(type, value)); } } return arbitraryAttrs; }
Source:
public void testNestedFields() { String indexName = "data"; Map<String, Object> source = new HashMap<>(); source.put("name", "nestfield"); source.put("fields.fielda", 32); source.put("fields.fieldb", "valueb"); embeddedElasticsearchNode.getClient().prepareIndex(indexName, "doc").setSource(source).get(); embeddedElasticsearchNode.getClient().admin().indices().refresh(refreshRequest(indexName)).actionGet(); MaterializedResult actualColumns = computeActual("SELECT name, fields.fielda, fields.fieldb FROM nested.data").toTestTypes(); MaterializedResult.Builder builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT, VARCHAR); for (MaterializedRow row : actualColumns.getMaterializedRows()) { builder.row(row.getField(0), row.getField(1), row.getField(2)); } MaterializedResult actualResult = builder.build(); builder = resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR, BIGINT, VARCHAR); MaterializedResult expectedColumns = builder.row("nestfield", 32, "valueb").build(); assertEquals(actualResult, expectedColumns, format("%s != %s", actualResult, expectedColumns)); }

Target:
public void testNestedFields() { String indexName = "data"; embeddedElasticsearchNode.getClient() .prepareIndex(indexName, "doc") .setSource(ImmutableMap.<String, Object>builder() .put("name", "nestfield") .put("fields.fielda", 32) .put("fields.fieldb", "valueb") .build()) .get(); embeddedElasticsearchNode.getClient() .admin() .indices() .refresh(refreshRequest(indexName)) .actionGet(); assertQuery( "SELECT name, fields.fielda, fields.fieldb FROM nested.data", "VALUES ('nestfield', 32, 'valueb')"); }
Source:
protected final AuditRepositoryRecord createDBAuditObj(LogEventSecureRequestType mess, AssertionType assertion) { AuditRepositoryRecord auditRec = new AuditRepositoryRecord(); String eventCommunityId = mess.getRemoteHCID(); if (NullChecker.isNotNullish(eventCommunityId)) { auditRec.setRemoteHcid(eventCommunityId); } else { auditRec.setRemoteHcid(""); } auditRec.setDirection(mess.getDirection()); auditRec.setMessage(getBlobFromAuditMessage(mess.getAuditMessage())); XMLGregorianCalendar xMLCalDate = mess.getEventTimestamp(); if (xMLCalDate != null) { auditRec.setEventTimeStamp(convertXMLGregorianCalendarToDate(xMLCalDate)); } auditRec.setOutcome(mess.getEventOutcomeIndicator().intValue()); auditRec.setEventType(mess.getEventType()); auditRec.setEventId(mess.getEventID()); auditRec.setMessageId(mess.getRequestMessageId()); auditRec.setRelatesTo(mess.getRelatesTo()); auditRec.setUserId(mess.getUserId()); return auditRec; }

Target:
protected final AuditRepositoryRecord createDBAuditObj(LogEventSecureRequestType mess, AssertionType assertion) { AuditRepositoryRecord auditRec = new AuditRepositoryRecord(); String eventCommunityId = mess.getRemoteHCID(); auditRec.setRemoteHcid(eventCommunityId); auditRec.setDirection(mess.getDirection()); auditRec.setMessage(getBlobFromAuditMessage(mess.getAuditMessage())); XMLGregorianCalendar xMLCalDate = mess.getEventTimestamp(); if (xMLCalDate != null) { auditRec.setEventTimeStamp(convertXMLGregorianCalendarToDate(xMLCalDate)); } auditRec.setOutcome(mess.getEventOutcomeIndicator().intValue()); auditRec.setEventType(mess.getEventType()); auditRec.setEventId(mess.getEventID()); auditRec.setMessageId(mess.getRequestMessageId()); auditRec.setRelatesTo(mess.getRelatesTo()); auditRec.setUserId(mess.getUserId()); return auditRec; }
Source:
public void log(RequestLogLine requestLogLine) throws IOException { final Map mdc; if (setMDC) { mdc = MDC.getCopyOfContextMap(); } else { mdc = null; } try { if (setMDC) { try { final Query query = requestLogLine.getQuery(); MDC.put("queryId", query.getId()); MDC.put("dataSource", query.getDataSource().toString()); MDC.put("queryType", query.getType()); MDC.put("hasFilters", Boolean.toString(query.hasFilters())); MDC.put("remoteAddr", requestLogLine.getRemoteAddr()); MDC.put("duration", query.getDuration().toString()); MDC.put("resultOrdering", query.getResultOrdering().toString()); MDC.put("descending", Boolean.toString(query.isDescending())); if (setContextMDC) { final Iterable<Map.Entry<String, Object>> entries = query.getContext() == null ? ImmutableList.<Map.Entry<String, Object>>of() : query.getContext().entrySet(); for (Map.Entry<String, Object> entry : entries) { MDC.put(entry.getKey(), entry.getValue() == null ? "NULL" : entry.getValue().toString()); } } } catch (RuntimeException re) { LOG.error(re, "Error preparing MDC"); } } final String line = requestLogLine.getLine(mapper); LOG.info("%s", line); } finally { if (setMDC && mdc != null) { MDC.setContextMap(mdc); } } }

Target:
public void log(RequestLogLine requestLogLine) throws IOException { final Map mdc = MDC.getCopyOfContextMap(); try { if (setMDC) { try { final Query query = requestLogLine.getQuery(); MDC.put("queryId", query.getId()); MDC.put("dataSource", query.getDataSource().toString()); MDC.put("queryType", query.getType()); MDC.put("hasFilters", Boolean.toString(query.hasFilters())); MDC.put("remoteAddr", requestLogLine.getRemoteAddr()); MDC.put("duration", query.getDuration().toString()); MDC.put("descending", Boolean.toString(query.isDescending())); if (setContextMDC) { final Iterable<Map.Entry<String, Object>> entries = query.getContext() == null ? ImmutableList.<Map.Entry<String, Object>>of() : query.getContext().entrySet(); for (Map.Entry<String, Object> entry : entries) { MDC.put(entry.getKey(), entry.getValue() == null ? "NULL" : entry.getValue().toString()); } } } catch (RuntimeException re) { LOG.error(re, "Error preparing MDC"); } } final String line = requestLogLine.getLine(mapper); LOG.info("%s", line); } finally { if (setMDC) { if (mdc != null) { MDC.setContextMap(mdc); } else { MDC.clear(); } } } }
Source:
public final void setVisible(final Set<Sequence> visibleSequences) { Set<SequenceSegment> vertices = new TreeSet<SequenceSegment>(); for (Sequence seq : visibleSequences) { Iterator<SequenceSegment> itSegments = seq.getSegments().iterator(); while (itSegments.hasNext()) { vertices.add(itSegments.next()); } } visibles = vertices; this.visibleSequences = visibleSequences; changed = true; }

Target:
public final void setVisible(final Set<Sequence> visibleSequences) { Set<SequenceSegment> vertices = new TreeSet<SequenceSegment>(); for (Sequence seq : visibleSequences) { for (SequenceSegment segment : seq.getSegments()) { vertices.add(segment); } } visibles = vertices; this.visibleSequences = visibleSequences; }
Source:
private static MaxwellDiagnosticContext getDiagnosticContext(MaxwellContext context) { MaxwellDiagnosticContext.Config diagnosticConfig = context.getConfig().diagnosticConfig; if (diagnosticConfig.enable) { return new MaxwellDiagnosticContext(diagnosticConfig, context.getDiagnostics()); } else { return null; } }

Target:
private static MaxwellDiagnosticContext getDiagnosticContext(MaxwellContext context) { MaxwellDiagnosticContext.Config diagnosticConfig = context.getConfig().diagnosticConfig; if (diagnosticConfig.enable) { return context.getDiagnosticContext(); } else { return null; } }
Source:
private static Boolean checkMatch(COSDictionary info, Map<String, Object> properties) { if (!checkProperty(info, properties, TITLE)) return Boolean.FALSE; if (!checkProperty(info, properties, SUBJECT)) return Boolean.FALSE; if (!checkProperty(info, properties, AUTHOR)) return Boolean.FALSE; if (!checkProperty(info, properties, KEYWORDS)) return Boolean.FALSE; if (!checkProperty(info, properties, PRODUCER)) return Boolean.FALSE; if (!checkProperty(info, properties, CREATOR)) return Boolean.FALSE; if (!checkProperty(info, properties, CREATION_DATE)) return Boolean.FALSE; if (!checkProperty(info, properties, MODIFICATION_DATE)) return Boolean.FALSE; return Boolean.TRUE; }

Target:
private static Boolean checkMatch(COSDictionary info, Map<String, Object> properties) { if ((checkProperty(info, properties, TITLE)) && (checkProperty(info, properties, SUBJECT)) && (checkProperty(info, properties, AUTHOR)) && (checkProperty(info, properties, KEYWORDS)) && (checkProperty(info, properties, PRODUCER)) && (checkProperty(info, properties, CREATOR)) && (checkProperty(info, properties, CREATION_DATE)) && (checkProperty(info, properties, MODIFICATION_DATE))) { return Boolean.TRUE; } else { return Boolean.FALSE; } }
Source:
public boolean hasTaskChanged(TaskRepository taskRepository, ITask task, TaskData taskData) { String lastKnownLocalModValue = task .getAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey()); TaskAttribute latestRemoteModAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); String latestRemoteModValue = latestRemoteModAttribute != null ? latestRemoteModAttribute.getValue() : null; return !Objects.equal(latestRemoteModValue, lastKnownLocalModValue); }

Target:
public boolean hasTaskChanged(TaskRepository taskRepository, ITask task, TaskData taskData) { String lastKnownLocalModValue = task .getAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey()); TaskAttribute latestRemoteModAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION); String latestRemoteModValue = latestRemoteModAttribute != null ? latestRemoteModAttribute.getValue() : null; if (latestRemoteModValue != null && lastKnownLocalModValue != null) { return !latestRemoteModValue.equals(lastKnownLocalModValue); } else if (latestRemoteModValue != null && lastKnownLocalModValue == null) { return true; } else { return false; } }
Source:
private void fetchSSHFingerprint() { getFetchSshFingerprint().setEntity(ConstantsManager.getInstance().getConstants().empty()); getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().empty()); AsyncQuery aQuery = new AsyncQuery(); aQuery.setModel(this); aQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { String fingerprint = (String) result; if (fingerprint != null && fingerprint.length() > 0) { getFetchSshFingerprint().setEntity(result); getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().successLoadingFingerprint()); } else { getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().errorLoadingFingerprint()); } } }; getHost().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() }); if (!getHost().getIsValid()) { getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().fingerprintAddressError() + getHost().getInvalidityReasons().get(0)); } else { getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().loadingFingerprint()); AsyncDataProvider.getHostFingerprint(aQuery, getHost().getEntity().toString()); } }

Target:
private void fetchSSHFingerprint() { getFetchSshFingerprint().setEntity(ConstantsManager.getInstance().getConstants().empty()); getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().empty()); AsyncQuery aQuery = new AsyncQuery(); aQuery.setModel(this); aQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { String fingerprint = (String) result; if (fingerprint != null && fingerprint.length() > 0) { getFetchSshFingerprint().setEntity(result); getFetchResult().setEntity((String) ConstantsManager.getInstance().getConstants().successLoadingFingerprint()); } else { getFetchResult().setEntity((String) ConstantsManager.getInstance().getConstants().errorLoadingFingerprint()); } } }; getHost().validateEntity(new IValidation[] { new NotEmptyValidation(), new LengthValidation(255), new HostAddressValidation() }); if (!getHost().getIsValid()) { getFetchResult().setEntity(ConstantsManager.getInstance().getConstants().fingerprintAddressError() + getHost().getInvalidityReasons().get(0)); } else { getFetchResult().setEntity((String) ConstantsManager.getInstance().getConstants().loadingFingerprint()); AsyncDataProvider.getHostFingerprint(aQuery, getHost().getEntity().toString()); } }
Source:
public Builder withFooterKey(byte[] footerKey) { if (null == footerKey) { return this; } if (null != this.footerKeyBytes) { throw new IllegalArgumentException("Footer key already set"); } this.footerKeyBytes = new byte[footerKey.length]; System.arraycopy(footerKey, 0, this.footerKeyBytes, 0, footerKey.length); return this; }

Target:
public Builder withFooterKey(byte[] footerKey) { if (null == footerKey) { return this; } if (null != this.footerKeyBytes) { throw new IllegalStateException("Footer key already set"); } this.footerKeyBytes = new byte[footerKey.length]; System.arraycopy(footerKey, 0, this.footerKeyBytes, 0, footerKey.length); return this; }
Source:
public boolean hideResource(ResourceInfo resource) { if (isFilterSubject()) { List<String> disabledServices = Collections.emptyList(); if (resource.isServiceConfiguration()) { disabledServices = CollectionUtils.isEmpty(resource.getDisabledServices()) ? Collections.emptyList() : resource.getDisabledServices(); } else { disabledServices = defaultDisabledServices(); } String service = request().getService(); return disabledServices .stream() .anyMatch(s -> service.toLowerCase().equals(s.trim().toLowerCase())); } return false; }

Target:
public boolean hideResource(ResourceInfo resource) { if (isFilterSubject()) { List<String> disabledServices = disabledServices(resource); String service = request().getService(); return disabledServices .stream() .anyMatch(s -> service.toLowerCase().equals(s.trim().toLowerCase())); } return false; }
Source:
public void testUnionAllWithLiteralColumn() throws Exception { String tableName1 = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(getUrl(), props); conn.setAutoCommit(false); try { String ddl = "CREATE TABLE " + tableName1 + " " + " (id varchar not null, col1 varchar" + " CONSTRAINT pk PRIMARY KEY (id))\n"; createTestTable(getUrl(), ddl); String dml = "UPSERT INTO " + tableName1 + " VALUES(?, ?)"; PreparedStatement stmt = conn.prepareStatement(dml); stmt.setString(1, "a"); stmt.setString(2, "11111"); stmt.execute(); conn.commit(); String unionAll = "select id, col1 from " + tableName1 + " union all select 'b' id, '2' col1"; String select = "select t.id, case when t.col1='11111' then 'yes' else 'no' end c from ( " + unionAll + " ) t"; ResultSet rs = conn.createStatement().executeQuery(select); assertTrue(rs.next()); assertEquals("a", rs.getString(1)); assertEquals("yes", rs.getString(2)); assertTrue(rs.next()); assertEquals("b", rs.getString(1)); assertEquals("no", rs.getString(2)); } finally { conn.close(); } }

Target:
public void testUnionAllWithLiteralColumn() throws Exception { String tableName1 = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { conn.setAutoCommit(false); String ddl = "CREATE TABLE " + tableName1 + " " + " (id varchar not null, col1 varchar, col2 varchar(10)" + " CONSTRAINT pk PRIMARY KEY (id))\n"; createTestTable(getUrl(), ddl); String dml = "UPSERT INTO " + tableName1 + " VALUES(?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(dml); stmt.setString(1, "a"); stmt.setString(2, "11111"); stmt.setString(3, "11111"); stmt.execute(); conn.commit(); String query = "select t.id, case when t.col1='11111' then 'yes' else 'no' end c1, " + " case when '11111'=t.col2 then 'yes' else 'no' end c2 " + "from ( " + " select id, col1, col2 from " + tableName1 + " union all" + " select 'b' id, '2' col1, '2' col2" + ") t"; ResultSet rs = conn.createStatement().executeQuery(query); assertTrue(rs.next()); assertEquals("a", rs.getString(1)); assertEquals("yes", rs.getString(2)); assertEquals("yes", rs.getString(3)); assertTrue(rs.next()); assertEquals("b", rs.getString(1)); assertEquals("no", rs.getString(2)); assertEquals("no", rs.getString(3)); } }
Source:
protected void executeVmCommand() { boolean isNicToBePlugged = getParameters().getAction() == PlugAction.PLUG; if (isNicToBePlugged){ clearAddressIfPciSlotIsDuplicated(vmDevice); } if (hotPlugVmNicRequired(getVm().getStatus())) { boolean externalNetworkIsPlugged = isNicToBePlugged && getNetwork() != null && getNetwork().isExternal(); if (externalNetworkIsPlugged) { plugToExternalNetwork(); } String vfToUse = null; try { boolean shouldAcquireVF = isNicToBePlugged && isPassthrough(); if (shouldAcquireVF) { vfToUse = acquireVF(); if (vfToUse == null) { failValidationCannotPlugPassthroughVnicNoSuitableVf(); return; } else { vmDevice.setHostDevice(vfToUse); } } VDSReturnValue returnValue = runVdsCommand(getParameters().getAction().getCommandType(), new VmNicDeviceVDSParameters(getVdsId(), getVm(), getParameters().getNic(), vmDevice)); if (returnValue.getSucceeded()) { boolean passthroughHotPlug = vfToUse != null; boolean passthroughHotUnplug = isPassthrough() && getParameters().getAction() == PlugAction.UNPLUG; if (passthroughHotUnplug) { networkDeviceHelper.setVmIdOnVfs(getVdsId(), null, new HashSet<>(Arrays.asList(vmDevice.getHostDevice()))); } if (passthroughHotPlug || passthroughHotUnplug) { runInternalAction(VdcActionType.RefreshHost, new VdsActionParameters(getVdsId())); } } else { clearPassthroughData(vfToUse); } } catch (EngineException e) { if (externalNetworkIsPlugged && getParameters().isNewNic()) { unplugFromExternalNetwork(); } clearPassthroughData(vfToUse); throw e; } } TransactionSupport.executeInNewTransaction(updateDevice()); setSucceeded(true); }

Target:
protected void executeVmCommand() { boolean isNicToBePlugged = getParameters().getAction() == PlugAction.PLUG; if (isNicToBePlugged){ clearAddressIfPciSlotIsDuplicated(vmDevice); } if (hotPlugVmNicRequired(getVm().getStatus())) { boolean externalNetworkIsPlugged = isNicToBePlugged && getNetwork() != null && getNetwork().isExternal(); if (externalNetworkIsPlugged) { plugToExternalNetwork(); } String vfToUse = null; try { boolean shouldAcquireVF = isNicToBePlugged && isPassthrough(); if (shouldAcquireVF) { vfToUse = acquireVF(); if (vfToUse == null) { failValidationCannotPlugPassthroughVnicNoSuitableVf(); return; } vmDevice.setHostDevice(vfToUse); } VDSReturnValue returnValue = runVdsCommand(getParameters().getAction().getCommandType(), new VmNicDeviceVDSParameters(getVdsId(), getVm(), getParameters().getNic(), vmDevice)); if (returnValue.getSucceeded()) { boolean passthroughHotPlug = vfToUse != null; boolean passthroughHotUnplug = isPassthrough() && getParameters().getAction() == PlugAction.UNPLUG; if (passthroughHotUnplug) { networkDeviceHelper.setVmIdOnVfs(getVdsId(), null, new HashSet<>(Arrays.asList(vmDevice.getHostDevice()))); } if (passthroughHotPlug || passthroughHotUnplug) { runInternalAction(VdcActionType.RefreshHost, new VdsActionParameters(getVdsId())); } } else { clearPassthroughData(vfToUse); } } catch (EngineException e) { if (externalNetworkIsPlugged && getParameters().isNewNic()) { unplugFromExternalNetwork(); } clearPassthroughData(vfToUse); throw e; } } TransactionSupport.executeInNewTransaction(updateDevice()); setSucceeded(true); }
Source:
public TmfLocation<L> clone() { return new TmfLocation<L>(fLocation); }

Target:
public TmfLocation<L> clone() { TmfLocation<L> clone = null; try { clone = (TmfLocation<L>) super.clone(); if (fLocationData != null) { final Class<?> clazz = fLocationData.getClass(); final Method method = clazz.getMethod("clone", new Class[0]); final Object copy = method.invoke(this.fLocationData, new Object[0]); clone = new TmfLocation<L>((L) copy); } else { clone = new TmfLocation<L>((L) null); } } catch (final CloneNotSupportedException e) { } catch (final NoSuchMethodException e) { } catch (final Exception e) { throw new InternalError(e.toString()); } return clone; }
Source:
protected void afterInvoke() throws Exception { LOG.debug("Finished task {}", getName()); final CompletableFuture<Void> timersFinishedFuture = new CompletableFuture<>(); operatorChain.closeOperators(actionExecutor); actionExecutor.runThrowing(() -> { FutureUtils.forward(timerService.quiesce(), timersFinishedFuture); mailboxProcessor.prepareClose(); isRunning = false; }); mailboxProcessor.drain(); timersFinishedFuture.get(); LOG.debug("Closed operators for task {}", getName()); operatorChain.flushOutputs(); disposeAllOperators(); disposedOperators = true; }

Target:
protected void afterInvoke() throws Exception { LOG.debug("Finished task {}", getName()); final CompletableFuture<Void> timersFinishedFuture = new CompletableFuture<>(); operatorChain.closeOperators(actionExecutor); actionExecutor.runThrowing(() -> { FutureUtils.forward(timerService.quiesce(), timersFinishedFuture); mailboxProcessor.prepareClose(); isRunning = false; }); mailboxProcessor.drain(); timersFinishedFuture.get(); LOG.debug("Closed operators for task {}", getName()); operatorChain.flushOutputs(); disposeAllOperators(); }
Source:
public void setUp() throws Exception { jedis = new Jedis(hnp.getHost(), hnp.getPort(), 500); jedis.connect(); jedis.auth("foobared"); jedis.flushAll(); jedis1 = new Jedis(hnp.getHost(), port, 500); jedis1.connect(); jedis1.flushAll(); }

Target:
public void setUp() throws Exception { super.setUp(); lfuJedis = new Jedis(lfuHnp.getHost(), lfuHnp.getPort(), 500); lfuJedis.connect(); lfuJedis.flushAll(); }
Source:
protected List<?> doPublishIfEntries(List<?> entries) { if (entries == null || entries.size() == 0) { return entries; } Object entry = entries.get(0); if (entry instanceof LogEntry) { for (Object logEntry : entries) { try { doPublish((LogEntry) logEntry); } catch (RuntimeException e) { log.warn("unable to read log entry", e); } } } return entries; }

Target:
protected List<?> doPublishIfEntries(List<?> entries) { if (entries == null || entries.size() == 0) { return entries; } Object entry = entries.get(0); if (entry instanceof LogEntry) { for (Object logEntry : entries) { doPublish((LogEntry) logEntry); } } return entries; }
Source:
public Optional<String> retrieveStorageIdentifier() throws UnableToRetrieveIdentifierException { return Optional.of(loadConfigurationToken()).map(i -> i.get("id")); }

Target:
public Optional<String> retrieveStorageIdentifier() throws UnableToRetrieveIdentifierException { return Optional.of(loadConfigurationToken()).map(configToken -> configToken.get("id")); }
Source:
public boolean postDeserialize(int version, PostDeserializeSetup setup, boolean persistent) { boolean migrated = super.postDeserialize(version, setup, persistent); if (version < this.getVersionNumber()) { convertColumnsAndTableToUppercase.setValue(false); migrated = true; } return migrated; }

Target:
public boolean postDeserialize(int version, PostDeserializeSetup setup, boolean persistent) { boolean migrated = super.postDeserialize(version, setup, persistent); if (version < CONVERT_COLUMNS_AND_TABLE_TO_UPPERCASE_VERSION) { convertColumnsAndTableToUppercase.setValue(false); migrated = true; } return migrated; }
Source:
public ViewResolver freemarkerResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setOrder(1); resolver.setViewClass(org.springframework.web.servlet.view.freemarker.FreeMarkerView.class); resolver.setPrefix(""); resolver.setSuffix(".ftl"); resolver.setRequestContextAttribute("req"); Properties properties = new Properties(); properties.put("nGrinderVersion" , ngrinderVersion); resolver.setExposeContextBeansAsAttributes(false); resolver.setAttributes(properties); resolver.setContentType("text/html; charset=UTF-8"); resolver.setExposeSpringMacroHelpers(true); resolver.setCache(false); return resolver; }

Target:
public ViewResolver freemarkerResolver() { FreeMarkerViewResolver resolver = new FreeMarkerViewResolver(); resolver.setOrder(1); resolver.setViewClass(org.springframework.web.servlet.view.freemarker.FreeMarkerView.class); resolver.setPrefix(""); resolver.setSuffix(".ftl"); resolver.setRequestContextAttribute("req"); Properties properties = new Properties(); properties.put("nGrinderVersion" , ngrinderVersion); resolver.setExposeContextBeansAsAttributes(false); resolver.setAttributes(properties); resolver.setContentType("text/html; charset=" + defaultEncoding); resolver.setExposeSpringMacroHelpers(true); resolver.setCache(false); return resolver; }
Source:
private void initCxfProviders(final Bus bus) { if (bus.getProperty("org.apache.cxf.jaxrs.bus.providers") == null) { bus.setProperty("skip.default.json.provider.registration", "true"); final Collection<Object> defaults = new ArrayList<>(); for (final String provider : asList( "org.apache.johnzon.jaxrs.jsonb.jaxrs.JsonbJaxrsProvider", "org.apache.openejb.server.cxf.rs.johnzon.TomEEJohnzonProvider", "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonpProvider")) { if (!isActive(provider)) { continue; } try { defaults.add(Class.forName(provider, true, CxfRSService.class.getClassLoader()).newInstance()); } catch (final Exception e) { } } try { final List<Object> all; final String userProviders = SystemInstance.get().getProperty("openejb.jaxrs.client.providers"); if (userProviders == null) { (all = new ArrayList<>(defaults.size())).addAll(defaults); } else { all = new ArrayList<>(defaults.size() + 2 ); for (String p : userProviders.split(" *, *")) { p = p.trim(); if (p.isEmpty()) { continue; } all.add(Thread.currentThread().getContextClassLoader().loadClass(p).newInstance()); } all.addAll(defaults); } bus.setProperty("org.apache.cxf.jaxrs.bus.providers", all); } catch (final Exception e) { throw new IllegalStateException(e); } } }

Target:
private void initCxfProviders(final Bus bus) { if (bus.getProperty("org.apache.cxf.jaxrs.bus.providers") == null) { bus.setProperty("skip.default.json.provider.registration", "true"); final Collection<Object> defaults = new ArrayList<>(); for (final String provider : asList( "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonbProvider", "org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonpProvider")) { if (!isActive(provider)) { continue; } try { defaults.add(Class.forName(provider, true, CxfRSService.class.getClassLoader()).newInstance()); } catch (final Exception e) { } } try { final List<Object> all; final String userProviders = SystemInstance.get().getProperty("openejb.jaxrs.client.providers"); if (userProviders == null) { (all = new ArrayList<>(defaults.size())).addAll(defaults); } else { all = new ArrayList<>(defaults.size() + 2 ); for (String p : userProviders.split(" *, *")) { p = p.trim(); if (p.isEmpty()) { continue; } all.add(Thread.currentThread().getContextClassLoader().loadClass(p).newInstance()); } all.addAll(defaults); } bus.setProperty("org.apache.cxf.jaxrs.bus.providers", all); } catch (final Exception e) { throw new IllegalStateException(e); } } }
Source:
private static <T, E extends Throwable> T doRetry(Retryable<T, E> task, SuccessCondition condition) throws E { T result = task.runExec(); for (int delay = 1; !condition.isSuccessful(task) && delay <= MAX_DELAY_IN_S; delay *= 2) { logFailure(task, delay); ThreadHelper.waitFor(delay * 1000); task.beforeRetry(); result = task.runExec(); } return result; }

Target:
private static <T, E extends Throwable> T doRetry(Retryable<T, E> task, SuccessCondition condition) throws E { T result = task.runExec(); for (int delay = 1; !condition.isSuccessful(task) && delay <= MAX_DELAY_IN_S; delay *= 2) { logFailure(task, delay); ThreadHelper.waitFor(delay * 1000); task.beforeRetry(); result = task.runExec(); } if (!condition.isSuccessful(task)) { throwFinalFailure(task); } return result; }
Source:
void populate(final int row, final Branch k) { final GitwebLink c = Gerrit.getConfig().getGitwebLink(); if (k.getCanDelete()) { table.setWidget(row, 1, new CheckBox()); canDelete = true; } else { table.setText(row, 1, ""); } table.setText(row, 2, k.getShortName()); if (k.getRevision() != null) { table.setText(row, 3, k.getRevision().get()); } else { table.setText(row, 3, ""); } if (c != null) { table.setWidget(row, 4, new Anchor("(gitweb)", false, c.toBranch(k .getNameKey()))); } final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); if ("refs/meta/config".equals(k.getShortName()) || Constants.HEAD.equals(k.getShortName())) { fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().specialBranch()); } fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); if (c != null) { fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell()); } setRowItem(row, k); }

Target:
void populate(final int row, final Branch k) { final GitwebLink c = Gerrit.getConfig().getGitwebLink(); if (k.getCanDelete()) { table.setWidget(row, 1, new CheckBox()); canDelete = true; } else { table.setText(row, 1, ""); } table.setText(row, 2, k.getShortName()); if (k.getRevision() != null) { table.setText(row, 3, k.getRevision().get()); } else { table.setText(row, 3, ""); } if (c != null) { table.setWidget(row, 4, new Anchor("(gitweb)", false, c.toBranch(k .getNameKey()))); } final FlexCellFormatter fmt = table.getFlexCellFormatter(); String iconCellStyle = Gerrit.RESOURCES.css().iconCell(); String dataCellStyle = Gerrit.RESOURCES.css().dataCell(); if ("refs/meta/config".equals(k.getShortName()) || Constants.HEAD.equals(k.getShortName())) { iconCellStyle = Gerrit.RESOURCES.css().specialBranchIconCell(); dataCellStyle = Gerrit.RESOURCES.css().specialBranchDataCell(); fmt.setStyleName(row, 0, iconCellStyle); } fmt.addStyleName(row, 1, iconCellStyle); fmt.addStyleName(row, 2, dataCellStyle); fmt.addStyleName(row, 3, dataCellStyle); if (c != null) { fmt.addStyleName(row, 4, dataCellStyle); } setRowItem(row, k); }
Source:
public LayerLinkPanel(String id, final IModel<ImportTask> model) { super(id); add(new Link<ImportTask>("link", model) { @Override public void onClick() { ImportTask task = getModelObject(); PageParameters pp = new PageParameters(); pp.add("id", task.getContext().getId()); setResponsePage(new LayerPage(task.getLayer(), pp) { protected void onSuccessfulSave() { super.onSuccessfulSave(); try { ImporterWebUtils.importer().changed(model.getObject()); } catch (IOException e) { throw new RuntimeException(e); } }; }); } }.add(new Label("name", new PropertyModel(model, "layer.name"))) .add(new Icon("icon",new DataIconModel(model.getObject().getData())))); }

Target:
public LayerLinkPanel(String id, final IModel<ImportTask> model) { super(id); add(new Link<ImportTask>("link", model) { @Override public void onClick() { ImportTask task = getModelObject(); PageParameters pp = new PageParameters(); pp.add("id", task.getContext().getId()); setResponsePage(new LayerPage(task.getLayer(), pp) { protected void onSuccessfulSave() { super.onSuccessfulSave(); try { ImporterWebUtils.importer().changed(model.getObject()); } catch (IOException e) { error(e); } }; }); } }.add(new Label("name", new PropertyModel(model, "layer.name"))) .add(new Icon("icon",new DataIconModel(model.getObject().getData())))); }
Source:
public Object init(CarbonMessage cMsg, CarbonCallback callback, Map<String, Object> properties) throws ClientConnectorException { if (Constants.PROTOCOL_FTP.equals(properties.get("PROTOCOL"))) { properties.forEach((property, value) -> { switch (property) { case Constants.FTP_PASSIVE_MODE: FtpFileSystemConfigBuilder.getInstance().setPassiveMode(opts, (Boolean) value); break; } }); } return Boolean.TRUE; }

Target:
public Object init(CarbonMessage cMsg, CarbonCallback callback, Map<String, Object> properties) throws ClientConnectorException { if (Constants.PROTOCOL_FTP.equals(properties.get("PROTOCOL"))) { properties.forEach((property, value) -> { if (Constants.FTP_PASSIVE_MODE.equals(property)) { FtpFileSystemConfigBuilder.getInstance().setPassiveMode(opts, (Boolean) value); } }); } return Boolean.TRUE; }
Source:
protected void onDestroy() { ((ViewGroup) mWebView.getParent()).removeView(mWebView); mWebView.destroy(); super.onDestroy(); }

Target:
protected void onDestroy() { ViewGroup parent = (ViewGroup) mWebView.getParent(); if (parent != null) { parent.removeView(mWebView); } mWebView.destroy(); super.onDestroy(); }
Source:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { if(sign.getLine(3).startsWith(tl("signFormatWorth")) && updateFromWorth(sign, player, ess, new BigDecimal("1.0"))) { return false; } Trade charge = getTrade(sign, 1, 2, player, ess); Trade money = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (charge.getItemStack().isSimilar(heldItem)) { int initialItemAmount = charge.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = charge.getItemStack(); item.setAmount(newItemAmount); charge = new Trade(item, ess); BigDecimal chargeAmount = money.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); money = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); money.pay(player, OverflowType.DROP); charge.charge(player); Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); return true; }

Target:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { if (sign.getLine(3).startsWith(tl("signFormatWorth")) && updateFromWorth(sign, player, ess)) { return false; } Trade charge = getTrade(sign, 1, 2, player, ess); Trade money = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (charge.getItemStack().isSimilar(heldItem)) { int initialItemAmount = charge.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = charge.getItemStack(); item.setAmount(newItemAmount); charge = new Trade(item, ess); BigDecimal chargeAmount = money.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); money = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); money.pay(player, OverflowType.DROP); charge.charge(player); Trade.log("Sign", "Sell", "Interact", username, charge, username, money, sign.getBlock().getLocation(), ess); return true; }
Source:
private static void runBuiltinFilterCommand(Repository repo, CheckoutMetadata checkoutMetadata, ObjectLoader ol, OutputStream channel) throws MissingObjectException, IOException { FilterCommand command = null; try { command = Repository.getCommand( checkoutMetadata.smudgeFilterCommand, repo, ol.openStream(), channel); } catch (IOException e) { ol.copyTo(channel); } if (command != null) { while (command.run() != -1) ; } }

Target:
private static void runBuiltinFilterCommand(Repository repo, CheckoutMetadata checkoutMetadata, ObjectLoader ol, OutputStream channel) throws MissingObjectException, IOException { FilterCommand command = null; try { command = Repository.getFilterCommand( checkoutMetadata.smudgeFilterCommand, repo, ol.openStream(), channel); } catch (IOException e) { LOG.error(JGitText.get().failedToDetermineFilterDefinition, e); ol.copyTo(channel); } if (command != null) { while (command.run() != -1) { } } }
Source:
public void discussionsAdministratorOnMobileCanRemoveCategoriesOnPostsListPage() { CategoryPill.Data data = DiscussionsCategoryOperations.using(User.DISCUSSIONS_ADMINISTRATOR, driver) .createCategory(TextGenerator.createUniqueCategoryName()); final String temporaryCategoryName = TextGenerator.createUniqueCategoryName(); final PostsListPage page = new PostsListPage().open(); final CategoriesFieldset categoriesFieldset = page.getFiltersPopOver().click().getCategoriesFieldset(); addAndRemoveTemporaryCategory(page, temporaryCategoryName, categoriesFieldset); Assertion.assertNull(categoriesFieldset.findCategoryWith(temporaryCategoryName), "Temporary category should not be added."); removeCategory(data, page, categoriesFieldset); Assertion.assertNull(categoriesFieldset.findCategoryWith(data.getName()), "Temporary category should be removed."); }

Target:
public void discussionsAdministratorOnMobileCanRemoveCategoriesOnPostsListPage() { CategoryPill.Data data = DiscussionsCategoryOperations.using(User.DISCUSSIONS_ADMINISTRATOR, driver) .createCategory(TextGenerator.createUniqueCategoryName()); final String temporaryCategoryName = TextGenerator.createUniqueCategoryName(); final PostsListPage page = new PostsListPage().open(); final CategoriesFieldset categoriesFieldset = page.getFiltersPopOver().click().getCategoriesFieldset(); addAndRemoveTemporaryCategory(page, temporaryCategoryName, categoriesFieldset); Assertion.assertNull(categoriesFieldset.findCategoryWith(temporaryCategoryName), TEMPORARY_CATEGORY_SHOULD_NOT_BE_ADDED_MESSAGE); removeCategory(data, page, categoriesFieldset); Assertion.assertNull(categoriesFieldset.findCategoryWith(data.getName()), CATEGORY_SHOULD_BE_REMOVED_MESSAGE); }
Source:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm())) { if (getVm() != null && !getVm().getStatus().isUpOrPaused()) { log.warn("Disk id- '{}' wasn't plug to VM- '{}' because the VM status is- '{}'", getParameters().getDiskInfo().getId(), getVmId(), getVm().getStatus()); } else { VmDiskOperationParameterBase params = new VmDiskOperationParameterBase(new DiskVmElement(getParameters().getDiskInfo().getId(), getVmId())); params.setShouldBeLogged(false); ActionReturnValue returnValue = runInternalAction(ActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } } }

Target:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null) { if (!getVm().getStatus().isUpOrPaused()) { log.warn("Disk id - '{}' wasn't plug to VM - '{}' with id - '{}' because the VM status is - '{}'", getParameters().getDiskInfo().getId(), getVmName(), getVmId(), getVm().getStatus()); } else { VmDiskOperationParameterBase params = new VmDiskOperationParameterBase(new DiskVmElement(getParameters().getDiskInfo().getId(), getVmId())); params.setShouldBeLogged(false); ActionReturnValue returnValue = runInternalAction(ActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { auditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } } }
Source:
public void emit(final ServiceEmitter emitter) { synchronized (lock) { ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder(); singleValueDims.forEach(builder::setDimension); multiValueDims.forEach(builder::setDimension); metrics.forEach((metric, value) -> emitter.emit(builder.build(metric, value))); metrics.clear(); } }

Target:
public void emit(final ServiceEmitter emitter) { final Thread currThread = Thread.currentThread(); synchronized (lock) { if (ownerThread == null) { ownerThread = currThread; } else if (!ownerThread.equals(currThread)) { throw new ISE("emit() from multiple threads is not allowed. If it is needed to emit metrics from " + "multiple threads, create a separate QueryMetrics instance for each thread instead."); } ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder(); singleValueDims.forEach(builder::setDimension); multiValueDims.forEach(builder::setDimension); metrics.forEach((metric, value) -> emitter.emit(builder.build(metric, value))); metrics.clear(); } }
Source:
public boolean onPrepareOptionsMenu(android.view.Menu menu) { MenuItem m = menu.findItem(R.id.option_edit_profile); if(state == State.EDIT) { m.setEnabled(false); m.setVisible(false); } else if(state == State.BACK) { state = State.DEFAULT; m.setEnabled(true); m.setVisible(true); } if (DineOnUserApplication.getDineOnUser() == null) { disableMenuItem(menu, R.id.option_check_in); disableMenuItem(menu, R.id.option_bill); return true; } if(DineOnUserApplication.getCurrentDiningSession() != null) { disableMenuItem(menu, R.id.option_check_in); enableMenuItem(menu, R.id.option_bill); } else { enableMenuItem(menu, R.id.option_check_in); disableMenuItem(menu, R.id.option_bill); } return true; }

Target:
public boolean onPrepareOptionsMenu(android.view.Menu menu) { MenuItem m = menu.findItem(R.id.option_edit_profile); if(state == State.EDIT) { m.setEnabled(false); m.setVisible(false); } else if(state == State.BACK) { state = State.DEFAULT; m.setEnabled(true); m.setVisible(true); } if(DineOnUserApplication.getCurrentDiningSession() != null) { disableMenuItem(menu, R.id.option_check_in); enableMenuItem(menu, R.id.option_bill); } else { enableMenuItem(menu, R.id.option_check_in); disableMenuItem(menu, R.id.option_bill); } return true; }
Source:
public void purgeExpired() { if (!enabled) return; long start = -1; try { if (trace) { log.trace("Purging cache store of expired entries"); start = timeService.time(); } storesMutex.readLock().lock(); try { checkStoreAvailability(); Consumer<CacheWriter> purgeWriter = writer -> { if (getStoreConfig(writer).shared() && transport != null && !transport.isCoordinator()) return; if (writer instanceof AdvancedCacheExpirationWriter) { ((AdvancedCacheExpirationWriter)writer).purge(persistenceExecutor, advancedListener); } else if (writer instanceof AdvancedCacheWriter) { ((AdvancedCacheWriter)writer).purge(persistenceExecutor, advancedListener); } }; nonTxWriters.forEach(purgeWriter); txWriters.forEach(purgeWriter); } finally { storesMutex.readLock().unlock(); } if (trace) { log.tracef("Purging cache store completed in %s", Util.prettyPrintTime(timeService.timeDuration(start, TimeUnit.MILLISECONDS))); } } catch (Exception e) { log.exceptionPurgingDataContainer(e); } }

Target:
public void purgeExpired() { if (!enabled) return; long start = -1; try { if (trace) { log.trace("Purging cache store of expired entries"); start = timeService.time(); } storesMutex.readLock().lock(); try { checkStoreAvailability(); Consumer<CacheWriter> purgeWriter = writer -> { if (globalConfiguration.isClustered() && getStoreConfig(writer).shared() && !transport.isCoordinator()) return; if (writer instanceof AdvancedCacheExpirationWriter) { ((AdvancedCacheExpirationWriter)writer).purge(persistenceExecutor, advancedListener); } else if (writer instanceof AdvancedCacheWriter) { ((AdvancedCacheWriter)writer).purge(persistenceExecutor, advancedListener); } }; nonTxWriters.forEach(purgeWriter); txWriters.forEach(purgeWriter); } finally { storesMutex.readLock().unlock(); } if (trace) { log.tracef("Purging cache store completed in %s", Util.prettyPrintTime(timeService.timeDuration(start, TimeUnit.MILLISECONDS))); } } catch (Exception e) { log.exceptionPurgingDataContainer(e); } }
Source:
private String encodeBlob(String encodingType, String blobName) { if (encodingType.equals("url")) { return URLEncoder.encode(blobName, "UTF-8"); } else { return blobName; } }

Target:
private static String encodeBlob(String encodingType, String blobName) { if (encodingType != null && encodingType.equals("url")) { try { return URLEncoder.encode(blobName, "UTF-8"); } catch (UnsupportedEncodingException e) { throw Throwables.propagate(e); } } else { return blobName; } }
Source:
public Builder addSetupQueryId(String queryId) { checkState(!this.queryId.isPresent(), "queryId is already set"); this.setupQueryIds.add(queryId); return this; }

Target:
public Builder addSetupQueryId(String queryId) { this.setupQueryIds.add(queryId); return this; }
Source:
private void createAndCacheNonBootclasspathSystemClassLoader(SharedLibraryInfo lib) { String path = lib.getPath(); List<SharedLibraryInfo> dependencies = lib.getDependencies(); ArrayList<ClassLoader> sharedLibraries = null; if (dependencies != null) { sharedLibraries = new ArrayList<ClassLoader>(dependencies.size()); for (SharedLibraryInfo dependency : dependencies) { String dependencyPath = dependency.getPath(); CachedClassLoader preload = mSystemLibsPreloadMap.get(dependencyPath); if (preload == null) { Log.e(TAG, "Failed to find dependency " + dependencyPath + " of preload library " + path); return; } sharedLibraries.add(preload.loader); } } ClassLoader classLoader = getClassLoader(path, Build.VERSION.SDK_INT, true , null , null , null , null , null , sharedLibraries ); if (classLoader == null) { Log.e(TAG, "Failed to preload " + path); return; } CachedClassLoader preload = new CachedClassLoader(); preload.loader = classLoader; preload.sharedLibraries = sharedLibraries; Log.d(TAG, "Created zygote-cached class loader: " + path); mSystemLibsPreloadMap.put(path, preload); }

Target:
private void createAndCacheNonBootclasspathSystemClassLoader(SharedLibraryInfo lib) { String path = lib.getPath(); List<SharedLibraryInfo> dependencies = lib.getDependencies(); ArrayList<ClassLoader> sharedLibraries = null; if (dependencies != null) { sharedLibraries = new ArrayList<ClassLoader>(dependencies.size()); for (SharedLibraryInfo dependency : dependencies) { String dependencyPath = dependency.getPath(); CachedClassLoader cached = mSystemLibsCacheMap.get(dependencyPath); if (cached == null) { Log.e(TAG, "Failed to find dependency " + dependencyPath + " of cached library " + path); return; } sharedLibraries.add(cached.loader); } } ClassLoader classLoader = getClassLoader(path, Build.VERSION.SDK_INT, true , null , null , null , null , null , sharedLibraries ); if (classLoader == null) { Log.e(TAG, "Failed to cache " + path); return; } CachedClassLoader cached = new CachedClassLoader(); cached.loader = classLoader; cached.sharedLibraries = sharedLibraries; Log.d(TAG, "Created zygote-cached class loader: " + path); mSystemLibsCacheMap.put(path, cached); }