auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldSendCorrelationId() throws ExecutionException, InterruptedException { final String projectKey = "my-project"; when: { when(sphereApiConfig.getProjectKey()).thenReturn(projectKey); when(sphereApiConfig.getApiUrl()).thenReturn("<LINK_0>"); when(httpClient.getUserAgent()).thenReturn("user-agent"); when(sphereAccessTokenSupplier.get()).thenReturn(CompletableFutureUtils.successful("token")); when(httpClient.execute(httpRequestArgumentCaptor.capture())) .thenReturn(CompletableFuture.completedFuture(HttpResponse.of(200, "ok"))); } then: { final SphereClient sphereClient = SphereClient.of(sphereApiConfig, httpClient, sphereAccessTokenSupplier); final DummySphereRequest sphereRequest = DummySphereRequest.of(); final CompletableFuture<String> completionStage = (CompletableFuture<String>) sphereClient.execute(sphereRequest); final String response = completionStage.get(); assertThat(response).isEqualTo(DummySphereRequest.DEFAULT_RESPONSE_OBJECT); final HttpHeaders headers = httpRequestArgumentCaptor.getValue().getHeaders(); final Optional<String> correlationId = headers.findFlatHeader(HttpHeaders.X_CORRELATION_ID); assertThat(correlationId.isPresent()).isTrue(); final List<String> correlationIdParts = Arrays.asList(correlationId.get().split("/")); assertThat(correlationIdParts).hasSize(2); assertThat(correlationIdParts.get(0)).isEqualTo(projectKey); final UUID uuid = UUID.fromString(correlationIdParts.get(1)); assertThat(uuid).isNotNull(); } }

Target:
public void shouldSendCorrelationId() throws ExecutionException, InterruptedException { final String projectKey = "my-project"; when: { when(sphereApiConfig.getProjectKey()).thenReturn(projectKey); when(sphereApiConfig.getApiUrl()).thenReturn("<LINK_0>"); when(httpClient.getUserAgent()).thenReturn("user-agent"); when(sphereAccessTokenSupplier.get()).thenReturn(CompletableFutureUtils.successful("token")); when(httpClient.execute(httpRequestArgumentCaptor.capture())) .thenReturn(CompletableFuture.completedFuture(HttpResponse.of(200, "ok"))); } then: { final SphereClient sphereClient = SphereClient.of(sphereApiConfig, httpClient, sphereAccessTokenSupplier); final DummySphereRequest sphereRequest = DummySphereRequest.of(); final CompletableFuture<String> completionStage = (CompletableFuture<String>) sphereClient.execute(sphereRequest); final String response = completionStage.get(); assertThat(response).isEqualTo(DummySphereRequest.DEFAULT_RESPONSE_OBJECT); final HttpHeaders headers = httpRequestArgumentCaptor.getValue().getHeaders(); final Optional<String> correlationId = headers.findFlatHeader(HttpHeaders.X_CORRELATION_ID); assertThat(correlationId).isPresent(); final List<String> correlationIdParts = Arrays.asList(correlationId.get().split("/")); assertThat(correlationIdParts).hasSize(2); assertThat(correlationIdParts.get(0)).isEqualTo(projectKey); final UUID uuid = UUID.fromString(correlationIdParts.get(1)); assertThat(uuid).isNotNull(); } }
Source:
private void fireUpdateEvent() { for (int i = 0; i < listeners.size(); i++) listeners.get(i).handleUpdateEvent(); }

Target:
private void fireUpdateEvent() { for (IUpdateListener listener : listeners) { listener.handleUpdateEvent(); } }
Source:
public <T extends Enum<?>> void setEnum(final String section, final String subsection, final String name, final T value) { String n = null; if (value instanceof ConfigEnum) { n = ((ConfigEnum) value).toConfigValue(); } else { n = value.name().toLowerCase().replace('_', ' '); } setString(section, subsection, name, n); }

Target:
public <T extends Enum<?>> void setEnum(final String section, final String subsection, final String name, final T value) { String n; if (value instanceof ConfigEnum) n = ((ConfigEnum) value).toConfigValue(); else n = value.name().toLowerCase().replace('_', ' '); setString(section, subsection, name, n); }
Source:
public void testLogEntryDoesntLogWhenLogLevelInactive() throws Exception { Log log = mock(Log.class); LoggedUtils.logEntry(log, "", new LoggedOverridingSubclass()); verify(log, never()).traceFormat(any(String.class), any()); verify(log, never()).debugFormat(any(String.class), any()); verify(log, never()).infoFormat(any(String.class), any()); verify(log, never()).warnFormat(any(String.class), any()); verify(log, never()).errorFormat(any(String.class), any()); verify(log, never()).fatalFormat(any(String.class), any()); }

Target:
public void testLogEntryDoesntLogWhenLogLevelInactive() throws Exception { Log log = mock(Log.class); LoggedUtils.logEntry(log, "", new LoggedOverridingSubclass()); verifyNoLogging(log); }
Source:
private void runOrganization(long tableId) { Set<ShardMetadata> shardMetadatas = shardManager.getNodeShardsOnly(currentNodeIdentifier, tableId); Table tableInfo = metadataDao.getTableInformation(tableId); Set<ShardMetadata> filteredShards = shardMetadatas.stream() .filter(shard -> !organizer.inProgress(shard.getShardUuid())) .collect(toSet()); Collection<ShardIndexInfo> indexInfos = getOrganizationEligibleShards(dbi, metadataDao, tableInfo, filteredShards, true); Set<OrganizationSet> organizationSets = createOrganizationSets(temporalFunction, tableInfo, indexInfos); if (organizationSets.isEmpty()) { return; } log.info("Created %s organization set(s) from %s shards for table ID %s", organizationSets.size(), filteredShards.size(), tableId); long lastStartTime = System.currentTimeMillis(); tablesInProgress.add(tableId); ImmutableList.Builder<ListenableFuture<?>> futures = ImmutableList.builder(); for (OrganizationSet organizationSet : organizationSets) { futures.add(organizer.enqueue(organizationSet)); } futures.build().forEach(listenableFuture -> { listenableFuture.addListener( () -> { tablesInProgress.remove(tableId); organizerDao.updateLastStartTime(currentNodeIdentifier, tableId, lastStartTime); }, MoreExecutors.directExecutor()); }); }

Target:
private void runOrganization(long tableId) { Set<ShardMetadata> shardMetadatas = shardManager.getNodeShards(currentNodeIdentifier, tableId); Table tableInfo = metadataDao.getTableInformation(tableId); Set<ShardMetadata> filteredShards = shardMetadatas.stream() .filter(shard -> !organizer.inProgress(shard.getShardUuid())) .collect(toSet()); Collection<ShardIndexInfo> indexInfos = getOrganizationEligibleShards(dbi, metadataDao, tableInfo, filteredShards, true); Set<OrganizationSet> organizationSets = createOrganizationSets(temporalFunction, tableInfo, indexInfos); if (organizationSets.isEmpty()) { return; } log.info("Created %s organization set(s) from %s shards for table ID %s", organizationSets.size(), filteredShards.size(), tableId); long lastStartTime = System.currentTimeMillis(); tablesInProgress.add(tableId); ImmutableList.Builder<ListenableFuture<?>> futures = ImmutableList.builder(); for (OrganizationSet organizationSet : organizationSets) { futures.add(organizer.enqueue(organizationSet)); } futures.build().forEach(listenableFuture -> listenableFuture.addListener( () -> { tablesInProgress.remove(tableId); organizerDao.updateLastStartTime(currentNodeIdentifier, tableId, lastStartTime); }, MoreExecutors.directExecutor())); }
Source:
public void before() throws Exception { synchronized ( running ) { if ( running.compareAndSet( false, true ) ) { RemoteHotRodServerHelper.beforeRun(); StandaloneCommandBuilder builder = StandaloneCommandBuilder .of( "target/infinispan-server" ); builder .setServerReadOnlyConfiguration( DEFAULT_CONFIG_PATH ); if ( portOffset != 0 ) { builder.addJavaOption( "-Djboss.socket.binding.port-offset=" + portOffset ); } Launcher launcher = Launcher.of( builder ); hotRodServer = launcher.inherit().launch(); waitForRunning(); } } }

Target:
public void before() throws Exception { synchronized ( running ) { if ( running.compareAndSet( false, true ) ) { StandaloneCommandBuilder builder = StandaloneCommandBuilder .of( "target/infinispan-server" ); builder .setServerReadOnlyConfiguration( DEFAULT_CONFIG_PATH ); if ( portOffset != 0 ) { builder.addJavaOption( "-Djboss.socket.binding.port-offset=" + portOffset ); } Launcher launcher = Launcher.of( builder ); hotRodServer = launcher.launch(); waitForRunning(); } } }
Source:
public static List<BrooklinMetricInfo> getPartitionSpecificMetrics(String prefix) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); prefix = Strings.nullToEmpty(prefix); metrics.add(new BrooklinMeterInfo(prefix + REBALANCE_RATE)); metrics.add(new BrooklinMeterInfo(prefix + STUCK_PARTITIONS)); return metrics; }

Target:
public static List<BrooklinMetricInfo> getPartitionSpecificMetrics(String prefix) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); prefix = Strings.nullToEmpty(prefix); metrics.add(new BrooklinMeterInfo(prefix + REBALANCE_RATE, Optional.of(Arrays.asList(BrooklinMeterInfo.COUNT, BrooklinMeterInfo.ONE_MINUTE_RATE)))); metrics.add(new BrooklinMeterInfo(prefix + STUCK_PARTITIONS)); return Collections.unmodifiableList(metrics); }
Source:
private void uploadPhoto(Uri uri) { hideDownloadUI(); Toast.makeText(this, "Uploading...", Toast.LENGTH_SHORT).show(); String uuid = UUID.randomUUID().toString(); mImageRef = FirebaseStorage.getInstance().getReference(uuid); mImageRef.putFile(uri) .addOnSuccessListener(this, new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { if (BuildConfig.DEBUG) { Log.d(TAG, "uploadPhoto:onEmailPromptSuccess:" + taskSnapshot.getMetadata().getReference().getPath()); } Toast.makeText(ImageActivity.this, "Image uploaded", Toast.LENGTH_SHORT).show(); showDownloadUI(); } }) .addOnFailureListener(this, new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.w(TAG, "uploadPhoto:onError", e); Toast.makeText(ImageActivity.this, "Upload failed", Toast.LENGTH_SHORT).show(); } }); }

Target:
private void uploadPhoto(Uri uri) { hideDownloadUI(); Toast.makeText(this, "Uploading...", Toast.LENGTH_SHORT).show(); String uuid = UUID.randomUUID().toString(); mImageRef = FirebaseStorage.getInstance().getReference(uuid); mImageRef.putFile(uri) .addOnSuccessListener(this, new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { if (BuildConfig.DEBUG) { Log.d(TAG, "uploadPhoto:onSuccess:" + taskSnapshot.getMetadata().getReference().getPath()); } Toast.makeText(ImageActivity.this, "Image uploaded", Toast.LENGTH_SHORT).show(); showDownloadUI(); } }) .addOnFailureListener(this, new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.w(TAG, "uploadPhoto:onError", e); Toast.makeText(ImageActivity.this, "Upload failed", Toast.LENGTH_SHORT).show(); } }); }
Source:
Mono<Response<AnalyzeSentimentResult>> analyzeSentimentWithResponse(String text, String language, Context context) { return analyzeBatchSentimentWithResponse( Arrays.asList(new TextDocumentInput(Integer.toString(0), text, language)), null, context) .flatMap(response -> { Iterator<AnalyzeSentimentResult> responseItem = response.getValue().iterator(); return Mono.just(new SimpleResponse<>(response, responseItem.next())); }); }

Target:
Mono<Response<AnalyzeSentimentResult>> analyzeSentimentWithResponse(String text, String language, Context context) { Objects.requireNonNull(text, "'text' cannot be null."); return analyzeBatchSentimentWithResponse( Collections.singletonList(new TextDocumentInput("0", text, language)), null, context) .map(response -> new SimpleResponse<>(response, response.getValue().iterator().next())); }
Source:
public void run() { for(; shouldRunMonitor && fsnamesystem.isRunning(); ) { boolean needSync = false; try { Thread.sleep(fsnamesystem.getLeaseRecheckIntervalMs()); Collection<Lease> candidates = getExpiredCandidateLeases(); if (candidates.isEmpty()) { continue; } fsnamesystem.writeLockInterruptibly(); try { if (!fsnamesystem.isInSafeMode()) { needSync = checkLeases(candidates); } } finally { fsnamesystem.writeUnlock("leaseManager"); if (needSync) { fsnamesystem.getEditLog().logSync(); } } } catch(InterruptedException ie) { if (LOG.isDebugEnabled()) { LOG.debug("{} is interrupted", name, ie); } } catch(Throwable e) { LOG.warn("Unexpected throwable: ", e); } } }

Target:
public void run() { for(; shouldRunMonitor && fsnamesystem.isRunning(); ) { boolean needSync = false; try { Thread.sleep(fsnamesystem.getLeaseRecheckIntervalMs()); Collection<Lease> candidates = getExpiredCandidateLeases(); if (candidates.isEmpty()) { continue; } fsnamesystem.writeLockInterruptibly(); try { if (!fsnamesystem.isInSafeMode()) { needSync = checkLeases(candidates); } } finally { fsnamesystem.writeUnlock("leaseManager"); if (needSync) { fsnamesystem.getEditLog().logSync(); } } } catch(InterruptedException ie) { LOG.debug("{} is interrupted", name, ie); } catch(Throwable e) { LOG.warn("Unexpected throwable: ", e); } } }
Source:
public void theAdministrativeStatusShouldBeSetOnTheDevice(final Map<String, String> settings) throws Throwable { final SetAdministrativeStatusAsyncRequest setAdministrativeStatusAsyncRequest = SetAdministrativeStatusRequestFactory .fromScenarioContext(); final SetAdministrativeStatusResponse setAdministrativeStatusResponse = this.smartMeteringConfigurationClient .retrieveSetAdministrativeStatusResponse(setAdministrativeStatusAsyncRequest); LOGGER.info("The administrative status result is: {}", setAdministrativeStatusResponse.getResult()); assertNotNull("Administrative status type result is null", setAdministrativeStatusResponse.getResult()); }

Target:
public void theAdministrativeStatusShouldBeSetOnTheDevice(final Map<String, String> settings) throws Throwable { final SetAdministrativeStatusAsyncRequest setAdministrativeStatusAsyncRequest = SetAdministrativeStatusRequestFactory .fromScenarioContext(); final SetAdministrativeStatusResponse setAdministrativeStatusResponse = this.smartMeteringConfigurationClient .retrieveSetAdministrativeStatusResponse(setAdministrativeStatusAsyncRequest); LOGGER.info("The administrative status result is: {}", setAdministrativeStatusResponse.getResult()); assertNotNull("Administrative status type result is null", setAdministrativeStatusResponse.getResult()); assertEquals("Administrative status type should be OK", OsgpResultType.OK, setAdministrativeStatusResponse.getResult()); }
Source:
private static int runTestCommand(TestCommandArgs testArgs, JCommander jc) { int returnCode = 131; try { ModuleTester tester = new ModuleTester(); returnCode = tester.runTests(testArgs.methodStoreUrl, testArgs.skipValidation, testArgs.allowSyncMethods); } catch (Exception e) { if (testArgs.verbose) e.printStackTrace(); showError("Error while testing module", e.getMessage()); return returnCode; } return returnCode; }

Target:
private static int runTestCommand(TestCommandArgs testArgs, JCommander jc) { int returnCode = 1; try { ModuleTester tester = new ModuleTester(); returnCode = tester.runTests(testArgs.methodStoreUrl, testArgs.skipValidation, testArgs.allowSyncMethods); } catch (Exception e) { if (testArgs.verbose) e.printStackTrace(); showError("Error while testing module", e.getMessage()); return returnCode; } return returnCode; }
Source:
public GetTablePartitionKeysResponse getAllPartitionKeys(RpcController controller, NullProto request) throws ServiceException { rlock.lock(); try { return GetTablePartitionKeysResponse.newBuilder() .setState(OK) .addAllPartKey(store.getAllPartitionKeys()) .build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetTablePartitionKeysResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }

Target:
public GetTablePartitionKeysResponse getAllPartitionKeys(RpcController controller, NullProto request) { rlock.lock(); try { return GetTablePartitionKeysResponse.newBuilder() .setState(OK) .addAllPartitionKey(store.getAllPartitionKeys()) .build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetTablePartitionKeysResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }
Source:
void addActiveCircuit(CircuitImpl circuit) { synchronized (activeCircuits) { activeCircuits.add(circuit); activeCircuits.notifyAll(); } lock.lock(); try { if (!isBuilding) { circuit.destroyCircuit(); } } finally { lock.unlock(); } }

Target:
void addActiveCircuit(CircuitImpl circuit) { synchronized (activeCircuits) { activeCircuits.add(circuit); activeCircuits.notifyAll(); } boolean doDestroy; lock.lock(); try { doDestroy = !isBuilding; } finally { lock.unlock(); } if (doDestroy) { circuit.destroyCircuit(); } }
Source:
public void setPrivateForRootComponentUuid(DbSession session, String projectUuid, boolean isPrivate) { mapper(session).setPrivateForRootComponentUuid(projectUuid, isPrivate); session.getMapper(BranchMapper.class).selectByProjectUuid(projectUuid) .stream() .filter(branch -> !projectUuid.equals(branch.getUuid())) .forEach(branch -> mapper(session).setPrivateForRootComponentUuid(branch.getUuid(), isPrivate)); }

Target:
public void setPrivateForRootComponentUuid(DbSession session, String projectUuid, boolean isPrivate) { mapper(session).setPrivateForRootComponentUuid(projectUuid, isPrivate); }
Source:
private void updateProjectDaoDependencies() { if (studyDao != null) studyDao.setProjectDAO(projectDao); if (sampleNumberPerProjectService != null) sampleNumberPerProjectService.setSqlProjectDAO(projectDao); if (referenceGenomeService != null) referenceGenomeService.setReferenceGenomeDao(referenceGenomeDao); }

Target:
private void updateProjectDaoDependencies() { if (studyDao != null) studyDao.setProjectDAO(projectDao); if (sampleNumberPerProjectService != null) sampleNumberPerProjectService.setSqlProjectDAO(projectDao); }
Source:
public void removeTagFromImage(String imageName, String tagToBeRemoved) { selectImage(imageName); new ContextMenu("Remove Tag").select(); String fullTag = ""; Combo combo = new DefaultCombo(); List<String> comboItems = combo.getItems(); for (String item : comboItems) { if (item.contains(tagToBeRemoved)) { fullTag = item; break; } } combo.setSelection(fullTag); ; new FinishButton().click(); }

Target:
public void removeTagFromImage(String imageName, String tagToBeRemoved) { selectImage(imageName); new ContextMenu("Remove Tag").select(); String fullTag = ""; Combo combo = new DefaultCombo(); List<String> comboItems = combo.getItems(); for (String item : comboItems) { if (item.contains(tagToBeRemoved)) { fullTag = item; break; } } combo.setSelection(fullTag); new FinishButton().click(); }
Source:
public void deleteFailOnNoIndexName() throws QueryException { im.ensureIndexed(Arrays.<FieldSort>asList(new FieldSort("name"), new FieldSort("address")), "basic"); assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); try { im.deleteIndex(null); Assert.fail("Expected deleteIndex to throw a QueryException"); } catch (QueryException qe) { ; } assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); try { im.deleteIndex(""); Assert.fail("Expected deleteIndex to throw a QueryException"); } catch (QueryException qe) { ; } assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); }

Target:
public void deleteFailOnNoIndexName() throws QueryException { im.ensureIndexed(Arrays.<FieldSort>asList(new FieldSort("name"), new FieldSort("address")), "basic"); assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); try { im.deleteIndex(null); Assert.fail("Expected deleteIndex to throw a IllegalArgumentException"); } catch (IllegalArgumentException iae) { ; } assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); try { im.deleteIndex(""); Assert.fail("Expected deleteIndex to throw a IllegalArgumentException"); } catch (IllegalArgumentException iae) { ; } assertThat(im.listIndexes(), contains(getIndexNameMatcher("basic"))); }
Source:
public void init() throws InitializationException { try { Set<Version> versions = getSupportedClusterLevels(); String devicePropertiesStr; deviceProperties = new HashMap<>(); for (Version version : versions) { devicePropertiesStr = getCustomDeviceProperties(version); if (FeatureSupported.deviceCustomProperties(version)) { deviceProperties.put(version, new EnumMap<VmDeviceGeneralType, Map<String, Pattern>>(VmDeviceGeneralType.class)); Matcher typeMatcher = devicePropSplitPattern.matcher(devicePropertiesStr); while (typeMatcher.find()) { String dcpStr = typeMatcher.group(); int start = TYPE_PREFIX_LEN; int end = dcpStr.length() - 1; if (dcpStr.endsWith(PROPERTIES_DELIMETER)) { end--; } dcpStr = dcpStr.substring(start, end); int idx = dcpStr.indexOf(PROPERTIES_DELIMETER); VmDeviceGeneralType type = VmDeviceGeneralType.forValue(dcpStr.substring(0, idx)); String propStr = dcpStr.substring(idx + PROP_PREFIX_LEN, dcpStr.length() - 1); Map<String, Pattern> props = new HashMap<String, Pattern>(); parsePropertiesRegex(propStr, props); deviceProperties.get(version).put(type, props); } } } } catch (Throwable ex) { throw new InitializationException(ex); } }

Target:
public void init() throws InitializationException { try { Set<Version> versions = getSupportedClusterLevels(); String devicePropertiesStr; deviceProperties = new HashMap<>(); for (Version version : versions) { devicePropertiesStr = getCustomDeviceProperties(version); if (FeatureSupported.deviceCustomProperties(version)) { deviceProperties.put(version, new EnumMap<VmDeviceGeneralType, Map<String, Pattern>>(VmDeviceGeneralType.class)); Matcher typeMatcher = devicePropSplitPattern.matcher(devicePropertiesStr); while (typeMatcher.find()) { String dcpStr = typeMatcher.group(); int start = TYPE_PREFIX_LEN; int end = dcpStr.length() - 1; if (dcpStr.endsWith(PROPERTIES_DELIMETER)) { end--; } dcpStr = dcpStr.substring(start, end); int idx = dcpStr.indexOf(PROPERTIES_DELIMETER); VmDeviceGeneralType type = VmDeviceGeneralType.forValue(dcpStr.substring(0, idx)); String propStr = dcpStr.substring(idx + PROP_PREFIX_LEN, dcpStr.length() - 1); Map<String, Pattern> props = new HashMap<String, Pattern>(); parsePropertiesRegex(propStr, props); deviceProperties.get(version).put(type, props); } } } } catch (Exception ex) { throw new InitializationException(ex); } }
Source:
private T handleClasspath(CompilationRequest req, T res) { T t; Map<String,Object> kieMap = req.getMap(); String classpathKey = req.getRequestUUID() + "." + STRING_CLASSPATH_KEY; Object o = kieMap.get(classpathKey); if(o != null){ Set<String> depsModules = (Set<String>) o; List<String> deps =CompilerClassloaderUtils.readItemsFromClasspathString(depsModules); t = (T) new DefaultCompilationResponse(res.isSuccessful(), res.getMavenOutput(), res.getWorkingDir().orElse(null), deps); }else{ t = (T) new DefaultCompilationResponse(res.isSuccessful(), res.getMavenOutput(), res.getWorkingDir().orElse(null)); } return t; }

Target:
private T handleClasspath(CompilationRequest req, T res) { T t; Map<String,Object> kieMap = req.getMap(); String classpathKey = req.getRequestUUID() + "." + STRING_CLASSPATH_KEY; Object o = kieMap.get(classpathKey); if(o != null){ Set<String> depsModules = (Set<String>) o; List<String> deps =CompilerClassloaderUtils.readItemsFromClasspathString(depsModules); t = (T) new DefaultCompilationResponse(res.isSuccessful(), res.getMavenOutput(), req.getInfo().getPrjPath(), deps); }else{ t = (T) new DefaultCompilationResponse(res.isSuccessful(), res.getMavenOutput(), req.getInfo().getPrjPath()); } return t; }
Source:
public void updateEvent(Event event, Position position) { updateEvent(event, position, false); }

Target:
public void updateEvent(Event event, Position position) { try { dataManager.addObject(event); } catch (SQLException error) { Log.warning(error); } Set<Long> users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId()); for (long userId : users) { if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) { Notification notification = getUserNotificationByType(userId, event.getType()); if (notification != null) { if (notification.getWeb()) { Context.getConnectionManager().updateEvent(userId, event); } if (notification.getMail()) { NotificationMail.sendMailAsync(userId, event, position); } if (notification.getSms()) { NotificationSms.sendSmsAsync(userId, event, position); } } } } if (Context.getEventForwarder() != null) { Context.getEventForwarder().forwardEvent(event, position); } }
Source:
public void cancelCreateTableTest() throws SQLException { String sql = format("CREATE TABLE %s AS " + "SELECT orderkey, partkey, shipinstruct FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); try { query(format("DROP TABLE %s", tableName)); throw new RuntimeException("cancelCreateTableTest failed"); } catch (QueryExecutionException exceptionDueToNonExistentTableName) { } }

Target:
public void cancelCreateTableTest() throws Exception { String tableName = format("cancel_createtable_%s", randomUUID().toString().replace("-", "")); String sql = format("CREATE TABLE %s AS " + "SELECT * FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); assertThat(() -> query(format("SELECT * from %s", tableName))) .failsWithMessage(format("Table hive.default.%s does not exist", tableName)); query(format("DROP TABLE IF EXISTS %s", tableName)); }
Source:
public JolieServiceLoader( Expression channelDest, Interpreter currInterpreter, String servicePath ) throws IOException, CommandLineException { super( channelDest ); final String[] ss = servicePathSplitPattern.split( servicePath ); final String[] options = currInterpreter.optionArgs(); final String[] newArgs = new String[ 2 + options.length + ss.length ]; newArgs[ 0 ] = "-i"; newArgs[ 1 ] = currInterpreter.programDirectory().getAbsolutePath(); newArgs[ 2 ] = "--serviceIdentifier"; newArgs[ 3 ] = new Long( Interpreter.getServiceIdentifier() ).toString(); System.arraycopy( options, 0, newArgs, 2, options.length ); System.arraycopy( ss, 0, newArgs, 2 + options.length, ss.length ); CommandLineParser commandLineParser = new CommandLineParser( newArgs, currInterpreter.getClassLoader(), false ); InterpreterParameters interpreterParameters = commandLineParser.getInterpreterParameters(); interpreter = new Interpreter( currInterpreter.getClassLoader(), commandLineParser.getInterpreterParameters(), currInterpreter.programDirectory() ); }

Target:
public JolieServiceLoader( Expression channelDest, Interpreter currInterpreter, String servicePath ) throws IOException, CommandLineException { super( channelDest ); final String[] ss = SERVICE_PATH_SPLIT_PATTERN.split( servicePath ); final String[] options = currInterpreter.optionArgs(); final String[] newArgs = new String[ 2 + options.length + ss.length ]; newArgs[ 0 ] = "-i"; newArgs[ 1 ] = currInterpreter.programDirectory().getAbsolutePath(); System.arraycopy( options, 0, newArgs, 2, options.length ); System.arraycopy( ss, 0, newArgs, 2 + options.length, ss.length ); CommandLineParser commandLineParser = new CommandLineParser( newArgs, currInterpreter.getClassLoader(), false ); interpreter = new Interpreter( currInterpreter.getClassLoader(), commandLineParser.getInterpreterParameters(), currInterpreter.programDirectory() ); }
Source:
private boolean validateNetworkInterfaces() { Map<String,VmNetworkInterface> interfaceNetworkMap = Entities.interfacesByNetworkName(getVm().getInterfaces()); Set<String> interfaceNetworkNames = interfaceNetworkMap.keySet(); List<network> clusterNetworks = DbFacade.getInstance() .getNetworkDAO() .getAllForCluster(getVm().getvds_group_id()); return isVmInterfacesConfigured(interfaceNetworkMap) && isVmInterfacesAttachedToClusterNetworks(clusterNetworks, interfaceNetworkNames) && isVmInterfacesAttachedToVmNetworks(clusterNetworks, interfaceNetworkNames); }

Target:
private boolean validateNetworkInterfaces() { Map<String,VmNetworkInterface> interfaceNetworkMap = Entities.interfacesByNetworkName(getVm().getInterfaces()); Set<String> interfaceNetworkNames = interfaceNetworkMap.keySet(); List<network> clusterNetworks = getNetworkDAO().getAllForCluster(getVm().getvds_group_id()); Set<String> clusterNetworksNames = Entities.objectNames(clusterNetworks); return isVmInterfacesConfigured(interfaceNetworkMap) && isVmInterfacesAttachedToClusterNetworks(clusterNetworksNames, interfaceNetworkNames) && isVmInterfacesAttachedToVmNetworks(clusterNetworks, interfaceNetworkNames); }
Source:
public static ArrayList<Guid> getGuidListFromString(String str) { if (str == null || str.isEmpty()) { return new ArrayList<Guid>(); } return getGuidListFromStringArray(Arrays.asList(str.split(SEPARATOR))); }

Target:
public static ArrayList<Guid> getGuidListFromString(String str) { if (StringHelper.isNullOrEmpty(str)) { return new ArrayList<Guid>(); } return getGuidListFromStringArray(Arrays.asList(str.split(SEPARATOR))); }
Source:
private void deleteGraphicalSynapseConfigFiles(IProject project) throws CoreException { IResource[] projectResources = project.members(); if (projectResources != null) { for (IResource projectResource : projectResources) { if (projectResource instanceof IFile) { if (ESB_FILE_EXTENSION.equals(projectResource.getFileExtension()) || ESB_DIAGRAM_FILE_EXTENSION.equals(projectResource.getFileExtension())) { projectResource.delete(true, new NullProgressMonitor()); } } } } }

Target:
private void deleteGraphicalSynapseConfigFiles(IProject project) throws CoreException { IResource[] projectResources = project.members(); for (IResource projectResource : projectResources) { if (projectResource instanceof IFile && (ESB_FILE_EXTENSION.equals(projectResource.getFileExtension()) || ESB_DIAGRAM_FILE_EXTENSION .equals(projectResource.getFileExtension()))) { projectResource.delete(true, new NullProgressMonitor()); } } }
Source:
public boolean deleteByParametersId(String layerName, String parametersId) throws StorageException { final File layerPath = getLayerPath(layerName); if (!layerPath.exists() || !layerPath.canWrite()) { log.info(layerPath + " does not exist or is not writable"); return false; } File[] parameterCaches = layerPath.listFiles(new FileFilter() { public boolean accept(File pathname) { if (!pathname.isDirectory()) { return false; } String dirName = pathname.getName(); return dirName.endsWith(parametersId); } }); for (File parameterCache : parameterCaches) { String target = filteredLayerName(layerName) + "_" + parameterCache.getName(); stageDelete(parameterCache, target); } listeners.sendParametersDeleted(layerName, parametersId); return true; }

Target:
public boolean deleteByParametersId(String layerName, String parametersId) throws StorageException { final File layerPath = getLayerPath(layerName); if (!layerPath.exists() || !layerPath.canWrite()) { log.info(layerPath + " does not exist or is not writable"); return false; } File[] parameterCaches = layerPath.listFiles((pathname)-> { if (!pathname.isDirectory()) { return false; } String dirName = pathname.getName(); return dirName.endsWith(parametersId); }); for (File parameterCache : parameterCaches) { String target = filteredLayerName(layerName) + "_" + parameterCache.getName(); stageDelete(parameterCache, target); } listeners.sendParametersDeleted(layerName, parametersId); return true; }
Source:
private void startInvocation( IInvocationContext context, ExecutableCommand cmd, IScheduledInvocationListener... listeners) { initInvocation(); throwIfDeviceInInvocationThread(context.getDevices()); int invocationId = cmd.getCommandTracker().getId(); CLog.d("starting invocation for command id %d", invocationId); final String invocationName = String.format("Invocation-%s", context.getSerials().get(0)); InvocationThread invocationThread = new InvocationThread(invocationName, context, cmd, listeners); if (context instanceof InvocationContext) { ((InvocationContext) context).setInvocationId(invocationId); } logInvocationStartedEvent(cmd.getCommandTracker(), context); invocationThread.start(); addInvocationThread(invocationThread); }

Target:
private void startInvocation( IInvocationContext context, ExecutableCommand cmd, IScheduledInvocationListener... listeners) { initInvocation(); throwIfDeviceInInvocationThread(context.getDevices()); int invocationId = cmd.getCommandTracker().getId(); CLog.d("starting invocation for command id %d", invocationId); final String invocationName = String.format("Invocation-%s", context.getSerials().get(0)); InvocationThread invocationThread = new InvocationThread(invocationName, context, cmd, listeners); context.addInvocationAttribute( IInvocationContext.INVOCATION_ID, Integer.toString(invocationId)); logInvocationStartedEvent(cmd.getCommandTracker(), context); invocationThread.start(); addInvocationThread(invocationThread); }
Source:
public Map<Long, Object> getBlock(final String dataType, final int blockId) { final Map<Integer, Block> blocks = typeToBlocks.get(dataType); if (null == blocks) { LOG.log(Level.WARNING, "Data in type {0} has never been stored. The result is empty", dataType); return Collections.emptyMap(); } final Block block = typeToBlocks.get(dataType).get(blockId); if (null == block) { LOG.log(Level.WARNING, "Block with id {0} does not exist.", blockId); return Collections.emptyMap(); } return block.getAll(); }

Target:
public Map<Long, Object> getBlock(final String dataType, final int blockId) { final Map<Integer, Block> blocks = typeToBlocks.get(dataType); if (null == blocks) { LOG.log(Level.WARNING, "Data in type {0} has never been stored. The result is empty", dataType); return Collections.emptyMap(); } final Block block = blocks.get(blockId); if (null == block) { LOG.log(Level.WARNING, "Block with id {0} does not exist.", blockId); return Collections.emptyMap(); } return block.getAll(); }
Source:
public byte[] getCacheKey() { return new byte[]{CACHE_TYPE_ID}; }

Target:
public byte[] getCacheKey() { return ByteBuffer.allocate(1 + 8) .put(CACHE_TYPE_ID) .putInt(this.index) .putInt(this.end) .array(); }
Source:
public <TYPE> TYPE followLink(TYPE object) { if (!isLink(object)) { throw new Error("Can't follow link because object don't have any"); } try { String href = ((Identified) object).href(); if (href == null) { throw new Error("Can't follow link because the 'href' attribute does't have a value"); } URL url = new URL(getUrl()); String prefix = url.getPath(); if (!prefix.endsWith("/")) { prefix += "/"; } if (!href.startsWith(prefix)) { throw new Error("The URL '" + href + "' isn't compatible with the base URL of the connection"); } String path = href.substring(prefix.length()); Service service = systemService().service(path); Method get = service.getClass().getMethod("get"); Object getRequest = get.invoke(service); Method send = getRequest.getClass().getMethod("send"); send.setAccessible(true); Object getResponse = send.invoke(getRequest); Method obtainObject = getResponse.getClass().getDeclaredMethods()[0]; obtainObject.setAccessible(true); return (TYPE) obtainObject.invoke(getResponse); } catch (NoSuchMethodException ex) { throw new Error(ex); } catch (IllegalAccessException ex) { throw new Error(ex); } catch (InvocationTargetException ex) { throw new Error(ex); } catch (MalformedURLException ex) { throw new Error(ex); } }

Target:
public <TYPE> TYPE followLink(TYPE object) { if (!isLink(object)) { throw new Error("Can't follow link because object don't have any"); } String href = ((Identified) object).href(); if (href == null) { throw new Error("Can't follow link because the 'href' attribute does't have a value"); } try { URL url = new URL(getUrl()); String prefix = url.getPath(); if (!prefix.endsWith("/")) { prefix += "/"; } if (!href.startsWith(prefix)) { throw new Error("The URL '" + href + "' isn't compatible with the base URL of the connection"); } String path = href.substring(prefix.length()); Service service = systemService().service(path); Method get = service.getClass().getMethod("get"); Object getRequest = get.invoke(service); Method send = getRequest.getClass().getMethod("send"); send.setAccessible(true); Object getResponse = send.invoke(getRequest); Method obtainObject = getResponse.getClass().getDeclaredMethods()[0]; obtainObject.setAccessible(true); return (TYPE) obtainObject.invoke(getResponse); } catch (NoSuchMethodException ex) { throw new Error(String.format("Unexpected error while following link \"%1$s\"", href), ex); } catch (IllegalAccessException ex) { throw new Error(String.format("Unexpected error while following link \"%1$s\"", href), ex); } catch (InvocationTargetException ex) { throw new Error(String.format("Unexpected error while following link \"%1$s\"", href), ex); } catch (MalformedURLException ex) { throw new Error(String.format("Error while creating URL \"%1$s\"", getUrl()), ex); } }
Source:
public void configurePipeline(MultiInputPipelineConfigurer pipelineConfigurer) { MultiInputStageConfigurer stageConfigurer = pipelineConfigurer.getMultiInputStageConfigurer(); Map<String, Schema> inputSchemas = stageConfigurer.getInputSchemas(); FailureCollector collector = pipelineConfigurer.getMultiInputStageConfigurer().getFailureCollector(); init(inputSchemas, collector); collector.getOrThrowException(); Schema outputSchema = getOutputSchema(inputSchemas, collector); if (outputSchema.getFields() != null && !outputSchema.getFields().isEmpty()) { stageConfigurer.setOutputSchema(outputSchema); } }

Target:
public void configurePipeline(MultiInputPipelineConfigurer pipelineConfigurer) { MultiInputStageConfigurer stageConfigurer = pipelineConfigurer.getMultiInputStageConfigurer(); Map<String, Schema> inputSchemas = stageConfigurer.getInputSchemas(); FailureCollector collector = pipelineConfigurer.getMultiInputStageConfigurer().getFailureCollector(); init(inputSchemas, collector); collector.getOrThrowException(); Schema outputSchema = getOutputSchema(inputSchemas, collector); if (outputSchema != null) { stageConfigurer.setOutputSchema(outputSchema); } }
Source:
private void setSubtreeChecked(Object element, boolean checked) { fCheckboxTreeViewer.setChecked(element, checked); if (checked) { fCheckboxTreeViewer.setGrayed(element, false); } fCheckboxTreeViewer.setChecked(element, checked); Object[] children = fContentProvider.getChildren(element); if (children != null) { for (Object child : children) { setSubtreeChecked(child, checked); } } }

Target:
private void setSubtreeChecked(Object element, boolean checked) { fCheckboxTreeViewer.setChecked(element, checked); if (checked) { fCheckboxTreeViewer.setGrayed(element, false); } Object[] children = fContentProvider.getChildren(element); if (children != null) { for (Object child : children) { setSubtreeChecked(child, checked); } } }
Source:
private void createCourseRelatedButtons(InstructorAttributes currentInstructor) { boolean isEditDeleteButtonDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); editCourseButton = createEditCourseButton(isEditDeleteButtonDisabled); deleteCourseButton = createDeleteCourseButton(isEditDeleteButtonDisabled); boolean isAddButtonDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); addInstructorButton = createAddInstructorButton(isAddButtonDisabled); }

Target:
private void createCourseRelatedButtons(InstructorAttributes currentInstructor) { boolean isEditDeleteCourseButtonDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); editCourseButton = createEditCourseButton(isEditDeleteCourseButtonDisabled); deleteCourseButton = createDeleteCourseButton(isEditDeleteCourseButtonDisabled); boolean isAddInstructorButtonDisabled = !currentInstructor.isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); addInstructorButton = createAddInstructorButton(isAddInstructorButtonDisabled); }
Source:
private String getTemplateDirectory(String template) { String templateDirectoryName; switch (infrastructure) { case openshift: case k8s: templateDirectoryName = Infrastructure.openshift.toString().toLowerCase(); break; case docker: default: templateDirectoryName = infrastructure.toString().toLowerCase(); } return String.format("/templates/workspace/%s/%s", templateDirectoryName, template); }

Target:
private String getTemplateDirectory(String template) { String templateDirectoryName; switch (infrastructure) { case OSIO: case K8S: templateDirectoryName = Infrastructure.OPENSHIFT.toString().toLowerCase(); break; default: templateDirectoryName = infrastructure.toString().toLowerCase(); } return String.format("/templates/workspace/%s/%s", templateDirectoryName, template); }
Source:
public void assignChildElement(Object parent, String nodeName, Object child) { ExtensionElements id = (ExtensionElements) parent; if (nodeName.equals(DMN_EXTERNAL_LINK)) { id.getExternalLinks().add((DMNExternalLink) child); } else { id.getAny().add(child); } }

Target:
public void assignChildElement(Object parent, String nodeName, Object child) { ExtensionElements id = (ExtensionElements) parent; if (Objects.equals(nodeName, DMN_EXTERNAL_LINK)) { id.getExternalLinks().add((DMNExternalLink) child); } else { id.getAny().add(child); } }
Source:
private WildcardPattern[] getExclusionPatterns() { if (exclusionPatterns == null) { if (StringUtils.isEmpty(exclusion)) { return new WildcardPattern[0]; } exclusionPatterns = PatternUtils.createPatterns(exclusion); } return exclusionPatterns; }

Target:
private WildcardPattern[] getExclusionPatterns() { if (exclusionPatterns == null) { if (StringUtils.isEmpty(exclusion)) { exclusionPatterns = new WildcardPattern[0]; } else { exclusionPatterns = PatternUtils.createPatterns(exclusion); } } return exclusionPatterns; }
Source:
public void commit(Xid xid, boolean b) throws XAException { assertIfRecoveryScanWasStarted(); delegate.commit(xid, b); }

Target:
public void commit(Xid xid, boolean b) throws XAException { delegate.commit(xid, b); }
Source:
private void initSqlTypes() { sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "SMALLINT"); sqlTypes.put("ROLLERSHUTTERITEM", "SMALLINT"); sqlTypes.put("STRINGITEM", "VARCHAR(32000)"); sqlTypes.put("TABLEPRIMARYVALUE", "CURRENT_TIMESTAMP"); logger.debug("JDBC::initEtendedSqlTypes: Initialize the type array sqlTypes={}", sqlTypes.values()); }

Target:
private void initSqlTypes() { sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "SMALLINT"); sqlTypes.put("ROLLERSHUTTERITEM", "SMALLINT"); sqlTypes.put("STRINGITEM", "VARCHAR(32000)"); sqlTypes.put("tablePrimaryValue", "CURRENT_TIMESTAMP"); logger.debug("JDBC::initEtendedSqlTypes: Initialize the type array sqlTypes={}", sqlTypes.values()); }
Source:
public boolean isSnapshotExist(final Guid id) { return execute(new Callable<Boolean>() { @Override public Boolean call() { try { Snapshot snapshot = proxy.getSnapshotById(id.toString()); return snapshot != null; } catch (OpenStackResponseException ex) { if (ex.getStatus() == HttpStatus.SC_NOT_FOUND) { return false; } throw ex; } } }); }

Target:
public boolean isSnapshotExist(final Guid id) { return execute(new Callable<Boolean>() { @Override public Boolean call() { try { Snapshot snapshot = proxy.getSnapshotById(id.toString()); return snapshot != null; } catch (OpenStackResponseException ex) { if (ex.getStatus() == HttpStatus.SC_NOT_FOUND) { log.info("Snapshot does not exists"); return false; } else { log.error("An error has occurred while looking for snapshot."); throw ex; } } } }); }
Source:
private String getBody() { String jobID = jobState.getId().value(); String status = jobState.getStatus().toString(); String hostname = "UNKNOWN"; List<TaskState> tasks = jobState.getTasks(); StringBuilder taskStatus = new StringBuilder(); for (TaskState task : tasks) { taskStatus.append(task.getId().getReadableName() + " (" + task.getId().toString() + ") Status: " + task.getStatus().toString() + "\n"); } try { hostname = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { logger.debug("Could not get hostname", e); } return String.format(BODY_TEMPLATE, jobID, status, taskStatus.toString(), hostname); }

Target:
private String getBody() { String jobID = jobState.getId().value(); String status = jobState.getStatus().toString(); String hostname = "UNKNOWN"; List<TaskState> tasks = jobState.getTasks(); String allTaskStatusesString = String.join(System.lineSeparator(), tasks.stream() .map(task -> task.getId().getReadableName() + " (" + task.getId().toString() + ") Status: " + task.getStatus().toString()) .collect(Collectors.toList())); try { hostname = InetAddress.getLocalHost().getCanonicalHostName(); } catch (UnknownHostException e) { logger.debug("Could not get hostname", e); } return String.format(BODY_TEMPLATE, jobID, status, allTaskStatusesString, hostname); }
Source:
public void orderMethods(MethodOrdererContext context) { Map<String, String[]> digraph = context.getMethodDescriptors().stream().filter( descriptor -> descriptor.isAnnotated(DependsOn.class)).collect( toMap(descriptor -> descriptor.getMethod().getName(), descriptor -> descriptor.findAnnotation(DependsOn.class).map(DependsOn::value).get())); Map<String, Integer> dependencySize = new HashMap<>(); try { digraph.keySet().forEach(name -> { if (!dependencySize.containsKey(name)) { depthFirstSearch(name, digraph, dependencySize); } }); } catch (IllegalArgumentException exception) { logger.error(exception, () -> "ERROR - Some arguments from @DependsOn annotations form cyclic dependencies, which would cause undefined behavior!"); } context.getMethodDescriptors().sort( Comparator.comparing(descriptor -> dependencySize.getOrDefault(descriptor.getMethod().getName(), 0))); }

Target:
public void orderMethods(MethodOrdererContext context) { Map<String, String[]> digraph = context.getMethodDescriptors().stream().filter( descriptor -> descriptor.isAnnotated(DependsOn.class)).collect( toMap(descriptor -> descriptor.getMethod().getName(), descriptor -> descriptor.findAnnotation(DependsOn.class).map(DependsOn::value).get())); Map<String, Integer> dependencySize = new HashMap<>(); try { digraph.keySet().forEach(name -> depthFirstSearch(name, digraph, dependencySize)); } catch (IllegalArgumentException exception) { logger.error(exception, () -> "ERROR - Some arguments from @DependsOn annotations form cyclic dependencies, which would cause undefined behavior!"); } context.getMethodDescriptors().sort( Comparator.comparing(descriptor -> dependencySize.getOrDefault(descriptor.getMethod().getName(), INDEPENDENT_TEST_PRIORITY))); }
Source:
public ArrayList<ElementTag> getFeedbackSessionTypeOptions(String defaultSessionType) { ArrayList<ElementTag> result = new ArrayList<ElementTag>(); ElementTag standardFeedbackSession = createOption("Session with your own questions", "STANDARD", defaultSessionType == null || defaultSessionType.equals("TEAMEVALUATION")); ElementTag evaluationFeedbackSession = createOption("Team peer evaluation session", "TEAMEVALUATION", defaultSessionType == null || defaultSessionType.equals("TEAMEVALUATION")); result.add(standardFeedbackSession); result.add(evaluationFeedbackSession); return result; }

Target:
private ArrayList<ElementTag> getFeedbackSessionTypeOptions(String defaultSessionType) { ArrayList<ElementTag> result = new ArrayList<ElementTag>(); ElementTag standardFeedbackSession = createOption("Session with your own questions", "STANDARD", defaultSessionType != null && defaultSessionType.equals("STANDARD")); ElementTag evaluationFeedbackSession = createOption("Team peer evaluation session", "TEAMEVALUATION", defaultSessionType == null || defaultSessionType.equals("TEAMEVALUATION")); result.add(standardFeedbackSession); result.add(evaluationFeedbackSession); return result; }