auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void removeCinderDisks() { if (getParameters().isRemoveDisks()) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(getVm().getDiskMap().values()); RemoveAllVmCinderDisksParameters param = new RemoveAllVmCinderDisksParameters(getVmId(), cinderDisks); param.setParentHasTasks(!getReturnValue().getVdsmTaskIdList().isEmpty()); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveAllVmCinderDisks, withRootCommandInfo(param, getActionType()), cloneContextAndDetachFromParent()); try { failedRemoveCinderDisks = future.get().getActionReturnValue(); } catch (InterruptedException | ExecutionException e) { failedRemoveCinderDisks.addAll(cinderDisks); log.error("Exception", e); } } }

Target:
private Collection<CinderDisk> removeCinderDisks() { Collection<CinderDisk> failedRemoveCinderDisks = null; if (getParameters().isRemoveDisks()) { List<CinderDisk> cinderDisks = ImagesHandler.filterDisksBasedOnCinder(getVm().getDiskMap().values()); RemoveAllVmCinderDisksParameters param = new RemoveAllVmCinderDisksParameters(getVmId(), cinderDisks); param.setParentHasTasks(!getReturnValue().getVdsmTaskIdList().isEmpty()); Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.RemoveAllVmCinderDisks, withRootCommandInfo(param, getActionType()), cloneContextAndDetachFromParent()); try { failedRemoveCinderDisks = future.get().getActionReturnValue(); } catch (InterruptedException | ExecutionException e) { failedRemoveCinderDisks.addAll(cinderDisks); log.error("Exception", e); } } return failedRemoveCinderDisks; }
Source:
protected @Nonnull Rule initRuleId(String rUID, Rule rule) { Rule ruleWithUID = new Rule(rUID, rule.getTriggers(), rule.getConditions(), rule.getActions(), rule.getConfigurationDescriptions(), rule.getConfiguration(), rule.getTemplateUID(), rule.getVisibility()); ruleWithUID.setName(rule.getName()); ruleWithUID.setTags(rule.getTags()); ruleWithUID.setDescription(rule.getDescription()); return ruleWithUID; }

Target:
protected @NonNull Rule initRuleId(String rUID, Rule rule) { Rule ruleWithUID = new Rule(rUID, rule.getTriggers(), rule.getConditions(), rule.getActions(), rule.getConfigurationDescriptions(), rule.getConfiguration(), rule.getTemplateUID(), rule.getVisibility()); ruleWithUID.setName(rule.getName()); ruleWithUID.setTags(rule.getTags()); ruleWithUID.setDescription(rule.getDescription()); return ruleWithUID; }
Source:
public String processSubmit(@ModelAttribute("experiment") Experiment experiment, ModelMap model, SessionStatus session) throws IOException, MalformedExperimentException { try { User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName()); if (!experiment.userCanWrite(user)) { throw new SecurityException("Permission denied."); } experiment.setLastModifier(user); experimentService.saveExperiment(experiment); session.setComplete(); model.clear(); return "redirect:/miso/experiment/" + experiment.getId(); } catch (IOException ex) { if (log.isDebugEnabled()) { log.debug("Failed to save Experiment", ex); } throw ex; } }

Target:
public String processSubmit(@ModelAttribute("experiment") Experiment experiment, ModelMap model, SessionStatus session) throws IOException, MalformedExperimentException { try { User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName()); if (!experiment.userCanWrite(user)) { throw new SecurityException("Permission denied."); } experiment.setLastModifier(user); experimentService.save(experiment); session.setComplete(); model.clear(); return "redirect:/miso/experiment/" + experiment.getId(); } catch (IOException ex) { if (log.isDebugEnabled()) { log.debug("Failed to save Experiment", ex); } throw ex; } }
Source:
protected void sendDatastreamProducerRecord(DatastreamProducerRecord datastreamProducerRecord, TopicPartition srcTopicPartition, int numBytes) { _producer.send(datastreamProducerRecord, ((metadata, exception) -> { if (exception != null) { _logger.warn("Detect exception being throw from callback for src partition: while sending producer " + "record: {}, exception: ", srcTopicPartition, datastreamProducerRecord, exception); rewindAndPauseTopicPartitionWhenException(srcTopicPartition, exception); } _consumerMetrics.updateBytesProcessedRate(numBytes); })); }

Target:
protected void sendDatastreamProducerRecord(DatastreamProducerRecord datastreamProducerRecord, TopicPartition srcTopicPartition, int numBytes) { _producer.send(datastreamProducerRecord, ((metadata, exception) -> { if (exception != null) { _logger.warn("Detect exception being throw from callback for src partition: while sending producer " + "record: {}, exception: ", srcTopicPartition, datastreamProducerRecord, exception); rewindAndPausePartitionOnException(srcTopicPartition, exception); } else { _consumerMetrics.updateBytesProcessedRate(numBytes); } })); }
Source:
public void init() throws FalconException { if (SecurityUtil.isSecurityEnabled()) { LOG.info("Falcon Kerberos Authentication Enabled!"); initializeKerberos(); String authTokenValidity = StartupProperties.get().getProperty(AUTH_TOKEN_VALIDITY_SECONDS); long validateFrequency; try { validateFrequency = (StringUtils.isNotEmpty(authTokenValidity)) ? (Long.parseLong(authTokenValidity) - 100) : 86300; if (validateFrequency < 0) { throw new NumberFormatException("Value provided for startup property \"" + AUTH_TOKEN_VALIDITY_SECONDS + "\" is too small."); } } catch (NumberFormatException nfe) { throw new FalconException("Invalid value provided for startup property \"" + AUTH_TOKEN_VALIDITY_SECONDS + "\", please provide a valid long number", nfe); } timer.schedule(new TokenValidationThread(), 0, validateFrequency*1000); } else { LOG.info("Falcon Simple Authentication Enabled!"); Configuration ugiConf = new Configuration(); ugiConf.set("hadoop.security.authentication", "simple"); UserGroupInformation.setConfiguration(ugiConf); } }

Target:
public void init() throws FalconException { if (SecurityUtil.isSecurityEnabled()) { LOG.info("Falcon Kerberos Authentication Enabled!"); initializeKerberos(); String authTokenValidity = StartupProperties.get().getProperty(AUTH_TOKEN_VALIDITY_SECONDS); long validateFrequency; try { validateFrequency = (StringUtils.isNotEmpty(authTokenValidity)) ? (Long.parseLong(authTokenValidity) - 100) : DEFAULT_VALIDATE_FREQUENCY_SECS; if (validateFrequency < 0) { throw new NumberFormatException("Value provided for startup property \"" + AUTH_TOKEN_VALIDITY_SECONDS + "\" should be greater than 100."); } } catch (NumberFormatException nfe) { throw new FalconException("Invalid value provided for startup property \"" + AUTH_TOKEN_VALIDITY_SECONDS + "\", please provide a valid long number", nfe); } timer.schedule(new TokenValidationThread(), 0, validateFrequency*1000); } else { LOG.info("Falcon Simple Authentication Enabled!"); Configuration ugiConf = new Configuration(); ugiConf.set("hadoop.security.authentication", "simple"); UserGroupInformation.setConfiguration(ugiConf); } }
Source:
private static Schema generateSchema() { Schema schema = new Schema("TargetedSweep", TargetedSweepSchema.class.getPackage().getName() + ".generated", NAMESPACE, OptionalType.JAVA8); schema.addTableDefinition("sweepableCells", new TableDefinition() {{ javaTableName("SweepableCells"); allSafeForLoggingByDefault(); rowName(); hashFirstRowComponent(); rowComponent("timestamp_partition", ValueType.VAR_LONG); rowComponent("metadata", ValueType.BLOB); dynamicColumns(); columnComponent("timestamp_modulus", ValueType.VAR_LONG); columnComponent("write_index", ValueType.VAR_LONG); value(ValueType.STRING); sweepStrategy(TableMetadataPersistence.SweepStrategy.NOTHING); conflictHandler(ConflictHandler.IGNORE_ALL); }}); schema.addTableDefinition("sweepableTimestamps", new TableDefinition() {{ javaTableName("SweepableTimestamps"); allSafeForLoggingByDefault(); rowName(); hashFirstRowComponent(); rowComponent("shard", ValueType.VAR_LONG); rowComponent("timestamp_partition", ValueType.VAR_LONG); rowComponent("sweep_mode", ValueType.STRING); columns(); column("timestamp_modulus", "ts_mod", ValueType.VAR_LONG); sweepStrategy(TableMetadataPersistence.SweepStrategy.NOTHING); conflictHandler(ConflictHandler.IGNORE_ALL); }}); schema.validate(); return schema; }

Target:
private static Schema generateSchema() { Schema schema = new Schema("TargetedSweep", TargetedSweepSchema.class.getPackage().getName() + ".generated", NAMESPACE, OptionalType.JAVA8); schema.addTableDefinition("sweepableCells", new TableDefinition() {{ javaTableName("SweepableCells"); allSafeForLoggingByDefault(); rowName(); hashFirstRowComponent(); rowComponent("timestamp_partition", ValueType.VAR_LONG); rowComponent("metadata", ValueType.BLOB); dynamicColumns(); columnComponent("timestamp_modulus", ValueType.VAR_LONG); columnComponent("write_index", ValueType.VAR_LONG); value(TableReferenceAndCell.class); sweepStrategy(TableMetadataPersistence.SweepStrategy.NOTHING); conflictHandler(ConflictHandler.IGNORE_ALL); }}); schema.addTableDefinition("sweepableTimestamps", new TableDefinition() {{ javaTableName("SweepableTimestamps"); allSafeForLoggingByDefault(); rowName(); hashFirstRowComponent(); rowComponent("shard", ValueType.VAR_LONG); rowComponent("timestamp_partition", ValueType.VAR_LONG); rowComponent("sweep_mode", ValueType.STRING); columns(); column("timestamp_modulus", "ts_mod", ValueType.VAR_LONG); sweepStrategy(TableMetadataPersistence.SweepStrategy.NOTHING); conflictHandler(ConflictHandler.IGNORE_ALL); }}); schema.validate(); return schema; }
Source:
private void assembleDatapointName(Long surveyId, Long surveyedLocaleId) { final SurveyedLocaleDao slDao = new SurveyedLocaleDao(); final SurveyInstanceDAO siDao = new SurveyInstanceDAO(); final QuestionDao qDao = new QuestionDao(); final QuestionAnswerStoreDao qasDao = new QuestionAnswerStoreDao(); List<SurveyedLocale> locales = null; if (surveyedLocaleId != null) { locales = new ArrayList<>(); locales.add(slDao.getById(surveyedLocaleId)); } else { locales = slDao.listLocalesByCreationSurvey(surveyId, Constants.ALL_RESULTS, null); } List<Question> nameQuestions = qDao.listDisplayNameQuestionsBySurveyId(surveyId); SurveyInstance si; for (SurveyedLocale sl : locales) { try { si = siDao.getRegistrationSurveyInstance(sl); if (si == null) { log.log(Level.WARNING, "Null registartion SurveyInstance for locale: " + sl.getKey().getId()); continue; } List<QuestionAnswerStore> responses = qasDao.listBySurveyInstance(si.getKey().getId()); sl.assembleDisplayName(nameQuestions, responses); log.info("Reassembled display name for SurveyedLocale : " + sl.getKey().getId() + ": " + sl.getDisplayName()); slDao.save(sl); } catch (Exception e) { log.log(Level.SEVERE, "Problem while assembling datapoint name: " + e.getMessage(), e); } } }

Target:
private void assembleDatapointName(Long surveyId, Long surveyedLocaleId) { final SurveyedLocaleDao slDao = new SurveyedLocaleDao(); final SurveyInstanceDAO siDao = new SurveyInstanceDAO(); final QuestionDao qDao = new QuestionDao(); final QuestionAnswerStoreDao qasDao = new QuestionAnswerStoreDao(); List<SurveyedLocale> locales = null; if (surveyedLocaleId != null) { locales = new ArrayList<>(); locales.add(slDao.getById(surveyedLocaleId)); } else { locales = slDao.listLocalesByCreationSurvey(surveyId, Constants.ALL_RESULTS, null); } List<Question> nameQuestions = qDao.listDisplayNameQuestionsBySurveyId(surveyId); for (SurveyedLocale sl : locales) { try { SurveyInstance si = siDao.getRegistrationSurveyInstance(sl); if (si == null) { log.log(Level.WARNING, "Null registartion SurveyInstance for locale: " + sl.getKey().getId()); continue; } List<QuestionAnswerStore> responses = qasDao.listBySurveyInstance(si.getKey().getId()); sl.assembleDisplayName(nameQuestions, responses); log.info("Reassembled display name for SurveyedLocale : " + sl.getKey().getId() + ": " + sl.getDisplayName()); slDao.save(sl); } catch (Exception e) { log.log(Level.SEVERE, "Problem while assembling datapoint name: " + e.getMessage(), e); } } }
Source:
private void changeKeyStorePassword() { String password = this.options.getSslKeystorePassword(); char[] oldPassword = this.cryptoService.getKeyStorePassword(this.options.getSslKeyStore()); char[] newPassword = oldPassword; if (password != null) { try { newPassword = this.cryptoService.decryptAes(password.toCharArray()); } catch (KuraException e) { logger.warn("Failed to decrypt keystore password"); } } if (oldPassword != null && !Arrays.equals(oldPassword, newPassword)) { try { if (isKeyStoreAccessible(this.options.getSslKeyStore(), oldPassword)) { changeKeyStorePassword(this.options.getSslKeyStore(), oldPassword, newPassword); } else if (isKeyStoreAccessible(this.options.getSslKeyStore(), newPassword)) { changeKeyStorePassword(this.options.getSslKeyStore(), newPassword, newPassword); } else { throw new KeyStoreException("Keystore not accessible!"); } this.cryptoService.setKeyStorePassword(this.options.getSslKeyStore(), newPassword); } catch (Exception e) { logger.warn("Failed to change keystore password", e); } } }

Target:
private void changeKeyStorePassword() { String password = this.options.getSslKeystorePassword(); char[] oldPassword = this.cryptoService.getKeyStorePassword(this.options.getSslKeyStore()); char[] newPassword = oldPassword; if (password != null) { try { newPassword = this.cryptoService.decryptAes(password.toCharArray()); } catch (KuraException e) { logger.warn("Failed to decrypt keystore password"); } } if (oldPassword != null && newPassword != null && !Arrays.equals(oldPassword, newPassword)) { try { if (isKeyStoreAccessible(this.options.getSslKeyStore(), oldPassword)) { changeKeyStorePassword(this.options.getSslKeyStore(), oldPassword, newPassword); } else if (isKeyStoreAccessible(this.options.getSslKeyStore(), newPassword)) { changeKeyStorePassword(this.options.getSslKeyStore(), newPassword, newPassword); } else { throw new KeyStoreException("Keystore not accessible!"); } this.cryptoService.setKeyStorePassword(this.options.getSslKeyStore(), newPassword); } catch (Exception e) { logger.warn("Failed to change keystore password", e); } } }
Source:
void load(InputStream is) { if (is != null) { for (Object map : yaml.loadAll(is)) { loadMap((Map<String, Object>)map, null); } try { is.close(); } catch (IOException ioe) { } } }

Target:
void load(InputStream is) { if (is != null) { for (Object map : yaml.loadAll(is)) { loadMap((Map<String, Object>)map, null); } } }
Source:
public boolean evalConfigSteps(Map<String, DataProvider> dataProviders) throws TaskHandlerException { LOGGER.info("Executing all config steps for task: {}", taskContext.getTask().getName()); Iterator<TaskConfigStep> iterator = taskContext.getTask().getTaskConfig().getSteps().iterator(); boolean result = true; TaskFilterExecutor taskFilterExecutor = new TaskFilterExecutor(); while (result && iterator.hasNext()) { TaskConfigStep step = iterator.next(); if (step instanceof DataSource) { DataSource ds = (DataSource) step; taskContext.addDataSourceObject(ds.getObjectId().toString(), getDataSourceObject(ds, dataProviders), ds.isFailIfDataNotFound()); LOGGER.info("Task data source: for task: added", ds.getName(), taskContext.getTask().getName()); } else if (step instanceof FilterSet && ((FilterSet) step).getActionOrder() == null) { try { FilterSet filterSet = (FilterSet) step; result = taskFilterExecutor.checkFilters(filterSet.getFilters(), filterSet.getOperator(), taskContext); } catch (RuntimeException e) { throw new TaskHandlerException(FILTER, "task.error.filterError", e); } } } return result; }

Target:
public boolean evalConfigSteps(Map<String, DataProvider> dataProviders) throws TaskHandlerException { LOGGER.info("Executing all config steps for task: {}", taskContext.getTask().getName()); Iterator<TaskConfigStep> iterator = taskContext.getTask().getTaskConfig().getSteps().iterator(); boolean result = true; TaskFilterExecutor taskFilterExecutor = new TaskFilterExecutor(); while (result && iterator.hasNext()) { TaskConfigStep step = iterator.next(); if (step instanceof DataSource) { DataSource ds = (DataSource) step; taskContext.addDataSourceObject(ds.getObjectId().toString(), getDataSourceObject(ds, dataProviders), ds.isFailIfDataNotFound()); LOGGER.info("Task data source: for task: added", ds.getName(), taskContext.getTask().getName()); } else if (step instanceof FilterSet && !isActionFilter((FilterSet) step)) { try { FilterSet filterSet = (FilterSet) step; result = taskFilterExecutor.checkFilters(filterSet.getFilters(), filterSet.getOperator(), taskContext); } catch (RuntimeException e) { throw new TaskHandlerException(FILTER, "task.error.filterError", e); } } } return result; }
Source:
private static Predicate<Field> isContainer() { return field -> { boolean isStartable = Startable.class.isAssignableFrom(field.getType()); if (!isStartable) { throw new ExtensionConfigurationException("Annotation is only supported for Startable types"); } return AnnotationSupport.isAnnotated(field, Container.class); }; }

Target:
private static Predicate<Field> isContainer() { return field -> { boolean isAnnotatedWithContainer = AnnotationSupport.isAnnotated(field, Container.class); if (isAnnotatedWithContainer) { boolean isStartable = Startable.class.isAssignableFrom(field.getType()); if (!isStartable) { throw new ExtensionConfigurationException("Annotation is only supported for Startable types"); } return true; } return false; }; }
Source:
public void undeploy(DeploymentUnit unit, Function<DeploymentUnit, Boolean> beforeUndeploy) { Function<DeploymentUnit, Boolean> predicate = Optional.ofNullable(beforeUndeploy).orElse(PreUndeployOperations.checkActiveProcessInstances(runtimeDataService)); if (Boolean.TRUE.equals(predicate.apply(unit))) { synchronized (this) { DeployedUnit deployed = deploymentsMap.remove(unit.getIdentifier()); if (deployed != null) { RuntimeManager manager = deployed.getRuntimeManager(); ((AbstractRuntimeManager) manager).close(true); } notifyOnUnDeploy(unit, deployed); } } else { logger.warn("Couldn't undeploy unit '{}'", unit.getIdentifier()); throw new IllegalStateException("Couldn't undeploy unit '" + unit.getIdentifier() + "'"); } }

Target:
public void undeploy(DeploymentUnit unit, Function<DeploymentUnit, Boolean> beforeUndeploy) { Function<DeploymentUnit, Boolean> beforeUpdate = Optional.ofNullable(beforeUndeploy).orElse(PreUndeployOperations.checkActiveProcessInstances(runtimeDataService)); if (Boolean.TRUE.equals(beforeUpdate.apply(unit))) { synchronized (this) { DeployedUnit deployed = deploymentsMap.remove(unit.getIdentifier()); if (deployed != null) { RuntimeManager manager = deployed.getRuntimeManager(); ((AbstractRuntimeManager) manager).close(true); } notifyOnUnDeploy(unit, deployed); } } else { logger.warn("Couldn't undeploy unit '{}'", unit.getIdentifier()); throw new IllegalStateException("Couldn't undeploy unit '" + unit.getIdentifier() + "'"); } }
Source:
public void constructorAmqpValidValues() { final List<BinaryData> listBinaryData = Collections.singletonList(DATA_BYTES); final AmqpDataBody amqpDataBody = new AmqpDataBody(listBinaryData); AmqpAnnotatedMessage expected = new AmqpAnnotatedMessage(amqpDataBody); AmqpAnnotatedMessage actual = new AmqpAnnotatedMessage(expected); assertMessageCreation(actual, AmqpBodyType.DATA, listBinaryData.size()); }

Target:
public void constructorAmqpValidValues() { final List<BinaryData> expectedBinaryData = Collections.singletonList(DATA_BYTES); final AmqpDataBody amqpDataBody = new AmqpDataBody(expectedBinaryData); final AmqpAnnotatedMessage expected = new AmqpAnnotatedMessage(amqpDataBody); final AmqpAnnotatedMessage actual = new AmqpAnnotatedMessage(expected); assertMessageCreation(AmqpBodyType.DATA, expectedBinaryData.size(), actual); }
Source:
public void testOnSelectionChanged() { final DataObject do1 = mock(DataObject.class); final DataObject do2 = mock(DataObject.class); final DataObject do3 = mock(DataObject.class); final TreeListItem treeListItem1 = mock(TreeListItem.class); final TreeListItem treeListItem2 = mock(TreeListItem.class); final TreeListItem treeListItem3 = mock(TreeListItem.class); when(treeListItem1.getDataSource()).thenReturn(do1); when(treeListItem2.getDataSource()).thenReturn(do2); when(treeListItem3.getDataSource()).thenReturn(do3); view.onSelectionChanged(Arrays.asList(treeListItem1, treeListItem2, treeListItem3)); verify(presenter).onDataObjectSelectionChanged(dataObjectsCaptor.capture()); final List<DataObject> values = dataObjectsCaptor.getValue(); assertEquals(3, values.size()); assertTrue(values.contains(do1)); assertTrue(values.contains(do2)); assertTrue(values.contains(do3)); }

Target:
public void testOnSelectionChanged() { final DataObject do1 = mock(DataObject.class); final DataObject do2 = mock(DataObject.class); final DataObject do3 = mock(DataObject.class); final TreeListItem treeListItem1 = mock(TreeListItem.class); final TreeListItem treeListItem2 = mock(TreeListItem.class); final TreeListItem treeListItem3 = mock(TreeListItem.class); when(treeListItem1.getDataSource()).thenReturn(do1); when(treeListItem2.getDataSource()).thenReturn(do2); when(treeListItem3.getDataSource()).thenReturn(do3); view.onSelectionChanged(Arrays.asList(treeListItem1, treeListItem2, treeListItem3)); verify(presenter).onDataObjectSelectionChanged(dataObjectsCaptor.capture()); final List<DataObject> values = dataObjectsCaptor.getValue(); assertEquals(3, values.size()); assertThat(values).containsExactly(do1, do2, do3); }
Source:
protected IStatus validateItem(Object item) { for (int i = 0; i < fdisabledModels.length; i++) { if (((IPluginModelBase) item).equals(fdisabledModels[i])) { return new Status(IStatus.CANCEL, IPDEUIConstants.PLUGIN_ID, 0, "", null); } } return new Status(IStatus.OK, IPDEUIConstants.PLUGIN_ID, 0, "", null); }

Target:
protected IStatus validateItem(Object item) { if (fdisabledModels != null && fdisabledModels.contains(item)) { return new Status(IStatus.CANCEL, IPDEUIConstants.PLUGIN_ID, 0, "", null); } return new Status(IStatus.OK, IPDEUIConstants.PLUGIN_ID, 0, "", null); }
Source:
public SpongeTameableData setOwner(@Nullable UUID owner){ this.owner = new UUID(owner.getMostSignificantBits(), owner.getLeastSignificantBits()); return this; }

Target:
public SpongeTameableData setOwner(@Nullable UUID owner){ this.owner = owner; return this; }
Source:
public GetPartitionsResponse getPartitionsByAlgebra(RpcController controller, PartitionsByAlgebraProto request) throws ServiceException { String dbName = request.getDatabaseName(); String tbName = request.getTableName(); try { if (linkedMetadataManager.existsDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } if (metaDictionary.isSystemDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } rlock.lock(); try { GetPartitionsResponse.Builder builder = GetPartitionsResponse.newBuilder(); List<PartitionDescProto> partitions = store.getPartitionsByAlgebra(request); builder.addAllPartition(partitions); builder.setState(OK); return builder.build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } }

Target:
public GetPartitionsResponse getPartitionsByAlgebra(RpcController controller, PartitionsByAlgebraProto request) throws ServiceException { String dbName = request.getDatabaseName(); String tbName = request.getTableName(); if (linkedMetadataManager.existsDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } if (metaDictionary.isSystemDatabase(dbName)) { return GetPartitionsResponse.newBuilder().setState(errUndefinedPartitionMethod(tbName)).build(); } else { rlock.lock(); try { GetPartitionsResponse.Builder builder = GetPartitionsResponse.newBuilder(); List<PartitionDescProto> partitions = store.getPartitionsByAlgebra(request); builder.addAllPartition(partitions); builder.setState(OK); return builder.build(); } catch (Throwable t) { printStackTraceIfError(LOG, t); return GetPartitionsResponse.newBuilder() .setState(returnError(t)) .build(); } finally { rlock.unlock(); } } }
Source:
public PotionEffect getPotionEffect() { return super.getPotionEffect; }

Target:
public PotionEffect getPotionEffect() { return super.getPotionEffect(); }
Source:
public Object convertToRequestFormat(Object o, MediaType contentType) { return encoderRegistry.convert(o, contentType, requestMediaType); }

Target:
public Object convertToRequestFormat(Object o, MediaType contentType) { if (o == null) return null; if (requestMediaType == null) return fromStorage(o); Transcoder transcoder = encoderRegistry.getTranscoder(contentType, requestMediaType); return transcoder.transcode(o, contentType, requestMediaType); }
Source:
private String modifybasename(String name) { if(name.equalsIgnoreCase("children")) return "child"; Map<String, String> map = Stream.of( new AbstractMap.SimpleImmutableEntry<>("Entries", "Entry"), new AbstractMap.SimpleImmutableEntry<>("Taxes", "Tax")) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for(String suffix : map.keySet()) { if(name.endsWith(suffix)) { String firstpart=name.substring(0,name.length()-suffix.length()); return firstpart+map.get(suffix); } } if(name.length()>2 && name.endsWith("s")) return name.substring(0,name.length()-1); return FOR_LOOP_ELEMENT_IDENTIFIER; }

Target:
private String modifybasename(String name) { if(name.equalsIgnoreCase("children")) return "child"; for(String suffix : irregNouns.keySet()) { if(name.endsWith(suffix)) { String firstpart=name.substring(0,name.length()-suffix.length()); return firstpart+irregNouns.get(suffix); } } if(name.length()>2 && name.endsWith("s")) return name.substring(0,name.length()-1); return FOR_LOOP_ELEMENT_IDENTIFIER; }
Source:
public void setUp() throws Exception { System.out.println(" => [" + testName.getMethodName() + "] " + getClass().getSimpleName() + ".setUp()"); voltron.getClusterControl().waitForActive(); voltron.getClusterControl().waitForRunningPassivesInStandby(); commonSetUp(voltron); nmsService.readMessages(); while (nmsService.readTopology() .serverStream() .filter(server -> !server.isActive()) .flatMap(Server::serverEntityStream) .filter(AbstractManageableNode::isManageable) .count() != 3) { Thread.sleep(1_000); } }

Target:
public void setUp() throws Exception { System.out.println(" => [" + testName.getMethodName() + "] " + getClass().getSimpleName() + ".setUp()"); voltron.getClusterControl().waitForActive(); voltron.getClusterControl().waitForRunningPassivesInStandby(); commonSetUp(voltron); nmsService.readMessages(); while (!Thread.currentThread().isInterrupted() && nmsService.readTopology() .serverStream() .filter(server -> !server.isActive()) .flatMap(Server::serverEntityStream) .filter(AbstractManageableNode::isManageable) .count() != 3) { Thread.sleep(1_000); } }
Source:
private void logHadoopDistro() { String hadoopDistroOption = environment.resolvePlaceholders(HADOOP_DISTRO_OPTION); String hadoopDistro = (hadoopDistroOption.equals(HADOOP_DISTRO_OPTION)) ? HadoopDistro.hadoop12.toString() : hadoopDistroOption; logger.info("Hadoop distro config: " + hadoopDistro); logger.info("Hadoop version: " + org.apache.hadoop.util.VersionInfo.getVersion()); }

Target:
private void logHadoopDistro() { String hadoopDistro = environment.resolvePlaceholders(HADOOP_DISTRO_OPTION); logger.info("Hadoop distro config (--hadoopDistro) used: " + hadoopDistro); String hdpVersionFromCP = org.apache.hadoop.util.VersionInfo.getVersion(); Map<HadoopDistro, String> hadoopVersionsMap = ContainerOptions.getHadoopDistroVersions(); if (!hdpVersionFromCP.contains(hadoopVersionsMap.get(HadoopDistro.valueOf(hadoopDistro)))) { for (HadoopDistro key : hadoopVersionsMap.keySet()) { if (hdpVersionFromCP.contains(hadoopVersionsMap.get(key))) { logger.error("Hadoop version detected from classpath : " + hdpVersionFromCP + " but you provided --hadoopDistro " + hadoopDistro + ". Did you mean? --hadoopDistro " + key.toString()); } } } else { logger.info("Hadoop version detected from classpath: " + hdpVersionFromCP); } }
Source:
public void create() { this.applicationComponent = DaggerSolApplicationComponent.builder() .audioModule(new AudioModule()) .inputModule(new InputModule()) .moduleManagerModule(new ModuleManagerModule()) .optionsModule(new OptionsModule(null )) .build(); Assets.initialize(applicationComponent.moduleEnviroment()); applicationComponent.inject(this); if (Gdx.app.getType() == Application.ApplicationType.Android || Gdx.app.getType() == Application.ApplicationType.iOS) { DebugOptions.read(null); } context = new ContextImpl(); context.put(SolApplication.class, this); logger.info("\n\n ------------------------------------------------------------ \n"); moduleManager.printAvailableModules(); worldConfig = new WorldConfig(); musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, options); this.menuScreens = applicationComponent.menuScreens(); inputManager.setScreen(this, menuScreens.main); }

Target:
public void create() { resizeSubscribers = new HashSet<>(); displayDimensions = new DisplayDimensions(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Context context = new ContextImpl(); context.put(SolApplication.class, this); this.applicationComponent = DaggerSolApplicationComponent.builder() .appModule(new AppModule(this,context,null)) .build(); Assets.initialize(applicationComponent.moduleEnviroment()); applicationComponent.inject(this); boolean isMobile = Gdx.app.getType() == Application.ApplicationType.Android || Gdx.app.getType() == Application.ApplicationType.iOS; if (isMobile) { DebugOptions.read(null); } logger.info("\n\n ------------------------------------------------------------ \n"); moduleManager.printAvailableModules(); musicManager.playMusic(OggMusicManager.MENU_MUSIC_SET, options); inputManager.setScreen(this, applicationComponent.menuScreens().main); }
Source:
public static void assertMetricsEqual(final MetricSet metricSet, final Map<String, Number> assertions) { assertions.forEach((name, value) -> { final long expected = value.longValue(); final long actual = extractLong(metricSet, name); Assert.assertEquals(String.format("%s assertion failed", name), expected, actual); }); }

Target:
public static void assertMetricsEqual(final MetricSet metricSet, final Map<String, Number> assertions) throws AssertionError { assertions.forEach((name, value) -> { final long expected = value.longValue(); final long actual = extractLong(metricSet, name); if (expected != actual) { throw new AssertionError( String.format("%s assertion failed; expected %d != actual %d", name, expected, actual)); } }); }
Source:
public static void generatePemPublicKey(ByteStringBuilder target, PublicKey publicKey) { Assert.checkNotNullParam("target", target); Assert.checkNotNullParam("publicKey", publicKey); generatePemContent(target, "PUBLIC KEY", ByteIterator.ofBytes(publicKey.getEncoded())); }

Target:
public static void generatePemPublicKey(ByteStringBuilder target, PublicKey publicKey) { Assert.checkNotNullParam("target", target); Assert.checkNotNullParam("publicKey", publicKey); try { KeyFactory instance = KeyFactory.getInstance(publicKey.getAlgorithm()); X509EncodedKeySpec keySpec = instance.getKeySpec(publicKey, X509EncodedKeySpec.class); generatePemContent(target, PUBLIC_KEY_FORMAT, ByteIterator.ofBytes(keySpec.getEncoded())); } catch (Exception e) { throw log.publicKeyParseError(e); } }
Source:
public void dispose() { cm.unregisterForCallStateChanged(this); cm.unregisterForOn(this); cm.unregisterForNotAvailable(this); this.removeCallbacksAndMessages(null); for(GsmConnection c : connections) { if(c != null) { c.dispose(); c = null; } else { continue; } } this.phone = null; }

Target:
public void dispose() { cm.unregisterForCallStateChanged(this); cm.unregisterForOn(this); cm.unregisterForNotAvailable(this); for(GsmConnection c : connections) { try { if(c != null) hangup(c); } catch (CallStateException ex) { Log.e(LOG_TAG, "unexpected error on hangup during dispose"); } } try { if(pendingMO != null) hangup(pendingMO); } catch (CallStateException ex) { Log.e(LOG_TAG, "unexpected error on hangup during dispose"); } clearDisconnected(); }
Source:
public void testGetAutoStack() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders( new MockResponse().setResponseCode(200).setBody(stringFromResource("/stack_get_response.json")))); try { HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides); StackApi api = heatApi.getStackApi("RegionOne"); Stack stack = api.get("simple_stack", "3095aefc-09fb-4bc7-b1f0-f21a304e864c"); System.out.println(stack); Method[] methods = stack.getClass().getDeclaredMethods(); for (Method m : methods) { System.out.println(m.getName()); } assertThat(server.getRequestCount()).isEqualTo(2); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", BASE_URI + "/stacks/simple_stack/3095aefc-09fb-4bc7-b1f0-f21a304e864c"); assertThat(stack).isNotNull(); } finally { server.shutdown(); } }

Target:
public void testGetAutoStack() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders( new MockResponse().setResponseCode(200).setBody(stringFromResource("/stack_get_response.json")))); try { HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides); StackApi api = heatApi.getStackApi("RegionOne"); Stack stack = api.get("simple_stack", "3095aefc-09fb-4bc7-b1f0-f21a304e864c"); assertThat(server.getRequestCount()).isEqualTo(2); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", BASE_URI + "/stacks/simple_stack/3095aefc-09fb-4bc7-b1f0-f21a304e864c"); assertThat(stack).isNotNull(); } finally { server.shutdown(); } }
Source:
public void execute(MapActivity activity) { switch (activity.getMyApplication().getSettings().DAYNIGHT_MODE.get()){ case DAY: { activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.NIGHT); break; } case NIGHT: case AUTO: case SENSOR: { activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.DAY); break; } } }

Target:
public void execute(MapActivity activity) { if (activity.getMyApplication().getDaynightHelper().isNightMode()) { activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.DAY); } else { activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.NIGHT); } }
Source:
public int getGroupedColumnCount() { int result = 0; for (IColumn<?> c : getSortColumns()) { if (c.isGroupingActive()) { result++; } } return result; }

Target:
public int getGroupedColumnCount() { return getGroupedColumns().size(); }
Source:
public boolean equalValues(QosBase other) { return true; }

Target:
public boolean equalValues(QosBase other) { return false; }
Source:
void columnValues() { ColumnName columnName = archived.columnName(); Object value = false; Map<ColumnName, Object> columnsExpected = singletonMap(columnName, value); EntityRecordWithColumns<?> record = EntityRecordWithColumns.of(sampleEntityRecord(), columnsExpected); ImmutableSet<ColumnName> columnNames = record.columnNames(); assertThat(columnNames).hasSize(1); assertTrue(columnNames.contains(columnName)); assertEquals(value, record.columnValue(columnName)); }

Target:
void columnValues() { ColumnName columnName = archived.columnName(); Object value = false; Map<ColumnName, Object> columnsExpected = singletonMap(columnName, value); EntityRecordWithColumns<?> record = EntityRecordWithColumns.of(sampleEntityRecord(), columnsExpected); ImmutableSet<ColumnName> columnNames = record.columnNames(); assertThat(columnNames).hasSize(1); assertTrue(columnNames.contains(columnName)); assertThat(value).isEqualTo(record.columnValue(columnName)); }
Source:
public boolean sendSerialData(XBee16BitAddress address, byte[] data) throws InterfaceNotOpenException, InvalidOperatingModeException, TimeoutException, IOException { if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); XBeePacket xbeePacket; XBeePacket receivedPacket; if (address == null || data == null) throw new NullPointerException("Address and data cannot be null"); logger.info("Sending data to >> {}.", address, HexUtils.byteArrayToHexString(data)); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX16Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TXStatusPacket) { switch (((TXStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; default: xbeePacket = new TransmitPacket(getNextFrameID(), XBee64BitAddress.UNKNOWN_ADDRESS, address, 0, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TransmitStatusPacket) { switch (((TransmitStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; } }

Target:
public boolean sendSerialData(XBee16BitAddress address, byte[] data) throws InterfaceNotOpenException, InvalidOperatingModeException, TimeoutException, IOException { if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); if (address == null) throw new NullPointerException("Address cannot be null"); if (data == null) throw new NullPointerException("Data cannot be null"); XBeePacket xbeePacket; XBeePacket receivedPacket; logger.info(toString() + "Sending serial data to >> {}.", address, HexUtils.byteArrayToHexString(data)); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX16Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TXStatusPacket) { switch (((TXStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; default: xbeePacket = new TransmitPacket(getNextFrameID(), XBee64BitAddress.UNKNOWN_ADDRESS, address, 0, XBeeTransmitOptions.NONE, data); receivedPacket = sendXBeePacket(xbeePacket); if (receivedPacket == null) return true; if (receivedPacket instanceof TransmitStatusPacket) { switch (((TransmitStatusPacket)receivedPacket).getTransmitStatus()) { case SUCCESS: return true; default: return false; } } else return false; } }
Source:
public PageCache getPageCache(final long pageId) { try { if (pageId > pagingStore.getCurrentWritingPage()) { return null; } boolean createPage = false; CompletableFuture<PageCache> inProgressReadPage; PageCache cache; Page page = null; synchronized (softCache) { cache = softCache.get(pageId); if (cache != null) { return cache; } if (!pagingStore.checkPageFileExists((int) pageId)) { return null; } inProgressReadPage = inProgressReadPages.get(pageId); if (inProgressReadPage == null) { final CompletableFuture<PageCache> readPage = new CompletableFuture<>(); cache = createPageCache(pageId); page = pagingStore.createPage((int) pageId); createPage = true; inProgressReadPage = readPage; inProgressReadPages.put(pageId, readPage); } } if (createPage) { return readPage(pageId, page, cache, inProgressReadPage); } else { return inProgressReadPage.get(10, TimeUnit.SECONDS); } } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }

Target:
public PageCache getPageCache(final long pageId) { try { PageCache cache; synchronized (softCache) { if (pageId > pagingStore.getCurrentWritingPage()) { return null; } cache = softCache.get(pageId); if (cache == null) { if (!pagingStore.checkPageFileExists((int) pageId)) { return null; } cache = createPageCache(pageId); logger.tracef("adding pageCache pageNr=%d into cursor = %s", pageId, this.pagingStore.getAddress()); readPage((int) pageId, cache); softCache.put(pageId, cache); } } return cache; } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
private void checkLinesIndent(DetailAstSet astSet, IndentLevel indentLevel, boolean firstLineMatches, int firstLine, boolean allowNesting) { if (!astSet.isEmpty()) { final DetailAST startLine = astSet.firstLine(); final int endLine = astSet.lastLine(); int startCol = expandedTabsColumnNo(astSet.firstLine()); final int realStartCol = getLineStart(indentCheck.getLine(startLine.getLineNo() - 1)); if (firstLineMatches && !allowNesting) { startCol = realStartCol; } if (realStartCol == startCol) { checkLineIndent(startLine, indentLevel, firstLineMatches); } IndentLevel theLevel = indentLevel; if (firstLineMatches || firstLine > mainAst.getLineNo() && shouldIncreaseIndent()) { theLevel = new IndentLevel(indentLevel, getBasicOffset()); } for (int i = startLine.getLineNo() + 1; i <= endLine; i++) { final Integer col = astSet.getStartColumn(i); if (col != null) { checkLineIndent(astSet.getAst(i), theLevel, false); } } } }

Target:
private void checkLinesIndent(DetailAstSet astSet, IndentLevel indentLevel, boolean firstLineMatches, int firstLine, boolean allowNesting) { if (!astSet.isEmpty()) { final DetailAST startLineAst = astSet.firstLine(); final int endLine = astSet.lastLine(); int startCol = expandedTabsColumnNo(astSet.firstLine()); final int realStartCol = getLineStart(indentCheck.getLine(startLineAst.getLineNo() - 1)); if (firstLineMatches && !allowNesting) { startCol = realStartCol; } if (realStartCol == startCol) { checkLineIndent(startLineAst, indentLevel, firstLineMatches); } IndentLevel theLevel = indentLevel; if (firstLineMatches || firstLine > mainAst.getLineNo() && shouldIncreaseIndent()) { theLevel = new IndentLevel(indentLevel, getBasicOffset()); } for (int i = startLineAst.getLineNo() + 1; i <= endLine; i++) { final Integer col = astSet.getStartColumn(i); if (col != null) { checkLineIndent(astSet.getAst(i), theLevel, false); } } } }
Source:
private CacheEventFilter<Object, String> filter(Object keyToFilter) { return (Serializable & CacheEventFilter<Object, String>) (k, oldValue, oldMetadata, newValue, newMetadata, eventType) -> { boolean retVal = Objects.equals(k, keyToFilter); return retVal; }; }

Target:
private CacheEventFilter<Object, String> filter(Object keyToFilter) { return (Serializable & CacheEventFilter<Object, String>) (k, oldValue, oldMetadata, newValue, newMetadata, eventType) -> Objects.equals(k, keyToFilter); }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression childExpr = children.get(0); PDataType dataType = childExpr.getDataType(); if (childExpr.evaluate(tuple, ptr)) { byte[] retBytes; if (dataType instanceof PWholeNumber) { PWholeNumber wholeNumber = (PWholeNumber) dataType; int ret = wholeNumber.signum(ptr, childExpr.getSortOrder()); retBytes = wholeNumber.getInstance().toBytes(Integer.valueOf(ret)); } else { PRealNumber realNumber = (PRealNumber) dataType; double ret = realNumber.signum(ptr, childExpr.getSortOrder()); if (dataType instanceof PDecimal) retBytes = PDecimal.INSTANCE.toBytes(BigDecimal.valueOf(ret)); else retBytes = realNumber.getInstance().toBytes(Double.valueOf(ret)); } ptr.set(retBytes); return true; } return false; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { Expression childExpr = children.get(0); PDataType dataType = childExpr.getDataType(); if (childExpr.evaluate(tuple, ptr)) { int ret = ((PNumericType) dataType).signum(ptr, childExpr.getSortOrder()); ptr.set(RESULT[ret + 1]); return true; } return false; }
Source:
private Change getChange(RenameResourceWizard refactoringWizard) { refactoringWizard.setChangeCreationCancelable(true); refactoringWizard.setInitialComputationContext(new IRunnableContext() { @Override public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { runnable.run(new NullProgressMonitor()); } }); return refactoringWizard.internalCreateChange(InternalAPI.INSTANCE, new CreateChangeOperation(new CheckConditionsOperation(refactoringWizard.getRefactoring(), CheckConditionsOperation.FINAL_CONDITIONS), RefactoringStatus.FATAL), true); }

Target:
private Change getChange(RenameResourceWizard refactoringWizard) { refactoringWizard.setChangeCreationCancelable(true); refactoringWizard.setInitialComputationContext((boolean fork, boolean cancelable, IRunnableWithProgress runnable) -> runnable.run(new NullProgressMonitor())); return refactoringWizard.internalCreateChange(InternalAPI.INSTANCE, new CreateChangeOperation(new CheckConditionsOperation(refactoringWizard.getRefactoring(), CheckConditionsOperation.FINAL_CONDITIONS), RefactoringStatus.FATAL), true); }
Source:
public FreeformFamily(BlockFamilyDefinition definition, BlockShape shape, BlockBuilderHelper blockBuilder) { super(definition, shape, blockBuilder); BlockUri uri; if (CUBE_SHAPE_URN.equals(shape.getUrn())) { uri = new BlockUri(definition.getUrn()); } else { uri = new BlockUri(definition.getUrn(), shape.getUrn()); } if (shape.isCollisionYawSymmetric()) { block = blockBuilder.constructSimpleBlock(definition, shape); block.setBlockFamily(this); block.setUri(uri); } else { for (Rotation rot : Rotation.horizontalRotations()) { Side side = rot.rotate(Side.FRONT); Block block = blockBuilder.constructTransformedBlock(definition, shape, side.toString().toLowerCase(Locale.ENGLISH), rot); if (block == null) { throw new IllegalArgumentException("Missing block for side: " + side.toString()); } block.setBlockFamily(this); block.setUri(new BlockUri(uri, new Name(side.name()))); blocks.put(side, block); } } this.setBlockUri(uri); this.setCategory(definition.getCategories()); }

Target:
public FreeformFamily(BlockFamilyDefinition definition, BlockShape shape, BlockBuilderHelper blockBuilder) { super(definition, shape, blockBuilder); BlockUri uri; if (CUBE_SHAPE_URN.equals(shape.getUrn())) { uri = new BlockUri(definition.getUrn()); } else { uri = new BlockUri(definition.getUrn(), shape.getUrn()); } if (shape.isCollisionYawSymmetric()) { block = blockBuilder.constructSimpleBlock(definition, shape); block.setBlockFamily(this); block.setUri(uri); } else { for (Rotation rot : Rotation.horizontalRotations()) { Side side = rot.rotate(Side.FRONT); block = blockBuilder.constructTransformedBlock(definition, shape, side.toString().toLowerCase(Locale.ENGLISH), rot); if (block == null) { throw new IllegalArgumentException("Missing block for side: " + side.toString()); } block.setBlockFamily(this); block.setUri(new BlockUri(uri, new Name(side.name()))); blocks.put(side, block); } } this.setBlockUri(uri); this.setCategory(definition.getCategories()); }
Source:
private boolean wontExceedLocalStorageLimit(DownloadRequest next) { return localStorageAllocated + next.getSize() < config.getLocalStorageLimit(); }

Target:
private boolean wontExceedLocalStorageLimit(DownloadRequest next) { return localStorageAllocated + next.getSize() <= config.getLocalStorageLimit(); }
Source:
void rollbackLocal() throws SystemException { if (transaction instanceof ImportedTransaction) { throw Log.log.rollbackOnImported(); } int oldVal; do { oldVal = completionBits.get(); if ((oldVal & BIT_PREPARE_OR_ROLLBACK) == 0) { throw Log.log.invalidTxnState(); } } while (! completionBits.compareAndSet(oldVal, oldVal | BIT_PREPARE_OR_ROLLBACK | BIT_BEFORE_COMP)); transaction.rollback(); }

Target:
void rollbackLocal() throws SystemException { if (transaction instanceof ImportedTransaction) { throw Log.log.rollbackOnImported(); } transaction.rollback(); }