auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void trace(final String level, String s, Throwable t) { if (s == null) { return; } if (Trace.STRING_SEVERE.equals(level)) { if (!logged.contains(s)) { StacksCoreActivator.pluginLog().logError(s, t); logged.add(s); } } if (StacksCoreActivator.getDefault().isDebugging()) { final StringBuffer sb = new StringBuffer(StacksCoreActivator.PLUGIN_ID); sb.append(" "); sb.append(level); sb.append(" "); sb.append(sdf.format(new Date())); sb.append(" "); sb.append(s); <START> System.out.println(sb.toString()); <END> if (t != null) { t.printStackTrace(); } } }</code><technical_language>System.out.println ??? send eclipse's log DEBUG status</technical_language>

Target:
public static void trace(final String level, String s, Throwable t) { if (s == null) { return; } if (Trace.STRING_SEVERE.equals(level)) { StacksCoreActivator.pluginLog().logError(s, t); } if (StacksCoreActivator.getDefault().isDebugging()) { final StringBuilder sb = new StringBuilder(StacksCoreActivator.PLUGIN_ID); sb.append(" "); sb.append(level); sb.append(" "); sb.append(formatDate()); sb.append(" "); sb.append(s); System.out.println(sb.toString()); if (t != null) { t.printStackTrace(); } } }
Source:
<code>public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, NON_CANCELLING, <START> ""); <END> }</code><technical_language>suggestion EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, NON_CANCELLING, EMPTY_VALUE); }
Source:
<code>public void testGetAndAppendNoMappingExists() { ServerStore store = newStore(); Chain chain = store.getAndAppend(1, getPayload(1)); <START> assertThat(chain.isEmpty(), is(true)); <END> chain = store.get(1); for (Element element : chain) { assertThat(readPayLoad(element.getPayload()), is(Long.valueOf(1))); } }</code><technical_language>want check iterator behavior here</technical_language>

Target:
public void testGetAndAppendNoMappingExists() { ServerStore store = newStore(); Chain chain = store.getAndAppend(1, createPayload(1)); assertThat(chain.isEmpty(), is(true)); chain = store.get(1); assertChainAndReverseChainOnlyHave(chain, 1); }
Source:
<code>@Test public void fingerPrintTest() { findElementByText("Fingerprint").click(); clickNext(); enterPasswordAndContinue(); clickNext(); driver.fingerPrint(2); try { <START> driver.findElementById("com.android.settings:id/next_button").click(); <END> } catch (Exception e) { Assert.fail("fingerprint command fail to execute"); } }</code><technical_language>clickNext()</technical_language>

Target:
@Test public void fingerPrintTest() { findElementByText("Fingerprint").click(); clickNext(); enterPasswordAndContinue(); clickNext(); driver.fingerPrint(2); try { clickNext(); } catch (Exception e) { Assert.fail("fingerprint command fail to execute"); } }
Source:
<code>public void run() { <START> topicMetadataLoadingRunner.refreshMetadata(); <END> }</code><technical_language>please add try catch(Exception), proper logging, if throw exception scheduled code, more jobs scheduled. a precaution. jobs stop running occurred</technical_language>

Target:
public void run() { try { topicMetadataLoadingRunner.refreshMetadata(); } catch (Exception e) { logger.error("An error occurred while refreshing topic metadata", e); } }
Source:
<code>public void beforeClass(final @Optional String testType) throws IOException { <START> if (testType.equals("buckets")) { <END> throw new SkipException("Skipping tests since jobs are disabled in Manta Buckets"); } ConfigContext config = new IntegrationTestConfigContext(); final String testName = this.getClass().getSimpleName(); mantaClient = new MantaClient(config); testPathPrefix = IntegrationTestHelper.setupTestPath(config, mantaClient, testName, testType); IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }</code><technical_language>testType null, invert equals() check so: java if ("buckets".equals(testType)) {</technical_language>

Target:
public void beforeClass(final @Optional String testType) throws IOException { if ("buckets".equals(testType)) { throw new SkipException("Skipping tests since jobs are disabled in Manta Buckets"); } ConfigContext config = new IntegrationTestConfigContext(); final String testName = this.getClass().getSimpleName(); mantaClient = new MantaClient(config); testPathPrefix = IntegrationTestHelper.setupTestPath(config, mantaClient, testName, testType); IntegrationTestHelper.createTestBucketOrDirectory(mantaClient, testPathPrefix, testType); }
Source:
<code>public void focusWindow(String titleOrUrl) throws Exception { String curTitle = this.getWd().getTitle(); String curUrl = this.getWd().getCurrentUrl(); if (titleOrUrl.equals(curTitle) || titleOrUrl.equals(curUrl)) { candybean.log.warning("No focus was made because the given string matched the current title or URL: " + titleOrUrl); } else { Set<String> windowHandlesSet = this.getWd().getWindowHandles(); String[] windowHandles = windowHandlesSet.toArray(new String[] {""}); int i = 0; boolean windowFound = false; while (i < windowHandles.length && !windowFound) { WebDriver window = this.getWd().switchTo().window(windowHandles[i]); if (window.getTitle().equals(titleOrUrl) || window.getCurrentUrl().equals(titleOrUrl)) { <START> windows.push(new Pair<Integer, String>(Integer.valueOf(i), this.getWd().getWindowHandle())); <END> candybean.log.info("Focused by title or URL: " + titleOrUrl + " to window: " + windows.peek()); windowFound = true; } i++; } if (!windowFound) { this.getWd().switchTo().window(windows.peek().getY()); throw new Exception("The given focus window string matched no title or URL: " + titleOrUrl); } } }</code><technical_language>Great change</technical_language>

Target:
public void focusWindow(String titleOrUrl) throws Exception { String curTitle = this.wd.getTitle(); String curUrl = this.wd.getCurrentUrl(); if (titleOrUrl.equals(curTitle) || titleOrUrl.equals(curUrl)) { candybean.log.warning("No focus was made because the given string matched the current title or URL: " + titleOrUrl); } else { Set<String> windowHandlesSet = this.wd.getWindowHandles(); String[] windowHandles = windowHandlesSet.toArray(new String[] {""}); int i = 0; boolean windowFound = false; while (i < windowHandles.length && !windowFound) { WebDriver window = this.wd.switchTo().window(windowHandles[i]); if (window.getTitle().equals(titleOrUrl) || window.getCurrentUrl().equals(titleOrUrl)) { windows.push(new Pair<Integer, String>(Integer.valueOf(i), this.wd.getWindowHandle())); candybean.log.info("Focused by title or URL: " + titleOrUrl + " to window: " + windows.peek()); windowFound = true; } i++; } if (!windowFound) { this.wd.switchTo().window(windows.peek().getY()); throw new Exception("The given focus window string matched no title or URL: " + titleOrUrl); } } }
Source:
<code>public void assumeBookmarkSupport() { String version = session.run( "RETURN 1" ).consume().server().version(); <START> System.out.println( version ); <END> assumeTrue( version( version ).greaterThanOrEqual( v3_1_0 ) ); }</code><technical_language>This println removed</technical_language>

Target:
public void assumeBookmarkSupport() { String version = session.run( "RETURN 1" ).consume().server().version(); assumeTrue( version( version ).greaterThanOrEqual( v3_1_0 ) ); }
Source:
<code>int count(String tableName, Connector conn) throws Exception { Scanner s = conn.createScanner(tableName, Authorizations.EMPTY); <START> s.close(); <END> return Iterators.size(s.iterator()); }</code><technical_language>This closed is used</technical_language>

Target:
int count(String tableName, Connector conn) throws Exception { try (Scanner s = conn.createScanner(tableName, Authorizations.EMPTY)) { return Iterators.size(s.iterator()); } }
Source:
<code>public void staticMethodsAreNotGenerated() { Set<String> staticMethods = Arrays.stream(TEST_CLASS_METHODS) .filter(method -> Modifier.isStatic(method.getModifiers())) .map(TestingUtils::methodToString) .collect(Collectors.toSet()); Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_TestClass.class); <START> assertThat(generatedMethods, not(hasItems(staticMethods.toArray(new String[0])))); <END> }</code><technical_language>boilerplate (.toArray(new String[0])) is a bit distracting. In fact, of test methods similar boilerplate enable get TEST_CLASS_METHODS array of methods care for this test, some filter. a one-arg helper method get array of relevant methods for test (the argument filter string, e.g. method -> Modifier.isStatic(method.getModifiers()) for this one)</technical_language>

Target:
public void staticMethodsAreNotGenerated() { Set<String> staticMethods = extractTestClassMethods(Modifier::isStatic); Set<String> generatedMethods = TestingUtils.extractMethods(AutoDelegate_TestClass.class); assertThat(generatedMethods, not(hasItems(staticMethods.toArray(new String[0])))); }
Source:
<code>public static BucketList create(List<Bucket> buckets) { <START> return new AutoValue_BucketList(buckets); <END> }</code><technical_language>Enforce immutable list copyOf</technical_language>

Target:
public static BucketList create(List<Bucket> buckets) { return new AutoValue_BucketList(ImmutableList.copyOf(buckets)); }
Source:
<code>private void setupFocusHandling() { <START> PlatformUI.getWorkbench().addWindowListener(new IWindowListener() { <END> public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.schedule(); } }); }</code><technical_language>This listener removed bundle stopped</technical_language>

Target:
private void setupFocusHandling() { focusListener = new IWindowListener() { public void windowOpened(IWorkbenchWindow window) { } public void windowDeactivated(IWorkbenchWindow window) { } public void windowClosed(IWorkbenchWindow window) { } public void windowActivated(IWorkbenchWindow window) { if (rcs.doReschedule) rcs.schedule(); refreshJob.schedule(); } }; PlatformUI.getWorkbench().addWindowListener(focusListener); }
Source:
<code>protected AbstractSiteMap processXml(URL sitemapUrl, InputSource is) throws UnknownFormatException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setXIncludeAware(false); try { factory.setFeature("<LINK_0>", false); } catch (Exception e) { <START> } <END> DelegatorHandler handler = new DelegatorHandler(sitemapUrl, strict); try { SAXParser saxParser = factory.newSAXParser(); saxParser.getXMLReader().setEntityResolver(new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { return new InputSource(new StringReader("")); } }); saxParser.parse(is, handler); return handler.getSiteMap(); } catch (IOException e) { UnknownFormatException ufe = new UnknownFormatException("Failed to parse " + sitemapUrl); ufe.initCause(e); throw ufe; } catch (SAXException e) { LOG.warn("Error parsing sitemap {}: {}", sitemapUrl, e.getMessage()); AbstractSiteMap sitemap = handler.getSiteMap(); if (allowPartial && sitemap != null) { LOG.warn("Processed broken/partial sitemap for '" + sitemapUrl + "'"); sitemap.setProcessed(true); return sitemap; } else { UnknownFormatException ufe = new UnknownFormatException("Failed to parse " + sitemapUrl); ufe.initCause(e); throw ufe; } } catch (ParserConfigurationException e) { throw new IllegalStateException(e); } }</code><technical_language>Feels re-throw this a RuntimeException</technical_language>

Target:
protected AbstractSiteMap processXml(URL sitemapUrl, InputSource is) throws UnknownFormatException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setXIncludeAware(false); try { factory.setFeature("<LINK_0>", false); } catch (Exception e) { throw new RuntimeException("Failed to configure XML parser: " + e.toString()); } DelegatorHandler handler = new DelegatorHandler(sitemapUrl, strict); try { SAXParser saxParser = factory.newSAXParser(); saxParser.getXMLReader().setEntityResolver(new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { return new InputSource(new StringReader("")); } }); saxParser.parse(is, handler); return handler.getSiteMap(); } catch (IOException e) { UnknownFormatException ufe = new UnknownFormatException("Failed to parse " + sitemapUrl); ufe.initCause(e); throw ufe; } catch (SAXException e) { LOG.warn("Error parsing sitemap {}: {}", sitemapUrl, e.getMessage()); AbstractSiteMap sitemap = handler.getSiteMap(); if (allowPartial && sitemap != null) { LOG.warn("Processed broken/partial sitemap for '" + sitemapUrl + "'"); sitemap.setProcessed(true); return sitemap; } else { UnknownFormatException ufe = new UnknownFormatException("Failed to parse " + sitemapUrl); ufe.initCause(e); throw ufe; } } catch (ParserConfigurationException e) { throw new IllegalStateException(e); } }
Source:
<code>public Object postProcess(Object bean, String beanName, Method method, List<Annotation> annotations) { String channelName = MessagingAnnotationUtils.resolveAttribute(annotations, AnnotationUtils.VALUE, String.class); Assert.hasText(channelName, "The channel ('value' attribute of @InboundChannelAdapter) can't be empty."); MessageSource<?> messageSource = null; try { messageSource = createMessageSource(bean, beanName, method); } catch (NoSuchBeanDefinitionException e) { <START> return null; <END> } MessageChannel channel = this.channelResolver.resolveDestination(channelName); SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); adapter.setOutputChannel(channel); adapter.setSource(messageSource); configurePollingEndpoint(adapter, annotations); return adapter; }</code><technical_language>I add a DEBUG log - in case, in future, some other bean missing (not @Bean). ok in abstract class for @Bean (instead of more general create... method). However, hurt add a DEBUG (or TRACE) log too</technical_language>

Target:
public Object postProcess(Object bean, String beanName, Method method, List<Annotation> annotations) { String channelName = MessagingAnnotationUtils.resolveAttribute(annotations, AnnotationUtils.VALUE, String.class); Assert.hasText(channelName, "The channel ('value' attribute of @InboundChannelAdapter) can't be empty."); MessageSource<?> messageSource = null; try { messageSource = createMessageSource(bean, beanName, method); } catch (NoSuchBeanDefinitionException e) { if (this.logger.isDebugEnabled()) { this.logger.debug("The bean for method [" + method + "] doesn't exist. " + "Mainly by the @Conditional reason."); } return null; } MessageChannel channel = this.channelResolver.resolveDestination(channelName); SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); adapter.setOutputChannel(channel); adapter.setSource(messageSource); configurePollingEndpoint(adapter, annotations); return adapter; }
Source:
<code>protected String getPropertiesFilePath() { String propertiesFilePath = null; <START> final String sValue = PropertyAccessor.getInstance().getPropertyFileLocation(); <END> if (sValue != null && sValue.length() > 0) { if (sValue.endsWith("/") || sValue.endsWith("\\")) { propertiesFilePath = sValue; } else { final String sFileSeparator = System.getProperty("file.separator"); propertiesFilePath = sValue + sFileSeparator + FILE_NAME; } } else { LOG.error("Path to property files not found"); } return propertiesFilePath; }</code><technical_language>check String is empty instead of length</technical_language>

Target:
protected String getPropertiesFilePath() { String propertiesFilePath = null; final String sValue = PropertyAccessor.getInstance().getPropertyFileLocation(); if (StringUtils.isNotEmpty(sValue)) { if (sValue.endsWith("/") || sValue.endsWith("\\")) { propertiesFilePath = sValue; } else { final String sFileSeparator = System.getProperty("file.separator"); propertiesFilePath = sValue + sFileSeparator + FILE_NAME; } } else { LOG.error("Path to property files not found"); } return propertiesFilePath; }
Source:
<code>public synchronized void mutate(final Mutation mutation) throws IOException { if (closed) { throw new IllegalStateException("Cannot mutate when the BufferedMutator is closed."); } <START> handleExceptions(); <END> currentWriteBufferSize.addAndGet(mutation.heapSize()); ListenableFuture<? extends GeneratedMessage> future = batchExecutor.issueRequest(mutation); inflightOperations.add(future); Futures.addCallback(future, new AccountingFutureCallback(mutation, future)); boolean waited = false; while (inflightOperations.size() > maxInflightRpcCount || currentWriteBufferSize.get() > writeBufferSize) { waited = true; LOG.info("BufferedMutator is pausing: inflight operations: %d currentWriteBufferSize:%d", inflightOperations.size(), currentWriteBufferSize.get()); try { wait(MAX_WAIT_MILLIS); } catch (InterruptedException e) { } } if (waited) { handleExceptions(); } }</code><technical_language>load this is susceptible starvation lock held while waiting. Other writers in write more data buffered mutator / rpc channel caller unlucky enough put top is suffer</technical_language>

Target:
public void mutate(final Mutation mutation) throws IOException { ReadLock lock = mutationLock.readLock(); lock.lock(); try { if (closed) { throw new IllegalStateException("Cannot mutate when the BufferedMutator is closed."); } handleExceptions(); doMutation(mutation); } finally { lock.unlock(); } }
Source:
<code>public static boolean isPublicKeyValid(String publicKey) { int i; <START> i = publicKey.indexOf("\n"); <END> if (i != -1 && i != publicKey.length()-1) { return false; } String[] words = publicKey.split("\\s+", 3); if (words.length < 2) { return false; } if (!words[0].matches("^[\\p{Alpha}\\p{Digit}-]*$")) { return false; } if (!isBase64(words[1].getBytes(Charset.forName("UTF-8")))) { return false; } return true; }</code><technical_language>this merged</technical_language>

Target:
public static boolean isPublicKeyValid(String publicKey) { int i = publicKey.indexOf("\n"); if (i != -1 && i != publicKey.length()-1) { return false; } String[] words = publicKey.split("\\s+", 3); if (words.length < 2) { return false; } if (!words[0].matches("^[\\p{Alpha}\\p{Digit}-]*$")) { return false; } if (!isBase64(words[1].getBytes(Charset.forName("UTF-8")))) { return false; } return true; }
Source:
<code>public void setLocked(boolean locked) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { <START> ((Terrain) getChild(i)).setLocked(locked); <END> } else if (this.getChild(i) instanceof TerrainPatch) { if (locked) ((TerrainPatch) getChild(i)).lockMesh(); else ((TerrainPatch) getChild(i)).unlockMesh(); } } }</code><technical_language>This wrong/useless me: setLocked is implemented Terrain instead of TerrainQuad, this cast confuse people. Specifically if instanceof Check extended Terrain then</technical_language>

Target:
public void setLocked(boolean locked) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { ((TerrainQuad) getChild(i)).setLocked(locked); } else if (this.getChild(i) instanceof TerrainPatch) { if (locked) ((TerrainPatch) getChild(i)).lockMesh(); else ((TerrainPatch) getChild(i)).unlockMesh(); } } }
Source:
<code>public void testLoadOrderedPublicEvents_5() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", IContentManager.CONTENT_DESCR_FILTER_KEY) .param("direction", FieldSearchFilter.DESC_ORDER) .param("filters[0].attribute", IContentManager.ENTITY_TYPE_CODE_FILTER_KEY) .param("filters[0].operator", "eq") .param("filters[0].value", "EVN") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); <START> String bodyResult = result.andReturn().getResponse().getContentAsString(); result.andExpect(status().isOk()); String[] expectedFreeContentsId = {"EVN25", "EVN21", "EVN20", "EVN194", "EVN193", "EVN192", "EVN191", "EVN23", "EVN24"}; int payloadSize = JsonPath.read(bodyResult, "$.payload.size()"); Assert.assertEquals(expectedFreeContentsId.length, payloadSize); for (int i = 0; i < expectedFreeContentsId.length; i++) { String expectedId = expectedFreeContentsId[i]; String extractedId = JsonPath.read(bodyResult, "$.payload[" + i + "].id"); Assert.assertEquals(expectedId, extractedId); } <END> }</code><technical_language>Check code style for building mvc test rules latest commit PR #556</technical_language>

Target:
public void testLoadOrderedPublicEvents_5() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", IContentManager.CONTENT_DESCR_FILTER_KEY) .param("direction", FieldSearchFilter.DESC_ORDER) .param("filters[0].attribute", IContentManager.ENTITY_TYPE_CODE_FILTER_KEY) .param("filters[0].operator", "eq") .param("filters[0].value", "EVN") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); result.andDo(print()) .andExpect(status().isOk()) .andExpect(jsonPath("$.payload.size()", is(9))) .andExpect(jsonPath("$.payload[0].id", is("EVN25"))) .andExpect(jsonPath("$.payload[1].id", is("EVN21"))) .andExpect(jsonPath("$.payload[2].id", is("EVN20"))) .andExpect(jsonPath("$.payload[3].id", is("EVN194"))) .andExpect(jsonPath("$.payload[4].id", is("EVN193"))) .andExpect(jsonPath("$.payload[5].id", is("EVN192"))) .andExpect(jsonPath("$.payload[6].id", is("EVN191"))) .andExpect(jsonPath("$.payload[7].id", is("EVN23"))) .andExpect(jsonPath("$.payload[8].id", is("EVN24"))); }
Source:
<code>public ElasticsearchTableHandle( @JsonProperty("schemaName") String schemaName, @JsonProperty("tableName") String tableName) { <START> this.schemaTableName = new SchemaTableName(requireNonNull(schemaName.toLowerCase(ENGLISH), "schemaName is null"), requireNonNull(tableName.toLowerCase(ENGLISH), "tableName is null")); <END> }</code><technical_language>This is hard read, please move out non-null checks</technical_language>

Target:
public ElasticsearchTableHandle( @JsonProperty("schemaName") String schemaName, @JsonProperty("tableName") String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); this.schemaTableName = new SchemaTableName(schemaName.toLowerCase(ENGLISH), tableName.toLowerCase(ENGLISH)); }
Source:
<code>public HomePage() { final GMap mapDefault = new GMap("mapPanelDefault"); add(mapDefault); final GMap map = new GMap("mapPanel"); add(map); List<GLatLng> markersToShow = new ArrayList<GLatLng>(); double minLat = -85.00; double maxLat = 85.00; double minLon = -180.00; double maxLon = 180.00; for(int i=0; i<1000; i++) { double latitude = minLat + (double)(Math.random() * ((maxLat - minLat) + 1)); <START> double longitude = minLon + (double)(Math.random() * ((maxLon - minLon) + 1)); <END> GLatLng glatlng = new GLatLng(latitude, longitude); markersToShow.add(glatlng); map.addOverlay(new GMarker("marker"+i, new GMarkerOptions(map, glatlng))); mapDefault.addOverlay(new GMarker("marker"+i, new GMarkerOptions(mapDefault, glatlng))); } GMarkerClusterOptions options = new GMarkerClusterOptions(); options.setMinimumClusterSize(3); List<GMarkerClusterStyle> styles = new ArrayList<GMarkerClusterStyle>(); GMarkerClusterStyle style1 = new GMarkerClusterStyle(); style1.setUrl(image1); style1.setHeight(26); style1.setWidth(30); GMarkerClusterStyle style2 = new GMarkerClusterStyle(); style2.setUrl(image2); style2.setHeight(35); style2.setWidth(40); GMarkerClusterStyle style3 = new GMarkerClusterStyle(); style3.setUrl(image3); style3.setHeight(44); style3.setWidth(50); styles.add(style1); styles.add(style2); styles.add(style3); options.setStyles(styles); map.setMarkerCluster(new GMarkerCluster(map, options)); mapDefault.setMarkerCluster(new GMarkerCluster(mapDefault)); map.fitMarkers(markersToShow); mapDefault.fitMarkers(markersToShow); }</code><technical_language>whitespace police</technical_language>

Target:
public HomePage() { final GMap mapDefault = new GMap("mapPanelDefault"); add(mapDefault); final GMap map = new GMap("mapPanel"); add(map); List<GLatLng> markersToShow = new ArrayList<GLatLng>(); double minLat = -85.00; double maxLat = 85.00; double minLon = -180.00; double maxLon = 180.00; for(int i=0; i<1000; i++) { double latitude = minLat + (double)(Math.random() * ((maxLat - minLat) + 1)); double longitude = minLon + (double)(Math.random() * ((maxLon - minLon) + 1)); GLatLng glatlng = new GLatLng(latitude, longitude); markersToShow.add(glatlng); map.addOverlay(new GMarker("marker"+i, new GMarkerOptions(map, glatlng))); mapDefault.addOverlay(new GMarker("marker"+i, new GMarkerOptions(mapDefault, glatlng))); } GMarkerClusterOptions options = new GMarkerClusterOptions(); options.setMinimumClusterSize(3); List<GMarkerClusterStyle> styles = new ArrayList<GMarkerClusterStyle>(); GMarkerClusterStyle style1 = new GMarkerClusterStyle(); style1.setUrl(image1).setHeight(26).setWidth(30); GMarkerClusterStyle style2 = new GMarkerClusterStyle(); style2.setUrl(image2).setHeight(35).setWidth(40); GMarkerClusterStyle style3 = new GMarkerClusterStyle(); style3.setUrl(image3).setHeight(44).setWidth(50); styles.add(style1); styles.add(style2); styles.add(style3); options.setStyles(styles); map.setMarkerCluster(new GMarkerCluster(map, options)); mapDefault.setMarkerCluster(new GMarkerCluster(mapDefault)); map.fitMarkers(markersToShow); mapDefault.fitMarkers(markersToShow); }
Source:
<code><START> public void testDeprecatedTimeMethods() { <END> ShallowTraceBuilder builder = new ShallowTraceBuilder((Long) null); assertNull(builder.getId()); assertNull(builder.getStartNanos()); assertNull(builder.getEndNanos()); assertNull(builder.getPendingNanos()); builder = new ShallowTraceBuilder(new Long(1L)); builder.setResultType(ResultType.UNFINISHED); builder.setName("test"); ShallowTrace trace = builder.build(); assertNull(trace.getStartNanos()); assertNull(trace.getEndNanos()); assertNull(trace.getPendingNanos()); builder.setResultType(ResultType.EARLY_FINISH); assertNotNull(builder.getStartNanos()); assertNotNull(builder.getEndNanos()); assertNotNull(builder.getPendingNanos()); builder.setStartNanos(new Long(1L)); assertEquals(builder.getStartNanos(), new Long(1L)); builder.setEndNanos(new Long(1L)); assertEquals(builder.getEndNanos(), new Long(1L)); builder.setPendingNanos(new Long(1L)); assertEquals(builder.getPendingNanos(), new Long(1L)); }</code><technical_language>cover permutations for fields touched. 1. set get deprecated methods 2. set new method, get deprecated method 3. set deprecated method, get new method 4. set get new methods (which covered other tests fixed)</technical_language>

Target:
public void testDeprecatedTimeMethods() { ShallowTraceBuilder builder = new ShallowTraceBuilder((Long) null); assertNull(builder.getId()); assertNull(builder.getStartNanos()); assertNull(builder.getEndNanos()); assertNull(builder.getPendingNanos()); builder = new ShallowTraceBuilder(new Long(1L)); assertEquals(builder.getId(), new Long(1L)); builder.setStartNanos(null); assertEquals(builder.getNativeStartNanos(), -1L); builder.setEndNanos(null); assertEquals(builder.getNativeEndNanos(), -1L); builder.setPendingNanos(null); assertEquals(builder.getNativePendingNanos(), -1L); builder.setNativeStartNanos(1L); assertEquals(builder.getStartNanos(), new Long(1L)); builder.setNativeEndNanos(1L); assertEquals(builder.getEndNanos(), new Long(1L)); builder.setNativePendingNanos(1L); assertEquals(builder.getPendingNanos(), new Long(1L)); builder.setStartNanos(new Long(1L)); assertEquals(builder.getStartNanos(), new Long(1L)); assertEquals(builder.getNativeStartNanos(), 1L); builder.setEndNanos(new Long(1L)); assertEquals(builder.getEndNanos(), new Long(1L)); assertEquals(builder.getNativeEndNanos(), 1L); builder.setPendingNanos(new Long(1L)); assertEquals(builder.getPendingNanos(), new Long(1L)); assertEquals(builder.getNativePendingNanos(), 1L); }
Source:
<code>private Host createPowerHost() { final List<Pe> peList = new ArrayList<>(HOST_PES); for (int i = 0; i < HOST_PES; i++) { peList.add(new PeSimple(1000, new PeProvisionerSimple())); } <START> final PowerModelHost powerModel = new PowerModelHost(STATIC_POWER, MAX_POWER); <END> final long ram = 2048; final long bw = 10000; final long storage = 1000000; final ResourceProvisioner ramProvisioner = new ResourceProvisionerSimple(); final ResourceProvisioner bwProvisioner = new ResourceProvisionerSimple(); final VmScheduler vmScheduler = new VmSchedulerTimeShared(); final Host host = new HostSimple(ram, bw, storage, peList); host.setPowerModel(powerModel); host.setRamProvisioner(ramProvisioner); host.setBwProvisioner(bwProvisioner); host.setVmScheduler(vmScheduler); return host; }</code><technical_language>Sometimes, parameters a weird order. However, changing lots of troubles for existing users. CloudSim userbase related projects growing, a kind of change is complicated. If parameter types incompatible, a big deal. here, type. This way, compiler error upgrading users start get wrong simulation results understanding why</technical_language>

Target:
private Host createPowerHost() { final List<Pe> peList = new ArrayList<>(HOST_PES); for (int i = 0; i < HOST_PES; i++) { peList.add(new PeSimple(1000, new PeProvisionerSimple())); } final PowerModelHost powerModel = new PowerModelHostSimple(MAX_POWER, STATIC_POWER); final long ram = 2048; final long bw = 10000; final long storage = 1000000; final ResourceProvisioner ramProvisioner = new ResourceProvisionerSimple(); final ResourceProvisioner bwProvisioner = new ResourceProvisionerSimple(); final VmScheduler vmScheduler = new VmSchedulerTimeShared(); final Host host = new HostSimple(ram, bw, storage, peList); host.setPowerModel(powerModel); host.setRamProvisioner(ramProvisioner); host.setBwProvisioner(bwProvisioner); host.setVmScheduler(vmScheduler); return host; }
Source:
<code>File getWpsOutputStorage() { File wpsStore = null; try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); Resource wps = loader.get("temp/wps"); wpsStore = wps.dir(); } catch(Exception e) { throw new WcsException("Could not create the temporary storage directory for WPS"); } if(wpsStore == null || !wpsStore.exists()) { <START> throw new WcsException("Could not create the temporary storage directory for WPS"); <END> } return wpsStore; }</code><technical_language>WcsException in WPS</technical_language>

Target:
File getWpsOutputStorage() { File wpsStore = null; try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); Resource wps = loader.get("temp/wps"); wpsStore = wps.dir(); } catch(Exception e) { throw new ServiceException("Could not create the temporary storage directory for WPS"); } if(wpsStore == null || !wpsStore.exists()) { throw new ServiceException("Could not create the temporary storage directory for WPS"); } return wpsStore; }
Source:
<code>public void replaceNodeShouldRemoveOldNode() throws Exception { Node oldNode = r.createSlave("foo", "", null); Node newNode = r.createSlave("foo-new", "", null); r.jenkins.addNode(oldNode); r.jenkins.getNodesObject().replaceNode(oldNode, newNode); r.jenkins.getNodesObject().load(); <START> assertNull(r.jenkins.getNode(oldNode.getNodeName())); <END> }</code><technical_language>suggestion assertNull(r.jenkins.getNode("foo")); is obvious node's name change in here</technical_language>

Target:
public void replaceNodeShouldRemoveOldNode() throws Exception { Node oldNode = r.createSlave("foo", "", null); Node newNode = r.createSlave("foo-new", "", null); r.jenkins.addNode(oldNode); r.jenkins.getNodesObject().replaceNode(oldNode, newNode); r.jenkins.getNodesObject().load(); assertNull(r.jenkins.getNode("foo")); }
Source:
<code>public AbstractId unmarshal(String id) { <START> throw new AssertionError("Cannot unmarshal from String"); <END> }</code><technical_language>UnsupportedOperationException more here</technical_language>

Target:
public AbstractId unmarshal(String id) { throw new UnsupportedOperationException("Cannot unmarshal from String"); }
Source:
<code>public <Match extends IPatternMatch> MatchSetRecord getMatchSetRecord(ResourceSet rs, IQuerySpecification<? extends ViatraQueryMatcher<Match>> querySpecification, Match filter) throws ViatraQueryException { if (engine == null){ engine = AdvancedViatraQueryEngine.createUnmanagedEngine(new EMFScope(rs)); } <START> ViatraQueryEngine engine = ViatraQueryEngine.on(new EMFScope(rs)); <END> ViatraQueryMatcher<Match> matcher = (ViatraQueryMatcher<Match>) ((AdvancedViatraQueryEngine) engine) .getMatcher(querySpecification, hint); return new SnapshotHelper().createMatchSetRecordForMatcher(matcher, filter == null ? matcher.newEmptyMatch() : filter); }</code><technical_language>Delete this line</technical_language>

Target:
public <Match extends IPatternMatch> MatchSetRecord getMatchSetRecord(ResourceSet rs, IQuerySpecification<? extends ViatraQueryMatcher<Match>> querySpecification, Match filter) throws ViatraQueryException { return getMatchSetRecord(new EMFScope(rs), querySpecification, filter); }
Source:
<code>MessageInfoAndMetadataListSerde(List<MessageInfo> messageInfoList, List<MessageMetadata> messageMetadataList, short version) { <START> if (messageMetadataList != null && messageInfoList.size() != messageMetadataList.size()) { <END> throw new IllegalArgumentException( "Mismatch in the number of messages in message Info list: " + messageInfoList.size() + " and message metadata list: " + messageMetadataList.size()); } this.messageInfoList = messageInfoList; this.messageMetadataList = messageMetadataList; this.version = version; }</code><technical_language>check for size match if messageMetadataList is Empty. This avoids NCopies in next constructor</technical_language>

Target:
MessageInfoAndMetadataListSerde(List<MessageInfo> messageInfoList, List<MessageMetadata> messageMetadataList, short version) { if (messageInfoList != null && messageMetadataList != null && messageInfoList.size() != messageMetadataList.size()) { throw new IllegalArgumentException( "Mismatch in the number of messages in message Info list: " + messageInfoList.size() + " and message metadata list: " + messageMetadataList.size()); } this.messageInfoList = messageInfoList; this.messageMetadataList = messageMetadataList; this.version = version; }
Source:
<code>public synchronized List<PrestoWarning> getWarnings() { if (addWarnings) { <START> super.add(createTestWarning(warningCode.incrementAndGet())); <END> } return super.getWarnings(); }</code><technical_language>super. is unnecessary</technical_language>

Target:
public synchronized List<PrestoWarning> getWarnings() { if (addWarnings) { add(createTestWarning(warningCode.incrementAndGet())); } return ImmutableList.copyOf(warnings.values()); }
Source:
<code>public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { boolean resultContainerCreate = false; checkArgument(location == null || location.equals(region), "location must be null or %s", region); if (options.isPublicRead()) { resultContainerCreate = api.getContainerApi(regionId).create(container, ANYBODY_READ); } resultContainerCreate = api.getContainerApi(regionId).create(container, BASIC_CONTAINER); if (resultContainerCreate) { Container val = api.getContainerApi(regionId).get(container); containerCache.put(container, Optional.fromNullable(val)); } <START> return resultContainerCreate; <END> }</code><technical_language>creating a container relate dynamic large objects? If this is a separate change, submit a separate pull request</technical_language>

Target:
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { checkArgument(location == null || location.equals(region), "location must be null or %s", region); if (options.isPublicRead()) { return api.getContainerApi(regionId).create(container, ANYBODY_READ); } return api.getContainerApi(regionId).create(container, BASIC_CONTAINER); }
Source:
<code>public static void removeBulkLoadEntries(Connector conn, String tableId, long tid) throws Exception { try (Scanner mscanner = new IsolatedScanner(conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)); BatchWriter bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig())) { mscanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange()); mscanner.fetchColumnFamily(TabletsSection.BulkFileColumnFamily.NAME); boolean shouldTrace = log.isTraceEnabled(); String tidString = Long.toString(tid); for (Entry<Key,Value> entry : mscanner) { if (shouldTrace) { <START> log.trace("Looking at entry " + entry + " with tid " + tidString); <END> } if (entry.getValue().toString().equals(tidString)) { if (shouldTrace) { log.trace("deleting entry " + entry); } Key key = entry.getKey(); Mutation m = new Mutation(key.getRow()); m.putDelete(key.getColumnFamily(), key.getColumnQualifier()); bw.addMutation(m); } } } }</code><technical_language>SLF4J in this class, right? able message syntax object place holders here</technical_language>

Target:
public static void removeBulkLoadEntries(Connector conn, String tableId, long tid) throws Exception { try (Scanner mscanner = new IsolatedScanner(conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY)); BatchWriter bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig())) { mscanner.setRange(new KeyExtent(tableId, null, null).toMetadataRange()); mscanner.fetchColumnFamily(TabletsSection.BulkFileColumnFamily.NAME); boolean shouldTrace = log.isTraceEnabled(); byte[] tidAsBytes = Long.toString(tid).getBytes(UTF_8); for (Entry<Key,Value> entry : mscanner) { if (shouldTrace) { log.trace("Looking at entry with tid {}", entry, tid); } if (Arrays.equals(entry.getValue().get(), tidAsBytes)) { if (shouldTrace) { log.trace("deleting entry {}", entry); } Key key = entry.getKey(); Mutation m = new Mutation(key.getRow()); m.putDelete(key.getColumnFamily(), key.getColumnQualifier()); bw.addMutation(m); } } } }
Source:
<code>private Map<String, FilePath> getJobs(AWSDeviceFarm adf, ScheduleRunResult run, FilePath resultsDir) throws IOException, InterruptedException { Map<String, FilePath> jobs = new HashMap<String, FilePath>(); ListJobsResult result = adf.listJobs(run.getRun().getArn()); for (Job job : result.getJobs()) { String arn = job.getArn().split(":")[6]; String jobId = arn.substring(arn.lastIndexOf("/") + 1); <START> jobs.put(arn, new FilePath(resultsDir, job.getName() + "-" + jobId)); <END> jobs.get(arn).mkdirs(); } return jobs; }</code><technical_language>I remember...does Job a reference device in object? If so, prefer a combination of name + device version instead of job ID, auto-increment number is user friendly helpful value</technical_language>

Target:
private Map<String, FilePath> getJobs(AWSDeviceFarm adf, ScheduleRunResult run, FilePath resultsDir) throws IOException, InterruptedException { Map<String, FilePath> jobs = new HashMap<String, FilePath>(); ListJobsResult result = adf.listJobs(run.getRun().getArn()); for (Job job : result.getJobs()) { String arn = job.getArn().split(":")[6]; String jobId = arn.substring(arn.lastIndexOf("/") + 1); String osVersion = null; if (job.getDevice() != null) { osVersion = job.getDevice().getOs(); } jobs.put(arn, new FilePath(resultsDir, job.getName() + "-" + (osVersion != null ? osVersion : jobId))); jobs.get(arn).mkdirs(); } return jobs; }
Source:
<code>private static String getRawMac() { final StringBuilder ret = new StringBuilder(); final String os = System.getProperty("os.name"); String[] command = {"ifconfig", "-a"}; if (os != null && !os.isEmpty() && os.toLowerCase(Locale.US).startsWith("win")) { command = new String[]{"getmac"}; } try { final ProcessBuilder builder = new ProcessBuilder(command); final Process process = builder.start(); <START> InputStream inputStream = process.getInputStream(); <END> try ( InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); BufferedReader br = new BufferedReader(inputStreamReader)) { String tmp; while ((tmp = br.readLine()) != null) { ret.append(tmp); } } } catch (IOException e) { return null; } return ret.toString(); }</code><technical_language>Ensure streams closed. try-with-resources</technical_language>

Target:
private static String getRawMac() { final StringBuilder ret = new StringBuilder(); final String os = System.getProperty("os.name"); String[] command = {"ifconfig", "-a"}; if (os != null && !os.isEmpty() && os.toLowerCase(Locale.US).startsWith("win")) { command = new String[]{"getmac"}; } try { final ProcessBuilder builder = new ProcessBuilder(command); final Process process = builder.start(); try (InputStream inputStream = process.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); BufferedReader br = new BufferedReader(inputStreamReader)) { String tmp; while ((tmp = br.readLine()) != null) { ret.append(tmp); } } } catch (IOException e) { return null; } return ret.toString(); }
Source:
<code>public Set<ResolvedBroadcast> aggregateBroadcasts( Set<Broadcast> broadcasts, Optional<Platform> platformOptional, List<Id> downweighChannelIds ) { if (platformOptional.isPresent()) { broadcasts = removeBroadcastsNotOnPlatform(broadcasts, platformOptional.get()); } <START> broadcasts = aggregateContinuations(broadcasts); <END> Multimap<DateTime, ResolvedBroadcast> broadcastMap = broadcasts.stream() .filter(broadcast -> broadcast.getTransmissionEndTime().isAfterNow()) .map(broadcast -> ResolvedBroadcast.create( broadcast, ResolvedChannel.builder(resolveChannel(broadcast.getChannelId())).build()) ) .collect(MoreCollectors.toImmutableListMultiMap( resolvedBroadcast -> resolvedBroadcast.getBroadcast().getTransmissionTime(), resolvedBroadcast -> resolvedBroadcast )); ImmutableMultimap.Builder<DateTime, ResolvedBroadcast> aggregatedBroadcasts = ImmutableMultimap.builder(); for(DateTime dateTime : broadcastMap.keySet()) { Collection<ResolvedBroadcast> sameTimeBroadcasts = broadcastMap.get(dateTime); if (sameTimeBroadcasts.size() > 1) { aggregatedBroadcasts.putAll( dateTime, aggregateBroadcastsInternal(sameTimeBroadcasts, platformOptional) ); } else { aggregatedBroadcasts.put(dateTime, Iterables.getOnlyElement(sameTimeBroadcasts)); } } return sortByDownweighChannelIds( downweighChannelIds, sortBroadcastsByDateTime(aggregatedBroadcasts.build()) ); }</code><technical_language>consider reusing variables, if processed 'aggregateBroadcasts' instead of 'broadcasts'</technical_language>

Target:
public Set<ResolvedBroadcast> aggregateBroadcasts( Set<Broadcast> broadcasts, Optional<Platform> platformOptional, List<Id> downweighChannelIds ) { Set<Broadcast> platformBroadcasts = platformOptional.isPresent() ? removeBroadcastsNotOnPlatform(broadcasts, platformOptional.get()) : broadcasts; Set<Broadcast> mergedContinuations = mergeBroadcastContinuations(platformBroadcasts); Multimap<DateTime, ResolvedBroadcast> broadcastMap = mergedContinuations.stream() .filter(broadcast -> broadcast.getTransmissionEndTime().isAfterNow()) .map(broadcast -> ResolvedBroadcast.create( broadcast, ResolvedChannel.builder(resolveChannel(broadcast.getChannelId())).build()) ) .collect(MoreCollectors.toImmutableListMultiMap( resolvedBroadcast -> resolvedBroadcast.getBroadcast().getTransmissionTime(), resolvedBroadcast -> resolvedBroadcast )); ImmutableMultimap.Builder<DateTime, ResolvedBroadcast> aggregatedBroadcasts = ImmutableMultimap.builder(); for(DateTime dateTime : broadcastMap.keySet()) { Collection<ResolvedBroadcast> sameTimeBroadcasts = broadcastMap.get(dateTime); if (sameTimeBroadcasts.size() > 1) { aggregatedBroadcasts.putAll( dateTime, aggregateBroadcastsInternal(sameTimeBroadcasts, platformOptional) ); } else { aggregatedBroadcasts.put(dateTime, Iterables.getOnlyElement(sameTimeBroadcasts)); } } return sortByDownweighChannelIds( downweighChannelIds, sortBroadcastsByDateTime(aggregatedBroadcasts.build()) ); }
Source:
<code>public static Map<String, SortedMap<Genotype, VariantContext>> createSampleToGenotypeVariantContextSortedMap(final List<String> sampleNames, final Collection<VariantContext> variants) { final Comparator<Genotype> genotypePArtifactComparator = Comparator .comparingDouble((Genotype g) -> -OrientationBiasUtils.getGenotypeDouble(g, OrientationBiasFilterConstants.P_ARTIFACT_FIELD_NAME, 0.0)) .thenComparingInt(g -> g.hashCode()); final Map<String, SortedMap<Genotype, VariantContext>> sampleNameToVariants = new HashMap<>(); final ProgressMeter customProgressMeter = new ProgressMeter(0.1); customProgressMeter.start(); <START> for (final String sampleName: sampleNames) { <END> final SortedMap<Genotype, VariantContext> genotypesToConsiderForFiltering = new TreeMap<>(genotypePArtifactComparator); for (final VariantContext vc : variants) { vc.getGenotypes(sampleName).forEach( genotype -> { if (!vc.isFiltered() && !genotype.isFiltered() && (genotype.getAnyAttribute(OrientationBiasFilterConstants.IS_ORIENTATION_BIAS_ARTIFACT_MODE).equals(String.valueOf(true)) || genotype.getAnyAttribute(OrientationBiasFilterConstants.IS_ORIENTATION_BIAS_RC_ARTIFACT_MODE).equals(String.valueOf(true))) ) { genotypesToConsiderForFiltering.put(genotype, vc); } }); customProgressMeter.update(new SimpleInterval(vc.getContig(), vc.getStart(), vc.getEnd())); } sampleNameToVariants.put(sampleName, genotypesToConsiderForFiltering); } customProgressMeter.stop(); return sampleNameToVariants; }</code><technical_language>space colon</technical_language>

Target:
public static Map<String, SortedMap<Genotype, VariantContext>> createSampleToGenotypeVariantContextSortedMap(final List<String> sampleNames, final Collection<VariantContext> variants) { final Comparator<Genotype> genotypePArtifactComparator = Comparator .comparingDouble((Genotype g) -> -OrientationBiasUtils.getGenotypeDouble(g, OrientationBiasFilterConstants.P_ARTIFACT_FIELD_NAME, 0.0)) .thenComparingInt(g -> g.hashCode()); final Map<String, SortedMap<Genotype, VariantContext>> sampleNameToVariants = new HashMap<>(); final ProgressMeter customProgressMeter = new ProgressMeter(0.1); customProgressMeter.start(); for (final String sampleName : sampleNames) { final SortedMap<Genotype, VariantContext> genotypesToConsiderForFiltering = new TreeMap<>(genotypePArtifactComparator); for (final VariantContext vc : variants) { vc.getGenotypes(sampleName).stream() .filter(g -> isFilteringCandidate(g, vc)) .forEach(genotype -> genotypesToConsiderForFiltering.put(genotype, vc)); customProgressMeter.update(new SimpleInterval(vc.getContig(), vc.getStart(), vc.getEnd())); } sampleNameToVariants.put(sampleName, genotypesToConsiderForFiltering); } customProgressMeter.stop(); return sampleNameToVariants; }