auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static byte[] hash(byte[] secret, byte[] label, byte[] seed, int length, String algo) { if (length < 0) { throw new IllegalArgumentException("You must provide a length greater than zero."); } try { Mac hmac = Mac.getInstance(algo); hmac.init(new SecretKeySpec(secret, algo)); int iterations = (int) Math.ceil(length / (double) hmac.getMacLength()); byte[] expansion = new byte[0]; byte[] data = concat(label, seed); byte[] A = data; for (int i = 0; i < iterations; i++) { A = hmac.doFinal(A); expansion = concat(expansion, hmac.doFinal(concat(A, data))); } return Arrays.copyOf(expansion, length); } catch (GeneralSecurityException e) { throw new IllegalArgumentException("Could not find algo: " + algo, e); } }

Target:
static byte[] hash(byte[] secret, byte[] label, byte[] seed, int length, String algo) { if (length < 0) { throw new IllegalArgumentException("You must provide a length greater than zero."); } try { Mac hmac = Mac.getInstance(algo); hmac.init(new SecretKeySpec(secret, algo)); int iterations = (int) Math.ceil(length / (double) hmac.getMacLength()); byte[] expansion = EmptyArrays.EMPTY_BYTES; byte[] data = concat(label, seed); byte[] A = data; for (int i = 0; i < iterations; i++) { A = hmac.doFinal(A); expansion = concat(expansion, hmac.doFinal(concat(A, data))); } return Arrays.copyOf(expansion, length); } catch (GeneralSecurityException e) { throw new IllegalArgumentException("Could not find algo: " + algo, e); } }
Source:
synchronized List<T> take(int n) throws InterruptedException { readingLock.lock(); List<T> result = new LinkedList<T>(); while (queue.size() < n) { try { nonEmpty.await(); } catch (InterruptedException e) { throw e; } } for (int i = 0; i < n; ++i) { result.add(queue.element()); queue.remove(); } if (queue.size() == 0) { empty.signal(); } readingLock.unlock(); return result; }

Target:
public synchronized List<T> take(int n) throws InterruptedException { try { lock.lock(); List<T> result = new LinkedList<T>(); while (queue.size() < n) { try { boolean flag = nonEmpty.await(5, TimeUnit.SECONDS); if (!flag) { return result; } } catch (InterruptedException e) { throw e; } } for (int i = 0; i < n; ++i) { result.add(queue.remove()); } empty.signal(); return result; } finally { lock.unlock(); } }
Source:
public void validateConnectionParams_Valid() { HashMap<String, Object> connectParams = new HashMap<String, Object>(); connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm"); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_REMOTE_VIDEO, new PercentFrameLayout(context)); try { connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, false); RCUtils.validateConnectionParms(connectParams); } catch (RCException ex) { assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.SUCCESS); } }

Target:
public void validateConnectionParams_Valid() { HashMap<String, Object> connectParams = new HashMap<String, Object>(); connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm"); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_REMOTE_VIDEO, new PercentFrameLayout(context)); try { connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, false); RCUtils.validateConnectionParms(connectParams); } catch (RCException ex) { fail(ex.toString()); } }
Source:
public void testMethod() { String suite = "src/test/resources/parametertest/1417.xml"; TestNG testNG = new TestNG(); testNG.setTestSuites(Collections.singletonList(suite)); testNG.run(); Assert.assertFalse(testNG.hasFailure()); Assert.assertFalse(testNG.hasSkip()); }

Target:
public void testMethod() { String suite = "src/test/resources/parametertest/1417.xml"; TestNG testNG = new TestNG(); testNG.setTestSuites(Collections.singletonList(suite)); testNG.run(); Assert.assertFalse(testNG.hasFailure()); Assert.assertFalse(testNG.hasSkip()); Assert.assertEquals(AnotherTestClassSample.getInstance().getBrowsername(), "chrome"); List<String> actual = YetAnotherTestClassSample.getInstance().getBrowsers(); Assert.assertEquals(actual.size(), 2); Assert.assertEquals(actual, Arrays.asList("safari", "safari")); }
Source:
protected void consumeRecordHeaderNameWithTypeParameters() { consumeTypeHeaderNameWithTypeParameters(); TypeDeclaration typeDecl = (TypeDeclaration)this.astStack[this.astPtr]; typeDecl.modifiers |= ExtraCompilerModifiers.AccRecord; }

Target:
protected void consumeRecordHeaderNameWithTypeParameters() { consumeTypeHeaderNameWithTypeParameters(); }
Source:
private void setupOneSignalSDK() { boolean privacyConsent = true; boolean isLocationShared = OneSignalPrefs.getCachedLocationSharedStatus(context); boolean isInAppMessagingPaused = OneSignalPrefs.getCachedInAppMessagingPausedStatus(context); OneSignal.pauseInAppMessages(isInAppMessagingPaused); Log.d(Tag.DEBUG, Text.PRIVACY_CONSENT_REQUIRED_SET + ": " + privacyConsent); boolean isEmailCached = attemptSignIn(new EmailUpdateCallback() { @Override public void onSuccess() { tasks[0] = true; attemptEnterApplication(); } @Override public void onFailure() { tasks[0] = true; attemptEnterApplication(); } }); if (!isEmailCached) { tasks[0] = true; attemptEnterApplication(); } new Thread() { public void run() { boolean isExternalUserIdCached = attemptExternalUserId(); tasks[1] = true; attemptEnterApplication(); } }.start(); new Thread() { public void run() { boolean hasConsent = OneSignalPrefs.getUserPrivacyConsent(context); OneSignal.provideUserConsent(hasConsent); tasks[2] = true; attemptEnterApplication(); } }.start(); }

Target:
private void setupOneSignalSDK() { boolean isInAppMessagingPaused = OneSignalPrefs.getCachedInAppMessagingPausedStatus(context); OneSignal.pauseInAppMessages(isInAppMessagingPaused); boolean isEmailCached = attemptSignIn(new EmailUpdateCallback() { @Override public void onSuccess() { tasks[0] = true; attemptEnterApplication(); } @Override public void onFailure() { tasks[0] = true; attemptEnterApplication(); } }); if (!isEmailCached) { tasks[0] = true; attemptEnterApplication(); } new Thread() { public void run() { boolean isExternalUserIdCached = attemptExternalUserId(); tasks[1] = true; attemptEnterApplication(); } }.start(); new Thread() { public void run() { boolean hasConsent = OneSignalPrefs.getUserPrivacyConsent(context); OneSignal.provideUserConsent(hasConsent); tasks[2] = true; attemptEnterApplication(); } }.start(); }
Source:
public String toString() { return Objects.toStringHelper("ConversationEndCause") .add("ConversationEndType", this.endType) .toString(); }

Target:
public String toString() { return Objects.toStringHelper(this) .add("ConversationEndType", this.endType) .toString(); }
Source:
protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException { AttributeDefinition attr = getAttributeDefinition(attributeName); if(attr == ServerDefinition.JOURNAL_FILE_SIZE){ context.addStep(new OperationStepHandler(){ final ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ModelNode journalType = ServerDefinition.JOURNAL_TYPE.resolveModelAttribute(context, model); final ModelNode journalFileSize = ServerDefinition.JOURNAL_FILE_SIZE.resolveModelAttribute(context, model); @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (journalType.asString().equalsIgnoreCase(JournalType.ASYNCIO.name()) && (journalFileSize.asLong() % 512 != 0)) { throw MessagingLogger.ROOT_LOGGER.invalidJournalFileSize(journalFileSize.asLong()); } } }, Stage.RUNTIME); } if (attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { return true; } else { ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(OP_ADDR))); ServiceController<?> service = registry.getService(serviceName); if (service == null) { return false; } else if (service.getState() != ServiceController.State.UP) { return true; } else { if (!ActiveMQActivationService.isActiveMQServerActive(context, operation)) { return false; } applyOperationToActiveMQService(context, operation, attributeName, service); return false; } } }

Target:
protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException { AttributeDefinition attr = getAttributeDefinition(attributeName); if (attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { return true; } else { ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(OP_ADDR))); ServiceController<?> service = registry.getService(serviceName); if (service == null) { return false; } else if (service.getState() != ServiceController.State.UP) { return true; } else { if (!ActiveMQActivationService.isActiveMQServerActive(context, operation)) { return false; } applyOperationToActiveMQService(context, operation, attributeName, service); return false; } } }
Source:
public Request append(Request target, Message message) { message.getExternalMetadata().forEach((header, value) -> target.getHeaders().put(header, value)); return target; }

Target:
public Request append(Request target, Message message) { message.getExternalMetadata().forEach(target::header); return target; }
Source:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException, OrmException { Transaction transaction = null; Statement stmt = null; try { transaction = db.beginTransaction(); Connection connection = ((JdbcSchema) db).getConnection(); final boolean projectIdColumnExists = checkColumn(connection); stmt = connection.createStatement(); final SqlDialect dialect = ((JdbcSchema) db).getDialect(); if (dialect instanceof DialectPostgreSQL) { if (!projectIdColumnExists) { stmt.execute("ALTER TABLE projects ADD COLUMN project_id INTEGER"); } stmt.execute("UPDATE projects SET project_id = nextval('project_id')"); } else if (dialect instanceof DialectH2) { if (!projectIdColumnExists) { stmt.execute("ALTER TABLE projects ADD COLUMN project_id INTEGER"); } stmt.execute("UPDATE projects SET project_id = nextval('project_id')"); } else if (dialect instanceof DialectMySQL) { if (!projectIdColumnExists){ stmt.execute("ALTER TABLE projects ADD project_id INTEGER"); } stmt.execute("CREATE FUNCTION nextval_project_id () RETURNS BIGINT" + " LANGUAGE SQL NOT DETERMINISTIC MODIFIES SQL DATA" + " BEGIN INSERT INTO project_id (s) VALUES (NULL);" + " DELETE FROM project_id WHERE s = LAST_INSERT_ID();" + " RETURN LAST_INSERT_ID(); END"); stmt.execute("UPDATE projects SET project_id = nextval_project_id()"); } else { throw new OrmException("Unsupported dialect " + dialect); } if (transaction != null) { transaction.commit(); } } catch (OrmException ormex) { if (transaction != null) { transaction.rollback(); } throw ormex; } catch (SQLException sqlex) { if (transaction != null) { transaction.rollback(); } throw sqlex; } finally { if (stmt != null) { stmt.close(); } } }

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { Statement stmt = ((JdbcSchema) db).getConnection().createStatement(); try { if (((JdbcSchema) db).getDialect() instanceof DialectMySQL) { stmt.execute("DROP INDEX account_project_watches_ntNew ON account_project_watches"); stmt.execute("DROP INDEX account_project_watches_ntCmt ON account_project_watches"); stmt.execute("DROP INDEX account_project_watches_ntSub ON account_project_watches"); } else { stmt.execute("DROP INDEX account_project_watches_ntNew"); stmt.execute("DROP INDEX account_project_watches_ntCmt"); stmt.execute("DROP INDEX account_project_watches_ntSub"); } stmt.execute("CREATE INDEX account_project_watches_byProject" + " ON account_project_watches (project_name)"); } finally { stmt.close(); } }
Source:
private int fluxSequentialMergePrefetch(FeedOptions options, int numberOfPartitions, int pageSize, int fluxConcurrency) { int maxBufferedItemCount = options.getMaxBufferedItemCount(); if (maxBufferedItemCount <= 0) { maxBufferedItemCount = Math.min(Configs.CPU_CNT * numberOfPartitions * pageSize, 100_000); } int fluxPrefetch = Math.max(maxBufferedItemCount / (Math.max(fluxConcurrency * pageSize, 1)), 1); return Math.min(fluxPrefetch, Queues.XS_BUFFER_SIZE); }

Target:
private int fluxSequentialMergePrefetch(FeedOptions options, int numberOfPartitions, int pageSize, int fluxConcurrency) { int maxBufferedItemCount = options.getMaxBufferedItemCount(); if (maxBufferedItemCount <= 0) { maxBufferedItemCount = Math.min(Configs.getCPUCnt() * numberOfPartitions * pageSize, 100_000); } int fluxPrefetch = Math.max(maxBufferedItemCount / (Math.max(fluxConcurrency * pageSize, 1)), 1); return Math.min(fluxPrefetch, Queues.XS_BUFFER_SIZE); }
Source:
private boolean isServerMetrics(final MetricMsg metricMsg) { return metricMsg.getCustomMetrics() == null; }

Target:
private boolean isServerMetrics(final MetricMsg metricMsg) { return metricMsg.getTableToNumBlocks().containsKey(MODEL_TABLE_ID); }
Source:
private void handleImage(Object image) { TiDrawableReference source = TiDrawableReference.fromObject(this, image); BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(source.getBitmap()); groundOverlayOptions.image(bitmapDescriptor); }

Target:
private void handleImage(Object image) { TiDrawableReference source = TiDrawableReference.fromObject(this, image); if (!source.isTypeNull()) { BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(source.getBitmap()); groundOverlayOptions.image(bitmapDescriptor); } }
Source:
static BundleNameInstanceTypeProvider getInstance() { final ExtensionList<BundleNameInstanceTypeProvider> all = ExtensionList.lookup(BundleNameInstanceTypeProvider.class); final int extensionCount = all.size(); if (extensionCount < 1) { LOGGER.fine("No alternative strategy provided for support bundle prefixing."); return DEFAULT_STRATEGY; } if (all.size() > 1) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning("{0} implementations found for support bundle prefix naming strategy. " + "Can be only 0 or 1. Choosing the first found."); for (BundleNameInstanceTypeProvider bundlePrefixProvider : all) { LOGGER.log(Level.WARNING, "class '{0}' found", bundlePrefixProvider.getClass().getName()); } } } return all.get(0); }

Target:
static BundleNameInstanceTypeProvider getInstance() { final ExtensionList<BundleNameInstanceTypeProvider> all = ExtensionList.lookup(BundleNameInstanceTypeProvider.class); final int extensionCount = all.size(); if (extensionCount > 2) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "{0} implementations found for support bundle prefix naming strategy. " + "Can be only 1 (default one) or 2 (default one, plus alternative). " + "Choosing the first found among the following:", extensionCount); for (BundleNameInstanceTypeProvider nameProvider : all) { LOGGER.log(Level.WARNING, "Class {0} found", nameProvider.getClass().getName()); } } } final BundleNameInstanceTypeProvider chosen = all.get(0); if (extensionCount > 1) { LOGGER.log(Level.FINE, "Using {0} as BundleNameInstanceTypeProvider implementation", chosen.getClass().getName()); } return chosen; }
Source:
public static Config defaultOverrides() { if (!getOverrideWithEnv()) { return systemProperties(); } else { return systemEnvironmentOverrides().withFallback(systemProperties()); } }

Target:
public static Config defaultOverrides() { if (getOverrideWithEnv()) { return systemEnvironmentOverrides().withFallback(systemProperties()); } else { return systemProperties(); } }
Source:
public void preferenceChange(PreferenceChangeEvent event) { final IWorkspace ws = ResourcesPlugin.getWorkspace(); if (!ws.isAutoBuilding()) return; Job job = new Job(Messages.DSAnnotationPreferenceListener_jobName) { @Override protected IStatus run(IProgressMonitor monitor) { try { ws.run(new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { IProject[] projects = ws.getRoot().getProjects(); ArrayList<IProject> managedProjects = new ArrayList<IProject>(projects.length); for (IProject project : projects) { if (project.isOpen() && DSAnnotationCompilationParticipant.isManaged(project)) managedProjects.add(project); } if (monitor != null) monitor.beginTask(Messages.DSAnnotationPreferenceListener_taskName, managedProjects.size()); try { for (IProject project : managedProjects) project.build(IncrementalProjectBuilder.FULL_BUILD, new SubProgressMonitor(monitor, 1)); } finally { if (monitor != null) monitor.done(); } } }, monitor); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }; }; PlatformUI.getWorkbench().getProgressService().showInDialog(null, job); job.schedule(); }

Target:
public void preferenceChange(PreferenceChangeEvent event) { final IWorkspace ws = ResourcesPlugin.getWorkspace(); if (!ws.isAutoBuilding()) return; Job job = new Job(Messages.DSAnnotationPreferenceListener_jobName) { @Override protected IStatus run(IProgressMonitor monitor) { try { ws.run(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { IProject[] projects = ws.getRoot().getProjects(); ArrayList<IProject> managedProjects = new ArrayList<>(projects.length); for (IProject project : projects) { if (project.isOpen() && DSAnnotationCompilationParticipant.isManaged(project)) managedProjects.add(project); } SubMonitor progress = SubMonitor.convert(monitor, Messages.DSAnnotationPreferenceListener_taskName, managedProjects.size()); for (IProject project : managedProjects) project.build(IncrementalProjectBuilder.FULL_BUILD, progress.newChild(1)); } }, monitor); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }; }; PlatformUI.getWorkbench().getProgressService().showInDialog(null, job); job.schedule(); }
Source:
public void edit(final SetupNetworksBondModel object) { object.getBond().getPropertyChangedEvent().addListener((ev, sender, arg) -> { SortedListModel<String> model = (SortedListModel<String>) sender; if (model.getSelectedItem().length() > 10) { bondSuggestEditor.addStyleName(HAS_WARNING); nameWarningLabel.setVisible(true); } else { bondSuggestEditor.removeStyleName(HAS_WARNING); nameWarningLabel.setVisible(false); } }); driver.edit(object); }

Target:
public void edit(final SetupNetworksBondModel object) { object.getBond().getPropertyChangedEvent().addListener((ev, sender, arg) -> { SortedListModel<String> model = (SortedListModel<String>) sender; int length = model.getSelectedItem().length(); if (length > BusinessEntitiesDefinitions.BOND_NAME_WARNING_LENGTH && length <= BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH) { bondSuggestEditor.addStyleName(HAS_WARNING); nameWarningLabel.setVisible(true); } else { bondSuggestEditor.removeStyleName(HAS_WARNING); nameWarningLabel.setVisible(false); } }); driver.edit(object); }
Source:
public StramLocalCluster(LogicalPlan dag) throws IOException, ClassNotFoundException { dag.validate(); cloneLogicalPlan(dag); final String pathUri; String appPath = dag.getAttributes().get(LogicalPlan.APPLICATION_PATH); if (appPath == null) { pathUri = new File("target", StramLocalCluster.class.getName()).toURI().toString(); dag.getAttributes().put(LogicalPlan.APPLICATION_PATH, pathUri); } else { pathUri = new File(appPath).toURI().toString(); } try { FileContext.getLocalFSFileContext().delete(new Path(pathUri), true); } catch (IllegalArgumentException e) { throw e; } catch (IOException e) { throw new RuntimeException("could not cleanup test dir", e); } dag.getAttributes().put(LogicalPlan.APPLICATION_ID, "app_local_" + System.currentTimeMillis()); if (dag.getAttributes().get(OperatorContext.STORAGE_AGENT) == null) { dag.setAttribute(OperatorContext.STORAGE_AGENT, new AsyncFSStorageAgent(new Path(pathUri, LogicalPlan.SUBDIR_CHECKPOINTS).toString(), null)); } this.dnmgr = new StreamingContainerManager(dag); this.umbilical = new UmbilicalProtocolLocalImpl(); if (!perContainerBufferServer) { StreamingContainer.eventloop.start(); bufferServer = new Server(0, 1024 * 1024,8); bufferServer.setSpoolStorage(new DiskStorage()); bufferServerAddress = InetSocketAddress.createUnresolved(LOCALHOST, bufferServer.run(StreamingContainer.eventloop).getPort()); LOG.info("Buffer server started: {}", bufferServerAddress); } }

Target:
public StramLocalCluster(LogicalPlan dag) throws IOException, ClassNotFoundException { dag.validate(); cloneLogicalPlan(dag); final Path pathUri; String appPath = dag.getAttributes().get(LogicalPlan.APPLICATION_PATH); if (appPath == null) { pathUri = new Path(DEFAULT_APP_DIR.toURI()); dag.getAttributes().put(LogicalPlan.APPLICATION_PATH, pathUri.toString()); } else { Path tmp = new Path(appPath); if (!tmp.isAbsolute()) { pathUri = new Path(new File(appPath).toURI()); } else { pathUri = tmp; } } try { FileContext.getLocalFSFileContext().delete(pathUri, true); } catch (IllegalArgumentException e) { throw e; } catch (IOException e) { throw new RuntimeException("could not cleanup test dir", e); } dag.getAttributes().put(LogicalPlan.APPLICATION_ID, "app_local_" + System.currentTimeMillis()); if (dag.getAttributes().get(OperatorContext.STORAGE_AGENT) == null) { dag.setAttribute(OperatorContext.STORAGE_AGENT, new AsyncFSStorageAgent(new Path(pathUri, LogicalPlan.SUBDIR_CHECKPOINTS).toString(), null)); } this.dnmgr = new StreamingContainerManager(dag); this.umbilical = new UmbilicalProtocolLocalImpl(); }
Source:
private void warmUpPopulate(Map<Future<SingleBenchmarkRunner>, SingleBenchmarkRunner> futureMap, ConcurrentMap<SolverBenchmarkResult, Integer> singleBenchmarkResultIndexMap, SolverBenchmarkResult[] solverBenchmarkResultArray, long timeLeftPerSolverConfig) { for (SolverBenchmarkResult solverBenchmarkResult : solverBenchmarkResultArray) { TerminationConfig originalTerminationConfig = solverBenchmarkResult.getSolverConfig().getTerminationConfig(); TerminationConfig tmpTerminationConfig = originalTerminationConfig == null ? new TerminationConfig() : originalTerminationConfig.clone(); tmpTerminationConfig.overwriteTimeMillisSpentLimit(timeLeftPerSolverConfig); solverBenchmarkResult.getSolverConfig().setTerminationConfig(tmpTerminationConfig); Integer singleBenchmarkResultIndex = singleBenchmarkResultIndexMap.get(solverBenchmarkResult); if (singleBenchmarkResultIndex == null || singleBenchmarkResultIndex >= solverBenchmarkResult.getSingleBenchmarkResultList().size()) { singleBenchmarkResultIndex = 0; } SingleBenchmarkResult singleBenchmarkResult = solverBenchmarkResult.getSingleBenchmarkResultList().get(singleBenchmarkResultIndex); if (singleBenchmarkResult != null) { SingleBenchmarkRunner singleBenchmarkRunner = new SingleBenchmarkRunner(singleBenchmarkResult); Future<SingleBenchmarkRunner> future = warmUpExecutorCompletionService.submit(singleBenchmarkRunner); futureMap.put(future, singleBenchmarkRunner); singleBenchmarkResultIndexMap.put(solverBenchmarkResult, singleBenchmarkResultIndex + 1); } } }

Target:
private void warmUpPopulate(Map<Future<SingleBenchmarkRunner>, SingleBenchmarkRunner> futureMap, ConcurrentMap<SolverBenchmarkResult, Integer> singleBenchmarkResultIndexMap, SolverBenchmarkResult[] solverBenchmarkResultArray, long timeLeftPerSolverConfig) { for (SolverBenchmarkResult solverBenchmarkResult : solverBenchmarkResultArray) { TerminationConfig originalTerminationConfig = solverBenchmarkResult.getSolverConfig().getTerminationConfig(); TerminationConfig tmpTerminationConfig = originalTerminationConfig == null ? new TerminationConfig() : originalTerminationConfig.clone(); tmpTerminationConfig.shortenTimeMillisSpentLimit(timeLeftPerSolverConfig); solverBenchmarkResult.getSolverConfig().setTerminationConfig(tmpTerminationConfig); Integer singleBenchmarkResultIndex = singleBenchmarkResultIndexMap.get(solverBenchmarkResult); singleBenchmarkResultIndex = (singleBenchmarkResultIndex == null) ? 0 : singleBenchmarkResultIndex % solverBenchmarkResult.getSingleBenchmarkResultList().size(); SingleBenchmarkResult singleBenchmarkResult = solverBenchmarkResult.getSingleBenchmarkResultList().get(singleBenchmarkResultIndex); SingleBenchmarkRunner singleBenchmarkRunner = new SingleBenchmarkRunner(singleBenchmarkResult); Future<SingleBenchmarkRunner> future = warmUpExecutorCompletionService.submit(singleBenchmarkRunner); futureMap.put(future, singleBenchmarkRunner); singleBenchmarkResultIndexMap.put(solverBenchmarkResult, singleBenchmarkResultIndex + 1); } }
Source:
public void testObtainRegistrationId() { SwrveConfig swrveConfig = new SwrveConfig(); assertEquals(true, swrveConfig.isObtainRegistrationIdEnabled()); swrveConfig.setAndroidIdLoggingEnabled(false); assertEquals(false, swrveConfig.isObtainRegistrationIdEnabled()); }

Target:
public void testObtainRegistrationId() { SwrveConfig swrveConfig = new SwrveConfig(); assertEquals(true, swrveConfig.isPushRegistrationAutomatic()); swrveConfig.setPushRegistrationAutomatic(false); assertEquals(false, swrveConfig.isPushRegistrationAutomatic()); }
Source:
private void runOneIteration() { ShardAndStrategy shardStrategy = ShardAndStrategy.of(getShardAndIncrement(), sweepStrategy); try { sweepNextBatch(shardStrategy); } catch (Throwable th) { log.error("Targeted sweep for failed and will be retried later.", SafeArg.of("shardStrategy", shardStrategy.toText()), th); } }

Target:
private void runOneIteration() { ShardAndStrategy shardStrategy = ShardAndStrategy.of(lockNextShardToSweep(), sweepStrategy); try { sweepNextBatch(shardStrategy); } catch (Throwable th) { log.warn("Targeted sweep for failed and will be retried later.", SafeArg.of("shardStrategy", shardStrategy.toText()), th); } finally { unlockShard(shardStrategy.shard()); } }
Source:
@Override public Set<T> get() { List<T> result = new ArrayList<T>(); for (SetBinding<T> setBinding = this; setBinding != null; setBinding = setBinding.parent) { for (Binding<?> contributor : setBinding.contributors) { Object contribution = contributor.get(); if (contributor.provideKey.equals(provideKey)) { result.addAll((Set<T>) contribution); } else { result.add((T) contribution); } } } return Collections.unmodifiableSet(new LinkedHashSet<T>(result)); }

Target:
@Override public Set<T> get() { List<T> result = new ArrayList<T>(); for (SetBinding<T> setBinding = this; setBinding != null; setBinding = setBinding.parent) { for (int i = 0, size = setBinding.contributors.size(); i < size; i++) { Binding<?> contributor = setBinding.contributors.get(i); Object contribution = contributor.get(); if (contributor.provideKey.equals(provideKey)) { result.addAll((Set<T>) contribution); } else { result.add((T) contribution); } } } return Collections.unmodifiableSet(new LinkedHashSet<T>(result)); }
Source:
public void onClick(View view) { if (view.getId() == R.id.email_provider) { if (mActivityHelper.getFlowParams().isReauth) { String reauthEmail = mActivityHelper.getFlowParams().reauthEmail; if (reauthEmail == null) { Log.e(TAG, "Attempting to reauth with email but no reauthEmail provided"); return; } startActivityForResult( WelcomeBackPasswordPrompt.createIntent( this, mActivityHelper.getFlowParams(), new IdpResponse( AuthUI.EMAIL_PROVIDER, reauthEmail)), RC_EMAIL_DIRECT_SIGN_IN); } else { startActivityForResult( RegisterEmailActivity.createIntent(this, mActivityHelper.getFlowParams()), RC_EMAIL_FLOW); } } }

Target:
public void onClick(View view) { if (view.getId() == R.id.email_provider) { startActivityForResult( RegisterEmailActivity.createIntent(this, mActivityHelper.getFlowParams()), RC_EMAIL_FLOW); } }
Source:
public void writeUTF(String s) { int startPos = skipIntSize(); int localPos = pos; byte[] localBuf = bytes; int strlen = s.length(); int c = 0; int i=0; for (i=0; i<strlen; i++) { c = s.charAt(i); if (!((c >= 0x0001) && (c <= 0x007F))) break; if(localPos == bytes.length) { pos = localPos; ensureCapacity(1); localBuf = bytes; } localBuf[localPos++] = (byte) c; } for (;i < strlen; i++){ c = s.charAt(i); if ((c >= 0x0001) && (c <= 0x007F)) { if(localPos == bytes.length) { pos = localPos; ensureCapacity(1); localBuf = bytes; } localBuf[localPos++] = (byte) c; } else if (c > 0x07FF) { if(localPos+3 >= bytes.length) { pos = localPos; ensureCapacity(3); localBuf = bytes; } localBuf[localPos++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); localBuf[localPos++] = (byte) (0x80 | ((c >> 6) & 0x3F)); localBuf[localPos++] = (byte) (0x80 | ((c >> 0) & 0x3F)); } else { if(localPos + 2 >= bytes.length) { pos = localPos; ensureCapacity(2); localBuf = bytes; } localBuf[localPos++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); localBuf[localPos++] = (byte) (0x80 | ((c >> 0) & 0x3F)); } } pos = localPos; writeIntDirect(localPos - 4 - startPos, startPos); }

Target:
public void writeUTF(String s) { int startPos = skipIntSize(); int localPos = pos; byte[] localBuf = bytes; int strlen = s.length(); int c = 0; int i=0; for (i=0; i<strlen; i++) { c = s.charAt(i); if (!((c >= 0x0001) && (c <= 0x007F))) break; if(localPos == bytes.length) { pos = localPos; ensureCapacity(1); localBuf = bytes; } localBuf[localPos++] = (byte) c; } for (;i < strlen; i++){ c = s.charAt(i); if ((c >= 0x0001) && (c <= 0x007F)) { if(localPos == bytes.length) { pos = localPos; ensureCapacity(1); localBuf = bytes; } localBuf[localPos++] = (byte) c; } else if (c > 0x07FF) { if(localPos+3 >= bytes.length) { pos = localPos; ensureCapacity(3); localBuf = bytes; } localBuf[localPos++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); localBuf[localPos++] = (byte) (0x80 | ((c >> 6) & 0x3F)); localBuf[localPos++] = (byte) (0x80 | (c & 0x3F)); } else { if(localPos + 2 >= bytes.length) { pos = localPos; ensureCapacity(2); localBuf = bytes; } localBuf[localPos++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); localBuf[localPos++] = (byte) (0x80 | (c & 0x3F)); } } pos = localPos; writeIntDirect(localPos - 4 - startPos, startPos); }
Source:
public Query createAndStartQuery(final String queryId, final ApplicationInfo applicationInfo, final DAG<ConfigVertex, MISTEdge> configDag) throws ClassNotFoundException, IOException { final Query query = new DefaultQueryImpl(queryId); groupAllocationTableModifier.addEvent(new WritingEvent(WritingEvent.EventType.QUERY_ADD, new Tuple<>(applicationInfo, query))); final Group group = applicationInfo.getGroups().get(0); group.getQueryStarter().start(queryId, query, configDag, applicationInfo.getJarFilePath()); return query; }

Target:
public Query createAndStartQuery(final String queryId, final ApplicationInfo applicationInfo, final DAG<ConfigVertex, MISTEdge> configDag) throws ClassNotFoundException, IOException { final Query query = new DefaultQueryImpl(queryId); groupAllocationTableModifier.addEvent(new WritingEvent(WritingEvent.EventType.QUERY_ADD, new Tuple<>(applicationInfo, query))); final Group group = applicationInfo.getRandomGroup(); group.getQueryStarter().start(queryId, query, configDag, applicationInfo.getJarFilePath()); return query; }
Source:
public void addProfile(ProfileService profile) { Message m = mHandler.obtainMessage(MESSAGE_PROFILE_SERVICE_STATE_CHANGED); m.obj = profile; m.arg1 = MESSAGE_PROFILE_REGISTERED; mHandler.sendMessage(m); }

Target:
public void addProfile(ProfileService profile) { Message m = mHandler.obtainMessage(MESSAGE_PROFILE_SERVICE_REGISTERED, profile); mHandler.sendMessage(m); }
Source:
public void setPageSource(IPageSource pageSource) { if (provision != null) { throw new IllegalStateException( "A provision was already been done. The provider can be forcefully detached or a new one needs to be used to provide using this page source."); } this.pageSource = pageSource; }

Target:
public void setPageSource(IPageSource pageSource) { if (provision != null) { throw new IllegalStateException("A page was already provided."); } this.pageSource = pageSource; }
Source:
public ChangeInfo apply(RevisionResource rsrc, Input input) throws BadRequestException, ResourceConflictException, EmailException, OrmException, ResourceNotFoundException, IOException { if (Strings.isNullOrEmpty(input.message)) { throw new BadRequestException("message must be non-empty"); } final Repository git; try { git = gitManager.openRepository(rsrc.getChange().getProject()); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(e.getMessage()); } try { return json.format(ChangeUtil.editCommitMessage( rsrc.getPatchSet().getId(), rsrc.getControl().getRefControl(), (IdentifiedUser) rsrc.getControl().getCurrentUser(), input.message, dbProvider.get(), commitMessageEditedSenderFactory, git, myIdent, patchSetInserterFactory)); } catch (InvalidChangeOperationException e) { throw new BadRequestException(e.getMessage()); } catch (MissingObjectException e) { throw new ResourceConflictException(e.getMessage()); } catch (IncorrectObjectTypeException e) { throw new ResourceConflictException(e.getMessage()); } catch (PatchSetInfoNotAvailableException e) { throw new ResourceConflictException(e.getMessage()); } catch (NoSuchChangeException e) { throw new ResourceNotFoundException(e.getMessage()); } finally { git.close(); } }

Target:
public ChangeInfo apply(RevisionResource rsrc, Input input) throws BadRequestException, ResourceConflictException, EmailException, OrmException, ResourceNotFoundException, IOException { if (Strings.isNullOrEmpty(input.message)) { throw new BadRequestException("message must be non-empty"); } final Repository git; try { git = gitManager.openRepository(rsrc.getChange().getProject()); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(e.getMessage()); } try { return json.format(ChangeUtil.editCommitMessage( rsrc.getPatchSet().getId(), rsrc.getControl().getRefControl(), (IdentifiedUser) rsrc.getControl().getCurrentUser(), input.message, dbProvider.get(), commitMessageEditedSenderFactory, git, myIdent, patchSetInserterFactory)); } catch (InvalidChangeOperationException e) { throw new BadRequestException(e.getMessage()); } catch (MissingObjectException e) { throw new ResourceConflictException(e.getMessage()); } catch (IncorrectObjectTypeException e) { throw new ResourceConflictException(e.getMessage()); } catch (PatchSetInfoNotAvailableException e) { throw new ResourceConflictException(e.getMessage()); } catch (NoSuchChangeException e) { throw new ResourceNotFoundException(); } finally { git.close(); } }
Source:
private <R> R performWithConnection(Function<Object, R> function) { connectionSupplier = getConnectionSupplier(); Object connection = getConnection(connectionSupplier); try { R result = function.apply(connection); connectionSupplier.close(); return result; } catch (Exception e) { if (isFirstPage) { silentlyCloseDelegate(connection); } extractConnectionException(e).ifPresent(ex -> connectionSupplier.invalidateConnection()); throw e; } }

Target:
private <R> R performWithConnection(Function<Object, R> function) { ConnectionSupplier connectionSupplier = getConnectionSupplier(); Object connection = getConnection(connectionSupplier); try { R result = function.apply(connection); return result; } catch (Exception exception) { if (isFirstPage) { safely(() -> delegate.close(connection), e -> LOGGER.debug("Found exception closing paging provider", e)); } extractConnectionException(exception).ifPresent(ex -> connectionSupplier.invalidateConnection()); throw exception; } finally { safely(connectionSupplier::close, e -> LOGGER.debug("Found exception closing the connection supplier", e)); } }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__DEACTIVATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage((getParameters().getAction() == PlugAction.PLUG) ? VdcBllMessages.VAR__ACTION__ACTIVATE : VdcBllMessages.VAR__ACTION__DEACTIVATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE); }
Source:
public void initialize() { String updateModel = (String) getThing().getConfiguration().get(MagicBindingConstants.UPDATE_MODEL_PROPERTY); switch (updateModel) { case MagicBindingConstants.MODEL_ID_ABRACADABRA: case MagicBindingConstants.MODEL_ID_SIMSALABIN: case MagicBindingConstants.MODEL_ID_PREPARATUS: getThing().setProperty(Thing.PROPERTY_MODEL_ID, updateModel); } updateStatus(ThingStatus.ONLINE); }

Target:
public void initialize() { String updateModel = (String) getThing().getConfiguration().get(MagicBindingConstants.UPDATE_MODEL_PROPERTY); switch (updateModel) { case MagicBindingConstants.MODEL_ALOHOMORA: case MagicBindingConstants.MODEL_COLLOPORTUS: case MagicBindingConstants.MODEL_LUMOS: case MagicBindingConstants.MODEL_NOX: getThing().setProperty(Thing.PROPERTY_MODEL_ID, updateModel); } updateStatus(ThingStatus.ONLINE); }
Source:
public void testBearerToken() throws Exception { MockEndpoint mockEndpoint = getMockEndpoint("mock:myapp"); mockEndpoint.expectedHeaderReceived(Exchange.HTTP_METHOD, "POST"); LOG.debug("Number of exchanges in mock:myapp " + mockEndpoint.getExchanges().size()); String response = template.requestBodyAndHeader("elytron:http://localhost:{{port}}/myapp", "empty body", Headers.AUTHORIZATION.toString(), "Bearer " + createToken("alice", "user", new Date(new Date().getTime() + 10000), getKeyPair().getPrivate()), String.class); assertNotNull(response); assertEquals("Hello alice!", response); }

Target:
public void testBearerToken() throws Exception { String response = template.requestBodyAndHeader("elytron:http://localhost:{{port}}/myapp", "empty body", Headers.AUTHORIZATION.toString(), "Bearer " + createToken("alice", "user", new Date(new Date().getTime() + 10000), getKeyPair().getPrivate()), String.class); assertNotNull(response); assertEquals("Hello alice!", response); }
Source:
public void onClickOnValue(String UId) { DashboardActivity.dashboardActivity.hideReview(UId); }

Target:
public void onClickOnValue(String UId) { view.navigateToQuestion(UId); }
Source:
public void showSkipImageInfo(){ DialogUtil.showAlertDialog(ReviewActivity.this, getString(R.string.skip_image), getString(R.string.skip_image_explanation), getString(R.string.about_translate_proceed), getString(android.R.string.cancel), () -> runRandomizer(),null); }

Target:
public void showSkipImageInfo(){ DialogUtil.showAlertDialog(ReviewActivity.this, getString(R.string.skip_image), getString(R.string.skip_image_explanation), getString(android.R.string.ok), "", null, null); }
Source:
public static ConcurrentOption valueFromName(String name) { for(ConcurrentOption option: ConcurrentOption.values()) { if(option.name.equals(name)) { return option; } } throw new IllegalArgumentException("No ConcurrentOption for name " + name); }

Target:
public static FailureAction valueFromName(String name) { for(FailureAction action: FailureAction.values()) { if(action.name.equals(name)) { return action; } } throw new IllegalArgumentException("No FailureAction for name " + name); }
Source:
private void executorFinished(final RollupExecutor.FinishRollupMessage message) { final Optional<Throwable> failure = message.getFailure(); _periodicMetrics.recordCounter("rollup/manager/executor_finished/success", failure.isPresent() ? 0 : 1); if (!failure.isPresent()) { return; } final boolean isRetryable = RollupPartitioningUtils.mightSplittingFixFailure(failure.get()); _periodicMetrics.recordCounter("rollup/manager/executor_finished/unretriable", isRetryable ? 0 : 1); if (!isRetryable) { LOGGER.warn() .setMessage("giving up after non-retryable error") .addData("rollupDefinition", message.getRollupDefinition()) .setThrowable(failure.get()) .log(); return; } final ImmutableSet<RollupDefinition> subjobs; try { subjobs = RollupPartitioningUtils.splitJob(message.getRollupDefinition()); _periodicMetrics.recordCounter("rollup/manager/executor_finished/unsplittable", 0); } catch (final RollupPartitioningUtils.CannotSplitException e) { _periodicMetrics.recordCounter("rollup/manager/executor_finished/unsplittable", 1); LOGGER.error() .setMessage("giving up on job that can't be split any more") .addData("rollupDefinition", message.getRollupDefinition()) .setThrowable(failure.get()) .log(); return; } subjobs.forEach(subjob -> getSelf().tell(subjob, getSelf())); }

Target:
private void executorFinished(final RollupExecutor.FinishRollupMessage message) { try (Metrics metrics = _metricsFactory.create()) { metrics.addAnnotation("rollup_metric", message.getRollupDefinition().getDestinationMetricName()); metrics.incrementCounter("rollup/manager/executor_finished", 1); final Optional<Throwable> failure = message.getFailure(); if (!failure.isPresent()) { metrics.addAnnotation("outcome", "success"); return; } final boolean isRetryable = _partitioner.mightSplittingFixFailure(failure.get()); if (!isRetryable) { LOGGER.warn() .setMessage("giving up after non-retryable error") .addData("rollupDefinition", message.getRollupDefinition()) .setThrowable(failure.get()) .log(); metrics.addAnnotation("outcome", "non_retryable_error"); return; } final ImmutableSet<RollupDefinition> children; try { children = _partitioner.splitJob(message.getRollupDefinition()); } catch (final RollupPartitioner.CannotSplitException e) { LOGGER.error() .setMessage("giving up on job that can't be split any more") .addData("rollupDefinition", message.getRollupDefinition()) .setThrowable(failure.get()) .log(); metrics.addAnnotation("outcome", "unable_to_split"); return; } LOGGER.info() .setMessage("splitting and retrying job") .addData("parent", message.getRollupDefinition()) .addData("children", children) .setThrowable(failure.get()) .log(); metrics.addAnnotation("outcome", "split_and_retry"); children.forEach(child -> getSelf().tell(child, getSelf())); } }
Source:
public void addFieldInNewModel(JSONObject m, JSONObject field) { assert(isModelNew(m)); _addField(m, field); }

Target:
public void addFieldInNewModel(JSONObject m, JSONObject field) { Assert.that(isModelNew(m), "Model was assumed to be new, but is not"); _addField(m, field); }
Source:
public Frame decorrelateRel(Join rel) { if (!rel.getJoinType().projectsRight()) { return decorrelateRel((RelNode) rel); } final RelNode oldLeft = rel.getInput(0); final RelNode oldRight = rel.getInput(1); final Frame leftFrame = getInvoke(oldLeft, rel); final Frame rightFrame = getInvoke(oldRight, rel); if (leftFrame == null || rightFrame == null) { return null; } final RelNode newJoin = relBuilder .push(leftFrame.r) .push(rightFrame.r) .join(rel.getJoinType(), decorrelateExpr(currentRel, map, cm, rel.getCondition()), ImmutableSet.<CorrelationId>of()) .build(); Map<Integer, Integer> mapOldToNewOutputs = new HashMap<>(); int oldLeftFieldCount = oldLeft.getRowType().getFieldCount(); int newLeftFieldCount = leftFrame.r.getRowType().getFieldCount(); int oldRightFieldCount = oldRight.getRowType().getFieldCount(); assert rel.getRowType().getFieldCount() == oldLeftFieldCount + oldRightFieldCount; mapOldToNewOutputs.putAll(leftFrame.oldToNewOutputs); for (int i = 0; i < oldRightFieldCount; i++) { mapOldToNewOutputs.put(i + oldLeftFieldCount, rightFrame.oldToNewOutputs.get(i) + newLeftFieldCount); } final SortedMap<CorDef, Integer> corDefOutputs = new TreeMap<>(leftFrame.corDefOutputs); for (Map.Entry<CorDef, Integer> entry : rightFrame.corDefOutputs.entrySet()) { corDefOutputs.put(entry.getKey(), entry.getValue() + newLeftFieldCount); } return register(rel, newJoin, mapOldToNewOutputs, corDefOutputs); }

Target:
public Frame decorrelateRel(Join rel) { if (!rel.getJoinType().projectsRight()) { return decorrelateRel((RelNode) rel); } final RelNode oldLeft = rel.getInput(0); final RelNode oldRight = rel.getInput(1); final Frame leftFrame = getInvoke(oldLeft, rel); final Frame rightFrame = getInvoke(oldRight, rel); if (leftFrame == null || rightFrame == null) { return null; } final RelNode newJoin = relBuilder .push(leftFrame.r) .push(rightFrame.r) .join(rel.getJoinType(), decorrelateExpr(currentRel, map, cm, rel.getCondition()), ImmutableSet.of()) .build(); Map<Integer, Integer> mapOldToNewOutputs = new HashMap<>(); int oldLeftFieldCount = oldLeft.getRowType().getFieldCount(); int newLeftFieldCount = leftFrame.r.getRowType().getFieldCount(); int oldRightFieldCount = oldRight.getRowType().getFieldCount(); assert rel.getRowType().getFieldCount() == oldLeftFieldCount + oldRightFieldCount; mapOldToNewOutputs.putAll(leftFrame.oldToNewOutputs); for (int i = 0; i < oldRightFieldCount; i++) { mapOldToNewOutputs.put(i + oldLeftFieldCount, rightFrame.oldToNewOutputs.get(i) + newLeftFieldCount); } final SortedMap<CorDef, Integer> corDefOutputs = new TreeMap<>(leftFrame.corDefOutputs); for (Map.Entry<CorDef, Integer> entry : rightFrame.corDefOutputs.entrySet()) { corDefOutputs.put(entry.getKey(), entry.getValue() + newLeftFieldCount); } return register(rel, newJoin, mapOldToNewOutputs, corDefOutputs); }
Source:
protected DatastaxCassandraOrganisationStore( Session session, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency, OrganisationUriStore uriStore, MetricRegistry metricRegistry, String metricPrefix ) { this.session = checkNotNull(session); this.readConsistency = checkNotNull(readConsistency); this.serializer = new OrganisationSerializer(); this.writeConsistency = checkNotNull(writeConsistency); this.organisationUriStore = uriStore; RegularStatement statement = select().all() .from(ORGANISATION_TABLE) .where(in(PRIMARY_KEY_COLUMN, bindMarker(KEYS))); statement.setFetchSize(Integer.MAX_VALUE); selectStatement = session.prepare(statement); rowUpdate = session.prepare(update(ORGANISATION_TABLE) .where(eq(PRIMARY_KEY_COLUMN, bindMarker(ORGANISATION_ID))) .with(set(DATA_COLUMN, bindMarker(DATA)))) .setConsistencyLevel(writeConsistency); this.metricRegistry = metricRegistry; write = metricPrefix + "write"; }

Target:
protected DatastaxCassandraOrganisationStore( Session session, ConsistencyLevel writeConsistency, ConsistencyLevel readConsistency, OrganisationUriStore uriStore, MetricRegistry metricRegistry, String metricPrefix ) { this.session = checkNotNull(session); this.readConsistency = checkNotNull(readConsistency); this.serializer = new OrganisationSerializer(); this.writeConsistency = checkNotNull(writeConsistency); this.organisationUriStore = uriStore; RegularStatement statement = select().all() .from(ORGANISATION_TABLE) .where(in(PRIMARY_KEY_COLUMN, bindMarker(KEYS))); statement.setFetchSize(Integer.MAX_VALUE); selectStatement = session.prepare(statement); rowUpdate = session.prepare(update(ORGANISATION_TABLE) .where(eq(PRIMARY_KEY_COLUMN, bindMarker(ORGANISATION_ID))) .with(set(DATA_COLUMN, bindMarker(DATA)))) .setConsistencyLevel(writeConsistency); this.metricRegistry = metricRegistry; write = metricPrefix + "write."; }