auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Stream<GatewayAccountPerformanceReportEntity> aggregateNumberAndValueOfPaymentsByGatewayAccount() { return entityManager .get() <START> .createQuery( <END> "SELECT new uk.gov.pay.connector.report.model.domain.GatewayAccountPerformanceReportEntity(" + " COALESCE(COUNT(c.amount), 0)," + " COALESCE(SUM(c.amount), 0)," + " COALESCE(AVG(c.amount), 0)," + " COALESCE(MIN(c.amount), 0)," + " COALESCE(MAX(c.amount), 0)," + " g.id" + " )" + " FROM ChargeEntity c" + " JOIN GatewayAccountEntity g" + " ON c.gatewayAccount.id = g.id" + " WHERE c.status = :status" + " AND g.type = :type" + " GROUP BY g.id" + " ORDER BY g.id ASC" ) .setParameter("status", CAPTURED.toString()) .setParameter("type", LIVE) .getResultStream(); }</code><technical_language>overloaded method of createQuery return a typedQuery passing in type argument. added nice fix there. This remove unchecked cast assignment warning. e.g. .createQuery( "SELECT new uk.gov.pay.connector.report.model.domain.GatewayAccountPerformanceReportEntity(" + " COALESCE(COUNT(c.amount), 0)," + " COALESCE(SUM(c.amount), 0)," + " COALESCE(AVG(c.amount), 0)," + " COALESCE(MIN(c.amount), 0)," + " COALESCE(MAX(c.amount), 0)," + " g.id" + " )" + " ChargeEntity c" + " JOIN GatewayAccountEntity g" + " c.gatewayAccount.id = g.id" + " c.status = :status" + " g.type = :type" + " GROUP g.id" + " ORDER g.id ASC" , GatewayAccountPerformanceReportEntity.class)</technical_language>

Target:
public Stream<GatewayAccountPerformanceReportEntity> aggregateNumberAndValueOfPaymentsByGatewayAccount() { return entityManager .get() .createQuery( "SELECT new uk.gov.pay.connector.report.model.domain.GatewayAccountPerformanceReportEntity(" + " COALESCE(COUNT(c.amount), 0)," + " COALESCE(SUM(c.amount), 0)," + " COALESCE(AVG(c.amount), 0)," + " COALESCE(MIN(c.amount), 0)," + " COALESCE(MAX(c.amount), 0)," + " g.id" + " )" + " FROM ChargeEntity c" + " JOIN GatewayAccountEntity g" + " ON c.gatewayAccount.id = g.id" + " WHERE c.status = :status" + " AND g.type = :type" + " GROUP BY g.id" + " ORDER BY g.id ASC" , GatewayAccountPerformanceReportEntity.class ) .setParameter("status", CAPTURED.toString()) .setParameter("type", LIVE) .getResultStream(); }
Source:
<code>private void init() { this.paused = false; this.stopped = true; this.tasksDoneCount = 0; this.tasksTotalCount = 0; this.initialized = false; defaultFetchFilter = new DefaultFetchFilter(); this.addFetchFilter(defaultFetchFilter); for (FetchFilter filter : extension.getCustomFetchFilters()) { this.addFetchFilter(filter); } for (ParseFilter filter : extension.getCustomParseFilters()) this.addParseFilter(filter); <START> this.setDefaultParseFilter(new DefaultParseFilter(spiderParam, extension.getMessages())); <END> defaultFetchFilter.setScanContext(this.scanContext); defaultFetchFilter.setDomainsAlwaysInScope(spiderParam.getDomainsAlwaysInScopeEnabled()); }</code><technical_language>This call controller directly, need expose in public API for now. - done in previous line longer needs done last</technical_language>

Target:
private void init() { this.paused = false; this.stopped = true; this.tasksDoneCount = 0; this.tasksTotalCount = 0; this.initialized = false; defaultFetchFilter = new DefaultFetchFilter(); this.addFetchFilter(defaultFetchFilter); for (FetchFilter filter : extension.getCustomFetchFilters()) { this.addFetchFilter(filter); } controller.setDefaultParseFilter( new DefaultParseFilter(spiderParam, extension.getMessages())); for (ParseFilter filter : extension.getCustomParseFilters()) this.addParseFilter(filter); defaultFetchFilter.setScanContext(this.scanContext); defaultFetchFilter.setDomainsAlwaysInScope(spiderParam.getDomainsAlwaysInScopeEnabled()); }
Source:
<code>public static void writeMetaDataFile(Configuration configuration, Path outputPath) { JobSummaryLevel level = ParquetOutputFormat.getJobSummaryLevel(configuration); <START> if (level != JobSummaryLevel.NONE) { <END> try { final FileSystem fileSystem = outputPath.getFileSystem(configuration); FileStatus outputStatus = fileSystem.getFileStatus(outputPath); List<Footer> footers; if (level == JobSummaryLevel.ALL) { footers = ParquetFileReader.readAllFootersInParallel(configuration, outputStatus, false); } else if (level == JobSummaryLevel.COMMON_ONLY) { footers = ParquetFileReader.readAllFootersInParallel(configuration, outputStatus, true); } else { throw new IllegalArgumentException("Unrecognized job summary level: " + level); } if (footers.isEmpty()) { return; } try { ParquetFileWriter.writeMetadataFile(configuration, outputPath, footers, level); } catch (Exception e) { LOG.warn("could not write summary file(s) for " + outputPath, e); final Path metadataPath = new Path(outputPath, ParquetFileWriter.PARQUET_METADATA_FILE); if (fileSystem.exists(metadataPath)) { fileSystem.delete(metadataPath, true); } final Path commonMetadataPath = new Path(outputPath, ParquetFileWriter.PARQUET_COMMON_METADATA_FILE); if (fileSystem.exists(commonMetadataPath)) { fileSystem.delete(commonMetadataPath, true); } } } catch (Exception e) { LOG.warn("could not write summary file for " + outputPath, e); } } }</code><technical_language>avoid nested blocks, invert condition exit early</technical_language>

Target:
public static void writeMetaDataFile(Configuration configuration, Path outputPath) { JobSummaryLevel level = ParquetOutputFormat.getJobSummaryLevel(configuration); if (level == JobSummaryLevel.NONE) { return; } try { final FileSystem fileSystem = outputPath.getFileSystem(configuration); FileStatus outputStatus = fileSystem.getFileStatus(outputPath); List<Footer> footers; switch (level) { case ALL: footers = ParquetFileReader.readAllFootersInParallel(configuration, outputStatus, false); break; case COMMON_ONLY: footers = ParquetFileReader.readAllFootersInParallel(configuration, outputStatus, true); break; default: throw new IllegalArgumentException("Unrecognized job summary level: " + level); } if (footers.isEmpty()) { return; } try { ParquetFileWriter.writeMetadataFile(configuration, outputPath, footers, level); } catch (Exception e) { LOG.warn("could not write summary file(s) for " + outputPath, e); final Path metadataPath = new Path(outputPath, ParquetFileWriter.PARQUET_METADATA_FILE); try { if (fileSystem.exists(metadataPath)) { fileSystem.delete(metadataPath, true); } } catch (Exception e2) { LOG.warn("could not delete metadata file" + outputPath, e2); } try { final Path commonMetadataPath = new Path(outputPath, ParquetFileWriter.PARQUET_COMMON_METADATA_FILE); if (fileSystem.exists(commonMetadataPath)) { fileSystem.delete(commonMetadataPath, true); } } catch (Exception e2) { LOG.warn("could not delete metadata file" + outputPath, e2); } } } catch (Exception e) { LOG.warn("could not write summary file for " + outputPath, e); } }
Source:
<code>public synchronized long getFirstId() throws IOException { <START> return (m_segments.size() == 0) ? -1 : m_segments.firstEntry().getValue().getStartId(); <END> }</code><technical_language>INVALID_ID</technical_language>

Target:
public synchronized long getFirstId() throws IOException { return (m_segments.size() == 0) ? PBDSegment.INVALID_ID : m_segments.firstEntry().getValue().getStartId(); }
Source:
<code>public static String getSlotSelector(String slotName) { Pattern pat = Pattern.compile("[A-Z][^A-Z]*$"); Matcher match = pat.matcher(slotName); <START> int lastCapitalIndex = -1; <END> if (match.find()) { lastCapitalIndex = match.start(); } if (lastCapitalIndex == -1) { return MOBILE_SLOTS_SELECTORS.get(slotName); } return SLOTS_SELECTORS.get(slotName); }</code><technical_language>match.matches()? a bit shorter. EDIT: do I know, really, Java. If works works</technical_language>

Target:
public static String getSlotSelector(String slotName) { Pattern pattern = Pattern.compile("[A-Z]"); Matcher match = pattern.matcher(slotName); int lastCapitalIndex = -1; if (match.find()) { lastCapitalIndex = match.start(); } if (lastCapitalIndex == -1) { return MOBILE_SLOTS_SELECTORS.get(slotName); } return SLOTS_SELECTORS.get(slotName); }
Source:
<code>protected ListenableFuture<? extends Iterable<LabelMeta>> fetchLabelMetas( final List<ResultSet> resultSets) { <START> List<ListenableFuture<LabelMeta>> metas = new ArrayList<>(); <END> for (ResultSet resultSet : resultSets) { for (Row row : resultSet) { CassandraLabelId id = CassandraLabelId.fromLong(row.getLong(1)); metas.add(cassandraStore.getMeta(id, id.type())); } } return allAsList(metas); }</code><technical_language>this variable final</technical_language>

Target:
protected ListenableFuture<? extends Iterable<LabelMeta>> fetchLabelMetas( final List<ResultSet> resultSets) { final List<ListenableFuture<LabelMeta>> metas = new ArrayList<>(); for (final ResultSet resultSet : resultSets) { for (final Row row : resultSet) { final CassandraLabelId id = CassandraLabelId.fromLong(row.getLong("label_id")); metas.add(cassandraStore.getMeta(id, id.type())); } } return allAsList(metas); }
Source:
<code>public <R extends HttpRequest> R bindToRequest(R request, Object input) { Iterable<?> values = Iterable.class.cast(checkNotNull(input, "subnetIds")); Builder<String, String> builder = ImmutableMultimap.builder(); int i = 0; for (Object o : values) { <START> builder.put("Subnets.member." + (i++ + 1), o.toString()); <END> } ImmutableMultimap<String, String> forms = builder.build(); return (R) (forms.size() == 0 ? request : request.toBuilder().replaceFormParams(forms).build()); }</code><technical_language>Initialize i 1 code easier read</technical_language>

Target:
public <R extends HttpRequest> R bindToRequest(R request, Object input) { Iterable<?> values = Iterable.class.cast(checkNotNull(input, "subnetIds")); Builder<String, String> builder = ImmutableMultimap.builder(); int i = 1; for (Object o : values) { builder.put("Subnets.member." + (i++), o.toString()); } ImmutableMultimap<String, String> forms = builder.build(); return (R) (forms.size() == 0 ? request : request.toBuilder().replaceFormParams(forms).build()); }
Source:
<code>public void checkSamplefn5NaN() { final String expression = "fn:arrayNaN(\"x\", 5)"; StringBuffer sb = new StringBuffer(""); try{ double[] result = performExpression(expression); for (double value: result){ sb.append(value+","); } System.out.println("JEXLExpressionEngineEnhancedTest: expression="+expression +"\n result "+sb.toString()); assertEquals(Double.NaN, result[0], DELTA); assertEquals(Double.NaN, result[1], DELTA); assertEquals(Double.NaN, result[2], DELTA); assertEquals(Double.NaN, result[3], DELTA); assertEquals(Double.NaN, result[4], DELTA); assertEquals(5, result[5], DELTA); assertEquals(6, result[6], DELTA); <START> } catch (Exception e){ <END> throw new RuntimeException(e); } }</code><technical_language>Another note: need for catch blocks, throwing exceptions method level effect</technical_language>

Target:
public void checkSamplefn5NaN() throws ExpressionException { final String expression = "fn:arrayNaN(\"x\", 5)"; StringBuffer sb = new StringBuffer(""); double[] result = performExpression(expression); for (double value: result){ sb.append(value+","); } System.out.println("JEXLExpressionEngineEnhancedTest: expression="+expression +"\n result "+sb.toString()); assertEquals(Double.NaN, result[0], DELTA); assertEquals(Double.NaN, result[1], DELTA); assertEquals(Double.NaN, result[2], DELTA); assertEquals(Double.NaN, result[3], DELTA); assertEquals(Double.NaN, result[4], DELTA); assertEquals(5, result[5], DELTA); assertEquals(6, result[6], DELTA); }
Source:
<code>public void startShooting() { if(timer.getDuration()<(1000 / firerate)) { return; } timer.reset(); shooting = true; new Thread(() -> { while (shooting) { <START> Vector2 orientation = gameObject.getBody().getOrientation().setMagnitude(gameObject.getBody().getHeight() / 2); <END> Point2D position = new Point2D(gameObject.getBody().getCenter().getX() + orientation.getX(), gameObject.getBody().getCenter().getY() + orientation.getY()); Vector2 velocity = new Vector2(gameObject.getBody().getOrientation()); velocity.setMagnitude(300); Bullet bullet = new Bullet(bulletsCreated++, position, 10, 10, velocity, damage, Bullet.Type.RIFLE); setChanged(); notifyObservers(bullet); System.out.println(this.countObservers()); activeBullets.add(bullet); bullet.addObserver(this); try { Thread.sleep((long) (1000 / firerate)); } catch (Exception e) { e.printStackTrace(); } } }).start(); }</code><technical_language>doesnt this component pattern</technical_language>

Target:
public void startShooting() { if(timer.getDuration()<(1000 / firerate)) { return; } timer.reset(); shooting = true; new Thread(() -> { while (shooting) { Vector2 orientation = gameObject.getBody().getOrientation().setMagnitude(gameObject.getBody().getHeight() / 2); Point2D position = new Point2D(gameObject.getBody().getCenter().getX() + orientation.getX(), gameObject.getBody().getCenter().getY() + orientation.getY()); Vector2 velocity = new Vector2(gameObject.getBody().getOrientation()); velocity.setMagnitude(300); Bullet bullet = new Bullet(bulletsCreated++, position, 10, 10, velocity, damage, Bullet.Type.RIFLE,bulletImages.get(Bullet.Type.RIFLE)); setChanged(); notifyObservers(bullet); System.out.println(this.countObservers()); activeBullets.add(bullet); bullet.addObserver(this); try { Thread.sleep((long) (1000 / firerate)); } catch (Exception e) { e.printStackTrace(); } } }).start(); }
Source:
<code>public void testSimpleExpirationMaxIdle() throws Exception { for (int i = 0; i < SIZE; i++) { <START> cache.put("key-" + i, "value-" + i,-1, TimeUnit.MILLISECONDS, 1, TimeUnit.MILLISECONDS); <END> } timeService.advance(2); assertEquals(0, cache.size()); }</code><technical_language>I problem addressed in Metadata implementation. Negative time values converted, TimeUnit null result in exception</technical_language>

Target:
public void testSimpleExpirationMaxIdle() throws Exception { for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, null, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); assertEquals(0, cache.size()); }
Source:
<code>private boolean isNegateDominatingFirstRoundAttack(final GamePlayer player) { <START> final RulesAttachment ra = <END> (RulesAttachment) player.getAttachment(Constants.RULES_ATTACHMENT_NAME); return ra != null && ra.getNegateDominatingFirstRoundAttack(); }</code><technical_language>nit, please prefer spell out variable names. ra => rulesAttachment</technical_language>

Target:
private boolean isNegateDominatingFirstRoundAttack(final GamePlayer player) { final RulesAttachment rulesAttachment = (RulesAttachment) player.getAttachment(Constants.RULES_ATTACHMENT_NAME); return rulesAttachment != null && rulesAttachment.getNegateDominatingFirstRoundAttack(); }
Source:
<code>private <DRONE> void createDroneCallable(DroneRegistry registry, final InjectionPoint<DRONE> injectionPoint) { final DroneContext context = droneContext.get(); if(context.isFutureDroneStored(injectionPoint)) { <START> logger.warning("Couldn't create drone callable, because it was already created!"); <END> return; } final Instantiator instantiator = registry.getEntryFor(injectionPoint.getDroneType(), Instantiator.class); if (logger.isLoggable(Level.FINE)) { logger.fine("Using instantiator defined in class: " + instantiator.getClass().getName() + ", " + "with precedence " + instantiator.getPrecedence()); } beforeDroneCallableCreatedEvent.fire(new BeforeDroneCallableCreated(instantiator, injectionPoint)); CachingCallable futureDrone = new CachingCallableImpl<DRONE>() { @Override protected DRONE createInstance() throws Exception { DroneConfiguration<?> configuration = context.getDroneConfiguration(injectionPoint, DroneConfiguration.class); return (DRONE) instantiator.createInstance(configuration); } }; context.storeFutureDrone(injectionPoint, futureDrone); afterDroneCallableCreatedEvent.fire(new AfterDroneCallableCreated(injectionPoint)); }</code><technical_language>This log message is useless. Drone, etc</technical_language>

Target:
private <DRONE> void createDroneCallable(DroneRegistry registry, final InjectionPoint<DRONE> injectionPoint) { final DroneContext context = droneContext.get(); if (context.isFutureDroneStored(injectionPoint)) { logger.log(Level.WARNING, "Couldn''t create drone callable for injection point {0}, because it was already created!", injectionPoint); return; } final Instantiator instantiator = registry.getEntryFor(injectionPoint.getDroneType(), Instantiator.class); if (logger.isLoggable(Level.FINE)) { logger.fine("Using instantiator defined in class: " + instantiator.getClass().getName() + ", " + "with precedence " + instantiator.getPrecedence()); } beforeDroneCallableCreatedEvent.fire(new BeforeDroneCallableCreated(instantiator, injectionPoint)); CachingCallable futureDrone = new CachingCallableImpl<DRONE>() { @Override protected DRONE createInstance() throws Exception { DroneConfiguration<?> configuration = context.getDroneConfiguration(injectionPoint, DroneConfiguration.class); return (DRONE) instantiator.createInstance(configuration); } }; context.storeFutureDrone(injectionPoint, futureDrone); afterDroneCallableCreatedEvent.fire(new AfterDroneCallableCreated(injectionPoint)); }
Source:
<code>public FileObject addDescription(InputStream modsStream) { fileObj = createFileObject(); <START> BinaryObject mods = fileObj.addOriginalFile(modsStream, null, "text/xml", null); <END> repository.createRelationship(pid, IanaRelation.describedby, mods.getResource()); return fileObj; }</code><technical_language>Add a pcdm:hasRelatedObject relationship this contentObject description fileObject. image_1 in diagram for example. purpose of hasRelatedObject is ownership content object in description object, while iana:describedby is point out specifically part of description object describe contentObject</technical_language>

Target:
public FileObject addDescription(InputStream modsStream) { FileObject fileObj = createFileObject(); BinaryObject mods = fileObj.addOriginalFile(modsStream, null, "text/xml", null); repository.createRelationship(pid, PcdmModels.hasRelatedObject, fileObj.getResource()); repository.createRelationship(pid, Cdr.hasMods, mods.getResource()); return fileObj; }
Source:
<code>private ReferenceCountedOpenSslEngine retrieveEngine(long ssl) throws SSLException { ReferenceCountedOpenSslEngine engine = engineMap.get(ssl); if (engine == null) { throw new SSLException("Could not find Engine"); <START> } <END> return engine; }</code><technical_language>nit: find OpenSslEngine</technical_language>

Target:
private ReferenceCountedOpenSslEngine retrieveEngine(long ssl) throws SSLException { ReferenceCountedOpenSslEngine engine = engineMap.get(ssl); if (engine == null) { throw new SSLException("Could not find a " + StringUtil.simpleClassName(ReferenceCountedOpenSslEngine.class) + " for sslPointer " + ssl); } return engine; }
Source:
<code>public void initializeCache() { if (!isNeedToInitializeCache()) { return; } List<Quota> allQuotaIncludingConsumption = getQuotaDAO().getAllQuotaIncludingConsumption(); <START> <END> if (allQuotaIncludingConsumption == null) { return; } lock.writeLock().lock(); try { for (Quota quota : allQuotaIncludingConsumption) { if (!storagePoolQuotaMap.containsKey(quota.getStoragePoolId())) { storagePoolQuotaMap.put(quota.getStoragePoolId(), new HashMap<Guid,Quota>()); } storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quota.getId(), quota); } } finally { lock.writeLock().unlock(); } }</code><technical_language>null, if nothing, empty list</technical_language>

Target:
public void initializeCache() { if (!isNeedToInitializeCache()) { return; } log.info("Updating Quota Cache..."); long timeStart = System.currentTimeMillis(); List<Quota> allQuotaIncludingConsumption = getQuotaDAO().getAllQuotaIncludingConsumption(); if (allQuotaIncludingConsumption.isEmpty()) { return; } lock.writeLock().lock(); try { for (Quota quota : allQuotaIncludingConsumption) { if (!storagePoolQuotaMap.containsKey(quota.getStoragePoolId())) { storagePoolQuotaMap.put(quota.getStoragePoolId(), new HashMap<Guid,Quota>()); } storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quota.getId(), quota); } } finally { lock.writeLock().unlock(); } long timeEnd = System.currentTimeMillis(); log.infoFormat("Quota Cache updated. ({0} msec)", timeEnd-timeStart); }
Source:
<code>public Map<String, Object> generateCrossesTableWithDuplicationNotes(final List<String> tableHeaderList, final GermplasmListData crossesData) { final Map<String, Object> dataMap = new HashMap<>(); dataMap.put(tableHeaderList.get(CrossesListUtil.ENTRY_INDEX), crossesData.getEntryId()); final List<String> maleDesignations = this.getDesignationsList(crossesData.getMaleParents()); final String concatenatedMaleDesignations = this.concatenateMaleParentsValue(maleDesignations); dataMap.put(tableHeaderList.get(CrossesListUtil.PARENTAGE_INDEX), crossesData.getFemaleParentDesignation() + CrossesListUtil.DEFAULT_SEPARATOR + concatenatedMaleDesignations); dataMap.put(ColumnLabels.DUPLICATE.getName(), ""); dataMap.put(tableHeaderList.get(CrossesListUtil.FEMALE_PEDIGREE), crossesData.getFemaleParent().getPedigree()); <START> dataMap.put(ColumnLabels.FEMALE_PARENT.getName().toUpperCase(), crossesData.getFemaleParentDesignation()); <END> dataMap.put(tableHeaderList.get(CrossesListUtil.MALE_PEDIGREE), this.concatenateMaleParentsValue(this.getPedigreeList(crossesData.getMaleParents()))); dataMap.put(ColumnLabels.MALE_PARENT.getName().toUpperCase(), maleDesignations); dataMap.put(tableHeaderList.get(CrossesListUtil.BREEDING_METHOD_INDEX), crossesData.getBreedingMethodName()); dataMap.put(tableHeaderList.get(CrossesListUtil.SOURCE_INDEX), crossesData.getSeedSource()); dataMap.put(ColumnLabels.FGID.getName(), crossesData.getFemaleGid()); dataMap.put(ColumnLabels.MGID.getName(), this.getGids(crossesData.getMaleParents())); return dataMap; }</code><technical_language>java dataMap.put(ColumnLabels.FEMALE_PARENT.name(), I do row['FEMALE_PARENT'] in js</technical_language>

Target:
public Map<String, Object> generateCrossesTableWithDuplicationNotes(final List<String> tableHeaderList, final GermplasmListData crossesData) { final Map<String, Object> dataMap = new HashMap<>(); dataMap.put(tableHeaderList.get(CrossesListUtil.ENTRY_INDEX), crossesData.getEntryId()); final List<String> maleDesignations = this.getDesignationsList(crossesData.getMaleParents()); final String concatenatedMaleDesignations = this.concatenateMaleParentsValue(maleDesignations); dataMap.put(tableHeaderList.get(CrossesListUtil.PARENTAGE_INDEX), crossesData.getFemaleParentDesignation() + CrossesListUtil.DEFAULT_SEPARATOR + concatenatedMaleDesignations); dataMap.put(ColumnLabels.DUPLICATE.name(), ""); dataMap.put(tableHeaderList.get(CrossesListUtil.FEMALE_PEDIGREE), crossesData.getFemaleParent().getPedigree()); dataMap.put(ColumnLabels.FEMALE_PARENT.name(), crossesData.getFemaleParentDesignation()); dataMap.put(tableHeaderList.get(CrossesListUtil.MALE_PEDIGREE), this.concatenateMaleParentsValue(this.getPedigreeList(crossesData.getMaleParents()))); dataMap.put(ColumnLabels.MALE_PARENT.name(), maleDesignations); dataMap.put(tableHeaderList.get(CrossesListUtil.BREEDING_METHOD_INDEX), crossesData.getBreedingMethodName()); dataMap.put(tableHeaderList.get(CrossesListUtil.SOURCE_INDEX), crossesData.getSeedSource()); dataMap.put(ColumnLabels.FGID.name(), crossesData.getFemaleGid()); dataMap.put(ColumnLabels.MGID.name(), this.getGids(crossesData.getMaleParents())); return dataMap; }
Source:
<code>void notAcceptableNoProblem() throws Exception { mvc().perform(request(GET, "http://localhost/api/handler-ok") .accept("image/png")) .andExpect(status().isNotAcceptable()) <START> .andExpect(header().doesNotExist("Content-Type")); <END> }</code><technical_language>Content-Type MediaTypes.PROBLEM</technical_language>

Target:
void notAcceptableNoProblem() throws Exception { mvc().perform(request(GET, "http://localhost/api/handler-ok") .accept("image/png")) .andExpect(status().isNotAcceptable()) .andExpect(content().contentType("application/problem+json")) .andExpect(jsonPath("$.type").doesNotExist()) .andExpect(jsonPath("$.title", is("Not Acceptable"))) .andExpect(jsonPath("$.status", is(406))) .andExpect(jsonPath("$.detail", containsString("Could not find acceptable representation"))); }
Source:
<code>public void shouldBuildWildcardQueries() throws Exception { WildcardQuery query = (WildcardQuery) LuceneDocumentStructure.newWildCardStringQuery( "foo" ); <START> assertEquals( "0string", query.getField() ); <END> }</code><technical_language>inclined keeping existing index structure for single-property indexes</technical_language>

Target:
public void shouldBuildWildcardQueries() throws Exception { WildcardQuery query = (WildcardQuery) LuceneDocumentStructure.newWildCardStringQuery( "foo" ); assertEquals( "string", query.getField() ); }
Source:
<code>private static void initializeDeserializer(Configuration configuration, Deserializer deserializer, Properties schema) { try { configuration = copy(configuration); deserializer.initialize(configuration, schema); } <START> catch (SerDeException | RuntimeException e) { <END> throw new RuntimeException("error initializing deserializer: " + deserializer.getClass().getName(), e); } }</code><technical_language>I squash this commit modifies next line</technical_language>

Target:
private static void initializeDeserializer(Configuration configuration, Deserializer deserializer, Properties schema) { try { configuration = copy(configuration); deserializer.initialize(configuration, schema); validate(deserializer); } catch (SerDeException | RuntimeException e) { throw new RuntimeException("error initializing deserializer: " + deserializer.getClass().getName(), e); } }
Source:
<code>public void sender(List<String> to, String subject, String body) { final Properties properties = EmailConfiguration.getConfiguration().getProperties(); EmailSender.Builder builder = new EmailSender.Builder(properties); builder.setFrom(PASchedulerProperties.EMAIL_NOTIFICATIONS_SENDER_ADDRESS.getValueAsString()); <START> for (String t : to) { <END> builder.addRecipient(t); } builder.setSubject(subject); builder.setBody(body); builder.build().sendPlainTextEmail(); }</code><technical_language>please change name "t" )</technical_language>

Target:
public void sender(List<String> to, String subject, String body) { final Properties properties = EmailConfiguration.getConfiguration().getProperties(); EmailSender.Builder builder = new EmailSender.Builder(properties); builder.setFrom(PASchedulerProperties.EMAIL_NOTIFICATIONS_SENDER_ADDRESS.getValueAsString()); to.forEach(address -> builder.addRecipient(address)); builder.setSubject(subject); builder.setBody(body); builder.build().sendPlainTextEmail(); }
Source:
<code>protected void dataTemplateToJsonGenerator(Object data, DataSchema schema, JsonGenerator generator, boolean order) throws IOException { if (order) { JacksonTraverseCallback callback = new SchemaOrderTraverseCallback(schema, generator); Data.traverse(data, callback); } else { <START> objectToJsonGenerator(data, generator, false); <END> } }</code><technical_language>revert this change now</technical_language>

Target:
protected void dataTemplateToJsonGenerator(Object data, DataSchema schema, JsonGenerator generator, boolean order) throws IOException { if (order) { JacksonTraverseCallback callback = new SchemaOrderTraverseCallback(schema, generator); Data.traverse(data, callback); } else { objectToJsonGenerator(data, generator); } }
Source:
<code>public void configureServlets() { filter("/*").through(ObjectifyFilter.class); filter("/api/*").through(GuiceRestEasyFilterDispatcher.class); <START> serve("/image/*").with(Serve.class); <END> serve("*.gupld").with(Upload.class); }</code><technical_language>need this</technical_language>

Target:
public void configureServlets() { filter("/*").through(ObjectifyFilter.class); filter("/api/*").through(GuiceRestEasyFilterDispatcher.class); serve("*.gupld").with(Upload.class); }
Source:
<code>public final DefaultConstraintMapping createConstraintMapping() { GetterPropertySelectionStrategy getterPropertySelectionStrategyToUse = null; if ( getterPropertySelectionStrategy == null ) { getterPropertySelectionStrategyToUse = new DefaultGetterPropertySelectionStrategy(); <START> LOG.creatingConstraintMappingPriorToBuildingFactoryWithoutDefinedFilter(); <END> } else { getterPropertySelectionStrategyToUse = getterPropertySelectionStrategy; } LOG.creatingConstraintMappingPriorToBuildingFactory( getterPropertySelectionStrategyToUse.getClass() ); return new DefaultConstraintMapping( getterPropertySelectionStrategyToUse ); }</code><technical_language>a bit torn log methods. method names disturbing. intent of log are. Second, totally add a log here. Third, warn level issue while user wrong</technical_language>

Target:
public final DefaultConstraintMapping createConstraintMapping() { GetterPropertySelectionStrategy getterPropertySelectionStrategyToUse = null; if ( getterPropertySelectionStrategy == null ) { getterPropertySelectionStrategyToUse = new DefaultGetterPropertySelectionStrategy(); } else { getterPropertySelectionStrategyToUse = getterPropertySelectionStrategy; } return new DefaultConstraintMapping( new JavaBeanHelper( getterPropertySelectionStrategyToUse ) ); }
Source:
<code>private static boolean isEmptyLayout(@Nullable XmlFile psiFile) { if (psiFile == null) { return false; } <START> final boolean[] result = {false}; <END> psiFile.accept(new XmlRecursiveElementVisitor() { @Override public void visitXmlTag(XmlTag tag) { if (tag.getName().equals(EMPTY_LAYOUT_TAG)) { result[0] = true; } } }); return result[0]; }</code><technical_language>Cleaner: Ref (com.intellij.openapi.util.Ref) instead. e.g. final Ref<Boolean> result = new Ref<Boolean>(false); ... ref.set(true) ... return ref.get()</technical_language>

Target:
private static boolean isEmptyLayout(@Nullable XmlFile psiFile) { if (psiFile == null) { return false; } final Ref<Boolean> result = new Ref<Boolean>(false); psiFile.accept(new XmlRecursiveElementVisitor() { @Override public void visitXmlTag(XmlTag tag) { if (tag.getName().equals(EMPTY_LAYOUT_TAG)) { result.set(true); } } }); return result.get(); }
Source:
<code>public MockHttpServletRequest newPutRequest(String requestURI, Object content) { MockHttpServletRequest request = request(RequestMethod.PUT, requestURI); try { String json = new ObjectMapper().writeValueAsString(content); <START> request.setContent(json.getBytes("UTF-8")); <END> } catch (Exception e) { throw new RuntimeException(e); } return request; }</code><technical_language>Instead of line above, call newPutRequest(requestURI, json)</technical_language>

Target:
public MockHttpServletRequest newPutRequest(String requestURI, Object content) { try { String json = new ObjectMapper().writeValueAsString(content); return newPutRequest(requestURI, json); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private ChangeMessage newMessage(Input input, Change change) throws OrmException { StringBuilder <START> msg = <END> new StringBuilder( "Change " + change.getId().get() + ": " + ((change.getStatus() == Status.DRAFT) ? "Work In Progress" : "Ready For Review")); if (!Strings.nullToEmpty(input.message).trim().isEmpty()) { msg.append("\n\n"); msg.append(input.message.trim()); } ChangeMessage message = new ChangeMessage( new ChangeMessage.Key( change.getId(), ChangeUtil.messageUUID(dbProvider.get())), ((IdentifiedUser)userProvider.get()).getAccountId(), change.getLastUpdatedOn(), change.currentPatchSetId()); message.setMessage(msg.toString()); return message; }</code><technical_language>call this tmp buf I suggest msg below</technical_language>

Target:
private ChangeMessage newMessage(Input input, Change change) throws OrmException { StringBuilder buf = new StringBuilder(change.getStatus() == Status.DRAFT ? "Work In Progress" : "Ready For Review"); String msg = Strings.nullToEmpty(input.message).trim(); if (!msg.isEmpty()) { buf.append("\n\n"); buf.append(msg); } ChangeMessage message = new ChangeMessage( new ChangeMessage.Key( change.getId(), ChangeUtil.messageUUID(dbProvider.get())), ((IdentifiedUser)userProvider.get()).getAccountId(), change.getLastUpdatedOn(), change.currentPatchSetId()); message.setMessage(buf.toString()); return message; }
Source:
<code>public int hashCode() { <START> int result = container != null ? container.hashCode() : 0; <END> result = 31 * result + (aggregators != null ? Arrays.hashCode(aggregators) : 0); result = 31 * result + (queryGranularity != null ? queryGranularity.hashCode() : 0); return result; }</code><technical_language>container is non-null</technical_language>

Target:
public int hashCode() { int result = container.hashCode(); result = 31 * result + (aggregators != null ? Arrays.hashCode(aggregators) : 0); result = 31 * result + (queryGranularity != null ? queryGranularity.hashCode() : 0); return result; }
Source:
<code>private Map<String, List<BinaryMapIndexReader>> getDiffsByRegion() { Map<String, List<BinaryMapIndexReader>> result = new HashMap<>(); <START> Iterator<BinaryMapIndexReader> it = indexes.iterator(); <END> while (it.hasNext()) { BinaryMapIndexReader r = it.next(); if (r.getFile().getName().matches("[a-zA-Z_-]+([0-9]+_*){3}[.a-z]+")) { String currRegionName = r.getRegionName(); if (result.containsKey(currRegionName)) { result.get(currRegionName).add(r); } else { result.put(currRegionName, new ArrayList<>(Arrays.asList(r))); } it.remove(); } } return result; }</code><technical_language>Formatting</technical_language>

Target:
private Map<String, List<BinaryMapIndexReader>> getDiffsByRegion() { Map<String, List<BinaryMapIndexReader>> result = new HashMap<>(); Iterator<BinaryMapIndexReader> it = indexes.iterator(); while (it.hasNext()) { BinaryMapIndexReader r = it.next(); if (r.getFile().getName().matches(".*([0-9]+_*){3}\\.obf")) { String currRegionName = r.getRegionName(); if (result.containsKey(currRegionName)) { result.get(currRegionName).add(r); } else { result.put(currRegionName, new ArrayList<>(Arrays.asList(r))); } it.remove(); } } return result; }
Source:
<code>public void after() { <START> if (router != null) { <END> router.close(); } if (networkClient != null) { networkClient.close(); } Assert.assertEquals("All operations should have completed", 0, router.getOperationsCount()); if (cryptoJobHandler != null) { cryptoJobHandler.close(); } }</code><technical_language>check this is necessary now? This sort of invalidates assert below</technical_language>

Target:
public void after() { if (networkClient != null) { networkClient.close(); } Assert.assertEquals("All operations should have completed", 0, router.getOperationsCount()); if (cryptoJobHandler != null) { cryptoJobHandler.close(); } }
Source:
<code>private void add(String s) { try { writer.write(s); <START> } catch (IOException e) { <END> throw new RuntimeException(e); } }</code><technical_language>run throws IOException propagate</technical_language>

Target:
private void add(String s) throws IOException { writer.write(s); }
Source:
<code>public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JSONArray array = new JSONArray(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); <START> for (RemotingConnection connection : connections) { <END> JSONObject obj = new JSONObject(); obj.put("connectionID", connection.getID().toString()); obj.put("clientAddress", connection.getRemoteAddress()); obj.put("creationTime", connection.getCreationTime()); obj.put("implementation", connection.getClass().getSimpleName()); obj.put("sessionCount", server.getSessions(connection.getID().toString()).size()); array.put(obj); } return array.toString(); } finally { blockOnIO(); } }</code><technical_language>this wait json change</technical_language>

Target:
public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = Json.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = Json.createObjectBuilder() .add("connectionID", connection.getID().toString()) .add("clientAddress", connection.getRemoteAddress()) .add("creationTime", connection.getCreationTime()) .add("implementation", connection.getClass().getSimpleName()) .add("sessionCount", server.getSessions(connection.getID().toString()).size()); array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }
Source:
<code>public IteratorRange(final int minRow, final int maxRow) { <START> Preconditions.checkArgument(maxRow > 0); <END> this.minRow = minRow; this.maxRow = maxRow; }</code><technical_language>a message good here</technical_language>

Target:
public IteratorRange(final int minRow, final int maxRow) { Preconditions.checkArgument(maxRow > 0, "maxRow: %s", maxRow); this.minRow = minRow; this.maxRow = maxRow; }
Source:
<code>public void close() { if (!closable) { <START> throw new IllegalStateException("Called close on unclosable local memory context"); <END> } delegate.close(); }</code><technical_language>nit: I feel throw unsupported operation exception</technical_language>

Target:
public void close() { if (!closeable) { throw new UnsupportedOperationException("Called close on unclosable local memory context"); } delegate.close(); }
Source:
<code>public String get() { SelectedInventorySlotComponent component = localPlayer.getCharacterEntity().getComponent(SelectedInventorySlotComponent.class); for (InventoryCell cell : findAll(InventoryCell.class)) { <START> if (cell.getTargetItem().getComponent(DisplayNameComponent.class) != null && cell.getTargetSlot() == component.slot) <END> return cell.getTargetItem().getComponent(DisplayNameComponent.class).name; } return ""; }</code><technical_language>brackets ifs :D</technical_language>

Target:
public String get() { SelectedInventorySlotComponent component = localPlayer.getCharacterEntity().getComponent(SelectedInventorySlotComponent.class); for (InventoryCell cell : findAll(InventoryCell.class)) { if (cell.getTargetItem().getComponent(DisplayNameComponent.class) != null && cell.getTargetSlot() == component.slot) { return cell.getTargetItem().getComponent(DisplayNameComponent.class).name; } } return ""; }
Source:
<code>public ElasticGraphProvider() throws Exception{ System.setProperty("build.dir", System.getProperty("user.dir") + "\\build"); String path = new java.io.File( "." ).getCanonicalPath() + "\\data"; File file = new File(path); FileUtils.deleteQuietly(file); <START> JsonObject object = new JsonParser() <END> .parse(new FileReader(Resources.getResource("configuration/" + CONFIGURATION).getFile())) .getAsJsonObject(); this.client = ElasticClientFactory.createNode(CLUSTER_NAME, false, 9300).client(); }</code><technical_language>object is used..</technical_language>

Target:
public ElasticGraphProvider() throws Exception{ System.setProperty("build.dir", System.getProperty("user.dir") + "\\build"); String path = new java.io.File( "." ).getCanonicalPath() + "\\data"; File file = new File(path); FileUtils.deleteQuietly(file); this.client = ElasticClientFactory.createNode(CLUSTER_NAME, false, 9300).client(); }
Source:
<code>public void validate(final T credentials, final WebContext context) throws HttpAction { init(context); try { final CommonProfile profile = this.cache.get(credentials, () -> { logger.debug("Delegating authentication to {}...", delegate); delegate.validate(credentials, context); return credentials.getUserProfile(); }); credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } catch (ExecutionException e) { if (e.getCause() instanceof HttpAction) { throw (HttpAction) e.getCause(); } else { throw rethrowWrapper(e); } } catch (UncheckedExecutionException e) { if (e.getCause() instanceof RuntimeException) { <START> throw (RuntimeException) e.getCause(); <END> } else { throw rethrowWrapper(e); } } catch (ExecutionError e) { if (e.getCause() instanceof Error) { throw (Error) e.getCause(); } else { throw rethrowWrapper(e); } } }</code><technical_language>internally call a validate method, I search for HttpAction CredentialsException in thrown is. Other exceptions wrapped in TechnicalException. I need catch ExecutionError previously compiled a catch (Exception Error, it? I merge "as is" if want</technical_language>

Target:
public void validate(final T credentials, final WebContext context) throws HttpAction, CredentialsException { init(context); CommonProfile profile = this.cache.getIfPresent(credentials); if (profile == null) { logger.debug("No cached credentials found. Delegating authentication to {}...", delegate); delegate.validate(credentials, context); profile = credentials.getUserProfile(); logger.debug("Caching credential. Using profile {}...", profile); cache.put(credentials, profile); } else { credentials.setUserProfile(profile); logger.debug("Found cached credential. Using cached profile {}...", profile); } }
Source:
<code>public void uncaughtException(Thread thread, Throwable exception) { CrashReporter.storeUnhandledException(exception); preferences.edit().putBoolean(RECOVERED_FROM_CRASH, true).commit(); <START> CrashReporter.logException(exception); <END> exit(); }</code><technical_language>Misunderstanding :wink: java Log.e(TAG, "uncaughtException: ", exception); IMO located top (first statement)</technical_language>

Target:
public void uncaughtException(Thread thread, Throwable exception) { Log.e(TAG, "uncaughtException: ", exception); CrashReporter.storeUnhandledException(exception); preferences.edit().putBoolean(RECOVERED_FROM_CRASH, true).commit(); exit(); }
Source:
<code>private void checkForLanguageChangeAndAskForRestart(UGSEvent ugsEvent) { if (ugsEvent.isSettingChangeEvent()) { if (!StringUtils.equalsIgnoreCase(lastSelectedLanguage, backend.getSettings().getLanguage())) { lastSelectedLanguage = backend.getSettings().getLanguage(); Localization.initialize(backend.getSettings().getLanguage()); notifyRestartRequired(); <START> } else if (!StringUtils.equalsIgnoreCase(lastSelectedConnectionClass, backend.getSettings().getConnectionClass())) { <END> notifyRestartRequired(); } } }</code><technical_language>Gotcha, settings reloaded in ConnectionFactory app needs flush file first. call SettingsFactory.saveSettings(backend.getSettings()) instead of making user restart app. if work connection-string idea</technical_language>

Target:
private void checkForLanguageChangeAndAskForRestart(UGSEvent ugsEvent) { if (ugsEvent.isSettingChangeEvent() && !StringUtils.equalsIgnoreCase(lastSelectedLanguage, backend.getSettings().getLanguage())) { lastSelectedLanguage = backend.getSettings().getLanguage(); Localization.initialize(backend.getSettings().getLanguage()); notifyRestartRequired(); } }
Source:
<code>public void verify() { int countEnabled = 0; if (getTcpIpConfig().isEnabled()) { countEnabled++; } if (getMulticastConfig().isEnabled()) { countEnabled++; } if (getAwsConfig().isEnabled()) { countEnabled++; } if (getGcpConfig().isEnabled()) { countEnabled++; } if (getAzureConfig().isEnabled()) { countEnabled++; } if (getKubernetesConfig().isEnabled()) { countEnabled++; } if (getEurekaConfig().isEnabled()) { countEnabled++; } Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs = discoveryConfig.getDiscoveryStrategyConfigs(); if (discoveryStrategyConfigs.size() > 0) { <START> countEnabled++; <END> } if (countEnabled > 1) { throw new InvalidConfigurationException("Multiple join configuration cannot be enabled at the same time. Enable only " + "one of: TCP/IP, Multicast, AWS, GCP, Azure, Kubernetes, Eureka or Discovery Strategy"); } }</code><technical_language>countEnabled += discoveryStrategyConfigs.size();? I allow multiple discovery strategies time</technical_language>

Target:
public void verify() { int countEnabled = 0; if (getTcpIpConfig().isEnabled()) { countEnabled++; } if (getMulticastConfig().isEnabled()) { countEnabled++; } if (getAwsConfig().isEnabled()) { countEnabled++; } if (getGcpConfig().isEnabled()) { countEnabled++; } if (getAzureConfig().isEnabled()) { countEnabled++; } if (getKubernetesConfig().isEnabled()) { countEnabled++; } if (getEurekaConfig().isEnabled()) { countEnabled++; } Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs = discoveryConfig.getDiscoveryStrategyConfigs(); countEnabled += discoveryStrategyConfigs.size(); if (countEnabled > 1) { throw new InvalidConfigurationException("Multiple join configuration cannot be enabled at the same time. Enable only " + "one of: TCP/IP, Multicast, AWS, GCP, Azure, Kubernetes, Eureka or Discovery Strategy"); } }
Source:
<code><START> private void createMSWordRequirement(ArtifactToken folderToken, String number) { <END> Long reqId = Lib.generateArtifactIdAsInt(); String name = "MSWordRequirement" + number; OwArtifact wordReq = OwFactory.createArtifact(CoreArtifactTypes.CustomerRequirementMsWord, name, reqId); OwApplicability owApp = OwFactory.createApplicability("Base"); wordReq.setAppId(owApp); OwFactory.createAttribute(wordReq, CoreAttributeTypes.WordTemplateContent, "static id field " + number); collector.getCreate().add(wordReq); OwRelation relation = new OwRelation(); relation.setType(OwFactory.createRelationType(orcsApi, CoreRelationTypes.Default_Hierarchical__Parent)); relation.setArtToken(folderToken); wordReq.getRelations().add(relation); }</code><technical_language>this method method differ in Artifact Type - consider changing method signature include type, name core artifact types, duplicate</technical_language>

Target:
private void createMSWordRequirement(ArtifactToken folderToken, String number) { Long reqId = Lib.generateArtifactIdAsInt(); String name = "MSWordRequirement" + number; OwArtifact wordReq = OwFactory.createArtifact(CoreArtifactTypes.CustomerRequirementMsWord, name, reqId); OwApplicability owApp = OwFactory.createApplicability("Base"); wordReq.setAppId(owApp); OwFactory.createAttribute(wordReq, CoreAttributeTypes.WordTemplateContent, "WordTemplate Content field " + number); collector.getCreate().add(wordReq); OwRelation relation = new OwRelation(); relation.setType(OwFactory.createRelationType(orcsApi, CoreRelationTypes.Default_Hierarchical__Parent)); relation.setArtToken(folderToken); wordReq.getRelations().add(relation); }
Source:
<code>public void testThreadNameWithNumberDemon() { ThreadFactory localThreadFactory = ThreadUtils.createThreadFactory(THREAD_NAME_WITH_NUMBER, true); Thread daemonThread1 = localThreadFactory.newThread(EMPTY_RUNNABLE); <START> Thread daemonThread2 = localThreadFactory.newThread(EMPTY_RUNNABLE); <END> try { Assert.assertEquals(daemonThread1.getName(), THREAD_NAME + "1"); Assert.assertTrue(daemonThread1.isDaemon()); } finally { try { daemonThread1.join(); } catch (InterruptedException e) { e.printStackTrace(); } } try { Assert.assertEquals(daemonThread2.getName(), THREAD_NAME + "2"); Assert.assertTrue(daemonThread2.isDaemon()); } finally { try { daemonThread2.join(); } catch (InterruptedException e) { e.printStackTrace(); } } }</code><technical_language>Do need daemonThread2 in this test</technical_language>

Target:
public void testThreadNameWithNumberDemon() { ThreadFactory localThreadFactory = ThreadUtils.createThreadFactory(THREAD_NAME_WITH_NUMBER, true); Thread daemonThread1 = localThreadFactory.newThread(EMPTY_RUNNABLE); Thread daemonThread2 = localThreadFactory.newThread(EMPTY_RUNNABLE); try { assertEquals(THREAD_NAME + "1", daemonThread1.getName()); assertTrue(daemonThread1.isDaemon()); } finally { try { daemonThread1.join(); } catch (InterruptedException e) { } } try { assertEquals(THREAD_NAME + "2", daemonThread2.getName()); assertTrue(daemonThread2.isDaemon()); } finally { try { daemonThread2.join(); } catch (InterruptedException e) { } } }
Source:
<code>private Optional<String> checkTagValue(final String tagName, final String value) { if (value == null) { return Optional.empty(); } final Matcher matcher = pattern.matcher(value); if (matcher.matches()) { return Optional.empty(); } else { <START> return Optional.of(String.format("The values of tags in a Sam header must adhere to the regex \"^[ -~]+$\", " + <END> "but the value provided for %s, '%s', doesn't.", tagName, value)); } }</code><technical_language>Sam caps</technical_language>

Target:
private Optional<String> checkTagValue(final String tagName, final String value) { if (value == null) { return Optional.empty(); } final Matcher matcher = pattern.matcher(value); if (matcher.matches()) { return Optional.empty(); } else { return Optional.of(String.format("The values of tags in a SAM header must adhere to the regular expression '%s'," + "but the value provided for %s, '%s', doesn't.",READGROUP_ID_REGEX, tagName, value)); } }