auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String logout(RequestContext requestContext) { HttpSession session = requestContext.getRequest().getSession(false); String logoutUrl = "<LINK_0>"; if (!isLoggedInToGoogle(session)) { return null; } else { try { return String.format(GOOGLE_LOGOUT_URL, logoutUrl); } finally { setGoogleLoggedIn(session, false); } } }

Target:
public String logout(RequestContext requestContext) { HttpSession session = requestContext.getRequest().getSession(false); String logoutUrl = String.format("%s/users/logout.page", getBaseUrl(requestContext)); if (!isLoggedInToGoogle(session)) { return null; } else { try { return String.format(GOOGLE_LOGOUT_URL, logoutUrl); } finally { setGoogleLoggedIn(session, false); } } }
Source:
public void loadScript(String scriptIdentifier, InputStreamReader scriptData) { ScriptEngineContainer container = loadedScriptEngineInstances.get(scriptIdentifier); if (container == null) { logger.error("could not load script as no engine is created"); } else { ScriptEngine engine = container.getScriptEngine(); try { engine.eval(scriptData); if (engine instanceof Invocable) { Invocable inv = (Invocable) engine; try { inv.invokeFunction("scriptLoaded", scriptIdentifier); } catch (NoSuchMethodException e) { logger.trace("scriptLoaded() not defined in script: " + scriptIdentifier); } } else { logger.trace("engine does not support Invocable interface"); } } catch (Exception ex) { logger.error("Error during Script evaluation {}", scriptIdentifier, ex); } } }

Target:
public void loadScript(String scriptIdentifier, InputStreamReader scriptData) { ScriptEngineContainer container = loadedScriptEngineInstances.get(scriptIdentifier); if (container == null) { logger.error("could not load script as no engine is created"); } else { ScriptEngine engine = container.getScriptEngine(); try { engine.eval(scriptData); if (engine instanceof Invocable) { Invocable inv = (Invocable) engine; try { inv.invokeFunction("scriptLoaded", scriptIdentifier); } catch (NoSuchMethodException e) { logger.trace("scriptLoaded() not defined in script: {}", scriptIdentifier); } } else { logger.trace("engine does not support Invocable interface"); } } catch (Exception ex) { logger.error("Error during Script evaluation {}", scriptIdentifier, ex); } } }
Source:
public Integer next() { return next++; }

Target:
public Integer next() { if (next >= size) { throw new NoSuchElementException(); } return next++; }
Source:
public @ResponseBody String doesRecipientExist(HttpSession session, @RequestParam(value = "recipient") String username) { if (session.getAttribute("member") == null) return "redirect:../denied"; MemberDao memberDao = new MemberDao(); Member member = memberDao.getMemberByUsername(username); String isValid; if (member == null) { isValid = "{ \"valid\": false }"; } else { isValid = "{ \"valid\": true }"; } return isValid; }

Target:
public @ResponseBody String doesRecipientExist( HttpSession session, @RequestParam(value = "recipient") String username) { if (session.getAttribute("member") == null) return "redirect:/denied"; MemberDao memberDao = new MemberDao(); Member member = memberDao.getMemberByUsername(username); String isValid; if (member == null) { isValid = "{ \"valid\": false }"; } else { isValid = "{ \"valid\": true }"; } return isValid; }
Source:
public synchronized void commit() throws SQLException { try { debugCodeCall("commit"); checkClosedForWrite(); if (SysProperties.FORCE_AUTOCOMMIT_OFF_ON_COMMIT && getAutoCommit()) { throw DbException.get(ErrorCode.METHOD_DISABLED_ON_AUTOCOMMIT_TRUE, "COMMIT"); } try { commit = prepareCommand("COMMIT", commit); commit.executeUpdate(false); } finally { afterWriting(); } } catch (Exception e) { throw logAndConvert(e); } }

Target:
public synchronized void commit() throws SQLException { try { debugCodeCall("commit"); checkClosedForWrite(); if (SysProperties.FORCE_AUTOCOMMIT_OFF_ON_COMMIT && getAutoCommit()) { throw DbException.get(ErrorCode.METHOD_DISABLED_ON_AUTOCOMMIT_TRUE, "commit()"); } try { commit = prepareCommand("COMMIT", commit); commit.executeUpdate(false); } finally { afterWriting(); } } catch (Exception e) { throw logAndConvert(e); } }
Source:
private void ensureStorageFormatInitialized() { StorageDomain sd = getStorageDomain(); if (sd.getStorageFormat() == null) { if (sd.getStorageDomainType().isDataDomain()) { StoragePool sp = getTargetStoragePool(); if (sp != null) { sd.setStorageFormat(VersionStorageFormatUtil.getPreferredForVersion( sp.getcompatibility_version(), sd.getStorageType()) ); } else { if (sd.getStorageType().isBlockDomain()) { sd.setStorageFormat(StorageFormatType.V2); } else { sd.setStorageFormat(StorageFormatType.V1); } } } else { sd.setStorageFormat(StorageFormatType.V1); } } }

Target:
private void ensureStorageFormatInitialized() { StorageDomain sd = getStorageDomain(); if (sd.getStorageFormat() == null) { if (sd.getStorageDomainType().isDataDomain()) { StoragePool sp = getTargetStoragePool(); if (sp != null) { sd.setStorageFormat(VersionStorageFormatUtil.getPreferredForVersion( sp.getcompatibility_version(), sd.getStorageType()) ); } } else { sd.setStorageFormat(StorageFormatType.V1); } } }
Source:
public static GridCellEditAction getSupportedEditAction(final AbstractNodeMouseEvent event) { return Arrays.asList(values()) .stream() .filter(action -> Objects.equals(action.eventClass, event.getClass())) .findFirst() .orElse(NONE); }

Target:
public static GridCellEditAction getSupportedEditAction(final AbstractNodeMouseEvent event) { return Arrays.stream(values()) .filter(action -> Objects.equals(action.eventClass, event.getClass())) .findFirst() .orElse(NONE); }
Source:
public static void resetSession(H2PooledConnection conn) { Session s = session(conn); s.setVariable("IGNITE_QUERY_CONTEXT", ValueNull.INSTANCE); }

Target:
public static void resetSession(H2PooledConnection conn) { Session s = session(conn); s.setVariable(QCTX_VARIABLE_NAME, ValueNull.INSTANCE); }
Source:
public void setupUserStatusToggle() { userStatusToggle = mNavigationHeader.findViewById(R.id.user_status_toggle); if (PrefManager.getUserStatus() == Constants.USER_OFFLINE) { userStatusToggle.setChecked(true); } userStatusToggle.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (PrefManager.getUserStatus() == Constants.USER_OFFLINE) { PrefManager.setUserStatus(Constants.USER_ONLINE); Toaster.show(mNavigationHeader, R.string.online_mode, Toaster.SHORT); userStatusToggle.setChecked(false); } else { PrefManager.setUserStatus(Constants.USER_OFFLINE); Toaster.show(mNavigationHeader, R.string.offline_mode, Toaster.SHORT); userStatusToggle.setChecked(true); } } }); }

Target:
public void setupUserStatusToggle() { userStatusToggle = mNavigationHeader.findViewById(R.id.user_status_toggle); if (PrefManager.getUserStatus() == Constants.USER_OFFLINE) { userStatusToggle.setChecked(true); } userStatusToggle.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (PrefManager.getUserStatus() == Constants.USER_OFFLINE) { PrefManager.setUserStatus(Constants.USER_ONLINE); userStatusToggle.setText(R.string.online_mode); userStatusToggle.setChecked(false); } else { PrefManager.setUserStatus(Constants.USER_OFFLINE); userStatusToggle.setText(R.string.offline_mode); userStatusToggle.setChecked(true); } } }); }
Source:
public static void tearDownAfterClass() throws Exception { file.delete(true, new NullProgressMonitor()); project.delete(true, new NullProgressMonitor()); }

Target:
public static void tearDownAfterClass() throws Exception { GenericEditorTestUtils.tearDownAfterClass(); }
Source:
public void remoteCallsStillMadeIfPingableLeader404s() throws IOException, InterruptedException { availableServer.stubFor(LEADER_UUID_MAPPING.willReturn(aResponse().withStatus(404))); when(config.leader()).thenReturn(Optional.of(ImmutableLeaderConfig.builder() .localServer(getUriForPort(availablePort)) .addLeaders(getUriForPort(availablePort)) .acceptorLogDir(temporaryFolder.newFolder()) .learnerLogDir(temporaryFolder.newFolder()) .quorumSize(1) .build())); TransactionManagers.LockAndTimestampServices lockAndTimestampServices = TransactionManagers.createLockAndTimestampServices( config, environment, LockServiceImpl::create, InMemoryTimestampService::new, invalidator, USER_AGENT); availableServer.verify(getRequestedFor(urlMatching(LEADER_UUID_PATH))); lockAndTimestampServices.timestamp().getFreshTimestamp(); lockAndTimestampServices.lock().currentTimeMillis(); availableServer.verify(postRequestedFor(urlMatching(TIMESTAMP_PATH)) .withHeader(USER_AGENT_HEADER, WireMock.equalTo(USER_AGENT))); availableServer.verify(postRequestedFor(urlMatching(LOCK_PATH)) .withHeader(USER_AGENT_HEADER, WireMock.equalTo(USER_AGENT))); }

Target:
public void remoteCallsStillMadeIfPingableLeader404s() throws IOException, InterruptedException { availableServer.stubFor(LEADER_UUID_MAPPING.willReturn(aResponse().withStatus(404))); when(config.leader()).thenReturn(Optional.of(ImmutableLeaderConfig.builder() .localServer(getUriForPort(availablePort)) .addLeaders(getUriForPort(availablePort)) .acceptorLogDir(temporaryFolder.newFolder()) .learnerLogDir(temporaryFolder.newFolder()) .quorumSize(1) .build())); TransactionManagers.LockAndTimestampServices lockAndTimestampServices = TransactionManagers.createLockAndTimestampServices( config, environment, LockServiceImpl::create, InMemoryTimestampService::new, invalidator, USER_AGENT); availableServer.verify(getRequestedFor(urlMatching(LEADER_UUID_PATH))); lockAndTimestampServices.timelock().getFreshTimestamp(); lockAndTimestampServices.lock().currentTimeMillis(); availableServer.verify(postRequestedFor(urlMatching(TIMESTAMP_PATH)) .withHeader(USER_AGENT_HEADER, WireMock.equalTo(USER_AGENT))); availableServer.verify(postRequestedFor(urlMatching(LOCK_PATH)) .withHeader(USER_AGENT_HEADER, WireMock.equalTo(USER_AGENT))); }
Source:
protected void paintComponent(Graphics g) { if(isIndeterminate()){ } final int width = getWidth(); final int height = getHeight(); if (isOpaque()) { g.setColor(WidgetUtils.BG_COLOR_DARK); g.fillRect(0, 0, width, height); } final int barWidth; if(isIndeterminate()){ barWidth = 0; } else { barWidth = getBarWidth(getValue()); } if (barWidth > 0) { g.setColor(_progressBarColor); g.fillRect(0, 0, barWidth, height / 2); g.setColor(WidgetUtils.slightlyDarker(_progressBarColor)); g.fillRect(0, height / 2, barWidth, height / 2); g.setColor(WidgetUtils.slightlyBrighter(_progressBarColor)); g.drawRect(0, 0, barWidth, height); } }

Target:
protected void paintComponent(Graphics g) { final int width = getWidth(); final int height = getHeight(); if (isOpaque()) { g.setColor(WidgetUtils.BG_COLOR_DARK); g.fillRect(0, 0, width, height); } final int barWidth; if (isIndeterminate()) { barWidth = 0; } else { barWidth = getBarWidth(getValue()); } if (barWidth > 0) { g.setColor(_progressBarColor); g.fillRect(0, 0, barWidth, height / 2); g.setColor(WidgetUtils.slightlyDarker(_progressBarColor)); g.fillRect(0, height / 2, barWidth, height / 2); g.setColor(WidgetUtils.slightlyBrighter(_progressBarColor)); g.drawRect(0, 0, barWidth, height); } }
Source:
public static String parseModelId(String operationLocation) { if (!CoreUtils.isNullOrEmpty(operationLocation)) { return operationLocation.substring(operationLocation.lastIndexOf('/') + 1); } throw LOGGER.logExceptionAsError(new RuntimeException("Failed to parse operation header for result Id.")); }

Target:
public static String parseModelId(String operationLocation) { if (!CoreUtils.isNullOrEmpty(operationLocation)) { int lastIndex = operationLocation.lastIndexOf('/'); if (lastIndex != -1) { return operationLocation.substring(lastIndex + 1); } } throw LOGGER.logExceptionAsError( new RuntimeException("Failed to parse operation header for result Id from: " + operationLocation)); }
Source:
public void deleteCartInStoreWithDataErasure() { StoreFixtures.withStore(client(), store -> { final CartDraft cartDraft = CartDraft.of(EUR).withCountry(DE); final Cart cart = client().executeBlocking(CartInStoreCreateCommand.of(store.getKey(), cartDraft)); assertThat(cart).isNotNull(); assertThat(cart.getStore()).isNotNull(); assertThat(cart.getStore().getKey()).isEqualTo(store.getKey()); client().executeBlocking(CartInStoreDeleteCommand.of(store.getKey(), cart, true)); PagedQueryResult<Cart> result = client().executeBlocking(CartQuery.of().withPredicates(cartQueryModel -> cartQueryModel.id().is(cart.getId()))); assertThat(result.getResults().size()).isZero(); }); }

Target:
public void deleteCartInStoreWithDataErasure() { withStore(client(), store -> { final CartDraft cartDraft = CartDraft.of(EUR).withCountry(DE); final Cart cart = client().executeBlocking(CartInStoreCreateCommand.of(store.getKey(), cartDraft)); assertThat(cart).isNotNull(); assertThat(cart.getStore()).isNotNull(); assertThat(cart.getStore().getKey()).isEqualTo(store.getKey()); client().executeBlocking(CartInStoreDeleteCommand.of(store.getKey(), cart, true)); PagedQueryResult<Cart> result = client().executeBlocking(CartQuery.of().withPredicates(cartQueryModel -> cartQueryModel.id().is(cart.getId()))); assertThat(result.getResults().size()).isZero(); }); }
Source:
public void run() { ConfigContext config = buildConfig(); if (usingEncryption) { config = buildEncryptionConfig(); } try (MantaClient client = new MantaClient(config)) { if (inferOutputFileName) { outputFileName = MantaUtils.lastItemInPath(filePath); } final MantaHttpHeaders headers = new MantaHttpHeaders(); headers.setByteRange(startBytes, endBytes); if (outputFileName != null) { try (OutputStream out = new FileOutputStream(outputFileName); MantaObjectInputStream objectStream = client.getAsInputStream(filePath, headers)) { IOUtils.copyLarge(objectStream, out); out.flush(); } catch (IOException e) { throw new UncheckedIOException(e); } } } }

Target:
public void run() { ConfigContext config = buildConfig(); if (usingEncryption) { config = buildEncryptionConfig(); } try (MantaClient client = new MantaClient(config)) { if (inferOutputFileName) { outputFileName = MantaUtils.lastItemInPath(filePath); } MantaHttpHeaders headers = new MantaHttpHeaders(); if (startBytes != null) { headers.setByteRange(startBytes, endBytes); } if (outputFileName != null) { try (OutputStream out = new FileOutputStream(outputFileName); MantaObjectInputStream objectStream = client.getAsInputStream(filePath, headers)) { IOUtils.copyLarge(objectStream, out); out.flush(); } catch (IOException e) { throw new UncheckedIOException(e); } } } }
Source:
public void testParseDeleteSkipTrash() { DistCpOptions options = OptionsParser.parse(new String[] { "-overwrite", "-delete", "-useTrash", "hdfs://localhost:8020/source/first", "hdfs://localhost:8020/target/"}); Assert.assertTrue(options.shouldDeleteUseTrash()); options = OptionsParser.parse(new String[] { "-overwrite", "-delete", "hdfs://localhost:8020/source/first", "hdfs://localhost:8020/target/"}); Assert.assertFalse(options.shouldDeleteUseTrash()); }

Target:
public void testParseDeleteSkipTrash() { DistCpOptions options = OptionsParser.parse(new String[] { "-overwrite", "-delete", "-useTrash", "hdfs://localhost:8020/source/first", "hdfs://localhost:8020/target/"}); Assert.assertTrue("Delete with useTrash.", options.shouldDeleteUseTrash()); options = OptionsParser.parse(new String[] { "-overwrite", "-delete", "hdfs://localhost:8020/source/first", "hdfs://localhost:8020/target/"}); Assert.assertFalse("Delete does not use trash.", options.shouldDeleteUseTrash()); }
Source:
private void checkImageTarget() { if (getVm().getOrigin() == OriginType.KVM && getActionState() == CommandActionState.EXECUTE) { StorageDomain domain = storageDomainDao.get(getStorageDomainId()); for (DiskImage image : getVm().getImages()) { if (domain.getStorageType().isBlockDomain()) { image.setActualSizeInBytes(image.getSize()); } } } }

Target:
private void checkImageTarget() { if (getVm().getOrigin() == OriginType.KVM && getActionState() == CommandActionState.EXECUTE) { StorageDomain domain = storageDomainDao.get(getStorageDomainId()); if (domain.getStorageType().isBlockDomain()) { getVm().getImages().forEach(image -> image.setActualSizeInBytes(image.getSize())); } } }
Source:
public Future<Void> asynchronousPreInitializationEventHandler(FMLPreInitializationEvent e) { CompletableFuture[] futures = Stream.of(1,2,3,4,5,6,7,8,9,10) .map(i -> CompletableFuture.runAsync(AsynchronousEventHandlerTest::doSomeStuffThatTakesALongTime)) .collect(Collectors.toList()) .toArray(new CompletableFuture[10]); return CompletableFuture.allOf(futures); }

Target:
public Future<Void> asynchronousPreInitializationEventHandler(FMLPreInitializationEvent e) { CompletableFuture[] futures = IntStream.range(1, 10) .boxed() .map(i -> CompletableFuture.runAsync(AsynchronousEventHandlerTest::doSomeStuffThatTakesALongTime)) .collect(Collectors.toList()) .toArray(new CompletableFuture[10]); return CompletableFuture.allOf(futures); }
Source:
private static void validateRequestMethod(HttpServletRequest req) throws MethodNotAllowedException { if (!"GET".equals(req.getMethod()) && !"HEAD".equals(req.getMethod())) { throw new MethodNotAllowedException(); } }

Target:
private static void validateRequestMethod(HttpServletRequest req) throws MethodNotAllowedException { if (!("GET".equals(req.getMethod()) || "HEAD".equals(req.getMethod()))) { throw new MethodNotAllowedException(); } }
Source:
private KieCompilationResponse compileAndLoadKieJarMetadataAllResourcesPackagedJar() { String alternateSettingsAbsPath = TestUtilMaven.getSettingsFile(); ; Path tmpRoot = Files.createTempDirectory("repo_" + UUID.randomUUID().toString()); Path tmp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); try { TestUtil.copyTree(Paths.get(ResourcesConstants.KJAR_2_ALL_RESOURCES), tmp); } catch (Exception e) { logger.error(e.getMessage()); } final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(KieDecorator.KIE_AND_LOG_AFTER); final WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); final CompilationRequest req = new DefaultCompilationRequest(mavenRepo, info, new String[]{ MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); final KieCompilationResponse res = (KieCompilationResponse) compiler.compile(req); logger.info("\nFinished " + res.isSuccessful() + " all Metadata tmp:" + tmp + " UUID:" + req.getRequestUUID() + " res.getMavenOutput().isEmpty():" + res.getMavenOutput().isEmpty()); if (!res.isSuccessful()) { try { logger.error("writing output on target folder:" + tmp); TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ConcurrentBuildTest.compileAndLoadKieJarMetadataAllResourcesPackagedJar_" + req.getRequestUUID()); } catch (Exception e) { logger.error(e.getMessage()); } } latch.countDown(); return res; }

Target:
private KieCompilationResponse compileAndLoadKieJarMetadataAllResourcesPackagedJar() { String alternateSettingsAbsPath = TestUtilMaven.getSettingsFile(); Path tmpRoot = Files.createTempDirectory("repo_" + UUID.randomUUID().toString()); Path tmp = Files.createDirectories(Paths.get(tmpRoot.toString(), "dummy")); try { TestUtil.copyTree(Paths.get(ResourcesConstants.KJAR_2_ALL_RESOURCES), tmp); } catch (Exception e) { logger.error(e.getMessage()); } final AFCompiler compiler = KieMavenCompilerFactory.getCompiler(KieDecorator.KIE_AND_LOG_AFTER); final WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(tmp); final CompilationRequest req = new DefaultCompilationRequest(mavenRepo, info, new String[]{ MavenCLIArgs.COMPILE, MavenCLIArgs.ALTERNATE_USER_SETTINGS + alternateSettingsAbsPath }, Boolean.FALSE); final KieCompilationResponse res = (KieCompilationResponse) compiler.compile(req); logger.info("\nFinished " + res.isSuccessful() + " all Metadata tmp:" + tmp + " UUID:" + req.getRequestUUID() + " res.getMavenOutput().isEmpty():" + res.getMavenOutput().isEmpty()); if (!res.isSuccessful()) { try { logger.error("writing output on target folder:" + tmp); TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ConcurrentBuildTest.compileAndLoadKieJarMetadataAllResourcesPackagedJar_" + req.getRequestUUID()); } catch (Exception e) { logger.error(e.getMessage()); } } latch.countDown(); return res; }
Source:
public ListenableFuture<PartitionedConsumption<Supplier<LookupSource>>> finishProbeOperator(OptionalInt lookupJoinsCount) { rwLock.writeLock().lock(); try { if (!spillingInfo.hasSpilled()) { finishedProbeOperators++; return immediateFuture(new PartitionedConsumption<>(1, emptyList(), i -> { throw new UnsupportedOperationException(); }, i -> { })); } int operatorsCount = lookupJoinsCount .orElseThrow(() -> new IllegalStateException("Indeterminate number of LookupJoinOperator-s when using spill to disk. This is a bug.")); checkState(finishedProbeOperators < operatorsCount, "%s probe operators finished out of %s declared", finishedProbeOperators + 1, operatorsCount); if (!partitionedConsumptionParticipants.isPresent()) { partitionedConsumptionParticipants = OptionalInt.of(operatorsCount - finishedProbeOperators); } finishedProbeOperators++; if (finishedProbeOperators == operatorsCount) { freePartitions(); verify(!partitionedConsumption.isDone()); partitionedConsumption.set(new PartitionedConsumption<>( partitionedConsumptionParticipants.getAsInt(), spilledPartitions.keySet(), this::loadSpilledLookupSource, this::disposeSpilledLookupSource)); } return partitionedConsumption; } finally { rwLock.writeLock().unlock(); } }

Target:
public ListenableFuture<PartitionedConsumption<Supplier<LookupSource>>> finishProbeOperator(OptionalInt lookupJoinsCount) { lock.writeLock().lock(); try { if (!spillingInfo.hasSpilled()) { finishedProbeOperators++; return immediateFuture(new PartitionedConsumption<>( 1, emptyList(), i -> { throw new UnsupportedOperationException(); }, i -> {})); } int operatorsCount = lookupJoinsCount .orElseThrow(() -> new IllegalStateException("A fixed distribution is required for JOIN when spilling is enabled")); checkState(finishedProbeOperators < operatorsCount, "%s probe operators finished out of %s declared", finishedProbeOperators + 1, operatorsCount); if (!partitionedConsumptionParticipants.isPresent()) { partitionedConsumptionParticipants = OptionalInt.of(operatorsCount - finishedProbeOperators); } finishedProbeOperators++; if (finishedProbeOperators == operatorsCount) { freePartitions(); verify(!partitionedConsumption.isDone()); partitionedConsumption.set(new PartitionedConsumption<>( partitionedConsumptionParticipants.getAsInt(), spilledPartitions.keySet(), this::loadSpilledLookupSource, this::disposeSpilledLookupSource)); } return partitionedConsumption; } finally { lock.writeLock().unlock(); } }
Source:
public void testConsistentIdConfiguredInIgniteCfgAndJvmProp() throws Exception { defConsistentId = "IgniteCfg consistent id"; String specificConsistentId = "JvmProp consistent id"; System.setProperty(IgniteSystemProperties.IGNITE_CONSISTENT_ID, specificConsistentId); Ignite ignite = startGrid(0); assertEquals(specificConsistentId, ignite.configuration().getConsistentId()); assertEquals(specificConsistentId, ignite.cluster().localNode().consistentId()); info("Consistent id in that case: " + ignite.cluster().localNode().consistentId()); }

Target:
public void testConsistentIdConfiguredInIgniteCfgAndJvmProp() throws Exception { defConsistentId = "IgniteCfg consistent id"; String specificConsistentId = "JvmProp consistent id"; System.setProperty(IgniteSystemProperties.IGNITE_OVERRIDE_CONSISTENT_ID, specificConsistentId); Ignite ignite = startGrid(0); assertEquals(specificConsistentId, ignite.configuration().getConsistentId()); assertEquals(specificConsistentId, ignite.cluster().localNode().consistentId()); info("Consistent ID: " + ignite.cluster().localNode().consistentId()); }
Source:
public int hashCode() { return Objects.hash(fEntry, fTime, fDuration, getValue()); }

Target:
public int hashCode() { return Objects.hash(fEntry, fTime, fDuration, getValue(), getActiveProperties()); }
Source:
private ExecRow getIndexRow(int i, ExecRow locatedRow) throws StandardException { int col = 1; for (int j = 0; i< sortedIndexRowColMap[i].length;j++) { indexRows[i].setColumn(col, locatedRow.getColumn(sortedIndexRowColMap[i][j])); col++; } indexRows[i].setKey(locatedRow.getKey()); return indexRows[i]; }

Target:
private ExecRow getIndexRow(int i, ExecRow locatedRow) throws StandardException { int col = 1; for (int j = 0; j< sortedIndexRowColMap[i].length;j++) { indexRows[i].setColumn(col, locatedRow.getColumn(sortedIndexRowColMap[i][j])); col++; } indexRows[i].setKey(locatedRow.getKey()); return indexRows[i]; }
Source:
public static int getSimpleType(Type type){ int tc = type.getTypeCode(); switch(tc){ case Type.POINT: case Type.MULTIPOINT: return POINT; case Type.LINESTRING: case Type.MULTILINESTRING: return LINE; case Type.POLYGON: case Type.MULTIPOLYGON: return POLYGON; case Type.GEOMETRYCOLLECTION: case Type.GEOMETRY: return ALL; } throw new IllegalArgumentException("Can't recognize "+tc+" as a geometry type"); }

Target:
public static int getSimpleType(Type type){ int tc = type.getTypeCode(); switch(tc){ case Type.POINT: case Type.MULTIPOINT: return POINT; case Type.LINESTRING: case Type.MULTILINESTRING: return LINE; case Type.POLYGON: case Type.MULTIPOLYGON: return POLYGON; case Type.GEOMETRYCOLLECTION: case Type.GEOMETRY: return ALL; default: throw new IllegalArgumentException("Can't recognize " + tc + " as a geometry type"); } }
Source:
void uploadFiles() { StringBuffer agentPublicIps = new StringBuffer(); if (!isLocal(simulatorProperties)) { List<AgentData> agents = componentRegistry.getAgents(); for (AgentData agentData : agents) { agentPublicIps.append(agentData.getPublicAddress()).append(','); } } String vendor = simulatorProperties.get("VENDOR"); String installFile = getConfigurationFile("install-" + vendor + ".sh").getPath(); for (String versionSpec : clusterLayout.getVersionSpecs()) { LOGGER.info("Installing '" + vendor + "' '" + versionSpec + "' on Agents using " + installFile); new BashCommand(installFile) .addParams(testSuite.getId(), agentPublicIps.toString(), versionSpec) .addEnvironment(simulatorProperties.asMap()) .execute(); LOGGER.info("Successfully installed '" + vendor + "'"); } }

Target:
void uploadFiles() { StringBuilder agentPublicIps = new StringBuilder(); if (!isLocal(simulatorProperties)) { List<AgentData> agents = componentRegistry.getAgents(); for (AgentData agentData : agents) { agentPublicIps.append(agentData.getPublicAddress()).append(','); } } String vendor = simulatorProperties.get("VENDOR"); String installFile = getConfigurationFile("install-" + vendor + ".sh").getPath(); for (String versionSpec : clusterLayout.getVersionSpecs()) { LOGGER.info("Installing '" + vendor + "' '" + versionSpec + "' on Agents using " + installFile); new BashCommand(installFile) .addParams(testSuite.getId(), agentPublicIps.toString(), versionSpec) .addEnvironment(simulatorProperties.asMap()) .execute(); LOGGER.info("Successfully installed '" + vendor + "'"); } }
Source:
public void createIndexConditions() { if (onCondition != null) { onCondition.createIndexConditions(session, this); if (nestedJoin != null) { onCondition.createIndexConditions(session, nestedJoin); } } if (join != null) { join.createIndexConditions(); } if (nestedJoin != null) { nestedJoin.createIndexConditions(); } }

Target:
public void createIndexConditions() { if (joinCondition != null) { joinCondition.createIndexConditions(session, this); if (nestedJoin != null) { joinCondition.createIndexConditions(session, nestedJoin); } } if (join != null) { join.createIndexConditions(); } if (nestedJoin != null) { nestedJoin.createIndexConditions(); } }
Source:
GlobalStreamingCommitterOperator( GlobalCommitter<CommT, GlobalCommT> globalCommitter, SimpleVersionedSerializer<GlobalCommT> committableSerializer) { super(globalCommitter, committableSerializer); this.globalCommitter = globalCommitter; this.endOfInput = false; }

Target:
GlobalStreamingCommitterOperator( GlobalCommitter<CommT, GlobalCommT> globalCommitter, SimpleVersionedSerializer<GlobalCommT> committableSerializer) { super(committableSerializer); this.globalCommitter = checkNotNull(globalCommitter); this.recoveredGlobalCommittables = new ArrayList<>(); this.endOfInput = false; }
Source:
public ShareStatistics(int shareUsageInGB) { this.shareUsageInGB = shareUsageInGB; this.shareUsageInBytes = 0; }

Target:
public ShareStatistics(int shareUsageInGB) { this.shareUsageInGB = shareUsageInGB; this.shareUsageInBytes = -1; }
Source:
void addReplicasToPartition(AmbryPartition partition, List<AmbryReplica> replicas) { ambryPartitionToAmbryReplicas.computeIfAbsent(partition, k -> ConcurrentHashMap.newKeySet()).addAll(replicas); clusterWideAllocatedRawCapacityBytes.getAndAdd(replicas.get(0).getCapacityInBytes() * replicas.size()); }

Target:
void addReplicasToPartition(AmbryPartition partition, List<AmbryReplica> replicas) { AmbryPartition currentPartition = addPartitionIfAbsent(partition, replicas.get(0).getCapacityInBytes()); ambryPartitionToAmbryReplicas.compute(currentPartition, (k, v) -> { v.addAll(replicas); return v; }); clusterWideAllocatedRawCapacityBytes.getAndAdd(replicas.get(0).getCapacityInBytes() * replicas.size()); }
Source:
public void testBadMyId() throws Exception { ClientBase.setupTestEnv(); final int CLIENT_PORT_QP1 = PortAssignment.unique(); List<Integer> invalidMyidList = new ArrayList<>(); invalidMyidList.add(-1); invalidMyidList.add(0); invalidMyidList.add(256); invalidMyidList.add(1024); for (Integer myidForCheck : invalidMyidList) { String quorumCfgSection = "server.1=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique() + "\nserver." + myidForCheck + "=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique(); MainThread q1 = new MainThread(myidForCheck, CLIENT_PORT_QP1, quorumCfgSection); String args[] = new String[1]; args[0] = q1.confFile.toString(); try { q1.start(); q1.main.initializeAndRun(args); Assert.fail("the number of myid must be between 1 and 255."); } catch (QuorumPeerConfig.ConfigException e) { } } }

Target:
public void testBadMyId() throws Exception { ClientBase.setupTestEnv(); int invalidMyid = 256; final int CLIENT_PORT_QP1 = PortAssignment.unique(); String quorumCfgSection = "server.1=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique() + "\nserver." + invalidMyid + "=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique(); MainThread q1 = new MainThread(invalidMyid, CLIENT_PORT_QP1, quorumCfgSection); String args[] = new String[1]; args[0] = q1.confFile.toString(); try { q1.start(); q1.main.initializeAndRun(args); Assert.fail("the number of myid must be between 0 and 255."); } catch (QuorumPeerConfig.ConfigException e) { } }
Source:
public void testGetCompatibleModelFields() { List<String> compatibleModelFields = formEditorHelper.getCompatibleModelFields(nameField); assertEquals(2, compatibleModelFields.size()); assertTrue(compatibleModelFields.contains(nameField.getId())); assertTrue(compatibleModelFields.contains(lastNameField.getId())); compatibleModelFields = formEditorHelper.getCompatibleModelFields(ageField); assertEquals(1, compatibleModelFields.size()); assertTrue(compatibleModelFields.contains(ageField.getId())); assertFalse(compatibleModelFields.contains(weightField.getId())); compatibleModelFields = formEditorHelper.getCompatibleModelFields(weightField); assertEquals(1, compatibleModelFields.size()); assertTrue(compatibleModelFields.contains(weightField.getId())); assertFalse(compatibleModelFields.contains(ageField.getId())); IntegerSliderDefinition slider = new IntegerSliderDefinition(); slider.setId("slider"); slider.setName("slider"); slider.setLabel("slider"); compatibleModelFields = formEditorHelper.getCompatibleModelFields(slider); assertEquals(2, compatibleModelFields.size()); assertTrue(compatibleModelFields.contains(weightField.getId())); assertTrue(compatibleModelFields.contains(ageField.getId())); }

Target:
public void testGetCompatibleModelFields() { List<String> compatibleModelFields = formEditorHelper.getCompatibleModelFields(nameField); assertEquals(2, compatibleModelFields.size()); Assertions.assertThat(compatibleModelFields).containsExactly(lastNameField.getId(), nameField.getId()); compatibleModelFields = formEditorHelper.getCompatibleModelFields(ageField); assertEquals(1, compatibleModelFields.size()); Assertions.assertThat(compatibleModelFields).containsOnly(ageField.getId()); compatibleModelFields = formEditorHelper.getCompatibleModelFields(weightField); assertEquals(1, compatibleModelFields.size()); Assertions.assertThat(compatibleModelFields).containsOnly(weightField.getId()); IntegerSliderDefinition slider = new IntegerSliderDefinition(); slider.setId("slider"); slider.setName("slider"); slider.setLabel("slider"); compatibleModelFields = formEditorHelper.getCompatibleModelFields(slider); assertEquals(2, compatibleModelFields.size()); Assertions.assertThat(compatibleModelFields).containsExactly(ageField.getId(), weightField.getId()); }
Source:
protected void removeMessageReference(ConsumerHolder<? extends Consumer> holder, MessageReference ref) { if (!isNonDestructive()) { holder.iter.remove(); refRemoved(ref); } }

Target:
protected void removeMessageReference(ConsumerHolder<? extends Consumer> holder, MessageReference ref) { if (!nonDestructive) { holder.iter.remove(); refRemoved(ref); } }
Source:
public List<String> listContentUris(ContentListingCriteria criteria) { List<Publisher> publishers = remainingPublishers(criteria); if(publishers.isEmpty()) { return Collections.emptyList(); } Iterator<Content> contentIterator = iteratorsFor(publishers, criteria, true); Iterator<String> uriIterator = Iterators.transform(contentIterator, Identified::getCanonicalUri ); List<String> allContent = new ArrayList<>(); uriIterator.forEachRemaining(allContent::add); return allContent; }

Target:
public Iterator<String> listContentUris(ContentListingCriteria criteria) { List<Publisher> publishers = remainingPublishers(criteria); if(publishers.isEmpty()) { return Iterators.emptyIterator(); } Iterator<Content> contentIterator = iteratorsFor(publishers, criteria, true); Iterator<String> uriIterator = Iterators.transform(contentIterator, Identified::getCanonicalUri ); return uriIterator; }
Source:
public List<BlockMetaData> visit(FilterCompat.FilterPredicateCompat filterPredicateCompat) { FilterPredicate filterPredicate = filterPredicateCompat.getFilterPredicate(); SchemaCompatibilityValidator.validate(filterPredicate, schema); List<BlockMetaData> filteredBlocks = new ArrayList<BlockMetaData>(); for (BlockMetaData block : blocks) { boolean drop = false; if(levels.contains(FilterLevel.STATISTICS)) { drop = StatisticsFilter.canDrop(filterPredicate, block.getColumns()); } if(!drop && levels.contains(FilterLevel.DICTIONARY)) { drop = DictionaryFilter.canDrop(filterPredicate, block.getColumns(), reader.getDictionaryReader(block)); } if (!drop && levels.contains(FilterLevel.BLOOMFILTER)) { drop = BloomFilterImpl.canDrop(filterPredicate, block.getColumns(), reader.getBloomFilterDataReader(block)); if (drop) logger.info("Block drop by Bloom filter"); } if(!drop) { filteredBlocks.add(block); } } return filteredBlocks; }

Target:
public List<BlockMetaData> visit(FilterCompat.FilterPredicateCompat filterPredicateCompat) { FilterPredicate filterPredicate = filterPredicateCompat.getFilterPredicate(); SchemaCompatibilityValidator.validate(filterPredicate, schema); List<BlockMetaData> filteredBlocks = new ArrayList<BlockMetaData>(); for (BlockMetaData block : blocks) { boolean drop = false; if(levels.contains(FilterLevel.STATISTICS)) { drop = StatisticsFilter.canDrop(filterPredicate, block.getColumns()); } if(!drop && levels.contains(FilterLevel.DICTIONARY)) { drop = DictionaryFilter.canDrop(filterPredicate, block.getColumns(), reader.getDictionaryReader(block)); } if (!drop && levels.contains(FilterLevel.BLOOMFILTER)) { drop = BloomFilterImpl.canDrop(filterPredicate, block.getColumns(), reader.getBloomFilterDataReader(block)); } if(!drop) { filteredBlocks.add(block); } } return filteredBlocks; }
Source:
public void run() { final ExecutorService executor = executorServiceInjectedValue.getOptionalValue(); if (executor != null) { executor.submit(this::persistTimer); } }

Target:
public void run() { executorServiceInjectedValue.getValue().submit(this::persistTimer); }
Source:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "Argument must be single-valued for transform function: %s", getName()); _transformFunction = transformFunction; }

Target:
public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) { Preconditions .checkArgument(arguments.size() == 1, "Exactly 1 argument is required for transform function: %s", getName()); TransformFunction transformFunction = arguments.get(0); Preconditions.checkArgument(transformFunction.getResultMetadata().isSingleValue(), "Argument must be single-valued for transform function: %s", getName()); Preconditions.checkArgument(transformFunction.getResultMetadata().getDataType() == FieldSpec.DataType.BYTES, "The argument must be of bytes type"); _transformFunction = transformFunction; }
Source:
public void readManyAsync_whenHitsStale_shouldNotBeBlocked() throws Exception { ICompletableFuture<ReadResultSet<String>> f = clientRingbuffer.readManyAsync(0, 1, 10, null); serverRingbuffer.addAllAsync(asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), OVERWRITE); f.get(); }

Target:
public void readManyAsync_whenHitsStale_shouldNotBeBlocked() throws Exception { ICompletableFuture<ReadResultSet<String>> f = clientRingbuffer.readManyAsync(0, 1, 10, null); serverRingbuffer.addAllAsync(asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), OVERWRITE); expectedException.expect(new RootCauseMatcher(StaleSequenceException.class)); f.get(); }
Source:
public void buildCidMap__onMultipartWithNoParts__shouldReturnEmptyMap() throws Exception { AttachmentInfoExtractor attachmentInfoExtractor = mock(AttachmentInfoExtractor.class); Part multipartPart = mock(Part.class); Multipart multipartBody = mock(Multipart.class); when(multipartPart.getBody()).thenReturn(multipartBody); when(multipartBody.getBodyParts()).thenReturn(Collections.EMPTY_LIST); Map<String,Uri> result = AttachmentResolver.buildCidToAttachmentUriMap(attachmentInfoExtractor, multipartPart); assertTrue(result.isEmpty()); }

Target:
public void buildCidMap__onMultipartWithNoParts__shouldReturnEmptyMap() throws Exception { Multipart multipartBody = new MimeMultipart(); Part multipartPart = new MimeBodyPart(multipartBody); Map<String,Uri> result = AttachmentResolver.buildCidToAttachmentUriMap(attachmentInfoExtractor, multipartPart); assertTrue(result.isEmpty()); }
Source:
public static boolean isNetworkAvailable() { ConnectivityManager connectivityManager = (ConnectivityManager) OpenMRS.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting(); }

Target:
public static boolean isNetworkAvailable() { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()); boolean toggle=prefs.getBoolean("sync", false); if(toggle==true) { ConnectivityManager connectivityManager = (ConnectivityManager) OpenMRS.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); boolean isConnected = activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting(); if(isConnected) return true; else { SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("sync", false); editor.commit(); return false; } } else return false; }
Source:
void execute(long taskId, String taskName, Object arg, Set<UUID> nodeIds, byte flags, long timeout) { assert taskName != null; this.taskId = taskId; GridTaskProcessor task = ctx.kernalContext().task(); IgnitePredicate<ClusterNode> nodePredicate = F.isEmpty(nodeIds) ? F.alwaysTrue() : F.nodeForNodeIds(nodeIds); UUID subjId = ctx.securityContext() == null ? null : ctx.securityContext().subject().id(); task.setThreadContextIfNotNull(TC_SUBGRID_PREDICATE, nodePredicate); task.setThreadContextIfNotNull(TC_SUBJ_ID, subjId); task.setThreadContext(TC_TIMEOUT, timeout); task.setThreadContext(TC_NO_FAILOVER, (flags & NO_FAILOVER_FLAG_MASK) != 0); task.setThreadContext(TC_NO_RESULT_CACHE, (flags & NO_RESULT_CACHE_FLAG_MASK) != 0); taskFut = task.execute(taskName, arg); if (taskFut.isDone() && taskFut.error() != null) throw new IgniteClientException(ClientStatus.FAILED, taskFut.error().getMessage()); }

Target:
void execute(long taskId, String taskName, Object arg, Set<UUID> nodeIds, byte flags, long timeout) { assert taskName != null; this.taskId = taskId; GridTaskProcessor task = ctx.kernalContext().task(); IgnitePredicate<ClusterNode> nodePredicate = F.isEmpty(nodeIds) ? F.alwaysTrue() : F.nodeForNodeIds(nodeIds); UUID subjId = ctx.securityContext() == null ? null : ctx.securityContext().subject().id(); task.setThreadContext(TC_SUBGRID_PREDICATE, nodePredicate); task.setThreadContextIfNotNull(TC_SUBJ_ID, subjId); task.setThreadContext(TC_TIMEOUT, timeout); task.setThreadContext(TC_NO_FAILOVER, (flags & NO_FAILOVER_FLAG_MASK) != 0); task.setThreadContext(TC_NO_RESULT_CACHE, (flags & NO_RESULT_CACHE_FLAG_MASK) != 0); taskFut = task.execute(taskName, arg); if (taskFut.isDone() && taskFut.error() != null) throw new IgniteClientException(ClientStatus.FAILED, taskFut.error().getMessage()); }
Source:
private String dataObjectToProcessVariableFormat(DataObject dataObject) { StringBuilder builder = new StringBuilder(); builder.append(dataObject.getName().getValue()); builder.append(":"); builder.append(dataObject.getType().getValue().getType()); return builder.toString(); }

Target:
private static String dataObjectToProcessVariableFormat(DataObject dataObject) { return dataObject.getName().getValue() + ":" + dataObject.getType().getValue().getType(); }
Source:
public String create(Project project, User user) { String name = project.getName(); FetchProjectHandler fetchProjectHandler = new FetchProjectHandler(); try { final List<Project> projects = this.dbOperator .query(FetchProjectHandler.SELECT_PROJECT_WITH_NAME_AND_SPACE_ID, fetchProjectHandler, name, project.getSpaceId()); if (!projects.isEmpty()) { throw new ProjectManagerException( "Project with name " + name + " already exists."); } } catch (final SQLException ex) { log.error("Check if project '" + name + "' exists failed with: " + ex); throw new ProjectManagerException("Check if project '" + name + "' exists failed"); } final SQLTransaction<Long> insertAndGetProjectId = transOperator -> { String currentTime = DateTime.now().toLocalDateTime().toString(); transOperator.update(INSERT_PROJECT, project.getName(), project.getDescription(), project.getSpaceId(), user.getUserId(), currentTime, user.getUserId(), currentTime, 1, true, 2, null); transOperator.getConnection().commit(); return transOperator.getLastInsertId(); }; String projectId = ""; try { projectId = dbOperator.transaction(insertAndGetProjectId).toString(); if (projectId.isEmpty()) { throw new ProjectManagerException("Insert project for '" + name + "' failed."); } projectAdminDaoImpl.addAdmins(projectId, project.getAdmins()); } catch (SQLException ex) { log.error(INSERT_PROJECT + " failed with exception:", ex); throw new ProjectManagerException("Insert project for '" + name + "' failed.", ex); } return projectId; }

Target:
public String create(Project project, User user) { String name = project.getName(); FetchProjectHandler fetchProjectHandler = new FetchProjectHandler(); try { final List<Project> projects = this.dbOperator .query(FetchProjectHandler.SELECT_PROJECT_WITH_NAME_AND_SPACE_ID, fetchProjectHandler, name, project.getSpaceId()); if (!projects.isEmpty()) { throw new ProjectManagerException( "Project with name " + name + " already exists."); } } catch (final SQLException ex) { log.error("Check if project '" + name + "' exists failed with: " + ex); throw new ProjectManagerException("Check if project '" + name + "' exists failed"); } final SQLTransaction<Long> insertAndGetProjectId = transOperator -> { long timestamp = System.currentTimeMillis(); transOperator.update(INSERT_PROJECT, project.getName(), 1, timestamp, timestamp, 1, user.getUserId(), project.getDescription(), 2, null, project.getSpaceId(), user.getUserId()); transOperator.getConnection().commit(); return transOperator.getLastInsertId(); }; String projectId = ""; try { projectId = dbOperator.transaction(insertAndGetProjectId).toString(); if (projectId.isEmpty()) { throw new ProjectManagerException("Insert project for '" + name + "' failed."); } projectAdminDaoImpl.addAdmins(projectId, project.getAdmins()); } catch (SQLException ex) { log.error(INSERT_PROJECT + " failed with exception:", ex); throw new ProjectManagerException("Insert project for '" + name + "' failed.", ex); } return projectId; }
Source:
public abstract boolean exists() throws IOException; public abstract @Nonnull VirtualFile[] list() throws IOException; @Restricted(NoExternalUse.class) public boolean supportQuickRecursiveListing() { return false; }

Target:
public abstract boolean exists() throws IOException; public abstract @Nonnull VirtualFile[] list() throws IOException; @Restricted(NoExternalUse.class) public boolean supportsQuickRecursiveListing() { return false; }
Source:
public void testContent() throws Exception { ______TS("Typical case: large session with no sections"); resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Session with no sections", true, "question"); AssertHelper.assertContains(Const.StatusMessages.FEEDBACK_RESULTS_QUESTIONVIEWWARNING, resultsPage.getStatus()); ______TS("Typical case: standard session results"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtml("/instructorFeedbackResultsPageOpen.html"); ______TS("Typical case: standard session results: helper view"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper1", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperOne.html"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper2", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperTwo.html"); ______TS("Typical case: empty session"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Empty Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageEmpty.html"); }

Target:
public void testContent() throws Exception { ______TS("Typical case: large session with no sections"); resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Session with no sections", true, "question"); resultsPage.verifyStatus(Const.StatusMessages.FEEDBACK_RESULTS_QUESTIONVIEWWARNING); ______TS("Typical case: standard session results"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtml("/instructorFeedbackResultsPageOpen.html"); ______TS("Typical case: standard session results: helper view"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper1", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperOne.html"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper2", "Open Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperTwo.html"); ______TS("Typical case: empty session"); resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Empty Session"); resultsPage.waitForPanelsToExpand(); resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageEmpty.html"); }