auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void flushTransactions() { while(true) { if (canFlush()) { syncToDB = true; setReadyBuffer(); final BatchOperation batchOperation = omMetadataManager.getStore() .initBatchOperation(); readyBuffer.iterator().forEachRemaining((entry) -> { try { entry.getResponse().addToRocksDBBatch(omMetadataManager, batchOperation); } catch (IOException ex) { String message = "During flush to DB encountered error " + ex.getMessage(); ExitUtil.terminate(1, message); } }); try { omMetadataManager.getStore().commitBatchOperation(batchOperation); } catch (IOException ex) { String message = "During flush to DB encountered error " + ex.getMessage(); ExitUtil.terminate(1, message); } int flushedTransactionsSize = readyBuffer.size(); flushedTransactionCount.addAndGet(flushedTransactionsSize); flushIterations.incrementAndGet(); LOG.info("Sync Iteration flushed transactions in this iteration{}", flushIterations.get(), flushedTransactionsSize); readyBuffer.clear(); syncToDB = false; } } }

Target:
private void flushTransactions() { while(isRunning) { try { if (canFlush()) { setReadyBuffer(); final BatchOperation batchOperation = omMetadataManager.getStore() .initBatchOperation(); readyBuffer.iterator().forEachRemaining((entry) -> { try { entry.getResponse().addToDBBatch(omMetadataManager, batchOperation); } catch (IOException ex) { terminate(ex); } }); omMetadataManager.getStore().commitBatchOperation(batchOperation); int flushedTransactionsSize = readyBuffer.size(); flushedTransactionCount.addAndGet(flushedTransactionsSize); flushIterations.incrementAndGet(); LOG.debug("Sync Iteration flushed transactions in this " + "iteration{}", flushIterations.get(), flushedTransactionsSize); readyBuffer.clear(); } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); if (isRunning) { final String message = "OMDoubleBuffer flush thread " + Thread.currentThread().getName() + " encountered Interrupted " + "exception while running"; ExitUtils.terminate(1, message, ex, LOG); } else { LOG.info("OMDoubleBuffer flush thread " + Thread.currentThread().getName() + " is interrupted and will " + "exit. {}", Thread.currentThread().getName()); } } catch (IOException ex) { terminate(ex); } catch (Throwable t) { final String s = "OMDoubleBuffer flush thread" + Thread.currentThread().getName() + "encountered Throwable error"; ExitUtils.terminate(2, s, t, LOG); } } }
Source:
protected void validateCredentials(final UsernamePasswordCredentials credentials, final OAuthRegisteredService registeredService, final WebContext context) { val clientSecret = context.getRequestParameter(OAuth20Constants.CLIENT_SECRET).map(String::valueOf).orElse(StringUtils.EMPTY); if (!OAuth20Utils.checkClientSecret(registeredService, clientSecret, registeredServiceCipherExecutor)) { throw new CredentialsException("Bad secret for client identifier: " + credentials.getUsername()); } val codeVerifier = credentials.getPassword(); val code = context.getRequestParameter(OAuth20Constants.CODE) .map(String::valueOf).orElse(StringUtils.EMPTY); val token = this.ticketRegistry.getTicket(code, OAuthCode.class); if (token == null || token.isExpired()) { LOGGER.error("Provided code is either not found in the ticket registry or has expired", code); throw new CredentialsException("Invalid token: " + code); } val method = StringUtils.defaultString(token.getCodeChallengeMethod(), "plain"); val hash = calculateCodeVerifierHash(method, codeVerifier); if (!hash.equalsIgnoreCase(token.getCodeChallenge())) { LOGGER.error("Code verifier does not match the challenge [{}]", hash, token.getCodeChallenge()); throw new CredentialsException("Code verification does not match the challenge assigned to: " + token.getId()); } LOGGER.debug("Validated code verifier using verification method [{}]", method); }

Target:
protected void validateCredentials(final UsernamePasswordCredentials credentials, final OAuthRegisteredService registeredService, final WebContext context) { val clientSecret = context.getRequestParameter(OAuth20Constants.CLIENT_SECRET) .map(String::valueOf) .orElse(StringUtils.EMPTY); if (!OAuth20Utils.checkClientSecret(registeredService, clientSecret, getRegisteredServiceCipherExecutor())) { throw new CredentialsException("Client Credentials provided is not valid for registered service: " + registeredService.getName()); } val codeVerifier = credentials.getPassword(); val code = context.getRequestParameter(OAuth20Constants.CODE) .map(String::valueOf).orElse(StringUtils.EMPTY); val token = getTicketRegistry().getTicket(code, OAuthCode.class); if (token == null || token.isExpired()) { LOGGER.error("Provided code is either not found in the ticket registry or has expired", code); throw new CredentialsException("Invalid token: " + code); } val method = StringUtils.defaultString(token.getCodeChallengeMethod(), "plain"); val hash = calculateCodeVerifierHash(method, codeVerifier); if (!hash.equalsIgnoreCase(token.getCodeChallenge())) { LOGGER.error("Code verifier does not match the challenge [{}]", hash, token.getCodeChallenge()); throw new CredentialsException("Code verification does not match the challenge assigned to: " + token.getId()); } LOGGER.debug("Validated code verifier using verification method [{}]", method); }
Source:
private boolean isValidAfterCondition(IInvokedMethod method) { if (method.isTestMethod()) { return true; } return method.getTestMethod().isAfterClassConfiguration(); }

Target:
private boolean isValidAfterCondition(IInvokedMethod method) { return method.isTestMethod() || method.getTestMethod().isAfterClassConfiguration(); }
Source:
public static AssertionError argumentsAreDifferent(String wanted, List<String> actualCalls, List<Location> actualLocations) { if (actualCalls == null || actualLocations == null || actualCalls.size() != actualLocations.size()) { throw new IllegalArgumentException("actualCalls and actualLocations list must match"); } StringBuilder actualBuilder = new StringBuilder(); StringBuilder messageBuilder = new StringBuilder(); messageBuilder.append("\n"); messageBuilder.append("Argument(s) are different! Wanted:\n"); messageBuilder.append(wanted); messageBuilder.append("\n"); messageBuilder.append(new LocationImpl()); messageBuilder.append("\n"); messageBuilder.append("Actual invocations have different arguments:\n"); for (int i = 0; i < actualCalls.size(); i++) { actualBuilder.append(actualCalls.get(i)); messageBuilder.append(actualCalls.get(i)); messageBuilder.append("\n"); messageBuilder.append(actualLocations.get(i)); messageBuilder.append("\n"); } return ExceptionFactory.createArgumentsAreDifferentException(messageBuilder.toString(), wanted, actualBuilder.toString()); }

Target:
public static AssertionError argumentsAreDifferent(String wanted, List<String> actualCalls, List<Location> actualLocations) { if (actualCalls == null || actualLocations == null || actualCalls.size() != actualLocations.size()) { throw new IllegalArgumentException("actualCalls and actualLocations list must match"); } StringBuilder actualBuilder = new StringBuilder(); StringBuilder messageBuilder = new StringBuilder(); messageBuilder.append("\n") .append("Argument(s) are different! Wanted:\n") .append(wanted) .append("\n") .append(new LocationImpl()) .append("\n") .append("Actual invocations have different arguments:\n"); for (int i = 0; i < actualCalls.size(); i++) { actualBuilder.append(actualCalls.get(i)) .append("\n"); messageBuilder.append(actualCalls.get(i)) .append("\n") .append(actualLocations.get(i)) .append("\n"); } return ExceptionFactory.createArgumentsAreDifferentException(messageBuilder.toString(), wanted, actualBuilder.toString()); }
Source:
public static List<CPListElement> removeFilters(IPath path, IJavaProject project, List<CPListElement> existingEntries) { if (path == null) return Collections.emptyList(); IPath projPath= project.getPath(); if (projPath.isPrefixOf(path)) { path= path.removeFirstSegments(projPath.segmentCount()).addTrailingSeparator(); } List<CPListElement> result= new ArrayList<>(); for (CPListElement element : existingEntries) { boolean hasChange= false; IPath[] exlusions= (IPath[])element.getAttribute(CPListElement.EXCLUSION); if (exlusions != null) { List<IPath> exlusionList= new ArrayList<>(exlusions.length); for (IPath exlusion : exlusions) { if (!exlusion.equals(path)) { exlusionList.add(exlusion); } else { hasChange= true; } } element.setAttribute(CPListElement.EXCLUSION, exlusionList.toArray(new IPath[exlusionList.size()])); } IPath[] inclusion= (IPath[])element.getAttribute(CPListElement.INCLUSION); if (inclusion != null) { List<IPath> inclusionList= new ArrayList<>(inclusion.length); for (IPath i : inclusion) { if (!i.equals(path)) { inclusionList.add(i); } else { hasChange= true; } } element.setAttribute(CPListElement.INCLUSION, inclusionList.toArray(new IPath[inclusionList.size()])); } if (hasChange) { result.add(element); } } return result; }

Target:
public static List<CPListElement> removeFilters(IPath path, IJavaProject project, List<CPListElement> existingEntries) { if (path == null) return Collections.emptyList(); IPath projPath= project.getPath(); if (projPath.isPrefixOf(path)) { path= path.removeFirstSegments(projPath.segmentCount()).addTrailingSeparator(); } List<CPListElement> result= new ArrayList<>(); for (CPListElement element : existingEntries) { boolean hasChange= false; IPath[] exlusions= (IPath[])element.getAttribute(CPListElement.EXCLUSION); if (exlusions != null) { List<IPath> exlusionList= new ArrayList<>(exlusions.length); for (IPath exlusion : exlusions) { if (!exlusion.equals(path)) { exlusionList.add(exlusion); } else { hasChange= true; } } element.setAttribute(CPListElement.EXCLUSION, exlusionList.toArray(new IPath[exlusionList.size()])); } IPath[] inclusions= (IPath[])element.getAttribute(CPListElement.INCLUSION); if (inclusions != null) { List<IPath> inclusionList= new ArrayList<>(inclusions.length); for (IPath inclusion : inclusions) { if (!inclusion.equals(path)) { inclusionList.add(inclusion); } else { hasChange= true; } } element.setAttribute(CPListElement.INCLUSION, inclusionList.toArray(new IPath[inclusionList.size()])); } if (hasChange) { result.add(element); } } return result; }
Source:
protected String getEndpointId(Endpoint ep) { String answer = doGetEndpointId(ep); boolean sanitize = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getMask(); if (sanitize != null && sanitize) { answer = URISupport.sanitizeUri(answer); } return answer; }

Target:
protected String getEndpointId(Endpoint ep) { String answer = doGetEndpointId(ep); boolean sanitize = camelContext != null && camelContext.getManagementStrategy().getManagementAgent().getMask(); if (sanitize) { answer = URISupport.sanitizeUri(answer); } return answer; }
Source:
public RxSessionImpl(Session session) { this.session = session; maximumInflightRequests = Math.min( session.getCluster().getConfiguration().getPoolingOptions().getMaxRequestsPerConnection(HostDistance.LOCAL), session.getCluster().getConfiguration().getPoolingOptions().getMaxRequestsPerConnection(HostDistance.REMOTE) ); }

Target:
public RxSessionImpl(Session session) { this.session = session; this.loadBalancingPolicy = session.getCluster().getConfiguration().getPolicies().getLoadBalancingPolicy(); PoolingOptions poolingOptions = session.getCluster().getConfiguration().getPoolingOptions(); maxInFlightLocal = poolingOptions.getCoreConnectionsPerHost(HostDistance.LOCAL) * poolingOptions.getMaxRequestsPerConnection(HostDistance.LOCAL); maxInFlightRemote = poolingOptions.getCoreConnectionsPerHost(HostDistance.REMOTE) * poolingOptions.getMaxRequestsPerConnection(HostDistance.REMOTE); }
Source:
public List<Cue> getCues(long timeUs, Map<String, TtmlStyle> globalStyles, Map<String, TtmlRegion> regionMap, Map<String, String> imageMap) { TreeMap<String, SpannableStringBuilder> regionOutputs = new TreeMap<>(); List<Pair<String, String>> regionImageList = new ArrayList<>(); traverseForText(timeUs, false, regionId, regionOutputs); traverseForStyle(timeUs, globalStyles, regionOutputs); traverseForImage(timeUs, regionId, regionImageList); List<Cue> cues = new ArrayList<>(); for (Pair<String, String> regionImagePair : regionImageList) { String base64 = imageMap.get(regionImagePair.second); byte[] decodedString = Base64.decode(base64, Base64.DEFAULT); Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); TtmlRegion region = regionMap.get(regionImagePair.first); cues.add( new Cue(decodedByte, region.position, Cue.ANCHOR_TYPE_MIDDLE, region.line, region.lineAnchor, region.width, Cue.DIMEN_UNSET ) ); } for (Entry<String, SpannableStringBuilder> entry : regionOutputs.entrySet()) { TtmlRegion region = regionMap.get(entry.getKey()); cues.add( new Cue( cleanUpText(entry.getValue()), null, region.line, region.lineType, region.lineAnchor, region.position, Cue.TYPE_UNSET, region.width, region.textSizeType, region.textSize)); } return cues; }

Target:
public List<Cue> getCues(long timeUs, Map<String, TtmlStyle> globalStyles, Map<String, TtmlRegion> regionMap, Map<String, String> imageMap) { TreeMap<String, SpannableStringBuilder> regionTextOutputs = new TreeMap<>(); List<Pair<String, String>> regionImageOutputs = new ArrayList<>(); traverseForText(timeUs, false, regionId, regionTextOutputs); traverseForStyle(timeUs, globalStyles, regionTextOutputs); traverseForImage(timeUs, regionId, regionImageOutputs); List<Cue> cues = new ArrayList<>(); for (Pair<String, String> regionImagePair : regionImageOutputs) { String base64 = imageMap.get(regionImagePair.second); if (base64 == null) { continue; } byte[] decodedString = Base64.decode(base64, Base64.DEFAULT); Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); TtmlRegion region = regionMap.get(regionImagePair.first); cues.add( new Cue(decodedByte, region.position, Cue.ANCHOR_TYPE_MIDDLE, region.line, region.lineAnchor, region.width, Cue.DIMEN_UNSET ) ); } for (Entry<String, SpannableStringBuilder> entry : regionTextOutputs.entrySet()) { TtmlRegion region = regionMap.get(entry.getKey()); cues.add( new Cue( cleanUpText(entry.getValue()), null, region.line, region.lineType, region.lineAnchor, region.position, Cue.TYPE_UNSET, region.width, region.textSizeType, region.textSize)); } return cues; }
Source:
private void start() { for (InetAddress address : getAllInetAddresses()) { createJmDNSByAddress(address); } for (ServiceDescription description : activeServices) { try { registerService(description); } catch (IOException e) { } } }

Target:
private void start() { for (InetAddress address : getAllInetAddresses()) { createJmDNSByAddress(address); } for (ServiceDescription description : activeServices) { try { registerServiceInternal(description); } catch (IOException e) { logger.warn("Exception while registering service {}", description, e); } } }
Source:
public Set<GitObject> getTags() throws GitException, InterruptedException { ArgumentListBuilder args = new ArgumentListBuilder("show-ref", "--tags", "-d"); String result; try { result = launchCommandIn(args, workspace); } catch (GitException ge) { result = ""; } String[] output = result.split("[\\n\\r]"); if (output.length == 0 || (output.length == 1 && output[0].isEmpty())) { return new HashSet<>(); } Pattern pattern = Pattern.compile("(\\p{XDigit}{40})\\s+refs/tags/([^\\^]*)(\\^\\{\\})?"); Map<String, ObjectId> tagMap = new HashMap<>(); for (String line : output) { Matcher matcher = pattern.matcher(line); if (!matcher.find()) { String message = MessageFormat.format( "git show-ref --tags -d output not matched in line: {0}", line); listener.getLogger().println(message); continue; } String sha1String = matcher.group(1); String tagName = matcher.group(2); String trailingText = matcher.group(3); boolean isPeeledRef = false; if (trailingText != null && trailingText.equals("^{}")) { isPeeledRef = true; } if (isPeeledRef || !tagMap.containsKey(tagName)) { tagMap.put(tagName, ObjectId.fromString(sha1String)); } } Set<GitObject> tags = new HashSet<>(tagMap.size()); for (Map.Entry<String, ObjectId> entry : tagMap.entrySet()) { tags.add(new GitObject(entry.getKey(), entry.getValue())); } return tags; }

Target:
public Set<GitObject> getTags() throws GitException, InterruptedException { ArgumentListBuilder args = new ArgumentListBuilder("show-ref", "--tags", "-d"); String result; try { result = launchCommandIn(args, workspace); } catch (GitException ge) { result = ""; } String[] output = result.split("[\\n\\r]+"); if (output.length == 0 || (output.length == 1 && output[0].isEmpty())) { return Collections.EMPTY_SET; } Pattern pattern = Pattern.compile("(\\p{XDigit}{40})\\s+refs/tags/([^^]+)(\\^\\{\\})?"); Map<String, ObjectId> tagMap = new HashMap<>(); for (String line : output) { Matcher matcher = pattern.matcher(line); if (!matcher.find()) { String message = MessageFormat.format( "git show-ref --tags -d output not matched in line: {0}", line); listener.getLogger().println(message); continue; } String sha1String = matcher.group(1); String tagName = matcher.group(2); String trailingText = matcher.group(3); boolean isPeeledRef = false; if (trailingText != null && trailingText.equals("^{}")) { isPeeledRef = true; } if (isPeeledRef || !tagMap.containsKey(tagName)) { tagMap.put(tagName, ObjectId.fromString(sha1String)); } } Set<GitObject> tags = new HashSet<>(tagMap.size()); for (Map.Entry<String, ObjectId> entry : tagMap.entrySet()) { tags.add(new GitObject(entry.getKey(), entry.getValue())); } return tags; }
Source:
public boolean remove(Object o) { if (! (o instanceof AbstractDomainObject)) { return false; } if (contains(o)) { remove(((T)o).getOid()); return true; } else { return false; } }

Target:
public boolean remove(Object o) { if (! (o instanceof AbstractDomainObject)) { return false; } if (contains(o)) { removeKey(((T)o).getOid()); return true; } else { return false; } }
Source:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); try { RefDatabase refDb = git.getRefDatabase(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); RevCommit mergeBase; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); Ref targetRef = refDb.getRef(targetBranch); RevCommit target = rw.parseCommit(targetRef.getObjectId()); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } else { return true; } } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); for (Ref branch : branches) { if (!branch.getObjectId().equals(mergeBase)) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { return false; } } return true; } finally { rw.release(); } } finally { git.close(); } }

Target:
private boolean otherBranchCommit(Change change, PatchSet patchSet) throws RepositoryNotFoundException, IOException, PatchSetInfoNotAvailableException { Repository git = repoManager.openRepository(change.getProject()); String targetBranch = change.getDest().get(); try { RefDatabase refDb = git.getRefDatabase(); RevWalk rw = new RevWalk(git); RevCommit pushedCommit = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get())); RevCommit mergeBase; RevFilter oldRevFilter = rw.getRevFilter(); try { rw.reset(); rw.setRevFilter(RevFilter.MERGE_BASE); rw.markStart(pushedCommit); Ref targetRef = refDb.getRef(targetBranch); RevCommit target = rw.parseCommit(targetRef.getObjectId()); rw.markStart(target); if (rw.next() != null) { mergeBase = rw.next(); } else { return true; } } catch (IOException e) { throw new PatchSetInfoNotAvailableException(e); } finally { rw.reset(); rw.setRevFilter(oldRevFilter); } try { rw.markStart(pushedCommit); Collection<Ref> branches = refDb.getRefs(Constants.R_HEADS).values(); for (Ref branch : branches) { if (!branch.getObjectId().equals(mergeBase)) { rw.markUninteresting(rw.parseCommit(branch.getObjectId())); } } for (RevCommit n; (n = rw.next()) != null;) { if (n.equals(mergeBase)) { return false; } } return true; } catch (IOException e) { throw new PatchSetInfoNotAvailableException(e); } finally { rw.release(); } } catch (IOException e) { throw new PatchSetInfoNotAvailableException(e); } finally { git.close(); } }
Source:
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException, InterruptedException { String group = "LzoB64Lines of " + typeRef_.getRawClass().getName(); linesReadCounter = HadoopUtils.getCounter(context, group, "Lines Read"); recordsReadCounter = HadoopUtils.getCounter(context, group, "Records Read"); recordErrorsCounter = HadoopUtils.getCounter(context, group, "Errors"); emptyLinesCounter = HadoopUtils.getCounter(context, group, "Empty Lines"); truncatedLinesCounter = HadoopUtils.getCounter(context, group, "Truncated Lines"); recordsSkippedCounter = HadoopUtils.getCounter(context, group, "Null Records Skipped"); super.initialize(genericSplit, context); }

Target:
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException, InterruptedException { String group = "LzoB64Lines of " + typeRef_.getRawClass().getName(); linesReadCounter = HadoopUtils.getCounter(context, group, "Lines Read"); recordsReadCounter = HadoopUtils.getCounter(context, group, "Records Read"); recordErrorsCounter = HadoopUtils.getCounter(context, group, "Errors"); emptyLinesCounter = HadoopUtils.getCounter(context, group, "Empty Lines"); truncatedLinesCounter = HadoopUtils.getCounter(context, group, "Truncated Lines"); recordsSkippedCounter = HadoopUtils.getCounter(context, group, "Records Skipped by Converter"); super.initialize(genericSplit, context); }
Source:
public Response exportBranches(BranchExportOptions options) { setUpHttpHeaders(); List<IOseeBranch> branches = getExportImportBranches(options.getBranchUuids()); PropertyStore exportOptions = new PropertyStore(); addOption(exportOptions, ExportOptions.MIN_TXS, options.getMinTx()); addOption(exportOptions, ExportOptions.MAX_TXS, options.getMaxTx()); addOption(exportOptions, ExportOptions.COMPRESS, options.isCompress()); Callable<URI> op = getBranchOps().exportBranch(branches, exportOptions, options.getFileName()); URI exportURI = executeCallable(op); UriInfo uriInfo = getUriInfo(); URI location = getExchangeExportUri(uriInfo, exportURI, options.isCompress()); activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format("Branch Operation Export Branches {branchUUID(s): %s accountId: %s serverId: %s, clientId: %s}", branches.toString(), accountId, serverId, clientId)); return Response.created(location).build(); }

Target:
public Response exportBranches(BranchExportOptions options) { List<IOseeBranch> branches = getExportImportBranches(options.getBranchUuids()); PropertyStore exportOptions = new PropertyStore(); addOption(exportOptions, ExportOptions.MIN_TXS, options.getMinTx()); addOption(exportOptions, ExportOptions.MAX_TXS, options.getMaxTx()); addOption(exportOptions, ExportOptions.COMPRESS, options.isCompress()); Callable<URI> op = getBranchOps().exportBranch(branches, exportOptions, options.getFileName()); URI exportURI = executeCallable(op); UriInfo uriInfo = getUriInfo(); URI location = getExchangeExportUri(uriInfo, exportURI, options.isCompress()); try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Export Branches {branchUUID(s): %s accountId: %s serverId: %s, clientId: %s}", branches.toString(), RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } return Response.created(location).build(); }
Source:
private void extractDetailedAttributes(Map attr) { String lNum = attr.get("lineNumber").toString(); Integer lineNumber = Integer.parseInt(lNum); String line = lines.get(lineNumber); attributeMetadata.add(fCOMMENT); while (line.length() > 0) { setHeaders(attr,line); attributeMetadata.add(fCOMMENT + line); line = lines.get(lineNumber); lineNumber ++; setEndOfVariableBlock(lineNumber); } }

Target:
private void extractDetailedAttributes(Map attr) { String lNum = attr.get("lineNumber").toString(); Integer lineNumber = Integer.parseInt(lNum); String line = lines.get(lineNumber); attributeMetadata.add(COMMENT); while (line.length() > 0) { setHeaders(attr,line); attributeMetadata.add(COMMENT + line); line = lines.get(lineNumber); lineNumber ++; setEndOfVariableBlock(lineNumber); } }
Source:
public void elasticSearchQueryWithFilter(String indexName, String mappingName, String columnName ,String filterType, String value){ commonspec.getLogger().info("Executing query over " + indexName + "/" + mappingName + " over column " + columnName); try { commonspec.setElasticsearchResults( commonspec.getElasticSearchClient() .searchSimpleFilterElasticsearchQuery(indexName, mappingName, columnName, value, filterType) ); }catch(Exception e){ commonspec.getLogger().error("Exception captured"); commonspec.getLogger().error(e.toString()); commonspec.getExceptions().add(e); } }

Target:
public void elasticSearchQueryWithFilter(String indexName, String mappingName, String columnName ,String filterType, String value){ commonspec.getLogger().info("Executing query over " + indexName + "/" + mappingName + " over column " + columnName); try { commonspec.setElasticsearchResults( commonspec.getElasticSearchClient() .searchSimpleFilterElasticsearchQuery(indexName, mappingName, columnName, value, filterType) ); }catch(Exception e){ commonspec.getLogger().info("Exception captured"); commonspec.getLogger().info(e.toString()); commonspec.getExceptions().add(e); } }
Source:
public void testStreamTapSingleProcessor() { String data = UUID.randomUUID().toString(); stream("dataSender", sources.http() + XD_DELIMETER + processors.transform().expression("payload.toUpperCase()") + XD_DELIMETER + sinks.log(), WAIT_TIME); stream(sources.tap("dataSender").moduleName("transform") + XD_TAP_DELIMETER + sinks.file()); waitForXD(); sources.http().postData(data); assertValid(data.toUpperCase(), sinks.file()); }

Target:
public void testStreamTapSingleProcessor() { String data = UUID.randomUUID().toString(); stream("dataSender", sources.http() + XD_DELIMITER + processors.transform().expression("payload.toUpperCase()") + XD_DELIMITER + sinks.log(), WAIT_TIME); stream(sources.tap("dataSender").moduleName("transform") + XD_TAP_DELIMITER + sinks.file()); waitForXD(); sources.http().postData(data); assertValid(data.toUpperCase(), sinks.file()); }
Source:
public int hashCode() { return Objects.hash( forceMigrationForNonMigratableVm, getVmId(), targetVdsGroupId ); }

Target:
public int hashCode() { return Objects.hash( super.hashCode(), forceMigrationForNonMigratableVm, targetVdsGroupId ); }
Source:
public void testRebaseShouldLeaveWorkspaceUntouchedWithUnstagedChangesConflict() throws Exception { writeTrashFile(FILE1, "initial file"); git.add().addFilepattern(FILE1).call(); RevCommit initial = git.commit().setMessage("initial commit").call(); createBranch(initial, "refs/heads/side"); writeTrashFile(FILE1, "updated file"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated FILE1 on master").call(); checkoutBranch("refs/heads/side"); writeTrashFile(FILE1, "side update"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated FILE1 on side").call(); File theFile = writeTrashFile(FILE1, "dirty the file"); RebaseResult rebaseResult = git.rebase() .setUpstream("refs/heads/master").call(); assertEquals(rebaseResult.getStatus(), Status.CONFLICTS); assertEquals(rebaseResult.getConflicts().size(), 1); assertEquals(rebaseResult.getConflicts().get(0), FILE1); checkFile(theFile, "dirty the file"); assertEquals(RepositoryState.SAFE, git.getRepository() .getRepositoryState()); }

Target:
public void testRebaseShouldLeaveWorkspaceUntouchedWithUnstagedChangesConflict() throws Exception { writeTrashFile(FILE1, "initial file"); git.add().addFilepattern(FILE1).call(); RevCommit initial = git.commit().setMessage("initial commit").call(); createBranch(initial, "refs/heads/side"); writeTrashFile(FILE1, "updated file"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated FILE1 on master").call(); checkoutBranch("refs/heads/side"); writeTrashFile(FILE1, "side update"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated FILE1 on side").call(); File theFile = writeTrashFile(FILE1, "dirty the file"); RebaseResult rebaseResult = git.rebase() .setUpstream("refs/heads/master").call(); assertEquals(Status.CONFLICTS, rebaseResult.getStatus()); assertEquals(1, rebaseResult.getConflicts().size()); assertEquals(FILE1, rebaseResult.getConflicts().get(0)); checkFile(theFile, "dirty the file"); assertEquals(RepositoryState.SAFE, git.getRepository() .getRepositoryState()); }
Source:
public int compareTo(ModuleMetadata other) { return this.getName().compareTo(other.getName()); }

Target:
public int compareTo(ModuleMetadata other) { return this.getId().compareTo(other.getId()); }
Source:
public void initialize() { mean = ops().computer(Mean.class, new DoubleType(), in().getB()); stdDeviation = ops().computer(StdDev.class, new DoubleType(), in().getB()); }

Target:
public void initialize() { mean = ops().computer(Mean.class, DoubleType.class, in().getB()); stdDeviation = ops().computer(StdDev.class, DoubleType.class, in().getB()); }
Source:
private void closeWriterQuietly() { try { if (writer != null) { writer.close(); } } catch (IOException e) { LOG.error("Error closing writer. {}", e.getMessage(), e); } writer = null; }

Target:
private void closeWriterQuietly() { try { if (writer != null) { writer.close(); } } catch (Throwable t) { LOG.error("Error closing writer. {}", t.getMessage(), t); } writer = null; }
Source:
public void setUp() throws Exception { port = PortAssignment.unique(); localServerAddress = new InetSocketAddress("localhost", port); System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, "org.apache.zookeeper.server.NettyServerCnxnFactory"); System.setProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET, "org.apache.zookeeper.ClientCnxnSocketNetty"); System.setProperty(ZKClientConfig.SECURE_CLIENT, "true"); x509Util = new ClientX509Util(); x509TestContext.setSystemProperties(x509Util, KeyStoreFileType.JKS, KeyStoreFileType.JKS); }

Target:
public void setUp() throws Exception { localServerAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(), PortAssignment.unique()); x509Util = new ClientX509Util(); x509TestContext.setSystemProperties(x509Util, KeyStoreFileType.JKS, KeyStoreFileType.JKS); }
Source:
public void testGetCursor() { final TestDao dao = getDao(); final Cursor cursor = dao.getCursor(Query.select(Root.class)); assertThat(cursor.getColumnName(0), is("_id")); assertThat(cursor.getColumnName(1), is("test")); }

Target:
public void testGetCursor() { final TestDao dao = getDao(); final Cursor cursor = dao.getCursor(Query.select(Root.class)); assertThat(cursor.getColumnIndex(RootTable.COLUMN_ID), is(not(-1))); assertThat(cursor.getColumnIndex(RootTable.COLUMN_TEST), is(not(-1))); }
Source:
private TablePopulationRequirements getMVHandlerInfoMessage(MaterializedViewHandlerInfo mvh) { TablePopulationRequirements retval; if ( ! mvh.getIssafewithnonemptysources()) { String viewName = mvh.getDesttable().getTypeName(); String errorMessage = createViewDisallowedMessage(viewName, null); retval = new TablePopulationRequirements(viewName); retval.setErrorMessage(errorMessage); for (TableRef tref : mvh.getSourcetables()) { String tableName = tref.getTable().getTypeName(); if ( ! m_newTables.contains(tableName)) { retval.addTableName(tableName); } } return retval; } return null; }

Target:
private TablePopulationRequirements getMVHandlerInfoMessage(MaterializedViewHandlerInfo mvh) { TablePopulationRequirements retval; if ( ! mvh.getIssafewithnonemptysources()) { String viewName = mvh.getDesttable().getTypeName(); String errorMessage = createViewDisallowedMessage(viewName, null); retval = new TablePopulationRequirements(viewName); retval.setErrorMessage(errorMessage); for (TableRef tref : mvh.getSourcetables()) { String tableName = tref.getTable().getTypeName(); retval.addTableName(tableName); } return retval; } return null; }
Source:
public void add(ConstrainedElement constrainedElement) { constraints.addAll( adaptConstraints( constrainedElement.getKind(), constrainedElement.getConstraints() ) ); constraints.addAll( adaptConstraints( constrainedElement.getKind(), new HashSet<>( constrainedElement.getTypeArgumentConstraints().values() ) ) ); isCascading = isCascading || constrainedElement.isCascading(); if ( unwrapMode == null || constrainedElement.getSource().getPriority() > unwrapModeSource.getPriority() ) { unwrapMode = constrainedElement.unwrapMode(); unwrapModeSource = constrainedElement.getSource(); } addGroupConversions( constrainedElement.getGroupConversions() ); }

Target:
public void add(ConstrainedElement constrainedElement) { constraints.addAll( adaptConstraints( constrainedElement.getKind(), constrainedElement.getConstraints() ) ); constraints.addAll( adaptConstraints( constrainedElement.getKind(), constrainedElement.getTypeArgumentConstraints() ) ); isCascading = isCascading || constrainedElement.isCascading(); if ( unwrapMode == null || constrainedElement.getSource().getPriority() > unwrapModeSource.getPriority() ) { unwrapMode = constrainedElement.unwrapMode(); unwrapModeSource = constrainedElement.getSource(); } addGroupConversions( constrainedElement.getGroupConversions() ); }
Source:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { ITmfEventField eventField; if (!(field.startsWith(SLASH_STRING))) { eventField = event.getContent().getField(field); } else { List<String> list = getPathList(field); ITmfEventField topField = event.getContent(); eventField = getSubField(topField, list); } if (eventField != null) { value = eventField.getValue(); } } return value; }

Target:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { if (field == null) { return null; } ITmfEventField eventField; if (field.equals(EMPTY_STRING) || field.charAt(0) != SLASH) { eventField = event.getContent().getField(field); } else { String[] array = getPathArray(field); eventField = event.getContent().getSubField(array); } if (eventField != null) { value = eventField.getValue(); } } return value; }
Source:
private Optional< SymbolInfo > getSymbol( ParsingContext context, String name ) { Optional< SymbolInfo > symbol = Helpers.firstNonNull( () -> { if( !symbolTables.containsKey( currentURI ) || !symbolTables.get( currentURI ).symbol( name ).isPresent() ) { return null; } return symbolTables.get( currentURI ).symbol( name ).get(); }, () -> { if( !symbolTables.containsKey( context.source() ) || !symbolTables.get( context.source() ).symbol( name ).isPresent() ) { return null; } return symbolTables.get( context.source() ).symbol( name ).get(); } ); return symbol; }

Target:
private Optional< SymbolInfo > getSymbol( ParsingContext context, String name ) { if( symbolTables.containsKey( currentURI ) && symbolTables.get( currentURI ).getSymbol( name ).isPresent() ) { return symbolTables.get( currentURI ).getSymbol( name ); } else if( symbolTables.containsKey( context.source() ) && symbolTables.get( context.source() ).getSymbol( name ).isPresent() ) { return symbolTables.get( context.source() ).getSymbol( name ); } return Optional.empty(); }
Source:
public void testDefaultTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); StudentAttributes s = new StudentAttributes(); s.name = "a valid student"; s.lastName = "last name of student"; s.email = "valid-fresh-student@email.com"; s.team = "validTeamNameOfStudent"; s.section = "aValidSectionName"; s.comments = ""; s.googleId = "validGoogleIdForStudent"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); student.setCreated_NonProduction(null); student.setUpdatedAt_NonProduction(null); Date defaultStudentCreationTimeStamp = Const.TIME_REPRESENTS_DEFAULT_STUDENT_CREATION_TIMESTAMP; ______TS("success : created defaultTimeStamp"); assertEquals(defaultStudentCreationTimeStamp, student.getCreatedAt()); ______TS("success : update defaultTimeStamp"); assertEquals(defaultStudentCreationTimeStamp, student.getUpdatedAt()); }

Target:
public void testDefaultTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { StudentAttributes s = new StudentAttributes(); s.name = "a valid student"; s.lastName = "last name of student"; s.email = "valid-fresh-student@email.com"; s.team = "validTeamNameOfStudent"; s.section = "aValidSectionName"; s.comments = ""; s.googleId = "validGoogleIdForStudent"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); student.setCreated_NonProduction(null); student.setUpdatedAt_NonProduction(null); Date defaultStudentCreationTimeStamp = Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP; ______TS("success : defaultTimeStamp for createdAt date"); assertEquals(defaultStudentCreationTimeStamp, student.getCreatedAt()); ______TS("success : defaultTimeStamp for updatedAt date"); assertEquals(defaultStudentCreationTimeStamp, student.getUpdatedAt()); }
Source:
public void testDelay() { final MySignal sig1 = new MySignal(sender, 0); final MySignal sig2 = new MySignal(sender, 0); final MySignal sig3 = new MySignal(sender, 0); sender.sendSignal(sig1); sleep(250); sender.sendSignal(sig2); sleep(250); sender.sendSignal(sig3); sleep(250); assertEquals(3, listener.nbReceived[0]); }

Target:
public void testDelay() { final MySignal sig1 = new MySignal(sender, 0); final MySignal sig2 = new MySignal(sender, 0); final MySignal sig3 = new MySignal(sender, 0); sender.sendSignal(sig1); sleep(1000); sender.sendSignal(sig2); sleep(1000); sender.sendSignal(sig3); sleep(1000); assertEquals(3, listener.nbReceived[0]); }
Source:
private static String getText(EObject[] eObjects) { String text = ""; if (eObjects != null) { ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); for (int i = 0; i < eObjects.length - 1; i++) { EObject eObject = eObjects[i]; if (eObject != null) { IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(eObject, IItemLabelProvider.class); if (itemLabelProvider != null) { text += itemLabelProvider.getText(eObject) + "(" + eObject + "), "; } } } EObject eObject = eObjects[eObjects.length - 1]; if (eObject != null) { IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(eObject, IItemLabelProvider.class); if (itemLabelProvider != null) { text += itemLabelProvider.getText(eObject) + "(" + eObject + ")"; } } } return text; }

Target:
private static String getText(EObject[] eObjects) { String text = ""; if (eObjects != null) { ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); for (int i = 0; i < eObjects.length; i++) { EObject eObject = eObjects[i]; if (eObject != null) { IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(eObject, IItemLabelProvider.class); if (itemLabelProvider != null) { text += itemLabelProvider.getText(eObject) + " (" + eObject + ")"; if (i != eObjects.length - 1) { text += ", "; } } } } } return text; }
Source:
private void apiConnectionLogic(HttpServletRequest request, HttpServletResponse response) throws IOException { PrintWriter out = response.getWriter(); String isStubTesting = appExtPropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_TEST_STUB); M_log.debug("isStubTesting: " + isStubTesting); if(Boolean.valueOf(isStubTesting)){ Utils.openFile(request, response, out); } else{ if(request.getPathInfo().equalsIgnoreCase(MPATHWAYS_PATH_INFO)){ mpathwaysCall(request, response, out); } else{ getCanvasResponse(request, response, out); } } }

Target:
private void apiConnectionLogic(HttpServletRequest request, HttpServletResponse response) throws IOException { PrintWriter out = response.getWriter(); String isStubTesting = appExtPropertiesFile.getProperty(SectionUtilityToolFilter.PROPERTY_TEST_STUB); M_log.debug("isStubTesting: " + isStubTesting); if(Boolean.valueOf(isStubTesting)){ Utils.openFile(request, response, out); return; } if(request.getPathInfo().equalsIgnoreCase(MPATHWAYS_PATH_INFO)){ mpathwaysCall(request, response, out); } else{ getCanvasResponse(request, response, out); } }
Source:
private ProteinVariantAnnotation getProteinAnnotation(Variant variant, ConsequenceType consequenceType) { ProteinVariantAnnotation proteinVariantAnnotation = null; if (consequenceType.getProteinVariantAnnotation() != null) { String transcriptId = consequenceType.getTranscriptId(); if (transcriptId != null && transcriptId.contains("\\.")) { transcriptId = transcriptId.split("\\.")[0]; } CellBaseDataResult<ProteinVariantAnnotation> results = proteinManager.getVariantAnnotation( transcriptId, consequenceType.getProteinVariantAnnotation().getPosition(), consequenceType.getProteinVariantAnnotation().getReference(), consequenceType.getProteinVariantAnnotation().getAlternate(), new QueryOptions()); if (results.getNumResults() > 0) { proteinVariantAnnotation = results.getResults().get(0); } CellBaseDataResult<MissenseVariantFunctionalScore> revelResults = proteinManager.getRevelScores(variant.getChromosome(), variant.getStart(), variant.getReference(), variant.getAlternate()); String aaReference = VariantAnnotationUtils.TO_ABBREVIATED_AA.get(consequenceType.getProteinVariantAnnotation().getReference()); String aaAlternate = VariantAnnotationUtils.TO_ABBREVIATED_AA.get(consequenceType.getProteinVariantAnnotation().getAlternate()); if (revelResults.getNumResults() > 0) { List<MissenseVariantFunctionalScore> scores = revelResults.getResults(); for (MissenseVariantFunctionalScore score : scores) { for (TranscriptMissenseVariantFunctionalScore transcriptScore : score.getScores()) { if (transcriptScore.getAaReference().equalsIgnoreCase(aaReference) && transcriptScore.getAaAlternate().equalsIgnoreCase(aaAlternate)) { proteinVariantAnnotation.getSubstitutionScores().add(new Score(transcriptScore.getScore(), "revel", "")); } } } } } return proteinVariantAnnotation; }

Target:
private ProteinVariantAnnotation getProteinAnnotation(Variant variant, ConsequenceType consequenceType) { ProteinVariantAnnotation proteinVariantAnnotation = null; if (consequenceType.getProteinVariantAnnotation() != null) { String transcriptId = consequenceType.getTranscriptId(); if (transcriptId != null && transcriptId.contains("\\.")) { transcriptId = transcriptId.split("\\.")[0]; } CellBaseDataResult<ProteinVariantAnnotation> results = proteinManager.getVariantAnnotation(variant, transcriptId, consequenceType.getProteinVariantAnnotation().getPosition(), consequenceType.getProteinVariantAnnotation().getReference(), consequenceType.getProteinVariantAnnotation().getAlternate(), new QueryOptions()); if (results.getNumResults() > 0) { proteinVariantAnnotation = results.getResults().get(0); } } return proteinVariantAnnotation; }
Source:
@Test public void shouldReturnEqualForSameInstance() throws Exception { GitModelCacheTree left = crateCacheTree(getTreeLocation()); boolean actual = left.equals(left); assertTrue(actual); }

Target:
@Test public void shouldReturnEqualForSameInstance() throws Exception { GitModelCacheTree left = createCacheTree(getTreeLocation()); boolean actual = left.equals(left); assertTrue(actual); }
Source:
protected void addSearchTerm(ResourceTable theEntity, Set<ResourceIndexedSearchParamString> retVal, String resourceName, String searchTerm) { if (isBlank(searchTerm)) { return; } if (searchTerm.length() > ResourceIndexedSearchParamString.MAX_LENGTH) { searchTerm = searchTerm.substring(0, ResourceIndexedSearchParamString.MAX_LENGTH); } String normalizedString = StringNormalizer.normalizeString(searchTerm); if (normalizedString.length() > ResourceIndexedSearchParamString.MAX_LENGTH) { normalizedString = normalizedString.substring(0, ResourceIndexedSearchParamString.MAX_LENGTH); } ResourceIndexedSearchParamString nextEntity = new ResourceIndexedSearchParamString(getModelConfig(), resourceName, normalizedString, searchTerm); nextEntity.setResource(theEntity); retVal.add(nextEntity); }

Target:
protected void addSearchTerm(ResourceTable theEntity, Set<ResourceIndexedSearchParamString> retVal, String resourceName, String searchTerm) { if (isBlank(searchTerm)) { return; } retVal.add(createResourceIndexedSearchParamString(theEntity, resourceName, searchTerm)); }
Source:
public void removeAllUserFacilityAttributes(PerunSession sess, User user) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM user_facility_attr_values WHERE user_id=?", user.getId())) { log.debug("All attributes s values were removed from user on all facilities.", user); } } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }

Target:
public void removeAllUserFacilityAttributes(PerunSession sess, User user) throws InternalErrorException { try { if (0 < jdbc.update("DELETE FROM user_facility_attr_values WHERE user_id=?", user.getId())) { log.debug("All attributes values were removed from user on all facilities.", user); } } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
Source:
public static int computeTruncatedLength(Slice slice, int offset, int length, int maxCodePointCount, boolean isCharType) { int truncatedLength = length; if (isCharType) { truncatedLength = byteCountWithoutTrailingSpace(slice, offset, length, maxCodePointCount); } else if (maxCodePointCount >= 0 && length > maxCodePointCount) { truncatedLength = byteCount(slice, offset, length, maxCodePointCount); } return truncatedLength; }

Target:
public static int computeTruncatedLength(Slice slice, int offset, int length, int maxCodePointCount, boolean isCharType) { if (isCharType) { return byteCountWithoutTrailingSpace(slice, offset, length, maxCodePointCount); } if (maxCodePointCount >= 0 && length > maxCodePointCount) { return byteCount(slice, offset, length, maxCodePointCount); } return length; }