auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Iterator<Node> singleStep(Graph graph, boolean forward, Node node, Node property) { <START> Iter<Node> iter2 = null ; <END> if ( forward ) return G.find(graph, node, property, Node.ANY).mapWith(Triple::getObject); else return G.find(graph, Node.ANY, property, node).mapWith(Triple::getSubject); }</code><technical_language>iter2</technical_language>

Target:
private static Iterator<Node> singleStep(Graph graph, boolean forward, Node node, Node property) { if ( forward ) return G.find(graph, node, property, Node.ANY).mapWith(Triple::getObject); else return G.find(graph, Node.ANY, property, node).mapWith(Triple::getSubject); }
Source:
<code>private Template getRequestTemplate(final Ds3Request ds3Request) throws IOException { if (isGetObjectRequest(ds3Request)) { return config.getTemplate("request/get_object_request.ftl"); } if (isBulkPutRequest(ds3Request)) { return config.getTemplate("request/bulk_put_request.ftl"); } if (isBulkGetRequest(ds3Request)) { return config.getTemplate("request/bulk_get_request.ftl"); } if (isCreateObjectRequest(ds3Request)) { return config.getTemplate("request/put_object_request.ftl"); } if (isCreateMultiPartUploadPartRequest(ds3Request)) { return config.getTemplate("request/stream_request_payload.ftl"); } if (isEjectStorageDomainBlobsRequest(ds3Request)) { <START> return config.getTemplate("request/eject_storage_domain.ftl"); <END> } if (isPhysicalPlacementRequest(ds3Request)) { return config.getTemplate("request/objects_request_payload.ftl"); } if (isMultiFileDeleteRequest(ds3Request)) { return config.getTemplate("request/multi_file_delete_request.ftl"); } if (hasStringRequestPayload(ds3Request)) { return config.getTemplate("request/string_request_payload.ftl"); } return config.getTemplate("request/request_template.ftl"); }</code><technical_language>template name change well</technical_language>

Target:
private Template getRequestTemplate(final Ds3Request ds3Request) throws IOException { if (isGetObjectRequest(ds3Request)) { return config.getTemplate("request/get_object_request.ftl"); } if (isBulkPutRequest(ds3Request)) { return config.getTemplate("request/bulk_put_request.ftl"); } if (isBulkGetRequest(ds3Request)) { return config.getTemplate("request/bulk_get_request.ftl"); } if (isCreateObjectRequest(ds3Request)) { return config.getTemplate("request/put_object_request.ftl"); } if (isCreateMultiPartUploadPartRequest(ds3Request)) { return config.getTemplate("request/stream_request_payload.ftl"); } if (isEjectStorageDomainBlobsRequest(ds3Request)) { return config.getTemplate("request/eject_storage_domain_blobs.ftl"); } if (isPhysicalPlacementRequest(ds3Request)) { return config.getTemplate("request/objects_request_payload.ftl"); } if (isMultiFileDeleteRequest(ds3Request)) { return config.getTemplate("request/multi_file_delete_request.ftl"); } if (hasStringRequestPayload(ds3Request)) { return config.getTemplate("request/string_request_payload.ftl"); } return config.getTemplate("request/request_template.ftl"); }
Source:
<code>private Estimate calculateNullsFraction(Map<String, PartitionStatistics> statisticsByPartitionName, String column, Estimate totalRowsCount) { Estimate totalNullsCount = summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getNullsCount().isPresent()) { return OptionalDouble.of(columnStatistics.getNullsCount().getAsLong()); } else { return OptionalDouble.empty(); } }, nullsCountStream -> { double nullsCount = 0; long partitionsWithStatisticsCount = 0; for (PrimitiveIterator.OfDouble nullsCountIterator = nullsCountStream.iterator(); nullsCountIterator.hasNext(); ) { nullsCount += nullsCountIterator.nextDouble(); partitionsWithStatisticsCount++; } if (partitionsWithStatisticsCount == 0) { return OptionalDouble.empty(); } else { int allPartitionsCount = statisticsByPartitionName.size(); return OptionalDouble.of(allPartitionsCount / partitionsWithStatisticsCount * nullsCount); } }); if (totalNullsCount.isValueUnknown() || totalRowsCount.isValueUnknown()) { return Estimate.unknownValue(); } if (totalRowsCount.getValue() == 0.0) { <START> return new Estimate(0.0); <END> } return new Estimate(totalNullsCount.getValue() / totalRowsCount.getValue()); }</code><technical_language>Estimate.zeroValue()</technical_language>

Target:
private Estimate calculateNullsFraction(Map<String, PartitionStatistics> statisticsByPartitionName, String column, Estimate totalRowsCount) { Estimate totalNullsCount = summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getNullsCount().isPresent()) { return OptionalDouble.of(columnStatistics.getNullsCount().getAsLong()); } else { return OptionalDouble.empty(); } }, nullsCountStream -> { double nullsCount = 0; long partitionsWithStatisticsCount = 0; for (PrimitiveIterator.OfDouble nullsCountIterator = nullsCountStream.iterator(); nullsCountIterator.hasNext(); ) { nullsCount += nullsCountIterator.nextDouble(); partitionsWithStatisticsCount++; } if (partitionsWithStatisticsCount == 0) { return OptionalDouble.empty(); } else { int allPartitionsCount = statisticsByPartitionName.size(); return OptionalDouble.of(allPartitionsCount / partitionsWithStatisticsCount * nullsCount); } }); if (totalNullsCount.isValueUnknown() || totalRowsCount.isValueUnknown()) { return Estimate.unknownValue(); } if (totalRowsCount.getValue() == 0.0) { return Estimate.zeroValue(); } return new Estimate(totalNullsCount.getValue() / totalRowsCount.getValue()); }
Source:
<code>public static Matrix4f getMatrix(EnumFacing facing) { Matrix4f ret = new Matrix4f(); switch(facing) { case DOWN: ret = ModelRotation.X90_Y0.getMatrix(); break; case UP: ret = ModelRotation.X270_Y0.getMatrix(); break; <START> case NORTH: ret = ModelRotation.X0_Y0.getMatrix(); break; <END> case SOUTH: ret = ModelRotation.X0_Y180.getMatrix(); break; case WEST: ret = ModelRotation.X0_Y270.getMatrix(); break; case EAST: ret = ModelRotation.X0_Y90.getMatrix(); break; default: ret.setIdentity(); } return ret; }</code><technical_language>TRSRTransformation.identity here. new matrix needs created in "default" case</technical_language>

Target:
public static Matrix4f getMatrix(EnumFacing facing) { switch(facing) { case DOWN: return ModelRotation.X90_Y0.getMatrix(); case UP: return ModelRotation.X270_Y0.getMatrix(); case NORTH: return TRSRTransformation.identity.matrix; case SOUTH: return ModelRotation.X0_Y180.getMatrix(); case WEST: return ModelRotation.X0_Y270.getMatrix(); case EAST: return ModelRotation.X0_Y90.getMatrix(); default: return new Matrix4f(); } }
Source:
<code>private static void enablePlugin(PluginManager manager, String shortName) throws IOException { PluginWrapper plugin = manager.getPlugin(shortName); if (plugin == null) throw new IllegalArgumentException(Messages.EnablePluginCommand_NoSuchPlugin(shortName)); if (plugin.isEnabled()) return; for (PluginWrapper.Dependency dependency : plugin.getDependencies()) { enablePlugin(manager, dependency.shortName); } <START> plugin.enable(); <END> }</code><technical_language>magic happening dependencies here, expect enabled plugin in command output</technical_language>

Target:
private void enablePlugin(PluginManager manager, String shortName) throws IOException { PluginWrapper plugin = manager.getPlugin(shortName); if (plugin == null) { throw new IllegalArgumentException(Messages.EnablePluginCommand_NoSuchPlugin(shortName)); } if (plugin.isEnabled()) { return; } stdout.println(String.format("Enabling plugin `%s' (%s)", plugin.getShortName(), plugin.getVersion())); enableDependencies(manager, plugin); plugin.enable(); stdout.println(String.format("Plugin `%s' was enabled.", plugin.getShortName())); }
Source:
<code>public void run() { <START> List<Diff> differences = newArrayList(); <END> differences.addAll(getDifferencesToMerge()); differences.addAll(getDifferencesToReject()); ICompareCopyCommand mergeCommand = editingDomain.createCopyCommand(differences, leftToRight, mergerRegistry, mergeRunnable); editingDomain.getCommandStack().execute(mergeCommand); if (navigatable != null) { navigatable.selectChange(Navigatable.NEXT_UNRESOLVED_CHANGE); } }</code><technical_language>This is optimal: - create ArrayList in getDifferencesToMerge selected differences. add elements this list return - element copy "differences" - create a new ArrayList, andagain walk selected differences add elements new arraylist, return - Finally copy elements "differences" useless copies, a single list (additional final field in this class I think)</technical_language>

Target:
public void run() { computeDifferencesToMerge(); computeRequiredDifferencesToReject(); ICompareCopyCommand mergeCommand = editingDomain.createCopyCommand(differencesToMerge, leftToRight, mergerRegistry, mergeRunnable); editingDomain.getCommandStack().execute(mergeCommand); if (navigatable != null) { navigatable.selectChange(Navigatable.NEXT_UNRESOLVED_CHANGE); } }
Source:
<code>public void testToJson() throws Exception { String expected = MAPPER.writeValueAsString( MAPPER.readValue(FixtureHelpers.fixture("fixtures/email.json"), Email.class)); <START> Assertions.assertEquals(expected, MAPPER.writeValueAsString(email)); <END> }</code><technical_language>please static import for in of classes? convention static import for Junit methods reduces verbosity more clear. <LINK_0></technical_language>

Target:
public void testToJson() throws Exception { String expected = MAPPER.writeValueAsString( MAPPER.readValue(FixtureHelpers.fixture("fixtures/email.json"), Email.class)); assertEquals(expected, MAPPER.writeValueAsString(email)); }
Source:
<code>private CompletionStage<String> completeTransaction(LocalTransaction localTx, boolean commit, Xid xid) { CompletionStage<?> stage; <START> Function<Throwable, String> errorTranslation; <END> if (commit) { localTx.clearLookedUpEntries(); stage = txCoordinator.prepare(localTx, true) .thenCompose(ignore -> txCoordinator.commit(localTx, false)); errorTranslation = t -> { log.warnCouldNotCommitLocalTx(localTx, t); return "Could not commit transaction " + xid + " : " + t.getMessage(); }; } else { stage = txCoordinator.rollback(localTx); errorTranslation = t -> { log.warnCouldNotRollbackLocalTx(localTx, t); return "Could not rollback transaction " + xid + " : " + t.getMessage(); }; } return stage.thenCompose(ignore -> removeRecoveryInformation(null, xid, localTx.getGlobalTransaction(), false) .thenApply(ignore2 -> commit ? "Commit successful!" : "Rollback successful") ).exceptionally(errorTranslation); }</code><technical_language>IMO this is abstract, longer if inlined: GlobalTransaction gtx = localTx.getGlobalTransaction(); if (commit) { localTx.clearLookedUpEntries(); return txCoordinator.prepare(localTx, true) .thenCompose(ignore -> txCoordinator.commit(localTx, false)) .thenCompose(ignore -> removeRecoveryInformation(null, xid, gtx, false)) .thenApply(ignore -> "Commit successful!") .exceptionally(t -> { log.warnCouldNotCommitLocalTx(localTx, t); return "Could commit transaction " + xid + " : " + t.getMessage(); }); } else { return txCoordinator.rollback(localTx) .thenCompose(ignore -> removeRecoveryInformation(null, xid, gtx, false)) .thenApply(ignore -> "Rollback successful") .exceptionally(t -> { log.warnCouldNotRollbackLocalTx(localTx, t); return "Could rollback transaction " + xid + " : " + t.getMessage(); }); }</technical_language>

Target:
private CompletionStage<String> completeTransaction(LocalTransaction localTx, boolean commit, Xid xid) { GlobalTransaction gtx = localTx.getGlobalTransaction(); if (commit) { localTx.clearLookedUpEntries(); return txCoordinator.prepare(localTx, true) .thenCompose(ignore -> txCoordinator.commit(localTx, false)) .thenCompose(ignore -> removeRecoveryInformation(null, xid, gtx, false)) .thenApply(ignore -> "Commit successful!") .exceptionally(t -> { log.warnCouldNotCommitLocalTx(localTx, t); return "Could not commit transaction " + xid + " : " + t.getMessage(); }); } else { return txCoordinator.rollback(localTx) .thenCompose(ignore -> removeRecoveryInformation(null, xid, gtx, false)) .thenApply(ignore -> "Rollback successful") .exceptionally(t -> { log.warnCouldNotRollbackLocalTx(localTx, t); return "Could not rollback transaction " + xid + " : " + t.getMessage(); }); } }
Source:
<code>public void fitBiggestContainerIgnoresCoresIfMissing() { Set<HeronMasterDriver.HeronWorker> workers = new HashSet<>(); <START> workers.add(new HeronMasterDriver.HeronWorker(1, 3, ByteAmount.fromMegabytes(3))); <END> AllocatedEvaluator mockEvaluator = createMockEvaluator("test", 1, ByteAmount.fromMegabytes(3)); Optional<HeronMasterDriver.HeronWorker> result = spyDriver.findLargestFittingWorker(mockEvaluator, workers, false); Assert.assertFalse(result.isPresent()); result = spyDriver.findLargestFittingWorker(mockEvaluator, workers, true); assertTrue(result.isPresent()); assertEquals(1, result.get().getWorkerId()); }</code><technical_language>ByteAmount.fromGigabytes(3)</technical_language>

Target:
public void fitBiggestContainerIgnoresCoresIfMissing() { Set<HeronMasterDriver.HeronWorker> workers = new HashSet<>(); workers.add(new HeronMasterDriver.HeronWorker(1, 3, ByteAmount.fromGigabytes(3))); AllocatedEvaluator mockEvaluator = createMockEvaluator("test", 1, ByteAmount.fromGigabytes(3)); Optional<HeronMasterDriver.HeronWorker> result = spyDriver.findLargestFittingWorker(mockEvaluator, workers, false); Assert.assertFalse(result.isPresent()); result = spyDriver.findLargestFittingWorker(mockEvaluator, workers, true); assertTrue(result.isPresent()); assertEquals(1, result.get().getWorkerId()); }
Source:
<code>public final <J extends IsProperties> J strip() { <START> return getDataImpl(); <END> }</code><technical_language>return this</technical_language>

Target:
public final <J extends IsProperties> J strip() { return (J)this; }
Source:
<code>default TimeDimensionProjection toTimeGrain(TimeGrain newGrain) { <START> if (getTimeDimension().getSupportedGrains().stream().noneMatch(g -> g.getGrain().equals(newGrain))) { <END> throw new InvalidValueException(getTimeDimension().getId() + " doesn't support grain " + newGrain); } TimeDimensionProjection projection = this; return new TimeDimensionProjection() { @Override public TimeDimension getTimeDimension() { return projection.getTimeDimension(); } @Override public TimeGrain getGrain() { return newGrain; } @Override public String getAlias() { return projection.getAlias(); } }; }</code><technical_language>Single letter parameter names code harder read. I grainDefinition</technical_language>

Target:
default TimeDimensionProjection toTimeGrain(TimeGrain newGrain) { if (getTimeDimension().getSupportedGrains().stream() .noneMatch(supportedGrain -> supportedGrain.getGrain().equals(newGrain))) { throw new InvalidValueException(getTimeDimension().getId() + " doesn't support grain " + newGrain); } TimeDimensionProjection projection = this; return new TimeDimensionProjection() { @Override public TimeDimension getTimeDimension() { return projection.getTimeDimension(); } @Override public TimeGrain getGrain() { return newGrain; } @Override public TimeZone getTimeZone() { return projection.getTimeZone(); } @Override public String getAlias() { return projection.getAlias(); } }; }
Source:
<code>protected DefaultIndexBuilder fillIndexBuilder(Path path) throws Exception { final DefaultIndexBuilder builder = getIndexBuilder(path); if (builder == null) { return null; } String formContent = ioService.readAllString(path); FormDefinition formDefinition = formDefinitionSerializer.deserialize(formContent); if (formDefinition != null) { Resource resParts = new Resource(formDefinition.getName(), ResourceType.FORM); FormDefinitionVisitor visitor = new FormDefinitionVisitor(resParts); visitor.visit(formDefinition); addReferencedResourcesToIndexBuilder(builder, visitor); FormModel model = formDefinition.getModel(); if (model != null) { FormModelVisitorProvider provider = visitorProviders.get(model.getClass()); if (provider != null) { FormModelVisitor modelVisitor = provider.getVisitor(); <START> modelVisitor.index(formDefinition ,model); <END> addReferencedResourcesToIndexBuilder(builder, modelVisitor); } } } else { logger.error("Unable to read FormDefinition on " + path.toUri().toString() + "."); return null; } return builder; }</code><technical_language>Formatting</technical_language>

Target:
protected DefaultIndexBuilder fillIndexBuilder(Path path) throws Exception { final DefaultIndexBuilder builder = getIndexBuilder(path); if (builder == null) { return null; } String formContent = ioService.readAllString(path); FormDefinition formDefinition = formDefinitionSerializer.deserialize(formContent); if (formDefinition != null) { Resource resParts = new Resource(formDefinition.getName(), ResourceType.FORM); FormDefinitionVisitor visitor = new FormDefinitionVisitor(resParts); visitor.visit(formDefinition); addReferencedResourcesToIndexBuilder(builder, visitor); FormModel model = formDefinition.getModel(); if (model != null) { FormModelVisitorProvider provider = getProviderForModel(model.getClass()); if (provider != null) { FormModelVisitor modelVisitor = provider.getVisitor(); modelVisitor.index(formDefinition, model); addReferencedResourcesToIndexBuilder(builder, modelVisitor); } } } else { logger.error("Unable to read FormDefinition on " + path.toUri().toString() + "."); return null; } return builder; }
Source:
<code><START> public void testWorkflowRepresentationMarshalling_shouldMarshallWorkflowCorrectly() throws <END> SAXException, IOException, JAXBException { WorkflowRepresentation representation = createWorkflow(); WorkflowRepresentationConverter workflowRepresentationMarshaller = new WorkflowRepresentationConverter(); String converted = workflowRepresentationMarshaller.marshallWorkflow(representation); WorkflowRepresentation rep = workflowRepresentationMarshaller.unmarshallWorkflow(converted); compareActionRepresentation(representation.getRoot(), rep.getRoot()); }</code><technical_language>throws exception</technical_language>

Target:
public void testWorkflowRepresentationMarshalling_shouldMarshallWorkflowCorrectly() throws JAXBException { WorkflowRepresentation representation = createWorkflow(); WorkflowRepresentationConverter workflowRepresentationMarshaller = new WorkflowRepresentationConverter(); String converted = workflowRepresentationMarshaller.marshallWorkflow(representation); WorkflowRepresentation rep = workflowRepresentationMarshaller.unmarshallWorkflow(converted); compareActionRepresentation(representation.getRoot(), rep.getRoot()); }
Source:
<code>public void testEncodeOutputControl() { Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); Command command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_OUTPUT_CONTROL); command.set(Command.KEY_INDEX, 0); <START> command.set(Command.KEY_DATA, "1"); <END> assertEquals("(123456789012345AV001)", encoder.encodeCommand(command)); }</code><technical_language>Is this for other protocols</technical_language>

Target:
public void testEncodeOutputControl() { Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); Command command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_OUTPUT_CONTROL); command.set(Command.KEY_DATA, "1"); assertEquals("(123456789012345AV001)", encoder.encodeCommand(command)); }
Source:
<code>public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; editorComposite.setMenu(menu); if (!shouldAutoRefresh) { <START> createFormContentInternal(); <END> } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }</code><technical_language>This is recreate everything. I want instead is like: boolean recreatePage = false; foreach(section) { if(section.hasIncomingChanges()) { if(section.supportsRefresh()) { section.refresh(); } else { recreatePage = true; break; } } if(recreatePage) { disposeAllSections(); createFormContentInternal(); } I section.refresh() is do in cases attribute editors detect model change refresh themselves</technical_language>

Target:
public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; boolean recreatePage = false; for (AbstractTaskEditorSection section : sections) { if (!section.supportsRefreshing()) { recreatePage = true; break; } } if (recreatePage) { Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); for (AbstractTaskEditorSection section : sections) { section.dispose(); } sections.clear(); editorComposite.setMenu(menu); createFormContentInternal(); } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }
Source:
<code>public LnkFile parse(byte[] rawLnkShortcutByteArray) { final byte dataFlags = rawLnkShortcutByteArray[20]; final LnkFileAttribute fileAttributes = fetchFilesAttributes(rawLnkShortcutByteArray); final LnkData lnkData = fetchLnkData(rawLnkShortcutByteArray); final boolean isDirectory = fileAttributes.hasDirMask(); final boolean hasArguments = lnkData.hasArguments(); final int fileStart = fetchFileStart(rawLnkShortcutByteArray, lnkData); final byte[] rawLnkContentWithoutHeader = Arrays.copyOfRange(rawLnkShortcutByteArray, fileStart, rawLnkShortcutByteArray.length - 1); final boolean isLocal = this.isLnkLocal(rawLnkContentWithoutHeader); final String fileName = parseLnkContent(rawLnkContentWithoutHeader, isLocal); <START> return new LnkFile(isDirectory, isLocal, fileName, hasArguments); <END> }</code><technical_language>arguments? a builder sense</technical_language>

Target:
public LnkFile parse(byte[] rawLnkShortcutByteArray) { final LnkFileAttributeFlagsParser fileAttributes = fetchFilesAttributes(rawLnkShortcutByteArray); final LnkLinkFlagsParser lnkDataFlag = fetchLnkData(rawLnkShortcutByteArray); final boolean isDirectory = fileAttributes.hasDirMask(); final boolean hasArguments = lnkDataFlag.hasArguments(); final int fileStart = fetchFileStart(rawLnkShortcutByteArray, lnkDataFlag); final byte[] rawLnkContentWithoutHeader = Arrays.copyOfRange(rawLnkShortcutByteArray, fileStart, rawLnkShortcutByteArray.length - 1); final boolean isLocal = this.isLnkLocal(rawLnkContentWithoutHeader); final String fileName = parseLnkContent(rawLnkContentWithoutHeader, isLocal); final LnkStringData lnkStringData = fetchStringData( rawLnkContentWithoutHeader, lnkDataFlag); return new LnkFile(isDirectory, isLocal, fileName, hasArguments, lnkStringData); }
Source:
<code>public SeekableByteChannel buildChannel(final String key) throws IOException { final String strippedKey = Ds3ClientHelpers.stripLeadingPath(key, prefix); <START> Files.createDirectories(Paths.get(strippedKey).getParent()); <END> return this.channelBuilder.buildChannel(strippedKey); }</code><technical_language>is this ObjectChannelBuilder creating directory? wrapped ObjectChannelBuilder creating directory</technical_language>

Target:
public SeekableByteChannel buildChannel(final String key) throws IOException { return this.channelBuilder.buildChannel(Ds3ClientHelpers.stripLeadingPath(key, prefix)); }
Source:
<code>public Map getDetails() { <START> Map<String, String> detailsMap = null; <END> if (!details.isEmpty()) { detailsMap = new HashMap<String, String>(); Collection<?> servicesCollection = details.values(); Iterator<?> iter = servicesCollection.iterator(); while (iter.hasNext()) { HashMap<String, String> services = (HashMap<String, String>)iter.next(); String key = services.get("key"); String value = services.get("value"); detailsMap.put(key, value); } } return detailsMap; }</code><technical_language>getDetails return null, instead return empty hashmap</technical_language>

Target:
public Map getDetails() { Map<String, String> detailsMap = new HashMap<String, String>();; if (!details.isEmpty()) { Collection<?> servicesCollection = details.values(); Iterator<?> iter = servicesCollection.iterator(); while (iter.hasNext()) { HashMap<String, String> services = (HashMap<String, String>)iter.next(); String key = services.get("key"); String value = services.get("value"); detailsMap.put(key, value); } } return detailsMap; }
Source:
<code><START> private void changeZ(int zOffset) { <END> SceneElement element = getSelectedSceneElement(); Scene scene = getCurrentScene(); List list = scene.getChildren(); int index = list.indexOf(element); controller.command(new ReorderInListCommand(list, element, Math.max(0, Math.min(index + zOffset, list.size() - 1)))); }</code><technical_language>want #140 (action Reorder)</technical_language>

Target:
private void changeZ(int zOffset) { SceneElement element = getSelectedSceneElement(); Scene scene = getCurrentScene(); List list = scene.getChildren(); controller.action(Reorder.class, element, zOffset, true, list); }
Source:
<code>protected Object doWork() { JavaSparkContext ctx = null; if (!isDisableSpark) { <START> SparkConf sparkConf = new SparkConf().setAppName(getProgramName()) <END> .set("spark.serializer", KryoSerializer.class.getCanonicalName()) .set("spark.kryo.registrator", "org.broadinstitute.hellbender.engine.spark.GATKRegistrator") .set("spark.kryoserializer.buffer.max", "512m") .set("spark.driver.maxResultSize", "0") .set("spark.driver.userClassPathFirst", "true") .set("spark.executor.userClassPathFirst", "true") .set("spark.io.compression.codec", "lzf") .set("spark.yarn.executor.memoryOverhead", "600") .setMaster(sparkMaster); ctx = new JavaSparkContext(sparkConf); } else { logger.info("Spark disabled. sparkMaster option (" + this.sparkMaster + ") ignored."); } try{ runPipeline(ctx); return null; } finally { afterPipeline(ctx); } }</code><technical_language>patched hellbender SparkContextFactory.getSparkContext fix this problem. Update <LINK_0></technical_language>

Target:
protected Object doWork() { JavaSparkContext ctx = null; if (!isDisableSpark) { ctx = SparkContextFactory.getSparkContext(getProgramName(), sparkMaster); } else { logger.info("Spark disabled. sparkMaster option (" + this.sparkMaster + ") ignored."); } try{ runPipeline(ctx); return null; } finally { afterPipeline(ctx); } }
Source:
<code>private Number readNumberFromConfig(Config config, String parameterName) { Number paramValue; try { <START> paramValue = config.getAny(parameterName); <END> } catch (ClassCastException e) { throw new IllegalArgumentException("Required parameter " + parameterName + " should be a number."); } return paramValue; }</code><technical_language>return (Number) config.getAny(parameterName);</technical_language>

Target:
private Number readNumberFromConfig(Config config, String parameterName) { try { return config.getAny(parameterName); } catch (ClassCastException e) { throw new IllegalArgumentException("Required parameter " + parameterName + " should be a number."); } }
Source:
<code>protected IProcess addProcessToLaunch(Process p, ILaunch launch, IServer s, boolean terminal) { Map<String, String> processAttributes = new HashMap<String, String>(); String vagrantcmdloc = VagrantBinaryUtility.getVagrantLocation(s); String progName = new Path(vagrantcmdloc).lastSegment(); if( terminal ) { launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, "false"); } processAttributes.put(IProcess.ATTR_PROCESS_TYPE, progName); IProcess process = null; if( terminal ) { process = new RuntimeProcess(launch, p, vagrantcmdloc, processAttributes) { <START> protected IStreamsProxy createStreamsProxy() { <END> return null; } }; } else { process = new RuntimeProcess(launch, p, vagrantcmdloc, processAttributes); } launch.addProcess(process); return process; }</code><technical_language>chance correct identation helps reading code</technical_language>

Target:
protected IProcess addProcessToLaunch(Process p, ILaunch launch, IServer s, boolean terminal) { String cmdLoc = VagrantBinaryUtility.getVagrantLocation(s); return addProcessToLaunch(p, launch, s, terminal, cmdLoc); }
Source:
<code>public void testCreateNoteWithSubject() throws IOException, SchedulerException, RepositoryException { AuthenticationInfo subject = new AuthenticationInfo("user1"); Note note = notebook.createNote(subject); <START> Notebook notebook = new Notebook( <END> conf, notebookRepo, schedulerFactory, new InterpreterFactory(conf, null, null, null, depResolver), this, null, notebookAuthorization, null); assertNotNull(notebook.getNotebookAuthorization().getOwners(note.getId())); assertEquals(1, notebook.getNotebookAuthorization().getOwners(note.getId()).size()); Set<String> owners = new HashSet<>(); owners.add("user1"); assertEquals(owners, notebook.getNotebookAuthorization().getOwners(note.getId())); }</code><technical_language>creating new notebook instance here? reused previous one,</technical_language>

Target:
public void testCreateNoteWithSubject() throws IOException, SchedulerException, RepositoryException { AuthenticationInfo subject = new AuthenticationInfo("user1"); Note note = notebook.createNote(subject); assertNotNull(notebook.getNotebookAuthorization().getOwners(note.getId())); assertEquals(1, notebook.getNotebookAuthorization().getOwners(note.getId()).size()); Set<String> owners = new HashSet<>(); owners.add("user1"); assertEquals(owners, notebook.getNotebookAuthorization().getOwners(note.getId())); }
Source:
<code>public List<Media> searchImages(String query, int offset) { List<CustomApiResult> imageNodes = null; List<CustomApiResult> authorNodes = null; CustomApiResult apiResult=null; try { apiResult= api.action("query") .param("format", "xml") .param("generator", "search") .param("gsrwhat", "text") .param("gsrnamespace", "6") .param("gsrlimit", "25") .param("gsroffset",offset) .param("gsrsearch", query) .param("prop", "imageinfo") .param("iiprop", "url|extmetadata") .get(); <START> imageNodes= apiResult.getNodes("/api/query/pages/page/@title"); <END> authorNodes= apiResult.getNodes("/api/query/pages/page/imageinfo/ii/@user"); } catch (IOException e) { Timber.e(e, "Failed to obtain searchImages"); } if (imageNodes == null) { return new ArrayList<>(); } CustomApiResult searchImagesNode = apiResult.getNode("/api/query/pages"); if (searchImagesNode == null || searchImagesNode.getDocument() == null || searchImagesNode.getDocument().getChildNodes() == null || searchImagesNode.getDocument().getChildNodes().getLength() == 0) { return new ArrayList<>(); } NodeList childNodes = searchImagesNode.getDocument().getChildNodes(); return CategoryImageUtils.getMediaList(childNodes); }</code><technical_language>imageNodes authorNodes is longer used. remove it</technical_language>

Target:
public List<Media> searchImages(String query, int offset) { CustomApiResult apiResult=null; try { apiResult= api.action("query") .param("format", "xml") .param("generator", "search") .param("gsrwhat", "text") .param("gsrnamespace", "6") .param("gsrlimit", "25") .param("gsroffset",offset) .param("gsrsearch", query) .param("prop", "imageinfo") .param("iiprop", "url|extmetadata") .get(); } catch (IOException e) { Timber.e(e, "Failed to obtain searchImages"); } CustomApiResult searchImagesNode = apiResult.getNode("/api/query/pages"); if (searchImagesNode == null || searchImagesNode.getDocument() == null || searchImagesNode.getDocument().getChildNodes() == null || searchImagesNode.getDocument().getChildNodes().getLength() == 0) { return new ArrayList<>(); } NodeList childNodes = searchImagesNode.getDocument().getChildNodes(); return CategoryImageUtils.getMediaList(childNodes); }
Source:
<code>protected boolean ConcreteAddVmImages(Guid itGuid) { boolean ret = true; if (getVmDisks().size() > 0) { for (Disk diskInfo : getVmDisks()) { VdcReturnValueBase tmpRetValue = null; AddImageFromScratchParameters tempVar = new AddImageFromScratchParameters(itGuid, getParameters() .getVmStaticData().getId(), (DiskImage) diskInfo); tempVar.setStorageDomainId(this.getStorageDomainId().getValue()); tempVar.setVmSnapshotId(getVmSnapshotId()); tempVar.setParentCommand(VdcActionType.AddVmFromScratch); tempVar.setEntityId(getParameters().getEntityId()); tempVar.setParentParameters(getParameters()); tmpRetValue = Backend.getInstance().runInternalAction( VdcActionType.AddImageFromScratch, tempVar, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!tmpRetValue.getSucceeded()) { log.error("AddVmFromScratchCommand::ConcreteAddVmImages: AddImageFromScratch Command failed."); ret = false; } else { getReturnValue().getTaskIdList().addAll(tmpRetValue.getInternalTaskIdList()); } } VmHandler.LockVm(getParameters().getVmStaticData().getId()); } else { <START> getVmDAO().incrementVmDbGeneration(getParameters().getVmStaticData().getId()); <END> } return ret; }</code><technical_language>Missed previous review. Question - getVmDao()? VmStaticDao()</technical_language>

Target:
protected boolean ConcreteAddVmImages(Guid itGuid) { boolean ret = true; if (getVmDisks().size() > 0) { for (Disk diskInfo : getVmDisks()) { VdcReturnValueBase tmpRetValue = null; AddImageFromScratchParameters tempVar = new AddImageFromScratchParameters(itGuid, getParameters() .getVmStaticData().getId(), (DiskImage) diskInfo); tempVar.setStorageDomainId(this.getStorageDomainId().getValue()); tempVar.setVmSnapshotId(getVmSnapshotId()); tempVar.setParentCommand(VdcActionType.AddVmFromScratch); tempVar.setEntityId(getParameters().getEntityId()); tempVar.setParentParameters(getParameters()); tmpRetValue = Backend.getInstance().runInternalAction( VdcActionType.AddImageFromScratch, tempVar, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!tmpRetValue.getSucceeded()) { log.error("AddVmFromScratchCommand::ConcreteAddVmImages: AddImageFromScratch Command failed."); ret = false; } else { getReturnValue().getTaskIdList().addAll(tmpRetValue.getInternalTaskIdList()); } } VmHandler.LockVm(getParameters().getVmStaticData().getId()); } else { updateVmInSpm(getVm().getstorage_pool_id(), Arrays.asList(getVm())); } return ret; }
Source:
<code><START> public static <T> String validationMethodFormatted(ConstraintViolation<T> v) { <END> final ImmutableList<Path.Node> nodes = ImmutableList.copyOf(v.getPropertyPath()); final ImmutableList<Path.Node> usefulNodes = nodes.subList(0, nodes.size() - 1); final String msg = v.getMessage().startsWith(".") ? "%s%s" : "%s %s"; return String.format(msg, Joiner.on('.').join(usefulNodes), v.getMessage()).trim(); }</code><technical_language>reuse Joiner String.format. java public static <T> String validationMethodFormatted(ConstraintViolation<T> v) { final ImmutableList<Path.Node> nodes = ImmutableList.copyOf(v.getPropertyPath()); String usefulNodes = JOINER.join(nodes.subList(0, nodes.size() - 1)); String msg = usefulNodes + (v.getMessage().startsWith(".") ? "" : " ") + v.getMessage(); return msg.trim(); } Micro-benchmark, kindly provided you, this machine: Benchmark Mode Cnt Score Error Units ConstraintViolationBenchmark.objViolation avgt 5 711.064 +- 22.911 ns/op ConstraintViolationBenchmark.paramViolation avgt 5 7400.960 +- 2268.245 ns/op Benchmark Mode Cnt Score Error Units ConstraintViolationBenchmark.objViolation avgt 5 693.016 +- 10.078 ns/op ConstraintViolationBenchmark.paramViolation avgt 5 6585.522 +- 815.698 ns/op</technical_language>

Target:
public static <T> String validationMethodFormatted(ConstraintViolation<T> v) { final ImmutableList<Path.Node> nodes = ImmutableList.copyOf(v.getPropertyPath()); String usefulNodes = DOT_JOINER.join(nodes.subList(0, nodes.size() - 1)); String msg = usefulNodes + (v.getMessage().startsWith(".") ? "" : " ") + v.getMessage(); return msg.trim(); }
Source:
<code>private Vector<String> groupsFor(DirContext ctx, String dn) { Vector<String> out = new Vector<String>(); String parentDn; try { String attNames[] = { groupName, accountMemberField }; Attributes groupAtts = ctx.getAttributes(dn, attNames); <START> String cn = String.valueOf(groupAtts.get(groupName)); <END> cn = cn.replace(groupName + ": ", ""); out.add(cn); Attribute parentAttrs = ctx.getAttributes(dn).get(accountMemberField); if (parentAttrs != null) { NamingEnumeration parents = parentAttrs.getAll(); while (parents.hasMore()) { parentDn = String.valueOf(parents.next()); out.addAll(groupsFor(ctx, parentDn)); } } } catch (NamingException e) { } return out; }</code><technical_language>above, able unpack a String String.valueOf</technical_language>

Target:
private ArrayList<String> groupsFor(DirContext ctx, String dn) throws NamingException { ArrayList<String> out = new ArrayList<String>(); String parentDn; try { String attNames[] = { groupName, accountMemberField }; Attributes groupAtts = ctx.getAttributes(dn, attNames); String cn = (String) groupAtts.get(groupName).get(); out.add(cn); Attribute parentAttrs = ctx.getAttributes(dn).get(accountMemberField); if (parentAttrs != null) { NamingEnumeration parents = parentAttrs.getAll(); while (parents.hasMore()) { parentDn = String.valueOf(parents.next()); out.addAll(groupsFor(ctx, parentDn)); } } } catch (NamingException e) { log.warn("Could not find dn", e); } return out; }
Source:
<code>public List<String> getUsernames(){ ArrayList<String> usernames = new ArrayList<String>(); <START> Iterator<Entry<String, String>> it = connectedUsers.entrySet().iterator(); <END> while (it.hasNext()) { Entry<String, String> entry = it.next(); usernames.add(entry.getKey()); } return usernames; }</code><technical_language>name this other it? i it</technical_language>

Target:
public List<String> getUsernames(){ ArrayList<String> usernames = new ArrayList<String>(); Iterator<Entry<String, String>> userListIterator = connectedUsers.entrySet().iterator(); while (userListIterator.hasNext()) { Entry<String, String> entry = userListIterator.next(); usernames.add(entry.getKey()); } return usernames; }
Source:
<code>public Map<Long, DrawableDbBuildStatusEnum> getDataSourceDbBuildStatus() throws TskCoreException { Statement statement = null; ResultSet rs = null; Map<Long, DrawableDbBuildStatusEnum> map = new HashMap<>(); dbReadLock(); try { statement = con.createStatement(); rs = statement.executeQuery("SELECT ds_obj_id, drawable_db_build_status FROM datasources "); while (rs.next()) { <START> map.put(rs.getLong(1), DrawableDbBuildStatusEnum.valueOf(rs.getString(2))); <END> } } catch (SQLException e) { throw new TskCoreException("SQLException while getting data source object ids", e); } finally { if (rs != null) { try { rs.close(); } catch (SQLException ex) { LOGGER.log(Level.SEVERE, "Error closing resultset", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { LOGGER.log(Level.SEVERE, "Error closing statement ", ex); } } dbReadUnlock(); } return map; }</code><technical_language>I strongly advise indices get values out of a result set. is easy change query forget change indices leading bugs. In addition I if column order is guaranteed consistent JDBC drivers</technical_language>

Target:
public Map<Long, DrawableDbBuildStatusEnum> getDataSourceDbBuildStatus() throws TskCoreException { Statement statement = null; ResultSet rs = null; Map<Long, DrawableDbBuildStatusEnum> map = new HashMap<>(); dbReadLock(); try { statement = con.createStatement(); rs = statement.executeQuery("SELECT ds_obj_id, drawable_db_build_status FROM datasources "); while (rs.next()) { map.put(rs.getLong("ds_obj_id"), DrawableDbBuildStatusEnum.valueOf(rs.getString("drawable_db_build_status"))); } } catch (SQLException e) { throw new TskCoreException("SQLException while getting data source object ids", e); } finally { if (rs != null) { try { rs.close(); } catch (SQLException ex) { LOGGER.log(Level.SEVERE, "Error closing resultset", ex); } } if (statement != null) { try { statement.close(); } catch (SQLException ex) { LOGGER.log(Level.SEVERE, "Error closing statement ", ex); } } dbReadUnlock(); } return map; }
Source:
<code>protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion, <START> @Named(LocationConstants.PROPERTY_REGION) String region) { <END> Supplier<Map<String, Supplier<URI>>> endpointsSupplier = factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion); if (!Strings.isNullOrEmpty(region)) { return getSpecificValueInMap(endpointsSupplier, region); } else { return getLastValueInMap(endpointsSupplier); } }</code><technical_language>this marked @Nullable? Also, if null _is_ a valid valid, default in metadata null</technical_language>

Target:
protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion, @Named(LocationConstants.PROPERTY_REGION) String region) { Supplier<Map<String, Supplier<URI>>> endpointsSupplier = factory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, apiVersion); if (region.isEmpty()) { return getLastValueInMap(endpointsSupplier); } else { return getValueInMapOrNull(endpointsSupplier, region); } }
Source:
<code>public void testMessageCustomCorrelation() throws Exception { this.fooMessage.getMessageProperties().setCorrelationId("foo".getBytes()); ListenableFuture<Message> future = this.template.sendAndReceive(this.fooMessage); Message result = checkMessageResult(future, "FOO"); <START> assertEquals(new String("foo"), new String(result.getMessageProperties().getCorrelationId())); <END> }</code><technical_language>Overdid: "foo" is String :smile:</technical_language>

Target:
public void testMessageCustomCorrelation() throws Exception { this.fooMessage.getMessageProperties().setCorrelationId("foo".getBytes()); ListenableFuture<Message> future = this.template.sendAndReceive(this.fooMessage); Message result = checkMessageResult(future, "FOO"); assertEquals("foo", new String(result.getMessageProperties().getCorrelationId())); }
Source:
<code>public MongoDbFactory mongoDbFactory() throws IOException { Properties properties = new Properties(); properties.load(MongoConfiguration.class.getResourceAsStream("/eva.properties")); MongoClient mongoClient = DBAdaptorConnector.getMongoClient(properties); <START> return new MultiMongoDbFactory(mongoClient, "test"); <END> }</code><technical_language>If this related tests a defaultDataBaseName "test" clearer</technical_language>

Target:
public MongoDbFactory mongoDbFactory() throws IOException { Properties properties = new Properties(); properties.load(MongoConfiguration.class.getResourceAsStream("/eva.properties")); MongoClient mongoClient = DBAdaptorConnector.getMongoClient(properties); return new MultiMongoDbFactory(mongoClient, "unusedDefaultDB"); }
Source:
<code><START> private ParquetProperties(WriterVersion writerVersion, int pageSize, int dictPageSize, boolean enableDict, int minRowCountForPageSizeCheck, <END> int maxRowCountForPageSizeCheck, boolean estimateNextSizeCheck, ByteBufferAllocator allocator, ValuesWriterFactory writerFactory) { this.pageSizeThreshold = pageSize; int initialSlabSize = CapacityByteArrayOutputStream .initialSlabSizeHeuristic(MIN_SLAB_SIZE, pageSizeThreshold, 10); this.dictionaryPageSizeThreshold = dictPageSize; this.writerVersion = writerVersion; this.enableDictionary = enableDict; this.minRowCountForPageSizeCheck = minRowCountForPageSizeCheck; this.maxRowCountForPageSizeCheck = maxRowCountForPageSizeCheck; this.estimateNextSizeCheck = estimateNextSizeCheck; this.allocator = allocator; ValuesWriterFactoryParams params = new ValuesWriterFactoryParams(writerVersion, initialSlabSize, pageSizeThreshold, allocator, enableDictionary, dictionaryPageSizeThreshold); valuesWriterFactory = writerFactory; valuesWriterFactory.initialize(params); }</code><technical_language>story for configurable properties here? If writes a custom ValuesWriterFactory, totally reasonable other non-default settings configure. this is supported in hadoop (if all) I imagine fetching settings parquet.writer.writerProperties.* something</technical_language>

Target:
private ParquetProperties(WriterVersion writerVersion, int pageSize, int dictPageSize, boolean enableDict, int minRowCountForPageSizeCheck, int maxRowCountForPageSizeCheck, boolean estimateNextSizeCheck, ByteBufferAllocator allocator, ValuesWriterFactory writerFactory) { this.pageSizeThreshold = pageSize; this.initialSlabSize = CapacityByteArrayOutputStream .initialSlabSizeHeuristic(MIN_SLAB_SIZE, pageSizeThreshold, 10); this.dictionaryPageSizeThreshold = dictPageSize; this.writerVersion = writerVersion; this.enableDictionary = enableDict; this.minRowCountForPageSizeCheck = minRowCountForPageSizeCheck; this.maxRowCountForPageSizeCheck = maxRowCountForPageSizeCheck; this.estimateNextSizeCheck = estimateNextSizeCheck; this.allocator = allocator; this.valuesWriterFactory = writerFactory; }
Source:
<code>default void validateParameters(long bucketCount, double sample, double weight, double min, double max) { <START> throw new UnsupportedOperationException( <END> format("Unsupported arguments for type: %s", getClass().getSimpleName())); }</code><technical_language>nit: put statement line; ditto other methods</technical_language>

Target:
default void validateParameters(long bucketCount, double sample, double weight, double min, double max) { throw new UnsupportedOperationException( format("In differential_entropy UDF, unsupported arguments for type: %s", getClass().getSimpleName())); }
Source:
<code>private static String expressionLogicalOr(Set<String> fileExts) { StringBuilder pattern = new StringBuilder("("); for (String ext : fileExts) { if (pattern.length() != 1) <START> pattern.append("|"); <END> pattern.append("(").append(Pattern.quote(ext)); pattern.append(")"); ext = ext.toUpperCase(); if (!fileExts.contains(ext)) { pattern.append("|(").append(Pattern.quote(ext)); pattern.append(")"); } } pattern.append(")"); return pattern.toString(); }</code><technical_language>'|' Similar below</technical_language>

Target:
private static String expressionLogicalOr(Set<String> fileExts) { StringBuilder pattern = new StringBuilder('('); for (String ext : fileExts) { if (pattern.length() != 1) pattern.append('|'); pattern.append('(').append(Pattern.quote(ext)); pattern.append(')'); ext = ext.toUpperCase(); if (!fileExts.contains(ext)) { pattern.append("|(").append(Pattern.quote(ext)); pattern.append(')'); } } pattern.append(')'); return pattern.toString(); }
Source:
<code>public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { <START> if(tab == EsteemedInnovation.tab) { <END> for (int i = 0; i < ArmorModule.MAX_PLATE_META; i++) { items.add(ArmorModule.plateStack(i)); } } }</code><technical_language>ItemMetalNugget</technical_language>

Target:
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (isInCreativeTab(tab)) { for (int i = 0; i < ArmorModule.MAX_PLATE_META; i++) { items.add(ArmorModule.plateStack(i)); } } }