auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void parseModuleDeclaration() { <START> JavaParser.getStaticConfiguration().setLanguageLevel(JAVA_9); <END> JavaParser.parseModuleDeclaration("module X {}"); }</code><technical_language>Is good change static configuration in a test</technical_language>

Target:
public void parseModuleDeclaration() { JavaParser.parseModuleDeclaration("module X {}"); }
Source:
<code>public List<EntryDTO> getNotificationsBySourceAndCustomAttribute(String source, String attributeName, String attributeValue) { Validate.notBlank(source, "Argument 'source' cannot be blank"); <START> Validate.notBlank(source, "Argument 'attributeName' cannot be blank"); <END> logger.debug("Invoking getNotificationsBySourceAndCustomAttribute with " + "source='{}', attributeName='{}', attributeValue='{}'", source, attributeName, attributeValue); final List<JpaEntry> entries = notificationDao.getNotificationsBySourceAndCustomAttribute(source, attributeName, attributeValue); logger.debug("Found the following entries: {}", entries.size(), entries); return notificationMapper.toEntryList(entries); }</code><technical_language>line 89 java Validate.notBlank(attributeName, "Argument 'attributeName' blank");</technical_language>

Target:
public List<EntryDTO> getNotificationsBySourceAndCustomAttribute(String source, String attributeName, String attributeValue) { Validate.notBlank(source, "Argument 'source' cannot be blank"); Validate.notBlank(attributeName, "Argument 'attributeName' cannot be blank"); logger.debug("Invoking getNotificationsBySourceAndCustomAttribute with " + "source='{}', attributeName='{}', attributeValue='{}'", source, attributeName, attributeValue); final List<JpaEntry> entries = notificationDao.getNotificationsBySourceAndCustomAttribute(source, attributeName, attributeValue); logger.debug("Found the following entries: {}", entries.size(), entries); return notificationMapper.toEntryList(entries); }
Source:
<code>public void getReserveStatisticsShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); <START> final CountDownLatch latch = new CountDownLatch(1); <END> final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final ReserveService reserveService = adapter.create(ReserveService.class); reserveService.getStatistics(new RetrofitPromise<List<ReserveStatistics>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/reserve/statistics", MOCK_URL)); }</code><technical_language>get rid of CountDownLatch here</technical_language>

Target:
public void getReserveStatisticsShouldReturnTheRequest() throws Exception { final MockRestAdapter<List<ReserveStatistics>> adapter = new MockRestAdapter<>(null, null, null); adapter.request(new RepromiseFunction<BitreserveRestAdapter, List<ReserveStatistics>>() { @Override public Promise<List<ReserveStatistics>> call(BitreserveRestAdapter bitreserveRestAdapter) { ReserveService reserveService = adapter.getRestAdapter().create(ReserveService.class); RetrofitPromise<List<ReserveStatistics>> promise = new RetrofitPromise<>(); reserveService.getStatistics(promise); return promise; } }); Request request = adapter.getRequest(); Assert.assertEquals(request.getMethod(), "GET"); Assert.assertEquals(request.getUrl(), "<LINK_0>"); }
Source:
<code>public String toString() { <START> StringBuffer buffer = new StringBuffer(); <END> buffer.append(super.toString()); buffer.append(":"); buffer.append(value == null ? "" : value); buffer.append("^"); buffer.append(boost); return buffer.toString(); }</code><technical_language>StringBuilder</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(super.toString()); builder.append(value == null ? "" : value); builder.append("^").append(boost); return builder.toString(); }
Source:
<code>public void writeOne() throws IOException { QueueEntry qe = queue.poll(); if (qe != null) { int read = qe.messageStream.read(outBytes); <START> if (LogUtil.isLogAvailable()) { <END> Log.i(TAG, "Message " + qe.messageNo + " written, it's a " + qe.messageClass.getSimpleName() + ", " + read + " bytes in length"); } outStream.write(outBytes, 0, read); int left = qe.messageStream.available(); if (left > 0) { if (LogUtil.isLogAvailable()) { Log.i(TAG, "Message " + qe.messageNo + ", " + left + " bytes left to write"); } queue.add(qe); } else { if (LogUtil.isLogAvailable()) { Log.i(TAG, "Message " + qe.messageNo + " finished writing"); } } } }</code><technical_language>suggest making log messages verbose</technical_language>

Target:
public void writeOne() throws IOException { QueueEntry qe = queue.poll(); if (qe != null) { int read = qe.messageStream.read(outBytes); if (LogUtil.isLogAvailable()) { Log.d(TAG, "Message " + qe.messageNo + " written, it's a " + qe.messageClass.getSimpleName() + ", " + read + " bytes in length"); } outStream.write(outBytes, 0, read); int left = qe.messageStream.available(); if (left > 0) { if (LogUtil.isLogAvailable()) { Log.d(TAG, "Message " + qe.messageNo + ", " + left + " bytes left to write"); } queue.add(qe); } else { if (LogUtil.isLogAvailable()) { Log.i(TAG, "Message " + qe.messageNo + " finished writing"); } } } }
Source:
<code><START> @Override public CauseOfBlockage getCauseOfBlockage() { <END> if (isLogUpdated() && !isConcurrentBuild()) { return new BlockedBecauseOfBuildInProgress(getLastBuild()); } if (blockBuildWhenDownstreamBuilding()) { AbstractProject<?,?> bup = getBuildingDownstream(); if (bup!=null) return new BecauseOfDownstreamBuildInProgress(bup); } if (blockBuildWhenUpstreamBuilding()) { AbstractProject<?,?> bup = getBuildingUpstream(); if (bup!=null) return new BecauseOfUpstreamBuildInProgress(bup); } return null; }</code><technical_language>ant: for follow convention in this file</technical_language>

Target:
public CauseOfBlockage getCauseOfBlockage() { if (isLogUpdated() && !isConcurrentBuild()) { return new BlockedBecauseOfBuildInProgress(getLastBuild()); } if (blockBuildWhenDownstreamBuilding()) { AbstractProject<?,?> bup = getBuildingDownstream(); if (bup!=null) return new BecauseOfDownstreamBuildInProgress(bup); } if (blockBuildWhenUpstreamBuilding()) { AbstractProject<?,?> bup = getBuildingUpstream(); if (bup!=null) return new BecauseOfUpstreamBuildInProgress(bup); } return null; }
Source:
<code>public Response redirectIndexHtml( @HeaderParam(X_FORWARDED_PROTO) String proto, @Context UriInfo uriInfo) { if (isNullOrEmpty(proto)) { proto = uriInfo.getRequestUri().getScheme(); } return Response.status(MOVED_PERMANENTLY) <START> .location(UriBuilder.fromPath("/ui/").scheme(proto).build()) <END> .build(); }</code><technical_language>static import fromPath (as was)</technical_language>

Target:
public Response redirectIndexHtml( @HeaderParam(X_FORWARDED_PROTO) String proto, @Context UriInfo uriInfo) { if (isNullOrEmpty(proto)) { proto = uriInfo.getRequestUri().getScheme(); } return Response.status(MOVED_PERMANENTLY) .location(fromPath("/ui/").scheme(proto).build()) .build(); }
Source:
<code>public void initializeEditorFragment() { if (mEditorFragment instanceof AztecEditorFragment) { AztecEditorFragment aztecEditorFragment = (AztecEditorFragment)mEditorFragment; aztecEditorFragment.setEditorBetaClickListener(EditPostActivity.this); <START> aztecEditorFragment.setAztecImageLoader(new AztecImageLoader(getBaseContext(), aztecEditorFragment.loadingImagePlaceholder)); <END> aztecEditorFragment.setAztecVideoLoader(new AztecVideoLoader(getBaseContext(), aztecEditorFragment.loadingVideoPlaceholder)); } }</code><technical_language>loadingImagePlaceholder loadingVideoPlaceholder exist onCreateView of AztecEditorFragment is called, I a feeling this lead some unforeseen consequences in a future. do lazy loading here? do think</technical_language>

Target:
public void initializeEditorFragment() { if (mEditorFragment instanceof AztecEditorFragment) { AztecEditorFragment aztecEditorFragment = (AztecEditorFragment)mEditorFragment; aztecEditorFragment.setEditorBetaClickListener(EditPostActivity.this); Drawable loadingImagePlaceholder = getResources().getDrawable(org.wordpress.android.editor.R.drawable.ic_gridicons_image); loadingImagePlaceholder.setBounds(0, 0, AztecEditorFragment.DEFAULT_MEDIA_PLACEHOLDER_DIMENSION_DP, AztecEditorFragment.DEFAULT_MEDIA_PLACEHOLDER_DIMENSION_DP); aztecEditorFragment.setAztecImageLoader(new AztecImageLoader(getBaseContext(), loadingImagePlaceholder)); aztecEditorFragment.setLoadingImagePlaceholder(loadingImagePlaceholder); Drawable loadingVideoPlaceholder = getResources().getDrawable(org.wordpress.android.editor.R.drawable.ic_gridicons_video_camera); loadingVideoPlaceholder.setBounds(0, 0, AztecEditorFragment.DEFAULT_MEDIA_PLACEHOLDER_DIMENSION_DP, AztecEditorFragment.DEFAULT_MEDIA_PLACEHOLDER_DIMENSION_DP); aztecEditorFragment.setAztecVideoLoader(new AztecVideoLoader(getBaseContext(), loadingVideoPlaceholder)); aztecEditorFragment.setLoadingVideoPlaceholder(loadingVideoPlaceholder); } }
Source:
<code>public static <T> TabbedListItemsPage createWithJson(String targetType, String property, Stream<T> tabItems, Function<T, String> getName, Function<T, Object> getValue) { ObjectMapper mapper = new ObjectMapper(); return new TabbedListItemsPage(targetType, property, tabItems.collect(Collectors.toMap(getName, v -> { try { return mapper.writeValueAsString(getValue.apply(v)); } catch (JsonProcessingException e) { <START> log.error("Failed to serialised tab value as JSON", e); <END> return null; } }, (left, right) -> left, TreeMap::new))); }</code><technical_language>Rethrow a runtime exception instead of returning null. Returning null exception anyway, is clear</technical_language>

Target:
public static <T> TabbedListItemsPage createWithJson(String targetType, String property, Stream<T> tabItems, Function<T, String> getName, Function<T, Object> getValue) { ObjectMapper mapper = new ObjectMapper(); return new TabbedListItemsPage(targetType, property, tabItems.collect(Collectors.toMap(getName, v -> { try { return mapper.writeValueAsString(getValue.apply(v)); } catch (JsonProcessingException e) { throw new IllegalStateException("Failed to serialised tab value as JSON", e); } }, (left, right) -> left, TreeMap::new))); }
Source:
<code>private void processUpdates(List<Update> updates) throws Exception { for (Update update : updates) { log.debug("Received update from Telegram service: " + update); <START> Exchange exchange = endpoint.createExchange(); <END> if (update.getMessage() != null) { exchange.getIn().setBody(update.getMessage()); if (update.getMessage().getChat() != null) { exchange.getIn().setHeader(TelegramConstants.TELEGRAM_CHAT_ID, update.getMessage().getChat().getId()); } } getProcessor().process(exchange); } }</code><technical_language>overload createExchange method endpoint in parameters create exchange is specific of this component, code part of createExchange(a, b) method</technical_language>

Target:
private void processUpdates(List<Update> updates) throws Exception { for (Update update : updates) { log.debug("Received update from Telegram service: {}", update); Exchange exchange = endpoint.createExchange(update); getProcessor().process(exchange); } }
Source:
<code>private void skip(int items) throws IOException { if (presentStream != null) { int dataToSkip = presentStream.countBitsSet(items); if (inDictionaryStream != null) { inDictionaryStream.skip(dataToSkip); } <START> if (dataStream != null) { <END> dataStream.skip(dataToSkip); } } else { if (inDictionaryStream != null) { inDictionaryStream.skip(items); } dataStream.skip(items); } }</code><technical_language>dataStream null, it</technical_language>

Target:
private void skip(int items) throws IOException { if (presentStream != null) { int dataToSkip = presentStream.countBitsSet(items); if (inDictionaryStream != null) { inDictionaryStream.skip(dataToSkip); } dataStream.skip(dataToSkip); } else { if (inDictionaryStream != null) { inDictionaryStream.skip(items); } dataStream.skip(items); } }
Source:
<code>private void refresh(VirtualItem item) { getContentProvider().preserveState(getTreePathFromItem(item)); if (!item.needsDataUpdate()) { if (item.getParent() != null) { item.setNeedsLabelUpdate(); virtualLazyUpdateHasChildren(item); } for (VirtualItem <START> item2 : <END> item.getItems()) { item2.setNeedsDataUpdate(); } } refreshStruct(item); }</code><technical_language>rename childItem</technical_language>

Target:
private void refresh(VirtualItem item) { getContentProvider().preserveState(getTreePathFromItem(item)); if (!item.needsDataUpdate()) { if (item.getParent() != null) { item.setNeedsLabelUpdate(); virtualLazyUpdateHasChildren(item); } for (VirtualItem childItem : item.getItems()) { childItem.setNeedsDataUpdate(); } } refreshStruct(item); }
Source:
<code>private String getClassName(TestIdentifier testIdentifier) { if (testIdentifier.isContainer()) { return testIdentifier.getLegacyReportingName(); } return parentDisplayName(testIdentifier); <START> } <END></code><technical_language>I leave getClassName() getMethodName() is _only_ pass PojoStackTraceWriter "optimize" stacktrace</technical_language>

Target:
private Optional<String> getClassName(TestIdentifier testIdentifier) { TestSource testSource = testIdentifier.getSource().orElse(null); if (testSource instanceof ClassSource) { return Optional.of(((ClassSource) testSource).getJavaClass().getName()); } if (testSource instanceof MethodSource) { return Optional.of(((MethodSource) testSource).getClassName()); } return Optional.empty(); }
Source:
<code>private void emitInsertOrUpdateObjectToRealmMethod(JavaWriter writer) throws IOException { writer.emitAnnotation("Override"); writer.beginMethod( "void", <START> "insertOrUpdateToRealm", <END> EnumSet.of(Modifier.PUBLIC), "Realm", "realm", "RealmModel", "obj", "Map<RealmModel, Long>", "cache"); writer.emitSingleLineComment("This cast is correct because obj is either"); writer.emitSingleLineComment("generated by RealmProxy or the original type extending directly from RealmObject"); writer.emitStatement("@SuppressWarnings(\"unchecked\") Class<RealmModel> clazz = (Class<RealmModel>) ((obj instanceof RealmObjectProxy) ? obj.getClass().getSuperclass() : obj.getClass())"); writer.emitEmptyLine(); emitMediatorSwitch(new ProxySwitchStatement() { @Override public void emitStatement(int i, JavaWriter writer) throws IOException { writer.emitStatement("%s.insertOrUpdate(realm, (%s) obj, cache)", proxyClasses.get(i), simpleModelClasses.get(i)); } }, writer, false); writer.endMethod(); writer.emitEmptyLine(); }</code><technical_language>InsertOrUpdateObject</technical_language>

Target:
private void emitInsertOrUpdateObjectToRealmMethod(JavaWriter writer) throws IOException { writer.emitAnnotation("Override"); writer.beginMethod( "void", "insertOrUpdate", EnumSet.of(Modifier.PUBLIC), "Realm", "realm", "RealmModel", "obj", "Map<RealmModel, Long>", "cache"); writer.emitSingleLineComment("This cast is correct because obj is either"); writer.emitSingleLineComment("generated by RealmProxy or the original type extending directly from RealmObject"); writer.emitStatement("@SuppressWarnings(\"unchecked\") Class<RealmModel> clazz = (Class<RealmModel>) ((obj instanceof RealmObjectProxy) ? obj.getClass().getSuperclass() : obj.getClass())"); writer.emitEmptyLine(); emitMediatorSwitch(new ProxySwitchStatement() { @Override public void emitStatement(int i, JavaWriter writer) throws IOException { writer.emitStatement("%s.insertOrUpdate(realm, (%s) obj, cache)", proxyClasses.get(i), simpleModelClasses.get(i)); } }, writer, false); writer.endMethod(); writer.emitEmptyLine(); }
Source:
<code><START> public PieChart getTimeRangePC() { <END> return fTimeRangePC; }</code><technical_language>For this method package visible</technical_language>

Target:
PieChart getTimeRangePC() { return fTimeRangePC; }
Source:
<code>public boolean isEnableForComponent(Component invoker) { Context ctx = View.getSingleton().getSiteTreePanel().getSelectedContext(); if (ctx == null) { return false; } <START> return invoker.getName().equals(SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME); <END> }</code><technical_language>suggest inverting order of ifs, check this first, if true check selection (no need check if selected if invoking in contexts tree)</technical_language>

Target:
public boolean isEnableForComponent(Component invoker) { if (invoker.getName().equals(SiteMapPanel.CONTEXT_TREE_COMPONENT_NAME)) { Context ctx = View.getSingleton().getSiteTreePanel().getSelectedContext(); if (ctx != null) { return true; } } return false; }
Source:
<code>public static Set<String> getCompletionKeywords() { Set<String> defaultCompletions = new ArrayList<>(Arrays.asList(QualifierType.values())).stream() .map(QualifierType::name) .map(String::toLowerCase) .collect(Collectors.toSet()); defaultCompletions.addAll(Arrays.asList( <START> "creator", "user", "status", "body", "closed", "open", "issue", "pr", "pullrequest", <END> "read", "unread", "merged", "unmerged", "comments", "nonSelfUpdate")); defaultCompletions.remove("is"); return Collections.unmodifiableSet(defaultCompletions); }</code><technical_language>I wondering if a stream of aliases.keys here; this more manageable aliases grow in size. filter keys lengths more 2 3. I noticed desc is completions. Is intended</technical_language>

Target:
public static Set<String> getCompletionKeywords() { Set<String> defaultCompletions = new ArrayList<>(Arrays.asList(QualifierType.values())).stream() .map(QualifierType::name) .map(String::toLowerCase) .collect(Collectors.toSet()); defaultCompletions.removeAll(Arrays.asList("false", "empty", "keyword")); defaultCompletions.addAll(ALIASES.keySet()); defaultCompletions.removeAll(Arrays.asList("m", "as", "au", "s")); defaultCompletions.addAll(Arrays.asList("closed", "open", "issue", "pr", "pullrequest", "read", "unread", "merged", "unmerged", "comments", "nonSelfUpdate")); return Collections.unmodifiableSet(defaultCompletions); }
Source:
<code>public DataAccessEditPage(PageParameters parameters) { String wsName = parameters.get(WS_NAME).toOptionalString(); String storeName = parameters.get(STORE_NAME).toString(); DataStoreInfo dsi = getCatalog().getDataStoreByName(wsName, storeName); if(dsi == null) { getSession().error( new ParamResourceModel("DataAccessEditPage.notFound", this, wsName, storeName).getString() ); doReturn(StorePage.class); return; } <START> try { <END> initUI(dsi); } catch (IllegalArgumentException e) { getSession().error(e.getMessage()); doReturn(StorePage.class); } }</code><technical_language>update header 2016</technical_language>

Target:
public DataAccessEditPage(PageParameters parameters) { String wsName = parameters.get(WS_NAME).toOptionalString(); String storeName = parameters.get(STORE_NAME).toString(); DataStoreInfo dsi = getCatalog().getDataStoreByName(wsName, storeName); if(dsi == null) { getSession().error( new ParamResourceModel("DataAccessEditPage.notFound", this, wsName, storeName).getString() ); doReturn(StorePage.class); return; } try { initUI(dsi); } catch (IllegalArgumentException e) { error(e.getMessage()); doReturn(StorePage.class); return; } }
Source:
<code>protected PageableResult doSearch(RequestContext context) { ConceptService cs = Context.getConceptService(); String query = context.getParameter("q"); if (query == null) return new EmptySearchResult(); <START> String sourceUuid = context.getParameter("source"); <END> ConceptSource source = null; if(sourceUuid!=null){ source = cs.getConceptSourceByUuid(sourceUuid); } List<ConceptReferenceTerm> terms = cs.getConceptReferenceTerms(query, source, context.getStartIndex(), context.getLimit(), context.getIncludeAll()); int count = cs.getCountOfConceptReferenceTerms(query, source, context.getIncludeAll()); boolean hasMore = count > context.getStartIndex() + context.getLimit(); return new AlreadyPaged<ConceptReferenceTerm>(context, terms, hasMore); }</code><technical_language>this handled a SearchHandler? generated API docs include this automatically</technical_language>

Target:
protected PageableResult doSearch(RequestContext context) { ConceptService cs = Context.getConceptService(); String query = context.getParameter("q"); if (query == null) return new EmptySearchResult(); List<ConceptReferenceTerm> terms = cs.getConceptReferenceTerms(query, null, context.getStartIndex(), context.getLimit(), context.getIncludeAll()); int count = cs.getCountOfConceptReferenceTerms(query, null, context.getIncludeAll()); boolean hasMore = count > context.getStartIndex() + context.getLimit(); return new AlreadyPaged<ConceptReferenceTerm>(context, terms, hasMore); }
Source:
<code>public static String getKitodoConfigDirectory() { <START> return ConfigCore.getParameter(CONFIG_DIR); <END> }</code><technical_language>This simplified return getParameter(CONFIG_DIR); I miss something</technical_language>

Target:
public static String getKitodoConfigDirectory() { return getParameter(CONFIG_DIR); }
Source:
<code>public void testMemoryExceeded() throws Exception { try { TypedSet typedSet = new TypedSet(BIGINT, 10, FUNCTION_NAME); for (int i = 0; i <= TypedSet.FOUR_MEGABYTES + 1; i++) { Block block = createLongsBlock(Collections.nCopies((int) 1, (long) i)); typedSet.add(block, 0); } <START> fail("expected exception"); <END> } catch (PrestoException e) { assertEquals(e.getErrorCode(), StandardErrorCode.EXCEEDED_FUNCTION_MEMORY_LIMIT.toErrorCode()); } }</code><technical_language>Empty lines in this method excessive? Here, empty line exists lines checkstyle allows. this function is pretty short simple, I remove of them</technical_language>

Target:
public void testMemoryExceeded() throws Exception { try { TypedSet typedSet = new TypedSet(BIGINT, 10, FUNCTION_NAME); for (int i = 0; i <= TypedSet.FOUR_MEGABYTES + 1; i++) { Block block = createLongsBlock(nCopies((int) 1, (long) i)); typedSet.add(block, 0); } fail("expected exception"); } catch (PrestoException e) { assertEquals(e.getErrorCode(), EXCEEDED_FUNCTION_MEMORY_LIMIT.toErrorCode()); } }
Source:
<code>@Override public Class<? extends Service> serviceClass() { if (cfg instanceof LazyServiceConfiguration) { if (srvcCls != null) return srvcCls; String clsName = ((LazyServiceConfiguration)cfg).serviceClassName(); try { srvcCls = (Class<? extends Service>)Class.forName(clsName); return srvcCls; } catch (ClassNotFoundException e) { <START> GridDeployment srvcDep = ctx.deploy().getDeployment(clsName); <END> if (srvcDep != null) { srvcCls = (Class<? extends Service>)srvcDep.deployedClass(clsName); if (srvcCls != null) return srvcCls; } throw new IgniteException("Failed to find service class: " + clsName, e); } } else return cfg.getService().getClass(); }</code><technical_language>similar logic IgniteServiceProcessor#copyAndInject reuse it</technical_language>

Target:
@Override public Class<? extends Service> serviceClass() { if (cfg instanceof LazyServiceConfiguration) { if (srvcCls != null) return srvcCls; String clsName = ((LazyServiceConfiguration)cfg).serviceClassName(); try { srvcCls = (Class<? extends Service>)Class.forName(clsName); return srvcCls; } catch (ClassNotFoundException e) { if (ctx != null) { GridDeployment srvcDep = ctx.deploy().getDeployment(clsName); if (srvcDep != null) { srvcCls = (Class<? extends Service>)srvcDep.deployedClass(clsName); if (srvcCls != null) return srvcCls; } } throw new IgniteException("Failed to find service class: " + clsName, e); } } else return cfg.getService().getClass(); }
Source:
<code>public final long doSObject(final Object receiver) { if (VmSettings.SNAPSHOTS_ENABLED) { SnapshotBuffer sb = new SnapshotBuffer(); if (!sb.containsObject(receiver)) { SClass sc = Types.getClassOf(receiver); sc.getSerializer().serialize(receiver, sb); } return 0; } <START> return 0; <END> }</code><technical_language>do return 0? receiver more usual? Also, multiple return statements redundant</technical_language>

Target:
public final Object doSObject(final Object receiver) { if (VmSettings.SNAPSHOTS_ENABLED) { SnapshotBuffer sb = new SnapshotBuffer(); if (!sb.containsObject(receiver)) { SClass sc = Types.getClassOf(receiver); sc.serialize(receiver, sb); } } return receiver; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VdcParametersMap otherParamsMap = (VdcParametersMap) obj; if (size() != otherParamsMap.size()) { return false; } for (Entry<VdcParameter, Object> entry : paramsMap.entrySet()) { <START> Object otherValue = otherParamsMap.get(entry.getKey(), entry.getKey().getJavaType()); <END> if (otherValue == null) { return false; } Object thisValue = entry.getValue(); if (!thisValue.equals(otherValue)) { return false; } } return true; }</code><technical_language>other class members directly? public interface? I I asked times, AbstractMap::equals is enough for compare</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } VdcParametersMap otherParamsMap = (VdcParametersMap) obj; return paramsMap.equals(otherParamsMap.paramsMap); }
Source:
<code>public void testPauseResumeWithDelay() { try { <START> runTestOnUiThread(new TestPauseResumeWithDelay()); <END> } catch (Throwable e) { fail("Exception error!"); } }</code><technical_language>@UiThreadTest annotation test method</technical_language>

Target:
public void testPauseResumeWithDelay() throws InterruptedException { GLSurfaceView view = mActivity.getView(); for (int i = 0; i < NUM_PAUSE_RESUME_ITERATIONS_WITH_DELAY; i++) { Thread.sleep(PAUSE_RESUME_DELAY); if (LOG_PAUSE_RESUME) { Log.w(TAG, "Pause/Resume (w/ delay) step " + i + " - pause"); } view.onPause(); Thread.sleep(PAUSE_RESUME_DELAY); if (LOG_PAUSE_RESUME) { Log.w(TAG, "Pause/Resume (w/ delay) step " + i + " - resume"); } view.onResume(); } }
Source:
<code><START> private void initializeWithoutRunning(TransactionManager txManager) { <END> initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), new TargetedSweepFollower(followers, txManager)); }</code><technical_language>I do this safely, large internal product call this (unless plan changing this)</technical_language>

Target:
public void initializeWithoutRunning(TransactionManager txManager) { initializeWithoutRunning(SpecialTimestampsSupplier.create(txManager), txManager.getTimelockService(), txManager.getKeyValueService(), new TargetedSweepFollower(followers, txManager)); }
Source:
<code>public MachineSet ensureUnclaimed(int count, ReusableMachineTemplate template) { MachineSet current; synchronized (this) { <START> current = unclaimed(matching(template)); <END> } if (current.size() >= count) return current; MachineSet moreNeeded = create(count-current.size(), template); return current.added(moreNeeded); }</code><technical_language>Again, this need synchronized</technical_language>

Target:
public MachineSet ensureUnclaimed(int count, ReusableMachineTemplate template) { MachineSet current; current = unclaimed(matching(template)); if (current.size() >= count) return current; MachineSet moreNeeded = create(count-current.size(), template); return current.added(moreNeeded); }
Source:
<code>private boolean hostExists(List<GlusterServerInfo> glusterServers, VDS server) { for (GlusterServerInfo glusterServer : glusterServers) { <START> if (glusterServer.getHostName().equals(server.gethost_name()) <END> || glusterServer.getHostName().equals(server.getManagmentIp())) { return true; } } return false; }</code><technical_language>I getHostName() in GlusterServerInfo changed getHostNameOrIp() in patch. a rebase is required</technical_language>

Target:
private boolean hostExists(List<GlusterServerInfo> glusterServers, VDS server) { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getHostnameOrIp().equals(server.gethost_name())) { return true; } for (VdsNetworkInterface nwInterface : server.getInterfaces()) { if (glusterServer.getHostnameOrIp().equals(nwInterface.getAddress())) { return true; } } } return false; }
Source:
<code>protected void collectFindQueries(BiConsumer<Predicate<SQLCodeListEntry>, Supplier<FindQuery<SQLCodeListEntry>>> queryConsumer) { <START> queryConsumer.accept(sqlCodeListEntry -> !sqlCodeListEntry.isNew(), <END> () -> context.getBatchContext().findQuery(SQLCodeListEntry.class, SQLCodeListEntry.ID)); queryConsumer.accept(sqlCodeListEntry -> Strings.isFilled(sqlCodeListEntry.getCodeListEntryData().getCode()) && sqlCodeListEntry.getCodeList().isFilled(), () -> context.getBatchContext() .findQuery(SQLCodeListEntry.class, SQLCodeListEntry.CODE_LIST_ENTRY_DATA.inner(CodeListEntryData.CODE), SQLCodeListEntry.CODE_LIST)); }</code><technical_language>is good reason support IDs</technical_language>

Target:
protected void collectFindQueries(BiConsumer<Predicate<SQLCodeListEntry>, Supplier<FindQuery<SQLCodeListEntry>>> queryConsumer) { queryConsumer.accept(sqlCodeListEntry -> Strings.isFilled(sqlCodeListEntry.getCodeListEntryData().getCode()) && sqlCodeListEntry.getCodeList().isFilled(), () -> context.getBatchContext() .findQuery(SQLCodeListEntry.class, SQLCodeListEntry.CODE_LIST_ENTRY_DATA.inner(CodeListEntryData.CODE), SQLCodeListEntry.CODE_LIST)); }
Source:
<code>protected Operation<UsersWorkspaceDto> startWorkspace() { return new Operation<UsersWorkspaceDto>() { @Override public void apply(UsersWorkspaceDto workspaceToStart) throws OperationException { WorkspaceStatus wsFromReferenceStatus = workspaceToStart.getStatus(); <START> Log.info(getClass(), workspaceToStart); <END> startWorkspaceById(workspaceToStart); } }; }</code><technical_language>remove this line</technical_language>

Target:
protected Operation<UsersWorkspaceDto> startWorkspace() { return new Operation<UsersWorkspaceDto>() { @Override public void apply(UsersWorkspaceDto workspaceToStart) throws OperationException { WorkspaceStatus wsFromReferenceStatus = workspaceToStart.getStatus(); startWorkspaceById(workspaceToStart); } }; }
Source:
<code>public static void updateThreadCount(final OnThreadCountUpdateListener listener){ new AsyncTask<Void, Void, List<MailThread>>() { int[] countArray = new int[6]; @Override protected List<MailThread> doInBackground(Void... params) { List<MailThread> threads = getAllThreads(); <START> List<MailThread> res = new ArrayList<>(); <END> for (MailThread thread : threads) { if (hasLabel(thread, Label.INBOX)) { countArray[0]++; } if (hasLabel(thread, Label.UNREAD)) { countArray[1]++; } if (hasLabel(thread, Label.IMPORTANT)) { countArray[2]++; } countArray[3] = DraftDBUtils.getDraftCount(); if (hasLabel(thread, Label.SENT)) { countArray[4]++; } if (hasLabel(thread, Label.ARCHIVED)) { countArray[5]++; } } return res; } @Override protected void onPostExecute(List<MailThread> mailThreads) { super.onPostExecute(mailThreads); listener.onThreadCountUpdated(countArray[0], countArray[1], countArray[2], countArray[3], countArray[4], countArray[5]); } }.execute(); }</code><technical_language>This list is used. return type of doInBackground Void</technical_language>

Target:
public static void updateThreadCount(final OnThreadCountUpdateListener listener){ new AsyncTask<Void, Void, Void>() { int[] countArray = new int[6]; HashMap<String, Integer> map = new HashMap<String, Integer>(); @Override protected Void doInBackground(Void... params) { List<MailThread> threads = getAllThreads(); List<MailThread> res = new ArrayList<>(); for (MailThread thread : threads) { if (hasLabel(thread, Label.INBOX)) { countArray[0]++; } if (hasLabel(thread, Label.UNREAD)) { countArray[1]++; } if (hasLabel(thread, Label.IMPORTANT)) { countArray[2]++; } countArray[3] = DraftDBUtils.getDraftCount(); if (hasLabel(thread, Label.SENT)) { countArray[4]++; } if (hasLabel(thread, Label.ARCHIVED)) { countArray[5]++; } } return null; } @Override protected void onPostExecute(Void v) { super.onPostExecute(v); map.put(Label.INBOX, countArray[0]); map.put(Label.UNREAD, countArray[1]); map.put(Label.IMPORTANT, countArray[2]); map.put(Label.DRAFT, countArray[3]); map.put(Label.SENT, countArray[4]); map.put(Label.ARCHIVED, countArray[4]); listener.onThreadCountUpdated(map); } }.execute(); }
Source:
<code>public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { final Map<byte[], NamedKey> keyLookup = Maps.uniqueIndex( keys, new Function<NamedKey, byte[]>() { @Override public byte[] apply( @Nullable NamedKey input ) { return computeKeyHash(prefix, input); } } ); final Map<NamedKey, byte[]> results = Maps.newHashMap(); if (keyLookup.size() == 0) { <START> return results; <END> } final List<byte[]> keysList = new ArrayList<>(keyLookup.keySet()); final List<byte[]> valuesList; try (final Jedis client = pool.getResource()) { valuesList = client.mget(keysList.toArray(new byte[keysList.size()][])); } catch (JedisConnectionException ex) { if (isTimeout(ex)) { timeoutCount.incrementAndGet(); } throw Throwables.propagate(ex); } catch (JedisException ex) { errorCount.incrementAndGet(); log.warn(ex, "Unable to get cache items"); return results; } final int length = valuesList.size(); int i = 0; while (i < length) { final byte[] value = valuesList.get(i); if (value != null) { final NamedKey key = keyLookup.get(keysList.get(i)); try { final byte[] deserialized = deserialize(key, value); hitCount.incrementAndGet(); results.put(key, deserialized); } catch (LZ4Exception ex) { errorCount.incrementAndGet(); log.warn(ex, "Error decompressing cache item"); } } else { missCount.incrementAndGet(); } i++; } return results; }</code><technical_language>delay creating results, return ImmutableMap.of() here</technical_language>

Target:
public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { final Map<byte[], NamedKey> keyLookup = Maps.uniqueIndex( keys, new Function<NamedKey, byte[]>() { @Override public byte[] apply( @Nullable NamedKey input ) { return CacheImplUtils.computeKeyHash(prefix, input).getBytes(); } } ); if (keyLookup.size() == 0) { return ImmutableMap.of(); } final Map<NamedKey, byte[]> results = Maps.newHashMap(); final byte[][] keysArray = Iterables.toArray(keyLookup.keySet(), byte[].class); final List<Object> valuesList; try (ResourceHolder<ShardedJedis> clientHolder = supplier.get()) { final ShardedJedis jedis = clientHolder.get(); final ShardedJedisPipeline pipeline = jedis.pipelined(); for (byte[] itemKey : keysArray) { pipeline.get(itemKey); } pipeline.sync(); valuesList = pipeline.getResults(); } catch (IOException | JedisException ex) { this.countException(ex); log.warn(ex, "Unable to get cache items"); return results; } final int length = keysArray.length; int i = 0; while (i < length) { final Object value = valuesList.get(i); if (value != null) { final NamedKey key = keyLookup.get(keysArray[i]); try { final byte[] deserialized = deserialize(key, (byte []) value); hitCount.incrementAndGet(); results.put(key, deserialized); } catch (LZ4Exception ex) { errorCount.incrementAndGet(); log.warn(ex, "Error decompressing cache item"); } } else { missCount.incrementAndGet(); } i++; } return results; }
Source:
<code>public void receivedMessage(Message msg) throws InterruptedException { <START> publisher.publish(new TraceEvent("[Recv: " + msg + "]")); <END> if (requestQueue.peek() != null) { MessageRoundtrip messageRoundtrip = requestQueue.peek(); Message waitingMessage = messageRoundtrip.getMsg(); if (waitingMessage instanceof PingMessage) hasPing = false; if (waitingMessage.getAnswerMessage() != null && msg.getClass() == waitingMessage.getAnswerMessage()) { messageRoundtrip.answer(); if (waitingMessage instanceof EthMessage) channel.getPeerStats().pong(messageRoundtrip.lastTimestamp); logger.trace("Message round trip covered: ", messageRoundtrip.getMsg().getClass()); } } }</code><technical_language>get rid of useless trace event</technical_language>

Target:
public void receivedMessage(Message msg) throws InterruptedException { ethereumListener.trace("[Recv: " + msg + "]"); if (requestQueue.peek() != null) { MessageRoundtrip messageRoundtrip = requestQueue.peek(); Message waitingMessage = messageRoundtrip.getMsg(); if (waitingMessage instanceof PingMessage) hasPing = false; if (waitingMessage.getAnswerMessage() != null && msg.getClass() == waitingMessage.getAnswerMessage()) { messageRoundtrip.answer(); if (waitingMessage instanceof EthMessage) channel.getPeerStats().pong(messageRoundtrip.lastTimestamp); logger.trace("Message round trip covered: ", messageRoundtrip.getMsg().getClass()); } } }
Source:
<code>public BatchMetricQuery findBatchById(String id) { String json = _cacheService.get(ROOT + id); if (json == null) { return null; } try { Map<String, Object> batchData = MAPPER.readValue(json, Map.class); Status status = BatchMetricQuery.Status.fromInt((Integer) batchData.get("status")); int ttl = Integer.valueOf(batchData.get("ttl").toString()); long createdDate = Long.valueOf(batchData.get("createdDate").toString()); String ownerName = (String) batchData.get("ownerName"); String batchId = (String) batchData.get("batchId"); List<AsyncBatchedMetricQuery> queries = new ArrayList<>(); int[] indices = MAPPER.readValue((String) batchData.get("indices"), int[].class); for (int index: indices) { queries.add(_findQueryById(batchId, index)); } BatchMetricQuery batch = new BatchMetricQuery(status, ttl, createdDate, batchId, ownerName, queries); <START> batch.updateStatus(); <END> return batch; } catch (IOException ex) { throw new SystemException(ex); } }</code><technical_language>This line removed. batch able calculate status getStatus is called</technical_language>

Target:
public BatchMetricQuery findBatchById(String id) { String json = _cacheService.get(ROOT + id); if (json == null) { return null; } try { Map<String, Object> batchData = MAPPER.readValue(json, Map.class); Status status = BatchMetricQuery.Status.fromInt((Integer) batchData.get("status")); int ttl = Integer.valueOf(batchData.get("ttl").toString()); long createdDate = Long.valueOf(batchData.get("createdDate").toString()); String ownerName = (String) batchData.get("ownerName"); String batchId = (String) batchData.get("batchId"); List<AsyncBatchedMetricQuery> queries = new ArrayList<>(); int[] indices = MAPPER.readValue((String) batchData.get("indices"), int[].class); for (int index: indices) { queries.add(_findQueryById(batchId, index)); } BatchMetricQuery batch = new BatchMetricQuery(status, ttl, createdDate, batchId, ownerName, queries); return batch; } catch (IOException ex) { throw new SystemException(ex); } }
Source:
<code>protected Point getInitialLocation(Point initialSize) { <START> Rectangle bounds = getShell().getParent().getMonitor().getBounds(); <END> GC gc = new GC(getShell().getDisplay()); int textExtendX = gc.textExtent(message).x; gc.dispose(); return new Point(bounds.x + bounds.width / 2 - textExtendX / 2, bounds.y + bounds.height / 5); }</code><technical_language>For safety, check parent call super.getInitialLocation() if null. handler a HandlerUtil#getActiveShell() #getActiveShellChecked()</technical_language>

Target:
protected Point getInitialLocation(Point initialSize) { if (getShell().getParent() == null) { return super.getInitialLocation(initialSize); } Rectangle bounds = getShell().getParent().getMonitor().getBounds(); GC gc = new GC(getShell().getDisplay()); int textExtendX = gc.textExtent(message).x; gc.dispose(); return new Point(bounds.x + bounds.width / 2 - textExtendX / 2, bounds.y + bounds.height / 5); }
Source:
<code>public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptyEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code><START> private ObjectType findNextNode() { <END> while (true) { if ((inner == null) || !inner.hasNext()) { if (outer.hasNext()) { inner = outer.next().getValue().iterator(); } else { return null; } } while (inner.hasNext()) { return inner.next(); } } }</code><technical_language>Return empty object instead of null</technical_language>

Target:
private Optional<ObjectType> findNextNode() { while (true) { if ((inner == null) || !inner.hasNext()) { if (outer.hasNext()) { inner = outer.next().getValue().iterator(); } else { return Optional.empty(); } } while (inner.hasNext()) { return Optional.of(inner.next()); } } }
Source:
<code>public void testAutoSyncWithNewSessionEstablishment() throws Exception { final String path = "/" + TestHelper.getTestMethodName(); final String data = "Hello Helix 2"; Assert.assertTrue(TestHelper .verify(() -> _zkClient.getConnection().getZookeeperState().isConnected(), 1000L)); final long originalSessionId = _zkClient.getSessionId(); try { _zkClient.create(path, data, CreateMode.PERSISTENT); } catch (Exception ex) { Assert.fail("Failed to create ephemeral node.", ex); } ZkTestHelper.expireSession(_zkClient); Assert.assertTrue(TestHelper.verify(() -> { try { return _zkClient.getSessionId() != originalSessionId; } catch (ZkClientException ex) { return false; } }, 1000L)); <START> <END> Stat stat = new Stat(); String nodeData = null; try { nodeData = _zkClient.readData(path, stat, true); } catch (ZkException e) { Assert.fail("fail to read data"); } Assert.assertEquals(nodeData, data, "Data is not correct."); }</code><technical_language>this is need. If exception is thrown here, test fail</technical_language>

Target:
public void testAutoSyncWithNewSessionEstablishment() throws Exception { final String path = "/" + TestHelper.getTestMethodName(); final String data = "Hello Helix 2"; Assert.assertTrue(_zkClient.waitUntilConnected(1, TimeUnit.SECONDS)); final long originalSessionId = _zkClient.getSessionId(); try { _zkClient.create(path, data, CreateMode.PERSISTENT); } catch (Exception ex) { Assert.fail("Failed to create ephemeral node.", ex); } ZkTestHelper.expireSession(_zkClient); Stat stat = new Stat(); String nodeData = null; try { nodeData = _zkClient.readData(path, stat, true); } catch (ZkException e) { Assert.fail("fail to read data"); } Assert.assertEquals(nodeData, data, "Data is not correct."); }
Source:
<code>public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; if (message instanceof DirectMemberAddedToGroup) { <START> resolvingMessages.addAll(resolveDirectMemberAddedToGroup(sess, (DirectMemberAddedToGroup) message)); <END> } else if (message instanceof MemberRemovedFromGroupTotally) { resolvingMessages.addAll(resolveMemberRemovedFromGroupTotally(sess, (MemberRemovedFromGroupTotally) message)); } return resolvingMessages; }</code><technical_language>add case for event IndirectMemberAddedToGroup</technical_language>

Target:
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException { List<AuditEvent> resolvingMessages = new ArrayList<>(); if (message == null) return resolvingMessages; if (message instanceof DirectMemberAddedToGroup) { resolvingMessages.addAll(resolveEvent(sess, ((DirectMemberAddedToGroup) message).getMember())); } else if (message instanceof IndirectMemberAddedToGroup) { resolvingMessages.addAll(resolveEvent(sess, ((IndirectMemberAddedToGroup) message).getMember())); } else if (message instanceof MemberRemovedFromGroupTotally) { resolvingMessages.addAll(resolveEvent(sess, ((MemberRemovedFromGroupTotally) message).getMember())); } return resolvingMessages; }
Source:
<code>public PowerMeter(final Simulation simulation, final PowerAware<? extends PowerModel> powerAwareEntity) { <START> this(simulation, new ArrayList<>(Arrays.asList(powerAwareEntity))); <END> }</code><technical_language>Is reason instantiate a new ArrayList here? Arrays.asList creates a list</technical_language>

Target:
public PowerMeter(final Simulation simulation, final PowerAware<? extends PowerModel> powerAwareEntity) { this(simulation, Arrays.asList(powerAwareEntity)); }
Source:
<code>private void recipeBattery() { addRecipe(findItemStack("Cost Oriented Battery"), "C C", "PPP", "PPP", 'C', findItemStack("Low Voltage Cable"), 'P', "ingotLead", 'I', new ItemStack(Items.iron_ingot)); addRecipe(findItemStack("Capacity Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', "ingotLead"); addRecipe(findItemStack("Voltage Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', new ItemStack(Items.iron_ingot)); addRecipe(findItemStack("Current Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', "ingotCopper"); addRecipe(findItemStack("Life Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', new ItemStack(Items.gold_ingot)); addRecipe(findItemStack("Experimental Battery"), <START> " S ", <END> "LDV", " C ", 'S', findItemStack("Capacity Oriented Battery"), 'L', findItemStack("Life Oriented Battery"), 'V', findItemStack("Voltage Oriented Battery"), 'C', findItemStack("Current Oriented Battery"), 'D', new ItemStack(Items.diamond)); addRecipe(findItemStack("Single-use Battery"), "ppp", "III", "ppp", 'C', findItemStack("Low Voltage Cable"), 'p', new ItemStack(Items.coal, 1, 0), 'I', "ingotCopper"); addRecipe(findItemStack("Single-use Battery"), "ppp", "III", "ppp", 'C', findItemStack("Low Voltage Cable"), 'p', new ItemStack(Items.coal, 1, 1), 'I', "ingotCopper"); }</code><technical_language>spaces tabs</technical_language>

Target:
private void recipeBattery() { addRecipe(findItemStack("Cost Oriented Battery"), "C C", "PPP", "PPP", 'C', findItemStack("Standard Low Voltage Cable"), 'P', "ingotLead", 'I', new ItemStack(Items.iron_ingot)); addRecipe(findItemStack("Capacity Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', "ingotLead"); addRecipe(findItemStack("Voltage Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', findItemStack("Iron Cable")); addRecipe(findItemStack("Current Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', "ingotCopper"); addRecipe(findItemStack("Life Oriented Battery"), "PBP", 'B', findItemStack("Cost Oriented Battery"), 'P', new ItemStack(Items.gold_ingot)); addRecipe(findItemStack("Experimental Battery"), " S ", "LDV", " C ", 'S', findItemStack("Capacity Oriented Battery"), 'L', findItemStack("Life Oriented Battery"), 'V', findItemStack("Voltage Oriented Battery"), 'C', findItemStack("Current Oriented Battery"), 'D', new ItemStack(Items.diamond)); addRecipe(findItemStack("Single-use Battery"), "ppp", "III", "ppp", 'C', findItemStack("Standard Low Voltage Cable"), 'p', new ItemStack(Items.coal, 1, 0), 'I', "ingotCopper"); addRecipe(findItemStack("Single-use Battery"), "ppp", "III", "ppp", 'C', findItemStack("Shoddy Low Voltage Cable"), 'p', new ItemStack(Items.coal, 1, 1), 'I', "ingotCopper"); }