auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void copyFileToDestination(Path exportPath) { Optional<Path> fileToExport = linkedFile.findIn(databaseContext, Globals.prefs.getFilePreferences()); <START> Optional<Path> newPath = OptionalUtil.combine(Optional.of(exportPath), fileToExport, resolvePathFilename); <END> if (newPath.isPresent()) { Path newFile = newPath.get(); boolean success = FileUtil.copyFile(fileToExport.get(), newFile, false); if (success) { dialogService.showInformationDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Sucessfully copied file to %0", newPath.map(Path::getParent).map(Path::toString).orElse(""))); } else { dialogService.showErrorDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Could not copy file to %0, maybe the file is already existing?", newPath.map(Path::getParent).map(Path::toString).orElse(""))); } } }</code><technical_language>I this is a bit overly complicated copy file if find (e.g. fileToExport is empty). Moreover, please show a warning in case is empty</technical_language>

Target:
private void copyFileToDestination(Path exportPath) { Optional<Path> fileToExport = linkedFile.findIn(databaseContext, Globals.prefs.getFilePreferences()); Optional<Path> newPath = OptionalUtil.combine(Optional.of(exportPath), fileToExport, resolvePathFilename); if (newPath.isPresent()) { Path newFile = newPath.get(); boolean success = FileUtil.copyFile(fileToExport.get(), newFile, false); if (success) { dialogService.showInformationDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Sucessfully copied file to %0", newPath.map(Path::getParent).map(Path::toString).orElse(""))); } else { dialogService.showErrorDialogAndWait(Localization.lang("Copy linked file"), Localization.lang("Could not copy file to %0, maybe the file is already existing?", newPath.map(Path::getParent).map(Path::toString).orElse(""))); } } else { dialogService.showErrorDialogAndWait(Localization.lang("Could not resolve the file %0", fileToExport.map(Path::getParent).map(Path::toString).orElse(""))); } }
Source:
<code>public Optional<ExerciseDesc> scanExercise(Path path, String exerciseName) { ProcessRunner runner = new ProcessRunner(this.getAvailablePointsCommand(), path); try { runner.call(); } catch (Exception e) { <START> log.error(CANNOT_SCAN_EXERCISE_MESSAGE, e); <END> } try { ImmutableList<TestDesc> testDescs = new RExerciseDescParser(path).parse(); return Optional.of(new ExerciseDesc(exerciseName, testDescs)); } catch (IOException e) { log.error(CANNOT_PARSE_EXERCISE_DESCRIPTION_MESSAGE, e); } return Optional.absent(); }</code><technical_language>Is some scenario want early return Optional.absent() here</technical_language>

Target:
public Optional<ExerciseDesc> scanExercise(Path path, String exerciseName) { ProcessRunner runner = new ProcessRunner(this.getAvailablePointsCommand(), path); try { runner.call(); } catch (Exception e) { log.error(CANNOT_SCAN_EXERCISE_MESSAGE, e); return Optional.absent(); } try { ImmutableList<TestDesc> testDescs = new RExerciseDescParser(path).parse(); return Optional.of(new ExerciseDesc(exerciseName, testDescs)); } catch (IOException e) { log.error(CANNOT_PARSE_EXERCISE_DESCRIPTION_MESSAGE, e); } return Optional.absent(); }
Source:
<code>private ACUser findUser(String name) throws ESException { ACUser result = null; for (final ACUser user : adminBroker.getUsers()) { if (user.getName().equals(name)) { <START> result = user; <END> } } return result; }</code><technical_language>break (applies findGroup well)</technical_language>

Target:
private ACUser findUser(String name) throws ESException { for (final ACUser user : adminBroker.getUsers()) { if (user.getName().equals(name)) { return user; } } return null; }
Source:
<code>public String renderExternalContent(Model model, @SiteParam Site site, @PathVariable String pageName) throws IOException { <START> String repoKeyPrefix = "c"; <END> String repoKey = repoKeyPrefix.concat(".").concat(pageName); try { model.addAttribute("externalServiceName", "ember"); model.addAttribute("externalData", editorialContentService.getJson("externalContent", repoKey)); } catch (EntityNotFoundException e) { throw new NotFoundException(e); } return site + "/ftl/externalContent/container"; }</code><technical_language>this a public static final constant instead? (And constant in RequestMapping line 37 too?)</technical_language>

Target:
public String renderExternalContent(Model model, @SiteParam Site site, @PathVariable String pageName) throws IOException { String repoKey = REPO_KEY_PREFIX.concat(".").concat(pageName); model.addAttribute("externalServiceName", "ember"); try { model.addAttribute("externalData", editorialContentService.getJson("externalContent", repoKey)); } catch (EntityNotFoundException e) { throw new NotFoundException(e); } return site + "/ftl/externalContent/container"; }
Source:
<code>static public void downloadAptDependencies(String packet) { Process proc; final Runtime rt = Runtime.getRuntime(); final String cmd = "apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends " + packet + " | grep \"^\\w\")"; <START> System.out.println("Command: " + cmd); <END> try { proc = rt.exec(new String[] {"bash", "-c", cmd}); proc.waitFor(); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>Please a logger</technical_language>

Target:
static public void downloadAptDependencies(String packet) { Runtime rt = Runtime.getRuntime(); String cmd = "apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends " + packet + " | grep \"^\\w\")"; LOGGER.info("Executing command: " + cmd); try { rt.exec(new String[] {"bash", "-c", cmd}) .waitFor(); } catch (Exception e) { LOGGER.error("Error while downloading artifacts...", e); } }
Source:
<code>private boolean validateDiskOnBackupDomain(StorageDomainValidator storageDomainValidator) { <START> if (!validate(storageDomainValidator.isBackupStorageDomainUpdatedWithRunningVm())) { return false; } return true; <END> }</code><technical_language>return validate(storageDomainValidator.isBackupStorageDomainUpdatedWithRunningVm());</technical_language>

Target:
private boolean validateDiskOnBackupDomain(StorageDomainValidator storageDomainValidator) { return validate(storageDomainValidator.isBackupStorageDomainUpdatedWithRunningVm()); }
Source:
<code>protected ArtifactRepository getLocalRepository() throws Exception { ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class, "legacy" ); <START> ArtifactRepository r = repositorySystem.createArtifactRepository( "local", "file://" + getLocalRepositoryPath().getAbsolutePath(), repoLayout, null, null ); <END> return r; }</code><technical_language>This is wrong. construct a URI that. Please do: toPath().toUri().toASCIIString()</technical_language>

Target:
protected ArtifactRepository getLocalRepository() throws Exception { ArtifactRepositoryLayout repoLayout = lookup( ArtifactRepositoryLayout.class ); ArtifactRepository r = repositorySystem.createArtifactRepository( "local", "file://" + getLocalRepositoryPath().getAbsolutePath(), repoLayout, null, null ); return r; }
Source:
<code>public void testExecutionInfo_withPrefixBlock() throws Exception { scratch.file( "tests/BUILD", "sh_binary(name = 'with-prefix-block', srcs=['sh.sh'], tags=['block-some-feature', 'block-network', 'wrong-tag'])", "sh_binary(name = 'with-prefix-cpu', srcs=['sh.sh'], tags=['cpu:123', 'wrong-tag'])", <START> "sh_binary(name = 'with-local-tag', srcs=['sh.sh'], tags=['local', 'some-tag'])" <END> ); Rule withBlockPrefix = (Rule) getTarget(" Map<String, String> execInfo = TargetUtils.getExecutionInfo(withBlockPrefix); assertThat(execInfo).containsExactly("block-network", "", "block-some-feature", ""); }</code><technical_language>remove lines. in test</technical_language>

Target:
public void testExecutionInfo_withPrefixBlock() throws Exception { scratch.file( "tests/BUILD", "sh_binary(name = 'with-prefix-block', srcs=['sh.sh'], tags=['block-some-feature', 'block-network', 'wrong-tag'])" ); Rule withBlockPrefix = (Rule) getTarget(" Map<String, String> execInfo = TargetUtils.getExecutionInfo(withBlockPrefix); assertThat(execInfo).containsExactly("block-network", "", "block-some-feature", ""); }
Source:
<code>private Block roundTrip(final Block in, final Version version) { byte[] written; try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) { in.write(version.major, os); written = os.toByteArray(); <START> } catch (final IOException e) { <END> throw new RuntimeIOException(e); } try (final InputStream is = new ByteArrayInputStream(written)) { return Block.read(version.major, is); } catch (final IOException e) { throw new RuntimeIOException(e); } }</code><technical_language>In tests declare methods test methods "throw IOException" catching wrapping them, get rid of catch clause</technical_language>

Target:
private Block roundTrip(final Block in, final Version version) throws IOException { byte[] written; try (final ByteArrayOutputStream os = new ByteArrayOutputStream()) { in.write(version.major, os); written = os.toByteArray(); } try (final InputStream is = new ByteArrayInputStream(written)) { return Block.read(version.major, is); } }
Source:
<code>public void test_evaluate_array_mixedTypes () { final AtomicReferenceArray<Object> atomicArray = new AtomicReferenceArray<>(3); atomicArray.set(0, "executing"); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { Object[] evalResult = (Object[]) browser.evaluate("return new Array(\"str1\", 2, true)"); atomicArray.set(0, evalResult[0]); atomicArray.set(1, evalResult[1]); atomicArray.set(2, evalResult[2]); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (! "executing".equals(atomicArray.get(0))) { if (atomicArray.get(0).equals("str1") && ((Double) atomicArray.get(1)) == 2 && ((Boolean) atomicArray.get(2))) { return; } else { <START> System.err.println("ERROR: test_evaluate_array_mixedTypes, resulting strings not as expected"); <END> } } } fail(name.getMethodName() + " failed. Expected evaluate to return an array of mixed types. But didn't receive a return value or return values didn't match."); }</code><technical_language>fail again</technical_language>

Target:
public void test_evaluate_array_mixedTypes () { assumeFalse(webkit1SkipMsg(), isWebkit1); final AtomicReferenceArray<Object> atomicArray = new AtomicReferenceArray<>(3); atomicArray.set(0, "executing"); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { Object[] evalResult = (Object[]) browser.evaluate("return new Array(\"str1\", 2, true)"); atomicArray.set(0, evalResult[0]); atomicArray.set(1, evalResult[1]); atomicArray.set(2, evalResult[2]); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (! "executing".equals(atomicArray.get(0))) { if (atomicArray.get(0).equals("str1") && ((Double) atomicArray.get(1)) == 2 && ((Boolean) atomicArray.get(2))) { return; } else { fail("Resulting strings not as expected"); } } } fail("Expected evaluate to return an array of mixed types. But didn't receive a return value or return values didn't match."); }
Source:
<code>public ValueExtractorDescriptor getMaximallySpecificAndContainerElementCompliantValueExtractor(Class<?> declaredType, TypeVariable<?> typeParameter) { Set<ValueExtractorDescriptor> maximallySpecificContainerElementCompliantValueExtractors = getMaximallySpecificValueExtractors( declaredType, getTypeCompliantAndContainerElementCompliantValueExtractors( declaredType, typeParameter ) ); if ( maximallySpecificContainerElementCompliantValueExtractors.isEmpty() ) { return null; } else if ( maximallySpecificContainerElementCompliantValueExtractors.size() == 1 ) { return maximallySpecificContainerElementCompliantValueExtractors.iterator().next(); } else { throw LOG.getUnableToGetMostSpecificValueExtractorDueToSeveralMaximallySpecificValueExtractorsDeclaredException( declaredType, ValueExtractorHelper.toValueExtractorClasses( maximallySpecificContainerElementCompliantValueExtractors ) ); } <START> } <END></code><technical_language>a time remove a <p>, rationale for this</technical_language>

Target:
public ValueExtractorDescriptor getMaximallySpecificAndContainerElementCompliantValueExtractor(Class<?> declaredType, TypeVariable<?> typeParameter) { return valueExtractorResolver.getMaximallySpecificAndContainerElementCompliantValueExtractor( declaredType, typeParameter ); }
Source:
<code>private Expression readAggregateExpression(int tokenT) { int type = ParserDQL.getExpressionType(tokenT); boolean distinct = false; boolean all = false; switch (tokenT) { case Tokens.RANK: case Tokens.DENSE_RANK: return null; <START> } <END> if (token.tokenType == Tokens.DISTINCT) { distinct = true; read(); } else if (token.tokenType == Tokens.ALL) { all = true; read(); } Expression e = XreadValueExpression(); switch (type) { case OpTypes.COUNT : if (e.getType() == OpTypes.MULTICOLUMN) { if (((ExpressionColumn) e).tableName != null) { throw unexpectedToken(); } e.opType = OpTypes.ASTERISK; break; } else { break; } case OpTypes.STDDEV_POP : case OpTypes.STDDEV_SAMP : case OpTypes.VAR_POP : case OpTypes.VAR_SAMP : case OpTypes.APPROX_COUNT_DISTINCT : if (all || distinct) { throw Error.error(ErrorCode.X_42582, all ? Tokens.T_ALL : Tokens .T_DISTINCT); } break; default : if (e.getType() == OpTypes.ASTERISK) { throw unexpectedToken(); } } Expression aggregateExp = new ExpressionAggregate(type, distinct, e); return aggregateExp; }</code><technical_language>A question: Is correct "RANK DISTINCT" is supported standard is correctly treated a syntax error</technical_language>

Target:
private Expression readAggregateExpression(int tokenT) { int type = ParserDQL.getExpressionType(tokenT); boolean distinct = false; boolean all = false; switch (tokenT) { case Tokens.RANK: case Tokens.DENSE_RANK: if (token.tokenType != Tokens.CLOSEBRACKET) { throw Error.error("Expected a right parenthesis (')') here.", "", -1); } return null; } if (token.tokenType == Tokens.DISTINCT) { distinct = true; read(); } else if (token.tokenType == Tokens.ALL) { all = true; read(); } Expression e = XreadValueExpression(); switch (type) { case OpTypes.COUNT : if (e.getType() == OpTypes.MULTICOLUMN) { if (((ExpressionColumn) e).tableName != null) { throw unexpectedToken(); } e.opType = OpTypes.ASTERISK; break; } else { break; } case OpTypes.STDDEV_POP : case OpTypes.STDDEV_SAMP : case OpTypes.VAR_POP : case OpTypes.VAR_SAMP : case OpTypes.APPROX_COUNT_DISTINCT : if (all || distinct) { throw Error.error(ErrorCode.X_42582, all ? Tokens.T_ALL : Tokens .T_DISTINCT); } break; default : if (e.getType() == OpTypes.ASTERISK) { throw unexpectedToken(); } } Expression aggregateExp = new ExpressionAggregate(type, distinct, e); return aggregateExp; }
Source:
<code>public void setTransportTypes(Set<TransportType> transportTypes) { Translator transportTypeTranslator = EnumTranslator.Create(TransportType.class); StringBuilder transportTypesBuilder = new StringBuilder(); Iterator<TransportType> iterator = transportTypes.iterator(); while (iterator.hasNext()) { TransportType transportType = iterator.next(); if (transportTypeTranslator.containsKey(transportType)) { transportTypesBuilder.append(transportTypeTranslator.get(transportType)); } else { transportTypesBuilder.append(transportType.toString()); } if (iterator.hasNext()) { transportTypesBuilder.append(", "); } } <START> this.transportTypes = new String(transportTypesBuilder.toString()); <END> }</code><technical_language>Consider moving this translation View itself. refer ClusterTypeLabel, if want write a custom renderer do translation</technical_language>

Target:
public void setTransportTypes(Set<TransportType> transportTypes) { this.transportTypes = transportTypes; }
Source:
<code>private void processRecords(ConsumerRecords<String, String> records) { for (ConsumerRecord<String, String> record : records) { String featureName = record.key(); String featureStateAsString = record.value(); try { LOG.info("Starting to process state of feature {}.", featureName); FeatureStateStorageWrapper storageWrapper = deserialize(featureStateAsString); LOG.info("Successfully deserialized state of feature {}.", featureName); updateHandler.accept(featureName, storageWrapper); LOG.info("Successfully processed state of feature {}.", featureName); updatePartitionOffset(record.partition(), record.offset()); <START> } catch (Exception e) { <END> throw new RuntimeException("An error occurred while processing state of feature " + featureName + ".", e); } } }</code><technical_language>RuntimeException is sufficient here</technical_language>

Target:
private void processRecords(ConsumerRecords<String, String> records) { for (ConsumerRecord<String, String> record : records) { String featureName = record.key(); String featureStateAsString = record.value(); try { LOG.debug("Starting to process state of feature {}.", featureName); FeatureStateStorageWrapper storageWrapper = deserialize(featureStateAsString); LOG.debug("Successfully deserialized state of feature {}.", featureName); updateHandler.accept(featureName, storageWrapper); LOG.debug("Successfully processed state of feature {}.", featureName); updatePartitionOffset(record.partition(), record.offset()); } catch (Exception e) { throw new RuntimeException("An error occurred while processing state of feature " + featureName + ".", e); } } }
Source:
<code>public DatabaseTestResult testStatus() { if (verifyConnection()) { if (verifyDatabaseExists()) { if (verifyDatabaseSchema()) { <START> return DatabaseTestResult.TESTEDOK; <END> } else { return DatabaseTestResult.SCHEMA_INVALID; } } else { return DatabaseTestResult.DB_DOES_NOT_EXIST; } } else { return DatabaseTestResult.CONNECTION_FAILED; } }</code><technical_language>I named this, underscore readability for "TESTEDOK"</technical_language>

Target:
public DatabaseTestResult testStatus() { if (verifyConnection()) { if (verifyDatabaseExists()) { if (verifyDatabaseSchema()) { return DatabaseTestResult.TESTED_OK; } else { return DatabaseTestResult.SCHEMA_INVALID; } } else { return DatabaseTestResult.DB_DOES_NOT_EXIST; } } else { return DatabaseTestResult.CONNECTION_FAILED; } }
Source:
<code>public Date getDateModified() { <START> return getMetadata().get(PublishedInfo.TIME_MODIFIED, Date.class); <END> }</code><technical_language>This is repeated then, this class a common interface? e.g CatalogInfo</technical_language>

Target:
public Date getDateModified() { return this.dateModified; }
Source:
<code>public Set<Plugin> getAllDependencies(){ <START> Map<Plugin,List<Plugin>> allDependencies = new HashMap<Plugin,List<Plugin>>(); <END> return addMissingDependencies(allDependencies); }</code><technical_language>need declare types in new constructor, diamond is enough</technical_language>

Target:
public Set<Plugin> getAllDependencies(){ Map<Plugin,List<Plugin>> dependencyMap = new HashMap<Plugin,List<Plugin>>(); addMissingDependencies(dependencyMap); dependencyMap.remove(this); return dependencyMap.keySet(); }
Source:
<code>private void replaceRuleIdsByRuleKeys(@Nullable Facets facets, List<RuleDefinitionDto> alreadyLoadedRules) { if (facets == null || facets.get(PARAM_RULES) == null) { return; } LinkedHashMap<String, Long> rulesFacet = facets.get(PARAM_RULES); try (DbSession dbSession = dbClient.openSession(false)) { Set<String> ruleKeysToLoad = new HashSet<>(); ruleKeysToLoad.addAll(rulesFacet.keySet()); ruleKeysToLoad.removeAll( alreadyLoadedRules .stream() .map(r -> r.getKey().toString()) .collect(Collectors.toList())); Set<RuleDefinitionDto> requiredRules = new HashSet<>(); requiredRules.addAll(alreadyLoadedRules); <START> requiredRules.addAll(dbClient.ruleDao().selectDefinitionByIds(dbSession, Collections2.transform(ruleKeysToLoad, Integer::parseInt))); <END> Map<Integer, RuleKey> idToRuleKey = requiredRules.stream() .collect(Collectors.toMap(RuleDefinitionDto::getId, RuleDefinitionDto::getKey)); LinkedHashMap<String, Long> newRulesFacet = new LinkedHashMap<>(); rulesFacet.forEach((k, v) -> { RuleKey ruleKey = idToRuleKey.get(Integer.parseInt(k)); if (ruleKey != null) { newRulesFacet.put(ruleKey.toString(), v); } else { LOGGER.error("Rule with id is not available in database", k); } }); rulesFacet.clear(); rulesFacet.putAll(newRulesFacet); } }</code><technical_language>selectDefinitionByIds a fast return in case list of rule keys is empty. method do a SQL request RuleKey collection is empty</technical_language>

Target:
private void replaceRuleIdsByRuleKeys(@Nullable Facets facets, List<RuleDefinitionDto> alreadyLoadedRules) { if (facets == null || facets.get(PARAM_RULES) == null) { return; } LinkedHashMap<String, Long> rulesFacet = facets.get(PARAM_RULES); try (DbSession dbSession = dbClient.openSession(false)) { Set<String> ruleKeysToLoad = new HashSet<>(rulesFacet.keySet()); ruleKeysToLoad.removeAll( alreadyLoadedRules .stream() .map(r -> r.getKey().toString()) .collect(Collectors.toList())); Map<Integer, RuleKey> idToRuleKey = Stream.concat( alreadyLoadedRules.stream(), dbClient.ruleDao().selectDefinitionByIds(dbSession, Collections2.transform(ruleKeysToLoad, Integer::parseInt)).stream()) .collect(Collectors.toMap(RuleDefinitionDto::getId, RuleDefinitionDto::getKey)); LinkedHashMap<String, Long> newRulesFacet = new LinkedHashMap<>(); rulesFacet.forEach((k, v) -> { RuleKey ruleKey = idToRuleKey.get(Integer.parseInt(k)); if (ruleKey != null) { newRulesFacet.put(ruleKey.toString(), v); } else { LOGGER.error("Rule with id is not available in database", k); } }); rulesFacet.clear(); rulesFacet.putAll(newRulesFacet); } }
Source:
<code>void runUntilCanceled() throws InterruptedException { ExponentialBackOff backoffTracker = null; while (!isCanceled()) { if (Thread.interrupted()) { throw new InterruptedException(); } Collection<Metric> metrics = metricsQueue.poll(batchSize, maxIdleTime); if (metrics.isEmpty() && lastWorkTime > 0 && maxIdleTime > 0 && System.currentTimeMillis() > lastWorkTime + maxIdleTime) { log.info("Shutting down writer due to dearth of work"); break; } if (metrics.isEmpty()) { log.debug("No work to do, so checking again."); continue; } try { if (backoffTracker == null) { backoffTracker = createExponentialBackOff(); } processBatch(metrics); backoffTracker.reset(); } catch (NoSuchElementException e) { long backOff = this.minBackOff; try { backOff = backoffTracker.nextBackOffMillis(); } catch (IOException e1) { } if (ExponentialBackOff.STOP == backOff) { backOff = backoffTracker.getMaxIntervalMillis(); log.warn("Error getting OpenTsdbClient after ms: {}", backoffTracker.getElapsedTimeMillis(), e); } else { log.debug("Error getting OpenTsdbClient", e); } <START> log.debug("Connection back off, sleeping:{}", backOff); <END> Thread.sleep(backOff); } } }</code><technical_language>add milliseconds log message</technical_language>

Target:
void runUntilCanceled() throws InterruptedException { ExponentialBackOff backoffTracker = null; while (!isCanceled()) { if (Thread.interrupted()) { throw new InterruptedException(); } Collection<Metric> metrics = metricsQueue.poll(batchSize, maxIdleTime); if (metrics.isEmpty() && lastWorkTime > 0 && maxIdleTime > 0 && System.currentTimeMillis() > lastWorkTime + maxIdleTime) { log.info("Shutting down writer due to dearth of work"); break; } if (metrics.isEmpty()) { log.debug("No work to do, so checking again."); continue; } try { if (backoffTracker == null) { backoffTracker = createExponentialBackOff(); } processBatch(metrics); backoffTracker.reset(); } catch (NoSuchElementException e) { long backOff = this.minBackOff; try { backOff = backoffTracker.nextBackOffMillis(); } catch (IOException e1) { } if (ExponentialBackOff.STOP == backOff) { backOff = backoffTracker.getMaxIntervalMillis(); log.warn("Error getting OpenTsdbClient after ms: {}", backoffTracker.getElapsedTimeMillis(), e); } else { log.debug("Error getting OpenTsdbClient", e); } log.debug("Connection back off, sleeping ms", backOff); Thread.sleep(backOff); } } }
Source:
<code>private Property getProperty(Class<?> clazz, String property, ElementType elementType) { Contracts.assertNotNull( clazz, MESSAGES.classCannotBeNull() ); if ( property == null || property.length() == 0 ) { throw LOG.getPropertyNameCannotBeNullOrEmptyException(); } if ( !( ElementType.FIELD.equals( elementType ) || ElementType.METHOD.equals( elementType ) ) ) { throw LOG.getElementTypeHasToBeFieldOrMethodException(); } if ( ElementType.FIELD.equals( elementType ) ) { Field field = run( GetDeclaredField.action( clazz, property ) ); return field == null ? null : new JavaBeanField( field ); } else { <START> Method method = GetMethodFromPropertyName.action( clazz, propertyFilter, property ).run(); <END> return method == null ? null : JavaBeanExecutable.of( propertyFilter, method ).as( Property.class ); } }</code><technical_language>a bit puzzled. usual run( action ) pattern</technical_language>

Target:
private Optional<Property> getProperty(Class<?> clazz, String property, ElementType elementType) { Contracts.assertNotNull( clazz, MESSAGES.classCannotBeNull() ); if ( property == null || property.length() == 0 ) { throw LOG.getPropertyNameCannotBeNullOrEmptyException(); } if ( !( ElementType.FIELD.equals( elementType ) || ElementType.METHOD.equals( elementType ) ) ) { throw LOG.getElementTypeHasToBeFieldOrMethodException(); } if ( ElementType.FIELD.equals( elementType ) ) { return javaBean.getFieldPropertyByName( property ); } else { return javaBean.getCallablePropertyByName( property ); } }
Source:
<code>private static void recordTimer( Registry registry, URL requestUrl, Long durationNs, int statusCode, boolean wasSuccessful, boolean hasAuthHeaders) { registry.timer( registry.createId("okhttp.requests") .withTag("requestHost", requestUrl.getHost()) .withTag("statusCode", String.valueOf(statusCode)) .withTag("status", bucket(statusCode)) .withTag("success", wasSuccessful) <START> .withTag("hasAuthHeaders", hasAuthHeaders) <END> ) .record(durationNs, TimeUnit.NANOSECONDS); }</code><technical_language>s/hasAuthHeaders/authenticated</technical_language>

Target:
private static void recordTimer( Registry registry, URL requestUrl, Long durationNs, int statusCode, boolean wasSuccessful, boolean hasAuthHeaders) { registry .timer( registry .createId("okhttp.requests") .withTag("requestHost", requestUrl.getHost()) .withTag("statusCode", String.valueOf(statusCode)) .withTag("status", bucket(statusCode)) .withTag("success", wasSuccessful) .withTag("authenticated", hasAuthHeaders)) .record(durationNs, TimeUnit.NANOSECONDS); }
Source:
<code>private void configureCompilerLog(CompilerConfiguration compilerConfiguration) { Map<String, String> map = compilerConfiguration.getCustomCompilerArgumentsAsMap(); if (!map.keySet().contains("-log") || ".".equals(outputJar.getName())) { return; } String logPath = map.get("-log"); if (logPath == null) { LinkedList<String> keys = new LinkedList<String>(map.keySet()); int logIndex = keys.indexOf("-log"); if (logIndex == keys.size() - 1) { getLog().error( "Compiler argument '-log' found, but no additional argument containing the path could be found"); return; } logPath = keys.get(logIndex + 1); map.remove(logPath); } File logFile = new File(logPath); String normalizedOutputJarName = <START> outputJar.getName().replaceAll("/", <END> "_").replaceAll("\\\\", "_"); String newLogFileName = normalizedOutputJarName + "_" + logFile.getName(); File newLogFile = new File(logFile.getParent(), newLogFileName); map.remove("-log"); map.put("-log", newLogFile.getAbsolutePath()); compilerConfiguration.setCustomCompilerArgumentsAsMap(map); }</code><technical_language>wondering if getName return normalized name. name is in EclipsePluginProjectImpl compute outputDirectory currently nested jar's classes folder hidden in a subfolder of target folder. E.g. for a Bundle-ClassPath: ., work/worker.jar, classes hide "target/work/worker.jar-classes". ("target/work" is Tycho's test execution, I expect classes there.) in "target/work_worker.jar-classes"</technical_language>

Target:
private void configureCompilerLog(CompilerConfiguration compilerConfiguration) { if (!logEnabled) { return; } logDirectory.mkdirs(); String logFileName = null; if (".".equals(outputJar.getName())) { logFileName = "@dot"; } else { logFileName = outputJar.getName().replaceAll("/", "_"); } String logPath = logDirectory.getAbsolutePath(); if (!logPath.endsWith(File.separator)) { logPath = logPath + File.separator; } String fileExtension = logFormat; if ("plain".equals(logFormat)) { fileExtension = "log"; } logPath = logPath + logFileName + "." + fileExtension; compilerConfiguration.addCompilerCustomArgument("-log", logPath); }
Source:
<code>private static SiriusContext fromDRepresentation(DRepresentation repr) { Session session = <START> new EObjectQuery(repr).getSession(); <END> DSemanticDecorator decorator = null; if (repr instanceof DSemanticDecorator) { decorator = (DSemanticDecorator) repr; } EObject mainSemanticElement = null; if (decorator != null) { mainSemanticElement = decorator.getTarget(); } return new SiriusContext(repr, session, repr, decorator, mainSemanticElement); }</code><technical_language>Session.of</technical_language>

Target:
private static SiriusContext fromDRepresentation(DRepresentation repr) { Session session = Session.of(repr).orElse(null); DSemanticDecorator decorator = null; if (repr instanceof DSemanticDecorator) { decorator = (DSemanticDecorator) repr; } EObject mainSemanticElement = null; if (decorator != null) { mainSemanticElement = decorator.getTarget(); } return new SiriusContext(repr, session, repr, decorator, mainSemanticElement); }
Source:
<code>private List<TaskInfo> getTasks() { List<TaskInfo> taskInfos = workQueue.getTaskInfos(new TaskInfoFactory<TaskInfo>() { @Override public TaskInfo getTaskInfo(Task<?> task) { return new TaskInfo(task); } }); Collections.sort(taskInfos, <START> new Comparator<TaskInfo>() { <END> @Override public int compare(TaskInfo a, TaskInfo b) { if (a.state != b.state) { return a.state.ordinal() - b.state.ordinal(); } int cmp = Long.signum(a.delay - b.delay); if (cmp != 0) { return cmp; } return a.command.compareTo(b.command); } }); return taskInfos; }</code><technical_language>I see, this code is copied SSH command, want improve code, right</technical_language>

Target:
private List<TaskInfo> getTasks() { List<TaskInfo> taskInfos = workQueue.getTaskInfos(new TaskInfoFactory<TaskInfo>() { @Override public TaskInfo getTaskInfo(Task<?> task) { return new TaskInfo(task); } }); Collections.sort(taskInfos, new Comparator<TaskInfo>() { @Override public int compare(TaskInfo a, TaskInfo b) { return ComparisonChain.start() .compare(a.state.ordinal(), b.state.ordinal()) .compare(a.delay, b.delay) .compare(a.command, b.command) .result(); } }); return taskInfos; }
Source:
<code>public String getDescription() { try { WebApp webapp = WebApp.getCurrent(); MetaClass meta = webapp.getMetaClass(super.clazz); Script s = meta.loadTearOff(JellyClassTearOff.class).resolveScript("newInstanceDetail"); if (s == null) { <START> meta.loadTearOff(JellyClassTearOff.class).resolveScript("newJobDetail"); <END> } DefaultScriptInvoker dsi = new DefaultScriptInvoker(); StringWriter sw = new StringWriter(); XMLOutput xml = dsi.createXMLOutput(sw, true); dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, meta, xml); return sw.toString(); } catch (Exception e) { return ""; } }</code><technical_language>bug: unnecessary</technical_language>

Target:
public String getDescription() { Stapler stapler = Stapler.getCurrent(); if (stapler != null) { try { WebApp webapp = WebApp.getCurrent(); MetaClass meta = webapp.getMetaClass(this); Script s = meta.loadTearOff(JellyClassTearOff.class).findScript("newInstanceDetail"); if (s == null) { return ""; } DefaultScriptInvoker dsi = new DefaultScriptInvoker(); StringWriter sw = new StringWriter(); XMLOutput xml = dsi.createXMLOutput(sw, true); dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, this, xml); return sw.toString(); } catch (Exception e) { LOGGER.log(Level.WARNING, null, e); return ""; } } else { return ""; } }
Source:
<code>private static Attribute createAttribute(String key, Serializable value) { if (value instanceof Collection) { Collection<?> valueCollection = (Collection<?>) value; return new AttributeImpl(key, new ArrayList<>(valueCollection)); } <START> return new AttributeImpl(key, value); <END> }</code><technical_language>suggestion return new AttributeImpl(key, instanceof Collection ? new ArrayList<>((Collection<?>) value) : value);</technical_language>

Target:
private static Attribute createAttribute(String key, Serializable value) { return new AttributeImpl( key, value instanceof Collection ? new ArrayList<>((Collection<?>) value) : value); }
Source:
<code>protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); String scope = element.getAttribute(BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); if (StringUtils.hasText(scope)) { builder.setScope(scope); } <START> String host = element.getAttribute("host"); <END> if (StringUtils.hasText(host)) { builder.addPropertyValue("host", host); } String port = element.getAttribute("port"); if (StringUtils.hasText(port)) { builder.addPropertyValue("port", port); } String scheme = element.getAttribute("scheme"); if (StringUtils.hasText(scheme)) { builder.addPropertyValue("scheme", scheme); } String app = element.getAttribute("app"); if (StringUtils.hasText(app)) { builder.addPropertyValue("app", app); } String owner = element.getAttribute("owner"); if (StringUtils.hasText(owner)) { builder.addPropertyValue("owner", owner); } String userName = element.getAttribute("userName"); if (StringUtils.hasText(userName)) { builder.addPropertyValue("userName", userName); } String password = element.getAttribute("password"); if (StringUtils.hasText(password)) { builder.addPropertyValue("password", password); } }</code><technical_language>change this to: IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); If need do more specific validation of do in setter of _SplunkServer_ class for other attributes well</technical_language>

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, BeanDefinitionParserDelegate.SCOPE_ATTRIBUTE); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "host"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "port"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "scheme"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "app"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "owner"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "userName"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "password"); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part instanceof AbstractTextEditor) { Collection<LSPDocumentInfo> infos = LanguageServiceAccessor.getLSPDocumentInfosFor( LSPEclipseUtils.getDocument((ITextEditor) part), capabilities -> Boolean.TRUE.equals(capabilities.getRenameProvider())); if (!infos.isEmpty()) { LSPDocumentInfo info = infos.iterator().next(); ISelection sel = ((AbstractTextEditor) part).getSelectionProvider().getSelection(); if (sel instanceof TextSelection) { int offset = ((TextSelection) sel).getOffset(); <START> String oldName = ""; END> RefactoringProcessor processor = new LSPRenameProcessor(info, offset, oldName); ProcessorBasedRefactoring refactoring = new ProcessorBasedRefactoring(processor); LSPRenameRefactoringWizard wizard = new LSPRenameRefactoringWizard(refactoring); RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard); try { operation.run(part.getSite().getShell(), Messages.rename_title); } catch (InterruptedException e1) { LanguageServerPlugin.logError(e1); } } } } return null; }</code><technical_language>easily retrive tge oldName, please remove need for oldName in LSRenameProcessers? consider adding later, moment, I this piece of code here</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart part = HandlerUtil.getActiveEditor(event); if (part instanceof AbstractTextEditor) { Collection<LSPDocumentInfo> infos = LanguageServiceAccessor.getLSPDocumentInfosFor( LSPEclipseUtils.getDocument((ITextEditor) part), capabilities -> Boolean.TRUE.equals(capabilities.getRenameProvider())); if (!infos.isEmpty()) { LSPDocumentInfo info = infos.iterator().next(); ISelection sel = ((AbstractTextEditor) part).getSelectionProvider().getSelection(); if (sel instanceof TextSelection) { int offset = ((TextSelection) sel).getOffset(); RefactoringProcessor processor = new LSPRenameProcessor(info, offset); ProcessorBasedRefactoring refactoring = new ProcessorBasedRefactoring(processor); LSPRenameRefactoringWizard wizard = new LSPRenameRefactoringWizard(refactoring); RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard); try { operation.run(part.getSite().getShell(), Messages.rename_title); } catch (InterruptedException e1) { LanguageServerPlugin.logError(e1); } } } } return null; }
Source:
<code>public void testCall() throws Exception { ListBranchesCommand listBranchesCommand = fGerrit.listBranches(Common.TEST_PROJECT); BranchInfo[] listBranchesResult = null; try { listBranchesResult = listBranchesCommand.call(); } catch (EGerritException e) { fail(e.getMessage()); } <START> System.out.println(listBranchesResult[0].getRef()); <END> assertEquals(listBranchesResult[0].getRef(), "HEAD"); }</code><technical_language>System.out removed</technical_language>

Target:
public void testCall() throws Exception { ListBranchesCommand listBranchesCommand = fGerrit.listBranches(Common.TEST_PROJECT); BranchInfo[] listBranchesResult = null; try { listBranchesResult = listBranchesCommand.call(); } catch (EGerritException e) { fail(e.getMessage()); } assertEquals(listBranchesResult[0].getRef(), "HEAD"); }
Source:
<code>public boolean performFinish() { try { <START> <END> final int actionSelection = importWithDirectoriesPage .getActionSelection(); final IProject[] projectsToShare; if (actionSelection == GitSelectWizardPage.ACTION_DIALOG_SHARE) projectsToShare = mySharePage.getSelectedProjects(); else projectsToShare = null; final File repoDir = selectRepoPage.getRepository().getDirectory(); getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (actionSelection != GitSelectWizardPage.ACTION_DIALOG_SHARE) { importProjects(); } if (actionSelection != GitSelectWizardPage.ACTION_NO_SHARE) { IProject[] projects; if (projectsToShare == null) projects = getAddedProjects(); else projects = projectsToShare; for (IProject prj : projects) { if (monitor.isCanceled()) throw new InterruptedException(); ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation( prj, repoDir); try { connectProviderOperation.execute(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } } } }); } catch (InvocationTargetException e) { Activator .handleError(e.getCause().getMessage(), e.getCause(), true); return false; } catch (InterruptedException e) { Activator.handleError( UIText.GitCreateProjectViaWizardWizard_AbortedMessage, e, true); return false; } return true; }</code><technical_language>style: unnecessary blank line</technical_language>

Target:
public boolean performFinish() { try { final int actionSelection = importWithDirectoriesPage .getActionSelection(); final IProject[] projectsToShare; if (actionSelection == GitSelectWizardPage.ACTION_DIALOG_SHARE) projectsToShare = shareProjectsPage.getSelectedProjects(); else projectsToShare = null; final File repoDir = selectRepoPage.getRepository().getDirectory(); getContainer().run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (actionSelection != GitSelectWizardPage.ACTION_DIALOG_SHARE) { importProjects(); } if (actionSelection != GitSelectWizardPage.ACTION_NO_SHARE) { IProject[] projects; if (projectsToShare == null) projects = getAddedProjects(); else projects = projectsToShare; for (IProject prj : projects) { if (monitor.isCanceled()) throw new InterruptedException(); ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation( prj, repoDir); try { connectProviderOperation.execute(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } } } }); } catch (InvocationTargetException e) { Activator .handleError(e.getCause().getMessage(), e.getCause(), true); return false; } catch (InterruptedException e) { Activator.handleError( UIText.GitCreateProjectViaWizardWizard_AbortedMessage, e, true); return false; } return true; }
Source:
<code>public void testVerifyIllegalStateException() throws IOException { <START> for (OrcWriteValidationMode validationMode : OrcWriteValidationMode.values()) { <END> TempFile tempFile = new TempFile(); OrcWriter writer = new OrcWriter( new MockOrcDataSink(new FileOutputStream(tempFile.getFile())), ImmutableList.of("test1"), ImmutableList.of(VARCHAR), ORC, NONE, new OrcWriterOptions() .withStripeMinSize(new DataSize(0, MEGABYTE)) .withStripeMaxSize(new DataSize(32, MEGABYTE)) .withStripeMaxRowCount(10) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE) .withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, true, validationMode, new OrcWriterStats()); int entries = 65536; BlockBuilder blockBuilder = VARCHAR.createBlockBuilder(null, entries); byte[] bytes = "dummyString".getBytes(); for (int j = 0; j < entries; j++) { bytes[0] = (byte) ((bytes[0] + 1) % 128); blockBuilder.writeBytes(Slices.wrappedBuffer(bytes, 0, bytes.length), 0, bytes.length); blockBuilder.closeEntry(); } Block[] blocks = new Block[] {blockBuilder.build()}; try { writer.write(new Page(blocks)); } catch (IOException e) { writer.close(); } } }</code><technical_language>Remove validation purpose of test. false HASH for validation options</technical_language>

Target:
public void testVerifyIllegalStateException() throws IOException { OrcWriter writer = new OrcWriter( new MockOrcDataSink(), ImmutableList.of("test1"), ImmutableList.of(VARCHAR), ORC, NONE, new OrcWriterOptions() .withStripeMinSize(new DataSize(0, MEGABYTE)) .withStripeMaxSize(new DataSize(32, MEGABYTE)) .withStripeMaxRowCount(10) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE) .withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, false, null, new OrcWriterStats()); int entries = 65536; BlockBuilder blockBuilder = VARCHAR.createBlockBuilder(null, entries); byte[] bytes = "dummyString".getBytes(); for (int j = 0; j < entries; j++) { bytes[0] = (byte) ((bytes[0] + 1) % 128); blockBuilder.writeBytes(Slices.wrappedBuffer(bytes, 0, bytes.length), 0, bytes.length); blockBuilder.closeEntry(); } Block[] blocks = new Block[] {blockBuilder.build()}; try { writer.write(new Page(blocks)); } catch (IOException e) { writer.close(); } }
Source:
<code><START> private static List<MediaDB> getAllNotInLocal() { <END> return new Select(). from(MediaDB.class). where(MediaDB_Table.filename.isNull()). and(MediaDB_Table.resource_url.isNotNull()). orderBy(MediaDB_Table.id_media, true). queryList(); }</code><technical_language>static is this method is necessary</technical_language>

Target:
private List<MediaDB> getAllNotInLocal() { return new Select(). from(MediaDB.class). where(MediaDB_Table.filename.isNull()). and(MediaDB_Table.resource_url.isNotNull()). orderBy(MediaDB_Table.id_media, true). queryList(); }
Source:
<code>protected void executeCommand() { setVds(null); if (getVds() != null && shouldVdsBeFenced()) { boolean sshVdsmRestartSuccess = false; if (getParameters().shouldExecuteSshSoftFencing()) { sshVdsmRestartSuccess = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion() .toString()); } if (sshVdsmRestartSuccess) { <START> ResourceManager.getInstance().GetVdsManager(getVds().getId()).sshSoftFencingExecutionCallback(getVds()); <END> } else { super.executeCommand(); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } }</code><technical_language>instead of calling a function set status connecting (without callback meanings), getVds().setStatus(connecting..) thing. change name of it, act callback function does</technical_language>

Target:
protected void executeCommand() { setVds(null); if (getVds() != null && shouldVdsBeFenced()) { boolean sshVdsmRestartSuccess = false; if (getParameters().shouldExecuteSshSoftFencing()) { sshVdsmRestartSuccess = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion() .toString()); } if (sshVdsmRestartSuccess) { ResourceManager.getInstance().GetVdsManager(getVds().getId()).finishSshSoftFencingExecution(getVds()); } else { super.executeCommand(); } } else { setCommandShouldBeLogged(false); log.infoFormat("Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore.", getVdsName(), getVdsId()); } }
Source:
<code>ARN(String arn) { this.arn = arn; <START> Matcher sqsMatcher = PATTERN.matcher(arn); <END> if (!sqsMatcher.matches()) { throw new IllegalArgumentException(arn + " is not a valid SNS or SQS ARN"); } this.region = sqsMatcher.group(1); this.name = sqsMatcher.group(3); }</code><technical_language>s/sqs/arn</technical_language>

Target:
ARN(String arn) { this.arn = arn; Matcher arnMatcher = PATTERN.matcher(arn); if (!arnMatcher.matches()) { throw new IllegalArgumentException(arn + " is not a valid ARN"); } this.region = arnMatcher.group(1); this.account = arnMatcher.group(2); this.name = arnMatcher.group(3); }
Source:
<code>public ListConverter(Message.Builder parentBuilder, Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { OriginalType originalType = parquetType.getOriginalType(); if (originalType != OriginalType.LIST) { throw new ParquetDecodingException("Expected LIST wrapper. Found: " + originalType + " instead."); } <START> listOfMessage = fieldDescriptor.getJavaType() == JavaType.MESSAGE; <END> Type parquetSchema; if (parquetType.asGroupType().containsField("list")) { parquetSchema = parquetType.asGroupType().getType("list"); if (parquetSchema.asGroupType().containsField("element")) { parquetSchema = parquetSchema.asGroupType().getType("element"); } } else { throw new ParquetDecodingException("Expected list but got: " + parquetType); } converter = newMessageConverter(parentBuilder, fieldDescriptor, parquetSchema); }</code><technical_language>This variable is unused</technical_language>

Target:
public ListConverter(Message.Builder parentBuilder, Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { OriginalType originalType = parquetType.getOriginalType(); if (originalType != OriginalType.LIST || parquetType.isPrimitive()) { throw new ParquetDecodingException("Expected LIST wrapper. Found: " + originalType + " instead."); } GroupType rootWrapperType = parquetType.asGroupType(); if (!rootWrapperType.containsField("list") || rootWrapperType.getType("list").isPrimitive()) { throw new ParquetDecodingException("Expected repeated 'list' group inside LIST wrapperr but got: " + rootWrapperType); } GroupType listType = rootWrapperType.getType("list").asGroupType(); if (!listType.containsField("element")) { throw new ParquetDecodingException("Expected 'element' inside repeated list group but got: " + listType); } Type elementType = listType.getType("element"); converter = newMessageConverter(parentBuilder, fieldDescriptor, elementType); }