auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static BindAxisEvent createNewBindAxisEvent(BindAxisEvent originalEvent) { BindAxisEvent newEvent = null; Class c = originalEvent.getClass(); if (c.equals(ForwardsMovementAxis.class)) { newEvent = new ForwardsMovementAxis(); } else if (c.equals(ForwardsRealMovementAxis.class)) { newEvent = new ForwardsRealMovementAxis(); } else if (c.equals(RotationPitchAxis.class)) { newEvent = new RotationPitchAxis(); } else if (c.equals(RotationYawAxis.class)) { newEvent = new RotationYawAxis(); } else if (c.equals(StrafeMovementAxis.class)) { newEvent = new StrafeMovementAxis(); } else if (c.equals(StrafeRealMovementAxis.class)) { newEvent = new StrafeRealMovementAxis(); } else if (c.equals(VerticalMovementAxis.class)) { newEvent = new VerticalMovementAxis(); } else if (c.equals(VerticalRealMovementAxis.class)) { newEvent = new VerticalRealMovementAxis(); } else { logger.error("ERROR!!! Event not Identified"); } return newEvent; }

Target:
private BindAxisEvent createNewBindAxisEvent(BindAxisEvent originalEvent) { BindAxisEvent newEvent = null; Class eventClass = originalEvent.getClass(); if (eventClass.equals(ForwardsMovementAxis.class)) { newEvent = new ForwardsMovementAxis(); } else if (eventClass.equals(ForwardsRealMovementAxis.class)) { newEvent = new ForwardsRealMovementAxis(); } else if (eventClass.equals(RotationPitchAxis.class)) { newEvent = new RotationPitchAxis(); } else if (eventClass.equals(RotationYawAxis.class)) { newEvent = new RotationYawAxis(); } else if (eventClass.equals(StrafeMovementAxis.class)) { newEvent = new StrafeMovementAxis(); } else if (eventClass.equals(StrafeRealMovementAxis.class)) { newEvent = new StrafeRealMovementAxis(); } else if (eventClass.equals(VerticalMovementAxis.class)) { newEvent = new VerticalMovementAxis(); } else if (eventClass.equals(VerticalRealMovementAxis.class)) { newEvent = new VerticalRealMovementAxis(); } else { logger.error("ERROR!!! Event not Identified"); } return newEvent; }
Source:
boolean removeDelegate(final DataStoreProvider ds) { return delegates.remove(ds); }

Target:
boolean removeDelegate(final DataStoreProvider ds) { LOG.info("Removing delegate with role \"{}\"", ds.getRole()); rolesForDelegates.remove(ds.getDataStore()); return delegateHandler.removeDataStore(ds); }
Source:
public HighScores(int[] highScores) { this.highScores = highScores; }

Target:
public HighScores(int[] highScores) { this.highScores = highScores.clone(); }
Source:
public boolean isSecretSocketSupported() { return this.newerThanEquals(SPARK_2_3_1) || this.equals(SparkVersion.fromVersionString("2.1.2")); }

Target:
public boolean isSecretSocketSupported() { return this.newerThanEquals(SPARK_2_3_1); }
Source:
public static <T> Predicate<Location> isChildOf(final Location parent) { return new Predicate<Location>() { @Override public boolean apply(@Nullable Location input) { return Objects.equal(input.getParent(), parent); } }; }

Target:
public static <T> Predicate<Location> isChildOf(final Location parent) { return new Predicate<Location>() { @Override public boolean apply(@Nullable Location input) { return (input != null) && Objects.equal(input.getParent(), parent); } }; }
Source:
public String extractPasswordValue(String value) throws IOException { String password = null; if (StringUtils.isNotBlank(value) && value.equals(INTERACTIVE_MODE)) { password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } return password; }

Target:
public String extractPasswordValue(String value) throws IOException { String password = null; if (StringUtils.isNotBlank(value) && value.equalsIgnoreCase(INTERACTIVE_MODE)) { password = EngineConfigLogic.startPasswordDialog(null); } else { password = EngineConfigLogic.getPassFromFile((StringUtils.isNotBlank(value)) ? value : parser.getAdminPassFile()); } return password; }
Source:
public static void makeInstance() { if (instance == null) { instance = new CameraManager(); } }

Target:
public static void makeInstance() { instance = new CameraManager(); }
Source:
private Consul(String url, ClientBuilder builder, ObjectMapper mapper) { if (!builder.getConfiguration().getClasses().stream() .filter(c -> JacksonJaxbJsonProvider.class.isAssignableFrom(c)).findAny().isPresent()) { builder.register(JacksonJaxbJsonProvider.class); } final Client client = builder .register(new ObjectMapperContextResolver(mapper)) .build(); this.agentClient = new AgentClient(client.target(url).path("v1").path("agent")); this.healthClient = new HealthClient(client.target(url).path("v1").path("health")); this.keyValueClient = new KeyValueClient(client.target(url).path("v1").path("kv")); this.catalogClient = new CatalogClient(client.target(url).path("v1").path("catalog")); this.statusClient = new StatusClient(client.target(url).path("v1").path("status")); this.sessionClient = new SessionClient(client.target(url).path("v1").path("session")); this.eventClient = new EventClient(client.target(url).path("v1").path("event")); agentClient.ping(); }

Target:
private Consul(String url, ClientBuilder builder, ObjectMapper mapper) { if (!FluentIterable.from(builder.getConfiguration().getClasses()) .filter(new Predicate<Class<?>>() { @Override public boolean apply(final Class<?> clazz) { return JacksonJaxbJsonProvider.class.isAssignableFrom(clazz); } }).first().isPresent()) { builder.register(JacksonJaxbJsonProvider.class); } final Client client = builder .register(new ObjectMapperContextResolver(mapper)) .build(); this.agentClient = new AgentClient(client.target(url).path("v1").path("agent")); this.healthClient = new HealthClient(client.target(url).path("v1").path("health")); this.keyValueClient = new KeyValueClient(client.target(url).path("v1").path("kv")); this.catalogClient = new CatalogClient(client.target(url).path("v1").path("catalog")); this.statusClient = new StatusClient(client.target(url).path("v1").path("status")); this.sessionClient = new SessionClient(client.target(url).path("v1").path("session")); this.eventClient = new EventClient(client.target(url).path("v1").path("event")); agentClient.ping(); }
Source:
protected Optional<Integer> getVal(Entity container) { if (container instanceof EntityCreeper) { EntityCreeper creeper = (EntityCreeper) container; return Optional.of(creeper.fuseTime); } else if (container instanceof EntityFireworkRocket) { EntityFireworkRocket fireworkRocket = (EntityFireworkRocket) container; return Optional.of(fireworkRocket.lifetime); } else if (container instanceof EntityMinecartTNT) { EntityMinecartTNT tntMinecart = (EntityMinecartTNT) container; return Optional.of(tntMinecart.minecartTNTFuse); } else if (container instanceof EntityTNTPrimed) { EntityTNTPrimed primedTNT = (EntityTNTPrimed) container; return Optional.of(primedTNT.fuse); } return Optional.empty(); }

Target:
protected Optional<Integer> getVal(Entity container) { if (container instanceof EntityCreeper) { EntityCreeper creeper = (EntityCreeper) container; return Optional.of(creeper.fuseTime - creeper.timeSinceIgnited); } else if (container instanceof EntityFireworkRocket) { EntityFireworkRocket fireworkRocket = (EntityFireworkRocket) container; return Optional.of(fireworkRocket.lifetime - fireworkRocket.fireworkAge); } else if (container instanceof EntityMinecartTNT) { EntityMinecartTNT tntMinecart = (EntityMinecartTNT) container; return Optional.of(tntMinecart.minecartTNTFuse); } else if (container instanceof EntityTNTPrimed) { EntityTNTPrimed primedTNT = (EntityTNTPrimed) container; return Optional.of(primedTNT.fuse); } return Optional.empty(); }
Source:
private ClientRegistration createClientBuilder(String id, AuthorizationProperties authz) { ClientRegistration.Builder result = createClientBuilder(id); List<String> scopes = authz.getScopes(); if (authz.isOnDemand()) { if (!scopes.contains("openid")) { scopes.add("openid"); } if (!scopes.contains("profile")) { scopes.add("profile"); } } result.scope(authz.getScopes()); return result.build(); }

Target:
private ClientRegistration createClientBuilder(String id, AuthorizationProperties authz) { ClientRegistration.Builder result = createClientBuilder(id); List<String> scopes = authz.getScopes(); if (authz.isOnDemand()) { if (!scopes.contains("openid")) { scopes.add("openid"); } if (!scopes.contains("profile")) { scopes.add("profile"); } } result.scope(scopes); return result.build(); }
Source:
public void deleteBlob(String blobIdString) throws CoordinatorException { try { logger.trace("deleteBlob. " + blobIdString); long startTimeInMs = System.currentTimeMillis(); BlobId blobId = getBlobIdFromString(blobIdString); DeleteOperation deleteOperation = new DeleteOperation(datacenterName, connectionPool, requesterPool, getOperationContext(), blobId, operationTimeoutMs); deleteOperation.execute(); notificationSystem.onBlobDeleted(blobIdString); coordinatorMetrics.deleteBlobOperationRate.mark(); coordinatorMetrics.deleteBlobOperationLatencyInMs.update(System.currentTimeMillis() - startTimeInMs); } catch (CoordinatorException e) { logger.error("deleteBlob re-throwing CoordinatorException" + e); coordinatorMetrics.countError(CoordinatorMetrics.CoordinatorOperationType.DeleteBlob, e.getErrorCode()); throw e; } }

Target:
public void deleteBlob(String blobIdString) throws CoordinatorException { try { logger.trace("deleteBlob. " + blobIdString); long startTimeInMs = System.currentTimeMillis(); BlobId blobId = getBlobIdFromString(blobIdString); DeleteOperation deleteOperation = new DeleteOperation(datacenterName, connectionPool, requesterPool, getOperationContext(), blobId, operationTimeoutMs); deleteOperation.execute(); notificationSystem.onBlobDeleted(blobIdString); coordinatorMetrics.deleteBlobOperationRate.mark(); coordinatorMetrics.deleteBlobOperationLatencyInMs.update(System.currentTimeMillis() - startTimeInMs); } catch (CoordinatorException e) { logger.trace("deleteBlob re-throwing CoordinatorException", e); coordinatorMetrics.countError(CoordinatorMetrics.CoordinatorOperationType.DeleteBlob, e.getErrorCode()); throw e; } }
Source:
long gtk_draw (long widget, long cairo) { boolean haveBoundsChanged = boundsChangedSinceLastDraw; boundsChangedSinceLastDraw = false; if ((state & OBSCURED) != 0) return 0; if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0)) { if (hooks (SWT.MeasureItem) || hooks (SWT.PaintItem) || hooks (SWT.EraseItem)) { if (haveBoundsChanged) { GTK.gtk_widget_queue_draw(handle); return 0; } } } drawInheritedBackground (0, cairo); return super.gtk_draw (widget, cairo); }

Target:
long gtk_draw (long widget, long cairo) { boolean haveBoundsChanged = boundsChangedSinceLastDraw; boundsChangedSinceLastDraw = false; if ((state & OBSCURED) != 0) return 0; if (GTK.GTK_VERSION >= OS.VERSION(3, 14, 0) && ownerDraw && haveBoundsChanged) { GTK.gtk_widget_queue_draw(handle); return 0; } drawInheritedBackground (0, cairo); return super.gtk_draw (widget, cairo); }
Source:
private PathChildrenCache setupCacheSync(final CuratorFramework zkClient) throws Exception { try { zkClient.create() .creatingParentsIfNeeded() .withMode(CreateMode.PERSISTENT) .forPath(ZKNODE_PATH); } catch (KeeperException.NodeExistsException expected) { } final PathChildrenCache cacheSync = new PathChildrenCache(zkClient, ZKNODE_PATH, false); cacheSync.start(); cacheSync.getListenable().addListener((curator, event) -> this.onZkEvent(event)); return cacheSync; }

Target:
private static PathChildrenCache setupCacheSync(final CuratorFramework zkClient) throws Exception { try { zkClient.create() .creatingParentsIfNeeded() .withMode(CreateMode.PERSISTENT) .forPath(ZKNODE_PATH); } catch (final KeeperException.NodeExistsException expected) { } final PathChildrenCache cacheSync = new PathChildrenCache(zkClient, ZKNODE_PATH, false); cacheSync.start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE); return cacheSync; }
Source:
public Parts( Optional<StatisticAggregations> finalAggregation, Optional<StatisticAggregations> intermediateAggregation, StatisticAggregations partialAggregation) { this.finalAggregation = requireNonNull(finalAggregation, "finalAggregation is null"); this.intermediateAggregation = requireNonNull(intermediateAggregation, "intermediateAggregation is null"); this.partialAggregation = requireNonNull(partialAggregation, "partialAggregation is null"); }

Target:
public Parts( Optional<StatisticAggregations> finalAggregation, Optional<StatisticAggregations> intermediateAggregation, StatisticAggregations partialAggregation) { this.finalAggregation = requireNonNull(finalAggregation, "finalAggregation is null"); this.intermediateAggregation = requireNonNull(intermediateAggregation, "intermediateAggregation is null"); checkArgument( finalAggregation.isPresent() ^ intermediateAggregation.isPresent(), "only final or only intermediate aggregation is expected to be present"); this.partialAggregation = requireNonNull(partialAggregation, "partialAggregation is null"); }
Source:
public void testNotificationOnStartProcess() { getStartProcessFormDisplayer().setNewProcessInstanceEvent(newProcessInstanceEvent); getStartProcessFormDisplayer().setNotificationEvent(notificationEvent); getStartProcessFormDisplayer().setProcessService(processServiceCaller); getStartProcessFormDisplayer().setParentProcessInstanceId(0L); getStartProcessFormDisplayer().startProcess(new HashMap<String, Object>()); verify(newProcessInstanceEvent).fire(any(NewProcessInstanceEvent.class)); ArgumentCaptor<NotificationEvent> argument = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(argument.capture()); assertEquals(NotificationEvent.NotificationType.SUCCESS, argument.getValue().getType()); }

Target:
public void testNotificationOnStartProcess() { getStartProcessFormDisplayer().setParentProcessInstanceId(0L); getStartProcessFormDisplayer().startProcess(new HashMap<String, Object>()); verify(newProcessInstanceEvent).fire(any(NewProcessInstanceEvent.class)); ArgumentCaptor<NotificationEvent> argument = ArgumentCaptor.forClass(NotificationEvent.class); verify(notificationEvent).fire(argument.capture()); assertEquals(NotificationEvent.NotificationType.SUCCESS, argument.getValue().getType()); }
Source:
public Command prepareLocal(String sql) { if (closed) { throw DbException.get(ErrorCode.CONNECTION_BROKEN_1, "session closed"); } Command command; if (queryCache != null) { synchronized (queryCache) { long newModificationMetaID = database.getModificationMetaId(); if (newModificationMetaID != modificationMetaID) { queryCache.clear(); modificationMetaID = newModificationMetaID; } command = queryCache.get(sql); if (command != null && command.canReuse()) { command.reuse(); return command; } } } Parser parser = new Parser(this); try { command = parser.prepareCommand(sql); } finally { subQueryIndexCache = null; } command.prepareJoinBatch(); if (queryCache != null && command.isCacheable()) { synchronized (queryCache) { queryCache.put(sql, command); } } return command; }

Target:
public Command prepareLocal(String sql) { if (closed) { throw DbException.get(ErrorCode.CONNECTION_BROKEN_1, "session closed"); } Command command; if (queryCacheSize > 0) { if (queryCache == null) { queryCache = SmallLRUCache.newInstance(queryCacheSize); modificationMetaID = database.getModificationMetaId(); } else { long newModificationMetaID = database.getModificationMetaId(); if (newModificationMetaID != modificationMetaID) { queryCache.clear(); modificationMetaID = newModificationMetaID; } command = queryCache.get(sql); if (command != null && command.canReuse()) { command.reuse(); return command; } } } Parser parser = new Parser(this); try { command = parser.prepareCommand(sql); } finally { subQueryIndexCache = null; } command.prepareJoinBatch(); if (queryCache != null) { if (command.isCacheable()) { queryCache.put(sql, command); } } return command; }
Source:
public <T extends Comparable<T>> Boolean visit(NotEq<T> notEq) { Column<T> filterColumn = notEq.getColumn(); T value = notEq.getValue(); ColumnChunkMetaData columnChunk = getColumnChunk(filterColumn.getColumnPath()); Statistics<T> stats = columnChunk.getStatistics(); if (stats.isEmpty()) { return false; } if (value == null) { return isAllNulls(columnChunk); } if (hasNulls(columnChunk)) { return false; } if (isAllNulls(columnChunk)) { return false; } return value.compareTo(stats.genericGetMin()) == 0 && value.compareTo(stats.genericGetMax()) == 0; }

Target:
public <T extends Comparable<T>> Boolean visit(NotEq<T> notEq) { Column<T> filterColumn = notEq.getColumn(); T value = notEq.getValue(); ColumnChunkMetaData columnChunk = getColumnChunk(filterColumn.getColumnPath()); Statistics<T> stats = columnChunk.getStatistics(); if (stats.isEmpty()) { return false; } if (value == null) { return isAllNulls(columnChunk); } if (hasNulls(columnChunk)) { return false; } return value.compareTo(stats.genericGetMin()) == 0 && value.compareTo(stats.genericGetMax()) == 0; }
Source:
public List<Container> getAllContainers() { return Collections.unmodifiableList(new ArrayList<>(containerIdToContainerMap.values())); }

Target:
public Collection<Container> getAllContainers() { return Collections.unmodifiableCollection(containerIdToContainerMap.values()); }
Source:
public void set_project_with_branch() { IssueChangeNotification result = notification.setProject("MyService", "My Service", "feature1", ""); assertThat(result.getFieldValue("projectKey")).isEqualTo("MyService"); assertThat(result.getFieldValue("projectName")).isEqualTo("My Service"); assertThat(result.getFieldValue("branch")).isEqualTo("feature1"); }

Target:
public void set_project_with_branch() { IssueChangeNotification result = notification.setProject("MyService", "My Service", "feature1", "uuid2"); assertThat(result.getFieldValue("projectKey")).isEqualTo("MyService"); assertThat(result.getFieldValue("projectUuid")).isEqualTo("uuid2"); assertThat(result.getFieldValue("projectName")).isEqualTo("My Service"); assertThat(result.getFieldValue("branch")).isEqualTo("feature1"); }
Source:
public static boolean isLoggingEnabled() { SharedPreferences properties = CommCareApplication.instance().getCurrentApp().getAppPreferences(); return !properties.contains(LOGS_ENABLED) || properties.getString(ENABLE_SAVED_FORMS, LOGS_ENABLED_YES).equals(LOGS_ENABLED_YES); }

Target:
public static boolean isLoggingEnabled() { if (CommCareApplication.instance().getCurrentApp() == null) { return true; } SharedPreferences properties = CommCareApplication.instance().getCurrentApp().getAppPreferences(); return !properties.contains(LOGS_ENABLED) || properties.getString(LOGS_ENABLED, LOGS_ENABLED_YES).equals(LOGS_ENABLED_YES); }
Source:
public void canCRUD() { DeveloperClient client = developer.getSession().getDeveloperClient(); ResourceList<Subpopulation> subpops = client.getAllSubpopulations(); int initialCount = subpops.getTotal(); assertNotNull(findByName(subpops.getItems(), "Default Consent Group")); Subpopulation subpop = new Subpopulation(); subpop.setName("Later Consent Group"); subpop.setMinAppVersion(10); GuidVersionHolder keys = client.createSubpopulation(subpop); subpop.setHolder(keys); Subpopulation retrieved = client.getSubpopulation(subpop.getGuid()); assertEquals(subpop, retrieved); retrieved.setDescription("Adding a description"); retrieved.setMinAppVersion(8); keys = client.updateSubpopulation(retrieved); retrieved.setHolder(keys); subpops = client.getAllSubpopulations(); assertEquals(initialCount+1, subpops.getTotal()); assertNotNull(findByName(subpops.getItems(), "Default Consent Group")); assertNotNull(findByName(subpops.getItems(), "Later Consent Group")); client.deleteSubpopulation(retrieved.getGuid()); assertEquals(initialCount, client.getAllSubpopulations().getTotal()); try { Subpopulation defaultSubpop = findByName(subpops.getItems(), "Default Consent Group"); client.deleteSubpopulation(defaultSubpop.getGuid()); fail("Should have thrown an exception."); } catch(BadRequestException e) { assertEquals("Cannot delete the default subpopulation for a study.", e.getMessage()); } admin.getSession().getAdminClient().deleteSubpopulationPermanently(retrieved.getGuid()); }

Target:
public void canCRUD() { DeveloperClient client = developer.getSession().getDeveloperClient(); ResourceList<Subpopulation> subpops = client.getAllSubpopulations(); int initialCount = subpops.getTotal(); assertNotNull(findByName(subpops.getItems(), "Default Consent Group")); Subpopulation subpop = new Subpopulation(); subpop.setName("Later Consent Group"); subpop.setMinAppVersion(10); GuidVersionHolder keys = client.createSubpopulation(subpop); subpop.setHolder(keys); guid = subpop.getGuid(); Subpopulation retrieved = client.getSubpopulation(subpop.getGuid()); assertEquals(subpop, retrieved); retrieved.setDescription("Adding a description"); retrieved.setMinAppVersion(8); keys = client.updateSubpopulation(retrieved); retrieved.setHolder(keys); subpops = client.getAllSubpopulations(); assertEquals(initialCount+1, subpops.getTotal()); assertNotNull(findByName(subpops.getItems(), "Default Consent Group")); assertNotNull(findByName(subpops.getItems(), "Later Consent Group")); client.deleteSubpopulation(retrieved.getGuid()); assertEquals(initialCount, client.getAllSubpopulations().getTotal()); try { Subpopulation defaultSubpop = findByName(subpops.getItems(), "Default Consent Group"); client.deleteSubpopulation(defaultSubpop.getGuid()); fail("Should have thrown an exception."); } catch(BadRequestException e) { assertEquals("Cannot delete the default subpopulation for a study.", e.getMessage()); } }
Source:
public Mono<byte[]> getSessionState() { if (!isSessionEnabled) { return monoError(logger, new IllegalStateException("Cannot get session state for non-session management node")); } return isAuthorized(ManagementConstants.OPERATION_GET_SESSION_STATE).then(createChannel.flatMap(channel -> { final Message message = createManagementMessage(ManagementConstants.OPERATION_GET_SESSION_STATE, null); final Map<String, Object> body = new HashMap<>(); body.put(ManagementConstants.SESSION_ID, sessionId); message.setBody(new AmqpValue(body)); return sendWithVerify(channel, message); })).flatMap(response -> { final Object value = ((AmqpValue) response.getBody()).getValue(); if (!(value instanceof Map)) { return monoError(logger, Exceptions.propagate(new AmqpException(false, String.format( "Body not expected when renewing session. Id: %s. Value: %s", sessionId, value), getErrorContext()))); } @SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>) value; final Object sessionState = map.get(ManagementConstants.SESSION_STATE); if (!map.containsKey(ManagementConstants.SESSION_STATE) || sessionState == null) { logger.info("sessionId[{}]. Does not have a session state.", sessionId); return Mono.empty(); } final byte[] state = ((Binary) sessionState).getArray(); return Mono.just(state); }); }

Target:
public Mono<byte[]> getSessionState() { if (!isSessionEnabled) { return monoError(logger, new IllegalStateException("Cannot get session state for non-session management node")); } return isAuthorized(ManagementConstants.OPERATION_GET_SESSION_STATE).then(createChannel.flatMap(channel -> { final Message message = createManagementMessage(ManagementConstants.OPERATION_GET_SESSION_STATE, null); final Map<String, Object> body = new HashMap<>(); body.put(ManagementConstants.SESSION_ID, sessionId); message.setBody(new AmqpValue(body)); return sendWithVerify(channel, message); })).flatMap(response -> { final Object value = ((AmqpValue) response.getBody()).getValue(); if (!(value instanceof Map)) { return monoError(logger, Exceptions.propagate(new AmqpException(false, String.format( "Body not expected when renewing session. Id: %s. Value: %s", sessionId, value), getErrorContext()))); } @SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>) value; final Object sessionState = map.get(ManagementConstants.SESSION_STATE); if (sessionState == null) { logger.info("sessionId[{}]. Does not have a session state.", sessionId); return Mono.empty(); } final byte[] state = ((Binary) sessionState).getArray(); return Mono.just(state); }); }
Source:
protected void executeCommand() { storage_pool storagePool = getStoragePool(); getStoragePoolDAO().updatePartial(storagePool); if (storagePool.getstatus() != StoragePoolStatus.Up) { setSucceeded(true); return; } String spName = storagePool.getname(); if (!StringHelper.EqOp(_oldStoragePool.getname(), spName)) { VDSBrokerFrontend resourceManager = Backend.getInstance() .getResourceManager(); Guid spId = storagePool.getId(); SetStoragePoolDescriptionVDSCommandParameters parameters = new SetStoragePoolDescriptionVDSCommandParameters(spId, spName); resourceManager.RunVdsCommand( VDSCommandType.SetStoragePoolDescription, parameters); } setSucceeded(true); }

Target:
protected void executeCommand() { if ((_oldStoragePool.getQuotaEnforcementType() == QuotaEnforcmentTypeEnum.DISABLED) && (getStoragePool().getQuotaEnforcementType() != QuotaEnforcmentTypeEnum.DISABLED)) { QuotaHelper.getInstance().setDefaultQuotaAsRegularQuota(_oldStoragePool); } storage_pool storagePool = getStoragePool(); getStoragePoolDAO().updatePartial(storagePool); if (storagePool.getstatus() != StoragePoolStatus.Up) { setSucceeded(true); return; } String spName = storagePool.getname(); if (!StringHelper.EqOp(_oldStoragePool.getname(), spName)) { VDSBrokerFrontend resourceManager = Backend.getInstance() .getResourceManager(); Guid spId = storagePool.getId(); SetStoragePoolDescriptionVDSCommandParameters parameters = new SetStoragePoolDescriptionVDSCommandParameters(spId, spName); resourceManager.RunVdsCommand( VDSCommandType.SetStoragePoolDescription, parameters); } setSucceeded(true); }
Source:
public void close() throws IOException { if (!closed) { closed = true; if (stream != null) { try { stream.close(); } catch (IOException e) { LOGGER.debug("Error closing stream", e); } } completed.countDown(); } }

Target:
public void close() throws IOException { if (!closed) { closed = true; try { if (stream != null) { stream.close(); } } finally { completed.countDown(); } } }
Source:
protected boolean processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile(String saeFullyQualifiedFileName, ConcurStandardAccountingExtractBatchReportData reportData) { boolean success = true; LOG.info("processCurrentFileAndExtractPdpFeedFromSAEFile, current File: " + saeFullyQualifiedFileName); ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFile(saeFullyQualifiedFileName); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountExtractFile(concurStandardAccoutingExtractFile)) { String outputFileName = getConcurStandardAccountingExtractService().extractPdpFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); if (StringUtils.isEmpty(outputFileName)) { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, could not produce a PDP XML file for " + saeFullyQualifiedFileName); } if (success) { success &= getConcurStandardAccountingExtractService() .extractCollectorFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); } if (success) { try { getConcurStandardAccountingExtractService().createDoneFileForPdpFile(outputFileName); } catch (IOException e) { LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, unable to create .done file: ", e); success = false; } } } else { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, the SAE file failed high level validation."); } return success; }

Target:
protected boolean processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile(String saeFullyQualifiedFileName, ConcurStandardAccountingExtractBatchReportData reportData) { boolean success = true; LOG.info("processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile, current File: " + saeFullyQualifiedFileName); ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFile(saeFullyQualifiedFileName); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountExtractFile(concurStandardAccoutingExtractFile)) { String outputFileName = getConcurStandardAccountingExtractService().extractPdpFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); if (StringUtils.isEmpty(outputFileName)) { success = false; LOG.error("processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile, could not produce a PDP XML file for " + saeFullyQualifiedFileName); } if (success) { success &= getConcurStandardAccountingExtractService() .extractCollectorFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); } if (success) { try { getConcurStandardAccountingExtractService().createDoneFileForPdpFile(outputFileName); } catch (IOException e) { LOG.error("processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile, unable to create .done file: ", e); success = false; } } } else { success = false; LOG.error("processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile, the SAE file failed high level validation."); } return success; }
Source:
public void setActive(boolean isActive) { mIsActive = isActive; if (!mIsActive) { synchronized (mActionLock) { if (mPendingZoomRatioCompleter != null) { mPendingZoomRatioCompleter.setException( new OperationCanceledException("Camera is not active.")); mPendingZoomRatioCompleter = null; } } setLiveDataValue(mZoomRatioLiveData, DEFAULT_ZOOM_RATIO); setLiveDataValue(mMaxZoomRatioLiveData, getMaxDigitalZoom()); setLiveDataValue(mMinZoomRatioLiveData, MIN_ZOOM); setLiveDataValue(mZoomPercentageLiveData, 0f); } }

Target:
void setActive(boolean isActive) { CallbackToFutureAdapter.Completer<Void> completerToSetException = null; boolean toResetDefault = false; synchronized (mActiveLock) { mIsActive = isActive; if (!mIsActive) { synchronized (mCompleterLock) { if (mPendingZoomRatioCompleter != null) { completerToSetException = mPendingZoomRatioCompleter; mPendingZoomRatioCompleter = null; } } toResetDefault = true; } } if (toResetDefault) { setLiveDataValue(mZoomRatioLiveData, DEFAULT_ZOOM_RATIO); setLiveDataValue(mMaxZoomRatioLiveData, getMaxDigitalZoom()); setLiveDataValue(mMinZoomRatioLiveData, MIN_ZOOM); setLiveDataValue(mZoomPercentageLiveData, 0f); } if (completerToSetException != null) { completerToSetException .setException(new OperationCanceledException("Camera is not active.")); } }
Source:
public boolean isNodeConstant(OgnlContext context) throws OgnlException { boolean result = false; Exception reason = null; try { Class c = OgnlRuntime.classForName(context, className); if (fieldName.equals("class")) { result = true; } else if (OgnlRuntime.isJdk15() && c.isEnum()) { result = true; } else { final int fModifiers; Field f; try { f = c.getField(fieldName); } catch (NoSuchFieldException nsfe) { f = OgnlRuntime.getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName); } } fModifiers = f.getModifiers(); if (!Modifier.isStatic(fModifiers)) throw new OgnlException("Field " + fieldName + " of class " + className + " is not static"); result = Modifier.isFinal(fModifiers); } } catch (ClassNotFoundException e) { reason = e; } catch (NoSuchFieldException e) { reason = e; } catch (SecurityException e) { reason = e; } if (reason != null) throw new OgnlException("Could not get static field " + fieldName + " from class " + className, reason); return result; }

Target:
public boolean isNodeConstant(OgnlContext context) throws OgnlException { boolean result = false; Exception reason = null; try { Class c = OgnlRuntime.classForName(context, className); if (fieldName.equals("class")) { result = true; } else if (OgnlRuntime.isJdk15() && c.isEnum()) { result = true; } else { Field f; try { f = c.getField(fieldName); } catch (NoSuchFieldException nsfe) { f = OgnlRuntime.getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName); } } final int fModifiers = f.getModifiers(); if (!Modifier.isStatic(fModifiers)) throw new OgnlException("Field " + fieldName + " of class " + className + " is not static"); result = Modifier.isFinal(fModifiers); } } catch (ClassNotFoundException e) { reason = e; } catch (NoSuchFieldException e) { reason = e; } catch (SecurityException e) { reason = e; } if (reason != null) throw new OgnlException("Could not get static field " + fieldName + " from class " + className, reason); return result; }
Source:
private void parallelAnnotation(JSONObject op, StringBuilder sb) { Boolean parallel = (Boolean) op.get("parallelOperator"); if (parallel != null && parallel) { sb.append("@parallel(width="); Object width = op.get("width"); if (width instanceof Integer) { sb.append(Integer.toString((int) width)); } else if (width instanceof Long) { sb.append(Long.toString((long) width)); } else { JSONObject jo = (JSONObject) width; String jsonType = (String) jo.get("type"); if (TYPE_SUBMISSION_PARAMETER.equals(jsonType)) sb.append(stvHelper.generateCompParamName((JSONObject) jo.get("value"))); else throw new IllegalArgumentException("Unsupported parallel width specification: " + jo); } Boolean partitioned = (Boolean) op.get("partitioned"); if (partitioned != null && partitioned) { String parallelInputPortName = (String) op .get("parallelInputPortName"); parallelInputPortName = splBasename(parallelInputPortName); sb.append(", partitionBy=[{port=" + parallelInputPortName + ", attributes=[__spl_hash]}]"); } sb.append(")\n"); } }

Target:
private void parallelAnnotation(JSONObject op, StringBuilder sb) { Boolean parallel = (Boolean) op.get("parallelOperator"); if (parallel != null && parallel) { sb.append("@parallel(width="); Object width = op.get("width"); if (width instanceof Integer) { sb.append(Integer.toString((int) width)); } else if (width instanceof Long) { sb.append(Integer.toString(((Long)width).intValue())); } else { JSONObject jo = (JSONObject) width; String jsonType = (String) jo.get("type"); if (TYPE_SUBMISSION_PARAMETER.equals(jsonType)) sb.append(stvHelper.generateCompParamName((JSONObject) jo.get("value"))); else throw new IllegalArgumentException("Unsupported parallel width specification: " + jo); } Boolean partitioned = (Boolean) op.get("partitioned"); if (partitioned != null && partitioned) { String parallelInputPortName = (String) op .get("parallelInputPortName"); parallelInputPortName = splBasename(parallelInputPortName); sb.append(", partitionBy=[{port=" + parallelInputPortName + ", attributes=[__spl_hash]}]"); } sb.append(")\n"); } }
Source:
public boolean isOverutilized() { return memoryManager.isOverUtilized(); }

Target:
public boolean isOverutilized() { return memoryManager.isOverutilized(); }
Source:
public static void main(String... args) { Thread.setDefaultUncaughtExceptionHandler(new FileExceptionHandler(ExceptionHandler.ExceptionType.CLIENT)); if (Context.getJavaVersion() >= 9) { UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); } if (!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It is recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }

Target:
public static void main(String... args) { if (Context.getJavaVersion() >= 9) { UILog.log("Parabot", "Parabot doesn't support Java 9+ currently. Please downgrade to Java 8 to ensure Parabot is working correctly."); } if (!System.getProperty("os.arch").contains("64")) { UILog.log("Parabot", "You are not running a 64-bit version of Java, this might cause the client to lag or crash unexpectedly.\r\n" + "It is recommended to upgrade to a 64-bit version."); } parseArgs(args); Directories.validate(); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode()); try { Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL") + UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable t) { t.printStackTrace(); } if (!Core.inDebugMode() && Core.hasValidation() && !Core.isValid()) { if (Core.newVersionAlert() == JOptionPane.YES_OPTION) { Core.downloadNewVersion(); return; } } Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER")); AccountManager.validate(); if (username != null && password != null) { new BotUI(username, password); username = null; password = null; return; } Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI")); new BotUI(null, null); }
Source:
public CompletableFuture<Object> visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) { return CompletableFuture.supplyAsync(() -> { try { return txHandler.visitPrepareCommand(null, command); } catch (Throwable throwable) { throw CompletableFutures.asCompletionException(throwable); } }, executor); }

Target:
public CompletionStage<Void> visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) { return CompletableFuture.runAsync(() -> txHandler.handlePrepareCommand(command), executor); }
Source:
public User login(String email, String password) throws SQLException { User user = QueryBuilder.create(dataSource, getQuery("database.loginUser")) .setString("email", email.trim().toLowerCase()) .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; } else { return null; } }

Target:
public User login(String email, String password) throws SQLException { User user = QueryBuilder.create(dataSource, getQuery("database.loginUser")) .setString("email", email.trim()) .executeQuerySingle(User.class); if (user != null && user.isPasswordValid(password)) { return user; } else { return null; } }
Source:
public <T> Mono<CosmosAsyncItemResponse<T>> replaceItem( T item, String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options) { Document doc = CosmosItemProperties.fromObject(item); if (options == null) { options = new CosmosItemRequestOptions(); } ModelBridgeInternal.setPartitionKey(options, partitionKey); @SuppressWarnings("unchecked") Class<T> itemType = (Class<T>) item.getClass(); final CosmosItemRequestOptions requestOptions = options; return withContext(context -> replaceItem(itemType, itemId, doc, requestOptions,context)).subscriberContext(reactorContext -> { Optional<String> master = reactorContext.getOrEmpty(TracerProvider.MASTER_CALL); if (master.isPresent()) { reactorContext = reactorContext.put(TracerProvider.NESTED_CALL, true); } return reactorContext.put(TracerProvider.MASTER_CALL, true); }); }

Target:
public <T> Mono<CosmosItemResponse<T>> replaceItem( T item, String itemId, PartitionKey partitionKey, CosmosItemRequestOptions options) { Document doc = CosmosItemProperties.fromObject(item); if (options == null) { options = new CosmosItemRequestOptions(); } ModelBridgeInternal.setPartitionKey(options, partitionKey); @SuppressWarnings("unchecked") Class<T> itemType = (Class<T>) item.getClass(); if(!database.getClient().getTracerProvider().isEnabled()){ return replaceItemInternal(itemType, itemId, doc, options); } final CosmosItemRequestOptions requestOptions = options; return withContext(context -> replaceItemInternal(itemType, itemId, doc, requestOptions,context)); }
Source:
public void testScanFilterAndProjectOperator() throws Exception { DriverContext driverContext = testPreparer.newDriverContext(); SourceOperator operator = testPreparer.newScanFilterAndProjectOperator(driverContext); assertEquals(driverContext.getSystemMemoryUsage(), 0); for (int i = 0; i < 54; i++) { assertFalse(operator.isFinished()); operator.getOutput(); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 20_000L, 699_999L); } assertFalse(operator.isFinished()); operator.getOutput(); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 400L, 600L); assertNull(operator.getOutput()); assertTrue(operator.isFinished()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 400L, 600L); }

Target:
public void testScanFilterAndProjectOperator() throws Exception { DriverContext driverContext = testPreparer.newDriverContext(); SourceOperator operator = testPreparer.newScanFilterAndProjectOperator(driverContext); assertEquals(driverContext.getSystemMemoryUsage(), 0); for (int i = 0; i < 50; i++) { assertFalse(operator.isFinished()); assertNotNull(operator.getOutput()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 90_000L, 499_999L); } assertNull(operator.getOutput()); assertTrue(operator.isFinished()); assertBetweenInclusive(driverContext.getSystemMemoryUsage(), 0L, 500L); }
Source:
private FilePath createWindowsSshAskpass(SSHUserPrivateKey sshUser) throws IOException, InterruptedException { FilePath ssh = workspace.createTempFile("pass", ".bat"); ssh.write("echo \"" + Secret.toString(sshUser.getPassphrase()) + "\"", null); ssh.chmod(0700); return ssh; }

Target:
private FilePath createWindowsSshAskpass(SSHUserPrivateKey sshUser) throws IOException, InterruptedException { FilePath ssh = workspace.createTextTempFile("pass", ".bat", "echo \"" + quoteWindowsCredentials(Secret.toString(sshUser.getPassphrase())) + "\"", false); return ssh; }
Source:
public ListOperationParameters buildListOperationParameters(IndexedRecord record) { listOpeParms = new ListOperationParameters(); listOpeParms.setApiMode(api); listOpeParms.setOperation(operation.name()); listOpeParms.setStrict(dieOnError); if (use_soap_api) { listOpeParms.setListKeyType(record.get(inputSchema.getField(FIELD_LIST_KEY_TYPE).pos()).toString()); listOpeParms.setListKeyValue(record.get(inputSchema.getField(FIELD_LIST_KEY_VALUE).pos()).toString()); listOpeParms.setLeadKeyType(record.get(inputSchema.getField(FIELD_LEAD_KEY_TYPE).pos()).toString()); listOpeParms.setLeadKeyValue( new String[] { String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_VALUE).pos())) }); } else { listOpeParms.setListId((Integer) record.get(inputSchema.getField(FIELD_LIST_ID).pos())); listOpeParms.setLeadIds(new Integer[] { (Integer) record.get(inputSchema.getField(FIELD_LEAD_ID).pos()) }); } LOG.debug("[buildParameters] {}.", listOpeParms); return listOpeParms; }

Target:
public ListOperationParameters buildListOperationParameters(IndexedRecord record) { listOpeParms = new ListOperationParameters(); listOpeParms.setApiMode(api); listOpeParms.setOperation(operation.name()); listOpeParms.setStrict(dieOnError); if (use_soap_api) { listOpeParms.setListKeyType(String.valueOf(record.get(inputSchema.getField(FIELD_LIST_KEY_TYPE).pos()))); listOpeParms.setListKeyValue(String.valueOf(record.get(inputSchema.getField(FIELD_LIST_KEY_VALUE).pos()))); listOpeParms.setLeadKeyType(String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_TYPE).pos()))); listOpeParms.setLeadKeyValue( new String[] { String.valueOf(record.get(inputSchema.getField(FIELD_LEAD_KEY_VALUE).pos())) }); } else { listOpeParms.setListId((Integer) record.get(inputSchema.getField(FIELD_LIST_ID).pos())); listOpeParms.setLeadIds(new Integer[] { (Integer) record.get(inputSchema.getField(FIELD_LEAD_ID).pos()) }); } LOG.debug("[buildParameters] {}.", listOpeParms); return listOpeParms; }
Source:
public void testAppendMissingTarget() throws Throwable { try { getFileSystem().append(target).close(); } catch (Exception ex) { handleExpectedException(ex); } }

Target:
public void testAppendMissingTarget() throws Throwable { try { FSDataOutputStream out = getFileSystem().append(target); out.close(); fail("expected a failure"); } catch (Exception e) { handleExpectedException(e); } }
Source:
public static boolean verifyOozieJobStatus(OozieClient client, String processName, ENTITY_TYPE entityType, Job.Status expectedStatus) throws OozieClientException, InterruptedException { for (int seconds = 0; seconds < 20; seconds++) { Job.Status status = getOozieJobStatus(client, processName, entityType); logger.info("Current status: " + status); if (status == expectedStatus) { return true; } TimeUnit.SECONDS.sleep(5); } return false; }

Target:
public static boolean verifyOozieJobStatus(OozieClient client, String processName, ENTITY_TYPE entityType, Job.Status expectedStatus) throws OozieClientException, InterruptedException { for (int seconds = 0; seconds < 100; seconds+=5) { Job.Status status = getOozieJobStatus(client, processName, entityType); logger.info("Current status: " + status); if (status == expectedStatus) { return true; } TimeUnit.SECONDS.sleep(5); } return false; }
Source:
public ConsumerMethodModel getMethodModel(String method) { Optional<Map.Entry<Method, ConsumerMethodModel>> consumerMethodModelEntry = methodModels.entrySet().stream().filter(entry -> entry.getKey().getName().equals(method)).findFirst(); return consumerMethodModelEntry.isPresent() ? consumerMethodModelEntry.get().getValue() : null; }

Target:
public ConsumerMethodModel getMethodModel(String method) { Optional<Map.Entry<Method, ConsumerMethodModel>> consumerMethodModelEntry = methodModels.entrySet().stream().filter(entry -> entry.getKey().getName().equals(method)).findFirst(); return consumerMethodModelEntry.map(Map.Entry::getValue).orElse(null); }
Source:
public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPipedInsertBulk( String key, Map<Long, T> elements, CollectionAttributes attributesForCreate, Transcoder<T> tc) { if (elements.size() <= CollectionPipedInsert.MAX_PIPED_ITEM_COUNT) { BTreePipedInsert<T> store = new BTreePipedInsert<T>(key, elements, (attributesForCreate != null), attributesForCreate, tc); return asyncCollectionPipedInsert(key, store); } else { List<CollectionPipedInsert<T>> storeList = new ArrayList<CollectionPipedInsert<T>>(); PartitionedMap<Long, T> list = new PartitionedMap<Long, T>( elements, CollectionPipedInsert.MAX_PIPED_ITEM_COUNT); for (int i = 0; i < list.size(); i++) { storeList .add(new BTreePipedInsert<T>(key, list.get(i), (attributesForCreate != null), attributesForCreate, tc)); } return asyncCollectionPipedInsert(key, storeList); } }

Target:
public <T> CollectionFuture<Map<Integer, CollectionOperationStatus>> asyncBopPipedInsertBulk( String key, Map<Long, T> elements, CollectionAttributes attributesForCreate, Transcoder<T> tc) { if (elements.size() <= CollectionPipedInsert.MAX_PIPED_ITEM_COUNT) { BTreePipedInsert<T> insert = new BTreePipedInsert<T>(key, elements, (attributesForCreate != null), attributesForCreate, tc); return asyncCollectionPipedInsert(key, insert); } else { List<CollectionPipedInsert<T>> insertList = new ArrayList<CollectionPipedInsert<T>>(); PartitionedMap<Long, T> list = new PartitionedMap<Long, T>( elements, CollectionPipedInsert.MAX_PIPED_ITEM_COUNT); for (int i = 0; i < list.size(); i++) { insertList .add(new BTreePipedInsert<T>(key, list.get(i), (attributesForCreate != null), attributesForCreate, tc)); } return asyncCollectionPipedInsert(key, insertList); } }
Source:
public Optional<T> lazyGet() { return Optional.ofNullable(instance); }

Target:
public synchronized Optional<T> lazyGet() { return Optional.ofNullable(instance); }
Source:
public static String repeat(String s, int n) { if (n < 1) { return ""; } int len = s.length() * n; StringBuilder buf = new StringBuilder(len); for (int i = 0; i < n; i++) { buf.append(s); } return buf.toString(); }

Target:
public static String repeat(String s, int n) { if (n < 1) { return ""; } return Strings.repeat(s, n); }