auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void enqueuePendingFile(final File file) { pendingFileExecutor.submit(new Runnable() { @Override public void run() { try { BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(new SnappyInputStream(new FileInputStream(file)), Charsets.UTF_8)); Event event = codec.fromJson(in.readLine()); EventPartition partition = partitioner.getPartition(event); enqueueUpload(partition, file); } catch (IOException e) { log.error(e, "Error while uploading file %s", file.getName()); } finally { Closeables.closeQuietly(in); } } catch (Exception e) { <START> log.error(e, "Unable to schedule pending file %s for upload", file.getName()); <END> } } }); }</code><technical_language>This happen if unable extract a event file, correct? happening, it? Do need a new place move files uploaded? a "dead" location, for manual intervention</technical_language>

Target:
public void enqueuePendingFile(final File file) { pendingFileExecutor.submit(new Runnable() { @Override public void run() { BufferedReader in = null; FileInputStream filein = null; try { filein = new FileInputStream(file); in = new BufferedReader(new InputStreamReader(new SnappyInputStream(filein), Charsets.UTF_8)); Event event = codec.fromJson(in.readLine()); EventPartition partition = partitioner.getPartition(event); enqueueUpload(partition, file); } catch (Exception e) { log.error(e, "Error while uploading file %s", file.getName()); file.renameTo(new File(failedFileDir, file.getName())); } finally { try { Closeables.close(filein, true); Closeables.close(in, true); } catch (IOException e) { log.error(e, "Error closing event file"); } } } }); }
Source:
<code>private void addToZipOutput(final String path, final RepositoryFolder folder, final ZipOutputStream zipOutput) throws IOException { int itemsCount = 0; final List<RepositoryFile> files = folder.getFiles(); for (RepositoryFile file : files) { System.out.println("File: " + path + file.getName()); zipOutput.putNextEntry(new ZipEntry(path + file.getName())); file.readFile(new Action<InputStream>() { @Override public void run(InputStream fileInput) throws Exception { FileHelper.copy(fileInput, zipOutput); } }); zipOutput.closeEntry(); itemsCount++; } final List<RepositoryFolder> folders = folder.getFolders(); for (RepositoryFolder subFolder : folders) { String name = subFolder.getName(); <START> System.out.println("Directory: " + path + name + "/"); <END> addToZipOutput(path + name + "/", subFolder, zipOutput); itemsCount++; } if (itemsCount == 0 && ! path.equals("")) { String relativePath = path; System.out.println("Empty: " + relativePath); ZipEntry entry = new ZipEntry(relativePath); zipOutput.putNextEntry(entry); } }</code><technical_language>Please logger instead of System.out (and please do a search in complete PR for this)</technical_language>

Target:
private void addToZipOutput(final String path, final RepositoryFolder folder, final ZipOutputStream zipOutput) throws IOException { int itemsCount = 0; final List<RepositoryFile> files = folder.getFiles(); for (RepositoryFile file : files) { logger.info("File: " + path + file.getName()); zipOutput.putNextEntry(new ZipEntry(path + file.getName())); file.readFile(new Action<InputStream>() { @Override public void run(InputStream fileInput) throws Exception { FileHelper.copy(fileInput, zipOutput); } }); zipOutput.closeEntry(); itemsCount++; } final List<RepositoryFolder> folders = folder.getFolders(); for (RepositoryFolder subFolder : folders) { String name = subFolder.getName(); logger.info("Directory: " + path + name + "/"); addToZipOutput(path + name + "/", subFolder, zipOutput); itemsCount++; } if (itemsCount == 0 && ! path.equals("")) { String relativePath = path; logger.info("Empty: " + relativePath); ZipEntry entry = new ZipEntry(relativePath); zipOutput.putNextEntry(entry); } }
Source:
<code><START> public void terminated() throws ViatraBaseException { <END> Notification n = new Notification(TERMINATED, this, sequenceNumber++); sendNotification(n); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name; try { name = new ObjectName(MBEANNAME+"_"+CURRENTVERSION+"_"+ID); mbs.unregisterMBean(name); } catch (MalformedObjectNameException | MBeanRegistrationException | InstanceNotFoundException e) { throw new ViatraBaseException(e.getMessage()); } }</code><technical_language>throw a ViatraDebuggerException</technical_language>

Target:
public void terminated() throws ViatraDebuggerException { Notification n = new Notification(TERMINATED, this, sequenceNumber++); sendNotification(n); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name; try { name = new ObjectName(MBEANNAME+"_"+CURRENTVERSION+"_"+ID); mbs.unregisterMBean(name); } catch (MalformedObjectNameException | MBeanRegistrationException | InstanceNotFoundException e) { throw new ViatraDebuggerException(e.getMessage()); } }
Source:
<code><START> public void shouldCreateRepartitionTopicWithSpecifiedNumberOfPartitions() throws ExecutionException, InterruptedException { <END> final String repartitionName = "new-partitions"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .repartition(Repartitioned.<Integer, String>as(repartitionName).withNumberOfPartitions(2)) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); validateReceivedMessages( new IntegerDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>(1, 1L), new KeyValue<>(2, 1L) ) ); final String repartitionTopicName = toRepartitionTopicName(repartitionName); assertTrue(topicExists(repartitionTopicName)); assertEquals(2, getNumberOfPartitionsForTopic(repartitionTopicName)); }</code><technical_language>nit: in test code, signature simplified throws Exception (there is list exceptions) -- for test methods in this class (and else?)</technical_language>

Target:
public void shouldCreateRepartitionTopicWithSpecifiedNumberOfPartitions() throws Exception { final String repartitionName = "new-partitions"; final long timestamp = System.currentTimeMillis(); sendEvents( timestamp, Arrays.asList( new KeyValue<>(1, "A"), new KeyValue<>(2, "B") ) ); final StreamsBuilder builder = new StreamsBuilder(); builder.stream(inputTopic, Consumed.with(Serdes.Integer(), Serdes.String())) .repartition(Repartitioned.<Integer, String>as(repartitionName).withNumberOfPartitions(2)) .groupByKey() .count() .toStream() .to(outputTopic); startStreams(builder); validateReceivedMessages( new IntegerDeserializer(), new LongDeserializer(), Arrays.asList( new KeyValue<>(1, 1L), new KeyValue<>(2, 1L) ) ); final String repartitionTopicName = toRepartitionTopicName(repartitionName); assertTrue(topicExists(repartitionTopicName)); assertEquals(2, getNumberOfPartitionsForTopic(repartitionTopicName)); }
Source:
<code>public void testGroupByWithLiteralInSubqueryGrouping() throws Exception { testQuery( "SELECT \n" + " t1, t2\n" + " FROM\n" + " ( SELECT\n" + " 'dummy' as t1,\n" + " CASE\n" + " WHEN \n" + " dim4 = 'b'\n" + " THEN dim4\n" + " ELSE NULL\n" + " END AS t2\n" + " FROM\n" + " numfoo\n" + " GROUP BY\n" + " dim4\n" + " )\n" + " GROUP BY\n" + " t1,t2\n", ImmutableList.of( GroupByQuery.builder() .setDataSource( GroupByQuery.builder() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions(new DefaultDimensionSpec("dim4", "_d0", ValueType.STRING)) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) .setVirtualColumns( expressionVirtualColumn( "v0", "\'dummy\'", ValueType.STRING ), expressionVirtualColumn( "v1", "case_searched((\"_d0\" == 'b'),\"_d0\",null)", ValueType.STRING ) ) .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions( dimensions( new DefaultDimensionSpec("v0", "d0", ValueType.STRING), new DefaultDimensionSpec("v1", "d1", ValueType.STRING) ) ) .setGranularity(Granularities.ALL) .setContext(QUERY_CONTEXT_DEFAULT) .build() ), NullHandling.replaceWithDefault() ? ImmutableList.of( new Object[]{"dummy", ""}, new Object[]{"dummy", "b"} ) : ImmutableList.of( <START> new Object[]{"dummy", null}, <END> new Object[]{"dummy", "b"} ) ); }</code><technical_language>FYI: simplify this NULL_STRING for null / "" avoiding ternary</technical_language>

Target:
public void testGroupByWithLiteralInSubqueryGrouping() throws Exception { testQuery( "SELECT \n" + " t1, t2\n" + " FROM\n" + " ( SELECT\n" + " 'dummy' as t1,\n" + " CASE\n" + " WHEN \n" + " dim4 = 'b'\n" + " THEN dim4\n" + " ELSE NULL\n" + " END AS t2\n" + " FROM\n" + " numfoo\n" + " GROUP BY\n" + " dim4\n" + " )\n" + " GROUP BY\n" + " t1,t2\n", ImmutableList.of( GroupByQuery.builder() .setDataSource( GroupByQuery.builder() .setDataSource(CalciteTests.DATASOURCE3) .setInterval(querySegmentSpec(Filtration.eternity())) .setGranularity(Granularities.ALL) .setDimensions(new DefaultDimensionSpec("dim4", "_d0", ValueType.STRING)) .setContext(QUERY_CONTEXT_DEFAULT) .build() ) .setVirtualColumns( expressionVirtualColumn( "v0", "\'dummy\'", ValueType.STRING ), expressionVirtualColumn( "v1", "case_searched((\"_d0\" == 'b'),\"_d0\",null)", ValueType.STRING ) ) .setInterval(querySegmentSpec(Filtration.eternity())) .setDimensions( dimensions( new DefaultDimensionSpec("v0", "d0", ValueType.STRING), new DefaultDimensionSpec("v1", "d1", ValueType.STRING) ) ) .setGranularity(Granularities.ALL) .setContext(QUERY_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{"dummy", NULL_STRING}, new Object[]{"dummy", "b"} ) ); }
Source:
<code>public CSMMetrics() { <START> int numEnumEntries = ContainerProtos.Type.values().length; <END> this.opsLatency = new MutableRate[numEnumEntries]; this.registry = new MetricsRegistry("CSMMetrics"); for (int i = 0; i < numEnumEntries; i++) { opsLatency[i] = registry.newRate( ContainerProtos.Type.forNumber(i + 1).toString(), ContainerProtos.Type.forNumber(i + 1) + " op"); } }</code><technical_language>rename numEnumEntries numCmdTypes sth that</technical_language>

Target:
public CSMMetrics() { int numCmdTypes = ContainerProtos.Type.values().length; this.opsLatency = new MutableRate[numCmdTypes]; this.registry = new MetricsRegistry(CSMMetrics.class.getName()); for (int i = 0; i < numCmdTypes; i++) { opsLatency[i] = registry.newRate( ContainerProtos.Type.forNumber(i + 1).toString(), ContainerProtos.Type.forNumber(i + 1) + " op"); } }
Source:
<code>private void assertEmptyPropertiesView(boolean emptyPropertiesView) { List<Tree> findedTrees = propertyViewBot.getFinder().findControls(IsInstanceOf.instanceOf(Tree.class)); <START> assertEquals("The properties view is expected to be " + (emptyPropertiesView ? "" : "not") + " empty", emptyPropertiesView, findedTrees.isEmpty() || (!findedTrees.isEmpty() && !propertyViewBot.tree().hasItems())); <END> }</code><technical_language>failing message is clear --> junit.framework.AssertionFailedError: properties view is expected empty expected:<false> was:<true> clearer with: boolean result = findedTrees.isEmpty() || (!findedTrees.isEmpty() && !propertyViewBot.tree().hasItems()); if (emptyPropertiesView) { assertTrue("The properties view is expected empty.", result); } else { assertFalse("The properties view is expected empty.", result); } --> junit.framework.AssertionFailedError: properties view is expected empty</technical_language>

Target:
private void assertEmptyPropertiesView(boolean emptyPropertiesView) { List<Tree> findedTrees = propertyViewBot.getFinder().findControls(IsInstanceOf.instanceOf(Tree.class)); boolean result = findedTrees.isEmpty() || (!findedTrees.isEmpty() && !propertyViewBot.tree().hasItems()); if (emptyPropertiesView) { assertTrue("The properties view is expected to be empty.", result); } else { assertFalse("The properties view is not expected to be empty.", result); } }
Source:
<code>private void processResponse(final String command, final HttpURLConnection hconn) throws IOException { final int httpResponseCode = hconn.getResponseCode(); if (httpResponseCode >= 400 && httpResponseCode < 500) { throw new IllegalStateException( "Unable to connect to Tomcat manager. " + "The server command (" + command + ") failed with responseCode (" + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage()+ ").\n\n" + "Please make sure that you provided correct credentials for a user which is allowed to access Tomcat manager application.\n" + "The user must have 'manager-script' role specified in tomcat-users.xml file.\n"); } else if (httpResponseCode >= 300) { throw new IllegalStateException("The server command (" + command + ") failed with responseCode (" + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage() + ")."); } BufferedReader reader = null; <START> try { <END> reader = new BufferedReader(new InputStreamReader(hconn.getInputStream(), MANAGER_CHARSET)); String line = reader.readLine(); String contentError = null; if (line != null && !line.startsWith("OK -")) { contentError = line; } while (line != null) { line = reader.readLine(); } if (contentError != null) { throw new IllegalStateException("The server command (" + command + ") failed with content (" + contentError + ")."); } } finally { closeQuietly(reader); } }</code><technical_language>try-with-resources</technical_language>

Target:
private void processResponse(final String command, final HttpURLConnection hconn) throws IOException { final int httpResponseCode = hconn.getResponseCode(); if (httpResponseCode >= 400 && httpResponseCode < 500) { throw new IllegalStateException( "Unable to connect to Tomcat manager. " + "The server command (" + command + ") failed with responseCode (" + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage()+ ").\n\n" + "Please make sure that you provided correct credentials for a user which is allowed to access Tomcat manager application.\n" + "The user must have 'manager-script' role specified in tomcat-users.xml file.\n"); } else if (httpResponseCode >= 300) { throw new IllegalStateException("The server command (" + command + ") failed with responseCode (" + httpResponseCode + ") and responseMessage (" + hconn.getResponseMessage() + ")."); } try (BufferedReader reader = new BufferedReader(new InputStreamReader(hconn.getInputStream(), MANAGER_CHARSET))) { String line = reader.readLine(); String contentError = null; if (line != null && !line.startsWith("OK -")) { contentError = line; } while (line != null) { line = reader.readLine(); } if (contentError != null) { throw new IllegalStateException("The server command (" + command + ") failed with content (" + contentError + ")."); } } }
Source:
<code>private <T> T decode(ByteBuf input, Class<T> clazz) throws Exception { ChannelHandlerContext ctx = mock(ChannelHandlerContext.class); when(ctx.alloc()).thenReturn(ByteBufAllocator.DEFAULT); List<Object> decoded = new ArrayList<Object>(); <START> new WebSocket13FrameDecoder(true, false, 65536, true).decode(ctx, input, decoded); <END> assertEquals(1, decoded.size()); return clazz.cast(decoded.get(0)); }</code><technical_language>@ursaj imho mimic life-cycle of handler means call handlerAdded(...) channelActive(..) well</technical_language>

Target:
private <T> T decode(ByteBuf input, Class<T> clazz) { EmbeddedChannel ch = new EmbeddedChannel(new WebSocket13FrameDecoder(true, false, 65536, true)); assertTrue(ch.writeInbound(input)); Object decoded = ch.readInbound(); assertNotNull(decoded); assertFalse(ch.finish()); return clazz.cast(decoded); }
Source:
<code><START> public static void getAudioDownloadFolder(Context context) { <END> getFolder(context, R.string.download_path_audio_key, Environment.DIRECTORY_MUSIC); }</code><technical_language>if void this sense</technical_language>

Target:
public static File getAudioDownloadFolder(Context context) { return getFolder(context, R.string.download_path_audio_key, Environment.DIRECTORY_MUSIC); }
Source:
<code>public void testResolveKnownVariable() { final String message = "This is my ${Variable}"; final String expectedResolved = "This is my value"; <START> Map<String, String> values = new HashMap<String, String>(); <END> values.put("variable", "value"); String resolvedMessage = AuditLogDirector.resolveMessage(message, values); Assert.assertEquals(expectedResolved, resolvedMessage); }</code><technical_language>singltonMap</technical_language>

Target:
public void testResolveKnownVariable() { final String message = "This is my ${Variable}"; final String expectedResolved = "This is my value"; Map<String, String> values = Collections.singletonMap("variable", "value"); String resolvedMessage = AuditLogDirector.resolveMessage(message, values); Assert.assertEquals(expectedResolved, resolvedMessage); }
Source:
<code>public boolean kill() { if (status.isKilled()) { return false; } status = SchedulerStatus.KILLED; pinger.interrupt(); schedulingThread.interrupt(); logger.info("Killing all running task processes..."); for (RunningTaskData taskData : jobs.getRunningTasks()) { NodeSet nodes = taskData.getTask().getExecuterInformation().getNodes(); try { taskData.getLauncher().kill(); } catch (Throwable t) { logger.error("Failed to terminate launcher", t); } try { infrastructure.getRMProxiesManager() .getUserRMProxy(taskData.getUser(), taskData.getCredentials()) .releaseNodes(nodes, taskData.getTask().getCleaningScript(), addThirdPartyCredentials(taskData.getCredentials())); } catch (Throwable t) { logger.error("Failed to release nodes", t); } } listenJobLogsSupport.shutdown(); infrastructure.shutdown(); listener.schedulerStateUpdated(SchedulerEvent.KILLED); <START> new Thread(new Runnable() { <END> @Override public void run() { try { Thread.sleep(SCHEDULER_EXIT_DELAY); } catch (InterruptedException e) { e.printStackTrace(); } System.exit(0); } }).start(); return true; }</code><technical_language>lambda. Idea change it)</technical_language>

Target:
public boolean kill() { if (status.isKilled()) { return false; } status = SchedulerStatus.KILLED; pinger.interrupt(); schedulingThread.interrupt(); logger.info("Killing all running task processes..."); for (RunningTaskData taskData : jobs.getRunningTasks()) { NodeSet nodes = taskData.getTask().getExecuterInformation().getNodes(); try { taskData.getLauncher().kill(); } catch (Throwable t) { logger.error("Failed to terminate launcher", t); } try { infrastructure.getRMProxiesManager() .getUserRMProxy(taskData.getUser(), taskData.getCredentials()) .releaseNodes(nodes, taskData.getTask().getCleaningScript(), addThirdPartyCredentials(taskData.getCredentials())); } catch (Throwable t) { logger.error("Failed to release nodes", t); } } listenJobLogsSupport.shutdown(); infrastructure.shutdown(); listener.schedulerStateUpdated(SchedulerEvent.KILLED); new Thread(() -> { try { Thread.sleep(SCHEDULER_KILL_DELAY); } catch (InterruptedException e) { logger.warn("Scheduler.kill() was interrupted while waiting for its configured delay, now terminating the process", e); } System.exit(0); }).start(); return true; }
Source:
<code>public static int mapECLtype2SQLtype(String ecltype) { if (mapECLTypeNameToSQLType.containsKey(ecltype)) { return mapECLTypeNameToSQLType.get(ecltype); } else { <START> int ftype = java.sql.Types.OTHER; <END> String postfixUpper = ecltype.substring(ecltype.lastIndexOf(':') + 1).toUpperCase(); if (mapECLTypeNameToSQLType.containsKey(postfixUpper)) return mapECLTypeNameToSQLType.get(postfixUpper); else { Matcher m = TRAILINGNUMERICPATTERN.matcher(postfixUpper); if (m.matches() && mapECLTypeNameToSQLType.containsKey(m.group(2))) ftype = mapECLTypeNameToSQLType.get(m.group(2)); return ftype; } } }</code><technical_language>more efficient declare this outer else clause (without setting anything), explicitly setting other values in if/else</technical_language>

Target:
public static int mapECLtype2SQLtype(String ecltype) { if (mapECLTypeNameToSQLType.containsKey(ecltype)) { return mapECLTypeNameToSQLType.get(ecltype); } else { String postfixUpper = ecltype.substring(ecltype.lastIndexOf(':') + 1).toUpperCase(); if (mapECLTypeNameToSQLType.containsKey(postfixUpper)) return mapECLTypeNameToSQLType.get(postfixUpper); else { Matcher m = TRAILINGNUMERICPATTERN.matcher(postfixUpper); if (m.matches() && mapECLTypeNameToSQLType.containsKey(m.group(2))) return mapECLTypeNameToSQLType.get(m.group(2)); else return java.sql.Types.OTHER; } } }
Source:
<code>public void setup() { if (mListFragments == null) { mListFragments = new ArrayList<Fragment>(); mListFragments.add(fragmentOverview = (ProfileOverviewFragment) Fragment.instantiate(this, ProfileOverviewFragment.class.getName())); mListFragments.add(fragmentStats = (ProfileStatsFragment) Fragment.instantiate(this, ProfileStatsFragment.class.getName())); mListFragments.add(fragmentFeed = (FeedFragment) Fragment.instantiate(this, FeedFragment.class.getName())); fragmentFeed.setTitle(selectedPersona().getPersonaName()); fragmentFeed.setType(FeedClient.TYPE_PROFILE); <START> fragmentFeed.setId(selectedPersona().getPersonaId()); <END> fragmentFeed.setCanWrite(false); mViewPager = (ViewPager) findViewById(R.id.viewpager); mTabs = (SwipeyTabs) findViewById(R.id.swipeytabs); mPagerAdapter = new SwipeyTabsPagerAdapter( mFragmentManager, new String[] { "OVERVIEW", "STATS", "FEED" }, mListFragments, mViewPager, mLayoutInflater ); mViewPager.setAdapter(mPagerAdapter); mTabs.setAdapter(mPagerAdapter); mViewPager.setOnPageChangeListener(mTabs); mViewPager.setCurrentItem(0); mViewPager.setOffscreenPageLimit(2); } }</code><technical_language>bug, a "profile id"/"user id" a persona id</technical_language>

Target:
public void setup() { if (mListFragments == null) { mListFragments = new ArrayList<Fragment>(); mListFragments.add(fragmentOverview = (ProfileOverviewFragment) Fragment.instantiate(this, ProfileOverviewFragment.class.getName())); mListFragments.add(fragmentStats = (ProfileStatsFragment) Fragment.instantiate(this, ProfileStatsFragment.class.getName())); mListFragments.add(fragmentFeed = (FeedFragment) Fragment.instantiate(this, FeedFragment.class.getName())); fragmentFeed.setTitle(BF3Droid.getUser()); fragmentFeed.setType(FeedClient.TYPE_PROFILE); fragmentFeed.setId(BF3Droid.getUserId()); fragmentFeed.setCanWrite(false); mViewPager = (ViewPager) findViewById(R.id.viewpager); mTabs = (SwipeyTabs) findViewById(R.id.swipeytabs); mPagerAdapter = new SwipeyTabsPagerAdapter( mFragmentManager, new String[] { "OVERVIEW", "STATS", "FEED" }, mListFragments, mViewPager, mLayoutInflater ); mViewPager.setAdapter(mPagerAdapter); mTabs.setAdapter(mPagerAdapter); mViewPager.setOnPageChangeListener(mTabs); mViewPager.setCurrentItem(0); mViewPager.setOffscreenPageLimit(2); } }
Source:
<code>private void getQuarks(Builder<@NonNull Integer> builder, int quark, List<String> pattern) { try { String element = pattern.get(0); List<String> remainder = pattern.subList(1, pattern.size()); if (remainder.isEmpty()) { if (element.equals(WILDCARD)) { builder.addAll(getSubAttributes(quark, false)); <START> } else if (element.equals(PARENT)){ <END> builder.add(getParentAttributeQuark(quark)); } else { builder.add(getQuarkRelative(quark, element)); } } else { if (element.equals(WILDCARD)) { for (@NonNull Integer subquark : getSubAttributes(quark, false)) { getQuarks(builder, subquark, remainder); } } else if (element.equals(PARENT)){ getQuarks(builder, getParentAttributeQuark(quark), remainder); } else { getQuarks(builder, getQuarkRelative(quark, element), remainder); } } } catch (AttributeNotFoundException e) { } }</code><technical_language>element == null?, PARENT.equals(element) if</technical_language>

Target:
private void getQuarks(Builder<@NonNull Integer> builder, int quark, List<String> pattern) { try { String element = pattern.get(0); if (element == null) { return; } List<String> remainder = pattern.subList(1, pattern.size()); if (remainder.isEmpty()) { if (element.equals(WILDCARD)) { builder.addAll(getSubAttributes(quark, false)); } else if (element.equals(PARENT)){ builder.add(getParentAttributeQuark(quark)); } else { int subQuark = optQuarkRelative(quark, element); if (subQuark != INVALID_ATTRIBUTE) { builder.add(subQuark); } } } else { if (element.equals(WILDCARD)) { for (@NonNull Integer subquark : getSubAttributes(quark, false)) { getQuarks(builder, subquark, remainder); } } else if (element.equals(PARENT)){ getQuarks(builder, getParentAttributeQuark(quark), remainder); } else { int subQuark = optQuarkRelative(quark, element); if (subQuark != INVALID_ATTRIBUTE) { getQuarks(builder, subQuark, remainder); } } } } catch (AttributeNotFoundException e) { throw new IndexOutOfBoundsException(String.format("Index: %d, Size: %d", quark, getNbAttributes())); } }
Source:
<code>public EnvironmentConfig getEnvironmentConfig(String environmentName) throws NoSuchEnvironmentException { if(environments.hasEnvironmentNamed(new CaseInsensitiveString(environmentName))) return environments.named(new CaseInsensitiveString(environmentName)); <START> return null; <END> }</code><technical_language>throw NoSuchEnvironmentException is it. a race condition here. time check hasEnvironmentNamed call environments.named, some other thread added/removed environment. IMO, delegate straight environments.named instead</technical_language>

Target:
public EnvironmentConfig getEnvironmentConfig(String environmentName) throws NoSuchEnvironmentException { return environments.named(new CaseInsensitiveString(environmentName)); }
Source:
<code>public void releaseCursor(Cursor cursor) { try { cursor.release(); if (cursors.remove(cursor)) { <START> if (provider.isClosed() && cursors.isEmpty()) { <END> releaseResources(); } } } catch (Exception e) { LOGGER.warn("Exception was found trying to release cursor resources. Execution will continue", e); } finally { statistics.decrementOpenCursors(); } }</code><technical_language>put this && in previous if</technical_language>

Target:
public void releaseCursor(Cursor cursor) { try { cursor.release(); if (cursors.remove(cursor) && provider.isClosed() && cursors.isEmpty()) { releaseResources(); } } catch (Exception e) { LOGGER.warn("Exception was found trying to release cursor resources. Execution will continue", e); } finally { statistics.decrementOpenCursors(); } }
Source:
<code>public void insertRow(RowWithMetaData metaData, Object[] values) throws InterruptedException { while (true) { try { PartitionSingleExecuteProcedureCallback cbmt = new PartitionSingleExecuteProcedureCallback(metaData); if (!m_client.callProcedure(cbmt, m_insertProcedure, values)) { m_log.fatal("Failed to send CSV insert to VoltDB cluster."); ClientResponse response = new ClientResponseImpl(ClientResponseImpl.SERVER_UNAVAILABLE, new VoltTable[0], "Failed to call procedure.", 0); m_errHandler.handleError(metaData, response, "Failed to call procedure."); } break; <START> } catch (NoConnectionsException ex) { <END> Thread.sleep(1000); } catch (IOException ex) { Thread.sleep(1000); } catch (Exception ex) { m_errHandler.handleError(metaData, null, ex.toString()); } } }</code><technical_language>This is a type of IOException, need a separate handler</technical_language>

Target:
public void insertRow(RowWithMetaData metaData, Object[] values) throws InterruptedException { m_totalRowCount.incrementAndGet(); insert(metaData, values); }
Source:
<code>public List<Map<String, String>> linkify(HttpServletRequest req, String message) { String baseGerritUrl = urls.getBaseGerritUrl(req); CommentLinkInfo changeIds = new CommentLinkInfo("ChangeIdLinks", changeId, baseGerritUrl + "#/q/$2,n,z", ""); mCommentLinks.add(changeIds); List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (CommentLinkInfo clp : mCommentLinks) { for (int <START> index = <END> 0; index < parsed.size(); index++) { Map<String, String> piece = parsed.get(index); if (piece.get("url") == null) { List<Map<String, String>> resultingReplacement = clp.replace(piece.get("text")); if (resultingReplacement != null) { parsed.remove(index); for (Map<String, String> it : resultingReplacement) { parsed.add(index, it); index++; } } } } } mCommentLinks.remove(mCommentLinks.size() - 1); return parsed; }</code><technical_language>for (Map<String, String> piece : parsed)</technical_language>

Target:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { String baseGerritUrl = urls.getBaseGerritUrl(req); CommentLinkInfo changeIds = new CommentLinkInfo("ChangeIdLinks", CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$2,n,z", ""); List<CommentLinkInfo> operationalCommentLinks = new ArrayList<CommentLinkInfo>(commentLinks); operationalCommentLinks.add(changeIds); List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { Map<String, String> piece = parsed.get(index); if (piece.get("url") == null) { String text = piece.get("text"); Matcher m = allPattern.matcher(text); if (m.find()) { for (CommentLinkInfo clp : operationalCommentLinks) { List<Map<String, String>> resultingReplacement = clp.replace(piece.get("text")); if (resultingReplacement != null) { parsed.remove(index); for (Map<String, String> it : resultingReplacement) { parsed.add(index, it); index++; } } } } } } return parsed; }
Source:
<code><START> public final void disconnect(Optional<? extends ConnectionAnchor> anchor) { <END> disconnect(anchor.orElse(null)); }</code><technical_language>Misschien mooier: anchor.ifPresent(this::disconnect); Java 8 yo</technical_language>

Target:
public final void disconnect(Optional<? extends ConnectionAnchor> anchor) { anchor.ifPresent(this::disconnect); }
Source:
<code>public void returnsCorrectLengthWithUrl() throws Exception { <START> final Path file = BodyUrlTest.createTempFile(); <END> try { final byte[] bytes = new Utf8String("URL returnsCorrectLength!").asBytes(); try (InputStream input = new InputOf(bytes).stream()) { Files.copy(input, file, StandardCopyOption.REPLACE_EXISTING); } MatcherAssert.assertThat( "Body content of Body.Url doesn't have the correct length", new LengthOf(new Body.Url(file.toUri().toURL())).intValue(), new IsEqual<>(bytes.length) ); } finally { Files.deleteIfExists(file); } }</code><technical_language>@Serranya here. above</technical_language>

Target:
public void returnsCorrectLengthWithUrl() throws Exception { try (TempFile file = new TempFile()) { final Bytes body = new Utf8String("URL returnsCorrectLength!"); try (OutputStream outStream = new OutputTo(file.value()).stream()) { new LengthOf( new TeeInput(body, new OutputTo(outStream)) ).intValue(); } MatcherAssert.assertThat( "Body content of Body.Url doesn't have the correct length", new LengthOf( new Body.Url(file.value().toUri().toURL()) ).intValue(), new IsEqual<>(body.asBytes().length) ); } }
Source:
<code>public void disconnect() throws IOException { if (forwarders != null) { for (LocalPortForwarder forwarder : forwarders) { try { forwarder.close(); } catch (IOException e) { log.warn("Error closing forwarder", e); } <START> } <END> } trans.disconnect(); super.disconnect(); }</code><technical_language>clear forwarders list loop</technical_language>

Target:
public void disconnect() throws IOException { for (LocalPortForwarder forwarder : forwarders) { try { forwarder.close(); } catch (IOException e) { log.warn("Error closing forwarder", e); } } forwarders.clear(); trans.disconnect(); super.disconnect(); }
Source:
<code><START> protected void locateFileFromResource(String res) { <END> CDebugUtils.FileParts missingFileParts = CDebugUtils.getFileParts(missingFile); if (res != null) { CDebugUtils.FileParts resParts = CDebugUtils.getFileParts(res); if (resParts.getFileName().toLowerCase().equals(missingFileParts.getFileName().toLowerCase())) { String compPath = missingFileParts.getFolder(); IPath newSourcePath = new Path(resParts.getFolder()); if (compPath.length() > 0) { try { if (isDebugElement) addSourceMappingToLaunch(compPath, newSourcePath); else addSourceMappingToCommon(compPath, newSourcePath); } catch (CoreException e) { } } IWorkbenchPage page = getEditorSite().getPage(); if (isDebugElement) { ISourceDisplay adapter = context.getAdapter(ISourceDisplay.class); if (adapter != null) { adapter.displaySource(context, page, true); } } else if (isTranslationUnit) { reopenTranslationUnit(tunit); } closeEditor(); } } }</code><technical_language>precondition of this function res != null (throw NullPointerException("<appropriate message here>") if need early check</technical_language>

Target:
protected void locateFileFromResource(String res) { if (res == null){ throw new NullPointerException("Tried to initialize 'null' resource"); } CDebugUtils.FileParts missingFileParts = CDebugUtils.getFileParts(missingFile); CDebugUtils.FileParts resParts = CDebugUtils.getFileParts(res); if (resParts.getFileName().toLowerCase().equals(missingFileParts.getFileName().toLowerCase())) { String compPath = missingFileParts.getFolder(); IPath newSourcePath = new Path(resParts.getFolder()); if (compPath.length() > 0) { try { if (isDebugElement) addSourceMappingToLaunch(compPath, newSourcePath); else addSourceMappingToCommon(compPath, newSourcePath); } catch (CoreException e) { } } IWorkbenchPage page = getEditorSite().getPage(); if (isDebugElement) { ISourceDisplay adapter = context.getAdapter(ISourceDisplay.class); if (adapter != null) { adapter.displaySource(context, page, true); } } else if (isTranslationUnit) { reopenTranslationUnit(tunit); } closeEditor(); } }
Source:
<code>public String stopAllJobExecutions( @CliOption(key = "force", help = "bypass confirmation prompt", unspecifiedDefaultValue = "false", specifiedDefaultValue = "true") boolean force) { <START> jobOperations().stopAllJobExecutions(); <END> return String.format("Stopped all the job executions"); }</code><technical_language>"force" check</technical_language>

Target:
public String stopAllJobExecutions( @CliOption(key = "force", help = "bypass confirmation prompt", unspecifiedDefaultValue = "false", specifiedDefaultValue = "true") boolean force) { if (force || "y".equalsIgnoreCase(userInput.prompt("Really stop all job executions?", "n", "y", "n"))) { jobOperations().stopAllJobExecutions(); return String.format("Stopped all the job executions"); } else { return ""; } }
Source:
<code>protected boolean set(EntityShulker container, DyeColor value) { <START> if (!(container instanceof IMixinShulker)) <END> return false; ((IMixinShulker) container).setColor(value); return true; }</code><technical_language>Braces</technical_language>

Target:
protected boolean set(EntityShulker container, DyeColor value) { ((IMixinShulker) container).setColor(value); return true; }
Source:
<code>public CoordinatorStats run( DruidCoordinator coordinator, DruidCoordinatorRuntimeParams params, DataSegment segment ) { final Set<ServerHolder> loadServerHolders = new HashSet<>(); final Set<ServerHolder> dropServerHolders = new HashSet<>(); final List<String> colocatedDataSources = getColocatedDataSources(); if (colocatedDataSources == null || colocatedDataSources.isEmpty()) { loadServerHolders.addAll(params.getDruidCluster().getAllServers()); } else { params.getDruidCluster().getAllServers().forEach( eachHolder -> { if (colocatedDataSources.stream() .anyMatch(source -> eachHolder.getServer().getDataSource(source) != null <START> && !eachHolder.isMaintenance())) { <END> loadServerHolders.add(eachHolder); } else if (eachHolder.isServingSegment(segment)) { if (!eachHolder.getPeon().getSegmentsToDrop().contains(segment)) { dropServerHolders.add(eachHolder); } } } ); } final CoordinatorStats stats = new CoordinatorStats(); return stats.accumulate(assign(loadServerHolders, segment)) .accumulate(drop(dropServerHolders, segment)); }</code><technical_language>of anyMatch(): !eachHolder.isMaintenance() && colocatedDataSources.stream().anyMatch(...)</technical_language>

Target:
public CoordinatorStats run(DruidCoordinator coordinator, DruidCoordinatorRuntimeParams params, DataSegment segment) { final Set<ServerHolder> loadServerHolders = new HashSet<>(); final Set<ServerHolder> dropServerHolders = new HashSet<>(); final List<String> colocatedDataSources = getColocatedDataSources(); if (colocatedDataSources == null || colocatedDataSources.isEmpty()) { loadServerHolders.addAll(params.getDruidCluster().getAllServers()); } else { params.getDruidCluster().getAllServers().forEach( eachHolder -> { if (!eachHolder.isInMaintenance() && colocatedDataSources.stream() .anyMatch(source -> eachHolder.getServer().getDataSource(source) != null)) { loadServerHolders.add(eachHolder); } else if (eachHolder.isServingSegment(segment)) { if (!eachHolder.getPeon().getSegmentsToDrop().contains(segment)) { dropServerHolders.add(eachHolder); } } } ); } final CoordinatorStats stats = new CoordinatorStats(); return stats.accumulate(assign(loadServerHolders, segment)) .accumulate(drop(dropServerHolders, segment)); }
Source:
<code>public void testSeekForRwServer() throws Exception { <START> Layout layout = org.apache.log4j.Logger.getRootLogger().getAppender("CONSOLE") <END> .getLayout(); ByteArrayOutputStream os = new ByteArrayOutputStream(); WriterAppender appender = new WriterAppender(layout, os); appender.setImmediateFlush(true); appender.setThreshold(Level.INFO); org.apache.log4j.Logger zlogger = org.apache.log4j.Logger.getLogger("org.apache.zookeeper"); zlogger.addAppender(appender); try { qu.shutdown(2); CountdownWatcher watcher = new CountdownWatcher(); ZooKeeper zk = new ZooKeeper(qu.getConnString(), CONNECTION_TIMEOUT, watcher, true); watcher.waitForConnected(CONNECTION_TIMEOUT); qu.getPeer(1).peer.suspend(); watcher.reset(); qu.start(2); qu.start(3); ClientBase.waitForServerUp(qu.getConnString(), 2000); watcher.waitForConnected(CONNECTION_TIMEOUT); zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); qu.getPeer(1).peer.resume(); } finally { zlogger.removeAppender(appender); } os.close(); LineNumberReader r = new LineNumberReader(new StringReader(os .toString())); String line; Pattern p = Pattern.compile(".*Majority server found.*"); boolean found = false; while ((line = r.readLine()) != null) { if (p.matcher(line).matches()) { found = true; break; } } Assert.assertTrue( "Majority server wasn't found while connected to r/o server", found); }</code><technical_language>is this necessary</technical_language>

Target:
public void testSeekForRwServer() throws Exception { Layout layout = Logger.getRootLogger().getAppender("CONSOLE") .getLayout(); ByteArrayOutputStream os = new ByteArrayOutputStream(); WriterAppender appender = new WriterAppender(layout, os); appender.setImmediateFlush(true); appender.setThreshold(Level.INFO); Logger zlogger = Logger.getLogger("org.apache.zookeeper"); zlogger.addAppender(appender); try { qu.shutdown(2); CountdownWatcher watcher = new CountdownWatcher(); ZooKeeper zk = new ZooKeeper(qu.getConnString(), CONNECTION_TIMEOUT, watcher, true); watcher.waitForConnected(CONNECTION_TIMEOUT); qu.getPeer(1).peer.suspend(); watcher.reset(); qu.start(2); qu.start(3); ClientBase.waitForServerUp(qu.getConnString(), 2000); watcher.waitForConnected(CONNECTION_TIMEOUT); zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); qu.getPeer(1).peer.resume(); } finally { zlogger.removeAppender(appender); } os.close(); LineNumberReader r = new LineNumberReader(new StringReader(os .toString())); String line; Pattern p = Pattern.compile(".*Majority server found.*"); boolean found = false; while ((line = r.readLine()) != null) { if (p.matcher(line).matches()) { found = true; break; } } Assert.assertTrue( "Majority server wasn't found while connected to r/o server", found); }
Source:
<code>public void testPutAndDeleteSynonymCatalog() throws Exception { <START> final SynonymCatalogModel dictionaryModel = new SynonymCatalogModel("synonymCatalog", <END> Collections.singletonList(new SynonymModel("foo", Arrays.asList("bar", "baz"))), true); final MvcResult mvcResult = _mockMvc.perform( put("/test/referencedata/synonymCatalog/testCatalog").contentType(MediaType.APPLICATION_JSON) .content(_objectMapper.writeValueAsString(dictionaryModel))).andExpect(status().isCreated()) .andExpect(header().string("Location", is("http://localhost/test/referencedata/synonymCatalog/testCatalog"))).andReturn(); final String location = mvcResult.getResponse().getHeader("Location"); _mockMvc.perform(get(location)).andExpect(status().isOk()).andExpect(jsonPath("$.name", is("testCatalog"))) .andExpect(jsonPath("$.entries", hasSize(1))).andExpect(jsonPath("$.entries[0].masterTerm", is("foo"))) .andExpect(jsonPath("$.entries[0].synonyms", hasSize(2))) .andExpect(jsonPath("$.entries[0].synonyms[1]", is("baz"))) .andExpect(jsonPath("$.caseSensitive", is(true))); _mockMvc.perform(delete(location)).andExpect(status().isNoContent()); _mockMvc.perform(get(location)).andExpect(status().isNotFound()); }</code><technical_language>variable is called dictionaryModel, contains a SynonymCatalogModel preferably rename synonymCatalogModel</technical_language>

Target:
public void testPutAndDeleteSynonymCatalog() throws Exception { final SynonymCatalogModel synonymCatalogModel = new SynonymCatalogModel("synonymCatalog", Collections.singletonList(new SynonymModel("foo", Arrays.asList("bar", "baz"))), true); final MvcResult mvcResult = _mockMvc.perform( put("/test/referencedata/synonymCatalog/testCatalog").contentType(MediaType.APPLICATION_JSON) .content(_objectMapper.writeValueAsString(synonymCatalogModel))).andExpect(status().isCreated()) .andExpect(header().string("Location", is("http://localhost/test/referencedata/synonymCatalog/testCatalog"))).andReturn(); final String location = mvcResult.getResponse().getHeader("Location"); _mockMvc.perform(get(location)).andExpect(status().isOk()).andExpect(jsonPath("$.name", is("testCatalog"))) .andExpect(jsonPath("$.entries", hasSize(1))).andExpect(jsonPath("$.entries[0].masterTerm", is("foo"))) .andExpect(jsonPath("$.entries[0].synonyms", hasSize(2))) .andExpect(jsonPath("$.entries[0].synonyms[1]", is("baz"))) .andExpect(jsonPath("$.caseSensitive", is(true))); _mockMvc.perform(delete(location)).andExpect(status().isNoContent()); _mockMvc.perform(get(location)).andExpect(status().isNotFound()); }
Source:
<code>public void testGetNotifications() { Notification expired = testNotification(); Notification current = anotherTestNotification(); curationApiAdmin.createNotification(expired); curationApiAdmin.createNotification(current); List<Notification> activeNotifications = curationApiUser.getActiveNotifications(); <START> assertEquals(activeNotifications.size(), 1); <END> assertEquals(activeNotifications.get(0).getMessage(), "ayy"); }</code><technical_language>param is expected result, is actual result. I consistent it, reverse these, next line too</technical_language>

Target:
public void testGetNotifications() { Notification expired = testNotification(); Notification current = anotherTestNotification(); curationApiAdmin.createNotification(expired); curationApiAdmin.createNotification(current); List<Notification> activeNotifications = curationApiUser.getActiveNotifications(); assertEquals(1, activeNotifications.size()); assertEquals("ayy", activeNotifications.get(0).getMessage()); }
Source:
<code>@Test public void testFilterTimestamp() { String sql = "select count(*) as c\n" + "from \"foodmart\"\n" + "where extract(year from \"timestamp\") = 1997\n" + "and extract(month from \"timestamp\") in (4, 6)\n"; final String explain = "EnumerableInterpreter\n" + " BindableAggregate(group=[{}], C=[COUNT()])\n" + " BindableFilter(condition=[AND(>=(/INT(Reinterpret($0), 86400000), 1997-01-01), <(/INT(Reinterpret($0), 86400000), 1998-01-01), OR(AND(>=(/INT(Reinterpret($0), 86400000), 1997-04-01), <(/INT(Reinterpret($0), 86400000), 1997-05-01)), AND(>=(/INT(Reinterpret($0), 86400000), 1997-06-01), <(/INT(Reinterpret($0), 86400000), 1997-07-01))))])\n" + " DruidQuery(table=[[foodmart, foodmart]], intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], projects=[[$0]])"; sql(sql) <START> .returnsUnordered("C=13500"); <END> }</code><technical_language>remove this</technical_language>

Target:
@Test public void testFilterTimestamp() { String sql = "select count(*) as c\n" + "from \"foodmart\"\n" + "where extract(year from \"timestamp\") = 1997\n" + "and extract(month from \"timestamp\") in (4, 6)\n"; final String explain = "PLAN=EnumerableInterpreter\n" + " DruidQuery(table=[[foodmart, foodmart]], " + "intervals=[[1900-01-09T00:00:00.000/2992-01-10T00:00:00.000]], filter=[AND(=" + "(EXTRACT_DATE(FLAG(YEAR), /INT(Reinterpret($0), 86400000)), 1997), OR(=(EXTRACT_DATE" + "(FLAG(MONTH), /INT(Reinterpret($0), 86400000)), 4), =(EXTRACT_DATE(FLAG(MONTH), /INT" + "(Reinterpret($0), 86400000)), 6)))], groups=[{}], aggs=[[COUNT()]])"; sql(sql) .explainContains(explain) .returnsUnordered("C=13500"); }
Source:
<code>protected void writeToFile(File downloadFolder, ArrayList<SEDRow> results) throws IOException { <START> String csvFilename = downloadFolder.getAbsolutePath() + File.separator + "chpl-sed-all-details" + ".csv"; <END> File csvFile = new File(csvFilename); if (!csvFile.exists()) { csvFile.createNewFile(); } else { csvFile.delete(); } CertifiedProductCsvPresenter csvPresenter = new CertifiedProductCsvPresenter(); Date start = new Date(); int numRows = csvPresenter.presentAsFileSED(csvFile, results); Date end = new Date(); LOGGER.info("Wrote " + numRows + " rows to SED detailed data CSV file in " + (end.getTime() - start.getTime()) / 1000 + " seconds"); }</code><technical_language>template parameter filename in</technical_language>

Target:
protected void writeToFile(File downloadFolder, ArrayList<SEDRow> results) throws IOException { String csvFilename = downloadFolder.getAbsolutePath() + File.separator + "chpl-sed-all-details.csv"; File csvFile = new File(csvFilename); if (!csvFile.exists()) { csvFile.createNewFile(); } else { csvFile.delete(); } SEDCsvPresenter csvPresenter = new SEDCsvPresenter(); Date start = new Date(); int numRows = csvPresenter.presentAsFile(csvFile, results); Date end = new Date(); LOGGER.info("Wrote " + numRows + " rows to SED detailed data CSV file in " + (end.getTime() - start.getTime()) / 1000 + " seconds"); }
Source:
<code>Map<Integer,InputStream> createInputMap(final Map<Integer, ExposedByteArrayOutputStream> outputMap) throws IOException { <START> final Map<Integer,InputStream> inputMap = new HashMap<>(); <END> for (final Map.Entry<Integer, ExposedByteArrayOutputStream> mapEntry : outputMap.entrySet()) { try (final ByteArrayInputStream is = new ByteArrayInputStream(mapEntry.getValue().toByteArray())) { inputMap.put(mapEntry.getKey(), is); } } return inputMap; }</code><technical_language>missing space ,</technical_language>

Target:
Map<Integer,InputStream> createInputMap(final Map<Integer, ExposedByteArrayOutputStream> outputMap) { return outputMap.entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, e -> new ByteArrayInputStream(e.getValue().toByteArray()))); }