idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
993,967
protected void initialize(final StyleId id, final String title) {<NEW_LINE>// Default frame initialization<NEW_LINE>enableEvents(AWTEvent.KEY_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);<NEW_LINE>setLocale(JComponent.getDefaultLocale());<NEW_LINE>setRootPane(createRootPane());<NEW_LINE>setRootPaneCheckingEnabled(true);<NEW_LINE>ProprietaryUtils.checkAndSetPolicy(this);<NEW_LINE>// Additional settings<NEW_LINE>WebLookAndFeel.setOrientation(this);<NEW_LINE>// Applying style<NEW_LINE>setStyleId(id);<NEW_LINE>// Language updater<NEW_LINE>if (title != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Adding focus tracker for this frame<NEW_LINE>// It is stored into a separate field to avoid its disposal from memory<NEW_LINE>focusTracker = new DefaultFocusTracker(getRootPane(), true) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabled() {<NEW_LINE>return closeOnFocusLoss && super.isEnabled();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusChanged(final boolean focused) {<NEW_LINE>if (isEnabled() && !focused) {<NEW_LINE>// Making sure frame can do something to prevent the close<NEW_LINE>processWindowEvent(new WindowEvent(WebFrame.this, WindowEvent.WINDOW_CLOSING));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>FocusManager.addFocusTracker(getRootPane(), focusTracker);<NEW_LINE>}
UILanguageManager.registerInitialLanguage(this, title);
1,257,798
private void runStructrScript(final String line, final Writable writable) throws FrameworkException, IOException {<NEW_LINE>actionContext.setJavaScriptContext(false);<NEW_LINE>try (final Tx tx = StructrApp.getInstance(actionContext.getSecurityContext()).tx()) {<NEW_LINE>final EvaluationHints hints = new EvaluationHints();<NEW_LINE>final Object result = Functions.evaluate(actionContext, null, new Snippet<MASK><NEW_LINE>if (result != null) {<NEW_LINE>if (result instanceof Iterable) {<NEW_LINE>writable.println(Iterables.toList((Iterable) result).toString());<NEW_LINE>} else {<NEW_LINE>writable.println(result.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (UnlicensedScriptException ex) {<NEW_LINE>throw new FrameworkException(422, "Unlicensed function called", ex);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new FrameworkException(422, t.getMessage());<NEW_LINE>}<NEW_LINE>}
("console", line), hints);
1,843,821
public BigDecimal invoke(int A_Asset_ID, String PostingType, int A_Asset_Acct_ID, int Flag, int Period) {<NEW_LINE>String conventionType = getConventionType();<NEW_LINE>BigDecimal retValue = null;<NEW_LINE>if (CLogMgt.isLevelFine())<NEW_LINE>log.fine("Entering: ConventionType=" + conventionType + "A_Asset_ID=" + A_Asset_ID + ", PostingType=" + PostingType + ", A_Asset_Acct_ID=" + A_Asset_Acct_ID + ", Flag=" + Flag + ", Period=" + Period);<NEW_LINE>if (conventionType.equalsIgnoreCase("FMCON")) {<NEW_LINE>return apply_FMCON(A_Asset_ID, PostingType, A_Asset_Acct_ID, Flag, Period);<NEW_LINE>} else {<NEW_LINE>String sql = "{ ? = call " + conventionType + "(?, ?, ?, ?, ?) }";<NEW_LINE>CallableStatement cs = null;<NEW_LINE>try {<NEW_LINE>cs = DB.prepareCall(sql);<NEW_LINE>cs.registerOutParameter(1, java.sql.Types.DECIMAL);<NEW_LINE>cs.setInt(2, A_Asset_ID);<NEW_LINE>cs.setString(3, PostingType);<NEW_LINE>cs.setInt(4, A_Asset_Acct_ID);<NEW_LINE>cs.setInt(5, Flag);<NEW_LINE><MASK><NEW_LINE>cs.execute();<NEW_LINE>retValue = cs.getBigDecimal(1);<NEW_LINE>cs.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (cs != null)<NEW_LINE>cs.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.FINEST, "Error", e);<NEW_LINE>}<NEW_LINE>cs = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (retValue == null) {<NEW_LINE>retValue = BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (CLogMgt.isLevelFine())<NEW_LINE>log.fine("Leaving: retValue=" + retValue);<NEW_LINE>return retValue;<NEW_LINE>}
cs.setInt(6, Period);
158,881
public Response serve(String uri, String method, Properties header, Properties parms, Properties files) {<NEW_LINE>Logger.log("URI: " + uri);<NEW_LINE>if (uri.endsWith("/sayhello")) {<NEW_LINE>System.out.println("header: " + header);<NEW_LINE>System.out.println("parms: " + parms);<NEW_LINE>System.out.println("method: " + method);<NEW_LINE>StringBuffer html = new StringBuffer();<NEW_LINE>String name = parms.getProperty("name");<NEW_LINE>String car = parms.getProperty("car");<NEW_LINE>html.append("<html><head><title>Hello: " + name + "</title></head>");<NEW_LINE>html.append("<body>");<NEW_LINE>html.append("<h1>This is my way of saying hello</h1>");<NEW_LINE>html.append("<h2>Hello !</h2>");<NEW_LINE>html.append("<h3>Your name is:</h3>");<NEW_LINE>html.append("&quot;" + name + "&quot;");<NEW_LINE>html.append("<h3>Your prefered car is:</h3>");<NEW_LINE>html.<MASK><NEW_LINE>html.append("<br><hr>to start again click <a href='http://localhost:4450/'>here</a>");<NEW_LINE>html.append("</body></html>");<NEW_LINE>return new NanoHTTPD.Response(HTTP_OK, MIME_HTML, html.toString());<NEW_LINE>} else {<NEW_LINE>StringBuffer html = new StringBuffer();<NEW_LINE>html.append("<html><head><title>Say Hello Demo</title></head>");<NEW_LINE>html.append("<body>");<NEW_LINE>html.append("Hello, can you please tell me your name?");<NEW_LINE>html.append("<form name='myform' action='http://localhost:4450/sayhello' method='get'>");<NEW_LINE>html.append("<div align='center'><br><br>");<NEW_LINE>html.append("<input type='text' id='name_input' name='name' size='25' value='Enter your name here!'><br>");<NEW_LINE>html.append("<p>Prefered Car:<br>");<NEW_LINE>html.append("<select name='car'><option value=\"volvo\">Volvo</option>");<NEW_LINE>html.append("<option value=\"mercedes\">Mercedes</option>");<NEW_LINE>html.append("<option value=\"audi\">Audi</option></select></p>");<NEW_LINE>html.append("<br><input type='submit' value='Send me your name!'><br>");<NEW_LINE>html.append("</div></form>");<NEW_LINE>html.append("</body></html>");<NEW_LINE>return new NanoHTTPD.Response(HTTP_OK, MIME_HTML, html.toString());<NEW_LINE>}<NEW_LINE>}
append("&quot;" + car + "&quot;");
1,081,225
public void visit(TypeDefinitionNode typeDefinitionNode) {<NEW_LINE>int type = TokenTypes.TYPE.getId();<NEW_LINE>int modifiers = 0;<NEW_LINE>Node typeDescriptor = typeDefinitionNode.typeDescriptor();<NEW_LINE>switch(typeDescriptor.kind()) {<NEW_LINE>case OBJECT_TYPE_DESC:<NEW_LINE>type = TokenTypes.INTERFACE.getId();<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>case RECORD_TYPE_DESC:<NEW_LINE>type <MASK><NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>case INTERSECTION_TYPE_DESC:<NEW_LINE>if (typeDescriptor instanceof IntersectionTypeDescriptorNode) {<NEW_LINE>IntersectionTypeDescriptorNode intSecDescriptor = (IntersectionTypeDescriptorNode) typeDescriptor;<NEW_LINE>SyntaxKind left = intSecDescriptor.leftTypeDesc().kind();<NEW_LINE>SyntaxKind right = intSecDescriptor.rightTypeDesc().kind();<NEW_LINE>if (left == SyntaxKind.RECORD_TYPE_DESC || right == SyntaxKind.RECORD_TYPE_DESC) {<NEW_LINE>type = TokenTypes.STRUCT.getId();<NEW_LINE>}<NEW_LINE>if (left == SyntaxKind.READONLY_TYPE_DESC || right == SyntaxKind.READONLY_TYPE_DESC) {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId() | TokenTypeModifiers.READONLY.getId();<NEW_LINE>} else {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>type = TokenTypes.TYPE.getId();<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>this.addSemanticToken(typeDefinitionNode.typeName(), type, modifiers, true, type, 0);<NEW_LINE>visitSyntaxNode(typeDefinitionNode);<NEW_LINE>}
= TokenTypes.STRUCT.getId();
1,797,591
protected String formulateQuery(Collection<SolrTerm> terms, SolrQuerySettings settings, Logger cLogger) {<NEW_LINE>StringBuffer result = new StringBuffer();<NEW_LINE>for (SolrTerm term : terms) {<NEW_LINE>if (settings.isProximityOnly())<NEW_LINE>continue;<NEW_LINE>if (term.isRequired() && settings.areCluesAllRequired())<NEW_LINE>result.append("+");<NEW_LINE>// drop quote characters; more escaping is done in escapeQuery()<NEW_LINE>String keyterm = term.getTermStr().replace("\"", "");<NEW_LINE>result.append("(");<NEW_LINE>boolean isFirstField = true;<NEW_LINE>for (String prefix : settings.getSearchPrefixes()) {<NEW_LINE>if (!isFirstField)<NEW_LINE>result.append(" OR ");<NEW_LINE>else<NEW_LINE>isFirstField = false;<NEW_LINE>result.append(prefix + "\"" + keyterm + "\"");<NEW_LINE>}<NEW_LINE>result.append(")^" + term.getWeight() + " ");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < settings.getProximityNum(); i++) for (String prefix : settings.getSearchPrefixes()) formulateProximityQuery(terms, settings, prefix, result, i);<NEW_LINE>String query = result.toString();<NEW_LINE><MASK><NEW_LINE>return query;<NEW_LINE>}
cLogger.info(" QUERY: " + query);
373,081
public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String labName = Utils.getValueFromIdByName(id, "labs");<NEW_LINE>if (labName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String username = Utils.getValueFromIdByName(id, "users");<NEW_LINE>if (username == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", id)));<NEW_LINE>}<NEW_LINE>String name = Utils.getValueFromIdByName(id, "disks");<NEW_LINE>if (name == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'disks'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, labName, username, name, context);<NEW_LINE>}
format("The resource ID '%s' is not valid. Missing path segment 'labs'.", id)));
1,645,125
public void create() {<NEW_LINE>if (created) {<NEW_LINE>throw new IllegalStateException("Must not call .create() twice");<NEW_LINE>}<NEW_LINE>created = true;<NEW_LINE>if (range == null) {<NEW_LINE>range = myCurrentElement.getTextRange();<NEW_LINE>}<NEW_LINE>if (tooltip == null && message != null) {<NEW_LINE>tooltip = XmlStringUtil.wrapInHtml(XmlStringUtil.escapeString(message));<NEW_LINE>}<NEW_LINE>// noinspection deprecation<NEW_LINE>Annotation annotation = new Annotation(range.getStartOffset(), range.getEndOffset(), severity, message, tooltip);<NEW_LINE>if (needsUpdateOnTyping != null) {<NEW_LINE>annotation.setNeedsUpdateOnTyping(needsUpdateOnTyping);<NEW_LINE>}<NEW_LINE>if (highlightType != null) {<NEW_LINE>annotation.setHighlightType(highlightType);<NEW_LINE>}<NEW_LINE>if (textAttributesKey != null) {<NEW_LINE>annotation.setTextAttributes(textAttributesKey);<NEW_LINE>}<NEW_LINE>if (enforcedAttributes != null) {<NEW_LINE>annotation.setEnforcedTextAttributes(enforcedAttributes);<NEW_LINE>}<NEW_LINE>if (problemGroup != null) {<NEW_LINE>annotation.setProblemGroup(problemGroup);<NEW_LINE>}<NEW_LINE>if (gutterIconRenderer != null) {<NEW_LINE>annotation.setGutterIconRenderer(gutterIconRenderer);<NEW_LINE>}<NEW_LINE>if (fileLevel != null) {<NEW_LINE>annotation.setFileLevelAnnotation(fileLevel);<NEW_LINE>}<NEW_LINE>if (afterEndOfLine != null) {<NEW_LINE>annotation.setAfterEndOfLine(afterEndOfLine);<NEW_LINE>}<NEW_LINE>if (fixes != null) {<NEW_LINE>for (FixB fb : fixes) {<NEW_LINE>IntentionAction fix = fb.fix;<NEW_LINE>TextRange finalRange = fb.range == null <MASK><NEW_LINE>if (fb.batch != null && fb.batch) {<NEW_LINE>registerBatchFix(annotation, fix, finalRange, fb.key);<NEW_LINE>} else if (fb.universal != null && fb.universal) {<NEW_LINE>registerBatchFix(annotation, fix, finalRange, fb.key);<NEW_LINE>annotation.registerFix(fix, finalRange, fb.key);<NEW_LINE>} else {<NEW_LINE>annotation.registerFix(fix, finalRange, fb.key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myHolder.add(annotation);<NEW_LINE>myHolder.queueToUpdateIncrementally();<NEW_LINE>myHolder.annotationCreatedFrom(this);<NEW_LINE>}
? this.range : fb.range;
861,315
final DescribeNotebookInstanceLifecycleConfigResult executeDescribeNotebookInstanceLifecycleConfig(DescribeNotebookInstanceLifecycleConfigRequest describeNotebookInstanceLifecycleConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeNotebookInstanceLifecycleConfigRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeNotebookInstanceLifecycleConfigRequest> request = null;<NEW_LINE>Response<DescribeNotebookInstanceLifecycleConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeNotebookInstanceLifecycleConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeNotebookInstanceLifecycleConfigRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeNotebookInstanceLifecycleConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeNotebookInstanceLifecycleConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeNotebookInstanceLifecycleConfigResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,035,266
void onWordCount() {<NEW_LINE>prepareForVisualExecution(() -> {<NEW_LINE>int totalWords = 0;<NEW_LINE>int selectionWords = 0;<NEW_LINE>Range selectionRange = null;<NEW_LINE>// A selection in visual mode may span multiple editors and blocks of<NEW_LINE>// prose, which we can't count here.<NEW_LINE>if (!isVisualEditorActive()) {<NEW_LINE>selectionRange = docDisplay_.getSelectionRange();<NEW_LINE>}<NEW_LINE>TextFileType fileType = docDisplay_.getFileType();<NEW_LINE>Iterator<Range> wordIter = docDisplay_.getWords(fileType.getTokenPredicate(), docDisplay_.getFileType().getCharPredicate(), Position.create(0, 0), null).iterator();<NEW_LINE>while (wordIter.hasNext()) {<NEW_LINE><MASK><NEW_LINE>totalWords++;<NEW_LINE>if (selectionRange != null && selectionRange.intersects(r))<NEW_LINE>selectionWords++;<NEW_LINE>}<NEW_LINE>String selectedWordsText = selectionWords == 0 ? "" : constants_.selectedWords(selectionWords);<NEW_LINE>globalDisplay_.showMessage(MessageDisplay.MSG_INFO, constants_.wordCount(), constants_.onWordCountMessage(totalWords, selectedWordsText));<NEW_LINE>});<NEW_LINE>}
Range r = wordIter.next();
186,218
public synchronized ReviewResult applyReview(Map<ReviewStatus, Set<Integer>> requestIdsByTargetState, String reason) {<NEW_LINE>// Sanity check if all request ids in the review exists in the purgatory.<NEW_LINE>Set<Integer> <MASK><NEW_LINE>for (Map.Entry<ReviewStatus, Set<Integer>> entry : requestIdsByTargetState.entrySet()) {<NEW_LINE>Set<Integer> requestIds = entry.getValue();<NEW_LINE>if (!_requestInfoById.keySet().containsAll(requestIds)) {<NEW_LINE>throw new IllegalStateException(String.format("Review contains request ids (%s) that do not exist in purgatory.", requestIds.removeAll(_requestInfoById.keySet())));<NEW_LINE>}<NEW_LINE>// Apply review to each Request Info<NEW_LINE>ReviewStatus targetReviewStatus = entry.getKey();<NEW_LINE>requestIds.forEach(requestId -> _requestInfoById.get(requestId).applyReview(targetReviewStatus, reason));<NEW_LINE>reviewedRequestIds.addAll(requestIds);<NEW_LINE>}<NEW_LINE>// Return the post-review result of the purgatory.<NEW_LINE>return new ReviewResult(new HashMap<>(_requestInfoById), reviewedRequestIds, _config);<NEW_LINE>}
reviewedRequestIds = new HashSet<>();
1,611,459
final void executeRegisterWorkflowType(RegisterWorkflowTypeRequest registerWorkflowTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerWorkflowTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<RegisterWorkflowTypeRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterWorkflowTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(registerWorkflowTypeRequest));<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, "SWF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterWorkflowType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<Void>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
395,482
private void unpackSerializationHint(AnnotationNode typeInfo, HintDeclaration ch) {<NEW_LINE>List<Object> values = typeInfo.values;<NEW_LINE>List<org.objectweb.asm.Type> types = new ArrayList<>();<NEW_LINE>List<String> typeNames = new ArrayList<>();<NEW_LINE>for (int i = 0; i < values.size(); i += 2) {<NEW_LINE>String key = (String) values.get(i);<NEW_LINE>Object value = values.get(i + 1);<NEW_LINE>if (key.equals("types")) {<NEW_LINE>types = (ArrayList<org.objectweb.asm.Type>) value;<NEW_LINE>} else if (key.equals("typeNames")) {<NEW_LINE>typeNames = (ArrayList<String>) value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (org.objectweb.asm.Type type : types) {<NEW_LINE>ch.<MASK><NEW_LINE>}<NEW_LINE>for (String typeName : typeNames) {<NEW_LINE>Type resolvedType = typeSystem.resolveName(typeName, true);<NEW_LINE>if (resolvedType != null) {<NEW_LINE>ch.addSerializationType(typeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addSerializationType(type.getClassName());
1,854,704
public void init(int WindowNo, FormFrame frame) {<NEW_LINE>log.info("");<NEW_LINE>windowNo = WindowNo;<NEW_LINE>formFrame = frame;<NEW_LINE>if (!controller.init(frame.getProcessInfo(), windowNo))<NEW_LINE>dispose();<NEW_LINE>selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), MSG_SELECTIONPANEL)));<NEW_LINE>confirmPanel.addActionListener(this);<NEW_LINE>String title = Msg.getMsg(Env.getCtx(), MSG_SELECTBOMLINES);<NEW_LINE>scroll = new CScrollPane(this);<NEW_LINE>scroll.setColumnHeaderView(header);<NEW_LINE>scroll.setBorder(new TitledBorder(title));<NEW_LINE>formFrame.getContentPane().setLayout(new BorderLayout());<NEW_LINE>formFrame.getContentPane().add(selectionPanel, BorderLayout.NORTH);<NEW_LINE>formFrame.getContentPane().add(scroll, BorderLayout.CENTER);<NEW_LINE>formFrame.getContentPane().<MASK><NEW_LINE>sizeIt();<NEW_LINE>this.setLayout(new GridBagLayout());<NEW_LINE>// Hide it until ready<NEW_LINE>scroll.setVisible(false);<NEW_LINE>}
add(confirmPanel, BorderLayout.SOUTH);
844,720
private static String color(String string, AttributeSet set) {<NEW_LINE>if (set == null) {<NEW_LINE>return string;<NEW_LINE>}<NEW_LINE>if (string.trim().length() == 0) {<NEW_LINE>// NOI18N<NEW_LINE>return string.replace(" ", "&nbsp;").replace("\n", "<br>");<NEW_LINE>}<NEW_LINE>StringBuilder buf = new StringBuilder(string);<NEW_LINE>if (StyleConstants.isBold(set)) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>buf.append("</b>");<NEW_LINE>}<NEW_LINE>if (StyleConstants.isItalic(set)) {<NEW_LINE>// NOI18N<NEW_LINE>buf.insert(0, "<i>");<NEW_LINE>// NOI18N<NEW_LINE>buf.append("</i>");<NEW_LINE>}<NEW_LINE>if (StyleConstants.isStrikeThrough(set)) {<NEW_LINE>// NOI18N<NEW_LINE>buf.insert(0, "<s>");<NEW_LINE>// NOI18N<NEW_LINE>buf.append("</s>");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>buf.insert(0, "<font color=" + getHTMLColor(StyleConstants.getForeground(set)) + ">");<NEW_LINE>// NOI18N<NEW_LINE>buf.append("</font>");<NEW_LINE>return buf.toString();<NEW_LINE>}
buf.insert(0, "<b>");
1,729,117
public static Date parseRSSDate(String date_str) {<NEW_LINE>date_str = date_str.trim();<NEW_LINE>if (date_str.length() == 0) {<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// see rfc822 [EEE,] dd MMM yyyy HH:mm::ss z<NEW_LINE>// assume 4 digit year<NEW_LINE>SimpleDateFormat format;<NEW_LINE>if (!date_str.contains(",")) {<NEW_LINE>format = new SimpleDateFormat("dd MMM yyyy HH:mm:ss z", Locale.US);<NEW_LINE>} else {<NEW_LINE>format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>} catch (ParseException e) {<NEW_LINE>String[] fallbacks = { // As above but laxer<NEW_LINE>// As above but laxer<NEW_LINE>"dd MMM yyyy HH:mm:ss z", // Fri Sep 26 00:00:00 EDT 2008<NEW_LINE>"EEE dd MMM yyyy HH:mm:ss z", // Fri Sep 26 00:00 EDT 2008<NEW_LINE>"EEE MMM dd HH:mm:ss z yyyy", // Fri Sep 26 00 EDT 2008<NEW_LINE>"EEE MMM dd HH:mm z yyyy", // 2009-02-08 22:56:45<NEW_LINE>"EEE MMM dd HH z yyyy", // 2009-02-08<NEW_LINE>"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" };<NEW_LINE>// remove commas as these keep popping up in silly places<NEW_LINE>date_str = date_str.replace(',', ' ');<NEW_LINE>// remove duplicate white space<NEW_LINE>date_str = date_str.replaceAll("(\\s)+", " ");<NEW_LINE>for (int i = 0; i < fallbacks.length; i++) {<NEW_LINE>try {<NEW_LINE>return (new SimpleDateFormat(fallbacks[i], Locale.US).parse(date_str));<NEW_LINE>} catch (ParseException f) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Debug.outNoStack("RSSUtils: failed to parse RSS date: " + date_str);<NEW_LINE>return (null);<NEW_LINE>}<NEW_LINE>}
(format.parse(date_str));
108,431
public Sample[] execute(final Sample[] ss, final String newLabelName, final String existingLabelName, final String namespaceLabelName) {<NEW_LINE>Sample[] samples = Arrays.stream(ss).map(sample -> {<NEW_LINE>String podName = sample.getLabels().get(existingLabelName);<NEW_LINE>String namespace = sample.<MASK><NEW_LINE>if (!Strings.isNullOrEmpty(podName) && !Strings.isNullOrEmpty(namespace)) {<NEW_LINE>String serviceName = K8sInfoRegistry.getInstance().findServiceName(namespace, podName);<NEW_LINE>if (Strings.isNullOrEmpty(serviceName)) {<NEW_LINE>serviceName = BLANK;<NEW_LINE>}<NEW_LINE>Map<String, String> labels = Maps.newHashMap(sample.getLabels());<NEW_LINE>labels.put(newLabelName, serviceName);<NEW_LINE>return sample.toBuilder().labels(ImmutableMap.copyOf(labels)).build();<NEW_LINE>}<NEW_LINE>return sample;<NEW_LINE>}).toArray(Sample[]::new);<NEW_LINE>return samples;<NEW_LINE>}
getLabels().get(namespaceLabelName);
414,269
public Throwable resolveException(final ObjectNode response) {<NEW_LINE>log.trace("Resolving exception from JSON response {}", response);<NEW_LINE>final JsonNode error = response.get(JsonRpcBasicServer.ERROR);<NEW_LINE>if (error == null || !error.isObject()) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final JsonNode code = error.get(JsonRpcBasicServer.ERROR_CODE);<NEW_LINE>if (code == null || !code.isInt() || code.asInt() != ThrowableSerializationMixin.ERROR_CODE) {<NEW_LINE>log.warn("Not resolving exception for unsupported error code {}", code);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final JsonNode data = error.get(JsonRpcBasicServer.DATA);<NEW_LINE>if (data == null || !data.isObject()) {<NEW_LINE>log.warn("No error details included in data field of JSON error {}", error);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final ObjectNode dataObject = ((ObjectNode) data);<NEW_LINE>if (!dataObject.has(JsonRpcBasicServer.ERROR_MESSAGE)) {<NEW_LINE>dataObject.set(JsonRpcBasicServer.ERROR_MESSAGE, new TextNode(error.get(JsonRpcBasicServer.ERROR_MESSAGE).asText()));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return mapper.treeToValue(data, Throwable.class);<NEW_LINE>} catch (final JsonProcessingException e) {<NEW_LINE>log.warn("Unable to convert JSON response error '{}' into Throwable", data, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
log.warn("No error information found in JSON response {}", response);
657,541
private boolean handleIntent(Intent intent) {<NEW_LINE>Uri data = intent.getData();<NEW_LINE>if (data != null && data.getScheme().equals(CALLBACK_URI.getScheme()) && data.getHost().equals(CALLBACK_URI.getHost())) {<NEW_LINE>final String code = data.getQueryParameter(PARAM_CODE);<NEW_LINE>if (code == null) {<NEW_LINE>onLoginCanceled();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>OAuthService service = ServiceGenerator.createAuthService();<NEW_LINE>RequestToken request = RequestToken.builder().clientId(BuildConfig.CLIENT_ID).clientSecret(BuildConfig.CLIENT_SECRET).code(code).build();<NEW_LINE>service.getToken(request).map(ApiHelpers::throwOnFailure).flatMap(token -> {<NEW_LINE>UserService userService = ServiceFactory.get(UserService.class, true, null, token.accessToken(), null);<NEW_LINE>Single<User> userSingle = userService.getUser(<MASK><NEW_LINE>return Single.zip(Single.just(token), userSingle, (t, user) -> Pair.create(t.accessToken(), user));<NEW_LINE>}).compose(RxUtils::doInBackground).subscribe(pair -> onLoginFinished(pair.first, pair.second), this::handleLoadFailure);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
).map(ApiHelpers::throwOnFailure);
14,183
final GetAnalyzedResourceResult executeGetAnalyzedResource(GetAnalyzedResourceRequest getAnalyzedResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAnalyzedResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAnalyzedResourceRequest> request = null;<NEW_LINE>Response<GetAnalyzedResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAnalyzedResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAnalyzedResourceRequest));<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, "AccessAnalyzer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAnalyzedResource");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAnalyzedResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAnalyzedResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
192,459
public boolean apply(Game game, Ability source) {<NEW_LINE>Player spellController = game.getPlayer(((Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK)).getControllerId());<NEW_LINE>if (spellController != null) {<NEW_LINE>Cards cardsToReveal = new CardsImpl();<NEW_LINE>Card toCast = null;<NEW_LINE>for (Card card : spellController.getLibrary().getCards(game)) {<NEW_LINE>cardsToReveal.add(card);<NEW_LINE>if (card.isSorcery(game) || card.isInstant(game)) {<NEW_LINE>toCast = card;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>spellController.revealCards(source, cardsToReveal, game);<NEW_LINE>if (toCast != null && spellController.chooseUse(outcome, "Cast " + toCast.getLogName() + " without paying its mana cost?", source, game)) {<NEW_LINE>game.getState().setValue("PlayFromNotOwnHandZone" + toCast.getId(), Boolean.TRUE);<NEW_LINE>spellController.cast(spellController.chooseAbilityForCast(toCast, game, true), game, true, new ApprovingObject(source, game));<NEW_LINE>game.getState().setValue("PlayFromNotOwnHandZone" + toCast.getId(), null);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
spellController.shuffleLibrary(source, game);
1,097,144
public static DescribeCouponDetailResponse unmarshall(DescribeCouponDetailResponse describeCouponDetailResponse, UnmarshallerContext context) {<NEW_LINE>describeCouponDetailResponse.setRequestId(context.stringValue("DescribeCouponDetailResponse.RequestId"));<NEW_LINE>describeCouponDetailResponse.setCouponTemplateId(context.longValue("DescribeCouponDetailResponse.CouponTemplateId"));<NEW_LINE>describeCouponDetailResponse.setTotalAmount(context.stringValue("DescribeCouponDetailResponse.TotalAmount"));<NEW_LINE>describeCouponDetailResponse.setBalanceAmount(context.stringValue("DescribeCouponDetailResponse.BalanceAmount"));<NEW_LINE>describeCouponDetailResponse.setFrozenAmount(context.stringValue("DescribeCouponDetailResponse.FrozenAmount"));<NEW_LINE>describeCouponDetailResponse.setExpiredAmount(context.stringValue("DescribeCouponDetailResponse.ExpiredAmount"));<NEW_LINE>describeCouponDetailResponse.setDeliveryTime(context.stringValue("DescribeCouponDetailResponse.DeliveryTime"));<NEW_LINE>describeCouponDetailResponse.setExpiredTime(context.stringValue("DescribeCouponDetailResponse.ExpiredTime"));<NEW_LINE>describeCouponDetailResponse.setCouponNumber(context.stringValue("DescribeCouponDetailResponse.CouponNumber"));<NEW_LINE>describeCouponDetailResponse.setStatus<MASK><NEW_LINE>describeCouponDetailResponse.setDescription(context.stringValue("DescribeCouponDetailResponse.Description"));<NEW_LINE>describeCouponDetailResponse.setCreationTime(context.stringValue("DescribeCouponDetailResponse.CreationTime"));<NEW_LINE>describeCouponDetailResponse.setModificationTime(context.stringValue("DescribeCouponDetailResponse.ModificationTime"));<NEW_LINE>describeCouponDetailResponse.setPriceLimit(context.stringValue("DescribeCouponDetailResponse.PriceLimit"));<NEW_LINE>describeCouponDetailResponse.setApplication(context.stringValue("DescribeCouponDetailResponse.Application"));<NEW_LINE>List<String> productCodes = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeCouponDetailResponse.ProductCodes.Length"); i++) {<NEW_LINE>productCodes.add(context.stringValue("DescribeCouponDetailResponse.ProductCodes[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeCouponDetailResponse.setProductCodes(productCodes);<NEW_LINE>List<String> tradeTypes = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeCouponDetailResponse.TradeTypes.Length"); i++) {<NEW_LINE>tradeTypes.add(context.stringValue("DescribeCouponDetailResponse.TradeTypes[" + i + "]"));<NEW_LINE>}<NEW_LINE>describeCouponDetailResponse.setTradeTypes(tradeTypes);<NEW_LINE>return describeCouponDetailResponse;<NEW_LINE>}
(context.stringValue("DescribeCouponDetailResponse.Status"));
1,150,258
public void testUnspecifiedContextTypesCleared() throws Exception {<NEW_LINE>ContextService contextSvc = InitialContext.doLookup("java:global/concurrent/allcontextcleared");<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>Integer txStatusOfCallable = contextSvc.contextualCallable(() -> {<NEW_LINE>try {<NEW_LINE>Object unexpected = InitialContext.doLookup("java:comp/concurrent/appContextExecutor");<NEW_LINE>throw new AssertionError("Application context must be cleared. Looked up " + unexpected);<NEW_LINE>} catch (NamingException x) {<NEW_LINE>// expected because application component namespace is cleared<NEW_LINE>return tran.getStatus();<NEW_LINE>}<NEW_LINE>}).call();<NEW_LINE>// transaction status must be cleared for contextual callable<NEW_LINE>assertEquals(Integer.valueOf<MASK><NEW_LINE>// transaction status must be restored on thread afterward,<NEW_LINE>assertEquals(Status.STATUS_ACTIVE, tran.getStatus());<NEW_LINE>} finally {<NEW_LINE>tran.rollback();<NEW_LINE>}<NEW_LINE>}
(Status.STATUS_NO_TRANSACTION), txStatusOfCallable);
1,509,714
protected void checkAppHome() {<NEW_LINE>String appHome = System.getProperty(APP_HOME_PROP);<NEW_LINE>if (StringUtils.isBlank(appHome)) {<NEW_LINE>String catalinaBase = System.getProperty("catalina.base");<NEW_LINE>if (StringUtils.isNotBlank(catalinaBase)) {<NEW_LINE>File appHomeDir = new File(catalinaBase, "work/app_home");<NEW_LINE>appHome = appHomeDir.getAbsolutePath();<NEW_LINE>} else {<NEW_LINE>File appHomeDir = new File(System<MASK><NEW_LINE>appHome = appHomeDir.getAbsolutePath();<NEW_LINE>}<NEW_LINE>System.setProperty(APP_HOME_PROP, appHome);<NEW_LINE>String message = String.format("Required '%s' Java system property is automatically set\n" + "to '%s'.\n" + "Consider providing it in '-D' Java command line parameter, \n" + "for example '-Dapp.home=/path_to_app_home'", APP_HOME_PROP, appHome);<NEW_LINE>log.warn(StringHelper.wrapLogMessage(message));<NEW_LINE>}<NEW_LINE>}
.getProperty("user.home"), ".app_home");
684,292
public void start(Configuration conf) {<NEW_LINE>boolean httpEnabled = conf.getBoolean(PROMETHEUS_STATS_HTTP_ENABLE, DEFAULT_PROMETHEUS_STATS_HTTP_ENABLE);<NEW_LINE>boolean bkHttpServerEnabled = conf.getBoolean("httpServerEnabled", false);<NEW_LINE>// only start its own http server when prometheus http is enabled and bk http server is not enabled.<NEW_LINE>if (httpEnabled && !bkHttpServerEnabled) {<NEW_LINE>String httpAddr = conf.getString(PROMETHEUS_STATS_HTTP_ADDRESS, DEFAULT_PROMETHEUS_STATS_HTTP_ADDR);<NEW_LINE>int httpPort = conf.getInt(PROMETHEUS_STATS_HTTP_PORT, DEFAULT_PROMETHEUS_STATS_HTTP_PORT);<NEW_LINE>InetSocketAddress httpEndpoint = InetSocketAddress.createUnresolved(httpAddr, httpPort);<NEW_LINE>this.server = new Server(httpEndpoint);<NEW_LINE>ServletContextHandler context = new ServletContextHandler();<NEW_LINE>context.setContextPath("/");<NEW_LINE>server.setHandler(context);<NEW_LINE>context.addServlet(new ServletHolder(new <MASK><NEW_LINE>try {<NEW_LINE>server.start();<NEW_LINE>log.info("Started Prometheus stats endpoint at {}", httpEndpoint);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Include standard JVM stats<NEW_LINE>registerMetrics(new StandardExports());<NEW_LINE>registerMetrics(new MemoryPoolsExports());<NEW_LINE>registerMetrics(new GarbageCollectorExports());<NEW_LINE>registerMetrics(new ThreadExports());<NEW_LINE>// Add direct memory allocated through unsafe<NEW_LINE>registerMetrics(Gauge.build("jvm_memory_direct_bytes_used", "-").create().setChild(new Child() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double get() {<NEW_LINE>return directMemoryUsage != null ? directMemoryUsage.longValue() : Double.NaN;<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>registerMetrics(Gauge.build("jvm_memory_direct_bytes_max", "-").create().setChild(new Child() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double get() {<NEW_LINE>return PlatformDependent.maxDirectMemory();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>executor = Executors.newSingleThreadScheduledExecutor(new DefaultThreadFactory("metrics"));<NEW_LINE>int latencyRolloverSeconds = conf.getInt(PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS, DEFAULT_PROMETHEUS_STATS_LATENCY_ROLLOVER_SECONDS);<NEW_LINE>executor.scheduleAtFixedRate(() -> {<NEW_LINE>rotateLatencyCollection();<NEW_LINE>}, 1, latencyRolloverSeconds, TimeUnit.SECONDS);<NEW_LINE>}
PrometheusServlet(this)), "/metrics");
454,777
public void addTestResult() {<NEW_LINE>svLogger.entering(CLASSNAME, "addTestResult", this);<NEW_LINE>MessageEndpointTestResultsImpl testResult = new MessageEndpointTestResultsImpl();<NEW_LINE>if (testResultNumber >= testResults.length) {<NEW_LINE>// Not enough room for test results, increase the size.<NEW_LINE>MessageEndpointTestResults[] temp = testResults;<NEW_LINE>testResults = new MessageEndpointTestResults[testResultNumber + TEST_RESULT_INCREMENT_SIZE];<NEW_LINE>// Copy the array<NEW_LINE>System.arraycopy(temp, 0, testResults, 0, temp.length);<NEW_LINE>svLogger.info("Get more test results than expected, increased array size to " + testResults.length);<NEW_LINE>}<NEW_LINE>if (!factory.getAdapter().testMode) {<NEW_LINE>// set the test result to the endpoint proxy.<NEW_LINE>// ((MessageEndpointInvocationHandler) (Proxy.getInvocationHandler(endpoint))).setTestResults(testResult);<NEW_LINE>}<NEW_LINE>testResults<MASK><NEW_LINE>svLogger.exiting(CLASSNAME, "addTestResult");<NEW_LINE>}
[testResultNumber++] = (testResult);
117,689
public StreamObserver<Subscription> subscribeStream(StreamObserver<SimpleMessage> responseObserver) {<NEW_LINE>EventEmitter<SimpleMessage> emitter = new EventEmitter<>(responseObserver);<NEW_LINE>return new StreamObserver<Subscription>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(Subscription subscription) {<NEW_LINE>if (!subscription.getSubscriptionItemsList().isEmpty()) {<NEW_LINE>logger.info("cmd={}|{}|client2eventMesh|from={}|to={}", "subscribeStream", EventMeshConstants.PROTOCOL_GRPC, subscription.getHeader().getIp(), <MASK><NEW_LINE>handleSubscriptionStream(subscription, emitter);<NEW_LINE>} else {<NEW_LINE>logger.info("cmd={}|{}|client2eventMesh|from={}|to={}", "reply-to-server", EventMeshConstants.PROTOCOL_GRPC, subscription.getHeader().getIp(), eventMeshGrpcServer.getEventMeshGrpcConfiguration().eventMeshIp);<NEW_LINE>handleSubscribeReply(subscription, emitter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>logger.error("Receive error from client: " + t.getMessage());<NEW_LINE>emitter.onCompleted();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompleted() {<NEW_LINE>logger.info("Client finish sending messages");<NEW_LINE>emitter.onCompleted();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
eventMeshGrpcServer.getEventMeshGrpcConfiguration().eventMeshIp);
1,777,566
private static Entry condition(RandomNumberGenerator rand, Entry personEntry, Bundle bundle, Entry encounterEntry, HealthRecord.Entry condition) {<NEW_LINE>Condition conditionResource = new Condition();<NEW_LINE>conditionResource.setPatient(new ResourceReferenceDt(personEntry.getFullUrl()));<NEW_LINE>conditionResource.setEncounter(new ResourceReferenceDt(encounterEntry.getFullUrl()));<NEW_LINE>Code code = condition.codes.get(0);<NEW_LINE>conditionResource.setCode<MASK><NEW_LINE>conditionResource.setCategory(ConditionCategoryCodesEnum.DIAGNOSIS);<NEW_LINE>conditionResource.setVerificationStatus(ConditionVerificationStatusEnum.CONFIRMED);<NEW_LINE>conditionResource.setClinicalStatus(ConditionClinicalStatusCodesEnum.ACTIVE);<NEW_LINE>conditionResource.setOnset(convertFhirDateTime(condition.start, true));<NEW_LINE>conditionResource.setDateRecorded(new DateDt(new Date(condition.start)));<NEW_LINE>if (condition.stop != 0) {<NEW_LINE>conditionResource.setAbatement(convertFhirDateTime(condition.stop, true));<NEW_LINE>conditionResource.setClinicalStatus(ConditionClinicalStatusCodesEnum.RESOLVED);<NEW_LINE>}<NEW_LINE>Entry conditionEntry = newEntry(rand, bundle, conditionResource);<NEW_LINE>condition.fullUrl = conditionEntry.getFullUrl();<NEW_LINE>return conditionEntry;<NEW_LINE>}
(mapCodeToCodeableConcept(code, SNOMED_URI));
523,330
public final void paint(final Graphics g_) {<NEW_LINE><MASK><NEW_LINE>int x = (int) (myIconBounds.x * (1 - myRatio) + myComponentBounds.x * myRatio);<NEW_LINE>int y = (int) (myIconBounds.y * (1 - myRatio) + myComponentBounds.y * myRatio);<NEW_LINE>int width = (int) (myIconBounds.width * (1 - myRatio) + myComponentBounds.width * myRatio);<NEW_LINE>int height = (int) (myIconBounds.height * (1 - myRatio) + myComponentBounds.height * myRatio);<NEW_LINE>Graphics2D g = (Graphics2D) g_.create();<NEW_LINE>try {<NEW_LINE>g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5F + (float) (myRatio / 2)));<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);<NEW_LINE>g.drawImage(myComponentImage, x, y, width, height, this);<NEW_LINE>} finally {<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>}
long l = System.currentTimeMillis();
1,067,084
public List<Invoice> retrieveInvoices(Company company) {<NEW_LINE>Query<Invoice> query = invoiceRepository.all().filter("self.company = :company AND self.partner.factorizedCustomer = TRUE " + "AND self.statusSelect = :invoiceStatusVentilated " + "AND self.id not in (" + " select Invoices.id " + " from SubrogationRelease as SR " + " join SR.invoiceSet as Invoices " + " where SR.statusSelect in (:subrogationReleaseStatusTransmitted, :subrogationReleaseStatusAccounted, :subrogationReleaseStatusCleared))" + "AND ((self.amountRemaining > 0 AND self.hasPendingPayments = FALSE)" + " OR self.originalInvoice.id in (" + " select Invoices.id " + " from SubrogationRelease as SR " + " join SR.invoiceSet as Invoices " + " where SR.statusSelect in (:subrogationReleaseStatusTransmitted, :subrogationReleaseStatusAccounted, :subrogationReleaseStatusCleared)))").order("invoiceDate").order("dueDate").order("invoiceId");<NEW_LINE>query.bind("company", company);<NEW_LINE>query.bind("invoiceStatusVentilated", InvoiceRepository.STATUS_VENTILATED);<NEW_LINE>query.bind("subrogationReleaseStatusTransmitted", SubrogationReleaseRepository.STATUS_TRANSMITTED);<NEW_LINE>query.bind("subrogationReleaseStatusAccounted", SubrogationReleaseRepository.STATUS_ACCOUNTED);<NEW_LINE>query.<MASK><NEW_LINE>List<Invoice> invoiceList = query.fetch();<NEW_LINE>return invoiceList;<NEW_LINE>}
bind("subrogationReleaseStatusCleared", SubrogationReleaseRepository.STATUS_CLEARED);
127,830
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand3 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);<NEW_LINE>final String targetRegister = (registerOperand1.getValue());<NEW_LINE>final String sourceRegister1 = (registerOperand2.getValue());<NEW_LINE>final String sourceRegister2 = (registerOperand3.getValue());<NEW_LINE>final long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>new Processor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String[] process(long baseOffset, final String[] firstTwo, final String[] secondTwo) {<NEW_LINE>final String sum1 = environment.getNextVariableString();<NEW_LINE>final String diff1 = environment.getNextVariableString();<NEW_LINE>final String diff1Sat = environment.getNextVariableString();<NEW_LINE>final <MASK><NEW_LINE>baseOffset = baseOffset - instructions.size();<NEW_LINE>// do the adds<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset + instructions.size(), dw, firstTwo[0], dw, secondTwo[1], dw, sum1));<NEW_LINE>instructions.add(ReilHelpers.createSub(baseOffset + instructions.size(), dw, firstTwo[1], dw, secondTwo[0], dw, diff1));<NEW_LINE>// Do the Sat<NEW_LINE>Helpers.signedSat(baseOffset + instructions.size(), environment, instruction, instructions, dw, firstTwo[0], dw, secondTwo[1], dw, sum1, "ADD", sum1Sat, 16L, "");<NEW_LINE>Helpers.signedSat(baseOffset + instructions.size(), environment, instruction, instructions, dw, firstTwo[1], dw, secondTwo[0], dw, diff1, "SUB", diff1Sat, 16L, "");<NEW_LINE>return new String[] { sum1Sat, diff1Sat };<NEW_LINE>}<NEW_LINE>}.generate(environment, baseOffset, 16, sourceRegister1, sourceRegister2, targetRegister, instructions);<NEW_LINE>}
String sum1Sat = environment.getNextVariableString();
917,050
private FindFreePageResult findFreePage(final int contentSize, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>while (true) {<NEW_LINE>int freePageIndex = contentSize / ONE_KB;<NEW_LINE>freePageIndex -= PAGINATED_STORAGE_LOWEST_FREELIST_BOUNDARY.getValueAsInteger();<NEW_LINE>if (freePageIndex < 0) {<NEW_LINE>freePageIndex = 0;<NEW_LINE>}<NEW_LINE>long pageIndex;<NEW_LINE>final OCacheEntry pinnedStateEntry = loadPageForRead(atomicOperation, fileId, stateEntryIndex, true);<NEW_LINE>if (pinnedStateEntry == null) {<NEW_LINE>loadPageForRead(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final OPaginatedClusterStateV0 freePageLists = new OPaginatedClusterStateV0(pinnedStateEntry);<NEW_LINE>do {<NEW_LINE>pageIndex = freePageLists.getFreeListPage(freePageIndex);<NEW_LINE>freePageIndex++;<NEW_LINE>} while (pageIndex < 0 && freePageIndex < FREE_LIST_SIZE);<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, pinnedStateEntry);<NEW_LINE>}<NEW_LINE>if (pageIndex < 0) {<NEW_LINE>pageIndex = getFilledUpTo(atomicOperation, fileId);<NEW_LINE>} else {<NEW_LINE>freePageIndex--;<NEW_LINE>}<NEW_LINE>if (freePageIndex < FREE_LIST_SIZE) {<NEW_LINE>final OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>// free list is broken automatically fix it<NEW_LINE>if (cacheEntry == null) {<NEW_LINE>updateFreePagesList(freePageIndex, -1, atomicOperation);<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>int realFreePageIndex;<NEW_LINE>try {<NEW_LINE>final OClusterPage localPage = new OClusterPage(cacheEntry);<NEW_LINE>realFreePageIndex = calculateFreePageIndex(localPage);<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>if (realFreePageIndex != freePageIndex) {<NEW_LINE>OLogManager.instance().warn(this, "Page in file %s with index %d was placed in wrong free list, this error will be fixed automatically", getFullName(), pageIndex);<NEW_LINE>updateFreePagesIndex(freePageIndex, pageIndex, atomicOperation);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FindFreePageResult(pageIndex, freePageIndex);<NEW_LINE>}<NEW_LINE>}
atomicOperation, fileId, stateEntryIndex, true);
157,135
public IStatus install(String packageName, String displayName, boolean global, char[] password, IPath workingDirectory, IProgressMonitor monitor) {<NEW_LINE>SubMonitor sub = SubMonitor.convert(monitor, 10);<NEW_LINE>String globalPrefixPath = null;<NEW_LINE>try {<NEW_LINE>// If we are doing a global install we will fetch the global prefix and set it back after the install<NEW_LINE>// completes to the original value<NEW_LINE>if (global) {<NEW_LINE>globalPrefixPath = getGlobalPrefix(global, password, workingDirectory, sub, globalPrefixPath);<NEW_LINE>}<NEW_LINE>sub.setWorkRemaining(8);<NEW_LINE>sub.subTask("Running npm install command");<NEW_LINE>IStatus status = runNpmInstaller(packageName, displayName, global, password, workingDirectory, INSTALL<MASK><NEW_LINE>if (status.getSeverity() == IStatus.CANCEL) {<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}<NEW_LINE>if (!status.isOK()) {<NEW_LINE>String message;<NEW_LINE>if (status instanceof ProcessStatus) {<NEW_LINE>message = ((ProcessStatus) status).getStdErr();<NEW_LINE>} else {<NEW_LINE>message = status.getMessage();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>JSCorePlugin.getDefault(), MessageFormat.format("Failed to install {0}.\n\n{1}", packageName, message));<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedInstallError, packageName));<NEW_LINE>} else if (status instanceof ProcessStatus) {<NEW_LINE>String error = ((ProcessStatus) status).getStdErr();<NEW_LINE>if (!StringUtil.isEmpty(error)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] lines = error.split("\n");<NEW_LINE>if (lines.length > 0 && lines[lines.length - 1].contains(NPM_ERROR)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>JSCorePlugin.getDefault(), MessageFormat.format("Failed to install {0}.\n\n{1}", packageName, error));<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedInstallError, packageName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} catch (CoreException ce) {<NEW_LINE>return ce.getStatus();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>// Set the global npm prefix path to its original value.<NEW_LINE>if (!StringUtil.isEmpty(globalPrefixPath)) {<NEW_LINE>try {<NEW_LINE>sub.subTask("Resetting global NPM prefix");<NEW_LINE>setGlobalPrefixPath(password, workingDirectory, sub.newChild(1), globalPrefixPath);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>return e.getStatus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sub.done();<NEW_LINE>}<NEW_LINE>}
, sub.newChild(6));
1,715,347
public void process(Tables.OsmWaterPolygon element, FeatureCollector features) {<NEW_LINE>if (nullIfEmpty(element.name()) != null) {<NEW_LINE>try {<NEW_LINE>Geometry centerlineGeometry = lakeCenterlines.get(element.source().id());<NEW_LINE>FeatureCollector.Feature feature;<NEW_LINE>int minzoom = 9;<NEW_LINE>if (centerlineGeometry != null) {<NEW_LINE>// prefer lake centerline if it exists<NEW_LINE>feature = features.geometry(LAYER_NAME, centerlineGeometry).setMinPixelSizeBelowZoom(13, 6 * element.name().length());<NEW_LINE>} else {<NEW_LINE>// otherwise just use a label point inside the lake<NEW_LINE><MASK><NEW_LINE>Geometry geometry = element.source().worldGeometry();<NEW_LINE>double area = geometry.getArea();<NEW_LINE>minzoom = (int) Math.floor(20 - Math.log(area / WORLD_AREA_FOR_70K_SQUARE_METERS) / LOG2);<NEW_LINE>minzoom = Math.min(14, Math.max(9, minzoom));<NEW_LINE>}<NEW_LINE>feature.setAttr(Fields.CLASS, FieldValues.CLASS_LAKE).setBufferPixels(BUFFER_SIZE).putAttrs(LanguageUtils.getNames(element.source().tags(), translations)).setAttr(Fields.INTERMITTENT, element.isIntermittent() ? 1 : 0).setMinZoom(minzoom);<NEW_LINE>} catch (GeometryException e) {<NEW_LINE>e.log(stats, "omt_water_polygon", "Unable to get geometry for water polygon " + element.source().id());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
feature = features.pointOnSurface(LAYER_NAME);
1,086,509
public void paint(BigInteger xOffset, BigInteger yOffset, GC gc) {<NEW_LINE>if (model == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>gc.setFont(font);<NEW_LINE>Rectangle clip = gc.getClipping();<NEW_LINE>BigInteger startY = yOffset.add(BigInteger.valueOf(top(clip)));<NEW_LINE>long startRow = startY.divide(lineHeightBig).max(BigInteger.ZERO).min(BigInteger.valueOf(model.getLineCount() - 1)).longValueExact();<NEW_LINE>long endRow = startY.add(BigInteger.valueOf(clip.height + lineHeight - 1)).divide(lineHeightBig).max(BigInteger.ZERO).min(BigInteger.valueOf(model.getLineCount())).longValueExact();<NEW_LINE>Color background = gc.getBackground();<NEW_LINE>gc.setBackground(theme.memoryReadHighlight());<NEW_LINE>for (Selection read : model.getReads(startRow, endRow)) {<NEW_LINE>highlight(gc, yOffset, read);<NEW_LINE>}<NEW_LINE>gc.setBackground(theme.memoryWriteHighlight());<NEW_LINE>for (Selection write : model.getWrites(startRow, endRow)) {<NEW_LINE>highlight(gc, yOffset, write);<NEW_LINE>}<NEW_LINE>if (selection != null && selection.isSelectionVisible(startRow, endRow)) {<NEW_LINE>gc.setBackground(theme.memorySelectionHighlight());<NEW_LINE>highlight(gc, yOffset, selection);<NEW_LINE>}<NEW_LINE>gc.setBackground(background);<NEW_LINE>int y = getY(startRow, yOffset);<NEW_LINE>Iterator<Segment> it = <MASK><NEW_LINE>for (; it.hasNext(); y += lineHeight) {<NEW_LINE>Segment segment = it.next();<NEW_LINE>gc.drawString(new String(segment.array, segment.offset, segment.count), 0, y, true);<NEW_LINE>}<NEW_LINE>}
model.getLines(startRow, endRow);
1,591,758
public TypeReference createTypeReference(EclipseNode type, long p, ASTNode source, boolean addWildcards) {<NEW_LINE>int pS = source.sourceStart;<NEW_LINE>int pE = source.sourceEnd;<NEW_LINE>List<String> list = new ArrayList<String>();<NEW_LINE>List<Integer> genericsCount = addWildcards ? new ArrayList<Integer>() : null;<NEW_LINE>list.add(type.getName());<NEW_LINE>if (addWildcards)<NEW_LINE>genericsCount.add(arraySizeOf(((TypeDeclaration) type.get()).typeParameters));<NEW_LINE>boolean staticContext = (((TypeDeclaration) type.get()).modifiers & ClassFileConstants.AccStatic) != 0;<NEW_LINE>EclipseNode tNode = type.up();<NEW_LINE>while (tNode != null && tNode.getKind() == Kind.TYPE) {<NEW_LINE>TypeDeclaration td = (TypeDeclaration) tNode.get();<NEW_LINE>if (td.name == null || td.name.length == 0)<NEW_LINE>break;<NEW_LINE>list.add(tNode.getName());<NEW_LINE>if (!staticContext && tNode.getKind() == Kind.TYPE && (td.modifiers & ClassFileConstants.AccInterface) != 0)<NEW_LINE>staticContext = true;<NEW_LINE>if (addWildcards)<NEW_LINE>genericsCount.add(staticContext ? 0 : arraySizeOf(td.typeParameters));<NEW_LINE>if (!staticContext)<NEW_LINE>staticContext = (td.modifiers & Modifier.STATIC) != 0;<NEW_LINE>tNode = tNode.up();<NEW_LINE>}<NEW_LINE>Collections.reverse(list);<NEW_LINE>if (addWildcards)<NEW_LINE>Collections.reverse(genericsCount);<NEW_LINE>if (list.size() == 1) {<NEW_LINE>if (!addWildcards || genericsCount.get(0) == 0) {<NEW_LINE>return new SingleTypeReference(list.get(0).toCharArray(), p);<NEW_LINE>} else {<NEW_LINE>return new ParameterizedSingleTypeReference(list.get(0).toCharArray(), wildcardify(pS, pE, source, genericsCount.get(0)), 0, p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addWildcards) {<NEW_LINE>addWildcards = false;<NEW_LINE>for (int i : genericsCount) if (i > 0)<NEW_LINE>addWildcards = true;<NEW_LINE>}<NEW_LINE>long[] ps = new long[list.size()];<NEW_LINE>char[][] tokens = new char[list.size()][];<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>ps[i] = p;<NEW_LINE>tokens[i] = list.get(i).toCharArray();<NEW_LINE>}<NEW_LINE>if (!addWildcards)<NEW_LINE><MASK><NEW_LINE>TypeReference[][] typeArgs2 = new TypeReference[tokens.length][];<NEW_LINE>for (int i = 0; i < tokens.length; i++) typeArgs2[i] = wildcardify(pS, pE, source, genericsCount.get(i));<NEW_LINE>return new ParameterizedQualifiedTypeReference(tokens, typeArgs2, 0, ps);<NEW_LINE>}
return new QualifiedTypeReference(tokens, ps);
783,278
final BatchUpsertTableRowsResult executeBatchUpsertTableRows(BatchUpsertTableRowsRequest batchUpsertTableRowsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchUpsertTableRowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchUpsertTableRowsRequest> request = null;<NEW_LINE>Response<BatchUpsertTableRowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchUpsertTableRowsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchUpsertTableRowsRequest));<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, "Honeycode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchUpsertTableRows");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchUpsertTableRowsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchUpsertTableRowsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,669,437
public void onMoveItemEnded(int adapterIndex) {<NEW_LINE>// Fire a "move" event.<NEW_LINE>final TiListView listView = getListView();<NEW_LINE>if ((listView != null) && this.moveEventInfo.isMoving()) {<NEW_LINE>final ListItemProxy targetItemProxy = listView.getAdapterItem(adapterIndex);<NEW_LINE>if (targetItemProxy != null) {<NEW_LINE>final <MASK><NEW_LINE>if (targetParentProxy instanceof ListSectionProxy) {<NEW_LINE>ListSectionProxy targetSectionProxy = (ListSectionProxy) targetParentProxy;<NEW_LINE>KrollDict data = new KrollDict();<NEW_LINE>data.put(TiC.PROPERTY_SECTION, this.moveEventInfo.sectionProxy);<NEW_LINE>data.put(TiC.PROPERTY_SECTION_INDEX, this.moveEventInfo.sectionIndex);<NEW_LINE>data.put(TiC.PROPERTY_ITEM_INDEX, this.moveEventInfo.itemIndex);<NEW_LINE>data.put(TiC.PROPERTY_TARGET_SECTION, targetSectionProxy);<NEW_LINE>data.put(TiC.PROPERTY_TARGET_SECTION_INDEX, getIndexOfSection(targetSectionProxy));<NEW_LINE>data.put(TiC.PROPERTY_TARGET_ITEM_INDEX, targetItemProxy.getIndexInSection());<NEW_LINE>targetItemProxy.fireEvent(TiC.EVENT_MOVE, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Clear last "move" event info.<NEW_LINE>this.moveEventInfo.clear();<NEW_LINE>}
TiViewProxy targetParentProxy = targetItemProxy.getParent();
148,016
private void performBundleAdjustment(Se3_F64 key_to_curr) {<NEW_LINE>if (bundle.configConverge.maxIterations <= 0)<NEW_LINE>return;<NEW_LINE>// Must only process inlier tracks here<NEW_LINE>inliers.clear();<NEW_LINE>for (int trackIdx = 0; trackIdx < consistentTracks.size(); trackIdx++) {<NEW_LINE>TrackQuad t = consistentTracks.get(trackIdx);<NEW_LINE>if (t.leftCurrIndex != -1 && t.inlier)<NEW_LINE>inliers.add(t);<NEW_LINE>}<NEW_LINE>// Copy the scene into a data structure bundle adjustment understands<NEW_LINE>SceneStructureMetric structure = bundle.getStructure();<NEW_LINE>SceneObservations observations = bundle.getObservations();<NEW_LINE>observations.initialize(4);<NEW_LINE>structure.initialize(2, 4, inliers.size());<NEW_LINE>// known relative view relating left to right cameras<NEW_LINE>int baseline = structure.addMotion(true, left_to_right);<NEW_LINE>structure.setCamera(0, true, stereoParameters.left);<NEW_LINE>structure.setCamera(1, true, stereoParameters.right);<NEW_LINE>// view[0].left<NEW_LINE>structure.setView(0, 0, true, listWorldToView.get(0));<NEW_LINE>// view[0].right<NEW_LINE>structure.setView(1, 1, baseline, 0);<NEW_LINE>// view[1].left<NEW_LINE>structure.setView(2, 0, false, listWorldToView.get(2));<NEW_LINE>// view[1].right<NEW_LINE>structure.setView(<MASK><NEW_LINE>for (int trackIdx = 0; trackIdx < inliers.size(); trackIdx++) {<NEW_LINE>TrackQuad t = inliers.get(trackIdx);<NEW_LINE>Point3D_F64 X = t.X;<NEW_LINE>structure.setPoint(trackIdx, X.x, X.y, X.z);<NEW_LINE>observations.getView(0).add(trackIdx, (float) t.v0.x, (float) t.v0.y);<NEW_LINE>observations.getView(1).add(trackIdx, (float) t.v1.x, (float) t.v1.y);<NEW_LINE>observations.getView(2).add(trackIdx, (float) t.v2.x, (float) t.v2.y);<NEW_LINE>observations.getView(3).add(trackIdx, (float) t.v3.x, (float) t.v3.y);<NEW_LINE>}<NEW_LINE>if (!bundle.process())<NEW_LINE>return;<NEW_LINE>// Update the state of tracks and the current views<NEW_LINE>for (int trackIdx = 0; trackIdx < inliers.size(); trackIdx++) {<NEW_LINE>TrackQuad t = inliers.get(trackIdx);<NEW_LINE>structure.points.get(trackIdx).get(t.X);<NEW_LINE>}<NEW_LINE>// Reminder: World here refers to key left view<NEW_LINE>key_to_curr.setTo(structure.getParentToView(2));<NEW_LINE>}
3, 1, baseline, 2);
935,117
private static boolean checkJREVersion() {<NEW_LINE>String <MASK><NEW_LINE>if (JREVersion != null) {<NEW_LINE>try {<NEW_LINE>// We're only interested in the big decimal part of the JRE version<NEW_LINE>int version = Integer.parseInt(JREVersion.split("\\.")[0]);<NEW_LINE>if (IntStream.of(Application.SUPPORTED_JRE_VERSIONS).noneMatch(c -> c == version)) {<NEW_LINE>String title = "Unsupported Java version";<NEW_LINE>String message1 = "Unsupported Java version: %s";<NEW_LINE>String message2 = "Supported version(s): %s";<NEW_LINE>String message3 = "Please change the Java Runtime Environment version or install OpenRocket using a packaged installer.";<NEW_LINE>StringBuilder message = new StringBuilder();<NEW_LINE>message.append(String.format(message1, JREVersion));<NEW_LINE>message.append("\n");<NEW_LINE>String[] supported = Arrays.stream(Application.SUPPORTED_JRE_VERSIONS).mapToObj(String::valueOf).toArray(String[]::new);<NEW_LINE>message.append(String.format(message2, String.join(", ", supported)));<NEW_LINE>message.append("\n\n");<NEW_LINE>message.append(message3);<NEW_LINE>JOptionPane.showMessageDialog(null, message.toString(), title, JOptionPane.ERROR_MESSAGE);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Malformed JRE version - " + JREVersion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
JREVersion = System.getProperty("java.version");
1,209,692
public void prepare(Map<String, Object> stormConf, TopologyContext context, OutputCollector collector) {<NEW_LINE>super.prepare(stormConf, context, collector);<NEW_LINE>partitioner = new URLPartitioner();<NEW_LINE>partitioner.configure(stormConf);<NEW_LINE>this.eventCounter = context.registerMetric("counter", new MultiCountMetric(), 10);<NEW_LINE>tableName = ConfUtils.getString(stormConf, Constants.SQL_STATUS_TABLE_PARAM_NAME, "urls");<NEW_LINE>batchMaxSize = ConfUtils.getInt(stormConf, Constants.SQL_UPDATE_BATCH_SIZE_PARAM_NAME, 1000);<NEW_LINE>try {<NEW_LINE>connection = SQLUtil.getConnection(stormConf);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>LOG.error(ex.getMessage(), ex);<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>String query = tableName + " (url, status, nextfetchdate, metadata, bucket, host)" + " values (?, ?, ?, ?, ?, ?)";<NEW_LINE>updateQuery = "REPLACE INTO " + query;<NEW_LINE>insertQuery = "INSERT IGNORE INTO " + query;<NEW_LINE>try {<NEW_LINE>insertPreparedStmt = connection.prepareStatement(insertQuery);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();<NEW_LINE>executor.scheduleAtFixedRate(() -> {<NEW_LINE>try {<NEW_LINE>checkExecuteBatch();<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}, 0, 1, TimeUnit.SECONDS);<NEW_LINE>}
ex.getMessage(), ex);
1,743,942
public void onProcessPlayer(ProcessPlayerEvent event) {<NEW_LINE>Player player = event.getPlayer();<NEW_LINE>LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);<NEW_LINE>Session session = WorldGuard.getInstance().getPlatform().<MASK><NEW_LINE>if (hasGodModeGroup(player) || hasGodModePermission(player)) {<NEW_LINE>if (GodMode.set(localPlayer, session, true)) {<NEW_LINE>log.log(Level.INFO, "Enabled auto-god mode for " + player.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasAmphibiousGroup(player)) {<NEW_LINE>if (WaterBreathing.set(localPlayer, session, true)) {<NEW_LINE>log.log(Level.INFO, "Enabled water breathing mode for " + player.getName() + " (player is in group 'wg-amphibious')");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getSessionManager().get(localPlayer);
1,375,689
private void generatePlugins(File output) throws BuildException, IOException {<NEW_LINE>Set<String> standardClusters = new HashSet<>();<NEW_LINE>String standardClustersS = getProject().getProperty("clusters.config.full.list");<NEW_LINE>if (standardClustersS != null) {<NEW_LINE>for (String clusterProp : standardClustersS.split(",")) {<NEW_LINE>String dir = getProject().getProperty(clusterProp + ".dir");<NEW_LINE>if (dir != null) {<NEW_LINE>standardClusters.add(dir.replaceFirst("[0-9.]+$", ""));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (FileWriter fw = new FileWriter(output)) {<NEW_LINE>PrintWriter w = new PrintWriter(fw);<NEW_LINE>SortedMap<String, String> lines = new TreeMap<>(Collator.getInstance());<NEW_LINE>lines.put("A", "||Code Name Base||Display Name||Display Category||Standard Cluster");<NEW_LINE>lines.put("C", "");<NEW_LINE><MASK><NEW_LINE>for (ModuleInfo m : modules) {<NEW_LINE>if (regexp != null && !regexp.matcher(m.group).matches()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (m.showInAutoupdate) {<NEW_LINE>lines.put((standardClusters.contains(m.group) ? "B" : "E") + m.displayCategory + " " + m.displayName, "|" + m.codebasename + "|" + m.displayName + "|" + m.displayCategory + "|" + m.group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String line : lines.values()) {<NEW_LINE>w.println(line);<NEW_LINE>}<NEW_LINE>w.flush();<NEW_LINE>}<NEW_LINE>}
lines.put("D", "||Code Name Base||Display Name||Display Category||Extra Cluster");
1,553,039
public void dragStart(DragSourceEvent event) {<NEW_LINE>event.doit = true;<NEW_LINE>if (!(event.widget instanceof DragSource)) {<NEW_LINE>event.doit = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TableView<?> tv = (TableView<?>) ((DragSource) event.widget).getData("tv");<NEW_LINE>// drag start happens a bit after the mouse moves, so the<NEW_LINE>// cursor location isn't accurate<NEW_LINE>// Point cursorLocation = event.display.getCursorLocation();<NEW_LINE>// cursorLocation = tv.getTableComposite().toControl(cursorLocation);<NEW_LINE>// TableRowCore row = tv.getRow(cursorLocation.x, cursorLocation.y);<NEW_LINE>// System.out.println("" + event.x + ";" + event.y + "/" + cursorLocation);<NEW_LINE>// event.x and y doesn't always return correct values!<NEW_LINE>// TableRowCore row = tv.getRow(event.x, event.y);<NEW_LINE>TableRowCore row = tv.getFocusedRow();<NEW_LINE>if (row == null) {<NEW_LINE>event.doit = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>tableColumn = (TableColumnCore) row.getDataSource();<NEW_LINE>if (event.image != null && !Constants.isLinux) {<NEW_LINE>try {<NEW_LINE>GC gc <MASK><NEW_LINE>try {<NEW_LINE>Rectangle bounds = event.image.getBounds();<NEW_LINE>gc.fillRectangle(bounds);<NEW_LINE>String title = MessageText.getString(tableColumn.getTitleLanguageKey(), tableColumn.getName());<NEW_LINE>String s = title + " Column will be placed at the location you drop it, shifting other columns down";<NEW_LINE>GCStringPrinter sp = new GCStringPrinter(gc, s, bounds, false, false, SWT.CENTER | SWT.WRAP);<NEW_LINE>sp.calculateMetrics();<NEW_LINE>if (sp.isCutoff()) {<NEW_LINE>GCStringPrinter.printString(gc, title, bounds, false, false, SWT.CENTER | SWT.WRAP);<NEW_LINE>} else {<NEW_LINE>sp.printString();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>gc.dispose();<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new GC(event.image);
212,736
public void testObservableRxInvoker_postCbReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.<MASK><NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(ObservableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Observable<Response> observable = builder.rx(ObservableRxInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testObservableRxInvoker_postCbReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testObservableRxInvoker_postCbReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
readTimeout(TIMEOUT, TimeUnit.MILLISECONDS);
1,396,619
public static void main(String[] args) {<NEW_LINE>SegmentTreeMinimumRangeQuery st = new SegmentTreeMinimumRangeQuery();<NEW_LINE>int[] input = { 0, 3, 4, 2, 1, 6, -1 };<NEW_LINE>int[] segTree = st.createSegmentTree(input);<NEW_LINE>// non lazy propagation example<NEW_LINE>assert 0 == st.rangeMinimumQuery(segTree, <MASK><NEW_LINE>assert 1 == st.rangeMinimumQuery(segTree, 1, 5, input.length);<NEW_LINE>assert -1 == st.rangeMinimumQuery(segTree, 1, 6, input.length);<NEW_LINE>st.updateSegmentTree(input, segTree, 2, 1);<NEW_LINE>assert 2 == st.rangeMinimumQuery(segTree, 1, 3, input.length);<NEW_LINE>st.updateSegmentTreeRange(input, segTree, 3, 5, -2);<NEW_LINE>assert -1 == st.rangeMinimumQuery(segTree, 5, 6, input.length);<NEW_LINE>assert 0 == st.rangeMinimumQuery(segTree, 0, 3, input.length);<NEW_LINE>// lazy propagation example<NEW_LINE>int[] input1 = { -1, 2, 4, 1, 7, 1, 3, 2 };<NEW_LINE>int[] segTree1 = st.createSegmentTree(input1);<NEW_LINE>int[] lazy1 = new int[segTree.length];<NEW_LINE>st.updateSegmentTreeRangeLazy(input1, segTree1, lazy1, 0, 3, 1);<NEW_LINE>st.updateSegmentTreeRangeLazy(input1, segTree1, lazy1, 0, 0, 2);<NEW_LINE>assert 1 == st.rangeMinimumQueryLazy(segTree1, lazy1, 3, 5, input1.length);<NEW_LINE>}
0, 3, input.length);
1,794,565
private void checkClassName(String name) {<NEW_LINE>boolean bogus = false;<NEW_LINE>if (name.startsWith("java/")) {<NEW_LINE>bogus = true;<NEW_LINE>} else if (name.startsWith("javax/")) {<NEW_LINE>int slashAt = <MASK><NEW_LINE>if (slashAt == -1) {<NEW_LINE>// Top-level javax classes are verboten.<NEW_LINE>bogus = true;<NEW_LINE>} else {<NEW_LINE>String pkg = name.substring(6, slashAt);<NEW_LINE>bogus = (Arrays.binarySearch(JAVAX_CORE, pkg) >= 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!bogus) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DxConsole.err.println("\ntrouble processing \"" + name + "\":\n\n" + IN_RE_CORE_CLASSES);<NEW_LINE>errors.incrementAndGet();<NEW_LINE>throw new StopProcessing();<NEW_LINE>}
name.indexOf('/', 6);
1,827,806
public StopDominantLanguageDetectionJobResult stopDominantLanguageDetectionJob(StopDominantLanguageDetectionJobRequest stopDominantLanguageDetectionJobRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopDominantLanguageDetectionJobRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopDominantLanguageDetectionJobRequest> request = null;<NEW_LINE>Response<StopDominantLanguageDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopDominantLanguageDetectionJobRequestMarshaller().marshall(stopDominantLanguageDetectionJobRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<StopDominantLanguageDetectionJobResult, JsonUnmarshallerContext> unmarshaller = new StopDominantLanguageDetectionJobResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<StopDominantLanguageDetectionJobResult> responseHandler = new JsonResponseHandler<StopDominantLanguageDetectionJobResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,809,671
private JSONObject convertPostedTweetToJSON(StatusUpdate statusUpdate) throws JSONException {<NEW_LINE>Context context = getActivity();<NEW_LINE>String id = statusUpdate.getIdStr();<NEW_LINE>StatusEntities entities = statusUpdate.getExtendedEntities();<NEW_LINE>List<String> images = new ArrayList<>();<NEW_LINE>// get image links if the posted tweet has images<NEW_LINE>if (entities != null) {<NEW_LINE>List<MediaEntity> mediaEntityList = entities.getMediaList();<NEW_LINE>if (mediaEntityList != null) {<NEW_LINE>List<String> mediaLinks = new ArrayList<>();<NEW_LINE>for (MediaEntity mediaEntity : mediaEntityList) {<NEW_LINE>mediaLinks.add(mediaEntity.getMediaUrlHttps());<NEW_LINE>}<NEW_LINE>images = mediaLinks;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String name = SharedPrefUtil.getSharedPrefString(context, USER_NAME);<NEW_LINE>String screenName = SharedPrefUtil.getSharedPrefString(context, USER_SCREEN_NAME);<NEW_LINE>String userId = SharedPrefUtil.getSharedPrefString(context, USER_ID);<NEW_LINE>String profileImageUrl = SharedPrefUtil.getSharedPrefString(context, USER_PROFILE_IMAGE_URL);<NEW_LINE>String link = "https://twitter.com/" + screenName + "status/" + id;<NEW_LINE>long createdAt = System.currentTimeMillis();<NEW_LINE>long timeStamp = System.currentTimeMillis();<NEW_LINE>String text = statusUpdate.getText();<NEW_LINE><MASK><NEW_LINE>String date = new DateTime(DateTimeZone.UTC).toString();<NEW_LINE>User user = new User(name, screenName, profileImageUrl, userId, date, date);<NEW_LINE>Status status = new Status(user, screenName, link, createdAt, timeStamp, text, id, retweetCount);<NEW_LINE>status.setImages(images);<NEW_LINE>if (mLatitude != null && mLongitude != null) {<NEW_LINE>status.setLocationPoint(mLatitude, mLongitude);<NEW_LINE>}<NEW_LINE>List<Status> statuses = new ArrayList<>();<NEW_LINE>statuses.add(status);<NEW_LINE>Gson gson = Utility.getGsonForPrivateVariableClass();<NEW_LINE>String data = gson.toJson(statuses);<NEW_LINE>JSONArray jsonArray = new JSONArray(data);<NEW_LINE>JSONObject jsonObject = new JSONObject();<NEW_LINE>jsonObject.put("statuses", jsonArray);<NEW_LINE>return jsonObject;<NEW_LINE>}
int retweetCount = statusUpdate.getRetweetCount();
823,515
public void reduce_trace_shape_at_tie_pin(Pin p_tie_pin, PolylineTrace p_trace) {<NEW_LINE>TileShape pin_shape = p_tie_pin.get_tree_shape_on_layer(this, p_trace.get_layer());<NEW_LINE>FloatPoint compare_corner;<NEW_LINE>int trace_shape_no;<NEW_LINE>if (p_trace.first_corner().equals(p_tie_pin.get_center())) {<NEW_LINE>trace_shape_no = 0;<NEW_LINE>compare_corner = p_trace.<MASK><NEW_LINE>} else if (p_trace.last_corner().equals(p_tie_pin.get_center())) {<NEW_LINE>trace_shape_no = p_trace.corner_count() - 2;<NEW_LINE>compare_corner = p_trace.polyline().corner_approx(p_trace.corner_count() - 2);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TileShape trace_shape = p_trace.get_tree_shape(this, trace_shape_no);<NEW_LINE>TileShape intersection = trace_shape.intersection(pin_shape);<NEW_LINE>if (intersection.dimension() < 2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TileShape[] shape_pieces = trace_shape.cutout(pin_shape);<NEW_LINE>TileShape new_trace_shape = Simplex.EMPTY;<NEW_LINE>for (int i = 0; i < shape_pieces.length; ++i) {<NEW_LINE>if (shape_pieces[i].dimension() == 2) {<NEW_LINE>if (new_trace_shape == Simplex.EMPTY || shape_pieces[i].contains(compare_corner)) {<NEW_LINE>new_trace_shape = shape_pieces[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>change_item_shape(p_trace, trace_shape_no, new_trace_shape);<NEW_LINE>}
polyline().corner_approx(1);
705,644
public void toDebugTreeNode(final StringBuilder buffer, final String indent) {<NEW_LINE>Coordinate[] relCoords = this.getInstanceOffsets();<NEW_LINE>Coordinate[] absCoords = this.getComponentLocations();<NEW_LINE>if (1 == getInstanceCount()) {<NEW_LINE>buffer.append(String.format("%-40s| %5.3f; %24s; %24s;", indent + this.getName() + " (# " + this.getStageNumber() + ")", this.getLength(), this.getPosition(), this.getComponentLocations()[0]));<NEW_LINE>buffer.append(String.format("len: %6.4f )(offset: %4.1f via: %s )\n", this.getLength(), this.getAxialOffset(), this<MASK><NEW_LINE>} else {<NEW_LINE>buffer.append(String.format("%-40s|(len: %6.4f )(offset: %4.1f via: %s)\n", (indent + this.getName() + "(# " + this.getStageNumber() + ")"), this.getLength(), this.getAxialOffset(), this.axialMethod.name()));<NEW_LINE>for (int instanceNumber = 0; instanceNumber < this.getInstanceCount(); instanceNumber++) {<NEW_LINE>Coordinate instanceRelativePosition = relCoords[instanceNumber];<NEW_LINE>Coordinate instanceAbsolutePosition = absCoords[instanceNumber];<NEW_LINE>final String prefix = String.format("%s [%2d/%2d]", indent, instanceNumber + 1, getInstanceCount());<NEW_LINE>buffer.append(String.format("%-40s| %5.3f; %24s; %24s;\n", prefix, this.getLength(), instanceRelativePosition, instanceAbsolutePosition));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.axialMethod.name()));
283,756
public // Matrix is in row-major form and compatible with SkMatrix.<NEW_LINE>void transform(float[] matrix) {<NEW_LINE>checkState(matrix.length == 9);<NEW_LINE>// The tricky part of this implementation is to preserve the value of<NEW_LINE>// rawX and rawY. So we apply the transformation to the first point<NEW_LINE>// then derive an appropriate new X/Y offset that will preserve rawX<NEW_LINE>// and rawY for that point.<NEW_LINE>float oldXOffset = mXOffset;<NEW_LINE>float oldYOffset = mYOffset;<NEW_LINE>final Ref<Float> newX = new Ref<>(0f);<NEW_LINE>final Ref<Float> newY = new Ref<>(0f);<NEW_LINE>float rawX = getRawX(0);<NEW_LINE>float rawY = getRawY(0);<NEW_LINE>transformPoint(matrix, rawX + oldXOffset, rawY + oldYOffset, newX, newY);<NEW_LINE>mXOffset = newX.get() - rawX;<NEW_LINE>mYOffset = newY.get() - rawY;<NEW_LINE>// Determine how the origin is transformed by the matrix so that we<NEW_LINE>// can transform orientation vectors.<NEW_LINE>final Ref<Float> originX = new Ref<>(0f);<NEW_LINE>final Ref<Float> originY = new Ref<>(0f);<NEW_LINE>transformPoint(matrix, <MASK><NEW_LINE>// Apply the transformation to all samples.<NEW_LINE>int numSamples = mSamplePointerCoords.size();<NEW_LINE>for (int i = 0; i < numSamples; i++) {<NEW_LINE>PointerCoords c = mSamplePointerCoords.get(i);<NEW_LINE>final Ref<Float> x = new Ref<>(c.getAxisValue(AMOTION_EVENT_AXIS_X) + oldXOffset);<NEW_LINE>final Ref<Float> y = new Ref<>(c.getAxisValue(AMOTION_EVENT_AXIS_Y) + oldYOffset);<NEW_LINE>transformPoint(matrix, x.get(), y.get(), x, y);<NEW_LINE>c.setAxisValue(AMOTION_EVENT_AXIS_X, x.get() - mXOffset);<NEW_LINE>c.setAxisValue(AMOTION_EVENT_AXIS_Y, y.get() - mYOffset);<NEW_LINE>float orientation = c.getAxisValue(AMOTION_EVENT_AXIS_ORIENTATION);<NEW_LINE>c.setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, transformAngle(matrix, orientation, originX.get(), originY.get()));<NEW_LINE>}<NEW_LINE>}
0, 0, originX, originY);
641,533
private void executeTest(String testName, CommandLineProgramTester testClass, String args, Class<?> expectedException) {<NEW_LINE>String[] command = Utils.escapeExpressions(args);<NEW_LINE>// run the executable<NEW_LINE>boolean gotAnException = false;<NEW_LINE>try {<NEW_LINE>final String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss"));<NEW_LINE>System.out.println(String.format("[%s] Executing test %s:%s", now, testClass.getClass().getSimpleName(), testName));<NEW_LINE>testClass.runCommandLine(command);<NEW_LINE>} catch (Exception e) {<NEW_LINE>gotAnException = true;<NEW_LINE>if (expectedException == null) {<NEW_LINE>// we didn't expect an exception but we got one :-(<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// we expect an exception<NEW_LINE>if (!expectedException.isInstance(e)) {<NEW_LINE>final String message = String.format("Test %s:%s expected exception %s but instead got %s with error message %s", testClass, testName, expectedException, e.getClass(), e.getMessage());<NEW_LINE>if (e.getCause() != null) {<NEW_LINE>final ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>final PrintStream ps = new PrintStream(baos);<NEW_LINE>e.getCause().printStackTrace(ps);<NEW_LINE>BaseTest.log(message);<NEW_LINE>BaseTest.log(baos.toString());<NEW_LINE>}<NEW_LINE>Assert.fail(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expectedException != null && !gotAnException) {<NEW_LINE>// we expected an exception but didn't see it<NEW_LINE>Assert.fail(String.format("Test %s:%s expected exception %s but none was thrown", testClass.getClass().getSimpleName(), testName<MASK><NEW_LINE>}<NEW_LINE>}
, expectedException.toString()));
1,398,858
private static Object readValue(PacketStream input, JDWPContext context) {<NEW_LINE>byte valueKind = input.readByte();<NEW_LINE>switch(valueKind) {<NEW_LINE>case TagConstants.VOID:<NEW_LINE>return Void.TYPE;<NEW_LINE>case TagConstants.BOOLEAN:<NEW_LINE>return input.readBoolean();<NEW_LINE>case TagConstants.BYTE:<NEW_LINE>return input.readByte();<NEW_LINE>case TagConstants.SHORT:<NEW_LINE>return input.readShort();<NEW_LINE>case TagConstants.CHAR:<NEW_LINE>return input.readChar();<NEW_LINE>case TagConstants.INT:<NEW_LINE>return input.readInt();<NEW_LINE>case TagConstants.FLOAT:<NEW_LINE>return input.readFloat();<NEW_LINE>case TagConstants.LONG:<NEW_LINE>return input.readLong();<NEW_LINE>case TagConstants.DOUBLE:<NEW_LINE>return input.readDouble();<NEW_LINE>case TagConstants.ARRAY:<NEW_LINE>case TagConstants.STRING:<NEW_LINE>case TagConstants.OBJECT:<NEW_LINE>case TagConstants.THREAD:<NEW_LINE>case TagConstants.THREAD_GROUP:<NEW_LINE>case TagConstants.CLASS_LOADER:<NEW_LINE>case TagConstants.CLASS_OBJECT:<NEW_LINE>return context.getIds().fromId((<MASK><NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Should not reach here!");<NEW_LINE>}<NEW_LINE>}
int) input.readLong());
587,675
public Builder mergeFrom(net.osmand.binary.OsmandOdb.OsmAndPoiBoxData other) {<NEW_LINE>if (other == net.osmand.binary.OsmandOdb.OsmAndPoiBoxData.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasZoom()) {<NEW_LINE>setZoom(other.getZoom());<NEW_LINE>}<NEW_LINE>if (other.hasX()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (other.hasY()) {<NEW_LINE>setY(other.getY());<NEW_LINE>}<NEW_LINE>if (poiDataBuilder_ == null) {<NEW_LINE>if (!other.poiData_.isEmpty()) {<NEW_LINE>if (poiData_.isEmpty()) {<NEW_LINE>poiData_ = other.poiData_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>} else {<NEW_LINE>ensurePoiDataIsMutable();<NEW_LINE>poiData_.addAll(other.poiData_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.poiData_.isEmpty()) {<NEW_LINE>if (poiDataBuilder_.isEmpty()) {<NEW_LINE>poiDataBuilder_.dispose();<NEW_LINE>poiDataBuilder_ = null;<NEW_LINE>poiData_ = other.poiData_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>poiDataBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPoiDataFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>poiDataBuilder_.addAllMessages(other.poiData_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>}
setX(other.getX());
1,837,626
final DeleteDeploymentResult executeDeleteDeployment(DeleteDeploymentRequest deleteDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDeploymentRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDeploymentRequest> request = null;<NEW_LINE>Response<DeleteDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDeploymentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDeploymentRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDeployment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDeploymentResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,744,200
public static Map create(int size, float loadFactor, int concurrencyLevel, boolean allowNullKeys) {<NEW_LINE>Map map = null;<NEW_LINE>if (concurrencyLevel <= 1) {<NEW_LINE>map <MASK><NEW_LINE>} else {<NEW_LINE>if (concurrentHashMapConstructor != null) {<NEW_LINE>// running under JRE 1.5+<NEW_LINE>try {<NEW_LINE>map = (Map) concurrentHashMapConstructor.newInstance(new Object[] { new Integer(size), new Float(loadFactor), new Integer(concurrencyLevel) });<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException("this should not happen", ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (allowNullKeys) {<NEW_LINE>map = Collections.synchronizedMap(new HashMap(size, loadFactor));<NEW_LINE>} else {<NEW_LINE>map = new Hashtable(size, loadFactor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
= new HashMap(size, loadFactor);
224,307
protected List<Element> expandNetUri(Document doc, String s) {<NEW_LINE>ArrayList<Element> exp = new ArrayList<Element>();<NEW_LINE>Matcher reMatcher = reNetUri.matcher(s);<NEW_LINE>if (!reMatcher.find())<NEW_LINE>return null;<NEW_LINE>String domain = reMatcher.group(1);<NEW_LINE>exp.addAll(expandDomain(doc, domain));<NEW_LINE>String <MASK><NEW_LINE>if (path != null && path.length() > 0) {<NEW_LINE>// true = sayPunctuation<NEW_LINE>String pathExpanded = abbrev.ruleExpandAbbrev(path, true);<NEW_LINE>// create mtu<NEW_LINE>exp.// create mtu<NEW_LINE>addAll(// create mtu<NEW_LINE>makeNewTokens(// create mtu<NEW_LINE>doc, // create mtu<NEW_LINE>pathExpanded, // force accents<NEW_LINE>true, // force accents<NEW_LINE>path, true));<NEW_LINE>exp.add(MaryDomUtils.createBoundary(doc));<NEW_LINE>}<NEW_LINE>return exp;<NEW_LINE>}
path = reMatcher.group(2);
1,569,946
final ListVoiceConnectorTerminationCredentialsResult executeListVoiceConnectorTerminationCredentials(ListVoiceConnectorTerminationCredentialsRequest listVoiceConnectorTerminationCredentialsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVoiceConnectorTerminationCredentialsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVoiceConnectorTerminationCredentialsRequest> request = null;<NEW_LINE>Response<ListVoiceConnectorTerminationCredentialsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVoiceConnectorTerminationCredentialsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listVoiceConnectorTerminationCredentialsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVoiceConnectorTerminationCredentials");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListVoiceConnectorTerminationCredentialsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListVoiceConnectorTerminationCredentialsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
254,456
private Expression evaluateArgumentExpressions(AST ast, ITypeBinding requiredType, String key) {<NEW_LINE>CompilationUnit root = (CompilationUnit) fCallerNode.getRoot();<NEW_LINE><MASK><NEW_LINE>Expression best = null;<NEW_LINE>ITypeBinding bestType = null;<NEW_LINE>ScopeAnalyzer analyzer = new ScopeAnalyzer(root);<NEW_LINE>IBinding[] bindings = analyzer.getDeclarationsInScope(offset, ScopeAnalyzer.VARIABLES);<NEW_LINE>for (int i = 0; i < bindings.length; i++) {<NEW_LINE>IVariableBinding curr = (IVariableBinding) bindings[i];<NEW_LINE>ITypeBinding type = curr.getType();<NEW_LINE>if (type != null && canAssign(type, requiredType) && testModifier(curr)) {<NEW_LINE>if (best == null || isMoreSpecific(bestType, type)) {<NEW_LINE>best = ast.newSimpleName(curr.getName());<NEW_LINE>bestType = type;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Expression defaultExpression = ASTNodeFactory.newDefaultExpression(ast, requiredType);<NEW_LINE>if (best == null) {<NEW_LINE>best = defaultExpression;<NEW_LINE>}<NEW_LINE>return best;<NEW_LINE>}
int offset = fCallerNode.getStartPosition();
1,145,926
private void passwordProtectPDF() {<NEW_LINE>final MaterialDialog dialog = new MaterialDialog.Builder(mActivity).title(R.string.set_password).customView(R.layout.custom_dialog, true).positiveText(android.R.string.ok).negativeText(android.R.string.cancel).neutralText(R.string.remove_dialog).build();<NEW_LINE>final View positiveAction = dialog.getActionButton(DialogAction.POSITIVE);<NEW_LINE>final View neutralAction = <MASK><NEW_LINE>final EditText passwordInput = dialog.getCustomView().findViewById(R.id.password);<NEW_LINE>passwordInput.setText(mPdfOptions.getPassword());<NEW_LINE>passwordInput.addTextChangedListener(new DefaultTextWatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTextChanged(CharSequence s, int start, int before, int count) {<NEW_LINE>positiveAction.setEnabled(s.toString().trim().length() > 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>positiveAction.setOnClickListener(v -> {<NEW_LINE>if (StringUtils.getInstance().isEmpty(passwordInput.getText())) {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.snackbar_password_cannot_be_blank);<NEW_LINE>} else {<NEW_LINE>mPdfOptions.setPassword(passwordInput.getText().toString());<NEW_LINE>mPdfOptions.setPasswordProtected(true);<NEW_LINE>showEnhancementOptions();<NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (StringUtils.getInstance().isNotEmpty(mPdfOptions.getPassword())) {<NEW_LINE>neutralAction.setOnClickListener(v -> {<NEW_LINE>mPdfOptions.setPassword(null);<NEW_LINE>mPdfOptions.setPasswordProtected(false);<NEW_LINE>showEnhancementOptions();<NEW_LINE>dialog.dismiss();<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.password_remove);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>dialog.show();<NEW_LINE>positiveAction.setEnabled(false);<NEW_LINE>}
dialog.getActionButton(DialogAction.NEUTRAL);
1,419,672
private Optional<ErrorResponse> responseFor(DiscFilterRequest request, String ruleName, ErrorResponse response) {<NEW_LINE>int statusCode = response != null ? response.getResponse<MASK><NEW_LINE>Metric.Context metricContext = metric.createContext(Map.of("rule", ruleName, "dryrun", Boolean.toString(dryrun), "statusCode", Integer.toString(statusCode)));<NEW_LINE>if (response != null) {<NEW_LINE>metric.add("jdisc.http.filter.rule.blocked_requests", 1L, metricContext);<NEW_LINE>log.log(Level.FINE, () -> String.format("Blocking request '%h' with status code '%d' using rule '%s' (dryrun=%b)", request, statusCode, ruleName, dryrun));<NEW_LINE>return dryrun ? Optional.empty() : Optional.of(response);<NEW_LINE>} else {<NEW_LINE>metric.add("jdisc.http.filter.rule.allowed_requests", 1L, metricContext);<NEW_LINE>log.log(Level.FINE, () -> String.format("Allowing request '%h' using rule '%s' (dryrun=%b)", request, ruleName, dryrun));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
().getStatus() : 0;
1,343,611
private OHashTable.BucketPath nextBucketToFind(final OHashTable.BucketPath bucketPath, final int bucketDepth, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>int offset = bucketPath.nodeGlobalDepth - bucketDepth;<NEW_LINE>OHashTable.BucketPath currentNode = bucketPath;<NEW_LINE>int nodeLocalDepth = directory.getNodeLocalDepth(bucketPath.nodeIndex, atomicOperation);<NEW_LINE>assert directory.getNodeLocalDepth(bucketPath.<MASK><NEW_LINE>while (offset > 0) {<NEW_LINE>offset -= nodeLocalDepth;<NEW_LINE>if (offset > 0) {<NEW_LINE>currentNode = bucketPath.parent;<NEW_LINE>nodeLocalDepth = currentNode.nodeLocalDepth;<NEW_LINE>assert directory.getNodeLocalDepth(currentNode.nodeIndex, atomicOperation) == currentNode.nodeLocalDepth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int diff = bucketDepth - (currentNode.nodeGlobalDepth - nodeLocalDepth);<NEW_LINE>final int interval = (1 << (nodeLocalDepth - diff));<NEW_LINE>final int firstStartIndex = currentNode.itemIndex & ((LEVEL_MASK << (nodeLocalDepth - diff)) & LEVEL_MASK);<NEW_LINE>final OHashTable.BucketPath bucketPathToFind;<NEW_LINE>final int globalIndex = firstStartIndex + interval + currentNode.hashMapOffset;<NEW_LINE>if (globalIndex >= MAX_LEVEL_SIZE) {<NEW_LINE>bucketPathToFind = nextLevelUp(currentNode, atomicOperation);<NEW_LINE>} else {<NEW_LINE>final int hashMapSize = 1 << currentNode.nodeLocalDepth;<NEW_LINE>final int hashMapOffset = globalIndex / hashMapSize * hashMapSize;<NEW_LINE>final int startIndex = globalIndex - hashMapOffset;<NEW_LINE>bucketPathToFind = new OHashTable.BucketPath(currentNode.parent, hashMapOffset, startIndex, currentNode.nodeIndex, currentNode.nodeLocalDepth, currentNode.nodeGlobalDepth);<NEW_LINE>}<NEW_LINE>return nextNonEmptyNode(bucketPathToFind, atomicOperation);<NEW_LINE>}
nodeIndex, atomicOperation) == bucketPath.nodeLocalDepth;
1,636,952
public static Request fromXContent(final XContentParser parser, TimeValue timeout) throws IOException {<NEW_LINE>Map<String, Object> content = parser.map();<NEW_LINE>// dest.index is not required for _preview, so we just supply our own<NEW_LINE>Map<String, String> tempDestination = new HashMap<>();<NEW_LINE>tempDestination.put(DestConfig.INDEX.getPreferredName(), DUMMY_DEST_INDEX_FOR_PREVIEW);<NEW_LINE>// Users can still provide just dest.pipeline to preview what their data would look like given the pipeline ID<NEW_LINE>Object providedDestination = content.get(TransformField.DESTINATION.getPreferredName());<NEW_LINE>if (providedDestination instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, String> providedDestinationAsMap = (Map<String, String>) providedDestination;<NEW_LINE>tempDestination.putAll(providedDestinationAsMap);<NEW_LINE>}<NEW_LINE>content.put(TransformField.<MASK><NEW_LINE>content.putIfAbsent(TransformField.ID.getPreferredName(), "transform-preview");<NEW_LINE>try (XContentBuilder xContentBuilder = XContentFactory.jsonBuilder().map(content);<NEW_LINE>XContentParser newParser = XContentType.JSON.xContent().createParser(parser.getXContentRegistry(), LoggingDeprecationHandler.INSTANCE, BytesReference.bytes(xContentBuilder).streamInput())) {<NEW_LINE>return new Request(TransformConfig.fromXContent(newParser, null, false), timeout);<NEW_LINE>}<NEW_LINE>}
DESTINATION.getPreferredName(), tempDestination);
680,993
public static void updateProgramCLI() {<NEW_LINE>logger.info("Checking for update...");<NEW_LINE>Document doc = null;<NEW_LINE>try {<NEW_LINE>logger.debug("Retrieving " + UpdateUtils.updateJsonURL);<NEW_LINE>doc = Jsoup.connect(UpdateUtils.updateJsonURL).timeout(10 * 1000).ignoreContentType(true).get();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Error while fetching update: ", e);<NEW_LINE>JOptionPane.showMessageDialog(null, "<html><font color=\"red\">Error while fetching update: " + e.getMessage() + "</font></html>", "RipMe Updater", JOptionPane.ERROR_MESSAGE);<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>logger.info("Current version: " + getThisJarVersion());<NEW_LINE>}<NEW_LINE>String jsonString = doc.body().html().replaceAll("&quot;", "\"");<NEW_LINE>ripmeJson = new JSONObject(jsonString);<NEW_LINE>String changeList = getChangeList(ripmeJson);<NEW_LINE>logger.info("Change log: \n" + changeList);<NEW_LINE>String <MASK><NEW_LINE>if (UpdateUtils.isNewerVersion(latestVersion)) {<NEW_LINE>logger.info("Found newer version: " + latestVersion);<NEW_LINE>logger.info("Downloading new version...");<NEW_LINE>logger.info("New version found, downloading...");<NEW_LINE>try {<NEW_LINE>UpdateUtils.downloadJarAndLaunch(getUpdateJarURL(latestVersion), false);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Error while updating: ", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug("This version (" + UpdateUtils.getThisJarVersion() + ") is the same or newer than the website's version (" + latestVersion + ")");<NEW_LINE>logger.info("v" + UpdateUtils.getThisJarVersion() + " is the latest version");<NEW_LINE>logger.debug("Running latest version: " + UpdateUtils.getThisJarVersion());<NEW_LINE>}<NEW_LINE>}
latestVersion = ripmeJson.getString("latestVersion");
1,474,849
private void populatePassSummary() {<NEW_LINE>HashMap<String, Stats> <MASK><NEW_LINE>for (Stats logStat : this.log) {<NEW_LINE>String passName = logStat.pass;<NEW_LINE>Stats entry = tmpPassSummary.computeIfAbsent(passName, (String k) -> new Stats(k, logStat.isOneTime));<NEW_LINE>entry.runtime += logStat.runtime;<NEW_LINE>entry.allocMem = max(entry.allocMem, logStat.allocMem);<NEW_LINE>entry.runs++;<NEW_LINE>entry.changes += logStat.changes;<NEW_LINE>entry.astDiff += logStat.astDiff;<NEW_LINE>entry.diff += logStat.diff;<NEW_LINE>entry.gzDiff += logStat.gzDiff;<NEW_LINE>// We don't populate the size fields in the passSummary stats.<NEW_LINE>// We used to put the size after the last time a pass was run, but that is<NEW_LINE>// a pretty meaningless thing to measure.<NEW_LINE>}<NEW_LINE>this.passSummary = ImmutableMap.copyOf(tmpPassSummary);<NEW_LINE>}
tmpPassSummary = new HashMap<>();
1,103,856
public DataStore initialize(Map<String, Object> dsInfos) {<NEW_LINE>String url = (String) dsInfos.get("url");<NEW_LINE>String name = (String) dsInfos.get("name");<NEW_LINE>String providerName = (String) dsInfos.get("providerName");<NEW_LINE>ScopeType scope = (ScopeType) dsInfos.get("scope");<NEW_LINE>DataStoreRole role = (DataStoreRole) dsInfos.get("role");<NEW_LINE>Map<String, String> details = (Map<String, String>) dsInfos.get("details");<NEW_LINE>s_logger.info("Trying to add a S3 store with endpoint: " + details.get(ApiConstants.S3_END_POINT));<NEW_LINE>Map<String, <MASK><NEW_LINE>imageStoreParameters.put("name", name);<NEW_LINE>imageStoreParameters.put("url", url);<NEW_LINE>String protocol = "http";<NEW_LINE>String useHttps = details.get(ApiConstants.S3_HTTPS_FLAG);<NEW_LINE>if (useHttps != null && Boolean.parseBoolean(useHttps)) {<NEW_LINE>protocol = "https";<NEW_LINE>}<NEW_LINE>imageStoreParameters.put("protocol", protocol);<NEW_LINE>if (scope != null) {<NEW_LINE>imageStoreParameters.put("scope", scope);<NEW_LINE>} else {<NEW_LINE>imageStoreParameters.put("scope", ScopeType.REGION);<NEW_LINE>}<NEW_LINE>imageStoreParameters.put("providerName", providerName);<NEW_LINE>imageStoreParameters.put("role", role);<NEW_LINE>ImageStoreVO ids = imageStoreHelper.createImageStore(imageStoreParameters, details);<NEW_LINE>return imageStoreMgr.getImageStore(ids.getId());<NEW_LINE>}
Object> imageStoreParameters = new HashMap();
1,851,129
public static List<String> exportEndpointsToS3(PinpointClient pinpoint, S3Client s3Client, String s3BucketName, String iamExportRoleArn, String applicationId) {<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH_mm:ss.SSS_z");<NEW_LINE>String endpointsKeyPrefix = "exports/" + applicationId + "_" + dateFormat<MASK><NEW_LINE>String s3UrlPrefix = "s3://" + s3BucketName + "/" + endpointsKeyPrefix + "/";<NEW_LINE>List<String> objectKeys = new ArrayList<>();<NEW_LINE>String key = "";<NEW_LINE>try {<NEW_LINE>// Defines the export job that Amazon Pinpoint runs<NEW_LINE>ExportJobRequest jobRequest = ExportJobRequest.builder().roleArn(iamExportRoleArn).s3UrlPrefix(s3UrlPrefix).build();<NEW_LINE>CreateExportJobRequest exportJobRequest = CreateExportJobRequest.builder().applicationId(applicationId).exportJobRequest(jobRequest).build();<NEW_LINE>System.out.format("Exporting endpoints from Amazon Pinpoint application %s to Amazon S3 " + "bucket %s . . .\n", applicationId, s3BucketName);<NEW_LINE>CreateExportJobResponse exportResult = pinpoint.createExportJob(exportJobRequest);<NEW_LINE>String jobId = exportResult.exportJobResponse().id();<NEW_LINE>System.out.println(jobId);<NEW_LINE>printExportJobStatus(pinpoint, applicationId, jobId);<NEW_LINE>ListObjectsV2Request v2Request = ListObjectsV2Request.builder().bucket(s3BucketName).prefix(endpointsKeyPrefix).build();<NEW_LINE>// Create a list of object keys<NEW_LINE>ListObjectsV2Response v2Response = s3Client.listObjectsV2(v2Request);<NEW_LINE>List<S3Object> objects = v2Response.contents();<NEW_LINE>for (S3Object object : objects) {<NEW_LINE>key = object.key();<NEW_LINE>objectKeys.add(key);<NEW_LINE>}<NEW_LINE>return objectKeys;<NEW_LINE>} catch (PinpointException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.format(new Date());
1,726,905
final DeletePublishingDestinationResult executeDeletePublishingDestination(DeletePublishingDestinationRequest deletePublishingDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePublishingDestinationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePublishingDestinationRequest> request = null;<NEW_LINE>Response<DeletePublishingDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePublishingDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePublishingDestinationRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePublishingDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePublishingDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePublishingDestinationResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
544,425
private void adjustForCompatibility() {<NEW_LINE>if (compatibilityLimitFileName != null) {<NEW_LINE>Map<String, StructureDescriptor> limitMap = new HashMap<>();<NEW_LINE>try (InputStream inputStream = new FileInputStream(compatibilityLimitFileName)) {<NEW_LINE>StructureReader limitReader = new StructureReader(inputStream);<NEW_LINE>for (StructureDescriptor structure : limitReader.getStructures()) {<NEW_LINE>limitMap.put(structure.getName(), structure);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Could not apply compatibility limits from: " + compatibilityLimitFileName);<NEW_LINE>errorCount += 1;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (StructureDescriptor structure : structureReader.getStructures()) {<NEW_LINE>Set<String> allowedConstants;<NEW_LINE>StructureDescriptor limit = limitMap.<MASK><NEW_LINE>if (limit == null) {<NEW_LINE>allowedConstants = Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>allowedConstants = new HashSet<>();<NEW_LINE>for (ConstantDescriptor constant : limit.getConstants()) {<NEW_LINE>allowedConstants.add(constant.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Iterator<ConstantDescriptor> iter = structure.getConstants().iterator(); iter.hasNext(); ) {<NEW_LINE>if (!allowedConstants.contains(iter.next().getName())) {<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (compatibilityConstantsFileName != null) {<NEW_LINE>try (InputStream inputStream = new FileInputStream(compatibilityConstantsFileName)) {<NEW_LINE>structureReader.addCompatibilityConstants(inputStream);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Could not apply compatibility constants from: " + compatibilityConstantsFileName);<NEW_LINE>errorCount += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(structure.getName());
1,237,908
public void render(PoseStack ms, IComponentRenderContext context, float pticks, int mouseX, int mouseY) {<NEW_LINE>ms.pushPose();<NEW_LINE>ms.translate(0, 0, -10);<NEW_LINE>context.renderItemStack(ms, x + 13, y + 1, mouseX, mouseY, cornerBlock);<NEW_LINE>ms.translate(0F, 0F, 5F);<NEW_LINE>context.renderItemStack(ms, x + 20, y + 4, mouseX, mouseY, middleBlock);<NEW_LINE>context.renderItemStack(ms, x + 7, y + 4, mouseX, mouseY, middleBlock);<NEW_LINE>ms.translate(0F, 0F, 5F);<NEW_LINE>context.renderItemStack(ms, x + 13, y + 8, mouseX, mouseY, cornerBlock);<NEW_LINE>context.renderItemStack(ms, x + 27, y + 8, mouseX, mouseY, centerBlock);<NEW_LINE>context.renderItemStack(ms, x, y + 8, mouseX, mouseY, cornerBlock);<NEW_LINE>ms.translate(0F, 0F, 5F);<NEW_LINE>context.renderItemStack(ms, x + 7, y + 12, mouseX, mouseY, middleBlock);<NEW_LINE>context.renderItemStack(ms, x + 20, y + 12, mouseX, mouseY, middleBlock);<NEW_LINE>ms.translate(0F, 0F, 5F);<NEW_LINE>context.renderItemStack(ms, x + 14, y + 15, mouseX, mouseY, cornerBlock);<NEW_LINE>ms.<MASK><NEW_LINE>context.renderItemStack(ms, x + 13, y, mouseX, mouseY, plateBlock);<NEW_LINE>ms.popPose();<NEW_LINE>}
translate(0F, 0F, 5F);
59,807
public BlockingIterable<Buffer> serialize(final HttpHeaders headers, final BlockingIterable<String> value, final BufferAllocator allocator) {<NEW_LINE>addContentType.accept(headers);<NEW_LINE>return () -> {<NEW_LINE>final BlockingIterator<String> iterator = value.iterator();<NEW_LINE>return new BlockingIterator<Buffer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext(final long timeout, final TimeUnit unit) throws TimeoutException {<NEW_LINE>return iterator.hasNext(timeout, unit);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Buffer next(final long timeout, final TimeUnit unit) throws TimeoutException {<NEW_LINE>return toBuffer(iterator.next(timeout, unit), allocator);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close() throws Exception {<NEW_LINE>iterator.close();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return iterator.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Buffer next() {<NEW_LINE>return toBuffer(<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>};<NEW_LINE>}
iterator.next(), allocator);
341,876
public void onOpenCloseIssue() {<NEW_LINE>if (getPullRequest() != null) {<NEW_LINE>IssueRequestModel requestModel = IssueRequestModel.clone(getPullRequest(), true);<NEW_LINE>manageDisposable(RxHelper.getObservable(RestProvider.getPullRequestService(isEnterprise()).editPullRequest(login, repoId, issueNumber, requestModel)).doOnSubscribe(disposable -> sendToView(view -> view.showProgress(0))).subscribe(issue -> {<NEW_LINE>if (issue != null) {<NEW_LINE>sendToView(view -> view.showSuccessIssueActionMsg(getPullRequest().getState() == IssueState.open));<NEW_LINE>issue.setRepoId(getPullRequest().getRepoId());<NEW_LINE>issue.setLogin(getPullRequest().getLogin());<NEW_LINE>pullRequest = issue;<NEW_LINE>sendToView(view <MASK><NEW_LINE>}<NEW_LINE>}, throwable -> sendToView(view -> view.showErrorIssueActionMsg(getPullRequest().getState() == IssueState.open))));<NEW_LINE>}<NEW_LINE>}
-> view.onSetupIssue(false));
424,806
public Request<TagResourceRequest> marshall(TagResourceRequest tagResourceRequest) {<NEW_LINE>if (tagResourceRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(TagResourceRequest)");<NEW_LINE>}<NEW_LINE>Request<TagResourceRequest> request = new DefaultRequest<TagResourceRequest>(tagResourceRequest, "AmazonSNS");<NEW_LINE>request.addParameter("Action", "TagResource");<NEW_LINE><MASK><NEW_LINE>String prefix;<NEW_LINE>if (tagResourceRequest.getResourceArn() != null) {<NEW_LINE>prefix = "ResourceArn";<NEW_LINE>String resourceArn = tagResourceRequest.getResourceArn();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(resourceArn));<NEW_LINE>}<NEW_LINE>if (tagResourceRequest.getTags() != null) {<NEW_LINE>prefix = "Tags";<NEW_LINE>java.util.List<Tag> tags = tagResourceRequest.getTags();<NEW_LINE>int tagsIndex = 1;<NEW_LINE>String tagsPrefix = prefix;<NEW_LINE>for (Tag tagsItem : tags) {<NEW_LINE>prefix = tagsPrefix + ".member." + tagsIndex;<NEW_LINE>if (tagsItem != null) {<NEW_LINE>TagStaxMarshaller.getInstance().marshall(tagsItem, request, prefix + ".");<NEW_LINE>}<NEW_LINE>tagsIndex++;<NEW_LINE>}<NEW_LINE>prefix = tagsPrefix;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Version", "2010-03-31");
492,221
public void translate(GeyserSession session, ClientboundGameProfilePacket packet) {<NEW_LINE><MASK><NEW_LINE>AuthType remoteAuthType = session.getRemoteAuthType();<NEW_LINE>// Required, or else Floodgate players break with Spigot chunk caching<NEW_LINE>GameProfile profile = packet.getProfile();<NEW_LINE>playerEntity.setUsername(profile.getName());<NEW_LINE>playerEntity.setUuid(profile.getId());<NEW_LINE>session.getGeyser().getSessionManager().addSession(playerEntity.getUuid(), session);<NEW_LINE>// Check if they are not using a linked account<NEW_LINE>if (remoteAuthType == AuthType.OFFLINE || playerEntity.getUuid().getMostSignificantBits() == 0) {<NEW_LINE>SkinManager.handleBedrockSkin(playerEntity, session.getClientData());<NEW_LINE>}<NEW_LINE>if (remoteAuthType == AuthType.FLOODGATE) {<NEW_LINE>// We'll send the skin upload a bit after the handshake packet (aka this packet),<NEW_LINE>// because otherwise the global server returns the data too fast.<NEW_LINE>session.getAuthData().upload(session.getGeyser());<NEW_LINE>}<NEW_LINE>}
PlayerEntity playerEntity = session.getPlayerEntity();
1,446,335
public static ColumnDef build(String name, String charset, String type, short pos, boolean signed, String[] enumValues, Long columnLength) {<NEW_LINE>name = name.intern();<NEW_LINE>if (charset != null)<NEW_LINE>charset = charset.intern();<NEW_LINE>switch(type) {<NEW_LINE>case "tinyint":<NEW_LINE>case "smallint":<NEW_LINE>case "mediumint":<NEW_LINE>case "int":<NEW_LINE>return IntColumnDef.create(name, type, pos, signed);<NEW_LINE>case "bigint":<NEW_LINE>return BigIntColumnDef.create(name, type, pos, signed);<NEW_LINE>case "tinytext":<NEW_LINE>case "text":<NEW_LINE>case "mediumtext":<NEW_LINE>case "longtext":<NEW_LINE>case "varchar":<NEW_LINE>case "char":<NEW_LINE>return StringColumnDef.create(name, type, pos, charset);<NEW_LINE>case "tinyblob":<NEW_LINE>case "blob":<NEW_LINE>case "mediumblob":<NEW_LINE>case "longblob":<NEW_LINE>case "binary":<NEW_LINE>case "varbinary":<NEW_LINE>return StringColumnDef.create(name, type, pos, "binary");<NEW_LINE>case "geometry":<NEW_LINE>case "geometrycollection":<NEW_LINE>case "linestring":<NEW_LINE>case "multilinestring":<NEW_LINE>case "multipoint":<NEW_LINE>case "multipolygon":<NEW_LINE>case "polygon":<NEW_LINE>case "point":<NEW_LINE>return GeometryColumnDef.create(name, type, pos);<NEW_LINE>case "float":<NEW_LINE>case "double":<NEW_LINE>return FloatColumnDef.create(name, type, pos);<NEW_LINE>case "decimal":<NEW_LINE>return DecimalColumnDef.create(name, type, pos);<NEW_LINE>case "date":<NEW_LINE>return DateColumnDef.<MASK><NEW_LINE>case "datetime":<NEW_LINE>case "timestamp":<NEW_LINE>return DateTimeColumnDef.create(name, type, pos, columnLength);<NEW_LINE>case "time":<NEW_LINE>return TimeColumnDef.create(name, type, pos, columnLength);<NEW_LINE>case "year":<NEW_LINE>return YearColumnDef.create(name, type, pos);<NEW_LINE>case "enum":<NEW_LINE>return EnumColumnDef.create(name, type, pos, enumValues);<NEW_LINE>case "set":<NEW_LINE>return SetColumnDef.create(name, type, pos, enumValues);<NEW_LINE>case "bit":<NEW_LINE>return BitColumnDef.create(name, type, pos);<NEW_LINE>case "json":<NEW_LINE>return JsonColumnDef.create(name, type, pos);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unsupported column type " + type);<NEW_LINE>}<NEW_LINE>}
create(name, type, pos);
305,661
public void sortOutOfPlace(V srcVector, V dstVector, VectorValueComparator<V> comparator) {<NEW_LINE>comparator.attachVector(srcVector);<NEW_LINE>// check vector capacity<NEW_LINE>Preconditions.checkArgument(dstVector.getValueCapacity() >= srcVector.getValueCount(), "Not enough capacity for the target vector. " + "Expected capacity %s, actual capacity %s", srcVector.getValueCount(<MASK><NEW_LINE>// sort value indices<NEW_LINE>try (IntVector sortedIndices = new IntVector("", srcVector.getAllocator())) {<NEW_LINE>sortedIndices.allocateNew(srcVector.getValueCount());<NEW_LINE>sortedIndices.setValueCount(srcVector.getValueCount());<NEW_LINE>IndexSorter<V> indexSorter = new IndexSorter<>();<NEW_LINE>indexSorter.sort(srcVector, sortedIndices, comparator);<NEW_LINE>// copy sorted values to the output vector<NEW_LINE>for (int dstIndex = 0; dstIndex < sortedIndices.getValueCount(); dstIndex++) {<NEW_LINE>int srcIndex = sortedIndices.get(dstIndex);<NEW_LINE>dstVector.copyFromSafe(srcIndex, dstIndex, srcVector);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), dstVector.getValueCapacity());
412,204
private List<Operation> extractOperations(ObjectTypeDefinition typeDef) {<NEW_LINE>List<Operation> results = new ArrayList<>();<NEW_LINE>for (FieldDefinition fieldDef : typeDef.getFieldDefinitions()) {<NEW_LINE>Operation operation = new Operation();<NEW_LINE>operation.setName(fieldDef.getName());<NEW_LINE>operation.setMethod(typeDef.getName().toUpperCase());<NEW_LINE>// Deal with input names if any.<NEW_LINE>if (fieldDef.getInputValueDefinitions() != null && !fieldDef.getInputValueDefinitions().isEmpty()) {<NEW_LINE>operation.setInputName(getInputNames(fieldDef.getInputValueDefinitions()));<NEW_LINE>boolean hasOnlyPrimitiveArgs = true;<NEW_LINE>for (InputValueDefinition inputValueDef : fieldDef.getInputValueDefinitions()) {<NEW_LINE>Type inputValueType = inputValueDef.getType();<NEW_LINE>if (TypeUtil.isNonNull(inputValueType)) {<NEW_LINE>inputValueType = TypeUtil.unwrapOne(inputValueType);<NEW_LINE>}<NEW_LINE>if (TypeUtil.isList(inputValueType)) {<NEW_LINE>hasOnlyPrimitiveArgs = false;<NEW_LINE>}<NEW_LINE>TypeInfo inputValueTypeInfo = TypeInfo.typeInfo(inputValueType);<NEW_LINE>if (!ScalarInfo.isGraphqlSpecifiedScalar(inputValueTypeInfo.getName())) {<NEW_LINE>hasOnlyPrimitiveArgs = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasOnlyPrimitiveArgs) {<NEW_LINE>operation.setDispatcher(DispatchStyles.QUERY_ARGS);<NEW_LINE>operation.setDispatcherRules(extractOperationParams<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Deal with output names if any.<NEW_LINE>if (fieldDef.getType() != null) {<NEW_LINE>operation.setOutputName(getTypeName(fieldDef.getType()));<NEW_LINE>}<NEW_LINE>results.add(operation);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
(fieldDef.getInputValueDefinitions()));
1,643,304
private static EmailFromOutlookMessage buildEmailFromOutlookMessage(@NotNull final EmailPopulatingBuilder builder, @NotNull final OutlookMessage outlookMessage, @NotNull final EmailPopulatingBuilderFactory builderFactory, @NotNull final InternalEmailConverter internalEmailConverter) {<NEW_LINE>checkNonEmptyArgument(builder, "emailBuilder");<NEW_LINE>checkNonEmptyArgument(outlookMessage, "outlookMessage");<NEW_LINE>String fromEmail = ofNullable(outlookMessage.getFromEmail()).orElse("donotreply@unknown-from-address.net");<NEW_LINE>builder.from(outlookMessage.getFromName(), fromEmail);<NEW_LINE>builder.fixingMessageId(outlookMessage.getMessageId());<NEW_LINE>// FIXME creation date?<NEW_LINE>builder.fixingSentDate(ofNullable(outlookMessage.getClientSubmitTime()).orElse(outlookMessage.getDate()));<NEW_LINE>if (!MiscUtil.valueNullOrEmpty(outlookMessage.getReplyToEmail())) {<NEW_LINE>builder.withReplyTo(outlookMessage.getReplyToName(), outlookMessage.getReplyToEmail());<NEW_LINE>}<NEW_LINE>copyReceiversFromOutlookMessage(builder, outlookMessage);<NEW_LINE>builder.withSubject(outlookMessage.getSubject());<NEW_LINE>builder.withPlainText(outlookMessage.getBodyText());<NEW_LINE>builder.withHTMLText(outlookMessage.getBodyHTML() != null ? outlookMessage.getBodyHTML() : outlookMessage.getConvertedBodyHTML());<NEW_LINE>for (final Map.Entry<String, OutlookFileAttachment> cid : outlookMessage.fetchCIDMap().entrySet()) {<NEW_LINE>final String cidName = checkNonEmptyArgument(cid.getKey(), "cid.key");<NEW_LINE>builder.withEmbeddedImage(verifyNonnullOrEmpty(extractCID(cidName)), cid.getValue().getData(), cid.getValue().getMimeTag());<NEW_LINE>}<NEW_LINE>for (final OutlookFileAttachment attachment : outlookMessage.fetchTrueAttachments()) {<NEW_LINE>String attachmentName = ofNullable(attachment.getLongFilename()).orElse(attachment.getFilename());<NEW_LINE>builder.withAttachment(attachmentName, attachment.getData(), attachment.getMimeTag());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < outlookMessage.getOutlookAttachments().size(); i++) {<NEW_LINE>final OutlookAttachment attachment = outlookMessage.getOutlookAttachments().get(i);<NEW_LINE>if (attachment instanceof OutlookMsgAttachment) {<NEW_LINE>final OutlookMessage nestedMsg = ((OutlookMsgAttachment) attachment).getOutlookMessage();<NEW_LINE>final Email email = buildEmailFromOutlookMessage(builderFactory.create(), nestedMsg, builderFactory, internalEmailConverter).getEmailBuilder().buildEmail();<NEW_LINE>final MimeMessage message = internalEmailConverter.emailToMimeMessage(email);<NEW_LINE>final byte[] mimedata = internalEmailConverter.mimeMessageToEMLByteArray(message);<NEW_LINE>builder.withAttachment(nestedMsg.getSubject() + ".eml", new ByteArrayDataSource(mimedata, "message/rfc822"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new EmailFromOutlookMessage(<MASK><NEW_LINE>}
builder, new OutlookMessageProxy(outlookMessage));
1,838,207
private void onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) {<NEW_LINE>final int version = buffer.getInt(offset + VERSION_OFFSET, LITTLE_ENDIAN);<NEW_LINE>if (VERSION != version) {<NEW_LINE>throw new IllegalArgumentException("unsupported version " + version + " expected " + VERSION);<NEW_LINE>}<NEW_LINE>final int messageType = buffer.getInt(offset + TYPE_OFFSET, LITTLE_ENDIAN);<NEW_LINE>switch(messageType) {<NEW_LINE>case FILE_CREATE_TYPE:<NEW_LINE>createFile(buffer.getLong(offset + CORRELATION_ID_OFFSET, LITTLE_ENDIAN), buffer.getLong(offset + FILE_LENGTH_OFFSET, LITTLE_ENDIAN), buffer.getStringUtf8(offset + FILE_NAME_OFFSET, LITTLE_ENDIAN));<NEW_LINE>break;<NEW_LINE>case FILE_CHUNK_TYPE:<NEW_LINE>fileChunk(buffer.getLong(offset + CORRELATION_ID_OFFSET, LITTLE_ENDIAN), buffer.getLong(offset + CHUNK_OFFSET_OFFSET, LITTLE_ENDIAN), buffer.getLong(offset + CHUNK_LENGTH_OFFSET<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unknown message type: " + messageType);<NEW_LINE>}<NEW_LINE>}
, LITTLE_ENDIAN), buffer, offset);
728,205
public static OpenOrders adaptOpenOrders(CurrencyPair currencyPair, Bl3pOpenOrders.Bl3pOpenOrder[] bl3pOrders) {<NEW_LINE>List<LimitOrder> result = new ArrayList<>(bl3pOrders.length);<NEW_LINE>for (Bl3pOpenOrders.Bl3pOpenOrder bl3pOrder : bl3pOrders) {<NEW_LINE>Order.OrderType orderType = Bl3pUtils.fromBl3pOrderType(bl3pOrder.getStatus());<NEW_LINE>BigDecimal limitPrice = bl3pOrder.getPrice().value;<NEW_LINE>BigDecimal originalAmount = bl3pOrder.getAmountFunds().value;<NEW_LINE>BigDecimal executedAmount = bl3pOrder.getAmountExecuted().value;<NEW_LINE>BigDecimal remainingAmount = originalAmount.subtract(executedAmount);<NEW_LINE>result.add(new LimitOrder.Builder(orderType, currencyPair).cumulativeAmount(executedAmount).id("" + bl3pOrder.getOrderId()).limitPrice(limitPrice).originalAmount(originalAmount).remainingAmount(remainingAmount).timestamp(bl3pOrder.getTimestamp<MASK><NEW_LINE>}<NEW_LINE>return new OpenOrders(result);<NEW_LINE>}
()).build());
601,862
private void invocation(RESTRequest request, RESTResponse response) {<NEW_LINE>RESTHelper.ensureConsumesJson(request);<NEW_LINE>String objectName = RESTHelper.getRequiredParam(request, APIConstants.PARAM_OBJECT_NAME);<NEW_LINE>String operation = RESTHelper.getRequiredParam(request, APIConstants.PARAM_OPERATION);<NEW_LINE>InputStream <MASK><NEW_LINE>// Get the converter<NEW_LINE>JSONConverter converter = JSONConverter.getConverter();<NEW_LINE>// Read the input<NEW_LINE>Invocation invocation = null;<NEW_LINE>try {<NEW_LINE>invocation = converter.readInvocation(is);<NEW_LINE>} catch (ConversionException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(e, converter, APIConstants.STATUS_BAD_REQUEST);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(e, converter, APIConstants.STATUS_BAD_REQUEST);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw ErrorHelper.createRESTHandlerJsonException(e, converter, APIConstants.STATUS_BAD_REQUEST);<NEW_LINE>}<NEW_LINE>// Get the converted ObjectName<NEW_LINE>ObjectName objectNameObj = RESTHelper.objectNameConverter(objectName, true, converter);<NEW_LINE>// Make the invocation<NEW_LINE>final Object pojo = MBeanServerHelper.invoke(objectNameObj, operation, invocation.params, invocation.signature, converter);<NEW_LINE>OutputHelper.writePOJOOutput(response, pojo, converter);<NEW_LINE>}
is = RESTHelper.getInputStream(request);
41,576
private void onVideoInit() {<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>containerLayout = new FrameLayout(activity);<NEW_LINE>containerLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));<NEW_LINE>// GodotEditText layout<NEW_LINE>GodotEditText editText = new GodotEditText(activity);<NEW_LINE>editText.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, (int) getResources().getDimension(R.dimen.text_edit_height)));<NEW_LINE>// ...add to FrameLayout<NEW_LINE>containerLayout.addView(editText);<NEW_LINE>GodotLib.setup(command_line);<NEW_LINE>final String videoDriver = GodotLib.getGlobal("rendering/driver/driver_name");<NEW_LINE>if (videoDriver.equals("vulkan")) {<NEW_LINE>mRenderView = new GodotVulkanRenderView(activity, this);<NEW_LINE>} else {<NEW_LINE>mRenderView = new GodotGLRenderView(activity, this, xrMode, use_debug_opengl);<NEW_LINE>}<NEW_LINE>View view = mRenderView.getView();<NEW_LINE>containerLayout.addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));<NEW_LINE>editText.setView(mRenderView);<NEW_LINE>io.setEdit(editText);<NEW_LINE>view.getViewTreeObserver().addOnGlobalLayoutListener(() -> {<NEW_LINE>Point fullSize = new Point();<NEW_LINE>activity.getWindowManager().<MASK><NEW_LINE>Rect gameSize = new Rect();<NEW_LINE>mRenderView.getView().getWindowVisibleDisplayFrame(gameSize);<NEW_LINE>final int keyboardHeight = fullSize.y - gameSize.bottom;<NEW_LINE>GodotLib.setVirtualKeyboardHeight(keyboardHeight);<NEW_LINE>});<NEW_LINE>mRenderView.queueOnRenderThread(() -> {<NEW_LINE>for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {<NEW_LINE>plugin.onRegisterPluginWithGodotNative();<NEW_LINE>}<NEW_LINE>setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on")));<NEW_LINE>});<NEW_LINE>// Include the returned non-null views in the Godot view hierarchy.<NEW_LINE>for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {<NEW_LINE>View pluginView = plugin.onMainCreate(activity);<NEW_LINE>if (pluginView != null) {<NEW_LINE>if (plugin.shouldBeOnTop()) {<NEW_LINE>containerLayout.addView(pluginView);<NEW_LINE>} else {<NEW_LINE>containerLayout.addView(pluginView, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getDefaultDisplay().getSize(fullSize);
233,098
public void init(SaasMethod m, RestClientSaasBean saasBean, Document doc) throws IOException {<NEW_LINE><MASK><NEW_LINE>setBean(saasBean);<NEW_LINE>targetSource = JavaSource.forFileObject(getTargetFile());<NEW_LINE>String packageName = JavaSourceHelper.getPackageName(targetSource);<NEW_LINE>getBean().setPackageName(packageName);<NEW_LINE>serviceFolder = null;<NEW_LINE>saasServiceFile = SourceGroupSupport.findJavaSourceFile(getProject(), getBean().getSaasServiceName());<NEW_LINE>if (saasServiceFile != null) {<NEW_LINE>saasServiceJS = JavaSource.forFileObject(saasServiceFile);<NEW_LINE>}<NEW_LINE>this.authGen = new SaasClientJavaAuthenticationGenerator(getBean(), getProject());<NEW_LINE>this.authGen.setLoginArguments(getLoginArguments());<NEW_LINE>this.authGen.setAuthenticatorMethodParameters(getAuthenticatorMethodParameters());<NEW_LINE>this.authGen.setSaasServiceFolder(getSaasServiceFolder());<NEW_LINE>this.authGen.setAuthenticationProfile(getBean().getProfile(m, getDropFileType()));<NEW_LINE>this.authGen.setDropFileType(getDropFileType());<NEW_LINE>}
super.init(m, doc);
603,707
private void updateFiles(Gist gist) {<NEW_LINE>final Activity activity = getActivity();<NEW_LINE>if (activity == null)<NEW_LINE>return;<NEW_LINE>for (View header : fileHeaders) adapter.removeHeader(header);<NEW_LINE>fileHeaders.clear();<NEW_LINE>Map<String, GistFile> files = gist.getFiles();<NEW_LINE>if (files == null || files.isEmpty())<NEW_LINE>return;<NEW_LINE>final LayoutInflater inflater = activity.getLayoutInflater();<NEW_LINE>final Typeface octicons = TypefaceUtils.getOcticons(activity);<NEW_LINE>for (GistFile file : files.values()) {<NEW_LINE>View fileView = inflater.inflate(<MASK><NEW_LINE>((TextView) fileView.findViewById(R.id.tv_file)).setText(file.getFilename());<NEW_LINE>TextView fileIcon = (TextView) fileView.findViewById(R.id.tv_file_icon);<NEW_LINE>fileIcon.setText(TypefaceUtils.ICON_FILE_TEXT);<NEW_LINE>fileIcon.setTypeface(octicons);<NEW_LINE>adapter.addHeader(fileView, file, true);<NEW_LINE>fileHeaders.add(fileView);<NEW_LINE>}<NEW_LINE>}
R.layout.gist_file_item, null);
1,482,059
public void onOutstandingTaskAppeared(int outstandingTaskAppearedRound, int outstandingTaskCount) {<NEW_LINE>Boolean gangAllocation = requestManager.getPlatParams().getGangAllocation();<NEW_LINE>Integer gangAllocationTimeoutSec = conf.getLauncherConfig().getAmGangAllocationTimeoutSec();<NEW_LINE>if (gangAllocation) {<NEW_LINE>String logPrefix = String.format("onOutstandingTaskAppeared[%s]: GangAllocation Unsatisfied: ", outstandingTaskAppearedRound);<NEW_LINE>LOGGER.logInfo(logPrefix + "Waiting for %s outstanding Tasks with timeout %ss.", outstandingTaskCount, gangAllocationTimeoutSec);<NEW_LINE>transitionTaskStateQueue.queueSystemTaskDelayed(() -> {<NEW_LINE>if (outstandingTaskAppearedRound == statusManager.getOutstandingTaskAppearedRound()) {<NEW_LINE>int currentOutstandingTaskCount = statusManager.getOutstandingStateTaskCount();<NEW_LINE>if (currentOutstandingTaskCount > 0) {<NEW_LINE>stopForInternalError(FrameworkExitCode.AM_GANG_ALLOCATION_TIMEOUT.toInt(), String.format<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, gangAllocationTimeoutSec * 1000);<NEW_LINE>}<NEW_LINE>}
("Still waiting for %s outstanding Tasks after timeout %ss", currentOutstandingTaskCount, gangAllocationTimeoutSec));
354,785
protected void createColumns() {<NEW_LINE>super.createColumns();<NEW_LINE>TableColumn<DaoStateBlockListItem, DaoStateBlockListItem> column = new AutoTooltipTableColumn<>(Res.get("dao.monitor.table.hashCreator"));<NEW_LINE>column.setMinWidth(90);<NEW_LINE>column.setMaxWidth(column.getMinWidth());<NEW_LINE>column.setCellValueFactory((item) -> new ReadOnlyObjectWrapper<>(item.getValue()));<NEW_LINE>column.setCellFactory(new Callback<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TableCell<DaoStateBlockListItem, DaoStateBlockListItem> call(TableColumn<DaoStateBlockListItem, DaoStateBlockListItem> column) {<NEW_LINE>return new TableCell<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void updateItem(final DaoStateBlockListItem item, boolean empty) {<NEW_LINE>super.updateItem(item, empty);<NEW_LINE>if (item != null)<NEW_LINE>setText(item.hashCreator());<NEW_LINE>else<NEW_LINE>setText("");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>});<NEW_LINE>column.setComparator(Comparator.comparing(e -> e.getStateBlock().getPeersMap().size()));<NEW_LINE>tableView.getColumns(<MASK><NEW_LINE>}
).add(2, column);
365,111
private void executeClasses(final OHttpRequest iRequest, final OHttpResponse iResponse, final ODatabaseDocument db, final String operation, final String rid, final String className, final Map<String, String> fields) throws IOException {<NEW_LINE>if ("add".equals(operation)) {<NEW_LINE>iRequest<MASK><NEW_LINE>// int defCluster = fields.get("defaultCluster") != null ?<NEW_LINE>// Integer.parseInt(fields.get("defaultCluster")) : db<NEW_LINE>// .getDefaultClusterId();<NEW_LINE>try {<NEW_LINE>final String superClassName = fields.get("superClass");<NEW_LINE>final OClass superClass;<NEW_LINE>if (superClassName != null)<NEW_LINE>superClass = db.getMetadata().getSchema().getClass(superClassName);<NEW_LINE>else<NEW_LINE>superClass = null;<NEW_LINE>final OClass cls = db.getMetadata().getSchema().createClass(fields.get("name"), superClass);<NEW_LINE>final String alias = fields.get("alias");<NEW_LINE>if (alias != null)<NEW_LINE>cls.setShortName(alias);<NEW_LINE>iResponse.send(OHttpUtils.STATUS_OK_CODE, OHttpUtils.STATUS_OK_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, "Class '" + rid + "' created successfully with id=" + db.getMetadata().getSchema().getClasses().size(), null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>iResponse.send(OHttpUtils.STATUS_INTERNALERROR_CODE, "Error on creating the new class '" + rid + "': " + e, OHttpUtils.CONTENT_TEXT_PLAIN, "Error on creating the new class '" + rid + "': " + e, null);<NEW_LINE>}<NEW_LINE>} else if ("del".equals(operation)) {<NEW_LINE>iRequest.getData().commandInfo = "Studio delete class";<NEW_LINE>db.getMetadata().getSchema().dropClass(rid);<NEW_LINE>iResponse.send(OHttpUtils.STATUS_OK_CODE, OHttpUtils.STATUS_OK_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, "Class '" + rid + "' deleted successfully.", null);<NEW_LINE>}<NEW_LINE>}
.getData().commandInfo = "Studio add class";
260,428
public Collection<LoadSpec> findSupportedLoadSpecs(ByteProvider provider) throws IOException {<NEW_LINE>List<LoadSpec> loadSpecs = new ArrayList<>();<NEW_LINE>BinaryReader reader = new BinaryReader(provider, true);<NEW_LINE>try {<NEW_LINE>byte[] magicBytes = provider.readBytes(0, <MASK><NEW_LINE>if (CDexConstants.MAGIC.equals(new String(magicBytes))) {<NEW_LINE>// should be CDEX<NEW_LINE>DexHeader header = DexHeaderFactory.getDexHeader(reader);<NEW_LINE>if (CDexConstants.MAGIC.equals(new String(header.getMagic()))) {<NEW_LINE>List<QueryResult> queries = QueryOpinionService.query(getName(), DexConstants.MACHINE, null);<NEW_LINE>for (QueryResult result : queries) {<NEW_LINE>loadSpecs.add(new LoadSpec(this, 0, result));<NEW_LINE>}<NEW_LINE>if (loadSpecs.isEmpty()) {<NEW_LINE>loadSpecs.add(new LoadSpec(this, 0, true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return loadSpecs;<NEW_LINE>}
CDexConstants.MAGIC.length());
250,506
public static QueryStatementsResponse unmarshall(QueryStatementsResponse queryStatementsResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryStatementsResponse.setRequestId(_ctx.stringValue("QueryStatementsResponse.RequestId"));<NEW_LINE>queryStatementsResponse.setCode<MASK><NEW_LINE>queryStatementsResponse.setMessage(_ctx.stringValue("QueryStatementsResponse.Message"));<NEW_LINE>queryStatementsResponse.setSubCode(_ctx.stringValue("QueryStatementsResponse.SubCode"));<NEW_LINE>queryStatementsResponse.setSubMessage(_ctx.stringValue("QueryStatementsResponse.SubMessage"));<NEW_LINE>queryStatementsResponse.setLogsId(_ctx.stringValue("QueryStatementsResponse.LogsId"));<NEW_LINE>queryStatementsResponse.setSuccess(_ctx.booleanValue("QueryStatementsResponse.Success"));<NEW_LINE>queryStatementsResponse.setTotalCount(_ctx.longValue("QueryStatementsResponse.TotalCount"));<NEW_LINE>Model model = new Model();<NEW_LINE>model.setPageSize(_ctx.integerValue("QueryStatementsResponse.Model.PageSize"));<NEW_LINE>model.setPageNumber(_ctx.integerValue("QueryStatementsResponse.Model.PageNumber"));<NEW_LINE>model.setTotalCount(_ctx.integerValue("QueryStatementsResponse.Model.TotalCount"));<NEW_LINE>List<StatementListItem> statementList = new ArrayList<StatementListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryStatementsResponse.Model.StatementList.Length"); i++) {<NEW_LINE>StatementListItem statementListItem = new StatementListItem();<NEW_LINE>statementListItem.setCreateDate(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].CreateDate"));<NEW_LINE>statementListItem.setModifiedDate(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].ModifiedDate"));<NEW_LINE>statementListItem.setSettleNo(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].SettleNo"));<NEW_LINE>statementListItem.setTenantId(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].TenantId"));<NEW_LINE>statementListItem.setPayeeId(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].PayeeId"));<NEW_LINE>statementListItem.setPayeeName(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].PayeeName"));<NEW_LINE>statementListItem.setPayeeAccountId(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].PayeeAccountId"));<NEW_LINE>statementListItem.setPayeeAccountName(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].PayeeAccountName"));<NEW_LINE>statementListItem.setPayeeAccountNo(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].PayeeAccountNo"));<NEW_LINE>statementListItem.setSettleAmount(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].SettleAmount"));<NEW_LINE>statementListItem.setStartTime(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].StartTime"));<NEW_LINE>statementListItem.setEndTime(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].EndTime"));<NEW_LINE>statementListItem.setSettleStatus(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].SettleStatus"));<NEW_LINE>statementListItem.setStatusMessage(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].StatusMessage"));<NEW_LINE>statementListItem.setAttributes(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].Attributes"));<NEW_LINE>statementListItem.setExtInfo(_ctx.stringValue("QueryStatementsResponse.Model.StatementList[" + i + "].ExtInfo"));<NEW_LINE>statementList.add(statementListItem);<NEW_LINE>}<NEW_LINE>model.setStatementList(statementList);<NEW_LINE>queryStatementsResponse.setModel(model);<NEW_LINE>return queryStatementsResponse;<NEW_LINE>}
(_ctx.stringValue("QueryStatementsResponse.Code"));
506,966
public void service(Context context, HttpServerRequest req, HttpServerResponse resp, HttpRequest vertxReq, HttpResponse vertxResp, boolean handleNotFound) throws IOException {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>Thread.currentThread().setContextClassLoader(classLoader);<NEW_LINE>ResteasyProviderFactory defaultInstance = ResteasyProviderFactory.getInstance();<NEW_LINE>if (defaultInstance instanceof ThreadLocalResteasyProviderFactory) {<NEW_LINE>ThreadLocalResteasyProviderFactory.push(providerFactory);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ResteasyContext.pushContext(Context.class, context);<NEW_LINE>ResteasyContext.pushContext(HttpServerRequest.class, req);<NEW_LINE>ResteasyContext.pushContext(HttpServerResponse.class, resp);<NEW_LINE>ResteasyContext.pushContext(Vertx.class, context.owner());<NEW_LINE>if (handleNotFound) {<NEW_LINE>dispatcher.invoke(vertxReq, vertxResp);<NEW_LINE>} else {<NEW_LINE>dispatcher.invokePropagateNotFound(vertxReq, vertxResp);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ResteasyContext.clearContextData();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (defaultInstance instanceof ThreadLocalResteasyProviderFactory) {<NEW_LINE>ThreadLocalResteasyProviderFactory.pop();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(old);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ResteasyProviderFactory defaultInstance = ResteasyProviderFactory.getInstance();
1,163,356
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String automationAccountName = Utils.getValueFromIdByName(id, "automationAccounts");<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'automationAccounts'.", id)));<NEW_LINE>}<NEW_LINE>String connectionTypeName = Utils.getValueFromIdByName(id, "connectionTypes");<NEW_LINE>if (connectionTypeName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'connectionTypes'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, automationAccountName, connectionTypeName, Context.NONE).getValue();<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
796,041
private void handleException(Throwable x, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>if (x instanceof NestedServletException && x.getCause() != null) {<NEW_LINE>x = x.getCause();<NEW_LINE>}<NEW_LINE>SubsonicRESTController.ErrorCode code = (x instanceof ServletRequestBindingException) ? SubsonicRESTController.ErrorCode.MISSING_PARAMETER : SubsonicRESTController.ErrorCode.GENERIC;<NEW_LINE>String msg = getErrorMessage(x);<NEW_LINE>// This happens often and outside of the control of the server, so<NEW_LINE>// we catch Tomcat/Jetty "connection aborted by client" exceptions<NEW_LINE>// and display a short error message.<NEW_LINE>boolean shouldCatch = <MASK><NEW_LINE>if (shouldCatch) {<NEW_LINE>LOG.info("{}: Client unexpectedly closed connection while loading {} ({})", request.getRemoteAddr(), Util.getAnonymizedURLForRequest(request), x.getMessage());<NEW_LINE>} else {<NEW_LINE>LOG.warn("Error in REST API", x);<NEW_LINE>try {<NEW_LINE>jaxbWriter.writeErrorResponse(request, response, code, msg);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to write error response.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Util.isInstanceOfClassName(x, "org.apache.catalina.connector.ClientAbortException");
828,965
public okhttp3.Call statObjectCall(String repository, String ref, String path, Boolean userMetadata, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/refs/{ref}/objects/stat".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())).replaceAll("\\{" + "ref" + "\\}", localVarApiClient.escapeString(ref.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (path != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path));<NEW_LINE>}<NEW_LINE>if (userMetadata != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("user_metadata", userMetadata));<NEW_LINE>}<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[<MASK><NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
] { "basic_auth", "cookie_auth", "jwt_token" };
1,379,437
public void render(Map<String, Object> context, String templateFile, Handler<AsyncResult<Buffer>> handler) {<NEW_LINE>try {<NEW_LINE>String src = adjustLocation(templateFile);<NEW_LINE>TemplateHolder<PebbleTemplate> template = getTemplate(src);<NEW_LINE>if (template == null) {<NEW_LINE>// real compile<NEW_LINE>synchronized (this) {<NEW_LINE>template = new TemplateHolder<>(pebbleEngine.<MASK><NEW_LINE>}<NEW_LINE>putTemplate(src, template);<NEW_LINE>}<NEW_LINE>// special key for lang selection<NEW_LINE>final String lang = (String) context.get("lang");<NEW_LINE>// rendering<NEW_LINE>final StringWriter stringWriter = new StringWriter();<NEW_LINE>template.template().evaluate(stringWriter, context, lang == null ? Locale.getDefault() : Locale.forLanguageTag(lang));<NEW_LINE>handler.handle(Future.succeededFuture(Buffer.buffer(stringWriter.toString())));<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>handler.handle(Future.failedFuture(ex));<NEW_LINE>}<NEW_LINE>}
getTemplate(adjustLocation(src)));
1,388,199
private void _processPortletRequest(HttpServletRequest req, HttpServletResponse res, boolean action) throws Exception {<NEW_LINE>String contentType = req.getHeader("Content-Type");<NEW_LINE>if ((contentType != null) && (contentType.startsWith("multipart/form-data"))) {<NEW_LINE>UploadServletRequest uploadReq = (UploadServletRequest) req;<NEW_LINE>req = uploadReq;<NEW_LINE>}<NEW_LINE>String companyId = PortalUtil.getCompanyId(req);<NEW_LINE>User user = PortalUtil.getUser(req);<NEW_LINE>Layout layout = (Layout) req.getAttribute(WebKeys.LAYOUT);<NEW_LINE>String portletId = ParamUtil.getString(req, "p_p_id");<NEW_LINE>Portlet portlet = PortletManagerUtil.getPortletById(companyId, portletId);<NEW_LINE>ServletContext ctx = (ServletContext) <MASK><NEW_LINE>ConcretePortletWrapper concretePortletWrapper = (ConcretePortletWrapper) APILocator.getPortletAPI().getImplementingInstance(portlet);<NEW_LINE>PortletPreferences portletPrefs = null;<NEW_LINE>PortletConfig portletConfig = APILocator.getPortletAPI().getPortletConfig(portlet);<NEW_LINE>PortletContext portletCtx = portletConfig.getPortletContext();<NEW_LINE>WindowState windowState = new WindowState(ParamUtil.getString(req, "p_p_state"));<NEW_LINE>PortletMode portletMode = new PortletMode(ParamUtil.getString(req, "p_p_mode"));<NEW_LINE>if (action) {<NEW_LINE>ActionRequestImpl actionRequest = new ActionRequestImpl(req, portlet, concretePortletWrapper, portletCtx, windowState, portletMode, portletPrefs, layout.getId());<NEW_LINE>ActionResponseImpl actionResponse = new ActionResponseImpl(actionRequest, res, portletId, user, layout, windowState, portletMode);<NEW_LINE>actionRequest.defineObjects(portletConfig, actionResponse);<NEW_LINE>concretePortletWrapper.processAction(actionRequest, actionResponse);<NEW_LINE>RenderParametersPool.put(req, layout.getId(), portletId, actionResponse.getRenderParameters());<NEW_LINE>} else {<NEW_LINE>// PortalUtil.updateWindowState(portletId, user, layout, windowState);<NEW_LINE>//<NEW_LINE>// PortalUtil.updatePortletMode(portletId, user, layout, portletMode);<NEW_LINE>}<NEW_LINE>}
req.getAttribute(WebKeys.CTX);
1,344,431
private static SetArgs createSetArgs3(Object[] argsArr) {<NEW_LINE>if (argsArr.length != 3) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args length invalid : %d", argsArr.length);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SetArgs setArgs = new SetArgs();<NEW_LINE>if (!(argsArr[0] instanceof Integer)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 0 not Integer, %s", argsArr[0]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.type = (Integer) argsArr[0];<NEW_LINE>}<NEW_LINE>if (!(argsArr[1] instanceof Long)) {<NEW_LINE>MatrixLog.w(TAG, "createSetArgs args idx 1 not Long, %s", argsArr[1]);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.triggerAtMillis = (Long) argsArr[1];<NEW_LINE>}<NEW_LINE>if (argsArr[2] != null && !(argsArr[2] instanceof PendingIntent)) {<NEW_LINE>MatrixLog.w(TAG<MASK><NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>setArgs.operation = (PendingIntent) argsArr[2];<NEW_LINE>}<NEW_LINE>return setArgs;<NEW_LINE>}
, "createSetArgs args idx 2 not PendingIntent, %s", argsArr[2]);
1,329,976
public void recordActivityEnd(ActivityInstance activityInstance) {<NEW_LINE>if (getHistoryConfigurationSettings().isHistoryEnabledForActivity(activityInstance)) {<NEW_LINE>if (StringUtils.isNotEmpty(activityInstance.getActivityId())) {<NEW_LINE>ObjectNode data = processEngineConfiguration.getObjectMapper().createObjectNode();<NEW_LINE>addCommonActivityInstanceFields(activityInstance, data);<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.DELETE_REASON, activityInstance.getDeleteReason());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.END_TIME, activityInstance.getEndTime());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.START_TIME, activityInstance.getStartTime());<NEW_LINE>ObjectNode correspondingActivityStartData = getActivityStart(<MASK><NEW_LINE>if (correspondingActivityStartData == null) {<NEW_LINE>getAsyncHistorySession().addHistoricData(getJobServiceConfiguration(), HistoryJsonConstants.TYPE_ACTIVITY_END, data);<NEW_LINE>} else {<NEW_LINE>getAsyncHistorySession().addHistoricData(getJobServiceConfiguration(), HistoryJsonConstants.TYPE_ACTIVITY_FULL, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
activityInstance.getId(), true);
343,551
public Request<ListPolicyPrincipalsRequest> marshall(ListPolicyPrincipalsRequest listPolicyPrincipalsRequest) {<NEW_LINE>if (listPolicyPrincipalsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListPolicyPrincipalsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListPolicyPrincipalsRequest> request = new DefaultRequest<ListPolicyPrincipalsRequest>(listPolicyPrincipalsRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>if (listPolicyPrincipalsRequest.getPolicyName() != null) {<NEW_LINE>request.addHeader("x-amzn-iot-policy", StringUtils.fromString(listPolicyPrincipalsRequest.getPolicyName()));<NEW_LINE>}<NEW_LINE>String uriResourcePath = "/policy-principals";<NEW_LINE>if (listPolicyPrincipalsRequest.getMarker() != null) {<NEW_LINE>request.addParameter("marker", StringUtils.fromString(listPolicyPrincipalsRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listPolicyPrincipalsRequest.getPageSize() != null) {<NEW_LINE>request.addParameter("pageSize", StringUtils.fromInteger(listPolicyPrincipalsRequest.getPageSize()));<NEW_LINE>}<NEW_LINE>if (listPolicyPrincipalsRequest.getAscendingOrder() != null) {<NEW_LINE>request.addParameter("isAscendingOrder", StringUtils.fromBoolean<MASK><NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(listPolicyPrincipalsRequest.getAscendingOrder()));
161,596
final ListProfileObjectTypeTemplatesResult executeListProfileObjectTypeTemplates(ListProfileObjectTypeTemplatesRequest listProfileObjectTypeTemplatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProfileObjectTypeTemplatesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProfileObjectTypeTemplatesRequest> request = null;<NEW_LINE>Response<ListProfileObjectTypeTemplatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProfileObjectTypeTemplatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProfileObjectTypeTemplatesRequest));<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, "Customer Profiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProfileObjectTypeTemplates");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProfileObjectTypeTemplatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProfileObjectTypeTemplatesResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();