auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void onlyTanksCanMoveTwo() { final Route route = new Route(germany, easternEurope, kareliaSsr); final Collection<Unit> units = germanyUnits(Matches.unitIsOfTypes(infantryType, armourType)); assertThat(units, hasSize(5)); final Collection<Unit> justTanks = germanyUnits(Matches.unitIsOfType(armourType)); assertThat(justTanks, hasSize(2)); final var result = filterUnits(route, units); assertThat(result.getErrorMessage(), is(nullValue())); <START> assertThat(result.getWarningMessage(), is("Not all units have enough movement")); <END> assertThat(result.getUnitsWithDependents(), containsInAnyOrder(justTanks.toArray())); }</code><technical_language>nit, brittle test code smell. If change this string in production code, this test fail unnecessarily. Recommend extracting string a constant, eg: @VisibleForTesting static String NOT_ALL_UNITS_CAN_MOVE = "Not units enough movement"; I a bit if string is displayed a downstream concern. For example, if internationalize strings (not radar, for sake of argument), odd dependency string value. a cleaner API return enum result, consumer map result a string. this test read more like: assertThat(result.getValue(), is(SOME_UNITS_CAN_MOVE)); other enum values I presume be: ALL_UNITS_CAN_MOVE NO_UNITS_CAN_MOVE This avoids a good bit of nullable args. Nullable return types essentially a SRP violation code-smell, represent values meanings depending value. IE: if null, this variable means (a flag), if not-null, a display string for user. enum values imply non-null return type, code is closer front-end decide display string use</technical_language>

Target:
void onlyTanksCanMoveTwo() { final Route route = new Route(germany, easternEurope, kareliaSsr); final Collection<Unit> units = germanyUnits(Matches.unitIsOfTypes(infantryType, armourType)); assertThat(units, hasSize(5)); final Collection<Unit> justTanks = germanyUnits(Matches.unitIsOfType(armourType)); assertThat(justTanks, hasSize(2)); final var result = filterUnits(route, units); assertThat(result.getStatus(), is(FilterOperationResult.Status.SOME_UNITS_CAN_MOVE)); assertThat( result.getWarningOrErrorMessage(), isPresentAndIs("Not all units have enough movement")); assertThat(result.getUnitsWithDependents(), containsInAnyOrder(justTanks.toArray())); }
Source:
<code>public void testGetUnknownResolver() { String synapseVariable = "$SYSTEM1:VAR"; <START> try { <END> ResolverFactory.getInstance().getResolver(synapseVariable); } catch (ResolverException e) { assertNotNull(e.getMessage()); } }</code><technical_language>expected exception here, instead of asserting exception</technical_language>

Target:
public void testGetUnknownResolver() { String synapseVariable = "$SYSTEM1:VAR"; ResolverFactory.getInstance().getResolver(synapseVariable); }
Source:
<code>public void init() throws IOException { super.init(); SortSpec[] sortSpecs = logicalPlan.getSortSpecs(); indexKeys = new int[sortSpecs.length]; keySchema = PlannerUtil.sortSpecsToSchema(sortSpecs); Column col; for (int i = 0 ; i < sortSpecs.length; i++) { col = sortSpecs[i].getSortKey(); indexKeys[i] = inSchema.getColumnId(col.getQualifiedName()); } TajoConf conf = new TajoConf(); <START> Path indexPath = new Path(conf.getVar(ConfVars.INDEX_DIR), logicalPlan.getIndexName() + "/" + <END> context.getUniqueKeyFromFragments()); BSTIndex bst = new BSTIndex(conf); this.comparator = new TupleComparator(keySchema, sortSpecs); this.indexWriter = bst.getIndexWriter(indexPath, BSTIndex.TWO_LEVEL_INDEX, keySchema, comparator); this.indexWriter.setLoadNum(100); this.indexWriter.open(); }</code><technical_language>write index ${INDEX_DIR}/${INDEX NAME}. if index is located directory hierarchy: ${DATABASE_NAME}/${TABLE_NAME}/${INDEX_NAME}. more indices table. proposed directory hierarchy enable Tajo manage indices more effectively</technical_language>

Target:
public void init() throws IOException { super.init(); SortSpec[] sortSpecs = logicalPlan.getSortSpecs(); indexKeys = new int[sortSpecs.length]; keySchema = PlannerUtil.sortSpecsToSchema(sortSpecs); Column col; for (int i = 0 ; i < sortSpecs.length; i++) { col = sortSpecs[i].getSortKey(); indexKeys[i] = inSchema.getColumnId(col.getQualifiedName()); } TajoConf conf = context.getConf(); String[] splits = logicalPlan.getIndexName().split("\\."); Path indexPath = new Path(conf.getVar(ConfVars.WAREHOUSE_DIR), splits[0] + "/" + splits[1] + "/" + context.getUniqueKeyFromFragments()); System.out.println("exec: " + indexPath); BSTIndex bst = new BSTIndex(conf); this.comparator = new TupleComparator(keySchema, sortSpecs); this.indexWriter = bst.getIndexWriter(indexPath, BSTIndex.TWO_LEVEL_INDEX, keySchema, comparator); this.indexWriter.setLoadNum(100); this.indexWriter.open(); }
Source:
<code>private void appendLineText(final SafeHtmlBuilder m, final int lineNumberMinusOne, final PatchLine.Type type, final SafeHtml lineHtml, final boolean trailingEdit, final boolean fullBlock) { m.openTd(); m.setStyleName(Gerrit.RESOURCES.css().lineNumber()); <START> m.openAnchor(); <END> m.append(lineNumberMinusOne + 1); m.closeAnchor(); m.closeTd(); m.openTd(); m.addStyleName(Gerrit.RESOURCES.css().fileLine()); switch (type) { case CONTEXT: m.addStyleName(Gerrit.RESOURCES.css().fileLineCONTEXT()); break; case DELETE: m.addStyleName(Gerrit.RESOURCES.css().fileLineDELETE()); if (trailingEdit || fullBlock) { m.addStyleName("wdd"); } break; case INSERT: m.addStyleName(Gerrit.RESOURCES.css().fileLineINSERT()); if (trailingEdit || fullBlock) { m.addStyleName("wdi"); } break; } m.append(lineHtml); m.closeTd(); }</code><technical_language>Do need anchors line numbers in order support clicking cell? table click event dispatching it</technical_language>

Target:
private void appendLineText(final SafeHtmlBuilder m, final int lineNumberMinusOne, final PatchLine.Type type, final SafeHtml lineHtml, final boolean trailingEdit, final boolean fullBlock) { m.openTd(); m.setStyleName(Gerrit.RESOURCES.css().lineNumber()); m.append(lineNumberMinusOne + 1); m.closeTd(); m.openTd(); m.addStyleName(Gerrit.RESOURCES.css().fileLine()); switch (type) { case CONTEXT: m.addStyleName(Gerrit.RESOURCES.css().fileLineCONTEXT()); break; case DELETE: m.addStyleName(Gerrit.RESOURCES.css().fileLineDELETE()); if (trailingEdit || fullBlock) { m.addStyleName("wdd"); } break; case INSERT: m.addStyleName(Gerrit.RESOURCES.css().fileLineINSERT()); if (trailingEdit || fullBlock) { m.addStyleName("wdi"); } break; } m.append(lineHtml); m.closeTd(); }
Source:
<code>private static DistributedQueryRunner createQueryRunner() throws Exception { <START> DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder() <END> .setSource(TestSpatialJoins.class.getSimpleName()) .setCatalog("hive") .setSchema("default") .build(), 4); queryRunner.installPlugin(new GeoPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data").toFile(); HiveClientConfig hiveClientConfig = new HiveClientConfig(); HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationUpdater(hiveClientConfig)); HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveClientConfig, new NoHdfsAuthentication()); FileHiveMetastore metastore = new FileHiveMetastore(hdfsEnvironment, baseDir.toURI().toString(), "test"); metastore.createDatabase(Database.builder() .setDatabaseName("default") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); queryRunner.installPlugin(new HivePlugin("hive", Optional.of(metastore))); queryRunner.createCatalog("hive", "hive"); return queryRunner; }</code><technical_language>This constructor is deprecated, instead use: Session session = testSessionBuilder() .setSource(TestSpatialJoins.class.getSimpleName()) .setCatalog("hive") .setSchema("default") .build(); DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session) .setNodeCount(4) .build();</technical_language>

Target:
private static DistributedQueryRunner createQueryRunner() throws Exception { Session session = testSessionBuilder() .setSource(TestSpatialJoins.class.getSimpleName()) .setCatalog("hive") .setSchema("default") .build(); DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session) .setNodeCount(4) .build(); queryRunner.installPlugin(new GeoPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data").toFile(); HiveClientConfig hiveClientConfig = new HiveClientConfig(); HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationUpdater(hiveClientConfig)); HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveClientConfig, new NoHdfsAuthentication()); FileHiveMetastore metastore = new FileHiveMetastore(hdfsEnvironment, baseDir.toURI().toString(), "test"); metastore.createDatabase(Database.builder() .setDatabaseName("default") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); queryRunner.installPlugin(new HivePlugin("hive", Optional.of(metastore))); queryRunner.createCatalog("hive", "hive"); return queryRunner; }
Source:
<code>private Date updateAge(String birthdate, String dateformat, String age) throws java.text.ParseException { SimpleDateFormat df = new SimpleDateFormat(); if (!"".equals(dateformat)) { dateformat = dateformat.toLowerCase().replaceAll("m", "M"); } else { dateformat = new String("MM/dd/yyyy"); } df.applyPattern(dateformat); Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); if ("".equals(birthdate)) { if ("".equals(age)) { return cal.getTime(); } try { cal.add(Calendar.YEAR, -(Integer.parseInt(age))); } catch (NumberFormatException nfe) { <START> log.debug ("Error during adding date into calendar",nfe); <END> } return cal.getTime(); } else { cal.setTime(df.parse(birthdate)); } return cal.getTime(); }</code><technical_language>this a log.error statement. needs space ","</technical_language>

Target:
private Date updateAge(String birthdate, String dateformat, String age) throws java.text.ParseException { SimpleDateFormat df = new SimpleDateFormat(); if (!"".equals(dateformat)) { dateformat = dateformat.toLowerCase().replaceAll("m", "M"); } else { dateformat = new String("MM/dd/yyyy"); } df.applyPattern(dateformat); Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); if ("".equals(birthdate)) { if ("".equals(age)) { return cal.getTime(); } try { cal.add(Calendar.YEAR, -(Integer.parseInt(age))); } catch (NumberFormatException nfe) { log.error ("Error during adding date into calendar", nfe); } return cal.getTime(); } else { cal.setTime(df.parse(birthdate)); } return cal.getTime(); }
Source:
<code>private void expandIfNecessary(long dataLength) throws IOException { long elementLength = Element.HEADER_LENGTH + dataLength; long remainingBytes = remainingBytes(); if (remainingBytes >= elementLength) return; long previousLength = fileLength; long newLength; do { remainingBytes += previousLength; newLength = previousLength << 1; previousLength = newLength; } while (remainingBytes < elementLength); setLength(newLength); long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length); long count = 0; if (endOfLastElement <= first.position) { FileChannel channel = raf.getChannel(); channel.position(fileLength); count = endOfLastElement - headerLength; if (channel.transferTo(headerLength, count, channel) != count) { throw new AssertionError("Copied insufficient number of bytes!"); } } if (last.position < first.position) { long newLastPosition = fileLength + last.position - headerLength; writeHeader(newLength, elementCount, first.position, newLastPosition); last = new Element(newLastPosition, last.length); } else { writeHeader(newLength, elementCount, first.position, last.position); } fileLength = newLength; <START> if (zero && count != 0) { <END> ringErase(headerLength, count); } }</code><technical_language>Do need check if count is zero? zero</technical_language>

Target:
private void expandIfNecessary(long dataLength) throws IOException { long elementLength = Element.HEADER_LENGTH + dataLength; long remainingBytes = remainingBytes(); if (remainingBytes >= elementLength) return; long previousLength = fileLength; long newLength; do { remainingBytes += previousLength; newLength = previousLength << 1; previousLength = newLength; } while (remainingBytes < elementLength); setLength(newLength); long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length); long count = 0; if (endOfLastElement <= first.position) { FileChannel channel = raf.getChannel(); channel.position(fileLength); count = endOfLastElement - headerLength; if (channel.transferTo(headerLength, count, channel) != count) { throw new AssertionError("Copied insufficient number of bytes!"); } } if (last.position < first.position) { long newLastPosition = fileLength + last.position - headerLength; writeHeader(newLength, elementCount, first.position, newLastPosition); last = new Element(newLastPosition, last.length); } else { writeHeader(newLength, elementCount, first.position, last.position); } fileLength = newLength; if (zero) { ringErase(headerLength, count); } }
Source:
<code>private static boolean isFuncInFuncSignature(@Nullable GoType type) { if (type == null) return false; PsiElement parentFunc = type; if (type.getParent() instanceof GoParameterDeclaration && type.getParent().getParent() instanceof GoParameters) { <START> parentFunc = type.getParent().getParent().getParent(); <END> } else if (type.getParent() instanceof GoResult) { parentFunc = type.getParent(); } if (parentFunc.getParent() instanceof GoResult) { parentFunc = type.getParent(); } else if (!(parentFunc instanceof GoResult)) { return false; } return parentFunc.getParent() instanceof GoSignature && (type instanceof GoFunctionType || parentFunc.getParent().getParent().getParent().getParent() instanceof GoSignature); }</code><technical_language>kidding? :) type.getParent().getParent().getParent()</technical_language>

Target:
private static boolean isFuncInFuncSignature(@Nullable GoType type) { if (type == null || !(type.getParent() instanceof GoResult)) return false; PsiElement parentFunc = type.getParent(); GoParameterDeclaration paramDecl = PsiTreeUtil.getParentOfType(parentFunc, GoParameterDeclaration.class); return parentFunc.getParent() instanceof GoSignature && (type instanceof GoFunctionType || (paramDecl != null && paramDecl.getParent() instanceof GoSignature)); }
Source:
<code>public Parser getParser() { return inputStream -> { String response = new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining(OS.NEWLINE)); <START> System.out.println(response); <END> List<BibEntry> entries = new ArrayList<>(); CoinsParser parser = new CoinsParser(); Pattern pattern = Pattern.compile("<span class=\"Z3988\" title=\"(.*)\"></span>"); Matcher matcher = pattern.matcher(response); while (matcher.find()) { String encodedDataString = matcher.group(1); entries.addAll(parser.parseEntries(encodedDataString)); } return entries; }; }</code><technical_language>Please Logger.debug() remove this line</technical_language>

Target:
public Parser getParser() { return inputStream -> { String response = new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining(OS.NEWLINE)); List<BibEntry> entries = new ArrayList<>(); CoinsParser parser = new CoinsParser(); Pattern pattern = Pattern.compile("<span class=\"Z3988\" title=\"(.*)\"></span>"); Matcher matcher = pattern.matcher(response); while (matcher.find()) { String encodedDataString = matcher.group(1); entries.addAll(parser.parseEntries(encodedDataString)); } return entries; }; }
Source:
<code>public IsoValidStatus isIsoFileValid(StringBuilder isoFile, List<OVirtNodeInfo> Info, RpmVersion ovirtHostOsVersion) { IsoValidStatus result = IsoValidStatus.NOTCOMPATIBLE; String iso = isoFile.toString(); if (StringUtils.isNotBlank(iso)) { for (OVirtNodeInfo infoData: Info) { if (infoData.path != null) { File path = new File(infoData.path, iso); log.infoFormat("Validating ISOs path: {0}", path); if (path.exists()) { log.infoFormat("ISO found: {0}", path); Matcher matcher = infoData.pattern.matcher(iso); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.infoFormat("ISO version [{0}] for RpmVersion", rpmLike); RpmVersion isoVersion = new RpmVersion(iso, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { isoFile.setLength(0); isoFile.append(path.getAbsolutePath()); result = IsoValidStatus.VALID; break; } else { result = IsoValidStatus.NOTCOMPATIBLE; } } else { result = IsoValidStatus.MISSINGFILE; } <START> break; <END> } } } } log.infoFormat("isIsoFileValid result [{0}]", result); return result; }</code><technical_language>do need this break? if break anyway, do need break? do need modify isoFile, this function test file? exist</technical_language>

Target:
public IsoValidStatus isIsoFileValid(StringBuilder isoFile, List<OVirtNodeInfo> Info, RpmVersion ovirtHostOsVersion) { IsoValidStatus result = IsoValidStatus.NOTCOMPATIBLE; String iso = isoFile.toString(); if (StringUtils.isNotBlank(iso)) { for (OVirtNodeInfo infoData: Info) { if (infoData.path != null) { File path = new File(infoData.path, iso); log.infoFormat("Validating ISOs path: {0}", path); if (path.exists()) { log.infoFormat("ISO found: {0}", path); Matcher matcher = infoData.pattern.matcher(iso); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.infoFormat("ISO version [{0}] for RpmVersion", rpmLike); RpmVersion isoVersion = new RpmVersion(iso, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { isoFile.setLength(0); isoFile.append(path.getAbsolutePath()); result = IsoValidStatus.VALID; break; } else { result = IsoValidStatus.NOTCOMPATIBLE; } } else { result = IsoValidStatus.MISSINGFILE; } } } } } log.infoFormat("isIsoFileValid result [{0}]", result); return result; }
Source:
<code>public JAXRSContract() { super.registerClassAnnotation(Path.class, (path, data) -> { <START> if (path.value().isEmpty()) { <END> return; } String pathValue = path.value(); if (!pathValue.startsWith("/")) { pathValue = "/" + pathValue; } if (pathValue.endsWith("/")) { pathValue = pathValue.substring(0, pathValue.length() - 1); } pathValue = pathValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(pathValue); }); super.registerClassAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerClassAnnotation(Produces.class, this::handleProducesAnnotation); registerMethodsAnnotations(); registerParamAnnotations(); }</code><technical_language>Path empty value, specification. this error</technical_language>

Target:
public JAXRSContract() { super.registerClassAnnotation(Path.class, (path, data) -> { if (path != null && !path.value().isEmpty()) { String pathValue = path.value(); if (!pathValue.startsWith("/")) { pathValue = "/" + pathValue; } if (pathValue.endsWith("/")) { pathValue = pathValue.substring(0, pathValue.length() - 1); } pathValue = pathValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(pathValue); } }); super.registerClassAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerClassAnnotation(Produces.class, this::handleProducesAnnotation); registerMethodAnnotation(methodAnnotation -> { Class<? extends Annotation> annotationType = methodAnnotation.annotationType(); HttpMethod http = annotationType.getAnnotation(HttpMethod.class); return http != null; }, (methodAnnotation, data) -> { Class<? extends Annotation> annotationType = methodAnnotation.annotationType(); HttpMethod http = annotationType.getAnnotation(HttpMethod.class); checkState(data.template().method() == null, "Method %s contains multiple HTTP methods. Found: %s and %s", data.configKey(), data.template().method(), http.value()); data.template().method(Request.HttpMethod.valueOf(http.value())); }); super.registerMethodAnnotation(Path.class, (path, data) -> { final String pathValue = emptyToNull(path.value()); if (pathValue == null) { return; } String methodAnnotationValue = path.value(); if (!methodAnnotationValue.startsWith("/") && !data.template().url().endsWith("/")) { methodAnnotationValue = "/" + methodAnnotationValue; } methodAnnotationValue = methodAnnotationValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(methodAnnotationValue, true); }); super.registerMethodAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerMethodAnnotation(Produces.class, this::handleProducesAnnotation); registerParamAnnotations(); }
Source:
<code>protected long getJWTTokenExpiration(final String token) { if (!isValidIdentifier(token)) { throw new IllegalArgumentException("Token data cannot be null."); } JWT jwt; try { jwt = new JWTToken(token); } catch (final ParseException e) { log.errorParsingToken(e.toString()); <START> throw new IllegalArgumentException(e); <END> } final Date expires = jwt.getExpiresDate(); if (expires == null) { log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), "-1"); return -1L; } log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), expires.toString()); return expires.getTime(); }</code><technical_language>this throws a new exception? this exception end going? I this convert UnknownTokenException a runtime IllegalArgumentException this weird failures stack</technical_language>

Target:
protected OptionalLong getJWTTokenExpiration(final String token) { JWT jwt; try { jwt = new JWTToken(token); } catch (final ParseException e) { log.errorParsingToken(e.toString()); return OptionalLong.empty(); } final Date expires = jwt.getExpiresDate(); if (expires == null) { log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), "-1"); return OptionalLong.of(-1); } log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), expires.toString()); return OptionalLong.of(expires.getTime()); }
Source:
<code>public void shouldCreateProcessFromAppstorePackageRegistryMiss() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(PROCESSES_PATH) .respond() .withBody(readFromResource("/dataload/processes/asyncTask.json")) .withStatus(202); onRequest() .havingMethodEqualTo("GET") .havingPathEqualTo(PROCESS_DEPLOYMENT_POLLING_URI) .respond() .withStatus(200) .withBody(readFromResource("/dataload/processes/appstoreProcess.json")); DataloadProcess newProcess = new DataloadProcess("appstoreProcess", ProcessType.RUBY.toString(), "${PUBLIC_APPSTORE}:tag/prodigy-testing:/test/rubyHello"); <START> DataloadProcess process = retry(() -> gd.getProcessService().createProcessFromAppstore(project, newProcess).get()); <END> assertThat(process, notNullValue()); }</code><technical_language>tests running mocked backends (using Jadler), retry is needed in this test class</technical_language>

Target:
public void shouldCreateProcessFromAppstorePackageRegistryMiss() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(PROCESSES_PATH) .respond() .withBody(readFromResource("/dataload/processes/asyncTask.json")) .withStatus(202); onRequest() .havingMethodEqualTo("GET") .havingPathEqualTo(PROCESS_DEPLOYMENT_POLLING_URI) .respond() .withStatus(200) .withBody(readFromResource("/dataload/processes/appstoreProcess.json")); DataloadProcess process = gd.getProcessService().createProcessFromAppstore(project, new DataloadProcess("appstoreProcess", ProcessType.RUBY.toString(), "${PUBLIC_APPSTORE}:tag/prodigy-testing:/test/rubyHello")).get(); assertThat(process, notNullValue()); }
Source:
<code>public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal docMetadata) { List<ReferenceMetadata> citationReferencesMetadata = Lists.newArrayList(); if (docMetadata.getReferences() != null) { for (eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata docReferenceMetadata : docMetadata.getReferences()) { ReferenceMetadata citationReferenceMetadata = convertReference(docReferenceMetadata); if (citationReferenceMetadata != null) { citationReferencesMetadata.add(citationReferenceMetadata); } } <START> } <END> return new DocumentMetadata(docMetadata.getId(), docMetadata.getExternalIdentifiers(), docMetadata.getPublicationTypeName(), citationReferencesMetadata); }</code><technical_language>'if' here... nice move a private method named e.g. convertReferences(docMetadata.getReferences()) returning List<ReferenceMetadata> citationReferencesMetadata. do think</technical_language>

Target:
public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal docMetadata) { Preconditions.checkNotNull(docMetadata); List<ReferenceMetadata> citationReferencesMetadata = convertReferences(docMetadata.getReferences()); return new DocumentMetadata(docMetadata.getId(), docMetadata.getExternalIdentifiers(), docMetadata.getPublicationTypeName(), citationReferencesMetadata); }
Source:
<code>public Matrix randn(final int length) { <START> return randn(length); <END> }</code><technical_language>This code is a bug, fix following: return randn(length, 1);</technical_language>

Target:
public Matrix randn(final int length) { return randn(length, 1); }
Source:
<code>private void handleEvent(JsonArray array) { if (array.size() > 0) { Event event = new JSONEventImpl(array); for (EventItem item : event.getEventItems()) { <START> logger.info("{}", item.getProperties().toString()); <END> this.sceneManager.handleEvent(item); } } }</code><technical_language>remove toString()</technical_language>

Target:
private void handleEvent(JsonArray array) { if (array.size() > 0) { Event event = new JSONEventImpl(array); for (EventItem item : event.getEventItems()) { logger.info("{}", item.getProperties()); this.sceneManager.handleEvent(item); } } }
Source:
<code>static boolean needsQuotedPrintableWithinPhrase(final int cp) { switch (cp) { case '!': case '*': case '+': case '-': case '/': case '=': case '_': return false; default: if <START> ((cp >= 'a' && cp <= 'z') <END> || (cp >= 'A' && cp <= 'Z') || (cp >= '0' && cp <= '9')) { return false; } else { return true; } } }</code><technical_language>I prefer this written like: 'a' <= cp && cp <= 'z' this is closer mathematical notation: 'a' <= cp <= 'z' codebase places this pattern. for 2 lines</technical_language>

Target:
static boolean needsQuotedPrintableWithinPhrase(final int cp) { switch (cp) { case '!': case '*': case '+': case '-': case '/': case '=': case '_': return false; default: if (('a' <= cp && cp <= 'z') || ('A' <= cp && cp <= 'Z') || ('0' <= cp && cp <= '9')) { return false; } else { return true; } } }
Source:
<code>private void updateRepoState(IFileBuffer buffer) { IFile file = getResource(buffer); if (file != null) { return; } Repository repo = getRepository(buffer); if (repo == null || repo.isBare()) { return; } IPath relativePath = getRelativePath(repo, buffer); if (relativePath == null) { return; } <START> IndexDiffCacheEntry diffEntry = Activator <END> .getDefault().getIndexDiffCache() .getIndexDiffCacheEntry(repo); if (diffEntry != null) { if (GITIGNORE_NAME.equals(relativePath.lastSegment())) { diffEntry.refresh(); } else { diffEntry.refreshFiles( Collections.singleton(relativePath.toString())); } } }</code><technical_language>If non-static, do getIndexDiffCacheEntry(repo) here</technical_language>

Target:
private void updateRepoState(IFileBuffer buffer) { IFile file = getResource(buffer); if (file != null) { return; } Repository repo = getRepository(buffer); if (repo == null || repo.isBare()) { return; } IPath relativePath = getRelativePath(repo, buffer); if (relativePath == null) { return; } IndexDiffCacheEntry diffEntry = getIndexDiffCacheEntry(repo); if (diffEntry != null) { if (GITIGNORE_NAME.equals(relativePath.lastSegment())) { diffEntry.refresh(); } else { diffEntry.refreshFiles( Collections.singleton(relativePath.toString())); } } }
Source:
<code>public static Map<String, String> buildData(long userId, Event event, Position position) { Map<String, String> data = new HashMap<>(); try { if (event != null) { <START> String eventJson = Context.getObjectMapper().writeValueAsString(event); <END> data.put("eventJson", eventJson); } if (position != null) { String positionJson = Context.getObjectMapper().writeValueAsString(position); data.put("positionJson", positionJson); } } catch (JsonProcessingException e) { LOGGER.warn("Notification JSON formatting error", e); } return data; }</code><technical_language>Remove unnecessary variable</technical_language>

Target:
public static Map<String, String> buildData(long userId, Event event, Position position) { Map<String, String> data = new HashMap<>(); try { if (event != null) { data.put(KEY_DATA_EVENT, Context.getObjectMapper().writeValueAsString(event)); } if (position != null) { data.put(KEY_DATA_POSITION, Context.getObjectMapper().writeValueAsString(position)); } } catch (JsonProcessingException e) { LOGGER.warn("Notification JSON formatting error", e); } return data; }
Source:
<code><START> public void done() throws CommitException { <END> commit(); close(); }</code><technical_language>nice try finally</technical_language>

Target:
public void done() throws CommitException { try { commit(); } finally { close(); } }
Source:
<code>protected void clientInit() { configuration.setApi(new OrcidApi20()); configuration.setProfileDefinition(new OrcidProfileDefinition()); configuration.setTokenAsHeader(true); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorDescription = ctx.getRequestParameter(OAuthCredentialsException.ERROR_DESCRIPTION); <START> if ("access_denied".equals(error.orElse(null)) && "User denied access".equals(errorDescription.orElse(null))) { <END> return true; } else { return false; } }); super.clientInit(); }</code><technical_language>prefer map and/or flatMap nulls</technical_language>

Target:
protected void clientInit() { configuration.setApi(new OrcidApi20()); configuration.setProfileDefinition(new OrcidProfileDefinition()); configuration.setTokenAsHeader(true); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> error = ctx.getRequestParameter(OAuthCredentialsException.ERROR); final Optional<String> errorDescription = ctx.getRequestParameter(OAuthCredentialsException.ERROR_DESCRIPTION); return error.map(e -> "access_denied".equals(e)).orElse(false) && errorDescription.map(e -> "User denied access".equals(e)).orElse(false); }); super.clientInit(); }
Source:
<code>private Contentlet createContentlet() throws DotDataException, DotSecurityException { final ContentletDataGen contentletDataGen = new ContentletDataGen( contentTypeAPI.find("Youtube").id()); Contentlet contentlet = contentletDataGen.next(); contentlet.setStringProperty("widgetTitle", "New YouTube Content"); contentlet.setStringProperty("url", "new-youtube-content"); contentlet = contentletDataGen.persist(contentlet); <START> return contentlet; <END> }</code><technical_language>above, do this in line</technical_language>

Target:
private Contentlet createContentlet() throws DotDataException, DotSecurityException { return new ContentletDataGen(contentTypeAPI.find("Youtube").id()) .setProperty("widgetTitle", "New YouTube Content") .setProperty("url", "new-youtube-content").nextPersisted(); }
Source:
<code>public void deleteRow(final String tableName, final Object rowKey) { if (tableName == null || rowKey == null) { throw new IllegalArgumentException("Can't delete a row without having tableName or rowKey"); } byte[] rowKeyAsByteArray = getValueAsByteArray(rowKey); if (rowKeyAsByteArray.length > 0) { try (final Table table = _connection.getTable(TableName.valueOf(tableName))) { if (rowExists(table, rowKeyAsByteArray)) { table.delete(new Delete(rowKeyAsByteArray)); } else { logger.warn("Rowkey with value doesn't exist in the table", rowKey.toString()); } } catch (IOException e) { throw new MetaModelException(e); } } else { <START> logger.info("Have not deleted a row, which has an empty (\"\") rowKey."); <END> } }</code><technical_language>throw instead? log error level. I throwing sense</technical_language>

Target:
public void deleteRow(final String tableName, final Object rowKey) { if (tableName == null || rowKey == null) { throw new IllegalArgumentException("Can't delete a row without having tableName or rowKey"); } byte[] rowKeyAsByteArray = getValueAsByteArray(rowKey); if (rowKeyAsByteArray.length > 0) { try (final Table table = _connection.getTable(TableName.valueOf(tableName))) { if (rowExists(table, rowKeyAsByteArray)) { table.delete(new Delete(rowKeyAsByteArray)); } else { logger.warn("Rowkey with value doesn't exist in the table", rowKey.toString()); } } catch (IOException e) { throw new MetaModelException(e); } } else { throw new IllegalArgumentException("Can't delete a row without an empty rowKey."); } }
Source:
<code>private byte[] readKeyData() throws IOException { final File keyFile = new File(mContext.getDir(mContext.getPackageName(), Context.MODE_PRIVATE), ADALKS); if (!keyFile.exists()) { throw new IOException("Key file to read does not exist"); } Logger.v(TAG, "Reading key data from a file"); final InputStream in = new FileInputStream(keyFile); try { final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); <START> final byte[] buffer = new byte[1024]; <END> int count; while ((count = in.read(buffer)) != -1) { bytes.write(buffer, 0, count); } return bytes.toByteArray(); } finally { in.close(); } }</code><technical_language>@weijjia I ok this, I good a class local constant</technical_language>

Target:
private byte[] readKeyData() throws IOException { final File keyFile = new File(mContext.getDir(mContext.getPackageName(), Context.MODE_PRIVATE), ADALKS); if (!keyFile.exists()) { throw new IOException("Key file to read does not exist"); } Logger.v(TAG, "Reading key data from a file"); final InputStream in = new FileInputStream(keyFile); try { final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); final byte[] buffer = new byte[KEY_FILE_SIZE]; int count; while ((count = in.read(buffer)) != -1) { bytes.write(buffer, 0, count); } return bytes.toByteArray(); } finally { in.close(); } }
Source:
<code>public MatrixServiceImpl(DataService dataService, FileStore fileStore) { <START> this.dataService = dataService; <END> this.fileStore = fileStore; }</code><technical_language>Objects.requireNonNull()</technical_language>

Target:
public MatrixServiceImpl(DataService dataService, FileStore fileStore) { this.dataService = Objects.requireNonNull(dataService); this.fileStore = Objects.requireNonNull(fileStore); }
Source:
<code>public DynamicTableSink createDynamicTableSink(Context context) { final FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context); helper.validate(); final JdbcOptions jdbcOptions = getJdbcOptions(helper.getOptions()); final DataType rowDataType = context.getCatalogTable().getSchema().toPhysicalRowDataType(); final TableSchema formatSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema()); <START> final DataType[] fieldDataTypes = formatSchema.getFieldDataTypes(); <END> return new JdbcDynamicTableSink( jdbcOptions, getJdbcExecutionOptions(helper.getOptions()), getJdbcDmlOptions(jdbcOptions, context.getCatalogTable().getSchema()), rowDataType, fieldDataTypes); }</code><technical_language>need declare local field final</technical_language>

Target:
public DynamicTableSink createDynamicTableSink(Context context) { final FactoryUtil.TableFactoryHelper helper = FactoryUtil.createTableFactoryHelper(this, context); final ReadableConfig config = helper.getOptions(); helper.validate(); validateConfigOptions(config); JdbcOptions jdbcOptions = getJdbcOptions(config); TableSchema physicalSchema = TableSchemaUtils.getPhysicalSchema(context.getCatalogTable().getSchema()); return new JdbcDynamicTableSink( jdbcOptions, getJdbcExecutionOptions(config), getJdbcDmlOptions(jdbcOptions, physicalSchema), physicalSchema); }
Source:
<code>@Nonnull private Set<SourceExpression> parseSourceList() throws DirectiveParseException { Set<SourceExpression> sourceExpressions = new LinkedHashSet<>(); boolean parseException = false; <START> Map<String, Boolean> seenStates = new HashMap<>(); <END> seenStates.put("seenNone", false); seenStates.put("seenUnsafeInline", false); seenStates.put("seenHashOrNonce", false); while (this.hasNext(SubDirectiveValueToken.class)) { try { SourceExpression se = this.parseSourceExpression(seenStates, !sourceExpressions.isEmpty()); if (se == None.INSTANCE) { seenStates.put("seenNone", true); } else if (se == KeywordSource.UnsafeInline) { seenStates.put("seenUnsafeInline", true); } else if (se instanceof HashSource || se instanceof NonceSource) { seenStates.put("seenHashOrNonce", true); } sourceExpressions.add(se); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_SOURCE_LIST; } return sourceExpressions; }</code><technical_language>Instead of booleans, existence, means a set</technical_language>

Target:
@Nonnull private Set<SourceExpression> parseSourceList() throws DirectiveParseException { Set<SourceExpression> sourceExpressions = new LinkedHashSet<>(); boolean parseException = false; Set<SeenStates> seenStates = new HashSet<>(); while (this.hasNext(SubDirectiveValueToken.class)) { try { SourceExpression se = this.parseSourceExpression(seenStates, !sourceExpressions.isEmpty()); if (se == None.INSTANCE) { seenStates.add(SeenStates.SEEN_NONE); } else if (se == KeywordSource.UnsafeInline) { seenStates.add(SeenStates.SEEN_UNSAFE_INLINE); } else if (se instanceof HashSource) { seenStates.add(SeenStates.SEEN_HASH); } else if (se instanceof NonceSource) { seenStates.add(SeenStates.SEEN_NONCE); } sourceExpressions.add(se); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_SOURCE_LIST; } return sourceExpressions; }
Source:
<code>public List<ConditionHistory> getConditionHistory(Patient patient) { List<Condition> conditionList = conditionDAO.getConditionHistory(patient); List<ConditionHistory> conditionHistoryList = new ArrayList<ConditionHistory>(); List<Condition> groupedConditions = new ArrayList<Condition>(); if (CollectionUtils.isEmpty(conditionList)) return new ArrayList<ConditionHistory>(); ConditionHistory conditionhistory = createConditionHistory(conditionList.get(0)); groupedConditions.add(conditionList.get(0)); for (int i = 1; i < conditionList.size(); i++) { Condition condition = conditionList.get(i); <START> if (condition.getConcept().equals(conditionhistory.getCondition())) { <END> groupedConditions.add(condition); } else { conditionhistory.setConditions(groupedConditions); conditionHistoryList.add(conditionhistory); conditionhistory = createConditionHistory(condition); groupedConditions = new ArrayList<Condition>(); groupedConditions.add(condition); } } if (CollectionUtils.isNotEmpty(groupedConditions)) { updateConditionHistoryList(conditionHistoryList, groupedConditions, conditionhistory); } return conditionHistoryList; }</code><technical_language>This assumes conditionList conditions ordered concepts, I is true. ordered dateCreated. I need is Map(Concept, ConditionHistory) Map(String, ConditionHistory) (for coded conditions) distribute conditionList based concept nonCoded proper ConditionHistories</technical_language>

Target:
public Map<String, ConditionHistory> getConditionHistory(Patient patient) { List<Condition> conditionList = conditionDAO.getConditionHistory(patient); Map<String, ConditionHistory> allConditions = new HashMap<String, ConditionHistory>(); for (Condition condition : conditionList) { Concept concept = condition.getConcept(); ConditionHistory conditionHistory; String nonCodedConceptUuid = administrationService.getGlobalProperty(ConditionListConstants.GLOBAL_PROPERTY_NON_CODED_UUID); String key = concept.getUuid().equals(nonCodedConceptUuid) ? condition.getConditionNonCoded() : concept.getName().getName(); if (allConditions.containsKey(key)) { conditionHistory = allConditions.get(key); List<Condition> existingConditions = allConditions.get(condition.getConcept().getName().getName()).getConditions(); existingConditions.add(condition); conditionHistory.setConditions(existingConditions); } else { conditionHistory = new ConditionHistory(); ArrayList<Condition> conditions = new ArrayList<Condition>(); conditions.add(condition); conditionHistory.setConditions(conditions); conditionHistory.setCondition(condition.getConcept()); if (concept.getUuid().equals(nonCodedConceptUuid)) { conditionHistory.setNonCodedCondition(condition.getConcept().getUuid()); } } allConditions.put(key,conditionHistory); } return allConditions; }
Source:
<code>public BatchStatement build() { return new DefaultBatchStatement( batchType, statementsBuilder.build(), executionProfileName, executionProfile, keyspace, routingKeyspace, routingKey, routingToken, buildCustomPayload(), idempotent, tracing, timestamp, pagingState, pageSize, consistencyLevel, serialConsistencyLevel, timeout, <START> null); <END> }</code><technical_language>argument node (inherited parent builder) instead of null</technical_language>

Target:
public BatchStatement build() { return new DefaultBatchStatement( batchType, statementsBuilder.build(), executionProfileName, executionProfile, keyspace, routingKeyspace, routingKey, routingToken, buildCustomPayload(), idempotent, tracing, timestamp, pagingState, pageSize, consistencyLevel, serialConsistencyLevel, timeout, node); }
Source:
<code>public void testCacheManagerAttributes() throws Exception { assertEquals(3, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "CreatedCacheCount"))); assertEquals(3, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "DefinedCacheCount"))); assertEquals("clustered", getAttribute(provider, cacheManagerMBean, "Name")); assertEquals(2, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "ClusterSize"))); assertEquals("RUNNING", getAttribute(provider, cacheManagerMBean, "CacheManagerStatus")); assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "ClusterMembers").length()); assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "NodeAddress").length()); <START> assertEquals(3, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "RunningCacheCount"))); <END> assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "PhysicalAddresses").length()); assertEquals(Version.VERSION, getAttribute(provider, cacheManagerMBean, "Version")); String names = getAttribute(provider, cacheManagerMBean, "DefinedCacheNames"); assertTrue(names.contains("default") && names.contains("memcachedCache") && names.contains("hotRodTopologyCache")); }</code><technical_language>do need this change? Cluster registry longer eagerly started</technical_language>

Target:
public void testCacheManagerAttributes() throws Exception { assertEquals(4, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "CreatedCacheCount"))); assertEquals(4, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "DefinedCacheCount"))); assertEquals("clustered", getAttribute(provider, cacheManagerMBean, "Name")); assertEquals(2, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "ClusterSize"))); assertEquals("RUNNING", getAttribute(provider, cacheManagerMBean, "CacheManagerStatus")); assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "ClusterMembers").length()); assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "NodeAddress").length()); assertEquals(4, Integer.parseInt(getAttribute(provider, cacheManagerMBean, "RunningCacheCount"))); assertNotEquals(0, getAttribute(provider, cacheManagerMBean, "PhysicalAddresses").length()); assertEquals(Version.VERSION, getAttribute(provider, cacheManagerMBean, "Version")); String names = getAttribute(provider, cacheManagerMBean, "DefinedCacheNames"); assertTrue(names.contains("default") && names.contains("memcachedCache") && names.contains("hotRodTopologyCache")); }
Source:
<code>private void assertBranchesExist(Set<Branch> branches, String ... names) throws InterruptedException { Collection<String> branchNames = getBranchNames(branches); for (String name : names) { assertTrue(name + " branch not found in " + branchNames, branchNames.contains(name)); <START> } <END> }</code><technical_language>This is similar [assertBranchesExist(...)](<LINK_1> Hamcrest's [not(...)](<LINK_0> sneaked in</technical_language>

Target:
private void assertBranchesExist(Set<Branch> branches, String ... names) throws InterruptedException { Collection<String> branchNames = getBranchNames(branches); for (String name : names) { assertThat(branchNames, hasItem(name)); } }
Source:
<code><START> private void addSubscriptions(String... notifications) { <END> NuxeoPrincipal principal = session.getPrincipal(); String subscriber = NotificationConstants.USER_PREFIX + principal.getName(); for (String notif : notifications) { notificationService.addSubscription(subscriber, notif, annotatedDocumentModel, false, principal, notif); } }</code><technical_language>protected, other methods protected</technical_language>

Target:
protected void addSubscriptions(String... notifications) { NuxeoPrincipal principal = session.getPrincipal(); String subscriber = NotificationConstants.USER_PREFIX + principal.getName(); for (String notif : notifications) { notificationService.addSubscription(subscriber, notif, annotatedDocumentModel, false, principal, notif); } }
Source:
<code>public static void main(String[] args) { URL resource = Thread.currentThread().getContextClassLoader().getResource("netty-transports.yml"); if (resource != null) { System.setProperty(YAMLTransportConfigurationBuilder.NETTY_TRANSPORT_CONF, resource.getPath()); } else { <START> log.error("netty-transports.yml not found in resources - proceeding with default netty configuration"); <END> } new MicroservicesRunner() .deploy(new InterceptorService()) .addGlobalRequestInterceptor(new LogTextRequestInterceptor(), new PropertyAddRequestInterceptor()) .addGlobalResponseInterceptor(new LogTextResponseInterceptor(), new PropertyGetResponseInterceptor()) .start(); }</code><technical_language>If this condition is considered error, execution terminated printing error</technical_language>

Target:
public static void main(String[] args) { new MicroservicesRunner() .deploy(new InterceptorService()) .addGlobalRequestInterceptor(new LogTextRequestInterceptor(), new PropertyAddRequestInterceptor()) .addGlobalResponseInterceptor(new LogTextResponseInterceptor(), new PropertyGetResponseInterceptor()) .start(); }
Source:
<code>private void addErrorMetric(String transaction, String responseCode, String responseMessage, long count) { <START> final int MAX_RES_CODE_LENGTH_FOR_UDP = 50; <END> if (count > 0) { StringBuilder tag = new StringBuilder(70); tag.append(TAG_APPLICATION).append(application); tag.append(TAG_TRANSACTION).append(transaction); tag.append(TAG_RESPONSE_CODE).append(AbstractInfluxdbMetricsSender.tagToStringValue(responseCode)); if(this.influxdbMetricsManager instanceof UdpMetricsSender && responseMessage.length() > MAX_RES_CODE_LENGTH_FOR_UDP) { String trimmedMessage = responseMessage.substring(0, MAX_RES_CODE_LENGTH_FOR_UDP); tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(trimmedMessage + "...")); } else { tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(responseMessage)); } tag.append(userTag); StringBuilder field = new StringBuilder(30); field.append(METRIC_COUNT).append(count); influxdbMetricsManager.addMetric(measurement, tag.toString(), field.toString()); } }</code><technical_language>I this a property. point reference mentions 50 ? Thank</technical_language>

Target:
private void addErrorMetric(String transaction, String responseCode, String responseMessage, long count) { if (count > 0) { StringBuilder tag = new StringBuilder(70); tag.append(TAG_APPLICATION).append(application); tag.append(TAG_TRANSACTION).append(transaction); tag.append(TAG_RESPONSE_CODE).append(AbstractInfluxdbMetricsSender.tagToStringValue(responseCode)); if (this.influxdbMetricsManager instanceof UdpMetricsSender && responseMessageSize > 0 && responseMessage.length() > responseMessageSize) { String trimmedMessage = responseMessage.substring(0, responseMessageSize); tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(trimmedMessage + "...")); } else { tag.append(TAG_RESPONSE_MESSAGE).append(AbstractInfluxdbMetricsSender.tagToStringValue(responseMessage)); } tag.append(userTag); StringBuilder field = new StringBuilder(30); field.append(METRIC_COUNT).append(count); influxdbMetricsManager.addMetric(measurement, tag.toString(), field.toString()); } }