auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public BaseResponseDto findProductDetail(ProductDetailRequestDto productDetailRequestDto) { if (productDetailRequestDto.getProductId() == null) { logger.error(MessageFormat.format("Product id is null (userId = {0})", productDetailRequestDto.getBaseParam().getUserId())); return new BaseResponseDto<>(ReturnMessage.POINTS_PRODUCT_IS_NOT_NULL.getCode(), ReturnMessage.POINTS_PRODUCT_IS_NOT_NULL.getMsg()); } ProductModel productModel = productMapper.findById(Long.parseLong(productDetailRequestDto.getProductId())); ProductDetailResponseDto productDetailResponseDto = new ProductDetailResponseDto(productModel); String[] description; CouponModel couponModel = couponMapper.findById(productModel.getCouponId()); if (productModel.getType() == GoodsType.COUPON && couponModel != null) { description = new String[]{couponModel.getAmount() > 0 ? MessageFormat.format("投资满{0}元即可使用;", couponModel.getAmount()) : "", MessageFormat.format("{0}天产品可用;", couponModel.getProductTypes().toString().replaceAll("_","")), MessageFormat.format("有效期限:{0}天。", couponModel.getDeadline())}; } else { description = new String[]{productModel.getDescription()}; } BaseResponseDto baseResponseDto = new BaseResponseDto(); productDetailResponseDto.setProductDes(Lists.newArrayList(description)); baseResponseDto.setData(productDetailResponseDto); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); return baseResponseDto; }

Target:
public BaseResponseDto findProductDetail(ProductDetailRequestDto productDetailRequestDto) { if (productDetailRequestDto.getProductId() == null) { logger.info(MessageFormat.format("Product id is null (userId = {0})", productDetailRequestDto.getBaseParam().getUserId())); return new BaseResponseDto<>(ReturnMessage.POINTS_PRODUCT_IS_NOT_NULL.getCode(), ReturnMessage.POINTS_PRODUCT_IS_NOT_NULL.getMsg()); } ProductModel productModel = productMapper.findById(Long.parseLong(productDetailRequestDto.getProductId())); ProductDetailResponseDto productDetailResponseDto = new ProductDetailResponseDto(productModel.getId(),bannerServer + productModel.getImageUrl(),productModel.getName(),productModel.getPoints(),productModel.getType(),productModel.getTotalCount() - productModel.getUsedCount()); List<String> description = Lists.newArrayList(); CouponModel couponModel = couponMapper.findById(productModel.getCouponId()); if (productModel.getType() == GoodsType.COUPON && couponModel != null) { description.add(couponModel.getAmount() > 0 ? MessageFormat.format("投资满{0}元即可使用;", couponModel.getAmount()) : ""); description.add(MessageFormat.format("{0}天产品可用;", couponModel.getProductTypes().toString().replaceAll("_",""))); description.add(MessageFormat.format("有效期限:{0}天。", couponModel.getDeadline())); } else { description.add(productModel.getDescription()); } BaseResponseDto baseResponseDto = new BaseResponseDto(); productDetailResponseDto.setProductDes(Lists.newArrayList(description)); baseResponseDto.setData(productDetailResponseDto); baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setMessage(ReturnMessage.SUCCESS.getMsg()); return baseResponseDto; }
Source:
public void largeBlobTest() throws Exception { List<OperationInfo> opInfos = new ArrayList<>(); for (int i = 0; i < 2; i++) { Queue<OperationType> opChain = new LinkedList<>(); opChain.add(OperationType.PUT_NB); opChain.add(OperationType.AWAIT_CREATION); opChain.add(OperationType.GET_INFO_NB); opChain.add(OperationType.GET_NB); opChain.add(OperationType.DELETE_NB); opChain.add(OperationType.AWAIT_DELETION); opChain.add(OperationType.GET_INFO_DELETED_NB); opChain.add(OperationType.GET_DELETED_NB); opInfos.add(testFramework.startOperationChain(RouterServerTestFramework.CHUNK_SIZE * 4 + 1, i, opChain)); } testFramework.checkOperationChains(opInfos); }

Target:
public void largeBlobTest() throws Exception { final int blobSize = RouterServerTestFramework.CHUNK_SIZE * 2 + 1; List<OperationChain> opChains = new ArrayList<>(); for (int i = 0; i < 2; i++) { Queue<OperationType> operations = new LinkedList<>(); operations.add(OperationType.PUT_NB); operations.add(OperationType.AWAIT_CREATION); operations.add(OperationType.GET_INFO_NB); operations.add(OperationType.GET_NB); operations.add(OperationType.DELETE_NB); operations.add(OperationType.AWAIT_DELETION); operations.add(OperationType.GET_INFO_DELETED_NB); operations.add(OperationType.GET_DELETED_NB); opChains.add(testFramework.startOperationChain(blobSize, i, operations)); } testFramework.checkOperationChains(opChains); }
Source:
public static BasisFunctionKnots fromKnots(double[] knots, int degree) { ArgumentChecker.notEmpty(knots, "knots"); ArgumentChecker.notNegative(degree, "degree"); final int nKnots = knots.length; ArgumentChecker.isTrue(nKnots - 3 * degree > 0, "Require at least knots for degree {}, only given {}", 3 * degree + 1, degree, nKnots); for (int i = 1; i < nKnots; i++) { ArgumentChecker.isTrue(knots[i] - knots[i - 1] > 0, "knots are not ascending"); } int nSplines = nKnots - degree - 1; return new BasisFunctionKnots(knots, degree, nSplines); }

Target:
public static BasisFunctionKnots fromKnots(double[] knots, int degree) { ArgumentChecker.notEmpty(knots, "knots"); ArgumentChecker.notNegative(degree, "degree"); int nKnots = knots.length; ArgumentChecker.isTrue(nKnots - 3 * degree > 0, "Require at least knots for degree {}, only given {}", 3 * degree + 1, degree, nKnots); for (int i = 1; i < nKnots; i++) { ArgumentChecker.isTrue(knots[i] - knots[i - 1] > 0, "knots are not ascending"); } int nSplines = nKnots - degree - 1; return new BasisFunctionKnots(knots, degree, nSplines); }
Source:
protected void getAsync(AnnotationConfigApplicationContext context, String path, Callback<Void> callback) { Mono<ClientResponse> request = client(context).get().uri(path).exchange(); request.subscribe(new CoreSubscriber<ClientResponse>() { final AtomicReference<Subscription> ref = new AtomicReference<>(); @Override public void onSubscribe(Subscription s) { if (Operators.validate(ref.getAndSet(s), s)) { s.request(Long.MAX_VALUE); } else { s.cancel(); } } @Override public void onNext(ClientResponse clientResponse) { if (ref.getAndSet(null) != null) { callback.onSuccess(null); } else { Operators.onNextDropped(clientResponse, currentContext()); } } @Override public void onError(Throwable t) { if (ref.getAndSet(null) != null) { callback.onError(t); } } @Override public void onComplete() { if (ref.getAndSet(null) != null) { callback.onError( new RuntimeException("onComplete() called before onNext!")); } } @Override public Context currentContext() { return Context.empty(); } }); }

Target:
protected void getAsync(AnnotationConfigApplicationContext context, String path, Callback<Void> callback) { Mono<ClientResponse> request = client(context).get().uri(path).exchange(); TestCallbackSubscriber.subscribe(request, callback); }
Source:
public int runCmd(CommandLine cmdLine) throws Exception { LedgerManagerFactory mFactory = null; LedgerManager m = null; try { mFactory = LedgerManagerFactory.newLedgerManagerFactory( bkConf, RegistrationManager.instantiateRegistrationManager(bkConf).getLayoutManager()); m = mFactory.newLedgerManager(); LedgerRangeIterator iter = m.getLedgerRanges(); if (cmdLine.hasOption("m")) { List<ReadMetadataCallback> futures = new ArrayList<ReadMetadataCallback>(LIST_BATCH_SIZE); while (iter.hasNext()) { LedgerRange r = iter.next(); for (Long lid : r.getLedgers()) { ReadMetadataCallback cb = new ReadMetadataCallback(lid); m.readLedgerMetadata(lid, cb); futures.add(cb); } if (futures.size() >= LIST_BATCH_SIZE) { while (futures.size() > 0) { ReadMetadataCallback cb = futures.remove(0); printLedgerMetadata(cb); } } } while (futures.size() > 0) { ReadMetadataCallback cb = futures.remove(0); printLedgerMetadata(cb); } } else { while (iter.hasNext()) { LedgerRange r = iter.next(); for (Long lid : r.getLedgers()) { System.out.println(ledgerIdFormatter.formatLedgerId(lid)); } } } } finally { if (m != null) { try { m.close(); mFactory.uninitialize(); } catch (IOException ioe) { LOG.error("Failed to close ledger manager : ", ioe); } } } return 0; }

Target:
public int runCmd(CommandLine cmdLine) throws Exception { try (LedgerManagerFactory mFactory = LedgerManagerFactory.newLedgerManagerFactory( bkConf, RegistrationManager.instantiateRegistrationManager(bkConf).getLayoutManager())) { try (LedgerManager m = mFactory.newLedgerManager()) { LedgerRangeIterator iter = m.getLedgerRanges(); if (cmdLine.hasOption("m")) { List<ReadMetadataCallback> futures = new ArrayList<ReadMetadataCallback>(LIST_BATCH_SIZE); while (iter.hasNext()) { LedgerRange r = iter.next(); for (Long lid : r.getLedgers()) { ReadMetadataCallback cb = new ReadMetadataCallback(lid); m.readLedgerMetadata(lid, cb); futures.add(cb); } if (futures.size() >= LIST_BATCH_SIZE) { while (futures.size() > 0) { ReadMetadataCallback cb = futures.remove(0); printLedgerMetadata(cb); } } } while (futures.size() > 0) { ReadMetadataCallback cb = futures.remove(0); printLedgerMetadata(cb); } } else { while (iter.hasNext()) { LedgerRange r = iter.next(); for (Long lid : r.getLedgers()) { System.out.println(ledgerIdFormatter.formatLedgerId(lid)); } } } } } return 0; }
Source:
public NGuid getStorageDomainId() { DiskImage firstImage = null; NGuid result = null; if (diskInfoMap.size() > 0) { Iterator<DiskImage> iterator = diskInfoMap.values().iterator(); firstImage = iterator.next(); result = ImagesHandler.getStorageDomainId(firstImage); } return result; }

Target:
public NGuid getStorageDomainId() { List<DiskImage> images = getDiskImageDao().getAllSnapshotsForVmSnapshot(sourceSnapshotId); return (!images.isEmpty()) ? ImagesHandler.getStorageDomainId(images.get(0)) : Guid.Empty; }
Source:
public Response getRemoteByUrl( final @PathParam( "packageType" ) String packageType, final @ApiParam( allowableValues = "remote", required = true ) @PathParam( "type" ) String type, final @QueryParam( "url" ) String url, @Context final HttpServletRequest request, final @Context SecurityContext securityContext ) { if ( !"remote".equals( type ) ) { return ResponseUtils.formatBadRequestResponse( String.format( "Not supporte repository type of %s", type ) ); } logger.info( "Get remote repository by url: {}", url ); Response response; try { final RemoteRepository remote = adminController.getRemoteByUrl( url ); logger.info( "Returning remote repository: {}", remote ); if ( remote == null ) { response = Response.status( Status.NOT_FOUND ) .build(); } else { response = formatOkResponseWithJsonEntity( remote, objectMapper ); } } catch ( final IndyWorkflowException e ) { logger.error( e.getMessage(), e ); response = formatResponse( e ); } return response; }

Target:
public Response getRemoteByUrl( final @PathParam( "packageType" ) String packageType, final @ApiParam( allowableValues = "remote", required = true ) @PathParam( "type" ) String type, final @QueryParam( "url" ) String url, @Context final HttpServletRequest request, final @Context SecurityContext securityContext ) { if ( !"remote".equals( type ) ) { return ResponseUtils.formatBadRequestResponse( String.format( "Not supporte repository type of %s", type ) ); } logger.info( "Get remote repository by url: {}", url ); Response response; try { final List<RemoteRepository> remotes = adminController.getRemoteByUrl( url ); logger.info( "According to url {}, Returning remote listing remote repositories: {}", url, remotes ); if ( remotes == null || remotes.isEmpty() ) { response = Response.status( Status.NOT_FOUND ).build(); } else { final StoreListingDTO<RemoteRepository> dto = new StoreListingDTO<>( remotes ); response = formatOkResponseWithJsonEntity( dto, objectMapper ); } } catch ( final IndyWorkflowException e ) { logger.error( e.getMessage(), e ); response = formatResponse( e ); } return response; }
Source:
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) { Assert.notNull(repoItf, "Repository interface must be set."); Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface."); RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class); Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " + "this repository to the underlying cache."); Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " + "annotation to map this repository to the underlying cache."); String cacheName = null; if (!looksLikeExpression(annotation.cacheName())) { cacheName = annotation.cacheName(); } else { SpelExpressionParser parser = new SpelExpressionParser(); Expression expression = parser.parseExpression(annotation.cacheName()); StandardEvaluationContext ec = new StandardEvaluationContext(); ec.setBeanResolver(new BeanFactoryResolver(ctx.getAutowireCapableBeanFactory())); cacheName = (String)expression.getValue(ec); } repoToCache.put(repoItf, cacheName); return super.getRepositoryMetadata(repoItf); }

Target:
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) { Assert.notNull(repoItf, "Repository interface must be set."); Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface."); RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class); Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " + "this repository to the underlying cache."); Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " + "annotation to map this repository to the underlying cache."); String cacheName = evaluateExpression(annotation.cacheName()); repoToCache.put(repoItf, cacheName); return super.getRepositoryMetadata(repoItf); }
Source:
public long getAgedQueuedFlowSize() { long size = 0L; int minimum_age_minutes = this.azkProps.getInt( ConfigurationKeys.MIN_AGE_FOR_CLASSIFYING_A_JOB_AGED_MINUTES, Constants.MIN_AGE_FOR_CLASSIFYING_A_FLOW_AGED_MINUTES); try { size = this.executorLoader.fetchAgedQueuedFlows(Duration.ofMinutes(minimum_age_minutes)) .size(); } catch (final ExecutorManagerException e) { this.logger.error("Failed to get flows queued for a long time.", e); } return size; }

Target:
public long getAgedQueuedFlowSize() { long size = 0L; int minimum_age_minutes = this.azkProps.getInt( ConfigurationKeys.MIN_AGE_FOR_CLASSIFYING_A_FLOW_AGED_MINUTES, Constants.DEFAULT_MIN_AGE_FOR_CLASSIFYING_A_FLOW_AGED_MINUTES); try { size = this.executorLoader.fetchAgedQueuedFlows(Duration.ofMinutes(minimum_age_minutes)) .size(); } catch (final ExecutorManagerException e) { this.logger.error("Failed to get flows queued for a long time.", e); } return size; }
Source:
private void redeployStreamModule(CuratorFramework client, ModuleDeployment moduleDeployment) throws Exception { Stream stream = (Stream) moduleDeployment.deploymentUnit; ModuleDescriptor moduleDescriptor = moduleDeployment.moduleDescriptor; ModuleDeploymentProperties deploymentProperties = moduleDeployment.deploymentProperties; final ModuleDeploymentProperties mergedProperties = DeploymentPropertiesUtility.createModuleDeploymentProperties( stream.getDeploymentProperties(), moduleDescriptor); mergedProperties.putAll(deploymentProperties); ModuleDeploymentStatus deploymentStatus = null; if (mergedProperties.getCount() > 0) { try { client.setData().forPath( Paths.build(Paths.STREAM_DEPLOYMENTS, stream.getName(), Paths.STATUS), ZooKeeperUtils.mapToBytes(new DeploymentUnitStatus( DeploymentUnitStatus.State.deploying).toMap())); deploymentStatus = moduleDeploymentWriter.writeDeployment( moduleDescriptor, mergedProperties, instantiateContainerMatcher(client, moduleDescriptor)); } catch (NoContainerException e) { logger.warn("No containers available for redeployment of for stream {}", moduleDescriptor.getModuleLabel(), stream.getName()); } finally { updateDeploymentUnitState(client, moduleDeployment, deploymentStatus); } } else { logUnwantedRedeployment(mergedProperties.getCriteria(), moduleDescriptor.getModuleLabel()); } }

Target:
private void redeployStreamModule(CuratorFramework client, ModuleDeployment moduleDeployment) throws Exception { Stream stream = (Stream) moduleDeployment.deploymentUnit; ModuleDescriptor moduleDescriptor = moduleDeployment.moduleDescriptor; ModuleDeploymentProperties deploymentProperties = moduleDeployment.deploymentProperties; final ModuleDeploymentProperties mergedProperties = DeploymentPropertiesUtility.createModuleDeploymentProperties( stream.getDeploymentProperties(), moduleDescriptor); mergedProperties.putAll(deploymentProperties); ModuleDeploymentStatus deploymentStatus = null; if (mergedProperties.getCount() > 0) { try { deploymentStatus = deployModule(client, moduleDeployment, instantiateContainerMatcher(client, moduleDescriptor)); } catch (NoContainerException e) { logger.warn("No containers available for redeployment of for stream {}", moduleDescriptor.getModuleLabel(), stream.getName()); } finally { updateDeploymentUnitState(client, moduleDeployment, deploymentStatus); } } else { logUnwantedRedeployment(mergedProperties.getCriteria(), moduleDescriptor.getModuleLabel()); } }
Source:
public DocumentModel run(DocumentModel input) throws IOException { PDFTextExtractor textExtractor = new PDFTextExtractor(input, pdfxpath); textExtractor.setPassword(password); String extractedText; if (StringUtils.isBlank(patterntofind)) { extractedText = textExtractor.getAllExtractedLines(); } else { extractedText = removepatternfromresult ? textExtractor.extractLastPartOfLine(patterntofind) : textExtractor.extractLineOf(patterntofind); } if (extractedText != null) { input.setPropertyValue(targetxpath, extractedText); } else { DocumentHelper.removeProperty(input, targetxpath); } if (save) { input = session.saveDocument(input); } return input; }

Target:
public DocumentModel run(DocumentModel input) throws IOException { PDFTextExtractor textExtractor = new PDFTextExtractor(input, pdfxpath); textExtractor.setPassword(password); String extractedText; if (StringUtils.isBlank(patterntofind)) { extractedText = textExtractor.getAllExtractedLines(); } else if (removepatternfromresult) { extractedText = textExtractor.extractLastPartOfLine(patterntofind); } else { extractedText = textExtractor.extractLineOf(patterntofind); } if (extractedText != null) { input.setPropertyValue(targetxpath, extractedText); } else { DocumentHelper.removeProperty(input, targetxpath); } if (save) { input = session.saveDocument(input); } return input; }
Source:
public void refreshAllUsers() { DbUserDAO dao = DbFacade.getInstance().getDbUserDao(); List<DbUser> dbUsers = dao.getAll(); dbGroups.clear(); for (DbGroup dbGroup : DbFacade.getInstance().getDbGroupDao().getAll()) { MultiValueMapUtils.addToMap(dbGroup.getNamespace(), dbGroup, dbGroups); } Map<String, List<DbUser>> authzToPrincipalMap = new HashMap<>(); Map<String, ExtensionProxy> authzMap = new HashMap<>(); for (DbUser dbUser : dbUsers) { ExtensionProxy authz = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); if (authz == null) { log.warn(String.format("No authz extension was found for user %1$s. It is possible that the relevant " + "domain for the user was removed for the user. Marking the user as inactive", dbUser.getLoginName())); if (dbUser.isActive()) { dbUser.setActive(false); dao.update(dbUser); } continue; } String auhtzName = AuthzUtils.getName(authz); MultiValueMapUtils.addToMap(auhtzName, dbUser, authzToPrincipalMap); authzMap.put(auhtzName, authz); } List<DbUser> updates = new ArrayList<>(); for (Map.Entry<String, List<DbUser>> entry : authzToPrincipalMap.entrySet()) { List<DbUser> refreshed = refreshUsers(entry.getValue(), authzMap.get(entry.getKey())); updates.addAll(refreshed); } for (DbUser dbUser : updates) { dao.update(dbUser); } }

Target:
public void refreshAllUsers() { DbUserDAO dao = DbFacade.getInstance().getDbUserDao(); List<DbUser> dbUsers = dao.getAll(); Map<String, List<DbGroup>> dbGroups = new HashMap<>(); for (DbGroup dbGroup : DbFacade.getInstance().getDbGroupDao().getAll()) { MultiValueMapUtils.addToMap(dbGroup.getNamespace(), dbGroup, dbGroups); } Map<String, List<DbUser>> authzToPrincipalMap = new HashMap<>(); Map<String, ExtensionProxy> authzMap = new HashMap<>(); for (DbUser dbUser : dbUsers) { ExtensionProxy authz = EngineExtensionsManager.getInstance().getExtensionByName(dbUser.getDomain()); if (authz == null) { log.warn(String.format("No authz extension was found for user %1$s. It is possible that the relevant " + "domain for the user was removed for the user. Marking the user as inactive", dbUser.getLoginName())); if (dbUser.isActive()) { dbUser.setActive(false); dao.update(dbUser); } continue; } String auhtzName = AuthzUtils.getName(authz); MultiValueMapUtils.addToMap(auhtzName, dbUser, authzToPrincipalMap); authzMap.put(auhtzName, authz); } List<DbUser> updates = new ArrayList<>(); for (Map.Entry<String, List<DbUser>> entry : authzToPrincipalMap.entrySet()) { List<DbUser> refreshed = refreshUsers(entry.getValue(), authzMap.get(entry.getKey()), dbGroups); updates.addAll(refreshed); } for (DbUser dbUser : updates) { dao.update(dbUser); } }
Source:
private Map<String, String> getCallsToDockerMap(String mainDescriptor, String defaultContainer) { Map<String, String> map = new HashMap<>(); try { List<GroovySourceAST> processList = getGroovySourceASTList(mainDescriptor, "process"); for (GroovySourceAST processAST : processList) { String processName; try { processName = getProcessValue(processAST); } catch (NullPointerException e) { continue; } GroovySourceAST containerAST = getFirstAstWithKeyword(processAST, "container", false); String containerName; if (containerAST != null) { containerName = containerAST.getNextSibling().getFirstChild().getText(); } else { containerName = defaultContainer; } if (containerName != null) { map.put(processName, containerName); LOG.debug("found container: " + containerName + " in process " + processName); } } } catch (IOException | TokenStreamException | RecognitionException e) { LOG.warn("could not parse", e); } return map; }

Target:
private Map<String, String> getCallsToDockerMap(String mainDescriptor, String defaultContainer) { Map<String, String> map = new HashMap<>(); try { List<GroovySourceAST> processList = getGroovySourceASTList(mainDescriptor, "process"); for (GroovySourceAST processAST : processList) { String processName = getProcessValue(processAST); if (processName == null) { continue; } GroovySourceAST containerAST = getFirstAstWithKeyword(processAST, "container", false); String containerName; if (containerAST != null) { containerName = containerAST.getNextSibling().getFirstChild().getText(); } else { containerName = defaultContainer; } if (containerName != null) { map.put(processName, containerName); LOG.debug("found container: " + containerName + " in process " + processName); } } } catch (IOException | TokenStreamException | RecognitionException e) { LOG.warn("could not parse", e); } return map; }
Source:
public void testParsingJats10() throws Exception { String filePath = "/eu/dnetlib/iis/workflows/ingest/pmc/metadata/data/document_jats10.xml"; InputStream inputStream = null; try { SAXParserFactory saxFactory = SAXParserFactory.newInstance(); saxFactory.setValidating(false); SAXParser saxParser = saxFactory.newSAXParser(); XMLReader reader = saxParser.getXMLReader(); reader.setFeature("<LINK_2>", false); reader.setFeature("<LINK_0>", false); reader.setFeature("<LINK_1>", false); ExtractedDocumentMetadata.Builder metaBuilder = ExtractedDocumentMetadata.newBuilder(); metaBuilder.setId("some-id"); metaBuilder.setText(""); PmcXmlHandler pmcXmlHandler = new PmcXmlHandler(metaBuilder); saxParser.parse(inputStream = PmcXmlHandler.class.getResourceAsStream(filePath), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); } finally { if (inputStream != null) { inputStream.close(); } } }

Target:
public void testParsingJats10() throws Exception { saxParser.parse(inputStream = PmcXmlHandler.class .getResourceAsStream(xmlResourcesRootClassPath + "document_jats10.xml"), pmcXmlHandler); checkJats10Metadata(metaBuilder.build()); }
Source:
public void testShowTablesLikeWithEscape() { MaterializedResult withEscape = computeActual("SHOW TABLES LIKE '%$_%' ESCAPE '$'"); assertThat(withEscape.getOnlyColumnAsSet()).allMatch(tableName -> ((String) tableName).contains("_")); }

Target:
public void testShowTablesLikeWithEscape() { }
Source:
public Object getCompareValue(FormElementModel fem, String value) { switch (fem.getElementType()) { case BOOLEAN: return WebUtils.parseBoolean(value); case JRDATETIME: return WebUtils.parseDate(value); case JRDATE: return WebUtils.parseDate(value); case JRTIME: return WebUtils.parseDate(value); case INTEGER: return Long.valueOf(value); case DECIMAL: return new BigDecimal(value); case SELECT1: return value; case STRING: return value; case GEOPOINT: return new BigDecimal(value); default: throw new IllegalArgumentException("Can't get the compare value for FormElementModel type " + fem.getElementType()); } }

Target:
public Object getCompareValue(FormElementModel fem, String value) { switch (fem.getElementType()) { case BOOLEAN: return WebUtils.parseBoolean(value); case JRDATETIME: case JRDATE: case JRTIME: return WebUtils.parseDate(value); case INTEGER: return Long.valueOf(value); case DECIMAL: return new BigDecimal(value); case SELECT1: case STRING: return value; case GEOPOINT: return new BigDecimal(value); default: throw new IllegalArgumentException("Can't get the compare value for FormElementModel type " + fem.getElementType()); } }
Source:
private void test_expected_event_types(boolean withNaturalEventType, final int numOfAddEventExpected, final int numOfUpdateEventExpected) { Config config = getConfig(); config.setProperty(PROP_LISTENER_WITH_PREDICATE_PRODUCES_NATURAL_EVENT_TYPES, String.valueOf(withNaturalEventType)); config.setProperty("hazelcast.logging.type", "log4j2"); HazelcastInstance node = createHazelcastInstance(config); final AtomicInteger addedEntryCount = new AtomicInteger(); final AtomicInteger updatedEntryCount = new AtomicInteger(); IMap<Integer, Employee> map = node.getMap("test"); map.addEntryListener(new MapListenerAdapter<Integer, Employee>() { @Override public void entryAdded(EntryEvent<Integer, Employee> event) { addedEntryCount.incrementAndGet(); } @Override public void entryUpdated(EntryEvent<Integer, Employee> event) { updatedEntryCount.incrementAndGet(); } }, greaterEqual("age", 3), true); int key = 1; map.set(key, new Employee(1)); map.set(key, new Employee(2)); map.set(key, new Employee(3)); map.set(key, new Employee(4)); assertTrueEventually(new AssertTask() { @Override public void run() { assertEquals(numOfAddEventExpected, addedEntryCount.get()); assertEquals(numOfUpdateEventExpected, updatedEntryCount.get()); } }); }

Target:
private void test_expected_event_types(boolean withNaturalEventType, final int numOfAddEventExpected, final int numOfUpdateEventExpected) { Config config = getConfig(); config.setProperty(PROP_LISTENER_WITH_PREDICATE_PRODUCES_NATURAL_EVENT_TYPES, String.valueOf(withNaturalEventType)); HazelcastInstance node = createHazelcastInstance(config); final AtomicInteger addedEntryCount = new AtomicInteger(); final AtomicInteger updatedEntryCount = new AtomicInteger(); IMap<Integer, Employee> map = node.getMap("test"); map.addEntryListener(new MapListenerAdapter<Integer, Employee>() { @Override public void entryAdded(EntryEvent<Integer, Employee> event) { addedEntryCount.incrementAndGet(); } @Override public void entryUpdated(EntryEvent<Integer, Employee> event) { updatedEntryCount.incrementAndGet(); } }, greaterEqual("age", 3), true); int key = 1; map.set(key, new Employee(1)); map.set(key, new Employee(2)); map.set(key, new Employee(3)); map.set(key, new Employee(4)); assertTrueEventually(new AssertTask() { @Override public void run() { assertEquals(numOfAddEventExpected, addedEntryCount.get()); assertEquals(numOfUpdateEventExpected, updatedEntryCount.get()); } }); }
Source:
public synchronized long getPeakMemoryUsage() { return delegate.getPeakMemoryUsage(); }

Target:
public long getPeakMemoryUsage() { OutputBuffer outputBuffer; synchronized (this) { outputBuffer = delegate; } if (outputBuffer != null) { return outputBuffer.getPeakMemoryUsage(); } return 0; }
Source:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = nbEvents / DEFAULT_FACTOR; fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); }

Target:
public TmfGraphBuildRequest(ITmfGraphProvider provider, IProgressMonitor monitor) { super(TmfEvent.class, TmfTimeRange.ETERNITY, 0, ITmfEventRequest.ALL_DATA, ITmfEventRequest.ExecutionType.BACKGROUND); fProvider = provider; long nbEvents = provider.getTrace().getNbEvents(); fEventFactor = Math.max(DEFAULT_FACTOR, nbEvents / DEFAULT_FACTOR); fMonitor = SubMonitor.convert(monitor, DEFAULT_FACTOR + 2); }
Source:
private void parseAll() throws ConfigInvalidException, IOException { walk.markStart(walk.parseCommit(tip)); for (RevCommit commit : walk) { walk.parseBody(commit); parse(commit); } pruneReviewers(); for (Collection<PatchSetApproval> v : approvals.asMap().values()) { Collections.sort((List<PatchSetApproval>) v, PSA_BY_TIME); } }

Target:
private void parseAll() throws ConfigInvalidException, IOException { walk.markStart(walk.parseCommit(tip)); for (RevCommit commit : walk) { parse(commit); } pruneReviewers(); for (Collection<PatchSetApproval> v : approvals.asMap().values()) { Collections.sort((List<PatchSetApproval>) v, PSA_BY_TIME); } }
Source:
public synchronized ILogData current() { final QueuedStreamContext context = getCurrentContext(); if (Address.nonAddress(context.getGlobalPointer())) { return null; } return read(context.getGlobalPointer()); }

Target:
public synchronized ILogData current() { final QueuedStreamContext context = getCurrentContext(); if (Address.nonAddress(context.getGlobalPointer())) { return null; } return read(context.getGlobalPointer(), context.getGlobalPointer()); }
Source:
private InputStream createZip(SourceResponse sourceResponse, String transformerId) throws CatalogTransformerException { ServiceReference<MetacardTransformer> serviceRef = getTransformerServiceReference(transformerId); MetacardTransformer transformer = bundleContext.getService(serviceRef); String extension = getFileExtensionFromService(serviceRef); if (StringUtils.isNotBlank(extension)) { extension = "." + extension; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) { for (Result result : sourceResponse.getResults()) { Metacard metacard = result.getMetacard(); BinaryContent binaryContent = transformer.transform(metacard, Collections.emptyMap()); ZipEntry entry = new ZipEntry(METACARD_PATH + metacard.getId() + extension); zipOutputStream.putNextEntry(entry); zipOutputStream.write(binaryContent.getByteArray()); zipOutputStream.closeEntry(); } return new ByteArrayInputStream(baos.toByteArray()); } catch (IOException e) { throw new CatalogTransformerException( "An error occurred while initializing or closing output stream", e); } }

Target:
private InputStream createZip(SourceResponse sourceResponse, String transformerId) throws CatalogTransformerException { ServiceReference<MetacardTransformer> serviceRef = getTransformerServiceReference(transformerId); MetacardTransformer transformer = bundleContext.getService(serviceRef); String extension = getFileExtensionFromService(serviceRef); if (StringUtils.isNotBlank(extension)) { extension = "." + extension; } try (FileBackedOutputStream fileBackedOutputStream = new FileBackedOutputStream(BUFFER_SIZE); ZipOutputStream zipOutputStream = new ZipOutputStream(fileBackedOutputStream)) { for (Result result : sourceResponse.getResults()) { Metacard metacard = result.getMetacard(); BinaryContent binaryContent = getTransformedMetacard(metacard, Collections.emptyMap(), transformer); if (binaryContent != null) { ZipEntry entry = new ZipEntry(METACARD_PATH + metacard.getId() + extension); zipOutputStream.putNextEntry(entry); zipOutputStream.write(binaryContent.getByteArray()); zipOutputStream.closeEntry(); } else { LOGGER.debug("Metacard with id was not added to zip file", metacard.getId()); } } return fileBackedOutputStream.asByteSource().openStream(); } catch (IOException e) { throw new CatalogTransformerException( "An error occurred while initializing or closing output stream", e); } }
Source:
public String getDefaultSchemaName() { return defaultSchemaName; }

Target:
protected String getDefaultSchemaName() { return defaultSchemaName; }
Source:
String cause() default ""; } public interface Condition { boolean shouldIgnore(); default boolean supportClassRule() { return false; } }

Target:
String cause() default ""; } public interface Condition { boolean shouldIgnore(); default boolean supportsClassRule() { return false; } }
Source:
public static void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getLocalizedMessage(), e)); }

Target:
public static void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e)); }
Source:
public String getName(IterationInfo iteration) { FeatureInfo feature = iteration.getFeature(); if (!feature.isReportIterations()) { return feature.getName(); } StringJoiner nameJoiner = new StringJoiner(", ", "[", "]"); Map<String, Object> dataVariables = iteration.getDataVariables(); if (dataVariables != null) { dataVariables.forEach((name, value) -> nameJoiner.add(format("%s: %s", name, GroovyRuntimeUtil.toString(value)))); } nameJoiner.add(format("iterationIndex: %d", iteration.getIterationIndex())); return format("%s %s", feature.getName(), nameJoiner.toString()); }

Target:
public String getName(IterationInfo iteration) { FeatureInfo feature = iteration.getFeature(); if (!feature.isReportIterations()) { return feature.getName(); } StringJoiner nameJoiner = new StringJoiner(", ", "[", "]"); Map<String, Object> dataVariables = iteration.getDataVariables(); if (dataVariables != null) { dataVariables.forEach((name, value) -> { String valueString; try { valueString = toStringOrDump(value); } catch (Exception e) { valueString = format("#Error:%s during rendering", e.getClass().getSimpleName()); } nameJoiner.add(format("%s: %s", name, valueString)); }); } nameJoiner.add(format("#%d", iteration.getIterationIndex())); return format("%s %s", feature.getName(), nameJoiner.toString()); }
Source:
public byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException { hmac.update(input); byte[] hash = hmac.doFinal(aadLength); byte[] tag = new byte[hmacKey.length]; System.arraycopy(hash, 0, tag, 0, hmacKey.length); if (!ByteExtensions.sequenceEqualConstantTime(tag, tag)) { throw new IllegalArgumentException("Data is not authentic"); } return inner.doFinal(input); }

Target:
public byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmException { hmac.update(input); byte[] hash = hmac.doFinal(aadLength); byte[] tag = new byte[hmacKey.length]; System.arraycopy(hash, 0, tag, 0, hmacKey.length); if (!ByteExtensions.sequenceEqualConstantTime(tag, tag)) { logger.logAndThrow(new IllegalArgumentException("Data is not authentic")); } return inner.doFinal(input); }
Source:
public void setAtomInfo(String atomName, int serialNumber, char alternativeLocationId, float x, float y, float z, float occupancy, float temperatureFactor, String element, int charge) { Atom atom = new AtomImpl(); Group altGroup = null; atom.setPDBserial(serialNumber); atom.setName(atomName.trim()); atom.setElement(Element.valueOfIgnoreCase(element)); if(alternativeLocationId==MmtfStructure.UNAVAILABLE_CHAR_VALUE){ alternativeLocationId = ' '; } if (alternativeLocationId != ' ') { altGroup = getCorrectAltLocGroup(alternativeLocationId); atom.setAltLoc(alternativeLocationId); } else { atom.setAltLoc(Character.valueOf(' ')); } atom.setX(x); atom.setY(y); atom.setZ(z); atom.setOccupancy(occupancy); atom.setTempFactor(temperatureFactor); atom.setCharge((short) charge); if (altGroup == null) { group.addAtom(atom); } else { altGroup.setChain(chain); altGroup.addAtom(atom); } if (!group.hasAtom(atom.getName())) { if (group.getPDBName().equals(atom.getGroup().getPDBName())) { if(StructureTools.hasNonDeuteratedEquiv(atom,group)){ } else{ group.addAtom(atom); } } } atomsInGroup.add(atom); allAtoms[atomCounter] = atom; atomCounter++; }

Target:
public void setAtomInfo(String atomName, int serialNumber, char alternativeLocationId, float x, float y, float z, float occupancy, float temperatureFactor, String element, int charge) { Atom atom = new AtomImpl(); Group altGroup = null; atom.setPDBserial(serialNumber); atom.setName(atomName.trim()); atom.setElement(Element.valueOfIgnoreCase(element)); if(alternativeLocationId==MmtfStructure.UNAVAILABLE_CHAR_VALUE){ alternativeLocationId = ' '; } if (alternativeLocationId != ' ') { altGroup = getCorrectAltLocGroup(alternativeLocationId); atom.setAltLoc(alternativeLocationId); } else { atom.setAltLoc(Character.valueOf(' ')); } atom.setX(x); atom.setY(y); atom.setZ(z); atom.setOccupancy(occupancy); atom.setTempFactor(temperatureFactor); atom.setCharge((short) charge); if (altGroup == null) { group.addAtom(atom); } else { altGroup.setChain(chain); altGroup.addAtom(atom); } if (!group.hasAtom(atom.getName())) { if (group.getPDBName().equals(atom.getGroup().getPDBName())) { if(!StructureTools.hasNonDeuteratedEquiv(atom,group)){ group.addAtom(atom); } } } atomsInGroup.add(atom); allAtoms[atomCounter] = atom; atomCounter++; }
Source:
protected void closeReviewer(int result, boolean saveDeck) { if( mMicToolBar != null ) { mMicToolBar.notifyStopRecord(); } if( tempAudioPath != null ) { File tempAudioPathToDelete = new File(tempAudioPath); if (tempAudioPathToDelete.exists()) tempAudioPathToDelete.delete(); } mTimeoutHandler.removeCallbacks(mShowAnswerTask); mTimeoutHandler.removeCallbacks(mShowQuestionTask); mTimerHandler.removeCallbacks(removeChosenAnswerText); longClickHandler.removeCallbacks(longClickTestRunnable); longClickHandler.removeCallbacks(startLongClickAction); AbstractFlashcardViewer.this.setResult(result); if (saveDeck) { UIUtils.saveCollectionInBackground(this); } finishWithAnimation(ActivityTransitionAnimation.RIGHT); }

Target:
protected void closeReviewer(int result, boolean saveDeck) { if (mMicToolBar != null) { mMicToolBar.notifyStopRecord(); } if (mTempAudioPath != null) { File tempAudioPathToDelete = new File(mTempAudioPath); if (tempAudioPathToDelete.exists()) { tempAudioPathToDelete.delete(); } } mTimeoutHandler.removeCallbacks(mShowAnswerTask); mTimeoutHandler.removeCallbacks(mShowQuestionTask); mTimerHandler.removeCallbacks(removeChosenAnswerText); longClickHandler.removeCallbacks(longClickTestRunnable); longClickHandler.removeCallbacks(startLongClickAction); AbstractFlashcardViewer.this.setResult(result); if (saveDeck) { UIUtils.saveCollectionInBackground(this); } finishWithAnimation(ActivityTransitionAnimation.RIGHT); }
Source:
public void initialize(URL location, ResourceBundle resources) { xpathExpressionArea.setSyntaxHighlightingEnabled(new XPathSyntaxHighlighter()); initGenerateXPathFromStackTrace(); EventStreams.valuesOf(xpathResultListView.getSelectionModel().selectedItemProperty()) .filter(Objects::nonNull) .subscribe(parent::onNodeItemSelected); Platform.runLater(this::bindToParent); xpathExpressionArea.richChanges() .filter(t -> !t.getInserted().equals(t.getRemoved())) .successionEnds(XPATH_REFRESH) .subscribe(x -> parent.xPathEvaluate()); }

Target:
public void initialize(URL location, ResourceBundle resources) { xpathExpressionArea.setSyntaxHighlightingEnabled(new XPathSyntaxHighlighter()); initGenerateXPathFromStackTrace(); EventStreams.valuesOf(xpathResultListView.getSelectionModel().selectedItemProperty()) .conditionOn(xpathResultListView.focusedProperty()) .filter(Objects::nonNull) .subscribe(parent::onNodeItemSelected); Platform.runLater(this::bindToParent); xpathExpressionArea.richChanges() .filter(t -> !t.getInserted().equals(t.getRemoved())) .successionEnds(XPATH_REFRESH) .subscribe(x -> parent.refreshXPathResults()); }
Source:
public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException { Attribute attribute = attributes.get(ldapAttribute); final int size = attribute.size(); for (int i = 0; i < size; i++) { LdapName certSubjectDn = new LdapName(certificate.getSubjectDN().getName()); LdapName attributeDn = new LdapName((String)attribute.get(i)); if (certSubjectDn.equals(attributeDn)) { return true; } } return false; }

Target:
public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException { Attribute attribute = attributes.get(ldapAttribute); if (attribute == null) return false; final int size = attribute.size(); for (int i = 0; i < size; i++) { Object attrSubject = attribute.get(i); if (attrSubject != null){ X500Principal certSubjectX500Principal = certificate.getSubjectX500Principal(); X500Principal attSubjectX500Principal = new X500Principal((String) attrSubject); if ( certSubjectX500Principal.equals(attSubjectX500Principal) ) { return true; } } } return false; }
Source:
private void handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); if (localMonitoringService.getMetrics().getSequencerStatus() == SequencerStatus.READY) { log.trace("Primary sequencer is ready. Nothing to do"); return; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return; } log.info("Attempting to bootstrap the primary sequencer."); getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker); }

Target:
private CompletableFuture<DetectorTask> handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); if (localMonitoringService.getMetrics().join().getSequencerStatus() == SequencerStatus.READY) { log.trace("Primary sequencer is ready. Nothing to do"); return DETECTOR_TASK_SKIPPED; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return DETECTOR_TASK_SKIPPED; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return DETECTOR_TASK_SKIPPED; } log.info("Attempting to bootstrap the primary sequencer."); return getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker) .thenApply(DetectorTask::fromBool); }
Source:
private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { }

Target:
private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder .addChildResource(UndertowExtension.PATH_APPLICATION_SECURITY_DOMAIN) .getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, ENABLE_JASPI, INTEGRATED_JASPI) .setDiscard(DiscardAttributeChecker.ALWAYS, ENABLE_JASPI, INTEGRATED_JASPI) .end(); }
Source:
public String toString() { if (amount == (long) amount) { return currency + " " + Long.toString((long) amount); } return currency + " " + Double.toString(amount); }

Target:
public String toString() { return currency + " " + (DoubleMath.isMathematicalInteger(amount) ? Long.toString((long) amount) : Double.toString(amount)); }
Source:
public void create( org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter ) { BusyPopup.showMessage( translationService.getTranslation( FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse ) ); modelerService.call( path -> { BusyPopup.close(); presenter.complete(); notifySuccess(); PlaceRequest place = new PathPlaceRequest( (Path) path, "FormEditor" ); placeManager.goTo( place ); }, ( message, throwable ) -> { BusyPopup.close(); ErrorPopup.showMessage( CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother() ); return true; } ).createForm( pkg.getPackageMainResourcesPath(), buildFileName( baseFileName, resourceType ), formModelsPresenter.getFormModel() ); }

Target:
public void create( org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter ) { BusyPopup.showMessage( translationService.getTranslation( FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse ) ); modelerService.call( path -> { BusyPopup.close(); presenter.complete(); notifySuccess(); PlaceRequest place = new PathPlaceRequest( (Path) path, "FormEditor" ); placeManager.goTo( place ); }, ( message, throwable ) -> { BusyPopup.close(); ErrorPopup.showMessage( CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother() ); return false; } ).createForm( pkg.getPackageMainResourcesPath(), buildFileName( baseFileName, resourceType ), formModelsPresenter.getFormModel() ); }
Source:
public void start() { int port = getIntSetting(SETTING_PORT); String host = getStringSetting(SETTING_HOST); try { graphiteHttpUrl = new URL("http", host, port, "upload"); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } logger.info("Start Graphite writer connected to '{}'...", graphiteHttpUrl); metricPathPrefix = getStringSetting(SETTING_NAME_PREFIX, DEFAULT_NAME_PREFIX); metricPathPrefix = getStrategy().resolveExpression(metricPathPrefix); if (!metricPathPrefix.isEmpty() && !metricPathPrefix.endsWith(".")) { metricPathPrefix = metricPathPrefix + "."; } }

Target:
public void start() { String url = getStringSetting(SETTING_URL); try { graphiteHttpUrl = new URL(url); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } logger.info("Start Graphite writer connected to '{}'...", graphiteHttpUrl); metricPathPrefix = getStringSetting(SETTING_NAME_PREFIX, DEFAULT_NAME_PREFIX); metricPathPrefix = getStrategy().resolveExpression(metricPathPrefix); if (!metricPathPrefix.isEmpty() && !metricPathPrefix.endsWith(".")) { metricPathPrefix = metricPathPrefix + "."; } }