auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AutodetectResult(StreamInput in) throws IOException { if (in.readBoolean()) { this.bucket = new Bucket(in); } else { this.bucket = null; } if (in.readBoolean()) { this.records = in.readList(AnomalyRecord::new); } else { this.records = null; } if (in.readBoolean()) { this.influencers = in.readList(Influencer::new); } else { this.influencers = null; } if (in.readBoolean()) { this.quantiles = new Quantiles(in); } else { this.quantiles = null; } if (in.readBoolean()) { this.modelSnapshot = new ModelSnapshot(in); } else { this.modelSnapshot = null; } if (in.readBoolean()) { this.modelSizeStats = new ModelSizeStats(in); } else { this.modelSizeStats = null; } if (in.readBoolean()) { this.modelPlot = new ModelPlot(in); } else { this.modelPlot = null; } <START> if (in.getVersion().onOrAfter(Version.V_7_9_0)) { <END> if (in.readBoolean()) { this.annotation = new Annotation(in); } else { this.annotation = null; } } else { this.annotation = null; } if (in.readBoolean()) { this.categoryDefinition = new CategoryDefinition(in); } else { this.categoryDefinition = null; } if (in.readBoolean()) { this.flushAcknowledgement = new FlushAcknowledgement(in); } else { this.flushAcknowledgement = null; } if (in.readBoolean()) { this.forecast = new Forecast(in); } else { this.forecast = null; } if (in.readBoolean()) { this.forecastRequestStats = new ForecastRequestStats(in); } else { this.forecastRequestStats = null; } }</code><technical_language>a single field check I completely remove check master. This done in 7.last if done now, this confusion if removed now, removed now</technical_language>

Target:
public AutodetectResult(StreamInput in) throws IOException { if (in.readBoolean()) { this.bucket = new Bucket(in); } else { this.bucket = null; } if (in.readBoolean()) { this.records = in.readList(AnomalyRecord::new); } else { this.records = null; } if (in.readBoolean()) { this.influencers = in.readList(Influencer::new); } else { this.influencers = null; } if (in.readBoolean()) { this.quantiles = new Quantiles(in); } else { this.quantiles = null; } if (in.readBoolean()) { this.modelSnapshot = new ModelSnapshot(in); } else { this.modelSnapshot = null; } if (in.readBoolean()) { this.modelSizeStats = new ModelSizeStats(in); } else { this.modelSizeStats = null; } if (in.readBoolean()) { this.modelPlot = new ModelPlot(in); } else { this.modelPlot = null; } if (in.readBoolean()) { this.annotation = new Annotation(in); } else { this.annotation = null; } if (in.readBoolean()) { this.categoryDefinition = new CategoryDefinition(in); } else { this.categoryDefinition = null; } if (in.readBoolean()) { this.flushAcknowledgement = new FlushAcknowledgement(in); } else { this.flushAcknowledgement = null; } if (in.readBoolean()) { this.forecast = new Forecast(in); } else { this.forecast = null; } if (in.readBoolean()) { this.forecastRequestStats = new ForecastRequestStats(in); } else { this.forecastRequestStats = null; } }
Source:
<code>public void setup() { try { orientDBClient = new OrientDBClient(); Properties p = new Properties(); p.setProperty("orientdb.url", TEST_DB_URL); orientDBClient.setProperties(p); orientDBClient.init(); orientDBConnection = new ODatabaseDocumentTx(TEST_DB_URL).open("admin","admin"); orientDBDictionary = orientDBConnection.getMetadata().getIndexManager().getDictionary(); <START> } catch (DBException e) { <END> e.printStackTrace(); fail("Could not create OrientDBClient instance"); } }</code><technical_language>If this exception propogate out of method, junit care of logging details</technical_language>

Target:
public void setup() throws DBException { orientDBClient = new OrientDBClient(); Properties p = new Properties(); p.setProperty("orientdb.url", TEST_DB_URL); orientDBClient.setProperties(p); orientDBClient.init(); orientDBConnection = new ODatabaseDocumentTx(TEST_DB_URL).open("admin","admin"); orientDBDictionary = orientDBConnection.getMetadata().getIndexManager().getDictionary(); }
Source:
<code>private static void reportOnMissingParameters(SubscriptionContext ctx, FunctionSymbol overriddenMethod, FunctionDef functionDef) { int indexFirstMissingParam = TreeUtils.nonTupleParameters(functionDef).size(); StringBuilder missingParametersBuilder = new StringBuilder(); <START> for (int i = indexFirstMissingParam; i < overriddenMethod.parameters().size(); i++) { <END> FunctionSymbol.Parameter parameter = overriddenMethod.parameters().get(i); if (!parameter.hasDefaultValue()) { missingParametersBuilder.append(parameter.name()).append(" "); } } String missingParameters = missingParametersBuilder.toString(); if (!missingParameters.isEmpty()) { PreciseIssue preciseIssue = ctx.addIssue(functionDef.name(), "Add missing parameters " + missingParameters.trim() + "."); addDefinitionSecondaryLocation(preciseIssue, overriddenMethod.definitionLocation()); } }</code><technical_language>Nitpick: I this loop StringBuilder replaced subList streams a joining collector</technical_language>

Target:
private static void reportOnMissingParameters(SubscriptionContext ctx, FunctionSymbol overriddenMethod, FunctionDef functionDef) { int indexFirstMissingParam = TreeUtils.nonTupleParameters(functionDef).size(); List<FunctionSymbol.Parameter> overridenParams = overriddenMethod.parameters(); String missingParameters = overridenParams.subList(indexFirstMissingParam, overridenParams.size()) .stream() .filter(parameter -> !parameter.hasDefaultValue()) .map(FunctionSymbol.Parameter::name) .collect(Collectors.joining(" ")); if (!missingParameters.isEmpty()) { PreciseIssue preciseIssue = ctx.addIssue(functionDef.name(), "Add missing parameters " + missingParameters.trim() + "."); addDefinitionSecondaryLocation(preciseIssue, overriddenMethod.definitionLocation()); } }
Source:
<code>public void waitUntilAllCompleted() { while (completed.get() < scheduled.get()) { try { <START> poll(100, TimeUnit.MILLISECONDS); <END> } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } } }</code><technical_language>check future for exception also. logging kind of message for a failure longer, logged well</technical_language>

Target:
public void waitUntilAllCompleted() { while (completed.get() < scheduled.get()) { try { Future<Void> future = poll(100, TimeUnit.MILLISECONDS); if (future != null) { future.get(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } catch (ExecutionException e) { if (firstException.get() == null) { firstException.compareAndSet(null, e); } } } }
Source:
<code>public boolean isInSketchbook() { <START> return getFolder().getAbsolutePath().startsWith(BaseNoGui.getDefaultSketchbookFolder().getAbsolutePath()); <END> }</code><technical_language>getDefaultSketchbookFolder() here, actual folder (which I customized preferences). I suggest getSketchbookHardwareFolder() instead, is more specific. I this, works expected system. suggestion return getFolder().getAbsolutePath().startsWith(BaseNoGui.getSketchbookHardwareFolder().getAbsolutePath());</technical_language>

Target:
public boolean isInSketchbook() { return getFolder().getAbsolutePath().startsWith(BaseNoGui.getSketchbookHardwareFolder().getAbsolutePath()); }
Source:
<code>private void draw() { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); commonDrawer.begin(); if (solGame != null) { solGame.draw(); } uiDrawer.updateMtx(); inputManager.draw(uiDrawer, this); if (solGame != null) { solGame.drawDebugUi(uiDrawer); factionDisplay.drawFactionNames(uiDrawer); } if (fatalErrorMsg != null) { uiDrawer.draw(uiDrawer.whiteTexture, displayDimensions.getRatio(), .5f, 0, 0, 0, .25f, 0, SolColor.UI_BG); uiDrawer.drawString(fatalErrorMsg, displayDimensions.getRatio(), .5f, FontSize.MENU, true, SolColor.WHITE); uiDrawer.drawString(fatalErrorTrace, .2f * displayDimensions.getRatio(), .6f, FontSize.DEBUG, false, SolColor.WHITE); } DebugCollector.draw(uiDrawer); if (solGame == null) { uiDrawer.drawString("v" + Const.VERSION, 0.01f, .974f, FontSize.DEBUG, UiDrawer.TextAlignment.LEFT, false, SolColor.WHITE); <START> <END> } commonDrawer.end(); }</code><technical_language>newline</technical_language>

Target:
private void draw() { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); commonDrawer.begin(); if (solGame != null) { solGame.draw(); } uiDrawer.updateMtx(); inputManager.draw(uiDrawer, this); if (solGame != null) { solGame.drawDebugUi(uiDrawer); factionDisplay.drawFactionNames(solGame, uiDrawer, inputManager, solGame.getObjectManager()); } if (fatalErrorMsg != null) { uiDrawer.draw(uiDrawer.whiteTexture, displayDimensions.getRatio(), .5f, 0, 0, 0, .25f, 0, SolColor.UI_BG); uiDrawer.drawString(fatalErrorMsg, displayDimensions.getRatio(), .5f, FontSize.MENU, true, SolColor.WHITE); uiDrawer.drawString(fatalErrorTrace, .2f * displayDimensions.getRatio(), .6f, FontSize.DEBUG, false, SolColor.WHITE); } DebugCollector.draw(uiDrawer); if (solGame == null) { uiDrawer.drawString("v" + Const.VERSION, 0.01f, .974f, FontSize.DEBUG, UiDrawer.TextAlignment.LEFT, false, SolColor.WHITE); } commonDrawer.end(); }
Source:
<code>public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); <START> description.addProperty("deathdateEstimated"); <END> description.addProperty("birthtime"); return description; }</code><technical_language>I deathdateEstimated added in 1.11.x, in context of 1.10.x compatibility</technical_language>

Target:
public DelegatingResourceDescription getCreatableProperties() { DelegatingResourceDescription description = super.getCreatableProperties(); description.addProperty("birthtime"); return description; }
Source:
<code>public CustomTierSelectorStrategy( @JacksonInject ServerSelectorStrategy serverSelectorStrategy, @JacksonInject CustomTierSelectorStrategyConfig config ) { super(serverSelectorStrategy); final Map<Integer, Integer> lookup = Maps.newHashMap(); int pos = 0; for (Integer integer : config.getPriorities()) { lookup.put(integer, pos); pos++; } <START> this.comparator = (o1, o2) -> { <END> int pos1 = lookup.get(o1); int pos2 = lookup.get(o2); return Ints.compare(pos1, pos2); }; }</code><technical_language>Comparator.comparingInt(o -> lookup.get(o))</technical_language>

Target:
public CustomTierSelectorStrategy( @JacksonInject ServerSelectorStrategy serverSelectorStrategy, @JacksonInject CustomTierSelectorStrategyConfig config ) { super(serverSelectorStrategy); final Map<Integer, Integer> lookup = Maps.newHashMap(); int pos = 0; for (Integer integer : config.getPriorities()) { lookup.put(integer, pos); pos++; } this.comparator = Comparator.comparingInt(lookup::get); }
Source:
<code>public CompletableFuture<String> next() { <START> return next(timeout); <END> }</code><technical_language>clean timeout field of QueueLeaderElectionListener? I sense leader election listener a field</technical_language>

Target:
public CompletableFuture<String> next() { return next(null); }
Source:
<code>private static void checkCondition(List<Event> events, SoftAssertions softly, Condition<? super Event> condition) { boolean matches = events.stream().anyMatch(condition::matches); if (!matches) <START> softly.fail("Condition did not match any event: " + condition); <END> }</code><technical_language>softly.fail(..)</technical_language>

Target:
private static void checkCondition(List<Event> events, SoftAssertions softly, Condition<? super Event> condition) { boolean matches = events.stream().anyMatch(condition::matches); if (!matches) { softly.fail("Condition did not match any event: " + condition); } }
Source:
<code>protected Subject createSubject(final CallbackProperties properties, final X509Certificate certificate, final PublicKey publicKey) throws SAMLComponentBuilderException { String x509Name = properties.getUsername(); OpenSAML2ComponentBuilder openSamlBuilder = OpenSAML2ComponentBuilder.getInstance(); if ((NullChecker.isNullish(x509Name) || !checkDistinguishedName(x509Name)) && null != certificate && null != certificate.getSubjectDN()) { x509Name = certificate.getSubjectDN().getName(); } Subject subject = openSamlBuilder.createSubject(x509Name, publicKey); List<SubjectConfirmationDataBean> bearBeans = properties.getBearerBeans(); if (CollectionUtils.isNotEmpty(bearBeans)) { for (SubjectConfirmationDataBean bear : bearBeans) { SubjectConfirmation bearConfirmation = openSamlBuilder.createBearConfirmation(bear); subject.getSubjectConfirmations().add(bearConfirmation); } } List<SubjectConfirmationDataBean> senderVouchesBeans = properties.getSenderVouchesBeans(); if (CollectionUtils.isNotEmpty(senderVouchesBeans)) { for (SubjectConfirmationDataBean sender : senderVouchesBeans) { SubjectConfirmation bearConfirmation = openSamlBuilder.createSenderVouchesConfirmation(sender); <START> subject.getSubjectConfirmations().add(bearConfirmation); <END> } } return subject; }</code><technical_language>variable names (change senderVouches</technical_language>

Target:
protected Subject createSubject(final CallbackProperties properties, final X509Certificate certificate, final PublicKey publicKey) throws SAMLComponentBuilderException { String x509Name = properties.getUsername(); OpenSAML2ComponentBuilder openSamlBuilder = OpenSAML2ComponentBuilder.getInstance(); if ((NullChecker.isNullish(x509Name) || !checkDistinguishedName(x509Name)) && null != certificate && null != certificate.getSubjectDN()) { x509Name = certificate.getSubjectDN().getName(); } Subject subject = openSamlBuilder.createSubject(x509Name, publicKey); List<SAMLSubjectConfirmation> subjectConfirmations = properties.getSubjectConfirmations(); if (CollectionUtils.isNotEmpty(subjectConfirmations)) { for (SAMLSubjectConfirmation confirmation : subjectConfirmations) { SubjectConfirmation subjectConfirmation = openSamlBuilder.createSubjectConfirmation(confirmation); if (subjectConfirmation != null) { subject.getSubjectConfirmations().add(openSamlBuilder.createSubjectConfirmation(confirmation)); } } } return subject; }
Source:
<code>public Map<String, Object> baseline(final Blackhole blackhole) { Map<String, Object> parsed = flatParser.parseToMap(flatInputs.get(flatCounter)); <START> for (Map.Entry<String, Object> entry : parsed.entrySet()) { <END> String s = entry.getKey(); blackhole.consume(parsed.get(s)); } flatCounter = (flatCounter + 1) % numEvents; return parsed; }</code><technical_language>This iteration parsed.values(). Similar in other places in this PR</technical_language>

Target:
public Map<String, Object> baseline(final Blackhole blackhole) { Map<String, Object> parsed = flatParser.parseToMap(flatInputs.get(flatCounter)); for (Object s : parsed.values()) { blackhole.consume(s); } flatCounter = (flatCounter + 1) % numEvents; return parsed; }
Source:
<code>private RelRoot optimize(Planner planner, RelRoot relRoot) { RelTraitSet relTraitSet = RelTraitSet.createEmpty(); try { RelRoot optimizedRelRoot = RelRoot.of(planner.transform(0, relTraitSet, relRoot.project()), SqlKind.SELECT); LOG.info("query plan with optimization:\n" + RelOptUtil.toString(optimizedRelRoot.rel, SqlExplainLevel.EXPPLAN_ATTRIBUTES)); return optimizedRelRoot; } catch (Exception e) { String errorMsg = "Error while optimizing query plan:\n" + RelOptUtil.toString(relRoot.rel, SqlExplainLevel.EXPPLAN_ATTRIBUTES); LOG.error(errorMsg, e); <START> planner.close(); <END> throw new SamzaException(errorMsg, e); } }</code><technical_language>Calling close() unnecessary, closed caller try-with-resources-closeable</technical_language>

Target:
private RelRoot optimize(Planner planner, RelRoot relRoot) { RelTraitSet relTraitSet = RelTraitSet.createEmpty(); try { RelRoot optimizedRelRoot = RelRoot.of(planner.transform(0, relTraitSet, relRoot.project()), SqlKind.SELECT); LOG.info("query plan with optimization:\n" + RelOptUtil.toString(optimizedRelRoot.rel, SqlExplainLevel.EXPPLAN_ATTRIBUTES)); return optimizedRelRoot; } catch (Exception e) { String errorMsg = "Error while optimizing query plan:\n" + RelOptUtil.toString(relRoot.rel, SqlExplainLevel.EXPPLAN_ATTRIBUTES); LOG.error(errorMsg, e); throw new SamzaException(errorMsg, e); } }
Source:
<code><START> public String getValidationReason() { <END> return why; }</code><technical_language>This sounds "why validated" instead of "why failed"</technical_language>

Target:
public String getValidationReason() { return message; }
Source:
<code>private ValueMatcher makeMatcher(final ValueMatcher[] baseMatchers){ if (baseMatchers.length == 0) { <START> return BooleanValueMatcher.of(false); <END> } if (baseMatchers.length == 1) { return baseMatchers[0]; } return new ValueMatcher() { @Override public boolean matches() { for (ValueMatcher matcher : baseMatchers) { if (matcher.matches()) { return true; } } return false; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("firstBaseMatcher", baseMatchers[0]); inspector.visit("secondBaseMatcher", baseMatchers[1]); } }; }</code><technical_language>true</technical_language>

Target:
private ValueMatcher makeMatcher(final ValueMatcher[] baseMatchers){ Preconditions.checkState(baseMatchers.length > 0); if (baseMatchers.length == 1) { return baseMatchers[0]; } return new ValueMatcher() { @Override public boolean matches() { for (ValueMatcher matcher : baseMatchers) { if (matcher.matches()) { return true; } } return false; } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("firstBaseMatcher", baseMatchers[0]); inspector.visit("secondBaseMatcher", baseMatchers[1]); } }; }
Source:
<code><START> public CollectionOfClassesObjectFormatter(Collection<Class<?>> classes) { <END> StringBuilder sb = new StringBuilder(); boolean isFirst = true; for ( Class<?> clazz : classes ) { if ( !isFirst ) { sb.append( ", " ); } else { isFirst = false; } sb.append( clazz.getName() ); } this.stringRepresentation = sb.toString(); }</code><technical_language>this: stringRepresentation = classes.stream() .map( c -> c.getName() ) .collect( Collectors.joining( ", " ) ); Sorry, resist :)</technical_language>

Target:
public CollectionOfClassesObjectFormatter(Collection<Class<?>> classes) { this.stringRepresentation = classes.stream() .map( c -> c.getName() ) .collect( Collectors.joining( ", " ) ); }
Source:
<code>public static String convertEdgeToGraph(String outputNode, Node value, GRAPH_TYPE graphType) { String outputEdge = ""; for (EDGETYPE et : EDGETYPE.values()) { for (VKmer e : value.getEdgeList(et)) { String destNode = ""; switch (graphType) { case UNDIRECTED_GRAPH_WITHOUT_LABELS: if (map.containsKey(e.toString())) destNode += map.get(e.toString()); else { count++; map.put(e.toString(), count); destNode += count; } outputEdge += outputNode + " -> " + destNode + "[dir=none]\n"; break; case DIRECTED_GRAPH_WITH_SIMPLELABEL_AND_EDGETYPE: if (map.containsKey(e.toString())) destNode += map.get(e.toString()); else { count++; map.put(e.toString(), count); destNode += count; } outputEdge += outputNode + " -> " + destNode + "[color = \"" + getColor(et) + "\" label =\"" + et + "\"]\n"; break; case DIRECTED_GRAPH_WITH_KMERS_AND_EDGETYPE: outputEdge += outputNode + " -> " + e.toString() + "[color = \"" + getColor(et) + "\" label =\"" + et + "\"]\n"; break; case DIRECTED_GRAPH_WITH_ALLDETAILS: outputEdge += outputNode + " -> " + e.toString() + "[color = \"" + getColor(et) <START> + "\" label =\"" + et + "\"]\n"; <END> break; default: throw new IllegalStateException("Invalid input Graph Type!!!"); } } } if (outputEdge == "") outputEdge += outputNode; return outputEdge; }</code><technical_language>@anbangx readids edges in this version, reconsider DIRECTED_GRAPH_WITH_ALLDETAILS means. print internalKmer instead of key</technical_language>

Target:
public static String convertEdgeToGraph(String outputNode, Node value, GRAPH_TYPE graphType) { String outputEdge = ""; for (EDGETYPE et : EDGETYPE.values) { for (VKmer e : value.getEdges(et)) { String destNode = ""; switch (graphType) { case UNDIRECTED_GRAPH_WITHOUT_LABELS: if (map.containsKey(e.toString())) destNode += map.get(e.toString()); else { count++; map.put(e.toString(), count); destNode += count; } outputEdge += outputNode + " -> " + destNode + "[dir=none]\n"; break; case DIRECTED_GRAPH_WITH_SIMPLELABEL_AND_EDGETYPE: if (map.containsKey(e.toString())) destNode += map.get(e.toString()); else { count++; map.put(e.toString(), count); destNode += count; } outputEdge += outputNode + " -> " + destNode + "[color = \"" + getColor(et) + "\" label =\"" + et + "\"]\n"; break; case DIRECTED_GRAPH_WITH_KMERS_AND_EDGETYPE: outputEdge += outputNode + " -> " + e.toString() + "[color = \"" + getColor(et) + "\" label =\"" + et + "\"]\n"; break; case DIRECTED_GRAPH_WITH_ALLDETAILS: outputEdge += outputNode + " -> " + e.toString() + "[color = \"" + getColor(et) + "\" label =\"" + et + "\"]\n"; break; default: throw new IllegalStateException("Invalid input Graph Type!!!"); } } } if (outputEdge == "") outputEdge += outputNode; return outputEdge; }
Source:
<code>private void dialogUpdated() { if (Strings.isNullOrEmpty(destination.getText()) || Strings.isNullOrEmpty(commitMessage.getText())) { <START> disableOKButton(); <END> } else { enableOKButton(); } }</code><technical_language>If replace 2 methods a setOKButtonEnabled(boolean) simplify this (no need for if/else)</technical_language>

Target:
private void dialogUpdated() { boolean isSubmittable = !Strings.isNullOrEmpty(destination.getText()) && !Strings.isNullOrEmpty(commitMessage.getText()); setOKButtonEnabled(isSubmittable); }
Source:
<code>public void testSTArea() throws Exception { <START> assertQuery("select ST_Area(ST_GeometryFromText('Polygon ((2 2, 2 6, 6 6, 6 2))'))", "select 16.0"); <END> assertQueryFails("select ST_Area(ST_GeometryFromText('Point (1 4)'))", "ST_Area only applies to Polygon. Input type is: Point"); }</code><technical_language>nit: test 'POLYGON EMPTY'</technical_language>

Target:
public void testSTArea() throws Exception { assertFunction("ST_Area(ST_GeometryFromText('POLYGON ((2 2, 2 6, 6 6, 6 2))'))", DOUBLE, 16.0); assertFunction("ST_Area(ST_GeometryFromText('POLYGON EMPTY'))", DOUBLE, 0.0); assertInvalidFunction("ST_Area(ST_GeometryFromText('POINT (1 4)'))", "ST_Area only applies to POLYGON or MULTI_POLYGON. Input type is: POINT"); }
Source:
<code>private Map<String,String> readDescriptions(File file) throws IOException { BufferedReader readerHeader = new BufferedReader(new FileReader(file)); BufferedReader readerbody = new BufferedReader(new FileReader(file)); String header = ""; String description = ""; String line; Map<String,String> descriptions = new HashMap<String,String>(); <START> while ((line = readerHeader.readLine()) != null) { <END> if (line.startsWith("#")) { header += line + "\n"; } if (line.isEmpty()) { descriptions.put("hasHeader", "true"); descriptions.put("header", header); break; } else if ((!(line.startsWith("#")) && (!(line.isEmpty())))) { descriptions.put("header", "false"); } } readerHeader.close(); while ((line = readerbody.readLine()) != null) { if (line.startsWith("#")) { description += line + "\n"; } if (line.isEmpty()) { description = ""; } else if ((!(line.startsWith("#")) && (!(line.isEmpty())))) { String[] nameValue = line.split("="); String name = nameValue[0]; descriptions.put(name, description); description = ""; } } readerbody.close(); return descriptions; }</code><technical_language>2 loops? I done in one..</technical_language>

Target:
private Map<String,String> readDescriptions(File file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String header = ""; String description = ""; String line; Map<String,String> descriptions = new HashMap<String,String>(); while ((line = reader.readLine()) != null) { if (line.startsWith("#")) { description += line + "\n"; } if (line.isEmpty()) { description = ""; } else if ((!(line.startsWith("#")) && (!(line.isEmpty())))) { String[] nameValue = line.split("="); String name = nameValue[0]; descriptions.put(name, description); description = ""; } } reader.close(); return descriptions; }
Source:
<code>public ClassFactory(final SSymbol name, final MixinDefinition mixinDef, final EconomicSet<SlotDefinition> instanceSlots, final EconomicMap<SSymbol, Dispatchable> dispatchables, final boolean declaredAsValue, final boolean isTransferObject, final boolean isArray, final SClass[] superclassAndMixins, final boolean hasOnlyImmutableFields, final ClassFactory classClassFactory, final NodeFactory<? extends AbstractSerializationNode> serializerFactory) { assert instanceSlots == null || instanceSlots.size() > 0; this.className = name; this.mixinDef = mixinDef; this.instanceSlots = instanceSlots; this.dispatchables = dispatchables; this.isDeclaredAsValue = declaredAsValue; this.isTransferObject = isTransferObject; this.isArray = isArray; this.hasOnlyImmutableFields = hasOnlyImmutableFields; this.superclassAndMixins = superclassAndMixins; if (VmSettings.SNAPSHOTS_ENABLED) { <START> CompilerDirectives.transferToInterpreter(); <END> this.serializationRoot = new SerializerRootNode(null, serializerFactory.createNode(this)); } else { this.serializationRoot = null; } VM.callerNeedsToBeOptimized( "instanceLayout should only be accessed on slow path. (and ClassFactory should only be instantiated on slowpath, too)"); this.instanceLayout = (instanceSlots == null) ? null : new ObjectLayout(instanceSlots, this, isTransferObject); this.classClassFactory = classClassFactory; }</code><technical_language>This transferToInterpreter() done here, interferes VM.callerNeedsToBeOptimized a lines below. initializing serializationRoot afterwards. way, expect this code executed slow path</technical_language>

Target:
public ClassFactory(final SSymbol name, final MixinDefinition mixinDef, final EconomicSet<SlotDefinition> instanceSlots, final EconomicMap<SSymbol, Dispatchable> dispatchables, final boolean declaredAsValue, final boolean isTransferObject, final boolean isArray, final SClass[] superclassAndMixins, final boolean hasOnlyImmutableFields, final ClassFactory classClassFactory, final NodeFactory<? extends AbstractSerializationNode> serializerFactory) { assert instanceSlots == null || instanceSlots.size() > 0; this.className = name; this.mixinDef = mixinDef; this.instanceSlots = instanceSlots; this.dispatchables = dispatchables; this.isDeclaredAsValue = declaredAsValue; this.isTransferObject = isTransferObject; this.isArray = isArray; this.hasOnlyImmutableFields = hasOnlyImmutableFields; this.superclassAndMixins = superclassAndMixins; if (VmSettings.SNAPSHOTS_ENABLED) { this.serializationRoot = new SerializerRootNode(null, serializerFactory.createNode(this)); } else { this.serializationRoot = null; } VM.callerNeedsToBeOptimized( "instanceLayout should only be accessed on slow path. (and ClassFactory should only be instantiated on slowpath, too)"); this.instanceLayout = (instanceSlots == null) ? null : new ObjectLayout(instanceSlots, this, isTransferObject); this.classClassFactory = classClassFactory; }
Source:
<code>public static void classLevelSetup() throws Exception { Configuration conf = new Configuration(); conf.set("dfs.client.use.datanode.hostname", "true"); conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() + ".hosts", "*"); MiniDFSCluster miniDFSCluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).format(true).build(); HashMap<String, String> overridesForHiveConf = new HashMap<String, String>() {{ put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString()); put(HiveConf.ConfVars.HIVE_IN_TEST_REPL.varname, "true"); }}; HashMap<String, String> overridesForHiveConfDump = new HashMap<String, String>() {{ put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString()); put(HiveConf.ConfVars.HIVE_IN_TEST_REPL.varname, "true"); put(HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES.varname, "true"); }}; primary = new WarehouseInstance(LOG, miniDFSCluster, overridesForHiveConf); replica = new WarehouseInstance(LOG, miniDFSCluster, overridesForHiveConf); <START> externalDump = new WarehouseInstance(LOG, miniDFSCluster, overridesForHiveConfDump); <END> }</code><technical_language>Instead of another WarehouseInstance, pass new config option clause for REPL DUMP</technical_language>

Target:
public static void classLevelSetup() throws Exception { Configuration conf = new Configuration(); conf.set("dfs.client.use.datanode.hostname", "true"); conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() + ".hosts", "*"); MiniDFSCluster miniDFSCluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).format(true).build(); HashMap<String, String> overridesForHiveConf = new HashMap<String, String>() {{ put("fs.defaultFS", miniDFSCluster.getFileSystem().getUri().toString()); put(HiveConf.ConfVars.HIVE_IN_TEST_REPL.varname, "true"); }}; primary = new WarehouseInstance(LOG, miniDFSCluster, overridesForHiveConf); replica = new WarehouseInstance(LOG, miniDFSCluster, overridesForHiveConf); }
Source:
<code><START> public void run(MasterConfig masterConfig, Collection<Report> reports) { <END> if (perfRepoAuth == null) { log.error("perfRepoAuth parameter has to be set"); return; } if (perfRepoTest == null) { log.error("perfRepoTest parameter has to be set"); return; } for (Report report : reports) { reportTests(report); } }</code><technical_language>add this config uploaded PerfRepo in uploadAttachments method</technical_language>

Target:
public void run(MasterConfig masterConfig, Collection<Report> reports) { this.masterConfig = masterConfig; if (perfRepoAuth == null) { log.error("perfRepoAuth parameter has to be set"); return; } if (perfRepoTest == null) { log.error("perfRepoTest parameter has to be set"); return; } for (Report report : reports) { reportTests(report); } }
Source:
<code>protected JsonObject doBuild() { JsonArray array = new JsonArray( values.size() ); <START> values.stream().forEach( value -> array.add( value ) ); <END> JsonObject inner = getInnerObject(); VALUES.set( inner, array ); JsonObject outerObject = getOuterObject(); IDS.set( outerObject, getInnerObject() ); return outerObject; }</code><technical_language>A simple "for" loop here. aware lambdas a bad impact metaspace add if everywhere. I avoid them, easy here..</technical_language>

Target:
protected JsonObject doBuild() { JsonArray array = convert( values ); JsonObject inner = getInnerObject(); VALUES.set( inner, array ); JsonObject outerObject = getOuterObject(); IDS.set( outerObject, getInnerObject() ); return outerObject; }
Source:
<code>public static final ServiceProvider setCurrent(ServiceProvider provider) { Objects.requireNonNull(provider); ServiceProvider old = current.getAndSet(provider); <START> if (old.equals(provider)) { <END> System.getLogger("javax.measure.spi").log(System.Logger.Level.DEBUG, "Measurement ServiceProvider {1,choice,0#set to|1#replaced by} {0}.", new Object[] {provider.getClass().getName(), (old == null) ? 0 : 1}); } return old; }</code><technical_language>Missing ! . needs check if null (I do complete source code hand right for verifying)</technical_language>

Target:
public static final ServiceProvider setCurrent(ServiceProvider provider) { Objects.requireNonNull(provider); ServiceProvider old = current.getAndSet(provider); if (old != provider) { System.getLogger("javax.measure.spi").log(System.Logger.Level.DEBUG, "Measurement ServiceProvider {1,choice,0#set to|1#replaced by} {0}.", new Object[] {provider.getClass().getName(), (old == null) ? 0 : 1}); } return old; }
Source:
<code>private CSVListener readCsvFrom(CSVListener listener, String urlSource, String fileSource){ try { if (urlSource != null) { URL url = new URL(urlSource); try (InputStream is = url.openStream()) { new CSVLibrary().parse(is, listener); } } if (fileSource != null) { InputStream is = new BufferedInputStream(new FileInputStream(fileSource)); new CSVLibrary().parse(is, listener); } } catch (Exception e) { <START> e.printStackTrace(); <END> } return listener; }</code><technical_language>e.printStackTrace std out lost. a logger instead</technical_language>

Target:
private CSVListener readCsvFrom(CSVListener listener, String urlSource, String fileSource){ try { if (urlSource != null) { URL url = new URL(urlSource); try (InputStream is = url.openStream()) { new CSVLibrary().parse(is, listener); } } if (fileSource != null) { InputStream is = new BufferedInputStream(new FileInputStream(fileSource)); new CSVLibrary().parse(is, listener); } } catch (Exception e) { _log.error(e.getMessage()); } return listener; }
Source:
<code>public void testListRoles() throws Exception { List<RoleInfo> possibleRoles = api().listRoles(); assertNotNull(possibleRoles, "possibleRoles was not set"); assertTrue(possibleRoles.size() > 0, "Expected at least 1 Role but list was empty"); boolean roleFound = false; for (RoleInfo possibleRole : possibleRoles) { if (possibleRole.name().equals(roleName)) { roleFound = true; } <START> } <END> assertTrue(roleFound, "Expected but could not find Role amongst " + possibleRoles.size() + " found"); }</code><technical_language>a more idiomatic Iterables.find instead</technical_language>

Target:
public void testListRoles() throws Exception { List<RoleInfo> possibleRoles = api().listRoles(); assertNotNull(possibleRoles, "possibleRoles was not set"); assertTrue(possibleRoles.size() > 0, "Expected at least 1 Role but list was empty"); RoleInfo possibleRole = Iterables.find(possibleRoles, new Predicate<RoleInfo>() { @Override public boolean apply(RoleInfo arg0) { return arg0.name().equals(roleName); } }, null); assertNotNull(possibleRole, "Expected but could not find Role amongst " + possibleRoles.size() + " found"); }
Source:
<code>private int resolveIterationsCount(MessageContext synCtx) { String countStr = ""; if (getDynamicIterationsValue() != null) { countStr = getDynamicIterationsValue().evaluateValue(synCtx); <START> } else if (getIterations() != null) { <END> countStr = getIterations(); } return Integer.parseInt(countStr); }</code><technical_language>do need else if, else is enough. i.e if getDynamicIterationsValue() == null, get other</technical_language>

Target:
private int resolveIterationsCount(MessageContext synCtx) { String countStr = ""; if (getDynamicIterationsValue() != null) { countStr = getDynamicIterationsValue().evaluateValue(synCtx); } else { countStr = getIterations(); } try { return Integer.parseInt(countStr.trim()); } catch (NumberFormatException e) { handleException("Error while parsing iterations number in clone mediator", synCtx); } return 0; }
Source:
<code>private static void regenerateDataBundleJson(File folder) throws IOException { File[] listOfFiles = folder.listFiles(); for (File file : listOfFiles) { <START> if (file.getName().endsWith(".json") && !NON_DATA_BUNDLE_JSON.contains(file.getName())) { <END> String jsonString = FileHelper.readFile(file.getCanonicalPath()); Gson gson = Utils.getTeammatesGson(); DataBundle db = gson.fromJson(jsonString, DataBundle.class); for (Map.Entry<String, FeedbackResponseAttributes> responseMap : db.feedbackResponses.entrySet()) { fixResponse(responseMap.getValue()); } for (Map.Entry<String, FeedbackQuestionAttributes> questionMap : db.feedbackQuestions.entrySet()) { fixQuestion(questionMap.getValue()); } String regeneratedJsonString = gson.toJson(db).replace("+0000", "UTC"); saveFile(file.getCanonicalPath(), regeneratedJsonString); } } }</code><technical_language>Reverse condition reduce nesting. java if(!condition) { continue;}</technical_language>

Target:
private static void regenerateDataBundleJson(File folder) throws IOException { File[] listOfFiles = folder.listFiles(); for (File file : listOfFiles) { if (!file.getName().endsWith(".json") || NON_DATA_BUNDLE_JSON.contains(file.getName())) { continue; } String jsonString = FileHelper.readFile(file.getCanonicalPath()); Gson gson = Utils.getTeammatesGson(); DataBundle db = gson.fromJson(jsonString, DataBundle.class); for (Map.Entry<String, FeedbackResponseAttributes> responseMap : db.feedbackResponses.entrySet()) { fixResponse(responseMap.getValue()); } for (Map.Entry<String, FeedbackQuestionAttributes> questionMap : db.feedbackQuestions.entrySet()) { fixQuestion(questionMap.getValue()); } String regeneratedJsonString = gson.toJson(db).replace("+0000", "UTC"); saveFile(file.getCanonicalPath(), regeneratedJsonString); } }
Source:
<code>private void validateLocalUTCQueryRange(final DateTime startQueryTimestampLocalUTC, final DateTime endQueryTimestampLocalUTC, final Long accountId, final long allowedRangeInSeconds) { if (startQueryTimestampLocalUTC == null || endQueryTimestampLocalUTC == null) { throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(startQueryTimestampLocalUTC.getZone().equals(DateTimeZone.UTC) == false || endQueryTimestampLocalUTC.getZone().equals(DateTimeZone.UTC) == false) { LOGGER.error("validateLocalUTCQueryRange: Query start/end timestamp is not set to local UTC. start: {}, end: {}", startQueryTimestampLocalUTC, endQueryTimestampLocalUTC); throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(Math.abs(startQueryTimestampLocalUTC.getMillis() - endQueryTimestampLocalUTC.getMillis()) > 2 * allowedRangeInSeconds * 1000) { LOGGER.warn("Invalid request, query to range is too big for account_id = {}", startQueryTimestampLocalUTC, endQueryTimestampLocalUTC, accountId); <START> throw new WebApplicationException(Response.Status.FORBIDDEN); END> } }</code><technical_language>a HTTP 400</technical_language>

Target:
private void validateLocalUTCQueryRange(final DateTime startQueryTimestampLocalUTC, final DateTime endQueryTimestampLocalUTC, final Long accountId, final long allowedRangeInSeconds) { if (startQueryTimestampLocalUTC == null || endQueryTimestampLocalUTC == null) { throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(startQueryTimestampLocalUTC.getZone().equals(DateTimeZone.UTC) == false || endQueryTimestampLocalUTC.getZone().equals(DateTimeZone.UTC) == false) { LOGGER.error("validateLocalUTCQueryRange: Query start/end timestamp is not set to local UTC. start: {}, end: {}", startQueryTimestampLocalUTC, endQueryTimestampLocalUTC); throw new WebApplicationException(Response.Status.BAD_REQUEST); } if(Math.abs(startQueryTimestampLocalUTC.getMillis() - endQueryTimestampLocalUTC.getMillis()) > 2 * allowedRangeInSeconds * 1000) { LOGGER.warn("Invalid request, query to range is too big for account_id = {}", startQueryTimestampLocalUTC, endQueryTimestampLocalUTC, accountId); throw new WebApplicationException(Response.Status.BAD_REQUEST); } }
Source:
<code>public BinaryContent transform(SourceResponse sourceResponse, Map<String, Serializable> map) throws CatalogTransformerException { if (sourceResponse == null) { throw new CatalogTransformerException("Null result set cannot be transformed to HTML"); } List<Metacard> metacards = sourceResponse.getResults().stream().map(Result::getMetacard).collect(Collectors.toList()); List<HtmlMetacardModel> metacardModels = new ArrayList<>(); for (Metacard metacard : metacards) { metacardModels.add(new HtmlMetacardModel(metacard, htmlMetacardUtility.getCategoryList())); } String html = htmlMetacardUtility.buildHtml(metacardModels); if (html == null) { throw new CatalogTransformerException("Result set cannot be transformed to HTML"); <START> } else { <END> return new BinaryContentImpl(new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8))); } }</code><technical_language>nit: else is necessary</technical_language>

Target:
public BinaryContent transform(SourceResponse sourceResponse, Map<String, Serializable> map) throws CatalogTransformerException { if (sourceResponse == null) { throw new CatalogTransformerException("Null result set cannot be transformed to HTML"); } List<HtmlExportCategory> categoryList = HtmlMetacardUtility.sortCategoryList(htmlMetacardUtility.getCategoryList()); final List<HtmlMetacardModel> metacardModels = sourceResponse .getResults() .stream() .map(Result::getMetacard) .map(metacard -> new HtmlMetacardModel(metacard, categoryList)) .collect(toList()); final String html = htmlMetacardUtility.buildHtml(metacardModels); if (StringUtils.isEmpty(html)) { throw new CatalogTransformerException("Result set cannot be transformed to HTML"); } return new BinaryContentImpl( new ByteArrayInputStream(html.getBytes(StandardCharsets.UTF_8)), htmlMetacardUtility.getMimeType()); }
Source:
<code>public void onItemClick(AdapterView<?> parent, View view, int position, long id) { CollaboratorsAdapter.ViewHolder holder = (CollaboratorsAdapter.ViewHolder) view.getTag(); if (holder != null && holder.collaboration != null) { BoxCollaborator collaborator = holder.collaboration.getAccessibleBy(); String userId = mController.getCurrentUserId(); boolean isCollaboratorCurrentUser = collaborator != null && collaborator.getId().equals(userId); <START> if (rolesArr == null || (rolesArr.size() == 0 && !isCollaboratorCurrentUser)) { <END> SdkUtils.toastSafely(getContext(), R.string.box_sharesdk_cannot_get_collaborators, Toast.LENGTH_SHORT); return; } BoxCollaboration.Role role = holder.collaboration.getRole(); String name = collaborator == null ? getString(R.string.box_sharesdk_another_person) : collaborator.getName(); boolean allowOwner = getItem().getOwnedBy().getId().equals(mController.getCurrentUserId()); if (allowOwner){ allowOwner = getItem() instanceof BoxFolder; } CollaborationRolesDialog rolesDialog = CollaborationRolesDialog.newInstance(rolesArr, role, name, true, allowOwner, holder.collaboration); rolesDialog.setOnRoleSelectedListener(this); rolesDialog.show(getFragmentManager(), TAG); } }</code><technical_language>thought discussed a toast for rolesArr null</technical_language>

Target:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { CollaboratorsAdapter.ViewHolder holder = (CollaboratorsAdapter.ViewHolder) view.getTag(); if (holder != null && holder.collaboration != null) { ArrayList<BoxCollaboration.Role> rolesArr = getRoles(); BoxCollaborator collaborator = holder.collaboration.getAccessibleBy(); String userId = mController.getCurrentUserId(); boolean isCollaboratorCurrentUser = collaborator != null && collaborator.getId().equals(userId); if (rolesArr == null) { SdkUtils.toastSafely(getContext(), R.string.box_sharesdk_generic_error, Toast.LENGTH_SHORT); return; } else if (rolesArr.size() == 0 && !isCollaboratorCurrentUser) { SdkUtils.toastSafely(getContext(), R.string.box_sharesdk_insufficient_permissions, Toast.LENGTH_SHORT); return; } BoxCollaboration.Role role = holder.collaboration.getRole(); String name = collaborator == null ? getString(R.string.box_sharesdk_another_person) : collaborator.getName(); boolean allowOwner = getItem().getOwnedBy().getId().equals(mController.getCurrentUserId()); if (allowOwner){ allowOwner = getItem() instanceof BoxFolder; } CollaborationRolesDialog rolesDialog = CollaborationRolesDialog.newInstance(rolesArr, role, name, true, allowOwner, holder.collaboration); rolesDialog.setOnRoleSelectedListener(this); rolesDialog.show(getFragmentManager(), TAG); } }
Source:
<code>public String[] getImplementors(String className) throws MappingException { <START> if (implementorsCache.get(className) != null) { <END> return implementorsCache.get(className); } final Class clazz; String[] implementors; try { clazz = getSessionFactory().getServiceRegistry().getService( ClassLoaderService.class ).classForName( className ); } catch (ClassLoadingException e) { implementors = new String[] { className }; implementorsCache.put(className, implementors); return implementors; } ArrayList<String> results = new ArrayList<>(); for ( EntityPersister checkPersister : entityPersisters().values() ) { if ( ! Queryable.class.isInstance( checkPersister ) ) { continue; } final Queryable checkQueryable = Queryable.class.cast( checkPersister ); final String checkQueryableEntityName = checkQueryable.getEntityName(); final boolean isMappedClass = className.equals( checkQueryableEntityName ); if ( checkQueryable.isExplicitPolymorphism() ) { if ( isMappedClass ) { implementors = new String[] {className}; implementorsCache.put(className, implementors); return implementors; } } else { if ( isMappedClass ) { results.add( checkQueryableEntityName ); } else { final Class mappedClass = checkQueryable.getMappedClass(); if ( mappedClass != null && clazz.isAssignableFrom( mappedClass ) ) { final boolean assignableSuperclass; if ( checkQueryable.isInherited() ) { Class mappedSuperclass = entityPersister( checkQueryable.getMappedSuperclass() ).getMappedClass(); assignableSuperclass = clazz.isAssignableFrom( mappedSuperclass ); } else { assignableSuperclass = false; } if ( !assignableSuperclass ) { results.add( checkQueryableEntityName ); } } } } } implementors = results.toArray( new String[results.size()] ); implementorsCache.put(className, implementors); return implementors; }</code><technical_language>2 map accesses. Sorry, I more clear: store in a variable reuse variable for test return</technical_language>

Target:
public String[] getImplementors(String className) throws MappingException { String[] implementors = implementorsCache.get( className ); if ( implementors != null ) { return Arrays.copyOf( implementors, implementors.length ); } try { final Class<?> clazz = getSessionFactory().getServiceRegistry().getService( ClassLoaderService.class ).classForName( className ); implementors = doGetImplementors( clazz ); if ( implementors.length > 0 ) { implementorsCache.putIfAbsent( className, implementors ); return Arrays.copyOf( implementors, implementors.length ); } else { return EMPTY_IMPLEMENTORS; } } catch (ClassLoadingException e) { return new String[]{ className }; } }
Source:
<code><START> private String generateDataString(long ledger, long entry) { <END> return new String("ledger-" + ledger + "-" + entry); }</code><technical_language>nit: static</technical_language>

Target:
private static String generateDataString(long ledger, long entry) { return ("ledger-" + ledger + "-" + entry); }
Source:
<code>public boolean isInIdClass() { <START> return isInIdClass != null ? isInIdClass : ( parent != null && parent.isInIdClass() ); <END> }</code><technical_language>personal opinion this helps code readability</technical_language>

Target:
public boolean isInIdClass() { if ( isInIdClass != null ) { return isInIdClass; } if ( parent != null ) { return parent.isInIdClass(); } return false; }
Source:
<code>public void sendRequest(final Exchange exchange) { Request request = exchange.getCurrentRequest(); if (request.isObserve() && 0 == exchange.getFailedTransmissionCount()) { <START> exchangeStore.assignMessageId(request); <END> registerObserve(request); } try { if (exchangeStore.registerOutboundRequest(exchange)) { exchange.setRemoveHandler(exchangeRemoveHandler); LOGGER.debug("tracking open request [MID: {}, Token: {}]", request.getMID(), request.getToken()); } else { LOGGER.warn("message IDs exhausted, could not register outbound request for tracking"); request.setSendError(new IllegalStateException("automatic message IDs exhausted")); } } catch (IllegalArgumentException ex) { request.setSendError(ex); } }</code><technical_language>handle case assignMessageId returns Message.NONE</technical_language>

Target:
public void sendRequest(final Exchange exchange) { Request request = exchange.getCurrentRequest(); if (request.isObserve() && 0 == exchange.getFailedTransmissionCount()) { if (exchangeStore.assignMessageId(request) != Message.NONE) { registerObserve(request); } else { LOGGER.warn("message IDs exhausted, could not register outbound observe request for tracking"); request.setSendError(new IllegalStateException("automatic message IDs exhausted")); return; } } try { if (exchangeStore.registerOutboundRequest(exchange)) { exchange.setRemoveHandler(exchangeRemoveHandler); LOGGER.debug("tracking open request [MID: {}, Token: {}]", request.getMID(), request.getToken()); } else { LOGGER.warn("message IDs exhausted, could not register outbound request for tracking"); request.setSendError(new IllegalStateException("automatic message IDs exhausted")); } } catch (IllegalArgumentException ex) { request.setSendError(ex); } }
Source:
<code>public DatabaseLifecycleManager(){ <START> this.lifecycleExecutor = Executors.newSingleThreadExecutor(); <END> }</code><technical_language>give thread a name? easier identify in a thread dump</technical_language>

Target:
public DatabaseLifecycleManager(){ this.lifecycleExecutor = Executors.newSingleThreadExecutor( (runnable) -> new Thread(runnable, "SpliceDatabaseLifecycleManager") ); }