auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public MockRemoteTask createTableScanTask(TaskId taskId, Node newNode, List<Split> splits, PartitionedSplitCountTracker partitionedSplitCountTracker) { Symbol symbol = new Symbol("column"); PlanNodeId sourceId = new PlanNodeId("sourceId"); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("test"), new TableScanNode( sourceId, new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(sourceId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), <START> emptyMap(), <END> emptyMap()); ImmutableMultimap.Builder<PlanNodeId, Split> initialSplits = ImmutableMultimap.builder(); for (Split sourceSplit : splits) { initialSplits.put(sourceId, sourceSplit); } return createRemoteTask(TEST_SESSION, taskId, newNode, testFragment, initialSplits.build(), OptionalInt.empty(), createInitialEmptyOutputBuffers(BROADCAST), partitionedSplitCountTracker, true); }</code><technical_language>prefer ImmutableMap.of() code</technical_language>

Target:
public MockRemoteTask createTableScanTask(TaskId taskId, Node newNode, List<Split> splits, PartitionedSplitCountTracker partitionedSplitCountTracker) { Symbol symbol = new Symbol("column"); PlanNodeId sourceId = new PlanNodeId("sourceId"); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("test"), new TableScanNode( sourceId, new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(sourceId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), StageExecutionStrategy.ungroupedExecution(), StatsAndCosts.empty()); ImmutableMultimap.Builder<PlanNodeId, Split> initialSplits = ImmutableMultimap.builder(); for (Split sourceSplit : splits) { initialSplits.put(sourceId, sourceSplit); } return createRemoteTask(TEST_SESSION, taskId, newNode, testFragment, initialSplits.build(), OptionalInt.empty(), createInitialEmptyOutputBuffers(BROADCAST), partitionedSplitCountTracker, true); }
Source:
<code>public SummarizerConfiguration build() { return new SummarizerConfiguration(className, configId, <START> Collections.unmodifiableMap(imBuilder)); <END> }</code><technical_language>This behavior. If calls addOption builder calling build modify map. set imBuilder null prevent future use. call Map.copyOf</technical_language>

Target:
public SummarizerConfiguration build() { return new SummarizerConfiguration(className, configId, imBuilder.build()); }
Source:
<code>public void onStatusUpdate(QpidStatus oldStatus, QpidStatus newStatus) { if (oldStatus.equals(newStatus)) { return; } Reason reason; if (QpidStatus.CONNECTED.equals(newStatus)) { reason = Reason.QPID_UP; } else if (QpidStatus.DOWN.equals(newStatus)) { reason = Reason.QPID_DOWN; } else if (QpidStatus.FLOW_STOPPED.equals(newStatus)) { reason = Reason.QPID_FLOW_STOPPED; } else { <START> String msg = String.format("Could not transition candlpin mode: Unknown Qpid status: %s", <END> newStatus); throw new IllegalArgumentException(msg); } transitionAppropriately(reason); }</code><technical_language>typo here: candlpin -> Candlepin</technical_language>

Target:
public void onStatusUpdate(QpidStatus oldStatus, QpidStatus newStatus) { if (oldStatus.equals(newStatus)) { return; } Reason reason; if (QpidStatus.CONNECTED.equals(newStatus)) { reason = Reason.QPID_UP; } else if (QpidStatus.DOWN.equals(newStatus)) { reason = Reason.QPID_DOWN; } else if (QpidStatus.FLOW_STOPPED.equals(newStatus)) { reason = Reason.QPID_FLOW_STOPPED; } else { String msg = String.format("Could not transition candlepin mode: Unknown Qpid status: %s", newStatus); throw new IllegalArgumentException(msg); } transitionAppropriately(reason); }
Source:
<code>public DbSimpleImportCommandBuilder db_columns(String[] db_columns) { <START> node.put("db_columns", Arrays.toString(db_columns).replaceAll("\\[", "").replaceAll("\\]", "")); <END> return this; }</code><technical_language>this replace instance of [ instance of ]. is small utility StringBuilder do this stuff</technical_language>

Target:
public DbSimpleImportCommandBuilder db_columns(String[] db_columns) { String dbCols = Arrays.toString(db_columns); node.put("db_columns", dbCols.substring(1, dbCols.length()-1)); return this; }
Source:
<code>void handleContainerLaunch(SamzaResourceRequest request, String preferredHost, SamzaResource allocatedResource, ResourceRequestState resourceRequestState, ContainerAllocator allocator) { <START> if (getControlActionMetadata(request.getProcessorId()).isPresent()) { <END> handleContainerAllocationForExistingControlAction(request.getProcessorId(), allocator, resourceRequestState, request, preferredHost); } else if (this.standbyContainerManager.isPresent()) { standbyContainerManager.get() .checkStandbyConstraintsAndRunStreamProcessor(request, preferredHost, allocatedResource, allocator, resourceRequestState); } else { allocator.runStreamProcessor(request, preferredHost); } }</code><technical_language>expose a suitable method e.g., isControlActionRequest(request) (perhaps a wrapper getControlActionMetadata), logic more understanbable if need add additional validations (e.g., timestamp based) add there</technical_language>

Target:
boolean handleContainerLaunch(SamzaResourceRequest request, String preferredHost, SamzaResource allocatedResource, ResourceRequestState resourceRequestState, ContainerAllocator allocator) { if (hasActiveContainerPlacementAction(request.getProcessorId())) { String processorId = request.getProcessorId(); ContainerPlacementMetadata actionMetaData = getPlacementActionMetadata(processorId).get(); ContainerPlacementMetadata.ContainerStatus actionStatus = actionMetaData.getContainerStatus(); if (samzaApplicationState.runningProcessors.containsKey(processorId) && actionStatus == ContainerPlacementMetadata.ContainerStatus.RUNNING) { LOG.info("Requesting running container to shutdown due to existing container placement action {}", actionMetaData); actionMetaData.setContainerStatus(ContainerPlacementMetadata.ContainerStatus.STOP_IN_PROGRESS); clusterResourceManager.stopStreamProcessor(samzaApplicationState.runningProcessors.get(processorId)); return false; } else if (actionStatus == ContainerPlacementMetadata.ContainerStatus.STOP_IN_PROGRESS) { LOG.info("Waiting for running container to shutdown due to existing container placement action {}", actionMetaData); return false; } else if (actionStatus == ContainerPlacementMetadata.ContainerStatus.STOPPED) { allocator.runStreamProcessor(request, preferredHost); return true; } } if (this.standbyContainerManager.isPresent()) { standbyContainerManager.get() .checkStandbyConstraintsAndRunStreamProcessor(request, preferredHost, allocatedResource, allocator, resourceRequestState); } else { allocator.runStreamProcessor(request, preferredHost); } return true; }
Source:
<code>public CompletableFuture<V> getAsync(K key) { return failsafe(retryPolicy, retryMetrics, retryExecutor) <START> .future(k -> readFn.getAsync(key)) <END> .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key + " after retries.", e); }); }</code><technical_language>is this k? I this a callable</technical_language>

Target:
public CompletableFuture<V> getAsync(K key) { return failsafe(retryPolicy, retryMetrics, retryExecutor) .future(() -> readFn.getAsync(key)) .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key + " after retries.", e); }); }
Source:
<code>private void setProperty(String partitionName, CustomizedStateProperty property, String value) { Map<String, Map<String, String>> mapFields = _record.getMapFields(); <START> if (mapFields.get(partitionName) == null) { <END> mapFields.put(partitionName, new TreeMap<String, String>()); } mapFields.get(partitionName).put(property.name(), value); }</code><technical_language>mapFields.putIfAbsent() do simpler</technical_language>

Target:
private void setProperty(String partitionName, CustomizedStateProperty property, String value) { Map<String, Map<String, String>> mapFields = _record.getMapFields(); mapFields.putIfAbsent(partitionName, new TreeMap<String, String>()); mapFields.get(partitionName).put(property.name(), value); }
Source:
<code>public void testUsingDefaultConfigurationFileDebugLogging() { ByteArrayOutputStream output = new ByteArrayOutputStream(); PrintStream outputStream = new PrintStream(output); PrintStream originalStream = System.out; System.setOut(outputStream); final Request request = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/Accounts/AC123/Messages/MM123.json"); request.addHeaderParam("Authorization", "authorization value"); request.addHeaderParam("Test Header", "test value"); TwilioRestClient twilioRestClient = Twilio.getRestClient(); twilioRestClient.logRequest(request); System.out.flush(); System.setOut(originalStream); Assert.assertTrue(output.toString().isEmpty()); <START> } <END></code><technical_language>nit: duplicate code in tests: java ByteArrayOutputStream output = new ByteArrayOutputStream(); PrintStream outputStream = new PrintStream(output); PrintStream originalStream = System.out; System.setOut(outputStream); java TwilioRestClient twilioRestClient = Twilio.getRestClient(); twilioRestClient.logRequest(request); System.out.flush(); System.setOut(originalStream);</technical_language>

Target:
public void testUsingDefaultConfigurationFileDebugLogging() { logCapturingSetup(); final Request request = new Request(HttpMethod.GET, Domains.API.toString(), "/2010-04-01/Accounts/AC123/Messages/MM123.json"); request.addHeaderParam("Authorization", "authorization value"); request.addHeaderParam("Test Header", "test value"); finishLogCapturingSetup(request); Assert.assertTrue(output.toString().isEmpty()); }
Source:
<code>protected void ensureDetailFormCreated() { if (getDetailForm() != null) { return; } IForm form; if (isTileOverviewVisible()) { <START> form = new P_TileOverviewForm(); <END> } else { form = createDetailForm(); } if (form != null) { setDetailForm(form); interceptInitDetailForm(); } }</code><technical_language>createTileOverviewForm()</technical_language>

Target:
protected void ensureDetailFormCreated() { if (getDetailForm() != null) { return; } IForm form; if (isUseTileOverview()) { form = createTileOverviewForm(); } else { form = createDetailForm(); } if (form != null) { setDetailForm(form); interceptInitDetailForm(); } }
Source:
<code>public void hardKillWithWaitingRuns() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { LockableResourcesManager.get().createResource("resource1"); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("retry(99) {\n" + " lock('resource1') {\n" + " semaphore('wait-inside')\n" + " }\n" + "}", true)); WorkflowRun prevBuild = null; for (int i = 0; i < 3; i++) { WorkflowRun rNext = p.scheduleBuild2(0).waitForStart(); if (prevBuild != null) { story.j.waitForMessage("[resource1] is locked, waiting...", rNext); Executor ex = prevBuild.getExecutor(); assertNotNull(ex); ex.interrupt(); story.j.waitForMessage("Click here to forcibly terminate running steps", prevBuild); prevBuild.doTerm(); story.j.waitForMessage("Click here to forcibly kill entire build", prevBuild); prevBuild.doKill(); story.j.waitForMessage("Hard kill!", prevBuild); story.j.waitForCompletion(prevBuild); story.j.assertBuildStatus(Result.ABORTED, prevBuild); } story.j.waitForMessage("Lock acquired on [resource1]", rNext); SemaphoreStep.waitForStart("wait-inside/" + (i + 1), rNext); prevBuild = rNext; } prevBuild.doKill(); <START> story.j.assertBuildStatus(Result.ABORTED, story.j.waitForCompletion(prevBuild)); <END> } }); }</code><technical_language>Missing important assert: a new build succeed acquiring lock finish correctly kill unlock dance</technical_language>

Target:
public void hardKillWithWaitingRuns() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { LockableResourcesManager.get().createResource("resource1"); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("retry(99) {\n" + " lock('resource1') {\n" + " semaphore('wait-inside')\n" + " }\n" + "}", true)); WorkflowRun prevBuild = null; for (int i = 0; i < 3; i++) { WorkflowRun rNext = p.scheduleBuild2(0).waitForStart(); if (prevBuild != null) { story.j.waitForMessage("[resource1] is locked, waiting...", rNext); interruptTermKill(prevBuild); } story.j.waitForMessage("Lock acquired on [resource1]", rNext); SemaphoreStep.waitForStart("wait-inside/" + (i + 1), rNext); prevBuild = rNext; } SemaphoreStep.success("wait-inside/3", null); story.j.assertBuildStatus(Result.SUCCESS, story.j.waitForCompletion(prevBuild)); } }); }
Source:
<code>private static boolean isSame(final int size, AbstractInsnNode e, AbstractInsnNode n) { for (int i = 0; i < size; i++) { <START> if (e.getOpcode() != n.getOpcode()) { <END> return false; } e = next(e); n = next(n); } return true; }</code><technical_language>checking operands here? for labels</technical_language>

Target:
private static boolean isSame(final int size, AbstractInsnNode e, AbstractInsnNode n) { for (int i = 0; i < size; i++) { if (n == null || e.getOpcode() != n.getOpcode()) { return false; } e = next(e); n = next(n); } return true; }
Source:
<code>private List<RowGroup> createRowGroups( int rowsInStripe, Map<StreamId, Stream> streams, Map<StreamId, ValueInputStream<?>> valueStreams, Map<StreamId, List<RowGroupIndex>> columnIndexes, Set<Integer> selectedRowGroups, List<ColumnEncoding> encodings) throws InvalidCheckpointException { ImmutableList.Builder<RowGroup> rowGroupBuilder = ImmutableList.builder(); for (int rowGroupId : selectedRowGroups) { Map<StreamId, StreamCheckpoint> checkpoints = getStreamCheckpoints(includedOrcColumns, types, decompressor.isPresent(), rowGroupId, encodings, streams, columnIndexes); int rowOffset = rowGroupId * rowsInRowGroup; int rowsInGroup = Math.min(rowsInStripe - rowOffset, rowsInRowGroup); long minAverageRowBytes = columnIndexes <START> .values() <END> .stream() .mapToLong(rowGroupIndexes -> rowGroupIndexes.get(rowGroupId) .getColumnStatistics() .getMinAverageValueSizeInBytes()) .sum(); rowGroupBuilder.add(createRowGroup(rowGroupId, rowOffset, rowsInGroup, minAverageRowBytes, valueStreams, checkpoints)); } return rowGroupBuilder.build(); }</code><technical_language>nit: This change unrelated (although change semantic). I Map<StreamId, List<..>> type for columnIndexes (instead of originally Map<Int, Map<Int, List>>) reorganize changes in small refactor commits in necessary. huge commit mixed small change confusion read history of code :)</technical_language>

Target:
private List<RowGroup> createRowGroups( int rowsInStripe, Map<StreamId, Stream> streams, Map<StreamId, ValueInputStream<?>> valueStreams, Map<StreamId, List<RowGroupIndex>> columnIndexes, Set<Integer> selectedRowGroups, List<ColumnEncoding> encodings) throws InvalidCheckpointException { ImmutableList.Builder<RowGroup> rowGroupBuilder = ImmutableList.builder(); for (int rowGroupId : selectedRowGroups) { Map<StreamId, StreamCheckpoint> checkpoints = getStreamCheckpoints(includedOrcColumns, types, decompressor.isPresent(), rowGroupId, encodings, streams, columnIndexes); int rowOffset = rowGroupId * rowsInRowGroup; int rowsInGroup = Math.min(rowsInStripe - rowOffset, rowsInRowGroup); long minAverageRowBytes = columnIndexes .entrySet() .stream() .mapToLong(e -> e.getValue() .get(rowGroupId) .getColumnStatistics() .getMinAverageValueSizeInBytes()) .sum(); rowGroupBuilder.add(createRowGroup(rowGroupId, rowOffset, rowsInGroup, minAverageRowBytes, valueStreams, checkpoints)); } return rowGroupBuilder.build(); }
Source:
<code>public DefaultClassificationEngine(final ClassificationRuleProvider ruleProvider, final FilterService filterService, final boolean initialize) { this.ruleProvider = Objects.requireNonNull(ruleProvider); this.portClassifiersCache = CacheBuilder.newBuilder().build(new CacheLoader<Integer, List<Classifier>>() { @Override public List<Classifier> load(Integer port) throws Exception { final List<RuleDefinition> ruleDefinitions = rulePortList.get(port); final List<Classifier> classifiers = ruleDefinitions.stream().map(rule -> { if (!ruleClassifierMap.containsKey(rule)) { final DefaultRuleDefinition portRule = new DefaultRuleDefinition(); portRule.setName(rule.getName()); portRule.setProtocol(rule.getProtocol()); portRule.setSrcAddress(rule.getSrcAddress()); portRule.setDstAddress(rule.getDstAddress()); portRule.setExporterFilter(rule.getExporterFilter()); portRule.setGroupPosition(rule.getGroupPosition()); portRule.setPosition(rule.getPosition()); <START> if (rule.hasDstPortDefinition() && rule.hasSrcPortDefinition()) { portRule.setSrcPort(rule.getSrcPort()); } else { if (rule.hasDstPortDefinition()) { portRule.setDstPort(rule.getDstPort()); } if (rule.hasSrcPortDefinition()) { portRule.setSrcPort(rule.getSrcPort()); } } <END> ruleClassifierMap.put(rule, new CombinedClassifier(portRule, filterService)); } return ruleClassifierMap.get(rule); }).collect(Collectors.toList()); return classifiers; } }); if (initialize) { this.reload(); } }</code><technical_language>I missing something? if rule a dst src, set a SrcPort ignores DstPort. code in else present work cases</technical_language>

Target:
public DefaultClassificationEngine(final ClassificationRuleProvider ruleProvider, final FilterService filterService, final boolean initialize) { this.ruleProvider = Objects.requireNonNull(ruleProvider); this.portClassifiersCache = CacheBuilder.newBuilder().build(new CacheLoader<Integer, List<Classifier>>() { @Override public List<Classifier> load(Integer port) throws Exception { final List<RuleDefinition> ruleDefinitions = rulePortList.get(port); final List<Classifier> classifiers = ruleDefinitions.stream().map(rule -> { if (!ruleClassifierMap.containsKey(rule)) { final DefaultRuleDefinition portRule = new DefaultRuleDefinition(); portRule.setName(rule.getName()); portRule.setProtocol(rule.getProtocol()); portRule.setSrcAddress(rule.getSrcAddress()); portRule.setDstAddress(rule.getDstAddress()); portRule.setExporterFilter(rule.getExporterFilter()); portRule.setGroupPosition(rule.getGroupPosition()); portRule.setPosition(rule.getPosition()); if (rule.hasDstPortDefinition()) { portRule.setDstPort(rule.getDstPort()); } if (rule.hasSrcPortDefinition()) { portRule.setSrcPort(rule.getSrcPort()); } ruleClassifierMap.put(rule, new CombinedClassifier(portRule, filterService)); } return ruleClassifierMap.get(rule); }).collect(Collectors.toList()); return classifiers; } }); if (initialize) { this.reload(); } }
Source:
<code>public void visitClass(ClassTree tree) { if (!isBodyOfEnumConstantTree(tree)) { Type superClass = tree.symbol().superClass(); int dit = 0; while (superClass != null) { dit++; superClass = superClass.symbol().superClass(); } if (dit > max) { Tree reportTree = tree.simpleName(); if (tree.parent().is(Tree.Kind.NEW_CLASS)) { reportTree = ((NewClassTree) tree.parent()).newKeyword(); } context.reportIssue(this, reportTree, "This class has " + dit + " parents which is greater than " + max + " authorized.", <START> new ArrayList<JavaFileScannerContext.Location>(), dit - max); <END> } } super.visitClass(tree); }</code><technical_language>Type param removed</technical_language>

Target:
public void visitClass(ClassTree tree) { if (!isBodyOfEnumConstantTree(tree)) { Type superClass = tree.symbol().superClass(); int dit = 0; while (superClass != null) { dit++; superClass = superClass.symbol().superClass(); } if (dit > max) { Tree reportTree = tree.simpleName(); if (tree.parent().is(Tree.Kind.NEW_CLASS)) { reportTree = ((NewClassTree) tree.parent()).newKeyword(); } context.reportIssue(this, reportTree, "This class has " + dit + " parents which is greater than " + max + " authorized.", new ArrayList<>(), dit - max); } } super.visitClass(tree); }
Source:
<code>static String _getRequestBodyForMtsFieldUpdate(List<String> docIds, MetricSchemaRecordList msrList, long currentTimeMillis) { StringBuilder result = new StringBuilder(); for(String docId:docIds) { MetricSchemaRecord record = msrList.getRecord(docId); if (record == null) { _logger.warn("ES create response contains ID that was not in original request", docId); continue; } Integer retention = record.getRetentionDiscovery(); Long expiration = currentTimeMillis + (retention==null? DEFAULT_RETENTION_DISCOVERY_DAYS:retention) * 24L * 3600L * 1000L; <START> <END> result.append("{\"update\" : {\"_id\" : \"").append(docId).append("\" } }") .append(System.lineSeparator()) .append("{\"doc\" : {\"mts\": ").append(currentTimeMillis) .append(",\"").append(EXPIRATION_TS).append("\":").append(expiration); if (retention != null) { result.append(",\"").append(RETENTION_DISCOVERY).append("\":").append(retention); } result.append("}}"); result.append(System.lineSeparator()); } return result.toString(); }</code><technical_language>MILLISECONDS_IN_DAY constant</technical_language>

Target:
static String _getRequestBodyForMtsFieldUpdate(List<String> docIds, MetricSchemaRecordList msrList, long currentTimeMillis) { StringBuilder result = new StringBuilder(); for(String docId:docIds) { MetricSchemaRecord record = msrList.getRecord(docId); if (record == null) { _logger.warn("ES create response contains ID that was not in original request", docId); continue; } Integer retention = record.getRetentionDiscovery(); Long expiration = currentTimeMillis + (retention==null? DEFAULT_RETENTION_DISCOVERY_DAYS:retention) * ONE_DAY_IN_MILLIS; result.append("{\"update\" : {\"_id\" : \"").append(docId).append("\" } }") .append(System.lineSeparator()) .append("{\"doc\" : {\"mts\": ").append(currentTimeMillis) .append(",\"").append(EXPIRATION_TS).append("\":").append(expiration); if (retention != null) { result.append(",\"").append(RETENTION_DISCOVERY).append("\":").append(retention); } result.append("}}"); result.append(System.lineSeparator()); } return result.toString(); }
Source:
<code><START> public List<QualityProfileDto> selectByNameAndLanguages(String name, Collection<String> languageKeys, DbSession session) { <END> return executeLargeInputs(languageKeys, input -> mapper(session).selectByNameAndLanguages(name, input)); }</code><technical_language>![INFO](<LINK_0> 'Severity: INFO') Do forget remove this deprecated code someday. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public List<QualityProfileDto> selectByNameAndLanguages(String name, Collection<String> languageKeys, DbSession session) { return executeLargeInputs(languageKeys, input -> mapper(session).selectByNameAndLanguages(null, name, input)); }
Source:
<code>static <T> T fromBuffer(ByteBuf buf, Class<T> cls) { if (constructorMap.containsKey(cls)) { return (T) constructorMap.get(cls).construct(buf); } if (cls.isEnum()) { try { Map<Byte, T> enumMap = (Map<Byte, T>) cls.getDeclaredField("typeMap").get(null); constructorMap.put(cls, x -> enumMap.get(x.readByte())); return (T) constructorMap.get(cls).construct(buf); } catch (NoSuchFieldException e) { throw new RuntimeException("only enums with a typeMap are supported!"); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } if (!ICorfuPayload.class.isAssignableFrom(cls)) { throw new RuntimeException("Unknown class " + cls + " for deserialization"); } try { Constructor<?> t = cls.getConstructor(ByteBuf.class); MethodHandle mh = lookup.unreflectConstructor(t); MethodType mt = MethodType.methodType(Object.class, ByteBuf.class); try { CallSite metafactory = LambdaMetafactory.metafactory( lookup, "construct", MethodType.methodType(PayloadConstructor.class), mt, mh, mh.type() ); constructorMap.put(cls, (PayloadConstructor<T>) metafactory.getTarget().invokeExact()); return (T) constructorMap.get(cls).construct(buf); } catch (Throwable th) { throw new RuntimeException(th); } } catch (NoSuchMethodException nsme) { <START> throw new RuntimeException("CorfuPayloads must include a ByteBuf constructor! for class: " + cls.toString()); <END> } catch (IllegalAccessException e) { throw new RuntimeException(e); } }</code><technical_language>long line</technical_language>

Target:
static <T> T fromBuffer(ByteBuf buf, Class<T> cls) { if (constructorMap.containsKey(cls)) { return (T) constructorMap.get(cls).construct(buf); } if (cls.isEnum()) { try { Map<Byte, T> enumMap = (Map<Byte, T>) cls.getDeclaredField("typeMap").get(null); constructorMap.put(cls, x -> enumMap.get(x.readByte())); return (T) constructorMap.get(cls).construct(buf); } catch (NoSuchFieldException e) { throw new RuntimeException("only enums with a typeMap are supported!"); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } if (!ICorfuPayload.class.isAssignableFrom(cls)) { throw new RuntimeException("Unknown class " + cls + " for deserialization"); } try { Constructor<?> t = cls.getConstructor(ByteBuf.class); MethodHandle mh = lookup.unreflectConstructor(t); MethodType mt = MethodType.methodType(Object.class, ByteBuf.class); try { CallSite metafactory = LambdaMetafactory.metafactory( lookup, "construct", MethodType.methodType(PayloadConstructor.class), mt, mh, mh.type() ); constructorMap.put(cls, (PayloadConstructor<T>) metafactory.getTarget().invokeExact()); return (T) constructorMap.get(cls).construct(buf); } catch (Throwable th) { throw new RuntimeException(th); } } catch (NoSuchMethodException nsme) { throw new RuntimeException("CorfuPayloads must include a ByteBuf " + "constructor! for class: " + cls.toString()); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
Source:
<code>private static String getRoot() { URL url = io.crate.frameworks.mesos.Main.class.getProtectionDomain().getCodeSource().getLocation(); String jarPath = null; try { jarPath = URLDecoder.decode(url.getFile(), "UTF-8"); } catch (UnsupportedEncodingException e) { <START> e.printStackTrace(); <END> System.exit(2); } return new File(jarPath).getParentFile().getPath(); }</code><technical_language>logger</technical_language>

Target:
private static String getRoot() { URL url = io.crate.frameworks.mesos.Main.class.getProtectionDomain().getCodeSource().getLocation(); String jarPath = null; try { jarPath = URLDecoder.decode(url.getFile(), "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.debug("Could not encode jar file path", e); System.exit(2); } return new File(jarPath).getParentFile().getPath(); }
Source:
<code>public void configure() { if(templateStorage.isUnsatisfied()){ logger.warn("Unable to find template storage implementation, using in memory"); } else { setTemplateStorage(templateStorage.get()); } if(notificationService.isUnsatisfied()) { <START> setNotificationService(notificationService.get()); <END> } else { logger.warn("Unable to find notification service implementation, using logging only"); } }</code><technical_language>a warning log in else branch actual code - setNotificationService(notificationService.get());</technical_language>

Target:
public void configure() { if(templateStorage.isUnsatisfied()){ logger.warn("Unable to find template storage implementation, using in memory"); } else { setTemplateStorage(templateStorage.get()); } if(notificationService.isUnsatisfied()) { logger.warn("Unable to find notification service implementation, using logging only"); } else { setNotificationService(notificationService.get()); } }
Source:
<code>private void manageNetworkConnection(String containerId, String methodname, String networkId) throws DockerException, InterruptedException { final WebTarget resource = resource().path("networks").path(networkId).path(methodname); Map<String, String> request = new HashMap<>(); request.put("Container", containerId); Response response = request(POST, Response.class, resource, resource.request(APPLICATION_JSON_TYPE), Entity.json(request)); switch (response.getStatus()) { case 200: return; case 404: throw new ContainerNotFoundException(containerId); case 500: throw new DockerException(response.readEntity(String.class)); } <START> System.out.println(response.getStatus()); <END> }</code><technical_language>Extraneous debugging statement</technical_language>

Target:
private void manageNetworkConnection(String containerId, String methodname, String networkId) throws DockerException, InterruptedException { final WebTarget resource = resource().path("networks").path(networkId).path(methodname); Map<String, String> request = new HashMap<>(); request.put("Container", containerId); Response response = request(POST, Response.class, resource, resource.request(APPLICATION_JSON_TYPE), Entity.json(request)); switch (response.getStatus()) { case 200: return; case 404: throw new ContainerNotFoundException(containerId); case 500: throw new DockerException(response.readEntity(String.class)); } }
Source:
<code>public static void fillImagesMapBasedOnTemplate(VmTemplate template, List<StorageDomain> domains, Map<Guid, DiskImage> diskInfoDestinationMap, Map<Guid, StorageDomain> destStorages) { Map<Guid, StorageDomain> storageDomainsMap = domains.stream().filter(ImagesHandler::isDomainValidDestination) <START> .collect(Collectors.toMap(d -> d.getId(), Function.identity())); <END> for (DiskImage image : template.getDiskTemplateMap().values()) { for (Guid storageId : image.getStorageIds()) { if (storageDomainsMap.containsKey(storageId)) { ArrayList<Guid> storageIds = new ArrayList<>(); storageIds.add(storageId); image.setStorageIds(storageIds); diskInfoDestinationMap.put(image.getId(), image); break; } } } if (destStorages != null) { destStorages.putAll(diskInfoDestinationMap.values().stream() .collect(Collectors.toMap(d -> d.getStorageIds().get(0), d -> storageDomainsMap.get(d.getStorageIds().get(0))))); } }</code><technical_language>StorageDomain::getId</technical_language>

Target:
public static void fillImagesMapBasedOnTemplate(VmTemplate template, List<StorageDomain> domains, Map<Guid, DiskImage> diskInfoDestinationMap, Map<Guid, StorageDomain> destStorages) { Map<Guid, StorageDomain> storageDomainsMap = domains.stream().filter(ImagesHandler::isDomainValidDestination) .collect(Collectors.toMap(StorageDomain::getId, Function.identity())); for (DiskImage image : template.getDiskTemplateMap().values()) { for (Guid storageId : image.getStorageIds()) { if (storageDomainsMap.containsKey(storageId)) { ArrayList<Guid> storageIds = new ArrayList<>(); storageIds.add(storageId); image.setStorageIds(storageIds); diskInfoDestinationMap.put(image.getId(), image); break; } } } if (destStorages != null) { destStorages.putAll(diskInfoDestinationMap.values().stream() .collect(Collectors.toMap(d -> d.getStorageIds().get(0), d -> storageDomainsMap.get(d.getStorageIds().get(0))))); } }
Source:
<code>public ActivationKeyDTO setAddOns(Set<String> addOns) { <START> this.addOns = addOns; <END> return this; }</code><technical_language>decouple inbound collection here. A simple this.addOns = addOns != null ? new HashSet<>(addOns) : null; work</technical_language>

Target:
public ActivationKeyDTO setAddOns(Set<String> addOns) { this.addOns = addOns != null ? new HashSet<>(addOns) : null; return this; }
Source:
<code>public void testGetUnitResource() { YarnConfiguration yarnConfig = new YarnConfiguration(); <START> yarnConfig.set("yarn.resourcemanager.scheduler.class", "org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler"); <END> yarnConfig.setInt("yarn.scheduler.minimum-allocation-mb", 64); yarnConfig.setInt("yarn.scheduler.minimum-allocation-vcores", 1); yarnConfig.setInt("yarn.scheduler.increment-allocation-mb", 1024); yarnConfig.setInt("yarn.scheduler.increment-allocation-vcores", 4); Resource unitResource1 = Utils.getUnitResource(yarnConfig); assertEquals(1024, unitResource1.getMemory()); assertEquals(4, unitResource1.getVirtualCores()); yarnConfig.setInt("yarn.resource-types.memory-mb.increment-allocation", 512); yarnConfig.setInt("yarn.resource-types.vcores.increment-allocation", 2); Resource unitResource2 = Utils.getUnitResource(yarnConfig); assertEquals(512, unitResource2.getMemory()); assertEquals(2, unitResource2.getVirtualCores()); yarnConfig.set("yarn.resourcemanager.scheduler.class", "org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler"); Resource unitResource3 = Utils.getUnitResource(yarnConfig); assertEquals(64, unitResource3.getMemory()); assertEquals(1, unitResource3.getVirtualCores()); }</code><technical_language>try avoid magic string literals if possible</technical_language>

Target:
public void testGetUnitResource() { final int minMem = 64; final int minVcore = 1; final int incMem = 512; final int incVcore = 2; final int incMemLegacy = 1024; final int incVcoreLegacy = 4; YarnConfiguration yarnConfig = new YarnConfiguration(); yarnConfig.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, minMem); yarnConfig.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_VCORES, minVcore); yarnConfig.setInt(Utils.YARN_RM_INCREMENT_ALLOCATION_MB_LEGACY_KEY, incMemLegacy); yarnConfig.setInt(Utils.YARN_RM_INCREMENT_ALLOCATION_VCORES_LEGACY_KEY, incVcoreLegacy); verifyUnitResourceVariousSchedulers(yarnConfig, minMem, minVcore, incMemLegacy, incVcoreLegacy); yarnConfig.setInt(Utils.YARN_RM_INCREMENT_ALLOCATION_MB_KEY, incMem); yarnConfig.setInt(Utils.YARN_RM_INCREMENT_ALLOCATION_VCORES_KEY, incVcore); verifyUnitResourceVariousSchedulers(yarnConfig, minMem, minVcore, incMem, incVcore); }
Source:
<code>private Object getFromDB(String serviceName, String type, String user) throws CredentialStoreException { String application = findApplicationName(); if(StringUtil.isEmpty(user)){ user = serviceName+application; } try { Connection connection = getConnection(); try { PreparedStatement stmt = connection .prepareStatement("SELECT CREDENTIALTOKEN FROM "+getTableName()+" WHERE APPID = ? AND SERVICENAME = ? and TYPE = ? AND USERID = ?"); try { <START> <END> stmt.setString(1, application); stmt.setString(2, serviceName); stmt.setString(3, type); stmt.setString(4, user); ResultSet rs = stmt.executeQuery(); try { if(rs.next()){ byte[] buf = rs.getBytes(1); return(deSerialize(buf)); } } finally { rs.close(); } } finally { stmt.close(); } } finally { connection.close(); } } catch (SQLException e) { logger.log(Level.SEVERE, "getAppToken : ", e); throw new CredentialStoreException(e, "DBCredentialStore.java : getAppToken caused a SQLException"); } return null; }</code><technical_language>nested try/catch/finally blocks mixed throws statements. simplify this</technical_language>

Target:
private Object getFromDB(String serviceName, String type, String user) throws CredentialStoreException { String application = findApplicationName(); if(StringUtil.isEmpty(user)){ user = ""; } try { Connection connection = getConnection(); try { PreparedStatement stmt = connection .prepareStatement("SELECT CREDENTIALTOKEN FROM "+getTableName()+" WHERE APPID = ? AND SERVICENAME = ? and TYPE = ? AND USERID = ?"); try { stmt.setString(1, application); stmt.setString(2, serviceName); stmt.setString(3, type); stmt.setString(4, user); ResultSet rs = stmt.executeQuery(); try { if(rs.next()){ byte[] buf = rs.getBytes(1); return(deSerialize(buf)); } } finally { rs.close(); } } finally { stmt.close(); } } finally { connection.close(); } } catch (SQLException e) { logger.log(Level.SEVERE, "getAppToken : ", e); throw new CredentialStoreException(e, "DBCredentialStore.java : getAppToken caused a SQLException"); } return null; }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ReceivedPutRequest["); sb.append("BlobID=").append(blobId.getID()); sb.append(", ").append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); if (blobProperties != null) { sb.append(", ").append(blobProperties); } else { sb.append(", ").append("Properties=Null"); } if (userMetadata != null) { sb.append(", ").append("UserMetaDataSize=").append(userMetadata.capacity()); } else { sb.append(", ").append("UserMetaDataSize=0"); } sb.append(", ").append("blobType=").append(blobType); sb.append(", ").append("blobSize=").append(blobSize); sb.append(", ").append("crc=").append(receivedCrc); <START> sb.append(", ").append("BlobKeyAvailable=").append(blobKey != null); <END> sb.append("]"); return sb.toString(); }</code><technical_language>log keys for security reasons. log a key is present not</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ReceivedPutRequest["); sb.append("BlobID=").append(blobId.getID()); sb.append(", ").append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); if (blobProperties != null) { sb.append(", ").append(blobProperties); } else { sb.append(", ").append("Properties=Null"); } if (userMetadata != null) { sb.append(", ").append("UserMetaDataSize=").append(userMetadata.capacity()); } else { sb.append(", ").append("UserMetaDataSize=0"); } sb.append(", ").append("blobType=").append(blobType); sb.append(", ").append("blobSize=").append(blobSize); sb.append(", ").append("crc=").append(receivedCrc); sb.append(", ").append("BlobKeyAvailable=").append(blobEncryptionKey != null); sb.append("]"); return sb.toString(); }
Source:
<code>public boolean advanceNextPosition() { try { if (closed || !recordReader.next(key, value)) { close(); return false; } Arrays.fill(loaded, false); rowData = deserializer.deserialize(value); return true; } catch (IOException | SerDeException | RuntimeException e) { closeWithSuppression(this, e); if (e instanceof TextLineLengthLimitExceededException) { <START> throw new PrestoException(HIVE_BAD_DATA, e); <END> } throw new PrestoException(HIVE_CURSOR_ERROR, e); } }</code><technical_language>add a more user friendly error message: java throw new PrestoException(HIVE_BAD_DATA, "Line long in text file: " + path, e); need pass path constructor</technical_language>

Target:
public boolean advanceNextPosition() { try { if (closed || !recordReader.next(key, value)) { close(); return false; } Arrays.fill(loaded, false); rowData = deserializer.deserialize(value); return true; } catch (IOException | SerDeException | RuntimeException e) { closeWithSuppression(this, e); if (e instanceof TextLineLengthLimitExceededException) { throw new PrestoException(HIVE_BAD_DATA, "Line too long in text file: " + path, e); } throw new PrestoException(HIVE_CURSOR_ERROR, e); } }
Source:
<code>public List<Map<String, Map<Category, Double>>> getNamedEntities() throws IndicoException { if (!results.containsKey(Api.NamedEntities)) throw new IndicoException(Api.NamedEntities.name + " was not included in the request"); List<Map<String, Map<Category, Double>>> result = new ArrayList<>(); <START> List<Map<String, Map<String, Object>>> responses = (List<Map<String, Map<String, Object>>>) results.get(Api.NamedEntities); <END> for (Map<String, Map<String, Object>> response : responses) { Map<String, Map<Category, Double>> each = new HashMap<>(); for (Map.Entry<String, Map<String, Object>> entry : response.entrySet()) { Map<String, Double> res = new HashMap<>(); res.putAll((Map<String, Double>) entry.getValue().remove("categories")); res.put("confidence", (Double) entry.getValue().get("confidence")); each.put(entry.getKey(), EnumParser.parse(Category.class, res)); } result.add(each); } return result; }</code><technical_language>Ah, a Multi-API thing. a this a nice aspect in call</technical_language>

Target:
public List<Map<String, Map<Category, Double>>> getNamedEntities() throws IndicoException { List<Map<String, Map<Category, Double>>> result = new ArrayList<>(); List<Map<String, Map<String, Object>>> responses = (List<Map<String, Map<String, Object>>>) get(Api.NamedEntities); for (Map<String, Map<String, Object>> response : responses) { Map<String, Map<Category, Double>> each = new HashMap<>(); for (Map.Entry<String, Map<String, Object>> entry : response.entrySet()) { Map<String, Double> res = new HashMap<>(); res.putAll((Map<String, Double>) entry.getValue().remove("categories")); res.put("confidence", (Double) entry.getValue().get("confidence")); each.put(entry.getKey(), EnumParser.parse(Category.class, res)); } result.add(each); } return result; }
Source:
<code>public void _doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { if (delay==null) <START> delay=new TimeDuration(getJob().getQuietPeriod() * 1000); <END> List<ParameterValue> values = new ArrayList<ParameterValue>(); JSONObject formData = req.getSubmittedForm(); JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject) o; String name = jo.getString("name"); ParameterDefinition d = getParameterDefinition(name); if(d==null) throw new IllegalArgumentException("No such parameter definition: " + name); ParameterValue parameterValue = d.createValue(req, jo); if (parameterValue != null) { values.add(parameterValue); } else { throw new IllegalArgumentException("Cannot retrieve the parameter value: " + name); } } WaitingItem item = Jenkins.getInstance().getQueue().schedule( getJob(), delay.getTimeInSeconds(), new ParametersAction(values), new CauseAction(new Cause.UserIdCause())); if (item!=null) { String url = formData.optString("redirectTo"); if (url==null || !Util.isSafeToRedirectTo(url)) url = req.getContextPath()+'/'+item.getUrl(); rsp.sendRedirect(formData.optInt("statusCode",SC_CREATED), url); } else rsp.sendRedirect("."); }</code><technical_language>+1, a lot of examples in case for in core @fcojfernandez. <LINK_0> For instance, convert 5 seconds milliseconds: <LINK_1></technical_language>

Target:
public void _doBuild(StaplerRequest req, StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, ServletException { if (delay==null) delay=new TimeDuration(TimeUnit.MILLISECONDS.convert(getJob().getQuietPeriod(), TimeUnit.SECONDS)); List<ParameterValue> values = new ArrayList<ParameterValue>(); JSONObject formData = req.getSubmittedForm(); JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject) o; String name = jo.getString("name"); ParameterDefinition d = getParameterDefinition(name); if(d==null) throw new IllegalArgumentException("No such parameter definition: " + name); ParameterValue parameterValue = d.createValue(req, jo); if (parameterValue != null) { values.add(parameterValue); } else { throw new IllegalArgumentException("Cannot retrieve the parameter value: " + name); } } WaitingItem item = Jenkins.getInstance().getQueue().schedule( getJob(), delay.getTimeInSeconds(), new ParametersAction(values), new CauseAction(new Cause.UserIdCause())); if (item!=null) { String url = formData.optString("redirectTo"); if (url==null || !Util.isSafeToRedirectTo(url)) url = req.getContextPath()+'/'+item.getUrl(); rsp.sendRedirect(formData.optInt("statusCode",SC_CREATED), url); } else rsp.sendRedirect("."); }
Source:
<code>private IAction createOpenAction() { ITreeSelection selection = (ITreeSelection) tree.getSelection(); final List<String> pathsToOpen = getSelectedPaths(selection); if (pathsToOpen == null) return null; return new Action( UIText.CommitFileDiffViewer_OpenWorkingTreeVersionInEditorMenuLabel) { @Override public void run() { for (Iterator<String> iterator = pathsToOpen.iterator(); iterator <START> .hasNext();) { <END> openFileInEditor(iterator.next()); } } }; }</code><technical_language>a for-each loop here</technical_language>

Target:
private IAction createOpenAction() { ITreeSelection selection = (ITreeSelection) tree.getSelection(); final List<String> pathsToOpen = getSelectedPaths(selection); if (pathsToOpen == null) return null; return new Action( UIText.CommitFileDiffViewer_OpenWorkingTreeVersionInEditorMenuLabel) { @Override public void run() { for (String filePath: pathsToOpen) openFileInEditor(filePath); } }; }
Source:
<code>public ISchedulingRule getRule(int kind, Map<String, String> args) { if (InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).getBoolean(PREF_NULL_SCHEDULING_RULE, false)) { <START> return getProject(); <END> } return super.getRule(kind, args); }</code><technical_language>in this case, return null before. preference a 3rd (like "project") else if ("project".equsls(InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).getString(PREF_NULL_SCHEDULING_RULE, null)) { return getProject(); } return super.getRule(kind, args); introduce a new preference more explicitly 3 values</technical_language>

Target:
public ISchedulingRule getRule(int kind, Map<String, String> args) { String pref = InstanceScope.INSTANCE.getNode(JavaCore.PLUGIN_ID).get(PREF_SCHEDULING_RULE, null); if (pref != null) { if(pref.equals("project")) return getProject(); else if(pref.equals("null")) { return null; } } return super.getRule(kind, args); }
Source:
<code>public void sawClient(Client client) { long now = OffsetDateTime.now().toEpochSecond(); dslContext.transaction(configuration -> { DSL.using(configuration) .update(CLIENTS) <START> .set(CLIENTS.LASTSEEN, now) <END> .where(CLIENTS.ID.eq(client.getId())) .execute(); }); }</code><technical_language>I do this instead: .set(CLIENTS.LASTSEEN, DSL.greatest(CLIENTS.LASTSEEN, DSL.val(now, CLIENTS.LASTSEEN))) is jOOQ DSL for: lastseen = greatest(lastseen, :now) avoid accidentally writing earlier is in database in case of clock skew</technical_language>

Target:
public void sawClient(Client client) { Instant now = Instant.now(); Instant lastSeen = Optional.ofNullable(client.getLastSeen()).map(ls -> Instant.ofEpochSecond(ls.toEpochSecond())).orElse(null); if (lastSeen == null || now.isAfter(lastSeen.plus(lastSeenThreshold, SECONDS))) { dslContext.transaction(configuration -> { Param<Long> val = DSL.val(now.getEpochSecond(), CLIENTS.LASTSEEN); DSL.using(configuration) .update(CLIENTS) .set(CLIENTS.LASTSEEN, DSL.when(CLIENTS.LASTSEEN.isNull(), val).otherwise(DSL.greatest(CLIENTS.LASTSEEN, val))) .where(CLIENTS.ID.eq(client.getId())) .execute(); }); } }
Source:
<code>public void purge(Set<Integer> parts, IgniteCallable<Boolean> shouldStop) throws IgniteCheckedException { <START> if (F.isEmpty(parts)) <END> return; if (segments.length == 1) segments[0].purge(parts, shouldStop); else { for (int seg = 0; seg < segments.length; seg++) { for (Integer part : parts) { if (part % segments.length == seg) { segments[seg].purge(parts, shouldStop); break; } } } } }</code><technical_language>get if parts is empty. Seems, replace this check assert</technical_language>

Target:
public void purge(Set<Integer> parts, IgniteCallable<Boolean> shouldStop) throws IgniteCheckedException { assert !F.isEmpty(parts) : "Empty parts"; for (int seg = 0; seg < segments.length; seg++) { for (Integer part : parts) { if (part % segments.length == seg) { segments[seg].purge(parts, shouldStop); break; } } } }
Source:
<code>public RowExpressionMatchVisitor(Map<String, String> aliases) { <START> this.aliases = aliases; <END> }</code><technical_language>a copy instead, accidentally change passed in map. add requireNonNull aliases is null</technical_language>

Target:
public RowExpressionMatchVisitor(Map<String, String> aliases) { requireNonNull(aliases); this.aliases = ImmutableMap.copyOf(aliases); }
Source:
<code><START> public AbstractParamContainerPanel getJSplitPane() { <END> if (jSplitPane == null) { jSplitPane = new AbstractParamContainerPanel(); jSplitPane.setVisible(true); if (this.rootName != null) { jSplitPane.getRootNode().setUserObject(rootName); } } return jSplitPane; }</code><technical_language>This slipped through</technical_language>

Target:
private AbstractParamContainerPanel getJSplitPane() { if (jSplitPane == null) { jSplitPane = new AbstractParamContainerPanel(); jSplitPane.setVisible(true); if (this.rootName != null) { jSplitPane.getRootNode().setUserObject(rootName); } } return jSplitPane; }