auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void firePropertyChangedEvent(final PropertyChangeEvent event) { Object[] allListeners; synchronized(listeners) { allListeners = listeners.getListeners(); } for (Object <START> allListener : <END> allListeners) { final IPropertyChangeListener listener = (IPropertyChangeListener) allListener; SafeRunner.run(new SafeRunnable() { @Override public void run() throws Exception { listener.propertyChange(event); } }); } }</code><technical_language>listener</technical_language>

Target:
protected void firePropertyChangedEvent(final PropertyChangeEvent event) { Object[] allListeners; synchronized(listeners) { allListeners = listeners.getListeners(); } for (Object l : allListeners) { final IPropertyChangeListener listener = (IPropertyChangeListener)l; SafeRunner.run(new SafeRunnable() { @Override public void run() throws Exception { listener.propertyChange(event); } }); } }
Source:
<code>private int getLineOffset(int widgetLineIndex) throws BadLocationException { if (!isFixedWidth()) { return document.getLineOffset(widgetLineIndex); } else { if (widgetLineIndex < 0 || widgetLineIndex >= widgetLines) { throw new <START> BadLocationException(); <END> } return widgetLineOffsets[widgetLineIndex]; } }</code><technical_language>I prefer write some explanation call is failed</technical_language>

Target:
private int getLineOffset(int widgetLineIndex) throws BadLocationException { if (!isFixedWidth()) { return document.getLineOffset(widgetLineIndex); } else { if (widgetLineIndex < 0 || widgetLineIndex >= widgetLines) { throw new BadLocationException(widgetLineIndex + " is not a valid line index."); } return widgetLineOffsets[widgetLineIndex]; } }
Source:
<code>private CopyRatioDataCollection(final SegmentedModel segmentedModel) { if (segmentedModel.getGenome().getTargets().targetCount() == 0) { throw new IllegalArgumentException("Cannot construct CopyRatioDataCollection with no target-coverage data."); } <START> final TargetCollection<ReadCountRecord.SingletonRecord> targetCoverages = segmentedModel.getGenome().getTargets(); <END> final List<Double> coverages = segmentedModel.getSegments().stream() .flatMap(s -> targetCoverages.targets(s).stream()) .map(ReadCountRecord.SingletonRecord::getCount) .collect(Collectors.toList()); numTargetsPerSegment = segmentedModel.getSegments().stream() .map(s -> targetCoverages.targets(s).size()) .collect(Collectors.toList()); numSegments = numTargetsPerSegment.size(); numTargets = coverages.size(); coverageRange = Collections.max(coverages) - Collections.min(coverages); int startTarget = 0; for (int segment = 0; segment < numSegments; segment++) { startTargetsPerSegment.add(startTarget); final int numTargetsInSegment = numTargetsPerSegment.get(segment); coveragesPerSegment.add(coverages.subList(startTarget, startTarget + numTargetsInSegment)); startTarget += numTargetsInSegment; } }</code><technical_language>is this a ReadCountCollection? a ReadCountRecord.SingletonRecord</technical_language>

Target:
private CopyRatioDataCollection(final SegmentedModel segmentedModel) { if (segmentedModel.getGenome().getTargets().targetCount() == 0) { throw new IllegalArgumentException("Cannot construct CopyRatioDataCollection with no target-coverage data."); } final TargetCollection<ReadCountRecord.SingleSampleRecord> targetCoverages = segmentedModel.getGenome().getTargets(); final List<Double> coverages = segmentedModel.getSegments().stream() .flatMap(s -> targetCoverages.targets(s).stream()) .map(ReadCountRecord.SingleSampleRecord::getCount) .collect(Collectors.toList()); numTargetsPerSegment = segmentedModel.getSegments().stream() .map(s -> targetCoverages.targets(s).size()) .collect(Collectors.toList()); numSegments = numTargetsPerSegment.size(); numTargets = coverages.size(); coverageRange = Collections.max(coverages) - Collections.min(coverages); int startTarget = 0; for (int segment = 0; segment < numSegments; segment++) { startTargetsPerSegment.add(startTarget); final int numTargetsInSegment = numTargetsPerSegment.get(segment); coveragesPerSegment.add(coverages.subList(startTarget, startTarget + numTargetsInSegment)); startTarget += numTargetsInSegment; } }
Source:
<code>public void beforeExam() throws Exception { getCatalogBundle().setupMaxDownloadRetryAttempts(MAX_DOWNLOAD_RETRY_ATTEMPTS); setupOpenSearch(); setupCswServer(); setupGmd(); <START> getCatalogBundle().waitForFederatedSource(OPENSEARCH_SOURCE_ID); <END> getCatalogBundle().waitForFederatedSource(CSW_STUB_SOURCE_ID); getCatalogBundle().waitForFederatedSource(CSW_SOURCE_ID); getCatalogBundle().waitForFederatedSource(CSW_SOURCE_WITH_METACARD_XML_ID); getCatalogBundle().waitForFederatedSource(GMD_SOURCE_ID); getServiceManager() .waitForSourcesToBeAvailable( REST_PATH.getUrl(), OPENSEARCH_SOURCE_ID, CSW_STUB_SOURCE_ID, CSW_SOURCE_ID, CSW_SOURCE_WITH_METACARD_XML_ID, GMD_SOURCE_ID); LOGGER.info("Source status: \n{}", get(REST_PATH.getUrl() + "sources").body().prettyPrint()); }</code><technical_language>tests sources? tests need is OpenSearch source</technical_language>

Target:
public void beforeExam() throws Exception { getCatalogBundle().setupMaxDownloadRetryAttempts(MAX_DOWNLOAD_RETRY_ATTEMPTS); setupOpenSearch(); setupCswServer(); setupGmd(); getCatalogBundle().waitForFederatedSource(OPENSEARCH_SOURCE_ID); getCatalogBundle().waitForFederatedSource(CSW_STUB_SOURCE_ID); getCatalogBundle().waitForFederatedSource(CSW_SOURCE_ID); getCatalogBundle().waitForFederatedSource(CSW_SOURCE_WITH_METACARD_XML_ID); getCatalogBundle().waitForFederatedSource(GMD_SOURCE_ID); getServiceManager() .waitForSourcesToBeAvailable( REST_PATH.getUrl(), OPENSEARCH_SOURCE_ID, CSW_STUB_SOURCE_ID, CSW_SOURCE_ID, CSW_SOURCE_WITH_METACARD_XML_ID, GMD_SOURCE_ID); getCatalogBundle().setDownloadRetryDelayInSeconds(1); getCatalogBundle().setupCaching(false); LOGGER.info("Source status: \n{}", get(REST_PATH.getUrl() + "sources").body().prettyPrint()); }
Source:
<code>public int compareTo(@Nullable ITmfStateValue other) { if (other == null) { <START> throw new IllegalArgumentException(); <END> } if (other.getType() != Type.BOOLEAN) { throw new StateValueTypeException("A boolean state value cannot be compared to the type " + other.getType()); } return Boolean.compare(value, ((BooleanStateValue) other).value); }</code><technical_language>wish add info</technical_language>

Target:
public int compareTo(@Nullable ITmfStateValue other) { if (other == null) { throw new IllegalArgumentException("Cannot compare against null reference."); } if (other.getType() == Type.NULL) { return 1; } else if (other.getType() == Type.BOOLEAN) { return Boolean.compare(value, ((BooleanStateValue) other).value); } else { throw new StateValueTypeException("A boolean state value cannot be compared to the type " + other.getType()); } }
Source:
<code>protected void writeScoreView() { nextSheet("Score view", 1, 3, true); nextRow(); nextHeaderCell("Score"); nextCell().setCellValue(score == null ? "Not yet solved" : score.toShortString()); nextRow(); nextRow(); nextHeaderCell("Constraint match"); nextHeaderCell("Match score"); nextHeaderCell("Total score"); <START> if (!score.isSolutionInitialized()) { <END> nextRow(); nextHeaderCell("Unassigned variables"); nextCell(); nextCell().setCellValue(score.getInitScore()); } for (ConstraintMatchTotal constraintMatchTotal : constraintMatchTotalList) { nextRow(); nextHeaderCell(constraintMatchTotal.getConstraintName()); nextCell(); nextCell().setCellValue(constraintMatchTotal.getScore().toShortString()); List<ConstraintMatch> constraintMatchList = new ArrayList<>(constraintMatchTotal.getConstraintMatchSet()); constraintMatchList.sort(Comparator.comparing(ConstraintMatch::getScore)); for (ConstraintMatch constraintMatch : constraintMatchList) { nextRow(); nextCell().setCellValue(" " + constraintMatch.getJustificationList().stream() .filter(o -> o instanceof Talk).map(o -> ((Talk) o).getCode()) .collect(joining(", "))); nextCell().setCellValue(constraintMatch.getScore().toShortString()); nextCell(); nextCell(); } } autoSizeColumnsWithHeader(); }</code><technical_language>Findbugs: > null pointer dereference of AbstractXlsxSolutionFileIO$AbstractXlsxWriter.score. score is assigned a in constructor (line 364), null check line 456 is longer necessary. Removing nullcheck eliminates null dereference warning</technical_language>

Target:
protected void writeScoreView() { nextSheet("Score view", 1, 3, true); nextRow(); nextHeaderCell("Score"); nextCell().setCellValue(score.toShortString()); nextRow(); nextRow(); nextHeaderCell("Constraint match"); nextHeaderCell("Match score"); nextHeaderCell("Total score"); if (!score.isSolutionInitialized()) { nextRow(); nextHeaderCell("Unassigned variables"); nextCell(); nextCell().setCellValue(score.getInitScore()); } for (ConstraintMatchTotal constraintMatchTotal : constraintMatchTotalList) { nextRow(); nextHeaderCell(constraintMatchTotal.getConstraintName()); nextCell(); nextCell().setCellValue(constraintMatchTotal.getScore().toShortString()); List<ConstraintMatch> constraintMatchList = new ArrayList<>(constraintMatchTotal.getConstraintMatchSet()); constraintMatchList.sort(Comparator.comparing(ConstraintMatch::getScore)); for (ConstraintMatch constraintMatch : constraintMatchList) { nextRow(); nextCell().setCellValue(" " + constraintMatch.getJustificationList().stream() .filter(o -> o instanceof Talk).map(o -> ((Talk) o).getCode()) .collect(joining(", "))); nextCell().setCellValue(constraintMatch.getScore().toShortString()); nextCell(); nextCell(); } } autoSizeColumnsWithHeader(); }
Source:
<code>public boolean isSupported(boolean slaveMode) { if (CommandMetaData.Mode.MASTER_OR_SLAVE == this) { return true; } boolean runsWithMasterOnly = this == <START> CommandMetaData.Mode.MASTER ? true : false; <END> if (slaveMode ^ runsWithMasterOnly) { return true; } return false; }</code><technical_language>is this part necessary</technical_language>

Target:
public boolean isSupported(boolean slaveMode) { return this == MASTER_OR_SLAVE || !slaveMode; }
Source:
<code>private static String getFailMessage(ProcessStatus result) { <START> if (result instanceof ProcessStatus) { <END> ProcessStatus firstFail = getFirstFail(result.getChildren()); if (firstFail != null) return result.getMessage() + ": " + getFailMessage(firstFail); } return result.getMessage(); }</code><technical_language>do need this check? ScriptProcessStatus object containig ECL stack information. ProcessStatus is a common type for IStatus wrapper. absolutely meaning. I afraid this implementation get infromation for "short" message"</technical_language>

Target:
private static String getFailMessage(ProcessStatus result) { ProcessStatus firstFail = getFirstFail(result.getChildren()); if (firstFail != null) return result.getMessage() + ": " + getFailMessage(firstFail); return result.getMessage(); }
Source:
<code>void registerSubstitutionAlias(String name, GameRegistry.Type type, Object toReplace) throws ExistingSubstitutionException { ResourceLocation nameToSubstitute = new ResourceLocation(name); FMLControlledNamespacedRegistry registry = null; <START> switch (type) <END> { case BLOCK: registry = iBlockRegistry; break; case ITEM: registry = iItemRegistry; break; case POTION: registry = iPotionRegistry; break; case POTION_TYPE: registry = iPotionTypeRegistry; break; case BIOME: registry = iBiomeRegistry; break; case ENCHANTMENT: registry = iEnchantmentRegistry; break; case SOUND_EVENT: registry = iSoundEventRegistry; break; } if (registry != null) { registry.addSubstitutionAlias(Loader.instance().activeModContainer().getModId(), nameToSubstitute, (IForgeRegistryEntry) toReplace); registry.activateSubstitution(nameToSubstitute); } }</code><technical_language>I suggest enum map instead. for some cleaner code</technical_language>

Target:
void registerSubstitutionAlias(String name, GameRegistry.Type type, Object toReplace) throws ExistingSubstitutionException { ResourceLocation nameToSubstitute = new ResourceLocation(name); FMLControlledNamespacedRegistry registry=registryTypeMap.get(type); if(registry==null){ FMLLog.getLogger().log(Level.WARN,"Cannot register substitution. Registry for type %s not found",type); } else{ registry.addSubstitutionAlias(Loader.instance().activeModContainer().getModId(),nameToSubstitute, (IForgeRegistryEntry) toReplace); registry.activateSubstitution(nameToSubstitute); } }
Source:
<code>public void InteractiveMaps_036_VerifyEmbedMapContributeModals() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = new ArticlePageObject(driver); article.openArticleByName(wikiURL, InteractiveMapsContent.embedMapArticleName); EmbedMapComponentObject embedMapDialog = article.clickViewEmbedMap(); AddPinComponentObject addPinModal = embedMapDialog.placePinInMap(); addPinModal.verifyPinTitleFieldIsDisplayed(); addPinModal.verifyDescriptionFieldIsDisplayed(); addPinModal.clickCancelButton(); <START> embedMapDialog.clickEditPinTypesButton(); <END> CreatePinTypesComponentObject pinTypesDialog = new CreatePinTypesComponentObject(driver); pinTypesDialog.verifyPinTypesDialog(); }</code><technical_language>I consider if clickEditPinTypesButton() return CreatePinTypesComponentObject time this method, creating new CreatePinTypesComponentObject right :)</technical_language>

Target:
public void InteractiveMaps_036_VerifyEmbedMapContributeModals() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = new ArticlePageObject(driver); article.openArticleByName(wikiURL, InteractiveMapsContent.embedMapArticleName); EmbedMapComponentObject embedMapDialog = article.clickViewEmbedMap(); AddPinComponentObject addPinModal = embedMapDialog.placePinInMap(); addPinModal.verifyPinTitleFieldIsDisplayed(); addPinModal.verifyDescriptionFieldIsDisplayed(); addPinModal.clickCancelButton(); CreatePinTypesComponentObject pinTypesDialog = embedMapDialog.clickEditPinTypesButton(); pinTypesDialog.verifyPinTypesDialog(); }
Source:
<code>protected String getColumnDefinition() { StringBuilder toReturn = new StringBuilder(); String constraints = extras != null ? extras.constraints() : ColumnSpec.DEFAULT_NONE; if (!ColumnSpec.DEFAULT_NONE.equals(constraints)) { toReturn.append(constraints); } if (!ColumnSpec.DEFAULT_NONE.equals(getColumnDefault())) { String columnDefaultValue = getColumnDefinitionDefaultValue(); if (!toReturn.toString().toUpperCase().contains("DEFAULT")) { toReturn.append(" DEFAULT ").append(columnDefaultValue); } else { utils.getMessager().printMessage(Kind.WARNING, "Duplicate default value definitions", field); } } if (field != null && field.getAnnotation(PrimaryKey.class) != null) { PrimaryKey primaryKeyAnnotation = field.getAnnotation(PrimaryKey.class); if (!toReturn.toString().toUpperCase().contains("PRIMARY KEY")) { toReturn.append(" PRIMARY KEY "); if (TypeConstants.isIntegerType(getTypeForAccessors()) && primaryKeyAnnotation.autoincrement()) { toReturn.append("AUTOINCREMENT"); } } else { utils.getMessager().printMessage(Kind.WARNING, "Duplicate primary key definition in column constraints." <START> + " Use the PrimaryKey annotation instead of declaring the constraint in ColumnSpec."); <END> } } String toReturnString = toReturn.toString().trim(); if (!AptUtils.isEmpty(toReturnString)) { return "\"" + toReturnString + "\""; } return null; }</code><technical_language>add @ symbol in front of annotation names</technical_language>

Target:
protected String getColumnDefinition() { StringBuilder toReturn = new StringBuilder(); String constraints = extras != null ? extras.constraints() : ColumnSpec.DEFAULT_NONE; if (!ColumnSpec.DEFAULT_NONE.equals(constraints)) { toReturn.append(constraints); } if (!ColumnSpec.DEFAULT_NONE.equals(getColumnDefault())) { String columnDefaultValue = getColumnDefinitionDefaultValue(); if (!toReturn.toString().toUpperCase().contains("DEFAULT")) { toReturn.append(" DEFAULT ").append(columnDefaultValue); } else { utils.getMessager().printMessage(Kind.WARNING, "Duplicate default value definitions", field); } } if (field != null && field.getAnnotation(PrimaryKey.class) != null) { PrimaryKey primaryKeyAnnotation = field.getAnnotation(PrimaryKey.class); if (!toReturn.toString().toUpperCase().contains("PRIMARY KEY")) { toReturn.append(" PRIMARY KEY "); if (TypeConstants.isIntegerType(getTypeForAccessors()) && primaryKeyAnnotation.autoincrement()) { toReturn.append("AUTOINCREMENT"); } } else { utils.getMessager().printMessage(Kind.WARNING, "Duplicate primary key definition in column constraints." + " Use the @PrimaryKey annotation instead of declaring the constraint in ColumnSpec."); } } String toReturnString = toReturn.toString().trim(); if (!AptUtils.isEmpty(toReturnString)) { return "\"" + toReturnString + "\""; } return null; }
Source:
<code><START> @Override public void onSaveInstanceState(@NonNull Bundle outState) { <END> super.onSaveInstanceState(outState); outState.putBoolean(KEY_IS_IN_VISUAL_PREVIEW, isInVisualPreview()); }</code><technical_language>suggestion @Override public void onSaveInstanceState(@NonNull Bundle outState) { move @Override annotation a separate line for code style consistency</technical_language>

Target:
public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putBoolean(KEY_IS_IN_VISUAL_PREVIEW, isInVisualPreview()); }
Source:
<code>private static void setLevelUsingRegex(Level level, String regex) { if (regex.startsWith("^")) { regex = regex.substring(1); if (regex.endsWith("$") && !regex.endsWith("\\$")) { regex = regex.substring(0, regex.length() - 1); } } <START> final RunAutomaton <END> a = new RunAutomaton(new RegExp(regex).toAutomaton()); for (Enumeration<Logger> logger = LogManager.getCurrentLoggers(); logger.hasMoreElements();) { Logger log = logger.nextElement(); if (a.run(log.getName())) { log.setLevel(level); } } }</code><technical_language>final? in new code needed</technical_language>

Target:
private static void setLevelUsingRegex(Level level, String regex) { if (regex.startsWith("^")) { regex = regex.substring(1); if (regex.endsWith("$") && !regex.endsWith("\\$")) { regex = regex.substring(0, regex.length() - 1); } } RunAutomaton a = new RunAutomaton(new RegExp(regex).toAutomaton()); for (Enumeration<Logger> logger = LogManager.getCurrentLoggers(); logger.hasMoreElements();) { Logger log = logger.nextElement(); if (a.run(log.getName())) { log.setLevel(level); } } }
Source:
<code>private String getValuesAsString() { <START> return targetValues.stream().map(Object::toString).collect(Collectors.joining(", ")); <END> }</code><technical_language>targetValues is a List<String> need toString. String.join(", ", targetValues) instead</technical_language>

Target:
private String getValuesAsString() { return String.join(", ", targetValues); }
Source:
<code>void cancel() { super.cancel(); <START> if (callback != null) { <END> callback = null; } }</code><technical_language>if check needed, set reference null</technical_language>

Target:
@Override void cancel() { super.cancel(); callback = null; }
Source:
<code>private IAction createSelectionPathCopyAction(final TreeViewer viewer) { IStructuredSelection selection = (IStructuredSelection) viewer .getSelection(); String copyPathActionText = (selection.size() <= 1) ? UIText.StagingView_CopyPath : UIText.StagingView_CopyPaths; <START> IBindingService bindingService = AdapterUtils <END> .adapt(PlatformUI.getWorkbench(), IBindingService.class); if (bindingService != null) { String keyBinding = bindingService.getBestActiveBindingFormattedFor( IWorkbenchCommandConstants.EDIT_COPY); if (keyBinding != null) { copyPathActionText += '\t' + keyBinding; } } IAction copyAction = new Action(copyPathActionText) { @Override public void run() { copyPathOfSelectionToClipboard(viewer); } }; copyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY); return copyAction; }</code><technical_language>IAction copyAction = ActionUtils.createGlobalAction(ActionFactory.COPY, () -> copyPathOfSelectionToClipboard(viewer)); copyAction.setText(copyPathActionText); return copyAction;</technical_language>

Target:
private IAction createSelectionPathCopyAction(final TreeViewer viewer) { IStructuredSelection selection = (IStructuredSelection) viewer .getSelection(); String copyPathActionText = (selection.size() <= 1) ? UIText.StagingView_CopyPath : UIText.StagingView_CopyPaths; IAction copyAction = ActionUtils.createGlobalAction(ActionFactory.COPY, () -> copyPathOfSelectionToClipboard(viewer)); copyAction.setText(copyPathActionText); return copyAction; }
Source:
<code><START> public double getCDF(long x) { <END> final ImmutableList.Builder<Double> builder = ImmutableList.builder(); final long value = x; inOrderTraversal(root, new Callback() { protected double sum = 0.0; public boolean process(Node node) { long lower = Math.max(min, node.getLowerBound()); long upper = Math.min(max, node.getUpperBound()); if(value >= upper) { sum += node.weightedCount; if (node.isLeaf() && value == upper) { builder.add(sum); return false; } return true; } else if(value < lower) { builder.add(sum); return false; } else { double ratio = (value - lower) / (double) (upper - lower); if (node.right == null && node.left != null) { long middle = Math.min(max, node.getMiddle()); ratio = Math.max(0, value - middle) / (double) (upper - middle); sum += node.weightedCount * ratio; } else { sum += node.weightedCount * ratio; } } return true; } }, TraversalOrder.FORWARD); List<Double> tmp = builder.build(); if(tmp.size() == 0) { return 1.0; } else { return tmp.get(0) / weightedCount; } }</code><technical_language>abbreviate variable names</technical_language>

Target:
private double getCDF(long x) { double[] totalWeight = {0.0}; inOrderTraversal(root, new Callback() { protected double sum = 0.0; public boolean process(Node node) { long lower = Math.max(min, node.getLowerBound()); long upper = Math.min(max, node.getUpperBound()); if (x >= upper) { sum += node.weightedCount; if (node.isLeaf() && x == upper) { totalWeight[0] = sum; return false; } totalWeight[0] = sum; return true; } else if (x < lower) { totalWeight[0] = sum; return false; } else { double ratio = (x - lower) / (double) (upper - lower); if (max <= upper && node.right == null && node.left != null) { long middle = Math.min(max, node.getMiddle()); ratio = Math.min(middle - lower, x - lower) / (double) Math.max(1, middle - lower); } else if (max >= lower && node.left == null && node.right != null) { long middle = Math.max(min, node.getMiddle()); ratio = Math.max(0, x - middle) / (double) Math.max(1, upper - middle); } sum += node.weightedCount * ratio; } totalWeight[0] = sum; return true; } }, TraversalOrder.FORWARD); return totalWeight[0] / weightedCount; }
Source:
<code>public void test_first_3_bytes() throws IOException { byte[] data = new byte[1024 * 1024]; random.nextBytes(data); <START> <END> long[] coords = new long[]{0, 1, 1, 2, 2, 3}; CoordSpanInputSteam csis = new CoordSpanInputSteam(new ByteArraySeekableStream(data), coords); Assert.assertEquals(csis.read(), 0xFF & data[0]); Assert.assertEquals(csis.read(), 0xFF & data[1]); Assert.assertEquals(csis.read(), 0xFF & data[2]); Assert.assertEquals(csis.read(), -1); }</code><technical_language>I test order is randomized, want a different, seeded, random provider for test if care determinism. Alternatively, generate data in multiple places</technical_language>

Target:
public void test_first_3_bytes() throws IOException { byte[] data = new byte[1024 * 1024]; new Random(TestUtil.RANDOM_SEED).nextBytes(data); long[] coords = new long[]{0, 1, 1, 2, 2, 3}; CoordSpanInputSteam csis = new CoordSpanInputSteam(new ByteArraySeekableStream(data), coords); Assert.assertEquals(csis.read(), 0xFF & data[0]); Assert.assertEquals(csis.read(), 0xFF & data[1]); Assert.assertEquals(csis.read(), 0xFF & data[2]); Assert.assertEquals(csis.read(), -1); }
Source:
<code>public AuthenticatorMapper get() { Map<String, Authenticator> authenticatorMap = Maps.newLinkedHashMap(); List<String> authenticators = authConfig.getAuthenticatorChain(); if (authenticators == null || authenticators.isEmpty()) { Map<String, Authenticator> defaultMap = Maps.newHashMap(); defaultMap.put("allowAll", new AllowAllAuthenticator()); return new AuthenticatorMapper(defaultMap, "allowAll"); } for (String authenticatorName : authenticators) { final String authenticatorPropertyBase = StringUtils.format(AUTHENTICATOR_PROPERTIES_FORMAT_STRING, authenticatorName); final JsonConfigProvider<Authenticator> authenticatorProvider = new JsonConfigProvider<>( authenticatorPropertyBase, Authenticator.class ); authenticatorProvider.inject(props, configurator); Supplier<Authenticator> authenticatorSupplier = authenticatorProvider.get(); if (authenticatorSupplier == null) { throw new ISE("Could not create authenticator with name: %s", authenticatorName); } <START> Authenticator authenticator = authenticatorSupplier.get(); <END> authenticatorMap.put(authenticatorName, authenticator); } return new AuthenticatorMapper(authenticatorMap, authConfig.getEscalatedAuthenticator()); }</code><technical_language>this instantiation allow Authenticator implementations lifecycled if @ManagedLifecycle annotation</technical_language>

Target:
public AuthenticatorMapper get() { Map<String, Authenticator> authenticatorMap = Maps.newLinkedHashMap(); List<String> authenticators = authConfig.getAuthenticatorChain(); if (authenticators == null) { authenticatorMap.put("allowAll", new AllowAllAuthenticator()); return new AuthenticatorMapper(authenticatorMap, "allowAll"); } if (authenticators.isEmpty()) { throw new IAE("Must have at least one Authenticator configured."); } for (String authenticatorName : authenticators) { final String authenticatorPropertyBase = StringUtils.format(AUTHENTICATOR_PROPERTIES_FORMAT_STRING, authenticatorName); final JsonConfigProvider<Authenticator> authenticatorProvider = new JsonConfigProvider<>( authenticatorPropertyBase, Authenticator.class ); authenticatorProvider.inject(props, configurator); Supplier<Authenticator> authenticatorSupplier = authenticatorProvider.get(); if (authenticatorSupplier == null) { throw new ISE("Could not create authenticator with name: %s", authenticatorName); } Authenticator authenticator = authenticatorSupplier.get(); authenticatorMap.put(authenticatorName, authenticator); } return new AuthenticatorMapper(authenticatorMap, authConfig.getEscalatedAuthenticator()); }
Source:
<code>private void verifyDistributedQueue() { Assert.assertEquals(true, distributedQueue.size() == DATA_COUNT); Iterator<?> it = distributedQueue.iterator(); int index = 0; while (it.hasNext()) { Assert.assertEquals(index, it.next()); <START> index++; <END> } }</code><technical_language>simplified: int index = 0; for (Object o : distributedQueue) { Assert.assertEquals(index++, o); }</technical_language>

Target:
private void verifyDistributedQueue() { Assert.assertEquals(true, distributedQueue.size() == DATA_COUNT); int index = 0; for (Object o : distributedQueue) { Assert.assertEquals(index++, o); } }
Source:
<code>public void test_update_by_id_where_no_row_is_matching() throws Exception { execute("create table test (id int primary key, message string) clustered into 2 shards"); execute("insert into test values(1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='updated' where id = 99 returning id"); assertThat(response.cols()[0], is("id")); assertThat(response.rowCount(), is(0L)); <START> refresh(); <END> }</code><technical_language>suggestion</technical_language>

Target:
public void test_update_by_id_where_no_row_is_matching() throws Exception { execute("create table test (id int primary key, message string) clustered into 2 shards"); execute("insert into test values(1, 'msg');"); assertEquals(1, response.rowCount()); refresh(); execute("update test set message='updated' where id = 99 returning id"); assertThat(response.cols()[0], is("id")); assertThat(response.rowCount(), is(0L)); }
Source:
<code>public ImmutableValue<Boolean> charged() { <START> return ImmutableSpongeValue.cachedOf(Keys.CREEPER_CHARGED, false, this.value); <END> }</code><technical_language>this a final field - changes data is created, point find data time</technical_language>

Target:
public ImmutableValue<Boolean> charged() { return cachedValue; }
Source:
<code>public void unscheduleJob(SchedulableJob job) { assertArgumentNotNull(job); <START> JobId jobId=null; <END> if (job instanceof CronSchedulableJob) { jobId=new CronJobId(job.getMotechEvent()); } else if (job instanceof RepeatingSchedulableJob) { jobId=new RepeatingJobId(job.getMotechEvent()); } else if (job instanceof RepeatingPeriodSchedulableJob) { jobId=new RepeatingPeriodJobId(job.getMotechEvent()); } else if (job instanceof RunOnceSchedulableJob) { jobId=new RunOnceJobId(job.getMotechEvent()); } else if (job instanceof DayOfWeekSchedulableJob){ jobId=new DayOfWeekJobId(job.getMotechEvent()); } unscheduleJob(jobId); }</code><technical_language>spaces =</technical_language>

Target:
public void unscheduleJob(SchedulableJob job) { assertArgumentNotNull(job); JobId jobId = null; if (job instanceof CronSchedulableJob) { jobId = new CronJobId(job.getMotechEvent()); } else if (job instanceof RepeatingSchedulableJob) { jobId = new RepeatingJobId(job.getMotechEvent()); } else if (job instanceof RepeatingPeriodSchedulableJob) { jobId = new RepeatingPeriodJobId(job.getMotechEvent()); } else if (job instanceof RunOnceSchedulableJob) { jobId = new RunOnceJobId(job.getMotechEvent()); } else if (job instanceof DayOfWeekSchedulableJob) { jobId = new CronJobId(job.getMotechEvent()); } unscheduleJob(jobId); }
Source:
<code>public <ReqT, RespT> ClientCall<ReqT, RespT> newCall( MethodDescriptor<ReqT, RespT> methodDescriptor, CallOptions callOptions) { Preconditions.checkState(!shutdown, "Cannot perform operations on a closed connection"); int currentRequestNum = requestCount.getAndIncrement(); ImmutableList<ChannelAndMetrics> channelsList = channels.get(); <START> int index = Math.abs(currentRequestNum % channelsList.size()); <END> ChannelAndMetrics channelAndMetrics = channelsList.get(index); final Context timeContext = channelAndMetrics.timer.time(); ClientCall<ReqT, RespT> delegate = channelAndMetrics.channel.newCall(methodDescriptor, callOptions); return new CheckedForwardingClientCall<ReqT, RespT>(delegate) { @Override protected void checkedStart(ClientCall.Listener<RespT> responseListener, Metadata headers) throws Exception { for (HeaderInterceptor interceptor : headerInterceptors) { interceptor.updateHeaders(headers); } ClientCall.Listener<RespT> wrappedListener = wrap(responseListener, timeContext); delegate().start(wrappedListener, headers); } }; }</code><technical_language>nuke getNextChannel() logic here? NBD personally I is a bit more readable modulus/round-robin logic in a separate function. Separately a _bit_ nervous inherently ensuring channel choose is valid AFAICT? I guess channelsList grows, get invalid index, want ensure channel select shutdown (and correctly require more synchronization)</technical_language>

Target:
public <ReqT, RespT> ClientCall<ReqT, RespT> newCall( MethodDescriptor<ReqT, RespT> methodDescriptor, CallOptions callOptions) { Preconditions.checkState(!shutdown, "Cannot perform operations on a closed connection"); return getNextChannel().newCall(methodDescriptor, callOptions); }
Source:
<code>public static List<String> validateClass(Class<? extends Messages> classUnderTest) throws URISyntaxException, IOException { List<String> errors = new ArrayList<>(); if (classUnderTest.isInterface()) { File messagesDir = new File(classUnderTest.getResource(".") .toURI().toASCIIString().replaceAll("file:", "")); List<Method> messagesMethods = Arrays.asList(classUnderTest.getMethods()); Properties defaultProperties = loadDefaultProperties(classUnderTest); for (Method method : messagesMethods) { <START> checkPlaceHolders(method, defaultProperties, classUnderTest.getSimpleName() + ".properties", errors); <END> } File[] localePropertiesFiles = getMessagesLocalePropertiesFiles(messagesDir, classUnderTest.getSimpleName()); if (localePropertiesFiles != null) { for (File localeFile : localePropertiesFiles) { Properties localeProperties = loadProperties(localeFile); String localeFileName = localeFile.getName(); for (Method method : messagesMethods) { checkForMissingDefault(method, defaultProperties, localeProperties, localeFileName, errors); checkPlaceHolders(method, localeProperties, localeFileName, errors); } } } if (defaultProperties.size() == 0 && localePropertiesFiles == null) { errors.add("Class under test does not have a default or any locale specific properties files: " + classUnderTest.getName()); } } else { errors.add("Class under test is not an interface: " + classUnderTest.getName()); } return errors; }</code><technical_language>do like: checkForUnwantedValueAnnotations(..) report error Message interface contains @DefaultXxxValue method</technical_language>

Target:
public static List<String> validateClass(Class<? extends Messages> classUnderTest) throws URISyntaxException, IOException { List<String> errors = new ArrayList<>(); System.out.println("working on class: " + classUnderTest); if (classUnderTest.isInterface()) { File messagesDir = new File(classUnderTest.getResource(".") .toURI().toASCIIString().replaceAll("file:", "")); List<Method> messagesMethods = Arrays.asList(classUnderTest.getMethods()); Properties defaultProperties = loadDefaultProperties(classUnderTest); for (Method method : messagesMethods) { checkPlaceHolders(method, defaultProperties, classUnderTest.getSimpleName() + ".properties", errors); } File[] localePropertiesFiles = getMessagesLocalePropertiesFiles(messagesDir, classUnderTest.getSimpleName()); if (localePropertiesFiles != null) { for (File localeFile : localePropertiesFiles) { Properties localeProperties = loadProperties(localeFile); String localeFileName = localeFile.getName(); for (Method method : messagesMethods) { checkForMissingDefault(method, defaultProperties, localeProperties, localeFileName, errors); checkPlaceHolders(method, localeProperties, localeFileName, errors); } } } if (defaultProperties.size() == 0 && localePropertiesFiles == null) { errors.add("Class under test does not have a default or any locale specific properties files: " + classUnderTest.getName()); } } else { errors.add("Class under test is not an interface: " + classUnderTest.getName()); } return errors; }
Source:
<code>public RexNode field(RexNode e, String name) { <START> if (!e.getType().isStruct()) { throw new IllegalArgumentException("Requested field " + name + " in non-struct expression " + e.toString() + " (type: " + e.getType() + ")"); } <END> return getRexBuilder().makeFieldAccess(e, name, false); }</code><technical_language>I wondering is add this check RexBuilder#makeFieldAccess. Clients call RexBuilder direclty get NPE</technical_language>

Target:
public RexNode field(RexNode e, String name) { return getRexBuilder().makeFieldAccess(e, name, false); }
Source:
<code>private static Object getFormulaCellValueAsObject(final Workbook workbook, final Cell cell) { try { return getDoubleAsNumber(cell.getNumericCellValue()); } catch (final Exception e) { if (logger.isInfoEnabled()) { logger.info("Failed to fetch cached/precalculated formula value of cell: " + cell, e); } } try { if (logger.isInfoEnabled()) { logger .info("cell is a formula. Attempting to evaluate: {}", getCellCoordinates(cell), cell .getCellFormula()); } final FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); final Cell evaluatedCell = evaluator.evaluateInCell(cell); return getCellValueAsObject(workbook, evaluatedCell); } catch (final FormulaParseException e) { <START> logger.error("Parse exception occurred while evaluating cell formula: " + cell, e); <END> } catch (final IllegalArgumentException e) { logger.error("Illegal formula argument occurred while evaluating cell formula: " + cell, e); } catch (final RuntimeException e) { logger.error("Unexpected exception occurred while evaluating cell formula: " + cell, e); } return cell.getCellFormula(); }</code><technical_language>I consider logging messages "warning" level instead of "error" level, case is some major part of mechanism is breaking down, able handle cell in a nice manner do a fallback option handle that</technical_language>

Target:
private static Object getFormulaCellValueAsObject(final Workbook workbook, final Cell cell) { try { return getDoubleAsNumber(cell.getNumericCellValue()); } catch (final Exception e) { if (logger.isInfoEnabled()) { logger.info("Failed to fetch cached/precalculated formula value of cell: " + cell, e); } } final Cell evaluatedCell = getEvaluatedCell(workbook, cell); if (evaluatedCell != null) { return getCellValueAsObject(workbook, evaluatedCell); } else { return cell.getCellFormula(); } }
Source:
<code>SmtpEmailSender(@GerritServerConfig final Config cfg) { enabled = cfg.getBoolean("sendemail", null, "enable", true); connectTimeout = <START> cfg.getInt("sendemail", <END> "connectTimeout", DEFAULT_CONNECT_TIMEOUT); smtpHost = cfg.getString("sendemail", null, "smtpserver"); if (smtpHost == null) { smtpHost = "127.0.0.1"; } smtpEncryption = ConfigUtil.getEnum(cfg, "sendemail", null, "smtpencryption", Encryption.NONE); sslVerify = cfg.getBoolean("sendemail", null, "sslverify", true); final int defaultPort; switch (smtpEncryption) { case SSL: defaultPort = 465; break; case NONE: case TLS: default: defaultPort = 25; break; } smtpPort = cfg.getInt("sendemail", null, "smtpserverport", defaultPort); smtpUser = cfg.getString("sendemail", null, "smtpuser"); smtpPass = cfg.getString("sendemail", null, "smtppass"); Set<String> rcpt = new HashSet<String>(); for (String addr : cfg.getStringList("sendemail", null, "allowrcpt")) { rcpt.add(addr); } allowrcpt = Collections.unmodifiableSet(rcpt); importance = cfg.getString("sendemail", null, "importance"); expiryDays = cfg.getInt("sendemail", null, "expiryDays", 0); }</code><technical_language>ConfigUtil.getTimeUnit</technical_language>

Target:
SmtpEmailSender(@GerritServerConfig final Config cfg) { enabled = cfg.getBoolean("sendemail", null, "enable", true); connectTimeout = Ints.checkedCast(ConfigUtil.getTimeUnit(cfg, "sendemail", null, "connectTimeout", DEFAULT_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS)); smtpHost = cfg.getString("sendemail", null, "smtpserver"); if (smtpHost == null) { smtpHost = "127.0.0.1"; } smtpEncryption = ConfigUtil.getEnum(cfg, "sendemail", null, "smtpencryption", Encryption.NONE); sslVerify = cfg.getBoolean("sendemail", null, "sslverify", true); final int defaultPort; switch (smtpEncryption) { case SSL: defaultPort = 465; break; case NONE: case TLS: default: defaultPort = 25; break; } smtpPort = cfg.getInt("sendemail", null, "smtpserverport", defaultPort); smtpUser = cfg.getString("sendemail", null, "smtpuser"); smtpPass = cfg.getString("sendemail", null, "smtppass"); Set<String> rcpt = new HashSet<String>(); for (String addr : cfg.getStringList("sendemail", null, "allowrcpt")) { rcpt.add(addr); } allowrcpt = Collections.unmodifiableSet(rcpt); importance = cfg.getString("sendemail", null, "importance"); expiryDays = cfg.getInt("sendemail", null, "expiryDays", 0); }
Source:
<code>public static MongoCredential credentialFromJson(ObjectNode node) { String userName = null; String password = null; String source = null; JsonNode xnode = node.get("mechanism"); if (xnode == null) { throw new IllegalArgumentException("mechanism is required in credentials"); } String mech = xnode.asText(); xnode = node.get("userName"); if (xnode != null) { userName = xnode.asText(); } xnode = node.get("password"); if (xnode != null) { password = xnode.asText(); } xnode = node.get("source"); if (xnode != null) { source = xnode.asText(); } MongoCredential cr = null; if (null != mech) { switch (mech) { case "GSSAPI_MECHANISM": cr = MongoCredential.createGSSAPICredential(userName); break; case "MONGODB_CR_MECHANISM": cr = MongoCredential.createMongoCRCredential(userName, source, password == null ? null : password.toCharArray()); break; case "MONGODB_X509_MECHANISM": cr = MongoCredential.createMongoX509Credential(userName); break; case "PLAIN_MECHANISM": cr = MongoCredential.createPlainCredential(userName, source, password == null ? null : password.toCharArray()); break; case "SCRAM_SHA_1_MECHANISM": cr = MongoCredential.createScramSha1Credential(userName,source, password==null?null:password.toCharArray()); break; default: throw new IllegalArgumentException("invalid mechanism:" + mech + ", must be one of " + "GSSAPI_MECHANISM, MONGODB_CR_MECHANISM, " <START> + "MONGODB_X5090_MECHANISM, or PLAIN_MECHANISM"); <END> } } return cr; }</code><technical_language>Add new hashing method exception message</technical_language>

Target:
public static MongoCredential credentialFromJson(ObjectNode node) { String userName = null; String password = null; String source = null; JsonNode xnode = node.get("mechanism"); if (xnode == null) { throw new IllegalArgumentException("mechanism is required in credentials"); } String mech = xnode.asText(); xnode = node.get("userName"); if (xnode != null) { userName = xnode.asText(); } xnode = node.get("password"); if (xnode != null) { password = xnode.asText(); } xnode = node.get("source"); if (xnode != null) { source = xnode.asText(); } MongoCredential cr = null; if (null != mech) { switch (mech) { case "GSSAPI_MECHANISM": cr = MongoCredential.createGSSAPICredential(userName); break; case "MONGODB_CR_MECHANISM": cr = MongoCredential.createMongoCRCredential(userName, source, password == null ? null : password.toCharArray()); break; case "MONGODB_X509_MECHANISM": cr = MongoCredential.createMongoX509Credential(userName); break; case "PLAIN_MECHANISM": cr = MongoCredential.createPlainCredential(userName, source, password == null ? null : password.toCharArray()); break; case "SCRAM_SHA_1_MECHANISM": cr = MongoCredential.createScramSha1Credential(userName,source, password==null?null:password.toCharArray()); break; default: throw new IllegalArgumentException("invalid mechanism:" + mech + ", must be one of " + "GSSAPI_MECHANISM, MONGODB_CR_MECHANISM, " + "MONGODB_X5090_MECHANISM, SCRAM_SHA_1_MECHANISM or PLAIN_MECHANISM"); } } return cr; }
Source:
<code><START> ValueGroup valueType() <END> { return NUMBER; }</code><technical_language>This shorter more readable create a field in this enum a Constructor, instead of overriding method everywhere. E.g.: private enum PointValueField { X( NUMBER ); private ValueGroup valType; PointValueField( ValueGroup valType ) { this.valType = valType; } ValueGroup valueType() { return ValueGroup.NO_VALUE; } }</technical_language>

Target:
ValueGroup valueType() { return valueType; }
Source:
<code>public void usernamePassword_nullPassword() { SyncCredentials creds = SyncCredentials.usernamePassword("foo", null, true); Map<String, Object> userInfo = creds.getUserInfo(); <START> assertEquals(null, userInfo.get("password")); <END> }</code><technical_language>assertUsernamePassword here</technical_language>

Target:
public void usernamePassword_nullPassword() { SyncCredentials creds = SyncCredentials.usernamePassword("foo", null, true); assertUsernamePassword(creds, "foo", null, true); }
Source:
<code>public void process(String tuple) { JSONObject jo = null; try { jo = new JSONObject(tuple); if (jo.getString(Result.FIELD_TYPE).equals(DataResultDimensional.TYPE)) { String id = jo.getString(Result.FIELD_ID); JSONArray dataArray = jo.getJSONArray(Result.FIELD_DATA); boolean isEmpty = ((dataArray == null) || (dataArray.length() == 0)); cacheTuple(id, tuple, isEmpty); } else { <START> logger.info("Invalid type: {}, by pass.", jo.getString(Result.FIELD_TYPE)); <END> output.emit(tuple); } } catch (JSONException ex) { logger.warn("Invalid json. {}", ex.getMessage()); throw new RuntimeException(ex); } }</code><technical_language>is log level info...?</technical_language>

Target:
public void process(String tuple) { JSONObject jo = null; try { jo = new JSONObject(tuple); if (jo.getString(Result.FIELD_TYPE).equals(DataResultDimensional.TYPE)) { String id = jo.getString(Result.FIELD_ID); if (handledIds.contains(id)) return; JSONArray dataArray = jo.getJSONArray(Result.FIELD_DATA); boolean isEmpty = ((dataArray == null) || (dataArray.length() == 0)); if (!isEmpty) { output.emit(tuple); handledIds.add(id); if(idToEmptyTupleMap.containsKey(id)) { idToEmptyTupleMap.remove(id); } } else { Set<String> emptyTupleIds = idToEmptyTupleMap.keySet(); if (!emptyTupleIds.contains(id)) { idToEmptyTupleMap.put(id, tuple); } } } else { logger.debug("Invalid type: {}, by pass.", jo.getString(Result.FIELD_TYPE)); output.emit(tuple); } } catch (JSONException ex) { throw new RuntimeException(ex); } }
Source:
<code>protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { <START> if(sign.getLine(3).startsWith(tl("signFormatWorth")) && updateFromWorth(sign, player, ess, ess.getSettings().getEcoBuyMultiplier())) { <END> return false; } Trade items = getTrade(sign, 1, 2, player, ess); Trade charge = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (items.getItemStack().isSimilar(heldItem)) { int initialItemAmount = items.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = items.getItemStack(); item.setAmount(newItemAmount); items = new Trade(item, ess); BigDecimal chargeAmount = charge.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); charge = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); if (!items.pay(player)) { throw new ChargeException("Inventory full"); } charge.charge(player); Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; }</code><technical_language>suggestion if (sign.getLine(3).startsWith(tl("signFormatWorth")) && updateFromWorth(sign, player, ess, ess.getSettings().getEcoBuyMultiplier())) {</technical_language>

Target:
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException, MaxMoneyException { if(sign.getLine(3).startsWith(tl("signFormatWorth")) && updateFromWorthMultiplied(sign, player, ess)) { return false; } Trade items = getTrade(sign, 1, 2, player, ess); Trade charge = getTrade(sign, 3, ess); if (ess.getSettings().isAllowBulkBuySell() && player.getBase().isSneaking()) { ItemStack heldItem = player.getItemInHand(); if (items.getItemStack().isSimilar(heldItem)) { int initialItemAmount = items.getItemStack().getAmount(); int newItemAmount = heldItem.getAmount(); ItemStack item = items.getItemStack(); item.setAmount(newItemAmount); items = new Trade(item, ess); BigDecimal chargeAmount = charge.getMoney(); BigDecimal pricePerSingleItem = chargeAmount.divide(new BigDecimal(initialItemAmount)); pricePerSingleItem = pricePerSingleItem.multiply(new BigDecimal(newItemAmount)); charge = new Trade(pricePerSingleItem, ess); } } charge.isAffordableFor(player); if (!items.pay(player)) { throw new ChargeException("Inventory full"); } charge.charge(player); Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), ess); return true; }
Source:
<code>private void search(HybridFile directory, final SearchFilter filter) { if (directory.isDirectory(activity.get())) { directory.forEachChildrenFile( activity.get(), rootMode, file -> { <START> if (!isCancelled() && !(file.getName().startsWith("."))) { <END> if (filter.searchFilter(file.getName(activity.get()))) { publishProgress(file); } if (file.isDirectory() && !isCancelled()) { search(file, filter); } } }); } else { Log.d(TAG, "Cannot search " + directory.getPath() + ": Permission Denied"); } }</code><technical_language>Isnt a HybridFile function check if file is hidden</technical_language>

Target:
private void search(HybridFile directory, final SearchFilter filter) { if (directory.isDirectory(activity.get())) { directory.forEachChildrenFile( activity.get(), rootMode, file -> { boolean showHiddenFiles = PreferenceManager.getDefaultSharedPreferences(activity.get()) .getBoolean(PREFERENCE_SHOW_HIDDENFILES, false); if ((!isCancelled() && (showHiddenFiles || !file.isHidden()))) { if (filter.searchFilter(file.getName(activity.get()))) { publishProgress(file); } if (file.isDirectory() && !isCancelled()) { search(file, filter); } } }); } else { Log.d(TAG, "Cannot search " + directory.getPath() + ": Permission Denied"); } }