auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<String> buildTestScannerArgs(Path path, ClassPath classPath, String... args) { List<String> scannerArgs = new ArrayList<>(); scannerArgs.add("java"); scannerArgs.add("-cp"); if (classPath == null) { scannerArgs.add(generateClassPath(path).toString()); } else { scannerArgs.add(classPath.toString()); } scannerArgs.add("fi.helsinki.cs.tmc.testscanner.TestScanner"); path = path.toAbsolutePath(); scannerArgs.add(path.toString() + testDir); if (args != null) { for (String arg : args) { scannerArgs.add(arg); } <START> } <END> return scannerArgs; }</code><technical_language>scannerArgs.addAll(Arrays.asList(args)) do same</technical_language>

Target:
private List<String> buildTestScannerArgs(Path path, ClassPath classPath, String... args) { List<String> scannerArgs = new ArrayList<>(); scannerArgs.add("java"); scannerArgs.add("-cp"); if (classPath == null) { scannerArgs.add(generateClassPath(path).toString()); } else { scannerArgs.add(classPath.toString()); } scannerArgs.add("fi.helsinki.cs.tmc.testscanner.TestScanner"); path = path.toAbsolutePath(); scannerArgs.add(path.toString() + testDir); if (args != null) { Collections.addAll(scannerArgs, args); } return scannerArgs; }
Source:
<code>public static BlobProperties getBlobPropertiesFromStream(DataInputStream stream) throws IOException { short version = stream.readShort(); BlobProperties toReturn; long ttl = stream.readLong(); boolean isPrivate = stream.readByte() == 1; long creationTime = stream.readLong(); long blobSize = stream.readLong(); String contentType = Utils.readIntString(stream); String ownerId = Utils.readIntString(stream); String serviceId = Utils.readIntString(stream); switch (version) { case VERSION_1: toReturn = new BlobProperties(blobSize, serviceId, ownerId, contentType, isPrivate, ttl, creationTime, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, false); break; case VERSION_2: { short accountId = stream.readShort(); short containerId = stream.readShort(); toReturn = new BlobProperties(blobSize, serviceId, ownerId, contentType, isPrivate, ttl, creationTime, accountId, containerId, false); } break; case VERSION_3: { short accountId = stream.readShort(); short containerId = stream.readShort(); <START> boolean isEncrypted = stream.readByte() == (byte) 1; <END> toReturn = new BlobProperties(blobSize, serviceId, ownerId, contentType, isPrivate, ttl, creationTime, accountId, containerId, isEncrypted); } break; default: throw new IllegalArgumentException("stream has unknown blob property version " + version); } return toReturn; }</code><technical_language>suggested above, 1 bit in this field for encryption entire byte</technical_language>

Target:
public static BlobProperties getBlobPropertiesFromStream(DataInputStream stream) throws IOException { short version = stream.readShort(); if (version < VERSION_1 || version > VERSION_3) { throw new IllegalArgumentException("stream has unknown blob property version " + version); } long ttl = stream.readLong(); boolean isPrivate = stream.readByte() == 1; long creationTime = stream.readLong(); long blobSize = stream.readLong(); String contentType = Utils.readIntString(stream); String ownerId = Utils.readIntString(stream); String serviceId = Utils.readIntString(stream); short accountId = version > VERSION_1 ? stream.readShort() : Account.UNKNOWN_ACCOUNT_ID; short containerId = version > VERSION_1 ? stream.readShort() : Container.UNKNOWN_CONTAINER_ID; boolean isEncrypted = version > VERSION_2 && stream.readByte() == (byte) 1; return new BlobProperties(blobSize, serviceId, ownerId, contentType, isPrivate, ttl, creationTime, accountId, containerId, isEncrypted); }
Source:
<code>private boolean updateNumberRuns(AppAggregationKey appAggKey, HTable aggTable, JobDetails jobDetails) throws IOException { byte[] rowKey = aggConv.toBytes(appAggKey); Get g = new Get(rowKey); g.addColumn(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.NUMBER_RUNS_BYTES); byte[] numberRowsCol = Bytes.toBytes(jobDetails.getJobKey().getRunId()); g.addColumn(AggregationConstants.SCRATCH_FAM_BYTES, numberRowsCol); Result r = aggTable.get(g); <START> LOG.trace(" jobkey " + jobDetails.getJobKey().toString() <END> + " runid in updateNumberRuns " + jobDetails.getJobKey().getRunId()); long numberRuns = getNumberRunsScratch(r.getFamilyMap (AggregationConstants.SCRATCH_FAM_BYTES)); if (numberRuns == 1L) { return incrNumberRuns(r.getColumn (AggregationConstants.INFO_FAM_BYTES, AggregationConstants.NUMBER_RUNS_BYTES), aggTable, appAggKey); } else { return true; } }</code><technical_language>if (LOG.isTraceEnabled())</technical_language>

Target:
private boolean updateNumberRuns(AppAggregationKey appAggKey, HTable aggTable, JobDetails jobDetails) throws IOException { byte[] rowKey = aggConv.toBytes(appAggKey); Get g = new Get(rowKey); g.addColumn(AggregationConstants.INFO_FAM_BYTES, AggregationConstants.NUMBER_RUNS_BYTES); byte[] numberRowsCol = Bytes.toBytes(jobDetails.getJobKey().getRunId()); g.addColumn(AggregationConstants.SCRATCH_FAM_BYTES, numberRowsCol); Result r = aggTable.get(g); if (LOG.isTraceEnabled()) { LOG.trace(" jobkey " + jobDetails.getJobKey().toString() + " runid in updateNumberRuns " + jobDetails.getJobKey().getRunId()); } long numberRuns = getNumberRunsScratch(r.getFamilyMap (AggregationConstants.SCRATCH_FAM_BYTES)); if (numberRuns == 1L) { return incrNumberRuns(r.getColumn (AggregationConstants.INFO_FAM_BYTES, AggregationConstants.NUMBER_RUNS_BYTES), aggTable, appAggKey); } else { return true; } }
Source:
<code>private AnnotationProcessorConstraintTarget getConstraintTarget(AnnotationMirror annotation) { AnnotationValue validationAppliesTo = annotationApiHelper.getAnnotationValue( annotation, "validationAppliesTo" ); if(validationAppliesTo==null) { for(Element e : annotation.getAnnotationType().asElement().getEnclosedElements()) { Boolean isValidationAppliesToMethod = e.accept( new ElementKindVisitor6<Boolean, Void>() { @Override public Boolean visitExecutableAsMethod(ExecutableElement e, Void p) { if(e.getSimpleName().contentEquals( "validationAppliesTo" )) { return true; } <START> return super.visitExecutableAsMethod( e, p ); <END> } }, null ); if(Boolean.TRUE.equals( isValidationAppliesToMethod )) { return AnnotationProcessorConstraintTarget.IMPLICIT; } } return null; } return validationAppliesTo.accept( new SimpleAnnotationValueVisitor6<AnnotationProcessorConstraintTarget, Void>() { private TypeMirror constraintTargetMirror = annotationApiHelper.getDeclaredTypeByName( "javax.validation.ConstraintTarget" ); @Override public AnnotationProcessorConstraintTarget visitEnumConstant(VariableElement c, Void p) { if(typeUtils.isSameType( c.asType(), constraintTargetMirror )) { return AnnotationProcessorConstraintTarget.valueOf( c.getSimpleName().toString() ); } return null; } }, null ); }</code><technical_language>Is needed</technical_language>

Target:
private AnnotationProcessorConstraintTarget getConstraintTarget(AnnotationMirror annotation) { AnnotationValue validationAppliesTo = annotationApiHelper.getAnnotationValue( annotation, "validationAppliesTo" ); if(validationAppliesTo==null) { for(Element e : annotation.getAnnotationType().asElement().getEnclosedElements()) { Boolean isValidationAppliesToMethod = e.accept( new ElementKindVisitor6<Boolean, Void>() { @Override public Boolean visitExecutableAsMethod(ExecutableElement e, Void p) { if(e.getSimpleName().contentEquals( "validationAppliesTo" )) { return true; } return false; } }, null ); if(Boolean.TRUE.equals( isValidationAppliesToMethod )) { return AnnotationProcessorConstraintTarget.IMPLICIT; } } return null; } return validationAppliesTo.accept( new SimpleAnnotationValueVisitor6<AnnotationProcessorConstraintTarget, Void>() { private TypeMirror constraintTargetMirror = annotationApiHelper.getDeclaredTypeByName( BeanValidationTypes.CONSTRAINT_TARGET ); @Override public AnnotationProcessorConstraintTarget visitEnumConstant(VariableElement c, Void p) { if(typeUtils.isSameType( c.asType(), constraintTargetMirror )) { return AnnotationProcessorConstraintTarget.valueOf( c.getSimpleName().toString() ); } return null; } }, null ); }
Source:
<code>protected void showDialog(Bundle state) { <START> super.showDialog(state); <END> updateSaveButtonState(); }</code><technical_language>avoid showing dialog calling superclass implementation here. more checking in SettingsFragment ;)</technical_language>

Target:
protected void showDialog(Bundle state) { WifiConfiguration[] networks = loadConfiguredNetworksSorted(); if (networks != null) { Set<String> selected = getSharedPreferences().getStringSet(getKey(), new HashSet<String>()); selected = new HashSet<>(selected); CharSequence[] all = extractSsid(networks, false); filterRemovedNetworks(selected, all); setEntries(extractSsid(networks, true)); setEntryValues(all); setValues(selected); super.showDialog(state); } else { Toast.makeText(getContext(), R.string.sync_only_wifi_ssids_wifi_turn_on_wifi, Toast.LENGTH_LONG).show(); } }
Source:
<code>public double getBatteryResistance() { try { return getBatteryResistanceSafely(); } catch (InvalidSensorException e) { LogKitten.ex(e); <START> return 80.0; END> } }</code><technical_language>cachedResistance here? consistently cachedResistance 80.0 methods I</technical_language>

Target:
public double getBatteryResistance() { try { return getBatteryResistanceSafely(); } catch (InvalidSensorException e) { LogKitten.ex(e); return cachedResistance; } }
Source:
<code>public Collection<ActiveRuleDto> selectByRulesAndRuleProfileUuids(DbSession dbSession, Collection<RuleDefinitionDto> rules, Collection<String> ruleProfileUuids) { <START> if (rules.isEmpty()) { <END> return emptyList(); } checkArgument(rules.size() < PARTITION_SIZE_FOR_ORACLE, "too many rules (got %s, max is %s)", rules.size(), PARTITION_SIZE_FOR_ORACLE); List<Integer> ruleIds = rules.stream().map(RuleDefinitionDto::getId).collect(MoreCollectors.toArrayList(rules.size())); return executeLargeInputs(ruleProfileUuids, chunk -> mapper(dbSession).selectByRuleIdsAndRuleProfileUuids(ruleIds, chunk)); }</code><technical_language>if ruleProfileUuids is empty? return immediately too</technical_language>

Target:
public Collection<ActiveRuleDto> selectByRulesAndRuleProfileUuids(DbSession dbSession, Collection<RuleDefinitionDto> rules, Collection<String> ruleProfileUuids) { if (rules.isEmpty() || ruleProfileUuids.isEmpty()) { return emptyList(); } List<Integer> ruleIds = rules.stream().map(RuleDefinitionDto::getId).collect(MoreCollectors.toArrayList(rules.size())); ActiveRuleMapper mapper = mapper(dbSession); return executeLargeInputs(ruleIds, ruleIdsChunk -> executeLargeInputs(ruleProfileUuids, chunk -> mapper.selectByRuleIdsAndRuleProfileUuids(ruleIdsChunk, chunk))); }
Source:
<code>public String resolve(HttpServletRequest request) { String authorizationHeaderToken = resolveFromAuthorizationHeader(request); <START> String parameterToken = request.getParameter("access_token"); <END> if (authorizationHeaderToken != null) { if (parameterToken != null) { BearerTokenError error = new BearerTokenError(BearerTokenErrorCodes.INVALID_REQUEST, HttpStatus.BAD_REQUEST, "Found multiple bearer tokens in the request", "<LINK_0>"); throw new OAuth2AuthenticationException(error); } return authorizationHeaderToken; } else if (parameterToken != null && isParameterTokenSupportedForRequest(request)) { return parameterToken; } return null; }</code><technical_language>fail if parameter is included twice. This checked request.getParameterValues("access_token")</technical_language>

Target:
public String resolve(HttpServletRequest request) { String authorizationHeaderToken = resolveFromAuthorizationHeader(request); String parameterToken = resolveFromRequestParameters(request); if (authorizationHeaderToken != null) { if (parameterToken != null) { BearerTokenError error = new BearerTokenError(BearerTokenErrorCodes.INVALID_REQUEST, HttpStatus.BAD_REQUEST, "Found multiple bearer tokens in the request", "<LINK_0>"); throw new OAuth2AuthenticationException(error); } return authorizationHeaderToken; } else if (parameterToken != null && isParameterTokenSupportedForRequest(request)) { return parameterToken; } return null; }
Source:
<code>public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_INCOME_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public RiemannOutputPlugin( @JsonProperty("flushInterval") Optional<Long> flushInterval, @JsonProperty("protocol") ProtocolFactory protocol, @JsonProperty("retry") RetryPolicy retry, @JsonProperty("filter") Optional<Filter> filter ) { super("", filter, <START> flushInterval.isPresent() ? flushInterval : Optional.of(DEFAULT_FLUSH_INTERVAL)); <END> this.protocol = Optional .ofNullable(protocol) .orElseGet(ProtocolFactory.defaultFor()) .protocol(DEFAULT_PROTOCOL, DEFAULT_PORT); this.protocolClient = parseProtocolClient(); this.retry = Optional.ofNullable(retry).orElseGet(RetryPolicy.Exponential::new); }</code><technical_language>This wrong. DEFAULT_FLUSH_INTERVAL == 0 effect absent. unrelated did, mucking around, fix it</technical_language>

Target:
public RiemannOutputPlugin( @JsonProperty("flushInterval") Optional<Long> flushInterval, @JsonProperty("protocol") ProtocolFactory protocol, @JsonProperty("retry") RetryPolicy retry, @JsonProperty("filter") Optional<Filter> filter ) { super(filter, flushInterval); this.protocol = Optional .ofNullable(protocol) .orElseGet(ProtocolFactory.defaultFor()) .protocol(DEFAULT_PROTOCOL, DEFAULT_PORT); this.protocolClient = parseProtocolClient(); this.retry = Optional.ofNullable(retry).orElseGet(RetryPolicy.Exponential::new); }
Source:
<code>private boolean isIgnoringSomething() { <START> return ignoreBadRelationships | ignoreDuplicateNodes | ignoreExtraColumns; <END> }</code><technical_language>Is a reason want do bitwise instead of || want explicitly avoid short-circuiting</technical_language>

Target:
private boolean isIgnoringSomething() { return ignoreBadRelationships || ignoreDuplicateNodes || ignoreExtraColumns; }
Source:
<code><START> public static boolean textContains(String actual, String text, boolean ignoreCase) { <END> return ignoreCase ? StringUtils.containsIgnoreCase(actual, text) : StringUtils.contains(actual, text); }</code><technical_language>I personally a reason declare methods public hurt</technical_language>

Target:
private boolean textContains(String actual, String text, boolean ignoreCase) { return ignoreCase ? StringUtils.containsIgnoreCase(actual, text) : StringUtils.contains(actual, text); }
Source:
<code>public Event complianceCreated(Consumer consumer, Set<Entitlement> entitlements, ComplianceStatus compliance) { return new Event(Event.Type.CREATED, Event.Target.COMPLIANCE, consumer.getName(), principalProvider.get(), consumer.getOwner().getId(), consumer.getUuid(), <START> consumer.getId(), null, buildComplianceDataJson(consumer, entitlements, compliance), null, <END> null); }</code><technical_language>need usage of consumer.getId() replaced consumer.getUuid() well</technical_language>

Target:
public Event complianceCreated(Consumer consumer, Set<Entitlement> entitlements, ComplianceStatus compliance) { return new Event(Event.Type.CREATED, Event.Target.COMPLIANCE, consumer.getName(), principalProvider.get(), consumer.getOwner().getId(), consumer.getUuid(), consumer.getUuid(), null, buildComplianceDataJson(consumer, entitlements, compliance), null, null); }
Source:
<code>public void modifyJob() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final String bucketName = "test_modify_job"; try { client.putBucket(new PutBucketRequest(bucketName)); List<Ds3Object> objects = new ArrayList<>(); final File objFile = ResourceUtils.loadFileResource("books/beowulf.txt"); final Ds3Object obj = new Ds3Object("beowulf.txt", objFile.length()); objects.add(obj); WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); <START> Ds3ClientHelpers.Job job = com.spectralogic.ds3client.helpers.Ds3ClientHelpers <END> .wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJob(new ModifyJobRequest(job.getJobId()).withPriority(Priority.HIGH)); GetJobResponse response = client.getJob(new GetJobRequest(job.getJobId())); assertThat(response.getMasterObjectList().getPriority(), is(Priority.HIGH)); } finally { Util.deleteAllContents(client, bucketName); } }</code><technical_language>Missing final</technical_language>

Target:
public void modifyJob() throws IOException, SignatureException, XmlProcessingException, URISyntaxException { final String bucketName = "test_modify_job"; try { client.putBucket(new PutBucketRequest(bucketName)); final List<Ds3Object> objects = new ArrayList<>(); final Ds3Object obj = new Ds3Object("test", 2); objects.add(obj); final WriteJobOptions jobOptions = WriteJobOptions.create().withPriority(Priority.LOW); final Ds3ClientHelpers.Job job = com.spectralogic.ds3client.helpers.Ds3ClientHelpers .wrap(client).startWriteJob(bucketName, objects, jobOptions); client.modifyJob(new ModifyJobRequest(job.getJobId()).withPriority(Priority.HIGH)); final GetJobResponse response = client.getJob(new GetJobRequest(job.getJobId())); assertThat(response.getMasterObjectList().getPriority(), is(Priority.HIGH)); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
<code>public Result configuration(String configuration_id) { RecipeViewModel viewModel = new RecipeViewModel(); <START> FrontEndDatabase f = new FrontEndDatabase(); <END> String[] configInfo = f.getConfigInformation(Integer.parseInt(configuration_id)); models.Configuration conf = new models.Configuration(configInfo[0], configInfo[1], configInfo[2], configInfo[3], configInfo[4], configInfo[5]); List<Record> records = new ArrayList<>(); records.add(new Record("date", "comment", "repo", "author",95.1)); records.add(new Record("date2", "comment", "repo", "author",36.1)); records.add(new Record("date3", "comment", "repo", "author",97.1)); conf.records = records; viewModel.configuration = conf; viewModel.history = "history B"; return ok(recipe.render(viewModel)); }</code><technical_language>Im sense create a new instance of this time. a class variable lazy instantiation</technical_language>

Target:
public Result configuration(String configuration_id) { RecipeViewModel viewModel = new RecipeViewModel(); FrontEndDatabase f = new FrontEndDatabase(); models.Configuration conf = f.getConfigInformation(Integer.parseInt(configuration_id)); List<Record> records = new ArrayList<>(); records.add(new Record("date", "comment", "repo", "author",95.1)); records.add(new Record("date2", "comment", "repo", "author",36.1)); records.add(new Record("date3", "comment", "repo", "author",97.1)); conf.records = records; viewModel.configuration = conf; viewModel.history = "history B"; return ok(recipe.render(viewModel)); }
Source:
<code>protected BatchInsert newBatchInsert(PluginTask task, Optional<MergeConfig> mergeConfig) throws IOException, SQLException { if (mergeConfig.isPresent()) { throw new UnsupportedOperationException("Redshift output plugin doesn't support 'merge_direct' mode. Use 'merge' mode instead."); } RedshiftPluginTask t = (RedshiftPluginTask) task; setAWSCredentialsBackwardCompatibility(t); return new RedshiftCopyBatchInsert(getConnector(task, true), <START> getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName(), t.getDeleteS3TempFile(), t.getCopyIamRoleName().or(""), t.getCopyAwsAccountId().or("")); <END> }</code><technical_language>or("") orNull() default is defined null</technical_language>

Target:
protected BatchInsert newBatchInsert(PluginTask task, Optional<MergeConfig> mergeConfig) throws IOException, SQLException { if (mergeConfig.isPresent()) { throw new UnsupportedOperationException("Redshift output plugin doesn't support 'merge_direct' mode. Use 'merge' mode instead."); } RedshiftPluginTask t = (RedshiftPluginTask) task; setAWSCredentialsBackwardCompatibility(t); return new RedshiftCopyBatchInsert(getConnector(task, true), getAWSCredentialsProvider(t), t.getS3Bucket(), t.getS3KeyPrefix(), t.getIamUserName(), t.getDeleteS3TempFile(), t.getCopyIamRoleName().orNull(), t.getCopyAwsAccountId().orNull()); }
Source:
<code>public void setUp() { generator = new LargeCommitWarningGenerator(repositoriesApi); when(commit.getRepository()).thenReturn(configurable); when(commit.getRepository().getRepositoryName()).thenReturn(REPOSITORY_NAME); when(commit.getCommitId()).thenReturn(COMMIT_ID); when(commit.isMerge()).thenReturn(false); when(abstractCommitWarningGenerator.getRepository(commit)).thenReturn(repositoryApi); when(abstractCommitWarningGenerator.getGitCommit(commit)).thenReturn(commitApi); when(repositoriesApi.getRepository(REPOSITORY_NAME)).thenReturn(repositoryApi); when(repositoryApi.getCommit(COMMIT_ID)).thenReturn(commitApi); when(commitApi.diff()).thenReturn(diffModel); when(diffModel.getDiffs()).thenReturn(diffs); when(diffs.stream()).thenReturn(stream); when(stream.filter(anyObject())).thenReturn(stream); when(stream.flatMap(anyObject())).thenReturn(objectStream); <START> when(objectStream.flatMap(anyObject())).thenReturn(objectStream); <END> when(objectStream.filter(anyObject())).thenReturn(objectStream); LargeCommitWarning warning = new LargeCommitWarning(); warning.setCommit(commit); testEquals = Sets.newHashSet(warning); }</code><technical_language>avoid complex stubs well, test a bit more stable, changes LargeCommitWarningGenerator start underlying Collection interface differently require new specific stubs</technical_language>

Target:
public void setUp() throws IOException { generator = new LargeCommitWarningGenerator(repositoriesApi); repository = new PrivateRepository(); repository.setRepositoryName(REPOSITORY_NAME); commit = new Commit(); commit.setRepository(repository); commit.setCommitId(COMMIT_ID); commit.setParents(Lists.newArrayList()); diffModel = new DiffModel(); when(repositoriesApi.getRepository(anyString())).thenReturn(repositoryApi); when(repositoryApi.getCommit(anyString())).thenReturn(commitApi); when(commitApi.diff()).thenReturn(diffModel); ObjectMapper mapper = new ObjectMapper(); diffFile = mapper.readValue( LargeCommitWarningGeneratorTest.class.getResourceAsStream("/test-diff.json"), AbstractDiffModel.DiffFile.class ); diffModel.setDiffs(Lists.newArrayList(diffFile)); LargeCommitWarning warning = new LargeCommitWarning(); warning.setCommit(commit); testEquals = Sets.newHashSet(warning); }
Source:
<code>public KnoxShellTable url(String url) throws IOException { int rowIndex = 0; KnoxShellTable table = null; URL urlToCsv = new URL(url); URLConnection connection = urlToCsv.openConnection(); <START> try (BufferedReader csvReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8));) { <END> table = new KnoxShellTable(); if (title != null) { table.title(title); } table.id(id); String row = null; while ((row = csvReader.readLine()) != null) { boolean addingHeaders = (withHeaders && rowIndex == 0); if (!addingHeaders) { table.row(); } String[] data = row.split(","); for (String value : data) { if (addingHeaders) { table.header(value); } else { table.value(value); } } rowIndex++; } } return table; }</code><technical_language>new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8)) closed separately I think. want wrap in another try-with-resources? BufferedReader closes inputreader</technical_language>

Target:
public KnoxShellTable url(String url) throws IOException { int rowIndex = 0; KnoxShellTable table = null; URL urlToCsv = new URL(url); URLConnection connection = urlToCsv.openConnection(); try (Reader urlConnectionStreamReader = new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8); BufferedReader csvReader = new BufferedReader(urlConnectionStreamReader);) { table = new KnoxShellTable(); if (title != null) { table.title(title); } table.id(id); String row = null; while ((row = csvReader.readLine()) != null) { boolean addingHeaders = (withHeaders && rowIndex == 0); if (!addingHeaders) { table.row(); } String[] data = row.split(","); for (String value : data) { if (addingHeaders) { table.header(value); } else { table.value(value); } } rowIndex++; } } return table; }
Source:
<code><START> private void verifyThemeDirectoryExistence() throws ExecutionFailedException { <END> File themesDir = new File (frontendDirectory, APP_THEMES_FOLDER_NAME); File customThemeDir = new File (themesDir, theme.getName()); if (!customThemeDir.exists()) { String errorMessage = "Discovered @Theme(\"%s\") annotation but " + "no \"%s/%s/%s/\" directory present in the " + "project or available or inside a jar dependency for the " + "app. Check if you forgot to create the folder or have " + "typo in the theme or folder name \"%s\"."; throw new ExecutionFailedException(String.format(errorMessage, theme.getName(), frontendDirectory.getName(), APP_THEMES_FOLDER_NAME, theme.getName(), theme.getName())); } }</code><technical_language>Nit: method in String themeName theme.getName() in places</technical_language>

Target:
private void verifyThemeDirectoryExistence() throws ExecutionFailedException { String themeName = theme.getName(); String themePath = String.join("/", APPLICATION_THEME_ROOT, themeName); List<String> appThemePossiblePaths = getAppThemePossiblePaths( themePath); List<File> existingAppThemeDirectories = appThemePossiblePaths.stream() .map(path -> new File(npmFolder, path)) .filter(File::exists) .collect(Collectors.toList()); if (existingAppThemeDirectories.isEmpty()) { String errorMessage = "Discovered @Theme annotation with theme " + "name '%s', but could not find the theme directory " + "in the project or available as a jar dependency. " + "Check if you forgot to create the folder under '%s' " + "or have mistyped the theme or folder name for '%s'."; throw new ExecutionFailedException( String.format(errorMessage, themeName, new File(frontendDirectory, APPLICATION_THEME_ROOT) .getPath(), themeName)); } if (existingAppThemeDirectories.size() >= 2) { boolean themeFoundInJar = existingAppThemeDirectories .stream().map(File::getPath) .anyMatch(path -> path .contains(FrontendUtils.FLOW_NPM_PACKAGE_NAME)); if (themeFoundInJar) { String errorMessage = "Theme '%s' should not exist inside a " + "jar and in the project at the same time.%n" + "Extending another theme is possible by adding " + "{ \"parent\": \"your-parent-theme\" } entry to the " + "'theme.json' file inside your theme folder."; throw new ExecutionFailedException( String.format(errorMessage, themeName)); } else { String errorMessage = "Discovered Theme folder for theme '%s' " + "in more than one place in the project. Please " + "make sure there is only one theme folder with name " + "'%s' exists in the your project. " + "The recommended place to put the theme folder " + "inside the project is '%s'"; throw new ExecutionFailedException(String.format(errorMessage, themeName, themeName, new File(frontendDirectory, APPLICATION_THEME_ROOT) .getPath())); } } }
Source:
<code>public void copyColumnsFrom(QueryModel other) { clearColumnMapStructs(); this.aliasToColumnMap.putAll(other.aliasToColumnMap); ObjList<CharSequence> columnNames = other.bottomUpColumnNames; this.bottomUpColumnNames.addAll(columnNames); for (int i = 0, n = columnNames.size(); i < n; i++) { final CharSequence name = columnNames.getQuick(i); <START> this.aliasToColumnNameMap.put(Chars.toLowerCase(name), Chars.toLowerCase(name)); <END> } }</code><technical_language>unnecessary toLowerCase()</technical_language>

Target:
public void copyColumnsFrom(QueryModel other) { clearColumnMapStructs(); this.aliasToColumnMap.putAll(other.aliasToColumnMap); ObjList<CharSequence> columnNames = other.bottomUpColumnNames; this.bottomUpColumnNames.addAll(columnNames); for (int i = 0, n = columnNames.size(); i < n; i++) { final CharSequence name = columnNames.getQuick(i); this.aliasToColumnNameMap.put(name, name); } }
Source:
<code>protected boolean canDoAction() { if (getVmTemplate() != null) { setDescription(getVmTemplateName()); } <START> <END> if (!VmTemplateHandler.verifyVmTemplateStatusForUse(getVmTemplateId(), false)) { getReturnValue().getCanDoActionMessages() .add(VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString()); } StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); boolean retVal = storageDomainValidator.isDomainExistAndActive(getReturnValue().getCanDoActionMessages()); if (retVal) { if (getStorageDomain().getstorage_domain_type() != StorageDomainType.ImportExport) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SPECIFY_DOMAIN_IS_NOT_EXPORT_DOMAIN); retVal = false; } } retVal = retVal && super.canDoAction(); if (retVal && !getParameters().getForceOverride()) { retVal = !ExportVmCommand.CheckTemplateInStorageDomain(getVmTemplate().getstorage_pool_id().getValue(), getParameters().getStorageDomainId(), getVmTemplateId()); if (!retVal) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NAME_ALREADY_EXISTS); } } return retVal; }</code><technical_language>check is useless, is done in canDoAction()</technical_language>

Target:
protected boolean canDoAction() { if (getVmTemplate() != null) { setDescription(getVmTemplateName()); } if (!VmTemplateHandler.isTemplateStatusIsNotLocked(getVmTemplateId())) { getReturnValue().getCanDoActionMessages() .add(VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString()); } StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); boolean retVal = storageDomainValidator.isDomainExistAndActive(getReturnValue().getCanDoActionMessages()); if (retVal) { if (getStorageDomain().getstorage_domain_type() != StorageDomainType.ImportExport) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SPECIFY_DOMAIN_IS_NOT_EXPORT_DOMAIN); retVal = false; } } retVal = retVal && super.canDoAction(); if (retVal && !getParameters().getForceOverride()) { retVal = !ExportVmCommand.CheckTemplateInStorageDomain(getVmTemplate().getstorage_pool_id().getValue(), getParameters().getStorageDomainId(), getVmTemplateId()); if (!retVal) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NAME_ALREADY_EXISTS); } } return retVal; }
Source:
<code>public List<String> buildDirtyList(Map<String, String> pathVars, HttpServletRequest request, String id) { List<String> dirtyList = new ArrayList<>(); String sectionKey = getSectionKey(pathVars); String sectionClassName = getClassNameForSection(sectionKey); List<SectionCrumb> sectionCrumbs = getSectionCrumbs(request, sectionKey, id); PersistencePackageRequest ppr = getSectionPersistencePackageRequest(sectionClassName, sectionCrumbs, pathVars); ClassMetadata cmd = null; Entity entity = null; <START> try { <END> cmd = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData(); entity = service.getRecord(ppr, id, cmd, false).getDynamicResultSet().getRecords()[0]; } catch (ServiceException e) { return null; } for (Property p: entity.getProperties()) { if (p.getIsDirty()) { dirtyList.add(p.getName()); } } return dirtyList; }</code><technical_language>I put this in a try/catch block. Instead, mark method throws ServiceException caller handle (in this case, saveEntityJson() is marked throws Exception</technical_language>

Target:
public List<String> buildDirtyList(Map<String, String> pathVars, HttpServletRequest request, String id) throws ServiceException { List<String> dirtyList = new ArrayList<>(); String sectionKey = getSectionKey(pathVars); String sectionClassName = getClassNameForSection(sectionKey); List<SectionCrumb> sectionCrumbs = getSectionCrumbs(request, sectionKey, id); PersistencePackageRequest ppr = getSectionPersistencePackageRequest(sectionClassName, sectionCrumbs, pathVars); ClassMetadata cmd = null; Entity entity = null; cmd = service.getClassMetadata(ppr).getDynamicResultSet().getClassMetaData(); entity = service.getRecord(ppr, id, cmd, false).getDynamicResultSet().getRecords()[0]; for (Property p: entity.getProperties()) { if (p.getIsDirty()) { dirtyList.add(p.getName()); } } return dirtyList; }
Source:
<code>public void add(Expression expression) { if (fExpressions == null) fExpressions= new <START> ArrayList<Expression>(2); <END> fExpressions.add(expression); }</code><technical_language>A diamond operator suffice</technical_language>

Target:
public void add(Expression expression) { if (fExpressions == null) fExpressions= new ArrayList<>(2); fExpressions.add(expression); }
Source:
<code>public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order order : ordersPlaced) { <START> if (((order instanceof BuyOrder) && (newOrder instanceof BuyOrder)) || ((order instanceof SellOrder) && (newOrder instanceof SellOrder))) <END> { if (order.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }</code><technical_language>long if, split 2 ifs</technical_language>

Target:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order order : ordersPlaced) { if (((order instanceof BuyOrder) && (newOrder instanceof BuyOrder)) or if ((order instanceof SellOrder) && (newOrder instanceof SellOrder))) { if (order.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }
Source:
<code>public boolean filterParse(String text) { try { return classify(text); } catch (IOException e) { <START> LOG.error("Error occured while classifying:: " + text); <END> } return false; }</code><technical_language>print e's stack trace too</technical_language>

Target:
public boolean filterParse(String text) { try { return classify(text); } catch (IOException e) { LOG.error("Error occured while classifying:: " + text); e.printStackTrace(); } return false; }
Source:
<code>public void zeroDepthObjects() throws Exception { generator = new GraphQlGenerator(getHtml("zeroDepthObjects.graphql"), null, param); String query = generator.generateFull(GraphQlGenerator.RequestType.QUERY); <START> query = query.replaceAll("\\s+", " ").trim(); <END> String expectedQuery = "{ gymName dumbbell { fixedWeight weight } treadmill { maxSpeed manufacturer } }"; assertEquals(query, expectedQuery); }</code><technical_language>t this is done in test. done in code somewhere? issue generator</technical_language>

Target:
public void zeroDepthObjects() throws Exception { generator = new GraphQlGenerator(getHtml("zeroDepthObjects.graphql"), null, param); String query = generator.generateFull(GraphQlGenerator.RequestType.QUERY); String expectedQuery = "{ gymName dumbbell { fixedWeight weight } treadmill { maxSpeed manufacturer } } "; assertEquals(query, expectedQuery); }
Source:
<code>public Hardware apply(final MachineTypeInZone input) { Location location = checkNotNull(getOnlyElement(filter(locations.get().values(), new Predicate<Location>() { @Override public boolean apply(Location l) { return l.getId().equals(input.getMachineType().getZone()); } <START> })), "location for %s", input.getMachineType().getZone()); <END> return new HardwareBuilder() .id(SlashEncodedIds.fromTwoIds(input.getMachineType().getZone(), input.getMachineType().getName()).slashEncode()) .location(location) .name(input.getMachineType().getName()) .hypervisor("kvm") .processor(new Processor(input.getMachineType().getGuestCpus(), 1.0)) .providerId(input.getMachineType().getId()) .ram(input.getMachineType().getMemoryMb()) .uri(input.getMachineType().getSelfLink()) .userMetadata(ImmutableMap.of("imageSpaceGb", Integer.toString(input.getMachineType().getImageSpaceGb()))) .volumes(collectVolumes(input.getMachineType())) .build(); }</code><technical_language>Break statements? Iterable<...> locations = filter(...) Location location = checkNotNull(getOnlyElement(locations), ...)</technical_language>

Target:
public Hardware apply(final MachineTypeInZone input) { Iterable<? extends Location> zonesForMachineType = filter(locations.get().values(), new Predicate<Location>() { @Override public boolean apply(Location l) { return l.getId().equals(input.getMachineType().getZone()); } }); Location location = checkNotNull(getOnlyElement(zonesForMachineType), "location for %s", input.getMachineType().getZone()); return new HardwareBuilder() .id(SlashEncodedIds.fromTwoIds(input.getMachineType().getZone(), input.getMachineType().getName()).slashEncode()) .location(location) .name(input.getMachineType().getName()) .hypervisor("kvm") .processor(new Processor(input.getMachineType().getGuestCpus(), 1.0)) .providerId(input.getMachineType().getId()) .ram(input.getMachineType().getMemoryMb()) .uri(input.getMachineType().getSelfLink()) .userMetadata(ImmutableMap.of("imageSpaceGb", Integer.toString(input.getMachineType().getImageSpaceGb()))) .volumes(collectVolumes(input.getMachineType())) .supportsImage(input.getMachineType().getImageSpaceGb() > 0 ? Predicates.<Image>alwaysTrue() : Predicates.<Image>alwaysFalse()) .build(); }
Source:
<code>public Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { if (Logs.INVOCATION.isDebugEnabled()) { <START> Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - staeful, clustered case, setting weakAffinity to targetAffinty = %s", targetAffinity); <END> } context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to URIAffintiy = %s", URIAffinity.forUri(destination)); } context.setWeakAffinity(URIAffinity.forUri(destination)); } } } return result; }</code><technical_language>Please, fix staeful typo</technical_language>

Target:
public Object handleInvocationResult(final EJBClientInvocationContext context) throws Exception { final Object result; try { result = context.getResult(); } catch (NoSuchEJBException | RequestSendFailedException e) { processMissingTarget(context); throw e; } final EJBLocator<?> locator = context.getLocator(); if (locator.isStateful() && locator.getAffinity() instanceof ClusterAffinity && context.getWeakAffinity() == Affinity.NONE) { final Affinity targetAffinity = context.getTargetAffinity(); if (targetAffinity != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to targetAffinty = %s", targetAffinity); } context.setWeakAffinity(targetAffinity); } else { final URI destination = context.getDestination(); if (destination != null) { if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("DiscoveryEJBClientInterceptor: calling handleInvocationResult - stateful, clustered case, setting weakAffinity to URIAffintiy = %s", URIAffinity.forUri(destination)); } context.setWeakAffinity(URIAffinity.forUri(destination)); } } } return result; }
Source:
<code>public static void main(String[] args) { final MyMessageProcessor myMessageProcessor = new MyMessageProcessor(); ServiceBusMultiSessionProcessorClient multiSessionProcessorClient = new ServiceBusClientBuilder() .connectionString("connectionString") <START> .multiSessionProcessor() <END> .processMessage((receivedMessage, sessionManager) -> myMessageProcessor.onMessage(receivedMessage, sessionManager)) .processError(serviceBusErrorContext -> myMessageProcessor.onError(serviceBusErrorContext)) .receiveMode(ReceiveMode.PEEK_LOCK) .queueName("<<queue-name>>") .buildMultiSessionProcessorClient(); System.out.println("Starting message processor"); multiSessionProcessorClient.start(); System.out.println("Stopping message processor"); multiSessionProcessorClient.stop(); System.out.println("Exiting process"); }</code><technical_language>do need multisession here, build() end</technical_language>

Target:
public static void main(String[] args) { final MyStorageMessageProcessor myMessageProcessor = new MyStorageMessageProcessor(); String connectionString = System.getenv("AZURE_SERVICEBUS_CONNECTION_STRING"); String queueName = System.getenv("AZURE_SERVICEBUS_QUEUE_NAME"); ServiceBusReceiverAsyncClient multiSessionReceiverAsyncClient = new ServiceBusClientBuilder() .connectionString(connectionString) .receiver() .receiveMode(ReceiveMode.RECEIVE_AND_DELETE) .queueName(queueName) .maxConcurrentSessions(1) .buildAsyncClient(); final ReceiveAsyncOptions options = new ReceiveAsyncOptions() .setEnableAutoComplete(false) .setMaxAutoRenewDuration(Duration.ofSeconds(20)); Disposable subscription = multiSessionReceiverAsyncClient.receiveMultiSession(options) .flatMap(receivedMessage -> { System.out.println("!!! Received Message seq no "+ receivedMessage.getSequenceNumber() +" SessionId " + receivedMessage.getSessionId() + " Data : " + new String (receivedMessage.getBody())); if (receivedMessage.isSessionError()) { System.out.println("!!! Error Message session id" + receivedMessage.getServiceBusErrorContext().getSessionId()); return Mono.empty(); } return Mono.empty(); }).subscribe(); System.out.println(" Waiting for message to arrive .. "); try { Thread.sleep(Duration.ofSeconds(3 * 60).toMillis()); } catch (InterruptedException ignored) { } System.out.println(" !!! Test DONE !!! "); subscription.dispose(); multiSessionReceiverAsyncClient.close(); }
Source:
<code>protected void internalInit(WebContext context) { CommonHelper.assertNotNull("ticketValidator", this.ticketValidator); if (this.ticketValidator instanceof InitializableObject) { <START> ((InitializableObject) this.ticketValidator).init(); <END> } }</code><technical_language>This is I initialize objects, I tend do differently right now: initialization handled component is initializable, another it; otherwise, initialization forgotten</technical_language>

Target:
protected void internalInit(WebContext context) { CommonHelper.assertNotNull("ticketValidator", this.ticketValidator); }
Source:
<code>public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException { checkUri(path); <START> URIStatus status = getStatus(path, options); <END> return openFileInStream(path, status, options); }</code><technical_language>check result of status.isFolder status.isCompleted here</technical_language>

Target:
public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException { checkUri(path); AlluxioConfiguration conf = mFsContext.getPathConf(path); URIStatus status = getStatus(path, FileSystemOptions.getStatusDefaults(conf).toBuilder() .setAccessMode(Bits.READ) .setUpdateTimestamps(options.getUpdateLastAccessTime()) .build()); if (status.isFolder()) { throw new OpenDirectoryException(path); } if (!status.isCompleted()) { throw new FileIncompleteException(path); } OpenFilePOptions mergedOptions = FileSystemOptions.openFileDefaults(conf) .toBuilder().mergeFrom(options).build(); InStreamOptions inStreamOptions = new InStreamOptions(status, mergedOptions, conf); return new FileInStream(status, inStreamOptions, mFsContext); }
Source:
<code>public void processPacketAESCM(ByteArrayBuffer pkt) { int ssrc = RawPacket.getSSRC(pkt); int seqNo = RawPacket.getSequenceNumber(pkt); long index = (((long) guessedROC) << 16) | seqNo; ivStore[0] = saltKey[0]; ivStore[1] = saltKey[1]; ivStore[2] = saltKey[2]; ivStore[3] = saltKey[3]; int i; for (i = 4; i < 8; i++) { ivStore[i] = (byte) ( (0xFF & (ssrc >> ((7 - i) * 8))) ^ saltKey[i] ); } for (i = 8; i < 14; i++) { ivStore[i] = (byte) ( (0xFF & (byte) (index >> ((13 - i) * 8))) ^ saltKey[i] ); } ivStore[14] = ivStore[15] = 0; int payloadOffset = RawPacket.getHeaderLength(pkt.getBuffer(), pkt.getOffset(), pkt.getLength()); <START> int payloadLength = pkt.getLength() - payloadOffset; <END> cipherCtr.process( pkt.getBuffer(), pkt.getOffset() + payloadOffset, payloadLength, ivStore); }</code><technical_language>of overloads of RawPacket.getPayloadLength if want</technical_language>

Target:
public void processPacketAESCM(ByteArrayBuffer pkt) { int ssrc = RawPacket.getSSRC(pkt); int seqNo = RawPacket.getSequenceNumber(pkt); long index = (((long) guessedROC) << 16) | seqNo; ivStore[0] = saltKey[0]; ivStore[1] = saltKey[1]; ivStore[2] = saltKey[2]; ivStore[3] = saltKey[3]; int i; for (i = 4; i < 8; i++) { ivStore[i] = (byte) ( (0xFF & (ssrc >> ((7 - i) * 8))) ^ saltKey[i] ); } for (i = 8; i < 14; i++) { ivStore[i] = (byte) ( (0xFF & (byte) (index >> ((13 - i) * 8))) ^ saltKey[i] ); } ivStore[14] = ivStore[15] = 0; int rtpHeaderLength = RawPacket.getHeaderLength( pkt.getBuffer(), pkt.getOffset(), pkt.getLength()); cipherCtr.process( pkt.getBuffer(), pkt.getOffset() + rtpHeaderLength, pkt.getLength() - rtpHeaderLength, ivStore); }
Source:
<code>private void decodeRowType6() throws IOException { <START> if(optionByteAligned) resetBuffer(); <END> decode2D(); }</code><technical_language>Code style: curly brackets, space if</technical_language>

Target:
private void decodeRowType6() throws IOException { if (optionByteAligned) { resetBuffer(); } decode2D(); }