idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,053,447 | public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {<NEW_LINE>final View view = inflater.inflate(R.layout.wallet_transactions_fragment, container, false);<NEW_LINE>viewGroup = view.<MASK><NEW_LINE>emptyView = view.findViewById(R.id.wallet_transactions_empty);<NEW_LINE>recyclerView = view.findViewById(R.id.wallet_transactions_list);<NEW_LINE>recyclerView.setHasFixedSize(true);<NEW_LINE>recyclerView.setLayoutManager(new StickToTopLinearLayoutManager(activity));<NEW_LINE>recyclerView.setAdapter(adapter);<NEW_LINE>recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {<NEW_LINE><NEW_LINE>private final int PADDING = 2 * activity.getResources().getDimensionPixelOffset(R.dimen.card_margin_vertical);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void getItemOffsets(final Rect outRect, final View view, final RecyclerView parent, final RecyclerView.State state) {<NEW_LINE>super.getItemOffsets(outRect, view, parent, state);<NEW_LINE>final int position = parent.getChildAdapterPosition(view);<NEW_LINE>if (position == 0)<NEW_LINE>outRect.top += PADDING;<NEW_LINE>else if (position == parent.getAdapter().getItemCount() - 1)<NEW_LINE>outRect.bottom += PADDING;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>} | findViewById(R.id.wallet_transactions_group); |
655,411 | private void runActionTypeInit(FormStructureHelper formStructureHelper) {<NEW_LINE>if ((request.getAttribute(FormsHelper.REQ_ATTR_IS_INIT) == null)) {<NEW_LINE>request.setAttribute(FormsHelper.REQ_ATTR_IS_INIT, "true");<NEW_LINE>final RequestPathInfo requestPathInfo = request.getRequestPathInfo();<NEW_LINE>if (response != null && !StringUtils.equals(requestPathInfo.getSelectorString(), SCRIPT_FORM_SERVER_VALIDATION) && StringUtils.isNotEmpty(actionType)) {<NEW_LINE>final Resource formStart = formStructureHelper.getFormResource(request.getResource());<NEW_LINE>try {<NEW_LINE>FormsHelper.runAction(actionType, <MASK><NEW_LINE>} catch (IOException | ServletException e) {<NEW_LINE>LOGGER.error("Unable to initialise form " + resource.getPath(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>request.removeAttribute(FormsHelper.REQ_ATTR_IS_INIT);<NEW_LINE>}<NEW_LINE>} | INIT_SCRIPT, formStart, request, response); |
963,813 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {<NEW_LINE>Context ctx = parent.getContext();<NEW_LINE>LayoutInflater inflater = UiUtilities.getInflater(ctx, nightMode);<NEW_LINE>switch(ItemType.values()[viewType]) {<NEW_LINE>case WIDGET:<NEW_LINE>View itemView = inflater.inflate(R.layout.configure_screen_list_item_widget_reorder, parent, false);<NEW_LINE>return new WidgetViewHolder(itemView, ReorderWidgetsAdapter.this);<NEW_LINE>case HEADER:<NEW_LINE>return new HeaderViewHolder(inflater.inflate(R.layout.configure_screen_list_item_header, parent, false));<NEW_LINE>case CARD_DIVIDER:<NEW_LINE>return new DividerViewHolder(inflater.inflate(R.layout.list_item_divider, parent, false));<NEW_LINE>case CARD_TOP_DIVIDER:<NEW_LINE>itemView = inflater.inflate(R.layout.list_item_divider, parent, false);<NEW_LINE>View bottomShadow = itemView.findViewById(R.id.bottomShadowView);<NEW_LINE>bottomShadow.setVisibility(View.INVISIBLE);<NEW_LINE>return new DividerViewHolder(itemView);<NEW_LINE>case CARD_BOTTOM_DIVIDER:<NEW_LINE>return new DividerViewHolder(inflater.inflate(R.layout<MASK><NEW_LINE>case SPACE:<NEW_LINE>return new SpaceViewHolder(new View(ctx));<NEW_LINE>case BUTTON:<NEW_LINE>return new ButtonViewHolder(inflater.inflate(R.layout.configure_screen_list_item_button, parent, false));<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported view type");<NEW_LINE>}<NEW_LINE>} | .card_bottom_divider, parent, false)); |
136,737 | public ReferenceBinding[] substitute(Substitution substitution, ReferenceBinding[] originalTypes) {<NEW_LINE>if (originalTypes == null)<NEW_LINE>return null;<NEW_LINE>ReferenceBinding[] substitutedTypes = originalTypes;<NEW_LINE>for (int i = 0, length = originalTypes.length; i < length; i++) {<NEW_LINE>ReferenceBinding originalType = originalTypes[i];<NEW_LINE>TypeBinding <MASK><NEW_LINE>if (!(substitutedType instanceof ReferenceBinding)) {<NEW_LINE>// impossible substitution<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (substitutedType != originalType) {<NEW_LINE>// $IDENTITY-COMPARISON$<NEW_LINE>if (substitutedTypes == originalTypes) {<NEW_LINE>System.arraycopy(originalTypes, 0, substitutedTypes = new ReferenceBinding[length], 0, i);<NEW_LINE>}<NEW_LINE>substitutedTypes[i] = (ReferenceBinding) substitutedType;<NEW_LINE>} else if (substitutedTypes != originalTypes) {<NEW_LINE>substitutedTypes[i] = originalType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return substitutedTypes;<NEW_LINE>} | substitutedType = substitute(substitution, originalType); |
1,329,540 | private Type createTempType() throws CoreException {<NEW_LINE>Expression expression = getSelectedExpression().getAssociatedExpression();<NEW_LINE>Type resultingType = null;<NEW_LINE>ITypeBinding typeBinding = expression.resolveTypeBinding();<NEW_LINE>ASTRewrite rewrite = fCURewrite.getASTRewrite();<NEW_LINE>AST ast = rewrite.getAST();<NEW_LINE>if (expression instanceof ClassInstanceCreation && (typeBinding == null || typeBinding.getTypeArguments().length == 0)) {<NEW_LINE>resultingType = (Type) rewrite.createCopyTarget(((ClassInstanceCreation) expression).getType());<NEW_LINE>} else if (expression instanceof CastExpression) {<NEW_LINE>resultingType = (Type) rewrite.createCopyTarget(((CastExpression) expression).getType());<NEW_LINE>} else {<NEW_LINE>if (typeBinding == null) {<NEW_LINE>typeBinding = ASTResolving.guessBindingForReference(expression);<NEW_LINE>}<NEW_LINE>if (typeBinding != null) {<NEW_LINE>typeBinding = Bindings.normalizeForDeclarationUse(typeBinding, ast);<NEW_LINE><MASK><NEW_LINE>ImportRewriteContext context = new ContextSensitiveImportRewriteContext(expression, importRewrite);<NEW_LINE>resultingType = importRewrite.addImport(typeBinding, ast, context, TypeLocation.LOCAL_VARIABLE);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>resultingType = ast.newSimpleType(ast.newSimpleName("Object"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fLinkedProposalModel != null) {<NEW_LINE>LinkedProposalPositionGroupCore typeGroup = fLinkedProposalModel.getPositionGroup(KEY_TYPE, true);<NEW_LINE>typeGroup.addPosition(rewrite.track(resultingType), false);<NEW_LINE>if (typeBinding != null) {<NEW_LINE>ITypeBinding[] relaxingTypes = ASTResolving.getNarrowingTypes(ast, typeBinding);<NEW_LINE>for (int i = 0; i < relaxingTypes.length; i++) {<NEW_LINE>typeGroup.addProposal(relaxingTypes[i], fCURewrite.getCu(), relaxingTypes.length - i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultingType;<NEW_LINE>} | ImportRewrite importRewrite = fCURewrite.getImportRewrite(); |
1,675,269 | public static void radixSort(int[] input) {<NEW_LINE>List<Integer>[] buckets = new ArrayList[10];<NEW_LINE>for (// initialize buckets<NEW_LINE>// initialize buckets<NEW_LINE>int i = 0; // initialize buckets<NEW_LINE>i < buckets.length; i++) buckets[i] = new ArrayList<Integer>();<NEW_LINE>int divisor = 1;<NEW_LINE>String s = Integer.toString(findMax(input));<NEW_LINE>// count is the number of digits of the largest number<NEW_LINE>int count = s.length();<NEW_LINE>for (int i = 0; i < count; divisor *= 10, i++) {<NEW_LINE>for (Integer num : input) {<NEW_LINE>assert (num >= 0);<NEW_LINE>int temp = num / divisor;<NEW_LINE>buckets[temp <MASK><NEW_LINE>}<NEW_LINE>// Load buckets back into the input array<NEW_LINE>int j = 0;<NEW_LINE>for (int k = 0; k < 10; k++) {<NEW_LINE>for (Integer x : buckets[k]) {<NEW_LINE>input[j++] = x;<NEW_LINE>}<NEW_LINE>buckets[k].clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | % 10].add(num); |
411,097 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String test = request.getParameter("test");<NEW_LINE><MASK><NEW_LINE>out.println("Starting " + test + "<br>");<NEW_LINE>// The injection engine doesn't like this at the class level.<NEW_LINE>TraceComponent tc = Tr.register(JMSProducer_118073Servlet.class);<NEW_LINE>Tr.entry(this, tc, test);<NEW_LINE>try {<NEW_LINE>System.out.println(" Starting : " + test);<NEW_LINE>getClass().getMethod(test, HttpServletRequest.class, HttpServletResponse.class).invoke(this, request, response);<NEW_LINE>out.println(test + " COMPLETED SUCCESSFULLY");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>Tr.exit(this, tc, test);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof InvocationTargetException) {<NEW_LINE>e = e.getCause();<NEW_LINE>}<NEW_LINE>out.println("<pre>ERROR in " + test + ":");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>System.out.println(" <ERROR> " + e.getMessage() + " </ERROR>");<NEW_LINE>e.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>Tr.exit(this, tc, test, e);<NEW_LINE>}<NEW_LINE>} | PrintWriter out = response.getWriter(); |
1,524,990 | public void compute(double[][] seasonMatrix, int sP, int sQ, int season) {<NEW_LINE>// step 1: find CSS result<NEW_LINE>SCSSEstimate scssEstimate = new SCSSEstimate();<NEW_LINE>scssEstimate.compute(seasonMatrix, sP, sQ, season);<NEW_LINE>ArrayList<double[]> initCoef = new ArrayList<>();<NEW_LINE>initCoef.add(scssEstimate.sARCoef);<NEW_LINE>initCoef.add(scssEstimate.sMACoef);<NEW_LINE>initCoef.add(new double[] { scssEstimate.variance });<NEW_LINE>// step 2: set residual[i]=0, if i<initPoint; set data[i]=0, if i<initPoint<NEW_LINE>double[] cResidual = new double[seasonMatrix[0].length];<NEW_LINE>SMLEGradientTarget smleGT = new SMLEGradientTarget();<NEW_LINE>smleGT.fit(seasonMatrix, cResidual, initCoef, season);<NEW_LINE>AbstractGradientTarget problem = BFGS.solve(smleGT, 1000, 0.01, 0.000001, new int[] { 1, 2, 3 }, -1);<NEW_LINE>this.sResidual = problem.getResidual();<NEW_LINE>this.logLikelihood = -problem.getMinValue();<NEW_LINE>DenseMatrix result = problem.getFinalCoef();<NEW_LINE>this.warn = problem.getWarn();<NEW_LINE>this.sARCoef = new double[sP];<NEW_LINE>this.sMACoef = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sARCoef[i] = result.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMACoef[i] = result.<MASK><NEW_LINE>}<NEW_LINE>this.variance = result.get(sP + sQ, 0);<NEW_LINE>boolean gradientSuccess = Boolean.TRUE;<NEW_LINE>if (problem.getIter() < 2) {<NEW_LINE>gradientSuccess = Boolean.FALSE;<NEW_LINE>}<NEW_LINE>if (gradientSuccess) {<NEW_LINE>DenseMatrix information = problem.getH();<NEW_LINE>this.sArStdError = new double[sP];<NEW_LINE>this.sMaStdError = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sArStdError[i] = Math.sqrt(information.get(i, i));<NEW_LINE>if (Double.isNaN(this.sArStdError[i])) {<NEW_LINE>this.sArStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMaStdError[i] = Math.sqrt(information.get(i + sP, i + sP));<NEW_LINE>if (Double.isNaN(this.sMaStdError[i])) {<NEW_LINE>this.sMaStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.varianceStdError = Math.sqrt(information.get(sP + sQ, sP + sQ));<NEW_LINE>if (Double.isNaN(this.varianceStdError)) {<NEW_LINE>this.varianceStdError = -99;<NEW_LINE>} else {<NEW_LINE>this.sArStdError = scssEstimate.sArStdError;<NEW_LINE>this.sMaStdError = scssEstimate.sMaStdError;<NEW_LINE>this.varianceStdError = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(i + sP, 0); |
1,476,484 | public void configureVendorMetrics(String routingName, Routing.Rules rules) {<NEW_LINE>String metricPrefix = metricsNamePrefix(routingName);<NEW_LINE>KeyPerformanceIndicatorSupport.Metrics kpiMetrics = KeyPerformanceIndicatorMetricsImpls.get(metricPrefix, metricsSettings.keyPerformanceIndicatorSettings());<NEW_LINE>rules.any((req, res) -> {<NEW_LINE>KeyPerformanceIndicatorSupport.Context kpiContext = kpiContext(req);<NEW_LINE>PostRequestMetricsSupport prms = PostRequestMetricsSupport.create();<NEW_LINE>req.<MASK><NEW_LINE>kpiContext.requestHandlingStarted(kpiMetrics);<NEW_LINE>// Perform updates which depend on completion of request *processing* (after the response is sent).<NEW_LINE>res.whenSent().thenAccept(r -> postRequestProcessing(prms, req, r, null, kpiContext)).exceptionallyAccept(t -> postRequestProcessing(prms, req, res, t, kpiContext));<NEW_LINE>Exception exception = null;<NEW_LINE>try {<NEW_LINE>req.next();<NEW_LINE>} catch (Exception e) {<NEW_LINE>exception = e;<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>// Perform updates which depend on completion of request *handling* (after the server has begun request<NEW_LINE>// *processing* but, in the case of async requests, possibly before processing has finished).<NEW_LINE>kpiContext.requestHandlingCompleted(exception == null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | context().register(prms); |
679,048 | public void marshall(CreateIntegrationRequest createIntegrationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createIntegrationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getApiId(), APIID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getConnectionType(), CONNECTIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getContentHandlingStrategy(), CONTENTHANDLINGSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getCredentialsArn(), CREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationMethod(), INTEGRATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationSubtype(), INTEGRATIONSUBTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationType(), INTEGRATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getIntegrationUri(), INTEGRATIONURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getRequestParameters(), REQUESTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTemplateSelectionExpression(), TEMPLATESELECTIONEXPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createIntegrationRequest.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createIntegrationRequest.getPayloadFormatVersion(), PAYLOADFORMATVERSION_BINDING); |
529,143 | private void layout(ZoomableLabel label) {<NEW_LINE>String text = label.getText();<NEW_LINE>Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();<NEW_LINE>boolean wasPainting = isPainting;<NEW_LINE>try {<NEW_LINE>isPainting = true;<NEW_LINE>iconR.x = iconR.y = iconR.width = iconR.height = 0;<NEW_LINE>textR.x = textR.y = textR.width = textR.height = 0;<NEW_LINE>layoutCL(label, label.getFontMetrics(), text, icon, viewR, iconR, textR);<NEW_LINE>final float zoom = label.getZoom();<NEW_LINE>iconR.x = (int) (iconR.x * zoom);<NEW_LINE>iconR.y = (int) (iconR.y * zoom);<NEW_LINE>iconR.width = (int) (iconR.width * zoom);<NEW_LINE>iconR.height = (int) (iconR.height * zoom);<NEW_LINE>textR.x = (int) (textR.x * zoom);<NEW_LINE>textR.y = (int) (textR.y * zoom);<NEW_LINE>textR.width = (int) (textR.width * zoom);<NEW_LINE>textR.height = (int<MASK><NEW_LINE>} finally {<NEW_LINE>isPainting = wasPainting;<NEW_LINE>}<NEW_LINE>} | ) (textR.height * zoom); |
1,262,160 | public static <T1, T2, T3> double jointMI(WeightedTripleDistribution<T1, T2, T3> tripleRV) {<NEW_LINE>Map<CachedTriple<T1, T2, T3>, WeightCountTuple> jointCount = tripleRV.getJointCount();<NEW_LINE>Map<CachedPair<T1, T2>, WeightCountTuple> abCount = tripleRV.getABCount();<NEW_LINE>Map<T3, WeightCountTuple> cCount = tripleRV.getCCount();<NEW_LINE>double vectorLength = tripleRV.count;<NEW_LINE>double jmi = 0.0;<NEW_LINE>for (Entry<CachedTriple<T1, T2, T3>, WeightCountTuple> e : jointCount.entrySet()) {<NEW_LINE>double jointCurCount = e.getValue().count;<NEW_LINE>double jointCurWeight <MASK><NEW_LINE>double prob = jointCurCount / vectorLength;<NEW_LINE>CachedPair<T1, T2> pair = e.getKey().getAB();<NEW_LINE>double abCurCount = abCount.get(pair).count;<NEW_LINE>double cCurCount = cCount.get(e.getKey().getC()).count;<NEW_LINE>jmi += jointCurWeight * prob * Math.log((vectorLength * jointCurCount) / (abCurCount * cCurCount));<NEW_LINE>}<NEW_LINE>jmi /= LOG_BASE;<NEW_LINE>double stateRatio = vectorLength / jointCount.size();<NEW_LINE>if (stateRatio < SAMPLES_RATIO) {<NEW_LINE>logger.log(Level.INFO, "Joint MI estimate of {0} had samples/state ratio of {1}", new Object[] { jmi, stateRatio });<NEW_LINE>}<NEW_LINE>return jmi;<NEW_LINE>} | = e.getValue().weight; |
398,657 | public Builder mergeFrom(org.mlflow.api.proto.MlflowArtifacts.ListArtifacts.Response other) {<NEW_LINE>if (other == org.mlflow.api.proto.MlflowArtifacts.ListArtifacts.Response.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (filesBuilder_ == null) {<NEW_LINE>if (!other.files_.isEmpty()) {<NEW_LINE>if (files_.isEmpty()) {<NEW_LINE>files_ = other.files_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureFilesIsMutable();<NEW_LINE>files_.addAll(other.files_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.files_.isEmpty()) {<NEW_LINE>if (filesBuilder_.isEmpty()) {<NEW_LINE>filesBuilder_.dispose();<NEW_LINE>filesBuilder_ = null;<NEW_LINE>files_ = other.files_;<NEW_LINE><MASK><NEW_LINE>filesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getFilesFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>filesBuilder_.addAllMessages(other.files_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | bitField0_ = (bitField0_ & ~0x00000001); |
852,968 | private String interpolateLabel(Map<CaseInsensitiveString, String> materialRevisions, int pipelineCounter) {<NEW_LINE>final Matcher matcher = PATTERN.matcher(this.label);<NEW_LINE><MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>String token = matcher.group("name");<NEW_LINE>String value;<NEW_LINE>if (COUNT.equalsIgnoreCase(token)) {<NEW_LINE>value = Integer.toString(pipelineCounter);<NEW_LINE>} else if (token.toLowerCase().startsWith(ENV_VAR_PREFIX)) {<NEW_LINE>value = resolveEnvironmentVariable(token);<NEW_LINE>} else {<NEW_LINE>final String truncate = matcher.group("truncation");<NEW_LINE>value = resolveMaterialRevision(materialRevisions, token, truncate);<NEW_LINE>}<NEW_LINE>if (null == value) {<NEW_LINE>value = "\\" + matcher.group(0);<NEW_LINE>}<NEW_LINE>matcher.appendReplacement(buffer, value);<NEW_LINE>}<NEW_LINE>matcher.appendTail(buffer);<NEW_LINE>return buffer.toString();<NEW_LINE>} | final StringBuffer buffer = new StringBuffer(); |
1,506,578 | public static BarPlot of(double[] data, double[] breaks, boolean prob, Color color) {<NEW_LINE>int k = breaks.length - 1;<NEW_LINE>if (k <= 1) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of bins: " + k);<NEW_LINE>}<NEW_LINE>double[][] hist = smile.math.Histogram.of(data, breaks);<NEW_LINE>double[][] freq = new double[k][2];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[i][0] = (hist[0][i] + hist[<MASK><NEW_LINE>freq[i][1] = hist[2][i];<NEW_LINE>}<NEW_LINE>if (prob) {<NEW_LINE>double n = data.length;<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[i][1] /= n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BarPlot(new Bar(freq, width(freq), color));<NEW_LINE>} | 1][i]) / 2.0; |
313,950 | protected void runInContext() {<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>if (_inProgress.get() == 0) {<NEW_LINE>s_logger.debug("Running post certificate renewal task to restart services.");<NEW_LINE>// Let the resource perform any post certificate renewal cleanups<NEW_LINE>_resource.executeRequest(new PostCertificateRenewalCommand());<NEW_LINE>IAgentShell shell = agent._shell;<NEW_LINE>ServerResource resource = agent._resource.getClass().newInstance();<NEW_LINE>// Stop current agent<NEW_LINE>agent.cancelTasks();<NEW_LINE>agent._reconnectAllowed = false;<NEW_LINE>Runtime.getRuntime().removeShutdownHook(agent._shutdownThread);<NEW_LINE>agent.stop(ShutdownCommand.Requested, "Restarting due to new X509 certificates");<NEW_LINE>// Nullify references for GC<NEW_LINE>agent._shell = null;<NEW_LINE>agent._watchList = null;<NEW_LINE>agent._shutdownThread = null;<NEW_LINE>agent._controlListeners = null;<NEW_LINE>agent = null;<NEW_LINE>// Start a new agent instance<NEW_LINE>shell.launchNewAgent(resource);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (s_logger.isTraceEnabled()) {<NEW_LINE>s_logger.debug("Other tasks are in progress, will retry post certificate renewal command after few seconds");<NEW_LINE>}<NEW_LINE>Thread.sleep(5000);<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | s_logger.warn("Failed to execute post certificate renewal command:", e); |
941,865 | public void visit(LambdaExpr n, Object arg) {<NEW_LINE>printJavaComment(n.getComment(), arg);<NEW_LINE>final List<Parameter> parameters = n.getParameters();<NEW_LINE>final boolean printPar = n.isParametersEnclosed();<NEW_LINE>if (printPar) {<NEW_LINE>printer.print("(");<NEW_LINE>}<NEW_LINE>if (parameters != null) {<NEW_LINE>for (Iterator<Parameter> i = parameters.iterator(); i.hasNext(); ) {<NEW_LINE>Parameter p = i.next();<NEW_LINE>p.accept(this, arg);<NEW_LINE>if (i.hasNext()) {<NEW_LINE>printer.print(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (printPar) {<NEW_LINE>printer.print(")");<NEW_LINE>}<NEW_LINE>printer.print(" -> ");<NEW_LINE>final Statement body = n.getBody();<NEW_LINE>if (body instanceof ExpressionStmt) {<NEW_LINE>// Print the expression directly<NEW_LINE>((ExpressionStmt) body).getExpression().accept(this, arg);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | body.accept(this, arg); |
109,266 | final DescribeScalableTargetsResult executeDescribeScalableTargets(DescribeScalableTargetsRequest describeScalableTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScalableTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScalableTargetsRequest> request = null;<NEW_LINE>Response<DescribeScalableTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScalableTargetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeScalableTargetsRequest));<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, "Application Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScalableTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeScalableTargetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeScalableTargetsResultJsonUnmarshaller());<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); |
219,908 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>mapViewBuilder = new DefaultAirMapViewBuilder(this);<NEW_LINE>map = findViewById(R.id.map);<NEW_LINE>bottomToolsView = findViewById(R.id.bottom_tools);<NEW_LINE>logsRecyclerView = findViewById(R.id.logs);<NEW_LINE>((LinearLayoutManager) logsRecyclerView.getLayoutManager()).setReverseLayout(true);<NEW_LINE>logsRecyclerView.setAdapter(adapter);<NEW_LINE>Button btnMapTypeNormal = findViewById(R.id.btnMapTypeNormal);<NEW_LINE>Button btnMapTypeSattelite = findViewById(R.id.btnMapTypeSattelite);<NEW_LINE>Button btnMapTypeTerrain = findViewById(R.id.btnMapTypeTerrain);<NEW_LINE>btnMapTypeNormal.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(@NonNull View v) {<NEW_LINE>map.setMapType(MapType.MAP_TYPE_NORMAL);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>btnMapTypeSattelite.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(@NonNull View v) {<NEW_LINE>map.setMapType(MapType.MAP_TYPE_SATELLITE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>btnMapTypeTerrain.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(@NonNull View v) {<NEW_LINE>map.setMapType(MapType.MAP_TYPE_TERRAIN);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>map.setOnMapClickListener(this);<NEW_LINE>map.setOnCameraChangeListener(this);<NEW_LINE>map.setOnCameraMoveListener(this);<NEW_LINE>map.setOnMarkerClickListener(this);<NEW_LINE>map.setOnMapInitializedListener(this);<NEW_LINE>map.setOnInfoWindowClickListener(this);<NEW_LINE>map.initialize(getSupportFragmentManager());<NEW_LINE>} | setContentView(R.layout.activity_main); |
1,473,437 | ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setApplicationList(new ArrayList<Application>());<NEW_LINE>wo.setHttpProtocol(Config.nodes().centerServers().first().getValue().getHttpProtocol());<NEW_LINE>Center center = new Center();<NEW_LINE>center.setProxyHost(Config.nodes().centerServers().first().getValue().getProxyHost());<NEW_LINE>center.setProxyPort(Config.nodes().centerServers().first().getValue().getProxyPort());<NEW_LINE>wo.setCenter(center);<NEW_LINE>for (Entry<String, Node> en : Config.nodes().entrySet()) {<NEW_LINE>if (null != en.getValue()) {<NEW_LINE>WebServer webServer = en.getValue().getWeb();<NEW_LINE>if (null != webServer && BooleanUtils.isTrue(webServer.getEnable())) {<NEW_LINE>Web web = new Web();<NEW_LINE>web.setProxyHost(webServer.getProxyHost());<NEW_LINE>web.setProxyPort(webServer.getProxyPort());<NEW_LINE>wo.setWeb(web);<NEW_LINE>}<NEW_LINE>ApplicationServer applicationServer = en<MASK><NEW_LINE>if (null != applicationServer && BooleanUtils.isTrue(applicationServer.getEnable())) {<NEW_LINE>Application application = new Application();<NEW_LINE>application.setNode(en.getKey());<NEW_LINE>application.setProxyHost(applicationServer.getProxyHost());<NEW_LINE>application.setProxyPort(applicationServer.getProxyPort());<NEW_LINE>wo.getApplicationList().add(application);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | .getValue().getApplication(); |
1,536,078 | final DescribeConformancePacksResult executeDescribeConformancePacks(DescribeConformancePacksRequest describeConformancePacksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConformancePacksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConformancePacksRequest> request = null;<NEW_LINE>Response<DescribeConformancePacksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConformancePacksRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConformancePacks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConformancePacksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConformancePacksResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(describeConformancePacksRequest)); |
383,218 | public void validate(ValidationHelper helper, Context context, String key, OpenAPI t) {<NEW_LINE>if (t != null) {<NEW_LINE>String openapiVersion = t.getOpenapi();<NEW_LINE>ValidatorUtils.validateRequiredField(openapiVersion, context, DefinitionConstant.PROP_OPENAPI).ifPresent(helper::addValidationEvent);<NEW_LINE>ValidatorUtils.validateRequiredField(t.getInfo(), context, DefinitionConstant.PROP_INFO).ifPresent(helper::addValidationEvent);<NEW_LINE>ValidatorUtils.validateRequiredField(t.getPaths(), context, DefinitionConstant.PROP_PATHS).ifPresent(helper::addValidationEvent);<NEW_LINE>if (openapiVersion != null && !openapiVersion.startsWith("3.")) {<NEW_LINE>final String message = Tr.formatMessage(tc, ValidationMessageConstants.OPENAPI_VERSION_INVALID, openapiVersion);<NEW_LINE>helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context<MASK><NEW_LINE>}<NEW_LINE>List<Tag> tags = t.getTags();<NEW_LINE>if (tags != null) {<NEW_LINE>Set<String> tagNames = new HashSet<>();<NEW_LINE>for (Tag tag : tags) {<NEW_LINE>if (!tagNames.add(tag.getName())) {<NEW_LINE>final String message = Tr.formatMessage(tc, ValidationMessageConstants.OPENAPI_TAG_IS_NOT_UNIQUE, tag.getName());<NEW_LINE>helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation(), message));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getLocation(), message)); |
1,722,634 | public void handle(CommandBlock block) {<NEW_LINE>String path = FileSystem.denormalizePath(block.readString());<NEW_LINE><MASK><NEW_LINE>long size = block.read64();<NEW_LINE>try {<NEW_LINE>boolean close_file = false;<NEW_LINE>RandomAccessFile read_file = started_read_file;<NEW_LINE>if (read_file == null) {<NEW_LINE>read_file = new RandomAccessFile(path, "r");<NEW_LINE>close_file = true;<NEW_LINE>}<NEW_LINE>byte[] data = new byte[(int) size];<NEW_LINE>read_file.seek(offset);<NEW_LINE>int read = read_file.read(data, 0, (int) size);<NEW_LINE>if (close_file) {<NEW_LINE>read_file.close();<NEW_LINE>}<NEW_LINE>Logging.log("[cf] ReadFile(path: '" + path + "', offset: " + offset + ", size: " + size + ") -> read_size: " + read);<NEW_LINE>block.responseStart();<NEW_LINE>block.write64((long) read);<NEW_LINE>block.responseEnd();<NEW_LINE>block.sendBuffer(data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>block.respondFailure(ResultExceptionCaught);<NEW_LINE>}<NEW_LINE>} | long offset = block.read64(); |
800,554 | private void writeAttributes(Attributes atts) throws SAXException {<NEW_LINE>final int len = atts.getLength();<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>if ("xmlns".equals(atts.getQName(i))) {<NEW_LINE>// Redefines the default namespace.<NEW_LINE>forceNSDecl(atts.getValue(i));<NEW_LINE>} else if (atts.getQName(i) != null && atts.getQName(i).startsWith("xmlns")) {<NEW_LINE>// Defines the namespace using its prefix.<NEW_LINE>forceNSDecl(atts.getValue(i), atts.getLocalName(i));<NEW_LINE>} else {<NEW_LINE>final char[] ch = atts.getValue(i).toCharArray();<NEW_LINE>write(' ');<NEW_LINE>writeName(atts.getURI(i), atts.getLocalName(i), atts<MASK><NEW_LINE>write("=\"");<NEW_LINE>writeEsc(ch, 0, ch.length, true);<NEW_LINE>write('"');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getQName(i), false); |
914,194 | /* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.processor.MQLinkLocalization#delete()<NEW_LINE>*/<NEW_LINE>public void delete() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "delete");<NEW_LINE>// Mark the destination for deletion<NEW_LINE>try {<NEW_LINE>// Set the deletion flag in the DH persistently. A transaction per DH??<NEW_LINE>LocalTransaction siTran = txManager.createLocalTransaction(true);<NEW_LINE>setToBeDeleted(true);<NEW_LINE>// Adjust the destination lookups in Destination Manager<NEW_LINE>destinationManager.<MASK><NEW_LINE>requestUpdate((Transaction) siTran);<NEW_LINE>// commit the transaction<NEW_LINE>siTran.commit();<NEW_LINE>String name = _mqLinkName;<NEW_LINE>if (name == null)<NEW_LINE>name = getName();<NEW_LINE>SibTr.info(tc, "MQLINK_DEST_DELETE_INFO_CWSIP0064", new Object[] { name, _mqLinkUuid });<NEW_LINE>} catch (MessageStoreException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>// throw e;<NEW_LINE>} catch (SIException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>// handleRollback(siTran);<NEW_LINE>// throw e;<NEW_LINE>}<NEW_LINE>// Now start the asynch deletion thread to tidy up<NEW_LINE>destinationManager.startAsynchDeletion();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "delete");<NEW_LINE>} | getLinkIndex().delete(this); |
36,966 | protected JFreeChart createStackedBar3DChart() throws JRException {<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createStackedBarChart3D(evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression(((JRBar3DPlot) getPlot()).getCategoryAxisLabelExpression()), evaluateTextExpression(((JRBar3DPlot) getPlot()).getValueAxisLabelExpression()), (CategoryDataset) getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false);<NEW_LINE>configureChart(jfreeChart, getPlot());<NEW_LINE>CategoryPlot categoryPlot = (CategoryPlot) jfreeChart.getPlot();<NEW_LINE>JRBar3DPlot bar3DPlot = (JRBar3DPlot) getPlot();<NEW_LINE>StackedBarRenderer3D stackedBarRenderer3D = new StackedBarRenderer3D(bar3DPlot.getXOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble(), bar3DPlot.getYOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble());<NEW_LINE>boolean isShowLabels = bar3DPlot.getShowLabels() == null <MASK><NEW_LINE>stackedBarRenderer3D.setBaseItemLabelsVisible(isShowLabels);<NEW_LINE>if (isShowLabels) {<NEW_LINE>JRItemLabel itemLabel = bar3DPlot.getItemLabel();<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelFont(getFontUtil().getAwtFont(getFont(itemLabel == null ? null : itemLabel.getFont()), getLocale()));<NEW_LINE>if (itemLabel != null) {<NEW_LINE>if (itemLabel.getColor() != null) {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(itemLabel.getColor());<NEW_LINE>} else {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());<NEW_LINE>}<NEW_LINE>// categoryRenderer.setBaseFillPaint(itemLabel.getBackgroundColor());<NEW_LINE>// if(itemLabel.getMask() != null)<NEW_LINE>// {<NEW_LINE>// barRenderer3D.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(<NEW_LINE>// StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING,<NEW_LINE>// new DecimalFormat(itemLabel.getMask())));<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator) getLabelGenerator());<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator) getLabelGenerator());<NEW_LINE>stackedBarRenderer3D.setBaseItemLabelPaint(getChart().getForecolor());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>categoryPlot.setRenderer(stackedBarRenderer3D);<NEW_LINE>// Handle the axis formating for the category axis<NEW_LINE>configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(), bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(), bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(), bar3DPlot.getOwnCategoryAxisLineColor(), false, (Comparable<?>) evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()), (Comparable<?>) evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));<NEW_LINE>// Handle the axis formating for the value axis<NEW_LINE>configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(), bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(), bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(), bar3DPlot.getOwnValueAxisLineColor(), true, (Comparable<?>) evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()), (Comparable<?>) evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));<NEW_LINE>return jfreeChart;<NEW_LINE>} | ? false : bar3DPlot.getShowLabels(); |
565,402 | private OIndexSearchResult createIndexedProperty(final OSQLFilterCondition iCondition, final Object iItem, OCommandContext ctx) {<NEW_LINE>if (iItem == null || !(iItem instanceof OSQLFilterItemField)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (iCondition.getLeft() instanceof OSQLFilterItemField && iCondition.getRight() instanceof OSQLFilterItemField) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final OSQLFilterItemField item = (OSQLFilterItemField) iItem;<NEW_LINE>if (item.hasChainOperators() && !item.isFieldChain()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean inverted = iCondition.getRight() == iItem;<NEW_LINE>final Object origValue = inverted ? iCondition.getLeft() : iCondition.getRight();<NEW_LINE>OQueryOperator operator = iCondition.getOperator();<NEW_LINE>if (inverted) {<NEW_LINE>if (operator instanceof OQueryOperatorIn) {<NEW_LINE>operator = new OQueryOperatorContains();<NEW_LINE>} else if (operator instanceof OQueryOperatorContains) {<NEW_LINE>operator = new OQueryOperatorIn();<NEW_LINE>} else if (operator instanceof OQueryOperatorMajor) {<NEW_LINE>operator = new OQueryOperatorMinor();<NEW_LINE>} else if (operator instanceof OQueryOperatorMinor) {<NEW_LINE>operator = new OQueryOperatorMajor();<NEW_LINE>} else if (operator instanceof OQueryOperatorMajorEquals) {<NEW_LINE>operator = new OQueryOperatorMinorEquals();<NEW_LINE>} else if (operator instanceof OQueryOperatorMinorEquals) {<NEW_LINE>operator = new OQueryOperatorMajorEquals();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (iCondition.getOperator() instanceof OQueryOperatorBetween || operator instanceof OQueryOperatorIn) {<NEW_LINE>return new OIndexSearchResult(operator, item.getFieldChain(), origValue);<NEW_LINE>}<NEW_LINE>final Object value = OSQLHelper.getValue(origValue, null, ctx);<NEW_LINE>return new OIndexSearchResult(operator, <MASK><NEW_LINE>} | item.getFieldChain(), value); |
875,256 | static Color parseColor(String s) {<NEW_LINE>// blue and white came from a real file.<NEW_LINE>if ("blue".equals(s)) {<NEW_LINE>return new <MASK><NEW_LINE>}<NEW_LINE>if ("white".equals(s)) {<NEW_LINE>return new Color(255, 255, 255);<NEW_LINE>}<NEW_LINE>// I guessed these are valid color names in Rksim.<NEW_LINE>if ("red".equals(s)) {<NEW_LINE>return new Color(255, 0, 0);<NEW_LINE>}<NEW_LINE>if ("green".equals(s)) {<NEW_LINE>return new Color(0, 255, 0);<NEW_LINE>}<NEW_LINE>if ("black".equals(s)) {<NEW_LINE>return new Color(0, 0, 0);<NEW_LINE>}<NEW_LINE>s = s.replace("rgb(", "");<NEW_LINE>s = s.replace(")", "");<NEW_LINE>String[] ss = s.split(",");<NEW_LINE>return new Color(Integer.parseInt(ss[0]), Integer.parseInt(ss[1]), Integer.parseInt(ss[2]));<NEW_LINE>} | Color(0, 0, 255); |
879,374 | private void exportXML(ExportDataDumper eDD, String viewName) {<NEW_LINE>// Header<NEW_LINE>// NOI18N<NEW_LINE>String newline = System.getProperty("line.separator");<NEW_LINE>// NOI18N<NEW_LINE>StringBuffer result = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + newline + "<ExportedView Name=\"" + viewName + "\">" + newline);<NEW_LINE>// NOI18N<NEW_LINE>result.append("<TableData NumRows=\"").append(nTrackedItems).append("\" NumColumns=\"4\">").append(newline).append("<TableHeader>");<NEW_LINE>for (int i = 0; i < (columnNames.length); i++) {<NEW_LINE>// NOI18N<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(columnNames[i]).append("]]></TableColumn>").append(newline);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>result.append("</TableHeader>");<NEW_LINE>eDD.dumpData(result);<NEW_LINE>// Data<NEW_LINE>for (int i = 0; i < nTrackedItems; i++) {<NEW_LINE>// NOI18N<NEW_LINE>result = new StringBuffer(" <TableRow>" + newline + " <TableColumn><![CDATA[" + sortedClassNames[i] + "]]></TableColumn>" + newline);<NEW_LINE>// NOI18N<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(percentFormat.format(((double) totalLiveObjectsSize[i]) / nTotalLiveBytes)).append("]]></TableColumn>").append(newline);<NEW_LINE>// NOI18N<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(totalLiveObjectsSize[i]).append<MASK><NEW_LINE>// NOI18N<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(nTotalLiveObjects[i]).append("]]></TableColumn>").append(newline).append(" </TableRow>").append(newline);<NEW_LINE>eDD.dumpData(result);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>eDD.dumpDataAndClose(new StringBuffer(" </TableData>" + newline + "</ExportedView>"));<NEW_LINE>} | ("]]></TableColumn>").append(newline); |
513,153 | private StringBuffer createHeader(String packageName, String className) {<NEW_LINE>String script = getScript();<NEW_LINE>StringBuffer header = new StringBuffer();<NEW_LINE>// Add license<NEW_LINE><MASK><NEW_LINE>// New line<NEW_LINE>header.append(ModelInterfaceGenerator.NL);<NEW_LINE>// Package<NEW_LINE>header.append("package ").append(packageName).append(";\n");<NEW_LINE>// New line<NEW_LINE>header.append(ModelInterfaceGenerator.NL);<NEW_LINE>importClasses.keySet().forEach(importValue -> header.append(importValue).append(ModelInterfaceGenerator.NL));<NEW_LINE>header.append(ModelInterfaceGenerator.NL);<NEW_LINE>// Add comments<NEW_LINE>header.append("\n\n/** Generated Process for (").append(rule.getValue()).append(" ").append(rule.getName()).append(")\n");<NEW_LINE>if (rule.getDescription() != null) {<NEW_LINE>header.append(" * Description: ").append(rule.getDescription()).append("\n");<NEW_LINE>}<NEW_LINE>if (rule.getHelp() != null) {<NEW_LINE>header.append(" * Help: ").append(rule.getHelp()).append("\n");<NEW_LINE>}<NEW_LINE>header.append(" * @author ADempiere (generated) \n").append(" * @version ").append(Adempiere.MAIN_VERSION).append("\n").append(" */\n");<NEW_LINE>// Add Class Name<NEW_LINE>header.append("public class ").append(RuleEngineUtil.getClassName(rule)).append(" implements RuleInterface {");<NEW_LINE>// Description declaration<NEW_LINE>header.append("\n\n\tString description = null;");<NEW_LINE>// Add Prepare method<NEW_LINE>header.append("\n\n\t@Override").append("\n\tpublic Object run(MHRProcess process, Map<String, Object> engineContext) {").append("\n\t\t").append(script).append("\n\t\treturn result;").append("\n\t}");<NEW_LINE>// get Description<NEW_LINE>header.append("\n\n\t@Override").append("\n\tpublic String getDescription() {").append("\n\t\treturn description;").append("\n\t}");<NEW_LINE>// End class<NEW_LINE>header.append("\n}");<NEW_LINE>// Return<NEW_LINE>return header;<NEW_LINE>} | header.append(ModelInterfaceGenerator.COPY); |
741,167 | public void run() {<NEW_LINE>JmxModel model = JmxModelFactory.getJmxModelFor(application);<NEW_LINE>if (model == null || !model.isTakeHeapDumpSupported()) {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(HeapDumpProvider.class, "MSG_Dump_failed"), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String file = dumpFile;<NEW_LINE>if (file == null)<NEW_LINE>file = defineRemoteFile(model, customizeDumpFile);<NEW_LINE>if (file == null)<NEW_LINE>return;<NEW_LINE>if (model.takeHeapDump(file)) {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(HeapDumpProvider.class, "MSG_Dump_ok", file), NotifyDescriptor.INFORMATION_MESSAGE));<NEW_LINE>} else {<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>NotifyDescriptor.Message(// NOI18N<NEW_LINE>NbBundle.getMessage(HeapDumpProvider.class, "MSG_Dump_save_failed", <MASK><NEW_LINE>}<NEW_LINE>} | file), NotifyDescriptor.ERROR_MESSAGE)); |
37,909 | public Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, ConnectorInsertTableHandle insertHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics) {<NEW_LINE>if (fragments.isEmpty()) {<NEW_LINE>transaction.commitTransaction();<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>IcebergWritableTableHandle table = (IcebergWritableTableHandle) insertHandle;<NEW_LINE>org.apache.iceberg.Table icebergTable = transaction.table();<NEW_LINE>List<CommitTaskData> commitTasks = fragments.stream().map(slice -> commitTaskCodec.fromJson(slice.getBytes())).collect(toImmutableList());<NEW_LINE>Type[] partitionColumnTypes = icebergTable.spec().fields().stream().map(field -> field.transform().getResultType(icebergTable.schema().findType(field.sourceId()))).toArray(Type[]::new);<NEW_LINE><MASK><NEW_LINE>for (CommitTaskData task : commitTasks) {<NEW_LINE>DataFiles.Builder builder = DataFiles.builder(icebergTable.spec()).withPath(task.getPath()).withFileSizeInBytes(task.getFileSizeInBytes()).withFormat(table.getFileFormat()).withMetrics(task.getMetrics().metrics());<NEW_LINE>if (!icebergTable.spec().fields().isEmpty()) {<NEW_LINE>String partitionDataJson = task.getPartitionDataJson().orElseThrow(() -> new VerifyException("No partition data for partitioned table"));<NEW_LINE>builder.withPartition(PartitionData.fromJson(partitionDataJson, partitionColumnTypes));<NEW_LINE>}<NEW_LINE>appendFiles.appendFile(builder.build());<NEW_LINE>}<NEW_LINE>appendFiles.commit();<NEW_LINE>transaction.commitTransaction();<NEW_LINE>return Optional.of(new HiveWrittenPartitions(commitTasks.stream().map(CommitTaskData::getPath).collect(toImmutableList())));<NEW_LINE>} | AppendFiles appendFiles = transaction.newFastAppend(); |
922,352 | public void marshall(Integration integration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (integration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(integration.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getHttpMethod(), HTTPMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getUri(), URI_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getConnectionType(), CONNECTIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(integration.getCredentials(), CREDENTIALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getRequestParameters(), REQUESTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getRequestTemplates(), REQUESTTEMPLATES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getPassthroughBehavior(), PASSTHROUGHBEHAVIOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getContentHandling(), CONTENTHANDLING_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTimeoutInMillis(), TIMEOUTINMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheNamespace(), CACHENAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getCacheKeyParameters(), CACHEKEYPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getIntegrationResponses(), INTEGRATIONRESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(integration.getTlsConfig(), TLSCONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | integration.getConnectionId(), CONNECTIONID_BINDING); |
1,352,633 | private long readStreamChunk(ByteBufferStream buffer, long size, MessageDigest md5, MessageDigest sha256) throws IOException {<NEW_LINE>long totalBytesRead = 0;<NEW_LINE>if (this.oneByte != null) {<NEW_LINE>buffer.write(this.oneByte);<NEW_LINE>md5.update(this.oneByte);<NEW_LINE>if (sha256 != null)<NEW_LINE>sha256.update(this.oneByte);<NEW_LINE>totalBytesRead++;<NEW_LINE>this.oneByte = null;<NEW_LINE>}<NEW_LINE>while (totalBytesRead < size) {<NEW_LINE>long bytesToRead = size - totalBytesRead;<NEW_LINE>if (bytesToRead > this.buf16k.length)<NEW_LINE>bytesToRead = this.buf16k.length;<NEW_LINE>int bytesRead = this.stream.read(this.buf16k, 0, (int) bytesToRead);<NEW_LINE>this<MASK><NEW_LINE>if (this.eof) {<NEW_LINE>if (this.objectSize < 0)<NEW_LINE>break;<NEW_LINE>throw new IOException("unexpected EOF");<NEW_LINE>}<NEW_LINE>buffer.write(this.buf16k, 0, bytesRead);<NEW_LINE>md5.update(this.buf16k, 0, bytesRead);<NEW_LINE>if (sha256 != null)<NEW_LINE>sha256.update(this.buf16k, 0, bytesRead);<NEW_LINE>totalBytesRead += bytesRead;<NEW_LINE>}<NEW_LINE>return totalBytesRead;<NEW_LINE>} | .eof = (bytesRead < 0); |
1,344,374 | public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> serviceBindings) {<NEW_LINE>Optional<ServiceBinding> matchingByType = ServiceBinding.singleMatchingByType("kafka", serviceBindings);<NEW_LINE>if (!matchingByType.isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Map<String, String> properties = new HashMap<>();<NEW_LINE>ServiceBinding binding = matchingByType.get();<NEW_LINE>String bootstrapServers = binding.getProperties().get("bootstrapServers");<NEW_LINE>if (bootstrapServers == null) {<NEW_LINE>bootstrapServers = binding.getProperties().get("bootstrap-servers");<NEW_LINE>}<NEW_LINE>if (bootstrapServers != null) {<NEW_LINE>properties.put("kafka.bootstrap.servers", bootstrapServers);<NEW_LINE>}<NEW_LINE>String securityProtocol = binding.getProperties().get("securityProtocol");<NEW_LINE>if (securityProtocol != null) {<NEW_LINE>properties.put("kafka.security.protocol", securityProtocol);<NEW_LINE>}<NEW_LINE>String saslMechanism = binding.getProperties().get("saslMechanism");<NEW_LINE>if (saslMechanism != null) {<NEW_LINE>properties.put("kafka.sasl.mechanism", saslMechanism);<NEW_LINE>}<NEW_LINE>String user = binding.getProperties().get("user");<NEW_LINE>String password = binding.getProperties().get("password");<NEW_LINE>if ((user != null) && (password != null)) {<NEW_LINE>if ("PLAIN".equals(saslMechanism)) {<NEW_LINE>properties.put("kafka.sasl.jaas.config", String.format<MASK><NEW_LINE>}<NEW_LINE>if ("SCRAM-SHA-512".equals(saslMechanism) || "SCRAM-SHA-256".equals(saslMechanism)) {<NEW_LINE>properties.put("kafka.sasl.jaas.config", String.format("org.apache.kafka.common.security.scram.ScramLoginModule required username='%s' password='%s';", user, password));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new ServiceBindingConfigSource("kafka-k8s-service-binding-source", properties));<NEW_LINE>} | ("org.apache.kafka.common.security.plain.PlainLoginModule required username='%s' password='%s';", user, password)); |
1,466,801 | public void onReceive(Context context, Intent intent) {<NEW_LINE><MASK><NEW_LINE>String messageJson = intent.getStringExtra(MobiComKitConstants.MESSAGE_JSON_INTENT);<NEW_LINE>String activityToOpen = Utils.getMetaDataValueForReceiver(context, NotificationBroadcastReceiver.class.getName(), "activity.open.on.notification");<NEW_LINE>Intent newIntent;<NEW_LINE>if (actionName.equals(LAUNCH_APP)) {<NEW_LINE>String messageText = getMessageText(intent) == null ? null : getMessageText(intent).toString();<NEW_LINE>if (!TextUtils.isEmpty(messageText)) {<NEW_LINE>Message message = (Message) GsonUtils.getObjectFromJson(messageJson, Message.class);<NEW_LINE>Message replyMessage = new Message();<NEW_LINE>replyMessage.setTo(message.getTo());<NEW_LINE>replyMessage.setStoreOnDevice(Boolean.TRUE);<NEW_LINE>replyMessage.setSendToDevice(Boolean.FALSE);<NEW_LINE>replyMessage.setType(Message.MessageType.MT_OUTBOX.getValue());<NEW_LINE>replyMessage.setMessage(messageText);<NEW_LINE>replyMessage.setDeviceKeyString(MobiComUserPreference.getInstance(context).getDeviceKeyString());<NEW_LINE>replyMessage.setSource(Message.Source.MT_MOBILE_APP.getValue());<NEW_LINE>MessageWorker.enqueueWork(context, replyMessage, null, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: get activity name in intent...<NEW_LINE>Class activity = null;<NEW_LINE>try {<NEW_LINE>activity = Class.forName(activityToOpen);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (activity == null) {<NEW_LINE>}<NEW_LINE>newIntent = new Intent(context, activity);<NEW_LINE>newIntent.putExtra(MobiComKitConstants.MESSAGE_JSON_INTENT, messageJson);<NEW_LINE>newIntent.putExtra("sms_body", "text");<NEW_LINE>newIntent.setType("vnd.android-dir/mms-sms");<NEW_LINE>newIntent.setAction(NotificationBroadcastReceiver.LAUNCH_APP);<NEW_LINE>newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>context.startActivity(newIntent);<NEW_LINE>}<NEW_LINE>} | String actionName = intent.getAction(); |
942,915 | public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>if (finalResult != null) {<NEW_LINE>return finalResult.syncPull(ctx, nRecords);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < retries; i++) {<NEW_LINE>try {<NEW_LINE>if (OExecutionThreadLocal.isInterruptCurrentOperation()) {<NEW_LINE>throw new OCommandInterruptedException("The command has been interrupted");<NEW_LINE>}<NEW_LINE>OScriptExecutionPlan plan = initPlan(body, ctx);<NEW_LINE>OExecutionStepInternal result = plan.executeFull();<NEW_LINE>if (result != null) {<NEW_LINE>this.finalResult = result;<NEW_LINE>return result.syncPull(ctx, nRecords);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>} catch (ONeedRetryException ex) {<NEW_LINE>try {<NEW_LINE>ctx<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>if (i == retries - 1) {<NEW_LINE>if (elseBody != null && elseBody.size() > 0) {<NEW_LINE>OScriptExecutionPlan plan = initPlan(elseBody, ctx);<NEW_LINE>OExecutionStepInternal result = plan.executeFull();<NEW_LINE>if (result != null) {<NEW_LINE>this.finalResult = result;<NEW_LINE>return result.syncPull(ctx, nRecords);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (elseFail) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>finalResult = new EmptyStep(ctx, false);<NEW_LINE>return finalResult.syncPull(ctx, nRecords);<NEW_LINE>} | .getDatabase().rollback(); |
273,508 | public ExecuteResult call() throws Exception {<NEW_LINE>ExecuteResult result = new ExecuteResult("Generate Table[" + host.getDbSetName() + "." + host.getTableName() + "] Dao, Pojo, Test");<NEW_LINE>progress.setOtherMessage(result.getTaskName());<NEW_LINE>try {<NEW_LINE>VelocityContext context = GenUtils.buildDefaultVelocityContext();<NEW_LINE><MASK><NEW_LINE>GenUtils.mergeVelocityContext(context, String.format("%s/Dao/%sDao.java", mavenLikeDir.getAbsolutePath(), host.getPojoClassName()), "templates/java/dao/standard/DAO.java.tpl");<NEW_LINE>GenUtils.mergeVelocityContext(context, String.format("%s/Entity/%s.java", mavenLikeDir.getAbsolutePath(), host.getPojoClassName()), "templates/java/Pojo.java.tpl");<NEW_LINE>GenUtils.mergeVelocityContext(context, String.format("%s/Test/%sDaoUnitTest.java", mavenLikeDir.getAbsolutePath(), host.getPojoClassName()), "templates/java/test/DaoUnitTests.java.tpl");<NEW_LINE>result.setSuccessal(true);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | context.put("host", host); |
483,651 | private void countNode(List<PTuple> entries, ProfilerNode<Payload> node, double avgSampleTime) {<NEW_LINE>Collection<ProfilerNode<Payload>> children = node.getChildren();<NEW_LINE>Object[] profilerEntry = getProfilerEntry(node, avgSampleTime);<NEW_LINE>Object[] calls = new Object[children.size()];<NEW_LINE>int callIdx = 0;<NEW_LINE>for (ProfilerNode<Payload> childNode : children) {<NEW_LINE>countNode(entries, childNode, avgSampleTime);<NEW_LINE>calls[callIdx++] = factory().createStructSeq(LsprofModuleBuiltins.PROFILER_SUBENTRY_DESC, getProfilerEntry(childNode, avgSampleTime));<NEW_LINE>}<NEW_LINE>assert callIdx == calls.length;<NEW_LINE>profilerEntry = <MASK><NEW_LINE>profilerEntry[profilerEntry.length - 1] = factory().createList(calls);<NEW_LINE>entries.add(factory().createStructSeq(LsprofModuleBuiltins.PROFILER_ENTRY_DESC, profilerEntry));<NEW_LINE>} | Arrays.copyOf(profilerEntry, 6); |
1,622,998 | public static ClusterOperatorConfig fromMap(Map<String, String> map, KafkaVersion.Lookup lookup) {<NEW_LINE>Set<String> namespaces = parseNamespaceList(map.get(STRIMZI_NAMESPACE));<NEW_LINE>long reconciliationInterval = parseReconciliationInterval(map.get(STRIMZI_FULL_RECONCILIATION_INTERVAL_MS));<NEW_LINE>long operationTimeout = parseTimeout(map.get(STRIMZI_OPERATION_TIMEOUT_MS), DEFAULT_OPERATION_TIMEOUT_MS);<NEW_LINE>long connectBuildTimeout = parseTimeout(map.get(STRIMZI_CONNECT_BUILD_TIMEOUT_MS), DEFAULT_CONNECT_BUILD_TIMEOUT_MS);<NEW_LINE>boolean createClusterRoles = parseBoolean(map.get(STRIMZI_CREATE_CLUSTER_ROLES), DEFAULT_CREATE_CLUSTER_ROLES);<NEW_LINE>boolean networkPolicyGeneration = parseBoolean(map<MASK><NEW_LINE>ImagePullPolicy imagePullPolicy = parseImagePullPolicy(map.get(STRIMZI_IMAGE_PULL_POLICY));<NEW_LINE>List<LocalObjectReference> imagePullSecrets = parseImagePullSecrets(map.get(STRIMZI_IMAGE_PULL_SECRETS));<NEW_LINE>String operatorNamespace = map.get(STRIMZI_OPERATOR_NAMESPACE);<NEW_LINE>Labels operatorNamespaceLabels = parseLabels(map, STRIMZI_OPERATOR_NAMESPACE_LABELS);<NEW_LINE>RbacScope rbacScope = parseRbacScope(map.get(STRIMZI_RBAC_SCOPE));<NEW_LINE>Labels customResourceSelector = parseLabels(map, STRIMZI_CUSTOM_RESOURCE_SELECTOR);<NEW_LINE>String featureGates = map.getOrDefault(STRIMZI_FEATURE_GATES, "");<NEW_LINE>int operationsThreadPoolSize = parseInt(map.get(STRIMZI_OPERATIONS_THREAD_POOL_SIZE), DEFAULT_OPERATIONS_THREAD_POOL_SIZE);<NEW_LINE>int zkAdminSessionTimeout = parseInt(map.get(STRIMZI_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS), DEFAULT_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS);<NEW_LINE>int dnsCacheTtlSec = parseInt(map.get(STRIMZI_DNS_CACHE_TTL), DEFAULT_DNS_CACHE_TTL);<NEW_LINE>boolean podSetReconciliationOnly = parseBoolean(map.get(STRIMZI_POD_SET_RECONCILIATION_ONLY), DEFAULT_POD_SET_RECONCILIATION_ONLY);<NEW_LINE>int podSetControllerWorkQueueSize = parseInt(map.get(STRIMZI_POD_SET_CONTROLLER_WORK_QUEUE_SIZE), DEFAULT_POD_SET_CONTROLLER_WORK_QUEUE_SIZE);<NEW_LINE>return new ClusterOperatorConfig(namespaces, reconciliationInterval, operationTimeout, connectBuildTimeout, createClusterRoles, networkPolicyGeneration, lookup, imagePullPolicy, imagePullSecrets, operatorNamespace, operatorNamespaceLabels, rbacScope, customResourceSelector, featureGates, operationsThreadPoolSize, zkAdminSessionTimeout, dnsCacheTtlSec, podSetReconciliationOnly, podSetControllerWorkQueueSize);<NEW_LINE>} | .get(STRIMZI_NETWORK_POLICY_GENERATION), DEFAULT_NETWORK_POLICY_GENERATION); |
943,994 | private void lexVerbatimData(Matcher verbatimStartMatcher) {<NEW_LINE>// move cursor past the opening verbatim tag<NEW_LINE>this.source.advance(verbatimStartMatcher.end());<NEW_LINE>// look for the "endverbatim" tag and storing everything between<NEW_LINE>// now and then into a TEXT node<NEW_LINE>Matcher verbatimEndMatcher = this.syntax.getRegexVerbatimEnd().matcher(this.source);<NEW_LINE>// check for EOF<NEW_LINE>if (!verbatimEndMatcher.find()) {<NEW_LINE>throw new ParserException(null, "Unclosed verbatim tag.", this.source.getLineNumber(), this.source.getFilename());<NEW_LINE>}<NEW_LINE>String verbatimText = this.source.substring(verbatimEndMatcher.start());<NEW_LINE>// check if the verbatim start tag has a trailing whitespace trim<NEW_LINE>if (verbatimStartMatcher.group(0) != null) {<NEW_LINE>verbatimText = StringUtils.ltrim(verbatimText);<NEW_LINE>}<NEW_LINE>// check if the verbatim end tag had a leading whitespace trim<NEW_LINE>if (verbatimEndMatcher.group(1) != null) {<NEW_LINE>verbatimText = StringUtils.rtrim(verbatimText);<NEW_LINE>}<NEW_LINE>// check if the verbatim end tag had a trailing whitespace trim<NEW_LINE>if (verbatimEndMatcher.group(2) != null) {<NEW_LINE>this.trimLeadingWhitespaceFromNextData = true;<NEW_LINE>}<NEW_LINE>// move cursor past the verbatim text and end delimiter<NEW_LINE>this.source.advance(verbatimEndMatcher.end());<NEW_LINE>this.<MASK><NEW_LINE>} | pushToken(Type.TEXT, verbatimText); |
1,621,978 | private TraceId createTraceIdFromProperties(List<UserProperty> userProperties) {<NEW_LINE>String transactionId = null;<NEW_LINE>String spanID = null;<NEW_LINE>String parentSpanID = null;<NEW_LINE>String flags = null;<NEW_LINE>for (UserProperty property : userProperties) {<NEW_LINE>if (property.getKey().equals(Header.HTTP_TRACE_ID.toString())) {<NEW_LINE>transactionId = property.getValue();<NEW_LINE>} else if (property.getKey().equals(Header.HTTP_PARENT_SPAN_ID.toString())) {<NEW_LINE>parentSpanID = property.getValue();<NEW_LINE>} else if (property.getKey().equals(Header.HTTP_SPAN_ID.toString())) {<NEW_LINE>spanID = property.getValue();<NEW_LINE>} else if (property.getKey().equals(Header.HTTP_FLAGS.toString())) {<NEW_LINE>flags = property.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (transactionId == null || spanID == null || parentSpanID == null || flags == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return traceContext.createTraceId(transactionId, Long.parseLong(parentSpanID), Long.parseLong(spanID)<MASK><NEW_LINE>} | , Short.parseShort(flags)); |
499,120 | /* Take note of options used for a given library mapping, to facilitate<NEW_LINE>* looking them up later.<NEW_LINE>*/<NEW_LINE>private static Map<String, Object> cacheOptions(Class<?> cls, Map<String, ?> options, Object proxy) {<NEW_LINE>Map<String, Object> libOptions = new HashMap<MASK><NEW_LINE>libOptions.put(_OPTION_ENCLOSING_LIBRARY, cls);<NEW_LINE>typeOptions.put(cls, libOptions);<NEW_LINE>if (proxy != null) {<NEW_LINE>libraries.put(cls, new WeakReference<Object>(proxy));<NEW_LINE>}<NEW_LINE>// If it's a direct mapping, AND implements a Library interface,<NEW_LINE>// cache the library interface as well, so that any nested<NEW_LINE>// classes get the appropriate associated options<NEW_LINE>if (!cls.isInterface() && Library.class.isAssignableFrom(cls)) {<NEW_LINE>Class<?>[] ifaces = cls.getInterfaces();<NEW_LINE>for (Class<?> ifc : ifaces) {<NEW_LINE>if (Library.class.isAssignableFrom(ifc)) {<NEW_LINE>cacheOptions(ifc, libOptions, proxy);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return libOptions;<NEW_LINE>} | <String, Object>(options); |
726,937 | public static DescribeSyncReportDetailResponse unmarshall(DescribeSyncReportDetailResponse describeSyncReportDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSyncReportDetailResponse.setCode(_ctx.stringValue("DescribeSyncReportDetailResponse.code"));<NEW_LINE>describeSyncReportDetailResponse.setMessage(_ctx.stringValue("DescribeSyncReportDetailResponse.message"));<NEW_LINE>describeSyncReportDetailResponse.setRequestId(_ctx.stringValue("DescribeSyncReportDetailResponse.requestId"));<NEW_LINE>List<ResultItem> result = new ArrayList<ResultItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSyncReportDetailResponse.result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setDefaultDisplay(_ctx.booleanValue("DescribeSyncReportDetailResponse.result[" + i + "].defaultDisplay"));<NEW_LINE>resultItem.setErrorCount(_ctx.integerValue("DescribeSyncReportDetailResponse.result[" + i + "].errorCount"));<NEW_LINE>resultItem.setErrorPercent(_ctx.floatValue("DescribeSyncReportDetailResponse.result[" + i + "].errorPercent"));<NEW_LINE>resultItem.setSampleDisplay(_ctx.booleanValue("DescribeSyncReportDetailResponse.result[" + i + "].sampleDisplay"));<NEW_LINE>resultItem.setType(_ctx.stringValue<MASK><NEW_LINE>List<HistoryDataItem> historyData = new ArrayList<HistoryDataItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSyncReportDetailResponse.result[" + i + "].historyData.Length"); j++) {<NEW_LINE>HistoryDataItem historyDataItem = new HistoryDataItem();<NEW_LINE>historyDataItem.setEndTime(_ctx.longValue("DescribeSyncReportDetailResponse.result[" + i + "].historyData[" + j + "].endTime"));<NEW_LINE>historyDataItem.setErrorPercent(_ctx.floatValue("DescribeSyncReportDetailResponse.result[" + i + "].historyData[" + j + "].errorPercent"));<NEW_LINE>historyDataItem.setStartTime(_ctx.longValue("DescribeSyncReportDetailResponse.result[" + i + "].historyData[" + j + "].startTime"));<NEW_LINE>historyData.add(historyDataItem);<NEW_LINE>}<NEW_LINE>resultItem.setHistoryData(historyData);<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>describeSyncReportDetailResponse.setResult(result);<NEW_LINE>return describeSyncReportDetailResponse;<NEW_LINE>} | ("DescribeSyncReportDetailResponse.result[" + i + "].type")); |
182,705 | public ModelResponse<T> invoke(final ModelRequest request) {<NEW_LINE>int requireSize = 0;<NEW_LINE>final List<ModelResponse<T>> responses = Collections.synchronizedList(new ArrayList<ModelResponse<T>>());<NEW_LINE>final Semaphore semaphore = new Semaphore(0);<NEW_LINE>final Transaction t = Cat.getProducer().newTransaction("ModelService", getClass().getSimpleName());<NEW_LINE>int count = 0;<NEW_LINE>t.setStatus(Message.SUCCESS);<NEW_LINE>t.addData("request", request);<NEW_LINE>t.addData("thread", Thread.currentThread());<NEW_LINE>for (final ModelService<T> service : m_allServices) {<NEW_LINE>if (!service.isEligable(request)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// save current transaction so that child thread can access it<NEW_LINE>if (service instanceof ModelServiceWithCalSupport) {<NEW_LINE>((ModelServiceWithCalSupport) service).setParentTransaction(t);<NEW_LINE>}<NEW_LINE>requireSize++;<NEW_LINE>m_configManager.getModelServiceExecutorService().submit(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>ModelResponse<T> response = service.invoke(request);<NEW_LINE>if (response.getException() != null) {<NEW_LINE>logError(response.getException());<NEW_LINE>}<NEW_LINE>if (response != null && response.getModel() != null) {<NEW_LINE>responses.add(response);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError(e);<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>semaphore.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// 10 seconds timeout<NEW_LINE>semaphore.tryAcquire(count, 10000, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore it<NEW_LINE>t.setStatus(e);<NEW_LINE>} finally {<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>String requireAll = request.getProperty("requireAll");<NEW_LINE>if (requireAll != null && responses.size() != requireSize) {<NEW_LINE>String data = "require:" + requireSize + " actual:" + responses.size();<NEW_LINE>Cat.logEvent("FetchReportError:" + this.getClass().getSimpleName(), request.getDomain(), Event.SUCCESS, data);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ModelResponse<T> aggregated = new ModelResponse<T>();<NEW_LINE>T <MASK><NEW_LINE>aggregated.setModel(report);<NEW_LINE>return aggregated;<NEW_LINE>} | report = merge(request, responses); |
1,075,482 | public Number visitClass(ClassTree node, Void p) {<NEW_LINE>String name = node.getSimpleName().toString();<NEW_LINE>String newName = name;<NEW_LINE>if (name.startsWith("$")) {<NEW_LINE>if (parameterNames.containsKey(name)) {<NEW_LINE>newName = parameterNames.get(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<? extends TypeParameterTree> typeParams = <MASK><NEW_LINE>List<? extends Tree> implementsClauses = resolveMultiParameters(node.getImplementsClause());<NEW_LINE>List<? extends Tree> members = resolveMultiParameters(Utilities.filterHidden(getCurrentPath(), node.getMembers()));<NEW_LINE>Tree extend = resolveOptionalValue(node.getExtendsClause());<NEW_LINE>ClassTree nue = make.Class(node.getModifiers(), newName, typeParams, extend, implementsClauses, members);<NEW_LINE>rewrite(node, nue);<NEW_LINE>Element el = info.getTrees().getElement(getCurrentPath());<NEW_LINE>nestedTypes.add(el);<NEW_LINE>try {<NEW_LINE>return super.visitClass(nue, p);<NEW_LINE>} finally {<NEW_LINE>nestedTypes.remove(nestedTypes.size() - 1);<NEW_LINE>}<NEW_LINE>} | resolveMultiParameters(node.getTypeParameters()); |
1,518,010 | public static QueryTrademarkPriceResponse unmarshall(QueryTrademarkPriceResponse queryTrademarkPriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryTrademarkPriceResponse.setRequestId<MASK><NEW_LINE>queryTrademarkPriceResponse.setDiscountPrice(_ctx.floatValue("QueryTrademarkPriceResponse.DiscountPrice"));<NEW_LINE>queryTrademarkPriceResponse.setOriginalPrice(_ctx.floatValue("QueryTrademarkPriceResponse.OriginalPrice"));<NEW_LINE>queryTrademarkPriceResponse.setTradePrice(_ctx.floatValue("QueryTrademarkPriceResponse.TradePrice"));<NEW_LINE>queryTrademarkPriceResponse.setCurrency(_ctx.stringValue("QueryTrademarkPriceResponse.Currency"));<NEW_LINE>List<PricesItem> prices = new ArrayList<PricesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryTrademarkPriceResponse.Prices.Length"); i++) {<NEW_LINE>PricesItem pricesItem = new PricesItem();<NEW_LINE>pricesItem.setClassificationCode(_ctx.stringValue("QueryTrademarkPriceResponse.Prices[" + i + "].ClassificationCode"));<NEW_LINE>pricesItem.setDiscountPrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].DiscountPrice"));<NEW_LINE>pricesItem.setOriginalPrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].OriginalPrice"));<NEW_LINE>pricesItem.setTradePrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].TradePrice"));<NEW_LINE>pricesItem.setCurrency(_ctx.stringValue("QueryTrademarkPriceResponse.Prices[" + i + "].Currency"));<NEW_LINE>prices.add(pricesItem);<NEW_LINE>}<NEW_LINE>queryTrademarkPriceResponse.setPrices(prices);<NEW_LINE>return queryTrademarkPriceResponse;<NEW_LINE>} | (_ctx.stringValue("QueryTrademarkPriceResponse.RequestId")); |
752,827 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create table PointTable as (id string primary key, px double, py double);\n" + "create index MyIndex on PointTable((px,py) pointregionquadtree(0,0,100,100));\n" + "insert into PointTable select id, px, py from SupportSpatialPoint;\n" + "@name('s0') on SupportSpatialAABB as aabb select pt.id as c0 from PointTable as pt where point(px,py).inside(rectangle(x,y,width,height));\n";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>Random random = new Random();<NEW_LINE>List<SupportSpatialPoint> points = generateCoordinates(random, NUM_POINTS, WIDTH, HEIGHT);<NEW_LINE>for (SupportSpatialPoint point : points) {<NEW_LINE>sendPoint(env, point.getId(), point.getPx(), point.getPy());<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>EPCompiled deleteQuery = <MASK><NEW_LINE>EPFireAndForgetPreparedQueryParameterized preparedDelete = env.runtime().getFireAndForgetService().prepareQueryWithParameters(deleteQuery);<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>for (int i = 0; i < NUM_MOVES; i++) {<NEW_LINE>SupportSpatialPoint pointMoved = points.get(random.nextInt(points.size()));<NEW_LINE>movePoint(env, path, pointMoved, random, preparedDelete);<NEW_LINE>double startX = pointMoved.getPx() - 5;<NEW_LINE>double startY = pointMoved.getPy() - 5;<NEW_LINE>BoundingBox bb = new BoundingBox(startX, startY, startX + 10, startY + 10);<NEW_LINE>assertBBPoints(env, bb, points);<NEW_LINE>if (Arrays.binarySearch(CHECKPOINT_AT, i) >= 0) {<NEW_LINE>log.info("Checkpoint at " + points.size());<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>preparedDelete = env.runtime().getFireAndForgetService().prepareQueryWithParameters(deleteQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileFAF("delete from PointTable where id=?::string", path); |
504,919 | protected void actuallyCheckforUpdates(URI url, Collection<Plugin> plugins, String entryPoint) throws IOException {<NEW_LINE>LOGGER.fine("Checking for updates at " + url + " for " + getPluginNames(plugins));<NEW_LINE>if (DEBUG) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) url.toURL().openConnection();<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.setRequestMethod("POST");<NEW_LINE>conn.connect();<NEW_LINE>OutputStream out = conn.getOutputStream();<NEW_LINE>writeXml(out, plugins, entryPoint, true);<NEW_LINE>// for debugging:<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Sending");<NEW_LINE>writeXml(System.out, plugins, entryPoint, false);<NEW_LINE>}<NEW_LINE>int responseCode = conn.getResponseCode();<NEW_LINE>if (responseCode != 200) {<NEW_LINE>logError(SystemProperties.ASSERTIONS_ENABLED ? Level.WARNING : Level.FINE, "Error checking for updates at " + url + ": " + responseCode + " - " + conn.getResponseMessage());<NEW_LINE>} else {<NEW_LINE>parseUpdateXml(url, plugins, conn.getInputStream());<NEW_LINE>}<NEW_LINE>conn.disconnect();<NEW_LINE>} | System.out.println(url); |
1,350,179 | private Type coerceToSingleType(StackableAstVisitorContext<Context> context, String message, List<Expression> expressions) {<NEW_LINE>// determine super type<NEW_LINE>Type superType = UNKNOWN;<NEW_LINE>for (Expression expression : expressions) {<NEW_LINE>Optional<Type> newSuperType = functionAndTypeManager.getCommonSuperType(superType, process(expression, context));<NEW_LINE>if (!newSuperType.isPresent()) {<NEW_LINE>throw new SemanticException(TYPE_MISMATCH, expression, message, superType.getDisplayName());<NEW_LINE>}<NEW_LINE>superType = newSuperType.get();<NEW_LINE>}<NEW_LINE>// verify all expressions can be coerced to the superType<NEW_LINE>for (Expression expression : expressions) {<NEW_LINE>Type <MASK><NEW_LINE>if (!type.equals(superType)) {<NEW_LINE>if (!functionAndTypeManager.canCoerce(type, superType)) {<NEW_LINE>throw new SemanticException(TYPE_MISMATCH, expression, message, superType.getDisplayName());<NEW_LINE>}<NEW_LINE>addOrReplaceExpressionCoercion(expression, type, superType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return superType;<NEW_LINE>} | type = process(expression, context); |
271,127 | public String delete(String jobName, ServingJobType jobType, String jobVersion) throws IOException, ArenaException {<NEW_LINE>List<String> cmds = this.generateCommands("serve", "delete");<NEW_LINE>if (!jobType.equals(ServingJobType.AllServingJob) && !jobType.equals(ServingJobType.UnknownServingJob)) {<NEW_LINE>cmds.add("--type=" + jobType.shortHand());<NEW_LINE>}<NEW_LINE>if (jobVersion != null && jobVersion.length() != 0) {<NEW_LINE>cmds.add("--version=" + jobVersion);<NEW_LINE>}<NEW_LINE>cmds.add(jobName);<NEW_LINE>String[] arenaCommand = cmds.toArray(new String[cmds.size()]);<NEW_LINE>try {<NEW_LINE>String output = Command.execCommand(arenaCommand);<NEW_LINE>return output;<NEW_LINE>} catch (ExitCodeException e) {<NEW_LINE>throw new ArenaException(ArenaErrorEnum.<MASK><NEW_LINE>}<NEW_LINE>} | SERVING_DELETE, e.getMessage()); |
325,717 | public CreateSnapshotFromVolumeRecoveryPointResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateSnapshotFromVolumeRecoveryPointResult createSnapshotFromVolumeRecoveryPointResult = new CreateSnapshotFromVolumeRecoveryPointResult();<NEW_LINE><MASK><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 createSnapshotFromVolumeRecoveryPointResult;<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("SnapshotId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSnapshotFromVolumeRecoveryPointResult.setSnapshotId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VolumeARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSnapshotFromVolumeRecoveryPointResult.setVolumeARN(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VolumeRecoveryPointTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSnapshotFromVolumeRecoveryPointResult.setVolumeRecoveryPointTime(context.getUnmarshaller(String.class).unmarshall(context));<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 createSnapshotFromVolumeRecoveryPointResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
674,105 | public static List<BrokerOverviewVO> convert2BrokerOverviewList(List<BrokerOverviewDTO> brokerOverviewDTOList, List<RegionDO> regionDOList) {<NEW_LINE>if (ValidateUtils.isEmptyList(brokerOverviewDTOList)) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>Map<Integer, String> brokerIdRegionNameMap = convert2BrokerIdRegionNameMap(regionDOList);<NEW_LINE>List<BrokerOverviewVO> brokerOverviewVOList = new ArrayList<>();<NEW_LINE>for (BrokerOverviewDTO brokerOverviewDTO : brokerOverviewDTOList) {<NEW_LINE>BrokerOverviewVO brokerOverviewVO = new BrokerOverviewVO();<NEW_LINE>brokerOverviewVO.setBrokerId(brokerOverviewDTO.getBrokerId());<NEW_LINE>brokerOverviewVO.setHost(brokerOverviewDTO.getHost());<NEW_LINE>brokerOverviewVO.setPort(brokerOverviewDTO.getPort());<NEW_LINE>brokerOverviewVO.setJmxPort(brokerOverviewDTO.getJmxPort());<NEW_LINE>brokerOverviewVO.setStartTime(brokerOverviewDTO.getStartTime());<NEW_LINE>brokerOverviewVO.<MASK><NEW_LINE>brokerOverviewVO.setByteOut(brokerOverviewDTO.getByteOut());<NEW_LINE>brokerOverviewVO.setPartitionCount(brokerOverviewDTO.getPartitionCount());<NEW_LINE>brokerOverviewVO.setUnderReplicated(brokerOverviewDTO.getUnderReplicated());<NEW_LINE>brokerOverviewVO.setUnderReplicatedPartitions(brokerOverviewDTO.getUnderReplicatedPartitions());<NEW_LINE>brokerOverviewVO.setStatus(brokerOverviewDTO.getStatus());<NEW_LINE>brokerOverviewVO.setKafkaVersion(brokerOverviewDTO.getKafkaVersion());<NEW_LINE>brokerOverviewVO.setLeaderCount(brokerOverviewDTO.getLeaderCount());<NEW_LINE>brokerOverviewVO.setRegionName(brokerIdRegionNameMap.getOrDefault(brokerOverviewDTO.getBrokerId(), ""));<NEW_LINE>brokerOverviewVO.setPeakFlowStatus(brokerOverviewDTO.getPeakFlowStatus());<NEW_LINE>brokerOverviewVOList.add(brokerOverviewVO);<NEW_LINE>}<NEW_LINE>return brokerOverviewVOList;<NEW_LINE>} | setByteIn(brokerOverviewDTO.getByteIn()); |
1,400,474 | protected void sync() {<NEW_LINE>inSync = true;<NEW_LINE>WSDLComponent secBinding = null;<NEW_LINE>WSDLComponent topSecBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>WSDLComponent protTokenKind = SecurityTokensModelHelper.getTokenElement(topSecBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent protToken = SecurityTokensModelHelper.getTokenTypeElement(protTokenKind);<NEW_LINE>boolean secConv = (protToken instanceof SecureConversationToken);<NEW_LINE>setChBox(secConvChBox, secConv);<NEW_LINE>if (secConv) {<NEW_LINE>WSDLComponent bootPolicy = SecurityTokensModelHelper.<MASK><NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(bootPolicy);<NEW_LINE>Policy p = (Policy) secBinding.getParent();<NEW_LINE>setChBox(derivedKeysChBox, SecurityPolicyModelHelper.isRequireDerivedKeys(protToken));<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(p));<NEW_LINE>setChBox(encryptSignatureChBox, SecurityPolicyModelHelper.isEncryptSignature(bootPolicy));<NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(bootPolicy));<NEW_LINE>} else {<NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>setChBox(derivedKeysChBox, false);<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(comp));<NEW_LINE>setChBox(encryptSignatureChBox, SecurityPolicyModelHelper.isEncryptSignature(comp));<NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(comp));<NEW_LINE>}<NEW_LINE>WSDLComponent tokenKind = SecurityTokensModelHelper.getTokenElement(secBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent token = SecurityTokensModelHelper.getTokenTypeElement(tokenKind);<NEW_LINE>setChBox(reqDerivedKeys, SecurityPolicyModelHelper.isRequireDerivedKeys(token));<NEW_LINE>setCombo(algoSuiteCombo, AlgoSuiteModelHelper.getAlgorithmSuite(secBinding));<NEW_LINE>setCombo(layoutCombo, SecurityPolicyModelHelper.getMessageLayout(secBinding));<NEW_LINE>if (secConv) {<NEW_LINE>tokenKind = SecurityTokensModelHelper.getSupportingToken(secBinding.getParent(), SecurityTokensModelHelper.ENDORSING);<NEW_LINE>} else {<NEW_LINE>tokenKind = SecurityTokensModelHelper.getSupportingToken(comp, SecurityTokensModelHelper.ENDORSING);<NEW_LINE>}<NEW_LINE>token = SecurityTokensModelHelper.getTokenTypeElement(tokenKind);<NEW_LINE>setChBox(reqDerivedKeysIssued, SecurityPolicyModelHelper.isRequireDerivedKeys(token));<NEW_LINE>setCombo(tokenTypeCombo, SecurityTokensModelHelper.getIssuedTokenType(token));<NEW_LINE>setCombo(keyTypeCombo, SecurityTokensModelHelper.getIssuedKeyType(token));<NEW_LINE>fillKeySize(keySizeCombo, ComboConstants.ISSUED_KEYTYPE_PUBLIC.equals(keyTypeCombo.getSelectedItem()));<NEW_LINE>setCombo(keySizeCombo, SecurityTokensModelHelper.getIssuedKeySize(token));<NEW_LINE>issuerAddressField.setText(SecurityTokensModelHelper.getIssuedIssuerAddress(token));<NEW_LINE>issuerMetadataField.setText(SecurityTokensModelHelper.getIssuedIssuerMetadataAddress(token));<NEW_LINE>enableDisable();<NEW_LINE>inSync = false;<NEW_LINE>} | getTokenElement(protToken, BootstrapPolicy.class); |
306,454 | final RollbackApplicationResult executeRollbackApplication(RollbackApplicationRequest rollbackApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rollbackApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<RollbackApplicationRequest> request = null;<NEW_LINE>Response<RollbackApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RollbackApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(rollbackApplicationRequest));<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, "Kinesis Analytics V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RollbackApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RollbackApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RollbackApplicationResultJsonUnmarshaller());<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.ClientExecuteTime); |
1,354,798 | private InetSocketAddress bindToPort(final String name, final InetAddress hostAddress, String port) {<NEW_LINE>PortsRange portsRange = new PortsRange(port);<NEW_LINE>final AtomicReference<Exception> lastException = new AtomicReference<>();<NEW_LINE>final AtomicReference<InetSocketAddress> boundSocket = new AtomicReference<>();<NEW_LINE>closeLock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>// No need for locking here since Lifecycle objects can't move from STARTED to INITIALIZED<NEW_LINE>if (lifecycle.initialized() == false && lifecycle.started() == false) {<NEW_LINE>throw new IllegalStateException("transport has been stopped");<NEW_LINE>}<NEW_LINE>boolean success = portsRange.iterate(portNumber -> {<NEW_LINE>try {<NEW_LINE>TcpServerChannel channel = bind(name, new InetSocketAddress(hostAddress, portNumber));<NEW_LINE>serverChannels.computeIfAbsent(name, k -> new ArrayList<><MASK><NEW_LINE>boundSocket.set(channel.getLocalAddress());<NEW_LINE>} catch (Exception e) {<NEW_LINE>lastException.set(e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (!success) {<NEW_LINE>throw new BindTransportException("Failed to bind to " + NetworkAddress.format(hostAddress, portsRange), lastException.get());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closeLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Bound profile [{}] to address {{}}", name, NetworkAddress.format(boundSocket.get()));<NEW_LINE>}<NEW_LINE>return boundSocket.get();<NEW_LINE>} | ()).add(channel); |
1,513,436 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<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()); |
581,309 | public U map(AtmosphereRequest req, Map<String, U> handlers) {<NEW_LINE>String path = computePath(req);<NEW_LINE>U handler = map(path, handlers);<NEW_LINE>if (handler == null) {<NEW_LINE>// (2) First, try exact match<NEW_LINE>handler = map(path + (path.endsWith("/") ? "all" : "/all"), handlers);<NEW_LINE>if (handler == null) {<NEW_LINE>// (3) Wildcard<NEW_LINE>handler = map(path + "*", handlers);<NEW_LINE>// (4) try without a path<NEW_LINE>if (handler == null) {<NEW_LINE>String p = path.lastIndexOf("/") <= 0 ? "/" : path.substring(0, path.lastIndexOf("/"));<NEW_LINE>while (p.length() > 0) {<NEW_LINE>handler = map(p, handlers);<NEW_LINE>// (3.1) Try path wildcard<NEW_LINE>if (handler != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>p = p.substring(0<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Glassfish 3.1.2 issue .. BEUUUURRRRKKKKKK!!<NEW_LINE>if (handler == null && req.getContextPath().length() < path.length()) {<NEW_LINE>path = path.substring(req.getContextPath().length());<NEW_LINE>handler = map(path, handlers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>req.setAttribute(FrameworkConfig.MAPPED_PATH, path);<NEW_LINE>return handler;<NEW_LINE>} | , p.lastIndexOf("/")); |
876,082 | public void permissions() {<NEW_LINE>Long id = getParaToLong();<NEW_LINE>if (id == null) {<NEW_LINE>renderError(404);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Role role = roleService.findById(id);<NEW_LINE>setAttr("role", role);<NEW_LINE>String type = getPara("type");<NEW_LINE>List<Permission> permissions = type == null ? permissionService.findAll() : permissionService.findListByType(type);<NEW_LINE>Map<String, List<Permission>> permissionGroup = PermissionKits.groupPermission(permissions);<NEW_LINE>Map<String, Boolean> groupCheck = new HashMap();<NEW_LINE>for (String groupKey : permissionGroup.keySet()) {<NEW_LINE>List<Permission> permList = permissionGroup.get(groupKey);<NEW_LINE>for (Permission permission : permList) {<NEW_LINE>boolean hasPerm = roleService.hasPermission(role.getId(), permission.getId());<NEW_LINE>if (!hasPerm) {<NEW_LINE>groupCheck.put(groupKey, false);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setAttr("groupCheck", groupCheck);<NEW_LINE>setAttr("permissionGroup", permissionGroup);<NEW_LINE>render("user/role_permissions.html");<NEW_LINE>} | groupCheck.put(groupKey, true); |
504,553 | protected TupleIterable makeIterable(Evaluator evaluator) {<NEW_LINE>evaluator.getTiming().markStart(TIMING_NAME);<NEW_LINE>final int savepoint = evaluator.savepoint();<NEW_LINE>try {<NEW_LINE>Calc[] calcs = getCalcs();<NEW_LINE>ListCalc lcalc = (ListCalc) calcs[0];<NEW_LINE>BooleanCalc bcalc = (BooleanCalc) calcs[1];<NEW_LINE>TupleList list = lcalc.evaluateList(evaluator);<NEW_LINE>// make list mutable; guess selectivity .5<NEW_LINE>TupleList result = TupleCollections.createList(list.getArity(), list.size() / 2);<NEW_LINE>evaluator.setNonEmpty(false);<NEW_LINE><MASK><NEW_LINE>int currentIteration = 0;<NEW_LINE>Execution execution = evaluator.getQuery().getStatement().getCurrentExecution();<NEW_LINE>while (cursor.forward()) {<NEW_LINE>CancellationChecker.checkCancelOrTimeout(currentIteration++, execution);<NEW_LINE>cursor.setContext(evaluator);<NEW_LINE>if (bcalc.evaluateBoolean(evaluator)) {<NEW_LINE>result.addCurrent(cursor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>evaluator.restore(savepoint);<NEW_LINE>evaluator.getTiming().markEnd(TIMING_NAME);<NEW_LINE>}<NEW_LINE>} | TupleCursor cursor = list.tupleCursor(); |
1,245,514 | public Leg unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Leg leg = new Leg();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("Distance")) {<NEW_LINE>leg.setDistance(DoubleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DurationSeconds")) {<NEW_LINE>leg.setDurationSeconds(DoubleJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("EndPosition")) {<NEW_LINE>leg.setEndPosition(new ListUnmarshaller<Double>(DoubleJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("Geometry")) {<NEW_LINE>leg.setGeometry(LegGeometryJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("StartPosition")) {<NEW_LINE>leg.setStartPosition(new ListUnmarshaller<Double>(DoubleJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("Steps")) {<NEW_LINE>leg.setSteps(new ListUnmarshaller<Step>(StepJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return leg;<NEW_LINE>} | AwsJsonReader reader = context.getReader(); |
1,363,189 | private static void write_rules(WriteScopeParameter p_par, String p_design_name) throws java.io.IOException {<NEW_LINE>p_par.file.start_scope();<NEW_LINE>p_par.file.write("rules PCB ");<NEW_LINE>p_par.file.write(p_design_name);<NEW_LINE>Structure.write_snap_angle(p_par.file, p_par.board.rules.get_trace_angle_restriction());<NEW_LINE>AutorouteSettings.write_scope(p_par.file, p_par.autoroute_settings, p_par.board.layer_structure, p_par.identifier_type);<NEW_LINE>// write the default rule using 0 as default layer.<NEW_LINE>Rule.write_default_rule(p_par, 0);<NEW_LINE>// write the via padstacks<NEW_LINE>for (int i = 1; i <= p_par.board.library.padstacks.count(); ++i) {<NEW_LINE>app.freerouting.library.Padstack curr_padstack = p_par.board.library.padstacks.get(i);<NEW_LINE>if (p_par.board.library.get_via_padstack(curr_padstack.name) != null) {<NEW_LINE>Library.write_padstack_scope(p_par, curr_padstack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Network.write_via_infos(p_par.board.rules, p_par.file, p_par.identifier_type);<NEW_LINE>Network.write_via_rules(p_par.board.rules, <MASK><NEW_LINE>Network.write_net_classes(p_par);<NEW_LINE>p_par.file.end_scope();<NEW_LINE>} | p_par.file, p_par.identifier_type); |
425,091 | private String format(String input, IParseNode parseResult, int indentationLevel, boolean isSelection) throws Exception {<NEW_LINE>int spacesCount = -1;<NEW_LINE>if (isSelection) {<NEW_LINE>spacesCount = countLeftWhitespaceChars(input);<NEW_LINE>}<NEW_LINE>final FormatterDocument document = createFormatterDocument(input);<NEW_LINE>FormatterWriter writer = new FormatterWriter(document, lineSeparator, createIndentGenerator());<NEW_LINE>final HTMLFormatterNodeBuilder builder = new HTMLFormatterNodeBuilder(writer);<NEW_LINE>IFormatterContainerNode root = builder.build(parseResult, document);<NEW_LINE>new HTMLFormatterNodeRewriter().rewrite(root);<NEW_LINE>IFormatterContext context = new HTMLFormatterContext(indentationLevel);<NEW_LINE>writer.setWrapLength(getInt(HTMLFormatterConstants.WRAP_COMMENTS_LENGTH));<NEW_LINE>writer.setLinesPreserve(getInt(HTMLFormatterConstants.PRESERVED_LINES));<NEW_LINE>root.accept(context, writer);<NEW_LINE>writer.flush(context);<NEW_LINE>String output = writer.getOutput();<NEW_LINE>List<IRegion> offOnRegions = builder.getOffOnRegions();<NEW_LINE>if (offOnRegions != null && !offOnRegions.isEmpty()) {<NEW_LINE>// We re-parse the output to extract its On-Off regions, so we will be able to compute the offsets and<NEW_LINE>// adjust it.<NEW_LINE>List<IRegion> outputOnOffRegions = getOutputOnOffRegions(getString(HTMLFormatterConstants.FORMATTER_OFF), getString(HTMLFormatterConstants.FORMATTER_ON), new HTMLParseState(output));<NEW_LINE>output = FormatterUtils.applyOffOnRegions(input, output, offOnRegions, outputOnOffRegions);<NEW_LINE>}<NEW_LINE>if (isSelection) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>} | output = leftTrim(output, spacesCount); |
93,425 | // This method computes the roll over period by looping over the<NEW_LINE>// periods, starting with the shortest, and stopping when the r0 is<NEW_LINE>// different from from r1, where r0 is the epoch formatted according<NEW_LINE>// the datePattern (supplied by the user) and r1 is the<NEW_LINE>// epoch+nextMillis(i) formatted according to datePattern. All date<NEW_LINE>// formatting is done in GMT and not local format because the test<NEW_LINE>// logic is based on comparisons relative to 1970-01-01 00:00:00<NEW_LINE>// GMT (the epoch).<NEW_LINE>int computeCheckPeriod() {<NEW_LINE>RollingCalendar rollingCalendar = new RollingCalendar(gmtTimeZone, Locale.getDefault());<NEW_LINE>// set sate to 1970-01-01 00:00:00 GMT<NEW_LINE>Date epoch = new Date(0);<NEW_LINE>if (datePattern != null) {<NEW_LINE>for (int i = TOP_OF_SECONDS; i <= TOP_OF_MONTH; i++) {<NEW_LINE>SimpleDateFormat simpleDateFormat = new SimpleDateFormat(datePattern);<NEW_LINE>// do all date formatting in GMT<NEW_LINE>simpleDateFormat.setTimeZone(gmtTimeZone);<NEW_LINE>String r0 = simpleDateFormat.format(epoch);<NEW_LINE>rollingCalendar.setType(i);<NEW_LINE>Date next = new Date<MASK><NEW_LINE>String r1 = simpleDateFormat.format(next);<NEW_LINE>if (r0 != null && r1 != null && !r0.equals(r1)) {<NEW_LINE>return i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Deliberately head for trouble...<NEW_LINE>return TOP_OF_TROUBLE;<NEW_LINE>} | (rollingCalendar.getNextCheckMillis(epoch)); |
993,993 | private // If we can't calculate from pins or we don't need to, then return the measured width.<NEW_LINE>int calculateWidthFromPins(LayoutParams params, int parentLeft, int parentRight, int parentWidth, int measuredWidth) {<NEW_LINE>int width = measuredWidth;<NEW_LINE>// We only calculate width based on pins if Titanium's JavaScript "width" property is null.<NEW_LINE>// If JavaScript "width" property is set, then "left" and "right" properties are used as padding.<NEW_LINE>if ((params.optionWidth != null) || params.autoFillsWidth || params.sizeOrFillWidthEnabled) {<NEW_LINE>return width;<NEW_LINE>}<NEW_LINE>// If set up to use a custom fill size, then use it instead of the given parent size.<NEW_LINE>// Note: ScrollViews set this to size of container unless "contentWidth" is set.<NEW_LINE>if (this.childFillWidth >= 0) {<NEW_LINE>parentWidth = this.childFillWidth;<NEW_LINE>parentLeft = 0;<NEW_LINE>parentRight = parentWidth;<NEW_LINE>}<NEW_LINE>// Attempt to calculate width from the pin properties.<NEW_LINE>// Note: We need at least 2 pins to do this. Otherwise, use given "measuredWidth" argument.<NEW_LINE>TiDimension left = params.optionLeft;<NEW_LINE>TiDimension centerX = params.optionCenterX;<NEW_LINE>TiDimension right = params.optionRight;<NEW_LINE>if (left != null) {<NEW_LINE>if (centerX != null) {<NEW_LINE>width = (centerX.getAsPixels(this) - left.getAsPixels(this) - parentLeft) * 2;<NEW_LINE>} else if (right != null) {<NEW_LINE>width = parentWidth - right.getAsPixels(this<MASK><NEW_LINE>}<NEW_LINE>} else if (centerX != null && right != null) {<NEW_LINE>width = (parentRight - right.getAsPixels(this) - centerX.getAsPixels(this)) * 2;<NEW_LINE>}<NEW_LINE>return width;<NEW_LINE>} | ) - left.getAsPixels(this); |
294,617 | public StartBlueprintRunResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartBlueprintRunResult startBlueprintRunResult = new StartBlueprintRunResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return startBlueprintRunResult;<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("RunId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startBlueprintRunResult.setRunId(context.getUnmarshaller(String.class).unmarshall(context));<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 startBlueprintRunResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
606,846 | public AssociateResourceError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociateResourceError associateResourceError = new AssociateResourceError();<NEW_LINE><MASK><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("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateResourceError.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Reason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associateResourceError.setReason(context.getUnmarshaller(String.class).unmarshall(context));<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 associateResourceError;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
810,186 | private void handleSegregateFiles(final EncogFileSection section) {<NEW_LINE>final List<AnalystSegregateTarget> nfs = new ArrayList<AnalystSegregateTarget>();<NEW_LINE>boolean first = true;<NEW_LINE>for (final String line : section.getLines()) {<NEW_LINE>if (!first) {<NEW_LINE>final List<String> cols = EncogFileSection.splitColumns(line);<NEW_LINE>final String filename = cols.get(0);<NEW_LINE>final int percent = Integer.parseInt(cols.get(1));<NEW_LINE>final AnalystSegregateTarget nf = new AnalystSegregateTarget(filename, percent);<NEW_LINE>nfs.add(nf);<NEW_LINE>} else {<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final AnalystSegregateTarget[] array = new AnalystSegregateTarget[nfs.size()];<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>array[i] = nfs.get(i);<NEW_LINE>}<NEW_LINE>this.script.<MASK><NEW_LINE>} | getSegregate().setSegregateTargets(array); |
1,604,065 | public String docType(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {<NEW_LINE>Integer C_DocType_ID = (Integer) value;<NEW_LINE>if (C_DocType_ID == null || C_DocType_ID.intValue() == 0)<NEW_LINE>return "";<NEW_LINE>// 1..3<NEW_LINE>String // 1..3<NEW_LINE>sql = // 4..5<NEW_LINE>"SELECT d.HasCharges,'N',d.IsDocNoControlled," + // 6..8<NEW_LINE>"s.CurrentNext, d.DocBaseType, " + "s.StartNewYear, s.DateColumn, s.AD_Sequence_ID " + // 1<NEW_LINE>"FROM C_DocType d, AD_Sequence s " + "WHERE C_DocType_ID=?" + " AND d.DocNoSequence_ID=s.AD_Sequence_ID(+)";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(<MASK><NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>// Charges - Set Context<NEW_LINE>Env.setContext(ctx, WindowNo, "HasCharges", rs.getString(1));<NEW_LINE>// DocumentNo<NEW_LINE>if (rs.getString(3).equals("Y")) {<NEW_LINE>if ("Y".equals(rs.getString(6))) {<NEW_LINE>String dateColumn = rs.getString(7);<NEW_LINE>mTab.setValue("DocumentNo", "<" + MSequence.getPreliminaryNoByYear(mTab, rs.getInt(8), dateColumn, null) + ">");<NEW_LINE>} else<NEW_LINE>mTab.setValue("DocumentNo", "<" + rs.getString(4) + ">");<NEW_LINE>}<NEW_LINE>// DocBaseType - Set Context<NEW_LINE>String s = rs.getString(5);<NEW_LINE>Env.setContext(ctx, WindowNo, "DocBaseType", s);<NEW_LINE>// AP Check & AR Credit Memo<NEW_LINE>if (s.startsWith("AP"))<NEW_LINE>// Check<NEW_LINE>mTab.setValue("PaymentRule", "S");<NEW_LINE>else if (s.endsWith("C"))<NEW_LINE>// OnCredit<NEW_LINE>mTab.setValue("PaymentRule", "P");<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>return e.getLocalizedMessage();<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | 1, C_DocType_ID.intValue()); |
1,556,976 | public static void main(String[] args) {<NEW_LINE>Label[] items1 = new Label[5];<NEW_LINE>Label[] items2 = new Label[5];<NEW_LINE>for (int i = 0; i < items1.length; i++) {<NEW_LINE>items1[i] = new Label();<NEW_LINE>items2[i] = new Label();<NEW_LINE>}<NEW_LINE>Labels labels1 = new Labels(items1);<NEW_LINE>Labels labels2 = new Labels(items2);<NEW_LINE>labels1.items[0].phn = "A";<NEW_LINE>labels1.items[1].phn = "B";<NEW_LINE>labels1.items[2].phn = "C";<NEW_LINE>labels1.items[3].phn = "D";<NEW_LINE>labels1.items[4].phn = "E";<NEW_LINE>labels2.items[0].phn = "A1";<NEW_LINE>labels2.items[1].phn = "B";<NEW_LINE>labels2.items[2].phn = "C";<NEW_LINE>labels2.items[3].phn = "D1";<NEW_LINE>labels2.<MASK><NEW_LINE>Context c1 = new Context(labels1, 2, 2);<NEW_LINE>Context c2 = new Context(labels2, 2, 2);<NEW_LINE>System.out.println(String.valueOf(c1.matchScore(c2)));<NEW_LINE>Context c3 = new Context("t.u.nl,i,n");<NEW_LINE>System.out.println(c3.currentContext);<NEW_LINE>double[] possibleScores = c1.getPossibleScores();<NEW_LINE>System.out.println("Test completed");<NEW_LINE>} | items[4].phn = "E1"; |
1,303,875 | public TypeBinding resolveType(BlockScope scope) {<NEW_LINE>this.constant = Constant.NotAConstant;<NEW_LINE>if ((this.targetType = this.type.resolveType(scope, true)) == null)<NEW_LINE>return null;<NEW_LINE>LookupEnvironment environment = scope.environment();<NEW_LINE>this.targetType = environment.<MASK><NEW_LINE>if (this.targetType.isArrayType()) {<NEW_LINE>ArrayBinding arrayBinding = (ArrayBinding) this.targetType;<NEW_LINE>TypeBinding leafComponentType = arrayBinding.leafComponentType;<NEW_LINE>if (leafComponentType == TypeBinding.VOID) {<NEW_LINE>scope.problemReporter().cannotAllocateVoidArray(this);<NEW_LINE>return null;<NEW_LINE>} else if (leafComponentType.isTypeVariable()) {<NEW_LINE>scope.problemReporter().illegalClassLiteralForTypeVariable((TypeVariableBinding) leafComponentType, this);<NEW_LINE>}<NEW_LINE>} else if (this.targetType.isTypeVariable()) {<NEW_LINE>scope.problemReporter().illegalClassLiteralForTypeVariable((TypeVariableBinding) this.targetType, this);<NEW_LINE>}<NEW_LINE>ReferenceBinding classType = scope.getJavaLangClass();<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328689<NEW_LINE>if (scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {<NEW_LINE>// Integer.class --> Class<Integer>, perform boxing of base types (int.class --> Class<Integer>)<NEW_LINE>TypeBinding boxedType = null;<NEW_LINE>if (this.targetType.id == T_void) {<NEW_LINE>boxedType = environment.getResolvedJavaBaseType(JAVA_LANG_VOID, scope);<NEW_LINE>} else {<NEW_LINE>boxedType = scope.boxing(this.targetType);<NEW_LINE>}<NEW_LINE>if (environment.usesNullTypeAnnotations())<NEW_LINE>boxedType = environment.createAnnotatedType(boxedType, new AnnotationBinding[] { environment.getNonNullAnnotation() });<NEW_LINE>this.resolvedType = environment.createParameterizedType(classType, new TypeBinding[] { boxedType }, null);<NEW_LINE>} else {<NEW_LINE>this.resolvedType = classType;<NEW_LINE>}<NEW_LINE>return this.resolvedType;<NEW_LINE>} | convertToRawType(this.targetType, true); |
4,804 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jLabel1 = <MASK><NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jLabel1.setLabelFor(lstBranches);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BranchPickerPanel.class, "BranchPickerPanel.jLabel1.text"));<NEW_LINE>// NOI18N<NEW_LINE>jLabel1.setToolTipText(org.openide.util.NbBundle.getMessage(BranchPickerPanel.class, "BranchPickerPanel.jLabel1.TTtext"));<NEW_LINE>lstBranches.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>jScrollPane1.setViewportView(lstBranches);<NEW_LINE>pnlProgress.setLayout(new javax.swing.BoxLayout(pnlProgress, javax.swing.BoxLayout.LINE_AXIS));<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE).addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING).addComponent(pnlProgress, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE)).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(pnlProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap()));<NEW_LINE>} | new javax.swing.JLabel(); |
1,307,224 | protected void onBoundsChange(Rect bounds) {<NEW_LINE>Drawable underlyingDrawable = getCurrent();<NEW_LINE>if (mRotationAngle > 0 || (mExifOrientation != ExifInterface.ORIENTATION_UNDEFINED && mExifOrientation != ExifInterface.ORIENTATION_NORMAL)) {<NEW_LINE>switch(mExifOrientation) {<NEW_LINE>case ExifInterface.ORIENTATION_FLIP_HORIZONTAL:<NEW_LINE>mRotationMatrix.setScale(-1, 1);<NEW_LINE>break;<NEW_LINE>case ExifInterface.ORIENTATION_FLIP_VERTICAL:<NEW_LINE>mRotationMatrix.setScale(1, -1);<NEW_LINE>break;<NEW_LINE>case ExifInterface.ORIENTATION_TRANSPOSE:<NEW_LINE>mRotationMatrix.setRotate(270, bounds.centerX(), bounds.centerY());<NEW_LINE>mRotationMatrix.postScale(1, -1);<NEW_LINE>break;<NEW_LINE>case ExifInterface.ORIENTATION_TRANSVERSE:<NEW_LINE>mRotationMatrix.setRotate(270, bounds.centerX(), bounds.centerY());<NEW_LINE>mRotationMatrix.postScale(-1, 1);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>mRotationMatrix.setRotate(mRotationAngle, bounds.centerX(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Set the rotated bounds on the underlying drawable<NEW_LINE>mTempMatrix.reset();<NEW_LINE>mRotationMatrix.invert(mTempMatrix);<NEW_LINE>mTempRectF.set(bounds);<NEW_LINE>mTempMatrix.mapRect(mTempRectF);<NEW_LINE>underlyingDrawable.setBounds((int) mTempRectF.left, (int) mTempRectF.top, (int) mTempRectF.right, (int) mTempRectF.bottom);<NEW_LINE>} else {<NEW_LINE>underlyingDrawable.setBounds(bounds);<NEW_LINE>}<NEW_LINE>} | ), bounds.centerY()); |
1,846,768 | @NoCache<NEW_LINE>@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>public Response addExecutionToFlow(@PathParam("flowAlias") String flowAlias, Map<String, String> data) {<NEW_LINE>auth.realm().requireManageRealm();<NEW_LINE>AuthenticationFlowModel parentFlow = realm.getFlowByAlias(flowAlias);<NEW_LINE>if (parentFlow == null) {<NEW_LINE>throw new BadRequestException("Parent flow doesn't exist");<NEW_LINE>}<NEW_LINE>if (parentFlow.isBuiltIn()) {<NEW_LINE>throw new BadRequestException("It is illegal to add execution to a built in flow");<NEW_LINE>}<NEW_LINE>String provider = data.get("provider");<NEW_LINE>// make sure provider is one of the registered providers<NEW_LINE>ProviderFactory f;<NEW_LINE>if (parentFlow.getProviderId().equals(AuthenticationFlow.CLIENT_FLOW)) {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(ClientAuthenticator.class, provider);<NEW_LINE>} else if (parentFlow.getProviderId().equals(AuthenticationFlow.FORM_FLOW)) {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(FormAction.class, provider);<NEW_LINE>} else {<NEW_LINE>f = session.getKeycloakSessionFactory().getProviderFactory(Authenticator.class, provider);<NEW_LINE>}<NEW_LINE>if (f == null) {<NEW_LINE>throw new BadRequestException("No authentication provider found for id: " + provider);<NEW_LINE>}<NEW_LINE>AuthenticationExecutionModel execution = new AuthenticationExecutionModel();<NEW_LINE>execution.setParentFlow(parentFlow.getId());<NEW_LINE>ConfigurableAuthenticatorFactory conf = (ConfigurableAuthenticatorFactory) f;<NEW_LINE>if (conf.getRequirementChoices().length == 1)<NEW_LINE>execution.setRequirement(conf.getRequirementChoices()[0]);<NEW_LINE>else<NEW_LINE>execution.setRequirement(AuthenticationExecutionModel.Requirement.DISABLED);<NEW_LINE>execution.setAuthenticatorFlow(false);<NEW_LINE>execution.setAuthenticator(provider);<NEW_LINE>execution.setPriority(getNextPriority(parentFlow));<NEW_LINE>execution = realm.addAuthenticatorExecution(execution);<NEW_LINE>data.put("id", execution.getId());<NEW_LINE>adminEvent.operation(OperationType.CREATE).resource(ResourceType.AUTH_EXECUTION).resourcePath(session.getContext().getUri()).representation(data).success();<NEW_LINE>String addExecutionPathSegment = UriBuilder.fromMethod(AuthenticationManagementResource.class, "addExecutionToFlow").build(parentFlow.<MASK><NEW_LINE>return Response.created(session.getContext().getUri().getBaseUriBuilder().path(session.getContext().getUri().getPath().replace(addExecutionPathSegment, "")).path("executions").path(execution.getId()).build()).build();<NEW_LINE>} | getAlias()).getPath(); |
865,648 | final ListUsersResult executeListUsers(ListUsersRequest listUsersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUsersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUsersRequest> request = null;<NEW_LINE>Response<ListUsersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUsersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUsersRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUsers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUsersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUsersResultJsonUnmarshaller());<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); |
592,253 | private void verifyPeerCommunication(Location pos, BSymbol otherWorker, String otherWorkerName, SymbolEnv env) {<NEW_LINE>if (env.enclEnv.node.getKind() != NodeKind.FUNCTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BLangFunction funcNode = <MASK><NEW_LINE>Set<Flag> flagSet = funcNode.flagSet;<NEW_LINE>// Analyze worker interactions inside workers<NEW_LINE>Name workerDerivedName = names.fromString("0" + otherWorker.name.value);<NEW_LINE>if (flagSet.contains(Flag.WORKER)) {<NEW_LINE>// Interacting with default worker from a worker within a fork.<NEW_LINE>if (otherWorkerName.equals(DEFAULT_WORKER_NAME)) {<NEW_LINE>if (flagSet.contains(Flag.FORKED)) {<NEW_LINE>dlog.error(pos, DiagnosticErrorCode.WORKER_INTERACTIONS_ONLY_ALLOWED_BETWEEN_PEERS);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Scope enclFunctionScope = env.enclEnv.enclEnv.scope;<NEW_LINE>BInvokableSymbol wLambda = (BInvokableSymbol) enclFunctionScope.lookup(workerDerivedName).symbol;<NEW_LINE>// Interactions across fork<NEW_LINE>if (wLambda != null && funcNode.anonForkName != null && !funcNode.anonForkName.equals(wLambda.enclForkName)) {<NEW_LINE>dlog.error(pos, DiagnosticErrorCode.WORKER_INTERACTIONS_ONLY_ALLOWED_BETWEEN_PEERS);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Worker interactions outside of worker constructs (in default worker)<NEW_LINE>BInvokableSymbol wLambda = (BInvokableSymbol) env.scope.lookup(workerDerivedName).symbol;<NEW_LINE>if (wLambda != null && wLambda.enclForkName != null) {<NEW_LINE>dlog.error(pos, DiagnosticErrorCode.WORKER_INTERACTIONS_ONLY_ALLOWED_BETWEEN_PEERS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (BLangFunction) env.enclEnv.node; |
1,056,976 | public static void mail5() throws EmailException {<NEW_LINE>HtmlEmail email = new HtmlEmail();<NEW_LINE>email.setHtmlMsg("<html><body><h1>A Title</h1></body></html>");<NEW_LINE>email.setTextMsg("alternative message");<NEW_LINE>EmailAttachment attachment = new EmailAttachment();<NEW_LINE>attachment.setDescription("An image");<NEW_LINE>attachment.setDisposition(EmailAttachment.ATTACHMENT);<NEW_LINE>attachment.setPath(Play.applicationPath.getPath() + java.io.File.separator + "test" + java.<MASK><NEW_LINE>EmailAttachment attachment2 = new EmailAttachment();<NEW_LINE>attachment2.setName("fond3.jpg");<NEW_LINE>attachment2.setPath(Play.applicationPath.getPath() + java.io.File.separator + "test" + java.io.File.separator + "fond3.jpg");<NEW_LINE>email.attach(attachment);<NEW_LINE>email.attach(attachment2);<NEW_LINE>email.setFrom("test@localhost");<NEW_LINE>email.addTo("test@localhost");<NEW_LINE>email.setSubject("test attachments");<NEW_LINE>Mail.send(email);<NEW_LINE>renderText("OK5");<NEW_LINE>} | io.File.separator + "fond2.png"); |
147,818 | public void endCollecting() {<NEW_LINE>List<Annotation> toRemove = new ArrayList<>();<NEW_LINE>synchronized (fLockObject) {<NEW_LINE>Iterator<Annotation<MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Annotation annotation = iter.next();<NEW_LINE>if (ReconcileProblemAnnotation.TYPES.contains(annotation.getType()))<NEW_LINE>toRemove.add(annotation);<NEW_LINE>}<NEW_LINE>Annotation[] annotationsToRemove = toRemove.toArray(new Annotation[toRemove.size()]);<NEW_LINE>if (fAnnotationModel instanceof IAnnotationModelExtension)<NEW_LINE>((IAnnotationModelExtension) fAnnotationModel).replaceAnnotations(annotationsToRemove, fAddAnnotations);<NEW_LINE>else {<NEW_LINE>for (int i = 0; i < annotationsToRemove.length; i++) fAnnotationModel.removeAnnotation(annotationsToRemove[i]);<NEW_LINE>for (iter = fAddAnnotations.keySet().iterator(); iter.hasNext(); ) {<NEW_LINE>Annotation annotation = iter.next();<NEW_LINE>fAnnotationModel.addAnnotation(annotation, fAddAnnotations.get(annotation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fAddAnnotations = null;<NEW_LINE>} | > iter = fAnnotationModel.getAnnotationIterator(); |
1,801,331 | public static Part newPartForContentType(String contentType, String partName) throws InvalidFormatException, PartUnrecognisedException {<NEW_LINE>if (contentType.equals(ContentTypes.PRESENTATIONML_MAIN) || contentType.equals(ContentTypes.PRESENTATIONML_TEMPLATE) || contentType.equals(ContentTypes.PRESENTATIONML_MACROENABLED) || contentType.equals(ContentTypes.PRESENTATIONML_TEMPLATE_MACROENABLED)) {<NEW_LINE>return new MainPresentationPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE)) {<NEW_LINE>return new SlidePart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE_MASTER)) {<NEW_LINE>return new SlideMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_SLIDE_LAYOUT)) {<NEW_LINE>return new SlideLayoutPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_COMMENTS)) {<NEW_LINE>return new CommentsPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_TABLE_STYLES)) {<NEW_LINE>return new TableStylesPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_PRES_PROPS)) {<NEW_LINE>return new <MASK><NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_VIEW_PROPS)) {<NEW_LINE>return new ViewPropertiesPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_TAGS)) {<NEW_LINE>return new TagsPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_HANDOUT_MASTER)) {<NEW_LINE>return new HandoutMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_NOTES_MASTER)) {<NEW_LINE>return new NotesMasterPart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_NOTES_SLIDE)) {<NEW_LINE>return new NotesSlidePart(new PartName(partName));<NEW_LINE>} else if (contentType.equals(ContentTypes.PRESENTATIONML_COMMENT_AUTHORS)) {<NEW_LINE>return new CommentAuthorsPart(new PartName(partName));<NEW_LINE>} else {<NEW_LINE>throw new PartUnrecognisedException("No subclass found for " + partName + " (content type '" + contentType + "')");<NEW_LINE>}<NEW_LINE>} | PresentationPropertiesPart(new PartName(partName)); |
1,204,053 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 2);<NEW_LINE>try {<NEW_LINE>if (!(sources[0] instanceof File)) {<NEW_LINE>logParameterError(caller, sources, "First parameter is not a file object.", ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>if (!(sources[1] instanceof String)) {<NEW_LINE>logParameterError(caller, sources, "Second parameter is not a string.", ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>final File pdfFileObject = (File) sources[0];<NEW_LINE>final String userPassword = (String) sources[1];<NEW_LINE>final java.io.File fileOnDisk = pdfFileObject.getFileOnDisk();<NEW_LINE>final PDDocument pdDocument = PDDocument.load(fileOnDisk);<NEW_LINE>final AccessPermission accessPermission = new AccessPermission();<NEW_LINE>accessPermission.setCanPrint(false);<NEW_LINE>// Owner password (to open the file with all permissions) is the superuser password<NEW_LINE>final StandardProtectionPolicy standardProtectionPolicy = new StandardProtectionPolicy(Settings.SuperUserPassword.getValue(), userPassword, accessPermission);<NEW_LINE>standardProtectionPolicy.setEncryptionKeyLength(keyLength);<NEW_LINE>standardProtectionPolicy.setPermissions(accessPermission);<NEW_LINE>pdDocument.protect(standardProtectionPolicy);<NEW_LINE>if (fileOnDisk.delete()) {<NEW_LINE>pdDocument.save(fileOnDisk);<NEW_LINE>}<NEW_LINE>pdDocument.close();<NEW_LINE>} catch (final IOException ioex) {<NEW_LINE>logException(caller, ioex, sources);<NEW_LINE>}<NEW_LINE>} catch (final ArgumentNullException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>} catch (final ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(<MASK><NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} | ), ctx.isJavaScriptContext()); |
112,436 | private boolean upload(User loginUser, String fullName, MultipartFile file, ResourceType type) {<NEW_LINE>// save to local<NEW_LINE>String fileSuffix = Files.<MASK><NEW_LINE>String nameSuffix = Files.getFileExtension(fullName);<NEW_LINE>// determine file suffix<NEW_LINE>if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// query tenant<NEW_LINE>String tenantCode = tenantMapper.queryById(loginUser.getTenantId()).getTenantCode();<NEW_LINE>// random file name<NEW_LINE>String localFilename = FileUtils.getUploadFilename(tenantCode, UUID.randomUUID().toString());<NEW_LINE>// save file to hdfs, and delete original file<NEW_LINE>String fileName = storageOperate.getFileName(type, tenantCode, fullName);<NEW_LINE>String resourcePath = storageOperate.getDir(type, tenantCode);<NEW_LINE>try {<NEW_LINE>// if tenant dir not exists<NEW_LINE>if (!storageOperate.exists(tenantCode, resourcePath)) {<NEW_LINE>storageOperate.createTenantDirIfNotExists(tenantCode);<NEW_LINE>}<NEW_LINE>org.apache.dolphinscheduler.api.utils.FileUtils.copyInputStreamToFile(file, localFilename);<NEW_LINE>storageOperate.upload(tenantCode, localFilename, fileName, true, true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>FileUtils.deleteFile(localFilename);<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getFileExtension(file.getOriginalFilename()); |
1,010,881 | private <K, V> ConnectionFuture<StatefulRedisSentinelConnection<K, V>> doConnectSentinelAsync(RedisCodec<K, V> codec, RedisURI redisURI, Duration timeout, String clientName) {<NEW_LINE>ConnectionBuilder connectionBuilder;<NEW_LINE>if (redisURI.isSsl()) {<NEW_LINE>SslConnectionBuilder sslConnectionBuilder = SslConnectionBuilder.sslConnectionBuilder();<NEW_LINE>sslConnectionBuilder.ssl(redisURI);<NEW_LINE>connectionBuilder = sslConnectionBuilder;<NEW_LINE>} else {<NEW_LINE>connectionBuilder = ConnectionBuilder.connectionBuilder();<NEW_LINE>}<NEW_LINE>connectionBuilder.clientOptions(ClientOptions.copyOf(getOptions()));<NEW_LINE>connectionBuilder.clientResources(getResources());<NEW_LINE>DefaultEndpoint endpoint = new DefaultEndpoint(getOptions(), getResources());<NEW_LINE>RedisChannelWriter writer = endpoint;<NEW_LINE>if (CommandExpiryWriter.isSupported(getOptions())) {<NEW_LINE>writer = new CommandExpiryWriter(writer, getOptions(), getResources());<NEW_LINE>}<NEW_LINE>if (CommandListenerWriter.isSupported(getCommandListeners())) {<NEW_LINE>writer = new CommandListenerWriter(writer, getCommandListeners());<NEW_LINE>}<NEW_LINE>StatefulRedisSentinelConnectionImpl<K, V> connection = newStatefulRedisSentinelConnection(writer, codec, timeout);<NEW_LINE>ConnectionState state = connection.getConnectionState();<NEW_LINE>state.apply(redisURI);<NEW_LINE>if (LettuceStrings.isEmpty(state.getClientName())) {<NEW_LINE>state.setClientName(clientName);<NEW_LINE>}<NEW_LINE>connectionBuilder.connectionInitializer(createHandshake(state));<NEW_LINE>logger.debug("Connecting to Redis Sentinel, address: " + redisURI);<NEW_LINE>connectionBuilder.endpoint(endpoint).commandHandler(() -> new CommandHandler(getOptions(), getResources(), endpoint)).connection(connection);<NEW_LINE>connectionBuilder(getSocketAddressSupplier(redisURI), connectionBuilder, connection.getConnectionEvents(), redisURI);<NEW_LINE>ConnectionFuture<?> sync = initializeChannelAsync(connectionBuilder);<NEW_LINE>return sync.thenApply(ignore -> (StatefulRedisSentinelConnection<K, V>) connection).whenComplete((ignore, e) -> {<NEW_LINE>if (e != null) {<NEW_LINE>logger.warn(<MASK><NEW_LINE>connection.closeAsync();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | "Cannot connect Redis Sentinel at " + redisURI + ": " + e); |
1,115,339 | @SuppressWarnings("unchecked")<NEW_LINE>public <T> T put(final Key<T> key, @Nullable final T value, final CopyOnWriteContextMap owner, final AtomicReferenceFieldUpdater<CopyOnWriteContextMap, CopyContextMap> mapUpdater) {<NEW_LINE>if (keyOne.equals(key)) {<NEW_LINE>return mapUpdater.compareAndSet(owner, this, new ThreeContextMap(key, value, keyTwo, valueTwo, keyThree, valueThree)) ? (T) valueOne : <MASK><NEW_LINE>}<NEW_LINE>if (keyTwo.equals(key)) {<NEW_LINE>return mapUpdater.compareAndSet(owner, this, new ThreeContextMap(keyOne, valueOne, key, value, keyThree, valueThree)) ? (T) valueTwo : owner.put(key, value);<NEW_LINE>}<NEW_LINE>if (keyThree.equals(key)) {<NEW_LINE>return mapUpdater.compareAndSet(owner, this, new ThreeContextMap(keyOne, valueOne, keyTwo, valueTwo, key, value)) ? (T) valueThree : owner.put(key, value);<NEW_LINE>}<NEW_LINE>return mapUpdater.compareAndSet(owner, this, new FourContextMap(keyOne, valueOne, keyTwo, valueTwo, keyThree, valueThree, key, value)) ? null : owner.put(key, value);<NEW_LINE>} | owner.put(key, value); |
856,871 | private static BooleanWithReason checkCanEdit(@NonNull final Document document, @NonNull final IUserRolePermissions permissions) {<NEW_LINE>// In case document type is not Window, return OK because we cannot validate<NEW_LINE>final DocumentPath documentPath = document.getDocumentPath();<NEW_LINE>if (documentPath.getDocumentType() != DocumentType.Window) {<NEW_LINE>// OK<NEW_LINE>return BooleanWithReason.TRUE;<NEW_LINE>}<NEW_LINE>// Check if we have window write permission<NEW_LINE>final AdWindowId adWindowId = documentPath.getWindowId().toAdWindowIdOrNull();<NEW_LINE>if (adWindowId != null && !permissions.checkWindowPermission(adWindowId).hasWriteAccess()) {<NEW_LINE>return BooleanWithReason.falseBecause("no window edit permission");<NEW_LINE>}<NEW_LINE>final int adTableId = getAdTableId(document);<NEW_LINE>if (adTableId <= 0) {<NEW_LINE>// not table based => OK<NEW_LINE>return BooleanWithReason.TRUE;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final ClientId adClientId = document.getClientId();<NEW_LINE>final OrgId adOrgId = document.getOrgId();<NEW_LINE>if (adOrgId == null) {<NEW_LINE>// the user cleared the field; field is flagged as mandatory; until user set the field, don't make a fuss.<NEW_LINE>return BooleanWithReason.TRUE;<NEW_LINE>}<NEW_LINE>return permissions.checkCanUpdate(adClientId, adOrgId, adTableId, recordId);<NEW_LINE>} | final int recordId = getRecordId(document); |
277,282 | public UpdateDataSourceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateDataSourceResult updateDataSourceResult = new UpdateDataSourceResult();<NEW_LINE><MASK><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 updateDataSourceResult;<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("DataSourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateDataSourceResult.setDataSourceId(context.getUnmarshaller(String.class).unmarshall(context));<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 updateDataSourceResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
562,919 | static void printObjectAsCsv(StringBuilder out, JsonNode node, ReturnFields fields, boolean unquoted) {<NEW_LINE>if (node.isObject()) {<NEW_LINE>if (fields == null) {<NEW_LINE>Iterator<Map.Entry<String, JsonNode>> it = node.fields();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>printObjectAsCsv(out, it.next().getValue(), unquoted);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Iterator<String> it = fields.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>String field = it.next();<NEW_LINE>JsonNode attr = node.get(field);<NEW_LINE>printObjectAsCsv(out, attr, fields.child(field), unquoted);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (node.isArray()) {<NEW_LINE>for (JsonNode item : node) {<NEW_LINE>printObjectAsCsv(out, item, fields, unquoted);<NEW_LINE>}<NEW_LINE>} else if (node != null) {<NEW_LINE>out.append(",");<NEW_LINE>if (unquoted && node instanceof TextNode) {<NEW_LINE>out.append(node.asText());<NEW_LINE>} else {<NEW_LINE>out.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | append(node.toString()); |
71,445 | public // optional, can get from cookie instead<NEW_LINE>// optional, can get from cookie instead<NEW_LINE>Response // optional, can get from cookie instead<NEW_LINE>authenticate(@QueryParam(AUTH_SESSION_ID) String authSessionId, @QueryParam(SESSION_CODE) String code, @QueryParam(Constants.EXECUTION) String execution, @QueryParam(Constants.CLIENT_ID) String clientId, @QueryParam(Constants.TAB_ID) String tabId) {<NEW_LINE><MASK><NEW_LINE>SessionCodeChecks checks = checksForCode(authSessionId, code, execution, clientId, tabId, AUTHENTICATE_PATH);<NEW_LINE>if (!checks.verifyActiveAndValidAction(AuthenticationSessionModel.Action.AUTHENTICATE.name(), ClientSessionCode.ActionType.LOGIN)) {<NEW_LINE>return checks.getResponse();<NEW_LINE>}<NEW_LINE>AuthenticationSessionModel authSession = checks.getAuthenticationSession();<NEW_LINE>boolean actionRequest = checks.isActionRequest();<NEW_LINE>processLocaleParam(authSession);<NEW_LINE>return processAuthentication(actionRequest, execution, authSession, null);<NEW_LINE>} | event.event(EventType.LOGIN); |
1,107,680 | final CreateEventActionResult executeCreateEventAction(CreateEventActionRequest createEventActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEventActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEventActionRequest> request = null;<NEW_LINE>Response<CreateEventActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEventActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEventActionRequest));<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, "DataExchange");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEventAction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEventActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new CreateEventActionResultJsonUnmarshaller()); |
1,566,600 | public EntityDetail createSchemaTable(EntityDetail schema, String tableName) throws InvalidParameterException, TypeErrorException, EntityProxyOnlyException, ClassificationErrorException, RepositoryErrorException, EntityNotKnownException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException, StatusNotSupportedException {<NEW_LINE>String method = "createSchemaTable";<NEW_LINE>List<Relationship> relationshipsRDBSchemaList = client.getRelationshipsForEntity(userId, schema.getGUID(), OpenMetadataAPIMapper.ASSET_TO_SCHEMA_TYPE_TYPE_GUID, 0, Collections.singletonList(InstanceStatus.ACTIVE), null, null, null, 0);<NEW_LINE>String schemaQName = getEntityQName(schema, method);<NEW_LINE>if (relationshipsRDBSchemaList == null || relationshipsRDBSchemaList.isEmpty()) {<NEW_LINE>String relationalSchemaQName = buildQualifiedName(schemaQName, OpenMetadataAPIMapper.RELATIONAL_DB_SCHEMA_TYPE_TYPE_NAME, tableName);<NEW_LINE>InstanceProperties properties = new EntityPropertiesBuilder(context, method, null).withStringProperty(OpenMetadataAPIMapper.<MASK><NEW_LINE>EntityDetail relationalDBSchemaType = client.addEntity(userId, OpenMetadataAPIMapper.RELATIONAL_DB_SCHEMA_TYPE_TYPE_GUID, properties, null, null);<NEW_LINE>// add relationship schema->RelationalDBSchemaType<NEW_LINE>Relationship relationship = client.addRelationship(userId, OpenMetadataAPIMapper.ASSET_TO_SCHEMA_TYPE_TYPE_GUID, null, schema.getGUID(), relationalDBSchemaType.getGUID(), null);<NEW_LINE>relationshipsRDBSchemaList = Arrays.asList(relationship);<NEW_LINE>}<NEW_LINE>Relationship relRDBSchema = relationshipsRDBSchemaList.get(0);<NEW_LINE>EntityDetail entityRDBSchema = client.getEntityDetail(userId, relRDBSchema.getEntityTwoProxy().getGUID());<NEW_LINE>String tableQName = buildQualifiedName(getEntityQName(entityRDBSchema, method), OpenMetadataAPIMapper.RELATIONAL_TABLE_TYPE_NAME, tableName);<NEW_LINE>InstanceProperties properties = new EntityPropertiesBuilder(context, method, null).withStringProperty(OpenMetadataAPIMapper.QUALIFIED_NAME_PROPERTY_NAME, tableQName).withStringProperty(OpenMetadataAPIMapper.DISPLAY_NAME_PROPERTY_NAME, tableName).build();<NEW_LINE>EntityDetail entityTable = client.addEntity(userId, OpenMetadataAPIMapper.RELATIONAL_TABLE_TYPE_GUID, properties, null, null);<NEW_LINE>// add relationship RelationalDBSchemaType->table<NEW_LINE>client.addRelationship(userId, OpenMetadataAPIMapper.TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_GUID, null, entityRDBSchema.getGUID(), entityTable.getGUID(), null);<NEW_LINE>return entityTable;<NEW_LINE>} | QUALIFIED_NAME_PROPERTY_NAME, relationalSchemaQName).build(); |
911,572 | private static void pointAdd(PointExt p, PointAccum r) {<NEW_LINE>int[] a = F.create();<NEW_LINE>int[] b = F.create();<NEW_LINE>int[] c = F.create();<NEW_LINE>int[] d = F.create();<NEW_LINE><MASK><NEW_LINE>int[] f = F.create();<NEW_LINE>int[] g = F.create();<NEW_LINE>int[] h = r.v;<NEW_LINE>F.apm(r.y, r.x, b, a);<NEW_LINE>F.apm(p.y, p.x, d, c);<NEW_LINE>F.mul(a, c, a);<NEW_LINE>F.mul(b, d, b);<NEW_LINE>F.mul(r.u, r.v, c);<NEW_LINE>F.mul(c, p.t, c);<NEW_LINE>F.mul(c, C_d2, c);<NEW_LINE>F.mul(r.z, p.z, d);<NEW_LINE>F.add(d, d, d);<NEW_LINE>F.apm(b, a, h, e);<NEW_LINE>F.apm(d, c, g, f);<NEW_LINE>F.carry(g);<NEW_LINE>F.mul(e, f, r.x);<NEW_LINE>F.mul(g, h, r.y);<NEW_LINE>F.mul(f, g, r.z);<NEW_LINE>} | int[] e = r.u; |
581,986 | private void loadNode515() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>ApplyChangesRequired</Name><DataType><Identifier>i=1</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
901,790 | public Object execute(VirtualFrame frame) {<NEW_LINE>if (RubyArguments.getDescriptor(frame) instanceof KeywordArgumentsDescriptor) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (RubyArguments.getPositionalArgumentsCount(frame, keywordArguments) != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>checkIsArrayProfile.enter();<NEW_LINE>final Object firstArgument = RubyArguments.getArgument(frame, 0);<NEW_LINE>if (RubyGuards.isRubyArray(firstArgument)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (respondToToAry == null) {<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>respondToToAry = <MASK><NEW_LINE>}<NEW_LINE>// TODO(cseaton): check this is actually a static "find if there is such method" and not a<NEW_LINE>// dynamic call to respond_to?<NEW_LINE>return respondToToAry.execute(frame, firstArgument, "to_ary");<NEW_LINE>} | insert(InternalRespondToNode.create()); |
826,111 | final DescribePermissionSetResult executeDescribePermissionSet(DescribePermissionSetRequest describePermissionSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePermissionSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePermissionSetRequest> request = null;<NEW_LINE>Response<DescribePermissionSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePermissionSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePermissionSetRequest));<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, "SSO Admin");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePermissionSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePermissionSetResultJsonUnmarshaller());<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.OPERATION_NAME, "DescribePermissionSet"); |
869,940 | private Value invokeRemoteMethod(BVariable resultVar) throws EvaluationException {<NEW_LINE>ClassDefinitionResolver classDefResolver = new ClassDefinitionResolver(context);<NEW_LINE>String className = resultVar.getDapVariable().getValue();<NEW_LINE>Optional<ClassSymbol> classDef = classDefResolver.findBalClassDefWithinModule(className);<NEW_LINE>if (classDef.isEmpty()) {<NEW_LINE>// Resolves the JNI signature to see if the object/class is defined with a dependency module.<NEW_LINE>String signature = resultVar.getJvmValue().type().signature();<NEW_LINE>if (!signature.startsWith(QUALIFIED_TYPE_SIGNATURE_PREFIX)) {<NEW_LINE>throw createEvaluationException(CLASS_NOT_FOUND, className);<NEW_LINE>}<NEW_LINE>String[] signatureParts = signature.substring<MASK><NEW_LINE>if (signatureParts.length < 2) {<NEW_LINE>throw createEvaluationException(CLASS_NOT_FOUND, className);<NEW_LINE>}<NEW_LINE>String orgName = signatureParts[0];<NEW_LINE>String packageName = signatureParts[1];<NEW_LINE>classDef = classDefResolver.findBalClassDefWithinDependencies(orgName, packageName, className);<NEW_LINE>}<NEW_LINE>if (classDef.isEmpty()) {<NEW_LINE>throw createEvaluationException(CLASS_NOT_FOUND, className);<NEW_LINE>}<NEW_LINE>Optional<MethodSymbol> objectMethodDef = findObjectMethodInClass(classDef.get(), methodName);<NEW_LINE>if (objectMethodDef.isEmpty()) {<NEW_LINE>throw createEvaluationException(REMOTE_METHOD_NOT_FOUND, syntaxNode.methodName().toString().trim(), className);<NEW_LINE>}<NEW_LINE>GeneratedInstanceMethod objectMethod = getRemoteMethodByName(resultVar, objectMethodDef.get());<NEW_LINE>Map<String, Value> argValueMap = generateNamedArgs(context, methodName, objectMethodDef.get().typeDescriptor(), argEvaluators);<NEW_LINE>objectMethod.setNamedArgValues(argValueMap);<NEW_LINE>return objectMethod.invokeSafely();<NEW_LINE>} | (1).split(JNI_SIGNATURE_SEPARATOR); |
1,245,306 | private ExtensionArchive newExtensionArchive(ServiceReference<WebSphereCDIExtension> sr) throws CDIException {<NEW_LINE>Bundle bundle = sr.getBundle();<NEW_LINE>String extra_classes_blob = (String) sr.getProperty(EXTENSION_API_CLASSES);<NEW_LINE>Set<String> extra_classes = new HashSet<String>();<NEW_LINE>// parse the list<NEW_LINE>if (extra_classes_blob != null) {<NEW_LINE>String[] <MASK><NEW_LINE>if ((classes != null) && (classes.length > 0)) {<NEW_LINE>Collections.addAll(extra_classes, classes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String extraAnnotationsBlob = (String) sr.getProperty(EXTENSION_BEAN_DEFINING_ANNOTATIONS);<NEW_LINE>Set<String> extraAnnotations = new HashSet<String>();<NEW_LINE>if (extraAnnotationsBlob != null) {<NEW_LINE>String[] annotations = extraAnnotationsBlob.split(EXTENSION_API_CLASSES_SEPARATOR);<NEW_LINE>if ((annotations != null) && (annotations.length > 0)) {<NEW_LINE>Collections.addAll(extraAnnotations, annotations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String applicationBDAsVisibleStr = (String) sr.getProperty(EXTENSION_APP_BDAS_VISIBLE);<NEW_LINE>boolean applicationBDAsVisible = Boolean.parseBoolean(applicationBDAsVisibleStr);<NEW_LINE>String extClassesOnlyStr = (String) sr.getProperty(EXTENSION_CLASSES_ONLY_MODE);<NEW_LINE>boolean extClassesOnly = Boolean.parseBoolean(extClassesOnlyStr);<NEW_LINE>ExtensionArchive extensionArchive = cdiRuntime.getExtensionArchiveForBundle(bundle, extra_classes, extraAnnotations, applicationBDAsVisible, extClassesOnly, Collections.emptySet());<NEW_LINE>return extensionArchive;<NEW_LINE>} | classes = extra_classes_blob.split(EXTENSION_API_CLASSES_SEPARATOR); |
1,496,818 | void initiateClose(boolean saveState) {<NEW_LINE>log.trace("initiateClose(saveState={}) {}", saveState, getExtent());<NEW_LINE>MinorCompactionTask mct = null;<NEW_LINE>synchronized (this) {<NEW_LINE>if (isClosed() || isClosing()) {<NEW_LINE>String msg = "Tablet " + getExtent() + " already " + closeState;<NEW_LINE>throw new IllegalStateException(msg);<NEW_LINE>}<NEW_LINE>// enter the closing state, no splits or minor compactions can start<NEW_LINE>closeState = CloseState.CLOSING;<NEW_LINE>this.notifyAll();<NEW_LINE>}<NEW_LINE>// Cancel any running compactions and prevent future ones from starting. This is very important<NEW_LINE>// because background compactions may update the metadata table. These metadata updates can not<NEW_LINE>// be allowed after a tablet closes. Compactable has its own lock and calls tablet code, so do<NEW_LINE>// not hold tablet lock while calling it.<NEW_LINE>compactable.close();<NEW_LINE>synchronized (this) {<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>while (updatingFlushID) {<NEW_LINE>try {<NEW_LINE>this.wait(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error(e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// calling this.wait() releases the lock, ensure things are as expected when the lock is<NEW_LINE>// obtained again<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>if (!saveState || getTabletMemory().getMemTable().getNumEntries() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getTabletMemory().waitForMinC();<NEW_LINE>// calling this.wait() in waitForMinC() releases the lock, ensure things are as expected when<NEW_LINE>// the lock is obtained again<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>try {<NEW_LINE>mct = prepareForMinC(getFlushID(), MinorCompactionReason.CLOSE);<NEW_LINE>} catch (NoNodeException e) {<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do minor compaction outside of synch block so that tablet can be read and written to while<NEW_LINE>// compaction runs<NEW_LINE>mct.run();<NEW_LINE>} | "Exception on " + extent + " during prep for MinC", e); |
698,906 | public HttpResult doPost(CloseableHttpClient httpClient, String url, Map<String, String> header, String content, ContentType contentType) throws Exception {<NEW_LINE>HttpPost httpPost = new HttpPost(url);<NEW_LINE>httpPost.addHeader("Connection", "close");<NEW_LINE>if (header != null) {<NEW_LINE>header.forEach((k, v) -> {<NEW_LINE>httpPost.setHeader(k, v);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (content != null) {<NEW_LINE>StringEntity stringEntity = new StringEntity(content, contentType);<NEW_LINE>httpPost.setEntity(stringEntity);<NEW_LINE>}<NEW_LINE>CloseableHttpResponse response = httpClient.execute(httpPost);<NEW_LINE>HttpResult hr = new HttpResult(response.getStatusLine().getStatusCode(), EntityUtils.toString(response<MASK><NEW_LINE>try {<NEW_LINE>response.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("", e);<NEW_LINE>}<NEW_LINE>return hr;<NEW_LINE>} | .getEntity(), "UTF-8")); |
1,118,859 | public S3Resource convertArn(Arn arn) {<NEW_LINE>if (isV1Arn(arn)) {<NEW_LINE>return convertV1Arn(arn);<NEW_LINE>}<NEW_LINE>S3ResourceType s3ResourceType;<NEW_LINE>try {<NEW_LINE>s3ResourceType = S3ResourceType.fromValue(arn.<MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("Unknown ARN type '" + arn.getResource().getResourceType() + "'");<NEW_LINE>}<NEW_LINE>// OBJECT is a sub-resource under ACCESS_POINT and BUCKET and will not be recognized as a primary ARN resource<NEW_LINE>// type<NEW_LINE>switch(s3ResourceType) {<NEW_LINE>case ACCESS_POINT:<NEW_LINE>return parseS3AccessPointArn(arn);<NEW_LINE>case BUCKET:<NEW_LINE>return parseS3BucketArn(arn);<NEW_LINE>case OUTPOST:<NEW_LINE>return parseS3OutpostAccessPointArn(arn);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown ARN type '" + arn.getResource().getResourceType() + "'");<NEW_LINE>}<NEW_LINE>} | getResource().getResourceType()); |
114,070 | protected int handleGetExtendedYear() {<NEW_LINE>// EXTENDED_YEAR in TaiwanCalendar is a Gregorian year<NEW_LINE>// The default value of EXTENDED_YEAR is 1970 (Minguo 59)<NEW_LINE>int year = GREGORIAN_EPOCH;<NEW_LINE>if (newerField(EXTENDED_YEAR, YEAR) == EXTENDED_YEAR && newerField(EXTENDED_YEAR, ERA) == EXTENDED_YEAR) {<NEW_LINE>year = internalGet(EXTENDED_YEAR, GREGORIAN_EPOCH);<NEW_LINE>} else {<NEW_LINE>int <MASK><NEW_LINE>if (era == MINGUO) {<NEW_LINE>year = internalGet(YEAR, 1) + Taiwan_ERA_START;<NEW_LINE>} else {<NEW_LINE>year = 1 - internalGet(YEAR, 1) + Taiwan_ERA_START;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return year;<NEW_LINE>} | era = internalGet(ERA, MINGUO); |
754,541 | private Element generateLink(Link link) {<NEW_LINE>Element linkElement = new Element("link", NS);<NEW_LINE>if (link.getHref() != null) {<NEW_LINE>Attribute href = new Attribute(AtomLinkAttribute.HREF, link.getHref());<NEW_LINE>linkElement.setAttribute(href);<NEW_LINE>}<NEW_LINE>if (link.getType() != null) {<NEW_LINE>Attribute type = new Attribute(AtomLinkAttribute.TYPE, link.getType());<NEW_LINE>linkElement.setAttribute(type);<NEW_LINE>}<NEW_LINE>if (link.getRel() != null) {<NEW_LINE>Attribute rel = new Attribute(AtomLinkAttribute.REL, link.getRel());<NEW_LINE>linkElement.setAttribute(rel);<NEW_LINE>}<NEW_LINE>if (link.getHreflang() != null) {<NEW_LINE>final Attribute hreflangAttribute = new Attribute(AtomLinkAttribute.HREF_LANG, link.getHreflang());<NEW_LINE>linkElement.setAttribute(hreflangAttribute);<NEW_LINE>}<NEW_LINE>if (link.getTitle() != null) {<NEW_LINE>final Attribute title = new Attribute(AtomLinkAttribute.TITLE, link.getTitle());<NEW_LINE>linkElement.setAttribute(title);<NEW_LINE>}<NEW_LINE>if (link.getLength() != 0) {<NEW_LINE>final Attribute length = new Attribute(AtomLinkAttribute.LENGTH, Long.toString<MASK><NEW_LINE>linkElement.setAttribute(length);<NEW_LINE>}<NEW_LINE>return linkElement;<NEW_LINE>} | (link.getLength())); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.