auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void updateValues( Object object ) { validateFields( object ); for( Field field : getScenarioFields( object ) ) { try { Object value = getValue( field ); if( value != null ) { field.set( object, value ); log.debug( "Setting field to value {}", field, value ); } else if( isRequired( field ) ) { <START> throw new RuntimeException( "TODO Better exception?" ); <END> } } catch( IllegalAccessException e ) { throw new RuntimeException( "Error while updating field " + field, e ); } } }</code><technical_language>Yeah, this a exception. question is kind of exception. JGivenWrongUsageException is fitting, I think, JGiven is in a wrong in this case. JGivenPreconditionException/JGivenAssumptionException/JGivenUserException maybe</technical_language>

Target:
public void updateValues( Object object ) { validateFields( object ); for( ScenarioStateField field : getScenarioFields( object ) ) { Object value = getValue( field ); if( value != null ) { try { field.getField().set( object, value ); } catch( IllegalAccessException e ) { throw new RuntimeException( "Error while updating field " + field.getField(), e ); } log.debug( "Setting field to value {}", field.getField(), value ); } else if( field.isRequired() ) { throw new JGivenMissingRequiredScenarioStateException( field.getField() ); } } }
Source:
<code>public List<Template> getTemplates() { <START> return templates; <END> }</code><technical_language>return Collections.unmodifiableList(templates)</technical_language>

Target:
public List<Template> getTemplates() { return Collections.unmodifiableList(templates); }
Source:
<code>public void sanityCheck( Input.Estimates inputEstimates, RecordFormats recordFormats, MemoryStatsVisitor.Visitable baseMemory, MemoryStatsVisitor.Visitable... memoryVisitables ) { long estimatedCacheSize = estimatedCacheSize( baseMemory, memoryVisitables ); long freeMemory = freeMemoryLookup.getAsLong(); long optimalMinimalHeapSize = optimalMinimalHeapSize( inputEstimates, recordFormats ); long actualHeapSize = actualHeapSizeLookup.getAsLong(); boolean freeMemoryIsKnown = freeMemory != VALUE_UNAVAILABLE; if ( freeMemoryIsKnown && actualHeapSize + freeMemory < estimatedCacheSize + optimalMinimalHeapSize ) { monitor.insufficientAvailableMemory( estimatedCacheSize, optimalMinimalHeapSize, freeMemory ); return; } if ( actualHeapSize < optimalMinimalHeapSize ) { monitor.insufficientHeapSize( optimalMinimalHeapSize, actualHeapSize ); return; } <START> if ( ((freeMemoryIsKnown && freeMemory < estimatedCacheSize) || !freeMemoryIsKnown) && actualHeapSize > optimalMinimalHeapSize * 1.2 ) <END> { monitor.abundantHeapSize( optimalMinimalHeapSize, actualHeapSize ); } }</code><technical_language>expression simplified ( (!freeMemoryIsKnown || freeMemory < estimatedCacheSize) && (actualHeapSize > (optimalMinimalHeapSize * 1.2)) )</technical_language>

Target:
void sanityCheck( Input.Estimates inputEstimates, RecordFormats recordFormats, MemoryStatsVisitor.Visitable baseMemory, MemoryStatsVisitor.Visitable... memoryVisitables ) { long estimatedCacheSize = estimatedCacheSize( baseMemory, memoryVisitables ); long freeMemory = freeMemoryLookup.getAsLong(); long optimalMinimalHeapSize = optimalMinimalHeapSize( inputEstimates, recordFormats ); long actualHeapSize = actualHeapSizeLookup.getAsLong(); boolean freeMemoryIsKnown = freeMemory != VALUE_UNAVAILABLE; if ( freeMemoryIsKnown && actualHeapSize + freeMemory < estimatedCacheSize + optimalMinimalHeapSize ) { monitor.insufficientAvailableMemory( estimatedCacheSize, optimalMinimalHeapSize, freeMemory ); return; } if ( actualHeapSize < optimalMinimalHeapSize ) { monitor.insufficientHeapSize( optimalMinimalHeapSize, actualHeapSize ); return; } if ( (!freeMemoryIsKnown || freeMemory < estimatedCacheSize) && actualHeapSize > optimalMinimalHeapSize * 1.2 ) { monitor.abundantHeapSize( optimalMinimalHeapSize, actualHeapSize ); } }
Source:
<code>public void chGetEnvelopeTest() throws Exception { WMTSCapabilities caps = createCapabilities("admin_ch.getcapa.xml"); WebMapTileServer wmts = new WebMapTileServer(caps); Layer layer = (Layer) caps.getLayer("ch.are.alpenkonvention"); <START> assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:EPSG:2056"))); <END> assertNull(wmts.getEnvelope(layer, CRS.decode("EPSG:4326"))); CoordinateReferenceSystem crs = CRS.decode("CRS:84"); GeneralEnvelope envelope = wmts.getEnvelope(layer, crs); assertNotNull(envelope); assertEquals(45.398181, envelope.getMinimum(1), 0.0001); assertEquals(5.140242, envelope.getMinimum(0), 0.0001); assertEquals(48.230651, envelope.getMaximum(1), 0.0001); assertEquals(11.47757, envelope.getMaximum(0), 0.0001); }</code><technical_language>rational for removing additional checks</technical_language>

Target:
public void chGetEnvelopeTest() throws Exception { WMTSCapabilities caps = createCapabilities("admin_ch.getcapa.xml"); WebMapTileServer wmts = new WebMapTileServer(caps); Layer layer = (Layer) caps.getLayer("ch.are.alpenkonvention"); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:OGC:1.3:CRS84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("CRS:84"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("EPSG:2056"))); assertNotNull(wmts.getEnvelope(layer, CRS.decode("urn:ogc:def:crs:EPSG:2056"))); assertNull(wmts.getEnvelope(layer, CRS.decode("EPSG:4326"))); CoordinateReferenceSystem crs = CRS.decode("CRS:84"); GeneralEnvelope envelope = wmts.getEnvelope(layer, crs); assertNotNull(envelope); assertEquals(45.398181, envelope.getMinimum(1), 0.0001); assertEquals(5.140242, envelope.getMinimum(0), 0.0001); assertEquals(48.230651, envelope.getMaximum(1), 0.0001); assertEquals(11.47757, envelope.getMaximum(0), 0.0001); }
Source:
<code>private Mono<OffsetDateTime> populateLastConsumable() { return DownloadUtils.downloadToString(this.client, METADATA_SEGMENT_PATH) .flatMap(json -> { try { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = objectMapper.readTree(json); <START> this.lastConsumable = OffsetDateTime.parse(jsonNode.get("lastConsumable").asText()); <END> if (this.lastConsumable.isBefore(endTime)) { this.safeEndTime = this.lastConsumable; } return Mono.just(this.lastConsumable); } catch (IOException e) { return Mono.error(e); } }); }</code><technical_language>chance this class in multiple threads once? Setting class level variables result in timing issues</technical_language>

Target:
private Mono<OffsetDateTime> populateLastConsumable() { return DownloadUtils.downloadToByteArray(this.client, METADATA_SEGMENT_PATH) .flatMap(json -> { try { JsonNode jsonNode = MAPPER.reader().readTree(json); this.lastConsumable = OffsetDateTime.parse(jsonNode.get("lastConsumable").asText()); if (this.lastConsumable.isBefore(endTime)) { this.safeEndTime = this.lastConsumable; } return Mono.just(this.lastConsumable); } catch (IOException e) { return FluxUtil.monoError(logger, new UncheckedIOException(e)); } }); }
Source:
<code>protected PNOperationType getOperationType() { <START> return PNOperationType.PNAccessManagerGranToken; <END> }</code><technical_language>This a typo? PNAccessManagerGranToken <-- Missing "t" in Grant</technical_language>

Target:
protected PNOperationType getOperationType() { return PNOperationType.PNAccessManagerGrantToken; }
Source:
<code>public String toText() { <START> StringBuffer sb = new StringBuffer(); <END> elements.forEach(e -> sb.append(e.toText())); return sb.toString(); }</code><technical_language>Replace StringBuilder</technical_language>

Target:
public String toText() { StringBuilder sb = new StringBuilder(); elements.forEach(e -> sb.append(e.toText())); return sb.toString(); }
Source:
<code>public void setAcceptedPatterns(Set<String> patterns) { if (acceptedPatterns == null) { <START> LOG.debug("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", <END> acceptedPatterns, patterns); } else { LOG.warn("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", acceptedPatterns, patterns); } acceptedPatterns = new HashSet<>(patterns.size()); for (String pattern : patterns) { acceptedPatterns.add(Pattern.compile(pattern, Pattern.CASE_INSENSITIVE)); } }</code><technical_language>LOG.debug("Sets accepted patterns [{}]", patterns);</technical_language>

Target:
public void setAcceptedPatterns(Set<String> patterns) { if (acceptedPatterns == null) { LOG.debug("Sets accepted patterns to [{}], note this impacts the safety of your application!", patterns); } else { LOG.warn("Replacing accepted patterns with [{}], be aware that this affects all instances and safety of your application!", acceptedPatterns, patterns); } acceptedPatterns = new HashSet<>(patterns.size()); for (String pattern : patterns) { acceptedPatterns.add(Pattern.compile(pattern, Pattern.CASE_INSENSITIVE)); } }
Source:
<code>public Collection<PsiElement> getPsiTargets(StringLiteralExpression element) { final Set<PsiElement> priorityTargets = new LinkedHashSet<>(); final Set<PsiElement> targets = new LinkedHashSet<>(); final String contents = element.getContents(); if(StringUtils.isBlank(contents)) { return targets; } final String priorityTemplate = "/" + LaravelSettings.getInstance(element.getProject()).getMainLanguage() + "/"; <START> FileBasedIndexImpl.getInstance().getFilesWithKey(TranslationKeyStubIndex.KEY, new HashSet<>(Collections.singletonList(contents)), virtualFile -> { <END> PsiFile psiFileTarget = PsiManager.getInstance(getProject()).findFile(virtualFile); if(psiFileTarget == null) { return true; } String namespace = TranslationUtil.getNamespaceFromFilePath(virtualFile.getPath()); if(namespace == null) { return true; } psiFileTarget.acceptChildren(new ArrayReturnPsiRecursiveVisitor(namespace, (key, psiKey, isRootElement) -> { if(!isRootElement && key.equalsIgnoreCase(contents)) { if(virtualFile.getPath().contains(priorityTemplate)) { priorityTargets.add(psiKey); } else { targets.add(psiKey); } } })); return true; }, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(getProject()), PhpFileType.INSTANCE)); priorityTargets.addAll(targets); return priorityTargets; }</code><technical_language>interface FileBasedIndex</technical_language>

Target:
public Collection<PsiElement> getPsiTargets(StringLiteralExpression element) { final String contents = element.getContents(); if(StringUtils.isBlank(contents)) { return Collections.emptyList(); } final String priorityTemplate = "/" + LaravelSettings.getInstance(element.getProject()).getMainLanguage() + "/"; final Set<PsiElement> priorityTargets = new LinkedHashSet<>(); final Set<PsiElement> targets = new LinkedHashSet<>(); FileBasedIndex.getInstance().getFilesWithKey(TranslationKeyStubIndex.KEY, new HashSet<>(Collections.singletonList(contents)), virtualFile -> { PsiFile psiFileTarget = PsiManager.getInstance(getProject()).findFile(virtualFile); if(psiFileTarget == null) { return true; } String namespace = TranslationUtil.getNamespaceFromFilePath(virtualFile.getPath()); if(namespace == null) { return true; } psiFileTarget.acceptChildren(new ArrayReturnPsiRecursiveVisitor(namespace, (key, psiKey, isRootElement) -> { if(!isRootElement && key.equalsIgnoreCase(contents)) { if(virtualFile.getPath().contains(priorityTemplate)) { priorityTargets.add(psiKey); } else { targets.add(psiKey); } } })); return true; }, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(getProject()), PhpFileType.INSTANCE)); priorityTargets.addAll(targets); return priorityTargets; }
Source:
<code>public String getExecuteButtonLabel() { try { <START> executeButtonLabel = System.getProperty("PROMOTION_BUILD_APPROVE_BUTTON_CUSTOM_LABEL"); <END> if(executeButtonLabel == null) { executeButtonLabel = "Approve"; } } catch (Exception e) { e.printStackTrace(); executeButtonLabel = "Approve"; } return executeButtonLabel; }</code><technical_language>In Jenkins a common practice is include class name beginning of property name. examples in this plugin</technical_language>

Target:
public String getExecuteButtonLabel() { String label = System.getProperty(this.getClass().getSimpleName()+".approveButtonLabel"); if(null == label) { label = "Approve"; } return label; }
Source:
<code>protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = new ModelNode(); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String cacheContainerName = address.getElement(CACHE_CONTAINER_INDEX).getValue(); <START> final String counterType = address.getElement(COUNTER_INDEX).getKey(); <END> final String counterName = address.getElement(COUNTER_INDEX).getValue(); final ServiceController<?> controller = context.getServiceRegistry(false) .getService(CacheContainerServiceName.CACHE_CONTAINER.getServiceName(cacheContainerName)); Long value = null; if (controller != null) { DefaultCacheContainer cacheManager = (DefaultCacheContainer) controller.getValue(); CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager(cacheManager); if (ModelKeys.STRONG_COUNTER.equals(counterType)) { StrongCounter sc = counterManager.getStrongCounter(counterName); try { value = sc.getValue().get(); } catch (Exception e) { throw new OperationFailedException("Can not get value from counter " + sc, e); } } else if (ModelKeys.WEAK_COUNTER.equals(counterType)) { WeakCounter wc = counterManager.getWeakCounter(counterName); value = wc.getValue(); } result.set(value); } context.getResult().set(result); }</code><technical_language>need another metric value? enum overkill if</technical_language>

Target:
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = new ModelNode(); final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String cacheContainerName = address.getElement(CACHE_CONTAINER_INDEX).getValue(); final String counterType = address.getElement(COUNTER_INDEX).getKey(); final String counterName = address.getElement(COUNTER_INDEX).getValue(); final ServiceController<?> controller = context.getServiceRegistry(false) .getService(CacheContainerServiceName.CACHE_CONTAINER.getServiceName(cacheContainerName)); Long value = null; if (controller != null) { DefaultCacheContainer cacheManager = (DefaultCacheContainer) controller.getValue(); CounterManager counterManager = EmbeddedCounterManagerFactory.asCounterManager(cacheManager); if (ModelKeys.STRONG_COUNTER.equals(counterType)) { StrongCounter sc = counterManager.getStrongCounter(counterName); value = sc.sync().getValue(); } else { WeakCounter wc = counterManager.getWeakCounter(counterName); value = wc.sync().getValue(); } result.set(value); } context.getResult().set(result); }
Source:
<code>public static final IntList lineMapOrBinary(final byte[] buf, int ptr, int end) throws BinaryBlobException { IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { throw new <START> BinaryBlobException(); <END> } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }</code><technical_language>add empty fillInStackTrace() implementation avoid runtime penalty for constructing stack trace ? { @Override public Throwable fillInStackTrace() { return this; } };</technical_language>

Target:
public static final IntList lineMapOrBinary(final byte[] buf, int ptr, int end) throws BinaryBlobException { IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { throw new BinaryBlobException() @Override { public Throwable fillInStackTrace() { return this; } }; } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }
Source:
<code><START> public UpdateDynamicParametersCommand(String nodeSourceName) { <END> this.nodeSourceName = nodeSourceName; }</code><technical_language>this method a bit toooooooooooo long. Is do some refactoring is easier read maintain</technical_language>

Target:
public UpdateDynamicParametersCommand(String nodeSourceName) { super(nodeSourceName); }
Source:
<code>public void setSetPath(String path) { <START> setPath.set(requireNonNull(path, "path is null")); <END> }</code><technical_language>nit: I in other parts of this class put requireNonNull calls another method call, do for sake of slightly readability: requireNonNull(path, "path is null"); setPath.set(path);</technical_language>

Target:
public void setSetPath(String path) { requireNonNull(path, "path is null"); setPath.set(path); }
Source:
<code>private void loadANR(Activity activity, final ViewGroup root) { final ImageView fakeAnr = new ImageView(activity); fakeAnr.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); fakeAnr.setAdjustViewBounds(true); fakeAnr.setScaleType(ImageView.ScaleType.CENTER_INSIDE); root.addView(fakeAnr); for (int i = 0; i < 200; i++) { root.postDelayed( new Runnable() { @Override public void run() { <START> fakeAnr.setImageResource(getRandomSelfie()); <END> } }, i * ANR_INTERVAL ); } }</code><technical_language>A random selfie of ANR</technical_language>

Target:
private void loadANR(Activity activity, final ViewGroup root) { final ImageView fakeAnr = new ImageView(activity); fakeAnr.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); fakeAnr.setAdjustViewBounds(true); fakeAnr.setScaleType(ImageView.ScaleType.CENTER_INSIDE); root.addView(fakeAnr); for (int i = 0; i < 200; i++) { root.postDelayed( new Runnable() { @Override public void run() { fakeAnr.setImageResource(makeItBreak()); } }, i * ANR_INTERVAL ); } }
Source:
<code>public boolean addMac(String mac) { boolean retVal = true; <START> boolean allowDuplicate = getAllowDuplicate(); <END> lockObj.writeLock().lock(); try { if (allocatedMacs.contains(mac)) { retVal = allowDuplicate ? true : false; } else if (availableMacs.contains(mac)) { retVal = commitNewMac(mac); } else if (allocatedCustomMacs.contains(mac)) { retVal = allowDuplicate ? true : false; } else { allocatedCustomMacs.add(mac); } } finally { lockObj.writeLock().unlock(); } return retVal; }</code><technical_language>check for getAllowDuplicate return true immediately, save lock is left unlocked in this scenario. leave try-catch block untouched, this opportunity nicer</technical_language>

Target:
public boolean addMac(String mac) { boolean retVal = false; lockObj.writeLock().lock(); try { if (availableMacs.contains(mac)) { retVal = commitNewMac(mac); } else if (allocatedMacs.containsKey(mac)) { retVal = addMacToMap(allocatedMacs, mac); } else { retVal = addMacToMap(allocatedCustomMacs, mac); } } finally { lockObj.writeLock().unlock(); } return retVal; }
Source:
<code>protected void applyRow(Concept component, ConceptRow row, Collection<Concept> componentsToAttach) { <START> component.setId(row.getId()); <END> if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getOrCreate(row.getModuleId(), componentsToAttach)); component.setDefinitionStatus(getOrCreate(row.getDefinitionStatusId(), componentsToAttach)); component.setExhaustive(false); getImportContext().conceptVisited(row.getId()); }</code><technical_language>in reference set importers, core component importers avoid setting SCTID twice</technical_language>

Target:
protected void applyRow(Concept component, ConceptRow row, Collection<Concept> componentsToAttach) { if (row.getEffectiveTime() != null) { component.setEffectiveTime(row.getEffectiveTime()); component.setReleased(true); } else { component.unsetEffectiveTime(); } component.setActive(row.isActive()); component.setModule(getOrCreate(row.getModuleId(), componentsToAttach)); component.setDefinitionStatus(getOrCreate(row.getDefinitionStatusId(), componentsToAttach)); component.setExhaustive(false); getImportContext().conceptVisited(row.getId()); }
Source:
<code>public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException { Path qualifiedPath = makeQualified(f); List<FileStatus> fileStatuses = fileStatusesByParentPath.get(qualifiedPath); if (fileStatuses == null) { throw new FileNotFoundException( String.format("Path '%s' (qualified: '%s') does not exist.", f, qualifiedPath)); } <START> return cloneFileStatusList(fileStatuses); <END> }</code><technical_language>This simply do like: fileStatuses.stream().map(fileStatus -> new FileStatus(fileStatus)).collect(Collectors.toList()); save a method work</technical_language>

Target:
public FileStatus[] listStatus(Path f) throws FileNotFoundException, IOException { Path qualifiedPath = makeQualified(f); List<FileStatus> fileStatuses = fileStatusesByParentPath.get(qualifiedPath); if (fileStatuses == null) { throw new FileNotFoundException( String.format("Path '%s' (qualified: '%s') does not exist.", f, qualifiedPath)); } FileStatus[] result = new FileStatus[fileStatuses.size()]; for (int i = 0; i < fileStatuses.size(); i++) { result[i] = new FileStatus(fileStatuses.get(i)); } return result; }
Source:
<code>public void testUpdateSite() throws Exception { File baseDir = getBasedir("projects/simple/p003"); Map<String, Object> params = new HashMap<String, Object>(); params.put("groupId", "group-p003"); params.put("version", "1.0.0"); params.put("aggregator", Boolean.FALSE); generate(baseDir, params); Model model = readModel(baseDir, "pom.xml"); assertEquals("group-p003", model.getGroupId()); assertEquals("p003", model.getArtifactId()); assertEquals("1.0.0", model.getVersion()); <START> assertEquals("eclipse-repository", model.getPackaging()); <END> }</code><technical_language>1 this breaks template</technical_language>

Target:
public void testUpdateSite() throws Exception { File baseDir = getBasedir("projects/simple/p003"); Map<String, Object> params = new HashMap<String, Object>(); params.put("groupId", "group-p003"); params.put("version", "1.0.0"); params.put("aggregator", Boolean.FALSE); generate(baseDir, params); Model model = readModel(baseDir, "pom.xml"); assertEquals("group-p003", model.getGroupId()); assertEquals("p003", model.getArtifactId()); assertEquals("1.0.0", model.getVersion()); assertEquals("eclipse-update-site", model.getPackaging()); }
Source:
<code>protected Optional<PlanNodeStatsEstimate> visitIsNotNullPredicate(IsNotNullPredicate node, Void context) { if (node.getValue() instanceof SymbolReference) { Symbol symbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(symbol); <START> PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.buildFrom(input); <END> result.setOutputRowCount(input.getOutputRowCount() * (1 - symbolStats.getNullsFraction())); result.addSymbolStatistics(symbol, symbolStats.mapNullsFraction(x -> 0.0)); return Optional.of(result.build()); } return Optional.empty(); }</code><technical_language>put a new line .forEach</technical_language>

Target:
protected PlanNodeStatsEstimate visitIsNotNullPredicate(IsNotNullPredicate node, Void context) { if (node.getValue() instanceof SymbolReference) { Symbol symbol = Symbol.from(node.getValue()); SymbolStatsEstimate symbolStats = input.getSymbolStatistics(symbol); PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.buildFrom(input); result.setOutputRowCount(input.getOutputRowCount() * (1 - symbolStats.getNullsFraction())); result.addSymbolStatistics(symbol, symbolStats.mapNullsFraction(x -> 0.0)); return result.build(); } return PlanNodeStatsEstimate.unknown(); }
Source:
<code>public Bucket getBucketMetadata() throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(sConfig.getPassword()); <START> return client.buckets().get(sConfig.getBucket() + "a").execute(); <END> }</code><technical_language>+ "a"? Leftover manual testing</technical_language>

Target:
public Bucket getBucketMetadata() throws IOException, GeneralSecurityException { Storage client = StorageFactory.getService(sConfig.getPassword()); return client.buckets().get(sConfig.getBucket()).execute(); }
Source:
<code>public void invoke(String... parameters) { <START> <END> CmdLineParser parser = new CmdLineParser(this); try { parser.parseArgument(parameters); if (getParameters().isEmpty()) { throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing"); } } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } List<String> inputFiles = getParameters(); for (String inputFile : inputFiles) { Options options = parse(inputFile); String output = renderInput(options, inputFile); if(output != null) { System.out.println(output); } } }</code><technical_language>nit: blank here, line</technical_language>

Target:
public void invoke(String... parameters) { CmdLineParser parser = new CmdLineParser(this); try { try { parser.parseArgument(parameters); if (inputFiles.isEmpty()) { throw new CmdLineException(parser, "asciidoctor: FAILED: input file missing"); } } catch (CmdLineException e) { System.err.println(e.getMessage()); parser.printUsage(System.err); return; } Options options = parse(); ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(zipFile)); for (String inputFile : inputFiles) { String output = renderInput(options, inputFile); zip.putNextEntry(new ZipEntry(mapInFileToOutFile(inputFile))); zip.write(output.getBytes()); zip.closeEntry(); } zip.close(); } catch (java.io.IOException e) { System.err.println(e.getMessage()); } }
Source:
<code>public URLParams and(final String key, final boolean value) { <START> map.put(key, "" + value); <END> return this; }</code><technical_language>I prefer String.valueOf(value)</technical_language>

Target:
public URLParams and(final String key, final boolean value) { map.put(key, String.valueOf(value)); return this; }
Source:
<code>public ClusteredStoreConfiguration() { <START> this(DEFAULT_CONSISTENCY, DEFAULT_CONCURRENCY); <END> }</code><technical_language>This change related irrelevant for this PR part of it. removed</technical_language>

Target:
public ClusteredStoreConfiguration() { this(Consistency.EVENTUAL); }
Source:
<code><START> public SoapHeaderMessagePriorityEndpointInterceptor messagePriorityInterceptor() { <END> LOGGER.debug("Creating Message Priority Interceptor Bean"); return new SoapHeaderMessagePriorityEndpointInterceptor(MESSAGE_PRIORITY_HEADER); }</code><technical_language>ResponseUrl, MessagePriority, ScheduleTime Organisation interceptors. values originate soapHeader. consider creating a SoapHeaderInterceptor, set values if once? For new implementations need create this new SoapHeaderInterceptor</technical_language>

Target:
public SoapHeaderInterceptor messagePriorityInterceptor() { LOGGER.debug("Creating Message Priority Interceptor Bean"); return new SoapHeaderInterceptor(MESSAGE_PRIORITY_HEADER, MESSAGE_PRIORITY_HEADER); }
Source:
<code>void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { sApplicationVersion = "NA"; } sClientIp = "NA"; <START> <END> try { sDeviceId = StringExtensions.createHash(Secure.getString(context.getContentResolver(), Secure.ANDROID_ID)); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { sDeviceId = ""; } if (mDefaultEventCount == 0) { setEvent(EventStrings.APPLICATION_NAME, sApplicationName); setEvent(EventStrings.APPLICATION_VERSION, sApplicationVersion); setEvent(EventStrings.CLIENT_ID, sClientId); setEvent(EventStrings.CLIENT_IP, sClientIp); setEvent(EventStrings.DEVICE_ID, sDeviceId); mDefaultEventCount = mEventList.size(); } }</code><technical_language>um, nah. care ip? #Resolved</technical_language>

Target:
void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { sApplicationVersion = "NA"; } try { sDeviceId = StringExtensions.createHash(Secure.getString(context.getContentResolver(), Secure.ANDROID_ID)); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { sDeviceId = ""; } if (mDefaultEventCount == 0) { setProperty(EventStrings.APPLICATION_NAME, sApplicationName); setProperty(EventStrings.APPLICATION_VERSION, sApplicationVersion); setProperty(EventStrings.CLIENT_ID, sClientId); setProperty(EventStrings.DEVICE_ID, sDeviceId); mDefaultEventCount = mEventList.size(); } }
Source:
<code>public void onMessage(Message jmsMessage) { <START> logger.debug("message get " + jmsMessage.toString()); <END> try { if (jmsMessage instanceof ObjectMessage) { Object messageObject = ((ObjectMessage) jmsMessage).getObject(); try { T message = (T) messageObject; onMessage(message); } catch (ClassCastException e) { throw new IllegalStateException("Received message of wrong payload type " + messageObject.getClass() + " to destination " + getDestinationName(jmsMessage)); } } else { logger.warn("Received message of wrong type to destination {}", jmsMessage.getClass().getName(), getDestinationName(jmsMessage)); } } catch (JMSException e) { throw new MessageDeliveryException("Failed to handle message from destination " + getDestinationName(jmsMessage), e); } }</code><technical_language>Change this logger.debug("message get {}", jmsMessage) avoid string concatenation happen debug messages disabled</technical_language>

Target:
public void onMessage(Message jmsMessage) { logger.debug("message get {}", jmsMessage.toString()); try { if (jmsMessage instanceof ObjectMessage) { Object messageObject = ((ObjectMessage) jmsMessage).getObject(); try { T message = (T) messageObject; onMessage(message); } catch (ClassCastException e) { throw new IllegalStateException("Received message of wrong payload type " + messageObject.getClass() + " to destination " + getDestinationName(jmsMessage)); } } else { logger.warn("Received message of wrong type to destination {}", jmsMessage.getClass().getName(), getDestinationName(jmsMessage)); } } catch (JMSException e) { throw new MessageDeliveryException("Failed to handle message from destination " + getDestinationName(jmsMessage), e); } }
Source:
<code>@Override protected void beforeTest() throws Exception { startGridsMultiThreaded(GRID_CNT - 2); <START> Ignite grid = startClientGrid(GRID_CNT - 2); <END> grid.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration()); grid = startGrid(GRID_CNT - 1); grid.cache(DEFAULT_CACHE_NAME); }</code><technical_language>grid = startGrid(GRID_CNT - 1); starts a client node</technical_language>

Target:
@Override protected void beforeTest() throws Exception { startGridsMultiThreaded(GRID_CNT - 2); Ignite grid = startClientGrid(GRID_CNT - 2); grid.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration()); grid = startClientGrid(GRID_CNT - 1); grid.cache(DEFAULT_CACHE_NAME); }
Source:
<code>public void runCollectionsTest() { Path workingPath = createTestDirectory(workingDirsRoot, "collections-test"); String packageName = "foo.bar"; String regressionBasename = "TestClass"; String errorBasename = ""; List<String> options = getStandardOptions(workingPath, packageName, regressionBasename, errorBasename); options.add("--no-error-revealing-tests"); options.add("--inputlimit=500"); options.add("--testclass=java2.util2.TreeSet"); options.add("--testclass=java2.util2.Collections"); options.add("--npe-on-null-input=EXPECTED"); options.add("--debug_checks"); options.add("--observers=resources/systemTest/randoop1_observers.txt"); options.add("--omit-field-list=resources/systemTest/testclassomitfields.txt"); long startTime = System.currentTimeMillis(); long timeout = 600000L; RandoopRunDescription randoopRunDesc = generateAndCompile( classpath, workingPath, packageName, regressionBasename, errorBasename, options, timeout); long endTime = System.currentTimeMillis(); <START> System.out.println("runCollectionTest took: " + (endTime - startTime) + " milliseconds"); <END> assertThat("...has regression tests", randoopRunDesc.regressionTestCount, is(greaterThan(0))); TestRunDescription testRunDesc = runTests(classpath, workingPath, packageName, regressionBasename); assertThat( "all regression tests should pass", testRunDesc.testsSucceed, is(equalTo(randoopRunDesc.regressionTestCount))); assertThat("...has no error tests", randoopRunDesc.errorTestCount, is(equalTo(0))); }</code><technical_language>is OK me</technical_language>

Target:
public void runCollectionsTest() { Path workingPath = createTestDirectory(workingDirsRoot, "collections-test"); String packageName = "foo.bar"; String regressionBasename = "TestClass"; String errorBasename = ""; List<String> options = getStandardOptions(workingPath, packageName, regressionBasename, errorBasename); options.add("--no-error-revealing-tests"); options.add("--inputlimit=500"); options.add("--testclass=java2.util2.TreeSet"); options.add("--testclass=java2.util2.Collections"); options.add("--npe-on-null-input=EXPECTED"); options.add("--debug_checks"); options.add("--observers=resources/systemTest/randoop1_observers.txt"); options.add("--omit-field-list=resources/systemTest/testclassomitfields.txt"); long startTime = System.currentTimeMillis(); long timeout = 600000L; RandoopRunDescription randoopRunDesc = generateAndCompile( classpath, workingPath, packageName, regressionBasename, errorBasename, options, timeout); long endTime = System.currentTimeMillis(); assertThat("...has regression tests", randoopRunDesc.regressionTestCount, is(greaterThan(0))); TestRunDescription testRunDesc = runTests(classpath, workingPath, packageName, regressionBasename); assertThat( "all regression tests should pass", testRunDesc.testsSucceed, is(equalTo(randoopRunDesc.regressionTestCount))); assertThat("...has no error tests", randoopRunDesc.errorTestCount, is(equalTo(0))); }
Source:
<code>private Map<String, Object> createEvent() { Map<String, Object> event = new HashMap<String, Object>(); <START> event.put("timestamp", dateFormat.format(new Date())); <END> event.put("dim1", rand.nextLong()); event.put("dim2", rand.nextInt()); return event; }</code><technical_language>Joda time's DateTime(), is time library Druid. defaultobjectmapper understand joda time</technical_language>

Target:
private Map<String, Object> createEvent() { Map<String, Object> event = new HashMap<String, Object>(); event.put("timestamp", new DateTime().toString()); event.put("dim1", rand.nextLong()); event.put("dim2", rand.nextInt()); return event; }
Source:
<code>public GavinJobExecution findGavinJobExecution(String jobIdentifier) throws JobNotFoundException { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { <START> throw new JobNotFoundException(); <END> } return result; }</code><technical_language>UnknownEntityException</technical_language>

Target:
public GavinJobExecution findGavinJobExecution(String jobIdentifier) { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { throw new UnknownEntityException(gavinJobExecutionMetaData, jobIdentifier); } return result; }
Source:
<code>private static String[][] extractRequires(IInstallableUnit iu) { Collection<IRequirement> <START> requyres = <END> iu.getRequirements(); String[][] tuples = new String[requyres.size()][4]; int i = 0; for (IRequirement iRequirement : requyres) { IRequiredCapability next = (IRequiredCapability) iRequirement; tuples[i++] = new String[] {next.getNamespace(), next.getName(), next.getRange().toString(), Boolean.valueOf(next.getMin() == 0).toString()}; } return tuples; }</code><technical_language>rename requirements</technical_language>

Target:
private static String[][] extractRequires(IInstallableUnit iu) { Collection<IRequirement> requirements = iu.getRequirements(); String[][] tuples = new String[requirements.size()][4]; int i = 0; for (IRequirement requirement : requirements) { IRequiredCapability capability = (IRequiredCapability) requirement; tuples[i++] = new String[] {capability.getNamespace(), capability.getName(), capability.getRange().toString(), Boolean.valueOf(capability.getMin() == 0).toString()}; } return tuples; }
Source:
<code>private void expireMapping(final K key, final ValueHolder<V> value) { map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, final OnHeapValueHolder<V> mappedValue) { <START> if(mappedValue.equals(key)) { <END> onExpiration(key, value); return null; } return mappedValue; } }); }</code><technical_language>Pretty equal check want</technical_language>

Target:
private void expireMapping(final K key, final ValueHolder<V> value) { map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, final OnHeapValueHolder<V> mappedValue) { if(mappedValue.equals(value)) { onExpiration(key, value); return null; } return mappedValue; } }); }
Source:
<code><START> public void setAllowedHeaderNames(final Set<String> allowedHeaderNames) { <END> this.allowedHeaderNames = allowedHeaderNames; }</code><technical_language>'addAllowedHeaderName' option a single String</technical_language>

Target:
public HttpLogOptions setAllowedHeaderNames(final Set<String> allowedHeaderNames) { this.allowedHeaderNames = allowedHeaderNames; return this; }
Source:
<code>void performRetry(BitmapHunter hunter) { if (hunter.isCancelled()) return; if (service.isShutdown()) { performError(hunter); return; } NetworkInfo networkInfo = null; if (scansNetworkChanges) { ConnectivityManager connectivityManager = ContextCompat.getSystemService(context, ConnectivityManager.class); if (connectivityManager != null) { networkInfo = connectivityManager.getActiveNetworkInfo(); } } if (hunter.shouldRetry(airplaneMode, networkInfo)) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_RETRYING, getLogIdsForHunter(hunter)); } if (hunter.getException() instanceof NetworkRequestHandler.ContentLengthException) { hunter.setData(hunter.getData().newBuilder().networkPolicy(NetworkPolicy.NO_CACHE).build()); } <START> hunter.setFuture(service.submit(hunter)); <END> } else { performError(hunter); if (scansNetworkChanges && hunter.supportsReplay()) { markForReplay(hunter); } } }</code><technical_language>revert (@JvmField declaration)</technical_language>

Target:
void performRetry(BitmapHunter hunter) { if (hunter.isCancelled()) return; if (service.isShutdown()) { performError(hunter); return; } NetworkInfo networkInfo = null; if (scansNetworkChanges) { ConnectivityManager connectivityManager = ContextCompat.getSystemService(context, ConnectivityManager.class); if (connectivityManager != null) { networkInfo = connectivityManager.getActiveNetworkInfo(); } } if (hunter.shouldRetry(airplaneMode, networkInfo)) { if (hunter.picasso.loggingEnabled) { log(OWNER_DISPATCHER, VERB_RETRYING, getLogIdsForHunter(hunter)); } if (hunter.getException() instanceof NetworkRequestHandler.ContentLengthException) { hunter.data = hunter.data.newBuilder().networkPolicy(NetworkPolicy.NO_CACHE).build(); } hunter.future = service.submit(hunter); } else { performError(hunter); if (scansNetworkChanges && hunter.supportsReplay()) { markForReplay(hunter); } } }
Source:
<code>private static void deserializeColumn(List<Column> tobeAdded, List<ColumnProto> protos, int serializedColumnIndex) { ColumnProto columnProto = protos.get(serializedColumnIndex); if (columnProto.getDataType().getType() == Type.RECORD) { int childNum = columnProto.getDataType().getNumNestedFields(); int childStartIndex = tobeAdded.size() - childNum; List<Column> nestedColumns = new ArrayList<>(); <START> nestedColumns.addAll(tobeAdded.subList(childStartIndex, childStartIndex + childNum)); <END> for (int i = 0; i < childNum; i++) { tobeAdded.remove(tobeAdded.size() - 1); } tobeAdded.add(new Column(columnProto.getName(), new TypeDesc(new Schema(nestedColumns)))); } else { tobeAdded.add(new Column(protos.get(serializedColumnIndex))); } }</code><technical_language>lines merged a single constructor call</technical_language>

Target:
private static void deserializeColumn(List<Column> tobeAdded, List<ColumnProto> protos, int serializedColumnIndex) { ColumnProto columnProto = protos.get(serializedColumnIndex); if (columnProto.getDataType().getType() == Type.RECORD) { int childNum = columnProto.getDataType().getNumNestedFields(); int childStartIndex = tobeAdded.size() - childNum; List<Column> nestedColumns = new ArrayList<>(tobeAdded.subList(childStartIndex, childStartIndex + childNum)); for (int i = 0; i < childNum; i++) { tobeAdded.remove(tobeAdded.size() - 1); } tobeAdded.add(new Column(columnProto.getName(), new TypeDesc(new Schema(nestedColumns)))); } else { tobeAdded.add(new Column(protos.get(serializedColumnIndex))); } }
Source:
<code>private synchronized void connect(Handler<HttpVersion> headersHandler) { <START> if (connecting) { <END> return; } if (method == HttpMethod.OTHER && rawMethod == null) { throw new IllegalStateException("You must provide a rawMethod when using an HttpMethod.OTHER method"); } String peerHost; if (hostHeader != null) { int idx = hostHeader.lastIndexOf(':'); if (idx != -1) { peerHost = hostHeader.substring(0, idx); } else { peerHost = hostHeader; } } else { peerHost = host; } Handler<HttpConnection> initializer = connectionHandler; ContextInternal connectCtx = vertx.getOrCreateContext(); connecting = true; client.getConnectionForRequest(connectCtx, peerHost, ssl, port, host, ar1 -> { if (ar1.succeeded()) { HttpClientStream stream = ar1.result(); ContextInternal ctx = (ContextInternal) stream.getContext(); if(stream.connection() != null) { stream.connection().exceptionHandler(client.exceptionHandler()); } if (stream.id() == 1 && initializer != null) { ctx.executeFromIO(v -> { initializer.handle(stream.connection()); }); } if (exceptionOccurred != null || reset != null) { stream.reset(0); } else { ctx.executeFromIO(v -> { connected(headersHandler, stream); }); } } else { connectCtx.executeFromIO(v -> { handleException(ar1.cause()); }); } }); }</code><technical_language>avoid changing control flow in PR, differences actual code easy see, adds lot of noise actual review work</technical_language>

Target:
private synchronized void connect(Handler<HttpVersion> headersHandler) { if (!connecting) { if (method == HttpMethod.OTHER && rawMethod == null) { throw new IllegalStateException("You must provide a rawMethod when using an HttpMethod.OTHER method"); } String peerHost; if (hostHeader != null) { int idx = hostHeader.lastIndexOf(':'); if (idx != -1) { peerHost = hostHeader.substring(0, idx); } else { peerHost = hostHeader; } } else { peerHost = host; } Handler<HttpConnection> h1 = connectionHandler; Handler<HttpConnection> h2 = client.connectionHandler(); Handler<HttpConnection> initializer; if (h1 != null) { if (h2 != null) { initializer = conn -> { h1.handle(conn); h2.handle(conn); }; } else { initializer = h1; } } else { initializer = h2; } ContextInternal connectCtx = vertx.getOrCreateContext(); connecting = true; client.getConnectionForRequest(connectCtx, peerHost, ssl, port, host, ar1 -> { if (ar1.succeeded()) { HttpClientStream stream = ar1.result(); ContextInternal ctx = (ContextInternal) stream.getContext(); if (stream.id() == 1 && initializer != null) { ctx.executeFromIO(v -> { initializer.handle(stream.connection()); }); } if (exceptionOccurred != null || reset != null) { stream.reset(0); } else { ctx.executeFromIO(v -> { connected(headersHandler, stream); }); } } else { connectCtx.executeFromIO(v -> { handleException(ar1.cause()); }); } }); } }
Source:
<code>public void startActivity(String appPackage, String appActivity, String appWaitPackage, String appWaitActivity) throws IllegalArgumentException { Preconditions.checkArgument((_isNotNullOrEmpty(appPackage) && _isNotNullOrEmpty(appActivity)), String.format("'%s' and '%s' are required.", MobileCapabilityType.APP_PACKAGE, MobileCapabilityType.APP_ACTIVITY)); appWaitPackage = _isNotNullOrEmpty(appWaitPackage) ? appWaitPackage : ""; appWaitActivity = _isNotNullOrEmpty(appWaitActivity) ? appWaitActivity : ""; <START> ImmutableMap<String, String> parameters = ImmutableMap.of(MobileCapabilityType.APP_PACKAGE, appPackage, <END> MobileCapabilityType.APP_ACTIVITY, appActivity, MobileCapabilityType.APP_WAIT_PACKAGE, appWaitPackage, MobileCapabilityType.APP_WAIT_ACTIVITY, appWaitActivity); execute(START_ACTIVITY, parameters); }</code><technical_language>This code a lot cleaner static imports. - checkArgument a static import - MobileCapabilityType.\*</technical_language>

Target:
public void startActivity(String appPackage, String appActivity, String appWaitPackage, String appWaitActivity) throws IllegalArgumentException { checkArgument((_isNotNullOrEmpty(appPackage) && _isNotNullOrEmpty(appActivity)), String.format("'%s' and '%s' are required.", APP_PACKAGE, APP_ACTIVITY)); appWaitPackage = _isNotNullOrEmpty(appWaitPackage) ? appWaitPackage : ""; appWaitActivity = _isNotNullOrEmpty(appWaitActivity) ? appWaitActivity : ""; ImmutableMap<String, String> parameters = ImmutableMap.of(APP_PACKAGE, appPackage, APP_ACTIVITY, appActivity, APP_WAIT_PACKAGE, appWaitPackage, APP_WAIT_ACTIVITY, appWaitActivity); execute(START_ACTIVITY, parameters); }
Source:
<code><START> private static Set<File> getFilesForPattern(Path baseDir, String pathPattern, boolean libraryProperty) { <END> try { Path filePath = resolvePath(baseDir, pathPattern); if ((pathPattern.endsWith(".jar") || pathPattern.endsWith(".zip")) && Files.isRegularFile(filePath)) { return Collections.singleton(filePath.toFile()); } if (Files.isDirectory(filePath)) { if (libraryProperty) { Set<File> matches = new LibraryFinder().find(filePath, p -> true); matches.add(filePath.toFile()); return matches; } else { return Collections.singleton(filePath.toFile()); } } } catch (IOException e) { } String dirPath; String fileNamePattern; int wildcardIndex = pathPattern.indexOf('*'); if (wildcardIndex >= 0) { dirPath = pathPattern.substring(0, wildcardIndex); } else { dirPath = pathPattern; } int lastPathSeparator = Math.max(dirPath.lastIndexOf('/'), dirPath.lastIndexOf('\\')); if (lastPathSeparator == -1) { dirPath = "."; fileNamePattern = pathPattern; } else { dirPath = pathPattern.substring(0, lastPathSeparator); fileNamePattern = pathPattern.substring(lastPathSeparator + 1); } Path dir = resolvePath(baseDir, dirPath); if (!Files.isDirectory(dir)) { return Collections.emptySet(); } try { if (libraryProperty) { return getMatchingLibraries(fileNamePattern, dir); } else { return getMatchingDirs(fileNamePattern, dir); } } catch (IOException e) { throw new IllegalStateException(e); } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "getFilesForPattern" is 17 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
private static Set<File> getFilesForPattern(Path baseDir, String pathPattern, boolean libraryProperty) { try { Path filePath = resolvePath(baseDir, pathPattern); if ((pathPattern.endsWith(".jar") || pathPattern.endsWith(".zip")) && Files.isRegularFile(filePath)) { return Collections.singleton(filePath.toFile()); } if (Files.isDirectory(filePath)) { return getMatchesInDir(filePath, libraryProperty); } } catch (IOException e) { } String dirPath; String fileNamePattern; int wildcardIndex = pathPattern.indexOf('*'); if (wildcardIndex >= 0) { dirPath = pathPattern.substring(0, wildcardIndex); } else { dirPath = pathPattern; } int lastPathSeparator = Math.max(dirPath.lastIndexOf('/'), dirPath.lastIndexOf('\\')); if (lastPathSeparator == -1) { dirPath = "."; fileNamePattern = pathPattern; } else { dirPath = pathPattern.substring(0, lastPathSeparator); fileNamePattern = pathPattern.substring(lastPathSeparator + 1); } Path dir = resolvePath(baseDir, dirPath); if (!Files.isDirectory(dir)) { return Collections.emptySet(); } try { if (libraryProperty) { return getMatchingLibraries(fileNamePattern, dir); } else { return getMatchingDirs(fileNamePattern, dir); } } catch (IOException e) { throw new IllegalStateException(e); } }