auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Address(String address) { if (!StringUtils.hasText(address)) { this.exchangeName = ""; this.routingKey = ""; } else { String[] values = new String[] {"", ""}; if (address.contains("/")) { String[] groups = address.split("/"); System.arraycopy(groups, 0, values, 0, groups.length); } else { values[1] = address; } this.exchangeName = values[0]; this.routingKey = values[1]; } }

Target:
public Address(String address) { if (!StringUtils.hasText(address)) { this.exchangeName = ""; this.routingKey = ""; } else if (address.lastIndexOf('/') <= 0) { this.routingKey = address.replaceFirst("/", ""); this.exchangeName = ""; } else { Matcher matcher = pattern.matcher(address); boolean matchFound = matcher.find(); if (matchFound) { this.exchangeName = matcher.group(1); this.routingKey = matcher.group(2); } else { this.exchangeName = ""; this.routingKey = address; } } }
Source:
public void testSocketFinderAllowedInterfacesPublic() throws Exception { ConcurrentOpenSocketFinder finder = new ConcurrentOpenSocketFinder(socketAlwaysOpen, nodeRunning, userExecutor); finder.allowedInterfaces = AllowedInterfaces.PUBLIC; HostAndPort result = finder.findOpenSocketOnNode(node, 22, 2000, MILLISECONDS); assertEquals(result, HostAndPort.fromParts(PUBLIC_IP, 22)); }

Target:
public void testSocketFinderAllowedInterfacesPublic() throws Exception { FluentIterable<String> ips = ConcurrentOpenSocketFinder.checkNodeHasIps(node, AllowedInterfaces.PUBLIC); assertTrue(ips.contains(PUBLIC_IP)); assertFalse(ips.contains(PRIVATE_IP)); }
Source:
protected Metric constructMetric(String metricField, Class<?> cls, EntityDictionary entityDictionary) { Meta metaData = entityDictionary.getAttributeOrRelationAnnotation(cls, Meta.class, metricField); Class<?> fieldType = entityDictionary.getType(cls, metricField); List<Class<? extends Aggregation>> aggregations = getAggregations(metricField, cls, entityDictionary); String columnName = metricField; if (entityDictionary.attributeOrRelationAnnotationExists(cls, metricField, javax.persistence.Column.class)) { columnName = entityDictionary .getAttributeOrRelationAnnotation(cls, javax.persistence.Column.class, metricField).name(); } return new SQLMetric( this, metricField, metaData, fieldType, aggregations, columnName ); }

Target:
protected Metric constructMetric(String metricField, Class<?> cls, EntityDictionary entityDictionary) { Meta metaData = entityDictionary.getAttributeOrRelationAnnotation(cls, Meta.class, metricField); Class<?> fieldType = entityDictionary.getType(cls, metricField); List<Class<? extends Aggregation>> aggregations = getAggregations(metricField, cls, entityDictionary); return new SQLMetric( this, metricField, metaData, fieldType, aggregations, getColumnName(entityDictionary, cls, metricField) ); }
Source:
private SpecialPathInfo getPathInfo( Location location, String path, Collection<SpecialPathInfo> from ) { SpecialPathInfo firstHit = null; if ( path != null ) { for ( SpecialPathInfo info : from ) { final boolean originalMatched = info.getMatcher().matches( location, path ); final boolean storagePathMatched = cacheProvider != null && info.getMatcher() .matches( location, cacheProvider.getStoragePath( location, path ) ); if ( originalMatched || storagePathMatched ) { if ( firstHit != null ) { Logger logger = LoggerFactory.getLogger( getClass() ); logger.error( "Duplicate special-path registration for: {}:{}. Using: {}", location, path, firstHit ); } else { firstHit = info; } } } } return firstHit; }

Target:
private SpecialPathInfo getPathInfo( Location location, String path, Collection<SpecialPathInfo> from ) { SpecialPathInfo firstHit = null; if ( path != null ) { for ( SpecialPathInfo info : from ) { final boolean originalMatched = info.getMatcher().matches( location, path ); boolean storagePathMatched = originalMatched; if ( location != null ) { final ConcreteResource resource = new ConcreteResource( location, path ); storagePathMatched = info.getMatcher().matches( location, getStoragePath( resource ) ); } if ( originalMatched || storagePathMatched ) { if ( firstHit != null ) { Logger logger = LoggerFactory.getLogger( getClass() ); logger.error( "Duplicate special-path registration for: {}:{}. Using: {}", location, path, firstHit ); } else { firstHit = info; } } } } return firstHit; }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html"); try { String url = Config.get().getMotdUrl(); if (url == null || url.trim().length() == 0) { File f = new File(this.getServletContext().getRealPath(motdFileName)); long ft = f.lastModified(); if (ft != lastModified) { lastModified = ft; try { fileContent = FileUtils.readFileToString(f); } catch (IOException e) { LOGGER.debug("Failed to read MOTD file", e); response.getWriter().write(""); return; } } response.getWriter().write(fileContent); } else { HttpClient httpclient = new DefaultHttpClient(); try { HttpGet httpget = new HttpGet(url); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = httpclient.execute(httpget, responseHandler); response.setStatus(200); response.getWriter().write(responseBody); } catch (Exception e) { response.setStatus(500); response.getWriter().write("Server error"); } finally { httpclient.getConnectionManager().shutdown(); } } } catch (IOException e) { LOGGER.debug("Failed to provide MOTD file", e); } }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html"); try { String url = Config.get().getMotdUrl(); if (url == null || url.trim().length() == 0) { File f = new File(this.getServletContext().getRealPath(motdFileName)); long ft = f.lastModified(); if (ft != lastModified) { lastModified = ft; try { fileContent = FileUtils.readFileToString(f); } catch (IOException e) { LOGGER.debug("Failed to read MOTD file", e); response.getWriter().write(""); return; } } response.getWriter().write(fileContent); } else { HttpClient httpclient = new DefaultHttpClient(); try { HttpGet httpget = new HttpGet(url); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = httpclient.execute(httpget, responseHandler); response.setStatus(Response.Status.OK.getStatusCode()); response.getWriter().write(responseBody); } catch (Exception e) { response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); response.getWriter().write("Server error"); } finally { httpclient.getConnectionManager().shutdown(); } } } catch (IOException e) { LOGGER.debug("Failed to provide MOTD file", e); } }
Source:
private void logException(RuntimeException ex) { log.errorFormat("Command {0} execution failed. Exception: {1}", getCommandName(), ExceptionUtils.getMessage(ex)); if (!(ex instanceof VDSExceptionBase)) { log.error(ExceptionUtils.getStackTrace(ex)); } }

Target:
private void logException(RuntimeException ex) { log.errorFormat("Command {0} execution failed. Exception: {1}", getCommandName(), ExceptionUtils.getMessage(ex)); }
Source:
public GlusterVolumeProfileParameters(Guid clusterId, Guid volumeId) { super(clusterId, volumeId); this.nfs = false; }

Target:
public GlusterVolumeProfileParameters(Guid clusterId, Guid volumeId) { this(clusterId, volumeId, false); }
Source:
public boolean isEOF() { final boolean v3 = containerBlocksByteSize == 15 && alignmentContext.getReferenceContext().isUnmappedUnplaced() && alignmentContext.getAlignmentStart() == 4542278 && blockCount == 1 && recordCount == 0; final boolean v2 = containerBlocksByteSize == 11 && alignmentContext.getReferenceContext().isUnmappedUnplaced() && alignmentContext.getAlignmentStart() == 4542278 && blockCount == 1 && recordCount == 0; return v3 || v2; }

Target:
public boolean isEOF() { final boolean v3 = containerBlocksByteSize == CramIO.EOF_BLOCK_SIZE_V3 && alignmentContext.getReferenceContext().isUnmappedUnplaced() && alignmentContext.getAlignmentStart() == CramIO.EOF_ALIGNMENT_START && blockCount == 1 && recordCount == 0; final boolean v2 = containerBlocksByteSize == CramIO.EOF_BLOCK_SIZE_V2 && alignmentContext.getReferenceContext().isUnmappedUnplaced() && alignmentContext.getAlignmentStart() == CramIO.EOF_ALIGNMENT_START && blockCount == 1 && recordCount == 0; return v3 || v2; }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("groups") .setSince("5.2") .setInternal(true) .setDescription("Lists the groups with their permissions.<br>" + "This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.<br> " + "This service defaults to all groups, but can be limited to groups with a specific permission by providing the desired permission.<br>" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "</ul>") .addPagingParams(DEFAULT_PAGE_SIZE, RESULTS_MAX_SIZE) .setResponseExample(Resources.getResource(getClass(), "groups-example.json")) .setHandler(this); action.createParam(Param.TEXT_QUERY) .setMinimumLength(SEARCH_QUERY_MIN_LENGTH) .setDescription("Limit search to user names that contain the supplied string. <br/>" + "When this parameter is not set, only users having at least one permission are returned.") .setExampleValue("sonar"); createOrganizationParameter(action).setSince("6.2"); createPermissionParameter(action).setRequired(false); createProjectParameters(action); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction("groups") .setSince("5.2") .setInternal(true) .setDescription("Lists the groups with their permissions.<br>" + "This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.<br> " + "This service defaults to all groups, but can be limited to groups with a specific permission by providing the desired permission.<br>" + "Requires one of the following permissions:" + "<ul>" + "<li>'Administer System'</li>" + "<li>'Administer' rights on the specified project</li>" + "</ul>") .addPagingParams(DEFAULT_PAGE_SIZE, RESULTS_MAX_SIZE) .setResponseExample(Resources.getResource(getClass(), "groups-example.json")) .setHandler(this); action.createSearchQuery("sonar", "names") .setDescription("Limit search to group names that contain the supplied string. When this parameter is not set, only groups having at least one permission are returned.") .setMinimumLength(SEARCH_QUERY_MIN_LENGTH); createOrganizationParameter(action).setSince("6.2"); createPermissionParameter(action).setRequired(false); createProjectParameters(action); }
Source:
public int hashCode() { if (_attributes.isPresent()) { return Objects.hash(_nameOrRegex, new HashSet<>(_attributes.get())); } else { return Objects.hash(_nameOrRegex); } }

Target:
public int hashCode() { return _hashCode; }
Source:
public static Task<Task<?>> whenAny(Collection<? extends Task<?>> tasks) { if (tasks.size() == 0) { return Task.forResult(null); } final Task<Task<?>>.TaskCompletionSource firstCompleted = Task.create(); final AtomicBoolean isAnyTaskComplete = new AtomicBoolean(false); for (final Task<?> inputTask : tasks) { ((Task<Object>)inputTask).continueWith(new Continuation<Object, Void>() { @Override public Void then(Task<Object> task) { if (isAnyTaskComplete.compareAndSet(false, true)) { firstCompleted.setResult(inputTask); } return null; } }); } return firstCompleted.getTask(); }

Target:
public static Task<Task<?>> whenAny(Collection<? extends Task<?>> tasks) { if (tasks.size() == 0) { return Task.forResult(null); } final Task<Task<?>>.TaskCompletionSource firstCompleted = Task.create(); final AtomicBoolean isAnyTaskComplete = new AtomicBoolean(false); for (Task<?> task : tasks) { ((Task<Object>) task).continueWith(new Continuation<Object, Void>() { @Override public Void then(Task<Object> task) { if (isAnyTaskComplete.compareAndSet(false, true)) { firstCompleted.setResult(task); } return null; } }); } return firstCompleted.getTask(); }
Source:
private String getAuthoritiesClaimName(Jwt jwt) { for (String claimName : this.claimNames) { if (jwt.containsClaim(claimName)) { return claimName; } } return null; }

Target:
private String getAuthoritiesClaimName(Jwt jwt) { if (this.authoritiesClaimName != null) { return this.authoritiesClaimName; } for (String claimName : WELL_KNOWN_AUTHORITIES_CLAIM_NAMES) { if (jwt.containsClaim(claimName)) { return claimName; } } return null; }
Source:
public void visitNode(Tree tree) { Symbol sym; Arguments args; Tree methodName; if (tree.is(Tree.Kind.NEW_CLASS)) { NewClassTree nct = (NewClassTree) tree; sym = nct.constructorSymbol(); args = nct.arguments(); methodName = nct.identifier(); } else { MethodInvocationTree mit = (MethodInvocationTree) tree; sym = mit.symbol(); args = mit.arguments(); methodName = ExpressionUtils.methodName(mit); } if (sym.isMethodSymbol() && !args.isEmpty()) { ExpressionTree lastArg = args.get(args.size() - 1); JavaSymbol.MethodJavaSymbol methodSymbol = (JavaSymbol.MethodJavaSymbol) sym; MethodJavaType methodType = getMethodType(methodSymbol, methodName); checkInvokedMethod(methodSymbol, methodType, lastArg); } }

Target:
public void visitNode(Tree tree) { Symbol sym; Arguments args; Tree methodName; if (tree.is(Tree.Kind.NEW_CLASS)) { NewClassTree nct = (NewClassTree) tree; sym = nct.constructorSymbol(); args = nct.arguments(); methodName = nct.identifier(); } else { MethodInvocationTree mit = (MethodInvocationTree) tree; sym = mit.symbol(); args = mit.arguments(); methodName = mit.methodSelect(); } if (sym.isMethodSymbol() && !args.isEmpty()) { ExpressionTree lastArg = args.get(args.size() - 1); JavaSymbol.MethodJavaSymbol methodSymbol = (JavaSymbol.MethodJavaSymbol) sym; MethodJavaType methodType = getMethodType(methodSymbol, methodName); checkInvokedMethod(methodSymbol, methodType, lastArg); } }
Source:
protected void killSite(TestSite ts) { TestingUtil.killCacheManagers(ts.cacheManagers); }

Target:
protected void killSite(TestSite ts) { ts.cacheManagers.forEach(Lifecycle::stop); }
Source:
private boolean isPackageUpdated(Action action, EntityType newEntityType) { boolean updated; if (action == Action.CREATE) { updated = true; } else { EntityType currentEntityType = dataService.findOneById(EntityTypeMetadata.ENTITY_TYPE_META_DATA, newEntityType.getId(), EntityType.class); if (currentEntityType.getPackage() == null) { updated = newEntityType.getPackage() != null; } else { updated = !currentEntityType.getPackage().equals(newEntityType.getPackage()); } } return updated; }

Target:
private boolean isPackageUpdated(Action action, EntityType newEntityType) { boolean updated; if (action == Action.CREATE) { updated = true; } else { EntityType currentEntityType = dataService.findOneById(EntityTypeMetadata.ENTITY_TYPE_META_DATA, newEntityType.getId(), EntityType.class); if (currentEntityType.getPackage() == null) { updated = newEntityType.getPackage() != null; } else { if (newEntityType.getPackage() == null) { updated = true; } else { updated = !currentEntityType.getPackage().getId().equals(newEntityType.getPackage().getId()); } } } return updated; }
Source:
public FileDetailsPageObject clickVideoDetailsButton() { waitForElementByElement(videoDetailsButton); videoDetailsButton.click(); PageObjectLogging.log("clickVideoDetailsButton", "Video Details link is clicked", true); return new FileDetailsPageObject(driver); }

Target:
public FilePagePageObject clickVideoDetailsButton() { waitForElementByElement(videoDetailsButton); videoDetailsButton.click(); PageObjectLogging.log("clickVideoDetailsButton", "Video Details link is clicked", true); return new FilePagePageObject(driver); }
Source:
public int getNumSplits(InputFormat inputFormat, @Nullable SplitHintSpec splitHintSpec) throws IOException { int numSplits = 0; for (String inputPath : inputPaths) { Path path = new Path(inputPath); FileSystem fs = path.getFileSystem(configuration); final RemoteIterator<FileStatus> iterator = fs.listStatusIterator(path); numSplits += size(iterator); } return numSplits; }

Target:
public int getNumSplits(InputFormat inputFormat, @Nullable SplitHintSpec splitHintSpec) throws IOException { cachePathsIfNeeded(); return cachedPaths.size(); }
Source:
Set<AlternateHandle.Id> skipMe(Set<AlternateHandle.Id> skips) { Set<AlternateHandle.Id> withMe = new HashSet<>(); if (skips != null) { withMe.addAll(skips); } withMe.add(getAlternateId()); return withMe; }

Target:
private Set<AlternateHandle.Id> skipMe(Set<AlternateHandle.Id> skips) { Set<AlternateHandle.Id> withMe = new HashSet<>(); if (skips != null) { withMe.addAll(skips); } withMe.add(getAlternateId()); return withMe; }
Source:
public List<TopWebSearchResult> getMostRecentWebSearches(DataSource dataSource, int count) throws SleuthkitCaseProviderException, TskCoreException { assertValidCount(count); List<TopWebSearchResult> results = caseProvider.get().getBlackboard().getArtifacts(ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID(), dataSource.getId()) .stream() .map(artifact -> { String searchString = DataSourceInfoUtilities.getStringOrNull(artifact, TYPE_TEXT); Date dateAccessed = DataSourceInfoUtilities.getDateOrNull(artifact, TYPE_DATETIME_ACCESSED); return (StringUtils.isNotBlank(searchString) && dateAccessed != null) ? new TopWebSearchResult(searchString, dateAccessed) : null; }) .filter(result -> result != null) .collect(Collectors.groupingBy((result) -> result.getSearchString().toUpperCase())) .entrySet() .stream() .map((entry) -> entry.getValue().stream().max(TOP_WEBSEARCH_RESULT_DATE_COMPARE).get()) .sorted(TOP_WEBSEARCH_RESULT_DATE_COMPARE.reversed()) .limit(count) .collect(Collectors.toList()); if (translationService.hasProvider()) { for (TopWebSearchResult result : results) { result.setTranslatedResult(getTranslationOrNull(result.getSearchString())); } } return results; }

Target:
public List<TopWebSearchResult> getMostRecentWebSearches(DataSource dataSource, int count) throws SleuthkitCaseProviderException, TskCoreException { assertValidCount(count); List<BlackboardArtifact> webSearchArtifacts = caseProvider.get().getBlackboard() .getArtifacts(ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID(), dataSource.getId()); Collection<List<TopWebSearchResult>> resultGroups = webSearchArtifacts .stream() .map(DataSourceUserActivitySummary::getWebSearchResult) .filter(result -> result != null) .collect(Collectors.groupingBy((result) -> result.getSearchString().toUpperCase())) .values(); List<TopWebSearchResult> results = resultGroups .stream() .map((list) -> list.stream().max(TOP_WEBSEARCH_RESULT_DATE_COMPARE).get()) .sorted(TOP_WEBSEARCH_RESULT_DATE_COMPARE.reversed()) .limit(count) .collect(Collectors.toList()); if (translationService.hasProvider()) { for (TopWebSearchResult result : results) { result.setTranslatedResult(getTranslationOrNull(result.getSearchString())); } } return results; }
Source:
public void read( NodeRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) { int offset = cursor.getOffset(); byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); record.setInUse( inUse ); if ( mode.shouldLoad( inUse ) ) { long nextRel = cursor.getInt() & 0xFFFFFFFFL; long nextProp = cursor.getInt() & 0xFFFFFFFFL; long relModifier = (headerByte & 0xEL) << 31; long propModifier = (headerByte & 0xF0L) << 28; long lsbLabels = cursor.getInt() & 0xFFFFFFFFL; long hsbLabels = cursor.getByte() & 0xFF; long labels = lsbLabels | (hsbLabels << 32); byte extra = cursor.getByte(); boolean dense = (extra & 0x1) > 0; record.initialize( inUse, BaseRecordFormat.longFromIntAndMod( nextProp, propModifier ), dense, BaseRecordFormat.longFromIntAndMod( nextRel, relModifier ), labels ); } cursor.setOffset( offset ); }

Target:
public void read( NodeRecord record, PageCursor cursor, RecordLoad mode, int recordSize ) { byte headerByte = cursor.getByte(); boolean inUse = isInUse( headerByte ); record.setInUse( inUse ); if ( mode.shouldLoad( inUse ) ) { long nextRel = cursor.getInt() & 0xFFFFFFFFL; long nextProp = cursor.getInt() & 0xFFFFFFFFL; long relModifier = (headerByte & 0xEL) << 31; long propModifier = (headerByte & 0xF0L) << 28; long lsbLabels = cursor.getInt() & 0xFFFFFFFFL; long hsbLabels = cursor.getByte() & 0xFF; long labels = lsbLabels | (hsbLabels << 32); byte extra = cursor.getByte(); boolean dense = (extra & 0x1) > 0; record.initialize( inUse, BaseRecordFormat.longFromIntAndMod( nextProp, propModifier ), dense, BaseRecordFormat.longFromIntAndMod( nextRel, relModifier ), labels ); } else { int nextOffset = cursor.getOffset() + recordSize - HEADER_SIZE; cursor.setOffset( nextOffset ); } }
Source:
public Set<String> getDependencies() { return ImmutableSet.of("workspace"); }

Target:
public Set<String> getDependencies() { return ImmutableSet.of(WorkspaceServiceTermination.SERVICE_NAME); }
Source:
public void init(Property[] provisioningProperties) throws IdentityProvisioningException { Properties configs = new Properties(); if (provisioningProperties != null && provisioningProperties.length > 0) { for (Property property : provisioningProperties) { if (GoogleConnectorConstants.PRIVATE_KEY.equals(property.getName())) { FileOutputStream fos = null; try { byte[] decodedBytes = Base64Utils.decode(property.getValue()); googlePrvKey = new File("googlePrvKey"); fos = new FileOutputStream(googlePrvKey); fos.write(decodedBytes); } catch (IOException e) { log.error("Error while generating private key file object", e); }finally { IdentityIOStreamUtils.closeOutputStream(fos); } } configs.put(property.getName(), property.getValue()); if (IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED.equals(property .getName()) && "1".equals(property.getValue())) { jitProvisioningEnabled = true; } } } configHolder = new GoogleProvisioningConnectorConfig(configs); }

Target:
public void init(Property[] provisioningProperties) throws IdentityProvisioningException { Properties configs = new Properties(); if (provisioningProperties != null && provisioningProperties.length > 0) { for (Property property : provisioningProperties) { if (GoogleConnectorConstants.PRIVATE_KEY.equals(property.getName())) { FileOutputStream fos = null; try { byte[] decodedBytes = Base64Utils.decode(property.getValue()); googlePrvKey = new File("googlePrvKey"); fos = new FileOutputStream(googlePrvKey); fos.write(decodedBytes); } catch (IOException e) { log.error("Error while generating private key file object", e); }finally { IdentityIOStreamUtils.flushOutputStream(fos); IdentityIOStreamUtils.closeOutputStream(fos); } } configs.put(property.getName(), property.getValue()); if (IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED.equals(property .getName()) && "1".equals(property.getValue())) { jitProvisioningEnabled = true; } } } configHolder = new GoogleProvisioningConnectorConfig(configs); }
Source:
private void dumpCamelContext(String msg) { LOGGER.debug("\n\n*************** START: *****************", msg); List<RouteDefinition> routeDefinitions = camelContext.getRouteDefinitions(); if (routeDefinitions != null) { LOGGER.debug("Number of routes = {}", routeDefinitions.size()); for (RouteDefinition routeDef : routeDefinitions) { String routeId = routeDef.getId(); LOGGER.debug("route ID = {}", routeId); List<FromDefinition> routeInputs = routeDef.getInputs(); if (routeInputs.isEmpty()) { LOGGER.debug("routeInputs are EMPTY"); } else { for (FromDefinition fromDef : routeInputs) { LOGGER.debug("route input's URI = {}", fromDef.getUri()); } } ServiceStatus routeStatus = camelContext.getRouteStatus(routeId); if (routeStatus != null) { LOGGER.debug("Route ID is started = {}", routeId, routeStatus.isStarted()); } else { LOGGER.debug("routeStamtus is NULL for routeId = {}", routeId); } } } LOGGER.debug("*************** END: *****************\n\n", msg); }

Target:
private void dumpCamelContext(String msg) { LOGGER.debug("\n\n*************** START: *****************", msg); List<RouteDefinition> routeDefinitions = camelContext.getRouteDefinitions(); if (routeDefinitions != null) { LOGGER.debug("Number of routes = {}", routeDefinitions.size()); for (RouteDefinition routeDef : routeDefinitions) { String routeId = routeDef.getId(); LOGGER.debug("route ID = {}", routeId); List<FromDefinition> routeInputs = routeDef.getInputs(); if (routeInputs.isEmpty()) { LOGGER.debug("routeInputs are EMPTY"); } else { for (FromDefinition fromDef : routeInputs) { LOGGER.debug("route input's URI = {}", fromDef.getUri()); } } ServiceStatus routeStatus = camelContext.getRouteStatus(routeId); if (routeStatus != null) { LOGGER.debug("Route ID is started = {}", routeId, routeStatus.isStarted()); } else { LOGGER.debug("routeStatus is NULL for routeId = {}", routeId); } } } LOGGER.debug("*************** END: *****************\n\n", msg); }
Source:
public SnapshotDto setVersion(@Nullable String version) { checkArgument(version == null || version.length() <= 100, "\"%s\" is not a valid version name. " + "The maximum length of version numbers is 100 characters.", version); this.version = version; return this; }

Target:
public SnapshotDto setVersion(@Nullable String version) { if (version != null) { checkArgument(version.length() <= MAX_VERSION_LENGTH, "Event name length (%s) is longer than the maximum authorized (%s). '%s' was provided.", version.length(), MAX_VERSION_LENGTH, version); } this.version = version; return this; }
Source:
public CRAMIterator(final SeekableStream seekableStream, final ReferenceSource referenceSource, final long[] coordinates) throws IOException { if (null == referenceSource) { this.referenceSource = new ReferenceSource(); } else this.referenceSource = referenceSource; this.countingInputStream = new CountingInputStream(seekableStream); final CramSpanContainerIterator containerIterator = CramSpanContainerIterator.fromFileSpan(seekableStream, coordinates); cramHeader = containerIterator.getCramHeader(); this.containerIterator = containerIterator; firstContainerOffset = containerIterator.getFirstContainerOffset(); records = new ArrayList<SAMRecord>(10000); normalizer = new CramNormalizer(cramHeader.getSamFileHeader(), referenceSource); parser = new ContainerParser(cramHeader.getSamFileHeader()); }

Target:
public CRAMIterator(final SeekableStream seekableStream, final ReferenceSource referenceSource, final long[] coordinates) throws IOException { if (null == referenceSource) { throw new CRAMException("A reference source is required for CRAM files"); } this.countingInputStream = new CountingInputStream(seekableStream); this.referenceSource = referenceSource; final CramSpanContainerIterator containerIterator = CramSpanContainerIterator.fromFileSpan(seekableStream, coordinates); cramHeader = containerIterator.getCramHeader(); this.containerIterator = containerIterator; firstContainerOffset = containerIterator.getFirstContainerOffset(); records = new ArrayList<SAMRecord>(10000); normalizer = new CramNormalizer(cramHeader.getSamFileHeader(), referenceSource); parser = new ContainerParser(cramHeader.getSamFileHeader()); }
Source:
public HardwareLayout(JSONObject jsonObject) throws JSONException { logger.trace("HardwareLayout " + jsonObject.toString()); this.clusterName = jsonObject.getString("clusterName"); this.version = jsonObject.getLong("version"); this.datacenters = new ArrayList<Datacenter>(jsonObject.getJSONArray("datacenters").length()); for (int i = 0; i < jsonObject.getJSONArray("datacenters").length(); ++i) { this.datacenters.add(i, new Datacenter(this, jsonObject.getJSONArray("datacenters").getJSONObject(i))); } validate(); }

Target:
public HardwareLayout(JSONObject jsonObject) throws JSONException { if (logger.isTraceEnabled()) logger.trace("HardwareLayout " + jsonObject.toString()); this.clusterName = jsonObject.getString("clusterName"); this.version = jsonObject.getLong("version"); this.datacenters = new ArrayList<Datacenter>(jsonObject.getJSONArray("datacenters").length()); for (int i = 0; i < jsonObject.getJSONArray("datacenters").length(); ++i) { this.datacenters.add(i, new Datacenter(this, jsonObject.getJSONArray("datacenters").getJSONObject(i))); } this.rawCapacityInBytes = calculateRawCapacityInBytes(); this.dataNodeCount = calculateDataNodeCount(); this.diskCount = calculateDiskCount(); this.dataNodeInHardStateCount = calculateDataNodeInHardStateCount(); this.diskInHardStateCount = calculateDiskInHardStateCount(); validate(); }
Source:
private void addSubmodule(String url, String name, String revision, List<CopyFile> copyfiles, List<LinkFile> linkfiles, Set<String> groups, String recommendShallow) throws GitAPIException, IOException { if (repo.isBare()) { RepoProject proj = new RepoProject(url, name, revision, null, groups, recommendShallow); proj.addCopyFiles(copyfiles); proj.addLinkFiles(linkfiles); bareProjects.add(proj); } else { SubmoduleAddCommand add = git .submoduleAdd() .setPath(name) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); Repository subRepo = add.call(); if (revision != null) { try (Git sub = new Git(subRepo)) { sub.checkout().setName(findRef(revision, subRepo)) .call(); } subRepo.close(); git.add().addFilepattern(name).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } if (!linkfiles.isEmpty()) { throw new UnsupportedOperationException( JGitText.get().nonBareLinkFilesNotSupported); } } }

Target:
private void addSubmodule(String url, String name, String revision, List<CopyFile> copyfiles, List<LinkFile> linkfiles, Set<String> groups, String recommendShallow) throws GitAPIException, IOException { if (repo.isBare()) { RepoProject proj = new RepoProject(url, name, revision, null, groups, recommendShallow); proj.addCopyFiles(copyfiles); proj.addLinkFiles(linkfiles); bareProjects.add(proj); } else { if (!linkfiles.isEmpty()) { throw new UnsupportedOperationException( JGitText.get().nonBareLinkFilesNotSupported); } SubmoduleAddCommand add = git .submoduleAdd() .setPath(name) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); Repository subRepo = add.call(); if (revision != null) { try (Git sub = new Git(subRepo)) { sub.checkout().setName(findRef(revision, subRepo)) .call(); } subRepo.close(); git.add().addFilepattern(name).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } } }
Source:
public Line(RevCommit startCommit, int lineNumber) { commit = startCommit; number = lineNumber; }

Target:
Line(RevCommit startCommit, int lineNumber) { commit = startCommit; number = lineNumber; }
Source:
public RegistrationAuth requireCreate(ClientRegistrationContext context) { init(); RegistrationAuth registrationAuth = RegistrationAuth.ANONYMOUS; if (isBearerToken()) { checkClientProtocol(); if (hasRole(AdminRoles.MANAGE_CLIENTS, AdminRoles.CREATE_CLIENT)) { registrationAuth = RegistrationAuth.AUTHENTICATED; } else { throw forbidden(); } } else if (isInitialAccessToken()) { if (initialAccessModel.getRemainingCount() > 0) { if (initialAccessModel.getExpiration() == 0 || (initialAccessModel.getTimestamp() + initialAccessModel.getExpiration()) > Time.currentTime()) { registrationAuth = RegistrationAuth.AUTHENTICATED; } else { throw unauthorized("Expired initial access token"); } } else { throw unauthorized("No remaining count on initial access token"); } } try { ClientPolicyManager.triggerBeforeRegister(context, registrationAuth); } catch (ClientRegistrationPolicyException | ClientPolicyException crpe) { throw forbidden(crpe.getMessage()); } return registrationAuth; }

Target:
public RegistrationAuth requireCreate(ClientRegistrationContext context) { init(); RegistrationAuth registrationAuth = RegistrationAuth.ANONYMOUS; if (isBearerToken()) { checkClientProtocol(); if (hasRole(AdminRoles.MANAGE_CLIENTS, AdminRoles.CREATE_CLIENT)) { registrationAuth = RegistrationAuth.AUTHENTICATED; } else { throw forbidden(); } } else if (isInitialAccessToken()) { if (initialAccessModel.getRemainingCount() > 0) { if (initialAccessModel.getExpiration() == 0 || (initialAccessModel.getTimestamp() + initialAccessModel.getExpiration()) > Time.currentTime()) { registrationAuth = RegistrationAuth.AUTHENTICATED; } else { throw unauthorized("Expired initial access token"); } } else { throw unauthorized("No remaining count on initial access token"); } } try { session.clientPolicy().triggerOnEvent(new DynamicClientRegisterContext(context,registrationAuth)); ClientRegistrationPolicyManager.triggerBeforeRegister(context, registrationAuth); } catch (ClientRegistrationPolicyException | ClientPolicyException crpe) { throw forbidden(crpe.getMessage()); } return registrationAuth; }
Source:
public String getPreview() { StringBuilder bld= new StringBuilder(); bld.append("\n"); if (isEnabled(CleanUpConstants.USE_DIRECTLY_MAP_METHOD)) { bld.append("int x = map.size();\n"); bld.append("if (map.containsKey(\"hello\")) {\n"); bld.append(" map.remove(\"hello\");\n"); bld.append("}\n"); bld.append("map.clear();\n"); bld.append("if (map.isEmpty()) {\n"); } else { bld.append("int x = map.keySet().size();\n"); bld.append("if (map.keySet().contains(\"hello\")) {\n"); bld.append(" map.keySet().remove(\"hello\");\n"); bld.append("}\n"); bld.append("map.keySet().clear();\n"); bld.append("if (map.keySet().isEmpty()) {\n"); } bld.append(" x++;\n"); bld.append("}\n"); return bld.toString(); }

Target:
public String getPreview() { StringBuilder bld= new StringBuilder(); bld.append("\n"); if (isEnabled(CleanUpConstants.USE_DIRECTLY_MAP_METHOD)) { bld.append("int x = map.size();\n"); bld.append("if (map.containsKey(\"hello\")) {\n"); bld.append(" map.remove(\"hello\");\n"); bld.append("}\n"); bld.append("map.clear();\n"); bld.append("map.clear();\n"); bld.append("if (map.isEmpty()) {\n"); } else { bld.append("int x = map.keySet().size();\n"); bld.append("if (map.keySet().contains(\"hello\")) {\n"); bld.append(" map.keySet().remove(\"hello\");\n"); bld.append("}\n"); bld.append("map.keySet().clear();\n"); bld.append("map.values().clear();\n"); bld.append("if (map.keySet().isEmpty()) {\n"); } bld.append(" x++;\n"); bld.append("}\n"); return bld.toString(); }
Source:
public String getSwaggerDocument(String apiName, int tenantId) throws APIException { API api = getSynapseAPIByName(apiName); if (api == null) { throw new APIException("API with name \"" + apiName + "\" does not exists."); } String resourcePath = getSwaggerResourcePath(api); String swaggerJsonString = null; if (resourcePath.startsWith(CONFIG_REG_PREFIX) || resourcePath.startsWith(GOV_REG_PREFIX)) { try { swaggerJsonString = getResourceFromRegistry(resourcePath, tenantId); } catch (RegistryException e) { handleException(log, "Could not get swagger document", e); } } else { try { swaggerJsonString = readFromURI(resourcePath); } catch (IOException e) { log.error("Error occurred while reading swagger definition from: " + resourcePath, e); } } if (swaggerJsonString == null) { if (log.isDebugEnabled()) { log.debug("Generate swagger definition for the API : " + apiName); } try { AxisConfiguration axisConfiguration = ConfigHolder.getInstance().getAxisConfiguration(); ServerConfig serverConfig = new CarbonServerConfig(axisConfiguration); JSONObject jsonDefinition = new JSONObject(new GenericApiObjectDefinition(api, serverConfig).getDefinitionMap()); swaggerJsonString = jsonDefinition.toString(); } catch (AxisFault axisFault) { handleException(log, "Error occurred while generating swagger definition", axisFault); } } return swaggerJsonString; }

Target:
public String getSwaggerDocument(String apiName, int tenantId) throws APIException { API api = getSynapseAPIByName(apiName); if (api == null) { throw new APIException("API with name \"" + apiName + "\" does not exists."); } String resourcePath = getSwaggerResourcePath(api); String swaggerJsonString = null; if (resourcePath.startsWith(CONFIG_REG_PREFIX) || resourcePath.startsWith(GOV_REG_PREFIX)) { try { swaggerJsonString = getResourceFromRegistry(resourcePath, tenantId); } catch (RegistryException e) { handleException(log, "Could not get swagger document", e); } } else { try { swaggerJsonString = readFromURI(resourcePath); } catch (IOException e) { log.error("Error occurred while reading swagger definition from: " + resourcePath, e); } } if (swaggerJsonString == null) { if (log.isDebugEnabled()) { log.debug("Generate swagger definition for the API : " + apiName); } try { ServerConfig serverConfig = new CarbonServerConfig(); JSONObject jsonDefinition = new JSONObject(new GenericApiObjectDefinition(api, serverConfig).getDefinitionMap()); swaggerJsonString = jsonDefinition.toString(); } catch (AxisFault axisFault) { handleException(log, "Error occurred while generating swagger definition", axisFault); } } return swaggerJsonString; }
Source:
public void init() throws Exception { serverPropertyMap.put("-DportOffset",Integer.toString(portOffset)); AutomationContext autoCtx = new AutomationContext(); CarbonTestServerManager server = new CarbonTestServerManager(autoCtx, System.getProperty("carbon.zip"), serverPropertyMap); asServerManager.startServers(server); carbonHome = server.getCarbonHome(); context = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); initializeNecessaryVariables(); resourceAdminServiceClient = new ResourceAdminServiceClient(backendURLForInstance002, sessionCookieForInstance002); }

Target:
public void init() throws Exception { serverPropertyMap.put("-DportOffset", Integer.toString(portOffset)); AutomationContext autoCtx = new AutomationContext(); CarbonTestServerManager server = new CarbonTestServerManager(autoCtx, System.getProperty("carbon.zip"), serverPropertyMap); asServerManager.startServers(server); carbonHome = server.getCarbonHome(); context = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); initEnvironment(); resourceAdminServiceClient = new ResourceAdminServiceClient(backendURLForInstance002, sessionCookieForInstance002); }
Source:
public void characters(char[] ch, int start, int length) { if (currentQName.indexOf("BinData") < 0 || inPixels == false) { xmlBuffer.append(new String(ch, start, length)); } }

Target:
public void characters(char[] ch, int start, int length) { if (!inPixels || currentQName.indexOf("BinData") < 0) { xmlBuffer.append(new String(ch, start, length)); } }
Source:
private void checkAssertions(final String url, final Map<String,?> flags, final Map<?, ?> assertions) { for (final Map.Entry<?, ?> entry : assertions.entrySet()) { if (Objects.equal(entry.getKey(), "regex")) { LOG.info("Testing if url matches regex [{}]", new Object[]{url, entry.getValue()}); assertContentEventuallyMatches( flags, url, TypeCoercions.coerce(entry.getValue(), String.class)); } else if (Objects.equal(entry.getKey(), "string")) { LOG.debug("Testing if url contains string [{}]", new Object[]{url, entry.getValue()}); assertContentEventuallyContainsText(flags, url, TypeCoercions.coerce(entry.getValue(), String.class)); } else if (Objects.equal(entry.getKey(), "status")) { LOG.debug("Testing if url returns status code [{}]", new Object[]{url, entry.getValue()}); assertHttpStatusCodeEventuallyEquals(flags, url, TypeCoercions.coerce(entry.getValue(), Integer.class)); } } }

Target:
private void checkAssertions(final String url, final Map<String, ?> flags, final Map<?, ?> assertions) { for (final Map.Entry<?, ?> entry : assertions.entrySet()) { if (Objects.equal(entry.getKey(), "regex")) { LOG.info("Testing if url matches regex [{}]", new Object[]{url, entry.getValue()}); assertContentEventuallyMatches(flags, url, TypeCoercions.coerce(entry.getValue(), String.class)); } else if (Objects.equal(entry.getKey(), "bodyContains")) { LOG.debug("Testing if url contains string [{}]", new Object[]{url, entry.getValue()}); assertContentEventuallyContainsText(flags, url, TypeCoercions.coerce(entry.getValue(), String.class)); } else if (Objects.equal(entry.getKey(), "status")) { LOG.debug("Testing if url returns status code [{}]", new Object[]{url, entry.getValue()}); assertHttpStatusCodeEventuallyEquals(flags, url, TypeCoercions.coerce(entry.getValue(), Integer.class)); } } }
Source:
public Checkpoint readLastCheckpoint(TaskName taskName) { if (!taskNames.contains(taskName)) { throw new SamzaException("writing checkpoint of unregistered task"); } String partitionQueryKey = taskName.toString(); String partitionFilter = TableQuery.generateFilterCondition( PARTITION_KEY, TableQuery.QueryComparisons.EQUAL, partitionQueryKey); TableQuery<TaskCheckpointEntity> partitionQuery = TableQuery.from(TaskCheckpointEntity.class) .where(partitionFilter); Map<SystemStreamPartition, String> offsets = new HashMap<>(); for (TaskCheckpointEntity taskCheckpointEntity : cloudTable.execute(partitionQuery)) { String systemName = taskCheckpointEntity.getRowKey(); String streamName = taskCheckpointEntity.getStreamName(); int partitionId = taskCheckpointEntity.getPartitionId(); offsets.put(new SystemStreamPartition(systemName, streamName, new Partition(partitionId)), taskCheckpointEntity.getOffset()); } return new Checkpoint(offsets); }

Target:
public Checkpoint readLastCheckpoint(TaskName taskName) { if (!taskNames.contains(taskName)) { throw new SamzaException("reading checkpoint of unregistered/unwritten task"); } String partitionQueryKey = taskName.toString(); String partitionFilter = TableQuery.generateFilterCondition( PARTITION_KEY, TableQuery.QueryComparisons.EQUAL, partitionQueryKey); TableQuery<TaskCheckpointEntity> query = TableQuery.from(TaskCheckpointEntity.class).where(partitionFilter); ImmutableMap.Builder<SystemStreamPartition, String> builder = ImmutableMap.builder(); try { for (TaskCheckpointEntity taskCheckpointEntity : cloudTable.execute(query)) { String serializedSSP = taskCheckpointEntity.getRowKey(); builder.put(deserializeSystemStreamPartition(serializedSSP), taskCheckpointEntity.getOffset()); } } catch (NoSuchElementException e) { LOG.warn("No checkpoints found found for registered taskName={}", taskName); return null; } LOG.debug("Received checkpoint state for taskName=%s", taskName); return new Checkpoint(builder.build()); }
Source:
public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable, Boolean moneatizationEnabled) throws APIManagementException { SettingsDTO settingsDTO = new SettingsDTO(); if (isUserAvailable) { settingsDTO.setGrantTypes(APIUtil.getGrantTypes()); settingsDTO.setScopes(GetScopeList()); settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled()); settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled()); Map<String, Environment> environments = APIUtil.getEnvironments(); if (environments.size()==1){ Map.Entry<String,Environment> entry = environments.entrySet().iterator().next(); Environment singleEnvironment = environments.get(entry.getKey()); settingsDTO.apiGatewayEndpoint(singleEnvironment.getApiGatewayEndpoint()); } else { for (Map.Entry<String, Environment> entry : environments.entrySet()) { Environment multipleEnvironment = environments.get(entry.getKey()); if (multipleEnvironment.isDefault()) { settingsDTO.apiGatewayEndpoint(multipleEnvironment.getApiGatewayEndpoint()); break; } } Map.Entry<String,Environment> entry = environments.entrySet().iterator().next(); Environment singleEnvironment = environments.get(entry.getKey()); settingsDTO.apiGatewayEndpoint(singleEnvironment.getApiGatewayEndpoint()); } } else { settingsDTO.setScopes(GetScopeList()); settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled()); settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled()); settingsDTO.setMonetizationEnabled(moneatizationEnabled); } return settingsDTO; }

Target:
public SettingsDTO fromSettingstoDTO(Boolean isUserAvailable, Boolean moneatizationEnabled) throws APIManagementException { SettingsDTO settingsDTO = new SettingsDTO(); if (isUserAvailable) { settingsDTO.setGrantTypes(APIUtil.getGrantTypes()); settingsDTO.setScopes(GetScopeList()); settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled()); settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled()); Map<String, Environment> environments = APIUtil.getEnvironments(); if (environments.size() == 0) { settingsDTO.apiGatewayEndpoint("http://localhost:8280,https://localhost:8243"); } else { for (Map.Entry<String, Environment> entry : environments.entrySet()) { Environment environment = environments.get(entry.getKey()); if (environment.isDefault()) { settingsDTO.apiGatewayEndpoint(environment.getApiGatewayEndpoint()); break; } } if (settingsDTO.getApiGatewayEndpoint() == null) { Map.Entry<String, Environment> entry = environments.entrySet().iterator().next(); Environment environment = environments.get(entry.getKey()); settingsDTO.apiGatewayEndpoint(environment.getApiGatewayEndpoint()); } } } else { settingsDTO.setScopes(GetScopeList()); settingsDTO.setApplicationSharingEnabled(APIUtil.isMultiGroupAppSharingEnabled()); settingsDTO.setMapExistingAuthApps(APIUtil.isMapExistingAuthAppsEnabled()); settingsDTO.setMonetizationEnabled(moneatizationEnabled); } return settingsDTO; }
Source:
public void configure(H http) throws Exception { BearerTokenResolver resolver = getBearerTokenResolver(http); resolver = postProcess(resolver); this.matcher.setResolver(resolver); AuthenticationManager manager = http.getSharedObject(AuthenticationManager.class); BearerTokenAuthenticationFilter filter = new BearerTokenAuthenticationFilter(manager); filter.setBearerTokenResolver(resolver); filter = postProcess(filter); http.addFilterBefore(filter, BasicAuthenticationFilter.class); if (this.jwtConfigurer != null) { JwtDecoder decoder = getJwtDecoder(http); if (decoder != null) { decoder = postProcess(decoder); JwtAuthenticationProvider provider = new JwtAuthenticationProvider(decoder); provider = postProcess(provider); http.authenticationProvider(provider); } else { throw new BeanCreationException("Jwt is the only supported format for bearer tokens " + "in Spring Security and no instance of JwtDecoder could be found. Make sure to specify " + "a jwk set uri by doing http.oauth2().resourceServer().jwt().jwkSetUri(uri)"); } } }

Target:
public void configure(H http) throws Exception { BearerTokenResolver bearerTokenResolver = getBearerTokenResolver(); this.requestMatcher.setBearerTokenResolver(bearerTokenResolver); AuthenticationManager manager = http.getSharedObject(AuthenticationManager.class); BearerTokenAuthenticationFilter filter = new BearerTokenAuthenticationFilter(manager); filter.setBearerTokenResolver(bearerTokenResolver); filter = postProcess(filter); http.addFilterBefore(filter, BasicAuthenticationFilter.class); JwtDecoder decoder = this.jwtConfigurer.getJwtDecoder(); if (decoder != null) { JwtAuthenticationProvider provider = new JwtAuthenticationProvider(decoder); provider = postProcess(provider); http.authenticationProvider(provider); } else { throw new IllegalStateException("Jwt is the only supported format for bearer tokens " + "in Spring Security and no instance of JwtDecoder could be found. Make sure to specify " + "a jwk set uri by doing http.oauth2().resourceServer().jwt().jwkSetUri(uri)"); } }
Source:
public void retainData(final long n) { long curRetainedDataPoints = retained.addAndGet(n); if (curRetainedDataPoints > 500_000) { long total = quotaWatchers.stream().map(QuotaWatcher::getRetainData).reduce(0L, Long::sum); log.info("Total: {}; watchers: {}; Data points retained: {}; added: {}", total, quotaWatchers.size(), curRetainedDataPoints, n); } throwIfViolated(); }

Target:
public void retainData(final long n) { long curRetainedDataPoints = retained.addAndGet(n); if (curRetainedDataPoints > LOGLIMIT) { long total = quotaWatchers.stream().map(QuotaWatcher::getRetainData) .reduce(0L, Long::sum); log.info("Data Points RETAINED: Instance {}; This Query: {}; Delta: " + "(# Wathcers: {})", total, curRetainedDataPoints, n, quotaWatchers.size()); } throwIfViolated(); }