auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start() { this.executor = Executors.newSingleThreadExecutor(createThreadFactory()); if (this.recorder != null) { this.recorder.reset(); } this.identifierFactory.start(); final List<Scheduler> schedulers = new ArrayList<>(2); schedulers.add(new SessionExpirationScheduler(this.batcher, new ExpiredSessionRemover<>(this.factory, this.expirationListener))); if (this.maxActiveSessions >= 0) { schedulers.add(new SessionEvictionScheduler(this.cache.getName() + ".eviction", this.factory, this.batcher, this.dispatcherFactory, this.maxActiveSessions)); } this.scheduler = new Scheduler() { @Override public void schedule(String sessionId, ImmutableSessionMetaData metaData) { for (Scheduler scheduler1 : schedulers) { scheduler1.schedule(sessionId, metaData); } } @Override public void cancel(String sessionId) { for (Scheduler scheduler1 : schedulers) { scheduler1.cancel(sessionId); } } @Override public void cancel(Locality locality) { for (Scheduler scheduler1 : schedulers) { scheduler1.cancel(locality); } } @Override public void close() { for (Scheduler scheduler1 : schedulers) { scheduler1.close(); } } }; this.dispatcher = this.dispatcherFactory.createCommandDispatcher(this.cache.getName() + ".schedulers", this.scheduler); this.cache.addListener(this, this.filter); this.schedule(new SimpleLocality(false), new CacheLocality(this.cache)); }

Target:
public void start() { if (this.recorder != null) { this.recorder.reset(); } this.identifierFactory.start(); this.cache.addListener(this, this.filter); this.expirationRegistration = this.expirationRegistrar.register(this.expirationListener); }
Source:
public TracingP6SpyOptions(P6OptionsRepository optionsRepository) { super(TracingP6SpyOptionsMBean.class, false); logLoadableOptions = new P6LogOptions(optionsRepository); this.optionsRepository = optionsRepository; }

Target:
TracingP6SpyOptions(P6OptionsRepository optionsRepository) { super(optionsRepository); logLoadableOptions = new P6LogOptions(optionsRepository); this.optionsRepository = optionsRepository; }
Source:
public String toString() { return "TerminalAroundInvokeInvocationContext [method=" + method + "]"; }

Target:
public String toString() { return "TerminalAroundInvokeInvocationContext [method=" + method + ']'; }
Source:
public void execute() { moveRowUp(); }

Target:
public void execute() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); final List<?> containments = (List<?>) eObject.eGet(eStructuralFeature, true); final List<?> moveUpList = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); sortSelectionBasedOnIndex(moveUpList, containments); final EditingDomain editingDomain = getActionContext().getEditingDomain(); for (final Object moveUpObject : moveUpList) { final int currentIndex = containments.indexOf(moveUpObject); if (currentIndex <= 0) { return; } editingDomain.getCommandStack() .execute( new MoveCommand( editingDomain, eObject, eStructuralFeature, currentIndex, currentIndex - 1)); } }
Source:
public void visitMethodInvocation(MethodInvocationTree tree) { MethodInvocationTreeImpl mit = (MethodInvocationTreeImpl) tree; if((mit).isTypeSet()) { return; } Tree methodSelect = tree.methodSelect(); Resolve.Env methodEnv = semanticModel.getEnv(tree); scan(tree.arguments()); scan(tree.typeArguments()); List<JavaType> argTypes = getParameterTypes(tree.arguments()); List<JavaType> typeParamTypes = Lists.newArrayList(); if(tree.typeArguments() != null ) { typeParamTypes = getParameterTypes(tree.typeArguments()); } Resolve.Resolution resolution = resolveMethodSymbol(methodSelect, methodEnv, argTypes, typeParamTypes); JavaSymbol symbol = resolution.symbol(); mit.setSymbol(symbol); if(resolution.type() != null && resolution.type().isTagged(JavaType.DEFERRED)) { ((DeferredType) resolution.type()).setTree(mit); } registerType(tree, resolution.type()); inferArgumentTypes(argTypes, symbol); }

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { MethodInvocationTreeImpl mit = (MethodInvocationTreeImpl) tree; if(mit.isTypeSet()) { return; } Tree methodSelect = tree.methodSelect(); Resolve.Env methodEnv = semanticModel.getEnv(tree); scan(tree.arguments()); scan(tree.typeArguments()); List<JavaType> argTypes = getParameterTypes(tree.arguments()); List<JavaType> typeParamTypes = Lists.newArrayList(); if(tree.typeArguments() != null ) { typeParamTypes = getParameterTypes(tree.typeArguments()); } Resolve.Resolution resolution = resolveMethodSymbol(methodSelect, methodEnv, argTypes, typeParamTypes); JavaSymbol symbol = resolution.symbol(); mit.setSymbol(symbol); if(resolution.type() != null && resolution.type().isTagged(JavaType.DEFERRED)) { ((DeferredType) resolution.type()).setTree(mit); } registerType(tree, resolution.type()); inferArgumentTypes(argTypes, symbol); }
Source:
private Translation returnLatestVersion(UUID languageId, UUID packageId) { Translation highestFoundVersionTranslation = null; List<Translation> translations = selectByLanguageIdPackageId(languageId, packageId); for(Translation translation : translations) { if(highestFoundVersionTranslation == null || translation.getVersionNumber().compareTo(highestFoundVersionTranslation.getVersionNumber()) > 0) { highestFoundVersionTranslation = translation; } } return highestFoundVersionTranslation; }

Target:
private Translation returnLatestVersion(UUID languageId, UUID packageId) { Translation highestFoundVersionTranslation = null; for(Translation translation : selectByLanguageIdPackageId(languageId, packageId)) { if(highestFoundVersionTranslation == null || translation.getVersionNumber().compareTo(highestFoundVersionTranslation.getVersionNumber()) > 0) { highestFoundVersionTranslation = translation; } } return highestFoundVersionTranslation; }
Source:
public void testIOOB2DQuery() throws IndexOutOfBoundsException, TimeRangeException, StateSystemDisposedException { ITmfStateSystem ss = fStateSystem; assertNotNull(ss); Collection<Long> times = Collections.singleton(Long.valueOf(77)); int stringQuark = Integer.MAX_VALUE; ss.query2D(Collections.singleton(stringQuark), times); }

Target:
public void testIOOB2DQuery() throws IndexOutOfBoundsException, TimeRangeException, StateSystemDisposedException { ITmfStateSystem ss = fStateSystem; assertNotNull(ss); Collection<Long> times = Collections.singleton(77L); int stringQuark = Integer.MAX_VALUE; ss.query2D(Collections.singleton(stringQuark), times); }
Source:
private String clip(final String src, final int point, final Character replacement, final boolean posStrand) { final int len = src.length(); StringBuilder result = new StringBuilder(posStrand ? src.substring(0, point - 1) : src.substring(len - point + 1)); if (replacement != null) { if (posStrand) { for (int i = point; i <= len; i++) { result.append(replacement); } } else { for (int i = 0; i <= len - point; i++) { result.insert(0, replacement); } } } return result.toString(); }

Target:
private static String clip(final String src, final int point, final Character replacement, final boolean posStrand) { final int len = src.length(); StringBuilder result = new StringBuilder(posStrand ? src.substring(0, point - 1) : src.substring(len - point + 1)); if (replacement != null) { if (posStrand) { for (int i = point; i <= len; i++) { result.append(replacement); } } else { for (int i = 0; i <= len - point; i++) { result.insert(0, replacement); } } } return result.toString(); }
Source:
private void fillTempFile(File file) throws IOException { file.createNewFile(); FileWriter fileWriter = new FileWriter(file); for (int i = 0; i < 10; i++) { fileWriter.write("Sample text " + i + System.getProperty("line.separator")); } fileWriter.close(); }

Target:
private void fillTempFile(File file) throws IOException { file.createNewFile(); FileWriter fileWriter = new FileWriter(file); try { for (int i = 0; i < 10; i++) { fileWriter.write("Sample line of text"); fileWriter.write(System.getProperty("line.separator")); } } finally { fileWriter.close(); } }
Source:
public QualifiedModuleName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { logger.warning("Incorrect syntax. Valid syntax is '<ModuleType>:<ModuleName>'."); logger.warning("For example, 'module info source:file' to get 'file' <source> module info."); throw new ShellException(); } RESTModuleType moduleType = validateAndReturnModuleType(colonIndex, value); QualifiedModuleName result = new QualifiedModuleName(value.substring(colonIndex + 1), moduleType); return result; }

Target:
public QualifiedModuleName convertFromText(String value, Class<?> targetType, String optionContext) { int colonIndex = value.indexOf(':'); if (colonIndex == -1) { logger.warning("Incorrect syntax. Valid syntax is '<ModuleType>:<ModuleName>'."); logger.warning("For example, 'module info source:file' to get 'file' <source> module info."); throw new ShellException(); } RESTModuleType moduleType = validateAndReturnModuleType(value.substring(0, colonIndex)); QualifiedModuleName result = new QualifiedModuleName(value.substring(colonIndex + 1), moduleType); return result; }
Source:
private LegAmounts getNotional(SwapTrade input) { List<LegAmount> legAmounts = input.getProduct().getLegs().stream() .filter(RateCalculationSwapLeg.class::isInstance) .map(RateCalculationSwapLeg.class::cast) .map(l -> getLegAmount(l)) .collect(toList()); return LegAmounts.of(legAmounts); }

Target:
private LegAmounts getNotional(SwapTrade input) { List<LegAmount> legAmounts = input.getProduct().getLegs().stream() .filter(RateCalculationSwapLeg.class::isInstance) .map(RateCalculationSwapLeg.class::cast) .map(this::getLegAmount) .collect(toList()); return LegAmounts.of(legAmounts); }
Source:
public void add(int value) { addValueToBuffer(value); nextDoc(); }

Target:
public void add(int value) { _numberValueBuffer.put(_nextDocId, value); _docIdBuffer.put(_nextDocId, _nextDocId); _nextDocId++; }
Source:
public static void setUp() throws Exception { String url = postgres.start(EmbeddedPostgres.cachedRuntimeConfig(Paths.get("target/postgres")), "localhost", SocketUtil.findFreePort(), "keycolumn", "postgres", "root", Collections.emptyList()); Configuration configuration = new Configuration(); Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource( "org.postgresql.Driver", url, null)); configuration.setEnvironment(environment); configuration.addMapper(InsertMapper.class); sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration); SqlSession session = sqlSessionFactory.openSession(); Connection conn = session.getConnection(); Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql"); ScriptRunner runner = new ScriptRunner(conn); runner.setLogWriter(null); runner.runScript(reader); conn.close(); reader.close(); session.close(); }

Target:
public static void setUp() throws Exception { String url = postgres.start(EmbeddedPostgres.cachedRuntimeConfig(Paths.get("target/postgres")), "localhost", SocketUtil.findFreePort(), "keycolumn", "postgres", "root", Collections.emptyList()); Configuration configuration = new Configuration(); Environment environment = new Environment("development", new JdbcTransactionFactory(), new UnpooledDataSource( "org.postgresql.Driver", url, null)); configuration.setEnvironment(environment); configuration.addMapper(InsertMapper.class); sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration); try (SqlSession session = sqlSessionFactory.openSession(); Connection conn = session.getConnection(); Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/usesjava8/keycolumn/CreateDB.sql")) { ScriptRunner runner = new ScriptRunner(conn); runner.setLogWriter(null); runner.runScript(reader); } }
Source:
public CompoundNBT write(CompoundNBT tag) { CompoundNBT fluid = new CompoundNBT(); tank.writeToNBT(fluid); tag.put("tank", fluid); return super.write(tag); }

Target:
public CompoundNBT write(CompoundNBT tag) { CompoundNBT fluid = new CompoundNBT(); tank.writeToNBT(fluid); tag.put(Tags.TANK, fluid); return super.write(tag); }
Source:
public void serialize(XMLExtendedStreamWriter writer, RestStoreConfiguration configuration) throws XMLStreamException { AttributeSet attributes = configuration.attributes(); writer.writeStartElement(Element.REST_STORE); attributes.write(writer, RestStoreConfiguration.KEY2STRING_MAPPER, Attribute.KEY_TO_STRING_MAPPER); attributes.write(writer, RestStoreConfiguration.APPEND_CACHE_NAME_TO_PATH, Attribute.APPEND_CACHE_NAME_TO_PATH); attributes.write(writer, RestStoreConfiguration.PATH, Attribute.PATH); attributes.write(writer, RestStoreConfiguration.RAW_VALUES, Attribute.RAW_VALUES); writeCommonStoreSubAttributes(writer, configuration); writeServer(writer, configuration); writeConnectionPool(writer, configuration.connectionPool()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }

Target:
public void serialize(XMLExtendedStreamWriter writer, RestStoreConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.REST_STORE); configuration.attributes().write(writer); writeCommonStoreSubAttributes(writer, configuration); writeServer(writer, configuration); writeConnectionPool(writer, configuration.connectionPool()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }
Source:
protected synchronized void trimToSize(int size) { Map.Entry<T, Y> last; final Iterator<Map.Entry<T, Y>> cacheIterator = cache.entrySet().iterator(); while (currentSize > size) { last = cacheIterator.next(); final Y toRemove = last.getValue(); currentSize -= getSize(toRemove); final T key = last.getKey(); cacheIterator.remove(); onItemEvicted(key, toRemove); } }

Target:
protected synchronized void trimToSize(int size) { Map.Entry<T, Y> last; Iterator<Map.Entry<T, Y>> cacheIterator; while (currentSize > size) { cacheIterator = cache.entrySet().iterator(); last = cacheIterator.next(); final Y toRemove = last.getValue(); currentSize -= getSize(toRemove); final T key = last.getKey(); cacheIterator.remove(); onItemEvicted(key, toRemove); } }
Source:
public QueryV3Mapper queryV3Mapper() { return new QueryV3Mapper(); }

Target:
public QueryV3Mapper queryV3Mapper() { return new QueryV3Mapper(rsqlValueParser); }
Source:
protected String addReferenceData() { final boolean caseSensitive = (_caseSensitive != null && _caseSensitive.equals("on")); final SynonymCatalog catalog = new TextFileSynonymCatalog(_name, _filePath, caseSensitive, _encoding); getReferenceDataDao().addSynonymCatalog(getWizardContext().getTenantContext(), catalog); return _name; }

Target:
protected String addReferenceData() { copyUploadedFileToReferenceDataDirectory(); final boolean caseSensitive = (_caseSensitive != null && _caseSensitive.equals("on")); final SynonymCatalog catalog = new TextFileSynonymCatalog(_name, _filePath, caseSensitive, _encoding); getReferenceDataDao().addSynonymCatalog(getWizardContext().getTenantContext(), catalog); return _name; }
Source:
public void testCassandraHostWithoutPortFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); BluefloodServiceStarterException ex = null; try { BluefloodServiceStarter.validateCassandraHosts(); } catch (BluefloodServiceStarterException e) { ex = e; } assertNotNull(ex); assertEquals(-1, ex.getStatus()); }

Target:
public void testCassandraHostWithoutPortFailsValidation() { Configuration config = Configuration.getInstance(); config.setProperty(CoreConfig.CASSANDRA_HOSTS, "127.0.0.1"); BluefloodServiceStarter.validateCassandraHosts(); }
Source:
public InetAddressAndPort deserialize(DataInputPlus in, int version) throws IOException { int size = in.readByte() & 0xFF; switch(size) { case 4: case 16: { byte[] bytes = new byte[size]; in.readFully(bytes, 0, bytes.length); return InetAddressAndPort.getByAddress(bytes); } case 6: case 18: { byte[] bytes = new byte[size - 2]; in.readFully(bytes); int port = in.readShort() & 0xFFFF; return InetAddressAndPort.getByAddressOverrideDefaults(InetAddress.getByAddress(bytes), port); } default: throw new AssertionError("Unexpected size " + size); } }

Target:
public InetAddressAndPort deserialize(DataInputPlus in, int version) throws IOException { int size = in.readByte() & 0xFF; switch(size) { case 4: case 16: { byte[] bytes = new byte[size]; in.readFully(bytes, 0, bytes.length); return InetAddressAndPort.getByAddress(bytes); } case 6: case 18: { byte[] bytes = new byte[size - 2]; in.readFully(bytes); int port = in.readShort() & 0xFFFF; return InetAddressAndPort.getByAddressOverrideDefaults(InetAddress.getByAddress(bytes), bytes, port); } default: throw new AssertionError("Unexpected size " + size); } }
Source:
private IMethodBinding findMethodBindingInHierarchy(ITypeBinding currentTypeBinding, IMethod methodDeclaration) { IMethodBinding[] bindings= currentTypeBinding.getDeclaredMethods(); for (IMethodBinding binding : bindings) { if (methodDeclaration.equals(binding.getJavaElement())) { return binding; } } ITypeBinding superClass= currentTypeBinding.getSuperclass(); if (superClass != null) { IMethodBinding b= findMethodBindingInHierarchy(superClass, methodDeclaration); if (b != null) return b; } ITypeBinding[] interfaces= currentTypeBinding.getInterfaces(); for (ITypeBinding intf : interfaces) { IMethodBinding b = findMethodBindingInHierarchy(intf, methodDeclaration); if (b != null) return b; } return null; }

Target:
private IMethodBinding findMethodBindingInHierarchy(ITypeBinding currentTypeBinding, IMethod methodDeclaration) { for (IMethodBinding binding : currentTypeBinding.getDeclaredMethods()) { if (methodDeclaration.equals(binding.getJavaElement())) { return binding; } } ITypeBinding superClass= currentTypeBinding.getSuperclass(); if (superClass != null) { IMethodBinding b= findMethodBindingInHierarchy(superClass, methodDeclaration); if (b != null) return b; } for (ITypeBinding intf : currentTypeBinding.getInterfaces()) { IMethodBinding b= findMethodBindingInHierarchy(intf, methodDeclaration); if (b != null) return b; } return null; }
Source:
public void watchContainers(ContainerEventHandler handler) throws InfrastructureException { if (containerWatch == null) { final Watcher<Event> watcher = new Watcher<Event>() { @Override public void eventReceived(Action action, Event event) { ObjectReference involvedObject = event.getInvolvedObject(); String fieldPath = involvedObject.getFieldPath(); if (POD_OBJECT_KIND.equals(involvedObject.getKind()) && fieldPath != null) { Matcher containerFieldMatcher = CONTAINER_FIELD_PATH_PATTERN.matcher(fieldPath); if (containerFieldMatcher.matches()) { String containerName = containerFieldMatcher.group(CONTAINER_NAME_GROUP); String podName = Names.originalPodName(involvedObject.getName(), workspaceId); ContainerEvent containerEvent = new ContainerEvent( Names.machineName(containerName, podName), event.getMessage()); containerEventsHandlers.forEach(h -> h.handle(containerEvent)); } } } @Override public void onClose(KubernetesClientException ignored) }; try (OpenShiftClient client = clientFactory.create()) { containerWatch = client.events().inNamespace(namespace).watch(watcher); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage()); } } containerEventsHandlers.add(handler); }

Target:
public void watchContainers(ContainerEventHandler handler) throws InfrastructureException { if (containerWatch == null) { final Watcher<Event> watcher = new Watcher<Event>() { @Override public void eventReceived(Action action, Event event) { ObjectReference involvedObject = event.getInvolvedObject(); String fieldPath = involvedObject.getFieldPath(); if (POD_OBJECT_KIND.equals(involvedObject.getKind()) && fieldPath != null) { Matcher containerFieldMatcher = CONTAINER_FIELD_PATH_PATTERN.matcher(fieldPath); if (containerFieldMatcher.matches()) { String containerName = containerFieldMatcher.group(CONTAINER_NAME_GROUP); String podName = Names.originalPodName(involvedObject.getName(), workspaceId); ContainerEvent containerEvent = new ContainerEvent( Names.machineName(podName, containerName), event.getMessage(), event.getMetadata().getCreationTimestamp()); containerEventsHandlers.forEach(h -> h.handle(containerEvent)); } } } @Override public void onClose(KubernetesClientException ignored) }; try (OpenShiftClient client = clientFactory.create()) { containerWatch = client.events().inNamespace(namespace).watch(watcher); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage()); } } containerEventsHandlers.add(handler); }
Source:
static DefaultContainerDescription lookup(final ModelControllerClient client) throws IOException { final ModelNode op = Operations.createReadResourceOperation(new ModelNode().setEmptyList()); op.get(ClientConstants.INCLUDE_RUNTIME).set(true); final ModelNode result = client.execute(op); if (Operations.isSuccessfulOutcome(result)) { final ModelNode model = Operations.readResult(result); final String productName = getValue(model, "product-name", "WildFly"); final String productVersion = getValue(model, "product-version"); final String releaseVersion = getValue(model, "release-version"); final String launchType = getValue(model, "launch-type"); return new DefaultContainerDescription(productName, productVersion, releaseVersion, launchType, "DOMAIN".equalsIgnoreCase(launchType)); } else { Logger.getLogger(DefaultContainerDescription.class).errorf("Failed to read the root resource: ", Operations.getFailureDescription(result)); } return UNKNOWN; }

Target:
static DefaultContainerDescription lookup(final ModelControllerClient client) throws IOException, OperationExecutionException { final ModelNode op = Operations.createReadResourceOperation(new ModelNode().setEmptyList()); op.get(ClientConstants.INCLUDE_RUNTIME).set(true); final ModelNode result = client.execute(op); if (Operations.isSuccessfulOutcome(result)) { final ModelNode model = Operations.readResult(result); final String productName = getValue(model, "product-name", "WildFly"); final String productVersion = getValue(model, "product-version"); final String releaseVersion = getValue(model, "release-version"); final String launchType = getValue(model, "launch-type"); return new DefaultContainerDescription(productName, productVersion, releaseVersion, launchType, "DOMAIN".equalsIgnoreCase(launchType)); } throw new OperationExecutionException(op, result); }
Source:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexUpsertRuntime( IDataSourceIndex<String, String> dataSourceIndex, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalFilteringKeys, ILogicalExpression filterExpr, List<LogicalVariable> prevSecondaryKeys, LogicalVariable prevAdditionalFilteringKeys, RecordDescriptor inputDesc, JobGenContext context, JobSpecification spec) throws AlgebricksException { return null; }

Target:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getIndexUpsertRuntime( IDataSourceIndex<String, String> dataSourceIndex, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, List<LogicalVariable> additionalFilteringKeys, ILogicalExpression filterExpr, List<LogicalVariable> prevSecondaryKeys, LogicalVariable prevAdditionalFilteringKeys, RecordDescriptor inputDesc, JobGenContext context, JobSpecification spec) throws AlgebricksException { throw new UnsupportedOperationException(); }
Source:
public Mono<String> getToken(String... scopes) { String scope = scopes[0]; String resource = scope.substring(0, scope.lastIndexOf('.')); return getTokenFromUri(resource).map(token -> SCHEME + token); }

Target:
public Mono<AccessToken> getToken(String... scopes) { String resource = ScopeUtil.scopesToResource(scopes); return getTokenFromUri(resource); }
Source:
public final void taskAction() throws IOException { org.gradle.api.plugins.internal.DefaultJavaPluginConvention convention = (org.gradle.api.plugins.internal.DefaultJavaPluginConvention) getProject().getConvention().getPlugin(JavaPluginConvention.class); if (convention.getRawSourceCompatibility() != null) { return; } if (shouldFix.get()) { Files.write( getProject().getBuildFile().toPath(), Collections.singletonList(String.format("%nsourceCompatibility = %s", JavaVersion.current())), StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.CREATE); return; } throw new GradleException(String.format( "%s must set sourceCompatibility explicitly in '%s', " + "otherwise compilation will not be reproducible but instead depends on the Java version " + "that Gradle is currently running with (%s). To auto-fix, run%n" + "%n" + " ./gradlew %s --fix%n" + "%n" + "This will automatically add a suggested line " + "(you may need to adjust the number, e.g. to '1.8' for maximum compatibility).", getProject(), getProject().getRootProject().relativePath(getProject().getBuildFile()), JavaVersion.current(), getPath())); }

Target:
public final void taskAction() throws IOException { org.gradle.api.plugins.internal.DefaultJavaPluginConvention convention = (org.gradle.api.plugins.internal.DefaultJavaPluginConvention) getProject().getConvention().getPlugin(JavaPluginConvention.class); if (convention.getRawSourceCompatibility() != null) { return; } if (shouldFix.get()) { Files.write( getProject().getBuildFile().toPath(), Collections.singletonList(String.format("%nsourceCompatibility = %s%n", JavaVersion.current())), StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.CREATE); return; } throw new GradleException(String.format( "%s must set sourceCompatibility explicitly in '%s', " + "otherwise compilation will not be reproducible but instead depends on the Java version " + "that Gradle is currently running with (%s). To auto-fix, run%n" + "%n" + " ./gradlew %s --fix%n" + "%n" + "This will automatically add a suggested line " + "(you may need to adjust the number, e.g. to '1.8' for maximum compatibility).", getProject(), getProject().getRootProject().relativePath(getProject().getBuildFile()), JavaVersion.current(), getPath())); }
Source:
public void includeDeletedFlagWorks() throws Exception { int initialCountWithoutDeleted = surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size(); int initialCountWithDeleted = surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size(); Survey survey1 = createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); surveyDao.deleteSurvey(survey1); assertEquals(1 + initialCountWithoutDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size()); assertEquals(2 + initialCountWithDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size()); surveyDao.deleteSurveyPermanently(survey1); assertEquals(1 + initialCountWithoutDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false).size()); assertEquals(1 + initialCountWithDeleted, surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true).size()); }

Target:
public void includeDeletedFlagWorks() throws Exception { Survey survey1 = createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); createSurvey(new TestSurvey(DynamoSurveyDaoTest.class, true)); surveyDao.deleteSurvey(survey1); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false), survey1.getGuid()); anyDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true), survey1.getGuid()); surveyDao.deleteSurveyPermanently(survey1); String guid = survey1.getGuid(); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, false), guid); noneDeleted(surveyDao.getAllSurveysMostRecentVersion(TEST_STUDY, true), guid); }
Source:
protected boolean canDoAction() { final boolean wrongInput = getParameters() == null || getParameters().getId() == null || getParameters().getId().equals(Guid.Empty); if (!super.canDoAction() || wrongInput) { return false; } final MacPoolDAO macPoolDao = getDbFacade().getMacPoolDao(); final Guid macPoolId = getParameters().getId(); final MacPool macPool = macPoolDao.get(macPoolId); final int dcUsageCount = macPoolDao.getDCUsageCount(macPoolId); if (macPool == null) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_DOES_NOT_EXIST); return false; } final boolean canBeRemoved = macPool.canBeRemoved() && dcUsageCount == 0; if (!canBeRemoved) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_CANNOT_BE_REMOVED); return false; } else { return true; } }

Target:
protected boolean canDoAction() { final boolean wrongInput = getParameters() == null || getParameters().getId() == null || getParameters().getId().equals(Guid.Empty); if (!super.canDoAction() || wrongInput) { return false; } final Guid macPoolId = getParameters().getId(); final MacPool macPool = getMacPoolDAO().get(macPoolId); final int dcUsageCount = getMacPoolDAO().getDCUsageCount(macPoolId); if (macPool == null) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_DOES_NOT_EXIST); return false; } final boolean canBeRemoved = macPool.canBeRemoved() && dcUsageCount == 0; if (!canBeRemoved) { addCanDoActionMessage(VdcBllMessages.MAC_POOL_CANNOT_BE_REMOVED); return false; } else { return true; } }
Source:
public void start() { if (stopping.getAsBoolean()) return; try { if (!started.compareAndSet(false, true)) return; tmpSnpDir = U.resolveWorkDirectory(tmpTaskWorkDir.getAbsolutePath(), relativeNodePath(cctx.kernalContext().pdsFolderResolver().resolveFolders()), false); snpSndr.init(); for (Integer grpId : parts.keySet()) { CacheGroupContext gctx = cctx.cache().cacheGroup(grpId); if (gctx == null) throw new IgniteCheckedException("Cache group context has not found. Cache group is stopped: " + grpId); if (!CU.isPersistentCache(gctx.config(), cctx.kernalContext().config().getDataStorageConfiguration())) throw new IgniteCheckedException("In-memory cache groups are not allowed to be snapshotted: " + grpId); if (gctx.config().isEncryptionEnabled()) throw new IgniteCheckedException("Encrypted cache groups are note allowed to be snapshotted: " + grpId); U.ensureDirectory(cacheWorkDir(tmpSnpDir, cacheDirName(gctx.config())), "directory for snapshotting cache group", log); } startedFut.listen(f -> ((GridCacheDatabaseSharedManager)cctx.database()).removeCheckpointListener(this) ); ((GridCacheDatabaseSharedManager)cctx.database()).addCheckpointListener(this); if (log.isInfoEnabled()) { log.info("Snapshot operation is scheduled on local node and will be handled by the checkpoint " + "listener [sctx=" + this + ", topVer=" + cctx.discovery().topologyVersionEx() + ']'); } } catch (IgniteCheckedException e) { acceptException(e); } }

Target:
public boolean start() { if (stopping()) return false; try { if (!started.compareAndSet(false, true)) return false; tmpSnpDir = U.resolveWorkDirectory(tmpTaskWorkDir.getAbsolutePath(), igniteCacheStoragePath(cctx.kernalContext().pdsFolderResolver().resolveFolders()), false); for (Integer grpId : parts.keySet()) { CacheGroupContext gctx = cctx.cache().cacheGroup(grpId); if (gctx == null) throw new IgniteCheckedException("Cache group context has not found. Cache group is stopped: " + grpId); if (!CU.isPersistentCache(gctx.config(), cctx.kernalContext().config().getDataStorageConfiguration())) throw new IgniteCheckedException("In-memory cache groups are not allowed to be snapshot: " + grpId); if (gctx.config().isEncryptionEnabled()) throw new IgniteCheckedException("Encrypted cache groups are not allowed to be snapshot: " + grpId); U.ensureDirectory(cacheWorkDir(tmpSnpDir, cacheDirName(gctx.config())), "directory for snapshotting cache group", log); } startedFut.listen(f -> ((GridCacheDatabaseSharedManager)cctx.database()).removeCheckpointListener(this) ); ((GridCacheDatabaseSharedManager)cctx.database()).addCheckpointListener(this); if (log.isInfoEnabled()) { log.info("Snapshot operation is scheduled on local node and will be handled by the checkpoint " + "listener [sctx=" + this + ", topVer=" + cctx.discovery().topologyVersionEx() + ']'); } } catch (IgniteCheckedException e) { acceptException(e); return false; } return true; }
Source:
public static Bind parse(String serialized) { try { String[] parts = null; if (SystemUtils.IS_OS_WINDOWS) { parts = parseInternal(serialized); } else { parts = serialized.split(":"); } switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }

Target:
public static Bind parse(String serialized) { try { String[] parts = parseInternal(serialized); switch (parts.length) { case 2: { return new Bind(parts[0], new Volume(parts[1])); } case 3: { String[] flags = parts[2].split(","); AccessMode accessMode = AccessMode.DEFAULT; SELContext seMode = SELContext.DEFAULT; Boolean nocopy = null; PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; for (String p : flags) { if (p.length() == 2) { accessMode = AccessMode.valueOf(p.toLowerCase()); } else if ("nocopy".equals(p)) { nocopy = true; } else if (PropagationMode.SHARED.toString().equals(p)) { propagationMode = PropagationMode.SHARED; } else if (PropagationMode.SLAVE.toString().equals(p)) { propagationMode = PropagationMode.SLAVE; } else if (PropagationMode.PRIVATE.toString().equals(p)) { propagationMode = PropagationMode.PRIVATE; } else { seMode = SELContext.fromString(p); } } return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); } default: { throw new IllegalArgumentException(); } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); } }
Source:
public void testBindByPools() throws Exception { PoolIdAndQuantity[] pools = new PoolIdAndQuantity[2]; pools[0] = new PoolIdAndQuantity("first", 1); pools[1] = new PoolIdAndQuantity("second", 2); ConsumerCurator cc = mock(ConsumerCurator.class); SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class); PoolManager pm = mock(PoolManager.class); Owner owner = TestUtil.createOwner(); Consumer consumer = TestUtil.createConsumer(owner); when(cc.verifyAndLookupConsumerWithEntitlements(eq("fakeConsumer"))).thenReturn( consumer); when(sa.hasUnacceptedSubscriptionTerms(any(Owner.class))).thenReturn(false); ConsumerResource cr = new ConsumerResource(cc, null, null, sa, null, null, null, i18n, null, null, null, null, null, null, pm, null, null, null, null, null, null, null, null, new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil); Response rsp = cr.bind("fakeConsumer", null, null, null, null, null, true, null, null, pools, new TrustedUserPrincipal("TaylorSwift")); JobDetail detail = (JobDetail) rsp.getEntity(); PoolIdAndQuantity[] pQs = (PoolIdAndQuantity[]) detail.getJobDataMap().get("pool_and_quanities"); boolean firstFound = false; boolean secondFound = false; for (PoolIdAndQuantity pq : pQs) { if (pq.getPoolId().contentEquals("first")) { firstFound = true; assertEquals(1, pq.getQuantity().intValue()); } if (pq.getPoolId().contentEquals("second")) { secondFound = true; assertEquals(2, pq.getQuantity().intValue()); } } assertTrue(firstFound); assertTrue(secondFound); }

Target:
public void testBindByPools() throws Exception { PoolIdAndQuantity[] pools = new PoolIdAndQuantity[2]; pools[0] = new PoolIdAndQuantity("first", 1); pools[1] = new PoolIdAndQuantity("second", 2); ConsumerCurator cc = mock(ConsumerCurator.class); SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class); PoolManager pm = mock(PoolManager.class); Owner owner = TestUtil.createOwner(); Consumer consumer = TestUtil.createConsumer(owner); when(cc.verifyAndLookupConsumerWithEntitlements(eq("fakeConsumer"))).thenReturn( consumer); when(sa.hasUnacceptedSubscriptionTerms(any(Owner.class))).thenReturn(false); ConsumerResource cr = new ConsumerResource(cc, null, null, sa, null, null, null, i18n, null, null, null, null, null, null, pm, null, null, null, null, null, null, null, null, new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil); Response rsp = cr.bind("fakeConsumer", null, null, null, null, null, true, null, null, pools, new TrustedUserPrincipal("TaylorSwift")); JobDetail detail = (JobDetail) rsp.getEntity(); PoolIdAndQuantity[] pQs = (PoolIdAndQuantity[]) detail.getJobDataMap().get("pool_and_quantities"); boolean firstFound = false; boolean secondFound = false; for (PoolIdAndQuantity pq : pQs) { if (pq.getPoolId().contentEquals("first")) { firstFound = true; assertEquals(1, pq.getQuantity().intValue()); } if (pq.getPoolId().contentEquals("second")) { secondFound = true; assertEquals(2, pq.getQuantity().intValue()); } } assertTrue(firstFound); assertTrue(secondFound); }
Source:
public void updateCompactionTaskSlot(Double compactionTaskSlotRatio, Integer maxCompactionTaskSlots) throws Exception { String url = StringUtils.format("%sconfig/compaction/taskslots?ratio=%s&max=%s", getCoordinatorURL(), StringUtils.urlEncode(compactionTaskSlotRatio.toString()), StringUtils.urlEncode(maxCompactionTaskSlots.toString())); StatusResponseHolder response = httpClient.go(new Request(HttpMethod.POST, new URL(url)), responseHandler).get(); if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new ISE( "Error while force trigger auto compaction status[%s] content[%s]", response.getStatus(), response.getContent() ); } }

Target:
public void updateCompactionTaskSlot(Double compactionTaskSlotRatio, Integer maxCompactionTaskSlots) throws Exception { String url = StringUtils.format("%sconfig/compaction/taskslots?ratio=%s&max=%s", getCoordinatorURL(), StringUtils.urlEncode(compactionTaskSlotRatio.toString()), StringUtils.urlEncode(maxCompactionTaskSlots.toString())); StatusResponseHolder response = httpClient.go(new Request(HttpMethod.POST, new URL(url)), responseHandler).get(); if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new ISE( "Error while updating compaction task slot status[%s] content[%s]", response.getStatus(), response.getContent() ); } }
Source:
protected void handleRenameOperation( File hiddenTarget, File target ) throws IOException { if ( target.exists() ) { target.delete(); } boolean success = hiddenTarget.renameTo( target ); for ( int i = 1; success == false && i <= getRenameRetryCount(); i++ ) { getLogger().debug( "Rename operation attempt failed on --> {}, will wait ms and try again", new Object[] { i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), getRenameRetryDelay() } ); try { Thread.sleep( getRenameRetryDelay() ); } catch ( InterruptedException e ) { } if ( target.exists() ) { target.delete(); } success = hiddenTarget.renameTo( target ); if ( success ) { getLogger().info( "Rename operation succeeded after retries on --> {}", new Object[] { i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath() } ); } } if ( !success ) { try { FileUtils.rename( hiddenTarget, target ); } catch ( IOException e ) { getLogger().error( "Rename operation failed after retries in ms intervals --> {}", new Object[] { getRenameRetryCount(), getRenameRetryDelay(), hiddenTarget.getAbsolutePath(), target.getAbsolutePath() } ); throw new IOException( String.format( "Cannot rename file \"%s\" to \"%s\"! Message: %s", hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), e.getMessage() ), e ); } } }

Target:
protected void handleRenameOperation( File hiddenTarget, File target ) throws IOException { if ( target.exists() ) { target.delete(); } boolean success = hiddenTarget.renameTo( target ); for ( int i = 1; success == false && i <= getRenameRetryCount(); i++ ) { getLogger().debug( "Rename operation attempt failed on --> {}, will wait ms and try again", i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), getRenameRetryDelay() ); try { Thread.sleep( getRenameRetryDelay() ); } catch ( InterruptedException e ) { } if ( target.exists() ) { target.delete(); } success = hiddenTarget.renameTo( target ); if ( success ) { getLogger().info( "Rename operation succeeded after retries on --> {}", i, hiddenTarget.getAbsolutePath(), target.getAbsolutePath() ); } } if ( !success ) { try { FileUtils.rename( hiddenTarget, target ); } catch ( IOException e ) { getLogger().error( "Rename operation failed after retries in ms intervals --> {}", getRenameRetryCount(), getRenameRetryDelay(), hiddenTarget.getAbsolutePath(), target.getAbsolutePath() ); throw new IOException( String.format( "Cannot rename file \"%s\" to \"%s\"! Message: %s", hiddenTarget.getAbsolutePath(), target.getAbsolutePath(), e.getMessage() ), e ); } } }
Source:
public Iterable<Event> events() throws IOException { final MkIssueEvents issueevents = new MkIssueEvents( this.storage, this.self, this.coords ); return new MkIterable<Event>( this.storage, String.format( "/github/repos/repo[@coords='%s']/issue-events/issue-event[@issue='%s']", this.coords, this.num ), new MkIterable.Mapping<Event>() { @Override public Event map(final XML xml) { return issueevents.get( Integer.parseInt(xml.xpath("number/text()").get(0)) ); } } ); }

Target:
public Iterable<Event> events() throws IOException { return new MkIterable<Event>( this.storage, String.format( "/github/repos/repo[@coords='%s']/issue-events/issue-event[issue='%s']", this.coords, this.num ), new MkIssueEventMapping(this) ); }
Source:
public void alterCatalog(String catName, Catalog cat) throws MetaException, InvalidOperationException { rawStore.alterCatalog(catName, cat); catName = catName.toLowerCase(); sharedCache.alterCatalogInCache(StringUtils.normalizeIdentifier(catName), cat); }

Target:
public void alterCatalog(String catName, Catalog cat) throws MetaException, InvalidOperationException { rawStore.alterCatalog(catName, cat); sharedCache.alterCatalogInCache(StringUtils.normalizeIdentifier(catName), cat); }
Source:
private PlanBuilder planBuilderFor(PlanBuilder builder, Scope scope, Iterable<? extends Expression> expressionsToRemap) { PlanBuilder newBuilder = planBuilderFor(builder, scope); for (Expression expression : expressionsToRemap) { newBuilder.getTranslations().put(expression, builder.translate(expression)); } return newBuilder; }

Target:
private PlanBuilder planBuilderFor(PlanBuilder builder, Scope scope, Iterable<? extends Expression> expressionsToRemap) { PlanBuilder newBuilder = planBuilderFor(builder, scope); stream(expressionsToRemap) .forEach(expression -> newBuilder.getTranslations().put(expression, builder.translate(expression))); return newBuilder; }
Source:
private boolean isEnterpriseArchive(Archive<?> archive) { return archive instanceof EnterpriseArchive; }

Target:
private boolean isEnterpriseArchive(Archive<?> archive) { return archive.getName().endsWith(".ear"); }
Source:
private void startInstance(Object obj) throws IllegalAccessException, InvocationTargetException { Preconditions.checkNotNull(obj, "obj is null"); if (!startedInstances.contains(obj)) { startedInstances.add(obj); log.debug("Starting %s", obj.getClass().getName()); LifeCycleMethods methods = methodsMap.get(obj.getClass()); for (Method postConstruct : methods.methodsFor(PostConstruct.class)) { log.debug("\t%s()", postConstruct.getName()); postConstruct.invoke(obj); } } }

Target:
private void startInstance(Object obj) throws IllegalAccessException, InvocationTargetException { log.debug("Starting %s", obj.getClass().getName()); LifeCycleMethods methods = methodsMap.get(obj.getClass()); for (Method postConstruct : methods.methodsFor(PostConstruct.class)) { log.debug("\t%s()", postConstruct.getName()); postConstruct.invoke(obj); } }
Source:
public Traces generateStartSpan(String projectId, TraceContext context, TraceContext parentContext, SpanKind spanKind, String name, Timestamp timestamp) { TraceSpan.Builder spanBuilder = TraceSpan.newBuilder() .setSpanId(context.getSpanId().getSpanId()) .setKind(toSpanKindProto(spanKind)) .setName(name) .setStartTime(toTimestamp(timestamp)); if (parentContext.getTraceId().equals(context.getTraceId()) && parentContext.getSpanId().isValid()) { spanBuilder.setParentSpanId(parentContext.getSpanId().getSpanId()); } Trace.Builder traceBuilder = Trace.newBuilder() .setProjectId(projectId) .setTraceId(formatTraceId(context.getTraceId())) .addSpans(spanBuilder.build()); return Traces.newBuilder().addTraces(traceBuilder).build(); }

Target:
public Trace generateStartSpan(String projectId, TraceContext context, TraceContext parentContext, SpanKind spanKind, String name, Timestamp timestamp) { TraceSpan.Builder spanBuilder = TraceSpan.newBuilder() .setSpanId(context.getSpanId().getSpanId()) .setKind(toSpanKindProto(spanKind)) .setName(name) .setStartTime(toTimestamp(timestamp)); if (parentContext.getTraceId().equals(context.getTraceId()) && parentContext.getSpanId().isValid()) { spanBuilder.setParentSpanId(parentContext.getSpanId().getSpanId()); } Trace.Builder traceBuilder = Trace.newBuilder() .setProjectId(projectId) .setTraceId(formatTraceId(context.getTraceId())) .addSpans(spanBuilder.build()); return traceBuilder.build(); }
Source:
public JLoadTest testRpsLoadWithWarmUp() { long warmUp = testDuration/4; double expectedRps = 3*rps/4 + rps/2/4; double expectedUsersCount = expectedRps * latency; double expectedIterations = expectedRps * testDuration; return test("simple rps Load with warm up", rpsLoad(rps) .withWarmUpTimeInMilliseconds(warmUp).build(), durationTermination(testDuration), deviationLimit(JMetricName.PERF_THROUGHPUT, expectedRps, 0.05, 0.1), deviationLimit(JMetricName.PERF_ITERATION_SAMPLES, expectedIterations, 0.05, 0.1), userLimit(expectedUsersCount), LATENCY_LIMIT, DURATION_LIMIT, SUCCESS_LIMIT); }

Target:
public JLoadTest testRpsLoadWithWarmUp() { long warmUp = testDuration/4; double expectedRps = 3*rps/4 + rps/2/4; double expectedUsersCount = expectedRps * latency; double expectedIterations = expectedRps * testDuration; return test("simple rps Load with warm up", rpsLoad(rps) .withWarmUpTimeInMilliseconds(warmUp * 1000).build(), durationTermination(testDuration), deviationLimit(JMetricName.PERF_THROUGHPUT, expectedRps, 0.05, 0.1), deviationLimit(JMetricName.PERF_ITERATION_SAMPLES, expectedIterations, 0.05, 0.1), userLimit(expectedUsersCount), LATENCY_LIMIT, DURATION_LIMIT, SUCCESS_LIMIT); }