auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean spawnEntityOrCapture(G context, Entity entity, int chunkX, int chunkZ) { final ArrayList<Entity> entities = new ArrayList<>(1); entities.add(entity); try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { frame.addContext(EventContextKeys.SPAWN_TYPE, SpawnTypes.WORLD_SPAWNER); final SpawnEntityEvent event = SpongeEventFactory.createSpawnEntityEventSpawner(Sponge.getCauseStackManager().getCurrentCause(), entities); SpongeImpl.postEvent(event); if (!event.isCancelled() && event.getEntities().size() > 0) { for (Entity item : event.getEntities()) { ((IMixinWorldServer) item.getWorld()).forceSpawnEntity(item); } return true; } return false; } }

Target:
public boolean spawnEntityOrCapture(G context, Entity entity, int chunkX, int chunkZ) { final ArrayList<Entity> entities = new ArrayList<>(1); entities.add(entity); try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { frame.pushCause(entity.getLocation().getExtent()); frame.addContext(EventContextKeys.SPAWN_TYPE, SpawnTypes.WORLD_SPAWNER); final SpawnEntityEvent event = SpongeEventFactory.createSpawnEntityEventSpawner(frame.getCurrentCause(), entities); SpongeImpl.postEvent(event); if (!event.isCancelled() && event.getEntities().size() > 0) { for (Entity item : event.getEntities()) { ((IMixinWorldServer) item.getWorld()).forceSpawnEntity(item); } return true; } return false; } }
Source:
private boolean isTaskPending(Task task) { for (TaskRunnerWorkItem workItem : taskRunner.getPendingTasks()) { if (workItem.getTaskId().equals(task.getId())) { return true; } } return false; }

Target:
private boolean isTaskPending(Task task) { return taskRunner.getPendingTasks() .stream() .anyMatch(workItem -> workItem.getTaskId().equals(task.getId())); }
Source:
public Group createGroup(PerunSession sess, Vo vo, Group group) throws GroupExistsException, InternalErrorException { group = getGroupsManagerImpl().createGroup(sess, vo, group); getPerunBl().getAuditer().log(sess, "{} created in {}.", group, vo); group.setVoId(vo.getId()); try { User user = perunBl.getUsersManagerBl().getUserById(sess, group.getCreatedByUid()); if(!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo)) { AuthzResolver.setRole(sess, user, group, Role.GROUPADMIN); } } catch (UserNotExistsException e) { throw new InternalErrorException("Inconsistency error: User (group creator) does not exist."); } catch (AlreadyAdminException e) { throw new InternalErrorException("Inconsistency error: User is already group admin."); } catch (PrivilegeException e) { throw new InternalErrorException("Insufficient privilege."); } return group; }

Target:
public Group createGroup(PerunSession sess, Vo vo, Group group) throws GroupExistsException, InternalErrorException { group = getGroupsManagerImpl().createGroup(sess, vo, group); getPerunBl().getAuditer().log(sess, "{} created in {}.", group, vo); group.setVoId(vo.getId()); try { User user = sess.getPerunPrincipal().getUser(); if(!AuthzResolverBlImpl.isAuthorized(sess, Role.VOADMIN, vo)) { AuthzResolverBlImpl.setRole(sess, user, group, Role.GROUPADMIN); } } catch (AlreadyAdminException e) { throw new InternalErrorException("Inconsistency error: User is already group admin."); } return group; }
Source:
public void testInnerListChildrenDirectoryNpe() throws Exception { DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore(); Path p = mock(Path.class); List<PathMetadata> metas = mock(List.class); when(metas.isEmpty()).thenReturn(false); DDBPathMetadata dirPathMeta = null; assertEquals(null, ddbms.getDirListingMetadataFromDirMetaAndList(p, metas, dirPathMeta)); }

Target:
public void testInnerListChildrenDirectoryNpe() throws Exception { DynamoDBMetadataStore ddbms = new DynamoDBMetadataStore(); Path p = mock(Path.class); List<PathMetadata> metas = mock(List.class); when(metas.isEmpty()).thenReturn(false); DDBPathMetadata dirPathMeta = null; assertNull("The return value should be null.", ddbms.getDirListingMetadataFromDirMetaAndList(p, metas, dirPathMeta)); }
Source:
protected void disableAndRemoveECrossReferenceAdapters() { ResourceSet resourceSet = getTransactionalEditingDomain().getResourceSet(); for (Iterator<Adapter> iterator = resourceSet.eAdapters().iterator(); iterator.hasNext(); ) { Adapter next = iterator.next(); if (next instanceof SiriusCrossReferenceAdapter) { ((SiriusCrossReferenceAdapter) next).disableResolveProxy(); } } resourceSet.eAdapters().clear(); for (final DAnalysis analysis : Iterables.filter(allAnalyses(), Predicates.notNull())) { removeAdaptersOnAnalysis(analysis); } }

Target:
protected void disableAndRemoveECrossReferenceAdapters() { ResourceSet resourceSet = getTransactionalEditingDomain().getResourceSet(); for (Iterator<Adapter> iterator = resourceSet.eAdapters().iterator(); iterator.hasNext(); ) { Adapter next = iterator.next(); if (next instanceof SiriusCrossReferenceAdapter) { ((SiriusCrossReferenceAdapter) next).disableResolveProxy(); } } for (final Resource res : getSemanticResources()) { unregisterResourceInCrossReferencer(res); } for (final DAnalysis analysis : Iterables.filter(allAnalyses(), Predicates.notNull())) { removeAdaptersOnAnalysis(analysis); Resource analysisResource = analysis.eResource(); if (analysisResource != null) { unregisterResourceInCrossReferencer(analysisResource); } } Iterable<Resource> resources = Lists.newArrayList(resourceSet.getResources()); for (Resource resource : Iterables.filter(resources, new ResourceFileExtensionPredicate(SiriusUtil.DESCRIPTION_MODEL_EXTENSION, false))) { unregisterResourceInCrossReferencer(resource); } }
Source:
public SimpleObject getAll(RequestContext context) throws ResponseException { SimpleObject rest = new SimpleObject(); try { rest.put("SystemInfo", Context.getAdministrationService().getSystemInformation()); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { return rest; } }

Target:
public SimpleObject getAll(RequestContext context) throws ResponseException { SimpleObject rest = new SimpleObject(); rest.put("systemInfo", Context.getAdministrationService().getSystemInformation()); return rest; }
Source:
public void run() { long lastTimeStamp = 0; while (!closed.get()) { WatchKey key = null; try { key = watcher.take(); } catch (Exception e) { LOG.info("Watcher is either interruped or closed", e); break; } for (WatchEvent<?> event : key.pollEvents()) { WatchEvent.Kind<?> kind = event.kind(); WatchEvent<Path> ev = cast(event); Path dir = (Path) key.watchable(); Path updatedFile = dir.resolve(ev.context()); if (kind == StandardWatchEventKinds.ENTRY_MODIFY || kind == StandardWatchEventKinds.ENTRY_CREATE) { if (updatedFile.toString().equals(fileName)) { final long now = System.currentTimeMillis(); final long interval = Long.getLong("org.opennms.core.fileutils.watcher.interval.seconds", 1); if (now - lastTimeStamp > TimeUnit.SECONDS.toMillis(interval)) { LOG.info(" file got updated, send callback"); callback.reload(); } else { LOG.debug(" callback was not sent as the changes are in within secs interval ", interval); } lastTimeStamp = now; } } if (!key.reset()) { break; } } } }

Target:
public void run() { while (!closed.get()) { WatchKey key = null; try { key = watcher.take(); } catch (Exception e) { LOG.info("Watcher is either interruped or closed", e); break; } for (WatchEvent<?> event : key.pollEvents()) { WatchEvent.Kind<?> kind = event.kind(); WatchEvent<Path> ev = cast(event); Path dir = (Path) key.watchable(); Path updatedFile = dir.resolve(ev.context()); if (kind == StandardWatchEventKinds.ENTRY_MODIFY || kind == StandardWatchEventKinds.ENTRY_CREATE) { if (updatedFile.toString().equals(fileName)) { LOG.info(" file got updated, send callback", updatedFile.getFileName()); callback.reload(); } } if (!key.reset()) { break; } } } }
Source:
public PColumnFamilyImpl(PName name, List<PColumn> columns, List<byte[]> guidePosts) { Preconditions.checkNotNull(name); int guidePostsSize = 0; if(guidePosts != null) { guidePostsSize = guidePosts.size(); } this.guidePosts = guidePosts; long estimatedSize = SizedUtil.OBJECT_SIZE + SizedUtil.POINTER_SIZE * 5 + SizedUtil.INT_SIZE + name.getEstimatedSize() + SizedUtil.sizeOfMap(columns.size()) * 2 + SizedUtil.sizeOfArrayList(columns.size()) + guidePostsSize; this.name = name; this.columns = ImmutableList.copyOf(columns); ImmutableMap.Builder<String, PColumn> columnByStringBuilder = ImmutableMap.builder(); ImmutableSortedMap.Builder<byte[], PColumn> columnByBytesBuilder = ImmutableSortedMap.orderedBy(Bytes.BYTES_COMPARATOR); for (PColumn column : columns) { estimatedSize += column.getEstimatedSize(); columnByBytesBuilder.put(column.getName().getBytes(), column); columnByStringBuilder.put(column.getName().getString(), column); } this.columnByBytes = columnByBytesBuilder.build(); this.columnByString = columnByStringBuilder.build(); this.estimatedSize = (int)estimatedSize; }

Target:
public PColumnFamilyImpl(PName name, List<PColumn> columns, List<byte[]> guidePosts) { Preconditions.checkNotNull(name); int guidePostsSize = 0; if(guidePosts != null) { guidePostsSize = guidePosts.size(); for(byte[] gps : guidePosts) { guidePostsSize += gps.length; } Collections.sort(guidePosts, Bytes.BYTES_COMPARATOR); this.guidePosts = guidePosts; } long estimatedSize = SizedUtil.OBJECT_SIZE + SizedUtil.POINTER_SIZE * 5 + SizedUtil.INT_SIZE + name.getEstimatedSize() + SizedUtil.sizeOfMap(columns.size()) * 2 + SizedUtil.sizeOfArrayList(columns.size()) + SizedUtil.sizeOfArrayList(guidePostsSize); this.name = name; this.columns = ImmutableList.copyOf(columns); ImmutableMap.Builder<String, PColumn> columnByStringBuilder = ImmutableMap.builder(); ImmutableSortedMap.Builder<byte[], PColumn> columnByBytesBuilder = ImmutableSortedMap.orderedBy(Bytes.BYTES_COMPARATOR); for (PColumn column : columns) { estimatedSize += column.getEstimatedSize(); columnByBytesBuilder.put(column.getName().getBytes(), column); columnByStringBuilder.put(column.getName().getString(), column); } this.columnByBytes = columnByBytesBuilder.build(); this.columnByString = columnByStringBuilder.build(); this.estimatedSize = (int)estimatedSize; }
Source:
private boolean isEditAvailable(StorageDomain storageDomain) { if (storageDomain == null || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Locked) { return false; } boolean isEditAvailable; boolean isActive = storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Mixed; boolean isInMaintenance = (storageDomain.getStatus() == StorageDomainStatus.Maintenance || storageDomain.getStatus() == StorageDomainStatus.PreparingForMaintenance); boolean isUnattached = (storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Unattached || storageDomain.getStatus() == StorageDomainStatus.Detaching); boolean isDataISOorExportDomain = storageDomain.getStorageDomainType().isDataDomain() || storageDomain.getStorageDomainType().isIsoOrImportExportDomain(); boolean isBlockStorage = storageDomain.getStorageType().isBlockDomain(); isEditAvailable = isActive || isBlockStorage || ((isInMaintenance || isUnattached) && isDataISOorExportDomain); return isEditAvailable; }

Target:
private boolean isEditAvailable(StorageDomain storageDomain) { if (storageDomain == null || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Locked) { return false; } boolean isEditAvailable; boolean isActive = storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Mixed; boolean isInMaintenance = (storageDomain.getStatus() == StorageDomainStatus.Maintenance || storageDomain.getStatus() == StorageDomainStatus.PreparingForMaintenance); boolean isUnattached = (storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Unattached || storageDomain.getStatus() == StorageDomainStatus.Detaching); boolean isInternalDomain = storageDomain.getStorageDomainType().isInternalDomain(); boolean isBlockStorage = storageDomain.getStorageType().isBlockDomain(); isEditAvailable = isActive || isBlockStorage || ((isInMaintenance || isUnattached) && isInternalDomain); return isEditAvailable; }
Source:
private boolean shouldShowAsyncPromoDialog() { PostStatus status = PostStatus.fromPost(mPost); if (AppPrefs.isAsyncPromoRequired() && userCanPublishPosts() && ((status == PostStatus.DRAFT || status == PostStatus.PUBLISHED) && isNewPost() && mPost.isLocalDraft() || status == PostStatus.UNKNOWN && mPost.isLocalDraft())) { return true; } return false; }

Target:
private boolean shouldShowAsyncPromoDialog() { if (!AppPrefs.isAsyncPromoRequired() || !userCanPublishPosts()) return false; switch (PostStatus.fromPost(mPost)) { case DRAFT: case PUBLISHED: return isNewPost() && mPost.isLocalDraft(); case UNKNOWN: return mPost.isLocalDraft(); case SCHEDULED: case PRIVATE: case PENDING: case TRASHED: default: return false; } }
Source:
public void testCreateKey() throws IOException { QseqRecordReader reader = createReaderForOneQseq(); assertTrue(reader.createKey() != null); }

Target:
public void testCreateKey() throws IOException { QseqRecordReader reader = createReaderForOneQseq(); assertNotNull(reader.createKey()); }
Source:
private TypeConverter obtainConverter(QueryableEntry entry) { if (components == null) { return MapEntryAttributeExtractor.getConverter(entry, name, queryFieldType); } else { CompositeConverter existingConverter = (CompositeConverter) converter; TypeConverter[] converters = new TypeConverter[components.length]; for (int i = 0; i < components.length; ++i) { TypeConverter existingComponentConverter = getNonTransientComponentConverter(existingConverter, i); if (existingComponentConverter == null) { converters[i] = MapEntryAttributeExtractor.getConverter(entry, components[i], QueryFieldType.fromName(components[i])); assert converters[i] != null; } else { converters[i] = existingComponentConverter; } } return new CompositeConverter(converters); } }

Target:
private TypeConverter obtainConverter(QueryableEntry entry) { if (components == null) { return MapEntryAttributeExtractor.getConverter(entry, name, attributeOrigin); } else { CompositeConverter existingConverter = (CompositeConverter) converter; TypeConverter[] converters = new TypeConverter[components.length]; for (int i = 0; i < components.length; ++i) { TypeConverter existingComponentConverter = getNonTransientComponentConverter(existingConverter, i); if (existingComponentConverter == null) { converters[i] = MapEntryAttributeExtractor.getConverter(entry, components[i], AttributeOrigin.fromName(components[i])); assert converters[i] != null; } else { converters[i] = existingComponentConverter; } } return new CompositeConverter(converters); } }
Source:
public void testEmptyBatchDeletion() { if (magic >= RecordBatch.MAGIC_VALUE_V2) { for (final BatchRetention deleteRetention : Arrays.asList(BatchRetention.DELETE, BatchRetention.DELETE_EMPTY)) { ByteBuffer buffer = ByteBuffer.allocate(DefaultRecordBatch.RECORD_BATCH_OVERHEAD); long producerId = 23L; short producerEpoch = 5; long baseOffset = 3L; int baseSequence = 10; int partitionLeaderEpoch = 293; long timestamp = System.currentTimeMillis(); DefaultRecordBatch.writeEmptyHeader(buffer, RecordBatch.MAGIC_VALUE_V2, producerId, producerEpoch, baseSequence, baseOffset, baseOffset, partitionLeaderEpoch, TimestampType.CREATE_TIME, timestamp, false, false); buffer.flip(); ByteBuffer filtered = ByteBuffer.allocate(2048); MemoryRecords records = MemoryRecords.readableRecords(buffer); MemoryRecords.FilterResult filterResult = records.filterTo(new TopicPartition("foo", 0), new MemoryRecords.RecordFilter(0, 0) { @Override protected BatchRetentionResult checkBatchRetention(RecordBatch batch) { return new BatchRetentionResult(deleteRetention, true); } @Override protected boolean shouldRetainRecord(RecordBatch recordBatch, Record record) { return false; } }, filtered, Integer.MAX_VALUE, BufferSupplier.NO_CACHING); assertEquals(0, filterResult.outputBuffer().position()); filtered.flip(); MemoryRecords filteredRecords = MemoryRecords.readableRecords(filtered); assertEquals(0, filteredRecords.sizeInBytes()); } } }

Target:
public void testEmptyBatchDeletion() { if (magic >= RecordBatch.MAGIC_VALUE_V2) { for (final BatchRetention deleteRetention : Arrays.asList(BatchRetention.DELETE, BatchRetention.DELETE_EMPTY)) { ByteBuffer buffer = ByteBuffer.allocate(DefaultRecordBatch.RECORD_BATCH_OVERHEAD); long producerId = 23L; short producerEpoch = 5; long baseOffset = 3L; int baseSequence = 10; int partitionLeaderEpoch = 293; long timestamp = System.currentTimeMillis(); DefaultRecordBatch.writeEmptyHeader(buffer, RecordBatch.MAGIC_VALUE_V2, producerId, producerEpoch, baseSequence, baseOffset, baseOffset, partitionLeaderEpoch, TimestampType.CREATE_TIME, timestamp, false, false); buffer.flip(); ByteBuffer filtered = ByteBuffer.allocate(2048); MemoryRecords records = MemoryRecords.readableRecords(buffer); MemoryRecords.FilterResult filterResult = records.filterTo(new TopicPartition("foo", 0), new MemoryRecords.RecordFilter(0, 0) { @Override protected BatchRetentionResult checkBatchRetention(RecordBatch batch) { return new BatchRetentionResult(deleteRetention, false); } @Override protected boolean shouldRetainRecord(RecordBatch recordBatch, Record record) { return false; } }, filtered, Integer.MAX_VALUE, BufferSupplier.NO_CACHING); assertEquals(0, filterResult.outputBuffer().position()); filtered.flip(); MemoryRecords filteredRecords = MemoryRecords.readableRecords(filtered); assertEquals(0, filteredRecords.sizeInBytes()); } } }
Source:
private ShouldBeAbsolutePath(final Path actual) { super("\nExpecting:\n <%s>\nto be an absolute path", actual); }

Target:
private ShouldBeAbsolutePath(final Path actual) { super(MESSAGE, actual); }
Source:
public void initMDS() throws IOException { LOGGER.info("Initializing MOTECH Data Services"); File migrationDirectory = mdsConfig.getFlywayMigrationDirectory(); if (migrationDirectory.exists()) { FileUtils.cleanDirectory(migrationDirectory); } LOGGER.info("Migration directory cleared"); bundleContext.registerService(WeavingHook.class.getName(), mdsWeavingHook, null); LOGGER.info("MDS weaving hook registered"); try { monitor.init(); LOGGER.info("The entities bundle monitor started"); } catch (Exception e) { LOGGER.error("Error while starting the entities bundle monitor", e); } LOGGER.info("Starting MDS Bundle Watcher"); try { mdsBundleWatcher.start(); LOGGER.info("Existing bundles have been processed and refreshed"); } catch (Exception e) { LOGGER.error("Error while starting MDS Annotation Processor", e); } eventAdmin.postEvent(new Event(PlatformConstants.MDS_STARTUP_TOPIC, new HashMap<String, Object>())); LOGGER.info("MOTECH data services initialization complete"); bundleContext.registerService(OsgiBundleApplicationContextListener.class, mdsOsgiBundleApplicationContextListener, null); }

Target:
public void initMDS() throws IOException { LOGGER.info("Initializing MOTECH Data Services"); File migrationDirectory = mdsConfig.getFlywayMigrationDirectory(); if (migrationDirectory.exists()) { FileUtils.cleanDirectory(migrationDirectory); } LOGGER.info("Migration directory cleared"); bundleContext.registerService(WeavingHook.class.getName(), mdsWeavingHook, null); LOGGER.info("MDS weaving hook registered"); try { monitor.init(); LOGGER.info("The entities bundle monitor started"); } catch (Exception e) { LOGGER.error("Error while starting the entities bundle monitor", e); } LOGGER.info("Starting MDS Bundle Watcher"); try { mdsBundleWatcher.start(); LOGGER.info("Existing bundles have been processed and refreshed"); } catch (Exception e) { LOGGER.error("Error while starting MDS Annotation Processor", e); } eventAdmin.postEvent(new Event(PlatformConstants.MDS_STARTUP_TOPIC, new HashMap<String, Object>())); LOGGER.info("MOTECH data services initialization complete"); }
Source:
public static WebArchive createDeployment() { return ShrinkWrap .create(WebArchive.class, "test.war") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsManifestResource(new StringAsset("Dependencies: org.picketlink.core meta-inf,org.picketlink.core.api meta-inf, org.picketlink.idm meta-inf\n"), "MANIFEST.MF") .addClass(PartitionManagerProducerTestCase.class) .addAsManifestResource(createPermissionsXmlAsset( new FilePermission("/tmp/pl-idm", "read,write,delete"), new FilePermission("/tmp/pl-idm/-", "read,write,delete"), new FilePermission("/var/tmp/pl-idm", "read,write,delete"), new FilePermission("/var/tmp/pl-idm/-", "read,write,delete")), "permissions.xml"); }

Target:
public static WebArchive createDeployment() { final String tmpDir = System.getProperty("java.io.tmpdir"); return ShrinkWrap .create(WebArchive.class, "test.war") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsManifestResource(new StringAsset("Dependencies: org.picketlink.core meta-inf,org.picketlink.core.api meta-inf, org.picketlink.idm meta-inf\n"), "MANIFEST.MF") .addClass(PartitionManagerProducerTestCase.class) .addAsManifestResource(createPermissionsXmlAsset( new FilePermission(tmpDir + "/pl-idm", "read,write,delete"), new FilePermission(tmpDir + "/pl-idm/-", "read,write,delete")), "permissions.xml"); }
Source:
public Configuration build() { final Path jbossHome = this.jbossHome; final LoggerHint loggerHint = this.loggerHint == null ? LoggerHint.DEFAULT : this.loggerHint; final boolean embeddedLoggingHint = this.embeddedLoggingHint; configureLogging(loggerHint); final String[] cmdArgs = this.cmdArgs.toArray(new String[0]); final String[] systemPackages = this.systemPackages.toArray(new String[0]); final ModuleLoader moduleLoader; if (this.moduleLoader == null) { final String modulePath = WildFlySecurityManager.getPropertyPrivileged(SYSPROP_KEY_MODULE_PATH, jbossHome.resolve(JBOSS_MODULES_DIR_NAME).toAbsolutePath().toString()); moduleLoader = setupModuleLoader(modulePath, systemPackages); MODULE_LOADER_CONFIGURED.set(true); } else { moduleLoader = this.moduleLoader; } return new Configuration() { @Override public Path getJBossHome() { return jbossHome; } @Override public ModuleLoader getModuleLoader() { return moduleLoader; } @Override public String[] getCommandArguments() { return Arrays.copyOf(cmdArgs, cmdArgs.length); } }; }

Target:
public Configuration build() { final Path jbossHome = this.jbossHome; final LoggerHint loggerHint = this.loggerHint == null ? LoggerHint.DEFAULT : this.loggerHint; configureLogging(loggerHint); final String[] cmdArgs = this.cmdArgs.toArray(new String[0]); final String[] systemPackages = this.systemPackages.toArray(new String[0]); final ModuleLoader moduleLoader; if (this.moduleLoader == null) { final String modulePath = SecurityActions.getPropertyPrivileged(SYSPROP_KEY_MODULE_PATH, jbossHome.resolve(JBOSS_MODULES_DIR_NAME).toAbsolutePath().toString()); moduleLoader = setupModuleLoader(modulePath, systemPackages); MODULE_LOADER_CONFIGURED.set(true); } else { moduleLoader = this.moduleLoader; } return new Configuration() { @Override public Path getJBossHome() { return jbossHome; } @Override public ModuleLoader getModuleLoader() { return moduleLoader; } @Override public String[] getCommandArguments() { return Arrays.copyOf(cmdArgs, cmdArgs.length); } }; }
Source:
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (JarFile jar = new JarFile(entryFile)) { ZipEntry beansXmlEntry = jar.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { if (jar.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } Manifest manifest = jar.getManifest(); if (manifest != null) { final Attributes manifestMainAttributes = manifest.getMainAttributes(); if (manifestMainAttributes.containsKey(CLASS_PATH)) { scanManifestClassPath(entryFile.toURI().toURL(), manifestMainAttributes.getValue(CLASS_PATH), results); } } } }

Target:
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (JarFile jar = new JarFile(entryFile)) { JarEntry beansXmlEntry = jar.getJarEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { if (jar.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } Manifest manifest = jar.getManifest(); if (manifest != null) { final Attributes manifestMainAttributes = manifest.getMainAttributes(); if (manifestMainAttributes.containsKey(CLASS_PATH)) { scanManifestClassPath(entryFile.toURI().toURL(), manifestMainAttributes.getValue(CLASS_PATH), results); } } } }
Source:
protected TreeViewer doCreateTreeViewer(Composite parentComposite, int style) { fCheckboxTreeViewer = new CheckboxTreeViewer(parentComposite, style) { @Override protected void fireCheckStateChanged(CheckStateChangedEvent event) { int nb = getCheckedElements().length; IPreferenceStore corePreferenceStore = Activator.getDefault().getCorePreferenceStore(); String hide = corePreferenceStore.getString(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE); if (nb > 20 && !MessageDialogWithToggle.ALWAYS.equals(hide)) { int retCode = MessageDialogWithToggle.openOkCancelConfirm(getControl().getShell(), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedTitle, String.format(Messages.AbstractSelectTreeViewer_ManyEntriesSelectedMessage, nb), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedDontShowAgain, false, corePreferenceStore, ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE).getReturnCode(); if (retCode == Window.CANCEL) { setSubtreeChecked(event.getElement(), !event.getChecked()); checkSubtree(event.getElement(), !event.getChecked()); return; } } super.fireCheckStateChanged(event); } }; fCheckboxTreeViewer.setUseHashlookup(true); fCheckboxTreeViewer.addCheckStateListener(event -> { if (event.getChecked()) { fCheckedObjects.add(event.getElement()); } else { fCheckedObjects.remove(event.getElement()); } }); return fCheckboxTreeViewer; }

Target:
protected TreeViewer doCreateTreeViewer(Composite parentComposite, int style) { fCheckboxTreeViewer = new CheckboxTreeViewer(parentComposite, style); fCheckboxTreeViewer.setUseHashlookup(true); fCheckboxTreeViewer.addCheckStateListener(event -> { if (event.getChecked()) { fCheckedObjects.add(event.getElement()); } else { fCheckedObjects.remove(event.getElement()); } }); return fCheckboxTreeViewer; }
Source:
public Iterator<Object[]> indelFlipDataWithOriginalAllele() { final List<Object[]> tests = new ArrayList<>(); indelFlipData().forEachRemaining(x -> { if (x[2] == null){ tests.add(x); } else { VariantContext source = (VariantContext)x[0]; VariantContextBuilder result_builder = new VariantContextBuilder((VariantContext)x[2]); result_builder.attribute(LiftoverVcf.ORIGINAL_ALLELES, allelesToStringList(source.getAlleles())); tests.add(new Object[]{x[0], x[1], result_builder.make()}); } }); return tests.iterator(); }

Target:
public Iterator<Object[]> indelFlipDataWithOriginalAllele() { final List<Object[]> tests = new ArrayList<>(); indelFlipData().forEachRemaining(x -> { if (x[2] == null) { tests.add(x); } else { VariantContext source = (VariantContext)x[0]; VariantContextBuilder result_builder = new VariantContextBuilder((VariantContext)x[2]); result_builder.attribute(LiftoverVcf.ORIGINAL_ALLELES, LiftoverUtils.allelesToStringList(source.getAlleles())); tests.add(new Object[]{x[0], x[1], result_builder.make()}); } }); return tests.iterator(); }
Source:
public void shouldRaiseAlertOnMissingFeaturePolicyHTML() throws Exception { msg.getResponseHeader().addHeader(HttpHeader.CONTENT_TYPE, "text/html"); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertEquals(alertsRaised.size(), 1); assertEquals(alertsRaised.get(0).getDescription(), getAlertAtrribute("desc")); assertEquals(alertsRaised.get(0).getName(), getAlertAtrribute("name")); assertEquals(alertsRaised.get(0).getReference(), getAlertAtrribute("refs")); assertEquals(alertsRaised.get(0).getSolution(), getAlertAtrribute("soln")); }

Target:
public void shouldRaiseAlertOnMissingFeaturePolicyHTML() throws Exception { msg.getResponseHeader().addHeader(HttpHeader.CONTENT_TYPE, "text/html"); rule.scanHttpResponseReceive(msg, -1, createSource(msg)); assertEquals(alertsRaised.size(), 1); assertThat(alertsRaised.get(0), hasNameLoadedWithKey(MESSAGE_PREFIX+"name")); }
Source:
public Response demonstrateClaims(@HeaderParam("Authorization") String auth) { if (auth != null && auth.startsWith("Bearer ")) { try { JWT j = JWTParser.parse(auth.substring(7)); return Response.ok(j.getJWTClaimsSet().getClaims()).build(); } catch (ParseException e) { e.printStackTrace(); } } return Response.status(204).build(); }

Target:
public Response demonstrateClaims(@HeaderParam("Authorization") String auth) { if (auth != null && auth.startsWith("Bearer ")) { try { JWT j = JWTParser.parse(auth.substring(7)); return Response.ok(j.getJWTClaimsSet().getClaims()).build(); } catch (ParseException e) { e.printStackTrace(); return Response.status(400).build(); } } return Response.status(204).build(); }
Source:
private LastDataPointMessage buildLastDataPointResponse( final String sourceMetricName, final String rollupMetricName, final RollupPeriod period, final ImmutableSet<String> tags, final MetricsQueryResponse response, @Nullable final Throwable failure) { final LastDataPointMessage.Builder builder = new LastDataPointMessage.Builder() .setSourceMetricName(sourceMetricName) .setRollupMetricName(rollupMetricName) .setPeriod(period) .setTags(tags); if (failure != null) { return builder.setFailure(failure).build(); } final Map<String, MetricsQueryResponse.QueryResult> queryResults = response.getQueries() .stream() .flatMap(query -> query.getResults().stream()) .collect(ImmutableMap.toImmutableMap( MetricsQueryResponse.QueryResult::getName, Function.identity() )); if (queryResults.size() != 2 || !queryResults.containsKey(sourceMetricName) || !queryResults.containsKey(rollupMetricName)) { return builder.setFailure(new Exception("Unexpected query results.")).build(); } Optional.ofNullable(queryResults.get(sourceMetricName)) .flatMap(qr -> qr.getValues().stream().findFirst()) .map(DataPoint::getTime) .ifPresent(builder::setSourceLastDataPointTime); Optional.ofNullable(queryResults.get(rollupMetricName)) .flatMap(qr -> qr.getValues().stream().findFirst()) .map(DataPoint::getTime) .ifPresent(builder::setRollupLastDataPointTime); return builder.build(); }

Target:
private LastDataPointsMessage buildLastDataPointResponse( final String sourceMetricName, final String rollupMetricName, final RollupPeriod period, final ImmutableSet<String> tags, final MetricsQueryResponse response, @Nullable final Throwable failure) { final LastDataPointsMessage.Builder builder = new LastDataPointsMessage.Builder() .setSourceMetricName(sourceMetricName) .setRollupMetricName(rollupMetricName) .setPeriod(period) .setTags(tags); if (failure != null) { return builder.setFailure(failure).build(); } final Map<String, Optional<DataPoint>> queryResults = response.getQueries() .stream() .flatMap(query -> query.getResults().stream()) .collect(ImmutableMap.toImmutableMap( MetricsQueryResponse.QueryResult::getName, queryResult -> queryResult.getValues().stream().findFirst() )); if (queryResults.size() != 2 || !queryResults.containsKey(sourceMetricName) || !queryResults.containsKey(rollupMetricName)) { return builder.setFailure(new UnexpectedQueryResponseException("Unexpected or missing metric names", response)).build(); } queryResults.get(sourceMetricName) .map(DataPoint::getTime) .ifPresent(builder::setSourceLastDataPointTime); queryResults.get(rollupMetricName) .map(DataPoint::getTime) .ifPresent(builder::setRollupLastDataPointTime); return builder.build(); }
Source:
public boolean ok() { MapillaryProperties.DOWNLOAD_MODE.put(DOWNLOAD_MODE.fromLabel(downloadModeComboBox.getSelectedItem().toString()).getPrefId()); MapillaryProperties.DISPLAY_HOUR.put(displayHour.isSelected()); MapillaryProperties.TIME_FORMAT_24.put(format24.isSelected()); MapillaryProperties.MOVE_TO_IMG.put(moveTo.isSelected()); MapillaryProperties.HOVER_ENABLED.put(hoverEnabled.isSelected()); MapillaryProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(cutOffSeq.isSelected()); MapillaryProperties.DEVELOPER.put(developer.isSelected()); try { Integer prefetch_count = Integer.parseInt(preFetchSize.getText()); MapillaryProperties.PRE_FETCH_IMAGE_COUNT.put(prefetch_count); } catch (NumberFormatException e) { Logging.warn("Prefetch Image count is not a valid number. Resetting to default value."); } return false; }

Target:
public boolean ok() { MapillaryProperties.DOWNLOAD_MODE.put(DOWNLOAD_MODE.fromLabel(downloadModeComboBox.getSelectedItem().toString()).getPrefId()); MapillaryProperties.DISPLAY_HOUR.put(displayHour.isSelected()); MapillaryProperties.TIME_FORMAT_24.put(format24.isSelected()); MapillaryProperties.MOVE_TO_IMG.put(moveTo.isSelected()); MapillaryProperties.HOVER_ENABLED.put(hoverEnabled.isSelected()); MapillaryProperties.CUT_OFF_SEQUENCES_AT_BOUNDS.put(cutOffSeq.isSelected()); MapillaryProperties.DEVELOPER.put(developer.isSelected()); if (preFetchSize.getModel() instanceof SpinnerNumberModel) { Integer prefetch_count = ((SpinnerNumberModel) preFetchSize.getModel()).getNumber().intValue(); MapillaryProperties.PRE_FETCH_IMAGE_COUNT.put(prefetch_count); } else { JOptionPane.showMessageDialog( Main.parent, I18n.tr("The Mapillary image prefetch count is not a valid number"), I18n.tr("Warning"), JOptionPane.INFORMATION_MESSAGE); } return false; }
Source:
public boolean apply(IMap.Entry<String, EmployeeImpl> entry) { return entry.getValue().getSalary() == salary; }

Target:
public boolean apply(IMap.Entry<String, EmployeeImpl> entry) { EmployeeImpl value = entry.getValue(); return value.getSalary() == salary; }
Source:
public static Optional<InsightCard> getInsights(final SleepStatsDAODynamoDB sleepStatsDAODynamoDB, final Long accountId, final WakeStdDevData wakeStdDevData, final DateTime queryEndDate, final int numDays) { final DateTime queryStartDate = queryEndDate.minusDays(numDays); final String queryEndDateString = DateTimeUtil.dateToYmdString(queryEndDate); final String queryStartDateString = DateTimeUtil.dateToYmdString(queryStartDate); final List<AggregateSleepStats> sleepStats = sleepStatsDAODynamoDB.getBatchStats(accountId, queryStartDateString, queryEndDateString); LOGGER.debug("length of sleep stats is and sleepStats is ", sleepStats.size(), sleepStats); final List<Long> wakeTimeList = new ArrayList<>(); for (final AggregateSleepStats stat : sleepStats) { LOGGER.debug("printing sleepstats.waketime {}", stat.sleepStats.wakeTime); Long wakeTimeStamp = stat.sleepStats.wakeTime; DateTime wakeTimeDateTime = new DateTime(wakeTimeStamp, DateTimeZone.forOffsetMillis(stat.offsetMillis)); Long wakeTimeMillis = wakeTimeDateTime.getMillis() - wakeTimeDateTime.withTimeAtStartOfDay().getMillis(); Long wakeTime = wakeTimeMillis/(60L * 1000L); wakeTimeList.add(wakeTime); } final Optional<InsightCard> card = processWakeVarianceData(accountId, wakeTimeList, wakeStdDevData); return card; }

Target:
public static Optional<InsightCard> getInsights(final SleepStatsDAODynamoDB sleepStatsDAODynamoDB, final Long accountId, final WakeStdDevData wakeStdDevData, final DateTime queryEndDate, final int numDays) { final DateTime queryStartDate = queryEndDate.minusDays(numDays); final String queryEndDateString = DateTimeUtil.dateToYmdString(queryEndDate); final String queryStartDateString = DateTimeUtil.dateToYmdString(queryStartDate); final List<AggregateSleepStats> sleepStats = sleepStatsDAODynamoDB.getBatchStats(accountId, queryStartDateString, queryEndDateString); LOGGER.debug("Account id length of sleep stats is and sleepStats is ", accountId, sleepStats.size(), sleepStats); final List<Integer> wakeTimeList = Lists.newArrayList(); for (final AggregateSleepStats stat : sleepStats) { final Long wakeTimeStamp = stat.sleepStats.wakeTime; final DateTime wakeTimeDateTime = new DateTime(wakeTimeStamp, DateTimeZone.forOffsetMillis(stat.offsetMillis)); final int wakeTime = wakeTimeDateTime.getMinuteOfDay(); wakeTimeList.add(wakeTime); } final Optional<InsightCard> card = processWakeVarianceData(accountId, wakeTimeList, wakeStdDevData); return card; }
Source:
private List<Identifier> prepareIdentifier() { List<Identifier> testList = new ArrayList<>(); Identifier testIdentifier1 = new Identifier("603", new IdentifierType("Old Identification Number")); testIdentifier1.setUuid("2222"); Location location = locationAdapter.createLocation(DEFAULT_CONFIG_NAME, new Location("FooName", "FooCountry", "FooRegion", "FooCountryDistrict", "FooStateProvince")); testIdentifier1.setLocation(location); testList.add(testIdentifier1); return testList; }

Target:
private List<Identifier> prepareIdentifier() { List<Identifier> testList = new ArrayList<>(); Identifier testIdentifier1 = new Identifier("603", new IdentifierType("Old Identification Number")); testIdentifier1.setUuid("2222"); testIdentifier1.setLocation(location); testList.add(testIdentifier1); return testList; }
Source:
public void initialise() { sceneOpaqueFbo = displayResolutionDependentFBOs.get(SCENE_OPAQUE); playerCamera = worldRenderer.getActiveCamera(); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(SCENE_OPAQUE, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }

Target:
public void initialise() { wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }
Source:
public VdcReturnValueBase endAction(VdcActionType actionType, VdcActionParametersBase parameters, CommandContext context) { CommandBase<?> command = context != null ? CommandsFactory.createCommand(actionType, parameters, context.duplicate()) : CommandsFactory.createCommand(actionType, parameters); return command.endAction(); }

Target:
public VdcReturnValueBase endAction(VdcActionType actionType, VdcActionParametersBase parameters, CommandContext context) { return CommandsFactory.createCommand(actionType, parameters, context).endAction(); }
Source:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.PUT == request.getMethod()) { bookieServer.getBookie().getLedgerStorage().forceGC(); String output = "Triggered GC on BookieServer: " + bookieServer.toString(); String jsonResponse = JsonUtil.toJson(output); LOG.debug("output body:" + jsonResponse); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else if (HttpServer.Method.GET == request.getMethod()) { boolean isInForceGC = bookieServer.getBookie().getLedgerStorage().isInForceGC(); String output = "Is Force Triggered GC on BookieServer: " + bookieServer.toString() + " running? " + (isInForceGC ? "true" : "false"); String jsonResponse = JsonUtil.toJson(output); LOG.debug("output body:" + jsonResponse); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be PUT method to trigger GC."); return response; } }

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.PUT == request.getMethod()) { bookieServer.getBookie().getLedgerStorage().forceGC(); String output = "Triggered GC on BookieServer: " + bookieServer.toString(); String jsonResponse = JsonUtil.toJson(output); if (LOG.isDebugEnabled()) { LOG.debug("output body:" + jsonResponse); } response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else if (HttpServer.Method.GET == request.getMethod()) { Boolean isInForceGC = bookieServer.getBookie().getLedgerStorage().isInForceGC(); Pair<String, String> output = Pair.of("is_in_force_gc", isInForceGC.toString()); String jsonResponse = JsonUtil.toJson(output); if (LOG.isDebugEnabled()) { LOG.debug("output body:" + jsonResponse); } response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be PUT to trigger GC, Or GET to get Force GC state."); return response; } }
Source:
public void testDclassWrapper() { String userAgentSample = "Mozilla/5.0 (Linux; U; Android 2.2; en; HTC Aria A6380 Build/ERE27) AppleWebKit/540.13+ (KHTML, like Gecko) Version/3.1 Mobile Safari/524.15.0"; dClass dw = new dClass(dtree_path); dw.init(); Map<String, String> c = dw.classify(userAgentSample); assertEquals("Vendor as expected", "HTC" , c.get("vendor")); assertEquals("Model as expected" , "A6366", c.get("model")); assertEquals("device_os as expected","Android",c.get("device_os")); assertEquals("is_tablet as expected","false",c.get("is_tablet")); }

Target:
public void testDclassWrapper() { String userAgentSample = "Mozilla/5.0 (Linux; U; Android 2.2; en; HTC Aria A6380 Build/ERE27) AppleWebKit/540.13+ (KHTML, like Gecko) Version/3.1 Mobile Safari/524.15.0"; dClass dw = new dClass(dtree_path); Map<String, String> c = dw.classify(userAgentSample); assertEquals("Vendor as expected", "HTC" , c.get("vendor")); assertEquals("Model as expected" , "A6380", c.get("model")); assertEquals("device_os as expected","Android",c.get("device_os")); assertEquals("is_tablet as expected","false",c.get("is_tablet")); }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; return obj.hashCode() == hashCode(); }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SimpleMessage other = (SimpleMessage) obj; return Objects.equals(category, other.category) && Objects.equals(message, other.message) && ((messageParameters == null && other.messageParameters == null) || Arrays.equals(messageParameters, other.messageParameters)) && Objects.equals(severity, other.severity); }
Source:
private static void getThreadSuspendReason(DSFSessionState sessionState, final ICPUDMContext cpuContext, final ICoreDMContext coreContext, final IMIExecutionDMContext execContext, final IThreadDMData threadData, final IFrameDMData frameData, final DSFDebugModelListener listener, final Object arg) { IRunControl runControl = sessionState.getService(IRunControl.class); runControl.getExecutionData(execContext, new ImmediateDataRequestMonitor<IExecutionDMData>() { @Override protected void handleCompleted() { IExecutionDMData executionData = getData(); VisualizerExecutionState state = VisualizerExecutionState.SUSPENDED; if (isSuccess() && executionData != null) { if (executionData.getStateChangeReason() == StateChangeReason.SIGNAL) { if (executionData instanceof IExecutionDMData2) { String details = ((IExecutionDMData2)executionData).getDetails(); if (details != null) { if (isCrashSignal(details)) { state = VisualizerExecutionState.CRASHED; } } } } } listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, frameData, state, arg); } }); }

Target:
private static void getThreadSuspendReason(DSFSessionState sessionState, final ICPUDMContext cpuContext, final ICoreDMContext coreContext, final IMIExecutionDMContext execContext, final IThreadDMData threadData, final IFrameDMData frameData, final DSFDebugModelListener listener, final Object arg) { IRunControl runControl = sessionState.getService(IRunControl.class); if (runControl != null) { runControl.getExecutionData(execContext, new ImmediateDataRequestMonitor<IExecutionDMData>() { @Override protected void handleCompleted() { IExecutionDMData executionData = getData(); VisualizerExecutionState state = VisualizerExecutionState.SUSPENDED; if (isSuccess() && executionData != null) { if (executionData.getStateChangeReason() == StateChangeReason.SIGNAL) { if (executionData instanceof IExecutionDMData2) { String details = ((IExecutionDMData2)executionData).getDetails(); if (details != null) { if (isCrashSignal(details)) { state = VisualizerExecutionState.CRASHED; } } } } } listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, frameData, state, arg); } }); } else { listener.getThreadExecutionStateDone(cpuContext, coreContext, execContext, threadData, frameData, null, arg); } }
Source:
public Iterable<String> head() { return Collections.singletonList("HTTP/1.1 204 No Content"); }

Target:
public Iterable<String> head() { return new ListOf<>("HTTP/1.1 204 No Content"); }
Source:
public void testGPUDriverWithInexecutableScript() throws Exception { final Configuration config = new Configuration(); final TemporaryFolder temporaryFolder = new TemporaryFolder(new File(".")); temporaryFolder.create(); final File inexecutatbleFile = temporaryFolder.newFile(); assertTrue(inexecutatbleFile.setExecutable(false)); config.setString(GPUDriver.DISCOVERY_SCRIPT_PATH, inexecutatbleFile.getPath()); new GPUDriver(config); }

Target:
public void testGPUDriverWithInexecutableScript() throws Exception { final Configuration config = new Configuration(); final File inexecutableFile = TEMP_FOLDER.newFile(); assertTrue(inexecutableFile.setExecutable(false)); config.setString(GPUDriver.DISCOVERY_SCRIPT_PATH, inexecutableFile.getAbsolutePath()); new GPUDriver(config); }
Source:
protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText("Select a Route Resource"); }

Target:
protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(Messages.getString("DependenciesResourceSelectionDialog.selectResource")); }
Source:
public void testParent() throws Exception { final String xpath = "( final DetailAST rootAst = getRootAst("InputXpathMapperAst.java"); final RootNode rootNode = new RootNode(rootAst); final DetailAST[] actual = convertToDetailAstArray(getXpathItems(xpath, rootNode)); final DetailAST realVariableDefNode = getSiblingByType(rootAst, TokenTypes.CLASS_DEF) .findFirstToken(TokenTypes.OBJBLOCK) .findFirstToken(TokenTypes.METHOD_DEF) .findFirstToken(TokenTypes.SLIST); final DetailAST[] expected = {realVariableDefNode}; assertArrayEquals(expected, actual); }

Target:
public void testParent() throws Exception { final String xpath = "( final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); final DetailAST expectedVariableDefNode = getSiblingByType(rootNode.getUnderlyingNode(), TokenTypes.CLASS_DEF) .findFirstToken(TokenTypes.OBJBLOCK) .findFirstToken(TokenTypes.METHOD_DEF) .findFirstToken(TokenTypes.SLIST); final DetailAST[] expected = {expectedVariableDefNode}; assertArrayEquals("Result nodes differ from expected", expected, actual); }