idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
328,567
public void register(List<JarScan> jars, int version) {<NEW_LINE>Map<String, List<FunctionHolder>> newJars = new HashMap<>();<NEW_LINE>for (JarScan jarScan : jars) {<NEW_LINE>FunctionConverter converter = new FunctionConverter();<NEW_LINE>List<AnnotatedClassDescriptor> providerClasses = jarScan.getScanResult().getAnnotatedClasses(FunctionTemplate.class.getName());<NEW_LINE>List<FunctionHolder> functions = new ArrayList<>();<NEW_LINE>newJars.put(jarScan.getJarName(), functions);<NEW_LINE>for (AnnotatedClassDescriptor func : providerClasses) {<NEW_LINE>DrillFuncHolder holder = converter.getHolder(<MASK><NEW_LINE>if (holder != null) {<NEW_LINE>String functionInput = holder.getInputParameters();<NEW_LINE>String[] names = holder.getRegisteredNames();<NEW_LINE>for (String name : names) {<NEW_LINE>String functionName = name.toLowerCase();<NEW_LINE>String functionSignature = String.format(functionSignaturePattern, functionName, functionInput);<NEW_LINE>functions.add(new FunctionHolder(functionName, functionSignature, holder));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>registryHolder.addJars(newJars, version);<NEW_LINE>}
func, jarScan.getClassLoader());
1,576,476
final PutAccountSendingAttributesResult executePutAccountSendingAttributes(PutAccountSendingAttributesRequest putAccountSendingAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putAccountSendingAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutAccountSendingAttributesRequest> request = null;<NEW_LINE>Response<PutAccountSendingAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutAccountSendingAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putAccountSendingAttributesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint Email");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutAccountSendingAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutAccountSendingAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutAccountSendingAttributesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,724,956
public void processLocalTransactionStartedEvent(Object handle) throws ResourceException {<NEW_LINE>svLogger.entering(CLASSNAME, "processLocalTransactionStartedEvent", handle);<NEW_LINE>// An application level local transaction has been requested started<NEW_LINE>// The isValid method returns an exception if it is not valid. This allows the<NEW_LINE>// WSStateManager to create a more detailed message than this class could.<NEW_LINE>ResourceException re = stateMgr.isValid(StateManager.LT_BEGIN);<NEW_LINE>if (re == null) {<NEW_LINE>// Already validated the state so just set it. [d139351.19]<NEW_LINE>stateMgr.transtate = StateManager.LOCAL_TRANSACTION_ACTIVE;<NEW_LINE>} else {<NEW_LINE>throw re;<NEW_LINE>}<NEW_LINE>AdapterConnectionEvent event = new AdapterConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED, null, handle);<NEW_LINE><MASK><NEW_LINE>// Notification of the eventListeners must happen after the state change because if the statechange<NEW_LINE>// is illegal, we need to throw an exception. If this exception occurs, we do not want to<NEW_LINE>// notify the cm of the tx started because we are not allowing it to start.<NEW_LINE>// d116090<NEW_LINE>// loop through the listeners<NEW_LINE>for (int i = 0; i < numListeners; i++) {<NEW_LINE>// send Local Transaction Started event to the current listener<NEW_LINE>ivEventListeners[i].localTransactionStarted(event);<NEW_LINE>}<NEW_LINE>svLogger.exiting(CLASSNAME, "processLocalTransactionStartedEvent");<NEW_LINE>}
svLogger.info("Firing LOCAL TRANSACTION STARTED event for: " + handle);
753,147
protected void writeForLoopWithClosureList(final ForStatement statement) {<NEW_LINE>controller.getAcg().onLineNumber(statement, "visitForLoop");<NEW_LINE>writeStatementLabel(statement);<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE>controller.getCompileStack().pushLoop(statement.getVariableScope(), statement.getStatementLabels());<NEW_LINE>ClosureListExpression clExpr = (ClosureListExpression) statement.getCollectionExpression();<NEW_LINE>controller.getCompileStack().pushVariableScope(clExpr.getVariableScope());<NEW_LINE>List<Expression> expressions = clExpr.getExpressions();<NEW_LINE>int size = expressions.size();<NEW_LINE>// middle element is condition, lower half is init, higher half is increment<NEW_LINE>int condIndex = (size - 1) / 2;<NEW_LINE>// visit init<NEW_LINE>for (int i = 0; i < condIndex; i += 1) {<NEW_LINE>visitExpressionOfLoopStatement(expressions.get(i));<NEW_LINE>}<NEW_LINE>Label continueLabel = controller.getCompileStack().getContinueLabel();<NEW_LINE>Label breakLabel = controller.getCompileStack().getBreakLabel();<NEW_LINE>Label cond = new Label();<NEW_LINE>mv.visitLabel(cond);<NEW_LINE>// visit condition leave boolean on stack<NEW_LINE>{<NEW_LINE>int mark = controller.getOperandStack().getStackLength();<NEW_LINE>Expression condExpr = expressions.get(condIndex);<NEW_LINE>condExpr.visit(controller.getAcg());<NEW_LINE>controller.getOperandStack(<MASK><NEW_LINE>}<NEW_LINE>// jump if we don't want to continue<NEW_LINE>// note: ifeq tests for ==0, a boolean is 0 if it is false<NEW_LINE>controller.getOperandStack().jump(IFEQ, breakLabel);<NEW_LINE>// Generate the loop body<NEW_LINE>statement.getLoopBlock().visit(controller.getAcg());<NEW_LINE>// visit increment<NEW_LINE>mv.visitLabel(continueLabel);<NEW_LINE>// fix for being on the wrong line when debugging for loop<NEW_LINE>controller.getAcg().onLineNumber(statement, "increment condition");<NEW_LINE>for (int i = condIndex + 1; i < size; i += 1) {<NEW_LINE>visitExpressionOfLoopStatement(expressions.get(i));<NEW_LINE>}<NEW_LINE>// jump to test the condition again<NEW_LINE>mv.visitJumpInsn(GOTO, cond);<NEW_LINE>// loop end<NEW_LINE>mv.visitLabel(breakLabel);<NEW_LINE>controller.getCompileStack().pop();<NEW_LINE>controller.getCompileStack().pop();<NEW_LINE>}
).castToBool(mark, true);
1,361,410
final UpdateTagOptionResult executeUpdateTagOption(UpdateTagOptionRequest updateTagOptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateTagOptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateTagOptionRequest> request = null;<NEW_LINE>Response<UpdateTagOptionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateTagOptionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateTagOptionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateTagOption");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateTagOptionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateTagOptionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
827,710
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<NEW_LINE>if (req.getRequestURI().endsWith("logout")) {<NEW_LINE>UriBuilder redirectUriBuilder = UriBuilder.fromUri(ServletTestUtils.getUrlBase() + "/offline-client");<NEW_LINE>if (req.getParameter(OAuth2Constants.SCOPE) != null) {<NEW_LINE>redirectUriBuilder.queryParam(OAuth2Constants.SCOPE, req.getParameter(OAuth2Constants.SCOPE));<NEW_LINE>}<NEW_LINE>String redirectUri = redirectUriBuilder.build().toString();<NEW_LINE>String serverLogoutRedirect = UriBuilder.fromUri(ServletTestUtils.getAuthServerUrlBase() + "/auth/realms/test/protocol/openid-connect/logout").queryParam("redirect_uri", redirectUri)<MASK><NEW_LINE>resp.sendRedirect(serverLogoutRedirect);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder response = new StringBuilder("<html><head><title>Offline token servlet</title></head><body><pre>");<NEW_LINE>String tokens = renderTokens(req);<NEW_LINE>response = response.append(tokens);<NEW_LINE>response.append("</pre></body></html>");<NEW_LINE>resp.getWriter().println(response.toString());<NEW_LINE>}
.build().toString();
1,681,313
private static void convertMoveCompilationUnitChange(WorkspaceEdit edit, MoveCompilationUnitChange change) throws JavaModelException {<NEW_LINE>IPackageFragment newPackage = change.getDestinationPackage();<NEW_LINE>ICompilationUnit unit = change.getCu();<NEW_LINE>CompilationUnit astCU = RefactoringASTParser.parseWithASTProvider(unit, true, new NullProgressMonitor());<NEW_LINE>ASTRewrite rewrite = ASTRewrite.create(astCU.getAST());<NEW_LINE>IPackageDeclaration[] packDecls = unit.getPackageDeclarations();<NEW_LINE>String oldPackageName = packDecls.length > 0 ? packDecls[0].getElementName() : "";<NEW_LINE>if (!Objects.equals(oldPackageName, newPackage.getElementName())) {<NEW_LINE>// update the package declaration<NEW_LINE>if (updatePackageStatement(astCU, newPackage.getElementName(), rewrite, unit)) {<NEW_LINE>convertTextEdit(edit, unit, rewrite.rewriteAST());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RenameFile cuResourceChange = new RenameFile();<NEW_LINE>cuResourceChange.setOldUri<MASK><NEW_LINE>IPath newCUPath = newPackage.getResource().getLocation().append(unit.getPath().lastSegment());<NEW_LINE>String newUri = ResourceUtils.fixURI(newCUPath.toFile().toURI());<NEW_LINE>cuResourceChange.setNewUri(newUri);<NEW_LINE>edit.getDocumentChanges().add(Either.forRight(cuResourceChange));<NEW_LINE>}
(JDTUtils.toURI(unit));
341,666
private void load() {<NEW_LINE>ApplicationRegistry appRegistry = habitat.<ApplicationRegistry>getService(ApplicationRegistry.class);<NEW_LINE>ApplicationInfo appInfo = appRegistry.get(AdminConsoleAdapter.ADMIN_APP_NAME);<NEW_LINE>if (appInfo != null && appInfo.isLoaded()) {<NEW_LINE>// Application is already loaded<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// hook for Jerome<NEW_LINE>Application config = adapter.getConfig();<NEW_LINE>if (config == null) {<NEW_LINE>throw new IllegalStateException("Admin Console application has no system app entry!");<NEW_LINE>}<NEW_LINE>// Set adapter state<NEW_LINE>adapter.setStateMsg(AdapterState.APPLICATION_LOADING);<NEW_LINE>// Load the Admin Console Application<NEW_LINE>String sn = env.getInstanceName();<NEW_LINE>// FIXME: An exception may not be thrown... check for errors!<NEW_LINE>ApplicationRef ref = domain.getApplicationRefInServer(sn, AdminConsoleAdapter.ADMIN_APP_NAME);<NEW_LINE>Deployment lifecycle = habitat.getService(Deployment.class);<NEW_LINE>for (Deployment.ApplicationDeployment depl : habitat.getService(ApplicationLoaderService.class).processApplication(config, ref)) {<NEW_LINE>lifecycle.initialize(depl.appInfo, depl.appInfo.getSniffers(), depl.context);<NEW_LINE>}<NEW_LINE>// Set adapter state<NEW_LINE>adapter.setStateMsg(AdapterState.APPLICATION_LOADED);<NEW_LINE>}
adapter.setStateMsg(AdapterState.APPLICATION_LOADED);
120,962
private static String microsoftLogin(String email, String password, String cookie, String ppft, String urlPost) throws LoginException {<NEW_LINE>Map<String, String> postData = new HashMap<>();<NEW_LINE>postData.put("login", email);<NEW_LINE>postData.put("loginfmt", email);<NEW_LINE>postData.put("passwd", password);<NEW_LINE>postData.put("PPFT", ppft);<NEW_LINE>byte[] encodedDataBytes = urlEncodeMap(postData).getBytes(StandardCharsets.UTF_8);<NEW_LINE>try {<NEW_LINE>URL url = new URL(urlPost);<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");<NEW_LINE>connection.setRequestProperty("Content-Length", "" + encodedDataBytes.length);<NEW_LINE>connection.setRequestProperty("Cookie", cookie);<NEW_LINE>connection.setDoInput(true);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>System.out.println("Getting authorization code...");<NEW_LINE>try (OutputStream out = connection.getOutputStream()) {<NEW_LINE>out.write(encodedDataBytes);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (responseCode >= 500 && responseCode <= 599)<NEW_LINE>throw new LoginException("Servers are down (code " + responseCode + ").");<NEW_LINE>if (responseCode != 200)<NEW_LINE>throw new LoginException("Got code " + responseCode + " from urlPost.");<NEW_LINE>String decodedUrl = URLDecoder.decode(connection.getURL().toString(), StandardCharsets.UTF_8.name());<NEW_LINE>Matcher matcher = AUTHCODE_REGEX.matcher(decodedUrl);<NEW_LINE>if (!matcher.find())<NEW_LINE>throw new LoginException("Didn't get authCode. (Wrong email/password?)");<NEW_LINE>return matcher.group(1);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new LoginException("Connection failed: " + e, e);<NEW_LINE>}<NEW_LINE>}
int responseCode = connection.getResponseCode();
1,319,423
public static GalenActionDumpArguments parse(String[] args) {<NEW_LINE>args = ArgumentsUtils.processSystemProperties(args);<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption("u", "url", true, "Initial test url");<NEW_LINE>options.addOption("s", "size", true, "Browser window size");<NEW_LINE>options.addOption("W", "max-width", true, "Maximum width of element area image");<NEW_LINE>options.addOption("H", "max-height", true, "Maximum height of element area image");<NEW_LINE>options.addOption("E", "export", true, "Export path for page dump");<NEW_LINE>options.addOption("c", "config", true, "Path to config");<NEW_LINE>CommandLineParser parser = new PosixParser();<NEW_LINE>CommandLine cmd;<NEW_LINE>try {<NEW_LINE>cmd = parser.parse(options, args);<NEW_LINE>} catch (MissingArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("Missing value for " + e.getOption().getLongOpt(), e);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>GalenActionDumpArguments arguments = new GalenActionDumpArguments();<NEW_LINE>arguments.setUrl(cmd.getOptionValue("u"));<NEW_LINE>arguments.setScreenSize(convertScreenSize(cmd.getOptionValue("s")));<NEW_LINE>arguments.setMaxWidth(parseOptionalInt(cmd.getOptionValue("W")));<NEW_LINE>arguments.setMaxHeight(parseOptionalInt(cmd.getOptionValue("H")));<NEW_LINE>arguments.setExport<MASK><NEW_LINE>arguments.setPaths(asList(cmd.getArgs()));<NEW_LINE>arguments.setConfig(cmd.getOptionValue("c"));<NEW_LINE>return arguments;<NEW_LINE>}
(cmd.getOptionValue("E"));
1,597,591
private void innerDeleteLog(int sizeToReserve) {<NEW_LINE>long removeSize = (long) committedEntryManager.getTotalSize() - sizeToReserve;<NEW_LINE>if (removeSize <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long compactIndex = Math.min(committedEntryManager.getDummyIndex(<MASK><NEW_LINE>try {<NEW_LINE>logger.debug("{}: Before compaction index {}-{}, compactIndex {}, removeSize {}, committedLogSize " + "{}, maxAppliedLog {}", name, getFirstIndex(), getLastLogIndex(), compactIndex, removeSize, committedEntryManager.getTotalSize(), maxHaveAppliedCommitIndex);<NEW_LINE>getCommittedEntryManager().compactEntries(compactIndex);<NEW_LINE>if (ClusterDescriptor.getInstance().getConfig().isEnableRaftLogPersistence()) {<NEW_LINE>getStableEntryManager().removeCompactedEntries(compactIndex);<NEW_LINE>}<NEW_LINE>logger.debug("{}: After compaction index {}-{}, committedLogSize {}", name, getFirstIndex(), getLastLogIndex(), committedEntryManager.getTotalSize());<NEW_LINE>} catch (EntryUnavailableException e) {<NEW_LINE>logger.error("{}: regular compact log entries failed, error={}", name, e.getMessage());<NEW_LINE>}<NEW_LINE>}
) + removeSize, maxHaveAppliedCommitIndex - 1);
870,985
protected void buildBinding(Definition definition, Collection<BindingInfo> bindingInfos, Collection<PortType> portTypes) {<NEW_LINE>Binding binding = null;<NEW_LINE>for (BindingInfo bindingInfo : bindingInfos) {<NEW_LINE>binding = definition.createBinding();<NEW_LINE>addDocumentation(binding, bindingInfo.getDocumentation());<NEW_LINE>binding.setUndefined(false);<NEW_LINE>for (PortType portType : portTypes) {<NEW_LINE>if (portType.getQName().equals(bindingInfo.getInterface().getName())) {<NEW_LINE>binding.setPortType(portType);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>binding.setQName(bindingInfo.getName());<NEW_LINE>if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) {<NEW_LINE>addNamespace(bindingInfo.getName().getNamespaceURI(), definition);<NEW_LINE>}<NEW_LINE>buildBindingOperation(definition, <MASK><NEW_LINE>addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo));<NEW_LINE>definition.addBinding(binding);<NEW_LINE>}<NEW_LINE>}
binding, bindingInfo.getOperations());
1,040,430
static void parseAndValidateExtensionSchemas(String resolverPath, File inputDir) throws IOException, InvalidExtensionSchemaException {<NEW_LINE>// Parse each extension schema and validate it<NEW_LINE>Iterator<File> iterator = FileUtils.iterateFiles(inputDir, new String[] { PDL }, true);<NEW_LINE>DataSchemaResolver <MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>File inputFile = iterator.next();<NEW_LINE>PdlSchemaParser parser = new PdlSchemaParser(resolver);<NEW_LINE>parser.parse(new FileInputStream(inputFile));<NEW_LINE>if (parser.hasError()) {<NEW_LINE>throw new InvalidExtensionSchemaException(parser.errorMessage());<NEW_LINE>}<NEW_LINE>List<DataSchema> topLevelDataSchemas = parser.topLevelDataSchemas();<NEW_LINE>if (topLevelDataSchemas == null || topLevelDataSchemas.isEmpty() || topLevelDataSchemas.size() > 1) {<NEW_LINE>throw new InvalidExtensionSchemaException("Could not parse extension schema : " + inputFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>DataSchema topLevelDataSchema = topLevelDataSchemas.get(0);<NEW_LINE>if (!(topLevelDataSchema instanceof NamedDataSchema)) {<NEW_LINE>throw new InvalidExtensionSchemaException("Invalid extension schema : " + inputFile.getAbsolutePath() + ", the schema is not a named schema.");<NEW_LINE>}<NEW_LINE>if (!((NamedDataSchema) topLevelDataSchema).getName().endsWith(EXTENSIONS_SUFFIX)) {<NEW_LINE>throw new InvalidExtensionSchemaException("Invalid extension schema name: '" + ((NamedDataSchema) topLevelDataSchema).getName() + "'. The name of the extension schema must be <baseSchemaName> + 'Extensions'");<NEW_LINE>}<NEW_LINE>List<NamedDataSchema> includes = ((RecordDataSchema) topLevelDataSchema).getInclude();<NEW_LINE>if (includes.size() != 1) {<NEW_LINE>throw new InvalidExtensionSchemaException("The extension schema: '" + ((NamedDataSchema) topLevelDataSchema).getName() + "' should include and only include the base schema");<NEW_LINE>}<NEW_LINE>NamedDataSchema includeSchema = includes.get(0);<NEW_LINE>if (!((NamedDataSchema) topLevelDataSchema).getName().startsWith(includeSchema.getName())) {<NEW_LINE>throw new InvalidExtensionSchemaException("Invalid extension schema name: '" + ((NamedDataSchema) topLevelDataSchema).getName() + "'. The name of the extension schema must be baseSchemaName: '" + includeSchema.getName() + "' + 'Extensions");<NEW_LINE>}<NEW_LINE>List<RecordDataSchema.Field> extensionSchemaFields = ((RecordDataSchema) topLevelDataSchema).getFields().stream().filter(f -> !((RecordDataSchema) topLevelDataSchema).isFieldFromIncludes(f)).collect(Collectors.toList());<NEW_LINE>checkExtensionSchemaFields(extensionSchemaFields);<NEW_LINE>}<NEW_LINE>}
resolver = MultiFormatDataSchemaResolver.withBuiltinFormats(resolverPath);
1,075,607
protected void launch(Builder contextBuilder) {<NEW_LINE>contextBuilder.allowExperimentalOptions(true);<NEW_LINE>contextBuilder.arguments("python", new String[] { "java_embedding_bench" });<NEW_LINE>if (options.sharedEngine) {<NEW_LINE>contextBuilder.engine(Engine.newBuilder().allowExperimentalOptions(true).options(engineOptions).build());<NEW_LINE>} else {<NEW_LINE>contextBuilder.options(engineOptions);<NEW_LINE>}<NEW_LINE>System.out.println(LINE);<NEW_LINE>System.out.printf("### %s, %d warmup iterations, %d bench iterations%n", options.benchmarkName, <MASK><NEW_LINE>System.out.printf("### args = %s%n", Arrays.toString(options.benchmarkArgs));<NEW_LINE>System.out.println(LINE);<NEW_LINE>System.out.println("### setup ... ");<NEW_LINE>Source source;<NEW_LINE>Path path = Paths.get(options.benchmarksPath, options.benchmarkName + ".py");<NEW_LINE>try {<NEW_LINE>source = Source.newBuilder("python", path.toFile()).build();<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Cannot open the file: " + path);<NEW_LINE>System.exit(1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("### start benchmark ... ");<NEW_LINE>if (options.multiContext) {<NEW_LINE>runBenchmarkMultiContext(contextBuilder, source);<NEW_LINE>} else {<NEW_LINE>runBenchmarkSingleContext(contextBuilder, source);<NEW_LINE>}<NEW_LINE>}
options.warmupIterations, options.iterations);
120,541
private int compareDuration(Duration duration1, Duration duration2) {<NEW_LINE>int resultA = DatatypeConstants.INDETERMINATE;<NEW_LINE>int resultB = DatatypeConstants.INDETERMINATE;<NEW_LINE>XMLGregorianCalendar tempA = (XMLGregorianCalendar) TEST_POINTS[0].clone();<NEW_LINE>XMLGregorianCalendar tempB = (XMLGregorianCalendar) TEST_POINTS[0].clone();<NEW_LINE>// long comparison algorithm is required<NEW_LINE>tempA.add(duration1);<NEW_LINE>tempB.add(duration2);<NEW_LINE>resultA = tempA.compare(tempB);<NEW_LINE>if (resultA == DatatypeConstants.INDETERMINATE) {<NEW_LINE>return DatatypeConstants.INDETERMINATE;<NEW_LINE>}<NEW_LINE>tempA = (XMLGregorianCalendar) TEST_POINTS[1].clone();<NEW_LINE>tempB = (XMLGregorianCalendar) TEST_POINTS[1].clone();<NEW_LINE>tempA.add(duration1);<NEW_LINE>tempB.add(duration2);<NEW_LINE>resultB = tempA.compare(tempB);<NEW_LINE>resultA = compareResults(resultA, resultB);<NEW_LINE>if (resultA == DatatypeConstants.INDETERMINATE) {<NEW_LINE>return DatatypeConstants.INDETERMINATE;<NEW_LINE>}<NEW_LINE>tempA = (XMLGregorianCalendar) TEST_POINTS[2].clone();<NEW_LINE>tempB = (XMLGregorianCalendar) TEST_POINTS[2].clone();<NEW_LINE>tempA.add(duration1);<NEW_LINE>tempB.add(duration2);<NEW_LINE>resultB = tempA.compare(tempB);<NEW_LINE>resultA = compareResults(resultA, resultB);<NEW_LINE>if (resultA == DatatypeConstants.INDETERMINATE) {<NEW_LINE>return DatatypeConstants.INDETERMINATE;<NEW_LINE>}<NEW_LINE>tempA = (XMLGregorianCalendar) TEST_POINTS[3].clone();<NEW_LINE>tempB = (XMLGregorianCalendar) TEST_POINTS[3].clone();<NEW_LINE>tempA.add(duration1);<NEW_LINE>tempB.add(duration2);<NEW_LINE><MASK><NEW_LINE>resultA = compareResults(resultA, resultB);<NEW_LINE>return resultA;<NEW_LINE>}
resultB = tempA.compare(tempB);
504,597
public SAMPileupFeature decode(String line) {<NEW_LINE>// Split the line<NEW_LINE>final String[] tokens = SPLIT_PATTERN.split(line.trim(), -1);<NEW_LINE>// check the number of fields<NEW_LINE>if (tokens.length < MINIMUM_FIELDS || tokens.length > MAXIMUM_FIELDS) {<NEW_LINE>throw new CodecLineParsingException(String.format("The SAM pileup line didn't have the expected number of columns (%s-%s): %s. Note that this codes is only valid for single-sample pileups", MINIMUM_FIELDS, MAXIMUM_FIELDS, line));<NEW_LINE>}<NEW_LINE>// starting parsing<NEW_LINE>final String chr = tokens[0];<NEW_LINE>final int pos = parseInteger<MASK><NEW_LINE>final byte ref = parseBase(tokens[2], "reference");<NEW_LINE>final int cov = parseInteger(tokens[3], "coverage");<NEW_LINE>// we end parsing here if coverage is 0<NEW_LINE>if (cov == 0) {<NEW_LINE>return new SAMPileupFeature(chr, pos, ref, new ArrayList<>());<NEW_LINE>}<NEW_LINE>// parse the elements<NEW_LINE>final List<SAMPileupElement> pileupElements = parseBasesAndQuals(tokens[4], tokens[5], ref);<NEW_LINE>if (cov != pileupElements.size()) {<NEW_LINE>throw new CodecLineParsingException("THe SAM pileup line didn't have the same number of elements as the expected coverage: " + cov);<NEW_LINE>}<NEW_LINE>return new SAMPileupFeature(tokens[0], pos, ref, pileupElements);<NEW_LINE>}
(tokens[1], "position");
234,444
// @formatter:on<NEW_LINE>@Inject(method = "teleportEntity", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;setPortalCooldown()V"))<NEW_LINE>private static void arclight$portal(Level level, BlockPos pos, BlockState state, Entity entityIn, TheEndGatewayBlockEntity entity, CallbackInfo ci, ServerLevel serverLevel, BlockPos dest) {<NEW_LINE>if (entityIn instanceof ServerPlayer) {<NEW_LINE>CraftPlayer player = ((ServerPlayerEntityBridge) entityIn).bridge$getBukkitEntity();<NEW_LINE>Location location = new Location(((WorldBridge) level).bridge$getWorld(), dest.getX() + 0.5D, dest.getY() + 0.5D, dest.getZ() + 0.5D);<NEW_LINE>location.setPitch(player.getLocation().getPitch());<NEW_LINE>location.setYaw(player.getLocation().getYaw());<NEW_LINE>PlayerTeleportEvent event = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY);<NEW_LINE>Bukkit.<MASK><NEW_LINE>if (event.isCancelled()) {<NEW_LINE>ci.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>entityIn.setPortalCooldown();<NEW_LINE>((ServerPlayNetHandlerBridge) (((ServerPlayer) entityIn)).connection).bridge$teleport(event.getTo());<NEW_LINE>triggerCooldown(level, pos, state, entity);<NEW_LINE>ci.cancel();<NEW_LINE>}<NEW_LINE>}
getPluginManager().callEvent(event);
1,081,793
private void monitor(MeterRegistry registry, ForkJoinPool fj) {<NEW_LINE>FunctionCounter.builder(metricPrefix + "executor.steals", fj, ForkJoinPool::getStealCount).tags(tags).description("Estimate of the total number of tasks stolen from " + "one thread's work queue by another. The reported value " + "underestimates the actual total number of steals when the pool " + "is not quiescent").register(registry);<NEW_LINE>Gauge.builder(metricPrefix + "executor.queued", fj, ForkJoinPool::getQueuedTaskCount).tags(tags).description<MASK><NEW_LINE>Gauge.builder(metricPrefix + "executor.active", fj, ForkJoinPool::getActiveThreadCount).tags(tags).description("An estimate of the number of threads that are currently stealing or executing tasks").register(registry);<NEW_LINE>Gauge.builder(metricPrefix + "executor.running", fj, ForkJoinPool::getRunningThreadCount).tags(tags).description("An estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization threads").register(registry);<NEW_LINE>}
("An estimate of the total number of tasks currently held in queues by worker threads").register(registry);
297,993
private Integer openWriteLinear(String functionName, String fileName, long fileSize) {<NEW_LINE>byte[] command = new byte[26];<NEW_LINE>// System command telegram, response required<NEW_LINE>command[0] = (byte) 0x01;<NEW_LINE>// OPEN WRITE LINEAR command<NEW_LINE>command<MASK><NEW_LINE>copyStringValueToBytes(fileName, command, 2, 19);<NEW_LINE>copyULONGValueToBytes(fileSize, command, 22);<NEW_LINE>byte[] returnPackage = sendCommandAndReceiveReturnPackage(functionName, command);<NEW_LINE>if (evaluateStatus(functionName, returnPackage, command[1])) {<NEW_LINE>if (returnPackage.length == 4) {<NEW_LINE>return getUBYTEValueFromBytes(returnPackage, 3);<NEW_LINE>} else {<NEW_LINE>Log.w(logTag, functionName + ": unexpected return package length " + returnPackage.length + " (expected 4)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
[1] = (byte) 0x89;
460,848
public PrototypeModel selectModel(Parameter[] params) throws SleighException {<NEW_LINE>int bestscore = 500;<NEW_LINE>int bestindex = -1;<NEW_LINE>for (int i = 0; i < modellist.length; ++i) {<NEW_LINE>ScoreProtoModel scoremodel = new ScoreProtoModel(true, modellist<MASK><NEW_LINE>for (Parameter p : params) {<NEW_LINE>scoremodel.addParameter(p.getMinAddress(), p.getLength());<NEW_LINE>}<NEW_LINE>scoremodel.doScore();<NEW_LINE>int score = scoremodel.getScore();<NEW_LINE>if (score < bestscore) {<NEW_LINE>bestscore = score;<NEW_LINE>bestindex = i;<NEW_LINE>if (bestscore == 0) {<NEW_LINE>// Can't get any lower<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bestindex >= 0) {<NEW_LINE>return modellist[bestindex];<NEW_LINE>}<NEW_LINE>throw new SleighException("No model matches : missing default");<NEW_LINE>}
[i], params.length);
1,771,091
final ListTagOptionsResult executeListTagOptions(ListTagOptionsRequest listTagOptionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagOptionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagOptionsRequest> request = null;<NEW_LINE>Response<ListTagOptionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagOptionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagOptions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagOptionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagOptionsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,643,051
Mono<Response<QueueProperties>> createQueueWithResponse(String queueName, CreateQueueOptions createQueueOptions, Context context) {<NEW_LINE>if (queueName == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'queueName' cannot be null."));<NEW_LINE>} else if (queueName.isEmpty()) {<NEW_LINE>return monoError(LOGGER, new IllegalArgumentException("'queueName' cannot be empty."));<NEW_LINE>}<NEW_LINE>if (createQueueOptions == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'createQueueOptions' cannot be null."));<NEW_LINE>} else if (context == null) {<NEW_LINE>return monoError(LOGGER, new NullPointerException("'context' cannot be null."));<NEW_LINE>}<NEW_LINE>final Context contextWithHeaders = context.addData(AZ_TRACING_NAMESPACE_KEY, AZ_TRACING_NAMESPACE_VALUE).addData(AZURE_REQUEST_HTTP_HEADERS_KEY, new HttpHeaders());<NEW_LINE>final String forwardToEntity = createQueueOptions.getForwardTo();<NEW_LINE>if (!CoreUtils.isNullOrEmpty(forwardToEntity)) {<NEW_LINE>addSupplementaryAuthHeader(SERVICE_BUS_SUPPLEMENTARY_AUTHORIZATION_HEADER_NAME, forwardToEntity, contextWithHeaders);<NEW_LINE>createQueueOptions.setForwardTo(getAbsoluteUrlFromEntity(forwardToEntity));<NEW_LINE>}<NEW_LINE>final String forwardDlqToEntity = createQueueOptions.getForwardDeadLetteredMessagesTo();<NEW_LINE>if (!CoreUtils.isNullOrEmpty(forwardDlqToEntity)) {<NEW_LINE><MASK><NEW_LINE>createQueueOptions.setForwardDeadLetteredMessagesTo(getAbsoluteUrlFromEntity(forwardDlqToEntity));<NEW_LINE>}<NEW_LINE>final QueueDescription description = EntityHelper.getQueueDescription(createQueueOptions);<NEW_LINE>final CreateQueueBodyContent content = new CreateQueueBodyContent().setType(CONTENT_TYPE).setQueueDescription(description);<NEW_LINE>final CreateQueueBody createEntity = new CreateQueueBody().setContent(content);<NEW_LINE>try {<NEW_LINE>return entityClient.putWithResponseAsync(queueName, createEntity, null, contextWithHeaders).onErrorMap(ServiceBusAdministrationAsyncClient::mapException).map(this::deserializeQueue);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>return monoError(LOGGER, ex);<NEW_LINE>}<NEW_LINE>}
addSupplementaryAuthHeader(SERVICE_BUS_DLQ_SUPPLEMENTARY_AUTHORIZATION_HEADER_NAME, forwardDlqToEntity, contextWithHeaders);
821,328
public static XFormDialog buildTabbedDialogWithCustomActions(Class<? extends Object> tabbedFormClass, ActionList actions) {<NEW_LINE>AForm formAnnotation = tabbedFormClass.getAnnotation(AForm.class);<NEW_LINE>if (formAnnotation == null) {<NEW_LINE>throw new RuntimeException("formClass is not annotated correctly..");<NEW_LINE>}<NEW_LINE>MessageSupport messages = MessageSupport.getMessages(tabbedFormClass);<NEW_LINE>XFormDialogBuilder builder = XFormFactory.createDialogBuilder(formAnnotation.name());<NEW_LINE>for (Field field : tabbedFormClass.getFields()) {<NEW_LINE>APage pageAnnotation = field.getAnnotation(APage.class);<NEW_LINE>if (pageAnnotation != null) {<NEW_LINE>buildForm(builder, pageAnnotation.name(), field.getType(), messages);<NEW_LINE>}<NEW_LINE>AField fieldAnnotation = field.getAnnotation(AField.class);<NEW_LINE>if (fieldAnnotation != null) {<NEW_LINE>try {<NEW_LINE>Class<?> formClass = Class.forName(fieldAnnotation.description());<NEW_LINE>buildForm(builder, fieldAnnotation.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>SoapUI.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ActionList defaultActions = StringUtils.isBlank(formAnnotation.helpUrl()) ? null : builder.buildHelpActions(formAnnotation.helpUrl());<NEW_LINE>if (actions == null) {<NEW_LINE>actions = defaultActions;<NEW_LINE>} else {<NEW_LINE>defaultActions.addActions(actions);<NEW_LINE>actions = defaultActions;<NEW_LINE>}<NEW_LINE>XFormDialog dialog = builder.buildDialog(actions, formAnnotation.description(), UISupport.createImageIcon(formAnnotation.icon()));<NEW_LINE>return dialog;<NEW_LINE>}
name(), formClass, messages);
424,315
public okhttp3.Call apisApiIdEnvironmentsEnvIdKeysGetCall(String apiId, String envId, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/environments/{envId}/keys".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())).replaceAll("\\{" + "envId" + "\\}", localVarApiClient.escapeString(envId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
final String[] localVarContentTypes = {};
925,348
public static <T extends ImageBase<T>, O extends ImageBase> void add(T inputA, T inputB, O output) {<NEW_LINE>if (inputA instanceof ImageGray) {<NEW_LINE>if (GrayU8.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayU8) inputA, (GrayU8) inputB, (GrayU16) output);<NEW_LINE>} else if (GrayS8.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayS8) inputA, (GrayS8) inputB, (GrayS16) output);<NEW_LINE>} else if (GrayU16.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayU16) inputA, (GrayU16) inputB, (GrayS32) output);<NEW_LINE>} else if (GrayS16.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayS16) inputA, (GrayS16<MASK><NEW_LINE>} else if (GrayS32.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayS32) inputA, (GrayS32) inputB, (GrayS32) output);<NEW_LINE>} else if (GrayS64.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayS64) inputA, (GrayS64) inputB, (GrayS64) output);<NEW_LINE>} else if (GrayF32.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayF32) inputA, (GrayF32) inputB, (GrayF32) output);<NEW_LINE>} else if (GrayF64.class == inputA.getClass()) {<NEW_LINE>PixelMath.add((GrayF64) inputA, (GrayF64) inputB, (GrayF64) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image Type: " + inputA.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>} else if (inputA instanceof Planar) {<NEW_LINE>Planar inA = (Planar) inputA;<NEW_LINE>Planar inB = (Planar) inputB;<NEW_LINE>Planar out = (Planar) output;<NEW_LINE>for (int i = 0; i < inA.getNumBands(); i++) {<NEW_LINE>add(inA.getBand(i), inB.getBand(i), out.getBand(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image Type: " + inputA.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>}
) inputB, (GrayS32) output);
950,932
public <T> QueryTaskFuture<Void> eval(final QueryEnvironment<T> env, final QueryExpressionContext<T> context, final Callback<T> callback) {<NEW_LINE>if (!NAME_PATTERN.matcher(varName).matches()) {<NEW_LINE>return env.immediateFailedFuture(new QueryException(this, "invalid variable name '" + varName + "' in let expression", Query.Code.VARIABLE_NAME_INVALID));<NEW_LINE>}<NEW_LINE>QueryTaskFuture<ThreadSafeMutableSet<T>> varValueFuture = QueryUtil.evalAll(env, context, varExpr);<NEW_LINE>Function<ThreadSafeMutableSet<T>, QueryTaskFuture<Void>> evalBodyAsyncFunction = varValue -> {<NEW_LINE>QueryExpressionContext<T> bodyContext = context.with(varName, varValue);<NEW_LINE>return env.<MASK><NEW_LINE>};<NEW_LINE>return env.transformAsync(varValueFuture, evalBodyAsyncFunction);<NEW_LINE>}
eval(bodyExpr, bodyContext, callback);
388,790
public List<Issue> execute(Client client) {<NEW_LINE>List<Issue> issues = new ArrayList<Issue>();<NEW_LINE>List<Security<MASK><NEW_LINE>for (Portfolio portfolio : client.getPortfolios()) {<NEW_LINE>long[] shares = new long[securities.size()];<NEW_LINE>for (PortfolioTransaction t : portfolio.getTransactions()) {<NEW_LINE>int index = securities.indexOf(t.getSecurity());<NEW_LINE>// negative index means either the security is not known to the<NEW_LINE>// global collection or the security is null -> other checks<NEW_LINE>if (index < 0)<NEW_LINE>continue;<NEW_LINE>switch(t.getType()) {<NEW_LINE>case BUY:<NEW_LINE>case TRANSFER_IN:<NEW_LINE>case DELIVERY_INBOUND:<NEW_LINE>shares[index] += t.getShares();<NEW_LINE>break;<NEW_LINE>case SELL:<NEW_LINE>case TRANSFER_OUT:<NEW_LINE>case DELIVERY_OUTBOUND:<NEW_LINE>shares[index] -= t.getShares();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int ii = 0; ii < shares.length; ii++) {<NEW_LINE>if (shares[ii] < 0) {<NEW_LINE>Security security = securities.get(ii);<NEW_LINE>issues.add(new SharesIssue(portfolio, security, shares[ii]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return issues;<NEW_LINE>}
> securities = client.getSecurities();
1,195,368
public Void methodMissing(String name, Object argsObj) {<NEW_LINE>Object[] args = (Object[]) argsObj;<NEW_LINE>if (args.length == 1 && args[0] instanceof Class<?>) {<NEW_LINE>Class<? extends I> itemType = uncheckedCast(args[0]);<NEW_LINE>create(name, itemType);<NEW_LINE>} else if (args.length == 2 && args[0] instanceof Class<?> && args[1] instanceof Closure<?>) {<NEW_LINE>Class<? extends I> itemType = uncheckedCast(args[0]);<NEW_LINE>Closure<? super I> closure = uncheckedCast(args[1]);<NEW_LINE>create(name, itemType, closure);<NEW_LINE>} else if (args.length == 1 && args[0] instanceof Closure<?>) {<NEW_LINE>Closure<? super I> closure <MASK><NEW_LINE>named(name, closure);<NEW_LINE>} else {<NEW_LINE>throw new MissingMethodException(name, ModelMap.class, args);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
= uncheckedCast(args[0]);
335,579
public Object postUpdate(@Nullable String itemName, @Nullable String stateString) {<NEW_LINE>EventPublisher eventPublisher = this.eventPublisher;<NEW_LINE>ItemRegistry itemRegistry = this.itemRegistry;<NEW_LINE>if (eventPublisher != null && itemRegistry != null && itemName != null && stateString != null) {<NEW_LINE>try {<NEW_LINE>Item item = itemRegistry.getItem(itemName);<NEW_LINE>State state = TypeParser.parseState(<MASK><NEW_LINE>if (state != null) {<NEW_LINE>eventPublisher.post(ItemEventFactory.createStateEvent(itemName, state));<NEW_LINE>} else {<NEW_LINE>LoggerFactory.getLogger(ScriptBusEventImpl.class).warn("State '{}' cannot be parsed for item '{}'.", stateString, itemName);<NEW_LINE>}<NEW_LINE>} catch (ItemNotFoundException e) {<NEW_LINE>LoggerFactory.getLogger(ScriptBusEventImpl.class).warn("Item '{}' does not exist.", itemName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
item.getAcceptedDataTypes(), stateString);
1,530,085
public String postHttp(@ShellOption(value = { "", "--target" }, help = "the location to post to", defaultValue = Target.DEFAULT_TARGET) String target, @ShellOption(help = "the text payload to post. exclusive with file. " + "embedded double quotes are not supported if next to a space character", defaultValue = ShellOption.NULL) String data, @ShellOption(help = "filename to read data from. exclusive with data", defaultValue = ShellOption.NULL) File file, @ShellOption(value = "--contentType", help = "the content-type to use. file is also read using the specified charset", defaultValue = DEFAULT_MEDIA_TYPE) MediaType mediaType, @ShellOption(help = "the username for calls that require basic " + "authentication", defaultValue = Target.DEFAULT_USERNAME) String username, @ShellOption(help = "the password for calls that require basic authentication", defaultValue = Target.DEFAULT_PASSWORD) String password, @ShellOption(help = "accept any SSL certificate (even \"self-signed)\"", defaultValue = "false") boolean skipSslValidation) throws IOException {<NEW_LINE>Assert.isTrue(file != null || data != null, "One of 'file' or 'data' must be set");<NEW_LINE>Assert.isTrue(file == null || data == null, "Only one of 'file' or 'data' must be set");<NEW_LINE>if (file != null) {<NEW_LINE>InputStreamReader isr = new InputStreamReader(new FileInputStream(file), mediaType.getCharset());<NEW_LINE>data = FileCopyUtils.copyToString(isr);<NEW_LINE>}<NEW_LINE>final StringBuilder buffer = new StringBuilder();<NEW_LINE>URI requestURI = URI.create(target);<NEW_LINE>final HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(mediaType);<NEW_LINE>final HttpEntity<String> request = new HttpEntity<String>(data, headers);<NEW_LINE>try {<NEW_LINE>outputRequest("POST", requestURI, mediaType, data, buffer);<NEW_LINE>final RestTemplate restTemplate = createRestTemplate(buffer);<NEW_LINE>restTemplate.setRequestFactory(HttpClientConfigurer.create(requestURI).basicAuthCredentials(username, password).skipTlsCertificateVerification(skipSslValidation).buildClientHttpRequestFactory());<NEW_LINE>ResponseEntity<String> response = restTemplate.postForEntity(requestURI, request, String.class);<NEW_LINE>outputResponse(response, buffer);<NEW_LINE>if (!response.getStatusCode().is2xxSuccessful()) {<NEW_LINE>buffer.append(System.lineSeparator()).append(String.format("Error sending data '%s' to '%s'", data, target));<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>} catch (ResourceAccessException e) {<NEW_LINE>return String.format(buffer + "Failed to access http endpoint %s", target);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return String.<MASK><NEW_LINE>}<NEW_LINE>}
format(buffer + "Failed to send data to http endpoint %s", target);
1,341,850
public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> typeToken) {<NEW_LINE>// Check if we can deal with the given type<NEW_LINE>if (!IUnknownPropertiesConsumer.class.isAssignableFrom(typeToken.getRawType())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// If we can, we should get the backing class to fetch its fields from<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Class<IUnknownPropertiesConsumer> rawType = (Class<IUnknownPropertiesConsumer>) typeToken.getRawType();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final TypeAdapter<IUnknownPropertiesConsumer> delegateTypeAdapter = (TypeAdapter<IUnknownPropertiesConsumer>) <MASK><NEW_LINE>// Excluder is necessary to check if the field can be processed<NEW_LINE>// Basically it's not required, but it makes the check more complete<NEW_LINE>final Excluder excluder = gson.excluder();<NEW_LINE>// This is crucial to map fields and JSON object properties since Gson supports name remapping<NEW_LINE>final FieldNamingStrategy fieldNamingStrategy = gson.fieldNamingStrategy();<NEW_LINE>final TypeAdapter<IUnknownPropertiesConsumer> unknownPropertiesTypeAdapter = UnknownPropertiesTypeAdapter.create(rawType, delegateTypeAdapter, excluder, fieldNamingStrategy);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final TypeAdapter<T> castTypeAdapter = (TypeAdapter<T>) unknownPropertiesTypeAdapter;<NEW_LINE>return castTypeAdapter;<NEW_LINE>}
gson.getDelegateAdapter(this, typeToken);
1,842,924
public void run(RegressionEnvironment env) {<NEW_LINE>EPCompiled compiled = env.readCompile("regression/test_module_9.epl");<NEW_LINE>EPDeployment result;<NEW_LINE>try {<NEW_LINE>result = env.runtime().getDeploymentService().deploy(compiled);<NEW_LINE>} catch (EPDeployException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>assertTrue(env.runtime().getDeploymentService().isDeployed(result.getDeploymentId()));<NEW_LINE><MASK><NEW_LINE>assertEquals(2, result.getStatements().length);<NEW_LINE>assertEquals(1, env.deployment().getDeployments().length);<NEW_LINE>env.assertStatement("StmtOne", statement -> assertEquals("@Name(\"StmtOne\")" + NEWLINE + "create schema MyEvent(id String, val1 int, val2 int)", statement.getProperty(StatementProperty.EPL)));<NEW_LINE>env.assertStatement("StmtTwo", statement -> assertEquals("@Name(\"StmtTwo\")" + NEWLINE + "select * from MyEvent", statement.getProperty(StatementProperty.EPL)));<NEW_LINE>assertEquals(0, result.getDeploymentIdDependencies().length);<NEW_LINE>env.undeployAll();<NEW_LINE>assertFalse(env.runtime().getDeploymentService().isDeployed(result.getDeploymentId()));<NEW_LINE>}
assertNotNull(result.getDeploymentId());
407,932
private void replaceNull(LocalValue<?> key, Object value, int index) {<NEW_LINE>Entry[] tab = table;<NEW_LINE>int len = tab.length;<NEW_LINE>Entry e;<NEW_LINE>int slotToExpunge = index;<NEW_LINE>for (int i = prevIndex(index, len); (e = tab[i]) != null; i = prevIndex(i, len)) if (e.k == null) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>for (int i = nextIndex(index, len); (e = tab[i]) != null; i = nextIndex(i, len)) {<NEW_LINE>LocalValue<?> k = e.k;<NEW_LINE>if (k == key) {<NEW_LINE><MASK><NEW_LINE>e.value = value;<NEW_LINE>tab[i] = tab[index];<NEW_LINE>tab[index] = e;<NEW_LINE>if (slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>removeNullKeys(removeNull(slotToExpunge), len);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (k == null && slotToExpunge == index) {<NEW_LINE>slotToExpunge = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tab[index].value = Misc.free(tab[index].value);<NEW_LINE>tab[index] = new Entry(key, value);<NEW_LINE>if (slotToExpunge != index) {<NEW_LINE>removeNullKeys(removeNull(slotToExpunge), len);<NEW_LINE>}<NEW_LINE>}
Misc.free(e.value);
1,676,428
public static MatrixContext createMatrixContext(ModelContext context, RowType rowType, Class<? extends IElement> elemClass, int rowNum) {<NEW_LINE>if (rowType.isComplexValue() && elemClass == null) {<NEW_LINE>throw new InvalidParameterException("Complex value type must set element class type");<NEW_LINE>}<NEW_LINE>MatrixContext mc = new MatrixContext();<NEW_LINE>mc.<MASK><NEW_LINE>mc.setRowNum(rowNum);<NEW_LINE>mc.setRowType(rowType);<NEW_LINE>mc.setPartitionNum(context.getPartitionNum());<NEW_LINE>mc.setValidIndexNum(context.getNodeNum());<NEW_LINE>if (elemClass != null) {<NEW_LINE>mc.setValueType(elemClass);<NEW_LINE>}<NEW_LINE>if (context.isUseHashPartition()) {<NEW_LINE>mc.setPartitionerClass(HashPartitioner.class);<NEW_LINE>} else {<NEW_LINE>mc.setIndexStart(context.getMinNodeId());<NEW_LINE>mc.setIndexEnd(context.getMaxNodeId());<NEW_LINE>mc.setPartitionerClass(ColumnRangePartitioner.class);<NEW_LINE>if (context.getPartitionNum() > 0) {<NEW_LINE>mc.setMaxRowNumInBlock(rowNum);<NEW_LINE>mc.setMaxColNumInBlock((context.getMaxNodeId() - context.getMinNodeId()) / context.getPartitionNum());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mc;<NEW_LINE>}
setName(context.getModelName());
1,317,074
public List<KnowledgesEntity> selectAccessAbleEvents(Calendar start, LoginedUser loginedUser, int limit, int offset) {<NEW_LINE>String sql;<NEW_LINE>if (loginedUser != null && loginedUser.isAdmin()) {<NEW_LINE>sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/EventsDao/EventsDao_selectAdminKnowledgeEvents.sql");<NEW_LINE>} else {<NEW_LINE>sql = SQLManager.getInstance().getSql("/org/support/project/knowledge/dao/sql/EventsDao/EventsDao_selectAccessAbleKnowledgeEvents.sql");<NEW_LINE>}<NEW_LINE>List<Object> <MASK><NEW_LINE>params.add(new Timestamp(start.getTimeInMillis()));<NEW_LINE>if (loginedUser == null || !loginedUser.isAdmin()) {<NEW_LINE>sql = addAccessCondition(loginedUser, sql, params);<NEW_LINE>}<NEW_LINE>params.add(limit);<NEW_LINE>params.add(offset);<NEW_LINE>return executeQueryList(sql, KnowledgesEntity.class, params.toArray(new Object[0]));<NEW_LINE>}
params = new ArrayList<>();
1,327,231
public boolean apply(Game game, Ability source) {<NEW_LINE>UUID targetId = source.getFirstTarget();<NEW_LINE>FilterCreaturePermanent filter = new FilterCreaturePermanent("each other creature that player controls");<NEW_LINE>filter.add(Predicates.not(new PermanentIdPredicate(targetId)));<NEW_LINE>Permanent creature = game.getPermanent(targetId);<NEW_LINE>if (creature != null) {<NEW_LINE>Player player = game.<MASK><NEW_LINE>if (player != null) {<NEW_LINE>int power = creature.getPower().getValue();<NEW_LINE>for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {<NEW_LINE>perm.damage(power, creature.getId(), source, game, false, true);<NEW_LINE>}<NEW_LINE>for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {<NEW_LINE>creature.damage(perm.getPower().getValue(), perm.getId(), source, game, false, true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPlayer(creature.getControllerId());
1,334,886
protected void checkIfComplete() {<NEW_LINE>if (observer == null) {<NEW_LINE>logger.debug("observer is null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!completed) {<NEW_LINE>completed = true;<NEW_LINE>logger.info(" Rip completed!");<NEW_LINE>RipStatusComplete rsc = new RipStatusComplete(workingDir, getCount());<NEW_LINE>RipStatusMessage msg = new RipStatusMessage(STATUS.RIP_COMPLETE, rsc);<NEW_LINE>observer.update(this, msg);<NEW_LINE>Logger rootLogger = Logger.getRootLogger();<NEW_LINE>FileAppender fa = (FileAppender) rootLogger.getAppender("FILE");<NEW_LINE>if (fa != null) {<NEW_LINE>logger.debug("Changing log file back to 'ripme.log'");<NEW_LINE>fa.setFile("ripme.log");<NEW_LINE>fa.activateOptions();<NEW_LINE>}<NEW_LINE>if (Utils.getConfigBoolean("urls_only.save", false)) {<NEW_LINE>String urlFile = this<MASK><NEW_LINE>try {<NEW_LINE>Desktop.getDesktop().open(new File(urlFile));<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("Error while opening " + urlFile, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.workingDir + File.separator + "urls.txt";
325
// voidIt<NEW_LINE>@Override<NEW_LINE>public boolean closeIt() {<NEW_LINE>// Before Close<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_CLOSE);<NEW_LINE>if (m_processMsg != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Close Not delivered Qty - SO/PO<NEW_LINE>final MDDOrderLine[] lines = getLines(true, "M_Product_ID");<NEW_LINE>for (final MDDOrderLine line : lines) {<NEW_LINE>final BigDecimal qtyOrderedOld = line.getQtyOrdered();<NEW_LINE>if (qtyOrderedOld.compareTo(line.getQtyDelivered()) != 0) {<NEW_LINE>line.setQtyOrdered(line.getQtyDelivered());<NEW_LINE>// QtyEntered unchanged<NEW_LINE>line.addDescription("Close (" + qtyOrderedOld + ")");<NEW_LINE>line.setProcessed(true);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear Reservations<NEW_LINE>reserveStock(lines);<NEW_LINE>// After Close<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_CLOSE);<NEW_LINE>if (m_processMsg != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>setProcessed(true);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>return true;<NEW_LINE>}
line.save(get_TrxName());
316,353
public boolean accept(EdgeIteratorState iter) {<NEW_LINE>int <MASK><NEW_LINE>int vt = gsHeavyVehicles.getEdgeVehicleType(edgeId, buffer);<NEW_LINE>// ((buffer[1] >> (vehicleType >> 1)) & 1) == 1<NEW_LINE>boolean dstFlag = buffer[1] != 0;<NEW_LINE>// if edge has some restrictions<NEW_LINE>if (vt != HeavyVehicleAttributes.UNKNOWN) {<NEW_LINE>if (mode == MODE_CLOSEST_EDGE) {<NEW_LINE>// current vehicle type is not forbidden<NEW_LINE>boolean edgeRestricted = ((vt & vehicleType) == vehicleType);<NEW_LINE>if ((edgeRestricted || dstFlag) && buffer[1] != vehicleType)<NEW_LINE>return false;<NEW_LINE>} else if (mode == MODE_DESTINATION_EDGES) {<NEW_LINE>// Here we are looking for all edges that have destination<NEW_LINE>return dstFlag && ((vt & vehicleType) == vehicleType);<NEW_LINE>} else {<NEW_LINE>// Check an edge with destination attribute<NEW_LINE>if (dstFlag) {<NEW_LINE>if ((vt & vehicleType) == vehicleType) {<NEW_LINE>if (destinationEdges != null) {<NEW_LINE>if (!destinationEdges.contains(edgeId))<NEW_LINE>return false;<NEW_LINE>} else<NEW_LINE>return false;<NEW_LINE>} else<NEW_LINE>return false;<NEW_LINE>} else if ((vt & vehicleType) == vehicleType)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (mode == MODE_DESTINATION_EDGES) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasHazmat && (vt & HeavyVehicleAttributes.HAZMAT) != 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (restCount != 0) {<NEW_LINE>if (restCount == 1) {<NEW_LINE>double value = gsHeavyVehicles.getEdgeRestrictionValue(edgeId, indexValues[0]);<NEW_LINE>return value <= 0 || value >= restrictionValues[indexLocs[0]];<NEW_LINE>} else {<NEW_LINE>if (gsHeavyVehicles.getEdgeRestrictionValues(edgeId, retValues)) {<NEW_LINE>for (int i = 0; i < restCount; i++) {<NEW_LINE>double value = retValues[indexLocs[i]];<NEW_LINE>if (value > 0.0f && value < restrictionValues[indexLocs[i]]) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
edgeId = EdgeIteratorStateHelper.getOriginalEdge(iter);
1,773,419
private // https://github.com/aosp-mirror/platform_packages_apps_mms/blob/master/src/com/android/mms/transaction/SmsReceiverService.java#L554<NEW_LINE>void storeMessage(Context context, SmsMessage[] messages) {<NEW_LINE>final int pduCount = messages.length;<NEW_LINE>SmsMessage sms = messages[0];<NEW_LINE>Log.d(TAG, "storeMessage( " + sms + ")");<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>final String address = sms.getDisplayOriginatingAddress();<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.ADDRESS, address);<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.DATE_SENT, sms.getTimestampMillis());<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.<MASK><NEW_LINE>values.put(Telephony.TextBasedSmsColumns.TYPE, MESSAGE_TYPE_INBOX);<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.PROTOCOL, sms.getProtocolIdentifier());<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.SERVICE_CENTER, sms.getServiceCenterAddress());<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.STATUS, STATUS_NONE);<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.THREAD_ID, threadHelper.getThreadId(context, address));<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.READ, 0);<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.SEEN, 0);<NEW_LINE>if (sms.getPseudoSubject() != null && sms.getPseudoSubject().length() > 0) {<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.SUBJECT, sms.getPseudoSubject());<NEW_LINE>}<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.REPLY_PATH_PRESENT, sms.isReplyPathPresent() ? 1 : 0);<NEW_LINE>if (pduCount == 1) {<NEW_LINE>// There is only one part, so grab the body directly.<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.BODY, sms.getDisplayMessageBody());<NEW_LINE>} else {<NEW_LINE>// Build up the body from the parts.<NEW_LINE>StringBuilder body = new StringBuilder();<NEW_LINE>for (SmsMessage message : messages) {<NEW_LINE>body.append(message.getDisplayMessageBody());<NEW_LINE>}<NEW_LINE>values.put(Telephony.TextBasedSmsColumns.BODY, body.toString());<NEW_LINE>}<NEW_LINE>final Uri uri = context.getContentResolver().insert(Consts.SMS_PROVIDER, values);<NEW_LINE>Log.d(TAG, "inserted as " + uri);<NEW_LINE>}
DATE, System.currentTimeMillis());
728,362
public synchronized List<ResizeOption> loadAll() {<NEW_LINE>Preferences prefs = getPreferences();<NEW_LINE>// NOI18N<NEW_LINE>int count = prefs.getInt("count", 0);<NEW_LINE>List<ResizeOption> res = new ArrayList<ResizeOption>(count);<NEW_LINE>if (count == 0) {<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.DESKTOP, NbBundle.getMessage(ResizeOption.class, "Lbl_DESKTOP"), 1280, 1024, true, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.TABLET_LANDSCAPE, NbBundle.getMessage(ResizeOption.class, "Lbl_TABLET_LANDSCAPE"), 1024, 768, true, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.TABLET_PORTRAIT, NbBundle.getMessage(ResizeOption.class, "Lbl_TABLET_PORTRAIT"), 768, 1024, true, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.SMARTPHONE_LANDSCAPE, NbBundle.getMessage(ResizeOption.class, "Lbl_SMARTPHONE_LANDSCAPE"), 480, 320, true, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.SMARTPHONE_PORTRAIT, NbBundle.getMessage(ResizeOption.class, "Lbl_SMARTPHONE_PORTRAIT"), 320, 480, true, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.WIDESCREEN, NbBundle.getMessage(ResizeOption.class, "Lbl_WIDESCREEN"), 1680, 1050, false, true));<NEW_LINE>res.add(ResizeOption.create(ResizeOption.Type.NETBOOK, NbBundle.getMessage(ResizeOption.class, "Lbl_NETBOOK"), 1024, 600, false, true));<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>// NOI18N<NEW_LINE>Preferences node = <MASK><NEW_LINE>ResizeOption option = load(node);<NEW_LINE>if (option != null) {<NEW_LINE>res.add(option);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
prefs.node("option" + i);
1,682,474
public static DescribeDiskMonitorDataResponse unmarshall(DescribeDiskMonitorDataResponse describeDiskMonitorDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDiskMonitorDataResponse.setRequestId(_ctx.stringValue("DescribeDiskMonitorDataResponse.RequestId"));<NEW_LINE>describeDiskMonitorDataResponse.setTotalCount(_ctx.integerValue("DescribeDiskMonitorDataResponse.TotalCount"));<NEW_LINE>List<DiskMonitorData> monitorData = new ArrayList<DiskMonitorData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDiskMonitorDataResponse.MonitorData.Length"); i++) {<NEW_LINE>DiskMonitorData diskMonitorData = new DiskMonitorData();<NEW_LINE>diskMonitorData.setBPSRead(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].BPSRead"));<NEW_LINE>diskMonitorData.setIOPSRead(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].IOPSRead"));<NEW_LINE>diskMonitorData.setLatencyRead(_ctx.integerValue<MASK><NEW_LINE>diskMonitorData.setBPSTotal(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].BPSTotal"));<NEW_LINE>diskMonitorData.setIOPSTotal(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].IOPSTotal"));<NEW_LINE>diskMonitorData.setTimeStamp(_ctx.stringValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].TimeStamp"));<NEW_LINE>diskMonitorData.setLatencyWrite(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].LatencyWrite"));<NEW_LINE>diskMonitorData.setIOPSWrite(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].IOPSWrite"));<NEW_LINE>diskMonitorData.setDiskId(_ctx.stringValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].DiskId"));<NEW_LINE>diskMonitorData.setBPSWrite(_ctx.integerValue("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].BPSWrite"));<NEW_LINE>monitorData.add(diskMonitorData);<NEW_LINE>}<NEW_LINE>describeDiskMonitorDataResponse.setMonitorData(monitorData);<NEW_LINE>return describeDiskMonitorDataResponse;<NEW_LINE>}
("DescribeDiskMonitorDataResponse.MonitorData[" + i + "].LatencyRead"));
883,243
private TBParVec particleClosureBeta(final TBPar terms, final Vect<TBTriple> alphas, final Vect<TBTriple> betas) {<NEW_LINE>// try a beta expansion. See MP page 403<NEW_LINE>// figure 5.1. for beta expansion rules.<NEW_LINE>for (int i = 0; i < terms.size(); i++) {<NEW_LINE>LiveExprNode <MASK><NEW_LINE>LiveExprNode kappa1 = null, kappa2 = null;<NEW_LINE>if (ln instanceof LNEven) {<NEW_LINE>// Beta-Expansion: <>p expands to p, ()<>p<NEW_LINE>kappa1 = ((LNEven) ln).getBody();<NEW_LINE>kappa2 = new LNNext(ln);<NEW_LINE>} else if (ln instanceof LNDisj) {<NEW_LINE>// Beta-Expansion: p \/ expands to p, q<NEW_LINE>kappa1 = ((LNDisj) ln).getBody(0);<NEW_LINE>kappa2 = ((LNDisj) ln).getBody(1);<NEW_LINE>}<NEW_LINE>if ((kappa1 != null) && !terms.member(kappa1) && !terms.member(kappa2)) {<NEW_LINE>TBParVec ps1 = particleClosure(terms.append(kappa1), alphas, betas);<NEW_LINE>TBParVec ps2 = particleClosure(terms.append(kappa2), alphas, betas);<NEW_LINE>return ps1.union(ps2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// try a beta^-1 expansion<NEW_LINE>for (int i = 0; i < betas.size(); i++) {<NEW_LINE>TBTriple beta = (TBTriple) betas.elementAt(i);<NEW_LINE>if ((terms.member(beta.getB()) || terms.member(beta.getC())) && !terms.member(beta.getA())) {<NEW_LINE>return particleClosure(terms.append(beta.getA()), alphas, betas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if there are not any more expansions to do, return the terms<NEW_LINE>// we've got as the only particle in a list of particles.<NEW_LINE>TBParVec res = new TBParVec(1);<NEW_LINE>res.addElement(terms);<NEW_LINE>return res;<NEW_LINE>}
ln = terms.exprAt(i);
1,443,460
private String frequencyCounter(String[] words, int minLength) {<NEW_LINE>String title = "BinarySearchST costs using put() in FrequencyCounter";<NEW_LINE>String xAxisLabel = "operations";<NEW_LINE>String yAxisLabel = "cost";<NEW_LINE>double maxNumberOfOperations = 18000;<NEW_LINE>double maxCost = 20000;<NEW_LINE>int originValue = 0;<NEW_LINE>VisualAccumulator visualAccumulator = new VisualAccumulator(originValue, maxNumberOfOperations, maxCost, title, xAxisLabel, yAxisLabel);<NEW_LINE>BinarySearchSymbolTable<String, Integer> binarySearchSymbolTable = new BinarySearchSymbolTable<>();<NEW_LINE>for (String word : words) {<NEW_LINE>if (word.length() < minLength) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int numberOfArrayAccesses;<NEW_LINE>if (!binarySearchSymbolTable.contains(word)) {<NEW_LINE>numberOfArrayAccesses = binarySearchSymbolTable.put(word, 1);<NEW_LINE>} else {<NEW_LINE>numberOfArrayAccesses = binarySearchSymbolTable.put(word, binarySearchSymbolTable<MASK><NEW_LINE>}<NEW_LINE>visualAccumulator.addDataValue(numberOfArrayAccesses, true);<NEW_LINE>}<NEW_LINE>String max = "";<NEW_LINE>int numberOfArrayAccesses = binarySearchSymbolTable.put(max, 0);<NEW_LINE>visualAccumulator.addDataValue(numberOfArrayAccesses, true);<NEW_LINE>for (String word : binarySearchSymbolTable.keys()) {<NEW_LINE>if (binarySearchSymbolTable.get(word) > binarySearchSymbolTable.get(max)) {<NEW_LINE>max = word;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visualAccumulator.writeFinalMean();<NEW_LINE>return max + " " + binarySearchSymbolTable.get(max);<NEW_LINE>}
.get(word) + 1);
933,945
public void run(RegressionEnvironment env) {<NEW_LINE>String[] <MASK><NEW_LINE>String eplFragment = "@name('s0') select " + "utildate.roundCeiling('msec') as val0," + "utildate.roundCeiling('sec') as val1," + "utildate.roundCeiling('minutes') as val2," + "utildate.roundCeiling('hour') as val3," + "utildate.roundCeiling('day') as val4," + "utildate.roundCeiling('month') as val5," + "utildate.roundCeiling('year') as val6" + " from SupportDateTime";<NEW_LINE>env.compileDeploy(eplFragment).addListener("s0");<NEW_LINE>env.assertStmtTypesAllSame("s0", fields, DATE.getEPType());<NEW_LINE>String[] expected = { "2002-05-30T09:01:02.003", "2002-05-30T09:01:03.000", "2002-05-30T09:02:00.000", "2002-05-30T10:00:00.000", "2002-05-31T00:00:00.000", "2002-06-1T00:00:00.000", "2003-01-1T00:00:00.000" };<NEW_LINE>String startTime = "2002-05-30T09:01:02.003";<NEW_LINE>env.sendEventBean(SupportDateTime.make(startTime));<NEW_LINE>env.assertPropsNew("s0", fields, SupportDateTime.getArrayCoerced(expected, "util"));<NEW_LINE>env.undeployAll();<NEW_LINE>}
fields = "val0,val1,val2,val3,val4,val5,val6".split(",");
65,793
public SOAPMessage invoke(SOAPMessage request) {<NEW_LINE>SOAPMessage response = null;<NEW_LINE>try {<NEW_LINE>System.out.println("Incoming Client Request as a SOAPMessage:");<NEW_LINE>request.writeTo(System.out);<NEW_LINE>String hdrText = request.getSOAPHeader().getTextContent();<NEW_LINE>System.out.println("Incoming SOAP Header:" + hdrText);<NEW_LINE>String returnMsg = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body xmlns=\"http://wssec.pwdigest.cxf.fats/types\"><provider>This is WSSECFVT CXF Web Service with SSL (Password Digest Created) for: " + hdrText + ".</provider></soapenv:Body></soapenv:Envelope>";<NEW_LINE>StringReader respMsg = new StringReader(returnMsg);<NEW_LINE>// SOAPBody sb = request.getSOAPBody();<NEW_LINE>// System.out.println("Incoming SOAPBody: " + sb.getValue() );<NEW_LINE><MASK><NEW_LINE>MessageFactory factory = MessageFactory.newInstance();<NEW_LINE>response = factory.createMessage();<NEW_LINE>response.getSOAPPart().setContent(src);<NEW_LINE>response.saveChanges();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
Source src = new StreamSource(respMsg);
436,122
public void initScene() {<NEW_LINE>mObject3D = new Cube(3.0f);<NEW_LINE>mObject3D.setColor(0);<NEW_LINE>mObject3D.setPosition(0, 0, -3);<NEW_LINE>mObject3D.setRenderChildrenAsBatch(true);<NEW_LINE>mStreamingTexture = new StreamingTexture("viewTexture", this);<NEW_LINE>Material material = new Material();<NEW_LINE>material.setColorInfluence(0);<NEW_LINE>try {<NEW_LINE>material.addTexture(mStreamingTexture);<NEW_LINE>} catch (ATexture.TextureException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>mObject3D.setMaterial(material);<NEW_LINE>getCurrentScene().addChild(mObject3D);<NEW_LINE>RotateOnAxisAnimation anim = new RotateOnAxisAnimation(Vector3.<MASK><NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.INFINITE);<NEW_LINE>anim.setDurationMilliseconds(12000);<NEW_LINE>anim.setTransformable3D(mObject3D);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>}
Axis.Y, 0, 360);
1,167,084
protected void show(AbstractFile file) throws IOException {<NEW_LINE>setCurrentFile(file);<NEW_LINE>if (fileEditor == null) {<NEW_LINE>getFrame().setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);<NEW_LINE>getFrame().addWindowListener(new WindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowClosing(WindowEvent e) {<NEW_LINE>if (fileEditor != null) {<NEW_LINE>try {<NEW_LINE>fileEditor.close();<NEW_LINE>} catch (CloseCancelledException ex) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getFrame().dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>MnemonicHelper menuItemMnemonicHelper = new MnemonicHelper();<NEW_LINE>editorMenu.addSeparator();<NEW_LINE>closeMenuItem = MenuToolkit.addMenuItem(editorMenu, Translator.get("file_editor.close"), menuItemMnemonicHelper, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), (e) -> {<NEW_LINE>try {<NEW_LINE>fileEditor.close();<NEW_LINE>getFrame().dispose();<NEW_LINE>} catch (CloseCancelledException ex) {<NEW_LINE>// cancelled<NEW_LINE>}<NEW_LINE>});<NEW_LINE>editorMenu.add(closeMenuItem);<NEW_LINE>try {<NEW_LINE>switchFileEditor(0);<NEW_LINE>} catch (CloseCancelledException ex) {<NEW_LINE>Logger.getLogger(FileViewerPresenter.class.getName()).log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, "Unexpected cancellation", ex);
1,438,302
public boolean reverseCorrectIt() {<NEW_LINE>log.info("reverseCorrectIt - " + toString());<NEW_LINE>// Before reverseCorrect<NEW_LINE>processMesssage = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_REVERSECORRECT);<NEW_LINE>if (processMesssage != null)<NEW_LINE>return false;<NEW_LINE>MMovementConfirm reversalMovementConfirm = new MMovementConfirm(getCtx(), 0, get_TrxName());<NEW_LINE>copyValues(this, reversalMovementConfirm, getAD_Client_ID(), getAD_Org_ID());<NEW_LINE>reversalMovementConfirm.setReversal_ID(getM_MovementConfirm_ID());<NEW_LINE>reversalMovementConfirm.setM_Movement_ID(getM_Movement_ID());<NEW_LINE>reversalMovementConfirm.setDocStatus(DOCSTATUS_Drafted);<NEW_LINE>reversalMovementConfirm.setDocAction(DOCACTION_Complete);<NEW_LINE>reversalMovementConfirm.setIsApproved(false);<NEW_LINE>reversalMovementConfirm.setProcessed(false);<NEW_LINE>// indicate reversals<NEW_LINE>reversalMovementConfirm.setDocumentNo(getDocumentNo() + REVERSE_INDICATOR);<NEW_LINE>reversalMovementConfirm.addDescription("{->" + getDocumentNo() + ")");<NEW_LINE>reversalMovementConfirm.setIsReversal(true);<NEW_LINE>reversalMovementConfirm.saveEx();<NEW_LINE>// Reverse Line Qty<NEW_LINE>Arrays.stream(getLines(true)).forEach(movementLineConfirm -> {<NEW_LINE>MMovementLineConfirm reverseMovementLineConfirm = new MMovementLineConfirm(getCtx(), 0, get_TrxName());<NEW_LINE>copyValues(movementLineConfirm, reverseMovementLineConfirm, movementLineConfirm.getAD_Client_ID(), movementLineConfirm.getAD_Org_ID());<NEW_LINE>reverseMovementLineConfirm.setM_MovementConfirm_ID(reversalMovementConfirm.getM_MovementConfirm_ID());<NEW_LINE>reverseMovementLineConfirm.setReversalLine_ID(movementLineConfirm.getM_MovementLineConfirm_ID());<NEW_LINE>reverseMovementLineConfirm.setM_MovementLine_ID(movementLineConfirm.getM_MovementLine_ID());<NEW_LINE>reverseMovementLineConfirm.setConfirmedQty(movementLineConfirm.getConfirmedQty().negate());<NEW_LINE>reverseMovementLineConfirm.setTargetQty(movementLineConfirm.getTargetQty().negate());<NEW_LINE>reverseMovementLineConfirm.setScrappedQty(movementLineConfirm.<MASK><NEW_LINE>reverseMovementLineConfirm.setProcessed(false);<NEW_LINE>reverseMovementLineConfirm.saveEx();<NEW_LINE>});<NEW_LINE>if (!reversalMovementConfirm.processIt(DocAction.ACTION_Complete)) {<NEW_LINE>processMesssage = "Reversal ERROR: " + reversalMovementConfirm.getProcessMsg();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>reversalMovementConfirm.closeIt();<NEW_LINE>reversalMovementConfirm.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reversalMovementConfirm.setDocAction(DOCACTION_None);<NEW_LINE>reversalMovementConfirm.saveEx();<NEW_LINE>processMesssage = reversalMovementConfirm.getDocumentNo();<NEW_LINE>// After reverseCorrect<NEW_LINE>processMesssage = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_REVERSECORRECT);<NEW_LINE>if (processMesssage != null)<NEW_LINE>return false;<NEW_LINE>// Update Reversed (this)<NEW_LINE>setDescription("(" + reversalMovementConfirm.getDocumentNo() + "<-)");<NEW_LINE>setIsReversal(true);<NEW_LINE>setProcessed(true);<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>saveEx();<NEW_LINE>return true;<NEW_LINE>}
getScrappedQty().negate());
918,088
public void write(DataOutput out) throws IOException {<NEW_LINE>final byte[] integerBuffer = new byte[5];<NEW_LINE>serialize();<NEW_LINE>byte hasValues = (values == null) ? 0 : (byte) 1;<NEW_LINE>if (!replicationSources.isEmpty()) {<NEW_LINE>// Use 2nd least-significant bit for whether or not we have replication sources<NEW_LINE>hasValues = (byte) (0x02 | hasValues);<NEW_LINE>}<NEW_LINE>out.write((byte) (0x80 | hasValues));<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, row.length);<NEW_LINE>out.write(row);<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, data.length);<NEW_LINE>out.write(data);<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, entries);<NEW_LINE>if ((0x01 & hasValues) == 0x01) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, <MASK><NEW_LINE>for (byte[] val : values) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, val.length);<NEW_LINE>out.write(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((0x02 & hasValues) == 0x02) {<NEW_LINE>UnsynchronizedBuffer.writeVInt(out, integerBuffer, replicationSources.size());<NEW_LINE>for (String source : replicationSources) {<NEW_LINE>WritableUtils.writeString(out, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
integerBuffer, values.size());
713,243
public static Status.StoredFieldStatus testStoredFields(CodecReader reader, PrintStream infoStream, boolean failFast) throws IOException {<NEW_LINE>long startNS = System.nanoTime();<NEW_LINE>final Status.StoredFieldStatus <MASK><NEW_LINE>try {<NEW_LINE>if (infoStream != null) {<NEW_LINE>infoStream.print(" test: stored fields.......");<NEW_LINE>}<NEW_LINE>// Scan stored fields for all documents<NEW_LINE>final Bits liveDocs = reader.getLiveDocs();<NEW_LINE>StoredFieldsReader storedFields = reader.getFieldsReader().getMergeInstance();<NEW_LINE>for (int j = 0; j < reader.maxDoc(); ++j) {<NEW_LINE>// Intentionally pull even deleted documents to<NEW_LINE>// make sure they too are not corrupt:<NEW_LINE>DocumentStoredFieldVisitor visitor = new DocumentStoredFieldVisitor();<NEW_LINE>storedFields.visitDocument(j, visitor);<NEW_LINE>Document doc = visitor.getDocument();<NEW_LINE>if (liveDocs == null || liveDocs.get(j)) {<NEW_LINE>status.docCount++;<NEW_LINE>status.totFields += doc.getFields().size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Validate docCount<NEW_LINE>if (status.docCount != reader.numDocs()) {<NEW_LINE>throw new CheckIndexException("docCount=" + status.docCount + " but saw " + status.docCount + " undeleted docs");<NEW_LINE>}<NEW_LINE>msg(infoStream, String.format(Locale.ROOT, "OK [%d total field count; avg %.1f fields per doc] [took %.3f sec]", status.totFields, (((float) status.totFields) / status.docCount), nsToSec(System.nanoTime() - startNS)));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (failFast) {<NEW_LINE>throw IOUtils.rethrowAlways(e);<NEW_LINE>}<NEW_LINE>msg(infoStream, "ERROR [" + String.valueOf(e.getMessage()) + "]");<NEW_LINE>status.error = e;<NEW_LINE>if (infoStream != null) {<NEW_LINE>e.printStackTrace(infoStream);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>}
status = new Status.StoredFieldStatus();
1,338,536
protected void checkAndUpdateSubConfigs() {<NEW_LINE>if (StringUtils.isEmpty(interfaceName)) {<NEW_LINE>throw new IllegalStateException("<dubbo:reference interface=\"\" /> interface not allow null!");<NEW_LINE>}<NEW_LINE>// get consumer's global configuration<NEW_LINE>completeCompoundConfigs();<NEW_LINE>// init some null configuration.<NEW_LINE>List<ConfigInitializer> configInitializers = this.getExtensionLoader(ConfigInitializer.class).getActivateExtension(URL.valueOf("configInitializer://")<MASK><NEW_LINE>configInitializers.forEach(e -> e.initReferConfig(this));<NEW_LINE>if (getGeneric() == null && getConsumer() != null) {<NEW_LINE>setGeneric(getConsumer().getGeneric());<NEW_LINE>}<NEW_LINE>if (ProtocolUtils.isGeneric(generic)) {<NEW_LINE>interfaceClass = GenericService.class;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (getInterfaceClassLoader() != null && (interfaceClass == null || interfaceClass.getClassLoader() != getInterfaceClassLoader())) {<NEW_LINE>interfaceClass = Class.forName(interfaceName, true, getInterfaceClassLoader());<NEW_LINE>} else if (interfaceClass == null) {<NEW_LINE>interfaceClass = Class.forName(interfaceName, true, Thread.currentThread().getContextClassLoader());<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalStateException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkStubAndLocal(interfaceClass);<NEW_LINE>ConfigValidationUtils.checkMock(interfaceClass, this);<NEW_LINE>resolveFile();<NEW_LINE>ConfigValidationUtils.validateReferenceConfig(this);<NEW_LINE>postProcessConfig();<NEW_LINE>}
, (String[]) null);
524,119
public static void init(FMLPreInitializationEvent event) {<NEW_LINE>globalDataDirectory = new File(event.getModConfigurationDirectory().getParentFile(), "data" + File.separator + EquivalentExchange.MOD_ID);<NEW_LINE>globalTestDirectory = new File(globalDataDirectory, "tests");<NEW_LINE>globalTestDirectory.mkdirs();<NEW_LINE>EnergyValueRegistry.energyValuesDirectory = new File(globalDataDirectory, "energy-values");<NEW_LINE>EnergyValueRegistry.energyValuesDirectory.mkdirs();<NEW_LINE>EnergyValueRegistry.energyValuesFile = new File(EnergyValueRegistry.energyValuesDirectory, ENERGY_VALUES_JSON_FILENAME);<NEW_LINE>EnergyValueRegistry.preCalculationValuesFile = new <MASK><NEW_LINE>EnergyValueRegistry.postCalculationValuesFile = new File(EnergyValueRegistry.energyValuesDirectory, POST_CALCULATION_ENERGY_VALUES_FILENAME);<NEW_LINE>File templatePlayerKnowledgeDirectory = new File(globalDataDirectory, "knowledge" + File.separator + "transmutation");<NEW_LINE>templatePlayerKnowledgeDirectory.mkdirs();<NEW_LINE>PlayerKnowledgeRegistry.templatePlayerKnowledgeFile = new File(templatePlayerKnowledgeDirectory, TEMPLATE_PLAYER_KNOWLEDGE_FILENAME);<NEW_LINE>BlacklistRegistry.knowledgeBlacklistFile = new File(globalDataDirectory, "blacklist" + File.separator + KNOWLEDGE_BLACKLIST_FILENAME);<NEW_LINE>BlacklistRegistry.exchangeBlacklistFile = new File(globalDataDirectory, "blacklist" + File.separator + EXCHANGE_BLACKLIST_FILENAME);<NEW_LINE>}
File(EnergyValueRegistry.energyValuesDirectory, PRE_CALCULATION_ENERGY_VALUES_FILENAME);
447,028
private List<NameValueCountPair> listApplicationPair(Business business, EffectivePerson effectivePerson, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Review.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Review> root = cq.from(Review.class);<NEW_LINE>Path<String> pathApplication = root.get(Review_.application);<NEW_LINE>Path<String> pathApplicationName = root.get(Review_.applicationName);<NEW_LINE>cq.multiselect(pathApplication, pathApplicationName, cb.count(root)).where(predicate).groupBy(pathApplication);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathApplicationName));<NEW_LINE>pair.setValue(o.get(pathApplication));<NEW_LINE>pair.setCount(o.get<MASK><NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>list = list.stream().sorted((o1, o2) -> Objects.toString(o1.getName()).compareTo(o2.getName().toString())).collect(Collectors.toList());<NEW_LINE>return list;<NEW_LINE>}
(2, Long.class));
1,330,233
private void addToSummary(DatasetField dsfo, DatasetField dsfn) {<NEW_LINE>if (dsfo == null) {<NEW_LINE>dsfo = new DatasetField();<NEW_LINE>dsfo.setDatasetFieldType(dsfn.getDatasetFieldType());<NEW_LINE>}<NEW_LINE>if (dsfn == null) {<NEW_LINE>dsfn = new DatasetField();<NEW_LINE>dsfn.setDatasetFieldType(dsfo.getDatasetFieldType());<NEW_LINE>}<NEW_LINE>boolean addedToAll = false;<NEW_LINE>for (List<DatasetField[]> blockList : detailDataByBlock) {<NEW_LINE>DatasetField[] <MASK><NEW_LINE>if (dsft[0].getDatasetFieldType().getMetadataBlock().equals(dsfo.getDatasetFieldType().getMetadataBlock())) {<NEW_LINE>addToList(blockList, dsfo, dsfn);<NEW_LINE>addedToAll = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!addedToAll) {<NEW_LINE>List<DatasetField[]> newList = new ArrayList<>();<NEW_LINE>addToList(newList, dsfo, dsfn);<NEW_LINE>detailDataByBlock.add(newList);<NEW_LINE>}<NEW_LINE>}
dsft = blockList.get(0);
1,691,116
final GetDownloadUrlForLayerResult executeGetDownloadUrlForLayer(GetDownloadUrlForLayerRequest getDownloadUrlForLayerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDownloadUrlForLayerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDownloadUrlForLayerRequest> request = null;<NEW_LINE>Response<GetDownloadUrlForLayerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDownloadUrlForLayerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDownloadUrlForLayerRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDownloadUrlForLayer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDownloadUrlForLayerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDownloadUrlForLayerResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
804,944
public Object visit(Object context1, PostOpExpression expr, boolean strict) {<NEW_LINE>ExecutionContext context = (ExecutionContext) context1;<NEW_LINE>Object lhs = expr.getExpr().accept(context, this, strict);<NEW_LINE>if (lhs instanceof Reference) {<NEW_LINE>if (((Reference) lhs).isStrictReference()) {<NEW_LINE>if (((Reference) lhs).getBase() instanceof EnvironmentRecord) {<NEW_LINE>if (((Reference) lhs).getReferencedName().equals("arguments") || ((Reference) lhs).getReferencedName().equals("eval")) {<NEW_LINE>throw new ThrowException(context, context.createSyntaxError("invalid assignment: " + ((Reference) lhs).getReferencedName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Number newValue = null;<NEW_LINE>Number oldValue = Types.toNumber(context<MASK><NEW_LINE>if (oldValue instanceof Double) {<NEW_LINE>switch(expr.getOp()) {<NEW_LINE>case "++":<NEW_LINE>newValue = oldValue.doubleValue() + 1;<NEW_LINE>break;<NEW_LINE>case "--":<NEW_LINE>newValue = oldValue.doubleValue() - 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(expr.getOp()) {<NEW_LINE>case "++":<NEW_LINE>newValue = oldValue.longValue() + 1;<NEW_LINE>break;<NEW_LINE>case "--":<NEW_LINE>newValue = oldValue.longValue() - 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>((Reference) lhs).putValue(context, newValue);<NEW_LINE>return (oldValue);<NEW_LINE>}<NEW_LINE>// not reached<NEW_LINE>return null;<NEW_LINE>}
, getValue(context, lhs));
1,734,420
public <T> T[] toArray(@Nonnull T[] a) {<NEW_LINE>int aLength = a.length;<NEW_LINE>if (mySize == 1) {<NEW_LINE>if (aLength != 0) {<NEW_LINE>a[0] = (T) myElem;<NEW_LINE>} else {<NEW_LINE>T[] r = (T[]) Array.newInstance(a.getClass().getComponentType(), 1);<NEW_LINE>r[0] = (T) myElem;<NEW_LINE>return r;<NEW_LINE>}<NEW_LINE>} else if (aLength < mySize) {<NEW_LINE>return (T[]) Arrays.copyOf((E[]) myElem, mySize, a.getClass());<NEW_LINE>} else if (mySize != 0) {<NEW_LINE>// noinspection SuspiciousSystemArraycopy<NEW_LINE>System.arraycopy(myElem, <MASK><NEW_LINE>}<NEW_LINE>if (aLength > mySize) {<NEW_LINE>a[mySize] = null;<NEW_LINE>}<NEW_LINE>return a;<NEW_LINE>}
0, a, 0, mySize);
1,697,921
protected static void fillArrayANDNOT(char[] container, LongBuffer bitmap1, LongBuffer bitmap2) {<NEW_LINE>int pos = 0;<NEW_LINE>if (bitmap1.limit() != bitmap2.limit()) {<NEW_LINE>throw new IllegalArgumentException("not supported");<NEW_LINE>}<NEW_LINE>if (BufferUtil.isBackedBySimpleArray(bitmap1) && BufferUtil.isBackedBySimpleArray(bitmap2)) {<NEW_LINE>int len = bitmap1.limit();<NEW_LINE>long[] b1 = bitmap1.array();<NEW_LINE>long[] b2 = bitmap2.array();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>long bitset = b1[k] & (~b2[k]);<NEW_LINE>while (bitset != 0) {<NEW_LINE>container[pos++] = (char) (k * 64 + numberOfTrailingZeros(bitset));<NEW_LINE>bitset &= (bitset - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>long bitset = bitmap1.get(k) & (~bitmap2.get(k));<NEW_LINE>while (bitset != 0) {<NEW_LINE>container[pos++] = (char) (k * 64 + numberOfTrailingZeros(bitset));<NEW_LINE>bitset &= (bitset - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int len = bitmap1.limit();
45,040
public static ExchangeMetaData adaptToExchangeMetaData(Map<String, PoloniexCurrencyInfo> poloniexCurrencyInfo, Map<String, PoloniexMarketData> poloniexMarketData, ExchangeMetaData exchangeMetaData) {<NEW_LINE>Map<Currency, CurrencyMetaData> currencyMetaDataMap = exchangeMetaData.getCurrencies();<NEW_LINE>CurrencyMetaData currencyArchetype = currencyMetaDataMap.values().iterator().next();<NEW_LINE>for (Map.Entry<String, PoloniexCurrencyInfo> entry : poloniexCurrencyInfo.entrySet()) {<NEW_LINE>Currency ccy = Currency.getInstance(entry.getKey());<NEW_LINE>if (!currencyMetaDataMap.containsKey(ccy)) {<NEW_LINE>currencyMetaDataMap.put(ccy, currencyArchetype);<NEW_LINE>}<NEW_LINE>CurrencyMetaData currencyMetaData = currencyMetaDataMap.get(ccy);<NEW_LINE>WalletHealth walletHealth = WalletHealth.ONLINE;<NEW_LINE>if (entry.getValue().isDelisted() || entry.getValue().isDisabled()) {<NEW_LINE>walletHealth = WalletHealth.OFFLINE;<NEW_LINE>}<NEW_LINE>CurrencyMetaData currencyMetaDataUpdated = new CurrencyMetaData(currencyMetaData.getScale(), entry.getValue().getTxFee(), currencyMetaData.getMinWithdrawalAmount(), walletHealth);<NEW_LINE>currencyMetaDataMap.put(ccy, currencyMetaDataUpdated);<NEW_LINE>}<NEW_LINE>Map<CurrencyPair, CurrencyPairMetaData<MASK><NEW_LINE>CurrencyPairMetaData marketArchetype = marketMetaDataMap.values().iterator().next();<NEW_LINE>for (String market : poloniexMarketData.keySet()) {<NEW_LINE>CurrencyPair currencyPair = PoloniexUtils.toCurrencyPair(market);<NEW_LINE>if (!marketMetaDataMap.containsKey(currencyPair))<NEW_LINE>marketMetaDataMap.put(currencyPair, marketArchetype);<NEW_LINE>}<NEW_LINE>return exchangeMetaData;<NEW_LINE>}
> marketMetaDataMap = exchangeMetaData.getCurrencyPairs();
857,400
public <A, B> double dependence(NumberArrayAdapter<?, A> adapter1, A data1, NumberArrayAdapter<?, B> adapter2, B data2) {<NEW_LINE>final int len = Utils.size(adapter1, data1, adapter2, data2);<NEW_LINE>double[] <MASK><NEW_LINE>double dVarA = computeDCovar(dMatrixA, dMatrixA, len);<NEW_LINE>if (!(dVarA > 0.)) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>double[] dMatrixB = computeDistances(adapter2, data2);<NEW_LINE>double dVarB = computeDCovar(dMatrixB, dMatrixB, len);<NEW_LINE>if (!(dVarB > 0.)) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>// distance correlation<NEW_LINE>return Math.sqrt(computeDCovar(dMatrixA, dMatrixB, len) / Math.sqrt(dVarA * dVarB));<NEW_LINE>}
dMatrixA = computeDistances(adapter1, data1);
871,463
private void startAutomaticRefresh(MeteoBlueConfiguration config) {<NEW_LINE>if (refreshJob != null && !refreshJob.isCancelled()) {<NEW_LINE>logger.trace("Refresh job already exists.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Runnable runnable = () -> {<NEW_LINE>boolean updateSuccessful = false;<NEW_LINE>try {<NEW_LINE>// Request new weather data<NEW_LINE>updateSuccessful = updateWeatherData();<NEW_LINE>if (updateSuccessful) {<NEW_LINE>// build forecasts from the data<NEW_LINE>for (int i = 0; i < 7; i++) {<NEW_LINE>forecasts[i] = new Forecast(i, weatherData.getMetadata(), weatherData.getUnits(), weatherData.getDataDay());<NEW_LINE>}<NEW_LINE>// Update all channels from the updated weather data<NEW_LINE>for (Channel channel : getThing().getChannels()) {<NEW_LINE>updateChannel(channel.getUID().getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Exception occurred during weather update: {}", <MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>int period = config.refresh != null ? config.refresh : MeteoBlueConfiguration.DEFAULT_REFRESH;<NEW_LINE>refreshJob = scheduler.scheduleWithFixedDelay(runnable, 0, period, TimeUnit.MINUTES);<NEW_LINE>}
e.getMessage(), e);
779,409
public <A> SimpleGaussianContinuousUncertainObject newFeatureVector(Random rand, A array, NumberArrayAdapter<?, A> adapter) {<NEW_LINE>final int dim = adapter.size(array);<NEW_LINE>double[] min = new double[dim], max = new double[dim];<NEW_LINE>if (symmetric) {<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>double v = adapter.getDouble(array, i);<NEW_LINE>double width = rand.nextDouble() * (maxDev - minDev) + minDev;<NEW_LINE>min[i] = v - width;<NEW_LINE>max[i] = v + width;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>// Choose standard deviation<NEW_LINE>final double s = rand.nextDouble() * (maxDev - minDev) + minDev;<NEW_LINE>// Assume our center is off by a standard deviation of s.<NEW_LINE>double v = adapter.getDouble(array, i) <MASK><NEW_LINE>min[i] = v - s;<NEW_LINE>max[i] = v + s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SimpleGaussianContinuousUncertainObject(new HyperBoundingBox(min, max));<NEW_LINE>}
+ rand.nextGaussian() * s;
897,289
private void adjustNumRubricFields(int questionNum, int numSubQn, int numChoices) {<NEW_LINE>int numSubQnsNeeded = numSubQn - (getNumRubricRows(questionNum) - 2);<NEW_LINE>int numChoicesNeeded = numChoices - <MASK><NEW_LINE>if (numSubQnsNeeded > 0) {<NEW_LINE>for (int i = 0; i < numSubQnsNeeded; i++) {<NEW_LINE>click(getQuestionForm(questionNum).findElement(By.id("btn-add-row")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numChoicesNeeded > 0) {<NEW_LINE>for (int i = 0; i < numChoicesNeeded; i++) {<NEW_LINE>click(getQuestionForm(questionNum).findElement(By.id("btn-add-col")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numSubQnsNeeded < 0) {<NEW_LINE>for (int i = 0; i < -numSubQnsNeeded; i++) {<NEW_LINE>click(getRubricDeleteSubQnBtn(questionNum, 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (numChoicesNeeded < 0) {<NEW_LINE>for (int i = 0; i < -numChoicesNeeded; i++) {<NEW_LINE>clickAndConfirm(getRubricDeleteChoiceBtn(questionNum, 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(getNumRubricCols(questionNum) - 1);
1,291,972
private void cleanupReferencesToReservation(boolean expired, String username, String reservationId, PurchaseContext purchaseContext) {<NEW_LINE>List<String> reservationIdsToRemove = singletonList(reservationId);<NEW_LINE>specialPriceRepository.resetToFreeAndCleanupForReservation(reservationIdsToRemove);<NEW_LINE>groupManager.deleteWhitelistedTicketsForReservation(reservationId);<NEW_LINE>ticketRepository.resetCategoryIdForUnboundedCategories(reservationIdsToRemove);<NEW_LINE>ticketFieldRepository.deleteAllValuesForReservations(reservationIdsToRemove);<NEW_LINE>subscriptionRepository.deleteSubscriptionWithReservationId(List.of(reservationId));<NEW_LINE>int updatedAS = additionalServiceItemRepository.updateItemsStatusWithReservationUUID(reservationId, expired ? AdditionalServiceItemStatus.EXPIRED : AdditionalServiceItemStatus.CANCELLED);<NEW_LINE>purchaseContext.event().ifPresent(event -> {<NEW_LINE>int updatedTickets = ticketRepository.findTicketIdsInReservation(reservationId).stream().mapToInt(tickedId -> ticketRepository.releaseExpiredTicket(reservationId, event.getId(), tickedId, UUID.randomUUID().toString())).sum();<NEW_LINE>Validate.isTrue(updatedTickets + updatedAS > 0, "no items have been updated");<NEW_LINE>});<NEW_LINE>transactionRepository.deleteForReservations<MASK><NEW_LINE>waitingQueueManager.fireReservationExpired(reservationId);<NEW_LINE>auditingRepository.insert(reservationId, userRepository.nullSafeFindIdByUserName(username).orElse(null), purchaseContext.event().map(Event::getId).orElse(null), expired ? Audit.EventType.CANCEL_RESERVATION_EXPIRED : Audit.EventType.CANCEL_RESERVATION, new Date(), Audit.EntityType.RESERVATION, reservationId);<NEW_LINE>}
(List.of(reservationId));
1,105,747
final PutSubscriptionFilterResult executePutSubscriptionFilter(PutSubscriptionFilterRequest putSubscriptionFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putSubscriptionFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutSubscriptionFilterRequest> request = null;<NEW_LINE>Response<PutSubscriptionFilterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutSubscriptionFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putSubscriptionFilterRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudWatch Logs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutSubscriptionFilter");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutSubscriptionFilterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutSubscriptionFilterResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
259,849
final StartSnapshotResult executeStartSnapshot(StartSnapshotRequest startSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartSnapshotRequest> request = null;<NEW_LINE>Response<StartSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startSnapshotRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EBS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartSnapshotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartSnapshotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,784,505
public void addSection(NodeSectionPanel section) {<NEW_LINE>scrollPanel.remove(filler);<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = sectionCount;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor <MASK><NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>// gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 6);<NEW_LINE>scrollPanel.add((JPanel) section, gridBagConstraints);<NEW_LINE>section.setIndex(sectionCount);<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = sectionCount + 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weighty = 2.0;<NEW_LINE>// gridBagConstraints.insets = new java.awt.Insets(6, 2, 0, 6);<NEW_LINE>scrollPanel.add(filler, gridBagConstraints);<NEW_LINE>mapSection(section.getNode(), section);<NEW_LINE>sectionCount++;<NEW_LINE>}
= java.awt.GridBagConstraints.WEST;
719,633
private void checkPending() {<NEW_LINE>if (executing) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>executing = true;<NEW_LINE>ChannelHandlerContext ctx = socket.channelHandlerContext();<NEW_LINE>int written = 0;<NEW_LINE>CommandBase<?> cmd;<NEW_LINE>while (!paused && inflight < pipeliningLimit && (cmd = pending.poll()) != null) {<NEW_LINE>inflight++;<NEW_LINE>if (cmd instanceof ExtendedQueryCommand) {<NEW_LINE>ExtendedQueryCommand queryCmd = (ExtendedQueryCommand) cmd;<NEW_LINE>if (queryCmd.ps == null) {<NEW_LINE>if (psCache != null) {<NEW_LINE>queryCmd.ps = psCache.get(queryCmd.sql());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (queryCmd.ps == null) {<NEW_LINE>// Execute prepare<NEW_LINE>boolean cache = psCache != null && preparedStatementCacheSqlFilter.test(queryCmd.sql());<NEW_LINE>if (cache) {<NEW_LINE>CloseStatementCommand closeCmd = evictStatementIfNecessary();<NEW_LINE>if (closeCmd != null) {<NEW_LINE>inflight++;<NEW_LINE>written++;<NEW_LINE>ctx.write(closeCmd, ctx.voidPromise());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PrepareStatementCommand prepareCmd = prepareCommand(queryCmd, cache, false);<NEW_LINE>paused = true;<NEW_LINE>inflight++;<NEW_LINE>cmd = prepareCmd;<NEW_LINE>} else {<NEW_LINE>String msg = queryCmd.prepare();<NEW_LINE>if (msg != null) {<NEW_LINE>inflight--;<NEW_LINE>queryCmd.<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>written++;<NEW_LINE>ctx.write(cmd, ctx.voidPromise());<NEW_LINE>}<NEW_LINE>if (written > 0) {<NEW_LINE>ctx.flush();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>executing = false;<NEW_LINE>}<NEW_LINE>}
fail(new NoStackTraceThrowable(msg));
108,590
private Object onAddTrackedDataInsertMap(Int2ObjectMap<?> int2ObjectMap, int k, Object valueRaw) {<NEW_LINE>DataTracker.Entry<?> v = (DataTracker.Entry<?>) valueRaw;<NEW_LINE>DataTracker.Entry<?>[] storage = this.entriesArray;<NEW_LINE>// Check if we need to grow the backing array to accommodate the new key range<NEW_LINE>if (storage.length <= k) {<NEW_LINE>// Grow the array to accommodate 8 entries after this one, but limit it to never be larger<NEW_LINE>// than 256 entries as per the vanilla limit<NEW_LINE>int newSize = Math.<MASK><NEW_LINE>this.entriesArray = storage = Arrays.copyOf(storage, newSize);<NEW_LINE>}<NEW_LINE>// Update the storage<NEW_LINE>storage[k] = v;<NEW_LINE>// Ensure that the vanilla backing storage is still updated appropriately<NEW_LINE>return this.entries.put(k, v);<NEW_LINE>}
min(k + GROW_FACTOR, 256);
1,242,552
public static double[] medianFilter(double[] x, int N) {<NEW_LINE>double[] y = new double[x.length];<NEW_LINE>Vector<Double> v = new Vector<Double>();<NEW_LINE>int k, j, midVal;<NEW_LINE>if (// Odd version<NEW_LINE>N % 2 == 1) {<NEW_LINE>midVal = (N - 1) / 2;<NEW_LINE>for (k = 0; k < x.length; k++) {<NEW_LINE>// MS, 27.2.09: Ignore left/right out of bound; use window of size N, centered around current point<NEW_LINE>// if possible but staying within the range of data.<NEW_LINE>int iLeft = Math.max(0, k - midVal);<NEW_LINE>int iRight = Math.min(x.<MASK><NEW_LINE>for (j = iLeft; j <= iRight; j++) {<NEW_LINE>v.add(x[j]);<NEW_LINE>}<NEW_LINE>Collections.sort(v);<NEW_LINE>y[k] = ((Double) (v.get(midVal))).doubleValue();<NEW_LINE>v.clear();<NEW_LINE>}<NEW_LINE>} else // Even version<NEW_LINE>{<NEW_LINE>midVal = N / 2 - 1;<NEW_LINE>for (k = 0; k < x.length; k++) {<NEW_LINE>// MS, 27.2.09: Ignore left/right out of bound; use window of size N, centered around current point<NEW_LINE>// if possible but staying within the range of data.<NEW_LINE>int iLeft = Math.max(0, k - midVal);<NEW_LINE>int iRight = Math.min(x.length - 1, k + midVal);<NEW_LINE>for (j = iLeft; j <= iRight; j++) {<NEW_LINE>v.add(x[j]);<NEW_LINE>}<NEW_LINE>Collections.sort(v);<NEW_LINE>if (midVal + 1 < v.size())<NEW_LINE>y[k] = 0.5 * (((Double) (v.get(midVal))).doubleValue() + ((Double) (v.get(midVal + 1))).doubleValue());<NEW_LINE>else<NEW_LINE>y[k] = ((Double) (v.get(midVal))).doubleValue();<NEW_LINE>v.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return y;<NEW_LINE>}
length - 1, iLeft + N);
444,361
public E relaxedPoll() {<NEW_LINE>final long[] sBuffer = sequenceBuffer;<NEW_LINE>final long mask = this.mask;<NEW_LINE>long cIndex;<NEW_LINE>long seqOffset;<NEW_LINE>long seq;<NEW_LINE>long expectedSeq;<NEW_LINE>do {<NEW_LINE>cIndex = lvConsumerIndex();<NEW_LINE>seqOffset = calcCircularLongElementOffset(cIndex, mask);<NEW_LINE>seq = lvLongElement(sBuffer, seqOffset);<NEW_LINE>expectedSeq = cIndex + 1;<NEW_LINE>if (seq < expectedSeq) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} while (// another consumer beat us to it<NEW_LINE>// failed the CAS<NEW_LINE>seq > expectedSeq || !casConsumerIndex(cIndex, cIndex + 1));<NEW_LINE>final long <MASK><NEW_LINE>final E e = lpRefElement(buffer, offset);<NEW_LINE>spRefElement(buffer, offset, null);<NEW_LINE>soLongElement(sBuffer, seqOffset, cIndex + mask + 1);<NEW_LINE>return e;<NEW_LINE>}
offset = calcCircularRefElementOffset(cIndex, mask);
1,027,489
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {<NEW_LINE>if (!J9BuildFlags.interp_nativeSupport) {<NEW_LINE>CommandUtils.dbgPrint(out, "No JIT in this build\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String[] realArgs = null;<NEW_LINE>if (args.length != 0) {<NEW_LINE>realArgs = args[0].split(",");<NEW_LINE>}<NEW_LINE>if (args.length == 0 || !((realArgs.length == 3) || (realArgs.length == 4))) {<NEW_LINE>CommandUtils.dbgPrint(out, "Usage:\n");<NEW_LINE><MASK><NEW_LINE>CommandUtils.dbgPrint(out, "\t!jitstack thread,sp,pc,els\n");<NEW_LINE>CommandUtils.dbgPrint(out, "\tUse !jitstackslots instead of !jitstack to see slot values\n");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long address = CommandUtils.parsePointer(realArgs[0], J9BuildFlags.env_data64);<NEW_LINE>J9VMThreadPointer thread = J9VMThreadPointer.cast(address);<NEW_LINE>StackWalkerUtils.enableVerboseLogging(2, out);<NEW_LINE>WalkState walkState = new WalkState();<NEW_LINE>address = CommandUtils.parsePointer(realArgs[1], J9BuildFlags.env_data64);<NEW_LINE>UDATAPointer sp = UDATAPointer.cast(address);<NEW_LINE>address = CommandUtils.parsePointer(realArgs[2], J9BuildFlags.env_data64);<NEW_LINE>U8Pointer pc = U8Pointer.cast(address);<NEW_LINE>UDATAPointer arg0EA = UDATAPointer.NULL;<NEW_LINE>J9MethodPointer literals = J9MethodPointer.NULL;<NEW_LINE>J9VMEntryLocalStoragePointer entryLocalStorage = J9VMEntryLocalStoragePointer.NULL;<NEW_LINE>if (realArgs.length == 4) {<NEW_LINE>address = CommandUtils.parsePointer(realArgs[3], J9BuildFlags.env_data64);<NEW_LINE>entryLocalStorage = J9VMEntryLocalStoragePointer.cast(address);<NEW_LINE>} else {<NEW_LINE>entryLocalStorage = thread.entryLocalStorage();<NEW_LINE>}<NEW_LINE>walkState.flags = J9_STACKWALK_RECORD_BYTECODE_PC_OFFSET;<NEW_LINE>walkState.flags |= J9_STACKWALK_START_AT_JIT_FRAME;<NEW_LINE>if (command.equalsIgnoreCase("!jitstackslots")) {<NEW_LINE>walkState.flags |= J9_STACKWALK_ITERATE_O_SLOTS;<NEW_LINE>// 100 is highly arbitrary but basically means "print everything".<NEW_LINE>// It is used in jextract where the message levels have been copied<NEW_LINE>// from to begin with, so it should mean we get the same output.<NEW_LINE>StackWalkerUtils.enableVerboseLogging(100, out);<NEW_LINE>}<NEW_LINE>walkState.walkThread = thread;<NEW_LINE>walkState.callBacks = new BaseStackWalkerCallbacks();<NEW_LINE>walkState.frameFlags = new UDATA(0);<NEW_LINE>StackWalkResult result = StackWalker.walkStackFrames(walkState, sp, arg0EA, pc, literals, entryLocalStorage);<NEW_LINE>if (result != StackWalkResult.NONE) {<NEW_LINE>out.println("Stack walk result: " + result);<NEW_LINE>}<NEW_LINE>StackWalkerUtils.disableVerboseLogging();<NEW_LINE>out.flush();<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>throw new DDRInteractiveCommandException(e);<NEW_LINE>}<NEW_LINE>}
CommandUtils.dbgPrint(out, "\t!jitstack thread,sp,pc\n");
518,483
public static Collection<ErrorDescription> run(HintContext hintContext) {<NEW_LINE>List<ErrorDescription> problems = new ArrayList<>();<NEW_LINE>final JsfHintsContext <MASK><NEW_LINE>if (ctx.getJsfVersion() == null || !ctx.getJsfVersion().isAtLeast(JSFVersion.JSF_2_2)) {<NEW_LINE>return problems;<NEW_LINE>}<NEW_LINE>CompilationInfo info = hintContext.getInfo();<NEW_LINE>for (TypeElement typeElement : info.getTopLevelElements()) {<NEW_LINE>for (AnnotationMirror annotationMirror : typeElement.getAnnotationMirrors()) {<NEW_LINE>if (annotationMirror.getAnnotationType().toString().startsWith(JAVAX_FACES_BEAN)) {<NEW_LINE>// it's javax.faces.bean annotation<NEW_LINE>Tree tree = info.getTrees().getTree(typeElement, annotationMirror);<NEW_LINE>List<Fix> fixes = getFixesForType(info, typeElement, annotationMirror);<NEW_LINE>problems.add(JsfHintsUtils.createProblem(tree, info, Bundle.JavaxFacesBeanIsGonnaBeDeprecated_display_name(), Severity.HINT, fixes));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return problems;<NEW_LINE>}
ctx = JsfHintsUtils.getOrCacheContext(hintContext);
709,677
private static int storageCheck(ByteString stmt, int offset) {<NEW_LINE>if (stmt.length() > offset + "torage".length()) {<NEW_LINE>char c1 = stmt.charAt(++offset);<NEW_LINE>char c2 = stmt.charAt(++offset);<NEW_LINE>char c3 = stmt.charAt(++offset);<NEW_LINE>char c4 = stmt.charAt(++offset);<NEW_LINE>char c5 = stmt.charAt(++offset);<NEW_LINE>char c6 = stmt.charAt(++offset);<NEW_LINE>if ((c1 == 't' || c1 == 'T') && (c2 == 'o' || c2 == 'O') && (c3 == 'r' || c3 == 'R') && (c4 == 'a' || c4 == 'A') && (c5 == 'g' || c5 == 'G') && (c6 == 'e' || c6 == 'E')) {<NEW_LINE>while (++offset < stmt.length() && stmt.charAt(offset) == ' ') {<NEW_LINE>}<NEW_LINE>if ((stmt.length() == offset || ParseUtil.isEOF(stmt.charAt(offset)))) {<NEW_LINE>// SHOW STORAGE<NEW_LINE>return STORAGE;<NEW_LINE>} else {<NEW_LINE>// SHOW STORAGE REPLICAS<NEW_LINE>final String identifier = "replicas";<NEW_LINE>byte[] bs = stmt.getBytes(offset, Math.min(offset + identifier.length()<MASK><NEW_LINE>for (int i = 0; i < bs.length; i++) {<NEW_LINE>bs[i] = (byte) Character.toLowerCase((char) bs[i]);<NEW_LINE>}<NEW_LINE>if (Arrays.equals(identifier.getBytes(StandardCharsets.UTF_8), bs)) {<NEW_LINE>return STORAGE_REPLICAS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return OTHER;<NEW_LINE>}
, stmt.length()));
822,212
private void saveProfile() {<NEW_LINE>profile = changedProfile;<NEW_LINE>if (isNewProfile) {<NEW_LINE>DialogInterface.OnShowListener showListener = new DialogInterface.OnShowListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onShow(DialogInterface dialog) {<NEW_LINE>app.runInUIThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>ApplicationMode mode = saveNewProfile();<NEW_LINE>saveProfileBackup(mode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>showNewProfileSavingDialog(showListener);<NEW_LINE>} else {<NEW_LINE>ApplicationMode mode = getSelectedAppMode();<NEW_LINE>mode.setParentAppMode(changedProfile.parent);<NEW_LINE>mode.setIconResName(ProfileIcons.getResStringByResId(changedProfile.iconRes));<NEW_LINE>mode.setUserProfileName(changedProfile.name.trim());<NEW_LINE>mode.setRoutingProfile(changedProfile.routingProfile);<NEW_LINE>mode.setRouteService(changedProfile.routeService);<NEW_LINE>mode.setIconColor(changedProfile.color);<NEW_LINE>mode.setCustomIconColor(changedProfile.customColor);<NEW_LINE><MASK><NEW_LINE>mode.setNavigationIcon(changedProfile.navigationIcon);<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>activity.onBackPressed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mode.setLocationIcon(changedProfile.locationIcon);
142,144
public Boolean call() {<NEW_LINE>try {<NEW_LINE>LoggerUtil.buildMDC(schemaName);<NEW_LINE>if (!DdlHelper.isRunnable() || !ExecUtils.hasLeadership(null)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Perform the DDL job.<NEW_LINE>DdlHelper.getServerConfigManager().restoreDDL(schemaName, jobId);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOGGER.error("Failed to perform the DDL job '" + jobId + "'. Caused by: " + (t instanceof NullPointerException ? "NPE" : t<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>semaphore.release();<NEW_LINE>performVersion.incrementAndGet();<NEW_LINE>FailPoint.inject(() -> {<NEW_LINE>int availablePermits = semaphore.availablePermits();<NEW_LINE>if (availablePermits > maxParallelism) {<NEW_LINE>FailPoint.throwException(String.format("semaphore leaks. maxParallelism:%s, availablePermits:%s", maxParallelism, availablePermits));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
.getMessage()), t);
1,307,993
public void mouseDown(MouseEvent e) {<NEW_LINE>mouseDown = true;<NEW_LINE>// we need to fill the selected row indexes here because the<NEW_LINE>// dragstart event can occur before the SWT.SELECTION event and<NEW_LINE>// our drag code needs to know the selected rows..<NEW_LINE>TableRowSWT row = mouseDownOnRow = tv.getTableRow(e.x, e.y, false);<NEW_LINE>TableCellCore cell = tv.getTableCell(<MASK><NEW_LINE>TableColumnCore tc = cell == null ? null : cell.getTableColumnCore();<NEW_LINE>boolean in_expando = isInExpando(row, cell, tc, e);<NEW_LINE>if (in_expando) {<NEW_LINE>TableCellMouseEvent event = createMouseEvent(cell, e, TableCellMouseEvent.EVENT_MOUSEDOWN, false);<NEW_LINE>if (event != null) {<NEW_LINE>tc.invokeCellMouseListeners(event);<NEW_LINE>cell.invokeMouseListeners(event);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mouseDown(row, cell, e.button, e.stateMask);<NEW_LINE>if (row == null) {<NEW_LINE>tv.setSelectedRows(new TableRowCore[0]);<NEW_LINE>}<NEW_LINE>// clear out current cell editor<NEW_LINE>tv.editCell(null, -1);<NEW_LINE>if (cell != null && tc != null) {<NEW_LINE>TableCellMouseEvent event = createMouseEvent(cell, e, TableCellMouseEvent.EVENT_MOUSEDOWN, false);<NEW_LINE>if (event != null) {<NEW_LINE>tc.invokeCellMouseListeners(event);<NEW_LINE>cell.invokeMouseListeners(event);<NEW_LINE>tv.invokeRowMouseListener(event);<NEW_LINE>if (event.skipCoreFunctionality) {<NEW_LINE>lCancelSelectionTriggeredOn = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tc.hasInplaceEditorListener() && e.button == 1 && lastClickRow == cell.getTableRowCore()) {<NEW_LINE>tv.editCell(tv.getTableColumnByOffset(e.x), cell.getTableRowCore().getIndex());<NEW_LINE>}<NEW_LINE>if (e.button == 1) {<NEW_LINE>lastClickRow = cell.getTableRowCore();<NEW_LINE>}<NEW_LINE>} else if (row != null) {<NEW_LINE>TableRowMouseEvent event = createMouseEvent(row, e, TableCellMouseEvent.EVENT_MOUSEDOWN, false);<NEW_LINE>if (event != null) {<NEW_LINE>tv.invokeRowMouseListener(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
e.x, e.y);
1,410,213
private void chooseSnapshot() {<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>// NOI18N<NEW_LINE>chooser.putClientProperty("JFileChooser.packageIsTraversable", "always");<NEW_LINE>chooser.setDialogTitle(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, "CAP_Select_java_binary"));<NEW_LINE>chooser.setSelectedFile(<MASK><NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileFilter(new FileFilter() {<NEW_LINE><NEW_LINE>// NOI18N<NEW_LINE>private String java = "java.exe";<NEW_LINE><NEW_LINE>public boolean accept(File f) {<NEW_LINE>return f.isDirectory() || (f.isFile() && java.equals(f.getName()));<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getDescription() {<NEW_LINE>return // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, // NOI18N<NEW_LINE>"LBL_Java_file_filter", java);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>chooser.setFileFilter(new FileFilter() {<NEW_LINE><NEW_LINE>// NOI18N<NEW_LINE>private String java = "java";<NEW_LINE><NEW_LINE>public boolean accept(File f) {<NEW_LINE>// NOI18N<NEW_LINE>return f.isDirectory() || (f.isFile() && java.equals(f.getName()));<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getDescription() {<NEW_LINE>return // NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>JavaPlatformSelector.class, // NOI18N<NEW_LINE>"LBL_Java_file_filter", java);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (chooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == JFileChooser.APPROVE_OPTION)<NEW_LINE>javaPlatformFileField.setText(chooser.getSelectedFile().getAbsolutePath());<NEW_LINE>}
new File(getJavaBinary()));
746,041
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {<NEW_LINE>String inputs = String.valueOf(charSequence);<NEW_LINE>baseBind.clear.setVisibility(inputs.length() > 0 ? View.VISIBLE : View.INVISIBLE);<NEW_LINE>if (inputs.length() > 0 && searchType == 0 && !inputs.endsWith(" ") && fuck != null) {<NEW_LINE>List<String> keys = Arrays.stream(inputs.split(" ")).filter(s -> !TextUtils.isEmpty(s)).collect(Collectors.toList());<NEW_LINE>if (keys.size() > 0) {<NEW_LINE>fuck.onNext(keys.get(keys<MASK><NEW_LINE>}<NEW_LINE>} else if (inputs.length() > 0 && searchType == 5 && !inputs.endsWith(" ") && fuck != null && !Common.isNumeric(inputs)) {<NEW_LINE>List<String> keys = Arrays.stream(inputs.split(" ")).filter(s -> !TextUtils.isEmpty(s)).collect(Collectors.toList());<NEW_LINE>if (keys.size() > 0) {<NEW_LINE>fuck.onNext(keys.get(keys.size() - 1));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>baseBind.hintList.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
.size() - 1));
436,309
public Map<String, String> insertAgentCount(@RequestParam("agentCount") int agentCount, @RequestParam("timestamp") long timestamp) {<NEW_LINE>if (timestamp < 0) {<NEW_LINE>Map<String, String> result = new HashMap<>();<NEW_LINE>result.put("result", "FAIL");<NEW_LINE>result.put("message", "negative timestamp.");<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>AgentCountStatistics agentCountStatistics = new AgentCountStatistics(agentCount, DateTimeUtils.timestampToStartOfDay(timestamp));<NEW_LINE>boolean <MASK><NEW_LINE>if (success) {<NEW_LINE>Map<String, String> result = new HashMap<>();<NEW_LINE>result.put("result", "SUCCESS");<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>Map<String, String> result = new HashMap<>();<NEW_LINE>result.put("result", "FAIL");<NEW_LINE>result.put("message", "insert DAO error.");<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
success = agentStatisticsService.insertAgentCount(agentCountStatistics);
305,637
public boolean move(Point vector) {<NEW_LINE>final int dx = vector.x;<NEW_LINE>if (dx == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Data<NEW_LINE>box.width += dx;<NEW_LINE>if (box.width > 0) {<NEW_LINE>WordInter word = (WordInter) inter;<NEW_LINE>String value = word.getValue();<NEW_LINE>int fontSize = (int) Math.rint(TextFont.computeFontSize(value, FontInfo.DEFAULT, box.width));<NEW_LINE>model.fontInfo = FontInfo.createDefault(fontSize);<NEW_LINE>// Handles<NEW_LINE>TextFont textFont = new TextFont(model.fontInfo);<NEW_LINE>TextLayout layout = textFont.layout(value);<NEW_LINE>Rectangle2D rect = layout.getBounds();<NEW_LINE>double y = model.baseLoc.getY() + rect.getY() + (rect.getHeight() / 2);<NEW_LINE>middle.setLocation(box.x + (rect.getWidth<MASK><NEW_LINE>right.setLocation(box.x + rect.getWidth(), y);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
() / 2), y);
1,554,228
public static <K> PartitionByParams<K> build(final LogicalSchema sourceSchema, final ExecutionKeyFactory<K> serdeFactory, final List<Expression> partitionBys, final KsqlConfig ksqlConfig, final FunctionRegistry functionRegistry, final ProcessingLogger logger) {<NEW_LINE>final List<PartitionByColumn> partitionByCols = getPartitionByColumnName(sourceSchema, partitionBys);<NEW_LINE>final LogicalSchema resultSchema = buildSchema(sourceSchema, partitionBys, functionRegistry, partitionByCols);<NEW_LINE>final Mapper<K> mapper;<NEW_LINE>if (isPartitionByNull(partitionBys)) {<NEW_LINE>// In case of PARTITION BY NULL, it is sufficient to set the new key to null as the old key<NEW_LINE>// is already present in the current value<NEW_LINE>mapper = (k, v) -> new KeyValue<>(null, v);<NEW_LINE>} else {<NEW_LINE>final List<PartitionByExpressionEvaluator> evaluators = partitionBys.stream().map(pby -> {<NEW_LINE>final Set<? extends ColumnReferenceExp> sourceColsInPartitionBy = ColumnExtractor.extractColumns(pby);<NEW_LINE>final boolean partitionByInvolvesKeyColsOnly = sourceColsInPartitionBy.stream().map(ColumnReferenceExp::getColumnName<MASK><NEW_LINE>return buildExpressionEvaluator(sourceSchema, pby, ksqlConfig, functionRegistry, logger, partitionByInvolvesKeyColsOnly);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>mapper = buildMapper(partitionByCols, evaluators, serdeFactory);<NEW_LINE>}<NEW_LINE>return new PartitionByParams<>(resultSchema, mapper);<NEW_LINE>}
).allMatch(sourceSchema::isKeyColumn);
1,092,986
private void replaceDomainUsers() throws SQLException {<NEW_LINE>// Remove users<NEW_LINE>Closer closer = Closer.create();<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = closer.register(conn.prepareStatement("DELETE FROM " + config.getTablePrefix() + "region_players " + "WHERE region_id = ? " + "AND world_id = " + worldId));<NEW_LINE>for (List<ProtectedRegion> partition : Lists.partition(domainsToReplace, StatementBatch.MAX_BATCH_SIZE)) {<NEW_LINE>for (ProtectedRegion region : partition) {<NEW_LINE>stmt.setString(<MASK><NEW_LINE>stmt.addBatch();<NEW_LINE>}<NEW_LINE>stmt.executeBatch();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closer.closeQuietly();<NEW_LINE>}<NEW_LINE>// Add users<NEW_LINE>closer = Closer.create();<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = closer.register(conn.prepareStatement("INSERT INTO " + config.getTablePrefix() + "region_players " + "(region_id, world_id, user_id, owner) " + "VALUES (?, " + worldId + ", ?, ?)"));<NEW_LINE>StatementBatch batch = new StatementBatch(stmt, StatementBatch.MAX_BATCH_SIZE);<NEW_LINE>for (ProtectedRegion region : domainsToReplace) {<NEW_LINE>// owner = false<NEW_LINE>insertDomainUsers(stmt, batch, region, region.getMembers(), false);<NEW_LINE>// owner = true<NEW_LINE>insertDomainUsers(stmt, batch, region, region.getOwners(), true);<NEW_LINE>}<NEW_LINE>batch.executeRemaining();<NEW_LINE>} finally {<NEW_LINE>closer.closeQuietly();<NEW_LINE>}<NEW_LINE>}
1, region.getId());
118,207
public void pay(@RequestAttribute SysSite site, Long paymentId, String returnUrl, HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception {<NEW_LINE>Map<String, String> config = configComponent.getConfigData(site.getId(), Config.CONFIG_CODE_SITE);<NEW_LINE>String safeReturnUrl = config.get(LoginConfigComponent.CONFIG_RETURN_URL);<NEW_LINE>if (ControllerUtils.isUnSafeUrl(returnUrl, site, safeReturnUrl, request)) {<NEW_LINE>returnUrl = site.isUseStatic() ? site.getSitePath() : site.getDynamicPath();<NEW_LINE>}<NEW_LINE>TradePayment entity = service.getEntity(paymentId);<NEW_LINE>PaymentGateway paymentGateway = gatewayComponent.<MASK><NEW_LINE>if (null == paymentGateway || null == entity || ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {<NEW_LINE>log.info("pay parameter error");<NEW_LINE>response.sendRedirect(returnUrl);<NEW_LINE>} else if (!paymentGateway.pay(site, entity, returnUrl, response)) {<NEW_LINE>log.info("pay error");<NEW_LINE>response.sendRedirect(returnUrl);<NEW_LINE>}<NEW_LINE>}
get(entity.getAccountType());
801,817
public Object parse(FhirContext theContext, List<QualifiedParamList> theString) throws InternalErrorException, InvalidRequestException {<NEW_LINE>Collection<Include> retValCollection = null;<NEW_LINE>if (myInstantiableCollectionType != null) {<NEW_LINE>try {<NEW_LINE>retValCollection = myInstantiableCollectionType.newInstance();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InternalErrorException(Msg.code(440) + "Failed to instantiate " + myInstantiableCollectionType.getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (QualifiedParamList nextParamList : theString) {<NEW_LINE>if (nextParamList.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (nextParamList.size() > 1) {<NEW_LINE>throw new InvalidRequestException(Msg.code(441) + theContext.getLocalizer().getMessage<MASK><NEW_LINE>}<NEW_LINE>String qualifier = nextParamList.getQualifier();<NEW_LINE>boolean iterate = ParameterUtil.isIncludeIterate(qualifier);<NEW_LINE>String value = nextParamList.get(0);<NEW_LINE>if (myAllow != null && !myAllow.isEmpty()) {<NEW_LINE>if (!myAllow.contains(value)) {<NEW_LINE>if (!myAllow.contains("*")) {<NEW_LINE>String msg = theContext.getLocalizer().getMessage(IncludeParameter.class, "invalidIncludeNameInRequest", value, new TreeSet<String>(myAllow).toString(), getName());<NEW_LINE>throw new InvalidRequestException(Msg.code(442) + msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myInstantiableCollectionType == null) {<NEW_LINE>if (mySpecType == String.class) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>return new Include(value, iterate);<NEW_LINE>}<NEW_LINE>retValCollection.add(new Include(value, iterate));<NEW_LINE>}<NEW_LINE>return retValCollection;<NEW_LINE>}
(IncludeParameter.class, "orIncludeInRequest"));
638,436
final CreateProcessingJobResult executeCreateProcessingJob(CreateProcessingJobRequest createProcessingJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createProcessingJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateProcessingJobRequest> request = null;<NEW_LINE>Response<CreateProcessingJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateProcessingJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createProcessingJobRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateProcessingJob");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateProcessingJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateProcessingJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
854,107
public BackgroundException map(final SSLException failure) {<NEW_LINE>final StringBuilder buffer = new StringBuilder();<NEW_LINE>for (Throwable cause : ExceptionUtils.getThrowableList(failure)) {<NEW_LINE>if (cause instanceof SocketException) {<NEW_LINE>// Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Broken pipe<NEW_LINE>return new DefaultSocketExceptionMappingService()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String message = failure.getMessage();<NEW_LINE>for (Alert alert : Alert.values()) {<NEW_LINE>if (StringUtils.containsIgnoreCase(message, alert.name())) {<NEW_LINE>this.append(buffer, alert.getDescription());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (failure instanceof SSLHandshakeException) {<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof CertificateException) {<NEW_LINE>log.warn(String.format("Ignore certificate failure %s and drop connection", failure.getMessage()));<NEW_LINE>// Server certificate not accepted<NEW_LINE>return new ConnectionCanceledException(failure);<NEW_LINE>}<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof EOFException) {<NEW_LINE>// SSL peer shut down incorrectly<NEW_LINE>return this.wrap(failure, buffer);<NEW_LINE>}<NEW_LINE>return new SSLNegotiateException(buffer.toString(), failure);<NEW_LINE>}<NEW_LINE>if (ExceptionUtils.getRootCause(failure) instanceof GeneralSecurityException) {<NEW_LINE>this.append(buffer, ExceptionUtils.getRootCause(failure).getMessage());<NEW_LINE>return new InteroperabilityException(buffer.toString(), failure);<NEW_LINE>}<NEW_LINE>this.append(buffer, message);<NEW_LINE>return new InteroperabilityException(buffer.toString(), failure);<NEW_LINE>}
.map((SocketException) cause);
678,177
public AwsEc2InstanceViolation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsEc2InstanceViolation awsEc2InstanceViolation = new AwsEc2InstanceViolation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ViolationTarget", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsEc2InstanceViolation.setViolationTarget(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AwsEc2NetworkInterfaceViolations", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsEc2InstanceViolation.setAwsEc2NetworkInterfaceViolations(new ListUnmarshaller<AwsEc2NetworkInterfaceViolation>(AwsEc2NetworkInterfaceViolationJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return awsEc2InstanceViolation;<NEW_LINE>}
)).unmarshall(context));
134,953
public RestResponse copyRestApiCurl(@NotBlank(message = "{required}") String appId, @NotBlank(message = "{required}") String baseUrl, @NotBlank(message = "{required}") String path) {<NEW_LINE>String resultCURL = null;<NEW_LINE>CURLBuilder curlBuilder = new CURLBuilder(baseUrl + path);<NEW_LINE>User user = commonService.getCurrentUser();<NEW_LINE>curlBuilder.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8").addHeader("Authorization", accessTokenService.getByUserId(user.getUserId()).getToken());<NEW_LINE>if ("/flink/app/start".equalsIgnoreCase(path)) {<NEW_LINE>resultCURL = curlBuilder.addFormData("allowNonRestored", "false").addFormData("flameGraph", "false").addFormData("savePoint", "").addFormData("savePointed", "false").addFormData(<MASK><NEW_LINE>} else if ("/flink/app/cancel".equalsIgnoreCase(path)) {<NEW_LINE>resultCURL = curlBuilder.addFormData("id", appId).addFormData("savePointed", "false").addFormData("drain", "false").addFormData("savePoint", "").build();<NEW_LINE>}<NEW_LINE>return RestResponse.success(resultCURL);<NEW_LINE>}
"id", appId).build();
590,559
protected Void doInBackground() {<NEW_LINE>int numberOfScrapes = 0;<NEW_LINE>int progressAmountPerWorker;<NEW_LINE>setProgress(0);<NEW_LINE>// failIfInterrupted();<NEW_LINE>// get the latest version of the sraper group preference - if it's not there for whatever reason (usually from a specific scrape), just leave it alone<NEW_LINE>ScraperGroupAmalgamationPreference scraperGroupAmalgamationPreferenceNew = allAmalgamationOrderingPreferences.getScraperGroupAmalgamationPreference(scraperGroupAmalgamationPreference.getScraperGroupName());<NEW_LINE>if (scraperGroupAmalgamationPreferenceNew != null)<NEW_LINE>scraperGroupAmalgamationPreference = scraperGroupAmalgamationPreferenceNew;<NEW_LINE>LinkedList<DataItemSource> scraperList = scraperGroupAmalgamationPreference<MASK><NEW_LINE>// calculate progress amount per worker<NEW_LINE>for (DataItemSource currentScraper : scraperList) {<NEW_LINE>if (shouldScrapeThread(currentScraper) && currentScraper instanceof SiteParsingProfile)<NEW_LINE>numberOfScrapes++;<NEW_LINE>}<NEW_LINE>if (numberOfScrapes == 0) {<NEW_LINE>progressAmountPerWorker = 100;<NEW_LINE>} else {<NEW_LINE>progressAmountPerWorker = 100 / numberOfScrapes;<NEW_LINE>}<NEW_LINE>for (DataItemSource currentScraper : scraperList) {<NEW_LINE>// We don't want to read any leftover properties from our JSON - we want to start fresh so things like scraping language do not get set in our scraper<NEW_LINE>currentScraper = currentScraper.createInstanceOfSameType();<NEW_LINE>if (currentScraper instanceof SiteParsingProfile) {<NEW_LINE>if (shouldScrapeThread(currentScraper)) {<NEW_LINE>scrapeMovieInBackground(fileToScrape, currentScraper, progressAmountPerWorker);<NEW_LINE>numberOfScrapesToRun++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// failIfInterrupted();<NEW_LINE>// System.out.println("returnMovie is " + returnMovie);<NEW_LINE>// setProgress(100);<NEW_LINE>return null;<NEW_LINE>}
.getOverallAmalgamationPreference().getAmalgamationPreferenceOrder();
177,571
private void drawControls(int sx, int sy) {<NEW_LINE>FontRenderer fr = getFontRenderer();<NEW_LINE>int textColor = ColorUtil.getRGB(engineControlEnabled.isSelected() ? Color.black : Color.darkGray);<NEW_LINE>int x0 = sx + TEXT_MARGIN_LEFT;<NEW_LINE>int y0 = sy + TEXT_MARGIN_TOP;<NEW_LINE>// Emit signal when storage less<NEW_LINE>String engineTxt1 = Lang.GUI_POWER_MONITOR_ENGINE_1.get().trim();<NEW_LINE>// than<NEW_LINE>String engineTxt2 = Lang.GUI_POWER_MONITOR_ENGINE_2.get().trim();<NEW_LINE>// % full.<NEW_LINE>String engineTxt3 = Lang.GUI_POWER_MONITOR_ENGINE_3.get().trim();<NEW_LINE>// Stop when storage greater than<NEW_LINE>String engineTxt4 = Lang.GUI_POWER_MONITOR_ENGINE_4<MASK><NEW_LINE>// or equal to<NEW_LINE>String engineTxt5 = Lang.GUI_POWER_MONITOR_ENGINE_5.get().trim();<NEW_LINE>List<Object> elems = new ArrayList<Object>();<NEW_LINE>elems.add(engineControlEnabled);<NEW_LINE>elems.addAll(Arrays.asList(engineTxt1.split("(\\s+)")));<NEW_LINE>elems.addAll(Arrays.asList(engineTxt2.split("(\\s+)")));<NEW_LINE>elems.add(engineControlStart);<NEW_LINE>elems.addAll(Arrays.asList(engineTxt3.split("(\\s+)")));<NEW_LINE>elems.addAll(Arrays.asList(engineTxt4.split("(\\s+)")));<NEW_LINE>elems.addAll(Arrays.asList(engineTxt5.split("(\\s+)")));<NEW_LINE>elems.add(engineControlStop);<NEW_LINE>elems.addAll(Arrays.asList(engineTxt3.split("(\\s+)")));<NEW_LINE>int x = 0, y = 0;<NEW_LINE>for (Object elem : elems) {<NEW_LINE>int elemWidth = 0;<NEW_LINE>if (elem instanceof String) {<NEW_LINE>elemWidth = fr.getStringWidth((String) elem);<NEW_LINE>} else if (elem instanceof CheckBox) {<NEW_LINE>elemWidth = ((CheckBox) elem).width;<NEW_LINE>} else if (elem instanceof TextFieldEnder) {<NEW_LINE>elemWidth = ((TextFieldEnder) elem).width;<NEW_LINE>}<NEW_LINE>if (x + elemWidth > TEXT_WIDTH) {<NEW_LINE>x = 0;<NEW_LINE>y += CONTROL_LF_PX;<NEW_LINE>if (" ".equals(elem)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (elem instanceof String) {<NEW_LINE>fr.drawString((String) elem, x0 + x, y0 + y + TEXT_Y_OFFSET, textColor);<NEW_LINE>} else if (elem instanceof CheckBox) {<NEW_LINE>((CheckBox) elem).x = x0 + x;<NEW_LINE>((CheckBox) elem).y = y0 + y;<NEW_LINE>} else if (elem instanceof TextFieldEnder) {<NEW_LINE>((TextFieldEnder) elem).x = x0 + x;<NEW_LINE>((TextFieldEnder) elem).y = y0 + y;<NEW_LINE>}<NEW_LINE>x += elemWidth + fr.getStringWidth(" ");<NEW_LINE>}<NEW_LINE>}
.get().trim();
921,971
private void replaceSimpleEnumSwitchInstruction(Clazz clazz, int loadOffset, int switchOffset, SwitchInstruction replacementSwitchInstruction) {<NEW_LINE>logger.debug(" Replacing switch instruction at [{}] -> [{}] swap + pop, {})", switchOffset, loadOffset, replacementSwitchInstruction.toString(switchOffset));<NEW_LINE>// Remove the array load instruction.<NEW_LINE>codeAttributeEditor.replaceInstruction(loadOffset, new Instruction[] { new SimpleInstruction(Instruction.OP_SWAP), new SimpleInstruction(Instruction.OP_POP) });<NEW_LINE>// Replace the switch instruction.<NEW_LINE>codeAttributeEditor.replaceInstruction(switchOffset, replacementSwitchInstruction);<NEW_LINE>// Visit the instruction, if required.<NEW_LINE>if (extraInstructionVisitor != null) {<NEW_LINE>// Note: we're not passing the right arguments for now, knowing that<NEW_LINE>// they aren't used anyway.<NEW_LINE>replacementSwitchInstruction.accept(clazz, <MASK><NEW_LINE>}<NEW_LINE>}
null, null, switchOffset, extraInstructionVisitor);
643,018
public void execute(AdminCommandContext context) {<NEW_LINE>final ActionReport report = context.getActionReport();<NEW_LINE>HashMap attrList = new HashMap();<NEW_LINE>attrList.put(FACTORY_CLASS, factoryClass);<NEW_LINE>attrList.put(RES_TYPE, resType);<NEW_LINE>attrList.put(JNDI_LOOKUP, jndiLookupName);<NEW_LINE>attrList.put(ENABLED, enabled.toString());<NEW_LINE>attrList.put(JNDI_NAME, jndiName);<NEW_LINE>attrList.<MASK><NEW_LINE>ResourceStatus rs;<NEW_LINE>try {<NEW_LINE>rs = jndiResManager.create(domain.getResources(), attrList, properties, target);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.getLogger(CreateJndiResource.class.getName()).log(Level.SEVERE, "Unable to create jndi resource " + jndiName, e);<NEW_LINE>String def = "jndi resource: {0} could not be created, reason: {1}";<NEW_LINE>report.setMessage(localStrings.getLocalString("create.jndi.resource.fail", def, jndiName) + " " + e.getLocalizedMessage());<NEW_LINE>report.setActionExitCode(ActionReport.ExitCode.FAILURE);<NEW_LINE>report.setFailureCause(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ActionReport.ExitCode ec = ActionReport.ExitCode.SUCCESS;<NEW_LINE>if (rs.getStatus() == ResourceStatus.FAILURE) {<NEW_LINE>ec = ActionReport.ExitCode.FAILURE;<NEW_LINE>if (rs.getMessage() == null) {<NEW_LINE>report.setMessage(localStrings.getLocalString("create.jndi.resource.fail", "jndi resource {0} creation failed", jndiName, ""));<NEW_LINE>}<NEW_LINE>if (rs.getException() != null)<NEW_LINE>report.setFailureCause(rs.getException());<NEW_LINE>}<NEW_LINE>if (rs.getMessage() != null) {<NEW_LINE>report.setMessage(rs.getMessage());<NEW_LINE>}<NEW_LINE>report.setActionExitCode(ec);<NEW_LINE>}
put(ServerTags.DESCRIPTION, description);
291,653
List<FloatIntPair> predict(int k, float threshold, Vector hidden, Vector output) {<NEW_LINE>if (k <= 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (args_.model != model_name.supervised) {<NEW_LINE>throw new IllegalArgumentException("Model needs to be supervised for prediction! Mmodel = " + args_.model);<NEW_LINE>}<NEW_LINE>PriorityQueue<FloatIntPair> heap = new PriorityQueue<>(k + 1, PAIR_COMPARATOR);<NEW_LINE>if (args_.loss == Args.loss_name.hierarchicalSoftmax) {<NEW_LINE>dfs(k, threshold, 2 * osz_ - 2, 0.0f, heap, hidden);<NEW_LINE>} else {<NEW_LINE>findKBest(k, threshold, heap, hidden, output);<NEW_LINE>}<NEW_LINE>List<FloatIntPair> result = new ArrayList<>(heap);<NEW_LINE>Collections.sort(result);<NEW_LINE>return result;<NEW_LINE>}
throw new IllegalArgumentException("k needs to be 1 or higher! Value = " + k);
1,308,657
public boolean[] encode(String contents) {<NEW_LINE>int length = contents.length();<NEW_LINE>if (length > 80) {<NEW_LINE>throw new IllegalArgumentException("Requested contents should be less than 80 digits long, but got " + length);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>int indexInString = Code39Reader.ALPHABET_STRING.indexOf(contents.charAt(i));<NEW_LINE>if (indexInString < 0) {<NEW_LINE>contents = tryToConvertToExtendedMode(contents);<NEW_LINE>length = contents.length();<NEW_LINE>if (length > 80) {<NEW_LINE>throw new IllegalArgumentException("Requested contents should be less than 80 digits long, but got " + length + " (extended full ASCII mode)");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] widths = new int[9];<NEW_LINE>int codeWidth = 24 + 1 + (13 * length);<NEW_LINE>boolean[] result = new boolean[codeWidth];<NEW_LINE>toIntArray(Code39Reader.ASTERISK_ENCODING, widths);<NEW_LINE>int pos = appendPattern(result, 0, widths, true);<NEW_LINE>int[] narrowWhite = { 1 };<NEW_LINE>pos += appendPattern(result, pos, narrowWhite, false);<NEW_LINE>// append next character to byte matrix<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>int indexInString = Code39Reader.ALPHABET_STRING.indexOf(contents.charAt(i));<NEW_LINE>toIntArray(Code39Reader.CHARACTER_ENCODINGS[indexInString], widths);<NEW_LINE>pos += appendPattern(result, pos, widths, true);<NEW_LINE>pos += appendPattern(result, pos, narrowWhite, false);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>appendPattern(result, pos, widths, true);<NEW_LINE>return result;<NEW_LINE>}
toIntArray(Code39Reader.ASTERISK_ENCODING, widths);
565,656
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE><MASK><NEW_LINE>int n1 = sc.nextInt();<NEW_LINE>System.out.println("Enter the number of columns of the first matrix");<NEW_LINE>int m1 = sc.nextInt();<NEW_LINE>System.out.println("Enter the elements of the first matrix");<NEW_LINE>int[][] arr_1 = new int[n1][m1];<NEW_LINE>for (int i = 0; i < n1; i++) {<NEW_LINE>for (int j = 0; j < m1; j++) {<NEW_LINE>arr_1[i][j] = sc.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Enter the number of rows of the second matrix");<NEW_LINE>int n2 = sc.nextInt();<NEW_LINE>System.out.println("Enter the number of columns of the second matrix");<NEW_LINE>int m2 = sc.nextInt();<NEW_LINE>System.out.println("Enter the elements of the second matrix");<NEW_LINE>int[][] arr_2 = new int[n2][m2];<NEW_LINE>for (int i = 0; i < n2; i++) {<NEW_LINE>for (int j = 0; j < m2; j++) {<NEW_LINE>arr_2[i][j] = sc.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[][] res = new int[n1][m1];<NEW_LINE>for (int i = 0; i < n1; i++) {<NEW_LINE>for (int j = 0; j < m1; j++) {<NEW_LINE>res[i][j] = arr_1[i][j] + arr_2[i][j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("The result of matrix addition is :");<NEW_LINE>for (int i = 0; i < n1; i++) {<NEW_LINE>for (int j = 0; j < m1; j++) {<NEW_LINE>System.out.print(res[i][j] + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>sc.close();<NEW_LINE>}
System.out.println("Enter the number of rows of the first matrix");
612,433
private void writeObjectMonitorToBuffer(FilterOptions filter, ObjectMonitor objMon, StringBuilder out) throws CorruptDataException {<NEW_LINE>if (filter.shouldPrint(objMon)) {<NEW_LINE>out.append(String.format("Object monitor for %s\t\n", objMon.getObject().formatShortInteractive()));<NEW_LINE>if (objMon.isInflated()) {<NEW_LINE>out.append("\tInflated\n");<NEW_LINE>} else {<NEW_LINE>if (objMon.isContended()) {<NEW_LINE>out.append("\tContended Flatlocked\n");<NEW_LINE>} else if (objMon.getLockword().isNull()) {<NEW_LINE>out.append("\tDeflated\n");<NEW_LINE>} else {<NEW_LINE>out.append("\tFlatlocked\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>J9ObjectMonitorPointer j9ObjMonPtr = objMon.getJ9ObjectMonitorPointer();<NEW_LINE>if (j9ObjMonPtr.notNull()) {<NEW_LINE>out.append(String.format("\t%s %s\n", j9ObjMonPtr.formatShortInteractive(), j9ObjMonPtr.monitor().formatShortInteractive()));<NEW_LINE>}<NEW_LINE>J9VMThreadPointer ownerThreadPointer = objMon.getOwner();<NEW_LINE>if (ownerThreadPointer.notNull()) {<NEW_LINE>out.append(String.format("\tOwner:\t%s\t%s\n", ownerThreadPointer.formatShortInteractive(), <MASK><NEW_LINE>}<NEW_LINE>if (!objMon.getBlockedThreads().isEmpty()) {<NEW_LINE>out.append(String.format("\t%s\t\n", "Blocking (Enter Waiter):"));<NEW_LINE>for (J9VMThreadPointer threadPtr : objMon.getBlockedThreads()) {<NEW_LINE>out.append(String.format("\t\t%s\t%s\n", threadPtr.formatShortInteractive(), J9VMThreadHelper.getName(threadPtr)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!objMon.getWaitingThreads().isEmpty()) {<NEW_LINE>out.append(String.format("\t%s\t\n", "Waiting (Notify Waiter):"));<NEW_LINE>for (J9VMThreadPointer threadPtr : objMon.getWaitingThreads()) {<NEW_LINE>out.append(String.format("\t\t%s\t%s\n", threadPtr.formatShortInteractive(), J9VMThreadHelper.getName(threadPtr)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.append(nl);<NEW_LINE>}<NEW_LINE>}
J9VMThreadHelper.getName(ownerThreadPointer)));
922,579
private static void updateJDBCResourcesAndPools(Resources resources, ServerInterface mejb) {<NEW_LINE>HashMap serverPools = getServerConnectionPools(mejb, WizardConstants.__GetJdbcConnectionPool);<NEW_LINE>HashMap serverDatasources = getServerResources(mejb, WizardConstants.__GetJdbcResource);<NEW_LINE>JdbcConnectionPool[] pools = resources.getJdbcConnectionPool();<NEW_LINE>JdbcResource[] dataSources = resources.getJdbcResource();<NEW_LINE>// Delete datasources that are in this project<NEW_LINE>HashMap dupJdbcResources = getProjectDatasources(serverDatasources, dataSources);<NEW_LINE>deleteServerResources(dupJdbcResources, mejb, DELETE_JDBC);<NEW_LINE>for (int i = 0; i < pools.length; i++) {<NEW_LINE>JdbcConnectionPool connectionPoolBean = pools[i];<NEW_LINE>String newPoolName = connectionPoolBean.getName();<NEW_LINE>// Is this pool registered on the server.<NEW_LINE>if (serverPools.containsKey(newPoolName)) {<NEW_LINE>HashMap serverJdbcResources = getReferringResources(newPoolName, serverDatasources, mejb);<NEW_LINE>if (serverJdbcResources.size() > 0) {<NEW_LINE>// Change this connectionPoolName<NEW_LINE>copyServerPool(serverPools, <MASK><NEW_LINE>updateExternalResource(serverJdbcResources, newPoolName, mejb);<NEW_LINE>}<NEW_LINE>deleteOldServerPool(newPoolName, DELETE_POOL, mejb);<NEW_LINE>} else {<NEW_LINE>// delete pool.<NEW_LINE>deleteOldServerPool(newPoolName, DELETE_POOL, mejb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
newPoolName, WizardConstants.__CreateCP, mejb);
1,690,332
public void onLoad() {<NEW_LINE>this.skillDepot = GenshinData.getAvatarSkillDepotDataMap().get(this.SkillDepotId);<NEW_LINE>// Get fetters from GenshinData<NEW_LINE>this.fetters = GenshinData.getFetterDataEntries().get(this.Id);<NEW_LINE>int size = GenshinData.getAvatarCurveDataMap().size();<NEW_LINE>this.hpGrowthCurve = new float[size];<NEW_LINE>this.attackGrowthCurve = new float[size];<NEW_LINE>this<MASK><NEW_LINE>for (AvatarCurveData curveData : GenshinData.getAvatarCurveDataMap().values()) {<NEW_LINE>int level = curveData.getLevel() - 1;<NEW_LINE>for (PropGrowCurve growCurve : this.PropGrowCurves) {<NEW_LINE>FightProperty prop = FightProperty.getPropByName(growCurve.getType());<NEW_LINE>switch(prop) {<NEW_LINE>case FIGHT_PROP_BASE_HP:<NEW_LINE>this.hpGrowthCurve[level] = curveData.getCurveInfos().get(growCurve.getGrowCurve());<NEW_LINE>break;<NEW_LINE>case FIGHT_PROP_BASE_ATTACK:<NEW_LINE>this.attackGrowthCurve[level] = curveData.getCurveInfos().get(growCurve.getGrowCurve());<NEW_LINE>break;<NEW_LINE>case FIGHT_PROP_BASE_DEFENSE:<NEW_LINE>this.defenseGrowthCurve[level] = curveData.getCurveInfos().get(growCurve.getGrowCurve());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Cache abilities<NEW_LINE>String[] split = this.IconName.split("_");<NEW_LINE>if (split.length > 0) {<NEW_LINE>this.name = split[split.length - 1];<NEW_LINE>AbilityEmbryoEntry info = GenshinData.getAbilityEmbryoInfo().get(this.name);<NEW_LINE>if (info != null) {<NEW_LINE>this.abilities = new IntArrayList(info.getAbilities().length);<NEW_LINE>for (String ability : info.getAbilities()) {<NEW_LINE>this.abilities.add(Utils.abilityHash(ability));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.defenseGrowthCurve = new float[size];