auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); URIish uriish = remoteConfig.getURIs().get(0); String uriRoot = PubSubConfig.getUriRoot(uriish); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) p.addSubscriber(new Subscriber(p, remote, dir)); try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { out.println(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); return; } }

Target:
protected void run() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, remote); PubSubConfig pubsubConfig = SubscribeDaemon.getConfig(); List<URIish> uris = remoteConfig.getURIs(); if (uris.isEmpty()) { out.println(MessageFormat.format( CLIText.get().noRemoteUriSubscribe, remote)); return; } String uriRoot = PubSubConfig.getUriRoot(uris.get(0)); String dir = db.getDirectory().getAbsolutePath(); Publisher p = pubsubConfig.getPublisher(uriRoot); if (p == null) { p = new Publisher(uriRoot); pubsubConfig.addPublisher(p); } Subscriber s = p.getSubscriber(remote, dir); if (s == null) p.addSubscriber(new Subscriber(p, remote, dir)); try { SubscribeDaemon.updateConfig(pubsubConfig); } catch (IOException e) { out.println(MessageFormat.format(CLIText.get().cannotWrite, SubscribeDaemon.getConfigFile())); return; } out.println(MessageFormat.format( CLIText.get().didSubscribe, remote, uriRoot)); }
Source:
public void updateWorkerTransaction(boolean success, long transactionId, long nodeId) { ShardWriterDao dao = shardDbi.get(getNodeShard(nodeId)).onDemand(ShardWriterDao.class); dao.updateWorkerTransaction(success, transactionId, nodeId, System.currentTimeMillis()); }

Target:
public void updateWorkerTransaction(boolean success, long transactionId, long nodeId) { ShardWriterDao dao = shardDbi.get(getTableShard(nodeId)).onDemand(ShardWriterDao.class); dao.updateWorkerTransaction(success, transactionId, nodeId, System.currentTimeMillis()); }
Source:
public IStaticContentProvider getContentProvider(String propertyPath) { IStaticContentProvider provider = null; ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "rowSources"); } else if (MatrixPropertyConstants.MATRIX_COLUMN_SOURCES.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "columnSources"); } else if (MatrixPropertyConstants.MATRIX_CELL_TYPE.equals(propertyPath)) { provider = new GenericRelationshipMatrixElementTypeContentProvider(getRoot(getEditedTable().getContext())); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_DIRECTION.equals(propertyPath)) { provider = new MatrixDirectionContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER_STRATEGY.equals(propertyPath)) { provider = new MatrixRelationshipOwnerStrategyContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER.equals(propertyPath)) { provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "relationshipOwner"); } else { provider = super.getContentProvider(propertyPath); } return provider; }

Target:
public IStaticContentProvider getContentProvider(String propertyPath) { IStaticContentProvider provider = null; if (MatrixPropertyConstants.MATRIX_ROW_SOURCES.equals(propertyPath)) { ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "rowSources"); } else if (MatrixPropertyConstants.MATRIX_COLUMN_SOURCES.equals(propertyPath)) { ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "columnSources"); } else if (MatrixPropertyConstants.MATRIX_CELL_TYPE.equals(propertyPath)) { provider = new GenericRelationshipMatrixElementTypeContentProvider(getRoot(getEditedTable().getContext())); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_DIRECTION.equals(propertyPath)) { provider = new MatrixDirectionContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER_STRATEGY.equals(propertyPath)) { provider = new MatrixRelationshipOwnerStrategyContentProvider(); } else if (MatrixPropertyConstants.MATRIX_RELATIONSHIP_OWNER.equals(propertyPath)) { ResourceSet resourceSet= getRoot(getEditedTable().getContext()).eResource().getResourceSet(); provider = ProviderHelper.encapsulateProvider(ProviderHelper.getContentProvider(resourceSet), resourceSet, "relationshipOwner"); } else { provider = super.getContentProvider(propertyPath); } return provider; }
Source:
public Version get() { if( this.rawModVersion.equals( "@version@" ) || this.rawModVersion.contains( "pr" ) ) { return new DoNotCheckVersion(); } try { final Version version = this.parser.parse( this.rawModVersion ); return version; } catch( final Exception e ) { AELog.error( e ); return EXCEPTIONAL_VERSION; } }

Target:
public Version get() { if( this.rawModVersion.equals( "@version@" ) || this.rawModVersion.contains( "pr" ) ) { return new DoNotCheckVersion(); } try { final Version version = this.parser.parse( this.rawModVersion ); return version; } catch( final VersionCheckerException e ) { AELog.error( e ); return EXCEPTIONAL_VERSION; } }
Source:
private void createSchedulingGroup(Composite container) { Group group = new Group(container, SWT.SHADOW_ETCHED_IN); group.setText(Messages.TasksUiPreferencePage_Scheduling); group.setLayout(new GridLayout(2, false)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label weekStartLabel = new Label(group, SWT.NONE); weekStartLabel.setText(Messages.TasksUiPreferencePage_Week_Start); weekStartCombo = new Combo(group, SWT.READ_ONLY); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.add(""); weekStartCombo.select(getPreferenceStore().getInt(ITasksUiPreferenceConstants.WEEK_START_DAY) - 1); Label scheduleNewTasksLabel = new Label(group, SWT.NONE); scheduleNewTasksLabel.setText(Messages.TasksUiPreferencePage_ScheduleNewTasks); scheduleNewTasksCombo = new Combo(group, SWT.READ_ONLY); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_ThisWeek); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Tomorrow); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Today); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Unscheduled); String scheduleFor = getPreferenceStore().getString(ITasksUiPreferenceConstants.SCHEDULE_NEW_TASKS_FOR); scheduleNewTasksCombo.select(SCHEDULE_TIME_MAP.getOrDefault(scheduleFor, 0)); }

Target:
private void createSchedulingGroup(Composite container) { Group group = new Group(container, SWT.SHADOW_ETCHED_IN); group.setText(Messages.TasksUiPreferencePage_Scheduling); group.setLayout(new GridLayout(2, false)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label weekStartLabel = new Label(group, SWT.NONE); weekStartLabel.setText(Messages.TasksUiPreferencePage_Week_Start); weekStartCombo = new Combo(group, SWT.READ_ONLY); weekStartCombo.add(CommonMessages.Sunday); weekStartCombo.add(CommonMessages.Monday); weekStartCombo.add(CommonMessages.Tuesday); weekStartCombo.add(CommonMessages.Wednesday); weekStartCombo.add(CommonMessages.Thursday); weekStartCombo.add(CommonMessages.Friday); weekStartCombo.add(CommonMessages.Saturday); weekStartCombo.select(getPreferenceStore().getInt(ITasksUiPreferenceConstants.WEEK_START_DAY) - 1); Label scheduleNewTasksLabel = new Label(group, SWT.NONE); scheduleNewTasksLabel.setText(Messages.TasksUiPreferencePage_ScheduleNewTasks); scheduleNewTasksCombo = new Combo(group, SWT.READ_ONLY); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_ThisWeek); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Tomorrow); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Today); scheduleNewTasksCombo.add(Messages.TasksUiPreferencePage_Unscheduled); String scheduleFor = getPreferenceStore().getString(ITasksUiPreferenceConstants.SCHEDULE_NEW_TASKS_FOR); scheduleNewTasksCombo.select(SCHEDULE_TIME_MAP.getOrDefault(scheduleFor, 0)); }
Source:
protected void testDestructiveChanges() { FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); FeedbackResponseAttributes fra = new FeedbackResponseAttributes( feedbackSessionName, courseId, question.getId(), question.getQuestionType(), "alice.b.tmms@gmail.tmt", null, "alice.b.tmms@gmail.tmt", null, null); BackDoor.createFeedbackResponse(fra); feedbackEditPage.reloadPage(); feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1); ______TS("contrib: saving just after edit"); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.toggleNotSureCheck(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.waitForConfirmationModalAndClickCancel(); feedbackEditPage.toggleNotSureCheck(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1); BackDoor.deleteFeedbackResponse(question.getId(), fra.giver, fra.recipient); feedbackEditPage.reloadPage(); }

Target:
protected void testDestructiveChanges() { FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); FeedbackResponseAttributes fra = new FeedbackResponseAttributes( feedbackSessionName, courseId, question.getId(), question.getQuestionType(), "alice.b.tmms@gmail.tmt", null, "alice.b.tmms@gmail.tmt", null, null); BackDoor.createFeedbackResponse(fra); feedbackEditPage.reloadPage(); assertTrue(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1)); ______TS("Contrib destructive changes: saving just after edit"); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); assertTrue(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1)); ______TS("Contrib destructive changes: testing \"not sure\" answer option"); feedbackEditPage.clickEditQuestionButton(1); feedbackEditPage.toggleNotSureCheck(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.waitForConfirmationModalAndClickCancel(); feedbackEditPage.toggleNotSureCheck(1); feedbackEditPage.clickSaveExistingQuestionButton(1); feedbackEditPage.verifyStatus(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); assertTrue(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1)); BackDoor.deleteFeedbackResponse(question.getId(), fra.giver, fra.recipient); feedbackEditPage.reloadPage(); }
Source:
public void deployAPI(Object serviceImplementation, Dictionary<String, ?> properties) { if (!(serviceImplementation instanceof Microservice)) { throw new UUFException("API class " + serviceImplementation.getClass().getName() + " doesn't implement Microservice interface"); } BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); bundleContext.registerService(Microservice.class, (Microservice) serviceImplementation, properties); }

Target:
public void deployAPI(Object serviceImplementation, Dictionary<String, ?> properties) { if (!(serviceImplementation instanceof Microservice)) { throw new UUFException("Cannot deploy REST API '" + serviceImplementation.getClass().getName() + "' as a micro-service because it does not implement '" + Microservice.class.getName() + "'"); } BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); bundleContext.registerService(Microservice.class, (Microservice) serviceImplementation, properties); }
Source:
public void call(Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { LOG.info("invoking lifecycle action {}", description); method.invoke(obj); }

Target:
public void call(Object obj) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { LOG.debug("invoking lifecycle action {}", description); method.invoke(obj); }
Source:
private void cancelAllUploads() { mQueue.clear(); mCompletedItems.clear(); cancelCurrentUpload(); }

Target:
private void cancelAllUploads() { mUploadQueue.clear(); cancelCurrentUpload(); }
Source:
private RevObject parseNew(AnyObjectId id, ObjectLoader ldr) throws LargeObjectException, CorruptObjectException, MissingObjectException, IOException { RevObject r; int type = ldr.getType(); switch (type) { case Constants.OBJ_COMMIT: { initializeShallowCommits(); final RevCommit c = createCommit(id); c.parseCanonical(this, getCachedBytes(c, ldr)); r = c; break; } case Constants.OBJ_TREE: { r = new RevTree(id); r.flags |= PARSED; break; } case Constants.OBJ_BLOB: { r = new RevBlob(id); r.flags |= PARSED; break; } case Constants.OBJ_TAG: { final RevTag t = new RevTag(id); t.parseCanonical(this, getCachedBytes(t, ldr)); r = t; break; } default: throw new IllegalArgumentException(MessageFormat.format( JGitText.get().badObjectType, Integer.valueOf(type))); } objects.add(r); return r; }

Target:
private RevObject parseNew(AnyObjectId id, ObjectLoader ldr) throws LargeObjectException, CorruptObjectException, MissingObjectException, IOException { RevObject r; int type = ldr.getType(); switch (type) { case Constants.OBJ_COMMIT: { final RevCommit c = createCommit(id); c.parseCanonical(this, getCachedBytes(c, ldr)); r = c; break; } case Constants.OBJ_TREE: { r = new RevTree(id); r.flags |= PARSED; break; } case Constants.OBJ_BLOB: { r = new RevBlob(id); r.flags |= PARSED; break; } case Constants.OBJ_TAG: { final RevTag t = new RevTag(id); t.parseCanonical(this, getCachedBytes(t, ldr)); r = t; break; } default: throw new IllegalArgumentException(MessageFormat.format( JGitText.get().badObjectType, Integer.valueOf(type))); } objects.add(r); return r; }
Source:
private static DegraderTrackerClient createDegraderTrackerClient(URI uri, UriProperties uriProperties, ServiceProperties serviceProperties, String loadBalancerStrategyName, TransportClient transportClient, Clock clock) { DegraderImpl.Config config = null; if (serviceProperties.getLoadBalancerStrategyProperties() != null) { Map<String, Object> loadBalancerStrategyProperties = serviceProperties.getLoadBalancerStrategyProperties(); clock = MapUtil.getWithDefault(loadBalancerStrategyProperties, PropertyKeys.CLOCK, clock, Clock.class); } if (serviceProperties.getDegraderProperties() != null && !serviceProperties.getDegraderProperties().isEmpty()) { config = DegraderConfigFactory.toDegraderConfig(serviceProperties.getDegraderProperties()); config.setLogger(new RateLimitedLogger(LOG, LOG_RATE_MS, clock)); } long trackerClientInterval = getInterval(loadBalancerStrategyName, serviceProperties); Pattern errorStatusPattern = getErrorStatusPattern(loadBalancerStrategyName, serviceProperties); return new DegraderTrackerClient(uri, uriProperties.getPartitionDataMap(uri), transportClient, clock, config, trackerClientInterval, errorStatusPattern, uriProperties.getUriSpecificProperties().get(uri)); }

Target:
private static DegraderTrackerClient createDegraderTrackerClient(URI uri, UriProperties uriProperties, ServiceProperties serviceProperties, String loadBalancerStrategyName, TransportClient transportClient, Clock clock) { DegraderImpl.Config config = null; if (serviceProperties.getLoadBalancerStrategyProperties() != null) { Map<String, Object> loadBalancerStrategyProperties = serviceProperties.getLoadBalancerStrategyProperties(); clock = MapUtil.getWithDefault(loadBalancerStrategyProperties, PropertyKeys.CLOCK, clock, Clock.class); } if (serviceProperties.getDegraderProperties() != null && !serviceProperties.getDegraderProperties().isEmpty()) { config = DegraderConfigFactory.toDegraderConfig(serviceProperties.getDegraderProperties()); config.setLogger(new RateLimitedLogger(LOG, LOG_RATE_MS, clock)); } long trackerClientInterval = getInterval(loadBalancerStrategyName, serviceProperties); Pattern errorStatusPattern = getErrorStatusPattern(loadBalancerStrategyName, serviceProperties); return new DegraderTrackerClientImpl(uri, uriProperties.getPartitionDataMap(uri), transportClient, clock, config, trackerClientInterval, errorStatusPattern, uriProperties.getUriSpecificProperties().get(uri)); }
Source:
public StreamProcessor(Config config, Map<String, MetricsReporter> customMetricsReporters, TaskFactory taskFactory, ProcessorLifecycleListener processorListener, JobCoordinator jobCoordinator) { Preconditions.checkNotNull(processorListener, "ProcessorListener cannot be null."); this.taskFactory = taskFactory; this.config = config; this.taskShutdownMs = new TaskConfigJava(config).getShutdownMs(); this.processorListener = processorListener; this.customMetricsReporter = customMetricsReporters; this.jobCoordinator = (jobCoordinator != null) ? jobCoordinator : createJobCoordinator(); this.jobCoordinatorListener = createJobCoordinatorListener(); this.jobCoordinator.setListener(jobCoordinatorListener); ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat(CONTAINER_THREAD_NAME_FORMAT).setDaemon(true).build(); this.executorService = Executors.newSingleThreadExecutor(threadFactory); this.processorId = this.jobCoordinator.getProcessorId(); }

Target:
public StreamProcessor(Config config, Map<String, MetricsReporter> customMetricsReporters, TaskFactory taskFactory, ProcessorLifecycleListener processorListener, JobCoordinator jobCoordinator) { this(config, customMetricsReporters, taskFactory, sp -> processorListener, jobCoordinator); }
Source:
public void testListStatusACL() throws IOException, URISyntaxException { String testfilename = "testFileACL"; String childDirectoryName = "testDirectoryACL"; TEST_DIR.mkdirs(); File infile = new File(TEST_DIR, testfilename); final byte[] content = "dingos".getBytes(); try (FileOutputStream fos = new FileOutputStream(infile)) { fos.write(content); } assertEquals((long)content.length, infile.length()); File childDir = new File(TEST_DIR, childDirectoryName); childDir.mkdirs(); Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/file", infile.toURI()); ConfigUtil.addLink(conf, "/dir", childDir.toURI()); try (FileSystem vfs = FileSystem.get(FsConstants.VIEWFS_URI, conf)) { assertEquals(ViewFileSystem.class, vfs.getClass()); FileStatus[] statuses = vfs.listStatus(new Path("/")); FileSystem localFs = FileSystem.getLocal(conf); FileStatus fileStat = localFs.getFileStatus(new Path(infile.getPath())); FileStatus dirStat = localFs.getFileStatus(new Path(childDir.getPath())); for (FileStatus status : statuses) { if (status.getPath().getName().equals("file")) { assertEquals(fileStat.getPermission(), status.getPermission()); } else { assertEquals(dirStat.getPermission(), status.getPermission()); } } } }

Target:
public void testListStatusACL() throws IOException { String testfilename = "testFileACL"; String childDirectoryName = "testDirectoryACL"; TEST_DIR.mkdirs(); File infile = new File(TEST_DIR, testfilename); final byte[] content = "dingos".getBytes(); try (FileOutputStream fos = new FileOutputStream(infile)) { fos.write(content); } assertEquals(content.length, infile.length()); File childDir = new File(TEST_DIR, childDirectoryName); childDir.mkdirs(); Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/file", infile.toURI()); ConfigUtil.addLink(conf, "/dir", childDir.toURI()); try (FileSystem vfs = FileSystem.get(FsConstants.VIEWFS_URI, conf)) { assertEquals(ViewFileSystem.class, vfs.getClass()); FileStatus[] statuses = vfs.listStatus(new Path("/")); FileSystem localFs = FileSystem.getLocal(conf); FileStatus fileStat = localFs.getFileStatus(new Path(infile.getPath())); FileStatus dirStat = localFs.getFileStatus(new Path(childDir.getPath())); for (FileStatus status : statuses) { if (status.getPath().getName().equals("file")) { assertEquals(fileStat.getPermission(), status.getPermission()); } else { assertEquals(dirStat.getPermission(), status.getPermission()); } } localFs.setPermission(new Path(infile.getPath()), FsPermission.valueOf("-rwxr--r--")); localFs.setPermission(new Path(childDir.getPath()), FsPermission.valueOf("-r--rwxr--")); statuses = vfs.listStatus(new Path("/")); for (FileStatus status : statuses) { if (status.getPath().getName().equals("file")) { assertEquals(FsPermission.valueOf("-rwxr--r--"), status.getPermission()); } else { assertEquals(FsPermission.valueOf("-r--rwxr--"), status.getPermission()); } } } }
Source:
public static byte[] serializeEntry(KeystorePasswordStore.Entry entry) { byte[] className = entry.getClassName().getBytes(StandardCharsets.UTF_8); ByteBuffer b = ByteBuffer.allocate(8 + className.length + entry.getPayload().length ); b.putInt(entry.getVersion()); b.putInt(className.length); b.put(className); b.put(entry.getPayload()); return b.array(); }

Target:
public static byte[] serializeEntry(KeystorePasswordStore.Entry entry) { byte[] className = entry.getClassName().getBytes(StandardCharsets.UTF_8); ByteStringBuilder b = new ByteStringBuilder(); b.appendBE(entry.getVersion()); b.appendBE(className.length); b.append(className); b.append(entry.getPayload()); return b.toArray(); }
Source:
public void setData( String key, Object value ) { if( RWT.BADGE.equals( key ) && ( style & ( SWT.SEPARATOR | SWT.DROP_DOWN ) ) != 0 ) { return; } else if( RWT.TOOLTIP_MARKUP_ENABLED.equals( key ) && isToolTipMarkupEnabledFor( this ) ) { return; } super.setData( key, value ); }

Target:
public void setData( String key, Object value ) { if( RWT.BADGE.equals( key ) && ( style & SWT.PUSH ) == 0 ) { return; } else if( RWT.TOOLTIP_MARKUP_ENABLED.equals( key ) && isToolTipMarkupEnabledFor( this ) ) { return; } super.setData( key, value ); }
Source:
void checkAvailableResources() { int tries = 0; Throwable lastThrowable = null; while (tries < maxDBTries) { try { if (!RMStorageFactory.hasResources(databaseResourcesThreshold)) { throw new IOException("not enoug resources in the database"); } } catch (StorageException e) { LOG.warn("StorageException in checkAvailableResources (" + tries + "/" + maxDBTries + ").", e); if (e instanceof TransientStorageException) { LOG.debug("transiant exception"); continue; } lastThrowable = e; tries++; try { Thread.sleep(500); } catch (InterruptedException ex) { } } catch (Throwable t) { LOG.error("Runtime exception in checkAvailableResources. ", t); lastThrowable = t; tries++; try { Thread.sleep(500); } catch (InterruptedException ex) { } } } if (tries >= maxDBTries) { terminate(1, lastThrowable); } }

Target:
void checkAvailableResources() { int tries = 0; Throwable lastThrowable = null; while (tries < maxDBTries) { try { if (!RMStorageFactory.hasResources(databaseResourcesThreshold)) { throw new IOException("not enough resources in the database"); } } catch (StorageException e) { LOG.warn("StorageException in checkAvailableResources (" + tries + "/" + maxDBTries + ").", e); if (e instanceof TransientStorageException) { LOG.debug("transiant exception"); continue; } lastThrowable = e; tries++; try { Thread.sleep(500); } catch (InterruptedException ex) { } } catch (Throwable t) { LOG.error("Runtime exception in checkAvailableResources. ", t); lastThrowable = t; tries++; try { Thread.sleep(500); } catch (InterruptedException ex) { } } } if (tries >= maxDBTries) { terminate(1, lastThrowable); } }
Source:
public void shouldUpdateEmailToChargeTransaction() { service.create(CHARGE_REQUEST, GATEWAY_ACCOUNT_ID, mockedUriInfo); ArgumentCaptor<ChargeEntity> chargeEntityArgumentCaptor = forClass(ChargeEntity.class); verify(mockedChargeDao).persist(chargeEntityArgumentCaptor.capture()); ChargeEntity createdChargeEntity = chargeEntityArgumentCaptor.getValue(); final String chargeEntityExternalId = createdChargeEntity.getExternalId(); when(mockedChargeDao.findByExternalId(chargeEntityExternalId)) .thenReturn(Optional.of(createdChargeEntity)); final ChargeTransactionEntity chargeTransactionEntity = ChargeTransactionEntity.from(createdChargeEntity); final PaymentRequestEntity paymentRequestEntity = PaymentRequestEntity.from(createdChargeEntity, chargeTransactionEntity); when(mockedPaymentRequestDao.findByExternalId(chargeEntityExternalId)) .thenReturn(Optional.of(paymentRequestEntity)); final String expectedEmail = "test@examplecom"; PatchRequestBuilder.PatchRequest patchRequest = PatchRequestBuilder.aPatchRequestBuilder( ImmutableMap.of( "op", "replace", "path", "email", "value", expectedEmail)) .withValidOps(singletonList("replace")) .withValidPaths(singletonList("email")) .build(); assertThat(paymentRequestEntity.getChargeTransaction().getEmail(), is(nullValue())); service.updateCharge(chargeEntityExternalId, patchRequest); verify(mockedPaymentRequestDao).findByExternalId(chargeEntityExternalId); Optional<PaymentRequestEntity> maybePaymentRequest = mockedPaymentRequestDao.findByExternalId(chargeEntityExternalId); assertThat(maybePaymentRequest.isPresent(), is(true)); PaymentRequestEntity updatedPaymentRequest = maybePaymentRequest.get(); String emailFromTransaction = updatedPaymentRequest.getChargeTransaction().getEmail(); assertThat(emailFromTransaction, is(expectedEmail)); }

Target:
public void shouldUpdateEmailToChargeTransaction() { ChargeEntity createdChargeEntity = ChargeEntityFixture.aValidChargeEntity().build(); final String chargeEntityExternalId = createdChargeEntity.getExternalId(); when(mockedChargeDao.findByExternalId(chargeEntityExternalId)) .thenReturn(Optional.of(createdChargeEntity)); final ChargeTransactionEntity chargeTransactionEntity = ChargeTransactionEntity.from(createdChargeEntity); final PaymentRequestEntity paymentRequestEntity = PaymentRequestEntity.from(createdChargeEntity, chargeTransactionEntity); when(mockedPaymentRequestDao.findByExternalId(chargeEntityExternalId)) .thenReturn(Optional.of(paymentRequestEntity)); final String expectedEmail = "test@examplecom"; PatchRequestBuilder.PatchRequest patchRequest = PatchRequestBuilder.aPatchRequestBuilder( ImmutableMap.of( "op", "replace", "path", "email", "value", expectedEmail)) .withValidOps(singletonList("replace")) .withValidPaths(singletonList("email")) .build(); assertThat(paymentRequestEntity.getChargeTransaction().getEmail(), is(nullValue())); service.updateCharge(chargeEntityExternalId, patchRequest); verify(mockedPaymentRequestDao).findByExternalId(chargeEntityExternalId); String emailFromTransaction = paymentRequestEntity.getChargeTransaction().getEmail(); assertThat(emailFromTransaction, is(expectedEmail)); }
Source:
private static String stripIndentAndTrailingWhitespaceFromLine(String line, int indent) { final int lastNonWhitespace = lastIndexOfNonWhitespace(line); String returnString = ""; if (lastNonWhitespace > 0) { final int firstNonWhitespace = indexOfNonWhitespace(line); final int incidentalWhitespace = Math.min(indent, firstNonWhitespace); returnString = line.substring(incidentalWhitespace, lastNonWhitespace); } return returnString; }

Target:
private static String stripIndentAndTrailingWhitespaceFromLine(String line, int indent) { final int lastNonWhitespace = lastIndexOfNonWhitespace(line); String returnString = ""; if (lastNonWhitespace > 0) { returnString = line.substring(indent, lastNonWhitespace); } return returnString; }
Source:
public <T> boolean cache(String key, String field, T value) { RedisConnection<byte[], byte[]> redisCommands = null; try { redisCommands = getRedisConnection(); byte[] serializedValues = new JavaSerializer().serializeObject(value); redisCommands.hset(key.getBytes(), field.getBytes(), serializedValues); return true; } catch (Exception e) { logger.error("Exception Occurred while caching a value in redis", e); } finally { closeConnection(redisCommands); } return false; }

Target:
public <T extends Serializable> boolean cache(String key, String field, T value) { RedisConnection<byte[], byte[]> redisCommands = null; try { redisCommands = getRedisConnection(); byte[] serializedValues = codec.serializeObject(value); return redisCommands.hset(key.getBytes(), field.getBytes(), serializedValues); } finally { closeConnection(redisCommands); } }
Source:
public String getFeedId() { if (code != null && code.length() > 0) { return code.substring(0, code.indexOf(':')); } return route.getId().getAgencyId(); }

Target:
public String getFeedId() { return route.getId().getAgencyId(); }
Source:
public void getTaskDataStateByMultipleThreads() throws Exception { File file = newTaskDataZipFile(); List<Throwable> failures = runThreads(store -> store.getTaskDataState(file)); assertNoFailures(failures); }

Target:
public void getTaskDataStateByMultipleThreads() throws Exception { File file = newTaskDataZipFile(); List<Throwable> failures = runSameByMultipleThreads(store -> store.getTaskDataState(file)); assertNoFailures(failures); }
Source:
private void removeTab(JediTermWidget terminal) { synchronized (myLock) { if (myTabs != null) { synchronized (ProcessCache.class) { myTabs.remove(terminal); } if(mySettingsProvider.jobNameAsTabName()) { ProcessCache.getInstance().removePid(terminal.getTtyConnector().getTtyPid()); if (myTabs != null){ for (int i = 0; i < myTabs.getTabCount(); i++) { final int ind = i; ProcessCache.getInstance().addPid( myTabs.getComponentAt(i).getTtyConnector().getTtyPid(), new ProcessCache.TabNameChanger() { int index = ind; @Override public void changeName(String name) { myTabs.setTitleAt(index, name); } }); } } } } onSessionChanged(); } }

Target:
private void removeTab(JediTermWidget terminal) { synchronized (myLock) { if (myTabs != null) { myTabs.remove(terminal); } onSessionChanged(); } }
Source:
public boolean isNoexcept(boolean inCalledContext) { if (isConstantExpression()) return true; ICPPFunction overload = getOverload(); if (overload != null) { ICPPASTFunctionDeclarator decl = FunctionHelpers.findDeclarator(overload); if (decl.getNoexceptExpression() == null) return false; } return fArgument.isNoexcept(inCalledContext); }

Target:
public boolean isNoexcept(boolean inCalledContext) { if (fOperator == op_throw) return false; ICPPFunction overload = getOverload(); if (overload != null) { return EvalUtil.evaluateNoexceptSpecifier(overload.getType().getNoexceptSpecifier()); } return fArgument.isNoexcept(inCalledContext); }
Source:
@VisibleForTesting public void putIdForLanguage(@NonNull String code, int id) { ids.put(code, id); }

Target:
public void putIdForLanguage(@NonNull String code, int id) { ids.put(code, id); }
Source:
public RenameRefactoringSession createRenameRefactoring(CreateRenameRefactoring settings) throws CoreException, RefactoringException { LOG.info( "createRenameRefactoring started in " + System.currentTimeMillis() + " ms with " + settings.toString()); IJavaProject javaProject = model.getJavaProject(settings.getProjectPath()); IJavaElement elementToRename; ICompilationUnit cu = null; switch (settings.getType()) { case COMPILATION_UNIT: elementToRename = javaProject.findType(settings.getPath()).getCompilationUnit(); break; case PACKAGE: elementToRename = javaProject.findPackageFragment(new org.eclipse.core.runtime.Path(settings.getPath())); break; case JAVA_ELEMENT: cu = javaProject.findType(settings.getPath()).getCompilationUnit(); elementToRename = getSelectionElement(cu, settings.getOffset()); break; default: elementToRename = null; } if (elementToRename == null) { LOG.error( "createRenameRefactoring fail in " + System.currentTimeMillis() + " ms with RefactoringException: Can't find java element to rename. "); throw new RefactoringException("Can't find java element to rename."); } RenameRefactoringSession renameRefactoring = manager.createRenameRefactoring( elementToRename, cu, settings.getOffset(), settings.isRefactorLightweight()); LOG.info( "createRenameRefactoring finished in " + System.currentTimeMillis() + " ms with " + renameRefactoring.toString()); return renameRefactoring; }

Target:
public RenameRefactoringSession createRenameRefactoring(CreateRenameRefactoring settings) throws CoreException, RefactoringException { IJavaProject javaProject = model.getJavaProject(settings.getProjectPath()); IJavaElement elementToRename; ICompilationUnit cu = null; switch (settings.getType()) { case COMPILATION_UNIT: elementToRename = javaProject.findType(settings.getPath()).getCompilationUnit(); break; case PACKAGE: elementToRename = javaProject.findPackageFragment(new org.eclipse.core.runtime.Path(settings.getPath())); break; case JAVA_ELEMENT: cu = javaProject.findType(settings.getPath()).getCompilationUnit(); elementToRename = getSelectionElement(cu, settings.getOffset()); break; default: elementToRename = null; } if (elementToRename == null) { throw new RefactoringException("Can't find java element to rename."); } return manager.createRenameRefactoring( elementToRename, cu, settings.getOffset(), settings.isRefactorLightweight()); }
Source:
private void getNestedColsFromExprNodeDesc( ExprNodeDesc desc, String pathToRoot, List<String> paths) { if (desc instanceof ExprNodeColumnDesc) { String f = ((ExprNodeColumnDesc) desc).getColumn(); String p = pathToRoot.isEmpty() ? f : f + "." + pathToRoot; paths.add(p); } else if (desc instanceof ExprNodeGenericFuncDesc) { List<ExprNodeDesc> children = desc.getChildren(); if (children == null || children.isEmpty()) { return; } for (ExprNodeDesc c : children) { getNestedColsFromExprNodeDesc(c, pathToRoot, paths); } } else if (desc instanceof ExprNodeConstantDesc) { return; } else if (desc instanceof ExprNodeColumnListDesc) { } else if (desc instanceof ExprNodeFieldDesc) { String f = ((ExprNodeFieldDesc) desc).getFieldName(); String p = pathToRoot.isEmpty() ? f : f + "." + pathToRoot; getNestedColsFromExprNodeDesc(((ExprNodeFieldDesc) desc).getDesc(), p, paths); } }

Target:
private void getNestedColsFromExprNodeDesc( ExprNodeDesc desc, String pathToRoot, List<String> paths) { if (desc instanceof ExprNodeColumnDesc) { String f = ((ExprNodeColumnDesc) desc).getColumn(); String p = pathToRoot.isEmpty() ? f : f + "." + pathToRoot; paths.add(p); } else if (desc instanceof ExprNodeFieldDesc) { String f = ((ExprNodeFieldDesc) desc).getFieldName(); String p = pathToRoot.isEmpty() ? f : f + "." + pathToRoot; getNestedColsFromExprNodeDesc(((ExprNodeFieldDesc) desc).getDesc(), p, paths); } else { List<ExprNodeDesc> children = desc.getChildren(); if (children == null || children.isEmpty()) { return; } for (ExprNodeDesc c : children) { getNestedColsFromExprNodeDesc(c, pathToRoot, paths); } } }
Source:
public Trigger atPayload(final Map payload) { return this.toBuilder() .buildNumber(null) .hash(null) .digest(null) .payload(payload) .build(); }

Target:
public Trigger atPayload(final Map payload) { return this.toBuilder() .payload(payload) .build(); }
Source:
public void testAddSourceFinish() { PlanNodeId sourceId = new PlanNodeId("source"); final List<Type> types = ImmutableList.of(VARCHAR, BIGINT, BIGINT); TableScanOperator source = new TableScanOperator(driverContext.addOperatorContext(99, new PlanNodeId("test"), "values"), sourceId, new PageSourceProvider() { @Override public ConnectorPageSource createPageSource(Session session, Split split, TableHandle table, List<ColumnHandle> columns) { return new FixedPageSource(rowPagesBuilder(types) .addSequencePage(10, 20, 30, 40) .build()); } }, new TableHandle( new ConnectorId("test"), new ConnectorTableHandle() {}, new ConnectorTransactionHandle() {}, Optional.empty()), ImmutableList.of()); PageConsumerOperator sink = createSinkOperator(types); Driver driver = Driver.createDriver(driverContext, source, sink); assertSame(driver.getDriverContext(), driverContext); assertFalse(driver.isFinished()); assertFalse(driver.processFor(new Duration(1, TimeUnit.MILLISECONDS)).isDone()); assertFalse(driver.isFinished()); driver.updateSource(new TaskSource(sourceId, ImmutableSet.of(new ScheduledSplit(0, sourceId, newMockSplit())), true)); assertFalse(driver.isFinished()); assertTrue(driver.processFor(new Duration(1, TimeUnit.SECONDS)).isDone()); assertTrue(driver.isFinished()); assertTrue(sink.isFinished()); assertTrue(source.isFinished()); }

Target:
public void testAddSourceFinish() { PlanNodeId sourceId = new PlanNodeId("source"); final List<Type> types = ImmutableList.of(VARCHAR, BIGINT, BIGINT); TableScanOperator source = new TableScanOperator(driverContext.addOperatorContext(99, new PlanNodeId("test"), "values"), sourceId, new PageSourceProvider() { @Override public ConnectorPageSource createPageSource(Session session, Split split, TableHandle table, List<ColumnHandle> columns) { return new FixedPageSource(rowPagesBuilder(types) .addSequencePage(10, 20, 30, 40) .build()); } }, TESTING_TABLE_HANDLE, ImmutableList.of()); PageConsumerOperator sink = createSinkOperator(types); Driver driver = Driver.createDriver(driverContext, source, sink); assertSame(driver.getDriverContext(), driverContext); assertFalse(driver.isFinished()); assertFalse(driver.processFor(new Duration(1, TimeUnit.MILLISECONDS)).isDone()); assertFalse(driver.isFinished()); driver.updateSource(new TaskSource(sourceId, ImmutableSet.of(new ScheduledSplit(0, sourceId, newMockSplit())), true)); assertFalse(driver.isFinished()); assertTrue(driver.processFor(new Duration(1, TimeUnit.SECONDS)).isDone()); assertTrue(driver.isFinished()); assertTrue(sink.isFinished()); assertTrue(source.isFinished()); }
Source:
private static void runOnce(Context context, ClosableIterator<RowResult<Value>> iter) { Multimap<Cell, Value> batchToCreate = ArrayListMultimap.create(); Multimap<Cell, Long> batchToDelete = ArrayListMultimap.create(); while (iter.hasNext()) { RowResult<Value> rowResult = iter.next(); byte[] row = rowResult.getRowName(); for (Entry<byte[], Value> entry : rowResult.getColumns().entrySet()) { byte[] col = entry.getKey(); Value value = entry.getValue(); long timestamp = value.getTimestamp(); String[] tableNames = StringUtils.split( PtBytes.toString(value.getContents()), '\0'); for (String tableName : tableNames) { byte[] tableBytes = EncodingUtils.encodeVarString(tableName); byte[] newCol = EncodingUtils.add(tableBytes, col); Cell newCell = Cell.create(row, newCol); batchToCreate.put(newCell, Value.create(EMPTY_CONTENTS, timestamp)); } batchToDelete.put(Cell.create(row, col), timestamp); if (batchToDelete.size() >= context.batchSize) { flush(context, batchToCreate, batchToDelete); } } } if (!batchToDelete.isEmpty()) { flush(context, batchToCreate, batchToDelete); } }

Target:
private static void runOnce(Context context, ClosableIterator<RowResult<Value>> iter) { Multimap<Cell, Value> batchToCreate = ArrayListMultimap.create(); Multimap<Cell, Long> batchToDelete = ArrayListMultimap.create(); while (iter.hasNext()) { RowResult<Value> rowResult = iter.next(); byte[] row = rowResult.getRowName(); for (Entry<byte[], Value> entry : rowResult.getColumns().entrySet()) { byte[] col = entry.getKey(); Value value = entry.getValue(); long timestamp = value.getTimestamp(); String[] tableNames = StringUtils.split( PtBytes.toString(value.getContents()), AtlasDbConstants.OLD_SCRUB_TABLE_SEPARATOR_CHAR); for (String tableName : tableNames) { byte[] tableBytes = EncodingUtils.encodeVarString(tableName); byte[] newCol = EncodingUtils.add(tableBytes, col); Cell newCell = Cell.create(row, newCol); batchToCreate.put(newCell, Value.create(DUMMY_CONTENTS, timestamp)); } batchToDelete.put(Cell.create(row, col), timestamp); if (batchToDelete.size() >= context.batchSize) { flush(context, batchToCreate, batchToDelete); } } } if (!batchToDelete.isEmpty()) { flush(context, batchToCreate, batchToDelete); } }
Source:
boolean updateNewAndRestoringTasks() { Utils.sleep(10); active.initializeNewTasks(); standby.initializeNewTasks(); final Collection<TopicPartition> restored = changelogReader.restore(active); active.updateRestored(restored); if (active.allTasksRunning() && standby.allTasksRunning()) { final Set<TopicPartition> assignment = consumer.assignment(); log.trace("Resuming partitions {}", assignment); consumer.resume(assignment); assignStandbyPartitions(); return true; } return false; }

Target:
boolean updateNewAndRestoringTasks() { active.initializeNewTasks(); standby.initializeNewTasks(); final Collection<TopicPartition> restored = changelogReader.restore(active); active.updateRestored(restored); if (active.allTasksRunning()) { final Set<TopicPartition> assignment = consumer.assignment(); log.trace("Resuming partitions {}", assignment); consumer.resume(assignment); assignStandbyPartitions(); return standby.allTasksRunning(); } return false; }
Source:
public static int getShortestIndexLength(List<String> indices) { String initialValue = "REALLY_LONG_VALUE_THAT_WILL_SURELY_GET_REPLACED_BUT_HERE_ARE_SOME_MORE_CHARACTERS_JUST_IN_CASE"; String shortestIndex = indices.stream() .reduce(initialValue, (shortest, current) -> { if (current != null && current.length() > 0 && current.length() < shortest.length()) return current; return shortest; }); if (shortestIndex == null || initialValue.equals(shortestIndex)) return 0; return shortestIndex.length(); }

Target:
private static int getShortestIndexLength(List<String> indices) { try { int shortestIndex = indices.stream().filter(Objects::nonNull) .mapToInt(String::length).min().getAsInt(); if (shortestIndex == 0) return 0; return shortestIndex; } catch (NoSuchElementException e) { return 0; } }
Source:
public void listSecretVersions(String projectId, String secretId) throws IOException { try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) { SecretName parent = SecretName.of(projectId, secretId); ListSecretVersionsRequest request = ListSecretVersionsRequest.newBuilder().setParent(parent.toString()).build(); ListSecretVersionsPagedResponse iterator = client.listSecretVersions(request); for (SecretVersion version : iterator.iterateAll()) { System.out.printf("Secret version %s, %s\n", version.getName(), version.getState()); } } }

Target:
public void listSecretVersions(String projectId, String secretId) throws IOException { try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) { SecretName parent = SecretName.of(projectId, secretId); ListSecretVersionsRequest request = ListSecretVersionsRequest.newBuilder().setParent(parent.toString()).build(); ListSecretVersionsPagedResponse pagedResponse = client.listSecretVersions(request); pagedResponse .iterateAll() .forEach( version -> { System.out.printf("Secret version %s, %s\n", version.getName(), version.getState()); }); } }
Source:
public IStatus validate(Object[] selection) { String errorMessage = ""; if (selection.length == 0) { errorMessage = NO_SELECTION; } else { final Object firstSelection = selection[0]; if (selection.length != 1 || false == firstSelection instanceof Property || (firstSelection instanceof Property && false == ((Property) firstSelection).getType() instanceof PrimitiveType)) { errorMessage = Messages.SinglePropertyAttributeValidator_errorMessage; } } return buildIStatus(errorMessage); }

Target:
public IStatus validate(Object[] selection) { String errorMessage = ""; if (selection.length <= 0) { errorMessage = NO_SELECTION; } else { final Object firstSelection = selection[0]; if (selection.length != 1 || false == firstSelection instanceof Property || (firstSelection instanceof Property && false == ((Property) firstSelection).getType() instanceof PrimitiveType)) { errorMessage = Messages.SinglePropertyAttributeValidator_errorMessage; } } return buildIStatus(errorMessage); }
Source:
public Date getUpdatedAt() { return updatedAt; }

Target:
public Date getUpdatedAt() { return (updatedAt == null) ? Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP : updatedAt; }
Source:
public DefaultExecutionTopology(ExecutionGraph graph) { this.executionGraph = checkNotNull(graph, "execution graph can not be null"); this.executionVerticesById = new HashMap<>(); this.executionVerticesList = new ArrayList<>(graph.getTotalNumberOfVertices()); Map<IntermediateResultPartitionID, DefaultResultPartition> tmpResultPartitionsById = new HashMap<>(); Map<ExecutionVertex, DefaultExecutionVertex> executionVertexMap = new HashMap<>(); for (ExecutionVertex vertex : graph.getAllExecutionVertices()) { List<DefaultResultPartition> producedPartitions = generateProducedSchedulingResultPartition(vertex.getProducedPartitions()); producedPartitions.forEach(partition -> tmpResultPartitionsById.put(partition.getId(), partition)); DefaultExecutionVertex schedulingVertex = generateSchedulingExecutionVertex(vertex, producedPartitions); this.executionVerticesById.put(schedulingVertex.getId(), schedulingVertex); this.executionVerticesList.add(schedulingVertex); executionVertexMap.put(vertex, schedulingVertex); } this.resultPartitionsById = tmpResultPartitionsById; connectVerticesToConsumedPartitions(executionVertexMap, tmpResultPartitionsById); this.pipelinedRegionsByVertex = new HashMap<>(); this.pipelinedRegions = new ArrayList<>(); initializePipelinedRegions(); ensureCoLocatedVerticesInSameRegion(); }

Target:
private DefaultExecutionTopology(ExecutionGraph graph) { checkNotNull(graph, "execution graph can not be null"); this.executionVerticesById = new HashMap<>(); this.executionVerticesList = new ArrayList<>(graph.getTotalNumberOfVertices()); Map<IntermediateResultPartitionID, DefaultResultPartition> tmpResultPartitionsById = new HashMap<>(); Map<ExecutionVertex, DefaultExecutionVertex> executionVertexMap = new HashMap<>(); for (ExecutionVertex vertex : graph.getAllExecutionVertices()) { List<DefaultResultPartition> producedPartitions = generateProducedSchedulingResultPartition(vertex.getProducedPartitions()); producedPartitions.forEach(partition -> tmpResultPartitionsById.put(partition.getId(), partition)); DefaultExecutionVertex schedulingVertex = generateSchedulingExecutionVertex(vertex, producedPartitions); this.executionVerticesById.put(schedulingVertex.getId(), schedulingVertex); this.executionVerticesList.add(schedulingVertex); executionVertexMap.put(vertex, schedulingVertex); } this.resultPartitionsById = tmpResultPartitionsById; connectVerticesToConsumedPartitions(executionVertexMap, tmpResultPartitionsById); }
Source:
private KeyProvider toKeyProvider(DwrfProto.Encryption.KeyProvider keyProvider) { switch (keyProvider) { case CRYPTO_SERVICE: return KeyProvider.CRYPTO_SERVICE; default: return KeyProvider.UNKNOWN; } }

Target:
private static KeyProvider toKeyProvider(DwrfProto.Encryption.KeyProvider keyProvider) { switch (keyProvider) { case CRYPTO_SERVICE: return KeyProvider.CRYPTO_SERVICE; default: return KeyProvider.UNKNOWN; } }
Source:
public IGerritHudsonTriggerConfig getConfig(String serverName) { return PluginImpl.getInstance().getServer(serverName).getConfig(); }

Target:
public IGerritHudsonTriggerConfig getConfig(String serverName) { GerritServer server = PluginImpl.getInstance().getServer(serverName); if (server != null) { return server.getConfig(); } else { logger.error("Could not find the Gerrit Server: {}", serverName); } return null; }
Source:
public void emitResult(Tuple2<byte[], Integer> resultTuple) throws Exception { byte[] udafResult = resultTuple.f0; int length = resultTuple.f1; bais.setBuffer(udafResult, 0, length); int rowCount = arrowSerializer.load(); for (int i = 0; i < rowCount; i++) { RowData input = forwardedInputQueue.poll(); reuseJoinedRow.setRowKind(input.getRowKind()); RowData data = arrowSerializer.read(i); rowDataWrapper.collect(reuseJoinedRow.replace(input, data)); } }

Target:
public void emitResult(Tuple2<byte[], Integer> resultTuple) throws Exception { byte[] udafResult = resultTuple.f0; int length = resultTuple.f1; bais.setBuffer(udafResult, 0, length); int rowCount = arrowSerializer.load(); for (int i = 0; i < rowCount; i++) { RowData key = forwardedInputQueue.poll(); reuseJoinedRow.setRowKind(key.getRowKind()); RowData result = arrowSerializer.read(i); rowDataWrapper.collect(reuseJoinedRow.replace(key, result)); } }