auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException { boolean processResults; try { processResults = createAccountingDocumentService.createAccountingDocumentsFromXml(); } catch (Exception e) { LOG.error("execute, An error has ocurred while processing input files.", e); processResults = false; } LOG.info("execute, the processing results are: " + processResults); return processResults; }

Target:
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException { boolean processResults; try { processResults = createAccountingDocumentService.createAccountingDocumentsFromXml(); } catch (Exception e) { LOG.error("execute, An error has occurred while processing input files.", e); processResults = false; } if (processResults) { LOG.info("execute, The job ran successfully"); } else { LOG.warn("execute, there were non business rules errors that caused this job to fail"); } return processResults; }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (divBy != 0 && children.get(0).evaluate(tuple, ptr)) { Timestamp ts = (Timestamp)PDataType.TIMESTAMP.toObject(ptr, children.get(0).getColumnModifier()); Timestamp roundedTs; if(divBy == 1 && ts.getNanos() > java.util.concurrent.TimeUnit.MILLISECONDS.toNanos(1)/2) { roundedTs = new Timestamp(roundTime(ts.getTime() + 1)); } else { roundedTs = new Timestamp(roundTime(ts.getTime())); } byte[] byteValue = getDataType().toBytes(roundedTs , children.get(0).getColumnModifier()); ptr.set(byteValue); return true; } return false; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (children.get(0).evaluate(tuple, ptr)) { ColumnModifier columnModifier = children.get(0).getColumnModifier(); PDataType dataType = getDataType(); int nanos = dataType.getNanos(ptr, columnModifier); if(nanos / divBy >= HALF_OF_NANOS_IN_MILLI) { long timeMillis = dataType.getMillis(ptr, columnModifier); Timestamp roundedTs = new Timestamp(timeMillis + 1); byte[] byteValue = dataType.toBytes(roundedTs); ptr.set(byteValue); } return true; } return false; }
Source:
public boolean exchangeableCoupon(long couponId, String loginName){ long exchange_point = couponExchangeMapper.findByCouponId(couponId).getExchangePoint(); long availablePoint = accountMapper.findUsersAccountAvailablePoint(loginName); CouponModel couponModel = couponMapper.lockById(couponId); return availablePoint >= exchange_point && couponModel.getIssuedCount() <= couponModel.getTotalCount(); }

Target:
public boolean exchangeableCoupon(long couponId, String loginName){ long exchangePoint = couponExchangeMapper.findByCouponId(couponId).getExchangePoint(); long availablePoint = accountMapper.findUsersAccountAvailablePoint(loginName); CouponModel couponModel = couponMapper.lockById(couponId); return availablePoint >= exchangePoint && couponModel.getIssuedCount() <= couponModel.getTotalCount(); }
Source:
private Set<HistoricalChannelEntry> calculateChannelHistory(Channel input) { Builder<HistoricalChannelEntry> entries = ImmutableSet.builder(); for (TemporalField<String> title : input.getAllTitles()) { if (title.getStartDate() == null) { continue; } HistoricalChannelEntry entry = new HistoricalChannelEntry(title.getStartDate()); entry.setTitle(title.getValue()); Iterable<Image> primaryImages = Iterables.filter( input.getImagesForDate(title.getStartDate()), Channel.IS_PRIMARY_IMAGE ); if (!Iterables.isEmpty(primaryImages)) { entry.setImage(Iterables.getOnlyElement(primaryImages).getCanonicalUri()); } entry.setImages(Iterables.transform( input.getImagesForDate(title.getStartDate()), input1 -> imageSimplifier.simplify(input1, ImmutableSet.of(), null) )); entries.add(entry); } for (TemporalField<Image> image : input.getAllImages()) { if (image.getStartDate() == null) { continue; } HistoricalChannelEntry entry = new HistoricalChannelEntry(image.getStartDate()); entry.setTitle(input.getTitleForDate(image.getStartDate())); entry.setImage(image.getValue().getCanonicalUri()); entry.setImages(Iterables.transform( input.getImagesForDate(image.getStartDate()), input12 -> imageSimplifier.simplify(input12, ImmutableSet.of(), null) )); entries.add(entry); } return entries.build(); }

Target:
private Set<HistoricalChannelEntry> calculateChannelHistory(Channel input) { Builder<HistoricalChannelEntry> entries = ImmutableSet.builder(); for (TemporalField<String> title : input.getAllTitles()) { if (title.getStartDate() == null) { continue; } HistoricalChannelEntry entry = new HistoricalChannelEntry(title.getStartDate()); entry.setTitle(title.getValue()); Iterable<Image> primaryImages = input.getImagesForDate(title.getStartDate()).stream() .filter(Channel.IS_PRIMARY_IMAGE::apply) .collect(Collectors.toList()); if (!Iterables.isEmpty(primaryImages)) { entry.setImage(Iterables.getOnlyElement(primaryImages).getCanonicalUri()); } entry.setImages(input.getImagesForDate(title.getStartDate()).stream() .map(imageForDate -> imageSimplifier.simplify(imageForDate, ImmutableSet.of(), null)) .collect(Collectors.toList()) ); entries.add(entry); } for (TemporalField<Image> image : input.getAllImages()) { if (image.getStartDate() == null) { continue; } HistoricalChannelEntry entry = new HistoricalChannelEntry(image.getStartDate()); entry.setTitle(input.getTitleForDate(image.getStartDate())); entry.setImage(image.getValue().getCanonicalUri()); entry.setImages(input.getImagesForDate(image.getStartDate()).stream() .map(imageForDate -> imageSimplifier.simplify(imageForDate, ImmutableSet.of(), null)) .collect(Collectors.toList()) ); entries.add(entry); } return entries.build(); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTreeImpl methodTree = (MethodTreeImpl) tree; if (BooleanUtils.isFalse(methodTree.isOverriding())) { MethodSymbol methodSymbol = methodTree.symbol(); TypeSymbol owner = (TypeSymbol) methodSymbol.owner(); Type superClass = owner.superClass(); if(superClass != null && !SERIALIZATION_METHOD_NAME.contains(methodSymbol.name())) { checkMethod(methodTree.simpleName(), methodSymbol, superClass); superClass = superClass.symbol().superClass(); while (superClass != null) { checkStaticMethod(methodTree.simpleName(), methodSymbol, superClass); superClass = superClass.symbol().superClass(); } } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTreeImpl methodTree = (MethodTreeImpl) tree; if (BooleanUtils.isFalse(methodTree.isOverriding())) { MethodSymbol methodSymbol = methodTree.symbol(); TypeSymbol owner = (TypeSymbol) methodSymbol.owner(); Type superClass = owner.superClass(); if(superClass != null && !SERIALIZATION_METHOD_NAME.contains(methodSymbol.name())) { boolean reportStaticIssue = checkMethod(methodTree.simpleName(), methodSymbol, superClass); superClass = superClass.symbol().superClass(); while (superClass != null && !reportStaticIssue) { reportStaticIssue = checkStaticMethod(methodTree.simpleName(), methodSymbol, superClass); superClass = superClass.symbol().superClass(); } } } }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("host", host) .add("port", port) .add("username", username) .add("type", type) .add("nonProxyHosts", nonProxyHosts) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("host", host) .add("port", port) .add("username", username) .add("password", password == null ? "null" : "*********") .add("type", type) .add("nonProxyHosts", nonProxyHosts) .toString(); }
Source:
public BooleanWrapper createNodeSource(String nodeSourceName, String infrastructureType, Object[] infrastructureParameters, String policyType, Object[] policyParameters, boolean nodesRecoverable) { if (nodeSourceName == null) { throw new IllegalArgumentException("Node Source name cannot be null"); } nodeSourceName = nodeSourceName.trim(); NodeSourceData nodeSourceData = new NodeSourceData(nodeSourceName, infrastructureType, infrastructureParameters, policyType, policyParameters, caller, nodesRecoverable); boolean added = dbManager.addNodeSource(nodeSourceData); try { return createNodeSource(nodeSourceData, nodesRecoverable); } catch (RuntimeException ex) { logger.error(ex.getMessage(), ex); if (added && !(ex instanceof NodeSourceNameAlreadyExistException)) { dbManager.removeNodeSource(nodeSourceName); } throw ex; } }

Target:
public BooleanWrapper createNodeSource(String nodeSourceName, String infrastructureType, Object[] infrastructureParameters, String policyType, Object[] policyParameters, boolean nodesRecoverable) { if (nodeSourceName == null) { throw new IllegalArgumentException("Node Source name cannot be null"); } nodeSourceName = nodeSourceName.trim(); NodeSourceData nodeSourceData = new NodeSourceData(nodeSourceName, infrastructureType, infrastructureParameters, policyType, policyParameters, caller, nodesRecoverable); boolean added = dbManager.addNodeSource(nodeSourceData); try { return createNodeSource(nodeSourceData, nodesRecoverable); } catch (NodeSourceNameAlreadyExistException e) { logger.error(e.getMessage(), e); throw e; } catch (RuntimeException ex) { logger.error(ex.getMessage(), ex); if (added) { dbManager.removeNodeSource(nodeSourceName); } throw ex; } }
Source:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error(new RuntimeException("Token credentials require a URL using the HTTPS protocol scheme")); } return next.clone().process() .doOnNext(httpResponse -> { try { httpResponse.getBody().subscribe().dispose(); } catch (Throwable ignored) { } }) .map(res -> res.getHeaderValue(WWW_AUTHENTICATE)) .map(header -> extractChallenge(header, BEARER_TOKEN_PREFIX)) .flatMap(map -> { cache.setTokenRequest(new TokenRequestContext().addScopes(map.get("resource") + "/.default")); return cache.getToken(); }) .flatMap(token -> { context.getHttpRequest().setHeader(AUTHORIZATION, BEARER_TOKEN_PREFIX + token.getToken()); return next.process(); }); }

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { if ("http".equals(context.getHttpRequest().getUrl().getProtocol())) { return Mono.error(new RuntimeException("Token credentials require a URL using the HTTPS protocol scheme")); } return next.clone().process() .doOnNext(httpResponse -> { try { httpResponse.getBody().subscribe().dispose(); } catch (RuntimeException ignored) { logger.logExceptionAsWarning(ignored); } }) .map(res -> res.getHeaderValue(WWW_AUTHENTICATE)) .map(header -> extractChallenge(header, BEARER_TOKEN_PREFIX)) .flatMap(map -> { cache.setTokenRequest(new TokenRequestContext().addScopes(map.get("resource") + "/.default")); return cache.getToken(); }) .flatMap(token -> { context.getHttpRequest().setHeader(AUTHORIZATION, BEARER_TOKEN_PREFIX + token.getToken()); return next.process(); }); }
Source:
public void start( StageExecution execution ) { StringBuilder names = new StringBuilder(); names.append( names.length() > 0 ? ", " : "" ).append( execution.getStageName() ); out.println( format( "%n>>>>> EXECUTING STAGE(s) %s <<<<<%n", names ) ); }

Target:
public void start( StageExecution execution ) { out.println( format( "%n>>>>> EXECUTING STAGE %s <<<<<%n", execution.getStageName() ) ); }
Source:
private static IBinding resolveGetFunction(ICompositeType classType, IASTNode point, ICPPEvaluation argument, ICPPEvaluation index) { IBinding[] allGetBindings = CPPSemantics.findBindings(classType.getCompositeScope(), GET_NAME, false); ICPPFunction[] functions = Arrays.stream(allGetBindings).filter(IFunction.class::isInstance) .map(IFunction.class::cast).toArray(ICPPFunction[]::new); ICPPTemplateArgument[] arguments = new ICPPTemplateArgument[] { new CPPTemplateNonTypeArgument(index) }; LookupData lookupGet = new LookupData(GET_NAME, arguments, point); lookupGet.setFunctionArguments(true, argument); try { return CPPSemantics.resolveFunction(lookupGet, functions, true, true); } catch (DOMException e) { return null; } }

Target:
private static IBinding resolveGetFunction(ICompositeType classType, IASTNode point, ICPPEvaluation argument, ICPPEvaluation index) { IBinding[] allGetBindings = CPPSemantics.findBindings(classType.getCompositeScope(), GET_NAME, false, point); ICPPFunction[] functions = Arrays.stream(allGetBindings).filter(IFunction.class::isInstance) .map(IFunction.class::cast).toArray(ICPPFunction[]::new); ICPPTemplateArgument[] arguments = new ICPPTemplateArgument[] { new CPPTemplateNonTypeArgument(index) }; LookupData lookupGet = new LookupData(GET_NAME, arguments, point); lookupGet.setFunctionArguments(true, argument); try { return CPPSemantics.resolveFunction(lookupGet, functions, true, true); } catch (DOMException e) { return null; } }
Source:
private boolean isWatchListFilter(String filter) { return filter.isEmpty() || filter.matches(WATCH_LIST_FILTER_REGEX); }

Target:
public static boolean isWatchListFilter(String filter) { return filter.isEmpty() || filter.matches(WATCH_LIST_FILTER_REGEX); }
Source:
public String searchSeriesByCatalog( @RequestParam(name = "catalogNumber", defaultValue = "") String catalogNumber, @RequestParam(name = "catalogName", defaultValue = "") String catalogName, @RequestParam(name = "inCollection", defaultValue = "false") Boolean inCollection, @CurrentUser Integer currentUserId, Model model, Locale userLocale, RedirectAttributes redirectAttributes) { if (StringUtils.isBlank(catalogNumber)) { redirectAttributes.addFlashAttribute("numberIsEmpty", true); return "redirect:" + SiteUrl.INDEX_PAGE; } String lang = LocaleUtils.getLanguageOrNull(userLocale); List<SeriesInfoDto> series; switch (catalogName) { case "michel": series = seriesService.findByMichelNumber(catalogNumber, lang); break; case "scott": series = seriesService.findByScottNumber(catalogNumber, lang); break; case "yvert": series = seriesService.findByYvertNumber(catalogNumber, lang); break; case "gibbons": series = seriesService.findByGibbonsNumber(catalogNumber, lang); break; case "solovyov": series = seriesService.findBySolovyovNumber(catalogNumber, lang); break; case "zagorski": series = seriesService.findByZagorskiNumber(catalogNumber, lang); break; default: series = Collections.emptyList(); break; } if (Features.SEARCH_IN_COLLECTION.isActive() && inCollection && SecurityContextHolder.getContext().getAuthentication().isAuthenticated()) { series = series .stream() .filter( e->collectionService.isSeriesInCollection(currentUserId, e.getId()) ) .collect(Collectors.toList()); } model.addAttribute("searchResults", series); return "series/search_result"; }

Target:
public String searchSeriesByCatalog( @RequestParam(name = "catalogNumber", defaultValue = "") String catalogNumber, @RequestParam(name = "catalogName", defaultValue = "") String catalogName, @RequestParam(name = "inCollection", defaultValue = "false") Boolean inCollection, @CurrentUser Integer currentUserId, Model model, Locale userLocale, RedirectAttributes redirectAttributes) { if (StringUtils.isBlank(catalogNumber)) { redirectAttributes.addFlashAttribute("numberIsEmpty", true); return "redirect:" + SiteUrl.INDEX_PAGE; } String lang = LocaleUtils.getLanguageOrNull(userLocale); List<SeriesInfoDto> series; switch (catalogName) { case "michel": series = seriesService.findByMichelNumber(catalogNumber, lang); break; case "scott": series = seriesService.findByScottNumber(catalogNumber, lang); break; case "yvert": series = seriesService.findByYvertNumber(catalogNumber, lang); break; case "gibbons": series = seriesService.findByGibbonsNumber(catalogNumber, lang); break; case "solovyov": series = seriesService.findBySolovyovNumber(catalogNumber, lang); break; case "zagorski": series = seriesService.findByZagorskiNumber(catalogNumber, lang); break; default: series = Collections.emptyList(); break; } if (Features.SEARCH_IN_COLLECTION.isActive() && inCollection && currentUserId != null) { series = series .stream() .filter( e -> collectionService.isSeriesInCollection(currentUserId, e.getId()) ) .collect(Collectors.toList()); } model.addAttribute("searchResults", series); return "series/search_result"; }
Source:
public void testAlterReplicaLogDirsUnrequested() throws Exception { Node node0 = new Node(0, "localhost", 8120); Node node1 = new Node(1, "localhost", 8121); try (AdminClientUnitTestEnv env = mockClientEnv()) { createAlterLogDirsResponse(env, node0, Errors.NONE, 0); createAlterLogDirsResponse(env, node1, Errors.NONE, 1, 2); TopicPartitionReplica tpr0 = new TopicPartitionReplica("topic", 0, 0); TopicPartitionReplica tpr1 = new TopicPartitionReplica("topic", 0, 1); Map<TopicPartitionReplica, String> logDirs = new HashMap<>(); logDirs.put(tpr0, "/data0"); logDirs.put(tpr1, "/data1"); AlterReplicaLogDirsResult result = env.adminClient().alterReplicaLogDirs(logDirs); TestUtils.assertFutureError(result.values().get(tpr1), IllegalStateException.class); } }

Target:
public void testAlterReplicaLogDirsUnrequested() throws Exception { try (AdminClientUnitTestEnv env = mockClientEnv()) { createAlterLogDirsResponse(env, env.cluster().nodeById(0), Errors.NONE, 1, 2); TopicPartitionReplica tpr1 = new TopicPartitionReplica("topic", 1, 0); Map<TopicPartitionReplica, String> logDirs = new HashMap<>(); logDirs.put(tpr1, "/data1"); AlterReplicaLogDirsResult result = env.adminClient().alterReplicaLogDirs(logDirs); assertNull(result.values().get(tpr1).get()); } }
Source:
protected void cleanup(Context context) throws IOException, InterruptedException{ String strNumOfRegions = PhoenixConfigurationUtil.getNumOfRegions(context.getConfiguration()); if (strNumOfRegions != null) { String fullTableName = PhoenixConfigurationUtil.getInputTableName(context.getConfiguration()); int newNumRegions = regionCountForTesting != null ? regionCountForTesting : IndexUtil.getNumOfRegions(context.getConfiguration(), fullTableName); int prevNumRegions = Integer.parseInt(strNumOfRegions); if (newNumRegions != prevNumRegions) { throw new IOException(String.format("Data table split/merge happened during Index rebuild. Old region cnt=%d, New region cnt = %d" , prevNumRegions, newNumRegions)); } } try { IndexToolUtil.updateIndexState(context.getConfiguration(), PIndexState.ACTIVE); updateTasksTable(context); } catch (SQLException e) { LOGGER.error(" Failed to update the status to Active"); throw new RuntimeException(e.getMessage()); } }

Target:
protected void cleanup(Context context) throws IOException, InterruptedException{ String strNumOfRegions = PhoenixConfigurationUtil.getNumOfRegions(context.getConfiguration()); if (strNumOfRegions != null) { String fullTableName = PhoenixConfigurationUtil.getInputTableName(context.getConfiguration()); final Properties overrideProps = new Properties(); try { final Connection connection = ConnectionUtil.getOutputConnection(context.getConfiguration(), overrideProps); int newNumRegions = regionCountForTesting != null ? regionCountForTesting : IndexUtil.getNumOfRegions(connection, fullTableName); int prevNumRegions = Integer.parseInt(strNumOfRegions); if (newNumRegions != prevNumRegions) { throw new IOException(String.format(SPLIT_MERGE_ERROR_STR_FMT, prevNumRegions, newNumRegions)); } } catch (SQLException e) { LOGGER.error("Failed get the number of regions"); throw new RuntimeException(e.getMessage()); } } try { IndexToolUtil.updateIndexState(context.getConfiguration(), PIndexState.ACTIVE); updateTasksTable(context); } catch (SQLException e) { LOGGER.error(" Failed to update the status to Active"); throw new RuntimeException(e.getMessage()); } }
Source:
public void init(Config config, TaskContext taskContext) { int numberOfTasks = taskContext.getSamzaContainerContext().taskNames.size(); this.tagToRateLimiterMap = Collections.unmodifiableMap(tagToTargetRateMap.entrySet().stream() .map(e -> { String tag = e.getKey(); Integer ratePerTask = e.getValue() / numberOfTasks; return new ImmutablePair<String, com.google.common.util.concurrent.RateLimiter>( tag, com.google.common.util.concurrent.RateLimiter.create(ratePerTask)); }) .collect(Collectors.toMap(ImmutablePair::getKey, ImmutablePair::getValue)) ); }

Target:
public void init(Config config, TaskContext taskContext) { this.tagToRateLimiterMap = Collections.unmodifiableMap(tagToTargetRateMap.entrySet().stream() .map(e -> { String tag = e.getKey(); int effectiveRate = e.getValue(); if (taskContext != null) { effectiveRate /= taskContext.getSamzaContainerContext().taskNames.size(); LOGGER.info(String.format("Effective rate limit for task %s and tag %s is %d", taskContext.getTaskName(), tag, effectiveRate)); } return new ImmutablePair<String, com.google.common.util.concurrent.RateLimiter>( tag, com.google.common.util.concurrent.RateLimiter.create(effectiveRate)); }) .collect(Collectors.toMap(ImmutablePair::getKey, ImmutablePair::getValue)) ); }
Source:
public void setProviders( Map<String, Map.Entry<String, BlobStore>> providers) { this.providers = providers; }

Target:
public void setProviders( Map<String, Map.Entry<String, BlobStore>> providers) { this.providers = ImmutableMap.copyOf(providers); }
Source:
private void pipelined(int depth) throws Exception { System.out.println("Starting pipelined with depth:"+depth); long startMs = System.currentTimeMillis(); Random random = new Random(); for (int i = 0; i < iterations; i++) { Pipeline pipeline = new Pipeline(depth); for (long k = 0; k < getsPerIteration; k++) { int key = random.nextInt(keyDomain); pipeline.add(map.getAsync(key)); } pipeline.results(); } long duration = System.currentTimeMillis(); System.out.println("Pipedlined with depth:" + depth + ", duration:" + (duration - startMs) + " ms"); }

Target:
private void pipelined(int depth) throws Exception { System.out.println("Starting pipelined with depth:" + depth); long startMs = System.currentTimeMillis(); Random random = new Random(); for (int i = 0; i < iterations; i++) { Pipelining<String> pipelining = new Pipelining<String>(depth); for (long k = 0; k < getsPerIteration; k++) { int key = random.nextInt(keyDomain); pipelining.add(map.getAsync(key)); } List<String> results = pipelining.results(); if (results.size() != getsPerIteration) { throw new RuntimeException(); } } long duration = System.currentTimeMillis(); System.out.println("Pipelined with depth:" + depth + ", duration:" + (duration - startMs) + " ms"); }
Source:
public ResponseEntity<?> createLibrary(@RequestBody LibraryDto libraryDto, UriComponentsBuilder b) throws IOException { if (libraryDto == null) { log.error( "Received null libraryDto from front end; cannot convert to Library. Something likely went wrong in the JS DTO conversion."); throw new RestException("Cannot convert null to Library", Status.BAD_REQUEST); } Long id = null; try { Library library = Dtos.to(libraryDto); library.setCreationDate(new Date()); library.setSample(sampleService.get(libraryDto.getParentSampleId())); library.inheritPermissions(library.getSample()); libraryService.save(library); } catch (ConstraintViolationException | IllegalArgumentException e) { log.error("Error while creating library. ", e); RestException restException = new RestException(e.getMessage(), Status.BAD_REQUEST); if (e instanceof ConstraintViolationException) { restException.addData("constraintName", ((ConstraintViolationException) e).getConstraintName()); } throw restException; } UriComponents uriComponents = b.path("/library/{id}").buildAndExpand(id); HttpHeaders headers = new HttpHeaders(); headers.setLocation(uriComponents.toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }

Target:
public ResponseEntity<?> createLibrary(@RequestBody LibraryDto libraryDto, UriComponentsBuilder b) throws IOException { if (libraryDto == null) { log.error( "Received null libraryDto from front end; cannot convert to Library. Something likely went wrong in the JS DTO conversion."); throw new RestException("Cannot convert null to Library", Status.BAD_REQUEST); } Long id = null; try { Library library = Dtos.to(libraryDto); libraryService.create(library); } catch (ConstraintViolationException | IllegalArgumentException e) { log.error("Error while creating library. ", e); RestException restException = new RestException(e.getMessage(), Status.BAD_REQUEST); if (e instanceof ConstraintViolationException) { restException.addData("constraintName", ((ConstraintViolationException) e).getConstraintName()); } throw restException; } UriComponents uriComponents = b.path("/library/{id}").buildAndExpand(id); HttpHeaders headers = new HttpHeaders(); headers.setLocation(uriComponents.toUri()); return new ResponseEntity<>(headers, HttpStatus.CREATED); }
Source:
public boolean hasExplicitPermission(String sid, Permission p) { Set<String> set = grantedPermissions.get(p); if (set != null && p.getEnabled()) { if (set.contains(sid)) return true; final SecurityRealm securityRealm = Jenkins.getInstance().getSecurityRealm(); final IdStrategy groupIdStrategy = securityRealm.getGroupIdStrategy(); final IdStrategy userIdStrategy = securityRealm.getUserIdStrategy(); for (String s: set) { if (userIdStrategy.equals(s, sid) || groupIdStrategy.equals(s, sid)) { return true; } } } return false; }

Target:
public boolean hasExplicitPermission(String sid, Permission p) { Set<String> set = grantedPermissions.get(p); if (set != null && p.getEnabled()) { if (set.contains(sid)) return true; final SecurityRealm securityRealm = Jenkins.getActiveInstance().getSecurityRealm(); final IdStrategy groupIdStrategy = securityRealm.getGroupIdStrategy(); final IdStrategy userIdStrategy = securityRealm.getUserIdStrategy(); for (String s: set) { if (userIdStrategy.equals(s, sid) || groupIdStrategy.equals(s, sid)) { return true; } } } return false; }
Source:
public void testLayerDisabledServiceResponse() throws Exception { enableWFS(); String layerName = "cite:RoadSegments"; LayerInfo linfo = getCatalog().getLayerByName(layerName); ResourceInfo ri = linfo.getResource(); ri.setServiceConfiguration(true); ri.setDisabledServices(new ArrayList<>(Arrays.asList("WFS"))); getCatalog().save(ri); getCatalog().save(linfo); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + layerName + "&version=1.0.0&service=wfs"); assertEquals("ServiceExceptionReport", doc.getDocumentElement().getNodeName()); }

Target:
public void testLayerDisabledServiceResponse() throws Exception { enableWFS(); String layerName = "cite:RoadSegments"; FeatureTypeInfo ftinfo = getCatalog().getFeatureTypeByName(layerName); ftinfo.setServiceConfiguration(true); ftinfo.setDisabledServices(new ArrayList<>(Arrays.asList("WFS"))); getCatalog().save(ftinfo); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + layerName + "&version=1.0.0&service=wfs"); assertEquals("ServiceExceptionReport", doc.getDocumentElement().getNodeName()); doc = getAsDOM("wfs?service=WFS&version=1.1.0&request=getCapabilities"); XMLAssert.assertXpathNotExists( " }
Source:
public ChunkedFile(RandomAccessFile file, long offset, long length, int chunkSize) throws IOException { ObjectUtil.checkPositiveOrZero(offset, "offset"); ObjectUtil.checkPositiveOrZero(length, "length"); this.file = ObjectUtil.checkNotNull(file, "file"); this.chunkSize = ObjectUtil.checkPositive(chunkSize, "chunkSize"); this.offset = startOffset = offset; endOffset = offset + length; file.seek(offset); }

Target:
public ChunkedFile(RandomAccessFile file, long offset, long length, int chunkSize) throws IOException { ObjectUtil.checkNotNull(file, "file"); ObjectUtil.checkPositiveOrZero(offset, "offset"); ObjectUtil.checkPositiveOrZero(length, "length"); ObjectUtil.checkPositive(chunkSize, "chunkSize"); this.file = file; this.offset = startOffset = offset; this.endOffset = offset + length; this.chunkSize = chunkSize; file.seek(offset); }
Source:
public void testDRepresentationContainerRemovalMigrationDone() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); assertTrue("Check the migration logic.", ((XMLResource) analysis.eResource()).getEObjectToExtensionMap().size() == 0); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkFileContainsDRepresentationContainer(analysis.eResource().getURI(), false, "After migration, the resource should not contains any DRepresentationContainer."); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }

Target:
public void testDRepresentationContainerRemovalMigrationDone() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); assertTrue("Check the migration logic.", ((XMLResource) analysis.eResource()).getEObjectToExtensionMap().isEmpty()); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkFileContainsDRepresentationContainer(analysis.eResource().getURI(), false, "After migration, the resource should not contains any DRepresentationContainer."); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }
Source:
public void validate_shouldFailIfTheObjectParameterIsNull() throws Exception { Errors errors = new BindException(null, "concept"); new ConceptValidator().validate(null, errors); Assert.assertTrue(errors.hasFieldErrors()); }

Target:
public void validate_shouldFailIfTheObjectParameterIsNull() throws Exception { Errors errors = new BindException(null, "concept"); new ConceptValidator().validate(null, errors); Assert.assertTrue(errors.hasErrors()); }
Source:
private File[] listFiles( final File folder, final String fileExtension ) throws IOException { if ( folder.exists() && folder.isDirectory() && folder.canRead() ) { return folder.listFiles( new FileFilter() { @Override public boolean accept( File f ) { return f.isFile() && f.getName().toLowerCase().endsWith( fileExtension ); } } ); } else { logger.error( folder.getAbsolutePath() + " is not a valid directory" ); } return null; }

Target:
private File[] listFiles( final File folder, final String fileExtension ) { if ( folder.isDirectory() && folder.canRead() ) { return folder.listFiles( new FileFilter() { @Override public boolean accept( File f ) { return f.isFile() && f.getName().toLowerCase().endsWith( fileExtension ); } } ); } else { logger.error( folder.getAbsolutePath() + " is not a valid directory" ); } return null; }
Source:
private String parseDescription(final String input, final String componentName) { String result = componentName; final String title = "== " + componentName; int titleIndex = input.indexOf(title); if (titleIndex != -1) { int descriptionEndIndex = input.indexOf("===", titleIndex); if (descriptionEndIndex < 0) { descriptionEndIndex = input.length(); } result = input.substring(titleIndex + title.length(), descriptionEndIndex); if (result.endsWith("|")) { result = result.substring(0, result.length() - 1); } if (result.indexOf("== ") > 0) { result = result.substring(0, result.indexOf("== ")); } if (result.length() > 200) { result = result.substring(0, 197) + "..."; } } result = result.trim(); if (result == null || result.isEmpty()) { result = componentName; } return result; }

Target:
private String parseDescription(final String input, final String componentName) { String result = componentName; final String title = "== " + componentName; int titleIndex = input.indexOf(title); if (titleIndex != -1) { int descriptionEndIndex = input.indexOf("===", titleIndex); if (descriptionEndIndex < 0) { descriptionEndIndex = input.length(); } result = input.substring(titleIndex + title.length(), descriptionEndIndex); if (result.endsWith("|")) { result = result.substring(0, result.length() - 1); } int nextComponentIndex = result.indexOf("== "); if (nextComponentIndex > 0) { result = result.substring(0, nextComponentIndex); } if (result.length() > 200) { result = result.substring(0, 197) + "..."; } } result = result.trim(); if (result == null || result.isEmpty()) { result = componentName; } return result; }
Source:
public URI recentChanges(Date startTime, JSONObject continueObject, int batchSize) { URIBuilder builder = apiBuilder(); builder.addParameter("action", "query"); builder.addParameter("list", "recentchanges"); builder.addParameter("rcdir", "newer"); builder.addParameter("rcprop", "title|ids|timestamp"); builder.addParameter("rcnamespace", this.rcnamespace); builder.addParameter("rclimit", Integer.toString(batchSize)); if (continueObject == null) { builder.addParameter("continue", ""); builder.addParameter("rcstart", outputDateFormat().format(startTime)); } else { builder.addParameter("continue", continueObject.get("continue").toString()); builder.addParameter("rccontinue", continueObject.get("rccontinue").toString()); } return build(builder); }

Target:
public URI recentChanges(Date startTime, JSONObject continueObject, int batchSize) { URIBuilder builder = apiBuilder(); builder.addParameter("action", "query"); builder.addParameter("list", "recentchanges"); builder.addParameter("rcdir", "newer"); builder.addParameter("rcprop", "title|ids|timestamp"); builder.addParameter("rcnamespace", String.join("|", this.entityNamespaces)); builder.addParameter("rclimit", Integer.toString(batchSize)); if (continueObject == null) { builder.addParameter("continue", ""); builder.addParameter("rcstart", outputDateFormat().format(startTime)); } else { builder.addParameter("continue", continueObject.get("continue").toString()); builder.addParameter("rccontinue", continueObject.get("rccontinue").toString()); } return build(builder); }
Source:
public static FileReftableDatabase convertFrom(FileRepository repo, File refstackName, boolean writeLogs) throws IOException { FileReftableDatabase newDb = null; try { File reftableDir = new File(repo.getDirectory(), Constants.REFTABLE); if (!reftableDir.isDirectory()) { reftableDir.mkdir(); } FileReftableStack stack = new FileReftableStack(refstackName, reftableDir, null, () -> repo.getConfig()); stack.addReftable(rw -> writeConvertTable(repo, rw, writeLogs)); stack.close(); } catch (Exception e) { refstackName.delete(); throw e; } return newDb; }

Target:
public static FileReftableDatabase convertFrom(FileRepository repo, File refstackName, boolean writeLogs) throws IOException { FileReftableDatabase newDb = null; try { File reftableDir = new File(repo.getDirectory(), Constants.REFTABLE); if (!reftableDir.isDirectory()) { reftableDir.mkdir(); } try (FileReftableStack stack = new FileReftableStack(refstackName, reftableDir, null, () -> repo.getConfig())) { stack.addReftable(rw -> writeConvertTable(repo, rw, writeLogs)); } } catch (Exception e) { refstackName.delete(); throw e; } return newDb; }
Source:
public Response getSchemaForVersion(@PathParam("schemaName") String schemaName, @PathParam("version") String version, @Context SecurityContext securityContext) { try { LOG.info("Get schema:version {}", schemaName + ":" + version); SchemaVersionInfo schemaVersionInfo = schemaRegistryClient.getSchemaVersionInfo(new SchemaVersionKey(schemaName, Integer.parseInt (version))); if (schemaVersionInfo != null) { LOG.debug("######### Received schema version from schema registry: {}", schemaVersionInfo); String schema = schemaVersionInfo != null ? schemaVersionInfo.getSchemaText() : null; if (schema != null && !schema.isEmpty()) { schema = AvroStreamlineSchemaConverter.convertAvroSchemaToStreamlineSchema(schema); } LOG.debug("######### Converted schema: {}", schema); return WSUtils.respondEntity(schema, OK); } else { return WSUtils.respondEntity("", NOT_FOUND); } } catch (SchemaNotFoundException e) { LOG.error("Schema not found: [{}]", schemaName, e); throw EntityNotFoundException.byId(schemaName); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public Response getSchemaForVersion(@PathParam("schemaName") String schemaName, @PathParam("version") String version, @Context SecurityContext securityContext) { try { LOG.info("Get schema:version {}", schemaName + ":" + version); SchemaVersionInfo schemaVersionInfo = schemaRegistryClient.getSchemaVersionInfo(new SchemaVersionKey(schemaName, Integer.parseInt (version))); if (schemaVersionInfo != null) { LOG.debug("######### Received schema version from schema registry: {}", schemaVersionInfo); String schema = schemaVersionInfo.getSchemaText(); if (schema != null && !schema.isEmpty()) { schema = AvroStreamlineSchemaConverter.convertAvroSchemaToStreamlineSchema(schema); } LOG.debug("######### Converted schema: {}", schema); return WSUtils.respondEntity(schema, OK); } else { throw new SchemaNotFoundException("Version " + version + " of schema " + schemaName + " not found "); } } catch (SchemaNotFoundException e) { LOG.error("Schema not found: [{}]", schemaName, e); throw EntityNotFoundException.byName(schemaName); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public void testQueryOnLookup() { final QueryDataSource queryDataSource = new QueryDataSource( GroupByQuery.builder() .setDataSource(LOOKUP_LOOKYLOO) .setInterval(new MultipleIntervalSegmentSpec(Collections.singletonList(Intervals.of("2000/3000")))) .setGranularity(Granularities.ALL) .build() ); final DataSourceAnalysis analysis = DataSourceAnalysis.forDataSource(queryDataSource); Assert.assertFalse(analysis.isConcreteBased()); Assert.assertFalse(analysis.isConcreteTableBased()); Assert.assertTrue(analysis.isGlobal()); Assert.assertTrue(analysis.isQuery()); Assert.assertEquals(queryDataSource, analysis.getDataSource()); Assert.assertEquals(LOOKUP_LOOKYLOO, analysis.getBaseDataSource()); Assert.assertEquals(Optional.empty(), analysis.getBaseTableDataSource()); Assert.assertEquals( Optional.of(new MultipleIntervalSegmentSpec(ImmutableList.of(Intervals.of("2000/3000")))), analysis.getBaseQuerySegmentSpec() ); Assert.assertEquals(Collections.emptyList(), analysis.getPreJoinableClauses()); }

Target:
public void testQueryOnLookup() { final QueryDataSource queryDataSource = subquery(LOOKUP_LOOKYLOO); final DataSourceAnalysis analysis = DataSourceAnalysis.forDataSource(queryDataSource); Assert.assertFalse(analysis.isConcreteBased()); Assert.assertFalse(analysis.isConcreteTableBased()); Assert.assertTrue(analysis.isGlobal()); Assert.assertTrue(analysis.isQuery()); Assert.assertEquals(queryDataSource, analysis.getDataSource()); Assert.assertEquals(LOOKUP_LOOKYLOO, analysis.getBaseDataSource()); Assert.assertEquals(Optional.empty(), analysis.getBaseTableDataSource()); Assert.assertEquals( Optional.of(new MultipleIntervalSegmentSpec(MILLENIUM_INTERVALS)), analysis.getBaseQuerySegmentSpec() ); Assert.assertEquals(Collections.emptyList(), analysis.getPreJoinableClauses()); }
Source:
public void outputStatuses() { LogKitten.wtf(CHECK_NAME + ": " + getStatusMessage(CHECK_NAME).exceptions); }

Target:
public void outputStatuses() { if (getStatusMessage(CHECK_NAME).status == SystemStatus.PASS) { LogKitten.d(CHECK_NAME + ": PASS"); } else { LogKitten.e(CHECK_NAME + ": FAIL "); for (Exception e : getStatusMessage(CHECK_NAME).exceptions) { LogKitten.e(e); } } }
Source:
public void checkPublishAPI(String state, String role) throws Exception { if (state == APILifeCycleState.CREATED.toString()) { apiPublisher.logout(); apiPublisher.login(testUser, password); publishAPI(apiName, developer, role); } else if (state == APILifeCycleState.PROTOTYPED.toString()) { HttpResponse publishAPI = changeAPILifeCycleStatus(apiName, developer, APILifeCycleState.PROTOTYPED); assertTrue(publishAPI.getData().contains("PROTOTYPED"), "API has not been prototyped"); apiPublisher.logout(); apiPublisher.login(testUser, password); publishAPI(apiName, developer, role); } else if (state == APILifeCycleState.BLOCKED.toString()) { publishAPI(apiName, developer, role); HttpResponse blockAPI = changeAPILifeCycleStatus(apiName, developer, APILifeCycleState.BLOCKED); assertTrue(blockAPI.getData().contains("BLOCKED"), "API has not been blocked"); apiPublisher.logout(); apiPublisher.login(testUser, password); rePublishAPI(apiName, developer, role); } }

Target:
public void checkPublishAPI(String state, String role) throws Exception { if (state.equals(APILifeCycleState.CREATED.toString())) { apiPublisher.logout(); apiPublisher.login(testUser, password); publishAPI(apiName, developer, role); } else if (state.equals(APILifeCycleState.PROTOTYPED.toString())) { HttpResponse prototypedAPI = changeAPILifeCycleStatus(apiName, developer, APILifeCycleState.PROTOTYPED); assertTrue(prototypedAPI.getData().contains("PROTOTYPED"), "API has not been prototyped"); apiPublisher.logout(); apiPublisher.login(testUser, password); publishAPI(apiName, developer, role); } else if (state.equals(APILifeCycleState.BLOCKED.toString())) { publishAPI(apiName, developer, role); HttpResponse blockAPI = changeAPILifeCycleStatus(apiName, developer, APILifeCycleState.BLOCKED); assertTrue(blockAPI.getData().contains("BLOCKED"), "API has not been blocked"); apiPublisher.logout(); apiPublisher.login(testUser, password); rePublishAPI(apiName, developer, role); } }
Source:
public KafkaLogManager(String zkServers, String topicPrefix, Properties producerProperties, Properties consumerProperties) { this.prefix = (topicPrefix != null) ? topicPrefix : ""; this.kUtils = new KafkaUtils(zkServers); disableSubscribe = Boolean.valueOf(consumerProperties.getProperty(DISABLE_SUBSCRIBE_PROP, "false")); defaultReplicationFactor = Integer.valueOf(producerProperties.getProperty(DEFAULT_REPLICATION_FACTOR_PROP, "1")); this.producerProperties = normalizeProducerProperties(producerProperties); this.consumerProperties = normalizeConsumerProperties(consumerProperties); }

Target:
public KafkaLogManager(String zkServers, String topicPrefix, Properties producerProperties, Properties consumerProperties) { this.prefix = (topicPrefix != null) ? topicPrefix : ""; this.kUtils = new KafkaUtils(zkServers); disableSubscribe = Boolean.valueOf(consumerProperties.getProperty(DISABLE_SUBSCRIBE_PROP, "false")); defaultReplicationFactor = Integer.parseInt( producerProperties.getProperty(DEFAULT_REPLICATION_FACTOR_PROP, "1")); this.producerProperties = normalizeProducerProperties(producerProperties); this.consumerProperties = normalizeConsumerProperties(consumerProperties); }
Source:
public static synchronized void setupRetentionPolicyMgr(int numThreads) { if (s_retentionPolicyMgr == null) { s_retentionPolicyMgr = new RetentionPolicyMgr(numThreads); } else if (s_retentionPolicyMgr.getRetentionThreadPoolSize() != numThreads) { s_retentionPolicyMgr.updateThreadPoolSize(numThreads); } }

Target:
public static synchronized void setupRetentionPolicyMgr(int numThreads) { if (s_retentionPolicyMgr == null) { s_retentionPolicyMgr = new RetentionPolicyMgr(numThreads); } else { s_retentionPolicyMgr.updateThreadPoolSize(numThreads); } }
Source:
private BitSet getErrors() { lock.lock(); try { try { serial.write(new byte[] {START_BYTE, maestro, COMMAND_GET_ERRORS}); final ByteBuffer response = ByteBuffer.allocate(2).put(serial.read(), 0, 2); return BitSet.valueOf(new byte[]{response.get(1), response.get(0)}); } catch (final IOException e) { Logger.error(e); return BitSet.valueOf(new byte[]{0}); } } finally { lock.unlock(); } }

Target:
private BitSet getErrors() { lock.lock(); try { try { serial.write(new byte[] {START_BYTE, maestro, COMMAND_GET_ERRORS}); final ByteBuffer response = ByteBuffer.allocate(2).put(serial.read(2)); return BitSet.valueOf((byte[]) ByteBuffer.allocate(2).put(serial.read(2)).flip().array()); } catch (final IOException e) { Logger.error(e); return BitSet.valueOf(new byte[]{0}); } } finally { lock.unlock(); } }
Source:
public void botVSPlayer() { int size = tiles.size(); int pairs = size / 2; int mode = (int) Math.sqrt(size); ModeBotOrNot.setPairs(pairs); ModeBotOrNot.setBot(0); for (int i = 0; i < mode; i++) { for (int j = 0; j < mode; j++) { int n = i; int m = j; massiveTiles[i][j].setOnMouseClicked(event -> { if (ModeBotOrNot.isBot() == 0) { if (massiveTiles[n][m].isSelected() || event.getClickCount() > 1 || !event.isStillSincePress()) { return; } if (firstselected == null) { firstselected = massiveTiles[n][m]; massiveTiles[n][m].open(() -> { }); } else { massiveTiles[n][m].open(() -> { if (!massiveTiles[n][m].hasSameValue(firstselected)) { firstselected.close(); massiveTiles[n][m].close(); } else { firstselected.setOpen(); massiveTiles[n][m].setOpen(); } ModeBotOrNot.setBot(1); BotHod(); firstselected = null; secondselected = null; }); } } }); } } }

Target:
public void botVSPlayer() { int size = tiles.size(); int pairs = size / 2; int mode = (int) Math.sqrt(size); BotMode.setPairs(pairs); BotMode.setBotMode(0); for (int i = 0; i < mode; i++) { for (int j = 0; j < mode; j++) { int n = i; int m = j; massiveTiles[i][j].setOnMouseClicked(event -> { if (BotMode.getBotMode() == 0) { if (massiveTiles[n][m].isSelected() || event.getClickCount() > 1 || !event.isStillSincePress()) { return; } if (firstselected == null) { firstselected = massiveTiles[n][m]; massiveTiles[n][m].open(() -> { }); } else { massiveTiles[n][m].open(() -> { if (!massiveTiles[n][m].hasSameValue(firstselected)) { firstselected.close(); massiveTiles[n][m].close(); } else { firstselected.setOpen(); massiveTiles[n][m].setOpen(); } BotMode.setBotMode(1); BotHod(); firstselected = null; secondselected = null; }); } } }); } } }
Source:
public void selectionChanged(final SelectionChangedEvent event) { Object[] listeners = getListeners(); for (Object listener : listeners) { final ISelectionChangedListener l = (ISelectionChangedListener) listener; SafeRunner.run(new SafeRunnable() { @Override public void run() { l.selectionChanged(event); } }); } }

Target:
public void selectionChanged(final SelectionChangedEvent event) { for (Object listener : getListeners()) { final ISelectionChangedListener selectionChangedListener = (ISelectionChangedListener) listener; SafeRunner.run(new SafeRunnable() { @Override public void run() { selectionChangedListener.selectionChanged(event); } }); } }
Source:
public void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { if (getOMResponse().getStatus() == OzoneManagerProtocolProtos.Status.OK) { if (omVolumeCreateResponse != null) { omVolumeCreateResponse.addToDBBatch(omMetadataManager, batchOperation); } if (omBucketCreateResponse != null) { omBucketCreateResponse.addToDBBatch(omMetadataManager, batchOperation); } omMetadataManager.getS3Table().putWithBatch(batchOperation, s3Bucket, s3Mapping); } }

Target:
public void addToDBBatch(OMMetadataManager omMetadataManager, BatchOperation batchOperation) throws IOException { if (getOMResponse().getStatus() == OzoneManagerProtocolProtos.Status.OK) { if (omVolumeCreateResponse != null) { omVolumeCreateResponse.addToDBBatch(omMetadataManager, batchOperation); } Preconditions.checkState(omBucketCreateResponse != null); omBucketCreateResponse.addToDBBatch(omMetadataManager, batchOperation); omMetadataManager.getS3Table().putWithBatch(batchOperation, s3Bucket, s3Mapping); } }
Source:
public void clickOnIncrementMemoryButton(String machineName) { seleniumWebDriverHelper.waitAndClick(By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName))); WaitUtils.sleepQuietly(1); }

Target:
public void clickOnIncrementMemoryButton(String machineName) { seleniumWebDriverHelper.waitAndClick(By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName))); }