auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onCreate() { super.onCreate(); AwfulPreferences mPref = AwfulPreferences.getInstance(this); appStatePrefs = this.getSharedPreferences(APP_STATE_PREFERENCES, MODE_PRIVATE); NetworkUtils.init(this); AndroidThreeTen.init(this); AnnouncementsManager.init(); <START> fontManager = new FontManager(mPref.preferredFont, getAssets()); <END> mPref.registerCallback(fontManager); long hoursSinceInstall = getHoursSinceInstall(); crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4; if (crashlyticsEnabled) { Fabric.with(this, new Crashlytics()); if (mPref.sendUsernameInReport) Crashlytics.setUserName(mPref.username); } Timber.plant(crashlyticsEnabled ? new CrashlyticsReportingTree() : new Timber.DebugTree()); Timber.i("App installed %d hours ago", hoursSinceInstall); if (Constants.DEBUG) { Timber.d("*\n*\n*Debug active\n*\n*"); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDeath() .build()); } SyncManager.sync(this); }</code><technical_language>Sorry, this bit I meant pass in mPref FontManager constructor (instead of preferred font), in constructor pull out preferredFont register callback? in AwfulApplication is creating FontManager passing in prefs object do needs do initialise</technical_language>

Target:
public void onCreate() { super.onCreate(); AwfulPreferences mPref = AwfulPreferences.getInstance(this); appStatePrefs = this.getSharedPreferences(APP_STATE_PREFERENCES, MODE_PRIVATE); NetworkUtils.init(this); AndroidThreeTen.init(this); AnnouncementsManager.init(); FontManager.createInstance(mPref, getAssets()); long hoursSinceInstall = getHoursSinceInstall(); crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4; if (crashlyticsEnabled) { Fabric.with(this, new Crashlytics()); if (mPref.sendUsernameInReport) Crashlytics.setUserName(mPref.username); } Timber.plant(crashlyticsEnabled ? new CrashlyticsReportingTree() : new Timber.DebugTree()); Timber.i("App installed %d hours ago", hoursSinceInstall); if (Constants.DEBUG) { Timber.d("*\n*\n*Debug active\n*\n*"); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDeath() .build()); } SyncManager.sync(this); }
Source:
<code><START> public EntityType(Type type, Set<Supertype> superTypes, Function<EntityType, String> variableNameFunction) { <END> super(type); this.modifiedSimpleName = variableNameFunction.apply(this); this.superTypes = superTypes; this.variableNameFunction = variableNameFunction; }</code><technical_language>getUncapSimpleName deprecated transformation done of EntityType? java String variableName = variableNameFunction(type.getSimpleName()); if (JavaSyntaxUtils.isReserved(name)) { variableName = variableName + "$"; }</technical_language>

Target:
private EntityType(Type type, Set<Supertype> superTypes, Function<EntityType, String> variableNameFunction) { super(type); this.superTypes = superTypes; this.modifiedSimpleName = variableNameFunction.apply(this); }
Source:
<code>private void setDialogTextView(final String newString) { computeTextView.post(new Runnable() { @Override public void run() { computeTextView.setText(newString); ViewGroup.LayoutParams params = computeTextView.getLayoutParams(); int heightPixels = computeTextView.getLineCount() * computeTextView.getLineHeight(); params.width = ViewGroup.LayoutParams.FILL_PARENT; <START> params.height = heightPixels + (int) (heightPixels * 0.5); END> computeTextView.setLayoutParams(params); } }); }</code><technical_language>Robin: "Let's go! finish this task easy!" Batman: "Easily." Robin: "Easily." Batman: "Good grammar is essential, Robin." Robin: "Thank you." Batman: "You're welcome."</technical_language>

Target:
private void setDialogTextView(final String newString) { computeTextView.post(new Runnable() { @Override public void run() { computeTextView.setText(newString); ViewGroup.LayoutParams params = computeTextView.getLayoutParams(); int height = computeTextView.getLineCount() * computeTextView.getLineHeight(); int heightMargin = (int) (height * 0.5); params.width = ViewGroup.LayoutParams.FILL_PARENT; params.height = height + heightMargin; computeTextView.setLayoutParams(params); } }); }
Source:
<code>public Run<?,?> getBuild(Job<?,?> job, EnvVars env, BuildFilter filter, Run<?,?> parent) { String jobName = job instanceof MatrixConfiguration ? job.getParent().getFullName() : job.getFullName(); for (Cause cause : parent instanceof MatrixRun ? ((MatrixRun)parent).getParentBuild().getCauses() : parent.getCauses()) { if (cause instanceof UpstreamCause && jobName.equals(((UpstreamCause)cause).getUpstreamProject())) { Run<?,?> run = job.getBuildByNumber(((UpstreamCause)cause).getUpstreamBuild()); return (run != null && filter.isSelectable(run, env)) ? run : null; } <START> else if (cause instanceof UpstreamCause) { <END> String parentJobName = ((UpstreamCause)cause).getUpstreamProject(); Job <?,?> parentJob = Jenkins.getInstance().getItemByFullName(parentJobName, Job.class); Run<?,?> run = getBuild( job, env, filter, parentJob.getBuildByNumber(((UpstreamCause)cause).getUpstreamBuild())); if (run != null && filter.isSelectable(run, env)) { return run; } } } if (isFallbackToLastSuccessful()) { return super.getBuild(job, env, filter, parent); } return null; }</code><technical_language>Clearer consolidate: block for if (cause instanceof UpstreamCause) of is a nested test for if (jobName.equals(((UpstreamCause)cause).getUpstreamProject())). (In case introduce a variable for (UpstreamCause)cause.)</technical_language>

Target:
public Run<?,?> getBuild(Job<?,?> job, EnvVars env, BuildFilter filter, Run<?,?> parent) { String jobName = job instanceof MatrixConfiguration ? job.getParent().getFullName() : job.getFullName(); for (Cause cause : parent instanceof MatrixRun ? ((MatrixRun)parent).getParentBuild().getCauses() : parent.getCauses()) { if (cause instanceof UpstreamCause) { UpstreamCause upstream = (UpstreamCause) cause; if (jobName.equals(upstream.getUpstreamProject())) { Run<?,?> run = job.getBuildByNumber(upstream.getUpstreamBuild()); return (run != null && filter.isSelectable(run, env)) ? run : null; } else { String parentJobName = upstream.getUpstreamProject(); Job <?,?> parentJob = Jenkins.getInstance().getItemByFullName(parentJobName, Job.class); Run<?,?> run = getBuild( job, env, filter, parentJob.getBuildByNumber(upstream.getUpstreamBuild())); if (run != null && filter.isSelectable(run, env)) { return run; } } } } if (isFallbackToLastSuccessful()) { return super.getBuild(job, env, filter, parent); } return null; }
Source:
<code>public void switchAndQuoteMessageWall(String reply) { <START> driver.switchTo().defaultContent(); <END> driver.switchTo().frame(quoteMessageWallFrame); driver.findElement(By.cssSelector("body#bodyContent")).clear(); driver.findElement(By.cssSelector("body#bodyContent")).sendKeys(reply); PageObjectLogging.log("switchAndQuoteMessageWall", "quote typed", true); }</code><technical_language>remove this line</technical_language>

Target:
public void switchAndQuoteMessageWall(String reply) { driver.switchTo().frame(quoteMessageWallFrame); driver.findElement(By.cssSelector("body#bodyContent")).clear(); driver.findElement(By.cssSelector("body#bodyContent")).sendKeys(reply); PageObjectLogging.log("switchAndQuoteMessageWall", "quote typed", true); }
Source:
<code>public void selectionRangeUpdated(TmfSelectionRangeUpdatedSignal signal) { if ((signal.getSource() != this) && (TmfTraceManager.getInstance().getActiveTrace() != null)) { long start = signal.getBeginTime().getValue(); long end = signal.getEndTime().getValue(); Iterable<ISegment> selection; if (start == end) { selection = fTopData.getData().getIntersectingElements(start); } <START> else { <END> selection = fTopData.getData().getIntersectingElements(start, end); } TreeMapStore<ISegment> data = new TreeMapStore<>(); for (ISegment segment : selection) { if (segment != null) { data.addElement(segment); } } updateModel(new LatencyDataStore(data)); } }</code><technical_language>line: } else {</technical_language>

Target:
public void selectionRangeUpdated(TmfSelectionRangeUpdatedSignal signal) { if ((signal.getSource() != this) && (TmfTraceManager.getInstance().getActiveTrace() != null)) { TreeMapStore<ISegment> data = getIntersectingData(new TmfTimeRange(signal.getBeginTime(), signal.getEndTime())); if (data == null) { updateModel(null); return; } updateModel(new LatencyDataStore(data)); } }
Source:
<code>public static KeyStore loadKeyStore(final String storeType, final String password, final String storeLoc) throws CertificateManagerException { InputStream is = null; KeyStore secretStore = null; try { secretStore = KeyStore.getInstance(storeType); if (!PKCS11_TYPE.equalsIgnoreCase(storeType)) { is = new FileInputStream(storeLoc); } secretStore.load(is, password.toCharArray()); } catch (final IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException ex) { LOG.error(KEYSTORE_ERROR_MSG, ex.getLocalizedMessage(), ex); throw new CertificateManagerException(ex.getMessage(), ex); } finally { <START> try { <END> if (is != null) { is.close(); } } catch (final IOException ex) { LOG.error("Unable to close keyStoreStream- KeyStoreCallbackHandler {}", ex.getLocalizedMessage(), ex); } } return secretStore; }</code><technical_language>a method immediately this named closeStream(). that, a try-with-resources block</technical_language>

Target:
public static KeyStore loadKeyStore(final String storeType, final String password, final String storeLoc) throws CertificateManagerException { InputStream is = null; KeyStore secretStore = null; try { secretStore = KeyStore.getInstance(storeType); if (!PKCS11_TYPE.equalsIgnoreCase(storeType)) { is = new FileInputStream(storeLoc); } secretStore.load(is, password.toCharArray()); } catch (final IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException ex) { LOG.error(KEYSTORE_ERROR_MSG, ex.getLocalizedMessage(), ex); throw new CertificateManagerException(ex.getMessage(), ex); } finally { closeStream(is); } return secretStore; }
Source:
<code>public static JsonParser createFor(JsonValue jsonValue, Supplier<JsonParserFactory> parserFactoryProvider) { if (jsonValue instanceof JsonObject) { <START> return parserFactoryProvider.get().createParser((JsonObject) jsonValue); <END> } else if (jsonValue instanceof JsonArray) { return parserFactoryProvider.get().createParser((JsonArray) jsonValue); } else if (jsonValue instanceof JsonString) { return new JsonStringParserAdapter((JsonString) jsonValue); } else if (jsonValue instanceof JsonNumber) { return new JsonNumberParserAdapter((JsonNumber) jsonValue); } else if (EnumSet.of(ValueType.FALSE, ValueType.TRUE).contains(jsonValue.getValueType())) { return new JsonValueParserAdapter<>(jsonValue); } throw new IllegalArgumentException("Cannot create JsonParser for " + jsonValue.getValueType()); }</code><technical_language>asJsonXXX flavors for objects/arrays</technical_language>

Target:
public static JsonParser createFor(JsonValue jsonValue, Supplier<JsonParserFactory> parserFactoryProvider) { switch (jsonValue.getValueType()) { case OBJECT: return parserFactoryProvider.get().createParser(jsonValue.asJsonObject()); case ARRAY: return parserFactoryProvider.get().createParser(jsonValue.asJsonArray()); case STRING: return new JsonStringParserAdapter((JsonString) jsonValue); case NUMBER: return new JsonNumberParserAdapter((JsonNumber) jsonValue); default: return new JsonValueParserAdapter<>(jsonValue); } }
Source:
<code>public int hashCode() { <START> final int prime = 31; <END> int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + Arrays.hashCode(outcomes); result = prime * result + Arrays.hashCode(params); return result; }</code><technical_language>a style for hashCode in this project, Java contains Objects utils do this nicer</technical_language>

Target:
public int hashCode() { return Objects.hash(name, Arrays.hashCode(outcomes), Arrays.hashCode(params)); }
Source:
<code>public void setup() throws Exception { <START> temporaryFolder.create(); <END> String keysetHome = temporaryFolder.newFolder("keysets").getAbsolutePath(); String associatedDataHome = temporaryFolder.newFolder("etc").getAbsolutePath(); System.setProperty(SecurityConstants.KEYSET_DIR, keysetHome); System.setProperty( SecurityConstants.ASSOCIATED_DATA_PATH, associatedDataHome.concat("/associatedData.properties")); }</code><technical_language>managing temp folder creation & deletion? <LINK_0></technical_language>

Target:
public void setup() throws Exception { String keysetHome = temporaryFolder.newFolder("keysets").getAbsolutePath(); String associatedDataHome = temporaryFolder.newFolder("etc").getAbsolutePath(); System.setProperty(SecurityConstants.KEYSET_DIR, keysetHome); System.setProperty( SecurityConstants.ASSOCIATED_DATA_PATH, associatedDataHome.concat("/associatedData.properties")); }
Source:
<code>@NonNull public PageTitle pageTitle() { <START> PageTitle title = new PageTitle(article.normalizedTitle(), site); <END> if (article.thumbnail() != null) { title.setThumbUrl(article.thumbnail().toString()); } if (!TextUtils.isEmpty(article.description())) { title.setDescription(article.description()); } return title; }</code><technical_language>Consider non-normalized (i.e., underscore-containing) title instead. *probably* matter this object is for page request I underscores injected time request is made, cleaner with</technical_language>

Target:
@NonNull public PageTitle pageTitle() { PageTitle title = new PageTitle(article.title(), site); if (article.thumbnail() != null) { title.setThumbUrl(article.thumbnail().toString()); } if (!TextUtils.isEmpty(article.description())) { title.setDescription(article.description()); } return title; }
Source:
<code><START> public void the_user_is_on_the_Candidate_creation_page() throws Throwable { <END> getDriver().get(CANDIDATE_CREATION_URL); }</code><technical_language>Throwable is needed, delete them. generated automatically cucumber for default pending exception</technical_language>

Target:
public void the_user_is_on_the_Candidate_creation_page() { waitForPageLoadAfter(event -> getDriver().get(CANDIDATE_CREATION_URL)); }
Source:
<code>public Mono<Response<FileUploadInfo>> clearRange(long length) { FileRange range = new FileRange(0, length - 1); <START> return azureFileStorageClient.files().uploadRangeWithRestResponseAsync(shareName, filePath, range.toString(), FileRangeWriteType.UPDATE, 0, null, null, null, Context.NONE) <END> .map(this::uploadResponse); }</code><technical_language>I CLEAR enum remove statement clearing a range of 4MB, clear is allowed large file size. Additionally, clearing throw exception is Content-Length header is set</technical_language>

Target:
public Mono<FileUploadInfo> clearRange(long length) { return clearRangeWithResponse(length, 0).flatMap(FluxUtil::toMono); }
Source:
<code>private void setupBinding() { setupChanges(false); if (mInfo.getInvokerMethod() != null) { mCommand = new ICommand() { @Override public boolean canExecute(Object parameter) { try { return mInfo.check(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(Object parameter) { try { mInfo.invoke(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } } @Override public boolean canExecute(View view, Object parameter) { try { return mInfo.check(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(View view, Object parameter) { try { mInfo.invoke(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); retryExecute(view, parameter); } } private void retryExecute(View parameter, Object parameter2) { try { mInfo.invoke(getSubject(), parameter2); } catch (Exception e) { <START> if (mDebugMode) { <END> throw new RuntimeException(e); } else { execute(parameter); } } } }; } }</code><technical_language>change this behaviour</technical_language>

Target:
private void setupBinding() { setupChanges(false); if (mInfo.getInvokerMethod() != null) { mCommand = new ICommand() { @Override public boolean canExecute(Object parameter) { try { return mInfo.check(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(Object parameter) { try { mInfo.invoke(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } } @Override public boolean canExecute(View view, Object parameter) { try { return mInfo.check(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(View view, Object parameter) { try { mInfo.invoke(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); retryExecute(view, parameter); } } private void retryExecute(View parameter, Object parameter2) { try { mInfo.invoke(getSubject(), parameter2); } catch (Exception e) { execute(parameter); } } }; } }
Source:
<code>private void handleRemovedDevices(Guid vmId, HashSet<Guid> processedDevices) { List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDAO().getVmDeviceByVmId(vmId); for (VmDevice device : devices) { if (!processedDevices.contains(device.getDeviceId())) { if (device.getIsManaged()) { <START> if (device.getIsPlugged()) { <END> log.errorFormat("Managed non plugable device was removed unexpetedly from libvirt: {0}", device.toString()); } else { device.setAddress(""); DbFacade.getInstance().getVmDeviceDAO().update(device); log.debugFormat("Unmanaged pluggable device was unplugged : {0}", device.toString()); } } else { DbFacade.getInstance().getVmDeviceDAO().remove(device.getId()); log.debugFormat("unmanaged device was removed : {0}", device.toString()); } } } }</code><technical_language>please add vm id for log messages in this method</technical_language>

Target:
private void handleRemovedDevices(Guid vmId, HashSet<Guid> processedDevices) { List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDAO().getVmDeviceByVmId(vmId); for (VmDevice device : devices) { if (!processedDevices.contains(device.getDeviceId())) { if (device.getIsManaged()) { if (device.getIsPlugged()) { log.errorFormat("VM {0} managed non plugable device was removed unexpetedly from libvirt: {1}", vmId, device.toString()); } else { device.setAddress(""); addVmDeviceToList(device); log.debugFormat("VM {0} unmanaged pluggable device was unplugged : {1}", vmId, device.toString()); } } else { DbFacade.getInstance().getVmDeviceDAO().remove(device.getId()); log.debugFormat("VM {0} unmanaged device was removed : {1}", vmId, device.toString()); } } } }
Source:
<code>public PypiWheelArtifactCoordinates(String distribution, String version, String build, String languageImplementationVersion, String abi, String platform) { <START> if (distribution == "" || version == "" || languageImplementationVersion == "" || abi == "" || platform == "") <END> { throw new IllegalArgumentException("distribution, version, language_implementation_version_tag, abi_tag, and platform_tag must be specified"); } if (build != "" && !Character.isDigit(build.charAt(0))) { throw new IllegalArgumentException("illegal build tag"); } setId(distribution); setVersion(version); setBuild(build); setLanguageImplementationVersion(languageImplementationVersion); setAbi(abi); setPlatform(platform); }</code><technical_language>* compare objects ==, equals instead. a [this](<LINK_0> [this](<LINK_1> for more details. * checking String-s, StringUtils.isBlank(s). (Check codebase, plenty of examples)</technical_language>

Target:
public PypiWheelArtifactCoordinates(String distribution, String version, String build, String languageImplementationVersion, String abi, String platform) { if (StringUtils.isBlank(distribution) || StringUtils.isBlank(version) || StringUtils.isBlank(languageImplementationVersion) || StringUtils.isBlank(abi) || StringUtils.isBlank(platform)) { throw new IllegalArgumentException("The distribution, version, language_implementation_version_tag, abi_tag, and platform_tag are mandatory fields."); } if (!StringUtils.isBlank(build) && !Character.isDigit(build.charAt(0))) { throw new IllegalArgumentException("Illegal build tag!"); } setId(distribution); setVersion(version); setBuild(build); setLanguageImplementationVersion(languageImplementationVersion); setAbi(abi); setPlatform(platform); }
Source:
<code>public UserProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { <START> String userId = formData.optString("userId"); <END> boolean disableNotifications = formData.optBoolean("disableNotifications"); return new SlackUserProperty(userId, disableNotifications); }</code><technical_language>form binding instead? suggestion return req.bindJSON(SlackUserProperty.class, formData);</technical_language>

Target:
public UserProperty newInstance(StaplerRequest req, JSONObject formData) { return req.bindJSON(SlackUserProperty.class, formData); }
Source:
<code>private void init(List<ServiceReference<Object>> initServices){ if(initServices == null) { this.services = emptyList(); return; } <START> this.services = Arrays.asList( <END> initServices.stream() .map(TemplateServiceReference::new) .sorted() .toArray(TemplateServiceReference[]::new) ); }</code><technical_language>collect(Collectors.toList()) instead</technical_language>

Target:
private void init(List<ServiceReference<Object>> initServices){ if(initServices == null) { this.services = emptyList(); return; } this.services = initServices.stream() .map(TemplateServiceReference::new) .sorted() .collect(Collectors.toList()); }
Source:
<code>private static void writeToFile(CompilationUnit compUnit, File file) throws IOException { try (BufferedWriter bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { bw.write(compUnit.toString()); } catch (IOException e) { <START> throw e; <END> } }</code><technical_language>This catch clause eliminated, re-throws exception change</technical_language>

Target:
private static void writeToFile(CompilationUnit compUnit, File file) throws IOException { try (BufferedWriter bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { bw.write(compUnit.toString()); } }
Source:
<code><START> public String getIdentifier() { <END> MixinDefinition outer = getOuterMixinDefinition(); if (outer != null) { return outer.getIdentifier() + "." + this.name.getString(); } else if (this.isModule && this.sourceSection != null) { return this.sourceSection.getSource().getPath() + ":" + this.name.getString(); } return this.name.getString(); }</code><technical_language>unify this ClassFactory.getFullyQualifiedName? moment, this duplicated code. need ClassFactory.getFullyQualifiedName longer this</technical_language>

Target:
public SSymbol getIdentifier() { MixinDefinition outer = getOuterMixinDefinition(); if (identifier == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); if (outer != null) { identifier = Symbols.symbolFor(outer.getIdentifier() + "." + this.name.getString()); } else if (this.isModule && this.sourceSection != null) { Path absolute = Paths.get(this.sourceSection.getSource().getURI()); Path relative = Paths.get(VmSettings.BASE_DIRECTORY).toAbsolutePath().relativize(absolute); identifier = Symbols.symbolFor(relative.toString() + ":" + this.name.getString()); } else { identifier = this.name; } } return identifier; }
Source:
<code>public void testMassiveMerge() { ArrayList<Double> values = new ArrayList<>(); ArrayList<Double> weights = new ArrayList<>(); FixedDoubleBreakdownHistogram left = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); IntStream.range(0, 100).forEach(i -> { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); left.add(value, weight, 1); }); FixedDoubleBreakdownHistogram right = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); ArrayList<Double> rightValues = new ArrayList<>(); ArrayList<Double> rightWeights = new ArrayList<>(); <START> IntStream.range(0, 100).forEach(i -> { <END> double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); rightValues.add(value); rightWeights.add(weight); right.add(value, weight, 1); }); left.mergeWith(right.clone()); Streams.stream(left.iterator()).forEach(b -> { long count = IntStream.range(0, values.size()) .filter(i -> b.getLeft() < values.get(i) && values.get(i) <= b.getRight() && b.getWeight() == weights.get(i)) .count(); assertEquals(b.getCount(), count); }); Streams.stream(right.iterator()).forEach(b -> { long count = IntStream.range(0, rightValues.size()) .filter(i -> b.getLeft() < rightValues.get(i) && rightValues.get(i) <= b.getRight() && b.getWeight() == rightWeights.get(i)) .count(); assertEquals(b.getCount(), count); }); }</code><technical_language>nit: for-loop. I body is concise, for-loop stream :)</technical_language>

Target:
public void testMassiveMerge() { ArrayList<Double> values = new ArrayList<>(); ArrayList<Double> weights = new ArrayList<>(); FixedDoubleBreakdownHistogram left = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); for (int i = 0; i < 100; ++i) { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); left.add(value, weight, 1); } FixedDoubleBreakdownHistogram right = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); ArrayList<Double> rightValues = new ArrayList<>(); ArrayList<Double> rightWeights = new ArrayList<>(); for (int i = 0; i < 100; ++i) { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); rightValues.add(value); rightWeights.add(weight); right.add(value, weight, 1); } left.mergeWith(right.clone()); Streams.stream(left.iterator()).forEach(b -> { long count = IntStream.range(0, values.size()) .filter(i -> b.getLeft() < values.get(i) && values.get(i) <= b.getRight() && b.getWeight() == weights.get(i)) .count(); assertEquals(b.getCount(), count); }); Streams.stream(right.iterator()).forEach(b -> { long count = IntStream.range(0, rightValues.size()) .filter(i -> b.getLeft() < rightValues.get(i) && rightValues.get(i) <= b.getRight() && b.getWeight() == rightWeights.get(i)) .count(); assertEquals(b.getCount(), count); }); }
Source:
<code>private static long getEstimatedMemorySizeInBytes(MultiPath multiPath) { int pointCount = multiPath.getPointCount(); <START> int pathCount = multiPath.getPointCount(); <END> return ENVELOPE_INSTANCE_SIZE + sizeOfDoubleArray(2 * pointCount) + sizeOfIntArray(pathCount) + sizeOfByteArray(pathCount); }</code><technical_language>getPointCount() -> getPathCount()</technical_language>

Target:
private static long getEstimatedMemorySizeInBytes(MultiPath multiPath) { int pointCount = multiPath.getPointCount(); int pathCount = multiPath.getPathCount(); return ENVELOPE_INSTANCE_SIZE + sizeOfDoubleArray(2 * pointCount) + sizeOfIntArray(pathCount) + sizeOfByteArray(pathCount); }
Source:
<code>public List<Folder> getAllFolders() { Jenkins jenkins = Jenkins.getInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); List<Folder> folders; try (ACLContext ignored = ACL.as(ACL.SYSTEM)) { <START> folders = jenkins.getAllItems(Folder.class); <END> } return folders; }</code><technical_language>Note this exclude other AbstractFolders multibranch projects GitHub organization folders. want</technical_language>

Target:
public List<AbstractFolder> getAllFolders() { Jenkins jenkins = Jenkins.getInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); List<AbstractFolder> folders; try (ACLContext ignored = ACL.as(ACL.SYSTEM)) { folders = jenkins.getAllItems(AbstractFolder.class); } return folders; }
Source:
<code>protected void mergeBufferIntoQueue() { for (final Entry<DifferentialTimestamp, Map<Tuple, Integer>> outerEntry : this.buffer.entrySet()) { final DifferentialTimestamp selector = outerEntry.getKey(); final Map<Tuple, Integer> tupleMap = this.queue.get(selector); if (tupleMap == null) { this.queue.put(selector, outerEntry.getValue()); } else { for (final Entry<Tuple, Integer> innerEntry : outerEntry.getValue().entrySet()) { final Tuple tuple = innerEntry.getKey(); final Integer queueCount = tupleMap.get(tuple); final Integer bufferCount = innerEntry.getValue(); if (queueCount == null) { tupleMap.put(tuple, bufferCount); } else { final int sum = bufferCount + queueCount; if (sum != 0) { tupleMap.put(tuple, sum); <START> } <END> } } } } }</code><technical_language>else tupleMap.remove()</technical_language>

Target:
protected void mergeBufferIntoQueue() { for (final Entry<DifferentialTimestamp, IDeltaBag<Tuple>> outerEntry : this.buffer.entrySet()) { final DifferentialTimestamp selector = outerEntry.getKey(); final IDeltaBag<Tuple> tupleMap = this.queue.get(selector); if (tupleMap == null) { this.queue.put(selector, outerEntry.getValue()); } else { for (final Tuple tuple : outerEntry.getValue().distinctValues()) { final int queueCount = tupleMap.getCount(tuple); final int bufferCount = outerEntry.getValue().getCount(tuple); if (queueCount == 0) { tupleMap.addSigned(tuple, bufferCount); } else { final int sum = bufferCount + queueCount; if (sum != 0) { tupleMap.addSigned(tuple, sum); } else { tupleMap.clearAllOf(tuple); } } } } } }
Source:
<code>private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); float[][] percentageFrequencyOrAverage = calculatePercentageFrequencyAndAverage(responseFrequency, fqd); <START> return percentageFrequencyOrAverage; <END> }</code><technical_language>return calculatePercentageFrequencyAndAverage(responseFrequency, fqd); do</technical_language>

Target:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); return getPercentageFrequencyAndAverage(responseFrequency, fqd); }
Source:
<code>private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openAnchor() <START> .setAttribute("href", "/#/q/hashtag:" + hashtagName) <END> .setAttribute("role", "listitem") .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .append(hashtagName) .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( new ImageResourceRenderer().render(Resources.I.remove_reviewer())) .closeElement("button"); html.closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }</code><technical_language>this fail if gerrit is running other root of servlet container? e.g. <LINK_0> /r/#/q/hashtag. (Unless some magical GWT magic I here...)</technical_language>

Target:
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openAnchor() .setAttribute("href", "#" + PageLinks.toChangeQuery("hashtag:" + hashtagName)) .setAttribute("role", "listitem") .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .append(hashtagName) .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( new ImageResourceRenderer().render(Resources.I.remove_reviewer())) .closeElement("button"); html.closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }
Source:
<code>public int[] getSizes() { int[] array = new int[ headers.size()]; int x = 0; try { for ( CpioHeader header : headers) { Object object = sources.get( header); if ( object instanceof File) array[ x] = ( int) (( File) object).length(); else if ( object instanceof URL) array[ x] = (( URL) object).openConnection().getContentLength(); else if ( header.getType() == DIR) array[ x] = 4096; <START> else if ( object instanceof String) array[ x] = (( String) object).length(); <END> ++x; } } catch ( IOException e) { throw new RuntimeException( e); } return array; }</code><technical_language>this cleaner; else if ( header.getType() == SYMLINK) array[ x] = (( String) object).length();</technical_language>

Target:
public int[] getSizes() { int[] array = new int[ headers.size()]; int x = 0; try { for ( CpioHeader header : headers) { Object object = sources.get( header); if ( object instanceof File) array[ x] = ( int) (( File) object).length(); else if ( object instanceof URL) array[ x] = (( URL) object).openConnection().getContentLength(); else if ( header.getType() == DIR) array[ x] = 4096; else if ( header.getType() == SYMLINK) array[ x] = (( String) object).length(); ++x; } } catch ( IOException e) { throw new RuntimeException( e); } return array; }
Source:
<code>private void onWirelessDebuggingEnabled(boolean enabled) { setSwitchBarChecked(enabled); <START> mSwitchWidget.setEnabled(true); <END> if (mListener != null) { mListener.onEnabled(enabled); } }</code><technical_language>default, enable, I set false. So, remove it</technical_language>

Target:
private void onWirelessDebuggingEnabled(boolean enabled) { mSwitchWidget.setChecked(enabled); mSwitchWidget.setEnabled(true); if (mListener != null) { mListener.onEnabled(enabled); } }
Source:
<code>public static void generateFiles(String filePath, String content) throws IOException { <START> FileOutputStream fos = null; <END> File file; try { file = new File(filePath); fos = new FileOutputStream(file); if (!file.exists()) { file.createNewFile(); } byte[] bytesArray = content.getBytes(); fos.write(bytesArray); fos.flush(); } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new IOException(errorMessage, e); } finally { try { if (fos != null) { fos.close(); } } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new IOException(errorMessage, e); } } }</code><technical_language>try resource creating FileOutputStream? do need close file explicitly in line 365</technical_language>

Target:
public static void generateFiles(String filePath, String content) throws APIManagementException { File file = new File(filePath); try (FileOutputStream fos = new FileOutputStream(file)) { if (!file.exists()) { file.createNewFile(); } byte[] bytesArray = content.getBytes(); fos.write(bytesArray); fos.flush(); } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new APIManagementException(errorMessage, e); } }
Source:
<code>public void testReadAll_withLambda() throws Exception { ByteBuffer bb = struct.encoder() .string("name", "joe") <START> .structs("mapEntry", new StructArrayEncoderFunction() { <END> @Override public void encode(StructArrayEncoder encoder) { encoder .string("key", "1") .string("value", "one") .next() .string("key", "2") .string("value", "two"); } }) .int64("id", 999L) .encode(); bb.rewind(); StructDecoder decoder = struct.decoder(bb); assertThat(decoder.string("name"), is("joe")); StructArrayDecoder sad = decoder.structs("mapEntry"); assertThat(sad.length(), is(2)); assertThat(sad.string("key"), is("1")); assertThat(sad.string("value"), is("one")); sad.next(); assertThat(sad.string("key"), is("2")); assertThat(sad.string("value"), is("two")); sad.end(); assertThat(decoder.int64("id"), is(999L)); }</code><technical_language>pass a StructEncoderFunction iterable structs() method iterate calling function for element</technical_language>

Target:
public void testReadAll_withLambda() throws Exception { ByteBuffer bb = struct.encoder() .string("name", "joe") .structs("mapEntry", new StructArrayEncoderFunction() { @Override public void encode(StructArrayEncoder encoder) { encoder .string("key", "1") .enm("type", Type.STRING) .string("string", "one") .next() .string("key", "2") .enm("type", Type.STRING) .string("string", "two"); } }) .int64("id", 999L) .encode(); bb.rewind(); StructDecoder decoder = struct.decoder(bb); assertThat(decoder.string("name"), is("joe")); StructArrayDecoder sad = decoder.structs("mapEntry"); assertThat(sad.length(), is(2)); assertThat(sad.string("key"), is("1")); assertThat(sad.enm("type").get(), Is.<Object>is(Type.STRING)); assertThat(sad.string("string"), is("one")); sad.next(); assertThat(sad.string("key"), is("2")); assertThat(sad.enm("type").get(), Is.<Object>is(Type.STRING)); assertThat(sad.string("string"), is("two")); sad.end(); assertThat(decoder.int64("id"), is(999L)); }
Source:
<code>protected MemoryImageBuilder getMemoryImageBuilder() { <START> if (null == memoryBuilder) { <END> memoryBuilder = createMemoryImageBuilder(); } return memoryBuilder; }</code><technical_language>flip comparison - if (memoryBuilder == null) - more readable</technical_language>

Target:
protected MemoryImageBuilder getMemoryImageBuilder() { if (memoryBuilder == null) { memoryBuilder = createMemoryImageBuilder(); } return memoryBuilder; }
Source:
<code>public void onListItemClick(ListView l, View v, int position, long id) { Task taskClicked; <START> if (TASK_TYPE == USER && mUserTaskList.size() > 0) taskClicked = mUserTaskList.get(position); <END> else taskClicked = mAllTaskList.get(position); TaskDetailFragment detailFragment = TaskDetailFragment.newInstance(taskClicked); mParentActivity.replaceFragment(detailFragment); }</code><technical_language>switch id of ListView, checking list exists</technical_language>

Target:
public void onListItemClick(ListView l, View v, int position, long id) { Task taskClicked; if (TASK_TYPE == USER) taskClicked = mUserTaskList.get(position); else taskClicked = mAllTaskList.get(position); TaskDetailFragment detailFragment = TaskDetailFragment.newInstance(taskClicked); mParentActivity.replaceFragment(detailFragment); }
Source:
<code>public void teardown() { LOG.info("Shutting down"); terminated = true; mutex.release(); try { executorThread.awaitTermination(10000L + executeIntervalMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } <START> executorThread.shutdown(); <END> }</code><technical_language>I shutdown invoked awaitTermination</technical_language>

Target:
public void teardown() { LOG.info("Shutting down"); terminated = true; mutex.release(); executorThread.shutdown(); try { executorThread.awaitTermination(10000L + executeIntervalMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } }
Source:
<code>public void combinedLocksCondition_checkExternalLocksFirst() { <START> assertThatThrownBy(() -> combinedLocksCondition.throwIfConditionInvalid(0L)) <END> .isInstanceOf(TransactionLockTimeoutNonRetriableException.class) .hasMessageContaining("Provided external lock tokens expired. Retry is not possible"); }</code><technical_language>nit: this test start following? _looks_ strictly needed, for consistency others when(lockService.refreshLockRefreshTokens(Collections.singleton(EXTERNAL_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of()); when(lockService.refreshLockRefreshTokens(Collections.singleton(TRANSACTION_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of());</technical_language>

Target:
public void combinedLocksCondition_checkExternalLocksFirst() { when(lockService.refreshLockRefreshTokens(Collections.singleton(EXTERNAL_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of()); when(lockService.refreshLockRefreshTokens(Collections.singleton(TRANSACTION_LOCK_REFRESH_TOKEN))) .thenReturn(ImmutableSet.of()); assertThatThrownBy(() -> combinedLocksCondition.throwIfConditionInvalid(0L)) .isInstanceOf(TransactionLockTimeoutNonRetriableException.class) .hasMessageContaining("Provided external lock tokens expired. Retry is not possible"); }
Source:
<code>public void addsHeadersToResponse() throws IOException { MatcherAssert.assertThat( new RsPrint( new RsWithHeaders( new RsEmpty(), <START> "Host: www.example.com", <END> "Content-Type: text/xml" ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", "Host: www.example.com", "Content-Type: text/xml", "", "" ) ) ); }</code><technical_language>@dmzaytsev extract this a private final String variable</technical_language>

Target:
public void addsHeadersToResponse() throws IOException { final String host = "Host: www.example.com"; final String type = "Content-Type: text/xml"; MatcherAssert.assertThat( new RsPrint( new RsWithHeaders( new RsEmpty(), host, type ) ).print(), Matchers.equalTo( Joiner.on("\r\n").join( "HTTP/1.1 200 OK", host, type, "", "" ) ) ); }
Source:
<code>protected Future<?> runCollector(Properties props, String topic) { String jobName = topic + "-" + UUID.randomUUID().toString(); <START> props.put("tmp.path", props.getProperty(CAMUS_SWEEPER_TMP_DIR) + "/" + jobName + "_" + System.currentTimeMillis()); <END> if (props.containsKey(REDUCE_COUNT_OVERRIDE + topic)) props.put("reducer.count", Integer.parseInt(props.getProperty(REDUCE_COUNT_OVERRIDE + topic))); LOG.info("Processing " + props.get(INPUT_PATHS)); return executorService.submit(new KafkaCollectorRunner(jobName, props, errorMessages, topic)); }</code><technical_language>static final variable initialized in constructor TMP_PATH hard-coding string here</technical_language>

Target:
protected Future<?> runCollector(Properties props, String topic) { String jobName = topic + "-" + UUID.randomUUID().toString(); props .put("tmp.path", props.getProperty("camus.sweeper.tmp.dir") + "/" + jobName + "_" + System.currentTimeMillis()); if (props.containsKey("reduce.count.override." + topic)) props.put("reducer.count", Integer.parseInt(props.getProperty("reduce.count.override." + topic))); LOG.info("Processing " + props.get("input.paths")); return executorService.submit(new KafkaCollectorRunner(jobName, props, errorMessages, topic)); }
Source:
<code>public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { <START> return (isApplicationType(action.composeAction()) || isApplicationType(target)) ? APPLICATION : NON_APPLICATION; <END> }</code><technical_language>This simply return NON_APPLICATION isApplicationType() removed. methods return false</technical_language>

Target:
public Constraint getRequiredConstraint(Action.ActionEffect actionEffect, JmxAction action, JmxTarget target) { return NON_APPLICATION; }
Source:
<code>public List<IPAddress> getDhcpDnsServers(String interfaceName, IPAddress address) throws KuraException { ArrayList<IPAddress> servers = null; if (interfaceName != null && !interfaceName.isEmpty() && address != null && address.getAddress() != null) { StringBuilder sb = new StringBuilder(); sb.append("interface \"").append(interfaceName).append("\";"); String interfaceMatch = sb.toString(); sb = new StringBuilder(); sb.append("fixed-address ").append(address.getHostAddress()).append(";"); String fixedAddressMatch = sb.toString(); File globalDhClientFile = new File(formGlobalDhclientLeasesFilename()); File interfaceDhClientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); if (interfaceDhClientFile.exists()) { servers = parseDhclientFile(interfaceDhClientFile, interfaceMatch, fixedAddressMatch); } else if (globalDhClientFile.exists()) { servers = parseDhclientFile(globalDhClientFile, interfaceMatch, fixedAddressMatch); } else { servers = new ArrayList<>(); File dhclientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); if (!dhclientFile.exists()) { <START> try { <END> if (dhclientFile.createNewFile()) { logger.debug("The doesn't exist, created new empty file ...", dhclientFile.getName()); } } catch (Exception e) { throw new KuraException(KuraErrorCode.CONFIGURATION_ERROR, e); } } } } return servers; }</code><technical_language>try moved line and, in this way, merge ifs</technical_language>

Target:
public List<IPAddress> getDhcpDnsServers(String interfaceName, IPAddress address) throws KuraException { if (interfaceName == null || interfaceName.isEmpty() || address == null || address.getAddress() == null) { return new ArrayList<>(); } StringBuilder sb = new StringBuilder(); sb.append("interface \"").append(interfaceName).append("\";"); String interfaceMatch = sb.toString(); sb = new StringBuilder(); sb.append("fixed-address ").append(address.getHostAddress()).append(";"); String fixedAddressMatch = sb.toString(); File globalDhClientFile = new File(formGlobalDhclientLeasesFilename()); File interfaceDhClientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); ArrayList<IPAddress> servers; if (interfaceDhClientFile.exists()) { servers = parseDhclientFile(interfaceDhClientFile, interfaceMatch, fixedAddressMatch); } else if (globalDhClientFile.exists()) { servers = parseDhclientFile(globalDhClientFile, interfaceMatch, fixedAddressMatch); } else { servers = new ArrayList<>(); File dhclientFile = new File(formInterfaceDhclientLeasesFilename(interfaceName)); try { if (!dhclientFile.exists() && dhclientFile.createNewFile()) { logger.debug("The doesn't exist, created new empty file ...", dhclientFile.getName()); } } catch (Exception e) { throw new KuraException(KuraErrorCode.CONFIGURATION_ERROR, e); } } if (!servers.isEmpty()) { logger.debug("getDhcpDnsServers() :: DHCP DNS servers for interface {}", interfaceName, servers); } return servers; }
Source:
<code>private List<Pair<Block, Integer>> getBlockMetaPairsFromArray(JsonArray ary) { List<Pair<Block, Integer>> blockMetaPairs = new ArrayList<>(); ary.forEach((element) -> { String str = element.getAsString(); String[] pieces = str.split(":"); String domain = "minecraft"; String path; int meta = OreDictionary.WILDCARD_VALUE; if (pieces.length == 1) { path = pieces[0]; } else if (pieces.length == 2) { domain = pieces[0]; path = pieces[1]; } else { if (pieces.length > 3) { <START> EsteemedInnovation.logger.warn("[EI] More than 3 values separated by : in ReplaceableBlocks '%s' for Ore generation config. Expected maximum: 'domain:path:meta'. This may indicate a bug in your config!", str); <END> } domain = pieces[0]; path = pieces[1]; meta = Integer.valueOf(pieces[2]); } blockMetaPairs.add(Pair.of(Block.REGISTRY.getObject(new ResourceLocation(domain, path)), meta)); }); return blockMetaPairs; }</code><technical_language>[EI] removed this, [esteemedinnovation] in log entry</technical_language>

Target:
private List<Pair<Block, Integer>> getBlockMetaPairsFromArray(JsonArray ary) { List<Pair<Block, Integer>> blockMetaPairs = new ArrayList<>(); ary.forEach((element) -> { String str = element.getAsString(); String[] pieces = str.split(":"); String domain = "minecraft"; String path; int meta = OreDictionary.WILDCARD_VALUE; if (pieces.length == 1) { path = pieces[0]; } else if (pieces.length == 2) { domain = pieces[0]; path = pieces[1]; } else { if (pieces.length > 3) { EsteemedInnovation.logger.warn("More than 3 values separated by : in ReplaceableBlocks '%s' for Ore generation config. Expected maximum: 'domain:path:meta'. This may indicate a bug in your config!", str); } domain = pieces[0]; path = pieces[1]; meta = Integer.valueOf(pieces[2]); } blockMetaPairs.add(Pair.of(Block.REGISTRY.getObject(new ResourceLocation(domain, path)), meta)); }); return blockMetaPairs; }