auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static float getProgressForMedia(MediaModel media) { if (!sProgressByMediaId.containsKey(media.getId())) { return 1; } float uploadProgress = sProgressByMediaId.get(media.getId()); if (media.isVideo() && WPMediaUtils.isVideoOptimizationEnabled()) { if (sOptimizationProgressByMediaId.containsKey(media.getId())) { float optimizationProgress = sOptimizationProgressByMediaId.get(media.getId()); return optimizationProgress * 0.5F; } return 0.5F + (uploadProgress * 0.5F); } return uploadProgress; }

Target:
static float getProgressForMedia(MediaModel media) { Float progress = sUploadProgressByMediaId.get(media.getId()); float uploadProgress = progress == null ? 0 : progress; if (media.isVideo() && WPMediaUtils.isVideoOptimizationEnabled()) { if (sOptimizationProgressByMediaId.containsKey(media.getId())) { float optimizationProgress = sOptimizationProgressByMediaId.get(media.getId()); return optimizationProgress * 0.5F; } return 0.5F + (uploadProgress * 0.5F); } return uploadProgress; }
Source:
public void editBufferSizeInvalid() throws Exception { final int value = -1; ModelNodeResult originalModelNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE); originalModelNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFER_SIZE, String.valueOf(value)) .verifyFormNotSaved(); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE, originalModelNodeResult.value()); } }

Target:
public void editBufferSizeInvalid() throws Exception { final int value = -1; final ModelNodeResult originalModelNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE); originalModelNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFER_SIZE, String.valueOf(value)) .verifyFormNotSaved(); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE, originalModelNodeResult.value()); } }
Source:
public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { LOG.debug("CXFSAMLCallbackHandler.handle begin-Minh version 111111"); for (final Callback callback : callbacks) { if (callback instanceof SAMLCallback) { try { final Message message = getCurrentMessage(); final Object obj = message.get("assertion"); AssertionType custAssertion = null; if (obj != null) { custAssertion = (AssertionType) obj; } final SAMLCallback oSAMLCallback = (SAMLCallback) callback; oSAMLCallback.setIssuerKeyName("gateway"); oSAMLCallback.setIssuerKeyPassword("changeit"); oSAMLCallback.setSignAssertion(true); oSAMLCallback.setSendKeyValue(true); issuerCrypto = CryptoFactory.getInstance("signature.properties"); oSAMLCallback.setIssuerCrypto(issuerCrypto); oSAMLCallback.setSamlVersion(Version.SAML_20); oSAMLCallback.setSignatureAlgorithm(SPConstants.SHA1); oSAMLCallback.setSignatureDigestAlgorithm(SPConstants.SHA1); final SamlTokenCreator creator = new SamlTokenCreator(); final CallbackProperties properties = new CallbackMapProperties(addMessageProperties( creator.createRequestContext(custAssertion, getResource(message), null), message)); oSAMLCallback.setAssertionElement(builder.build(properties)); } catch (final Exception e) { LOG.error("Failed to create saml: {}", e.getLocalizedMessage(), e); } } } LOG.debug("CXFSAMLCallbackHandler.handle end"); }

Target:
public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { LOG.trace("CXFSAMLCallbackHandler.handle begin"); for (final Callback callback : callbacks) { if (callback instanceof SAMLCallback) { try { final Message message = getCurrentMessage(); final Object obj = message.get("assertion"); AssertionType custAssertion = null; if (obj != null) { custAssertion = (AssertionType) obj; } final SAMLCallback oSAMLCallback = (SAMLCallback) callback; oSAMLCallback.setIssuerKeyName("gateway"); oSAMLCallback.setIssuerKeyPassword("changeit"); oSAMLCallback.setSignAssertion(true); oSAMLCallback.setSendKeyValue(true); issuerCrypto = CryptoFactory.getInstance("signature.properties"); oSAMLCallback.setIssuerCrypto(issuerCrypto); oSAMLCallback.setSamlVersion(Version.SAML_20); oSAMLCallback.setSignatureAlgorithm(SPConstants.SHA1); oSAMLCallback.setSignatureDigestAlgorithm(SPConstants.SHA1); final SamlTokenCreator creator = new SamlTokenCreator(); final CallbackProperties properties = new CallbackMapProperties(addMessageProperties( creator.createRequestContext(custAssertion, getResource(message), null), message)); oSAMLCallback.setAssertionElement(builder.build(properties)); } catch (final Exception e) { LOG.error("Failed to create saml: {}", e.getLocalizedMessage(), e); } } } LOG.trace("CXFSAMLCallbackHandler.handle end"); }
Source:
public Object execute() { String key = getKey(); Optional<byte[]> value = blobStore.get(key, THRESHOLDING_KV_CONTEXT); if (value.isPresent()) { System.out.println(fst.asObject(value.get()).toString()); } else { System.out.println(String.format("Could not find a state for key '%s'", key)); } return null; }

Target:
public Object execute() { String key = getKey(); Optional<byte[]> value = blobStore.get(key, THRESHOLDING_KV_CONTEXT); if (value.isPresent()) { System.out.println(fst.asObject(value.get()).toString()); } else { System.out.printf("Could not find a state for key '%s'\n", key); } return null; }
Source:
public static String configToConnectionString(QuorumVerifier data) throws Exception { StringBuilder sb = new StringBuilder(); for ( QuorumPeer.QuorumServer server : data.getAllMembers().values() ) { if ( server.clientAddr == null ) { continue; } if ( sb.length() != 0 ) { sb.append(","); } InetAddress wildcardAddress = new InetSocketAddress(0).getAddress(); String hostAddress; if ( wildcardAddress.equals(server.clientAddr.getAddress()) ) { hostAddress = server.addr.getAddress().getHostAddress(); } else { hostAddress = server.clientAddr.getAddress().getHostAddress(); } sb.append(hostAddress).append(":").append(server.clientAddr.getPort()); } return sb.toString(); }

Target:
public static String configToConnectionString(QuorumVerifier data) throws Exception { StringBuilder sb = new StringBuilder(); for ( QuorumPeer.QuorumServer server : data.getAllMembers().values() ) { if ( server.clientAddr == null ) { continue; } if ( sb.length() != 0 ) { sb.append(","); } String hostAddress; if ( server.clientAddr.getAddress().isAnyLocalAddress() ) { hostAddress = server.addr.getAddress().getHostAddress(); } else { hostAddress = server.clientAddr.getAddress().getHostAddress(); } sb.append(hostAddress).append(":").append(server.clientAddr.getPort()); } return sb.toString(); }
Source:
protected void updateDetailsAvailability() { if (getSelectedItem() != null) { Disk disk = getSelectedItem(); vmListModel.setIsAvailable(disk.getVmEntityType() == null || !disk.getVmEntityType().isTemplateType()); templateListModel.setIsAvailable(isTemplateDisk(disk)); storageListModel.setIsAvailable(disk.getDiskStorageType() == DiskStorageType.IMAGE || disk.getDiskStorageType() == DiskStorageType.CINDER); } }

Target:
protected void updateDetailsAvailability() { if (getSelectedItem() != null) { Disk disk = getSelectedItem(); vmListModel.setIsAvailable(!isTemplateDisk(disk)); templateListModel.setIsAvailable(isTemplateDisk(disk)); storageListModel.setIsAvailable(disk.getDiskStorageType() == DiskStorageType.IMAGE || disk.getDiskStorageType() == DiskStorageType.CINDER); } }
Source:
static void addCommitStep(final OperationContext context, final ConfigurationPersistence configurationPersistence) { context.addStep(new CommitOperationStepHandler(configurationPersistence), Stage.RUNTIME); final Collection<OperationStepHandler> afterCommitSteps = context.getAttachment(AFTER_COMMIT_STEPS); if (afterCommitSteps != null && !afterCommitSteps.isEmpty()) { for (OperationStepHandler step : afterCommitSteps) { context.addStep(step, Stage.RUNTIME); } context.addStep(new CommitOperationStepHandler(configurationPersistence), Stage.RUNTIME); } }

Target:
static void addCommitStep(final OperationContext context, final ConfigurationPersistence configurationPersistence) { context.addStep(new CommitOperationStepHandler(configurationPersistence), Stage.RUNTIME); final Collection<OperationStepHandler> afterCommitSteps = context.detach(AFTER_COMMIT_STEPS); if (afterCommitSteps != null && !afterCommitSteps.isEmpty()) { for (OperationStepHandler step : afterCommitSteps) { context.addStep(step, Stage.RUNTIME); } context.addStep(new CommitOperationStepHandler(configurationPersistence), Stage.RUNTIME); } }
Source:
protected Type getNewMethodType(ASTRewrite rewrite, ImportRewriteContext context) throws CoreException { AST ast= rewrite.getAST(); return ast.newSimpleType(ast.newSimpleName(fReturnType)); }

Target:
protected Type getNewMethodType(ASTRewrite rewrite, ImportRewriteContext context) throws CoreException { AST ast= rewrite.getAST(); getImportRewrite().addImport(fReturnType.getFullyQualifiedName()); return ast.newSimpleType(ast.newSimpleName(fReturnType.getElementName())); }
Source:
protected GetFeatureRequest createGetFeature(Query query, ResultType resultType) throws IOException { GetFeatureRequest request = client.createGetFeatureRequest(); final WFSDataStore dataStore = getDataStore(); final QName remoteTypeName = dataStore.getRemoteTypeName(getEntry().getName()); final SimpleFeatureType remoteSimpleFeatureType; remoteSimpleFeatureType = dataStore.getRemoteSimpleFeatureType(remoteTypeName); request.setTypeName(remoteTypeName); request.setFullType(remoteSimpleFeatureType); removeFastBBOXFilterIfNeeded(query); invertAxisInFilterIfNeeded(query, remoteSimpleFeatureType); request.setFilter(query.getFilter()); request.setResultType(resultType); request.setHints(query.getHints()); int maxFeatures = query.getMaxFeatures(); if (Integer.MAX_VALUE > maxFeatures) { request.setMaxFeatures(maxFeatures); } request.setPropertyNames(query.getPropertyNames()); request.setSortBy(query.getSortBy()); String srsName = getSupportedSrsName(request, query); request.setSrsName(srsName); return request; }

Target:
protected GetFeatureRequest createGetFeature(Query query, ResultType resultType) throws IOException { GetFeatureRequest request = client.createGetFeatureRequest(); final WFSDataStore dataStore = getDataStore(); final QName remoteTypeName = dataStore.getRemoteTypeName(getEntry().getName()); final SimpleFeatureType remoteSimpleFeatureType; remoteSimpleFeatureType = dataStore.getRemoteSimpleFeatureType(remoteTypeName); request.setTypeName(remoteTypeName); request.setFullType(remoteSimpleFeatureType); invertAxisInFilterIfNeeded(query, remoteSimpleFeatureType); request.setFilter(query.getFilter()); request.setResultType(resultType); request.setHints(query.getHints()); int maxFeatures = query.getMaxFeatures(); if (Integer.MAX_VALUE > maxFeatures) { request.setMaxFeatures(maxFeatures); } request.setPropertyNames(query.getPropertyNames()); request.setSortBy(query.getSortBy()); String srsName = getSupportedSrsName(request, query); request.setSrsName(srsName); return request; }
Source:
private V computeInternal(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction, boolean computeIfPresent, Metadata metadata, long flags) { return computeInternal(key, remappingFunction, computeIfPresent, metadata, flags, this::singleKeyContextWithImplicitTransaction); }

Target:
private V computeInternal(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction, boolean computeIfPresent, Metadata metadata, long flags) { return computeInternal(key, remappingFunction, computeIfPresent, metadata, flags, contextBuilder); }
Source:
public Computation execute(String program) { return new Computation(this.transport, program, new HashMap<String, String>(), false); }

Target:
public Computation execute(String program) { return new Computation(this.transport, program, Collections.<String, String> emptyMap(), false); }
Source:
public void changeSharingScope() throws Exception { TestUtils.mockPlay().withJsonBody("{\"scope\":\"all_qualified_researchers\"}").mock(); Result result = controller.changeSharingScope(); assertEquals(200, result.status()); UserSession retrievedSession = TestUtils.getResponsePayload(result, UserSession.class); assertEquals(ORIGINAL_SESSION_TOKEN, retrievedSession.getSessionToken()); verify(accountDao).editAccount(eq(TestConstants.TEST_STUDY), eq(HEALTH_CODE), any()); verify(sessionUpdateService).updateSharingScope(session, SharingScope.ALL_QUALIFIED_RESEARCHERS); }

Target:
public void changeSharingScope() throws Exception { TestUtils.mockPlay().withJsonBody("{\"scope\":\"all_qualified_researchers\"}").mock(); Result result = controller.changeSharingScope(); assertEquals(200, result.status()); UserSession retrievedSession = TestUtils.getResponsePayload(result, UserSession.class); assertEquals(ORIGINAL_SESSION_TOKEN, retrievedSession.getSessionToken()); verify(accountDao).editAccount(eq(TestConstants.TEST_STUDY), eq(HEALTH_CODE), accountConsumerCaptor.capture()); verify(sessionUpdateService).updateSharingScope(session, SharingScope.ALL_QUALIFIED_RESEARCHERS); Consumer<Account> accountConsumer = accountConsumerCaptor.getValue(); Account account = Mockito.mock(Account.class); accountConsumer.accept(account); verify(account).setSharingScope(SharingScope.ALL_QUALIFIED_RESEARCHERS); }
Source:
public Void visit(GenContext state, Case ast) { return null; }

Target:
public Void visit(GenContext state, Case ast) { ast.getAST().acceptVisitor(this, state); return null; }
Source:
private void printSession(RestSession session) { ln("session id: %d", session.getId()); ln("attempt id: %s", session.getLastAttempt().transform(a -> String.valueOf(a.getId())).or("")); ln("uuid: %s", session.getSessionUuid()); ln("project: %s", session.getProject().getName()); ln("workflow: %s", session.getWorkflow().getName()); ln("session time: %s", TimeUtil.formatTime(session.getSessionTime())); ln("retry attempt name: %s", session.getLastAttempt().transform(a -> a.getRetryAttemptName().or("")).or("")); ln("params: %s", session.getLastAttempt().transform(a -> a.getParams().toString()).or("")); ln("created at: %s", session.getLastAttempt().transform(a -> TimeUtil.formatTime(a.getCreatedAt())).or("")); ln("kill requested: %s", session.getLastAttempt().transform(a -> a.getCancelRequested()).or(false)); ln("status: %s", status(session)); ln(""); }

Target:
private void printSession(RestSession session) throws IOException { EntityPrinter<RestSession> printer = new EntityPrinter<>(); printer.field("session id", s -> Long.toString(s.getId())); printer.field("attempt id", s -> s.getLastAttempt().transform(a -> Long.toString(a.getId())).or("")); printer.field("uuid", s -> s.getSessionUuid().toString()); printer.field("project", s -> s.getProject().getName()); printer.field("workflow", s -> s.getWorkflow().getName()); printer.field("session time", s -> TimeUtil.formatTime(s.getSessionTime())); printer.field("retry attempt name", s -> s.getLastAttempt().transform(a -> a.getRetryAttemptName().or("")).or("")); printer.field("params", s -> s.getLastAttempt().transform(a -> a.getParams().toString()).or("")); printer.field("created at", s -> s.getLastAttempt().transform(a -> TimeUtil.formatTime(a.getCreatedAt())).or("")); printer.field("kill requested", s -> Boolean.toString(s.getLastAttempt().transform(a -> a.getCancelRequested()).or(false))); printer.field("status", this::status); printer.print(format, session, out); }
Source:
public static JsonSchema generateJsonSchema(JsonSchemaExternalType jsonTypeDefinition) throws IOException, ProcessingException { String includedResourceURI = null; TypeDeclarationNode typeDeclarationNode = jsonTypeDefinition.getTypeDeclarationNode(); List<ExternalSchemaTypeExpressionNode> schemas = typeDeclarationNode.findDescendantsWith(ExternalSchemaTypeExpressionNode.class); if (schemas.size() > 0) { includedResourceURI = schemas.get(0).getStartPosition().getIncludedResourceURI(); } else { List<NamedTypeExpressionNode> refNode = typeDeclarationNode.findDescendantsWith(NamedTypeExpressionNode.class); if (refNode.size() > 0) { typeDeclarationNode = refNode.get(0).resolveReference(); if (typeDeclarationNode != null) { schemas = typeDeclarationNode.findDescendantsWith(ExternalSchemaTypeExpressionNode.class); if (schemas.size() > 0) { includedResourceURI = schemas.get(0).getStartPosition().getIncludedResourceURI(); } } } } JsonNode jsonSchema = JsonLoader.fromString(jsonTypeDefinition.getSchemaValue()); JsonSchemaFactory factory = JsonSchemaFactory.newBuilder().freeze(); if (jsonTypeDefinition.getInternalFragment() != null) { return factory.getJsonSchema(jsonSchema, "/definitions/" + jsonTypeDefinition.getInternalFragment()); } else { if (includedResourceURI != null) { return factory.getJsonSchema(includedResourceURI); } else { return factory.getJsonSchema(jsonSchema); } } }

Target:
public static JsonSchema generateJsonSchema(JsonSchemaExternalType jsonTypeDefinition) throws IOException, ProcessingException { String includedResourceUri = resolveResourceUriIfIncluded(jsonTypeDefinition); JsonNode jsonSchema = JsonLoader.fromString(jsonTypeDefinition.getSchemaValue()); JsonSchemaFactory factory = JsonSchemaFactory.newBuilder().freeze(); if (jsonTypeDefinition.getInternalFragment() != null) { return factory.getJsonSchema(jsonSchema, "/definitions/" + jsonTypeDefinition.getInternalFragment()); } else { if (includedResourceUri != null) { return factory.getJsonSchema(includedResourceUri); } else { return factory.getJsonSchema(jsonSchema); } } }
Source:
XlsxWriter(Path target, Workbook workbook, TimeZone timeZone) { this.target = requireNonNull(target); this.workbook = requireNonNull(workbook); this.timeZone = requireNonNull(timeZone); this.simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd"); simpleDateFormat.setTimeZone(timeZone); this.simpleDateTimeFormat = new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ssZ"); simpleDateTimeFormat.setTimeZone(timeZone); }

Target:
XlsxWriter(Path target, Workbook workbook, TimeZone timeZone) { this.target = requireNonNull(target); this.workbook = requireNonNull(workbook); this.timeZone = requireNonNull(timeZone); this.simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); simpleDateFormat.setTimeZone(timeZone); this.simpleDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ"); simpleDateTimeFormat.setTimeZone(timeZone); }
Source:
@Ignore @Test public void annotatedArrayType() { TypeName type = ArrayTypeName.of(ClassName.get(Object.class)).annotated(TYPE_USE_ANNOTATION); assertThat(type.toString()).isEqualTo("java.lang.Object @" + TUA + " []"); }

Target:
@Test public void annotatedArrayType() { TypeName type = ArrayTypeName.of(ClassName.get(Object.class)).annotated(TYPE_USE_ANNOTATION); assertThat(type.toString()).isEqualTo("java.lang.Object @" + TUA + " []"); }
Source:
public void writePage(BytesInput bytes, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { long uncompressedSize = bytes.size(); if (uncompressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write page larger than Integer.MAX_VALUE bytes: " + uncompressedSize); } BytesInput compressedBytes = compressor.compress(bytes); long compressedSize = compressedBytes.size(); if (compressedSize > Integer.MAX_VALUE) { throw new ParquetEncodingException( "Cannot write compressed page larger than Integer.MAX_VALUE bytes: " + compressedSize); } tempOutputStream.reset(); final PageHeader pageHeader = parquetMetadataConverter.writeDataPageHeader( (int)uncompressedSize, (int)compressedSize, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding, tempOutputStream); this.uncompressedLength += uncompressedSize; this.compressedLength += compressedSize; this.totalValueCount += valueCount; this.pageCount += 1; this.totalStatistics.mergeStatistics(statistics); buf.collect(BytesInput.concat(BytesInput.from(tempOutputStream), compressedBytes)); encodings.add(rlEncoding); encodings.add(dlEncoding); encodings.add(valuesEncoding); pageHeaderWithOffsets.add(new PageHeaderWithOffset(pageHeader, -1, tempOutputStream.size())); }

Target:
public void writePage(BytesInput bytes, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding) throws IOException { bufferedPages.add(new PageV1Holder(pageCount, bytes, valueCount, statistics, rlEncoding, dlEncoding, valuesEncoding)); }
Source:
public void testArcUserAssigned() throws Exception { Configuration configuration = Configuration.getGlobalConfiguration(); String token1 = "token1"; String endpoint = "http://localhost"; TokenRequestContext request = new TokenRequestContext().addScopes("<LINK_0>"); OffsetDateTime expiresOn = OffsetDateTime.now(ZoneOffset.UTC).plusHours(1); configuration.put("IDENTITY_ENDPOINT", endpoint); configuration.put("IMDS_ENDPOINT", endpoint); ManagedIdentityCredential credential = new ManagedIdentityCredentialBuilder().clientId(CLIENT_ID).build(); StepVerifier.create(credential.getToken(request)) .expectError(CredentialUnavailableException.class); }

Target:
public void testArcUserAssigned() throws Exception { Configuration configuration = Configuration.getGlobalConfiguration().clone(); String token1 = "token1"; String endpoint = "http://localhost"; TokenRequestContext request = new TokenRequestContext().addScopes("<LINK_0>"); configuration.put("IDENTITY_ENDPOINT", endpoint); configuration.put("IMDS_ENDPOINT", endpoint); ManagedIdentityCredential credential = new ManagedIdentityCredentialBuilder().clientId(CLIENT_ID).build(); StepVerifier.create(credential.getToken(request)) .expectErrorMatches(t -> t instanceof ClientAuthenticationException) .verify(); }
Source:
public JSONObject listAllBoxesTable(HttpSession session, JSONObject json) { try { JSONObject j = new JSONObject(); JSONArray jsonArray = new JSONArray(); for (Box box : requestManager.listAllBoxes()) { int filledSpaces = box.getSize().getRows() * box.getSize().getColumns() - box.getFree(); int availableSpaces = box.getSize().getRows() * box.getSize().getColumns(); JSONArray inner = new JSONArray(); inner.add(TableHelper.hyperLinkify("/miso/box/" + box.getId(), box.getName())); inner.add(TableHelper.hyperLinkify("/miso/box/" + box.getId(), box.getAlias())); inner.add(box.getLocationBarcode()); inner.add(filledSpaces + "/" + availableSpaces); inner.add(box.getSize().getRows() + "x" + box.getSize().getColumns()); inner.add(box.getUse().getAlias()); inner.add(isStringEmptyOrNull(box.getIdentificationBarcode()) ? "" : box.getIdentificationBarcode()); jsonArray.add(inner); } j.put("array", jsonArray); return j; } catch (IOException e) { log.debug("Failed", e); return JSONUtils.SimpleJSONError("Failed: " + e.getMessage()); } }

Target:
public JSONObject listAllBoxesTable(HttpSession session, JSONObject json) { try { JSONObject j = new JSONObject(); JSONArray jsonArray = new JSONArray(); for (Box box : requestManager.listAllBoxes()) { int filledSpaces = box.getSize().getRows() * box.getSize().getColumns() - box.getFree(); int availableSpaces = box.getSize().getRows() * box.getSize().getColumns(); JSONArray inner = new JSONArray(); inner.add(TableHelper.hyperLinkify("/miso/box/" + box.getId(), box.getName())); inner.add(TableHelper.hyperLinkify("/miso/box/" + box.getId(), box.getAlias())); inner.add(box.getLocationBarcode()); inner.add(filledSpaces + "/" + availableSpaces); inner.add(box.getSize().getRows() + "x" + box.getSize().getColumns()); inner.add(isStringEmptyOrNull(box.getLocationBarcode()) ? "" : box.getLocationBarcode()); inner.add(box.getUse().getAlias()); inner.add(isStringEmptyOrNull(box.getIdentificationBarcode()) ? "" : box.getIdentificationBarcode()); jsonArray.add(inner); } j.put("array", jsonArray); return j; } catch (IOException e) { log.debug("Failed", e); return JSONUtils.SimpleJSONError("Failed: " + e.getMessage()); } }
Source:
public CompiledExpression compile(String expression, CompilerContext ctx) { FEEL_1_1Parser parser = FEELParser.parse(getEventsManager(ctx.getListeners()), expression, ctx.getInputVariableTypes(), ctx.getInputVariables(), ctx.getFEELFunctions(), profiles); ParseTree tree = parser.compilation_unit(); if (!doCompile) { ASTBuilderVisitor v = new ASTBuilderVisitor(ctx.getInputVariableTypes()); BaseNode expr = v.visit(tree); CompiledExpression ce = new CompiledExpressionImpl(expr); return ce; } else { DirectCompilerVisitor v = new DirectCompilerVisitor(ctx.getInputVariableTypes()); DirectCompilerResult directResult = v.visit(tree); Expression expr = directResult.getExpression(); CompiledFEELExpression cu = new CompilerBytecodeLoader().makeFromJPExpression(expression, expr, directResult.getFieldDeclarations()); return cu; } }

Target:
public CompiledExpression compile(String expression, CompilerContext ctx) { if (doCompile) { Set<FEELEventListener> listeners = new HashSet<>(ctx.getListeners()); CompilerErrorListener errorListener = new CompilerErrorListener(); listeners.add(errorListener); FEEL_1_1Parser parser = FEELParser.parse(getEventsManager(listeners), expression, ctx.getInputVariableTypes(), ctx.getInputVariables(), ctx.getFEELFunctions(), profiles); ParseTree tree = parser.compilation_unit(); if (errorListener.evt != null) { return compiledError(expression, errorListener.evt.getMessage()); } try { DirectCompilerVisitor v = new DirectCompilerVisitor(ctx.getInputVariableTypes()); DirectCompilerResult directResult = v.visit(tree); Expression expr = directResult.getExpression(); return new CompilerBytecodeLoader().makeFromJPExpression(expression, expr, directResult.getFieldDeclarations()); } catch (FEELCompilationError e) { return compiledError(expression, e.getMessage()); } } else { FEEL_1_1Parser parser = FEELParser.parse(getEventsManager(ctx.getListeners()), expression, ctx.getInputVariableTypes(), ctx.getInputVariables(), ctx.getFEELFunctions(), profiles); ParseTree tree = parser.compilation_unit(); ASTBuilderVisitor v = new ASTBuilderVisitor(ctx.getInputVariableTypes()); BaseNode expr = v.visit(tree); CompiledExpression ce = new CompiledExpressionImpl(expr); return ce; } }
Source:
public D create(Map<String,String> parameters) { D result = ClassLoaderHelper.untypedInstanceFromClass( targetClass, "Analyzer definition" ); Map<String, JsonElement> parameterMap = new LinkedHashMap<>(); for ( Entry<String, String> parameter : parameters.entrySet() ) { String name = parameter.getKey(); String value = parameter.getValue(); switch ( name ) { case "type": result.setType( parseJsonString( name, value ) ); break; default: parameterMap.put( name, parseJson( name, value ) ); break; } } if ( !parameterMap.isEmpty() ) { result.setParameters( parameterMap ); } return result; }

Target:
public D create(Map<String,String> parameters) { D result = ClassLoaderHelper.untypedInstanceFromClass( targetClass, "analysis definition" ); Map<String, JsonElement> parameterMap = new LinkedHashMap<>(); for ( Entry<String, String> parameter : parameters.entrySet() ) { String name = parameter.getKey(); String value = parameter.getValue(); switch ( name ) { case "type": result.setType( parseJsonString( name, value ) ); break; default: parameterMap.put( name, parseJson( name, value ) ); break; } } if ( !parameterMap.isEmpty() ) { result.setParameters( parameterMap ); } return result; }
Source:
public String toString() { long columnCount = getColumnCount(); StringBuilder stringBuilder = new StringBuilder("This TableView "); stringBuilder.append("contains "); stringBuilder.append(columnCount); stringBuilder.append(" columns: "); for (int i = 0; i < columnCount; i++) { if (i != 0) { stringBuilder.append(", "); } stringBuilder.append(getColumnName(i)); } stringBuilder.append("."); stringBuilder.append(" And "); stringBuilder.append(size()); stringBuilder.append(" rows."); return stringBuilder.toString(); }

Target:
public String toString() { long columnCount = getColumnCount(); StringBuilder stringBuilder = new StringBuilder("The TableView "); stringBuilder.append("contains "); stringBuilder.append(columnCount); stringBuilder.append(" columns: "); for (int i = 0; i < columnCount; i++) { if (i != 0) { stringBuilder.append(", "); } stringBuilder.append(getColumnName(i)); } stringBuilder.append("."); stringBuilder.append(" And "); stringBuilder.append(size()); stringBuilder.append(" rows."); return stringBuilder.toString(); }
Source:
private void setupToolbar() { setTitle(getResources().getText(R.string.jetpack_security_setting_title)); Toolbar toolbar = findViewById(org.wordpress.mobile.ReactNativeGutenbergBridge.R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeAsUpIndicator(R.drawable.ic_close_24px); actionBar.setSubtitle(""); } } }

Target:
private void setupToolbar() { setTitle(getResources().getText(R.string.jetpack_security_setting_title)); Toolbar toolbar = findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeAsUpIndicator(R.drawable.ic_close_24px); actionBar.setSubtitle(""); } } }
Source:
public CdaTemplate(String templateName, Byte[] templateData, Map<String, String> properties) { this.templateName = templateName; if (templateData != null) { byte[] bytes = new byte[templateData.length]; int i = 0; for (Byte b : templateData) { bytes[i++] = b.byteValue(); } String templateString = new String(bytes); Pattern regex = Pattern.compile("(?s)<!--.*?-->", Pattern.DOTALL); Matcher regexMatcher = regex.matcher(templateString); templateString = regexMatcher.replaceAll(""); templateString.replaceAll("(?s)<!--.*?-->", ""); bytes = templateString.getBytes(); Byte[] byteObjects = new Byte[bytes.length]; i = 0; for (byte b : bytes) { byteObjects[i++] = new Byte(b); } this.templateData = byteObjects.clone(); } else { this.templateData = ArrayUtils.EMPTY_BYTE_OBJECT_ARRAY; } this.properties = properties; }

Target:
public CdaTemplate(String templateName, Byte[] templateData, Map<String, String> properties) { this.templateName = templateName; if (templateData != null) { this.templateData = removeCommentsFromTemplate(templateData).clone(); } else { this.templateData = ArrayUtils.EMPTY_BYTE_OBJECT_ARRAY; } this.properties = properties; }
Source:
public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class); if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) { boolean isIndexed = cfg.indexing().index().isEnabled(); AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader()); SearchIntegrator searchFactory = null; if (isIndexed) { log.registeringQueryInterceptor(cacheName); cr.registerComponent(new ShardAllocationManagerImpl(), ShardAllocatorManager.class); searchFactory = createSearchIntegrator(cfg.indexing(), cr, aggregatedClassLoader); createQueryInterceptorIfNeeded(cr, cfg, searchFactory); addCacheDependencyIfNeeded(cacheName, cache.getCacheManager(), cfg.indexing()); CommandInitializer initializer = cr.getComponent(CommandInitializer.class); initializer.setCacheManager(cache.getCacheManager()); cr.registerComponent(new QueryBox(), QueryBox.class); } registerMatcher(cr, searchFactory, aggregatedClassLoader); EmbeddedQueryEngine queryEngine = new EmbeddedQueryEngine(cache, isIndexed); cr.registerComponent(queryEngine, EmbeddedQueryEngine.class); } }

Target:
public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) { InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class); if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) { AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache(); ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader()); SearchIntegrator searchFactory = null; boolean isIndexed = cfg.indexing().index().isEnabled(); if (isIndexed) { cr.registerComponent(new ShardAllocationManagerImpl(), ShardAllocatorManager.class); searchFactory = createSearchIntegrator(cfg.indexing(), cr, aggregatedClassLoader); createQueryInterceptorIfNeeded(cr, cfg, cache, searchFactory); addCacheDependencyIfNeeded(cacheName, cache.getCacheManager(), cfg.indexing()); CommandInitializer initializer = cr.getComponent(CommandInitializer.class); initializer.setCacheManager(cache.getCacheManager()); cr.registerComponent(new QueryBox(), QueryBox.class); } registerMatcher(cr, searchFactory, aggregatedClassLoader); EmbeddedQueryEngine queryEngine = new EmbeddedQueryEngine(cache, isIndexed); cr.registerComponent(queryEngine, EmbeddedQueryEngine.class); } }
Source:
public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); localization = new LocalizationPrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); lastGameType = new SimpleStringProperty(KnownFeaturedMod.DEFAULT.getTechnicalName()); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); rememberLastTab = new SimpleBooleanProperty(true); lastGameTitle = new SimpleStringProperty(); lastMap = new SimpleStringProperty(); lastGameMinRating = new SimpleIntegerProperty(800); lastGameMaxRating = new SimpleIntegerProperty(1300); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.RACKOVER); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); lastGameOnlyFriends = new SimpleBooleanProperty(); disallowJoinsViaDiscord = new SimpleBooleanProperty(false); }

Target:
public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); localization = new LocalizationPrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); lastGameType = new SimpleStringProperty(KnownFeaturedMod.DEFAULT.getTechnicalName()); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); rememberLastTab = new SimpleBooleanProperty(true); lastGameTitle = new SimpleStringProperty(); lastMap = new SimpleStringProperty(); lastGameMinRating = new SimpleIntegerProperty(800); lastGameMaxRating = new SimpleIntegerProperty(1300); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.RACKOVER); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); lastGameOnlyFriends = new SimpleBooleanProperty(); disallowJoinsViaDiscord = new SimpleBooleanProperty(); }
Source:
private void createGroup() throws OrmException { AccountGroup.Id groupId = new AccountGroup.Id(db.nextAccountGroupId()); AccountGroup.NameKey nameKey = new AccountGroup.NameKey(groupName); AccountGroup group = new AccountGroup(nameKey, groupId); if (ownerGroupId != null) { group.setOwnerGroupId(ownerGroupId); } if (groupDescription != null) { group.setDescription(groupDescription); } db.accountGroups().insert(Collections.singleton(group)); AccountGroupName groupName = new AccountGroupName(group); db.accountGroupNames().insert(Collections.singleton(groupName)); List<AccountGroupMember> memberships = new ArrayList<AccountGroupMember>(); List<AccountGroupMemberAudit> membershipsAudit = new ArrayList<AccountGroupMemberAudit>(); for (String userName : initialMembers) { AccountExternalId.Key key = new AccountExternalId.Key(SCHEME_USERNAME, userName); Account.Id accountId = db.accountExternalIds().get(key).getAccountId(); AccountGroupMember membership = new AccountGroupMember(new AccountGroupMember.Key(accountId, groupId)); memberships.add(membership); AccountGroupMemberAudit audit = new AccountGroupMemberAudit(membership, currentUser.getAccountId()); membershipsAudit.add(audit); } db.accountGroupMembers().insert(memberships); db.accountGroupMembersAudit().insert(membershipsAudit); }

Target:
private void createGroup() throws OrmException, UnloggedFailure { AccountGroup.Id groupId = new AccountGroup.Id(db.nextAccountGroupId()); AccountGroup.NameKey nameKey = new AccountGroup.NameKey(groupName); AccountGroup group = new AccountGroup(nameKey, groupId); if (ownerGroupId != null) { group.setOwnerGroupId(ownerGroupId); } if (groupDescription != null) { group.setDescription(groupDescription); } AccountGroupName gn = new AccountGroupName(group); try { db.accountGroupNames().insert(Collections.singleton(gn)); } catch (OrmDuplicateKeyException e) { throw die("group '" + groupName + "' already exists"); } db.accountGroups().insert(Collections.singleton(group)); List<AccountGroupMember> memberships = new ArrayList<AccountGroupMember>(); List<AccountGroupMemberAudit> membershipsAudit = new ArrayList<AccountGroupMemberAudit>(); for (Account.Id accountId : initialMembers) { AccountGroupMember membership = new AccountGroupMember(new AccountGroupMember.Key(accountId, groupId)); memberships.add(membership); AccountGroupMemberAudit audit = new AccountGroupMemberAudit(membership, currentUser.getAccountId()); membershipsAudit.add(audit); } db.accountGroupMembers().insert(memberships); db.accountGroupMembersAudit().insert(membershipsAudit); }
Source:
public boolean equals(final Object that) { return Equal.equals0(Natural.class, this, that, Equal.equal(l -> r -> l.value.equals(r.value))); }

Target:
public boolean equals(final Object that) { return Equal.equals0(Natural.class, this, that, Equal.naturalEqual); }
Source:
private boolean isTransientAuthentication(Authentication authentication) { if (authentication == null ) { return false; } return AnnotationUtils.getAnnotation(authentication.getClass(), TransientAuthentication.class) != null; }

Target:
private boolean isTransientAuthentication(Authentication authentication) { return AnnotationUtils.getAnnotation(authentication.getClass(), TransientAuthentication.class) != null; }
Source:
public void shouldWrapExceptionIntoStorIOExceptionForObservable() { final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class); when(storIOSQLite.observeChangesInTables(eq(singleton("test_table")))) .thenReturn(Observable.<Changes>empty()); final GetResolver<Integer> getResolver = mock(GetResolver.class); when(getResolver.performGet(eq(storIOSQLite), any(Query.class))) .thenThrow(new IllegalStateException("test exception")); final TestSubscriber<Integer> testSubscriber = new TestSubscriber<Integer>(); new PreparedGetNumberOfResults.Builder(storIOSQLite) .withQuery(Query.builder().table("test_table").build()) .withGetResolver(getResolver) .prepare() .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(60, SECONDS); testSubscriber.assertError(StorIOException.class); StorIOException storIOException = (StorIOException) testSubscriber.getOnErrorEvents().get(0); IllegalStateException cause = (IllegalStateException) storIOException.getCause(); assertThat(cause).hasMessage("test exception"); testSubscriber.unsubscribe(); }

Target:
public void shouldWrapExceptionIntoStorIOExceptionForObservable() { final StorIOSQLite storIOSQLite = mock(StorIOSQLite.class); when(storIOSQLite.observeChangesInTables(eq(singleton("test_table")))) .thenReturn(Observable.<Changes>empty()); final GetResolver<Integer> getResolver = mock(GetResolver.class); when(getResolver.performGet(eq(storIOSQLite), any(Query.class))) .thenThrow(new IllegalStateException("test exception")); final TestSubscriber<Integer> testSubscriber = new TestSubscriber<Integer>(); new PreparedGetNumberOfResults.Builder(storIOSQLite) .withQuery(Query.builder().table("test_table").build()) .withGetResolver(getResolver) .prepare() .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(60, SECONDS); testSubscriber.assertError(StorIOException.class); assertThat(testSubscriber.getOnErrorEvents()).hasSize(1); StorIOException storIOException = (StorIOException) testSubscriber.getOnErrorEvents().get(0); IllegalStateException cause = (IllegalStateException) storIOException.getCause(); assertThat(cause).hasMessage("test exception"); testSubscriber.unsubscribe(); }
Source:
private void setDebugStatus( String message ) { if ( debug ) { log.setLogLevel(LogLevel.DEBUG); log.logDebug( message ); } }

Target:
private void setDebugStatus( String message ) { if ( log.isDebug() ) { log.logDebug( message ); } }
Source:
private static void initializeRealm(Realm realm) { long version = realm.getVersion(); boolean commitNeeded = false; try { realm.beginTransaction(); if (version == UNVERSIONED) { commitNeeded = true; realm.setVersion(realm.configuration.getSchemaVersion()); } RealmProxyMediator mediator = realm.configuration.getSchemaMediator(); final Set<Class<? extends RealmObject>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmObject>, ColumnInfo> columnInfoMap; columnInfoMap = new HashMap<Class<? extends RealmObject>, ColumnInfo>(modelClasses.size()); for (Class<? extends RealmObject> modelClass : modelClasses) { if (version == UNVERSIONED) { mediator.createTable(modelClass, realm.sharedGroupManager.getTransaction()); } columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedGroupManager.getTransaction())); } realm.schema.columnIndices = new ColumnIndices(columnInfoMap); final Transaction transaction = realm.getConfiguration().getInitialDataTransaction(); if (transaction != null) { transaction.execute(realm); } } finally { if (commitNeeded) { realm.commitTransaction(false, null); } else { realm.cancelTransaction(); } } }

Target:
private static void initializeRealm(Realm realm) { long version = realm.getVersion(); boolean commitNeeded = false; try { realm.beginTransaction(); if (version == UNVERSIONED) { commitNeeded = true; realm.setVersion(realm.configuration.getSchemaVersion()); } RealmProxyMediator mediator = realm.configuration.getSchemaMediator(); final Set<Class<? extends RealmObject>> modelClasses = mediator.getModelClasses(); final Map<Class<? extends RealmObject>, ColumnInfo> columnInfoMap; columnInfoMap = new HashMap<Class<? extends RealmObject>, ColumnInfo>(modelClasses.size()); for (Class<? extends RealmObject> modelClass : modelClasses) { if (version == UNVERSIONED) { mediator.createTable(modelClass, realm.sharedGroupManager.getTransaction()); } columnInfoMap.put(modelClass, mediator.validateTable(modelClass, realm.sharedGroupManager.getTransaction())); } realm.schema.columnIndices = new ColumnIndices(columnInfoMap); if (version == UNVERSIONED) { final Transaction transaction = realm.getConfiguration().getInitialDataTransaction(); if (transaction != null) { transaction.execute(realm); } } } finally { if (commitNeeded) { realm.commitTransaction(false, null); } else { realm.cancelTransaction(); } } }
Source:
public Mono<MsalToken> authenticateWithPublicClientCache(TokenRequestContext request, IAccount account) { return Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder parametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())); if (account != null) { parametersBuilder = parametersBuilder.account(account); } try { return getPublicClientApplication(false) .acquireTokenSilently(parametersBuilder.build()); } catch (MalformedURLException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }).map(ar -> new MsalToken(ar, options)) .filter(t -> !t.isExpired()) .switchIfEmpty(Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder forceParametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())).forceRefresh(true); if (account != null) { forceParametersBuilder = forceParametersBuilder.account(account); } try { return getPublicClientApplication(false).acquireTokenSilently(forceParametersBuilder.build()); } catch (MalformedURLException e) { throw logger.logExceptionAsError(Exceptions.propagate(e)); } }).map(result -> new MsalToken(result, options))); }

Target:
public Mono<MsalToken> authenticateWithPublicClientCache(TokenRequestContext request, IAccount account) { return Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder parametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())); if (account != null) { parametersBuilder = parametersBuilder.account(account); } try { return getPublicClientApplication(false) .acquireTokenSilently(parametersBuilder.build()); } catch (MalformedURLException e) { return getFailedCompletableFuture(logger.logExceptionAsError(new RuntimeException(e))); } }).map(ar -> new MsalToken(ar, options)) .filter(t -> !t.isExpired()) .switchIfEmpty(Mono.fromFuture(() -> { SilentParameters.SilentParametersBuilder forceParametersBuilder = SilentParameters.builder( new HashSet<>(request.getScopes())).forceRefresh(true); if (account != null) { forceParametersBuilder = forceParametersBuilder.account(account); } try { return getPublicClientApplication(false).acquireTokenSilently(forceParametersBuilder.build()); } catch (MalformedURLException e) { return getFailedCompletableFuture(logger.logExceptionAsError(new RuntimeException(e))); } }).map(result -> new MsalToken(result, options))); }
Source:
public Builder useKryoSerializer() { try { config.setSerializationClassName(new KryoSerializer().getClass().getName()); } catch (NoClassDefFoundError e) { throw new RuntimeException("Please link with kryo"); } return this; }

Target:
public Builder useKryoSerializer() { try { config.setSerializationClassName(new KryoSerializer().getClass().getName()); } catch (NoClassDefFoundError e) { throw new RuntimeException("Linking with kryo is needed because useKryoSerializer is used"); } return this; }
Source:
public double min(String colName) { double[] colArray = toDoubleArray(colName); double arrayMin = StatUtils.min(colArray); return arrayMin; }

Target:
public double min(String colName) { return StatUtils.min(toDoubleArray(colName)); }
Source:
final static JSONObject getEnumOrigin(String enumOrigin) { String typeName = enumOrigin.substring(0, enumOrigin.lastIndexOf(".")); JSONArray enums = Simulator.getDatabase().getModelStructure() .getJSONArray("enums"); JSONObject originDeclaration = null; for (int num = 0; num < enums.length(); num++) { JSONObject curType = enums.getJSONObject(num); if (typeName.equals(curType.getString("name"))) { originDeclaration = curType; break; } } return originDeclaration; }

Target:
final static JSONObject getEnumOrigin(String enumOrigin) { String typeName = enumOrigin.substring(0, enumOrigin.lastIndexOf(".")); JSONArray enums = Simulator.getDatabase().getModelStructure() .getJSONArray("enums"); for (int num = 0; num < enums.length(); num++) { JSONObject enumItem = enums.getJSONObject(num); if (typeName.equals(enumItem.getString("name"))) { return enumItem; } } return null; }