auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private TileMatrixSet getTileMatrixSet() throws IllegalArgumentException { List<TileMatrixSet> possibleTileMatrixSets = new ArrayList<>(); for (TileMatrixSet tms : capabilities.getTileMatrixSets()) { String key = tms.getTileMatrixMap().keySet().iterator().next(); possibleTileMatrixSets.add(tms); } if (possibleTileMatrixSets.isEmpty()) { throw new NullPointerException("Could not find any TileMatrixSets"); } if (possibleTileMatrixSets.size() == 1) { return possibleTileMatrixSets.get(0); } HashMap<String, String> alternativeTileMatrixSets = new HashMap<>(); JSONObject useThisTileMatrixSetInstead = layerService.find(layer.getId()).getOptions().optJSONObject("useThisAlternativeTileMatrixSet"); if (useThisTileMatrixSetInstead == null) { alternativeTileMatrixSets.put(srs, srs); } else if (useThisTileMatrixSetInstead.length() > 0) { Iterator iterator = useThisTileMatrixSetInstead.keys(); while (iterator.hasNext()) { String nextKey = (String) iterator.next(); alternativeTileMatrixSets.put(nextKey, useThisTileMatrixSetInstead.optString(nextKey)); } } TileMatrixSet setToReturn = null; for (TileMatrixSet tms : possibleTileMatrixSets) { String tileMatrixSetName = tms.getTileMatrixMap().keySet().iterator().next(); for (Map.Entry<String, String> entry : alternativeTileMatrixSets.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (tileMatrixSetName.contains(key) || tileMatrixSetName.contains(value)) { setToReturn = tms; break; } } } if (setToReturn != null) { return setToReturn; } throw new IllegalArgumentException("Could not find TileMatrixSet for the requested crs"); }

Target:
private TileMatrixSet getTileMatrixSet() throws IllegalArgumentException { List<TileMatrixSet> possibleTileMatrixSets = new ArrayList<>(); for (TileMatrixSet tms : capabilities.getTileMatrixSets()) { if (srs.equals(ProjectionHelper.shortSyntaxEpsg(tms.getCrs()))) { possibleTileMatrixSets.add(tms); } } if (possibleTileMatrixSets.isEmpty()) { throw new IllegalArgumentException("Could not find TileMatrixSet for the requested crs"); } if (possibleTileMatrixSets.size() == 1) { return possibleTileMatrixSets.get(0); } return determineTileMatrixSetToUse(possibleTileMatrixSets); }
Source:
public int getMinimumValue() { switch (relation) { case LESS_THAN: case LESS_THAN_OR_EQUAL: return Integer.MIN_VALUE; case GREATER_THAN_OR_EQUAL: case EQUAL: return queryInt; case GREATER_THAN: if (queryInt == Integer.MAX_VALUE) { return queryInt; } else { return queryInt + 1; } default: throw new IllegalStateException("Unknown relation " + relation); } }

Target:
public int getMinimumValue() { return range.min; }
Source:
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" ) .setParameter("status", CAPTURED.toString()) .setParameter("type", LIVE) .getResultStream(); }

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:
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); this.setDefaultParseFilter(new DefaultParseFilter(spiderParam, extension.getMessages())); defaultFetchFilter.setScanContext(this.scanContext); defaultFetchFilter.setDomainsAlwaysInScope(spiderParam.getDomainsAlwaysInScopeEnabled()); }

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:
public static void writeMetaDataFile(Configuration configuration, Path outputPath) { JobSummaryLevel level = ParquetOutputFormat.getJobSummaryLevel(configuration); if (level != JobSummaryLevel.NONE) { 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); } } }

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:
public synchronized long getFirstId() throws IOException { return (m_segments.size() == 0) ? -1 : m_segments.firstEntry().getValue().getStartId(); }

Target:
public synchronized long getFirstId() throws IOException { return (m_segments.size() == 0) ? PBDSegment.INVALID_ID : m_segments.firstEntry().getValue().getStartId(); }
Source:
public static String getSlotSelector(String slotName) { Pattern pat = Pattern.compile("[A-Z][^A-Z]*$"); Matcher match = pat.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); }

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:
protected ListenableFuture<? extends Iterable<LabelMeta>> fetchLabelMetas( final List<ResultSet> resultSets) { List<ListenableFuture<LabelMeta>> metas = new ArrayList<>(); 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); }

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:
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) { builder.put("Subnets.member." + (i++ + 1), o.toString()); } ImmutableMultimap<String, String> forms = builder.build(); return (R) (forms.size() == 0 ? request : request.toBuilder().replaceFormParams(forms).build()); }

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:
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); } catch (Exception e){ throw new RuntimeException(e); } }

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:
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); 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(); }

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:
public void testSimpleExpirationMaxIdle() throws Exception { for (int i = 0; i < SIZE; i++) { cache.put("key-" + i, "value-" + i,-1, TimeUnit.MILLISECONDS, 1, TimeUnit.MILLISECONDS); } timeService.advance(2); assertEquals(0, cache.size()); }

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:
private boolean isNegateDominatingFirstRoundAttack(final GamePlayer player) { final RulesAttachment ra = (RulesAttachment) player.getAttachment(Constants.RULES_ATTACHMENT_NAME); return ra != null && ra.getNegateDominatingFirstRoundAttack(); }

Target:
private boolean isNegateDominatingFirstRoundAttack(final GamePlayer player) { final RulesAttachment rulesAttachment = (RulesAttachment) player.getAttachment(Constants.RULES_ATTACHMENT_NAME); return rulesAttachment != null && rulesAttachment.getNegateDominatingFirstRoundAttack(); }
Source:
private <DRONE> void createDroneCallable(DroneRegistry registry, final InjectionPoint<DRONE> injectionPoint) { final DroneContext context = droneContext.get(); if(context.isFutureDroneStored(injectionPoint)) { logger.warning("Couldn't create drone callable, because it was already created!"); 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)); }

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:
public FileObject addDescription(InputStream modsStream) { fileObj = createFileObject(); BinaryObject mods = fileObj.addOriginalFile(modsStream, null, "text/xml", null); repository.createRelationship(pid, IanaRelation.describedby, mods.getResource()); return fileObj; }

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:
private ReferenceCountedOpenSslEngine retrieveEngine(long ssl) throws SSLException { ReferenceCountedOpenSslEngine engine = engineMap.get(ssl); if (engine == null) { throw new SSLException("Could not find Engine"); } return engine; }

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:
public void initializeCache() { if (!isNeedToInitializeCache()) { return; } List<Quota> allQuotaIncludingConsumption = getQuotaDAO().getAllQuotaIncludingConsumption(); 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(); } }

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:
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()); dataMap.put(ColumnLabels.FEMALE_PARENT.getName().toUpperCase(), crossesData.getFemaleParentDesignation()); 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; }

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:
void notAcceptableNoProblem() throws Exception { mvc().perform(request(GET, "http://localhost/api/handler-ok") .accept("image/png")) .andExpect(status().isNotAcceptable()) .andExpect(header().doesNotExist("Content-Type")); }

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:
public void shouldBuildWildcardQueries() throws Exception { WildcardQuery query = (WildcardQuery) LuceneDocumentStructure.newWildCardStringQuery( "foo" ); assertEquals( "0string", query.getField() ); }

Target:
public void shouldBuildWildcardQueries() throws Exception { WildcardQuery query = (WildcardQuery) LuceneDocumentStructure.newWildCardStringQuery( "foo" ); assertEquals( "string", query.getField() ); }
Source:
private static void initializeDeserializer(Configuration configuration, Deserializer deserializer, Properties schema) { try { configuration = copy(configuration); deserializer.initialize(configuration, schema); } catch (SerDeException | RuntimeException e) { throw new RuntimeException("error initializing deserializer: " + deserializer.getClass().getName(), e); } }

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:
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()); for (String t : to) { builder.addRecipient(t); } builder.setSubject(subject); builder.setBody(body); builder.build().sendPlainTextEmail(); }

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:
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, false); } }

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:
public void configureServlets() { filter("/*").through(ObjectifyFilter.class); filter("/api/*").through(GuiceRestEasyFilterDispatcher.class); serve("/image/*").with(Serve.class); serve("*.gupld").with(Upload.class); }

Target:
public void configureServlets() { filter("/*").through(ObjectifyFilter.class); filter("/api/*").through(GuiceRestEasyFilterDispatcher.class); serve("*.gupld").with(Upload.class); }
Source:
public final DefaultConstraintMapping createConstraintMapping() { GetterPropertySelectionStrategy getterPropertySelectionStrategyToUse = null; if ( getterPropertySelectionStrategy == null ) { getterPropertySelectionStrategyToUse = new DefaultGetterPropertySelectionStrategy(); LOG.creatingConstraintMappingPriorToBuildingFactoryWithoutDefinedFilter(); } else { getterPropertySelectionStrategyToUse = getterPropertySelectionStrategy; } LOG.creatingConstraintMappingPriorToBuildingFactory( getterPropertySelectionStrategyToUse.getClass() ); return new DefaultConstraintMapping( getterPropertySelectionStrategyToUse ); }

Target:
public final DefaultConstraintMapping createConstraintMapping() { GetterPropertySelectionStrategy getterPropertySelectionStrategyToUse = null; if ( getterPropertySelectionStrategy == null ) { getterPropertySelectionStrategyToUse = new DefaultGetterPropertySelectionStrategy(); } else { getterPropertySelectionStrategyToUse = getterPropertySelectionStrategy; } return new DefaultConstraintMapping( new JavaBeanHelper( getterPropertySelectionStrategyToUse ) ); }
Source:
private static boolean isEmptyLayout(@Nullable XmlFile psiFile) { if (psiFile == null) { return false; } final boolean[] result = {false}; psiFile.accept(new XmlRecursiveElementVisitor() { @Override public void visitXmlTag(XmlTag tag) { if (tag.getName().equals(EMPTY_LAYOUT_TAG)) { result[0] = true; } } }); return result[0]; }

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:
public MockHttpServletRequest newPutRequest(String requestURI, Object content) { MockHttpServletRequest request = request(RequestMethod.PUT, requestURI); try { String json = new ObjectMapper().writeValueAsString(content); request.setContent(json.getBytes("UTF-8")); } catch (Exception e) { throw new RuntimeException(e); } return request; }

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:
private ChangeMessage newMessage(Input input, Change change) throws OrmException { StringBuilder msg = 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; }

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:
public int hashCode() { int result = container != null ? container.hashCode() : 0; result = 31 * result + (aggregators != null ? Arrays.hashCode(aggregators) : 0); result = 31 * result + (queryGranularity != null ? queryGranularity.hashCode() : 0); return result; }

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:
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("[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; }

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:
public void after() { if (router != null) { router.close(); } if (networkClient != null) { networkClient.close(); } Assert.assertEquals("All operations should have completed", 0, router.getOperationsCount()); if (cryptoJobHandler != null) { cryptoJobHandler.close(); } }

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:
private void add(String s) { try { writer.write(s); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private void add(String s) throws IOException { writer.write(s); }
Source:
public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JSONArray array = new JSONArray(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { 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(); } }

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:
public IteratorRange(final int minRow, final int maxRow) { Preconditions.checkArgument(maxRow > 0); this.minRow = minRow; this.maxRow = maxRow; }

Target:
public IteratorRange(final int minRow, final int maxRow) { Preconditions.checkArgument(maxRow > 0, "maxRow: %s", maxRow); this.minRow = minRow; this.maxRow = maxRow; }
Source:
public void close() { if (!closable) { throw new IllegalStateException("Called close on unclosable local memory context"); } delegate.close(); }

Target:
public void close() { if (!closeable) { throw new UnsupportedOperationException("Called close on unclosable local memory context"); } delegate.close(); }
Source:
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 ""; }

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:
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); JsonObject object = new JsonParser() .parse(new FileReader(Resources.getResource("configuration/" + CONFIGURATION).getFile())) .getAsJsonObject(); this.client = ElasticClientFactory.createNode(CLUSTER_NAME, false, 9300).client(); }

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:
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) { throw (RuntimeException) e.getCause(); } else { throw rethrowWrapper(e); } } catch (ExecutionError e) { if (e.getCause() instanceof Error) { throw (Error) e.getCause(); } else { throw rethrowWrapper(e); } } }

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:
public void uncaughtException(Thread thread, Throwable exception) { CrashReporter.storeUnhandledException(exception); preferences.edit().putBoolean(RECOVERED_FROM_CRASH, true).commit(); CrashReporter.logException(exception); exit(); }

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:
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(); } else if (!StringUtils.equalsIgnoreCase(lastSelectedConnectionClass, backend.getSettings().getConnectionClass())) { notifyRestartRequired(); } } }

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:
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) { countEnabled++; } 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"); } }

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:
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, "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); }

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:
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 { 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(); } } }

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:
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 regex \"^[ -~]+$\", " + "but the value provided for %s, '%s', doesn't.", tagName, value)); } }

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)); } }
Source:
public void trackWifiInfo(final Map<String, WifiInfo> wifiInfos) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); for(final Map.Entry <String, WifiInfo> entry : wifiInfos.entrySet()) { final WifiInfo wifiInfo = entry.getValue(); pipe.hset(WIFI_INFO_HASH_KEY, entry.getKey(), String.format("%s : %s", wifiInfo.ssid, wifiInfo.rssi)); } pipe.exec(); }catch (JedisDataException exception) { LOGGER.error("Failed getting data out of redis: {}", exception.getMessage()); jedisPool.returnBrokenResource(jedis); return; } catch(Exception exception) { LOGGER.error("Unknown error connection to redis: {}", exception.getMessage()); jedisPool.returnBrokenResource(jedis); return; } finally { try{ jedisPool.returnResource(jedis); }catch (JedisConnectionException e) { LOGGER.error(GENERIC_EXCEPTION_LOG_MESSAGE); } } LOGGER.debug("Tracked wifi info for senses", wifiInfos.size()); }

Target:
public void trackWifiInfo(final Map<String, WifiInfo> wifiInfos) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); for(final Map.Entry <String, WifiInfo> entry : wifiInfos.entrySet()) { final WifiInfo wifiInfo = entry.getValue(); pipe.hset(WIFI_INFO_HASH_KEY, entry.getKey(), String.format("%s : %s", wifiInfo.ssid, wifiInfo.rssi)); } pipe.exec(); }catch (JedisDataException exception) { LOGGER.error("error=jedis-data-exception message={}", exception.getMessage()); jedisPool.returnBrokenResource(jedis); return; } catch(Exception exception) { LOGGER.error("error=redis-unknown-failure message={}", exception.getMessage()); jedisPool.returnBrokenResource(jedis); return; } finally { try{ jedisPool.returnResource(jedis); }catch (JedisConnectionException e) { LOGGER.error(GENERIC_EXCEPTION_LOG_MESSAGE); } } LOGGER.debug("action=wifi-info-tracked device_count={}", wifiInfos.size()); }
Source:
public Optional<PageStructure> getPage(String pageName) { for(PageStructure pageStructure : pageStructureList) { if(Objects.equal(pageStructure.getFilename(), pageName)) { return Optional.fromNullable(pageStructure); } } return Optional.absent(); }

Target:
public Optional<PageStructure> getPage(String pageName) { for(PageStructure pageStructure : pageStructureList) { if(Objects.equal(pageStructure.getFilename(), pageName)) { return Optional.of(pageStructure); } } return Optional.absent(); }
Source:
public int hashCode() { int hash = super.hashCode(); hash = 89 * hash + (this.pushedBy != null ? this.pushedBy.hashCode() : 0); return hash; }

Target:
public int hashCode() { int hash = super.hashCode(); hash = 89 * hash + Objects.hash(this.pushedBy); return hash; }