auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
AgentOptions createAgentOptions() { final AgentOptions agentOptions = new AgentOptions(); agentOptions.setDestfile(getDestFile().getAbsolutePath()); if (append != null) { agentOptions.setAppend(append.booleanValue()); } if (includes != null && !includes.isEmpty()) { final String agentIncludes = StringUtils.join(includes.iterator(), ":"); agentOptions.setIncludes(agentIncludes); } if (excludes != null && !excludes.isEmpty()) { final String agentExcludes = StringUtils.join(excludes.iterator(), ":"); agentOptions.setExcludes(agentExcludes); } if (exclClassLoaders != null) { agentOptions.setExclClassloader(exclClassLoaders); } if (inclBootstrapClasses != null) { agentOptions.setInclBootstrapClasses(inclBootstrapClasses .booleanValue()); } if (inclNoLocationClasses != null) { agentOptions.setInclNoLocationClasses(inclNoLocationClasses .booleanValue()); } if (sessionId != null) { agentOptions.setSessionId(sessionId); } if (dumpOnExit != null) { agentOptions.setDumpOnExit(dumpOnExit.booleanValue()); } if (output != null) { agentOptions.setOutput(output); } if (address != null) { agentOptions.setAddress(address); } if (port != null) { agentOptions.setPort(port.intValue()); } if (classDumpDir != null) { agentOptions.setClassDumpDir(classDumpDir.getAbsolutePath()); } if (jmx != null) { agentOptions.setJmx(jmx.booleanValue()); } return agentOptions; }

Target:
AgentOptions createAgentOptions() { final AgentOptions agentOptions = new AgentOptions(); agentOptions.setDestfile(getDestFile().getAbsolutePath()); if (append != null) { agentOptions.setAppend(append.booleanValue()); } if (includes != null && !includes.isEmpty()) { agentOptions .setIncludes(StringUtils.join(includes.iterator(), ":")); } if (excludes != null && !excludes.isEmpty()) { agentOptions .setExcludes(StringUtils.join(excludes.iterator(), ":")); } if (exclClassLoaders != null) { agentOptions.setExclClassloader(exclClassLoaders); } if (inclBootstrapClasses != null) { agentOptions.setInclBootstrapClasses(inclBootstrapClasses .booleanValue()); } if (inclNoLocationClasses != null) { agentOptions.setInclNoLocationClasses(inclNoLocationClasses .booleanValue()); } if (sessionId != null) { agentOptions.setSessionId(sessionId); } if (dumpOnExit != null) { agentOptions.setDumpOnExit(dumpOnExit.booleanValue()); } if (output != null) { agentOptions.setOutput(output); } if (address != null) { agentOptions.setAddress(address); } if (port != null) { agentOptions.setPort(port.intValue()); } if (classDumpDir != null) { agentOptions.setClassDumpDir(classDumpDir.getAbsolutePath()); } if (jmx != null) { agentOptions.setJmx(jmx.booleanValue()); } return agentOptions; }
Source:
public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext) throws InterruptedException { if (!idealStateInitialized.get()) { logger.info("Received initial notification for IdealState change from {}", dcName); idealStateInitialized.set(true); } else { logger.info("IdealState change triggered from {}", dcName); } synchronized (notificationLock) { partitionToResourceNameByDc.put(dcName, new ConcurrentHashMap<>()); for (IdealState state : idealState) { String resourceName = state.getResourceName(); for (String partitionStr : state.getPartitionSet()) { partitionToResourceNameByDc.get(dcName).put(partitionStr, resourceName); } } helixClusterManagerMetrics.idealStateChangeTriggerCount.inc(); } }

Target:
public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext) throws InterruptedException { if (!idealStateInitialized.get()) { logger.info("Received initial notification for IdealState change from {}", dcName); idealStateInitialized.set(true); } else { logger.info("IdealState change triggered from {}", dcName); } ConcurrentHashMap<String, String> newPartitionToResourceMap = new ConcurrentHashMap<>(); for (IdealState state : idealState) { String resourceName = state.getResourceName(); for (String partitionStr : state.getPartitionSet()) { newPartitionToResourceMap.put(partitionStr, resourceName); } } partitionToResourceNameByDc.put(dcName, newPartitionToResourceMap); helixClusterManagerMetrics.idealStateChangeTriggerCount.inc(); }
Source:
public void loadRewardedAd(final MediationRewardedAdConfiguration mediationRewardedAdConfiguration, final MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> mediationAdLoadCallback) { if (!VASAds.isInitialized()) { mediationAdLoadCallback.onFailure("Verizon Ads SDK not initialized"); return; } Bundle serverParameters = mediationRewardedAdConfiguration.getServerParameters(); String placementId = serverParameters.getString(PLACEMENT_KEY); if (TextUtils.isEmpty(placementId)) { mediationAdLoadCallback.onFailure( "Verizon Ads SDK placement ID must be set in mediationRewardedAdConfiguration server params"); return; } setCoppaValue(mediationRewardedAdConfiguration); VASAds.setLocationEnabled((mediationRewardedAdConfiguration.getLocation() != null)); AdapterIncentivizedEventListener adapterIncentivizedEventListener = new AdapterIncentivizedEventListener(mediationAdLoadCallback); try { interstitialAdFactory = new InterstitialAdFactory(mediationRewardedAdConfiguration.getContext(), placementId, adapterIncentivizedEventListener); interstitialAdFactory.setRequestMetaData(getRequestMetadata()); interstitialAdFactory.load(adapterIncentivizedEventListener); } catch (Exception e) { Log.e(TAG, "Failed to load Verizon Ads SDK Incentivized Video Ad", e); ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { if (mediationAdLoadCallback != null) { mediationAdLoadCallback.onFailure("Failed to load Incentivized Video Ad"); } } }); } }

Target:
public void loadRewardedAd(final MediationRewardedAdConfiguration mediationRewardedAdConfiguration, final MediationAdLoadCallback<MediationRewardedAd, MediationRewardedAdCallback> mediationAdLoadCallback) { if (!VASAds.isInitialized()) { mediationAdLoadCallback.onFailure("Verizon Ads SDK not initialized"); return; } Bundle serverParameters = mediationRewardedAdConfiguration.getServerParameters(); String placementId = fetchPlacementId(serverParameters); setContext(mediationRewardedAdConfiguration.getContext()); if (TextUtils.isEmpty(placementId)) { mediationAdLoadCallback.onFailure( "Verizon Ads SDK placement ID must be set in mediationRewardedAdConfiguration server params"); return; } setCoppaValue(mediationRewardedAdConfiguration); VASAds.setLocationEnabled((mediationRewardedAdConfiguration.getLocation() != null)); adapterIncentivizedEventListener = new AdapterIncentivizedEventListener(mediationAdLoadCallback); try { interstitialAdFactory = new InterstitialAdFactory(mediationRewardedAdConfiguration.getContext(), placementId, adapterIncentivizedEventListener); interstitialAdFactory.setRequestMetaData(getRequestMetadata()); interstitialAdFactory.load(adapterIncentivizedEventListener); } catch (Exception e) { Log.e(TAG, "Failed to load Verizon Ads SDK Incentivized Video Ad", e); ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { if (mediationAdLoadCallback != null) { mediationAdLoadCallback.onFailure("Failed to load Incentivized Video Ad"); } } }); } }
Source:
void assignOperationOnExpDesignVariables(final List<MeasurementVariable> conditions) { final VariableTypeList factors = this.studyDataManager.getAllStudyFactors(this.userSelection.getWorkbook().getStudyDetails().getId()); for (final MeasurementVariable mvar : conditions) { if ((mvar.getTermId() == TermId.EXPERIMENT_DESIGN_FACTOR.getId() || mvar.getTermId() == TermId.NUMBER_OF_REPLICATES.getId() || mvar.getTermId() == TermId.PERCENTAGE_OF_REPLICATION.getId() || mvar.getTermId() == TermId.EXPT_DESIGN_SOURCE.getId()) && factors.findById(mvar.getTermId()) != null) { mvar.setOperation(Operation.UPDATE); } } }

Target:
void assignOperationOnExpDesignVariables(final List<MeasurementVariable> conditions) { final VariableTypeList factors = this.studyDataManager.getAllStudyFactors(this.userSelection.getWorkbook().getStudyDetails().getId()); for (final MeasurementVariable mvar : conditions) { if (EXPERIMENT_DESIGN_FACTOR_IDS.contains(mvar.getTermId()) && factors.findById(mvar.getTermId()) != null) { mvar.setOperation(Operation.UPDATE); } } }
Source:
public void changeDetail(final Change.Id id, final AsyncCallback<ChangeDetail> callback) { run(callback, new Action<ChangeDetail>() { public ChangeDetail run(final ReviewDb db) throws OrmException, Failure { final Account.Id me = Common.getAccountId(); final Change change = db.changes().get(id); if (change == null) { throw new Failure(new NoSuchEntityException()); } final PatchSet patch = db.patchSets().get(change.currentPatchSetId()); final Project proj = db.projects().get(change.getDest().getParentKey()); if (patch == null || proj == null) { throw new Failure(new NoSuchEntityException()); } assertCanRead(change); final boolean anon; boolean canAbandon = false; if (me == null) { anon = true; } else { anon = canRead(null, change.getDest().getParentKey()); canAbandon = me.equals(change.getOwner()) || me.equals(patch.getUploader()) || Common.getGroupCache().isAdministrator(me) || Common.getGroupCache().isInGroup(me, proj.getOwnerGroupId()); } final ChangeDetail d = new ChangeDetail(); d.load(db, new AccountInfoCacheFactory(db), change, anon, canAbandon); return d; } }); }

Target:
public void changeDetail(final Change.Id id, final AsyncCallback<ChangeDetail> callback) { run(callback, new Action<ChangeDetail>() { public ChangeDetail run(final ReviewDb db) throws OrmException, Failure { final Account.Id me = Common.getAccountId(); final Change change = db.changes().get(id); if (change == null) { throw new Failure(new NoSuchEntityException()); } final PatchSet patch = db.patchSets().get(change.currentPatchSetId()); final Project proj = Common.getProjectCache().get(change.getDest().getParentKey()) .getProject(); if (patch == null || proj == null) { throw new Failure(new NoSuchEntityException()); } assertCanRead(change); final boolean anon; boolean canAbandon = false; if (me == null) { anon = true; } else { anon = canRead(null, change.getDest().getParentKey()); canAbandon = me.equals(change.getOwner()) || me.equals(patch.getUploader()) || Common.getGroupCache().isAdministrator(me) || Common.getGroupCache().isInGroup(me, proj.getOwnerGroupId()); } final ChangeDetail d = new ChangeDetail(); d.load(db, new AccountInfoCacheFactory(db), change, anon, canAbandon); return d; } }); }
Source:
public List<Address> getItemShippingAddresses() { return null; }

Target:
public List<Address> getItemShippingAddresses() { return itemShippingAddresses; }
Source:
public Matrix shuffle(Factory factory) { double[] matrix = new double[columns * rows]; int k = 0; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { matrix[k] = get(i, j); k++; } } Random rnd = new Random(); for (int i = matrix.length - 1; i >= 0; i--) { int index = rnd.nextInt(i + 1); double a = matrix[index]; matrix[index] = matrix[i]; matrix[i] = a; } Matrix result = factory().createMatrix(rows, columns); k = 0; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { result.set(i, j, matrix[k]); k++; } } return result; }

Target:
public Matrix shuffle(Factory factory) { Matrix result = copy(factory); Random rnd = new Random(); for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { int ii = rnd.nextInt(rows - i) + i; int jj = rnd.nextInt(columns - j) + j; double a = result.get(ii, jj); result.set(ii, jj, result.get(i, j)); result.set(i, j, a); } } return result; }
Source:
public void errorsNotWrapped() { AuthenticationServer orgAuthServer = SyncManager.getAuthServer(); AuthenticationServer authServer = Mockito.mock(AuthenticationServer.class); when(authServer.loginUser(any(Credentials.class), any(URL.class))).thenReturn(SyncTestUtils.createErrorResponse(ErrorCode.ACCESS_DENIED)); SyncManager.setAuthServerImpl(authServer); try { User.login(Credentials.facebook("foo"), "<LINK_0>"); fail(); } catch (ObjectServerError e) { assertEquals(ErrorCode.ACCESS_DENIED, e.getErrorCode()); } finally { SyncManager.setAuthServerImpl(orgAuthServer); } }

Target:
public void errorsNotWrapped() { AuthenticationServer originalAuthServer = SyncManager.getAuthServer(); AuthenticationServer authServer = Mockito.mock(AuthenticationServer.class); when(authServer.loginUser(any(Credentials.class), any(URL.class))).thenReturn(SyncTestUtils.createErrorResponse(ErrorCode.ACCESS_DENIED)); SyncManager.setAuthServerImpl(authServer); try { User.login(Credentials.facebook("foo"), "<LINK_0>"); fail(); } catch (ObjectServerError e) { assertEquals(ErrorCode.ACCESS_DENIED, e.getErrorCode()); } finally { SyncManager.setAuthServerImpl(originalAuthServer); } }
Source:
public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", loadedVersion == null || migrationVersion.compareTo(loadedVersion) > 0); }

Target:
public void testMigrationIsNeededOnData() { Version migrationVersion = new SnapBackDistantLabelsMigrationParticipant().getMigrationVersion(); Version loadedVersion = checkRepresentationFileMigrationStatus(URI.createPlatformResourceURI(SiriusTestCase.TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), true); assertTrue("The migration must be required on test data.", migrationVersion.compareTo(loadedVersion) > 0); }
Source:
public void injectInto(NashornEngine nashornEngine) { nashornEngine.eval("var InstallationType = Java.type(\"org.phoenicis.scripts.ui.InstallationType\")", this::throwException); nashornEngine.put("SetupWizard", (TriFunction<InstallationType, String, Optional<URI>, UiSetupWizardImplementation>) (installationType, name, miniature) -> { final UiSetupWizardImplementation uiSetupWizardImplementation = uiSetupWizardFactory.create(name, miniature, installationType); nashornEngine.addErrorHandler(e -> uiSetupWizardImplementation.close()); return uiSetupWizardImplementation; }, this::throwException); }

Target:
public void injectInto(NashornEngine nashornEngine) { nashornEngine.eval("var InstallationType = Java.type(\"" + InstallationType.class.getCanonicalName() + "\")", this::throwException); nashornEngine.put("SetupWizard", (TriFunction<InstallationType, String, Optional<URI>, UiSetupWizardImplementation>) (installationType, name, miniature) -> { final UiSetupWizardImplementation uiSetupWizardImplementation = uiSetupWizardFactory.create(name, miniature, installationType); nashornEngine.addErrorHandler(e -> uiSetupWizardImplementation.close()); return uiSetupWizardImplementation; }, this::throwException); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ActionDefinition that = (ActionDefinition) o; if (tenantId != null ? !tenantId.equals(that.tenantId) : that.tenantId != null) return false; if (actionPlugin != null ? !actionPlugin.equals(that.actionPlugin) : that.actionPlugin != null) return false; if (actionId != null ? !actionId.equals(that.actionId) : that.actionId != null) return false; return properties != null ? properties.equals(that.properties) : that.properties == null; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ActionDefinition that = (ActionDefinition) o; if (tenantId != null ? !tenantId.equals(that.tenantId) : that.tenantId != null) return false; if (actionPlugin != null ? !actionPlugin.equals(that.actionPlugin) : that.actionPlugin != null) return false; if (actionId != null ? !actionId.equals(that.actionId) : that.actionId != null) return false; if (properties != null ? !properties.equals(that.properties) : that.properties != null) return false; if (states != null ? !states.equals(that.states) : that.states != null) return false; return calendar != null ? calendar.equals(that.calendar) : that.calendar == null; }
Source:
public void clearServers() { RESTHelper.clearServers(); }

Target:
public static void clearServers() { RESTHelper.clearServers(); }
Source:
public String toString() { return (days == 1) ? days + " day" : days + " days"; }

Target:
public String toString() { if (days == null) { return ""; } return days.toString() + ((days == 1) ? " day" : " days"); }
Source:
private static int setDiskBootOrder(List<VmDevice> devices, int bootOrder) { for (VmDevice device : devices) { if (device.getType().equals(VmDeviceCommonUtils.DISK) && device.getDevice().equals(VmDeviceCommonUtils.DISK)) { device.setBootOrder(bootOrder++); } } return bootOrder; }

Target:
private static int setDiskBootOrder(List<VmDevice> devices, int bootOrder) { boolean isOldCluster = VmDeviceCommonUtils.isOldClusterVersion(vm); for (VmDevice device : devices) { if (device.getType().equals(VmDeviceCommonUtils.DISK) && device.getDevice().equals(VmDeviceCommonUtils.DISK)) { if (isOldCluster) { if (DbFacade.getInstance() .getDiskDao() .get(device.getDeviceId()) .getDiskType() .equals(DiskType.System)) { device.setBootOrder(bootOrder++); break; } } else { device.setBootOrder(bootOrder++); } } } return bootOrder; }
Source:
public boolean enable() throws KuraException { try { int pid = LinuxProcessUtil.getPid(this.procString); if (pid > -1) { logger.error("DNS server is already running, bringing it down..."); disable(); } int result; if (OS_VERSION .startsWith(KuraSupportedPlatforms.YOCTO_121.getImageName() + "_") || OS_VERSION.startsWith(KuraSupportedPlatforms.YOCTO_161.getImageName() + "_" + KuraSupportedPlatforms.YOCTO_161.getImageVersion() + "_")) { result = LinuxProcessUtil.start("/etc/init.d/bind start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.RASPBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.DEBIAN_100.getImageName())) { result = LinuxProcessUtil.start("/etc/init.d/bind9 start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.FEDORA_2X.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.CENTOS_7.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.RHEL_73.getImageName() + "_" + KuraSupportedPlatforms.RHEL_73.getImageVersion())) { result = LinuxProcessUtil.start("/bin/systemctl start named"); } else { logger.info("Linux named enable fallback"); result = LinuxProcessUtil.start("/etc/init.d/named start"); } if (result == 0) { logger.debug("DNS server started."); logger.trace("{}", this.dnsServerConfigIP4); return true; } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return false; }

Target:
public boolean enable() throws KuraException { try { int pid = LinuxProcessUtil.getPid(this.procString); if (pid > -1) { logger.error("DNS server is already running, bringing it down..."); disable(); } int result; if (OS_VERSION .startsWith(KuraSupportedPlatforms.YOCTO_121.getImageName() + "_") || OS_VERSION.startsWith(KuraSupportedPlatforms.YOCTO_161.getImageName() + "_" + KuraSupportedPlatforms.YOCTO_161.getImageVersion() + "_")) { result = LinuxProcessUtil.start("/etc/init.d/bind start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.RASPBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.DEBIAN_100.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.UBUNTU_16.getImageName())) { result = LinuxProcessUtil.start("/etc/init.d/bind9 start"); } else if (OS_VERSION.equals(KuraSupportedPlatforms.FEDORA_2X.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.CENTOS_7.getImageName()) || OS_VERSION.equals(KuraSupportedPlatforms.RHEL_73.getImageName() + "_" + KuraSupportedPlatforms.RHEL_73.getImageVersion())) { result = LinuxProcessUtil.start("/bin/systemctl start named"); } else { logger.info("Linux named enable fallback"); result = LinuxProcessUtil.start("/etc/init.d/named start"); } if (result == 0) { logger.debug("DNS server started."); logger.trace("{}", this.dnsServerConfigIP4); return true; } } catch (Exception e) { throw new KuraException(KuraErrorCode.INTERNAL_ERROR, e); } return false; }
Source:
public void surviveWithOneTaskAsStandby() throws InterruptedException, IOException { IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp( inputTopic, Collections.singletonList( new KeyValue<>(0, 0)), TestUtils.producerConfig( CLUSTER.bootstrapServers(), IntegerSerializer.class, IntegerSerializer.class, new Properties()), 10L); final String stateDirPath = TestUtils.tempDirectory(appId).getPath(); final CountDownLatch instanceLatch = new CountDownLatch(1); try ( final KafkaStreams streamInstanceOne = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-1/", instanceLatch); final KafkaStreams streamInstanceTwo = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-2/", instanceLatch); ) { streamInstanceOne.start(); streamInstanceTwo.start(); assertTrue(instanceLatch.await(15, TimeUnit.SECONDS)); waitForCondition(() -> streamInstanceOne.state().equals(KafkaStreams.State.RUNNING), "Stream instance one should be up and running by now"); waitForCondition(() -> streamInstanceTwo.state().equals(KafkaStreams.State.RUNNING), "Stream instance two should be up and running by now"); streamInstanceOne.close(Duration.ZERO); streamInstanceTwo.close(Duration.ZERO); streamInstanceOne.cleanUp(); streamInstanceTwo.cleanUp(); } }

Target:
public void surviveWithOneTaskAsStandby() throws Exception { IntegrationTestUtils.produceKeyValuesSynchronouslyWithTimestamp( inputTopic, Collections.singletonList( new KeyValue<>(0, 0)), TestUtils.producerConfig( CLUSTER.bootstrapServers(), IntegerSerializer.class, IntegerSerializer.class, new Properties()), 10L); final String stateDirPath = TestUtils.tempDirectory(appId).getPath(); final CountDownLatch instanceLatch = new CountDownLatch(1); try ( final KafkaStreams streamInstanceOne = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-1/", instanceLatch); final KafkaStreams streamInstanceTwo = buildStreamWithDirtyStateDir(stateDirPath + "/" + appId + "-2/", instanceLatch); ) { streamInstanceOne.start(); streamInstanceTwo.start(); assertTrue(instanceLatch.await(15, TimeUnit.SECONDS)); waitForCondition(() -> streamInstanceOne.state().equals(KafkaStreams.State.RUNNING), "Stream instance one should be up and running by now"); waitForCondition(() -> streamInstanceTwo.state().equals(KafkaStreams.State.RUNNING), "Stream instance two should be up and running by now"); streamInstanceOne.close(Duration.ZERO); streamInstanceTwo.close(Duration.ZERO); streamInstanceOne.cleanUp(); streamInstanceTwo.cleanUp(); } }
Source:
protected RowExpression visitSubscriptExpression(SubscriptExpression node, Void context) { RowExpression base = process(node.getBase(), context); RowExpression index = process(node.getIndex(), context); if (base instanceof SpecialFormExpression && base.getType() instanceof RowType) { ConstantExpression pos = (ConstantExpression) index; int i = toIntExact((Long) pos.getValue()); return specialForm(DEREFERENCE, getType(node), base, new ConstantExpression(i - 1, INTEGER)); } return call( SUBSCRIPT.name(), functionManager.resolveOperator(SUBSCRIPT, fromTypes(base.getType(), index.getType())), getType(node), base, index); }

Target:
protected RowExpression visitSubscriptExpression(SubscriptExpression node, Void context) { RowExpression base = process(node.getBase(), context); RowExpression index = process(node.getIndex(), context); if (base.getType() instanceof RowType) { checkState(index instanceof ConstantExpression, "Subscript expression on ROW requires a ConstantExpression"); ConstantExpression position = (ConstantExpression) index; checkState(position.getValue() instanceof Long, "ConstantExpression should contain a valid integer index into the row"); Long offset = (Long) position.getValue(); checkState( offset >= 1 && offset <= base.getType().getTypeParameters().size(), "Subscript index out of bounds %s: should be >= 1 and <= %s", offset, base.getType().getTypeParameters().size()); return specialForm(DEREFERENCE, getType(node), base, Expressions.constant(offset - 1, INTEGER)); } return call( SUBSCRIPT.name(), functionManager.resolveOperator(SUBSCRIPT, fromTypes(base.getType(), index.getType())), getType(node), base, index); }
Source:
private static String getPropertyAsString(Properties prop) { StringWriter writer = new StringWriter(); try { prop.store(writer, ""); } catch (IOException e) { logger.error("Cannot retrieve consumer properties for Logging : {}", e.getMessage() ); } return writer.getBuffer().toString(); }

Target:
private String getPropertyAsString(Properties prop) { StringWriter writer = new StringWriter(); try { prop.store(writer, ""); } catch (IOException e) { logger.error("Cannot retrieve consumer properties for Logging : {}", e.getMessage() ); } return writer.getBuffer().toString(); }
Source:
private String getAvailablePluginsString() { final StringBuilder buf = new StringBuilder("Available Plugins\r\n"); for (Plugin plugin : getAvailablePlugins()) { Set<String> versionSet = plugin.getVersions(); String[] versions = versionSet.toArray(new String[versionSet.size()]); if (versions.length == 1) { buf.append("install ").append(plugin.getID()).append('=').append(versions[0]).append("\r\n"); } else { buf.append("install ["); for (int i = versions.length - 1; i >= 0; i--) { buf.append(plugin.getID()).append('=').append(versions[i]); if (i != 0) { buf.append(", "); } } buf.append("]\r\n"); } } return buf.toString(); }

Target:
private String getAvailablePluginsString() { ArrayList<String> res = new ArrayList<>(); for (Plugin plugin : getAvailablePlugins()) { List<String> versions = new ArrayList<>(plugin.getVersions()); Collections.reverse(versions); res.add(plugin.getID() + "=" + Arrays.toString(versions.toArray())); } return Arrays.toString(res.toArray()); }
Source:
public Google2AttributesDefinition() { addAttribute(GENDER, Converters.genderConverter); addAttribute(GENDER, Converters.stringConverter); addAttribute(DISPLAY_NAME, Converters.stringConverter); addAttribute(GIVEN_NAME, Converters.stringConverter); addAttribute(FAMILY_NAME, Converters.stringConverter); addAttribute(URL, Converters.stringConverter); addAttribute(PICTURE, Converters.stringConverter); addAttribute(LANGUAGE, Converters.localeConverter); addAttribute(BIRTHDAY, Google2Converters.dateConverter); addAttribute(EMAILS, Google2Converters.listEmailConverter); }

Target:
public Google2AttributesDefinition() { addAttribute(GENDER, Converters.genderConverter); addAttribute(DISPLAY_NAME, Converters.stringConverter); addAttribute(GIVEN_NAME, Converters.stringConverter); addAttribute(FAMILY_NAME, Converters.stringConverter); addAttribute(URL, Converters.stringConverter); addAttribute(PICTURE, Converters.stringConverter); addAttribute(LANGUAGE, Converters.localeConverter); addAttribute(BIRTHDAY, Google2Converters.dateConverter); addAttribute(EMAILS, Google2Converters.listEmailConverter); }
Source:
public boolean truncateLog(long zxid) { try { close(); FileTxnLog truncLog = new FileTxnLog(dataDir); boolean truncated = truncLog.truncate(zxid); truncLog.close(); txnLog = new FileTxnLog(dataDir); snapLog = new FileSnap(snapDir); return truncated; } catch (IOException e) { LOG.error("Unable to truncate Txn log", e); return false; } }

Target:
public boolean truncateLog(long zxid) { try { close(); try (FileTxnLog truncLog = new FileTxnLog(dataDir)) { boolean truncated = truncLog.truncate(zxid); txnLog = new FileTxnLog(dataDir); snapLog = new FileSnap(snapDir); return truncated; } } catch (IOException e) { LOG.error("Unable to truncate Txn log", e); return false; } }
Source:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } else if (height > oldHeight) { App.fireJavascriptEvent("hidekeyboard"); } else if (height < oldHeight) { App.fireJavascriptEvent("showkeyboard"); } oldHeight = height; oldWidth = width; }

Target:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); LOG.v(TAG, "We are in our onMeasure method"); int width, height; height = MeasureSpec.getSize(heightMeasureSpec); width = MeasureSpec.getSize(widthMeasureSpec); LOG.v(TAG, "Old Height = %d", oldHeight); LOG.v(TAG, "Height = %d", height); LOG.v(TAG, "Old Width = %d", oldWidth); LOG.v(TAG, "Width = %d", width); if (oldHeight == 0 || oldHeight == height) { LOG.d(TAG, "Ignore this event"); } else if (screenHeight == width) { int tmp_var = screenHeight; screenHeight = screenWidth; screenWidth = tmp_var; LOG.v(TAG, "Orientation Change"); } else if (height > oldHeight) { sendEvent("hidekeyboard"); } else if (height < oldHeight) { sendEvent("showkeyboard"); } oldHeight = height; oldWidth = width; }
Source:
void prepare() throws InfrastructureException { OpenShiftClient osClient = clientFactory.createOC(workspaceId); if (osClient.serviceAccounts().inNamespace(projectName).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(osClient); } String execRoleName = "exec"; if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { createExecRole(osClient, execRoleName); } String viewRoleName = "view"; if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { createViewRole(osClient, viewRoleName); } osClient.roleBindings().inNamespace(projectName).createOrReplace(createExecRoleBinding()); osClient.roleBindings().inNamespace(projectName).createOrReplace(createViewRoleBinding()); }

Target:
void prepare() throws InfrastructureException { OpenShiftClient osClient = clientFactory.createOC(workspaceId); if (osClient.serviceAccounts().inNamespace(projectName).withName(serviceAccountName).get() == null) { createWorkspaceServiceAccount(osClient); } String execRoleName = "exec"; if (osClient.roles().inNamespace(projectName).withName(execRoleName).get() == null) { createExecRole(osClient, execRoleName); } String viewRoleName = "workspace-view"; if (osClient.roles().inNamespace(projectName).withName(viewRoleName).get() == null) { createViewRole(osClient, viewRoleName); } osClient.roleBindings().inNamespace(projectName).createOrReplace(createExecRoleBinding()); osClient.roleBindings().inNamespace(projectName).createOrReplace(createViewRoleBinding()); }
Source:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { PedigreeReader pedigreeReader = new PedigreePedReader(jobOptions.getPipelineOptions().getString("input.pedigree")); pedigreeReader.open(); List<Pedigree> pedigrees = pedigreeReader.read(); pedigreeReader.close(); return RepeatStatus.FINISHED; }

Target:
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { PedigreeReader pedigreeReader = new PedigreePedReader(jobOptions.getPipelineOptions().getString("input.pedigree")); pedigreeReader.open(); pedigree = pedigreeReader.read().get(0); pedigreeReader.close(); return RepeatStatus.FINISHED; }
Source:
private void add(@NonNull Container container, String name, LoadStatistics stats) { boolean headless = Boolean.getBoolean("java.awt.headless"); for (MultiStageTimeSeries.TimeScale scale: MultiStageTimeSeries.TimeScale.values()) { if (!headless) { BufferedImage image = stats.createTrendChart(scale).createChart().createBufferedImage(500, 400); container.add(new ImageContent(String.format("load-stats/%s/%s.png", name, scale.name().toLowerCase()), image)); } container.add(new CsvContent(String.format("load-stats/%s/%s.csv", name, scale.name().toLowerCase()), stats, scale)); } }

Target:
private void add(@NonNull Container container, String name, LoadStatistics stats) { boolean headless = GraphicsEnvironment.isHeadless(); for (MultiStageTimeSeries.TimeScale scale : MultiStageTimeSeries.TimeScale.values()) { String scaleName = scale.name().toLowerCase(Locale.ENGLISH); if (!headless) { BufferedImage image = stats.createTrendChart(scale).createChart().createBufferedImage(500, 400); container.add(new ImageContent(String.format("load-stats/%s/%s.png", name, scaleName), image)); } container.add(new CsvContent(String.format("load-stats/%s/%s.csv", name, scaleName), stats, scale)); } if (headless) { container.add(new GnuPlotScript(String.format("load-stats/%s/gnuplot", name))); } }
Source:
public void execute(Tuple inputTuple) { Map<String, List<Object>> results = modelRunner.scoredTuplePerStream(inputTuple); LOG.debug("Emitting events to collector: [{}]", results); for (Map.Entry<String, List<Object>> result : results.entrySet()) { collector.emit(result.getKey(), inputTuple, new Values(result.getValue())); } }

Target:
public void execute(Tuple inputTuple) { try { Map<String, List<Object>> results = modelRunner.scoredTuplePerStream(inputTuple); for (Map.Entry<String, List<Object>> result : results.entrySet()) { LOG.debug("Emitting tuples in the following stream: [{}]", result.getKey()); collector.emit(result.getKey(), inputTuple, new Values(result.getValue())); } } catch (Exception exception) { LOG.error("There was an error while evaluation the tuple [{}]", inputTuple); } }
Source:
public DocumentModel getParentDocument(DocumentRef docRef) { Document parentDoc; if (docRef != null && docRef.type() == DocumentRef.PATH) { String targetPath = ((String) docRef.reference()); String parentPath = targetPath.substring(0, targetPath.lastIndexOf("/")); parentDoc = resolveReference( new PathRef(parentPath)); } else { Document doc = resolveReference(docRef); parentDoc = doc.getParent(); } if (parentDoc == null) { return null; } if (!hasPermission(parentDoc, READ)) { throw new DocumentSecurityException("Privilege READ is not granted to " + getPrincipal().getName()); } return readModel(parentDoc); }

Target:
public DocumentModel getParentDocument(DocumentRef docRef) { Document parentDoc = resolveParentReference(docRef); if (parentDoc == null) { return null; } if (!hasPermission(parentDoc, READ)) { throw new DocumentSecurityException("Privilege READ is not granted to " + getPrincipal().getName()); } return readModel(parentDoc); }
Source:
private void reportFileUploadException(FileUploadException e) { validator.add(new ValidationMessage(e.getMessage(), "file.upload.exception")); logger.warn("There was some problem parsing this multipart request, " + "or someone is not sending a RFC1867 compatible multipart request.", e); }

Target:
private void reportFileUploadException(FileUploadException e) { validator.add(new I18nMessage("upload", "file.upload.exception")); logger.warn("There was some problem parsing this multipart request, " + "or someone is not sending a RFC1867 compatible multipart request.", e); }
Source:
public IdpResponse build() { if (mPendingCredential != null) { return new IdpResponse(mPendingCredential, new FirebaseUiException(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT)); } else { String providerId = mUser.getProviderId(); if (!AuthUI.SUPPORTED_PROVIDERS.contains(providerId)) { throw new IllegalStateException("Unknown provider: " + providerId); } if (AuthUI.SOCIAL_PROVIDERS.contains(providerId) && TextUtils.isEmpty(mToken)) { throw new IllegalStateException( "Token cannot be null when using a non-email provider."); } if (providerId.equals(TwitterAuthProvider.PROVIDER_ID) && TextUtils.isEmpty(mSecret)) { throw new IllegalStateException( "Secret cannot be null when using the Twitter provider."); } return new IdpResponse(mUser, mToken, mSecret, mIsNewUser); } }

Target:
public IdpResponse build() { if (mPendingCredential != null) { return new IdpResponse(mPendingCredential, new FirebaseUiException(ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT)); } String providerId = mUser.getProviderId(); if (!AuthUI.SUPPORTED_PROVIDERS.contains(providerId)) { throw new IllegalStateException("Unknown provider: " + providerId); } if (AuthUI.SOCIAL_PROVIDERS.contains(providerId) && TextUtils.isEmpty(mToken)) { throw new IllegalStateException( "Token cannot be null when using a non-email provider."); } if (providerId.equals(TwitterAuthProvider.PROVIDER_ID) && TextUtils.isEmpty(mSecret)) { throw new IllegalStateException( "Secret cannot be null when using the Twitter provider."); } return new IdpResponse(mUser, mToken, mSecret, mIsNewUser); }
Source:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { try { MinioClient minioClient = new MinioClient( "<LINK_1>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); List<SseConfigurationRule> rules = new LinkedList<>(); rules.add(new SseConfigurationRule("my-kms-master-key-id", null)); SseConfiguration config = new SseConfiguration(rules); minioClient.setBucketEncryption("my-bucketname", config); System.out.println("Encryption configuration of my-bucketname is set successfully"); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }

Target:
public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException { try { MinioClient minioClient = new MinioClient( "<LINK_1>", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); List<SseConfigurationRule> rules = new LinkedList<>(); rules.add(new SseConfigurationRule(null, SseAlgorithm.AES256)); SseConfiguration config = new SseConfiguration(rules); minioClient.setBucketEncryption( SetBucketEncryptionArgs.builder().bucket("my-bucketname").config(config).build()); System.out.println("Encryption configuration of my-bucketname is set successfully"); } catch (MinioException e) { System.out.println("Error occurred: " + e); } }
Source:
public void testConfigFromEnvVars() { environmentVariables.set("FFWD_TTL", "100"); environmentVariables.set("FFWD_OUTPUT_RATELIMIT", "1000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYLIMIT", "10000"); environmentVariables.set("FFWD_OUTPUT_HYPERLOGLOGSWAPPERIODMS", "3000000"); CoreOutputManager outputManager = getOutputManager(null); assertEquals(100, outputManager.getTtl()); assertEquals(Long.valueOf(1000), outputManager.getRateLimit()); assertEquals(Long.valueOf(10000), outputManager.getCardinalityLimit()); assertEquals(Long.valueOf(3000000), outputManager.getHLLPRefreshPeriodLimit()); }

Target:
public void testConfigFromEnvVars() { environmentVariables.set("FFWD_TTL", "100"); environmentVariables.set("FFWD_OUTPUT_RATELIMIT", "1000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYLIMIT", "10000"); environmentVariables.set("FFWD_OUTPUT_CARDINALITYTTL", "3000000"); CoreOutputManager outputManager = getOutputManager(null); assertEquals(100, outputManager.getTtl()); assertEquals(Long.valueOf(1000), outputManager.getRateLimit()); assertEquals(Long.valueOf(10000), outputManager.getCardinalityLimit()); assertEquals(Long.valueOf(3000000), outputManager.getHLLPRefreshPeriodLimit()); }
Source:
private boolean useBasicAuth() { return Boolean.getBoolean("solr.useBasicAuth"); }

Target:
private boolean useBasicAuth() { return Boolean.valueOf(getProperty(SOLR_USE_BASIC_AUTH)); }
Source:
protected boolean set(EntityParrot dataHolder, ParrotVariant value) { if (value instanceof SpongeParrotVariant) { dataHolder.setVariant(((SpongeParrotVariant)value).type); return true; } return false; }

Target:
protected boolean set(EntityParrot dataHolder, ParrotVariant value) { dataHolder.setVariant(((SpongeParrotVariant)value).type); return true; }
Source:
public Page<AuthorizationRest> findByObject(@Parameter(value = "uri", required = true) String uri, @Parameter(value = "eperson") UUID epersonUuid, Pageable pageable) throws AuthorizeException, SQLException { Context context = obtainContext(); BaseObjectRest obj = utils.getBaseObjectRestFromUri(context, uri); if (obj == null) { return null; } EPerson currUser = context.getCurrentUser(); EPerson user = getUserFromRequestParameter(context, epersonUuid); context.setCurrentUser(user); List<AuthorizationFeature> features = authorizationFeatureService.findByResourceType(obj.getUniqueType()); List<Authorization> authorizations = new ArrayList<Authorization>(); for (AuthorizationFeature f : features) { if (authorizationFeatureService.isAuthorized(context, f, obj)) { authorizations.add(new Authorization(user, f, obj)); } } context.setCurrentUser(currUser); return converter.toRestPage(utils.getPage(authorizations, pageable), utils.obtainProjection()); }

Target:
public Page<AuthorizationRest> findByObject(@Parameter(value = "uri", required = true) String uri, @Parameter(value = "eperson") UUID epersonUuid, Pageable pageable) throws AuthorizeException, SQLException { Context context = obtainContext(); BaseObjectRest obj = utils.getBaseObjectRestFromUri(context, uri); if (obj == null) { return null; } EPerson currUser = context.getCurrentUser(); EPerson user = getUserFromRequestParameter(context, epersonUuid); if (currUser != user) { context.switchContextUser(user); } List<AuthorizationFeature> features = authorizationFeatureService.findByResourceType(obj.getUniqueType()); List<Authorization> authorizations = new ArrayList<Authorization>(); for (AuthorizationFeature f : features) { if (authorizationFeatureService.isAuthorized(context, f, obj)) { authorizations.add(new Authorization(user, f, obj)); } } if (currUser != user) { context.restoreContextUser(); } return converter.toRestPage(utils.getPage(authorizations, pageable), utils.obtainProjection()); }
Source:
public void shouldThrowExceptionWithBadMethodName() throws Exception { MyActivity myActivity = buildActivity(MyActivity.class).create().get(); RoboAttributeSet attrs = shadowOf(RuntimeEnvironment.application).createAttributeSet( new Attribute("android:onClick", "clickYou", R.class.getPackage().getName()) ); view = new View(myActivity, attrs); view.performClick(); }

Target:
public void shouldThrowExceptionWithBadMethodName() throws Exception { MyActivity myActivity = buildActivity(MyActivity.class).create().get(); RoboAttributeSet attrs = ShadowApplication.getInstance().createAttributeSet( new Attribute("android:onClick", "clickYou", R.class.getPackage().getName()) ); view = new View(myActivity, attrs); view.performClick(); }
Source:
public Queues createOrPropagate(Throwable t) throws Exception { return valOnNotFoundOr404(Queues.EMPTY, checkNotNull(t, "throwable")); }

Target:
public Queues createOrPropagate(Throwable t) throws Exception { if ((getFirstThrowableOfType(checkNotNull(t, "throwable"), ResourceNotFoundException.class) != null) || contains404(t)) { return Queues.EMPTY; } throw propagate(t); }
Source:
public DataSet< V> union(DataSet<V> dataSet, OperationContext operationContext, String name, boolean pushScope, String scopeDetail) { pushScopeIfNeeded((SpliceFunction)null, pushScope, scopeDetail); try { Dataset rdd1 = dataset.union(((NativeSparkDataSet) dataSet).dataset); return new NativeSparkDataSet<>(rdd1, operationContext); } finally { if (pushScope) SpliceSpark.popScope(); } }

Target:
public DataSet< V> union(DataSet<V> dataSet, OperationContext operationContext, String name, boolean pushScope, String scopeDetail) { pushScopeIfNeeded((SpliceFunction)null, pushScope, scopeDetail); try { Dataset right = getDataset(dataSet); Dataset rdd1 = dataset.union(right); return new NativeSparkDataSet<>(rdd1, operationContext); } catch (Exception se){ throw new RuntimeException(se); } finally { if (pushScope) SpliceSpark.popScope(); } }
Source:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if (args.length == 1) { return StringUtil.copyPartialMatches(args[0], BAN_TYPES, new ArrayList(BAN_TYPES_SIZE)); } return super.tabComplete(sender, alias, args); }

Target:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if (args.length == 1) { return StringUtil.copyPartialMatches(args[0], BAN_TYPES, new ArrayList(BAN_TYPES.size())); } else { return args.length == 0 ? super.tabComplete(sender, alias, args) : Collections.emptyList(); } }
Source:
protected Properties createProducerConfigs() { Properties producerProps = new Properties(); producerProps.setProperty(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers()); producerProps.setProperty(KEY_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER); producerProps.setProperty(VALUE_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER); return producerProps; }

Target:
protected Properties createProducerConfigs() { Properties producerProps = super.createProducerConfigs(); producerProps.setProperty(KEY_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER); producerProps.setProperty(VALUE_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER); return producerProps; }
Source:
String invoke(RequestContext reqctx, MethodInfo mi) { final Class[] argTypes = mi.method.getParameterTypes(); final Object[] args = mi.arguments; if (reqctx != null) { for (int j = 0; j < args.length; ++j) if (ServletRequest.class.isAssignableFrom(argTypes[j])) args[j] = reqctx.request; else if (ServletResponse.class.isAssignableFrom(argTypes[j])) args[j] = reqctx.response; else if (ServletContext.class.isAssignableFrom(argTypes[j])) args[j] = getServletContext(); } try { Object o = mi.method.invoke(null, args); return o instanceof String ? (String) o : ""; } catch (Throwable ex) { log.error("Unable to invoke " + mi.method, ex); return ""; } finally { mi.arguments = new Object[0]; } }

Target:
String invoke(RequestContext reqctx, MethodInfo mi) { final Class[] argTypes = mi.method.getParameterTypes(); final Object[] args = mi.arguments; if (reqctx != null) { for (int j = 0; j < args.length; ++j) if (ServletRequest.class.isAssignableFrom(argTypes[j])) args[j] = reqctx.request; else if (ServletResponse.class.isAssignableFrom(argTypes[j])) args[j] = reqctx.response; else if (ServletContext.class.isAssignableFrom(argTypes[j])) args[j] = getServletContext(); } try { Object o = mi.method.invoke(null, args); return o instanceof String ? (String) o : ""; } catch (Throwable ex) { log.error("Unable to invoke " + mi.method, ex); return ""; } finally { Arrays.fill(mi.arguments, null); } }
Source:
public void start(@SuppressWarnings("rawtypes") Observable[] os, AtomicLong requested) { Object[] observers = new Object[os.length]; for (int i = 0; i < os.length; i++) { InnerSubscriber io = new InnerSubscriber(); observers[i] = io; childSubscription.add(io); } this.requested = requested; this.observers = observers; for (int i = 0; i < os.length; i++) { os[i].unsafeSubscribe((InnerSubscriber) observers[i]); } }

Target:
public void start(@SuppressWarnings("rawtypes") Observable[] os, AtomicLong requested) { final Object[] subscribers = new Object[os.length]; for (int i = 0; i < os.length; i++) { InnerSubscriber io = new InnerSubscriber(); subscribers[i] = io; childSubscription.add(io); } this.requested = requested; this.subscribers = subscribers; for (int i = 0; i < os.length; i++) { os[i].unsafeSubscribe((InnerSubscriber) subscribers[i]); } }