auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isFeedbackParticipantNameVisibleToUser( FeedbackQuestionAttributes question, FeedbackResponseAttributes response, String userEmail, UserRole role, boolean isGiverName, CourseRoster roster) { List<FeedbackParticipantType> showNameTo = isGiverName ? question.showGiverNameTo : question.showRecipientNameTo; for (FeedbackParticipantType type : showNameTo) { switch (type) { case INSTRUCTORS: if (roster.getInstructorForEmail(userEmail) != null && role == UserRole.INSTRUCTOR) { return true; } break; case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: if (roster.isStudentsInSameTeam(response.giver, userEmail)) { return true; } break; case RECEIVER: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (response.recipient.equals(userEmail)) { return true; } else { break; } case RECEIVER_TEAM_MEMBERS: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (roster.isStudentsInSameTeam(response.recipient, userEmail)) { return true; } break; case STUDENTS: if (roster.isStudentInCourse(userEmail)) { return true; } break; default: Assumption.fail("Invalid FeedbackParticipantType for showNameTo in " + "FeedbackResponseLogic.shouldFeedbackParticipantNameBeVisibleToUser()"); break; } } return false; }

Target:
private boolean isFeedbackParticipantNameVisibleToUser( FeedbackQuestionAttributes question, FeedbackResponseAttributes response, String userEmail, UserRole role, boolean isGiverName, CourseRoster roster) { List<FeedbackParticipantType> showNameTo = isGiverName ? question.showGiverNameTo : question.showRecipientNameTo; for (FeedbackParticipantType type : showNameTo) { switch (type) { case INSTRUCTORS: if (roster.getInstructorForEmail(userEmail) != null && role == UserRole.INSTRUCTOR) { return true; } break; case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: if (roster.isStudentsInSameTeam(response.giver, userEmail)) { return true; } break; case RECEIVER: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (response.recipient.equals(userEmail)) { return true; } else { break; } case RECEIVER_TEAM_MEMBERS: if (question.recipientType.isTeam()) { if (roster.isStudentInTeam(userEmail, response.recipient)) { return true; } break; } else if (roster.isStudentsInSameTeam(response.recipient, userEmail)) { return true; } break; case STUDENTS: if (roster.isStudentInCourse(userEmail)) { return true; } break; default: Assumption.fail("Invalid FeedbackParticipantType for showNameTo in " + "FeedbackResponseLogic.isFeedbackParticipantNameVisibleToUser()"); break; } } return false; }
Source:
default void onConfigurationSuccess(ITestResult itr) { throw new UnsupportedOperationException("Method is not implemented"); }

Target:
default void onConfigurationSuccess(ITestResult itr) { }
Source:
public void testOnlyOneErrorForMissingRequiredProperty() throws Exception { EObject testModel = parseHelper.parse("use testmodel.* TestModel {}"); AssertableDiagnostics assertDiag = tester.validate(testModel).assertDiagnosticsCount(1); assertDiag.assertErrorContains("The required feature"); diagnosticConverter.convertValidatorDiagnostic(assertDiag.getDiagnostic(), new IAcceptor<Issue>() { @Override public void accept(Issue t) { assertEquals("lineNumber", Integer.valueOf(1), t.getLineNumber()); assertEquals("length", Integer.valueOf("TestModel {".length()), t.getLength()); } }); }

Target:
public void testOnlyOneErrorForMissingRequiredProperty() throws Exception { EObject testModel = parseHelper.parse("use testmodel.* TestModel {}"); AssertableDiagnostics assertDiag = tester.validate(testModel).assertDiagnosticsCount(1); assertDiag.assertErrorContains("The required feature"); final AtomicBoolean acceptPassed = new AtomicBoolean(); new MyDiagnosticConverter(diagnosticConverter).convertValidatorDiagnostic(assertDiag.getDiagnostic(), new IAcceptor<Issue>() { @Override public void accept(Issue t) { assertEquals("lineNumber", Integer.valueOf(1), t.getLineNumber()); assertEquals("length", Integer.valueOf("TestModel {".length()), t.getLength()); acceptPassed.set(true); } }); assertTrue("accept run", acceptPassed.get()); }
Source:
private static double process() { SwapPricePerformance test = new SwapPricePerformance(); long start = System.nanoTime(); double total = 0d; for (int i = 0; i < 10000; i++) { total += test.test_VanillaFixedVsLibor1mSwap(); total += test.test_VanillaFixedVsLibor3mSwap(); total += test.test_VanillaFixedVsLibor3mSwapWithFixing(); total += test.test_BasisLibor3mVsLibor6mSwapWithSpread(); total += test.test_BasisCompoundedLibor1mVsLibor3mSwap(); if (total < -1_000_000d) { System.out.println("negative"); } } System.out.println("positive " + total); long end = System.nanoTime(); System.out.println((end - start) / 1000000000d + " s"); return total; }

Target:
private static double process() { SwapPricePerformance test = new SwapPricePerformance(); long start = System.nanoTime(); double total = 0d; for (int i = 0; i < 10_000; i++) { total += test.test_VanillaFixedVsLibor1mSwap(); total += test.test_VanillaFixedVsLibor3mSwap(); total += test.test_VanillaFixedVsLibor3mSwapWithFixing(); total += test.test_BasisLibor3mVsLibor6mSwapWithSpread(); total += test.test_BasisCompoundedLibor1mVsLibor3mSwap(); } System.out.println("Total: " + total); long end = System.nanoTime(); System.out.println((end - start) / 1_000_000_000d + " s"); return total; }
Source:
public void testRemoteMapReduceWithStreams() throws Exception { String cacheName = "testRemoteMapReduce_Streams"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()).compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(0).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream.js"); HashMap<String, Long> results = cache.execute("wordCountStream.js", new HashMap<String, String>()); assertEquals(3209, results.size()); assertTrue(results.get("macbeth").equals(Long.valueOf(287))); }

Target:
public void testRemoteMapReduceWithStreams() throws Exception { String cacheName = "testRemoteMapReduce_Streams"; ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence()).compatibility().enable().marshaller(new GenericJBossMarshaller()); defineInAll(cacheName, builder); RemoteCache<String, String> cache = clients.get(0).getCache(cacheName); RemoteCache<String, String> scriptCache = clients.get(0).getCache(SCRIPT_CACHE); loadData(cache, "/macbeth.txt"); loadScript(scriptCache, "/wordCountStream.js"); Map<String, Long> results = cache.execute("wordCountStream.js", new HashMap<String, String>()); assertEquals(3209, results.size()); assertTrue(results.get("macbeth").equals(Long.valueOf(287))); }
Source:
public static void beforeInitPageStores(File workDir, IgniteLogger log) throws IgniteCheckedException { batchRenameDefragmentedCacheGroupPartitions(workDir, log); U.delete(defragmentationCompletionMarkerFile(workDir)); for (File file : workDir.listFiles()) { String fileName = file.getName(); if ( fileName.startsWith(DFRG_PARTITION_FILE_PREFIX) || fileName.startsWith(DFRG_INDEX_FILE_NAME) || fileName.startsWith(DFRG_LINK_MAPPING_FILE_PREFIX) ) U.delete(file); } }

Target:
public static void beforeInitPageStores(File workDir, IgniteLogger log) throws IgniteCheckedException { try { batchRenameDefragmentedCacheGroupPartitions(workDir, log); U.delete(defragmentationCompletionMarkerFile(workDir)); for (File file : workDir.listFiles()) { String fileName = file.getName(); if ( fileName.startsWith(DFRG_PARTITION_FILE_PREFIX) || fileName.startsWith(DFRG_INDEX_FILE_NAME) || fileName.startsWith(DFRG_LINK_MAPPING_FILE_PREFIX) ) U.delete(file); } } catch (IgniteException e) { throw new IgniteCheckedException(e); } }
Source:
public static WindowsConfiguration create(final boolean provisionVMAgent, final WinRM winRM, final AdditionalUnattendContent additionalUnattendContent, final boolean enableAutomaticUpdates, final List<String> secrets) { return new AutoValue_OSProfile_WindowsConfiguration(provisionVMAgent, winRM, additionalUnattendContent, enableAutomaticUpdates, secrets); }

Target:
public static WindowsConfiguration create(final boolean provisionVMAgent, final WinRM winRM, final AdditionalUnattendContent additionalUnattendContent, final boolean enableAutomaticUpdates, final List<String> secrets) { return new AutoValue_OSProfile_WindowsConfiguration(provisionVMAgent, winRM, additionalUnattendContent, enableAutomaticUpdates, secrets == null ? null : ImmutableList.copyOf(secrets)); }
Source:
protected void processBuilder(Builder builder) { String bsn = builder.getProperty(Constants.BUNDLE_SYMBOLICNAME); builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, bsn + "-tests"); builder.setProperty(Constants.TESTCASES, testCases.filter()); if (fragment) { builder.setProperty(Constants.FRAGMENT_HOST, bsn); builder.setProperty("-fixupmessages.missing.host", "\"Host " + bsn + "= for this fragment...\";is:=ignore"); } }

Target:
protected void processBuilder(Builder builder) throws MojoFailureException { String defaultBsn = project.getArtifactId(); if (artifactFragment) { builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, defaultBsn + "-tests"); builder.setProperty(Constants.FRAGMENT_HOST, defaultBsn); builder.setProperty("-fixupmessages.missing.host", "\"Host " + defaultBsn + "= for this fragment...\";is:=ignore"); } else if (builder.getProperty(Constants.BUNDLE_SYMBOLICNAME) == null) { builder.setProperty(Constants.BUNDLE_SYMBOLICNAME, defaultBsn + "-tests"); } if (testCases != TestCases.useTestCasesHeader) { builder.setProperty(Constants.TESTCASES, "${sort;${uniq;" + testCases.filter() + "}}"); } else if (builder.getProperty(Constants.TESTCASES) == null) { throw new MojoFailureException( "<testCases> specified " + TestCases.useTestCasesHeader + " but no Test-Cases header was found"); } }
Source:
public void mergeSegments(Layout currentLayout) throws OutrankedException { Layout newLayout; if (currentLayout.getSegments().size() > 1) { log.info("mergeSegments: layout is {}", currentLayout); sealEpoch(currentLayout); Predicate<Layout> shouldMergeSegments = layout -> { if(layout.getSegments().size() > 1){ return Sets.difference( layout.getSegments().get(1).getAllLogServers(), layout.getSegments().get(0).getAllLogServers()).isEmpty(); } return false; }; while(shouldMergeSegments.test(currentLayout)){ LayoutBuilder layoutBuilder = new LayoutBuilder(currentLayout); currentLayout = layoutBuilder .mergePreviousSegment(1) .build(); } newLayout = currentLayout; attemptConsensus(newLayout); } else { log.info("mergeSegments: skipping, no segments to merge {}", currentLayout); newLayout = currentLayout; } reconfigureSequencerServers(currentLayout, newLayout, false); }

Target:
public void mergeSegments(Layout currentLayout) { Layout tempLayout = currentLayout; Layout newLayout; Predicate<Layout> shouldMergeSegments = layout -> { if (layout.getSegments().size() > 1) { return Sets.difference( layout.getSegments().get(1).getAllLogServers(), layout.getSegments().get(0).getAllLogServers()).isEmpty(); } return false; }; if (shouldMergeSegments.test(tempLayout)) { log.info("mergeSegments: layout is {}", tempLayout); sealEpoch(tempLayout); while (shouldMergeSegments.test(tempLayout)) { LayoutBuilder layoutBuilder = new LayoutBuilder(tempLayout); tempLayout = layoutBuilder .mergePreviousSegment(1) .build(); } newLayout = tempLayout; attemptConsensus(newLayout); } else { log.info("mergeSegments: skipping, no segments to merge {}", tempLayout); newLayout = tempLayout; } reconfigureSequencerServers(tempLayout, newLayout, false); }
Source:
public void blockingStreamShouldNotPreventDiagnosis() throws Exception { FastPipedInputStream in = new FastPipedInputStream(); try (FastPipedOutputStream out = new FastPipedOutputStream(in)) { out.write(payload); } ClassicCommandTransport ct = (ClassicCommandTransport) new ChannelBuilder("dummy",null) .withMode(Mode.BINARY) .withBaseLoader(getClass().getClassLoader()) .negotiate(in, new NullOutputStream()); verify(ct); }

Target:
public void blockingStreamShouldNotPreventDiagnosis() throws Exception { try (FastPipedInputStream in = new FastPipedInputStream(); FastPipedOutputStream out = new FastPipedOutputStream(in)) { out.write(payload); ClassicCommandTransport ct = (ClassicCommandTransport) new ChannelBuilder("dummy",null) .withMode(Mode.BINARY) .withBaseLoader(getClass().getClassLoader()) .negotiate(in, new NullOutputStream()); verify(ct); } }
Source:
public void testDifferentGAVsWithAlias() throws Exception { Long oldPid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(oldPid).isNotNull(); assertThat(oldPid).isGreaterThan(0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, oldPid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); ReleaseId differentReleaseId101 = new ReleaseId("org.kie.server.different", "different-gav-definition-project", "1.0.1.Final"); KieContainerResource containerResource = new KieContainerResource(CONTAINER_ID_101, differentReleaseId101); containerResource.setContainerAlias(CONTAINER_ALIAS); client.createContainer(CONTAINER_ID_101, containerResource); if(configuration.isRest()) { assertClientException( () -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(PROCESS_DEFINITION_NOT_FOUND, PROCESS_ID_EVALUATION_2, CONTAINER_ALIAS)); } else { assertClientException( () -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(NO_PROCESS_AVAILABLE_WITH_ID, PROCESS_ID_EVALUATION_2)); } Long pid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(pid).isNotNull(); assertThat(pid).isGreaterThan(0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, pid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); }

Target:
public void testDifferentGAVsWithAlias() throws Exception { Long oldPid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(oldPid).isNotNull(); assertThat(oldPid).isGreaterThan(0); ProcessInstance processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, oldPid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); ReleaseId differentReleaseId101 = new ReleaseId("org.kie.server.different", "different-gav-definition-project", "1.0.1.Final"); KieContainerResource containerResource = new KieContainerResource(CONTAINER_ID_101, differentReleaseId101); containerResource.setContainerAlias(CONTAINER_ALIAS); client.createContainer(CONTAINER_ID_101, containerResource); assertClientException(() -> processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION_2), 404, MessageFormat.format(PROCESS_DEFINITION_NOT_FOUND, PROCESS_ID_EVALUATION_2, CONTAINER_ALIAS), MessageFormat.format(NO_PROCESS_AVAILABLE_WITH_ID, PROCESS_ID_EVALUATION_2)); Long pid = processClient.startProcess(CONTAINER_ALIAS, PROCESS_ID_EVALUATION); assertThat(pid).isNotNull(); assertThat(pid).isGreaterThan(0); processInstance = processClient.getProcessInstance(CONTAINER_ALIAS, pid); assertThat(processInstance).isNotNull(); assertThat(processInstance.getContainerId()).isEqualTo(CONTAINER_ID); }
Source:
private boolean doesConfigReplicationFactorMatchWithCluster() { return clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, configManager.getConfig(), false); return true; } catch (Exception e) { return false; } }); }

Target:
private boolean doesConfigReplicationFactorMatchWithCluster() { return clientPool.run(client -> { try { CassandraVerifier.currentRfOnKeyspaceMatchesDesiredRf(client, configManager.getConfig(), false); return true; } catch (Exception e) { log.warn("The config and Cassandra cluster do not agree on the replication factor.", e); return false; } }); }
Source:
public List<RpslObject> handleQuery(final Query query, final HttpServletRequest request) { final int contextId = System.identityHashCode(Thread.currentThread()); final InetAddress remoteAddress = InetAddresses.forString(request.getRemoteAddr()); final List<RpslObject> result = Lists.newArrayList(); try { queryHandler.streamResults(query, remoteAddress, contextId, new ApiResponseHandler() { @Override public void handle(final ResponseObject responseObject) { if (responseObject instanceof RpslObject) { result.add((RpslObject) responseObject); } } }); return result; } catch (final QueryException e) { if (e.getCompletionInfo() == QueryCompletionInfo.BLOCKED) { throw tooManyRequests(); } else { LOGGER.error(e.getMessage(), e); throw new IllegalStateException("query error"); } } }

Target:
public List<RpslObject> handleQuery(final Query query, final HttpServletRequest request) { final InetAddress remoteAddress = InetAddresses.forString(request.getRemoteAddr()); final List<RpslObject> result = Lists.newArrayList(); try { queryHandler.streamResults(query, remoteAddress, 0, new ApiResponseHandler() { @Override public void handle(final ResponseObject responseObject) { if (responseObject instanceof RpslObject) { result.add((RpslObject) responseObject); } } }); return result; } catch (final QueryException e) { if (e.getCompletionInfo() == QueryCompletionInfo.BLOCKED) { throw tooManyRequests(); } else { LOGGER.error(e.getMessage(), e); throw new IllegalStateException("query error"); } } }
Source:
public void init() throws IOException { final String confFile = "client/conf/configuration.properties"; configuration = new Properties(); configuration.load(new FileInputStream(confFile)); baseURI = configuration.getProperty("baseURI"); login = configuration.getProperty("login"); password = configuration.getProperty("password"); }

Target:
public void init() throws IOException { final String confFile = "conf/configuration.properties"; configuration = new Properties(); configuration.load(new FileInputStream(confFile)); baseURI = configuration.getProperty("baseURI"); login = configuration.getProperty("login"); password = configuration.getProperty("password"); }
Source:
public void testValidDepth() { SubsetParameters sp = SubsetParameters.parse("TIME,2009-01-01T00:00:00.000Z,2009-12-25T23:04:00.000Z;LATITUDE,-33.433849,-32.150743;LONGITUDE,114.15197,115.741219;DEPTH,43.567,100.0"); assertEquals((Object) sp.getVerticalRange().start, 43.567); assertEquals((Object) sp.getVerticalRange().end, 100.0); }

Target:
public void testValidDepth() { SubsetParameters sp = SubsetParameters.parse("TIME,2009-01-01T00:00:00.000Z,2009-12-25T23:04:00.000Z;LATITUDE,-33.433849,-32.150743;LONGITUDE,114.15197,115.741219;DEPTH,43.567,100.0"); assertEquals(sp.getVerticalRange().getMin().doubleValue(), 43.567, 0.000001); assertEquals(sp.getVerticalRange().getMax().doubleValue(), 100.0, 0.000001); }
Source:
private <T extends Described> T createMerged(Iterable<? extends T> sortedEquivalents) { T highestPrecedenceContent = sortedEquivalents.iterator().next(); T mostSpecificTypeContent = highestPrecedenceContent; for (T next : ImmutableList.copyOf(sortedEquivalents)) { if (!mostSpecificTypeContent.getClass().equals(next.getClass()) && mostSpecificTypeContent.getClass().isAssignableFrom(next.getClass())) { mostSpecificTypeContent = next; } } T merged = (T) mostSpecificTypeContent.createNew(); merged = highestPrecedenceContent.copyToPreferNonNull(merged); IdAndPublisher idAndPublisher = findLowestIdContent(sortedEquivalents); Id id = idAndPublisher.getId(); merged.setId(id); Publisher publisher = idAndPublisher.getPublisher(); merged.setPublisher(publisher); Set<EquivalenceRef> equivs = Sets.newHashSet(merged.getEquivalentTo()); equivs.remove(EquivalenceRef.valueOf(merged)); merged.setEquivalentTo(equivs); return merged; }

Target:
private <T extends Described> T createMerged(Iterable<? extends T> sortedEquivalents) { T highestPrecedenceContent = sortedEquivalents.iterator().next(); T mostSpecificTypeContent = highestPrecedenceContent; for (T next : ImmutableList.copyOf(sortedEquivalents)) { if (!mostSpecificTypeContent.getClass().equals(next.getClass()) && mostSpecificTypeContent.getClass().isAssignableFrom(next.getClass())) { mostSpecificTypeContent = next; } } T merged = (T) mostSpecificTypeContent.createNew(); merged = mostSpecificTypeContent.copyToPreferNonNull(merged); merged = highestPrecedenceContent.copyToPreferNonNull(merged); T lowestIdContent = findLowestIdContent(sortedEquivalents); merged.setId(lowestIdContent.getId()); merged.setPublisher(lowestIdContent.getSource()); merged.setEquivalentTo(lowestIdContent.getEquivalentTo()); return merged; }
Source:
private void testNullability(MutableRealmIntegerTypes c1) { MutableRealmInteger r1 = c1.columnMutableRealmInteger; c1.columnMutableRealmInteger.set(0L); assertFalse(c1.columnMutableRealmInteger.isNull()); assertFalse(r1.isNull()); c1.columnMutableRealmInteger.set(null); assertFalse(c1.columnMutableRealmInteger == null); assertTrue(c1.columnMutableRealmInteger.isNull()); assertTrue(r1.isNull()); assertTrue(c1.columnMutableRealmInteger.get() == null); assertTrue(r1.get() == null); try { c1.columnMutableRealmInteger.increment(5); fail("Attempt to increment a null valued MutableRealmInteger should throw NPE"); } catch (IllegalArgumentException ignore) { } try { c1.columnMutableRealmInteger.decrement(5); fail("Attempt to decrement a null valued MutableRealmInteger should throw NPE"); } catch (IllegalArgumentException ignore) { } }

Target:
private void testNullability(MutableRealmIntegerTypes c1) { MutableRealmInteger r1 = c1.columnMutableRealmInteger; c1.columnMutableRealmInteger.set(0L); assertFalse(c1.columnMutableRealmInteger.isNull()); assertFalse(r1.isNull()); c1.columnMutableRealmInteger.set(null); assertFalse(c1.columnMutableRealmInteger == null); assertTrue(c1.columnMutableRealmInteger.isNull()); assertTrue(r1.isNull()); assertTrue(c1.columnMutableRealmInteger.get() == null); assertTrue(r1.get() == null); try { c1.columnMutableRealmInteger.increment(5); fail("Attempt to increment a null valued MutableRealmInteger should throw NPE"); } catch (IllegalStateException ignore) { } try { c1.columnMutableRealmInteger.decrement(5); fail("Attempt to decrement a null valued MutableRealmInteger should throw NPE"); } catch (IllegalStateException ignore) { } }
Source:
public void testLogSegmentValidDataSize() throws InterruptedException, StoreException, IOException { for (long i = 0; i <= state.time.milliseconds() + TEST_TIME_INTERVAL_IN_MS; i += TEST_TIME_INTERVAL_IN_MS) { TimeRange timeRange = new TimeRange(i, 0L); verifyLogSegmentValidSize(timeRange); } }

Target:
public void testLogSegmentValidDataSize() throws InterruptedException, StoreException, IOException { for (long i = 0; i <= state.time.milliseconds() + TEST_TIME_INTERVAL_IN_MS; i += TEST_TIME_INTERVAL_IN_MS) { TimeRange timeRange = new TimeRange(i, 0L); verifyAndGetLogSegmentValidSize(timeRange); } }
Source:
private static SelectiveStreamReader[] createStreamReaders( OrcDataSource orcDataSource, List<OrcType> types, DateTimeZone hiveStorageTimeZone, Map<Integer, Type> includedColumns, List<Integer> outputColumns, Map<Integer, TupleDomainFilter> filters, Map<Integer, List<Subfield>> requiredSubfields, AggregatedMemoryContext systemMemoryContext) { List<StreamDescriptor> streamDescriptors = createStreamDescriptor("", "", 0, types, orcDataSource).getNestedStreams(); OrcType rowType = types.get(0); SelectiveStreamReader[] streamReaders = new SelectiveStreamReader[rowType.getFieldCount()]; for (int columnId = 0; columnId < rowType.getFieldCount(); columnId++) { if (includedColumns.containsKey(columnId)) { StreamDescriptor streamDescriptor = streamDescriptors.get(columnId); streamReaders[columnId] = createStreamReader( streamDescriptor, Optional.ofNullable(filters.get(columnId)), outputColumns.contains(columnId) ? Optional.of(includedColumns.get(columnId)) : Optional.empty(), Optional.ofNullable(requiredSubfields.get(columnId)).orElse(ImmutableList.of()), hiveStorageTimeZone, systemMemoryContext); } } return streamReaders; }

Target:
private static SelectiveStreamReader[] createStreamReaders( OrcDataSource orcDataSource, List<OrcType> types, DateTimeZone hiveStorageTimeZone, Map<Integer, Type> includedColumns, List<Integer> outputColumns, Map<Integer, TupleDomainFilter> filters, Map<Integer, List<Subfield>> requiredSubfields, AggregatedMemoryContext systemMemoryContext) { List<StreamDescriptor> streamDescriptors = createStreamDescriptor("", "", 0, types, orcDataSource).getNestedStreams(); OrcType rowType = types.get(0); SelectiveStreamReader[] streamReaders = new SelectiveStreamReader[rowType.getFieldCount()]; for (int columnId = 0; columnId < rowType.getFieldCount(); columnId++) { if (includedColumns.containsKey(columnId)) { StreamDescriptor streamDescriptor = streamDescriptors.get(columnId); streamReaders[columnId] = createStreamReader( streamDescriptor, Optional.ofNullable(filters.get(columnId)), Optional.ofNullable(includedColumns.get(columnId)), Optional.ofNullable(requiredSubfields.get(columnId)).orElse(ImmutableList.of()), hiveStorageTimeZone, systemMemoryContext); } } return streamReaders; }
Source:
public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { allFormatDefs = getPossibleFormatValues(); createFormatValues(); Widget w = form.getWidget(FORMAT_PROPERTIES_NAME); if (!allFormatDefs.isEmpty() && w != null) { updateProperties(); form.replaceRow(FORMAT_PROPERTIES_NAME, formatProperties.getForm(Form.MAIN)); } else if (!allFormatDefs.isEmpty() && w == null) { updateProperties(); form.addRow(formatProperties.getForm(Form.MAIN)); } form.getWidget(format.getName()).setReadonly(allFormatDefs.isEmpty()); } }

Target:
public void refreshLayout(Form form) { super.refreshLayout(form); if (form.getName().equals(Form.MAIN)) { createFormatValues(); Widget w = form.getWidget(FORMAT_PROPERTIES_NAME); if (!allFormatDefs.isEmpty() && w != null) { updateProperties(); form.replaceRow(FORMAT_PROPERTIES_NAME, formatProperties.getForm(Form.MAIN)); } else if (!allFormatDefs.isEmpty() && w == null) { updateProperties(); form.addRow(formatProperties.getForm(Form.MAIN)); } form.getWidget(format.getName()).setReadonly(allFormatDefs.isEmpty()); } }
Source:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { List<Schema.Field> fields = from.getSchema().getFields(); fields.forEach(field -> { String fieldName = field.name(); to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); }); } else { _fields.forEach(fieldName -> to.putValue(fieldName, AvroUtils.convert(from.get(fieldName)))); } return to; }

Target:
public GenericRow extract(GenericRecord from, GenericRow to) { if (_extractAll) { List<Schema.Field> fields = from.getSchema().getFields(); for (Schema.Field field : fields) { String fieldName = field.name(); to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); } } else { for (String fieldName : _fields) { to.putValue(fieldName, AvroUtils.convert(from.get(fieldName))); } } return to; }
Source:
Name decomposeName(CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return new SimpleName(); } final NameParser parser = getNativeNameParser(); final Name name = new SimpleName(); for (int i = 0; i < compositeName.size(); i ++) { final String part = compositeName.get(i); final Name parsed = parser.parse(part); if (parsed.isEmpty()) parsed.add(""); name.addAll(parsed); } return name; }

Target:
Name decomposeName(CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return new SimpleName(); } final NameParser parser = getNativeNameParser(); final Name name = parser.parse(compositeName.get(0)); if(name.isEmpty())name.add(""); for (int i = 1; i < compositeName.size(); i ++) { final String part = compositeName.get(i); final Name parsed = parser.parse(part); if (parsed.isEmpty()) parsed.add(""); name.addAll(parsed); } return name; }
Source:
public Map activateStorageDomain(String sdUUID, String spUUID) { try { log.info("Activating storage domain, spUUID: sdUUID: {}", new Object[] { spUUID, sdUUID }); final StorageDomain storageDomain = getDataCenterById(spUUID).getStorageDomainMap().get(sdUUID); if (storageDomain != null) { activateClearance(storageDomain); log.info("storage were activated {}", storageDomain.getName(), sdUUID); }else { log.warn("no storage domains were activated"); } return getOKStatus(); } catch (Exception e) { throw error(e); } }

Target:
public Map activateStorageDomain(String sdUUID, String spUUID) { try { log.info("Activating storage domain, spUUID: sdUUID: {}", new Object[] { spUUID, sdUUID }); final StorageDomain storageDomain = getDataCenterById(spUUID).getStorageDomainMap().get(sdUUID); if (storageDomain != null) { activateClearance(storageDomain); log.info("storage were activated {}", storageDomain.getName(), sdUUID); } else { log.warn("No storage domains were activated for storage domain '{}' and storage pool '{}'", sdUUID, spUUID); } return getOKStatus(); } catch (Exception e) { throw error(e); } }
Source:
private boolean isNodeSupportGoInto(Object node) { return node != null && node instanceof Node && ((Node)node).supportGoInto(); }

Target:
private boolean isNodeSupportGoInto(Object node) { return node instanceof Node && ((Node)node).supportGoInto(); }
Source:
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity player) { if(!(target instanceof PlayerEntity) && !target.world.isRemote) { target.addPotionEffect(new EffectInstance(effect, duration, effectTier)); } return super.hitEntity(stack, target, player); }

Target:
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity player) { if((!(target instanceof PlayerEntity) || giveToPlayers) && !target.world.isRemote) { target.addPotionEffect(new EffectInstance(effect.get(), duration, effectTier)); } return super.hitEntity(stack, target, player); }
Source:
public VmCheckpointInfo(Map<String, Object> innerMap) { super(innerMap); if (innerMap.containsKey(VdsProperties.jobError)) { Map<String, Object> errorInfo = (Map<String, Object>) innerMap.get(VdsProperties.jobError); Integer code = (Integer) errorInfo.get(VdsProperties.jobErrorCode); String message = (String) errorInfo.get(VdsProperties.jobErrorMessage); error = new VDSError(EngineError.forValue(code), message); } Object[] tempObj = (Object[]) innerMap.get(VdsProperties.CHECKPOINT_IDS); if (tempObj != null) { checkpointsUuids = new String[tempObj.length]; for (int i = 0; i < tempObj.length; i++) { checkpointsUuids[i] = (String) tempObj[i]; } } }

Target:
public VmCheckpointInfo(Map<String, Object> innerMap) { super(innerMap); if (innerMap.containsKey(VdsProperties.jobError)) { Map<String, Object> errorInfo = (Map<String, Object>) innerMap.get(VdsProperties.jobError); Integer code = (Integer) errorInfo.get(VdsProperties.jobErrorCode); String message = (String) errorInfo.get(VdsProperties.jobErrorMessage); error = new VDSError(EngineError.forValue(code), message); } Object[] tempObj = (Object[]) innerMap.get(VdsProperties.CHECKPOINT_IDS); if (tempObj != null) { checkpointsIds = Arrays.stream(tempObj).map(s -> (String) s).collect(Collectors.toList()); } }
Source:
public boolean append( RecordCursor<RECORD> cursor, RECORD[] array, long id, int index ) { RECORD record = array[index]; if ( !cursor.next( id, record, RecordLoad.CHECK ) || (filter != null && !filter.test( record )) ) { return false; } return true; }

Target:
public boolean append( RecordCursor<RECORD> cursor, RECORD[] array, long id, int index ) { RECORD record = array[index]; return cursor.next( id, record, RecordLoad.CHECK ) && filter.test( record ); }
Source:
public static DataType<?> of(String typeName, List<Integer> parameters) { DataType<?> dataType = ofNameOrNull(typeName); if (dataType == null) { throw new IllegalArgumentException("Cannot find data type: " + typeName); } if (!parameters.isEmpty()) { if (dataType.id() == StringType.ID) { if (parameters.size() != 1) { throw new IllegalArgumentException( "The number of parameters for the text data is wrong: " + parameters.size()); } return StringType.of(parameters.get(0)); } throw new IllegalArgumentException( "The '" + typeName + "' type doesn't support type parameters."); } else { return dataType; } }

Target:
public static DataType<?> of(String typeName, List<Integer> parameters) { DataType<?> dataType = ofNameOrNull(typeName); if (dataType == null) { throw new IllegalArgumentException("Cannot find data type: " + typeName); } if (!parameters.isEmpty()) { if (dataType.id() == StringType.ID) { return StringType.of(parameters); } throw new IllegalArgumentException( "The '" + typeName + "' type doesn't support type parameters."); } else { return dataType; } }
Source:
public static Boolean equal(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right) { if (left == null) { return right == null; } if (right == null) { return false; } return deserialize(left).Equals(deserialize(right)); }

Target:
public static Boolean equal(@SqlType(GEOMETRY_TYPE_NAME) Slice left, @SqlType(GEOMETRY_TYPE_NAME) Slice right) { return deserialize(left).Equals(deserialize(right)); }
Source:
public void testIsSigned_signed() { IntegerDeclaration fixture_signed = new IntegerDeclaration(2, true, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, null, 8); boolean result = fixture_signed.isSigned(); assertEquals(true, result); }

Target:
public void testIsSigned_signed() { IntegerDeclaration fixtureSigned = new IntegerDeclaration(2, true, 1, ByteOrder.BIG_ENDIAN, Encoding.ASCII, null, 8); boolean result = fixtureSigned.isSigned(); assertEquals(true, result); }
Source:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); Guid volumeId = Guid.newGuid(); CinderlibReturnValue returnValue; List<String> extraParams = new ArrayList<>(); extraParams.add(volumeId.toString()); Number sizeInGiB = SizeConverter.convert(getParameters().getDiskInfo().getSize(), SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB); extraParams.add(Long.toString(sizeInGiB.longValue())); try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibCommand.CREATE_VOLUME, params); if (!returnValue.getSucceed()) { setSucceeded(false); return; } saveDisk(volumeId); } catch (Exception e) { log.error("Failed executing volume creation", e); setSucceeded(false); return; } getReturnValue().setActionReturnValue(volumeId); setSucceeded(true); }

Target:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); Guid volumeId = Guid.newGuid(); List<String> extraParams = new ArrayList<>(); extraParams.add(volumeId.toString()); Number sizeInGiB = SizeConverter.convert(getParameters().getDiskInfo().getSize(), SizeConverter.SizeUnit.BYTES, SizeConverter.SizeUnit.GiB); extraParams.add(Long.toString(sizeInGiB.longValue())); CinderlibReturnValue returnValue; try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibCommand.CREATE_VOLUME, params); } catch (Exception e) { log.error("Failed executing volume creation", e); return; } if (!returnValue.getSucceed()) { return; } saveDisk(volumeId); getReturnValue().setActionReturnValue(volumeId); setSucceeded(true); }
Source:
ValueJson(String str) throws IOException { int memFirst = Utils.getMemoryUsed(); if (str == null) { this.json=mapper.createObjectNode(); this.string = this.json.toString(); } this.string = str.replaceAll("\n", ""); char c = this.string.charAt(0); if ('{' == c) { ObjectNode node = (ObjectNode) mapper.readTree(this.string); this.json = node; } else if ('[' == c) { ObjectMapper mapper = new ObjectMapper(); ArrayNode arr = (ArrayNode) mapper.readTree(this.string); this.json = arr; } else { TextNode stringVal = new TextNode(this.string); this.json = stringVal; } this.binarySize = Utils.getMemoryUsed() - memFirst; }

Target:
ValueJson(String str) throws IOException { if (str == null) { this.json=mapper.createObjectNode(); this.string = this.json.toString(); } this.string = str.replaceAll("\n", ""); char c = this.string.charAt(0); if ('{' == c) { ObjectNode node = (ObjectNode) mapper.readTree(this.string); this.json = node; } else if ('[' == c) { ObjectMapper mapper = new ObjectMapper(); ArrayNode arr = (ArrayNode) mapper.readTree(this.string); this.json = arr; } else { TextNode stringVal = new TextNode(this.string); this.json = stringVal; } this.binarySize = string.length(); }
Source:
private void upsertData() throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); PreparedStatement sourceStmt = conn.prepareStatement(String.format(UPSERT_USER, sourceTableName)); PreparedStatement targetStmt = conn.prepareStatement(String.format(UPSERT_USER, targetTableName)); for (int t = 0; t < 2; t++) { for (int u = 1; u <= 10; u++) { String tenantId = sourceTenants.get(t); String userId = "user" + userNum++; int age = RANDOM.nextInt(99) + 1; upsertData(sourceStmt, tenantId, userId, age); if (tenantId.equals(sourceAndTargetTenant)) { upsertData(targetStmt, tenantId, userId, age); } } } for (int u = 1; u <= 10; u++) { upsertData(targetStmt, targetOnlyTenant); } conn.commit(); assertEquals(10, countUsers(sourceTableName, sourceOnlyTenant)); assertEquals(10, countUsers(sourceTableName, sourceAndTargetTenant)); assertEquals(0, countUsers(sourceTableName, targetOnlyTenant)); assertEquals(10, countUsers(targetTableName, sourceAndTargetTenant)); assertEquals(10, countUsers(targetTableName, targetOnlyTenant)); assertEquals(0, countUsers(targetTableName, sourceOnlyTenant)); }

Target:
private void upsertData() throws SQLException { Connection conn = DriverManager.getConnection(getUrl()); sourceStmt = conn.prepareStatement(String.format(UPSERT_USER, sourceTableName)); targetStmt = conn.prepareStatement(String.format(UPSERT_USER, targetTableName)); sourceSplitPoints = Lists.newArrayListWithExpectedSize(4); targetSplitPoints = Lists.newArrayListWithExpectedSize(2); upsertData(sourceOnlyTenant); upsertData(sourceAndTargetTenant); upsertData(targetOnlyTenant); conn.commit(); assertEquals(NUM_USERS, countUsers(sourceTableName, sourceOnlyTenant)); assertEquals(NUM_USERS, countUsers(sourceTableName, sourceAndTargetTenant)); assertEquals(0, countUsers(sourceTableName, targetOnlyTenant)); assertEquals(NUM_USERS, countUsers(targetTableName, sourceAndTargetTenant)); assertEquals(NUM_USERS, countUsers(targetTableName, targetOnlyTenant)); assertEquals(0, countUsers(targetTableName, sourceOnlyTenant)); }
Source:
private MemoryImageBuilder createMemoryImageBuilder() { if (!isMemorySnapshotSupported()) { return new NullableMemoryImageBuilder(); } if (getParameters().getSnapshotType() == SnapshotType.STATELESS) { return new StatelessSnapshotMemoryImageBuilder(getVm()); } if (getParameters().isSaveMemory() && isLiveSnapshotApplicable()) { boolean wipeAfterDelete = getDisksList().stream().anyMatch(d -> d.isWipeAfterDelete()); return new LiveSnapshotMemoryImageBuilder(getVm(), cachedStorageDomainId, getStoragePool(), this, vmOverheadCalculator, getParameters().getDescription(), wipeAfterDelete); } return new NullableMemoryImageBuilder(); }

Target:
private MemoryImageBuilder createMemoryImageBuilder() { if (!isMemorySnapshotSupported()) { return new NullableMemoryImageBuilder(); } if (getParameters().getSnapshotType() == SnapshotType.STATELESS) { return new StatelessSnapshotMemoryImageBuilder(getVm()); } if (getParameters().isSaveMemory() && isLiveSnapshotApplicable()) { boolean wipeAfterDelete = getDisksList().stream().anyMatch(DiskImage::isWipeAfterDelete); return new LiveSnapshotMemoryImageBuilder(getVm(), cachedStorageDomainId, getStoragePool(), this, vmOverheadCalculator, getParameters().getDescription(), wipeAfterDelete); } return new NullableMemoryImageBuilder(); }
Source:
public List<ConsumerRecord<byte[], byte[]>> update(final TopicPartition partition, final List<ConsumerRecord<byte[], byte[]>> records) { log.trace("Updating standby replicas of its state store for partition [{}]", partition); long limit = offsetLimits.getOrDefault(partition, Long.MAX_VALUE); long lastOffset = -1L; final List<ConsumerRecord<byte[], byte[]>> restoreRecords = new ArrayList<>(records.size()); final List<ConsumerRecord<byte[], byte[]>> remainingRecords = new ArrayList<>(); if (!records.isEmpty() && records.get(records.size() - 1).offset() >= limit && updateableOffsetLimits.remove(partition)) { limit = updateOffsetLimits(partition); } for (final ConsumerRecord<byte[], byte[]> record : records) { if (record.offset() < limit) { restoreRecords.add(record); lastOffset = record.offset(); } else { remainingRecords.add(record); } } if (!restoreRecords.isEmpty()) { stateMgr.updateStandbyStates(partition, restoreRecords, lastOffset); commitNeeded = true; } return remainingRecords; }

Target:
public List<ConsumerRecord<byte[], byte[]>> update(final TopicPartition partition, final List<ConsumerRecord<byte[], byte[]>> records) { if (records.isEmpty()) { return Collections.emptyList(); } log.trace("Updating standby replicas of its state store for partition [{}]", partition); long limit = offsetLimits.getOrDefault(partition, Long.MAX_VALUE); long lastOffset = -1L; final List<ConsumerRecord<byte[], byte[]>> restoreRecords = new ArrayList<>(records.size()); final List<ConsumerRecord<byte[], byte[]>> remainingRecords = new ArrayList<>(); for (final ConsumerRecord<byte[], byte[]> record : records) { if (record.offset() >= limit && updateableOffsetLimits.contains(partition)) { limit = updateOffsetLimits(partition); } if (record.offset() < limit) { restoreRecords.add(record); lastOffset = record.offset(); } else { remainingRecords.add(record); } } if (!restoreRecords.isEmpty()) { stateMgr.updateStandbyStates(partition, restoreRecords, lastOffset); commitNeeded = true; } return remainingRecords; }
Source:
private void addActionToTitle() { title.setOnLongClickListener(view -> { Utils.copy("place", title.getText().toString(), getContext()); Toast.makeText(getContext(), "Text copied to clipboard", Toast.LENGTH_SHORT).show(); return true; }); title.setOnClickListener(view -> { bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) { bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } else { bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } }); }

Target:
private void addActionToTitle() { title.setOnLongClickListener(view -> { Utils.copy("place", title.getText().toString(), getContext()); Toast.makeText(getContext(), R.string.text_copy, Toast.LENGTH_SHORT).show(); return true; }); title.setOnClickListener(view -> { bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) { bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } else { bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); } }); }
Source:
private void getHistory(AbstractFile origFile, File resultDir) throws TskCoreException, FileNotFoundException { ArrayList<File> historyFiles = getHistoryFiles(resultDir); if (historyFiles == null) { return; } for (File file : historyFiles) { Scanner fileScanner; try { fileScanner = new Scanner(new FileInputStream(file.toString())); } catch (FileNotFoundException ex) { LOG.log(Level.WARNING, "Unable to find the ESEDatabaseView file at " + file.getPath(), ex); continue; } Collection<BlackboardArtifact> bbartifacts = new ArrayList<>(); try { List<String> headers = null; while (fileScanner.hasNext()) { String line = fileScanner.nextLine(); if (headers == null) { headers = Arrays.asList(line.toLowerCase().split(",")); continue; } if (line.contains(EDGE_KEYWORD_VISIT)) { BlackboardArtifact b = getHistoryArtifact(origFile, headers, line); if (b != null) { bbartifacts.add(b); this.indexArtifact(b); } } } } finally { fileScanner.close(); } if (!bbartifacts.isEmpty()) { services.fireModuleDataEvent(new ModuleDataEvent( RecentActivityExtracterModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY, bbartifacts)); } } }

Target:
private void getHistory(AbstractFile origFile, File resultDir) throws TskCoreException, FileNotFoundException { ArrayList<File> historyFiles = getHistoryFiles(resultDir); if (historyFiles == null) { return; } for (File file : historyFiles) { Scanner fileScanner; try { fileScanner = new Scanner(new FileInputStream(file.toString())); } catch (FileNotFoundException ex) { LOG.log(Level.WARNING, "Unable to find the ESEDatabaseView file at " + file.getPath(), ex); continue; } Collection<BlackboardArtifact> bbartifacts = new ArrayList<>(); try { List<String> headers = null; while (fileScanner.hasNext()) { String line = fileScanner.nextLine(); if (headers == null) { headers = Arrays.asList(line.toLowerCase().split(",")); continue; } if (line.contains(EDGE_KEYWORD_VISIT)) { BlackboardArtifact ba = getHistoryArtifact(origFile, headers, line); if (ba != null) { bbartifacts.add(ba); this.indexArtifact(ba); } } } } finally { fileScanner.close(); } if (!bbartifacts.isEmpty()) { services.fireModuleDataEvent(new ModuleDataEvent( RecentActivityExtracterModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY, bbartifacts)); } } }
Source:
public GetUsersResult call() throws IOException, SignatureException, SSLSetupException, CommandException { try { ModifyUserSpectraS3Request modifyRequest = new ModifyUserSpectraS3Request(this.userId); for (String paramChange : this.modifyParams.keySet() ) { String paramNewValue = this.modifyParams.get(paramChange); if("default_data_policy_id".equalsIgnoreCase(paramChange)) { modifyRequest.withDefaultDataPolicyId(paramNewValue); } else if("name".equalsIgnoreCase(paramChange)) { throw new CommandException("Modify user name currently not supported." ); } else { throw new CommandException("Unrecognized user parameter: " + paramChange); } } final ModifyUserSpectraS3Response modifyResponse = getClient().modifyUserSpectraS3(modifyRequest); return new GetUsersResult(modifyResponse.getSpectraUserResult()); } catch (final FailedRequestException e) { throw new CommandException("Failed Modify User: " + e.getMessage(), e); } }

Target:
public GetUsersResult call() throws IOException, SignatureException, SSLSetupException, CommandException { try { final ModifyUserSpectraS3Request modifyRequest = new ModifyUserSpectraS3Request(this.userId); for (final String paramChange : this.modifyParams.keySet()) { final String paramNewValue = this.modifyParams.get(paramChange); if("default_data_policy_id".equalsIgnoreCase(paramChange)) { modifyRequest.withDefaultDataPolicyId(paramNewValue); } else if("name".equalsIgnoreCase(paramChange)) { throw new CommandException("Modify user name currently not supported." ); } else { throw new CommandException("Unrecognized user parameter: " + paramChange); } } final ModifyUserSpectraS3Response modifyResponse = getClient().modifyUserSpectraS3(modifyRequest); return new GetUsersResult(modifyResponse.getSpectraUserResult()); } catch (final FailedRequestException e) { throw new CommandException("Failed Modify User: " + e.getMessage(), e); } }