auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public UnifyResult apply(UnifyRuleCall call) { final MutableAggregate query = (MutableAggregate) call.query; final MutableAggregate target = (MutableAggregate) call.target; if (!(query.getInput() instanceof MutableProject)) { return null; } final MutableProject project = (MutableProject) query.getInput(); if (project.getInput() != target.getInput()) { return null; } final Mappings.TargetMapping mapping = project.getMapping(); if (mapping == null) { return null; } final MutableAggregate aggregate2 = permute(query, project.getInput(), mapping.inverse()); final MutableRel unifiedAggregate = unifyAggregates(aggregate2, target); if (unifiedAggregate == null) { return null; } MutableRel result = unifiedAggregate; <START> <END> if (!Mappings.keepsOrdering(mapping)) { final List<Integer> posList = new ArrayList<>(); final int fieldCount = aggregate2.rowType.getFieldCount(); for (int group: aggregate2.groupSet) { if (mapping.inverse().getTargetOpt(group) != -1) { posList.add(mapping.inverse().getTarget(group)); } } for (int i = posList.size(); i < fieldCount; i++) { posList.add(i); } result = MutableRels.createProject(unifiedAggregate, posList); } return call.result(result); }</code><technical_language>remove empty line</technical_language>

Target:
public UnifyResult apply(UnifyRuleCall call) { final MutableAggregate query = (MutableAggregate) call.query; final MutableAggregate target = (MutableAggregate) call.target; if (!(query.getInput() instanceof MutableProject)) { return null; } final MutableProject project = (MutableProject) query.getInput(); if (project.getInput() != target.getInput()) { return null; } final Mappings.TargetMapping mapping = project.getMapping(); if (mapping == null) { return null; } Mapping inverseMapping = mapping.inverse(); final MutableAggregate aggregate2 = permute(query, project.getInput(), inverseMapping); final MutableRel unifiedAggregate = unifyAggregates(aggregate2, target); if (unifiedAggregate == null) { return null; } MutableRel result = unifiedAggregate; if (!Mappings.keepsOrdering(mapping)) { final List<Integer> posList = new ArrayList<>(); final int fieldCount = aggregate2.rowType.getFieldCount(); for (int group: aggregate2.groupSet) { if (inverseMapping.getTargetOpt(group) != -1) { posList.add(inverseMapping.getTarget(group)); } } for (int i = posList.size(); i < fieldCount; i++) { posList.add(i); } result = MutableRels.createProject(unifiedAggregate, posList); } return call.result(result); }
Source:
<code>public void testClusterSnapshotWithRebalancing() throws Exception { IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE); TestRecordingCommunicationSpi commSpi = TestRecordingCommunicationSpi.spi(ignite); commSpi.blockMessages((node, msg) -> msg instanceof GridDhtPartitionSupplyMessage); startGrid(2); ignite.cluster().setBaselineTopology(ignite.cluster().topologyVersion()); commSpi.waitForBlocked(); IgniteFuture<Void> fut = ignite.snapshot().createSnapshot(SNAPSHOT_NAME); commSpi.stopBlock(true); fut.get(); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(3, SNAPSHOT_NAME); awaitPartitionMapExchange(); <START> assertSnapshotCacheKeys(snp.cache(dfltCacheCfg.getName())); <END> }</code><technical_language>Need check rebalancing finished affinity reassignment is triggered snapshot restore</technical_language>

Target:
public void testClusterSnapshotWithRebalancing() throws Exception { IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE); TestRecordingCommunicationSpi commSpi = TestRecordingCommunicationSpi.spi(ignite); commSpi.blockMessages((node, msg) -> msg instanceof GridDhtPartitionSupplyMessage); startGrid(2); ignite.cluster().setBaselineTopology(ignite.cluster().topologyVersion()); commSpi.waitForBlocked(); IgniteFuture<Void> fut = ignite.snapshot().createSnapshot(SNAPSHOT_NAME); commSpi.stopBlock(true); fut.get(); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(3, SNAPSHOT_NAME); awaitPartitionMapExchange(); checkPartitionMapExchangeFinished(); assertSnapshotCacheKeys(snp.cache(dfltCacheCfg.getName())); }
Source:
<code>int compareTo(byte[] other, int otherOffset, int otherLength) { if (value.hasArray()) { return Binary.compareTwoByteArrays(value.array(), value.arrayOffset() + offset, length, other, otherOffset, otherLength); } <START> byte[] bytes = getBytes(); <END> return Binary.compareTwoByteArrays(bytes, 0, bytes.length, other, otherOffset, otherLength); }</code><technical_language>this change</technical_language>

Target:
int compareTo(byte[] other, int otherOffset, int otherLength) { if (value.hasArray()) { return Binary.compareTwoByteArrays(value.array(), value.arrayOffset() + offset, length, other, otherOffset, otherLength); } { return Binary.compareByteBufferToByteArray(value, offset, length, other, otherOffset, otherLength); } }
Source:
<code>private PageRef getPageRef(SashWindowsMngr sashWindowsManager, EObject emfPageIdentifier) { <START> EList<PageRef> allPageRef = sashWindowsManager.getSashModel().getCurrentSelection().getChildren(); <END> Iterator<PageRef> iterator = allPageRef.iterator(); PageRef pageRef = null; boolean match = false; while (!match && iterator.hasNext()) { PageRef currentPage = iterator.next(); match = currentPage.getEmfPageIdentifier() != null && emfPageIdentifier.equals(currentPage.getEmfPageIdentifier()); if (match) { pageRef = currentPage; } } return pageRef; }</code><technical_language>A SashWindowsManager TabFolders. iterating Active miss some (opened) diagrams reproduce, open 2 diagrams in Papyrus, layout side side, control both. of opened in resulting controlled models (The "active" tab folder)</technical_language>

Target:
private PageRef getPageRef(SashWindowsMngr sashWindowsManager, EObject emfPageIdentifier) { PageRef pageRef = null; boolean match = false; Iterator<Window> windowsIterator = sashWindowsManager.getSashModel().getWindows().iterator(); while (!match && windowsIterator.hasNext()) { Window window = windowsIterator.next(); Iterator<AbstractPanel> panelIterator = window.getChildren().iterator(); while (!match && panelIterator.hasNext()) { pageRef = parseAbstractFolder(panelIterator.next(), emfPageIdentifier); match = pageRef != null; } } return pageRef; }
Source:
<code><START> public static List<FilterEntry> parse(String filters) { <END> List<FilterEntry> ret = new LinkedList<>(); Matcher m = PARSE_PATTERN.matcher(filters); while (m.find()) { log.debug(String.format("parse: handling '%s'", m.group(0))); boolean exclude = "exclude".equals(m.group("exclude")); String event = m.group("event"); String recipient = m.group("recipient"); ret.add(FilterEntry.createEntry(event, exclude, recipient)); } return ret; }</code><technical_language>changed list? this is static array parse. please revert</technical_language>

Target:
public static List<FilterEntry> parse(String filters) { List<FilterEntry> ret = new LinkedList<>(); Matcher m = PARSE_PATTERN.matcher(filters); while (m.find()) { log.debug(String.format("parse: handling '%s'", m.group(0))); boolean exclude = "exclude".equals(m.group("exclude")); String event = m.group("event"); String recipient = m.group("recipient"); String transport = null; String name = null; if ("*".equals(event)) { event = null; } if (!"*".equals(recipient)) { String s[] = recipient.split(":", 2); if (s.length != 2) { throw new RuntimeException( String.format( "Invalid recipient: '%s'", recipient )); } transport = s[0]; name = s[1]; } ret.add(new FilterEntry(event, exclude,transport, name)); } return Collections.unmodifiableList(ret); }
Source:
<code>private void recomputeScheduleCache() { Map<Object, Integer> nextCache = new HashMap<Object, Integer>(); for (Map.Entry<Object, List<AtomicLong>> entry : callCosts.entrySet()) { Object id = entry.getKey(); <START> if (isServiceUser((String)id)) { <END> nextCache.put(id, 0); continue; } AtomicLong value = entry.getValue().get(0); long snapshot = value.get(); int computedLevel = computePriorityLevel(snapshot); nextCache.put(id, computedLevel); } scheduleCacheRef.set(Collections.unmodifiableMap(nextCache)); }</code><technical_language>@tasanuma Thanks for proposal. I concerned corner case if put service users's request priority flow controls. user hdfs is service user, submit big job involve massive RPC request NameNode, other normal users' request postpone serious</technical_language>

Target:
private void recomputeScheduleCache() { Map<Object, Integer> nextCache = new HashMap<Object, Integer>(); for (Map.Entry<Object, List<AtomicLong>> entry : callCosts.entrySet()) { Object id = entry.getKey(); AtomicLong value = entry.getValue().get(0); long snapshot = value.get(); int computedLevel = computePriorityLevel(snapshot, id); nextCache.put(id, computedLevel); } scheduleCacheRef.set(Collections.unmodifiableMap(nextCache)); }
Source:
<code><START> private <T> Optional<T> recast(Optional<?> source) { <END> return (Optional<T>) source; }</code><technical_language>This static</technical_language>

Target:
private static <T> Optional<T> recast(Optional<?> source) { return (Optional<T>) source; }
Source:
<code>public void testPodLogOfApplicationPod() { TestUtils.setUpOcBinary(); ApplicationPodIsRunning applicationPodIsRunning = new ApplicationPodIsRunning(); new WaitUntil(applicationPodIsRunning, TimePeriod.LONG); OpenShiftResource pod = new OpenShiftExplorerView().getOpenShift3Connection().getProject(). getOpenShiftResource(Resource.POD, applicationPodIsRunning.getApplicationPodName()); pod.select(); String podName = pod.getName(); new ContextMenu(OpenShiftLabel.ContextMenu.POD_LOG).select(); ConsoleView consoleView = new ConsoleView(); new WaitUntil(new ConsoleHasText() { @Override public String errorMessage() { return "Console of pod log is not opened"; <START> }}, TimePeriod.NORMAL, false); <END> new WaitUntil(new ConsoleHasNoChange(TimePeriod.getCustom(7)), TimePeriod.VERY_LONG); assertTrue("Console label is incorrect, it should contains project name and pod name.\n" + "but label is: " + consoleView.getConsoleLabel(), consoleView.getConsoleLabel().contains( DatastoreOS3.PROJECT1 + "\\" + podName)); assertTrue("Console text should contain output from EAP runtime", consoleView.getConsoleText().contains("Admin console listening on")); }</code><technical_language>Is errorMessage used, parameter is "false"? means exception thrown I exception message is place errorMessage is used</technical_language>

Target:
public void testPodLogOfApplicationPod() { TestUtils.setUpOcBinary(); ApplicationPodIsRunning applicationPodIsRunning = new ApplicationPodIsRunning(); new WaitUntil(applicationPodIsRunning, TimePeriod.LONG); OpenShiftResource pod = new OpenShiftExplorerView().getOpenShift3Connection().getProject(). getOpenShiftResource(Resource.POD, applicationPodIsRunning.getApplicationPodName()); pod.select(); String podName = pod.getName(); new ContextMenu(OpenShiftLabel.ContextMenu.POD_LOG).select(); ConsoleView consoleView = new ConsoleView(); new WaitUntil(new ConsoleHasSomeText() { @Override public String errorMessage() { return "Console of pod log is not opened or does not have text"; }}, TimePeriod.NORMAL); new WaitUntil(new ConsoleHasNoChange(TimePeriod.getCustom(7)), TimePeriod.VERY_LONG); assertTrue("Console label is incorrect, it should contains project name and pod name.\n" + "but label is: " + consoleView.getConsoleLabel(), consoleView.getConsoleLabel().contains( DatastoreOS3.PROJECT1 + "\\" + podName)); assertTrue("Console text should contain output from EAP runtime", consoleView.getConsoleText().contains("Admin console listening on")); }
Source:
<code>public void testMultiReadSpansSegments() { final long segmentEnd = 5L; addServer(SERVERS.PORT_0); addServer(SERVERS.PORT_1); addServer(SERVERS.PORT_2); bootstrapAllServers(new TestLayoutBuilder() .setEpoch(1L) .addLayoutServer(SERVERS.PORT_0) .addSequencer(SERVERS.PORT_0) .buildSegment() .setStart(0L) .setEnd(segmentEnd) .buildStripe() .addLogUnit(SERVERS.PORT_0) .addToSegment() .buildStripe() .addLogUnit(SERVERS.PORT_1) .addToSegment() .addToLayout() .buildSegment() .setStart(segmentEnd) .setEnd(-1L) .buildStripe() .addLogUnit(SERVERS.PORT_1) .addToSegment() .buildStripe() .addLogUnit(SERVERS.PORT_2) .addToSegment() .addToLayout() .build()); getManagementServer(SERVERS.PORT_0).shutdown(); getManagementServer(SERVERS.PORT_1).shutdown(); getManagementServer(SERVERS.PORT_2).shutdown(); CorfuRuntime rt = getRuntime().connect(); final String testString = "hello world "; final long numAddresses = 10L; for (long i = 0L; i < numAddresses; i++) { TokenResponse token = rt.getSequencerView().next(); rt.getAddressSpaceView().write(token, (testString + i).getBytes()); } Map<Long, ILogData> readResult = rt.getAddressSpaceView().read( ContiguousSet.create(Range.closed(0L, numAddresses - 1), DiscreteDomain.longs())); <START> readResult.forEach((addr, data) -> <END> assertThat(data.getPayload(rt)).isEqualTo((testString + addr).getBytes())); }</code><technical_language>Disable caching client test fetchAll. Also, waitForWrite option tested</technical_language>

Target:
public void testMultiReadSpansSegments() { final long segmentEnd = 5L; addServer(SERVERS.PORT_0); addServer(SERVERS.PORT_1); addServer(SERVERS.PORT_2); bootstrapAllServers(new TestLayoutBuilder() .setEpoch(1L) .addLayoutServer(SERVERS.PORT_0) .addSequencer(SERVERS.PORT_0) .buildSegment() .setStart(0L) .setEnd(segmentEnd) .buildStripe() .addLogUnit(SERVERS.PORT_0) .addToSegment() .buildStripe() .addLogUnit(SERVERS.PORT_1) .addToSegment() .addToLayout() .buildSegment() .setStart(segmentEnd) .setEnd(-1L) .buildStripe() .addLogUnit(SERVERS.PORT_1) .addToSegment() .buildStripe() .addLogUnit(SERVERS.PORT_2) .addToSegment() .addToLayout() .build()); getManagementServer(SERVERS.PORT_0).shutdown(); getManagementServer(SERVERS.PORT_1).shutdown(); getManagementServer(SERVERS.PORT_2).shutdown(); CorfuRuntime rt = getRuntime(); rt.setCacheDisabled(true); rt.connect(); final String testString = "hello world "; final long numAddresses = 10L; for (long i = 0L; i < numAddresses; i++) { TokenResponse token = rt.getSequencerView().next(); rt.getAddressSpaceView().write(token, (testString + i).getBytes()); } Map<Long, ILogData> readResult = rt.getAddressSpaceView().read( ContiguousSet.create(Range.closed(0L, numAddresses - 1), DiscreteDomain.longs())); readResult.forEach((addr, data) -> assertThat(data.getPayload(rt)).isEqualTo((testString + addr).getBytes())); }
Source:
<code>public void checkStackButtons() { newWorkspace.waitPageLoad(); newWorkspace.waitQuickStartButton(); newWorkspace.waitStacks(EXPECTED_QUICK_START_STACKS); assertEquals(newWorkspace.getAvailableStacksCount(), EXPECTED_QUICK_START_STACKS_COUNT); newWorkspace.clickOnSingleMachineButton(); newWorkspace.waitStacks(EXPECTED_SINGLE_MACHINE_STACKS); assertEquals(newWorkspace.getAvailableStacksCount(), EXPECTED_SINGLE_MACHINE_STACKS_COUNT); newWorkspace.clickOnAllButton(); newWorkspace.waitStacks(EXPECTED_ALL_STACKS); assertEquals(newWorkspace.getAvailableStacksCount(), EXPECTED_ALL_STACKS_COUNT); newWorkspace.clickOnMultiMachineButton(); newWorkspace.waitStacks(EXPECTED_MULTI_MACHINE_STACKS); assertEquals(newWorkspace.getAvailableStacksCount(), EXPECTED_MULTI_MACHINE_STACKS_COUNT); <START> newWorkspace.clickOnAllButton(); <END> newWorkspace.waitStacks(EXPECTED_SINGLE_MACHINE_STACKS); newWorkspace.waitStacks(EXPECTED_MULTI_MACHINE_STACKS); assertEquals( newWorkspace.getAvailableStacksCount(), EXPECTED_SINGLE_MACHINE_STACKS_COUNT + EXPECTED_MULTI_MACHINE_STACKS_COUNT); newWorkspace.clickOnQuickStartButton(); newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS); newWorkspace.clickNameButton(); try { newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS_REVERSE_ORDER); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } newWorkspace.clickNameButton(); newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS); }</code><technical_language>clear while call of command newWorkspace.clickOnAllButton(); expecting completely result</technical_language>

Target:
public void checkStackButtons() { newWorkspace.waitPageLoad(); newWorkspace.waitQuickStartButton(); newWorkspace.waitStacks(EXPECTED_QUICK_START_STACKS); newWorkspace.waitStacksCount(EXPECTED_QUICK_START_STACKS_COUNT); newWorkspace.clickOnSingleMachineButton(); newWorkspace.waitStacks(EXPECTED_SINGLE_MACHINE_STACKS); newWorkspace.waitStacksCount(EXPECTED_SINGLE_MACHINE_STACKS_COUNT); newWorkspace.clickOnAllButton(); newWorkspace.waitStacks(EXPECTED_ALL_STACKS); newWorkspace.waitStacksCount(EXPECTED_ALL_STACKS_COUNT); newWorkspace.clickOnMultiMachineButton(); newWorkspace.waitStacks(EXPECTED_MULTI_MACHINE_STACKS); newWorkspace.waitStacksCount(EXPECTED_MULTI_MACHINE_STACKS_COUNT); newWorkspace.clickOnAllButton(); newWorkspace.waitStacks(EXPECTED_SINGLE_MACHINE_STACKS); newWorkspace.waitStacks(EXPECTED_MULTI_MACHINE_STACKS); newWorkspace.waitStacksCount( EXPECTED_SINGLE_MACHINE_STACKS_COUNT + EXPECTED_MULTI_MACHINE_STACKS_COUNT); newWorkspace.clickOnQuickStartButton(); newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS); newWorkspace.clickNameButton(); try { newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS_REVERSE_ORDER); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } newWorkspace.clickNameButton(); newWorkspace.waitStacksOrder(EXPECTED_QUICK_START_STACKS); }
Source:
<code><START> public void testProcessQueryGraphQl() throws NoHttpResponseException, URISyntaxException { <END> String query = "{\"query\":\"{ group { edges { node { name commonName description } } } }\",\"variables\":null}"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getQueryType()).thenReturn(QueryType.GRAPHQL_V1_0); when(runner.run(query, user)).thenReturn(response); when(response.getResponseCode()).thenReturn(200); when(response.getBody()).thenReturn("ResponseBody"); }</code><technical_language>This test testing anything</technical_language>

Target:
public void testProcessQueryGraphQl() throws NoHttpResponseException, URISyntaxException { AsyncQuery queryObj = new AsyncQuery(); ElideResponse response = new ElideResponse(200, "ResponseBody"); String query = "{\"query\":\"{ group { edges { node { name commonName description } } } }\",\"variables\":null}"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.GRAPHQL_V1_0); when(runner.run(query, user)).thenReturn(response); AsyncQueryThread queryThread = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, "v1"); queryResultObj = queryThread.processQuery(); assertEquals(queryResultObj.getResponseBody(), "ResponseBody"); assertEquals(queryResultObj.getHttpStatus(), 200); }
Source:
<code>public ScheduledFuture<?> scheduleHealthCheck(final ExecutorDriver driver, final String host, final Integer port) { ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); final Runnable checker = new Runnable() { public void run() { performHealthCheck(host, port, driver); } }; <START> return scheduler.scheduleWithFixedDelay(checker, 120, 30, SECONDS); <END> }</code><technical_language>initial delay recurring delay</technical_language>

Target:
public ScheduledFuture<?> scheduleHealthCheck(final ExecutorDriver driver, final String host, final Integer port) { ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); final Runnable checker = new Runnable() { HttpClient client = HttpClientBuilder.create().build(); HttpGet request = new HttpGet("http://" + host + ":" + port); public void run() { performHealthCheck(host, port, driver, client, request); } }; return scheduler.scheduleWithFixedDelay(checker, 30, 30, SECONDS); }
Source:
<code>public void incrementalSSTableSelection() throws Exception { <START> cfs.setMinimumCompactionThreshold(10); <END> SSTableReader sstable1 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (1, 1)", keyspace, table))); SSTableReader sstable2 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (2, 2)", keyspace, table))); SSTableReader sstable3 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (3, 3)", keyspace, table))); SSTableReader sstable4 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (4, 4)", keyspace, table))); UUID pendingRepair = UUIDGen.getTimeUUID(); long repairedAt = System.currentTimeMillis(); mutateRepaired(sstable2, ActiveRepairService.UNREPAIRED_SSTABLE, pendingRepair, false); mutateRepaired(sstable3, ActiveRepairService.UNREPAIRED_SSTABLE, UUIDGen.getTimeUUID(), false); mutateRepaired(sstable4, repairedAt, NO_PENDING_REPAIR, false); Assert.assertEquals(Sets.newHashSet(sstable1, sstable2, sstable3, sstable4), selectReaders(NO_PENDING_REPAIR)); Assert.assertEquals(Sets.newHashSet(sstable2), selectReaders(pendingRepair)); }</code><technical_language>I cfs.disableAutoCompaction();</technical_language>

Target:
public void incrementalSSTableSelection() throws Exception { cfs.disableAutoCompaction(); SSTableReader sstable1 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (1, 1)", keyspace, table))); SSTableReader sstable2 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (2, 2)", keyspace, table))); SSTableReader sstable3 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (3, 3)", keyspace, table))); SSTableReader sstable4 = createSSTable(() -> QueryProcessor.executeInternal(String.format("INSERT INTO %s.%s (k, v) VALUES (4, 4)", keyspace, table))); UUID pendingRepair = UUIDGen.getTimeUUID(); long repairedAt = System.currentTimeMillis(); mutateRepaired(sstable2, ActiveRepairService.UNREPAIRED_SSTABLE, pendingRepair, false); mutateRepaired(sstable3, ActiveRepairService.UNREPAIRED_SSTABLE, UUIDGen.getTimeUUID(), false); mutateRepaired(sstable4, repairedAt, NO_PENDING_REPAIR, false); Assert.assertEquals(Sets.newHashSet(sstable1, sstable2, sstable3, sstable4), selectReaders(NO_PENDING_REPAIR)); Assert.assertEquals(Sets.newHashSet(sstable2), selectReaders(pendingRepair)); }
Source:
<code>private Optional<MethodExecutor> getMethodExecutor(EvaluationContextExtensionAdapter adapter, String name, List<TypeDescriptor> argumentTypes) { FunctionsMap functions = adapter.getFunctions(); Optional<Function> function = functions.get(name, argumentTypes); <START> return function.map(FunctionMethodExecutor::new); <END> }</code><technical_language>Inline function</technical_language>

Target:
private Optional<MethodExecutor> getMethodExecutor(EvaluationContextExtensionAdapter adapter, String name, List<TypeDescriptor> argumentTypes) { return adapter.getFunctions().get(name, argumentTypes).map(FunctionMethodExecutor::new); }
Source:
<code>public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString) { SaveHandler sh = (SaveHandler) playerFileData; File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "field_75771_c"); <START> MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString)); <END> }</code><technical_language>is a reason srg names split strings.. guess</technical_language>

Target:
public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString) { SaveHandler sh = (SaveHandler) playerFileData; File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "field_"+"75771_c"); MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString)); }
Source:
<code><START> private static String randomId() { <END> byte[] randomBytes = new byte[16]; RANDOM.nextBytes(randomBytes); randomBytes[6] &= 0x0f; randomBytes[6] |= 0x40; randomBytes[8] &= 0x3f; randomBytes[8] |= 0x80; ByteBuffer buffer = ByteBuffer.wrap(randomBytes); long msb = buffer.getLong(0); long lsb = buffer.getLong(8); return new UUID(msb, lsb).toString(); }</code><technical_language>opinion introducing a snowflake ID opposed random? <LINK_0></technical_language>

Target:
public static String randomId() { return Long.toHexString(ThreadLocalRandom.current().nextLong()); }
Source:
<code>public IdentityProvider[] getEnabledAllIdPs() throws IdentityProviderManagementException { try { String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); List<IdentityProvider> identityProviders = IdentityProviderManager.getInstance().getEnabledIdPs (tenantDomain); return identityProviders.toArray(new IdentityProvider[identityProviders.size()]); } catch (IdentityProviderManagementException idpException) { <START> log.error("Error while getting enabled registered Identity providers", idpException); <END> throw idpException; } }</code><technical_language>log tenantDomain if</technical_language>

Target:
public IdentityProvider[] getEnabledAllIdPs() throws IdentityProviderManagementException { String tenantDomain = ""; try { tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); List<IdentityProvider> identityProviders = IdentityProviderManager.getInstance().getEnabledIdPs (tenantDomain); return identityProviders.toArray(new IdentityProvider[identityProviders.size()]); } catch (IdentityProviderManagementException idpException) { log.error("Error while getting enabled registered Identity providers in tenantDomain : " + tenantDomain, idpException); throw idpException; } }
Source:
<code>public void disconnect() throws IOException { <START> channel.close(); <END> connection.close(); }</code><technical_language>changed try { channel.close(); } catch (IOException e) { //ignore } try { connection.close(); } catch (IOException e) { //ignore }</technical_language>

Target:
public void disconnect(){ try { channel.close(); } catch (IOException e) { e.printStackTrace(); } try { connection.close(); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public Publisher(PublisherReverseResolver repositoryNameLookup, PublisherPackFactory packFactory, SessionGenerator generator) { sessions = new HashMap<String, PublisherSession>(); pushStream = new PublisherStream(); <START> sessionDeleter = new ScheduledThreadPoolExecutor(1); <END> sessionLifetime = DEFAULT_SESSION_GRACE_PERIOD; sessionRollbackCount = DEFAULT_SESSION_ROLLBACK_COUNT; this.repositoryNameLookup = repositoryNameLookup; this.packFactory = packFactory; this.generator = generator; }</code><technical_language>name this thread a daemon thread</technical_language>

Target:
public Publisher(PublisherReverseResolver repositoryNameLookup, PublisherPackFactory packFactory, SessionGenerator generator) { sessions = new HashMap<String, PublisherSession>(); pushStream = new PublisherStream(); sessionDeleter = new ScheduledThreadPoolExecutor( 1, new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setName("SessionDeleter"); t.setDaemon(true); return t; } }); sessionLifetime = DEFAULT_SESSION_GRACE_PERIOD; sessionRollbackCount = DEFAULT_SESSION_ROLLBACK_COUNT; this.repositoryNameLookup = repositoryNameLookup; this.packFactory = packFactory; this.generator = generator; }
Source:
<code>public ConceptName getPreferredName(Locale forLocale) { if (log.isDebugEnabled()) { log.debug("Getting preferred conceptName for locale: " + forLocale); } if (getNames(forLocale).isEmpty()) { log.debug("The locale is {}.", forLocale); return null; } else if (forLocale == null) { <START> log.warn("Locale cannot be null"); <END> return null; } for (ConceptName nameInLocale : getNames(forLocale)) { if (ObjectUtils.nullSafeEquals(nameInLocale.getLocalePreferred(), true)) { return nameInLocale; } } ConceptName bestMatch = null; for (ConceptName nameInLocale : getPartiallyCompatibleNames(forLocale)) { if (ObjectUtils.nullSafeEquals(nameInLocale.getLocalePreferred(), true)) { Locale nameLocale = nameInLocale.getLocale(); if (forLocale.getLanguage().equals(nameLocale.getLanguage())) { return nameInLocale; } else { bestMatch = nameInLocale; } } } if (bestMatch != null) { return bestMatch; } return getFullySpecifiedName(forLocale); }</code><technical_language>Logger message . display concept id locale . change log locale information</technical_language>

Target:
public ConceptName getPreferredName(Locale forLocale) { if (log.isDebugEnabled()) { log.debug("Getting preferred conceptName for locale: " + forLocale); } if (getNames(forLocale).isEmpty()) { log.debug("there are no names defined for concept with id: in the locale: {}", conceptId, forLocale); return null; } else if (forLocale == null) { log.warn("Locale cannot be null"); return null; } for (ConceptName nameInLocale : getNames(forLocale)) { if (ObjectUtils.nullSafeEquals(nameInLocale.getLocalePreferred(), true)) { return nameInLocale; } } ConceptName bestMatch = null; for (ConceptName nameInLocale : getPartiallyCompatibleNames(forLocale)) { if (ObjectUtils.nullSafeEquals(nameInLocale.getLocalePreferred(), true)) { Locale nameLocale = nameInLocale.getLocale(); if (forLocale.getLanguage().equals(nameLocale.getLanguage())) { return nameInLocale; } else { bestMatch = nameInLocale; } } } if (bestMatch != null) { return bestMatch; } return getFullySpecifiedName(forLocale); }
Source:
<code>public ChainedPreferenceStore(IPreferenceStore[] preferenceStores) { Assert.isTrue(preferenceStores != null && preferenceStores.length > 0); fPreferenceStores= new IPreferenceStore[preferenceStores.length]; System.arraycopy(preferenceStores, 0, fPreferenceStores, 0, preferenceStores.length); for (IPreferenceStore <START> fPreferenceStore : <END> fPreferenceStores) { PropertyChangeListener listener= new PropertyChangeListener(fPreferenceStore); fChildListeners.add(listener); } }</code><technical_language>rename store</technical_language>

Target:
public ChainedPreferenceStore(IPreferenceStore[] preferenceStores) { Assert.isTrue(preferenceStores != null && preferenceStores.length > 0); fPreferenceStores= new IPreferenceStore[preferenceStores.length]; System.arraycopy(preferenceStores, 0, fPreferenceStores, 0, preferenceStores.length); for (IPreferenceStore store : fPreferenceStores) { PropertyChangeListener listener= new PropertyChangeListener(store); fChildListeners.add(listener); } }
Source:
<code>private List<SourceFile> generateSourceFiles(DescriptorLanguage descriptorLanguage) throws IOException { String resourceFilePath; String dockstorePath; SourceFile.TypeEnum type; if (descriptorLanguage == CWL) { resourceFilePath = "tar-param.cwl"; dockstorePath = "/Dockstore.cwl"; type = SourceFile.TypeEnum.DOCKSTORE_CWL; } else if (descriptorLanguage == WDL) { resourceFilePath = "hello.wdl"; dockstorePath = "/Dockstore.wdl"; type = SourceFile.TypeEnum.DOCKSTORE_WDL; } else { <START> throw new CustomWebApplicationException("Only wdl and cwl are an option", HttpStatus.SC_BAD_REQUEST); <END> } SourceFile descriptorFile = new SourceFile(); descriptorFile .setContent(FileUtils.readFileToString(new File(ResourceHelpers.resourceFilePath(resourceFilePath)), StandardCharsets.UTF_8)); descriptorFile.setType(type); descriptorFile.setPath(dockstorePath); descriptorFile.setAbsolutePath(dockstorePath); SourceFile dockerfile = new SourceFile(); dockerfile.setContent("FROM ubuntu:latest"); dockerfile.setType(SourceFile.TypeEnum.DOCKERFILE); dockerfile.setPath("/Dockerfile"); dockerfile.setAbsolutePath("/Dockerfile"); return Lists.newArrayList(descriptorFile, dockerfile); }</code><technical_language>WDL CWL..</technical_language>

Target:
private List<SourceFile> generateSourceFiles(DescriptorLanguage descriptorLanguage) throws IOException { String resourceFilePath; String dockstorePath; SourceFile.TypeEnum type; if (descriptorLanguage == CWL) { resourceFilePath = "tar-param.cwl"; dockstorePath = "/Dockstore.cwl"; type = SourceFile.TypeEnum.DOCKSTORE_CWL; } else if (descriptorLanguage == WDL) { resourceFilePath = "hello.wdl"; dockstorePath = "/Dockstore.wdl"; type = SourceFile.TypeEnum.DOCKSTORE_WDL; } else { throw new CustomWebApplicationException("Only WDL and CWL are an option", HttpStatus.SC_BAD_REQUEST); } SourceFile descriptorFile = new SourceFile(); descriptorFile .setContent(FileUtils.readFileToString(new File(ResourceHelpers.resourceFilePath(resourceFilePath)), StandardCharsets.UTF_8)); descriptorFile.setType(type); descriptorFile.setPath(dockstorePath); descriptorFile.setAbsolutePath(dockstorePath); SourceFile dockerfile = new SourceFile(); dockerfile.setContent("FROM ubuntu:latest"); dockerfile.setType(SourceFile.TypeEnum.DOCKERFILE); dockerfile.setPath("/Dockerfile"); dockerfile.setAbsolutePath("/Dockerfile"); return Lists.newArrayList(descriptorFile, dockerfile); }
Source:
<code>public void shouldExtractPastTikaWriteLimitIfConfigured() throws Exception { int stringLength = DEFAULT_TIKA_WRITE_LIMIT + 1; String rndString = randomString(stringLength); File tempFile = File.createTempFile("tika_extraction_", ".txt"); <START> tempFile.deleteOnExit(); <END> IoUtil.write(rndString, tempFile); SimpleProblems problems = new SimpleProblems(); TextExtractorContext context = new TextExtractorContext(execContext, path(tempFile.getName()), inputProperties, "text/plain", problems); StringTextExtractorOutput output = new StringTextExtractorOutput(); extractor.setWriteLimit(stringLength); extractor.extractFrom(new FileInputStream(tempFile), output, context); assertTrue(problems.toString(), problems.isEmpty()); assertEquals(rndString, output.toString()); }</code><technical_language>In general, I try avoid deleteOnExit() method. in (at older JVMs) this method is called, file is guaranteed removed in situations platforms. then, is called VM terminates (which for case means end of Surefire run of tests in modeshape-jcr, possibly build if tests forked a separate process.) Plus, is inefficient of JVM records this file needs deleted (IIRC, this information is in native memory.) WDYT a try-finally block simply calling tempFile.delete()' in finally block</technical_language>

Target:
public void shouldExtractPastTikaWriteLimitIfConfigured() throws Exception { int stringLength = DEFAULT_TIKA_WRITE_LIMIT + 1; String rndString = randomString(stringLength); File tempFile = File.createTempFile("tika_extraction_", ".txt"); try { IoUtil.write(rndString, tempFile); SimpleProblems problems = new SimpleProblems(); TextExtractorContext context = new TextExtractorContext(execContext, path(tempFile.getName()), inputProperties, "text/plain", problems); StringTextExtractorOutput output = new StringTextExtractorOutput(); extractor.setWriteLimit(stringLength); extractor.extractFrom(new FileInputStream(tempFile), output, context); assertTrue(problems.toString(), problems.isEmpty()); assertEquals(rndString, output.toString()); } finally { tempFile.delete(); } }
Source:
<code><START> public int getPlacementPriority(BlockStateHolder block) { <END> if (Blocks.shouldPlaceLate(block.getBlockType())) { return 1; } else if (Blocks.shouldPlaceLast(block.getBlockType())) { return 2; } else if (Blocks.shouldPlaceFinal(block.getBlockType())) { return 3; } else { return 0; } }</code><technical_language>I nice turn this enum, PlacementPriority: java enum PlacementPriority { FIRST, LAST, LATE, FINAL } This a more readable. Another option extract numbers fields, magic numbers around. hard 1 2 in srcPriority == 1 || srcPriority == 2 below</technical_language>

Target:
private PlacementPriority getPlacementPriority(BlockStateHolder block) { return priorityMap.getOrDefault(block.getBlockType(), PlacementPriority.FIRST); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_visit_dashboard); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } Intent intent = getIntent(); VisitDashboardFragment visitDashboardFragment = (VisitDashboardFragment) getSupportFragmentManager().findFragmentById(R.id.visitDashboardContentFrame); if (visitDashboardFragment == null) { visitDashboardFragment = VisitDashboardFragment.newInstance(); } <START> addFragmentToActivity(getSupportFragmentManager(), <END> visitDashboardFragment, R.id.visitDashboardContentFrame); mPresenter = new VisitDashboardPresenter(visitDashboardFragment, intent); }</code><technical_language>check if fragment added</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_visit_dashboard); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } Intent intent = getIntent(); VisitDashboardFragment visitDashboardFragment = (VisitDashboardFragment) getSupportFragmentManager().findFragmentById(R.id.visitDashboardContentFrame); if (visitDashboardFragment == null) { visitDashboardFragment = VisitDashboardFragment.newInstance(); } if (!visitDashboardFragment.isActive()) { addFragmentToActivity(getSupportFragmentManager(), visitDashboardFragment, R.id.visitDashboardContentFrame); } mPresenter = new VisitDashboardPresenter(visitDashboardFragment, intent.getLongExtra(ApplicationConstants.BundleKeys.VISIT_ID, 0)); }
Source:
<code>private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, String settingXML, boolean skipProjectDepCreation, String goal, Map<Path, InputStream> override) { WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath); AFCompiler compiler = getCompiler(projectPath); CompilationRequest req; if(settingXML != null) { req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{MavenCLIArgs.ALTERNATE_USER_SETTINGS + settingXML, goal}, skipProjectDepCreation); }else{ req = new DefaultCompilationRequest(mavenRepoPath, info, new String[]{goal}, skipProjectDepCreation); <START> } <END> return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req, override)), executor); }</code><technical_language>I noticed this part of code duplicated, inline private method? getCompilationRequest(String mavenSettingPath)</technical_language>

Target:
private CompletableFuture<KieCompilationResponse> internalBuild(Path projectPath, String mavenRepoPath, String settingXML, boolean skipProjectDepCreation, String goal, Map<Path, InputStream> override) { WorkspaceCompilationInfo info = new WorkspaceCompilationInfo(projectPath); AFCompiler compiler = getCompiler(projectPath); CompilationRequest req; if (settingXML != null) { req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[]{MavenCLIArgs.ALTERNATE_USER_SETTINGS + settingXML, goal}); } else { req = getDefaultRequest(mavenRepoPath, info, skipProjectDepCreation, new String[]{goal}); } return CompletableFuture.supplyAsync(() -> ((KieCompilationResponse) compiler.compile(req, override)), executor); }
Source:
<code>void removeRelation (int type, Accessible target) { AccessibleObject <START> accessibleObject = <END> target.getAccessibleObject(); if (accessibleObject!= null) { OS.atk_object_remove_relationship (handle, toATKRelation(type), accessibleObject.handle); } }</code><technical_language>Renamed targetAccessibleObject for 2 reasons: 1) Duplicate code exact duplicate, easy compare/change if necessary. 2) Confusingly, enclosing type is AccessibleObject. A longer variable name clarify code does</technical_language>

Target:
void removeRelation (int type, Accessible target) { AccessibleObject targetAccessibleObject = target.getAccessibleObject(); if (targetAccessibleObject != null) { OS.atk_object_remove_relationship (handle, toATKRelation(type), targetAccessibleObject.handle); } }
Source:
<code><START> public Reader createReader(RuntimeContainer container) { <END> return new CouchbaseReader(container, this); }</code><technical_language>do: public Reader<IndexedRecord> createReader</technical_language>

Target:
public Reader<IndexedRecord> createReader(RuntimeContainer container) { return new CouchbaseReader(container, this); }
Source:
<code>public static void populate(Object object, Map<String, String> values) throws Exception { final Map<String, String> clonedValues = new HashMap<String, String>(values); final Set<String> candidates = new HashSet<String>(); final Class<?> clazz = object.getClass(); for (Method candidate : clazz.getMethods()) { String methodName = candidate.getName(); if (methodName.matches("^set[A-Z].*") && candidate.getReturnType().equals(Void.TYPE) && candidate.getParameterTypes().length == 1) { candidate.setAccessible(true); String propertyName = methodName.substring(3, 4).toLowerCase() + methodName.substring(4); candidates.add(propertyName); if (clonedValues.containsKey(propertyName)) { <START> if (shouldBeTrimmed(clazz, propertyName)) <END> { String trimmed = MultilineTrimmer.trim(clonedValues.get(propertyName)); clonedValues.put(propertyName, trimmed); } candidate.invoke( object, convert(candidate.getParameterTypes()[0], clonedValues.get(propertyName))); clonedValues.remove(propertyName); } } } if(!clonedValues.isEmpty()) { log.warning( "Configuration contain properties not supported by the backing object " + clazz.getName() + "\n" + "Unused property entries: " + clonedValues + "\n" + "Supported property names: " + candidates); } }</code><technical_language>@Multiline check Setter method, Field name Setter</technical_language>

Target:
public static void populate(Object object, Map<String, String> values) throws Exception { final Map<String, String> clonedValues = new HashMap<String, String>(values); final Set<String> candidates = new HashSet<String>(); final Class<?> clazz = object.getClass(); for (Method candidate : clazz.getMethods()) { if (isSetter(candidate)) { candidate.setAccessible(true); final String methodName = candidate.getName(); String propertyName = methodName.substring(3, 4).toLowerCase() + methodName.substring(4); candidates.add(propertyName); if (clonedValues.containsKey(propertyName)) { if (shouldBeTrimmed(candidate)) { String trimmed = MultilineTrimmer.trim(clonedValues.get(propertyName)); clonedValues.put(propertyName, trimmed); } candidate.invoke( object, convert(candidate.getParameterTypes()[0], clonedValues.get(propertyName))); clonedValues.remove(propertyName); } } } if(!clonedValues.isEmpty()) { log.warning( "Configuration contain properties not supported by the backing object " + clazz.getName() + "\n" + "Unused property entries: " + clonedValues + "\n" + "Supported property names: " + candidates); } }
Source:
<code>public long getLastModified(String src) { if (getCheckPeriod() < 0) return 1; URLConnection conn = null; try { final URL url = getExtendletContext().getResource(src); if (url != null) { conn = url.openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } } catch (Throwable ex) { } finally { if (conn != null) { try { conn.getInputStream().close(); <START> } catch (Exception ignored) { } <END> } } return -1; }</code><technical_language>log</technical_language>

Target:
public long getLastModified(String src) { if (getCheckPeriod() < 0) return 1; URLConnection conn = null; try { final URL url = getExtendletContext().getResource(src); if (url != null) { conn = url.openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } } catch (Throwable ex) { } finally { if (conn != null) { try { conn.getInputStream().close(); } catch (Throwable e) { log.warn("The connection cannot be closed", e); } } } return -1; }
Source:
<code>public final void connectServers(final AbstractServerWebSocketHandler parent) { try { createAndAddConnection(parent, isConnectionLocal(), "srl02.tamu.edu", PORT, this.isSecure(), SubmissionClientWebSocket.class); } catch (ConnectionException e) { <START> LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); <END> } }</code><technical_language>change error</technical_language>

Target:
public final void connectServers(final AbstractServerWebSocketHandler parent) { try { createAndAddConnection(parent, isConnectionLocal(), "srl02.tamu.edu", PORT, this.isSecure(), SubmissionClientWebSocket.class); } catch (ConnectionException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } }
Source:
<code>protected void cleanup() { try { try { epollFd.close(); } catch (IOException e) { logger.warn("Failed to close the epoll fd.", e); } try { WAKEN_UP_UPDATER.compareAndSet(this, WAKEUP_ALLOWED, WAKEUP_NOT_ALLOWED); <START> while (wakenUp != WAKEUP_NOT_ALLOWED) { } <END> eventFd.close(); } catch (IOException e) { logger.warn("Failed to close the event fd.", e); } try { timerFd.close(); } catch (IOException e) { logger.warn("Failed to close the timer fd.", e); } } finally { if (iovArray != null) { iovArray.release(); iovArray = null; } if (datagramPacketArray != null) { datagramPacketArray.release(); datagramPacketArray = null; } events.free(); } }</code><technical_language>put loop if block? i.e. java if (!WAKEN_UP_UPDATER.compareAndSet... ) { // Busy loop ... while (wakenup != WAKEUP_NOT_ALLOWED) { } }</technical_language>

Target:
protected void cleanup() { try { try { epollFd.close(); } catch (IOException e) { logger.warn("Failed to close the epoll fd.", e); } try { if (!WAKEN_UP_UPDATER.compareAndSet(this, WAKEUP_ALLOWED, WAKEUP_NOT_ALLOWED)) { while (wakenUp != WAKEUP_NOT_ALLOWED) { } } eventFd.close(); } catch (IOException e) { logger.warn("Failed to close the event fd.", e); } try { timerFd.close(); } catch (IOException e) { logger.warn("Failed to close the timer fd.", e); } } finally { if (iovArray != null) { iovArray.release(); iovArray = null; } if (datagramPacketArray != null) { datagramPacketArray.release(); datagramPacketArray = null; } events.free(); } }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.getClass().getSimpleName()); sb.append("["); if (outputModuleId != null) { sb.append(outputModuleId); sb.append("."); sb.append(outputName); } if (reference != null) { <START> sb.append(reference); <END> } sb.append("->"); sb.append(inputName); sb.append("]"); return sb.toString(); }</code><technical_language>reference concatenated w/o a separator. Is this intended</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.getClass().getSimpleName()); sb.append("["); if (outputModuleId != null) { sb.append(outputModuleId); sb.append("."); sb.append(outputName); } if (reference != null) { sb.append("("); sb.append(reference); sb.append(")"); } sb.append("->"); sb.append(inputName); sb.append("]"); return sb.toString(); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse) || monitoringDisabled || !instanceEnabled) { chain.doFilter(request, response); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; final HttpServletResponse httpResponse = (HttpServletResponse) response; <START> if (httpRequest.getRequestURI().endsWith(getMonitoringUrl(httpRequest))) { <END> doMonitoring(httpRequest, httpResponse); return; } if (!httpCounter.isDisplayed() || isRequestExcluded((HttpServletRequest) request)) { chain.doFilter(request, response); return; } doFilter(chain, httpRequest, httpResponse); }</code><technical_language>This is a bit dangerous, match *anything* is /monitoring. Example /myapp/roadmap/monitoring ... end in JavaMelody instead of displaying (example) monitoring stations of a road-map :-)</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse) || monitoringDisabled || !instanceEnabled) { chain.doFilter(request, response); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; final HttpServletResponse httpResponse = (HttpServletResponse) response; if (httpRequest.getRequestURI().equals(getMonitoringUrl(httpRequest)) || (Parameters.getMonitoringPathAuthenticated() != null && httpRequest.getRequestURI().equals(getMonitoringPathAuthenticated(httpRequest)))) { doMonitoring(httpRequest, httpResponse); return; } if (!httpCounter.isDisplayed() || isRequestExcluded((HttpServletRequest) request)) { chain.doFilter(request, response); return; } doFilter(chain, httpRequest, httpResponse); }