auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run(String step, MigrationContext migrationContext) { if (!List.of(MIGRATION_STEP_RELATION_TO_PROPERTY, MIGRATION_STEP_PROPERTY_TO_SECURED).contains(step)) { throw new NuxeoException("Unknown migration step: " + step); } this.migrationContext = migrationContext; reportProgress("Initializing", 0, -1); List<String> repositoryNames = Framework.getService(RepositoryService.class).getRepositoryNames(); try { repositoryNames.forEach(r -> migrateRepository(migrationContext, step, r)); } catch (MigrationShutdownException e) { log.debug("Migration shutdown on step: {}.", step); } }

Target:
public void run(String step, MigrationContext migrationContext) { if (!MIGRATION_STEP_RELATION_TO_PROPERTY.equals(step)) { throw new NuxeoException("Unknown migration step: " + step); } this.migrationContext = migrationContext; reportProgress("Initializing", 0, -1); List<String> repositoryNames = Framework.getService(RepositoryService.class).getRepositoryNames(); try { repositoryNames.forEach(this::migrateRepository); } catch (MigrationShutdownException e) { return; } }
Source:
private void executeQuery(Ignite ignite, Query<Cache.Entry<Integer, Integer>> q, boolean init) { IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache( new CacheConfiguration<Integer, Integer>() .setName(CACHE_NAME + CACHE_INDEX.incrementAndGet()) .setCacheMode(CacheMode.PARTITIONED) ); if (init) cache.put(primaryKey(grid(SRV), cache.getName()), 100); Integer key = primaryKey(grid(SRV), cache.getName()); try (QueryCursor<Cache.Entry<Integer, Integer>> cur = cache.query(q)) { if (!init) cache.put(key, 100); cur.getAll(); } catch (Exception e) { if (init) throw e; fail(e.getMessage()); } if (!init) { assertEquals(Integer.valueOf(100), cache.get(key)); } }

Target:
private void executeQuery(Ignite ignite, Query<Cache.Entry<Integer, Integer>> q, boolean init) throws IgniteCheckedException { IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache( new CacheConfiguration<Integer, Integer>() .setName(CACHE_NAME + CACHE_INDEX.incrementAndGet()) .setCacheMode(CacheMode.PARTITIONED) ); Integer key = primaryKey(grid(SRV).cache(cache.getName())); if (init) cache.put(key, 100); try (QueryCursor<Cache.Entry<Integer, Integer>> cur = cache.query(q)) { if (!init) { try { cache.put(key, 100); } catch (Exception e) { fail(e.getMessage()); } } cur.getAll(); } assertEquals(Integer.valueOf(100), cache.get(key)); }
Source:
private Optional<org.atlasapi.content.Clip> transformClip(Clip inputClip) { try { return Optional.of((org.atlasapi.content.Clip) apply(inputClip)); } catch(NullPointerException e) { log.warn("Unable to process Clip of: " + java.util.Objects.toString(inputClip.getClipOf(), "unspecified")); return Optional.empty(); } }

Target:
private Optional<org.atlasapi.content.Clip> transformClip(Clip inputClip) { try { return Optional.of((org.atlasapi.content.Clip) apply(inputClip)); } catch(NullPointerException e) { log.warn("Unable to process Clip of: '{}'", inputClip.getClipOf()); return Optional.empty(); } }
Source:
private static MessageInfo getMessageInfo(StoreKey id, List<MessageInfo> messageInfos, boolean deleteMsg) { MessageInfo toRet = null; for (MessageInfo messageInfo : messageInfos) { if (messageInfo.getStoreKey().equals(id)) { if ((deleteMsg && messageInfo.isDeleted()) || (!deleteMsg && !messageInfo.isDeleted())) { toRet = messageInfo; break; } } } return toRet; }

Target:
private static MessageInfo getMessageInfo(StoreKey id, List<MessageInfo> messageInfos, boolean deleteMsg) { MessageInfo toRet = null; for (MessageInfo messageInfo : messageInfos) { if (messageInfo.getStoreKey().equals(id)) { if (deleteMsg == messageInfo.isDeleted()) { toRet = messageInfo; break; } } } return toRet; }
Source:
private synchronized void acquireWakeLock() { int lockLevel = boundActivity.getWakeLockLevel(); if (lockLevel != CommCareTask.DONT_WAKELOCK) { if (wakelock != null) { if (wakelock.isHeld()) { wakelock.release(); } } PowerManager pm = (PowerManager)boundActivity.getSystemService(Context.POWER_SERVICE); wakelock = pm.newWakeLock(lockLevel, "CommCareLock"); wakelock.acquire(); } }

Target:
private synchronized void acquireWakeLock() { int lockLevel = boundActivity.getWakeLockLevel(); if (lockLevel != CommCareTask.DONT_WAKELOCK) { releaseWakeLock(); PowerManager pm = (PowerManager)boundActivity.getSystemService(Context.POWER_SERVICE); wakelock = pm.newWakeLock(lockLevel, "CommCareLock"); wakelock.acquire(); } }
Source:
public List<TagDto> getAllTags() { List<TagDto> allTags = new ArrayList<TagDto>(); if (commonDataService.getWebClientProperties().isTagsStoreAvailable()) { List<TagEntity> tags = new ArrayList<TagEntity>(entityManager.createQuery("select te from TagEntity as te").getResultList()); if (!tags.isEmpty()) { for (TagEntity tagEntity : tags) { allTags.add(new TagDto(tagEntity.getName(), tagEntity.getDescription())); } } } return allTags; }

Target:
public List<TagDto> getAllTags() { List<TagDto> allTags = new ArrayList<TagDto>(); if (commonDataService.getWebClientProperties().isTagsStoreAvailable()) { List<TagEntity> tags = entityManager.createQuery("select te from TagEntity as te").getResultList(); if (!tags.isEmpty()) { for (TagEntity tagEntity : tags) { allTags.add(new TagDto(tagEntity.getName(), tagEntity.getDescription())); } } } return allTags; }
Source:
public static Activity createInstance(DeviceAnonymized deviceAnonymized, ZoneId timeZone, LocalDateTime startTime, LocalDateTime endTime, Optional<String> app) { return new Activity(Objects.requireNonNull(deviceAnonymized), timeZone, startTime, endTime, app); }

Target:
public static Activity createInstance(DeviceAnonymized deviceAnonymized, ZoneId timeZone, LocalDateTime startTime, LocalDateTime endTime, Optional<String> app) { return new Activity(deviceAnonymized, timeZone, startTime, endTime, app); }
Source:
List<CallableProcedure> compileProcedure( Class<?> procDefinition, Optional<String> warning, boolean fullAccess ) throws KernelException { try { List<Method> procedureMethods = Arrays.stream( procDefinition.getDeclaredMethods() ) .filter( m -> m.isAnnotationPresent( Procedure.class ) ) .collect( Collectors.toList() ); if ( procedureMethods.isEmpty() ) { return emptyList(); } MethodHandle constructor = constructor( procDefinition ); ArrayList<CallableProcedure> out = new ArrayList<>( procedureMethods.size() ); for ( Method method : procedureMethods ) { String valueName = method.getAnnotation( Procedure.class ).value(); String definedName = method.getAnnotation( Procedure.class ).name(); QualifiedName procName = extractName( procDefinition, method, valueName, definedName ); if ( !(fullAccess || config.whiteListed( procName.toString() )) ) { log.warn( String.format( "The procedure '%s' is not white listed.", procName.toString() ) ); } else { out.add( compileProcedure( procDefinition, constructor, method, warning, fullAccess, procName ) ); } } out.sort( Comparator.comparing( a -> a.signature().name().toString() ) ); return out; } catch ( KernelException e ) { throw e; } catch ( Exception e ) { throw new ProcedureException( Status.Procedure.ProcedureRegistrationFailed, e, "Failed to compile procedure defined in `%s`: %s", procDefinition.getSimpleName(), e.getMessage() ); } }

Target:
List<CallableProcedure> compileProcedure( Class<?> procDefinition, Optional<String> warning, boolean fullAccess ) throws KernelException { try { List<Method> procedureMethods = Arrays.stream( procDefinition.getDeclaredMethods() ) .filter( m -> m.isAnnotationPresent( Procedure.class ) ) .collect( Collectors.toList() ); if ( procedureMethods.isEmpty() ) { return emptyList(); } MethodHandle constructor = constructor( procDefinition ); ArrayList<CallableProcedure> out = new ArrayList<>( procedureMethods.size() ); for ( Method method : procedureMethods ) { String valueName = method.getAnnotation( Procedure.class ).value(); String definedName = method.getAnnotation( Procedure.class ).name(); QualifiedName procName = extractName( procDefinition, method, valueName, definedName ); if ( fullAccess || config.isWhitelisted( procName.toString() ) ) { out.add( compileProcedure( procDefinition, constructor, method, warning, fullAccess, procName ) ); } else { log.warn( String.format( "The procedure '%s' is not on the whitelist and won't be loaded.", procName.toString() ) ); } } out.sort( Comparator.comparing( a -> a.signature().name().toString() ) ); return out; } catch ( KernelException e ) { throw e; } catch ( Exception e ) { throw new ProcedureException( Status.Procedure.ProcedureRegistrationFailed, e, "Failed to compile procedure defined in `%s`: %s", procDefinition.getSimpleName(), e.getMessage() ); } }
Source:
public void setupFTPServer() { createNewFile(FTP_DIRECTORY + File.separator + DOWNLOAD_FILE_NAME); createNewFile(DEVICE_DOWNLOAD_DIRECTORY + File.separator + UPLOAD_FILE_NAME); TEST_FTP_SERVER = new FTPServer(USER_NAME, PASSWORD, FTP_DIRECTORY, FTP_PORT); TEST_FTP_SERVER.startFTP(); TEST_SFTP_SERVER = new SFTPServer(USER_NAME, PASSWORD, SFTP_DIRECTORY, SFTP_PORT); TEST_SFTP_SERVER.startSFTP(); }

Target:
public void setupFTPServer() { testFtpServer = new FTPTestServer(Constants.USER_NAME, Constants.PASSWORD, ftpDirectory, Constants.FTP_PORT); testFtpServer.startFTP(); testSftpServer = new SFTPTestServer(Constants.USER_NAME, Constants.PASSWORD, sftpDirectory, Constants.SFTP_PORT); testSftpServer.startSFTP(); }
Source:
public void init() { logger.entering(); (new File(outputFolder)).mkdirs(); (new File(outputFolder, "sources")).mkdir(); (new File(outputFolder, "html")).mkdir(); (new File(outputFolder, "screenshots")).mkdir(); logger.exiting(); }

Target:
public void init() { logger.entering(); (new File(outputFolder, "sources")).mkdir(); (new File(outputFolder, "html")).mkdir(); (new File(outputFolder, "screenshots")).mkdir(); logger.exiting(); }
Source:
public CalibratedPredictiveModel(Classifier wrappedPredictiveModel, PoolAdjacentViolatorsModel PAVFunction) { Preconditions.checkArgument(!(wrappedPredictiveModel instanceof CalibratedPredictiveModel)); this.wrappedPredictiveModel = wrappedPredictiveModel; this.pavFunction = PAVFunction; }

Target:
public CalibratedPredictiveModel(Classifier wrappedPredictiveModel, PoolAdjacentViolatorsModel PAVFunction) { this.wrappedPredictiveModel = wrappedPredictiveModel; this.pavFunction = PAVFunction; }
Source:
public void shouldReportErrorWhenFailExecWithVerbose() { runBuild(exec("not-not-not-exist", true, "-a", "-bb"), Failed); System.out.println("console = " + console); }

Target:
public void shouldReportErrorWhenFailExecWithVerbose() { runBuild(exec("not-not-not-exist", map("verbose", "true"), "-a", "-bb"), Failed); assertThat(console.output(), containsString("[go] Failed to run not-not-not-exist -a -bb")); }
Source:
public Set<String> getFreeVariables() { Set<String> freeVars = objectExpr.getFreeVariables(); freeVars.add(this.methodName); for (Expression arg : args) { freeVars.addAll(arg.getFreeVariables()); } return freeVars; }

Target:
public Set<String> getFreeVariables() { Set<String> freeVars = objectExpr.getFreeVariables(); for (Expression arg : args) { freeVars.addAll(arg.getFreeVariables()); } return freeVars; }
Source:
private void publishSegments( StreamAppenderatorDriver driver, TransactionalSegmentPublisher publisher, Supplier<Committer> committerSupplier, String sequenceName ) { final ListenableFuture<SegmentsAndMetadata> publishFuture = driver.publish( publisher, committerSupplier.get(), Collections.singletonList(sequenceName) ); final SettableFuture<SegmentsAndMetadata> handoffDoneFuture = SettableFuture.create(); Futures.addCallback(publishFuture, new FutureCallback<SegmentsAndMetadata>() { @Override public void onSuccess(@Nullable SegmentsAndMetadata result) { final ListenableFuture<SegmentsAndMetadata> handoffFuture = driver.registerHandoff(result); Futures.addCallback(handoffFuture, new FutureCallback<SegmentsAndMetadata>() { @Override public void onSuccess(@Nullable SegmentsAndMetadata result) { handoffDoneFuture.set(result); } @Override public void onFailure(Throwable t) { handoffDoneFuture.setException(t); } }); } @Override public void onFailure(Throwable t) { handoffDoneFuture.setException(t); } }); pendingHandoffs.add(handoffDoneFuture); }

Target:
private void publishSegments( StreamAppenderatorDriver driver, TransactionalSegmentPublisher publisher, Supplier<Committer> committerSupplier, String sequenceName ) { final ListenableFuture<SegmentsAndMetadata> publishFuture = driver.publish( publisher, committerSupplier.get(), Collections.singletonList(sequenceName) ); pendingHandoffs.add(ListenableFutures.transformAsync(publishFuture, driver::registerHandoff)); }
Source:
private void sendError(HttpResponseStatus status, String errorMsg) { StringBuilder msg = new StringBuilder("Failure: ").append(status); if (errorMsg != null) { msg.append(errorMsg); } FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, status, Unpooled.copiedBuffer(msg, CharsetUtil.UTF_8)); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=UTF-8"); if (ctx.channel().isActive()) { logger.trace("Sending error response to the client", msg); ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE); } else { logger.error("Could not send error to client on channel because channel is inactive", ctx.channel()); nettyMetrics.fallbackErrorSendingError.inc(); } }

Target:
private void sendError(HttpResponseStatus status, String errorMsg) { if (ctx.channel().isActive()) { StringBuilder msg = new StringBuilder("Failure: ").append(status); if (errorMsg != null) { msg.append(errorMsg); } FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, status, Unpooled.copiedBuffer(msg, CharsetUtil.UTF_8)); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=UTF-8"); logger.trace("Sending error response to the client", msg); ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE); } else { logger.error("Could not send error to client on channel because channel is inactive", ctx.channel()); nettyMetrics.fallbackErrorSendingError.inc(); } }
Source:
public void showModal() { super.showModal(); getGlassElement().getStyle().setZIndex(2000); getElement().getStyle().setZIndex(2001); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { center(); } }); }

Target:
public void showModal() { super.showModal(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { center(); } }); }
Source:
public void iterableTest() { for (String string : ImmutableSet.<String>emptyUsingEquality()) { throw new RuntimeException("empty HashTable has iterated"); } int N = 10000; HashTable<String, Integer> t = range(0, N).foldLeft((ht, i) -> ht.put(Integer.toString(i), i), HashTable.emptyUsingEquality()); int sum = 0; for (Pair<String, Integer> i : t) { assertEquals(Integer.toString(i.right), i.left); sum += i.right; } assertEquals(N * (N - 1) / 2, sum); }

Target:
public void iterableTest() { for (Pair<String, String> string : HashTable.<String, String>emptyUsingEquality()) { fail("Empty Hashtable Iterated"); } int N = 10000; HashTable<String, Integer> t = range(0, N).foldLeft((ht, i) -> ht.put(Integer.toString(i), i), HashTable.emptyUsingEquality()); int sum = 0; for (Pair<String, Integer> i : t) { assertEquals(Integer.toString(i.right), i.left); sum += i.right; } assertEquals(N * (N - 1) / 2, sum); }
Source:
public CasAuthentication(final CasAuthenticator authenticator, final String ticket, final Assertion assertion) { super(authenticator.getAuthMethod(), new CasUserIdentity(assertion, authenticator.getRoleAttribute())); assert ticket != null : "Ticket cannot be null"; assert authenticator != null : "CasAuthenticator cannot be null"; this.authenticator = authenticator; this.ticket = ticket; }

Target:
public CasAuthentication(final CasAuthenticator authenticator, final String ticket, final Assertion assertion) { super(authenticator.getAuthMethod(), new CasUserIdentity(assertion, authenticator.getRoleAttribute())); CommonUtils.assertNotNull(ticket, "Ticket cannot be null"); CommonUtils.assertNotNull(authenticator, "CasAuthenticator cannot be null"); this.authenticator = authenticator; this.ticket = ticket; }
Source:
private String getDocker0Ip(Launcher launcher, String image) throws IOException, InterruptedException { ArgumentListBuilder args = dockerCommand() .add("run", "--rm") .add("--entrypoint") .add("/bin/true") .add("alpine:3.2"); int status = launcher.launch() .envs(getEnvVars()) .cmds(args) .stdout(TaskListener.NULL).quiet(!verbose).stderr(listener.getLogger()).join(); if (status != 0) { throw new RuntimeException("Failed to run docker image "+image); } NetworkInterface docker0 = NetworkInterface.getByName("docker0"); if (docker0 != null) { for (InterfaceAddress address : docker0.getInterfaceAddresses()) { InetAddress inetAddress = address.getAddress(); if (inetAddress != null && inetAddress instanceof Inet4Address) { return inetAddress.getHostAddress(); } } } args = dockerCommand() .add("run", "--tty", "--rm") .add("--entrypoint") .add("/sbin/ip") .add("alpine:3.2") .add("route"); ByteArrayOutputStream out = new ByteArrayOutputStream(); status = launcher.launch() .envs(getEnvVars()) .cmds(args) .stdout(out).quiet(!verbose).stderr(listener.getLogger()).join(); if (status != 0) { throw new RuntimeException("Failed to retrieve Docker daemon bridge IP"); } String route = out.toString("UTF-8").trim(); if (route.indexOf("default") == -1){ throw new RuntimeException("Default IP does not exist"); } String dockerhost = route.substring(route.indexOf("default")) .split(" ")[2]; return dockerhost; }

Target:
private String getDocker0Ip(Launcher launcher, String image) throws IOException, InterruptedException { ArgumentListBuilder args = dockerCommand() .add("run", "--rm") .add("--entrypoint") .add("/bin/true") .add("alpine:3.2"); int status = launcher.launch() .envs(getEnvVars()) .cmds(args) .stdout(TaskListener.NULL).quiet(!verbose).stderr(listener.getLogger()).join(); if (status != 0) { throw new RuntimeException("Failed to run docker image "+image); } NetworkInterface docker0 = NetworkInterface.getByName("docker0"); if (docker0 != null) { for (InterfaceAddress address : docker0.getInterfaceAddresses()) { InetAddress inetAddress = address.getAddress(); if (inetAddress != null && inetAddress instanceof Inet4Address) { return inetAddress.getHostAddress(); } } } args = dockerCommand() .add("run", "--tty", "--rm") .add("--entrypoint") .add("/sbin/ip") .add("alpine:3.2") .add("route"); ByteArrayOutputStream out = new ByteArrayOutputStream(); status = launcher.launch() .envs(getEnvVars()) .cmds(args) .stdout(out).quiet(!verbose).stderr(listener.getLogger()).join(); if (status != 0) { throw new RuntimeException("Failed to retrieve Docker daemon bridge IP"); } String route = out.toString("UTF-8").trim(); if (!route.contains("default")) { throw new RuntimeException("Default IP does not exist"); } String dockerhost = route.substring(route.indexOf("default")) .split(" ")[2]; return dockerhost; }
Source:
private Optional<CloudflareZone> getCloudflareZone(String edgeCacheDNS) throws CloudflareClientException { List<CloudflareZone> zones = cf.getAllZones(); String[] domainTokens = edgeCacheDNS.split("\\."); String baseDomain = String.format("%s.%s", domainTokens[domainTokens.length - 2], domainTokens[domainTokens.length - 1]); return zones.stream() .filter(z -> z.getName().equals(baseDomain)) .findAny(); }

Target:
private Optional<CloudflareZone> getCloudflareZone(String edgeCacheDNS) throws CloudflareClientException { String baseDomain = getBaseDomain(edgeCacheDNS); return Optional.ofNullable(cf.getZone(baseDomain)); }
Source:
protected IntegrationFlowDefinition<?> buildFlow() { return from((MessageSource<?>) () -> new GenericMessage<>("flowAdapterMessage"), e -> e.poller(p -> p .trigger(ctx -> this.nextExecutionTime.getAndSet(null)))) .channel(MessageChannels.queue("flowAdapterOutput")); }

Target:
protected IntegrationFlowDefinition<?> buildFlow() { return from(() -> new GenericMessage<>("flowAdapterMessage"), e -> e.poller(p -> p .trigger(ctx -> this.nextExecutionTime.getAndSet(null)))) .channel(MessageChannels.queue("flowAdapterOutput")); }
Source:
public void testCreateInvoiceAndRetrieveInvoicePdf() throws Exception { final Account accountData = TestUtils.createRandomAccount(); PDDocument pdDocument = null; try { final Account account = recurlyClient.createAccount(accountData); final Adjustment a = new Adjustment(); a.setUnitAmountInCents(150); a.setCurrency(CURRENCY); final Adjustment createdA = recurlyClient.createAccountAdjustment(accountData.getAccountCode(), a); final Invoice invoiceData = new Invoice(); invoiceData.setCollectionMethod("manual"); invoiceData.setLineItems(null); final Invoice invoice = recurlyClient.postAccountInvoice(accountData.getAccountCode(), invoiceData); Assert.assertNotNull(invoice); byte[] pdfBytes = recurlyClient.getInvoicePdf(invoice.getInvoiceNumber()); Assert.assertNotNull(pdfBytes); pdDocument = PDDocument.load(pdfBytes); String pdfString = new PDFTextStripper().getText(pdDocument); Assert.assertNotNull(pdfString); Assert.assertTrue(pdfString.contains("Invoice # " + invoice.getInvoiceNumber())); Assert.assertTrue(pdfString.contains("Subtotal $" + 1.5)); final Invoice closedInvoice = recurlyClient.markInvoiceSuccessful(invoice.getInvoiceNumber()); Assert.assertEquals(closedInvoice.getState(), "collected", "Invoice not closed successfully"); } finally { if (pdDocument != null) { pdDocument.close(); } recurlyClient.closeAccount(accountData.getAccountCode()); } }

Target:
public void testCreateInvoiceAndRetrieveInvoicePdf() throws Exception { final Account accountData = TestUtils.createRandomAccount(); PDDocument pdDocument = null; try { final Account account = recurlyClient.createAccount(accountData); final Adjustment a = new Adjustment(); a.setUnitAmountInCents(150); a.setCurrency(CURRENCY); final Adjustment createdA = recurlyClient.createAccountAdjustment(accountData.getAccountCode(), a); final Invoice invoiceData = new Invoice(); invoiceData.setCollectionMethod("manual"); invoiceData.setLineItems(null); final Invoice invoice = recurlyClient.postAccountInvoice(accountData.getAccountCode(), invoiceData); Assert.assertNotNull(invoice); InputStream pdfInputStream = recurlyClient.getInvoicePdf(invoice.getInvoiceNumber()); Assert.assertNotNull(pdfInputStream); pdDocument = PDDocument.load(pdfInputStream); String pdfString = new PDFTextStripper().getText(pdDocument); Assert.assertNotNull(pdfString); Assert.assertTrue(pdfString.contains("Invoice # " + invoice.getInvoiceNumber())); Assert.assertTrue(pdfString.contains("Subtotal $" + 1.5)); final Invoice closedInvoice = recurlyClient.markInvoiceSuccessful(invoice.getInvoiceNumber()); Assert.assertEquals(closedInvoice.getState(), "collected", "Invoice not closed successfully"); } finally { if (pdDocument != null) { pdDocument.close(); } recurlyClient.closeAccount(accountData.getAccountCode()); } }
Source:
public static File getFilePluginLocation(DockstoreWebserviceConfiguration configuration) { String userHome = System.getProperty("user.home"); String filename = userHome + File.separator + ".dockstore" + File.separator + "language-plugins"; filename = StringUtils.isEmpty(configuration.getLanguagePluginLocation()) ? filename : configuration.getLanguagePluginLocation(); System.out.println("File plugin path set to:" + filename); return new File(filename); }

Target:
public static File getFilePluginLocation(DockstoreWebserviceConfiguration configuration) { String userHome = System.getProperty("user.home"); String filename = userHome + File.separator + ".dockstore" + File.separator + "language-plugins"; filename = StringUtils.isEmpty(configuration.getLanguagePluginLocation()) ? filename : configuration.getLanguagePluginLocation(); LOG.info("File plugin path set to:" + filename); return new File(filename); }
Source:
public ByteBuf decrypt(ByteBuf toDecrypt, SecretKeySpec key) throws GeneralSecurityException { try { Cipher decrypter = Cipher.getInstance(GCM_CRYPTO_INSTANCE, "BC"); byte[] iv = deserializeIV(new ByteBufInputStream(toDecrypt)); decrypter.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); ByteBuf decryptedContent = ByteBufAllocator.DEFAULT.heapBuffer(decrypter.getOutputSize(toDecrypt.readableBytes())); if (toDecrypt.hasArray()) { int n = decrypter.doFinal(toDecrypt.array(), toDecrypt.arrayOffset() + toDecrypt.readerIndex(), toDecrypt.readableBytes(), decryptedContent.array(), decryptedContent.arrayOffset() + decryptedContent.writerIndex()); toDecrypt.readerIndex(toDecrypt.readerIndex() + toDecrypt.readableBytes()); decryptedContent.writerIndex(decryptedContent.writerIndex() + n); } else { byte[] toDecryptArray = new byte[toDecrypt.readableBytes()]; toDecrypt.readBytes(toDecryptArray); int n = decrypter.doFinal(toDecryptArray, 0, toDecryptArray.length, decryptedContent.array(), decryptedContent.arrayOffset() + decryptedContent.writerIndex()); decryptedContent.writerIndex(decryptedContent.writerIndex() + n); } return decryptedContent; } catch (Exception e) { throw new GeneralSecurityException("Exception thrown while decrypting data", e); } }

Target:
public ByteBuf decrypt(ByteBuf toDecrypt, SecretKeySpec key) throws GeneralSecurityException { try { Cipher decrypter = Cipher.getInstance(GCM_CRYPTO_INSTANCE, "BC"); byte[] iv = deserializeIV(new ByteBufInputStream(toDecrypt)); decrypter.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); int outputSize = decrypter.getOutputSize(toDecrypt.readableBytes()); ByteBuf decryptedContent = ByteBufAllocator.DEFAULT.heapBuffer(outputSize); ByteBuffer toDecryptBuffer = toDecrypt.nioBuffer(); ByteBuffer decryptedContentBuffer = decryptedContent.nioBuffer(0, outputSize); int n = decrypter.doFinal(toDecryptBuffer, decryptedContentBuffer); toDecrypt.readerIndex(toDecrypt.readerIndex() + toDecrypt.readableBytes()); decryptedContent.writerIndex(decryptedContent.writerIndex() + n); return decryptedContent; } catch (Exception e) { throw new GeneralSecurityException("Exception thrown while decrypting data", e); } }
Source:
int getMessageInfoAndMetadataListSize() { if (messageInfoList == null) { return Integer.BYTES; } int size = Integer.BYTES; ListIterator<MessageInfo> infoListIterator = messageInfoList.listIterator(); ListIterator<MessageMetadata> metadataListIterator = messageMetadataList.listIterator(); while (infoListIterator.hasNext()) { MessageInfo messageInfo = infoListIterator.next(); MessageMetadata messageMetadata = metadataListIterator.next(); size += messageInfo.getStoreKey().sizeInBytes(); size += Long.BYTES; size += Long.BYTES; size += 1; switch (version) { case VERSION_1: break; case VERSION_2: size += 1; if (messageInfo.getCrc() != null) { size += Long.BYTES; } break; case VERSION_3: size += 1; if (messageInfo.getCrc() != null) { size += Long.BYTES; } size += Short.BYTES; size += Short.BYTES; size += Long.BYTES; break; case VERSION_4: size += 1; if (messageInfo.getCrc() != null) { size += Long.BYTES; } size += Short.BYTES; size += Short.BYTES; size += Long.BYTES; if (messageMetadata != null) { size += Integer.BYTES; size += messageMetadata.sizeInBytes(); } else { size += Integer.BYTES; } break; default: throw new IllegalArgumentException("Unknown version in MessageInfoList " + version); } } return size; }

Target:
int getMessageInfoAndMetadataListSize() { if (messageInfoList == null) { return Integer.BYTES; } int size = Integer.BYTES; ListIterator<MessageInfo> infoListIterator = messageInfoList.listIterator(); ListIterator<MessageMetadata> metadataListIterator = messageMetadataList.listIterator(); while (infoListIterator.hasNext()) { MessageInfo messageInfo = infoListIterator.next(); MessageMetadata messageMetadata = metadataListIterator.next(); size += messageInfo.getStoreKey().sizeInBytes(); size += Long.BYTES; size += Long.BYTES; size += 1; if (version < VERSION_1 || version > VERSION_4) { throw new IllegalArgumentException("Unknown version in MessageInfoList " + version); } if (version > VERSION_1) { size += 1; if (messageInfo.getCrc() != null) { size += Long.BYTES; } } if (version > VERSION_2) { size += Short.BYTES; size += Short.BYTES; size += Long.BYTES; } if (version > VERSION_3) { size += Byte.BYTES; if (messageMetadata != null) { size += messageMetadata.sizeInBytes(); } } } return size; }
Source:
public boolean apply(ObjectPlayer<Controllable> input, Game game) { Controllable object = input.getObject(); UUID playerId = input.getPlayerId(); switch (controller) { case YOU: if (object.getControllerId().equals(playerId)) { return true; } break; case OPPONENT: if (!object.getControllerId().equals(playerId) && game.getPlayer(playerId).hasOpponent(object.getControllerId(), game)) { return true; } break; case NOT_YOU: if (!object.getControllerId().equals(playerId)) { return true; } break; case ACTIVE: if (object.getControllerId().equals(game.getActivePlayerId())) { return true; } case ANY: return true; } return false; }

Target:
public boolean apply(ObjectPlayer<Controllable> input, Game game) { Controllable object = input.getObject(); UUID playerId = input.getPlayerId(); switch (controller) { case YOU: if (object.getControllerId().equals(playerId)) { return true; } break; case OPPONENT: if (!object.getControllerId().equals(playerId) && game.getPlayer(playerId).hasOpponent(object.getControllerId(), game)) { return true; } break; case NOT_YOU: if (!object.getControllerId().equals(playerId)) { return true; } break; case ACTIVE: if (object.getControllerId().equals(game.getActivePlayerId())) { return true; } break; case ANY: return true; } return false; }
Source:
private SymbolStatsEstimate buildSymbolStatistics(List<Object> values, Session session, Type type) { if (values.isEmpty()) { return new SymbolStatsEstimate(NaN, NaN, NaN, NaN, 0.0); } List<Object> nonNullValues = values.stream() .filter(Objects::nonNull) .collect(toImmutableList()); if (nonNullValues.isEmpty()) { return new SymbolStatsEstimate(NaN, NaN, 1.0, 0.0, 0.0); } double[] valuesAsDoubles = nonNullValues.stream() .map(value -> toStatsRepresentation(metadata, session, type, value)) .filter(OptionalDouble::isPresent) .mapToDouble(OptionalDouble::getAsDouble) .toArray(); double lowValue = DoubleStream.of(valuesAsDoubles).min().orElse(Double.NEGATIVE_INFINITY); double highValue = DoubleStream.of(valuesAsDoubles).max().orElse(Double.POSITIVE_INFINITY); double valuesCount = values.size(); double nonNullValuesCount = nonNullValues.size(); long distinctValuesCount = nonNullValues.stream().distinct().count(); return SymbolStatsEstimate.builder() .setNullsFraction((valuesCount - nonNullValuesCount) / valuesCount) .setLowValue(lowValue) .setHighValue(highValue) .setDistinctValuesCount(distinctValuesCount) .build(); }

Target:
private SymbolStatsEstimate buildSymbolStatistics(List<Object> values, Session session, Type type) { List<Object> nonNullValues = values.stream() .filter(Objects::nonNull) .collect(toImmutableList()); if (nonNullValues.isEmpty()) { return SymbolStatsEstimate.zero(); } double[] valuesAsDoubles = nonNullValues.stream() .map(value -> toStatsRepresentation(metadata, session, type, value)) .filter(OptionalDouble::isPresent) .mapToDouble(OptionalDouble::getAsDouble) .toArray(); double lowValue = DoubleStream.of(valuesAsDoubles).min().orElse(Double.NEGATIVE_INFINITY); double highValue = DoubleStream.of(valuesAsDoubles).max().orElse(Double.POSITIVE_INFINITY); double valuesCount = values.size(); double nonNullValuesCount = nonNullValues.size(); long distinctValuesCount = nonNullValues.stream().distinct().count(); return SymbolStatsEstimate.builder() .setNullsFraction((valuesCount - nonNullValuesCount) / valuesCount) .setLowValue(lowValue) .setHighValue(highValue) .setDistinctValuesCount(distinctValuesCount) .build(); }
Source:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig storeConfig, DiskManagerConfig diskManagerConfig, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreMetrics storeMainMetrics, StoreMetrics storeUnderCompactionMetrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, ReplicaStatusDelegate replicaStatusDelegate, List<String> stoppedReplicas, Time time) { this.disk = disk; this.metrics = metrics; this.time = time; diskIOScheduler = new DiskIOScheduler(getThrottlers(storeConfig, time)); longLivedTaskScheduler = Utils.newScheduler(1, true); diskSpaceAllocator = new DiskSpaceAllocator(diskManagerConfig.diskManagerEnableSegmentPooling, new File(disk.getMountPath(), diskManagerConfig.diskManagerReserveFileDirName), diskManagerConfig.diskManagerRequiredSwapSegmentsPerSize, metrics); this.stoppedReplicas = stoppedReplicas == null ? new ArrayList<>() : stoppedReplicas; for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { BlobStore store = new BlobStore(replica, storeConfig, scheduler, longLivedTaskScheduler, diskIOScheduler, diskSpaceAllocator, storeMainMetrics, storeUnderCompactionMetrics, keyFactory, recovery, hardDelete, replicaStatusDelegate, time); stores.put(replica.getPartitionId(), store); } } compactionManager = new CompactionManager(disk.getMountPath(), storeConfig, stores.values(), metrics, time); }

Target:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig storeConfig, DiskManagerConfig diskManagerConfig, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreMetrics storeMainMetrics, StoreMetrics storeUnderCompactionMetrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, ReplicaStatusDelegate replicaStatusDelegate, List<String> stoppedReplicas, Time time) { this.disk = disk; this.metrics = metrics; this.time = time; diskIOScheduler = new DiskIOScheduler(getThrottlers(storeConfig, time)); longLivedTaskScheduler = Utils.newScheduler(1, true); diskSpaceAllocator = new DiskSpaceAllocator(diskManagerConfig.diskManagerEnableSegmentPooling, new File(disk.getMountPath(), diskManagerConfig.diskManagerReserveFileDirName), diskManagerConfig.diskManagerRequiredSwapSegmentsPerSize, metrics); this.replicaStatusDelegate = replicaStatusDelegate; this.stoppedReplicas = stoppedReplicas; for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { BlobStore store = new BlobStore(replica, storeConfig, scheduler, longLivedTaskScheduler, diskIOScheduler, diskSpaceAllocator, storeMainMetrics, storeUnderCompactionMetrics, keyFactory, recovery, hardDelete, replicaStatusDelegate, time); stores.put(replica.getPartitionId(), store); partitionToReplicaMap.put(replica.getPartitionId(), replica); } } compactionManager = new CompactionManager(disk.getMountPath(), storeConfig, stores.values(), metrics, time); }
Source:
public static void fastCompleteSpan(Map<String, String> metadata) { popCurrentSpan() .filter(openSpan -> currentTrace.get().isObservable()) .map(openSpan -> toSpan(openSpan, metadata)) .ifPresent(span -> { for (SpanObserver observer : observersList) { observer.consume(span); } }); }

Target:
public static void fastCompleteSpan(Map<String, String> metadata) { popCurrentSpan() .filter(openSpan -> currentTrace.get().isObservable()) .map(openSpan -> toSpan(openSpan, metadata)) .ifPresent(Tracer::notifyObservers); }
Source:
private String txtElapsedTime(long seconds) { long hours = 0; long minutes = 0; if (seconds >= 3600) { hours = seconds / 3600; seconds -= hours * 3600; } if (seconds >= 60) { minutes = seconds / 60; seconds -= minutes * 60; } StringBuilder s = new StringBuilder(); if (hours > 0) { s.append(hours).append(" ").append(resources.getString(R.string.metrics_hours)); } if (minutes > 0) { if (hours > 0) s.append(" "); if (hours > 0 || seconds > 0) s.append(minutes).append(" ").append(resources.getString(R.string.metrics_meters)); else s.append(minutes).append(" ").append(resources.getString(R.string.metrics_min)); } if (seconds > 0) { if (hours > 0 || minutes > 0) s.append(" "); s.append(seconds).append(" ").append(resources.getString(R.string.metrics_sec)); } return s.toString(); }

Target:
private String txtElapsedTime(long seconds) { long hours = 0; long minutes = 0; if (seconds >= 3600) { hours = seconds / 3600; seconds -= hours * 3600; } if (seconds >= 60) { minutes = seconds / 60; seconds -= minutes * 60; } StringBuilder s = new StringBuilder(); if (hours > 0) { s.append(hours).append(" ").append(resources.getString(R.string.metrics_elapsed_h)); } if (minutes > 0) { if (hours > 0) s.append(" "); if (hours > 0 || seconds > 0) s.append(minutes).append(" ").append(resources.getString(R.string.metrics_elapsed_m)); else s.append(minutes).append(" ").append(resources.getString(R.string.metrics_elapsed_min)); } if (seconds > 0) { if (hours > 0 || minutes > 0) s.append(" "); s.append(seconds).append(" ").append(resources.getString(R.string.metrics_elapsed_s)); } return s.toString(); }
Source:
public void testNormallyEnabledMercurialRepository() throws IllegalAccessException, InvocationTargetException, ForbiddenSymlinkException, InstantiationException, NoSuchMethodException, IOException { File root = new File(repository.getSourceRoot(), "mercurial"); env.setSourceRoot(root.getAbsolutePath()); assertNotNull("should get MercurialRepository", RepositoryFactory.getRepository(root)); }

Target:
public void testNormallyEnabledMercurialRepository() throws IllegalAccessException, InvocationTargetException, ForbiddenSymlinkException, InstantiationException, NoSuchMethodException, IOException { File root = new File(repository.getSourceRoot(), "mercurial"); env.setSourceRoot(root.getAbsolutePath()); assertNotNull("should get repository for mercurial/", RepositoryFactory.getRepository(root)); List<Class<? extends Repository>> clazzes = RepositoryFactory.getRepositoryClasses(); assertTrue("should contain MercurialRepository", clazzes.contains(MercurialRepository.class)); }
Source:
private void logCompactionChoice(String tableToCompact, long maxSweptAfterCompact) { if (maxSweptAfterCompact > 0) { log.info("Choosing to compact {}, because it was swept milliseconds after the last compaction", tableToCompact, maxSweptAfterCompact); } else { log.info("All swept tables have been compacted after the last sweep. Choosing to compact anyway - " + "this may be a no-op. It was last compacted milliseconds after it was last swept.", tableToCompact, -maxSweptAfterCompact); } }

Target:
private void logCompactionChoice(String tableToCompact, long maxSweptAfterCompact) { if (maxSweptAfterCompact > 0) { log.info("Choosing to compact {}, because it was swept milliseconds after the last compaction", tableToCompact, maxSweptAfterCompact); } else { log.info("All swept tables have been compacted after the last sweep. Choosing to compact anyway - " + "this may be a no-op. It was last compacted milliseconds after it was last swept.", tableToCompact, Math.abs(maxSweptAfterCompact)); } }
Source:
public void notifyChange(ModelChangeNotification notification) { if (notification.getRawNotification().isTouch()) { return; } if (EAttribute.class.isInstance(notification.getStructuralFeature())) { return; } boolean relevantChange = false; EObject iterateEObject = rootEObject; for (final EReference eReference : getDomainModelEReferencePath()) { relevantChange |= eReference.equals(notification.getStructuralFeature()) && iterateEObject == notification.getNotifier(); iterateEObject = (EObject) iterateEObject.eGet(eReference); } relevantChange |= getDomainModelEFeature().equals(notification.getStructuralFeature()) && lastResolvedEObject == notification.getNotifier(); if (relevantChange) { cleanDiagnostic(getDomainModelEFeature().equals(notification.getStructuralFeature()), notification); resolve(rootEObject, false); final List<DomainModelReferenceChangeListener> copyOfChangeListeners = new ArrayList<DomainModelReferenceChangeListener>( getChangeListener()); for (final DomainModelReferenceChangeListener listener : copyOfChangeListeners) { listener.notifyChange(); } } }

Target:
public void notifyChange(ModelChangeNotification notification) { if (notification.getRawNotification().isTouch()) { return; } if (EAttribute.class.isInstance(notification.getStructuralFeature())) { return; } boolean relevantChange = false; EObject iterateEObject = rootEObject; for (final EReference eReference : getDomainModelEReferencePath()) { relevantChange |= eReference.equals(notification.getStructuralFeature()) && iterateEObject == notification.getNotifier(); if (relevantChange) { break; } iterateEObject = (EObject) iterateEObject.eGet(eReference); } relevantChange |= notification.getStructuralFeature().equals(getDomainModelEFeature()) && lastResolvedEObject == notification.getNotifier(); if (relevantChange) { cleanDiagnostic(getDomainModelEFeature().equals(notification.getStructuralFeature()), notification); resolve(rootEObject, false); final List<DomainModelReferenceChangeListener> copyOfChangeListeners = new ArrayList<DomainModelReferenceChangeListener>( getChangeListener()); for (final DomainModelReferenceChangeListener listener : copyOfChangeListeners) { listener.notifyChange(); } } }
Source:
public static void combineState( BooleanDistinctState state, BooleanDistinctState otherState) { int combinedValue; int firstVal = state.getInt(); int secondVal = otherState.getInt(); if (firstVal == 3 || secondVal == 3) { combinedValue = 3; } else if (firstVal == 0) { combinedValue = secondVal; } else if (secondVal == 0) { combinedValue = firstVal; } else if (firstVal == secondVal) { combinedValue = firstVal; } else { combinedValue = 3; } state.setInt(combinedValue); }

Target:
public static void combineState(BooleanDistinctState state, BooleanDistinctState otherState) { state.setByte((byte) (state.getByte() | otherState.getByte())); }
Source:
public void clickOnAuthorizeBtn() { waitAuthorizeBtn(); new WebDriverWait(seleniumWebDriver, 10) .until(ExpectedConditions.elementToBeClickable(authorizeBtn)); authorizeBtn.click(); }

Target:
public void clickOnAuthorizeBtn() { waitAuthorizeBtn(); new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until(ExpectedConditions.elementToBeClickable(authorizeBtn)); authorizeBtn.click(); }
Source:
public ExecutionAttemptID(JobID jobId, ExecutionVertexID executionVertexId, int attemptNumber) { Preconditions.checkState(attemptNumber >= 0); this.jobId = jobId; this.executionVertexId = Preconditions.checkNotNull(executionVertexId); this.attemptNumber = attemptNumber; }

Target:
public ExecutionAttemptID(JobID jobId, ExecutionVertexID executionVertexId, int attemptNumber) { Preconditions.checkState(attemptNumber >= 0); this.jobId = Preconditions.checkNotNull(jobId); this.executionVertexId = Preconditions.checkNotNull(executionVertexId); this.attemptNumber = attemptNumber; }
Source:
public DistinctCountHLLAggregationFunction(List<String> arguments) { super(arguments.get(0)); int numExpressions = arguments.size(); Preconditions .checkArgument(numExpressions <= 2 && numExpressions >= 1, "DistinctCountHLL expects 1 or 2 arguments, got: ", numExpressions); if (arguments.size() == 2) { _log2M = Integer.valueOf(arguments.get(1).replace("'", "")); } else { _log2M = DEFAULT_LOG2M; } }

Target:
public DistinctCountHLLAggregationFunction(List<String> arguments) { super(arguments.get(0)); int numExpressions = arguments.size(); Preconditions .checkArgument(numExpressions <= 2 && numExpressions >= 1, "DistinctCountHLL expects 1 or 2 arguments, got: %s", numExpressions); if (arguments.size() == 2) { _log2m = Integer.valueOf(arguments.get(1).replace("'", "")); } else { _log2m = CommonConstants.Helix.DEFAULT_HYPERLOGLOG_LOG2M; } }
Source:
public int compare(Session session, PlanNodeCostEstimate left, PlanNodeCostEstimate right) { requireNonNull(session, "session can not be null"); requireNonNull(left, "left can not be null"); requireNonNull(right, "right can not be null"); checkArgument(!left.hasUnknownComponents() && !right.hasUnknownComponents(), "cannot compare unknown costs"); double leftCost = left.getCpuCost() * cpuWeight + left.getMemoryCost() * memoryWeight + left.getNetworkCost() * networkWeight; double rightCost = right.getCpuCost() * cpuWeight + right.getMemoryCost() * memoryWeight + right.getNetworkCost() * networkWeight; return Double.compare(leftCost, rightCost); }

Target:
public int compare(Session session, PlanNodeCostEstimate left, PlanNodeCostEstimate right) { requireNonNull(session, "session is null"); requireNonNull(left, "left is null"); requireNonNull(right, "right is null"); checkArgument(!left.hasUnknownComponents() && !right.hasUnknownComponents(), "cannot compare unknown costs"); double leftCost = left.getCpuCost() * cpuWeight + left.getMemoryCost() * memoryWeight + left.getNetworkCost() * networkWeight; double rightCost = right.getCpuCost() * cpuWeight + right.getMemoryCost() * memoryWeight + right.getNetworkCost() * networkWeight; return Double.compare(leftCost, rightCost); }
Source:
public void testVmElementDiskPluggedStatus() { DiskVmElement dvePlugged = dao.get(new VmDeviceId(PLUGGED_DISK_ID, FixturesTool.VM_RHEL5_POOL_57)); assertTrue(dvePlugged.isPlugged()); DiskVmElement dveUnlugged = dao.get(new VmDeviceId(UNPLUGGED_DISK_ID, FixturesTool.VM_RHEL5_POOL_57)); assertFalse(dveUnlugged.isPlugged()); }

Target:
public void testVmElementDiskPluggedStatus() { DiskVmElement dvePlugged = dao.get(new VmDeviceId(PLUGGED_DISK_ID, FixturesTool.VM_RHEL5_POOL_57)); assertTrue(dvePlugged.isPlugged()); }
Source:
OMClientResponse onFailure(OMResponse.Builder omResponse, IOException ex) { LOG.error("Add acl to volume failed!", getAcl(), getVolumeName(), ex); return new OMVolumeAclOpResponse(null, createErrorOMResponse(omResponse, ex)); }

Target:
OMClientResponse onFailure(OMResponse.Builder omResponse, IOException ex) { return new OMVolumeAclOpResponse(null, createErrorOMResponse(omResponse, ex)); }
Source:
public void initializeCertificateClient(OzoneConfiguration config) throws IOException { LOG.info("Initializing secure Datanode."); CertificateClient.InitResponse response = dnCertClient.init(); LOG.info("Init response: {}", response); switch (response) { case SUCCESS: LOG.info("Initialization successful."); break; case GETCERT: getSCMSignedCert(dnCertClient, config); LOG.info("Successfully stored SCM signed certificate."); break; case FAILURE: LOG.error("DN security initialization failed."); throw new RuntimeException("DN security initialization failed."); case RECOVER: LOG.error("DN security initialization failed. OM certificate is " + "missing."); throw new RuntimeException("DN security initialization failed."); default: LOG.error("DN security initialization failed. Init response: {}", response); throw new RuntimeException("DN security initialization failed."); } }

Target:
public void initializeCertificateClient(OzoneConfiguration config) throws IOException { LOG.info("Initializing secure Datanode."); CertificateClient.InitResponse response = dnCertClient.init(); LOG.info("Init response: {}", response); switch (response) { case SUCCESS: LOG.info("Initialization successful, case:{}.", response); break; case GETCERT: getSCMSignedCert(config); LOG.info("Successfully stored SCM signed certificate, case:{}.", response); break; case FAILURE: LOG.error("DN security initialization failed, case:{}.", response); throw new RuntimeException("DN security initialization failed."); case RECOVER: LOG.error("DN security initialization failed, case:{}. OM certificate " + "is missing.", response); throw new RuntimeException("DN security initialization failed."); default: LOG.error("DN security initialization failed. Init response: {}", response); throw new RuntimeException("DN security initialization failed."); } }
Source:
public float getExposureCompensationStep() { return 0.3f; }

Target:
public float getExposureCompensationStep() { return 0.5f; }