auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void main(String[] args) { ArrayList<String> tmpArgs = new ArrayList<String>(Arrays.asList(args)); int numThreads = 0; int delay = 0; <START> try { <END> int pos = tmpArgs.size() - 1; delay = Integer.parseInt(tmpArgs.get(pos)); tmpArgs.remove(pos); pos--; numThreads = Integer.parseInt(tmpArgs.get(pos)); tmpArgs.remove(pos); } catch (Exception e) { System.out.println("Please make sure that you set numthreads and sourcedelay properties in bin/samoa-threads.properties"); System.out.println(e.getStackTrace()); } args = tmpArgs.toArray(new String[0]); FlagOption suppressStatusOutOpt = new FlagOption("suppressStatusOut", 'S', SUPPRESS_STATUS_OUT_MSG); FlagOption suppressResultOutOpt = new FlagOption("suppressResultOut", 'R', SUPPRESS_RESULT_OUT_MSG); IntOption statusUpdateFreqOpt = new IntOption("statusUpdateFrequency", 'F', STATUS_UPDATE_FREQ_MSG, 1000, 0, Integer.MAX_VALUE); Option[] extraOptions = new Option[] { suppressStatusOutOpt, suppressResultOutOpt, statusUpdateFreqOpt }; StringBuilder cliString = new StringBuilder(); for (int i = 0; i < args.length; i++) { cliString.append(" ").append(args[i]); } logger.debug("Command line string = {}", cliString.toString()); System.out.println("Command line string = " + cliString.toString()); Task task = null; try { task = (Task) ClassOption.cliStringToObject(cliString.toString(), Task.class, extraOptions); logger.info("Sucessfully instantiating {}", task.getClass().getCanonicalName()); } catch (Exception e) { logger.error("Fail to initialize the task", e); System.out.println("Fail to initialize the task" + e); return; } task.setFactory(new ThreadsComponentFactory()); task.init(); ThreadsEngine.submitTopology(task.getTopology(), delay, numThreads); }</code><technical_language>Option parsing is a bit fragile</technical_language>

Target:
public static void main(String[] args) { ArrayList<String> tmpArgs = new ArrayList<String>(Arrays.asList(args)); int numThreads = 1; for (int i=0; i<tmpArgs.size()-1; i++) { if (tmpArgs.get(i).equals("-t")) { try { numThreads = Integer.parseInt(tmpArgs.get(i+1)); tmpArgs.remove(i+1); tmpArgs.remove(i); } catch (NumberFormatException e) { System.err.println("Invalid number of threads."); System.err.println(e.getStackTrace()); } } } logger.info("Number of threads:{}", numThreads); args = tmpArgs.toArray(new String[0]); StringBuilder cliString = new StringBuilder(); for (int i = 0; i < args.length; i++) { cliString.append(" ").append(args[i]); } logger.debug("Command line string = {}", cliString.toString()); System.out.println("Command line string = " + cliString.toString()); Task task = null; try { task = (Task) ClassOption.cliStringToObject(cliString.toString(), Task.class, null); logger.info("Sucessfully instantiating {}", task.getClass().getCanonicalName()); } catch (Exception e) { logger.error("Fail to initialize the task", e); System.out.println("Fail to initialize the task" + e); return; } task.setFactory(new ThreadsComponentFactory()); task.init(); ThreadsEngine.submitTopology(task.getTopology(), numThreads); }
Source:
<code>public Set<Rule> rules() { <START> return ImmutableSet.of(new ProjectExpressionRewrite(), new AggregationExpressionRewrite(), new FilterExpressionRewrite(), new TableScanExpressionRewrite(), new JoinExpressionRewrite(), new ValuesExpressionRewrite(), new ApplyExpressionRewrite()); <END> }</code><technical_language>Please put rewrite in separate line</technical_language>

Target:
public Set<Rule> rules() { return rules; }
Source:
<code>protected void demandResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); for (URI currentUri : uriCollection) { <START> lock.lock(); <END> try { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { monitor.setWorkRemaining(1000); ListenableFuture<?> future = resolvingPool.submit(new ResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } finally { lock.unlock(); } } }</code><technical_language>lock of this loop? locking unlocking, is useful</technical_language>

Target:
protected void demandResolve(SynchronizedResourceSet resourceSet, URI uri, final ThreadSafeProgressMonitor monitor) { if (isInterruptedOrCanceled(monitor)) { demandResolvingAndUnloadingPoolShutdown(); return; } Collection<URI> uriCollection = dependencyProviderRegistry.getDependencies(uri); lock.lock(); try { for (URI currentUri : uriCollection) { if (resolvedResources.add(currentUri) && currentlyResolving.add(currentUri)) { monitor.setWorkRemaining(1000); ListenableFuture<?> future = resolvingPool.submit(new ResourceResolver(resourceSet, currentUri, monitor)); Futures.addCallback(future, new ResolvingFutureCallback(monitor, currentUri)); } } } finally { lock.unlock(); } }
Source:
<code>private void assertGetResult(VM result) { assertNotNull(result); <START> assertEquals("Vm db generation wasn't loaded as expected", new Long(1), result.getDbGeneration()); <END> assertEquals(result, existingVm); }</code><technical_language>Long.valueOf(1)</technical_language>

Target:
private void assertGetResult(VM result) { assertNotNull(result); assertTrue("Vm db generation wasn't loaded as expected", result.getDbGeneration() == 1); assertEquals(result, existingVm); }
Source:
<code>public <B> Eval<B> bind(final F<A, Eval<B>> f) { <START> if (isTrampoline()) { <END> return bindTrampoline(f, (TrampolineEval<A>) this); } else { return bindTrampoline(f, pureTrampoline(this)); } }</code><technical_language>instead of abstract isTrampoline I simpler safer a abstract asTrampoline return a TrampolineEval<A>. this method simply: return bindTrampoline(f, this.asTrampoline);</technical_language>

Target:
public final <B> Eval<B> bind(final F<A, Eval<B>> f) { return new BindTrampolineEval<>(f, asTrampoline()); }
Source:
<code>private void parseUpdate(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canUpdate()) { if (isHead(cmd) && !isCommit(cmd)) { return; } validateNewCommits(ctl, cmd); } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { errors.put(Error.CONFIG_UPDATE, Collections.<String> emptyList()); } else { addError(Error.UPDATE, ctl.getRefName()); } <START> reject(cmd, String.format("%s cannot update the reference as a fast forward", displayName(ctl))); <END> } }</code><technical_language>This is long :-(</technical_language>

Target:
private void parseUpdate(final ReceiveCommand cmd) { RefControl ctl = projectControl.controlForRef(cmd.getRefName()); if (ctl.canUpdate()) { if (isHead(cmd) && !isCommit(cmd)) { return; } validateNewCommits(ctl, cmd); } else { if (GitRepositoryManager.REF_CONFIG.equals(ctl.getRefName())) { errors.put(Error.CONFIG_UPDATE, Collections.<String> emptyList()); } else { addError(Error.UPDATE, ctl); } reject(cmd, "can not update the reference as a fast forward"); } }
Source:
<code>private String decode(final String resourceName) { try { return URLDecoder.decode(resourceName, "UTF-8"); <START> } catch (Exception e) { <END> return resourceName; } }</code><technical_language>Hi, doublechecking if this is want do here. catching general Exception is a bad practice, catch exceptions want catch. @mariofusco do think</technical_language>

Target:
private String decode(final String resourceName) { try { return URLDecoder.decode(resourceName, "UTF-8"); } catch (UnsupportedEncodingException | IllegalArgumentException e) { return resourceName; } }
Source:
<code>public void messageQueueTest() { MessageQueue msgQueue = new MessageQueue(); Message msg = new Message("MessageQueue Test"); <START> msgQueue.submitMsg(msg); <END> assertEquals(msg.getMsg(), msgQueue.retrieveMsg().getMsg()); }</code><technical_language>Message created submitted line</technical_language>

Target:
public void messageQueueTest() { MessageQueue msgQueue = new MessageQueue(); msgQueue.submitMsg(new Message("MessageQueue Test")); assertEquals(msgQueue.retrieveMsg().getMsg(), "MessageQueue Test"); }
Source:
<code>public User getOneWithFollowers(String userId) { User user = userRepository.findOneByUserId(userId); <START> Hibernate.initialize(user.getFollowers()); <END> return user; }</code><technical_language>this in getOne</technical_language>

Target:
public User getOneWithFollowers(String userId) { User one = userRepository.findOneByUserId(userId); one.getFollowers().size(); return one; }
Source:
<code>public void testReleasesItsComponents2() { ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); buffer.writeBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); ByteBuf s1 = buffer.readRetainedSlice(2); ByteBuf s2 = s1.readRetainedSlice(2); ByteBuf s3 = s2.readRetainedSlice(2); ByteBuf s4 = s3.readRetainedSlice(2); ByteBuf composite = PooledByteBufAllocator.DEFAULT.compositeBuffer() .addComponent(s1) .addComponents(s2, s3, s4) .order(ByteOrder.LITTLE_ENDIAN); assertEquals(1, composite.refCnt()); assertEquals(2, buffer.refCnt()); <START> ReferenceCountUtil.release(composite); <END> assertEquals(0, composite.refCnt()); assertEquals(1, buffer.refCnt()); ReferenceCountUtil.release(buffer); assertEquals(0, buffer.refCnt()); }</code><technical_language>composite.release()</technical_language>

Target:
public void testReleasesItsComponents2() { ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); buffer.writeBytes(new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); ByteBuf s1 = buffer.readRetainedSlice(2); ByteBuf s2 = s1.readRetainedSlice(2); ByteBuf s3 = s2.readRetainedSlice(2); ByteBuf s4 = s3.readRetainedSlice(2); ByteBuf composite = Unpooled.compositeBuffer() .addComponent(s1) .addComponents(s2, s3, s4) .order(ByteOrder.LITTLE_ENDIAN); assertEquals(1, composite.refCnt()); assertEquals(2, buffer.refCnt()); composite.release(); assertEquals(0, composite.refCnt()); assertEquals(1, buffer.refCnt()); buffer.release(); assertEquals(0, buffer.refCnt()); }
Source:
<code>private boolean httpAuthentication(Credentials creds) { return <START> true; <END> }</code><technical_language>default return false now, is true, explain</technical_language>

Target:
private boolean httpAuthentication(Credentials creds) { if (creds != null && creds.getUserPrincipal() != null) { return true; } else { return false; } }
Source:
<code>public String logSelectQueriesForCurrentThread(int... theIndexes) { List<String> queries = getSelectQueriesForCurrentThread() .stream() <START> .map(t -> CircularQueueCaptureQueriesListener.formatQueryAsSql(t)) <END> .collect(Collectors.toList()); if (theIndexes != null && theIndexes.length > 0) { List<String> newList = new ArrayList<>(); for (int i = 0; i < theIndexes.length; i++) { newList.add(queries.get(theIndexes[i])); } queries = newList; } String queriesAsString = String.join("\n", queries); ourLog.info("Select Queries:\n{}", queriesAsString); return queriesAsString; }</code><technical_language>nitpick: I :: syntax</technical_language>

Target:
public String logSelectQueriesForCurrentThread(int... theIndexes) { List<String> queries = getSelectQueriesForCurrentThread() .stream() .map(CircularQueueCaptureQueriesListener::formatQueryAsSql) .collect(Collectors.toList()); if (theIndexes != null && theIndexes.length > 0) { List<String> newList = new ArrayList<>(); for (int i = 0; i < theIndexes.length; i++) { newList.add(queries.get(theIndexes[i])); } queries = newList; } String queriesAsString = String.join("\n", queries); ourLog.info("Select Queries:\n{}", queriesAsString); return queriesAsString; }
Source:
<code>public void restoreFragmentListeners() { <START> FragmentManager fragmentManager = mainActivity.getSupportFragmentManager(); <END> Fragment fragment = fragmentManager.findFragmentByTag(Constants.COLOR_PICKER_DIALOG_TAG); if (fragment != null) { setupColorPickerDialogListeners((ColorPickerDialog) fragment); } }</code><technical_language>please revert changes this file</technical_language>

Target:
public void restoreFragmentListeners() { Fragment fragment = findFragmentByTag(Constants.COLOR_PICKER_DIALOG_TAG); if (fragment != null) { setupColorPickerDialogListeners((ColorPickerDialog) fragment); } }
Source:
<code>public Set<String> listIndexes(final Connection db, String tableName) throws SQLException { Statement s = db.createStatement(); tableName = tableName.toUpperCase(); try { ResultSet rs = s.executeQuery(String.format( <START> "SELECT distinct index_name FROM user_indexes " <END> + "where table_name = '%s'", tableName)); try { Set<String> indexes = new HashSet<String>(); while (rs.next()) { indexes.add(rs.getString(1).toLowerCase()); } return indexes; } finally { rs.close(); } } finally { s.close(); } }</code><technical_language>nit: i prefer space a continued line start of next line, end of this line</technical_language>

Target:
public Set<String> listIndexes(final Connection db, String tableName) throws SQLException { PreparedStatement s = db.prepareStatement("SELECT distinct index_name " + "FROM user_indexes WHERE table_name = ?"); try { s.setString(1, tableName.toUpperCase()); ResultSet rs = s.executeQuery(); try { Set<String> indexes = new HashSet<String>(); while (rs.next()) { indexes.add(rs.getString(1).toLowerCase()); } return indexes; } finally { rs.close(); } } finally { s.close(); } }
Source:
<code>public boolean equals(Object object) { if (object == this) { return true; } if (object instanceof BlockSplitBloomFilter) { BlockSplitBloomFilter that = (BlockSplitBloomFilter) object; <START> return Arrays.equals(this.bitset, that.bitset) <END> && this.maximumBytes == that.maximumBytes && this.hashStrategy == that.hashStrategy; } return false; }</code><technical_language>3 checks while other properties minimumBytes</technical_language>

Target:
public boolean equals(Object object) { if (object == this) { return true; } if (object instanceof BlockSplitBloomFilter) { BlockSplitBloomFilter that = (BlockSplitBloomFilter) object; return Arrays.equals(this.bitset, that.bitset) && this.getAlgorithm() == that.getAlgorithm() && this.hashStrategy == that.hashStrategy; } return false; }
Source:
<code>public Flux<BlobChangefeedPagedResponse> byPage(String continuationToken, int preferredPageSize) { <START> if (continuationToken != null) { return Flux.error(new UnsupportedOperationException("continuationToken not supported. Use " + "client.getEvents(String) to pass in a cursor.")); } <END> if (preferredPageSize <= 0) { return Flux.error(new IllegalArgumentException("preferredPageSize > 0 required but provided: " + preferredPageSize)); } preferredPageSize = Integer.min(preferredPageSize, defaultPageSize); return changefeed.getEvents() .window(preferredPageSize) .flatMap(eventWrappers -> { Flux<BlobChangefeedEventWrapper> cachedEventWrappers = eventWrappers.cache(); Mono<ChangefeedCursor> c = cachedEventWrappers.last() .map(BlobChangefeedEventWrapper::getCursor); Mono<List<BlobChangefeedEvent>> e = cachedEventWrappers .map(BlobChangefeedEventWrapper::getEvent) .collectList(); return Mono.zip(e, c); }) .map(tuple2 -> new BlobChangefeedPagedResponse(tuple2.getT1(), tuple2.getT2())); }</code><technical_language>interpret continuationToken cursor ? strings effectively - opaque string resume iteration</technical_language>

Target:
public Flux<BlobChangefeedPagedResponse> byPage(String continuationToken, int preferredPageSize) { if (continuationToken != null) { return FluxUtil.fluxError(logger, new UnsupportedOperationException("continuationToken not supported. Use " + "client.getEvents(String) to pass in a cursor.")); } if (preferredPageSize <= 0) { return FluxUtil.fluxError(logger, new IllegalArgumentException("preferredPageSize > 0 required but " + "provided: " + preferredPageSize)); } preferredPageSize = Integer.min(preferredPageSize, DEFAULT_PAGE_SIZE); Changefeed changefeed; if (cursor != null) { changefeed = changefeedFactory.getChangefeed(cursor); } else { changefeed = changefeedFactory.getChangefeed(startTime, endTime); } return changefeed.getEvents() .window(preferredPageSize) .concatMap(eventWrappers -> { Flux<BlobChangefeedEventWrapper> cachedEventWrappers = eventWrappers.cache(); Mono<ChangefeedCursor> c = cachedEventWrappers.last() .map(BlobChangefeedEventWrapper::getCursor); Mono<List<BlobChangefeedEvent>> e = cachedEventWrappers .map(BlobChangefeedEventWrapper::getEvent) .collectList(); return Mono.zip(e, c); }) .map(tuple2 -> new BlobChangefeedPagedResponse(tuple2.getT1(), tuple2.getT2())); }
Source:
<code>public Iterable<PushCertificate> getAll(final String refName) { return new Iterable<PushCertificate>() { @Override public Iterator<PushCertificate> iterator() { final String path = pathName(refName); final RevWalk rw; try { if (reader == null) { load(); } if (commit != null) { rw = new RevWalk(reader); rw.setTreeFilter(AndTreeFilter.create( PathFilterGroup.create( Collections.singleton(PathFilter.create(path))), TreeFilter.ANY_DIFF)); rw.setRewriteParents(false); rw.markStart(rw.parseCommit(commit)); } else { rw = null; } } catch (IOException e) { throw new RuntimeException(e); } return new Iterator<PushCertificate>() { private PushCertificate added = getPending(refName); private PushCertificate next; @Override public boolean hasNext() { try { if (next == null) { if (added != null) { next = added; added = null; return true; } else if (rw == null) { return false; } try { RevCommit c = rw.next(); if (c != null) { try (TreeWalk tw = TreeWalk.forPath( rw.getObjectReader(), path, c.getTree())) { next = read(tw); } } else { next = null; } } catch (IOException e) { throw new RuntimeException(e); } } return next != null; } finally { if (next == null && rw != null) { <START> rw.close(); <END> } } } @Override public PushCertificate next() { hasNext(); PushCertificate n = next; if (n == null) { throw new NoSuchElementException(); } next = null; return n; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }</code><technical_language>rw = null</technical_language>

Target:
public Iterable<PushCertificate> getAll(final String refName) { return new Iterable<PushCertificate>() { @Override public Iterator<PushCertificate> iterator() { return new Iterator<PushCertificate>() { private final String path = pathName(refName); private PushCertificate next; private RevWalk rw; { try { if (reader == null) { load(); } if (commit != null) { rw = new RevWalk(reader); rw.setTreeFilter(AndTreeFilter.create( PathFilterGroup.create( Collections.singleton(PathFilter.create(path))), TreeFilter.ANY_DIFF)); rw.setRewriteParents(false); rw.markStart(rw.parseCommit(commit)); } else { rw = null; } } catch (IOException e) { throw new RuntimeException(e); } } @Override public boolean hasNext() { try { if (next == null) { if (rw == null) { return false; } try { RevCommit c = rw.next(); if (c != null) { try (TreeWalk tw = TreeWalk.forPath( rw.getObjectReader(), path, c.getTree())) { next = read(tw); } } else { next = null; } } catch (IOException e) { throw new RuntimeException(e); } } return next != null; } finally { if (next == null && rw != null) { rw.close(); rw = null; } } } @Override public PushCertificate next() { hasNext(); PushCertificate n = next; if (n == null) { throw new NoSuchElementException(); } next = null; return n; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
Source:
<code>private boolean notRacyClean(long read) { <START> return read - lastModified > (fsTimestampResolution.toNanos() + 1) * 11 / 10_000_000; <END> }</code><technical_language>If fsTimestampResolution is 4_500_000ns, this compares > 4ms. I need convert (read - lastModified) nanoseconds compare nanoseconds</technical_language>

Target:
private boolean notRacyClean(long read) { long racyNanos = (fsTimestampResolution.toNanos() + 1) * 11 / 10; return (read - lastModified) * 1_000_000 > racyNanos; }
Source:
<code>public static Date getDueDate(final Event event) { <START> return event.getDueDateAmountMap().keySet().stream() <END> .sorted(Comparator.reverseOrder()).findFirst().get().toDate(); }</code><technical_language>this max</technical_language>

Target:
public static Date getDueDate(final Event event) { return event.getDueDateAmountMap().keySet() .stream() .max(Comparator.naturalOrder()) .map(LocalDate::toDate) .orElseThrow(() -> new DomainException("key.return.argument", "No due date found for event " + event.getExternalId()); }
Source:
<code><START> public static void addConfigDriveDisk(final VirtualMachineProfile profile, final DataStore dataStore) throws ResourceUnavailableException { <END> boolean isoAvailable = false; final String isoPath = ConfigDrive.createConfigDrivePath(profile.getInstanceName()); for (DiskTO dataTo : profile.getDisks()) { if (dataTo.getPath().equals(isoPath)) { isoAvailable = true; break; } } if (!isoAvailable) { TemplateObjectTO dataTO = new TemplateObjectTO(); if (dataStore == null) { throw new ResourceUnavailableException("Config drive disk add failed, datastore not available", ConfigDriveNetworkElement.class, 0L); } dataTO.setDataStore(dataStore.getTO()); dataTO.setUuid(profile.getUuid()); dataTO.setPath(isoPath); dataTO.setFormat(Storage.ImageFormat.ISO); profile.addDisk(new DiskTO(dataTO, CONFIGDRIVEDISKSEQ.longValue(), isoPath, Volume.Type.ISO)); } else { LOG.warn("Config drive iso already is in VM profile."); } }</code><technical_language>explain? I</technical_language>

Target:
private void addConfigDriveDisk(final VirtualMachineProfile profile, final DataStore dataStore) throws ResourceUnavailableException { boolean isoAvailable = false; final String isoPath = ConfigDrive.createConfigDrivePath(profile.getInstanceName()); for (DiskTO dataTo : profile.getDisks()) { if (dataTo.getPath().equals(isoPath)) { isoAvailable = true; break; } } if (!isoAvailable) { TemplateObjectTO dataTO = new TemplateObjectTO(); if (dataStore == null) { throw new ResourceUnavailableException("Config drive disk add failed, datastore not available", ConfigDriveNetworkElement.class, 0L); } dataTO.setDataStore(dataStore.getTO()); dataTO.setUuid(profile.getUuid()); dataTO.setPath(isoPath); dataTO.setFormat(Storage.ImageFormat.ISO); profile.addDisk(new DiskTO(dataTO, CONFIGDRIVEDISKSEQ.longValue(), isoPath, Volume.Type.ISO)); } else { LOG.warn("Config drive iso already is in VM profile."); } }
Source:
<code>public static List<File> getTestInputFiles(FilenameFilter filter) { File[] testFiles = getPackagePath().toFile().listFiles(filter); File[] testPartialFiles = getPackagePath().resolve("partial").toFile().listFiles(filter); File[] testMultifilePartailFiles = getPackagePath().resolve("multifilePartial").toFile().listFiles(filter); File[] testPartialCrossModuleTypeImportsFiles = getPackagePath().resolve("partialCrossModuleTypeImports").toFile().listFiles(filter); File[] testOutputBaseFiles = getPackagePath().resolve("outputBase").toFile().listFiles(filter); List<File> filesList = Lists.newArrayList(testFiles); filesList.addAll(Arrays.asList(testPartialFiles)); filesList.addAll(Arrays.asList(testMultifilePartailFiles)); filesList.addAll(Arrays.asList(testPartialCrossModuleTypeImportsFiles)); filesList.addAll(Arrays.asList(testOutputBaseFiles)); Stream<File> jsFiles = filesList.stream().filter(f -> !f.getName().endsWith(".zip")); Stream<File> zipFiles = filesList .stream() .filter(f -> f.getName().endsWith(".zip")) .map(File::getPath) .flatMap( f -> { try (ZipFile zipFile = new ZipFile(f)) { return zipFile .stream() .filter(e -> !e.isDirectory()) .filter(e -> e.getName().endsWith(".js")) <START> .map(e -> f + "!/" + e.getName()) <END> .map(Paths::get) .map(Path::toFile) .collect(Collectors.toList()) .stream(); } catch (IOException e) { throw new RuntimeException("failed to read zip file " + f, e); } }); return Stream.concat(jsFiles, zipFiles).collect(Collectors.toList()); }</code><technical_language>some duplicated logic DeclarationGenerator. Consider extracting a helper</technical_language>

Target:
public static List<File> getTestInputFiles(FilenameFilter filter) { File[] testFiles = getPackagePath().toFile().listFiles(filter); File[] testPartialFiles = getPackagePath().resolve("partial").toFile().listFiles(filter); File[] testMultifilePartailFiles = getPackagePath().resolve("multifilePartial").toFile().listFiles(filter); File[] testPartialCrossModuleTypeImportsFiles = getPackagePath().resolve("partialCrossModuleTypeImports").toFile().listFiles(filter); File[] testOutputBaseFiles = getPackagePath().resolve("outputBase").toFile().listFiles(filter); List<File> filesList = Lists.newArrayList(testFiles); filesList.addAll(Arrays.asList(testPartialFiles)); filesList.addAll(Arrays.asList(testMultifilePartailFiles)); filesList.addAll(Arrays.asList(testPartialCrossModuleTypeImportsFiles)); filesList.addAll(Arrays.asList(testOutputBaseFiles)); Stream<File> jsFiles = filesList.stream().filter(f -> !f.getName().endsWith(".zip")); Stream<File> zipFiles = filesList .stream() .filter(f -> f.getName().endsWith(".zip")) .map(File::getPath) .map(DeclarationGenerator::getJsEntryPathsFromZip) .flatMap(List::stream) .map(Path::toFile); return Stream.concat(jsFiles, zipFiles).collect(Collectors.toList()); }
Source:
<code>public void testNetworkError() throws IOException, InterruptedException { initialize(); List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; int requestCount; requestInfoList.add(new RequestInfo(host2, port2, new MockSend(5))); requestInfoList.add(new RequestInfo(host2, port2, new MockSend(6))); requestCount = requestInfoList.size(); selector.setBeBad(true); do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNotNull("Should have encountered an error", error); Assert.assertEquals("Should have received a connection unavailable error", NetworkClientErrorCode.NetworkError, error); Assert.assertNull("Should not have received a valid response", response); requestCount--; } } while (requestCount > 0); responseInfoList = networkClient.sendAndPoll(requestInfoList); <START> requestInfoList.clear(); <END> Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); selector.setBeBad(false); }</code><technical_language>do clear</technical_language>

Target:
public void testNetworkError() throws IOException, InterruptedException { List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; requestInfoList.add(new RequestInfo(host2, port2, new MockSend(5))); requestInfoList.add(new RequestInfo(host2, port2, new MockSend(6))); int requestCount = requestInfoList.size(); int responseCount = 0; selector.setBeBad(true); do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNotNull("Should have encountered an error", error); Assert.assertEquals("Should have received a connection unavailable error", NetworkClientErrorCode.NetworkError, error); Assert.assertNull("Should not have received a valid response", response); responseCount++; } } while (requestCount > responseCount); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); selector.setBeBad(false); }
Source:
<code><START> public void testFindByRegionsAndComplexFiltersExcludeMultiple() { <END> List<Region> regions = new ArrayList<>(); regions.add(new Region("11", 183000, 183300)); List<String> exclude = new ArrayList<>(); exclude.add("files"); exclude.add("ids"); List<VariantEntity> variantEntityList = variantEntityRepository.findByRegionsAndComplexFilters(regions, null, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, exclude, new PageRequest(0, 100000000)); for (VariantEntity currVariantEntity : variantEntityList) { assertTrue(currVariantEntity.getSourceEntries().isEmpty()); assertTrue(currVariantEntity.getIds().isEmpty()); } exclude = new ArrayList<>(); variantEntityList = variantEntityRepository.findByRegionsAndComplexFilters(regions, null, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, exclude, new PageRequest(0, 100000000)); for (VariantEntity currVariantEntity : variantEntityList) { assertFalse(currVariantEntity.getSourceEntries().isEmpty()); assertFalse(currVariantEntity.getIds().isEmpty()); } }</code><technical_language>of test cases (no exclusions) redundant if previous is split in 2. asserts grouped single method. Applies testFindByRegionsAndComplexFiltersExcludeNested</technical_language>

Target:
public void testFindByRegionsAndComplexFiltersExcludeMultiple() { List<Region> regions = new ArrayList<>(); regions.add(new Region("11", 183000, 183300)); List<String> exclude = new ArrayList<>(); exclude.add("files"); exclude.add("ids"); List<VariantEntity> variantEntityList = variantEntityRepository.findByRegionsAndComplexFilters(regions, null, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, VariantEntityRepository.RelationalOperator.NONE, null, exclude, new PageRequest(0, 100000000)); for (VariantEntity currVariantEntity : variantEntityList) { assertTrue(currVariantEntity.getSourceEntries().isEmpty()); assertTrue(currVariantEntity.getIds().isEmpty()); } }
Source:
<code>public AssumptionViolatedException(String assumption, boolean valueMatcher, Object value, Matcher<?> matcher) { <START> if (value instanceof Throwable) { <END> initCause((Throwable) value); } this.assumption = assumption; this.value = value; this.matcher = matcher; this.valueMatcher = valueMatcher; }</code><technical_language>closer, I this be: if (!valueMatcher && (value instanceof Throwable)) { This lead initCause() called if constructor. This is a slight change in behavior, I expect throw AssumptionViolationException a cause: assumeThat(e, hasMessage("woops")); _Edit:_ A simpler solution call initCause() in AssumptionViolatedException(String assumption, Throwable e). I before; this class is complicated</technical_language>

Target:
public AssumptionViolatedException(String assumption, boolean valueMatcher, Object value, Matcher<?> matcher) { this.assumption = assumption; this.value = value; this.matcher = matcher; this.valueMatcher = valueMatcher; }
Source:
<code>public byte[] getCacheKey() { final byte[] aggBytes = StringUtils.toUtf8(aggregationName); <START> final byte[] valBytes = Bytes.toArray(Collections.singletonList(value)); <END> return ByteBuffer.allocate(1 + aggBytes.length + valBytes.length) .put(CACHE_KEY) .put(aggBytes) .put(valBytes) .array(); }</code><technical_language>new byte[] {value.byteValue()}</technical_language>

Target:
public byte[] getCacheKey() { final byte[] aggBytes = StringUtils.toUtf8(aggregationName); final byte[] valBytes = new byte[] { value.byteValue() }; return ByteBuffer.allocate(1 + aggBytes.length + valBytes.length) .put(CACHE_KEY) .put(aggBytes) .put(valBytes) .array(); }
Source:
<code>public static List<ChromeCast> get() { <START> synchronized (INSTANCE.chromeCasts) { <END> return new ArrayList<ChromeCast>(INSTANCE.chromeCasts); } }</code><technical_language>I idea put synchronization here. some concurrent collections, unmodifiable list. replace reference time change occurs. I change much, list of current chromecasts called more in runtime, sense remove synchronization unmodifiable collection here. Please do it</technical_language>

Target:
public static List<ChromeCast> get() { return new ArrayList<ChromeCast>(INSTANCE.chromeCasts); }
Source:
<code>public CastFromHandWithoutPayingManaCostEffect(FilterCard filter, boolean fromHand, Duration duration) { super(duration, Outcome.Detriment); this.filter = filter; <START> this.fromHand = fromHand; <END> }</code><technical_language>Missing staticText code. main constructor code setup max params other additional constructors this(...) call</technical_language>

Target:
public CastFromHandWithoutPayingManaCostEffect(FilterCard filter, boolean fromHand, Duration duration) { super(duration, Outcome.Detriment); this.filter = filter; this.fromHand = fromHand; this.staticText = "You may cast " + filter.getMessage() + (fromHand ? " from your hand" : "") + " without paying their mana costs"; }
Source:
<code>public GitSynchronizeData(Repository repository, String srcRev, String dstRev, boolean includeLocal) throws IOException { repo = repository; Ref srcRef = repo.getRef(srcRev); Ref dstRef = repo.getRef(dstRev); <START> ObjectWalk ow = new ObjectWalk(repo); <END> ow.markStart(ow.parseCommit(srcRef.getObjectId())); this.srcRev = ow.next(); ow.reset(); ow.markStart(ow.parseCommit(dstRef.getObjectId())); this.dstRev = ow.next(); this.includeLocal = includeLocal; repoParentPath = repo.getDirectory().getParentFile().getAbsolutePath(); projects = new HashSet<IProject>(); final IProject[] workspaceProjects = ResourcesPlugin.getWorkspace() .getRoot().getProjects(); for (IProject project : workspaceProjects) { RepositoryMapping mapping = RepositoryMapping.getMapping(project); if (mapping != null && mapping.getRepository() == repo) projects.add(project); } }</code><technical_language>IMHO this.srcRev = ow.parseCommit(srcRef.getObjectId()) a RevWalk instead of ObjectWalk</technical_language>

Target:
public GitSynchronizeData(Repository repository, String srcRev, String dstRev, boolean includeLocal) throws IOException { repo = repository; Ref srcRef = repo.getRef(srcRev); Ref dstRef = repo.getRef(dstRev); ObjectWalk ow = new ObjectWalk(repo); this.srcRev = ow.parseCommit(srcRef.getObjectId()); this.dstRev = ow.parseCommit(dstRef.getObjectId()); this.includeLocal = includeLocal; repoParentPath = repo.getDirectory().getParentFile().getAbsolutePath(); projects = new HashSet<IProject>(); final IProject[] workspaceProjects = ResourcesPlugin.getWorkspace() .getRoot().getProjects(); for (IProject project : workspaceProjects) { RepositoryMapping mapping = RepositoryMapping.getMapping(project); if (mapping != null && mapping.getRepository() == repo) projects.add(project); } }
Source:
<code>public LogReplicationServerRouter(List<AbstractServer> servers) { this.serverEpoch = ((BaseServer) servers.get(0)).serverContext.getServerEpoch(); this.servers = ImmutableList.copyOf(servers); this.handlerMap = new EnumMap<>(CorfuMsgType.class); servers.forEach(server -> { try { server.getHandler().getHandledTypes().forEach(x -> handlerMap.put(x, server)); } catch (UnsupportedOperationException ex) { <START> log.warn("No registered CorfuMsg handler for server {}", server); <END> } }); this.serverAdapter = getAdapter(((BaseServer) servers.get(0)).serverContext); }</code><technical_language>log.error exception perhaps</technical_language>

Target:
public LogReplicationServerRouter(List<AbstractServer> servers) { this.serverEpoch = ((BaseServer) servers.get(0)).serverContext.getServerEpoch(); this.servers = ImmutableList.copyOf(servers); this.handlerMap = new EnumMap<>(CorfuMsgType.class); servers.forEach(server -> { try { server.getHandler().getHandledTypes().forEach(x -> handlerMap.put(x, server)); } catch (UnsupportedOperationException ex) { log.error("No registered CorfuMsg handler for server {}", server, ex); } }); this.serverAdapter = getAdapter(((BaseServer) servers.get(0)).serverContext); }
Source:
<code>public void assertIsEqualToNormalizingNewlines(AssertionInfo info, CharSequence actual, CharSequence expected) { String actualNormalized = actual.toString().replaceAll("\\r\\n", "\n"); <START> String expectedNormalized = expected.toString().replaceAll("\\r\\n", "\n"); <END> if(!actualNormalized.equals(expectedNormalized)) throw failures.failure(info, shouldBeEqual(actual, expected)); }</code><technical_language>@mauricioaniche need compiled patterns improve performance</technical_language>

Target:
public void assertIsEqualToNormalizingNewlines(AssertionInfo info, CharSequence actual, CharSequence expected) { String actualNormalized = actual.toString().replace("\r\n", "\n"); String expectedNormalized = expected.toString().replace("\r\n", "\n"); if(!actualNormalized.equals(expectedNormalized)) throw failures.failure(info, shouldBeEqual(actual, expected)); }
Source:
<code>public SingleOp(String name, Runnable op) { <START> setName(name); <END> this.op = op; }</code><technical_language>do want call super() here</technical_language>

Target:
public SingleOp(String name, Runnable op) { super(); setName(name); this.op = op; }
Source:
<code>public void onSaveInstanceState(Bundle outState) { <START> outState.putBoolean(ExtraConstants.HAS_EXISTING_INSTANCE, !mIsWaitingForPlayServices); <END> super.onSaveInstanceState(outState); }</code><technical_language>of HAS_EXISTING _INSTANCE store inverse of mIsWaitingForPlayServices is a confusing. do separate extras? is true stores state of mIsWaitingForPlayServices</technical_language>

Target:
public void onSaveInstanceState(Bundle outState) { outState.putBoolean(ExtraConstants.HAS_EXISTING_INSTANCE, true); outState.putBoolean(IS_WAITING_FOR_PLAY_SERVICES, mIsWaitingForPlayServices); super.onSaveInstanceState(outState); }
Source:
<code>public void mucTest() throws Exception { EntityBareJid mucAddress = getRandomRoom("smack-inttest-"); MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress); MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress); final String mucMessage = "Smack Integration Test MUC Test Message " + randomString; final ResultSyncPoint<String, Exception> resultSyncPoint = new ResultSyncPoint<>(); mucAsSeenByTwo.addMessageListener(new MessageListener() { @Override public void processMessage(Message message) { String body = message.getBody(); if (mucMessage.equals(body)) { resultSyncPoint.signal(body); } } }); MucCreateConfigFormHandle handle = mucAsSeenByOne.createOrJoin(Resourcepart.from("one-" + randomString)); try { if (handle != null) { <START> handle.makeInstant(); <END> } mucAsSeenByTwo.join(Resourcepart.from("two-" + randomString)); mucAsSeenByOne.sendMessage(mucMessage); resultSyncPoint.waitForResult(timeout); } finally { tryDestroy(mucAsSeenByOne); } }</code><technical_language>I this pattern before, this PR repeats this pattern I if is a good idea. (or most?) MUCs integration test run freshly created, they? do MultiUserChat.createOrJoin() simply MulitUserChat.create() get rid of if (handle != null)? If agree motivated give a shot, please do. PR merged</technical_language>

Target:
public void mucTest() throws Exception { EntityBareJid mucAddress = getRandomRoom("smack-inttest"); MultiUserChat mucAsSeenByOne = mucManagerOne.getMultiUserChat(mucAddress); MultiUserChat mucAsSeenByTwo = mucManagerTwo.getMultiUserChat(mucAddress); final String mucMessage = "Smack Integration Test MUC Test Message " + randomString; final ResultSyncPoint<String, Exception> resultSyncPoint = new ResultSyncPoint<>(); mucAsSeenByTwo.addMessageListener(new MessageListener() { @Override public void processMessage(Message message) { String body = message.getBody(); if (mucMessage.equals(body)) { resultSyncPoint.signal(body); } } }); createMUC(mucAsSeenByOne, "one-" + randomString); mucAsSeenByTwo.join(Resourcepart.from("two-" + randomString)); mucAsSeenByOne.sendMessage(mucMessage); try { resultSyncPoint.waitForResult(timeout); } catch (TimeoutException e) { throw new AssertionError("Failed to receive presence"); } finally { tryDestroy(mucAsSeenByOne); } }
Source:
<code>public StructDefinition getContext() { if (fStreamContext == null) { return fEventContext; } if (fEventContext == null) { return (StructDefinition) fStreamContext; } StructDeclaration mergedDeclaration = new StructDeclaration(1); Builder<String> builder = ImmutableList.<String> builder(); List<Definition> fieldValues = new ArrayList<>(); for (String fieldName : fStreamContext.getFieldNames()) { Definition definition = fStreamContext.getDefinition(fieldName); mergedDeclaration.addField(fieldName, definition.getDeclaration()); builder.add(fieldName); fieldValues.add(definition); } ImmutableList<String> fieldNames = builder.build(); for (String fieldName : fEventContext.getFieldNames()) { Definition definition = fEventContext.getDefinition(fieldName); mergedDeclaration.addField(fieldName, definition.getDeclaration()); if (fieldNames.contains(fieldName)) { fieldValues.set((fieldNames.indexOf(fieldName)), definition); } else { builder.add(fieldName); fieldValues.add(definition); } } fieldNames = builder.build(); <START> ICompositeDefinition mergedContext = new StructDefinition(mergedDeclaration, this, "context", END> fieldNames, fieldValues.toArray(new Definition[fieldValues.size()])); return (StructDefinition) mergedContext; }</code><technical_language>this</technical_language>

Target:
public StructDefinition getContext() { if (fStreamContext == null) { return fEventContext; } if (fEventContext == null) { return fStreamContext; } StructDeclaration mergedDeclaration = new StructDeclaration(1); Builder<String> builder = ImmutableList.<String> builder(); List<Definition> fieldValues = new ArrayList<>(); for (String fieldName : fStreamContext.getFieldNames()) { Definition definition = fStreamContext.getDefinition(fieldName); mergedDeclaration.addField(fieldName, definition.getDeclaration()); builder.add(fieldName); fieldValues.add(definition); } ImmutableList<String> fieldNames = builder.build(); for (String fieldName : fEventContext.getFieldNames()) { Definition definition = fEventContext.getDefinition(fieldName); mergedDeclaration.addField(fieldName, definition.getDeclaration()); if (fieldNames.contains(fieldName)) { fieldValues.set((fieldNames.indexOf(fieldName)), definition); } else { builder.add(fieldName); fieldValues.add(definition); } } fieldNames = builder.build(); ICompositeDefinition mergedContext = new StructDefinition(mergedDeclaration, this, "context", fieldNames, fieldValues.toArray(new Definition[fieldValues.size()])); return (StructDefinition) mergedContext; }
Source:
<code>private static void listInstances(ServiceDiscovery<InstanceDetails> serviceDiscovery) throws Exception { try { Collection<String> serviceNames = serviceDiscovery.queryForNames(); System.out.println(serviceNames.size() + " type(s)"); for ( String serviceName : serviceNames ) { Collection<ServiceInstance<InstanceDetails>> instances = serviceDiscovery.queryForInstances(serviceName); System.out.println(serviceName); for ( ServiceInstance<InstanceDetails> instance : instances ) { outputInstance(instance); } <START> } <END> } catch ( Exception e ) { if ( e instanceof KeeperException.NoNodeException ) { System.err.println("There are no registered instances."); return; } CloseableUtils.closeQuietly(serviceDiscovery); } }</code><technical_language>Please closing of resources finally block</technical_language>

Target:
private static void listInstances(ServiceDiscovery<InstanceDetails> serviceDiscovery) throws Exception { try { Collection<String> serviceNames = serviceDiscovery.queryForNames(); System.out.println(serviceNames.size() + " type(s)"); for ( String serviceName : serviceNames ) { Collection<ServiceInstance<InstanceDetails>> instances = serviceDiscovery.queryForInstances(serviceName); System.out.println(serviceName); for ( ServiceInstance<InstanceDetails> instance : instances ) { outputInstance(instance); } } } catch ( KeeperException.NoNodeException e ) { System.err.println("There are no registered instances."); } finally { CloseableUtils.closeQuietly(serviceDiscovery); } }
Source:
<code>public VM get() { VM vm = performGet(VdcQueryType.GetVmByVmId, new GetVmByVmIdParameters(guid)); <START> setPayload(vm); <END> return vm; }</code><technical_language>move 'setPayload(vm)' populate() method. This care of get() update() flows</technical_language>

Target:
public VM get() { VM vm = performGet(VdcQueryType.GetVmByVmId, new GetVmByVmIdParameters(guid)); return vm; }
Source:
<code><START> public void testIsValid() <END> { NumberManager numberManager = new NumberManager(); assertEquals(numberManager, FormatUtilities.isValid(numberManager)); try { FormatUtilities.isValid(new BadManager1()); fail("Should reject a manager without an identifier"); } catch (NullPointerException e) { } try { FormatUtilities.isValid(new BadManager2()); fail("Should reject a manager without a managed class"); } catch (NullPointerException e) { } }</code><technical_language>Is valid? A FormatManager</technical_language>

Target:
public void testIsValid() { NumberManager numberManager = new NumberManager(); assertEquals(numberManager, FormatUtilities.isValid(numberManager)); try { FormatUtilities.isValid(new BadManagerNoIdentifierType()); fail("Should reject a manager without an identifier"); } catch (NullPointerException e) { } try { FormatUtilities.isValid(new BadManagerNoManagedClass()); fail("Should reject a manager without a managed class"); } catch (NullPointerException e) { } }
Source:
<code><START> public void dispose() { <END> super.dispose(); getConsoleManager().removeConsoleListener(this); if (fDisplayConsoleAction != null) { fDisplayConsoleAction.dispose(); fDisplayConsoleAction = null; } }</code><technical_language>unregister a part listener</technical_language>

Target:
public void dispose() { super.dispose(); getConsoleManager().removeConsoleListener(this); getViewSite().getPage().removePartListener((IPartListener2) this); if (fDisplayConsoleAction != null) { fDisplayConsoleAction.dispose(); fDisplayConsoleAction = null; } }
Source:
<code>public void textualConfigurationTests() { MqttService service = new MqttService(); Dictionary<String, String> properties = new Hashtable<>(); properties.put("bam.name", "brokername"); properties.put("bam.url", "tcp://123.123.123.123"); Map<String, Map<String, Object>> map = service.extractBrokerConfigurations(properties); <START> assertNotNull(map); <END> assertEquals(map.size(), 1); Map<String, Object> data = map.get("bam"); assertNotNull(data); assertTrue("brokername".equals(data.get("name"))); assertTrue("tcp://123.123.123.123".equals(data.get("url"))); assertEquals(service.getAllBrokerConnections().size(), 0); try { service.addBrokerConnection(data); } catch (ConfigurationException | MqttException e) { fail(e.getMessage()); } assertEquals(service.getAllBrokerConnections().size(), 1); assertNotNull(service.getBrokerConnection("brokername")); }</code><technical_language>obsolete, fail NPE in next line</technical_language>

Target:
public void textualConfigurationTests() throws ConfigurationException, MqttException { MqttService service = new MqttService(); Dictionary<String, String> properties = new Hashtable<>(); properties.put("bam.name", "brokername"); properties.put("bam.url", "tcp://123.123.123.123"); Map<String, Map<String, String>> map = service.extractBrokerConfigurations(properties); assertEquals(map.size(), 1); Map<String, String> data = map.get("bam"); assertNotNull(data); assertEquals("brokername", data.get("name")); assertEquals("tcp://123.123.123.123", data.get("url")); assertThat(service.getAllBrokerConnections(), hasSize(0)); service.addBrokerConnection(data); assertThat(service.getAllBrokerConnections(), hasSize(1)); assertNotNull(service.getBrokerConnection("brokername")); }
Source:
<code>public RtFilmProcessor rtFilmProcessor() { <START> return new RtFilmProcessor(contentResolver, contentWriter, peopleWriter, log, queuingPersonWriter); <END> }</code><technical_language>line length</technical_language>

Target:
public RtFilmProcessor rtFilmProcessor() { try { return new RtFilmProcessor( contentResolver, contentWriter, peopleWriter, log, queuingPersonWriter ); } catch (Exception e) { LOGGER.error(" RtFilmModule problem with rtFilmProcessor()", e); return null; } }