auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void setUp() { mockApplicationContext = mock(ApplicationContext.class); mockEventStore = mock(EventStore.class); mockRepositoryProvider = mock(RepositoryProvider.class); executor = spy(new MockExecutor()); testSubject = new SpringAggregateSnapshotterFactoryBean(); testSubject.setApplicationContext(mockApplicationContext); testSubject.setExecutor(executor); when(mockApplicationContext.getBeansOfType(AggregateFactory.class)).thenReturn( Collections.singletonMap("myFactory", new AbstractAggregateFactory<StubAggregate>(StubAggregate.class) { @Override public StubAggregate doCreateAggregate(String aggregateIdentifier, DomainEventMessage firstEvent) { return new StubAggregate(aggregateIdentifier); } })); testSubject.setEventStore(mockEventStore); testSubject.setRepositoryProvider(mockRepositoryProvider); mockTransactionManager = mock(PlatformTransactionManager.class); aggregateIdentifier = UUID.randomUUID().toString(); String type = "StubAggregate"; DomainEventMessage event1 = new GenericDomainEventMessage<>(type, aggregateIdentifier, 0L, "Mock contents", MetaData.emptyInstance()); DomainEventMessage event2 = new GenericDomainEventMessage<>(type, aggregateIdentifier, 1L, "Mock contents", MetaData.emptyInstance()); when(mockEventStore.readEvents(aggregateIdentifier)).thenReturn(DomainEventStream.of(event1, event2)); }

Target:
void setUp() { mockApplicationContext = mock(ApplicationContext.class); mockEventStore = mock(EventStore.class); mockRepositoryProvider = mock(RepositoryProvider.class); executor = spy(new MockExecutor()); testSubject = new SpringAggregateSnapshotterFactoryBean(); testSubject.setApplicationContext(mockApplicationContext); testSubject.setExecutor(executor); when(mockApplicationContext.getBeansOfType(AggregateFactory.class)).thenReturn( Collections.singletonMap("myFactory", new AbstractAggregateFactory<StubAggregate>(StubAggregate.class) { @Override public StubAggregate doCreateAggregate(String aggregateIdentifier, DomainEventMessage firstEvent) { return new StubAggregate(aggregateIdentifier); } })); testSubject.setEventStore(mockEventStore); testSubject.setRepositoryProvider(mockRepositoryProvider); mockTransactionManager = mock(PlatformTransactionManager.class); aggregateIdentifier = UUID.randomUUID().toString(); String type = "testAggregate"; DomainEventMessage event1 = new GenericDomainEventMessage<>(type, aggregateIdentifier, 0L, "Mock contents", MetaData.emptyInstance()); DomainEventMessage event2 = new GenericDomainEventMessage<>(type, aggregateIdentifier, 1L, "Mock contents", MetaData.emptyInstance()); when(mockEventStore.readEvents(aggregateIdentifier)).thenReturn(DomainEventStream.of(event1, event2)); }
Source:
private static Integer getPlatFormOffset() { String currentOs = System.getProperty("os.name").toLowerCase(Locale.ROOT); String currentJdk = System.getProperty("java.version").toLowerCase(Locale.ROOT); for (int i = 0; i < PLATFORM_LIST.size(); i++) { if (currentOs.toLowerCase(Locale.ROOT).contains(PLATFORM_LIST.get(i).split(",")[0].toLowerCase(Locale.ROOT)) && currentJdk.toLowerCase(Locale.ROOT).contains( PLATFORM_LIST.get(i).split(",")[1].toLowerCase(Locale.ROOT))) { return i; } } return null; }

Target:
private static Integer getPlatFormOffset() { ClientLogger logger = new ClientLogger(TestBase.class); String currentOs = System.getProperty("os.name").toLowerCase(Locale.ROOT); logger.info("It is currently running on os: " + currentOs); String currentJdk = System.getProperty("java.version").toLowerCase(Locale.ROOT); logger.info("It is using jdk: " + currentJdk); for (int i = 0; i < PLATFORM_LIST.size(); i++) { if (isCurrentPlatformIncluded(currentOs, currentJdk, i)) { return i; } } throw new RuntimeException(String.format("Not running on the expected platform. os: %s, jdk: %s", currentOs, currentJdk)); }
Source:
public void subscribeUnsubscribe() throws Exception { final Postman postman = Mockito.mock(Postman.class); final DyBase base = new DyBase(); final Alias alias = new EmAlias(this.randomAlias(base), postman); final Bout bout = alias.inbox().bout(alias.inbox().start()); final Alias friend = this.randomAlias(base); bout.friends().invite(friend.name()); final ArgumentCaptor<Envelope> captor = ArgumentCaptor.forClass(Envelope.class); friend.inbox().bout(bout.number()).subscribe(false); bout.messages().post(DON_T_SEND_IT); friend.inbox().bout(bout.number()).subscribe(true); bout.messages().post(SEND_IT); bout.messages().post(SEND_IT); friend.inbox().bout(bout.number()).subscribe(false); bout.messages().post(DON_T_SEND_IT); Mockito.verify(postman, Mockito.times(2)).send(captor.capture()); final List<Envelope> messages = captor.getAllValues(); for (final Envelope envelope : messages) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); MimeMultipart.class.cast(envelope.unwrap().getContent()) .writeTo(baos); MatcherAssert.assertThat( baos.toString(), Matchers.containsString( SEND_IT ) ); } }

Target:
public void subscribeUnsubscribe() throws Exception { final Postman postman = Mockito.mock(Postman.class); final DyBase base = new DyBase(); final Alias alias = new EmAlias(this.getAlias(base, 26, 6), postman); final Bout bout = alias.inbox().bout(alias.inbox().start()); final Alias friend = this.getAlias(base, 20, 1); bout.friends().invite(friend.name()); final ArgumentCaptor<Envelope> captor = ArgumentCaptor.forClass(Envelope.class); friend.inbox().bout(bout.number()).subscribe(false); final String dontsend = "don't send it"; bout.messages().post(dontsend); friend.inbox().bout(bout.number()).subscribe(true); final String send = "send it"; bout.messages().post(send); bout.messages().post(send); friend.inbox().bout(bout.number()).subscribe(false); bout.messages().post(dontsend); Mockito.verify(postman, Mockito.times(2)).send(captor.capture()); final List<Envelope> messages = captor.getAllValues(); for (final Envelope envelope : messages) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); MimeMultipart.class.cast(envelope.unwrap().getContent()) .writeTo(baos); MatcherAssert.assertThat( baos.toString(), Matchers.not(Matchers.containsString(dontsend)) ); MatcherAssert.assertThat( baos.toString(), Matchers.containsString(send) ); } }
Source:
public Ban.Builder profile(org.spongepowered.api.profile.GameProfile profile) { checkNotNull(profile, "Profile cannot be null!"); checkState(banType == BanTypes.PROFILE, "Cannot set a GameProfile if the BanType is not BanType.USER_BAN!"); this.profile = profile; return this; }

Target:
public Ban.Builder profile(org.spongepowered.api.profile.GameProfile profile) { checkNotNull(profile, "Profile cannot be null!"); checkState(banType == BanTypes.PROFILE, "Cannot set a GameProfile if the BanType is not BanTypes.PROFILE!"); this.profile = profile; return this; }
Source:
public void removeListener() { View view = getView(); if (view != null) { getDiagramEventBroker().removeNotificationListener(view, this); if (hostSemanticElement != null) { for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) { getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this); } getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this); hostSemanticElement = null; } } if (!stereotypeList.isEmpty()) { for (Stereotype stereotype : stereotypeList) { View label = helper.getStereotypeLabel(hostView, stereotype); if (null != label) { getDiagramEventBroker().removeNotificationListener(label, this); } BasicCompartment compartment = helper.getStereotypeBraceCompartment(hostView, stereotype); if (compartment != null) { getDiagramEventBroker().addNotificationListener(helper.getStereotypeBraceCompartment(hostView, stereotype), this); } if (compartment != null && stereotype != null) { EList<Property> properties = stereotype.allAttributes(); for (Property property : properties) { getDiagramEventBroker().removeNotificationListener(helper.getStereotypePropertyInBrace(hostView, stereotype, property), this); } } } } }

Target:
public void removeListener() { View view = getView(); if (null != view) { getDiagramEventBroker().removeNotificationListener(view, this); if (null != hostSemanticElement) { for (EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) { getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this); } getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this); hostSemanticElement = null; } } if (!stereotypeList.isEmpty()) { for (Stereotype stereotype : stereotypeList) { View label = helper.getStereotypeLabel(hostView, stereotype); if (null != label) { getDiagramEventBroker().removeNotificationListener(label, this); } BasicCompartment compartment = helper.getStereotypeBraceCompartment(hostView, stereotype); if (null != compartment) { getDiagramEventBroker().addNotificationListener(helper.getStereotypeBraceCompartment(hostView, stereotype), this); } if (null != compartment && null != stereotype) { EList<Property> properties = stereotype.allAttributes(); for (Property property : properties) { getDiagramEventBroker().removeNotificationListener(helper.getStereotypePropertyInBrace(hostView, stereotype, property), this); } } } } }
Source:
protected void reinitAllDatabases() throws IOException { boolean acquired = false; try { semaphore.acquire(Integer.MAX_VALUE); acquired = true; try { db.close(); } catch (IOException e) { log.warnUnableToCloseDb(e); } try { expiredDb.close(); } catch (IOException e) { log.warnUnableToCloseExpiredDb(e); } } catch (InterruptedException e) { log.warnUnableToCloseDb(e); log.warnUnableToCloseExpiredDb(e); } db = reinitDatabase(getQualifiedLocation(), dataDbOptions()); expiredDb = reinitDatabase(getQualifiedExpiredLocation(), expiredDbOptions()); if (acquired) { semaphore.release(Integer.MAX_VALUE); } }

Target:
protected void reinitAllDatabases() throws IOException { try { semaphore.acquire(Integer.MAX_VALUE); } catch (InterruptedException e) { throw new PersistenceException("Cannot acquire semaphore", e); } try { if (stopped) { throw new PersistenceException("LevelDB is stopped"); } try { db.close(); } catch (IOException e) { log.warnUnableToCloseDb(e); } try { expiredDb.close(); } catch (IOException e) { log.warnUnableToCloseExpiredDb(e); } db = reinitDatabase(getQualifiedLocation(), dataDbOptions()); expiredDb = reinitDatabase(getQualifiedExpiredLocation(), expiredDbOptions()); } finally { semaphore.release(Integer.MAX_VALUE); } }
Source:
public MatchClause append(Filter filter) { if (clause == null) { clause = new StringBuilder("MATCH (n)"); if (filter.getRelationshipDirection().equals(Direction.INCOMING)) { clause.append("<"); } clause.append(String.format("-[%s:`%s`]-", relationshipIdentifier(), this.relationshipType)); if (filter.getRelationshipDirection().equals(Direction.OUTGOING)) { clause.append(">"); } clause.append(String.format("(%s) ", nodeIdentifier())); } clause.append(filter.toCypher(relationshipIdentifier(), clause.indexOf(" WHERE ") == -1)); return this; }

Target:
public MatchClause append(Filter filter) { if (clause == null) { clause = new StringBuilder("MATCH (n)"); if (filter.getRelationshipDirection() == Direction.INCOMING) { clause.append("<"); } clause.append(String.format("-[%s:`%s`]-", relationshipIdentifier(), this.relationshipType)); if (filter.getRelationshipDirection() == Direction.OUTGOING) { clause.append(">"); } clause.append(String.format("(%s) ", nodeIdentifier())); } clause.append(filter.toCypher(relationshipIdentifier(), clause.indexOf(" WHERE ") == -1)); return this; }
Source:
public static AdjustableSweepBatchConfigSource create( MetricsManager metricsManager, Supplier<SweepBatchConfig> rawSweepBatchConfig) { AdjustableSweepBatchConfigSource configSource = new AdjustableSweepBatchConfigSource(rawSweepBatchConfig); Gauge<Double> gauge = AdjustableSweepBatchConfigSource::getBatchSizeMultiplier; metricsManager.addMetricFilter(AdjustableSweepBatchConfigSource.class, "batchSizeMultiplier", ImmutableMap.of(), () -> gauge.getValue() != 1.0); metricsManager.registerMetric(AdjustableSweepBatchConfigSource.class, "batchSizeMultiplier", gauge); return configSource; }

Target:
public static AdjustableSweepBatchConfigSource create( MetricsManager metricsManager, Supplier<SweepBatchConfig> rawSweepBatchConfig) { AdjustableSweepBatchConfigSource configSource = new AdjustableSweepBatchConfigSource(rawSweepBatchConfig); Gauge<Double> gauge = AdjustableSweepBatchConfigSource::getBatchSizeMultiplier; metricsManager.addMetricFilter(AdjustableSweepBatchConfigSource.class, "batchSizeMultiplier", ImmutableMap.of(), () -> gauge.getValue() < 1.0); metricsManager.registerMetric(AdjustableSweepBatchConfigSource.class, "batchSizeMultiplier", gauge); return configSource; }
Source:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, "druid.metadata.storage.tables", MetadataStorageTablesConfig.class); JsonConfigProvider.bind(binder, "druid.metadata.storage.connector", MetadataStorageConnectorConfig.class); JsonConfigProvider.bind(binder, "druid.manager.segments", MetadataSegmentManagerConfig.class); JsonConfigProvider.bind(binder, "druid.manager.rules", MetadataRuleManagerConfig.class); binder.bind(PasswordProvider.class).toProvider( new Provider<PasswordProvider>() { @Inject MetadataStorageConnectorConfig metadataStorageConnectorConfig; @Inject Injector injector; @Override public PasswordProvider get() { final PasswordProvider passwordProvider; if (metadataStorageConnectorConfig == null || metadataStorageConnectorConfig.getPasswordProvider() == null) { JsonConfigProvider<PasswordProvider> provider = JsonConfigProvider.of("druid.password", PasswordProvider.class); provider.inject(injector.getInstance(Properties.class), injector.getInstance(JsonConfigurator.class)); passwordProvider = provider.get().get(); } else { passwordProvider = metadataStorageConnectorConfig.getPasswordProvider(); } injector.injectMembers(passwordProvider); return passwordProvider; } } ); }

Target:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, "druid.metadata.storage.tables", MetadataStorageTablesConfig.class); JsonConfigProvider.bind(binder, "druid.metadata.storage.connector", MetadataStorageConnectorConfig.class); JsonConfigProvider.bind(binder, "druid.manager.segments", MetadataSegmentManagerConfig.class); JsonConfigProvider.bind(binder, "druid.manager.rules", MetadataRuleManagerConfig.class); }
Source:
public void testMigrationTask() throws InterruptedException { MigrationTask migrationTask = new MigrationTask(project); migrationTask.start(); Assert.assertTrue(migrationTask.isAlive()); migrationTask.join(); Assert.assertFalse(migrationTask.isAlive()); Assert.assertEquals(100, migrationTask.getProgress()); }

Target:
public void testMigrationTask() throws Exception { MigrationTask migrationTask = new MigrationTask(project); Field dataEditorServiceField = ServiceManager.class.getDeclaredField("dataEditorService"); dataEditorServiceField.setAccessible(true); Assert.assertTrue(Objects.isNull(dataEditorServiceField.get(null))); migrationTask.start(); Assert.assertTrue(migrationTask.isAlive()); migrationTask.join(); Assert.assertTrue(Objects.nonNull(dataEditorServiceField.get(null))); Assert.assertFalse(migrationTask.isAlive()); Assert.assertEquals(100, migrationTask.getProgress()); Assert.assertNotNull("Process migration failed", metsService.loadWorkpiece(processService.getMetadataFileUri(processService.getById(2)))); }
Source:
protected Object toNSCollection(ERXRestFormat.Delegate delegate, NSMutableDictionary<Object, Object> associatedObjects) { Object result = associatedObjects.get(_associatedObject); if (result == null) { if (delegate != null) { delegate.nodeWillWrite(this); } if (isArray()) { NSMutableArray<Object> array = new NSMutableArray<Object>(); for (ERXRestRequestNode child : _children) { array.add(child.toNSCollection(delegate, associatedObjects)); } result = array; } else if (isNull()) { result = NSKeyValueCoding.NullValue; } else if (_value != null) { result = _value; } else { NSMutableDictionary<Object, Object> dict = new NSMutableDictionary<Object, Object>(); for (Map.Entry<String, Object> attribute : _attributes.entrySet()) { String key = attribute.getKey(); Object value = attribute.getValue(); if (value == null) { value = NSKeyValueCoding.NullValue; } dict.put(key, value); } for (ERXRestRequestNode child : _children) { String name = child.name(); Object value = child.toNSCollection(delegate, associatedObjects); if (value != NSKeyValueCoding.NullValue || ERXProperties.booleanForKeyWithDefault("ERXRest.includeNullValues", true) == true) { dict.put(name, value); } } if (dict.isEmpty()) { result = NSKeyValueCoding.NullValue; } else { result = dict; } } if (_associatedObject != null) { associatedObjects.put(_associatedObject, result); } } return result; }

Target:
protected Object toNSCollection(ERXRestFormat.Delegate delegate, NSMutableDictionary<Object, Object> associatedObjects) { Object result = associatedObjects.get(_associatedObject); if (result == null) { if (delegate != null) { delegate.nodeWillWrite(this); } if (isArray()) { NSMutableArray<Object> array = new NSMutableArray<Object>(); for (ERXRestRequestNode child : _children) { array.add(child.toNSCollection(delegate, associatedObjects)); } result = array; } else if (isNull()) { result = NSKeyValueCoding.NullValue; } else if (_value != null) { result = _value; } else { NSMutableDictionary<Object, Object> dict = new NSMutableDictionary<Object, Object>(); for (Map.Entry<String, Object> attribute : _attributes.entrySet()) { String key = attribute.getKey(); Object value = attribute.getValue(); if (value == null) { value = NSKeyValueCoding.NullValue; } dict.put(key, value); } for (ERXRestRequestNode child : _children) { String name = child.name(); Object value = child.toNSCollection(delegate, associatedObjects); if (value != NSKeyValueCoding.NullValue || ERXProperties.booleanForKeyWithDefault("ERXRest.includeNullValues", true)) { dict.put(name, value); } } if (dict.isEmpty()) { result = NSKeyValueCoding.NullValue; } else { result = dict; } } if (_associatedObject != null) { associatedObjects.put(_associatedObject, result); } } return result; }
Source:
public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); noNullElements(Arrays.stream(userRoles).map(Role::getUri).collect(Collectors.toList()), "userRoles.uri"); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); }

Target:
public User addUserToProject(final Project project, final Account account, final Role... userRoles) { notNull(project, "project"); notNull(account, "account"); notEmpty(account.getUri(), "account.uri"); notNull(userRoles, "userRoles"); validateRoleURIs(userRoles); notEmpty(project.getId(), "project.id"); final User user = new User(account, userRoles); doPostProjectUsersUpdate(project, user); return getUser(project, account); }
Source:
public void testDeadlock() throws Exception { doTest(1000 * 30); boolean interrupted = Thread.interrupted(); if (interrupted) { fail("Thread was interrupted at end of test"); } }

Target:
public void testDeadlock() throws Exception { doTest(1000 * 30); if (Thread.interrupted()) { fail("Thread was interrupted at end of test"); } }
Source:
public void makeSortable() { final Map<ImageResource, Integer> imageWeightMap = new HashMap<ImageResource, Integer>(); imageWeightMap.put(statusCell.upImage, 0); imageWeightMap.put(statusCell.volumeSomeBricksDownImage, 1); imageWeightMap.put(statusCell.allBricksDownImage, 2); imageWeightMap.put(statusCell.downImage, 3); makeSortable(new Comparator<GlusterVolumeEntity>() { private final CustomStatusImageComaparator imageComparator = new CustomStatusImageComaparator(imageWeightMap); @Override public int compare(GlusterVolumeEntity o1, GlusterVolumeEntity o2) { return imageComparator.compare(statusCell.getStatusImage(statusCell.getVolumeStatus(o1)), statusCell.getStatusImage(statusCell.getVolumeStatus(o2))); } }); }

Target:
public void makeSortable() { makeSortable(new Comparator<GlusterVolumeEntity>() { private final CustomStatusImageComaparator imageComparator = new CustomStatusImageComaparator(); @Override public int compare(GlusterVolumeEntity o1, GlusterVolumeEntity o2) { return imageComparator.compare(VolumeStatusCell.getVolumeStatus(o1), VolumeStatusCell.getVolumeStatus(o2)); } }); }
Source:
public GoldenEgg(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); this.subtype.add(SubType.FOOD); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); Ability ability = new AnyColorManaAbility(new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new ManaCostsImpl("{1}")); ability1.addCost(new TapSourceCost()); ability1.addCost(new SacrificeSourceCost()); this.addAbility(ability1); }

Target:
public GoldenEgg(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); this.subtype.add(SubType.FOOD); this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); Ability ability = new AnyColorManaAbility(new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new ManaCostsImpl("{2}")); ability1.addCost(new TapSourceCost()); ability1.addCost(new SacrificeSourceCost()); this.addAbility(ability1); }
Source:
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { writer.keyword("CREATE"); if (isTemporary()) { writer.keyword("TEMPORARY"); } if (getReplace()) { writer.keyword("OR REPLACE"); } writer.keyword("VIEW"); if (isIfNotExists()) { writer.keyword("IF NOT EXISTS"); } viewName.unparse(writer, leftPrec, rightPrec); if (fieldList.size() > 0) { fieldList.unparse(writer, 1, rightPrec); } if (comment != null) { writer.newlineAndIndent(); writer.keyword("COMMENT"); comment.unparse(writer, leftPrec, rightPrec); } writer.newlineAndIndent(); writer.keyword("AS"); writer.newlineAndIndent(); query.unparse(writer, leftPrec, rightPrec); }

Target:
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { writer.keyword("CREATE"); if (isTemporary()) { writer.keyword("TEMPORARY"); } writer.keyword("VIEW"); if (isIfNotExists()) { writer.keyword("IF NOT EXISTS"); } viewName.unparse(writer, leftPrec, rightPrec); if (fieldList.size() > 0) { fieldList.unparse(writer, 1, rightPrec); } if (comment != null) { writer.newlineAndIndent(); writer.keyword("COMMENT"); comment.unparse(writer, leftPrec, rightPrec); } writer.newlineAndIndent(); writer.keyword("AS"); writer.newlineAndIndent(); query.unparse(writer, leftPrec, rightPrec); }
Source:
public void testValidCRAMFileWithoutSeqDict() throws Exception { final SamReader samReader = SamReaderFactory. makeDefault(). validationStringency(ValidationStringency.SILENT). referenceSequence(new File(TEST_DATA_DIR, "nm_tag_validation.fa")). open(new File(TEST_DATA_DIR, "nm_tag_validation.cram")); final ReferenceSequenceFile reference = new FastaSequenceFile(new File(TEST_DATA_DIR, "nm_tag_validation.fa"), true); final Histogram<String> results = executeValidation(samReader, reference, IndexValidationStringency.EXHAUSTIVE); Assert.assertTrue(!results.isEmpty()); }

Target:
public void testValidCRAMFileWithoutSeqDict() throws Exception { final File reference = new File(TEST_DATA_DIR, "nm_tag_validation.fa"); final SamReader samReader = SamReaderFactory .makeDefault() .validationStringency(ValidationStringency.SILENT) .referenceSequence(reference) .open(new File(TEST_DATA_DIR, "nm_tag_validation.cram")); final Histogram<String> results = executeValidation(samReader, new FastaSequenceFile(reference, true), IndexValidationStringency.EXHAUSTIVE); Assert.assertTrue(!results.isEmpty()); }
Source:
public void cleanup() { if (model != null) { model.cleanup(); model = null; } if (modelItems != null) { for (T model: modelItems) { if (model instanceof HasCleanup) { ((HasCleanup)model).cleanup(); } } } for (Pair<T, V> item : items) { T value = item.getFirst(); if (!isGhost(value)) { if (item instanceof HasCleanup) { ((HasCleanup)value).cleanup(); } } } cleanContentPanel(); }

Target:
public void cleanup() { if (model != null) { model.cleanup(); model = null; } cleanupModelItems(); for (Pair<T, V> item : items) { T value = item.getFirst(); if (!isGhost(value)) { if (item instanceof HasCleanup) { ((HasCleanup)value).cleanup(); } } } cleanContentPanel(); }
Source:
public String get(String name) { return (isSet(name)) ? myRecord.get(name) : new String(); }

Target:
public String get(String name) { return (isSet(name)) ? myRecord.get(name) : ""; }
Source:
private void updateMutePreviewOverlayVisibility() { mutePreviewOverlay.setVisibility( showMuteOverlayOnVideoCall() && muteButton.isChecked() && !isInGreenScreenMode ? View.VISIBLE : View.GONE); }

Target:
private void updateMutePreviewOverlayVisibility() { int mutePreviewOverlayVisibility = showMuteOverlayOnVideoCall() && muteButton.isChecked() && !isInGreenScreenMode ? View.VISIBLE : View.GONE; mutePreviewOverlay.setVisibility(mutePreviewOverlayVisibility); }
Source:
public void resetAllResponses() { for (FeedbackQuestionAttributes question : questionResponseBundle.keySet()) { questionResponseBundle.putIfAbsent(question, new ArrayList<>()); } }

Target:
public void resetAllResponses() { for (FeedbackQuestionAttributes question : questionResponseBundle.keySet()) { questionResponseBundle.put(question, new ArrayList<FeedbackResponseAttributes>()); } }
Source:
protected URLConnection getExternalGraphic(AjaxRequestTarget target, Form<?> form) { onlineResource.processInput(); if (onlineResource.getModelObject() != null) { URL url = null; try { String baseUrl = baseURL(form); String external = onlineResource.getModelObject().toString(); URI uri = new URI( external ); if( uri.isAbsolute() ){ url = uri.toURL(); if( !external.startsWith(baseUrl)){ form.warn( "Recommend use of styles directory at "+baseUrl); } } else { url = new URL( baseUrl + "styles/"+external ); } URLConnection conn = url.openConnection(); if("text/html".equals(conn.getContentType())){ form.error("Unable to access url"); return null; } return conn; } catch (FileNotFoundException notFound ){ form.error( "Unable to access "+url); } catch (Exception e) { e.printStackTrace(); form.error( "Recommend use of styles directory at "+e); } } return null; }

Target:
protected URLConnection getExternalGraphic(AjaxRequestTarget target, Form<?> form) { onlineResource.processInput(); if (onlineResource.getModelObject() != null) { URL url = null; try { String baseUrl = baseURL(form); String external = onlineResource.getModelObject().toString(); URI uri = new URI( external ); if( uri.isAbsolute() ){ url = uri.toURL(); if( !external.startsWith(baseUrl)){ form.warn( "Recommend use of styles directory at "+baseUrl); } } else { WorkspaceInfo wsInfo = ((StyleInfo)getDefaultModelObject()).getWorkspace(); if (wsInfo != null) { url = new URL( baseUrl + "styles/"+wsInfo.getName()+"/"+external ); } else { url = new URL( baseUrl + "styles/"+external ); } } URLConnection conn = url.openConnection(); if("text/html".equals(conn.getContentType())){ form.error("Unable to access url"); return null; } return conn; } catch (FileNotFoundException notFound ){ form.error( "Unable to access "+url); } catch (Exception e) { e.printStackTrace(); form.error( "Recommend use of styles directory at "+e); } } return null; }
Source:
private void loadButtonAction(ActionEvent e) { progressDialog = new ProgressDialog(list.getParent()); if (dbpath == SELECT_OPTION) { File dir = selectDirectory(); if (dir == null) { return; } } dbload.restart(); }

Target:
private void loadButtonAction(ActionEvent e) { loadDB(); }
Source:
public Single<String> getP18ForItem(String entityId) { return depictsInterface.getLabelForEntity(entityId) .map(response -> { String name; try { JsonObject claims = response.getAsJsonObject("claims").getAsJsonObject(); JsonObject P18 = claims.get("P18").getAsJsonArray().get(0).getAsJsonObject(); JsonObject mainsnak = P18.get("mainsnak").getAsJsonObject(); JsonObject datavalue = mainsnak.get("datavalue").getAsJsonObject(); JsonPrimitive value = datavalue.get("value").getAsJsonPrimitive(); name = value.toString(); name = name.substring(1, name.length() - 1); } catch (Exception e) { name=""; } if (!name.isEmpty()){ return getImageUrl(name); } else return "No Image for Depiction"; }) .singleOrError(); }

Target:
public Single<String> getP18ForItem(String entityId) { return depictsInterface.getImageForEntity(entityId) .map(commonsFilename -> { String name; try { JsonObject claims = commonsFilename.getAsJsonObject("claims").getAsJsonObject(); JsonObject p18 = claims.get("P18").getAsJsonArray().get(0).getAsJsonObject(); JsonObject mainsnak = p18.get("mainsnak").getAsJsonObject(); JsonObject datavalue = mainsnak.get("datavalue").getAsJsonObject(); JsonPrimitive value = datavalue.get("value").getAsJsonPrimitive(); name = value.toString(); name = name.substring(1, name.length() - 1); } catch (Exception e) { name=""; } if (!name.isEmpty()){ return getThumbnailUrl(name); } else return NO_DEPICTED_IMAGE; }) .singleOrError(); }
Source:
public String getServerState() { this.officeServer.refreshState(); return contextualLocalizationManager.getTranslationPlain( TRANSLATION_KEY_SERVER_STATE_PREFIX + this.officeServer.getState().name().toLowerCase()); }

Target:
public String getServerState() { this.officeServer.refreshState(); String normalizedStatusKey = CaseUtils.toCamelCase(this.officeServer.getState().name().toLowerCase(), false, '_'); return this.contextualLocalizationManager .getTranslationPlain(TRANSLATION_KEY_SERVER_STATE_PREFIX + normalizedStatusKey); }
Source:
public void visitToken(DetailAST token) { switch (token.getType()) { case TokenTypes.INTERFACE_DEF: checkServiceInterface(token); break; default: break; } }

Target:
public void visitToken(DetailAST token) { if (token.getType() == TokenTypes.INTERFACE_DEF) { checkServiceInterface(token); } }
Source:
public DeCoupleMBusDeviceCommandExecutor() { super(MbusChannelElementsDto.class); }

Target:
public DeCoupleMBusDeviceCommandExecutor() { super(DeCoupleMbusDeviceDto.class); }
Source:
public ServerWebSocketInitializer(final ServerInfo serverInfo) { LOG.info("Currently time out time is not used " + serverInfo.getTimeOut()); this.serverInfo = serverInfo; connectionServer = createServerSocket(); manager = createConnectionManager(getServerInfo()); }

Target:
public ServerWebSocketInitializer(final ServerInfo serverInfo) { LOG.info("Currently time out time is not used: " + serverInfo.getTimeOut()); this.serverInfo = serverInfo; connectionServer = createServerSocket(); manager = createConnectionManager(getServerInfo()); }
Source:
public ArrayList<OncoTreeNode> getOncoTree(Version version) throws TopBraidException { ArrayList<OncoTreeNode> list = new ArrayList<OncoTreeNode>(super.query(String.format(query, version.getGraphURI()), new ParameterizedTypeReference<List<OncoTreeNode>>(){})); return list; }

Target:
public ArrayList<OncoTreeNode> getOncoTree(Version version) throws TopBraidException { return new ArrayList<OncoTreeNode>(super.query(String.format(query, version.getGraphURI()), new ParameterizedTypeReference<List<OncoTreeNode>>(){})); }
Source:
public void doSample() { sendData(pm.isScreenOn()?"on":"off"); }

Target:
public void doSample() { boolean isScreenActive; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { isScreenActive = pm.isInteractive(); } else { isScreenActive = pm.isScreenOn(); } sendData(isScreenActive?"on":"off"); }
Source:
public Configuration setDefaults(Configuration defaults) { this.defaults = defaults; return this; }

Target:
public Configuration setDefaults(Configuration defaults) { if ( defaults == this ) { throw new IllegalArgumentException( "Can't set self as defaults" ); } this.defaults = defaults; return this; }
Source:
public void refreshMetadata(String username) { if (mNosaraClient == null) { return; } if (!TextUtils.isEmpty(username)) { mUserName = username; if (getAnonID() != null) { mNosaraClient.trackAliasUser(mUserName, getAnonID()); clearAnonID(); } } else { mUserName = null; if (getAnonID() == null) { generateNewAnonID(); } } }

Target:
public void refreshMetadata(String username) { if (mNosaraClient == null) { return; } if (!TextUtils.isEmpty(username)) { mUserName = username; if (getAnonID() != null) { mNosaraClient.trackAliasUser(mUserName, getAnonID(), TracksClient.NosaraUserType.SIMPLENOTE); clearAnonID(); } } else { mUserName = null; if (getAnonID() == null) { generateNewAnonID(); } } }
Source:
private void removeHiddenInstructors(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responses, Map<String, String> recipients, Set<String> hiddenInstructorEmails) { boolean noChangeRequired = hiddenInstructorEmails == null || hiddenInstructorEmails.isEmpty() || question.getRecipientType() != FeedbackParticipantType.INSTRUCTORS; if (noChangeRequired) { return; } for (String instructorEmail : hiddenInstructorEmails) { if (recipients.containsKey(instructorEmail)) { recipients.remove(instructorEmail); } Iterator<FeedbackResponseAttributes> iterResponse = responses.iterator(); while (iterResponse.hasNext()) { FeedbackResponseAttributes response = iterResponse.next(); if (response.recipientEmail.equals(instructorEmail)) { iterResponse.remove(); } } } }

Target:
private void removeHiddenInstructors(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responses, Map<String, String> recipients, Set<String> hiddenInstructorEmails) { boolean isNoChangeRequired = hiddenInstructorEmails == null || hiddenInstructorEmails.isEmpty() || question.getRecipientType() != FeedbackParticipantType.INSTRUCTORS; if (isNoChangeRequired) { return; } for (String instructorEmail : hiddenInstructorEmails) { if (recipients.containsKey(instructorEmail)) { recipients.remove(instructorEmail); } Iterator<FeedbackResponseAttributes> iterResponse = responses.iterator(); while (iterResponse.hasNext()) { FeedbackResponseAttributes response = iterResponse.next(); if (response.recipientEmail.equals(instructorEmail)) { iterResponse.remove(); } } } }
Source:
private void cancelUpload(int localMediaId) { if (mCurrentUpload != null && mCurrentUpload.getId() == localMediaId) { cancelCurrentUpload(); } for(Iterator<MediaModel> i = mQueue.iterator(); i.hasNext();) { MediaModel mediaModel = i.next(); if (mediaModel.getId() == localMediaId) { i.remove(); } } }

Target:
private void cancelUpload(int localMediaId) { if (mCurrentUpload != null && mCurrentUpload.getId() == localMediaId) { cancelCurrentUpload(); } for(Iterator<MediaModel> i = mUploadQueue.iterator(); i.hasNext();) { MediaModel mediaModel = i.next(); if (mediaModel.getId() == localMediaId) { i.remove(); } } }
Source:
MergingUpdater(AbstractTripleStore database) { this.database = database; String property = System.getProperty("outputDumps"); outputDumps = Boolean.TRUE.toString().equals(property); id = UUID.randomUUID().toString().replaceAll("-", ""); }

Target:
MergingUpdater(AbstractTripleStore database) { this(database, false); }
Source:
protected org.spine3.server.storage.EventStorage createStorage(StorageFactory factory) { final RecordStorage<EventId> recordStorage = super.createStorage(factory); final org.spine3.server.storage.EventStorage storage = factory.createEventStorage(recordStorage); return storage; }

Target:
protected EventRecordStorage createStorage(StorageFactory factory) { final RecordStorage<EventId> recordStorage = super.createStorage(factory); final EventRecordStorage storage = factory.createEventStorage(recordStorage); return storage; }
Source:
public int getLength() { Widget widget = getWidget(); int childCount = 0; if (widget instanceof Composite) { childCount = ((Composite) widget).getChildren().length; if (widget instanceof CTabFolder) { for (CTabItem tabItem : ((CTabFolder) widget).getItems()) { if (tabItem.isDisposed()) { System.err.println("CTabItem was disposed"); break; } else { childCount++; } } } } return childCount; }

Target:
public int getLength() { Widget widget = getWidget(); int childCount = 0; if (widget instanceof Composite) { childCount = ((Composite) widget).getChildren().length; if (widget instanceof CTabFolder) { for (CTabItem tabItem : ((CTabFolder) widget).getItems()) { if (tabItem.isDisposed()) { break; } else { childCount++; } } } } return childCount; }
Source:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations( org.ovirt.engine.core.common.businessentities.VM entity, VmStatistics statistics, int index) { expect(entity.getId()).andReturn(GUIDS[index]).anyTimes(); expect(entity.getvds_group_id()).andReturn(GUIDS[2]).anyTimes(); expect(entity.getvm_name()).andReturn(NAMES[index]).anyTimes(); expect(entity.getvm_description()).andReturn(DESCRIPTIONS[index]).anyTimes(); expect(entity.getnum_of_cpus()).andReturn(8).anyTimes(); expect(entity.getnum_of_sockets()).andReturn(2).anyTimes(); expect(entity.getusage_mem_percent()).andReturn(Integer.valueOf(20)).anyTimes(); expect(entity.getdisplay_type()).andReturn(DisplayType.vnc).anyTimes(); expect(entity.getdisplay_secure_port()).andReturn(5900).anyTimes(); expect(entity.getnum_of_monitors()).andReturn(2).anyTimes(); expect(entity.getvm_type()).andReturn(VmType.Server).anyTimes(); expect(entity.getrun_on_vds_name()).andReturn(NAMES[NAMES.length - 1]).anyTimes(); Map<String, DiskImage> diskImageMap = new HashMap<String, DiskImage>(); diskImageMap.put("1", new DiskImage()); expect(entity.getDiskMap()).andReturn(diskImageMap).anyTimes(); VmStatic vmStatic = new VmStatic(); vmStatic.setId(GUIDS[index]); vmStatic.setvm_name(NAMES[index]); expect(entity.getStaticData()).andReturn(vmStatic).anyTimes(); setUpStatisticalEntityExpectations(entity, statistics); return entity; }

Target:
static org.ovirt.engine.core.common.businessentities.VM setUpEntityExpectations( org.ovirt.engine.core.common.businessentities.VM entity, VmStatistics statistics, int index) { expect(entity.getId()).andReturn(GUIDS[index]).anyTimes(); expect(entity.getvds_group_id()).andReturn(GUIDS[2]).anyTimes(); expect(entity.getvm_name()).andReturn(NAMES[index]).anyTimes(); expect(entity.getvm_description()).andReturn(DESCRIPTIONS[index]).anyTimes(); expect(entity.getnum_of_cpus()).andReturn(8).anyTimes(); expect(entity.getnum_of_sockets()).andReturn(2).anyTimes(); expect(entity.getusage_mem_percent()).andReturn(Integer.valueOf(20)).anyTimes(); expect(entity.getdisplay_type()).andReturn(DisplayType.vnc).anyTimes(); expect(entity.getdisplay_secure_port()).andReturn(5900).anyTimes(); expect(entity.getnum_of_monitors()).andReturn(2).anyTimes(); expect(entity.getvm_type()).andReturn(VmType.Server).anyTimes(); expect(entity.getrun_on_vds_name()).andReturn(NAMES[NAMES.length - 1]).anyTimes(); setUpStatisticalEntityExpectations(entity, statistics); return entity; }
Source:
public List<String> getDirectory() throws OwException { List<String> directory = new ArrayList<String>(); OwserverPacket requestPacket = new OwserverPacket(OwserverMessageType.DIR, "/"); write(requestPacket); OwserverPacket returnPacket = null; do { try { returnPacket = read(false); } catch (OwException e) { logger.info("getDirectory may have returned incomplete result: {}", e.getMessage()); closeOnError(); return directory; } if (returnPacket.hasPayload()) { directory.add(returnPacket.getPayloadString()); } } while ((returnPacket.isPingPacket() || returnPacket.hasPayload())); if (!returnPacket.hasControlFlag(OwserverControlFlag.PERSISTENCE)) { logger.trace("closing connection because persistence was denied"); close(); } connectionErrorCounter = 0; return directory; }

Target:
public List<String> getDirectory() throws OwException { List<String> directory = new ArrayList<String>(); OwserverPacket requestPacket = new OwserverPacket(OwserverMessageType.DIR, "/"); write(requestPacket); OwserverPacket returnPacket = null; do { try { returnPacket = read(false); } catch (OwException e) { logger.debug("getDirectory may have returned incomplete result: {}", e.getMessage()); closeOnError(); return directory; } if (returnPacket.hasPayload()) { directory.add(returnPacket.getPayloadString()); } } while ((returnPacket.isPingPacket() || returnPacket.hasPayload())); if (!returnPacket.hasControlFlag(OwserverControlFlag.PERSISTENCE)) { logger.trace("closing connection because persistence was denied"); close(); } connectionErrorCounter = 0; return directory; }
Source:
public void start() throws Exception { synchronized (lock) { if (childrenCache != null) { return; } childrenCache = cacheFactory.make(curatorFramework, config.getContainerPath()); } ContainerCacheListener containerCacheListener = new ContainerCacheListener(); childrenCache.getListenable().addListener(containerCacheListener); try { childrenCache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); } catch (Exception e) { synchronized (lock) { try { stop(); } catch (IOException e1) { log.error(e1, "Exception when stopping InventoryManager that couldn't start."); } } throw e; } while (!containerCacheListener.doneInitializing) { Thread.sleep(2000); log.info("Waiting for PathChildrenCache to be completely loaded."); } }

Target:
public void start() throws Exception { synchronized (lock) { if (childrenCache != null) { return; } childrenCache = cacheFactory.make(curatorFramework, config.getContainerPath()); } ContainerCacheListener containerCacheListener = new ContainerCacheListener(); childrenCache.getListenable().addListener(containerCacheListener); try { childrenCache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); } catch (Exception e) { synchronized (lock) { try { stop(); } catch (IOException e1) { log.error(e1, "Exception when stopping InventoryManager that couldn't start."); } } throw e; } while (!latch.await(1, TimeUnit.MINUTES)) { log.info("Waiting for PathChildrenCache to be completely loaded."); } log.info("PathChildrenCache has been loaded."); }
Source:
public void testDoubletonFlatbush() { List<Rectangle> items = new ArrayList<>(); Rectangle rect0 = new Rectangle(1, 1, 1, 1); items.add(rect0); Rectangle rect1 = new Rectangle(-1, -2, -1, -1); items.add(rect1); items.sort(RECTANGLE_COMPARATOR); Flatbush<Rectangle> rtree = new Flatbush<>(items.toArray(new Rectangle[] {})); List<Rectangle> allResults = findIntersections(rtree, EVERYTHING); allResults.sort(RECTANGLE_COMPARATOR); assertEquals(allResults, items); Rectangle hit0 = new Rectangle(1, 1, 2, 2); assertEquals(findIntersections(rtree, hit0), ImmutableList.of(rect0)); Rectangle hit1 = new Rectangle(-2, -2, -1, -2); assertEquals(findIntersections(rtree, hit1), ImmutableList.of(rect1)); Rectangle totalMiss = new Rectangle(10, 10, 12, 12); assertEquals(findIntersections(rtree, totalMiss), ImmutableList.of()); Rectangle marginalMiss = new Rectangle(0, 0, 0, 0); assertEquals(findIntersections(rtree, marginalMiss), ImmutableList.of()); }

Target:
public void testDoubletonFlatbush() { Rectangle rect0 = new Rectangle(1, 1, 1, 1); Rectangle rect1 = new Rectangle(-1, -2, -1, -1); List<Rectangle> items = ImmutableList.of(rect0, rect1); Flatbush<Rectangle> rtree = new Flatbush<>(items.toArray(new Rectangle[] {})); List<Rectangle> allResults = findIntersections(rtree, EVERYTHING); assertEqualsSorted(allResults, items, RECTANGLE_COMPARATOR); assertEquals(findIntersections(rtree, new Rectangle(1, 1, 2, 2)), ImmutableList.of(rect0)); assertEquals(findIntersections(rtree, new Rectangle(-2, -2, -1, -2)), ImmutableList.of(rect1)); assertEquals(findIntersections(rtree, new Rectangle(10, 10, 12, 12)), ImmutableList.of()); assertEquals(findIntersections(rtree, new Rectangle(0, 0, 0, 0)), ImmutableList.of()); }
Source:
public void onDeniedPendingLockNotification() { synchronized (ZKDistributedNonblockingLock.this) { _isLocked = false; _isPreempted = true; _isPending = false; ZKDistributedNonblockingLock.this.notify(); } }

Target:
public void onDeniedPendingLockNotification() { _lockStatus = LockConstants.LockStatus.PREEMPTED; _countDownLatch.countDown(); }
Source:
public void generateExperimentalCoordinates(Vector2d firstBondVector) throws CDKException { IMolecule original = molecule; IMolecule shallowCopy = molecule.getBuilder().newInstance(IMolecule.class,molecule); for (IAtom curAtom : shallowCopy.atoms()) { if (curAtom.getSymbol().equals("H")) { int bondsFromCurAtom=0; for (IBond bond : shallowCopy.bonds()) if(bond.contains (curAtom)) ++bondsFromCurAtom; if (bondsFromCurAtom < 2) { shallowCopy.removeAtomAndConnectedElectronContainers(curAtom); curAtom.setPoint2d(null); } } } molecule = shallowCopy; generateCoordinates(firstBondVector); double bondLength = GeometryTools.getBondLengthAverage(molecule); HydrogenPlacer hPlacer = new HydrogenPlacer(); molecule = original; hPlacer.placeHydrogens2D(molecule, bondLength); }

Target:
public void generateExperimentalCoordinates(Vector2d firstBondVector) throws CDKException { IMolecule original = molecule; IMolecule shallowCopy = molecule.getBuilder().newInstance(IMolecule.class,molecule); Map<IAtom,Integer> single_h = new HashMap<IAtom,Integer>(); for (IBond curBond : shallowCopy.bonds()) { boolean first = curBond.getAtom(0).getSymbol().equals("H"); boolean second = curBond.getAtom(1).getSymbol().equals("H"); if (first && !second) single_h.put(curBond.getAtom(0), 0); if (!first && second) single_h.put(curBond.getAtom(1), 0); } for (IAtom curAtom : single_h.keySet()) { if (shallowCopy.getConnectedBondsCount(curAtom) == 1) { shallowCopy.removeAtomAndConnectedElectronContainers(curAtom); } } molecule = shallowCopy; generateCoordinates(firstBondVector); double bondLength = GeometryTools.getBondLengthAverage(molecule); HydrogenPlacer hPlacer = new HydrogenPlacer(); molecule = original; hPlacer.placeHydrogens2D(molecule, bondLength); }
Source:
public void visitNode(Tree tree) { if (tree.is(Kind.METHOD) && isServletInit((MethodTree) tree)) { tree.accept(new AssignmentVisitor()); } else if (tree.is(Kind.VARIABLE)) { VariableTree variable = (VariableTree) tree; if (hasSemantic() && isOwnedByAServlet(variable) && !isStaticOrFinal(variable)) { issuableVariables.add(variable); } } }

Target:
public void visitNode(Tree tree) { if (tree.is(Kind.METHOD) && isServletInit((MethodTree) tree)) { tree.accept(new AssignmentVisitor()); } else if (tree.is(Kind.VARIABLE)) { VariableTree variable = (VariableTree) tree; if (isOwnedByAServlet(variable) && !isStaticOrFinal(variable)) { issuableVariables.add(variable); } } }