idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
445,955 | public void channelRead(ChannelHandlerContext ctx, Object msg) {<NEW_LINE>Channel channel = ctx.channel();<NEW_LINE>Attribute<Context> contextAttr = channel.attr(AttributeKeys.SERVER_CONTEXT);<NEW_LINE>Attribute<HttpRequestAndChannel> requestAttr = channel.attr(AttributeKeys.SERVER_REQUEST);<NEW_LINE>if (!(msg instanceof HttpRequest)) {<NEW_LINE>Context serverContext = contextAttr.get();<NEW_LINE>if (serverContext == null) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>} else {<NEW_LINE>try (Scope ignored = serverContext.makeCurrent()) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Context parentContext = contextAttr.get();<NEW_LINE>if (parentContext == null) {<NEW_LINE>parentContext = Context.current();<NEW_LINE>}<NEW_LINE>HttpRequestAndChannel request = HttpRequestAndChannel.create((HttpRequest) msg, channel);<NEW_LINE>if (!instrumenter().shouldStart(parentContext, request)) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Context context = instrumenter(<MASK><NEW_LINE>contextAttr.set(context);<NEW_LINE>requestAttr.set(request);<NEW_LINE>try (Scope ignored = context.makeCurrent()) {<NEW_LINE>ctx.fireChannelRead(msg);<NEW_LINE>// the span is ended normally in HttpServerResponseTracingHandler<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>// make sure to remove the server context on end() call<NEW_LINE>instrumenter().end(contextAttr.getAndRemove(), requestAttr.getAndRemove(), null, throwable);<NEW_LINE>throw throwable;<NEW_LINE>}<NEW_LINE>} | ).start(parentContext, request); |
726,620 | public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) {<NEW_LINE>if (this.shouldCaptureInstance) {<NEW_LINE>this.binding.modifiers &= ~ClassFileConstants.AccStatic;<NEW_LINE>} else {<NEW_LINE>this.binding.modifiers |= ClassFileConstants.AccStatic;<NEW_LINE>}<NEW_LINE>SourceTypeBinding sourceType = currentScope.enclosingSourceType();<NEW_LINE>boolean firstSpill = <MASK><NEW_LINE>this.binding = sourceType.addSyntheticMethod(this);<NEW_LINE>int pc = codeStream.position;<NEW_LINE>StringBuffer signature = new StringBuffer();<NEW_LINE>signature.append('(');<NEW_LINE>if (this.shouldCaptureInstance) {<NEW_LINE>codeStream.aload_0();<NEW_LINE>signature.append(sourceType.signature());<NEW_LINE>}<NEW_LINE>for (int i = 0, length = this.outerLocalVariables == null ? 0 : this.outerLocalVariables.length; i < length; i++) {<NEW_LINE>SyntheticArgumentBinding syntheticArgument = this.outerLocalVariables[i];<NEW_LINE>if (this.shouldCaptureInstance && firstSpill) {<NEW_LINE>// finally block handling results in extra spills, avoid side effect.<NEW_LINE>syntheticArgument.resolvedPosition++;<NEW_LINE>}<NEW_LINE>signature.append(syntheticArgument.type.signature());<NEW_LINE>LocalVariableBinding capturedOuterLocal = syntheticArgument.actualOuterLocalVariable;<NEW_LINE>VariableBinding[] path = currentScope.getEmulationPath(capturedOuterLocal);<NEW_LINE>codeStream.generateOuterAccess(path, this, capturedOuterLocal, currentScope);<NEW_LINE>}<NEW_LINE>signature.append(')');<NEW_LINE>if (this.expectedType instanceof IntersectionTypeBinding18) {<NEW_LINE>signature.append(((IntersectionTypeBinding18) this.expectedType).getSAMType(currentScope).signature());<NEW_LINE>} else {<NEW_LINE>signature.append(this.expectedType.signature());<NEW_LINE>}<NEW_LINE>int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);<NEW_LINE>codeStream.invokeDynamic(invokeDynamicNumber, (this.shouldCaptureInstance ? 1 : 0) + this.outerLocalVariablesSlotSize, 1, this.descriptor.selector, signature.toString().toCharArray(), this.resolvedType.id, this.resolvedType);<NEW_LINE>if (!valueRequired)<NEW_LINE>codeStream.pop();<NEW_LINE>codeStream.recordPositionsFrom(pc, this.sourceStart);<NEW_LINE>} | !(this.binding instanceof SyntheticMethodBinding); |
1,473,262 | public void paintComponent(Graphics g) {<NEW_LINE>boolean pressed = getModel().isPressed();<NEW_LINE>boolean stateChanged = myWasPressed != pressed;<NEW_LINE>myWasPressed = pressed;<NEW_LINE>if (myBufferedImage == null || stateChanged) {<NEW_LINE>Dimension size = getSize();<NEW_LINE>Insets insets = getInsets();<NEW_LINE>int barWidth = size.width - INDENT;<NEW_LINE>myBufferedImage = ImageUtil.createImage(g, barWidth, <MASK><NEW_LINE>Graphics2D g2 = JBSwingUtilities.runGlobalCGTransform(this, myBufferedImage.createGraphics());<NEW_LINE>UISettings.setupAntialiasing(g2);<NEW_LINE>g2.setFont(getFont());<NEW_LINE>int textHeight = g2.getFontMetrics().getAscent();<NEW_LINE>Runtime rt = Runtime.getRuntime();<NEW_LINE>long maxMem = rt.maxMemory();<NEW_LINE>long allocatedMem = rt.totalMemory();<NEW_LINE>long unusedMem = rt.freeMemory();<NEW_LINE>long usedMem = allocatedMem - unusedMem;<NEW_LINE>int usedBarLength = (int) (barWidth * usedMem / maxMem);<NEW_LINE>int unusedBarLength = (int) (size.height * unusedMem / maxMem);<NEW_LINE>// background<NEW_LINE>g2.setColor(UIUtil.getPanelBackground());<NEW_LINE>g2.fillRect(0, 0, barWidth, size.height);<NEW_LINE>// gauge (used)<NEW_LINE>g2.setColor(USED_COLOR);<NEW_LINE>g2.fillRect(0, 0, usedBarLength, size.height);<NEW_LINE>// gauge (unused)<NEW_LINE>g2.setColor(UNUSED_COLOR);<NEW_LINE>g2.fillRect(usedBarLength, 0, unusedBarLength, size.height);<NEW_LINE>// label<NEW_LINE>g2.setColor(pressed ? UIUtil.getLabelDisabledForeground() : JBColor.foreground());<NEW_LINE>String text = UIBundle.message("memory.usage.panel.message.text", usedMem / MEGABYTE, maxMem / MEGABYTE);<NEW_LINE>int textX = insets.left;<NEW_LINE>int textY = insets.top + (size.height - insets.top - insets.bottom - textHeight) / 2 + textHeight - JBUIScale.scale(1);<NEW_LINE>g2.drawString(text, textX, textY);<NEW_LINE>g2.dispose();<NEW_LINE>}<NEW_LINE>UIUtil.drawImage(g, myBufferedImage, INDENT, 0, null);<NEW_LINE>} | size.height, BufferedImage.TYPE_INT_RGB); |
1,849,777 | public int writeVarInt(long value) {<NEW_LINE>assert value != Long.MIN_VALUE;<NEW_LINE>final long signMask <MASK><NEW_LINE>final long magnitude = value < 0 ? -value : value;<NEW_LINE>if (magnitude < VAR_INT_2_OCTET_MIN_VALUE) {<NEW_LINE>writeUInt8((magnitude & VAR_INT_SIGNED_OCTET_MASK) | VAR_INT_FINAL_OCTET_SIGNAL_MASK | signMask);<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>final long signBit = value < 0 ? 1 : 0;<NEW_LINE>final int remaining = remaining();<NEW_LINE>if (magnitude < VAR_INT_3_OCTET_MIN_VALUE && remaining >= 2) {<NEW_LINE>return writeVarUIntDirect2(magnitude | (signBit << VAR_SINT_2_OCTET_SHIFT));<NEW_LINE>} else if (magnitude < VAR_INT_4_OCTET_MIN_VALUE && remaining >= 3) {<NEW_LINE>return writeVarUIntDirect3(magnitude | (signBit << VAR_SINT_3_OCTET_SHIFT));<NEW_LINE>} else if (magnitude < VAR_INT_5_OCTET_MIN_VALUE && remaining >= 4) {<NEW_LINE>return writeVarUIntDirect4(magnitude | (signBit << VAR_SINT_4_OCTET_SHIFT));<NEW_LINE>} else if (magnitude < VAR_INT_6_OCTET_MIN_VALUE && remaining >= 5) {<NEW_LINE>return writeVarUIntDirect5(magnitude | (signBit << VAR_SINT_5_OCTET_SHIFT));<NEW_LINE>}<NEW_LINE>// TODO determine if it is worth doing the fast path beyond 2**34 - 1<NEW_LINE>// we give up--go to the slow path<NEW_LINE>return writeVarIntSlow(magnitude, signMask);<NEW_LINE>} | = value < 0 ? VAR_INT_SIGNBIT_ON_MASK : VAR_INT_SIGNBIT_OFF_MASK; |
855,559 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2".split(",");<NEW_LINE>String epl = "@name('s0') select " + "value = all (select sum(intPrimitive) from SupportBean#keepall group by theString) as c0, " + "value = any (select sum(intPrimitive) from SupportBean#keepall group by theString) as c1, " + "value = some (select sum(intPrimitive) from SupportBean#keepall group by theString) as c2 " + "from SupportValueEvent";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { true, false, false });<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { true, true, true });<NEW_LINE>env.sendEventBean(new SupportBean("E2", 11));<NEW_LINE>sendVEAndAssert(env, fields, 10, new Object[] { false, true, true });<NEW_LINE>env.undeployAll();<NEW_LINE>} | new SupportBean("E1", 10)); |
289,768 | public static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException {<NEW_LINE>if (buffer.start != buffer.offset)<NEW_LINE>throw new IllegalArgumentException("Buffer previously used and had not been reset.");<NEW_LINE>if (messages.isEmpty()) {<NEW_LINE>System.arraycopy(EMPTY_ARRAY, 0, buffer.buffer, buffer.offset, EMPTY_ARRAY.length);<NEW_LINE>buffer.offset += EMPTY_ARRAY.length;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JsonXOutput output = new JsonXOutput(<MASK><NEW_LINE>output.writeStartArray();<NEW_LINE>boolean first = true;<NEW_LINE>for (T m : messages) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>output.writeStartObject();<NEW_LINE>} else<NEW_LINE>output.writeCommaAndStartObject();<NEW_LINE>schema.writeTo(output, m);<NEW_LINE>if (output.isLastRepeated())<NEW_LINE>output.writeEndArray();<NEW_LINE>output.writeEndObject().reset();<NEW_LINE>}<NEW_LINE>output.writeEndArray();<NEW_LINE>LinkedBuffer.writeTo(out, buffer);<NEW_LINE>} | buffer, out, numeric, schema); |
1,110,033 | public Expr apply(Expr expr, Analyzer analyzer, ExprRewriter.ClauseType clauseType) throws AnalysisException {<NEW_LINE>SlotRef queryColumnSlotRef;<NEW_LINE>Column mvColumn;<NEW_LINE>// meet the condition<NEW_LINE>if (!(expr instanceof FunctionCallExpr)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>FunctionCallExpr fnExpr = (FunctionCallExpr) expr;<NEW_LINE>String fnNameString = fnExpr.getFnName().getFunction();<NEW_LINE>if (!fnNameString.equalsIgnoreCase("hll_union") && !fnNameString.equalsIgnoreCase("hll_raw_agg") && !fnNameString.equalsIgnoreCase("hll_union_agg")) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (!(fnExpr.getChild(0) instanceof FunctionCallExpr)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>FunctionCallExpr child0FnExpr = (FunctionCallExpr) fnExpr.getChild(0);<NEW_LINE>if (!child0FnExpr.getFnName().getFunction().equalsIgnoreCase("hll_hash")) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>if (child0FnExpr.getChild(0) instanceof SlotRef) {<NEW_LINE>queryColumnSlotRef = (<MASK><NEW_LINE>} else if (child0FnExpr.getChild(0) instanceof CastExpr) {<NEW_LINE>CastExpr castExpr = (CastExpr) child0FnExpr.getChild(0);<NEW_LINE>if (!(castExpr.getChild(0) instanceof SlotRef)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>queryColumnSlotRef = (SlotRef) castExpr.getChild(0);<NEW_LINE>} else {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>Column column = queryColumnSlotRef.getColumn();<NEW_LINE>Table table = queryColumnSlotRef.getTable();<NEW_LINE>if (column == null || table == null || !(table instanceof OlapTable)) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>OlapTable olapTable = (OlapTable) table;<NEW_LINE>// check column<NEW_LINE>String queryColumnName = column.getName();<NEW_LINE>String mvColumnName = CreateMaterializedViewStmt.mvColumnBuilder(AggregateType.HLL_UNION.name().toLowerCase(), queryColumnName);<NEW_LINE>mvColumn = olapTable.getVisibleColumn(mvColumnName);<NEW_LINE>if (mvColumn == null) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>// equal expr<NEW_LINE>return rewriteExpr(fnNameString, queryColumnSlotRef, mvColumn, analyzer);<NEW_LINE>} | SlotRef) child0FnExpr.getChild(0); |
1,206,424 | public final T build(String[] args) {<NEW_LINE>T config = newConfiguration();<NEW_LINE>Map<String, Param> paramMap = getParamMap();<NEW_LINE>Set<String> appliedParams = new TreeSet<>(CASE_INSENSITIVE_ORDER);<NEW_LINE>for (String arg : args) {<NEW_LINE>if (!arg.startsWith("--")) {<NEW_LINE>throw new IllegalArgumentException("All arguments must start with '--': " + arg);<NEW_LINE>}<NEW_LINE>String[] pair = arg.substring(2).split("=", 2);<NEW_LINE>String key = pair[0];<NEW_LINE>String value = "";<NEW_LINE>if (pair.length == 2) {<NEW_LINE>value = pair[1];<NEW_LINE>}<NEW_LINE>// If help was requested, just throw now to print out the usage.<NEW_LINE>if (HELP.getName().equalsIgnoreCase(key)) {<NEW_LINE>throw new IllegalArgumentException("Help requested");<NEW_LINE>}<NEW_LINE>Param <MASK><NEW_LINE>if (param == null) {<NEW_LINE>throw new IllegalArgumentException("Unsupported argument: " + key);<NEW_LINE>}<NEW_LINE>param.setValue(config, value);<NEW_LINE>appliedParams.add(key);<NEW_LINE>}<NEW_LINE>// Ensure that all required options have been provided.<NEW_LINE>for (Param param : getParams()) {<NEW_LINE>if (param.isRequired() && !appliedParams.contains(param.getName())) {<NEW_LINE>throw new IllegalArgumentException("Missing required option '--" + param.getName() + "'.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return build0(config);<NEW_LINE>} | param = paramMap.get(key); |
1,274,809 | private LogRecordWithDLSN doReadNext(boolean nonBlocking) throws IOException {<NEW_LINE>LogRecordWithDLSN record = null;<NEW_LINE>do {<NEW_LINE>// fetch one record until we don't find any entry available in the readahead cache<NEW_LINE>while (null == record) {<NEW_LINE>if (null == currentEntry) {<NEW_LINE>currentEntry = readNextEntry(nonBlocking);<NEW_LINE>if (null == currentEntry) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>record = currentEntry.nextRecord();<NEW_LINE>if (null == record) {<NEW_LINE>currentEntry = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check if we reached the end of stream<NEW_LINE>if (record.isEndOfStream()) {<NEW_LINE>EndOfStreamException eos = new EndOfStreamException("End of Stream Reached for " + readHandler.getFullyQualifiedName());<NEW_LINE><MASK><NEW_LINE>throw eos;<NEW_LINE>}<NEW_LINE>// skip control records<NEW_LINE>if (record.isControl()) {<NEW_LINE>record = null;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!positioned) {<NEW_LINE>if (record.getTransactionId() < startTransactionId.get()) {<NEW_LINE>record = null;<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>positioned = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>return record;<NEW_LINE>} | readerException.compareAndSet(null, eos); |
1,600,588 | protected String generateSourceView(String source, String extension, boolean prettyPrint) {<NEW_LINE>String[] lines = source.split("\n");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<!-- start blob table -->");<NEW_LINE>sb.append("<table width=\"100%\"><tbody><tr>");<NEW_LINE>// nums column<NEW_LINE>sb.append("<!-- start nums column -->");<NEW_LINE>sb.append("<td id=\"nums\">");<NEW_LINE>sb.append("<pre>");<NEW_LINE>String numPattern = "<span id=\"L{0}\" class=\"jump\"></span><a href=\"#L{0}\">{0}</a>\n";<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>sb.append(MessageFormat.format(numPattern, "" <MASK><NEW_LINE>}<NEW_LINE>sb.append("</pre>");<NEW_LINE>sb.append("<!-- end nums column -->");<NEW_LINE>sb.append("</td>");<NEW_LINE>sb.append("<!-- start lines column -->");<NEW_LINE>sb.append("<td id=\"lines\">");<NEW_LINE>sb.append("<div class=\"sourceview\">");<NEW_LINE>if (prettyPrint) {<NEW_LINE>sb.append("<pre class=\"prettyprint lang-" + extension + "\">");<NEW_LINE>} else {<NEW_LINE>sb.append("<pre class=\"plainprint\">");<NEW_LINE>}<NEW_LINE>final int tabLength = app().settings().getInteger(Keys.web.tabLength, 4);<NEW_LINE>lines = StringUtils.escapeForHtml(source, true, tabLength).split("\n");<NEW_LINE>sb.append("<table width=\"100%\"><tbody>");<NEW_LINE>String linePattern = "<tr class=\"{0}\"><td><div><span class=\"line\">{1}</span></div>\r</tr>";<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>String line = lines[i].replace('\r', ' ');<NEW_LINE>String cssClass = (i % 2 == 0) ? "even" : "odd";<NEW_LINE>if (StringUtils.isEmpty(line.trim())) {<NEW_LINE>line = " ";<NEW_LINE>}<NEW_LINE>sb.append(MessageFormat.format(linePattern, cssClass, line, "" + (i + 1)));<NEW_LINE>}<NEW_LINE>sb.append("</tbody></table></pre>");<NEW_LINE>sb.append("</pre>");<NEW_LINE>sb.append("</div>");<NEW_LINE>sb.append("</td>");<NEW_LINE>sb.append("<!-- end lines column -->");<NEW_LINE>sb.append("</tr></tbody></table>");<NEW_LINE>sb.append("<!-- end blob table -->");<NEW_LINE>return sb.toString();<NEW_LINE>} | + (i + 1))); |
1,324,670 | public boolean hasSaveRelevantChanges(final OfflineLogEntry prev) {<NEW_LINE>// Do not erase the saved log if the user has removed all the characters<NEW_LINE>// without using "Clear". This may be a manipulation mistake, and erasing<NEW_LINE>// again will be easy using "Clear" while retyping the text may not be.<NEW_LINE>boolean changed = StringUtils.isNotEmpty(log) && !StringUtils.equals(log, prev.log);<NEW_LINE>// other changes however lead to save anyway<NEW_LINE>changed |= !Objects.equals(logType, prev.logType);<NEW_LINE>changed |= !Objects.equals(reportProblem, prev.reportProblem);<NEW_LINE>changed |= !Objects.equals(date, prev.date);<NEW_LINE>changed |= favorite != prev.favorite;<NEW_LINE>changed |= tweet != prev.tweet;<NEW_LINE>changed |= !equalsFloat(<MASK><NEW_LINE>changed |= !Objects.equals(password, prev.password);<NEW_LINE>changed |= !Objects.equals(imageScale, prev.imageScale);<NEW_LINE>changed |= !Objects.equals(imageTitlePraefix, prev.imageTitlePraefix);<NEW_LINE>changed |= logImages.size() != prev.logImages.size() || !new HashSet<>(logImages).equals(new HashSet<>(prev.logImages));<NEW_LINE>changed |= !Objects.equals(trackableActions, prev.trackableActions);<NEW_LINE>return changed;<NEW_LINE>} | rating, prev.rating, 0.2f); |
1,628,069 | private void initComponents() {<NEW_LINE>// Init strategies list<NEW_LINE>this.mainPanel = new TransparentPanel(new BorderLayout());<NEW_LINE>JPanel infoTitlePanel = new TransparentPanel(new FlowLayout(FlowLayout.CENTER));<NEW_LINE>JTextArea firstDescription = new JTextArea(GuiActivator.getResources<MASK><NEW_LINE>JLabel title = new JLabel(GuiActivator.getResources().getI18NString("impl.gui.main.account.DEFAULT_PAGE_TITLE"));<NEW_LINE>// Title<NEW_LINE>title.setFont(title.getFont().deriveFont(Font.BOLD, 14.0f));<NEW_LINE>infoTitlePanel.add(title);<NEW_LINE>this.mainPanel.add(infoTitlePanel, BorderLayout.NORTH);<NEW_LINE>// Description<NEW_LINE>firstDescription.setLineWrap(true);<NEW_LINE>firstDescription.setEditable(false);<NEW_LINE>firstDescription.setOpaque(false);<NEW_LINE>firstDescription.setRows(6);<NEW_LINE>firstDescription.setWrapStyleWord(true);<NEW_LINE>firstDescription.setAutoscrolls(false);<NEW_LINE>this.mainPanel.add(firstDescription);<NEW_LINE>} | ().getI18NString("impl.gui.main.account.DEFAULT_PAGE_BODY")); |
15,549 | private static boolean isPregMatchInverted(@NotNull FunctionReference reference) {<NEW_LINE>boolean result = false;<NEW_LINE>final PsiElement parent = reference.getParent();<NEW_LINE>if (ExpressionSemanticUtil.isUsedAsLogicalOperand(reference)) {<NEW_LINE>if (parent instanceof UnaryExpression) {<NEW_LINE>result = OpenapiTypesUtil.is(((UnaryExpression) parent).getOperation(), PhpTokenTypes.opNOT);<NEW_LINE>}<NEW_LINE>} else if (parent instanceof BinaryExpression) {<NEW_LINE>// inverted: < 1, == 0, === 0, != 1, !== 1<NEW_LINE>// not inverted: > 0, == 1, === 1, != 0, !== 0<NEW_LINE>final BinaryExpression binary = (BinaryExpression) parent;<NEW_LINE>final <MASK><NEW_LINE>if (operator == PhpTokenTypes.opLESS || OpenapiTypesUtil.tsCOMPARE_EQUALITY_OPS.contains(operator)) {<NEW_LINE>final PsiElement second = OpenapiElementsUtil.getSecondOperand(binary, reference);<NEW_LINE>if (OpenapiTypesUtil.isNumber(second)) {<NEW_LINE>final String number = second.getText();<NEW_LINE>result = operator == PhpTokenTypes.opLESS && number.equals("1") || operator == PhpTokenTypes.opEQUAL && number.equals("0") || operator == PhpTokenTypes.opIDENTICAL && number.equals("0") || operator == PhpTokenTypes.opNOT_EQUAL && number.equals("1") || operator == PhpTokenTypes.opNOT_IDENTICAL && number.equals("1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | IElementType operator = binary.getOperationType(); |
43,821 | public static FindCredentialsListResponse unmarshall(FindCredentialsListResponse findCredentialsListResponse, UnmarshallerContext _ctx) {<NEW_LINE>findCredentialsListResponse.setRequestId(_ctx.stringValue("FindCredentialsListResponse.RequestId"));<NEW_LINE>findCredentialsListResponse.setCode(_ctx.integerValue("FindCredentialsListResponse.Code"));<NEW_LINE>findCredentialsListResponse.setMessage(_ctx.stringValue("FindCredentialsListResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("FindCredentialsListResponse.Data.CurrentPage"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("FindCredentialsListResponse.Data.PageNumber"));<NEW_LINE>List<Credential> credentialList = new ArrayList<Credential>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("FindCredentialsListResponse.Data.CredentialList.Length"); i++) {<NEW_LINE>Credential credential = new Credential();<NEW_LINE>credential.setGmtCreate(_ctx.longValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].GmtCreate"));<NEW_LINE>credential.setId(_ctx.longValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].Id"));<NEW_LINE>credential.setName(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].Name"));<NEW_LINE>credential.setOwnerAttr(_ctx.stringValue<MASK><NEW_LINE>credential.setUserId(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].UserId"));<NEW_LINE>CurrentCredential currentCredential = new CurrentCredential();<NEW_LINE>currentCredential.setAccessKey(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].CurrentCredential.AccessKey"));<NEW_LINE>currentCredential.setSecretKey(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].CurrentCredential.SecretKey"));<NEW_LINE>credential.setCurrentCredential(currentCredential);<NEW_LINE>NewCredential newCredential = new NewCredential();<NEW_LINE>newCredential.setAccessKey(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].NewCredential.AccessKey"));<NEW_LINE>newCredential.setSecretKey(_ctx.stringValue("FindCredentialsListResponse.Data.CredentialList[" + i + "].NewCredential.SecretKey"));<NEW_LINE>credential.setNewCredential(newCredential);<NEW_LINE>credentialList.add(credential);<NEW_LINE>}<NEW_LINE>data.setCredentialList(credentialList);<NEW_LINE>findCredentialsListResponse.setData(data);<NEW_LINE>return findCredentialsListResponse;<NEW_LINE>} | ("FindCredentialsListResponse.Data.CredentialList[" + i + "].OwnerAttr")); |
375,487 | private int addBootStrapRecordEntry(int localContentsOffset, TypeDeclaration typeDecl, Map<String, Integer> fPtr) {<NEW_LINE>TypeBinding type = typeDecl.binding;<NEW_LINE>// sanity check<NEW_LINE>assert type.isRecord();<NEW_LINE>final int contentsEntries = 10;<NEW_LINE>int indexForObjectMethodBootStrap = fPtr.get(ClassFile.BOOTSTRAP_STRING);<NEW_LINE>if (contentsEntries + localContentsOffset >= this.contents.length) {<NEW_LINE>resizeContents(contentsEntries);<NEW_LINE>}<NEW_LINE>if (indexForObjectMethodBootStrap == 0) {<NEW_LINE>ReferenceBinding javaLangRuntimeObjectMethods = this.referenceBinding.scope.getJavaLangRuntimeObjectMethods();<NEW_LINE>indexForObjectMethodBootStrap = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, javaLangRuntimeObjectMethods, ConstantPool.BOOTSTRAP, ConstantPool.JAVA_LANG_RUNTIME_OBJECTMETHOD_BOOTSTRAP_SIGNATURE, false);<NEW_LINE>fPtr.put(ClassFile.BOOTSTRAP_STRING, indexForObjectMethodBootStrap);<NEW_LINE>}<NEW_LINE>this.contents[localContentsOffset++] = (byte) (indexForObjectMethodBootStrap >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) indexForObjectMethodBootStrap;<NEW_LINE>// u2 num_bootstrap_arguments<NEW_LINE>int numArgsLocation = localContentsOffset;<NEW_LINE>localContentsOffset += 2;<NEW_LINE>char[] recordName = type.constantPoolName();<NEW_LINE>int recordIndex = <MASK><NEW_LINE>this.contents[localContentsOffset++] = (byte) (recordIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) recordIndex;<NEW_LINE>assert type instanceof SourceTypeBinding;<NEW_LINE>SourceTypeBinding sourceType = (SourceTypeBinding) type;<NEW_LINE>FieldBinding[] recordComponents = sourceType.getImplicitComponentFields();<NEW_LINE>int numArgs = 2 + recordComponents.length;<NEW_LINE>this.contents[numArgsLocation++] = (byte) (numArgs >> 8);<NEW_LINE>this.contents[numArgsLocation] = (byte) numArgs;<NEW_LINE>String names = // $NON-NLS-1$<NEW_LINE>Arrays.stream(recordComponents).map(f -> new String(f.name)).// $NON-NLS-1$<NEW_LINE>reduce((s1, s2) -> {<NEW_LINE>return s1 + ";" + s2;<NEW_LINE>}).orElse(Util.EMPTY_STRING);<NEW_LINE>int namesIndex = this.constantPool.literalIndex(names);<NEW_LINE>this.contents[localContentsOffset++] = (byte) (namesIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) namesIndex;<NEW_LINE>if (recordComponents.length * 2 + localContentsOffset >= this.contents.length) {<NEW_LINE>resizeContents(recordComponents.length * 2);<NEW_LINE>}<NEW_LINE>for (FieldBinding field : recordComponents) {<NEW_LINE>int methodHandleIndex = this.constantPool.literalIndexForMethodHandleFieldRef(ClassFileConstants.MethodHandleRefKindGetField, recordName, field.name, field.type.signature());<NEW_LINE>this.contents[localContentsOffset++] = (byte) (methodHandleIndex >> 8);<NEW_LINE>this.contents[localContentsOffset++] = (byte) methodHandleIndex;<NEW_LINE>}<NEW_LINE>return localContentsOffset;<NEW_LINE>} | this.constantPool.literalIndexForType(recordName); |
1,005,170 | public void scanBarCode(ScanResult callback) {<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (getActivity() instanceof CodenameOneActivity) {<NEW_LINE>((CodenameOneActivity) getActivity<MASK><NEW_LINE>}<NEW_LINE>this.callback = callback;<NEW_LINE>IntentIntegrator in = new IntentIntegrator(getActivity());<NEW_LINE>Collection<String> types = IntentIntegrator.PRODUCT_CODE_TYPES;<NEW_LINE>if (Display.getInstance().getProperty("scanAllCodeTypes", "false").equals("true")) {<NEW_LINE>types = IntentIntegrator.ALL_CODE_TYPES;<NEW_LINE>}<NEW_LINE>if (Display.getInstance().getProperty("android.scanTypes", null) != null) {<NEW_LINE>String[] arr = Display.getInstance().getProperty("android.scanTypes", null).split(";");<NEW_LINE>types = Arrays.asList(arr);<NEW_LINE>}<NEW_LINE>if (!in.initiateScan(types, "ONE_D_MODE")) {<NEW_LINE>// restore old activity handling<NEW_LINE>Display.getInstance().callSerially(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>CodeScannerImpl.this.callback.scanError(-1, "no scan app");<NEW_LINE>CodeScannerImpl.this.callback = null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (getActivity() instanceof CodenameOneActivity) {<NEW_LINE>((CodenameOneActivity) getActivity()).restoreIntentResultListener();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).setIntentResultListener(this); |
56,535 | Response toFeignResponse(ClassicHttpResponse httpResponse, Request request) throws IOException {<NEW_LINE>final int statusCode = httpResponse.getCode();<NEW_LINE>final String reason = httpResponse.getReasonPhrase();<NEW_LINE>final Map<String, Collection<String>> headers = new HashMap<String, Collection<String>>();<NEW_LINE>for (final Header header : httpResponse.getHeaders()) {<NEW_LINE>final String name = header.getName();<NEW_LINE>final String value = header.getValue();<NEW_LINE>Collection<String> headerValues = headers.get(name);<NEW_LINE>if (headerValues == null) {<NEW_LINE>headerValues = new ArrayList<String>();<NEW_LINE>headers.put(name, headerValues);<NEW_LINE>}<NEW_LINE>headerValues.add(value);<NEW_LINE>}<NEW_LINE>return Response.builder().protocolVersion(enumForName(Request.ProtocolVersion.class, httpResponse.getVersion().format())).status(statusCode).reason(reason).headers(headers).request(request).body(toFeignBody<MASK><NEW_LINE>} | (httpResponse)).build(); |
1,515,748 | final DescribeDirectConnectGatewayAssociationsResult executeDescribeDirectConnectGatewayAssociations(DescribeDirectConnectGatewayAssociationsRequest describeDirectConnectGatewayAssociationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDirectConnectGatewayAssociationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDirectConnectGatewayAssociationsRequest> request = null;<NEW_LINE>Response<DescribeDirectConnectGatewayAssociationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDirectConnectGatewayAssociationsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDirectConnectGatewayAssociations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDirectConnectGatewayAssociationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDirectConnectGatewayAssociationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeDirectConnectGatewayAssociationsRequest)); |
486,086 | CdmAttributeContext copyAttributeContextTree(final ResolveOptions resOpt, final CdmAttributeContext newNode) {<NEW_LINE>// remember which node in the new tree replaces which node in the old tree<NEW_LINE>// the caller MUST use this to replace the explicit references held in the lineage and parent reference objects<NEW_LINE>// and to change the context node that any associated resolved attributes will be pointing at<NEW_LINE>// so we can see the replacement for a copied node<NEW_LINE>resOpt.getMapOldCtxToNewCtx().put(this, newNode);<NEW_LINE>// now copy the children<NEW_LINE>for (final CdmObject child : this.contents) {<NEW_LINE>if (child instanceof CdmAttributeContext) {<NEW_LINE>final CdmAttributeContext childAsAttributeContext = (CdmAttributeContext) child;<NEW_LINE>final CdmAttributeContext newChild = (CdmAttributeContext) childAsAttributeContext.copyNode(resOpt);<NEW_LINE>// need to NOT trigger the collection fix up and parent code<NEW_LINE>newNode.getContents().allItems.add(newChild);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newNode;<NEW_LINE>} | childAsAttributeContext.copyAttributeContextTree(resOpt, newChild); |
717,748 | public Request<DeleteVocabularyRequest> marshall(DeleteVocabularyRequest deleteVocabularyRequest) {<NEW_LINE>if (deleteVocabularyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DeleteVocabularyRequest)");<NEW_LINE>}<NEW_LINE>Request<DeleteVocabularyRequest> request = new DefaultRequest<DeleteVocabularyRequest>(deleteVocabularyRequest, "AmazonConnect");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/vocabulary-remove/{InstanceId}/{VocabularyId}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (deleteVocabularyRequest.getInstanceId() == null) ? "" : StringUtils.fromString(deleteVocabularyRequest.getInstanceId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{VocabularyId}", (deleteVocabularyRequest.getVocabularyId() == null) ? "" : StringUtils.fromString<MASK><NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>request.addHeader("Content-Length", "0");<NEW_LINE>request.setContent(new ByteArrayInputStream(new byte[0]));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (deleteVocabularyRequest.getVocabularyId())); |
1,492,472 | public void execute() throws ZinggClientException {<NEW_LINE>try {<NEW_LINE>// read input, filter, remove self joins<NEW_LINE>Dataset<Row> testData = getTestData();<NEW_LINE>testData = testData.repartition(args.getNumPartitions(), testData.col(ColName.ID_COL));<NEW_LINE>// testData = dropDuplicates(testData);<NEW_LINE>long count = testData.count();<NEW_LINE>LOG.info("Read " + count);<NEW_LINE>Analytics.track(Metric.DATA_COUNT, count, args.getCollectMetrics());<NEW_LINE>Dataset<Row> blocked = getBlocked(testData);<NEW_LINE>LOG.info("Blocked ");<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Num distinct hashes " + blocked.select(ColName.HASH_COL).<MASK><NEW_LINE>}<NEW_LINE>// LOG.warn("Num distinct hashes " + blocked.agg(functions.approx_count_distinct(ColName.HASH_COL)).count());<NEW_LINE>Dataset<Row> blocks = getBlocks(selectColsFromBlocked(blocked), testData);<NEW_LINE>// blocks.explain();<NEW_LINE>// LOG.info("Blocks " + blocks.count());<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("block size" + blocks.count());<NEW_LINE>}<NEW_LINE>// blocks.toJavaRDD().saveAsTextFile("/tmp/zblocks");<NEW_LINE>// check if all fields equal<NEW_LINE>// Dataset<Row> allEqual = DSUtil.allFieldsEqual(blocks, args);<NEW_LINE>// allEqual = allEqual.cache();<NEW_LINE>// send remaining to model<NEW_LINE>Model model = getModel();<NEW_LINE>// blocks.cache().withColumn("partition_id", functions.spark_partition_id())<NEW_LINE>// .groupBy("partition_id").agg(functions.count("z_id")).ias("zid").orderBy("partition_id").;<NEW_LINE>// .exceptAll(allEqual));<NEW_LINE>Dataset<Row> dupes = model.predict(blocks);<NEW_LINE>// allEqual = massageAllEquals(allEqual);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Found dupes " + dupes.count());<NEW_LINE>}<NEW_LINE>// dupes = dupes.cache();<NEW_LINE>// allEqual = allEqual.cache();<NEW_LINE>// writeOutput(blocked, dupes.union(allEqual).cache());<NEW_LINE>Dataset<Row> dupesActual = getDupesActualForGraph(dupes);<NEW_LINE>// dupesActual.explain();<NEW_LINE>// dupesActual.toJavaRDD().saveAsTextFile("/tmp/zdupes");<NEW_LINE>writeOutput(testData, dupesActual);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new ZinggClientException(e.getMessage());<NEW_LINE>}<NEW_LINE>} | distinct().count()); |
1,706,954 | public void execute(final JobExecutionContext jobCtx) throws JobExecutionException {<NEW_LINE>TopicConnection conn = null;<NEW_LINE>TopicSession sess = null;<NEW_LINE>TopicPublisher publisher = null;<NEW_LINE>try {<NEW_LINE>final <MASK><NEW_LINE>final Context namingCtx = JmsHelper.getInitialContext(dataMap);<NEW_LINE>final TopicConnectionFactory connFactory = (TopicConnectionFactory) namingCtx.lookup(dataMap.getString(JmsHelper.JMS_CONNECTION_FACTORY_JNDI));<NEW_LINE>if (!JmsHelper.isDestinationSecure(dataMap)) {<NEW_LINE>conn = connFactory.createTopicConnection();<NEW_LINE>} else {<NEW_LINE>final String user = dataMap.getString(JmsHelper.JMS_USER);<NEW_LINE>final String password = dataMap.getString(JmsHelper.JMS_PASSWORD);<NEW_LINE>conn = connFactory.createTopicConnection(user, password);<NEW_LINE>}<NEW_LINE>final boolean useTransaction = JmsHelper.useTransaction(dataMap);<NEW_LINE>final int ackMode = dataMap.getInt(JmsHelper.JMS_ACK_MODE);<NEW_LINE>sess = conn.createTopicSession(useTransaction, ackMode);<NEW_LINE>final Topic topic = (Topic) namingCtx.lookup(dataMap.getString(JmsHelper.JMS_DESTINATION_JNDI));<NEW_LINE>publisher = sess.createPublisher(topic);<NEW_LINE>final JmsMessageFactory messageFactory = JmsHelper.getMessageFactory(dataMap.getString(JmsHelper.JMS_MSG_FACTORY_CLASS_NAME));<NEW_LINE>final Message msg = messageFactory.createMessage(dataMap, sess);<NEW_LINE>publisher.publish(msg);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new JobExecutionException(e);<NEW_LINE>} finally {<NEW_LINE>JmsHelper.closeResource(publisher);<NEW_LINE>JmsHelper.closeResource(sess);<NEW_LINE>JmsHelper.closeResource(conn);<NEW_LINE>}<NEW_LINE>} | JobDataMap dataMap = jobCtx.getMergedJobDataMap(); |
1,445,876 | public void replaceShrinkResourcesTransform() {<NEW_LINE>File shrinkerOutput = FileUtils.join(variantContext.getScope().getGlobalScope().getIntermediatesDir(), "res_stripped", variantContext.getScope().getVariantConfiguration().getDirName());<NEW_LINE>List<TransformTask> baseTransforms = TransformManager.findTransformTaskByTransformType(variantContext, ShrinkResourcesTransform.class);<NEW_LINE>for (TransformTask transform : baseTransforms) {<NEW_LINE>ShrinkResourcesTransform oldTransform = (ShrinkResourcesTransform) transform.getTransform();<NEW_LINE>ResourcesShrinker resourcesShrinker = new ResourcesShrinker(oldTransform, variantContext.getVariantData(), variantContext.getScope().getOutput(TaskOutputHolder.TaskOutputType.PROCESSED_RES), shrinkerOutput, AaptGeneration.fromProjectOptions(variantContext.getScope().getGlobalScope().getProjectOptions()), variantContext.getScope().getOutput(TaskOutputHolder.TaskOutputType.SPLIT_LIST), variantContext.getProject().getLogger(), variantContext);<NEW_LINE>ReflectUtils.<MASK><NEW_LINE>}<NEW_LINE>} | updateField(transform, "transform", resourcesShrinker); |
1,138,831 | private static Set<String> buildTagsInformative() {<NEW_LINE>Set<String> set = new HashSet<>();<NEW_LINE>set.add(OboFormatTag.TAG_IS_A.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_RELATIONSHIP.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_DISJOINT_FROM.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_INTERSECTION_OF.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_UNION_OF.getTag());<NEW_LINE>set.add(<MASK><NEW_LINE>// removed OboFormatTag.TAG_REPLACED_BY to be compatible with OBO-Edit<NEW_LINE>set.add(OboFormatTag.TAG_PROPERTY_VALUE.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_DOMAIN.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_RANGE.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_INVERSE_OF.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_TRANSITIVE_OVER.getTag());<NEW_LINE>// removed OboFormatTag.TAG_HOLDS_OVER_CHAIN to be compatible with<NEW_LINE>// OBO-Edit<NEW_LINE>set.add(OboFormatTag.TAG_EQUIVALENT_TO_CHAIN.getTag());<NEW_LINE>set.add(OboFormatTag.TAG_DISJOINT_OVER.getTag());<NEW_LINE>return set;<NEW_LINE>} | OboFormatTag.TAG_EQUIVALENT_TO.getTag()); |
73,641 | public double estimate(KNNSearcher<DBIDRef> knnq, DistanceQuery<? extends Object> distq, DBIDRef cur, int k) {<NEW_LINE>final boolean issquared = distq.getDistance().isSquared();<NEW_LINE>final KNNList kl = knnq.getKNN(cur, k);<NEW_LINE>final double r = kl.getKNNDistance(), r2 = issquared ? r : r * r;<NEW_LINE>double sum = 0;<NEW_LINE>// We fill the upper triangle only,<NEW_LINE>DoubleDBIDListIter ii = kl.iter(), ij = kl.iter();<NEW_LINE>long valid = 0;<NEW_LINE>// Compute pairwise distances:<NEW_LINE>for (ii.seek(0); ii.valid(); ii.advance()) {<NEW_LINE>final double kdi = ii.doubleValue();<NEW_LINE>if (kdi <= 0. || kdi >= r) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double Di2 = issquared ? kdi : kdi * kdi;<NEW_LINE>double r2mDi2 = 2 * (r2 - Di2), ir2mDi2 = 1. / r2mDi2;<NEW_LINE>for (ij.seek(ii.getOffset() + 1); ij.valid(); ij.advance()) {<NEW_LINE>final double kdj = ij.doubleValue();<NEW_LINE>if (kdj <= 0. || kdj >= r) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final double d = distq.distance(ii, ij);<NEW_LINE>double Dj2 = issquared ? kdj : kdj * kdj, V2 = issquared ? d : d * d;<NEW_LINE>// Real point:<NEW_LINE>double S = Di2 + V2 - Dj2;<NEW_LINE>S = (Math.sqrt(S * S + 2 * V2 * r2mDi2) - S) * ir2mDi2;<NEW_LINE>if (S <= 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Virtual point:<NEW_LINE>double Z2 = 2 * Di2 + 2 * Dj2 - V2;<NEW_LINE>double T = Di2 + Z2 - Dj2;<NEW_LINE>T = (Math.sqrt(T * T + 2 * Z2 * r2mDi2) - T) * ir2mDi2;<NEW_LINE>if (T > 0) {<NEW_LINE>sum += 2 * (FastMath.log(T) <MASK><NEW_LINE>valid += 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Square cancels out with taking this twice.<NEW_LINE>sum += FastMath.log(Di2 / r2);<NEW_LINE>++valid;<NEW_LINE>}<NEW_LINE>// TODO: there are still some special cases missing?<NEW_LINE>return sum < 0 ? -valid / sum * (issquared ? 2 : 1) : 1;<NEW_LINE>} | + FastMath.log(S)); |
40,521 | public void onCreate(Bundle savedInstance) {<NEW_LINE>super.onCreate(savedInstance);<NEW_LINE>applyColorTheme("");<NEW_LINE>setContentView(R.layout.activity_login);<NEW_LINE>setupAppBar(R.id.toolbar, "Re-authenticate", true, true);<NEW_LINE>String[] scopes = { "identity", "modcontributors", "modconfig", "modothers", "modwiki", "creddits", "livemanage", "account", "privatemessages", "modflair", "modlog", "report", "modposts", "modwiki", "read", "vote", "edit", "submit", "subscribe", "save", "wikiread", "flair", "history", "mysubreddits", "wikiedit" };<NEW_LINE>final OAuthHelper oAuthHelper = Authentication.reddit.getOAuthHelper();<NEW_LINE>final Credentials credentials = Credentials.installedApp(CLIENT_ID, REDIRECT_URL);<NEW_LINE>String authorizationUrl = oAuthHelper.getAuthorizationUrl(credentials, <MASK><NEW_LINE>authorizationUrl = authorizationUrl.replace("www.", "i.");<NEW_LINE>authorizationUrl = authorizationUrl.replace("%3A%2F%2Fi", "://www");<NEW_LINE>Log.v(LogUtil.getTag(), "Auth URL: " + authorizationUrl);<NEW_LINE>final CookieManager cookieManager = CookieManager.getInstance();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>cookieManager.removeAllCookies(null);<NEW_LINE>} else {<NEW_LINE>cookieManager.removeAllCookie();<NEW_LINE>}<NEW_LINE>final WebView webView = (WebView) findViewById(R.id.web);<NEW_LINE>webView.loadUrl(authorizationUrl);<NEW_LINE>webView.setWebChromeClient(new WebChromeClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(WebView view, int newProgress) {<NEW_LINE>// activity.setProgress(newProgress * 1000);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webView.setWebViewClient(new WebViewClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageStarted(WebView view, String url, Bitmap favicon) {<NEW_LINE>if (url.contains("code=")) {<NEW_LINE>Log.v(LogUtil.getTag(), "WebView URL: " + url);<NEW_LINE>// Authentication code received, prevent HTTP call from being made.<NEW_LINE>webView.stopLoading();<NEW_LINE>new UserChallengeTask(oAuthHelper, credentials).execute(url);<NEW_LINE>webView.setVisibility(View.GONE);<NEW_LINE>webView.clearCache(true);<NEW_LINE>webView.clearHistory();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | true, scopes).toExternalForm(); |
1,661,560 | public static CreateDataModelResponse unmarshall(CreateDataModelResponse createDataModelResponse, UnmarshallerContext _ctx) {<NEW_LINE>createDataModelResponse.setRequestId(_ctx.stringValue("CreateDataModelResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCreateTime(_ctx.stringValue("CreateDataModelResponse.Data.CreateTime"));<NEW_LINE>data.setModelType(_ctx.stringValue("CreateDataModelResponse.Data.ModelType"));<NEW_LINE>data.setSubType<MASK><NEW_LINE>data.setRevision(_ctx.integerValue("CreateDataModelResponse.Data.Revision"));<NEW_LINE>data.setModifiedTime(_ctx.stringValue("CreateDataModelResponse.Data.ModifiedTime"));<NEW_LINE>data.setDescription(_ctx.stringValue("CreateDataModelResponse.Data.Description"));<NEW_LINE>data.setSchemaVersion(_ctx.stringValue("CreateDataModelResponse.Data.SchemaVersion"));<NEW_LINE>data.setAppId(_ctx.stringValue("CreateDataModelResponse.Data.AppId"));<NEW_LINE>data.setProps(_ctx.mapValue("CreateDataModelResponse.Data.Props"));<NEW_LINE>data.setModelStatus(_ctx.stringValue("CreateDataModelResponse.Data.ModelStatus"));<NEW_LINE>data.setModelName(_ctx.stringValue("CreateDataModelResponse.Data.ModelName"));<NEW_LINE>data.setContent(_ctx.mapValue("CreateDataModelResponse.Data.Content"));<NEW_LINE>data.setId(_ctx.stringValue("CreateDataModelResponse.Data.Id"));<NEW_LINE>data.setModelId(_ctx.stringValue("CreateDataModelResponse.Data.ModelId"));<NEW_LINE>List<Map<Object, Object>> attributes = _ctx.listMapValue("CreateDataModelResponse.Data.Attributes");<NEW_LINE>data.setAttributes(attributes);<NEW_LINE>createDataModelResponse.setData(data);<NEW_LINE>return createDataModelResponse;<NEW_LINE>} | (_ctx.stringValue("CreateDataModelResponse.Data.SubType")); |
439,098 | public static DescribeResourcePackagesResponse unmarshall(DescribeResourcePackagesResponse describeResourcePackagesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeResourcePackagesResponse.setRequestId(_ctx.stringValue("DescribeResourcePackagesResponse.RequestId"));<NEW_LINE>describeResourcePackagesResponse.setSuccess(_ctx.booleanValue("DescribeResourcePackagesResponse.Success"));<NEW_LINE>describeResourcePackagesResponse.setCode(_ctx.stringValue("DescribeResourcePackagesResponse.Code"));<NEW_LINE>describeResourcePackagesResponse.setMessage(_ctx.stringValue("DescribeResourcePackagesResponse.Message"));<NEW_LINE>describeResourcePackagesResponse.setTotalCount(_ctx.integerValue("DescribeResourcePackagesResponse.TotalCount"));<NEW_LINE>describeResourcePackagesResponse.setPageSize(_ctx.integerValue("DescribeResourcePackagesResponse.PageSize"));<NEW_LINE>describeResourcePackagesResponse.setPageNumber(_ctx.integerValue("DescribeResourcePackagesResponse.PageNumber"));<NEW_LINE>List<ResourcePackage> resourcePackages = new ArrayList<ResourcePackage>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeResourcePackagesResponse.ResourcePackages.Length"); i++) {<NEW_LINE>ResourcePackage resourcePackage = new ResourcePackage();<NEW_LINE>resourcePackage.setId(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Id"));<NEW_LINE>resourcePackage.setUid(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Uid"));<NEW_LINE>resourcePackage.setResourceType(_ctx.stringValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].ResourceType"));<NEW_LINE>resourcePackage.setStartTime(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].StartTime"));<NEW_LINE>resourcePackage.setEndTime(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].EndTime"));<NEW_LINE>resourcePackage.setInitCapacity(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].InitCapacity"));<NEW_LINE>resourcePackage.setCurrCapacity(_ctx.longValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].CurrCapacity"));<NEW_LINE>resourcePackage.setInstanceName(_ctx.stringValue<MASK><NEW_LINE>resourcePackage.setStatus(_ctx.stringValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Status"));<NEW_LINE>Template template = new Template();<NEW_LINE>template.setDisplayName(_ctx.stringValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Template.DisplayName"));<NEW_LINE>template.setUpgrade(_ctx.booleanValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Template.Upgrade"));<NEW_LINE>template.setRenew(_ctx.booleanValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Template.Renew"));<NEW_LINE>template.setTemplateType(_ctx.stringValue("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].Template.TemplateType"));<NEW_LINE>resourcePackage.setTemplate(template);<NEW_LINE>resourcePackages.add(resourcePackage);<NEW_LINE>}<NEW_LINE>describeResourcePackagesResponse.setResourcePackages(resourcePackages);<NEW_LINE>return describeResourcePackagesResponse;<NEW_LINE>} | ("DescribeResourcePackagesResponse.ResourcePackages[" + i + "].InstanceName")); |
1,160,082 | private void initialize(Snapshot snapshot) {<NEW_LINE>// TODO: if some property cannot be loaded for current snapshot version, FAIL initializing the snapshot!<NEW_LINE>Storage storage = snapshot.getStorage();<NEW_LINE>String version = getProperty(storage, SNAPSHOT_VERSION);<NEW_LINE>chartCache = Integer.parseInt(getProperty(storage, PROP_CHART_CACHE));<NEW_LINE>uptime = Long.parseLong(getProperty(storage, PROP_UPTIME));<NEW_LINE>prevUpTime = Long.parseLong(getProperty(storage, PROP_PREV_UPTIME));<NEW_LINE>takeHeapDumpSupported = false;<NEW_LINE>cpuMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_CPU_MONITORING_SUPPORTED));<NEW_LINE>gcMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_GC_MONITORING_SUPPORTED));<NEW_LINE>memoryMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_MEMORY_MONITORING_SUPPORTED));<NEW_LINE>classMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_CLASS_MONITORING_SUPPORTED));<NEW_LINE>threadsMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_THREADS_MONITORING_SUPPORTED));<NEW_LINE>processorsCount = Integer.parseInt(getProperty(storage, PROP_NUMBER_OF_PROCESSORS));<NEW_LINE>processCpuTime = Long.parseLong(getProperty(storage, PROP_PROCESS_CPU_TIME));<NEW_LINE>processGcTime = Long.parseLong(getProperty(storage, PROP_PROCESS_GC_TIME));<NEW_LINE>prevProcessCpuTime = Long.parseLong(getProperty(storage, PROP_PREV_PROCESS_CPU_TIME));<NEW_LINE>prevProcessGcTime = Long.parseLong(getProperty(storage, PROP_PREV_PROCESS_GC_TIME));<NEW_LINE>heapCapacity = Long.parseLong(getProperty(storage, PROP_HEAP_CAPACITY));<NEW_LINE>heapUsed = Long.parseLong(getProperty(storage, PROP_HEAP_USED));<NEW_LINE>maxHeap = Long.parseLong(getProperty(storage, PROP_MAX_HEAP));<NEW_LINE>permgenCapacity = Long.parseLong(getProperty(storage, PROP_PERMGEN_CAPACITY));<NEW_LINE>permgenUsed = Long.parseLong(getProperty(storage, PROP_PERMGEN_USED));<NEW_LINE>permgenMax = Long.parseLong(getProperty(storage, PROP_PERMGEN_MAX));<NEW_LINE>sharedUnloaded = Long.parseLong(getProperty(storage, PROP_SHARED_UNLOADED));<NEW_LINE>totalUnloaded = Long.parseLong(getProperty(storage, PROP_TOTAL_UNLOADED));<NEW_LINE>sharedLoaded = Long.parseLong(getProperty(storage, PROP_SHARED_LOADED));<NEW_LINE>totalLoaded = Long.parseLong(getProperty(storage, PROP_TOTAL_LOADED));<NEW_LINE>totalThreads = Long.parseLong(getProperty(storage, PROP_TOTAL_THREADS));<NEW_LINE>daemonThreads = Long.parseLong(getProperty(storage, PROP_DAEMON_THREADS));<NEW_LINE>peakThreads = Long.parseLong(getProperty(storage, PROP_PEAK_THREADS));<NEW_LINE>startedThreads = Long.parseLong(getProperty(storage, PROP_STARTED_THREADS));<NEW_LINE>if (version.compareTo("1.1") >= 0) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>permgenName = getProperty(storage, PROP_PERMGEN_NAME);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>heapName = NbBundle.getMessage(ApplicationMonitorModel.class, "LBL_Heap");<NEW_LINE>// NOI18N<NEW_LINE>permgenName = NbBundle.getMessage(ApplicationMonitorModel.class, "LBL_PermGen");<NEW_LINE>}<NEW_LINE>} | heapName = getProperty(storage, PROP_HEAP_NAME); |
69,473 | protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) {<NEW_LINE>Histogram histogram = new Histogram(inPixels, width, height, 0, width);<NEW_LINE>int i, j;<NEW_LINE>if (histogram.getNumSamples() > 0) {<NEW_LINE>float scale = 255.0f / histogram.getNumSamples();<NEW_LINE>lut = <MASK><NEW_LINE>for (i = 0; i < 3; i++) {<NEW_LINE>lut[i][0] = histogram.getFrequency(i, 0);<NEW_LINE>for (j = 1; j < 256; j++) lut[i][j] = lut[i][j - 1] + histogram.getFrequency(i, j);<NEW_LINE>for (j = 0; j < 256; j++) lut[i][j] = (int) Math.round(lut[i][j] * scale);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>lut = null;<NEW_LINE>i = 0;<NEW_LINE>for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) {<NEW_LINE>inPixels[i] = filterRGB(x, y, inPixels[i]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>lut = null;<NEW_LINE>return inPixels;<NEW_LINE>} | new int[3][256]; |
1,372,144 | public UpdateParallelDataResult updateParallelData(UpdateParallelDataRequest updateParallelDataRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateParallelDataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateParallelDataRequest> request = null;<NEW_LINE>Response<UpdateParallelDataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateParallelDataRequestMarshaller().marshall(updateParallelDataRequest);<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<UpdateParallelDataResult, JsonUnmarshallerContext> unmarshaller = new UpdateParallelDataResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateParallelDataResult> responseHandler = <MASK><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>} | new JsonResponseHandler<UpdateParallelDataResult>(unmarshaller); |
755,596 | private Elements.Builder convertBufferForTransmission() {<NEW_LINE>Elements.Builder bufferedElements = Elements.newBuilder();<NEW_LINE>for (Map.Entry<String, Receiver<?>> entry : outputDataReceivers.entrySet()) {<NEW_LINE>if (entry.getValue().getOutput().size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ByteString bytes = entry.getValue()<MASK><NEW_LINE>bufferedElements.addDataBuilder().setInstructionId(processBundleRequestIdSupplier.get()).setTransformId(entry.getKey()).setData(bytes);<NEW_LINE>entry.getValue().resetOutput();<NEW_LINE>}<NEW_LINE>for (Map.Entry<TimerEndpoint, Receiver<?>> entry : outputTimersReceivers.entrySet()) {<NEW_LINE>if (entry.getValue().getOutput().size() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ByteString bytes = entry.getValue().getOutput().toByteString();<NEW_LINE>bufferedElements.addTimersBuilder().setInstructionId(processBundleRequestIdSupplier.get()).setTransformId(entry.getKey().pTransformId).setTimerFamilyId(entry.getKey().timerFamilyId).setTimers(bytes);<NEW_LINE>entry.getValue().resetOutput();<NEW_LINE>}<NEW_LINE>bytesWrittenSinceFlush = 0L;<NEW_LINE>return bufferedElements;<NEW_LINE>} | .getOutput().toByteString(); |
1,376,586 | public void save(TeaVMDevServerConfiguration configuration) {<NEW_LINE>configuration.setMainClass(mainClassField.getText().trim());<NEW_LINE>moduleSelector.applyTo(configuration);<NEW_LINE>configuration.setJdkPath(jrePathEditor.getJrePathOrName());<NEW_LINE>configuration.setFileName(fileNameField.<MASK><NEW_LINE>configuration.setPathToFile(pathToFileField.getText().trim());<NEW_LINE>configuration.setIndicator(indicatorField.isSelected());<NEW_LINE>configuration.setDeobfuscateStack(deobfuscateStackField.isSelected());<NEW_LINE>configuration.setAutomaticallyReloaded(autoReloadField.isSelected());<NEW_LINE>if (!maxHeapField.getText().trim().isEmpty()) {<NEW_LINE>configuration.setMaxHeap(Integer.parseInt(maxHeapField.getText()));<NEW_LINE>}<NEW_LINE>if (!portField.getText().trim().isEmpty()) {<NEW_LINE>configuration.setPort(Integer.parseInt(portField.getText()));<NEW_LINE>}<NEW_LINE>configuration.setProxyUrl(proxyUrlField.getText().trim());<NEW_LINE>configuration.setProxyPath(proxyPathField.getText().trim());<NEW_LINE>} | getText().trim()); |
723,128 | private void startCleanupThread() {<NEW_LINE>if (cleanupThread != null) {<NEW_LINE>cleanupThread.cancel(true);<NEW_LINE>}<NEW_LINE>logger.debug(String.format("progress cleanup thread starts with interval %ss", ProgressGlobalConfig.CLEANUP_THREAD_INTERVAL.value(Integer.class)));<NEW_LINE>cleanupThread = thdf.submitPeriodicTask(new PeriodicTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TimeUnit getTimeUnit() {<NEW_LINE>return TimeUnit.SECONDS;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long getInterval() {<NEW_LINE>return ProgressGlobalConfig.CLEANUP_THREAD_INTERVAL.value(Long.class);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return "progress-cleanup-thread";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>new SQLBatch() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void scripts() {<NEW_LINE>Query query = dbf.getEntityManager().createNativeQuery("select unix_timestamp()");<NEW_LINE>Long current = ((BigInteger) query.getSingleResult(<MASK><NEW_LINE>sql(TaskProgressVO.class).notNull(TaskProgressVO_.timeToDelete).lte(TaskProgressVO_.timeToDelete, current).hardDelete();<NEW_LINE>sql("delete from TaskProgressVO vo where vo.time + :ttl <= UNIX_TIMESTAMP() * 1000").param("ttl", TimeUnit.SECONDS.toMillis(ProgressGlobalConfig.PROGRESS_TTL.value(Long.class))).execute();<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | )).longValue() * 1000; |
673,166 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>Log.d(TAG, "Application onCreate", Log.DEBUG_MODE);<NEW_LINE>// handle uncaught java exceptions<NEW_LINE>Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void uncaughtException(Thread t, Throwable e) {<NEW_LINE>// obtain java stack trace<NEW_LINE>String javaStack = null;<NEW_LINE>StackTraceElement[] frames = e.getCause() != null ? e.getCause().getStackTrace() : e.getStackTrace();<NEW_LINE>if (frames != null && frames.length > 0) {<NEW_LINE>javaStack = "";<NEW_LINE>for (StackTraceElement frame : frames) {<NEW_LINE>javaStack += "\n " + frame.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// throw exception as KrollException<NEW_LINE>KrollRuntime.dispatchException("Runtime Error", e.getMessage(), null, 0, null, 0, null, javaStack);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>appProperties = new TiProperties(getApplicationContext(), APPLICATION_PREFERENCES_NAME, false);<NEW_LINE>File fullPath = new <MASK><NEW_LINE>baseUrl = fullPath.getParent();<NEW_LINE>proxyMap = new HashMap<>(5);<NEW_LINE>deployData = new TiDeployData(this);<NEW_LINE>registerActivityLifecycleCallbacks(new TiApplicationLifecycle());<NEW_LINE>// Delete all Titanium temp files created from previous app execution.<NEW_LINE>deleteTiTempFiles();<NEW_LINE>// Set up a listener to be invoked just before Titanium's JavaScript runtime gets terminated.<NEW_LINE>// Note: Runtime will be terminated once all Titanium activities have been destroyed.<NEW_LINE>KrollRuntime.addOnDisposingListener(new KrollRuntime.OnDisposingListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDisposing(KrollRuntime runtime) {<NEW_LINE>// Fire a Ti.App "close" event. Must be fired synchronously before termination.<NEW_LINE>KrollModule appModule = getModuleByName("App");<NEW_LINE>if (appModule != null) {<NEW_LINE>appModule.fireSyncEvent(TiC.EVENT_CLOSE, null);<NEW_LINE>}<NEW_LINE>// Cancel all Titanium timers.<NEW_LINE>cancelTimers();<NEW_LINE>// Delete all Titanium temp files.<NEW_LINE>deleteTiTempFiles();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | File(TiC.URL_ANDROID_ASSET_RESOURCES, "app.js"); |
1,336,512 | private void overrideStartForResultMethod() {<NEW_LINE>AbstractJClass postActivityStarterClass = environment.getJClass(PostActivityStarter.class);<NEW_LINE>JMethod method = holder.getIntentBuilderClass().<MASK><NEW_LINE>method.annotate(Override.class);<NEW_LINE>JVar requestCode = method.param(environment.getCodeModel().INT, "requestCode");<NEW_LINE>JBlock body = method.body();<NEW_LINE>JConditional condition = null;<NEW_LINE>if (fragmentSupportField != null) {<NEW_LINE>condition = body._if(fragmentSupportField.ne(JExpr._null()));<NEW_LINE>//<NEW_LINE>condition._then().invoke(fragmentSupportField, "startActivityForResult").arg(intentField).arg(requestCode);<NEW_LINE>}<NEW_LINE>if (fragmentField != null) {<NEW_LINE>if (condition == null) {<NEW_LINE>condition = body._if(fragmentField.ne(JExpr._null()));<NEW_LINE>} else {<NEW_LINE>condition = condition._elseif(fragmentField.ne(JExpr._null()));<NEW_LINE>}<NEW_LINE>JBlock fragmentStartForResultInvocationBlock;<NEW_LINE>if (hasActivityOptionsInFragment() && shouldGuardActivityOptions()) {<NEW_LINE>fragmentStartForResultInvocationBlock = createCallWithIfGuard(requestCode, condition._then(), fragmentField);<NEW_LINE>} else {<NEW_LINE>fragmentStartForResultInvocationBlock = condition._then();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>JInvocation //<NEW_LINE>invocation = fragmentStartForResultInvocationBlock.invoke(fragmentField, "startActivityForResult").arg(intentField).arg(requestCode);<NEW_LINE>if (hasActivityOptionsInFragment()) {<NEW_LINE>invocation.arg(optionsField);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JBlock activityStartInvocationBlock = null;<NEW_LINE>if (condition != null) {<NEW_LINE>activityStartInvocationBlock = condition._else();<NEW_LINE>} else {<NEW_LINE>activityStartInvocationBlock = method.body();<NEW_LINE>}<NEW_LINE>JConditional activityCondition = activityStartInvocationBlock._if(contextField._instanceof(getClasses().ACTIVITY));<NEW_LINE>JBlock thenBlock = activityCondition._then();<NEW_LINE>JVar activityVar = thenBlock.decl(getClasses().ACTIVITY, "activity", JExpr.cast(getClasses().ACTIVITY, contextField));<NEW_LINE>AbstractJClass activityCompat = getActivityCompat();<NEW_LINE>if (activityCompat != null) {<NEW_LINE>//<NEW_LINE>thenBlock.staticInvoke(activityCompat, "startActivityForResult").arg(activityVar).arg(intentField).arg(requestCode).arg(optionsField);<NEW_LINE>} else if (hasActivityOptionsInFragment()) {<NEW_LINE>JBlock startForResultInvocationBlock;<NEW_LINE>if (shouldGuardActivityOptions()) {<NEW_LINE>startForResultInvocationBlock = createCallWithIfGuard(requestCode, thenBlock, activityVar);<NEW_LINE>} else {<NEW_LINE>startForResultInvocationBlock = thenBlock;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>startForResultInvocationBlock.invoke(activityVar, "startActivityForResult").arg(intentField).arg(requestCode).arg(optionsField);<NEW_LINE>} else {<NEW_LINE>thenBlock.invoke(activityVar, "startActivityForResult").arg(intentField).arg(requestCode);<NEW_LINE>}<NEW_LINE>if (hasActivityOptionsInFragment()) {<NEW_LINE>JBlock startInvocationBlock;<NEW_LINE>if (shouldGuardActivityOptions()) {<NEW_LINE>startInvocationBlock = createCallWithIfGuard(null, activityCondition._else(), contextField);<NEW_LINE>} else {<NEW_LINE>startInvocationBlock = activityCondition._else();<NEW_LINE>}<NEW_LINE>startInvocationBlock.invoke(contextField, "startActivity").arg(intentField).arg(optionsField);<NEW_LINE>} else {<NEW_LINE>activityCondition._else().invoke(contextField, "startActivity").arg(intentField);<NEW_LINE>}<NEW_LINE>body._return(_new(postActivityStarterClass).arg(contextField));<NEW_LINE>} | method(PUBLIC, postActivityStarterClass, "startForResult"); |
70,103 | final CancelServiceSoftwareUpdateResult executeCancelServiceSoftwareUpdate(CancelServiceSoftwareUpdateRequest cancelServiceSoftwareUpdateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelServiceSoftwareUpdateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelServiceSoftwareUpdateRequest> request = null;<NEW_LINE>Response<CancelServiceSoftwareUpdateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelServiceSoftwareUpdateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(cancelServiceSoftwareUpdateRequest));<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, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelServiceSoftwareUpdate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CancelServiceSoftwareUpdateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelServiceSoftwareUpdateResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
137,807 | private boolean addTangents(Grid grid, int rowA, int colA, int rowB, int colB) {<NEW_LINE>EllipseRotated_F64 a = grid.get(rowA, colA);<NEW_LINE>EllipseRotated_F64 b = grid.get(rowB, colB);<NEW_LINE>if (!tangentFinder.process(a, b, A0, A1, A2, A3, B0, B1, B2, B3)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Tangents ta = tangents.get(grid.getIndexOfRegEllipse(rowA, colA));<NEW_LINE>Tangents tb = tangents.get(grid.getIndexOfRegEllipse(rowB, colB));<NEW_LINE>// Which point is 0 or 3 is not defined and can swap arbitrarily. To fix this problem<NEW_LINE>// 0 will be defined as on the 'positive side' of the line connecting the ellipse centers<NEW_LINE>double slopeX = b.center.x - a.center.x;<NEW_LINE>double slopeY = b.center.y - a.center.y;<NEW_LINE>double dx0 = A0.x - a.center.x;<NEW_LINE>double dy0 = A0.y - a.center.y;<NEW_LINE>double z = slopeX * dy0 - slopeY * dx0;<NEW_LINE>if (z < 0 == (rowA == rowB)) {<NEW_LINE>Point2D_F64 tmp = A0;<NEW_LINE>A0 = A3;<NEW_LINE>A3 = tmp;<NEW_LINE>tmp = B0;<NEW_LINE>B0 = B3;<NEW_LINE>B3 = tmp;<NEW_LINE>}<NEW_LINE>// add tangent points from the two lines which do not cross the center line<NEW_LINE>if (rowA == rowB) {<NEW_LINE>ta.t[ta.countT++].setTo(A0);<NEW_LINE>ta.b[ta.countB++].setTo(A3);<NEW_LINE>tb.t[tb.<MASK><NEW_LINE>tb.b[tb.countB++].setTo(B3);<NEW_LINE>} else {<NEW_LINE>ta.r[ta.countL++].setTo(A0);<NEW_LINE>ta.l[ta.countR++].setTo(A3);<NEW_LINE>tb.r[tb.countL++].setTo(B0);<NEW_LINE>tb.l[tb.countR++].setTo(B3);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | countT++].setTo(B0); |
1,314,826 | final UpdateBatchPredictionResult executeUpdateBatchPrediction(UpdateBatchPredictionRequest updateBatchPredictionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateBatchPredictionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateBatchPredictionRequest> request = null;<NEW_LINE>Response<UpdateBatchPredictionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateBatchPredictionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateBatchPredictionRequest));<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, "Machine Learning");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateBatchPrediction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateBatchPredictionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateBatchPredictionResultJsonUnmarshaller()); |
75,286 | final ListManagedSchemaArnsResult executeListManagedSchemaArns(ListManagedSchemaArnsRequest listManagedSchemaArnsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listManagedSchemaArnsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListManagedSchemaArnsRequest> request = null;<NEW_LINE>Response<ListManagedSchemaArnsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListManagedSchemaArnsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listManagedSchemaArnsRequest));<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, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListManagedSchemaArns");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListManagedSchemaArnsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListManagedSchemaArnsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,146,983 | public static ListSkillGroupResponse unmarshall(ListSkillGroupResponse listSkillGroupResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSkillGroupResponse.setRequestId(_ctx.stringValue("ListSkillGroupResponse.RequestId"));<NEW_LINE>listSkillGroupResponse.setMessage(_ctx.stringValue("ListSkillGroupResponse.Message"));<NEW_LINE>listSkillGroupResponse.setCode(_ctx.stringValue("ListSkillGroupResponse.Code"));<NEW_LINE>listSkillGroupResponse.setSuccess(_ctx.booleanValue("ListSkillGroupResponse.Success"));<NEW_LINE>List<SkillGroups> data = new ArrayList<SkillGroups>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSkillGroupResponse.Data.Length"); i++) {<NEW_LINE>SkillGroups skillGroups = new SkillGroups();<NEW_LINE>skillGroups.setDisplayName(_ctx.stringValue("ListSkillGroupResponse.Data[" + i + "].DisplayName"));<NEW_LINE>skillGroups.setDescription(_ctx.stringValue("ListSkillGroupResponse.Data[" + i + "].Description"));<NEW_LINE>skillGroups.setChannelType(_ctx.integerValue<MASK><NEW_LINE>skillGroups.setSkillGroupId(_ctx.longValue("ListSkillGroupResponse.Data[" + i + "].SkillGroupId"));<NEW_LINE>skillGroups.setName(_ctx.stringValue("ListSkillGroupResponse.Data[" + i + "].Name"));<NEW_LINE>data.add(skillGroups);<NEW_LINE>}<NEW_LINE>listSkillGroupResponse.setData(data);<NEW_LINE>return listSkillGroupResponse;<NEW_LINE>} | ("ListSkillGroupResponse.Data[" + i + "].ChannelType")); |
1,086,118 | private void dumpHeapReferences(J9JavaVMPointer vm, J9ObjectPointer targetObject, PrintStream out) throws CorruptDataException {<NEW_LINE>if (GCExtensions.isVLHGC()) {<NEW_LINE>Table table = new Table("On Heap References");<NEW_LINE>table.row("object (!j9object)", "field (!j9object)", "!mm_heapregiondescriptorvlhgc", "AC (type)");<NEW_LINE>GCObjectHeapIterator heapObjectIterator = <MASK><NEW_LINE>while (heapObjectIterator.hasNext()) {<NEW_LINE>J9ObjectPointer currentObject = heapObjectIterator.next();<NEW_LINE>J9ClassPointer objectClass = J9ObjectHelper.clazz(currentObject);<NEW_LINE>String objectClassString = J9ClassHelper.getJavaName(objectClass);<NEW_LINE>table.row(currentObject.getHexAddress() + " //" + objectClassString, currentTargetObject.getHexAddress(), vlhgcRegion.getHexAddress(), currentAllocationContextTarok.getHexAddress() + " (" + currentAllocationContextTarok._allocationContextType() + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.render(out);<NEW_LINE>}<NEW_LINE>} | region.objectIterator(true, false); |
845,133 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
357,039 | public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(classLoader, className, classfileBuffer);<NEW_LINE>List<InstrumentMethod> childCancelled = target.getDeclaredMethods(MethodFilters.name("childCancelled"));<NEW_LINE>for (InstrumentMethod instrumentMethod : childCancelled) {<NEW_LINE>instrumentMethod.addInterceptor(CancelledInterceptor.class, VarArgs.va(CoroutinesConstants.SERVICE_TYPE));<NEW_LINE>}<NEW_LINE>List<InstrumentMethod> parentCancelled = target.getDeclaredMethods(MethodFilters.name("parentCancelled"));<NEW_LINE>for (InstrumentMethod instrumentMethod : parentCancelled) {<NEW_LINE>instrumentMethod.addInterceptor(CancelledInterceptor.class, VarArgs.va(CoroutinesConstants.SERVICE_TYPE));<NEW_LINE>}<NEW_LINE>List<InstrumentMethod> notifyCancelling = target.getDeclaredMethods(MethodFilters.name("notifyCancelling"));<NEW_LINE>for (InstrumentMethod instrumentMethod : notifyCancelling) {<NEW_LINE>instrumentMethod.addInterceptor(NotifyCancellingInterceptor.class, VarArgs<MASK><NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>} | .va(CoroutinesConstants.SERVICE_TYPE)); |
472,609 | private void replaceRVContainer(boolean showTabs) {<NEW_LINE>for (AdapterHolder adapterHolder : mAH) {<NEW_LINE>AllAppsRecyclerView rv = adapterHolder.recyclerView;<NEW_LINE>if (rv != null) {<NEW_LINE>rv.setLayoutManager(null);<NEW_LINE>rv.setAdapter(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>View oldView = getRecyclerViewContainer();<NEW_LINE>int layout;<NEW_LINE>if (isPagedView()) {<NEW_LINE>layout = R.layout.all_apps_horizontal_view;<NEW_LINE>} else if (showTabs) {<NEW_LINE>layout = R.layout.all_apps_tabs;<NEW_LINE>} else {<NEW_LINE>layout = R.layout.all_apps_rv_layout;<NEW_LINE>}<NEW_LINE>int index = indexOfChild(oldView);<NEW_LINE>removeView(oldView);<NEW_LINE>View newView = getLayoutInflater().inflate(layout, this, false);<NEW_LINE>addView(newView, index);<NEW_LINE>if (TestProtocol.sDebugTracing) {<NEW_LINE>Log.d(TestProtocol.WORK_PROFILE_REMOVED, "should show tabs:" + showTabs, new Exception());<NEW_LINE>}<NEW_LINE>if (isPagedView()) {<NEW_LINE>mHorizontalViewPager = (AllAppsPagedView) newView;<NEW_LINE>mHorizontalViewPager.addTabs(mPagesController.getPagesCount());<NEW_LINE>mHorizontalViewPager.initParentViews(this);<NEW_LINE>mHorizontalViewPager.getPageIndicator().setOnActivePageChangedListener(this);<NEW_LINE>removeWorkToggle();<NEW_LINE>} else {<NEW_LINE>if (showTabs) {<NEW_LINE>mViewPager = (AllAppsPagedView) newView;<NEW_LINE>mViewPager.addTabs(mTabsController.getTabsCount());<NEW_LINE>mViewPager.initParentViews(this);<NEW_LINE>mViewPager.<MASK><NEW_LINE>if (mTabsController.getTabs().getHasWorkApps()) {<NEW_LINE>setupWorkToggle();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mViewPager = null;<NEW_LINE>mHorizontalViewPager = null;<NEW_LINE>removeWorkToggle();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getPageIndicator().setOnActivePageChangedListener(this); |
795,140 | public void fetchFile(OrderType orderType, int segmentNumber, boolean lastSegment, byte[] transactionId, Joiner joiner) throws IOException, AxelorException {<NEW_LINE>DTransferRequestElement downloader;<NEW_LINE>HttpRequestSender sender;<NEW_LINE>DTransferResponseElement response;<NEW_LINE>int httpCode;<NEW_LINE>sender = new HttpRequestSender(session);<NEW_LINE>downloader = new DTransferRequestElement(session, <MASK><NEW_LINE>downloader.build();<NEW_LINE>downloader.validate();<NEW_LINE>httpCode = sender.send(new ByteArrayContentFactory(downloader.prettyPrint()));<NEW_LINE>EbicsUtils.checkHttpCode(httpCode);<NEW_LINE>response = new DTransferResponseElement(sender.getResponseBody(), orderType, DefaultEbicsRootElement.generateName(orderType), session.getUser());<NEW_LINE>response.build();<NEW_LINE>response.report(new EbicsRootElement[] { downloader, response });<NEW_LINE>joiner.append(response.getOrderData());<NEW_LINE>} | orderType, segmentNumber, lastSegment, transactionId); |
1,764,025 | // Implementation of ActionListener ------------------------------------<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>// only chooseMainClassButton can be performed<NEW_LINE>// final MainClassChooser panel = new MainClassChooser (sourceRoots.getRoots(), null, mainClassTextField.getText());<NEW_LINE>final JFXApplicationClassChooser panel = new JFXApplicationClassChooser(project, evaluator);<NEW_LINE>Object[] options = new Object[] { okButton, DialogDescriptor.CANCEL_OPTION };<NEW_LINE>panel.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>if (e.getSource() instanceof MouseEvent && MouseUtils.isDoubleClick(((MouseEvent) e.getSource()))) {<NEW_LINE>// click button and finish the dialog with selected class<NEW_LINE>okButton.doClick();<NEW_LINE>} else {<NEW_LINE>okButton.setEnabled(panel.getSelectedClass() != null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>okButton.setEnabled(false);<NEW_LINE>DialogDescriptor desc = new // NOI18N<NEW_LINE>DialogDescriptor(// NOI18N<NEW_LINE>panel, NbBundle.getMessage(JFXRunPanel.class, FXinSwing ? "LBL_ChooseMainClass_Title_Swing" : "LBL_ChooseMainClass_Title"), true, options, options[0], <MASK><NEW_LINE>// desc.setMessageType (DialogDescriptor.INFORMATION_MESSAGE);<NEW_LINE>Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);<NEW_LINE>dlg.setVisible(true);<NEW_LINE>if (desc.getValue() == options[0]) {<NEW_LINE>textFieldAppClass.setText(panel.getSelectedClass());<NEW_LINE>}<NEW_LINE>dlg.dispose();<NEW_LINE>} | DialogDescriptor.BOTTOM_ALIGN, null, null); |
1,807,392 | private INDArray decodeGivenLatentSpaceValues(INDArray latentSpaceValues, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>if (latentSpaceValues.size(1) != getParamWithNoise(VariationalAutoencoderParamInitializer.PZX_MEAN_W, false, workspaceMgr).size(1)) {<NEW_LINE>throw new IllegalArgumentException("Invalid latent space values: expected size " + getParamWithNoise(VariationalAutoencoderParamInitializer.PZX_MEAN_W, false, workspaceMgr).size(1) + ", got size (dimension 1) = " + latentSpaceValues.size(1) + " " + layerId());<NEW_LINE>}<NEW_LINE>// Do forward pass through decoder<NEW_LINE>int nDecoderLayers = decoderLayerSizes.length;<NEW_LINE>INDArray currentActivations = latentSpaceValues;<NEW_LINE>IActivation afn = layerConf().getActivationFn();<NEW_LINE>for (int i = 0; i < nDecoderLayers; i++) {<NEW_LINE>String wKey = "d" + i + WEIGHT_KEY_SUFFIX;<NEW_LINE>String bKey = "d" + i + BIAS_KEY_SUFFIX;<NEW_LINE>INDArray w = getParamWithNoise(wKey, false, workspaceMgr);<NEW_LINE>INDArray b = getParamWithNoise(bKey, false, workspaceMgr);<NEW_LINE>currentActivations = currentActivations.mmul(w).addiRowVector(b);<NEW_LINE>afn.getActivation(currentActivations, false);<NEW_LINE>}<NEW_LINE>INDArray pxzw = getParamWithNoise(VariationalAutoencoderParamInitializer.PXZ_W, false, workspaceMgr);<NEW_LINE>INDArray pxzb = getParamWithNoise(<MASK><NEW_LINE>return currentActivations.mmul(pxzw).addiRowVector(pxzb);<NEW_LINE>} | VariationalAutoencoderParamInitializer.PXZ_B, false, workspaceMgr); |
1,518,492 | private void createDataBase() throws ClassNotFoundException, IOException, SQLException {<NEW_LINE>String goalUrl = properties.getProperty("spring.datasource.url");<NEW_LINE>this.user = properties.getProperty("spring.datasource.username");<NEW_LINE>this.password = properties.getProperty("spring.datasource.password");<NEW_LINE>String <MASK><NEW_LINE>boolean flag = driverName.contains("mariadb");<NEW_LINE>if (flag) {<NEW_LINE>databaseType = "mysql";<NEW_LINE>}<NEW_LINE>int first = goalUrl.lastIndexOf("/") + 1;<NEW_LINE>int endTag = goalUrl.indexOf("?");<NEW_LINE>if (endTag == -1) {<NEW_LINE>endTag = goalUrl.length();<NEW_LINE>}<NEW_LINE>this.dbName = goalUrl.substring(first, endTag);<NEW_LINE>// get mysql default url like jdbc:mysql://127.0.0.1:3306<NEW_LINE>String defaultUrl = flag ? goalUrl.substring(0, first) : goalUrl;<NEW_LINE>log.info("dbName:{},defaultUrl:{}, {}", this.dbName, defaultUrl, databaseType);<NEW_LINE>Class.forName(driverName);<NEW_LINE>List<String> tableSqlList = readSql();<NEW_LINE>runScript(defaultUrl, flag, tableSqlList);<NEW_LINE>} | driverName = properties.getProperty("spring.datasource.driver-class-name"); |
1,494,207 | private HttpResponse generateEmptyResponse() {<NEW_LINE>HttpResponse response <MASK><NEW_LINE>// response.setContent(ChannelBuffers.wrappedBuffer(responseBody));<NEW_LINE>response.setHeader(CONTENT_TYPE, "text/plain; charset=UTF-8");<NEW_LINE>response.setHeader("Access-Control-Allow-Origin", "*");<NEW_LINE>setTrackingInfo(response);<NEW_LINE>// Encode the cookie.<NEW_LINE>String cookieString = _httpRequest.getHeader(COOKIE);<NEW_LINE>if (cookieString != null) {<NEW_LINE>CookieDecoder cookieDecoder = new CookieDecoder();<NEW_LINE>Set<Cookie> cookies = cookieDecoder.decode(cookieString);<NEW_LINE>if (!cookies.isEmpty()) {<NEW_LINE>// Reset the cookies if necessary.<NEW_LINE>CookieEncoder cookieEncoder = new CookieEncoder(true);<NEW_LINE>for (Cookie cookie : cookies) {<NEW_LINE>cookieEncoder.addCookie(cookie);<NEW_LINE>}<NEW_LINE>response.addHeader(SET_COOKIE, cookieEncoder.encode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | = new DefaultHttpResponse(HTTP_1_1, OK); |
1,411,940 | protected static void removeDefinedCustomXmlParts(WordprocessingMLPackage wmlPackage, String itemId) {<NEW_LINE>List<PartName> partsToRemove = new ArrayList<PartName>();<NEW_LINE>RelationshipsPart relationshipsPart = wmlPackage.getMainDocumentPart().getRelationshipsPart();<NEW_LINE>List<Relationship> relationshipsList = ((relationshipsPart != null) && (relationshipsPart.getRelationships() != null) ? relationshipsPart.getRelationships(<MASK><NEW_LINE>Part part = null;<NEW_LINE>if (relationshipsList != null) {<NEW_LINE>for (Relationship relationship : relationshipsList) {<NEW_LINE>if (Namespaces.CUSTOM_XML_DATA_STORAGE.equals(relationship.getType())) {<NEW_LINE>part = relationshipsPart.getPart(relationship);<NEW_LINE>if (itemId != null && itemId.equals(((CustomXmlPart) part).getItemId())) {<NEW_LINE>partsToRemove.add(part.getPartName());<NEW_LINE>} else if (part instanceof XPathsPart) {<NEW_LINE>partsToRemove.add(part.getPartName());<NEW_LINE>} else if (part instanceof ConditionsPart) {<NEW_LINE>partsToRemove.add(part.getPartName());<NEW_LINE>} else {<NEW_LINE>log.warn("Keeping " + part.getPartName() + " of type " + part.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!partsToRemove.isEmpty()) {<NEW_LINE>for (int i = 0; i < partsToRemove.size(); i++) {<NEW_LINE>relationshipsPart.removePart(partsToRemove.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getRelationship() : null); |
449,153 | final CreateComponentVersionResult executeCreateComponentVersion(CreateComponentVersionRequest createComponentVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createComponentVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateComponentVersionRequest> request = null;<NEW_LINE>Response<CreateComponentVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateComponentVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createComponentVersionRequest));<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, "GreengrassV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateComponentVersion");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateComponentVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateComponentVersionResultJsonUnmarshaller());<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,249,060 | private void addReference(MInOut inout, String createFromType, int referenceId) {<NEW_LINE>// Valid Reference<NEW_LINE>if (referenceId == 0)<NEW_LINE>return;<NEW_LINE>if (createFromType.equals(ORDER)) {<NEW_LINE>MOrder order = new MOrder(getCtx(), referenceId, get_TrxName());<NEW_LINE>inout.setC_Order_ID(order.getC_Order_ID());<NEW_LINE>inout.setAD_OrgTrx_ID(order.getAD_OrgTrx_ID());<NEW_LINE>inout.setC_Project_ID(order.getC_Project_ID());<NEW_LINE>inout.setC_Campaign_ID(order.getC_Campaign_ID());<NEW_LINE>inout.setC_Activity_ID(order.getC_Activity_ID());<NEW_LINE>inout.setUser1_ID(order.getUser1_ID());<NEW_LINE>inout.setUser2_ID(order.getUser2_ID());<NEW_LINE>inout.setUser3_ID(order.getUser3_ID());<NEW_LINE>inout.setUser4_ID(order.getUser4_ID());<NEW_LINE>// For Drop Ship<NEW_LINE>if (order.isDropShip()) {<NEW_LINE>inout.setM_Warehouse_ID(order.getM_Warehouse_ID());<NEW_LINE>inout.setIsDropShip(order.isDropShip());<NEW_LINE>inout.setDropShip_BPartner_ID(order.getDropShip_BPartner_ID());<NEW_LINE>inout.setDropShip_Location_ID(order.getDropShip_Location_ID());<NEW_LINE>inout.setDropShip_User_ID(order.getDropShip_User_ID());<NEW_LINE>}<NEW_LINE>} else if (createFromType.equals(INVOICE)) {<NEW_LINE>MInvoice invoice = new MInvoice(getCtx(), referenceId, get_TrxName());<NEW_LINE>if (inout.getC_Order_ID() == 0)<NEW_LINE>inout.setC_Order_ID(invoice.getC_Order_ID());<NEW_LINE>inout.setC_Invoice_ID(invoice.getC_Invoice_ID());<NEW_LINE>inout.setAD_OrgTrx_ID(invoice.getAD_OrgTrx_ID());<NEW_LINE>inout.setC_Project_ID(invoice.getC_Project_ID());<NEW_LINE>inout.setC_Campaign_ID(invoice.getC_Campaign_ID());<NEW_LINE>inout.setC_Activity_ID(invoice.getC_Activity_ID());<NEW_LINE>inout.setUser1_ID(invoice.getUser1_ID());<NEW_LINE>inout.setUser2_ID(invoice.getUser2_ID());<NEW_LINE>inout.setUser3_ID(invoice.getUser3_ID());<NEW_LINE>inout.setUser4_ID(invoice.getUser4_ID());<NEW_LINE>} else if (createFromType.equals(RMA)) {<NEW_LINE>MRMA rma = new MRMA(getCtx(), referenceId, get_TrxName());<NEW_LINE>MInOut originalIO = rma.getShipment();<NEW_LINE>inout.setIsSOTrx(rma.isSOTrx());<NEW_LINE>inout.setC_Order_ID(0);<NEW_LINE>inout.setC_Invoice_ID(0);<NEW_LINE>inout.setM_RMA_ID(rma.getM_RMA_ID());<NEW_LINE>inout.setAD_OrgTrx_ID(originalIO.getAD_OrgTrx_ID());<NEW_LINE>inout.setC_Project_ID(originalIO.getC_Project_ID());<NEW_LINE>inout.setC_Campaign_ID(originalIO.getC_Campaign_ID());<NEW_LINE>inout.<MASK><NEW_LINE>inout.setUser1_ID(originalIO.getUser1_ID());<NEW_LINE>inout.setUser2_ID(originalIO.getUser2_ID());<NEW_LINE>inout.setUser3_ID(originalIO.getUser3_ID());<NEW_LINE>inout.setUser4_ID(originalIO.getUser4_ID());<NEW_LINE>}<NEW_LINE>// Save<NEW_LINE>inout.saveEx();<NEW_LINE>} | setC_Activity_ID(originalIO.getC_Activity_ID()); |
1,153,794 | public // FIXME. embedded??<NEW_LINE>Object createAdministeredObject(ClassLoader jcl) throws PoolingException {<NEW_LINE>try {<NEW_LINE>if (jcl == null) {<NEW_LINE>// use context class loader<NEW_LINE>jcl = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {<NEW_LINE><NEW_LINE>public Object run() {<NEW_LINE>return Thread.currentThread().getContextClassLoader();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>Object adminObject = jcl.loadClass(adminObjectClass_).newInstance();<NEW_LINE>AccessController.doPrivileged(new SetMethodAction(adminObject, configProperties_));<NEW_LINE>// associate ResourceAdapter if the admin-object is RAA<NEW_LINE>if (adminObject instanceof ResourceAdapterAssociation) {<NEW_LINE>try {<NEW_LINE>ResourceAdapter ra = ConnectorRegistry.getInstance().getActiveResourceAdapter(resadapter_).getResourceAdapter();<NEW_LINE>((ResourceAdapterAssociation) adminObject).setResourceAdapter(ra);<NEW_LINE>} catch (ResourceException ex) {<NEW_LINE>_logger.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At this stage, administered object is instantiated, config properties applied<NEW_LINE>// validate administered object<NEW_LINE>// ConnectorRuntime should be available in CLIENT mode now as admin-object-factory would have bootstapped<NEW_LINE>// connector-runtime.<NEW_LINE>ConnectorRuntime.getRuntime().getConnectorBeanValidator().validateJavaBean(adminObject, resadapter_);<NEW_LINE>return adminObject;<NEW_LINE>} catch (PrivilegedActionException ex) {<NEW_LINE>throw (PoolingException) (new PoolingException().initCause(ex));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw (PoolingException) (new PoolingException().initCause(ex));<NEW_LINE>}<NEW_LINE>} | Level.SEVERE, "rardeployment.assoc_failed", ex); |
1,713,267 | private void addWaypoint(@Nullable GPXFile gpxFile, @NonNull MapActivity mapActivity) {<NEW_LINE>LatLon latLon = mapActivity.getMapView().getCurrentRotatedTileBox().getCenterLatLon();<NEW_LINE>boolean usePredefinedWaypoint = Boolean.parseBoolean(getParams().get(KEY_USE_PREDEFINED_WPT_APPEARANCE));<NEW_LINE>if (usePredefinedWaypoint) {<NEW_LINE>WptPt wptPt = createWaypoint();<NEW_LINE>wptPt.lat = latLon.getLatitude();<NEW_LINE>wptPt.lon = latLon.getLongitude();<NEW_LINE>wptPt<MASK><NEW_LINE>String categoryName = getParams().get(KEY_CATEGORY_NAME);<NEW_LINE>int categoryColor = getColorFromParams(KEY_CATEGORY_COLOR, 0);<NEW_LINE>if (Algorithms.isBlank(wptPt.name) && Algorithms.isBlank(wptPt.getAddress())) {<NEW_LINE>lookupAddress(latLon, mapActivity, foundAddress -> {<NEW_LINE>wptPt.name = foundAddress;<NEW_LINE>mapActivity.getContextMenu().addWptPt(wptPt, categoryName, categoryColor, true, gpxFile);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (Algorithms.isBlank(wptPt.name)) {<NEW_LINE>wptPt.name = wptPt.getAddress();<NEW_LINE>wptPt.setAddress(null);<NEW_LINE>}<NEW_LINE>mapActivity.getContextMenu().addWptPt(wptPt, categoryName, categoryColor, true, gpxFile);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>WptPt wptPt = new WptPt(latLon.getLatitude(), latLon.getLongitude(), System.currentTimeMillis(), Double.NaN, 0, Double.NaN);<NEW_LINE>mapActivity.getContextMenu().addWptPt(wptPt, null, 0, false, gpxFile);<NEW_LINE>}<NEW_LINE>} | .time = System.currentTimeMillis(); |
127,320 | private void createOrReplaceViewQuery(List<DBEPersistAction> actions, MySQLView view) {<NEW_LINE>StringBuilder decl = new StringBuilder(200);<NEW_LINE>final <MASK><NEW_LINE>String viewDDL = view.getAdditionalInfo().getDefinition();<NEW_LINE>if (viewDDL == null) {<NEW_LINE>viewDDL = "";<NEW_LINE>}<NEW_LINE>if (!view.isPersisted() && SQLSemanticProcessor.isSelectQuery(view.getDataSource().getSQLDialect(), viewDDL)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>decl.append("CREATE OR REPLACE VIEW ").append(view.getFullyQualifiedName(DBPEvaluationContext.DDL)).append(lineSeparator).// $NON-NLS-1$<NEW_LINE>append("AS ");<NEW_LINE>}<NEW_LINE>final MySQLView.CheckOption checkOption = view.getAdditionalInfo().getCheckOption();<NEW_LINE>if (checkOption != null && checkOption != MySQLView.CheckOption.NONE) {<NEW_LINE>if (viewDDL.endsWith(";")) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>viewDDL = viewDDL.substring(0, viewDDL.length() - 1);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>decl.append(viewDDL).append(lineSeparator).append("WITH ").append(checkOption.getDefinitionName()).append(" CHECK OPTION");<NEW_LINE>} else {<NEW_LINE>decl.append(viewDDL);<NEW_LINE>}<NEW_LINE>actions.add(new SQLDatabasePersistAction("Create view", decl.toString()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeExecute(DBCSession session) throws DBCException {<NEW_LINE>MySQLView schemaView;<NEW_LINE>try {<NEW_LINE>schemaView = DBUtils.findObject(view.getParentObject().getViews(session.getProgressMonitor()), view.getName());<NEW_LINE>} catch (DBException e) {<NEW_LINE>throw new DBCException(e, session.getExecutionContext());<NEW_LINE>}<NEW_LINE>if (schemaView != view) {<NEW_LINE>throw new DBCException("View with name '" + view.getName() + "' already exists. Choose another name");<NEW_LINE>}<NEW_LINE>super.beforeExecute(session);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | String lineSeparator = GeneralUtils.getDefaultLineSeparator(); |
1,672,892 | private static BlockStatement generateCopyRecordToVectorBatchBody(IntInnerType[] types) {<NEW_LINE>int size = types.length;<NEW_LINE>ArrayList<Statement> statements = new ArrayList<>(size);<NEW_LINE>for (int varIndex = 0; varIndex < size; varIndex++) {<NEW_LINE>IntInnerType intPair = types[varIndex];<NEW_LINE>int columnIndex = intPair.index;<NEW_LINE>InnerType type = intPair.type;<NEW_LINE>ConstantExpression index = Expressions.constant(columnIndex);<NEW_LINE>ParameterExpression vectorVariable = Expressions.<MASK><NEW_LINE>statements.add(Expressions.declare(0, vectorVariable, Expressions.convert_(Expressions.call(input, "getVector", index), type.getFieldVector())));<NEW_LINE>ParameterExpression returnVariable = Expressions.parameter(type.getJavaClass());<NEW_LINE>statements.add(Expressions.declare(0, returnVariable, Expressions.call(from, "get" + type.name(), index)));<NEW_LINE>MethodCallExpression isNullCondition = Expressions.call(from, "isNull", index);<NEW_LINE>statements.add(Expressions.ifThenElse(isNullCondition, Expressions.statement(Expressions.call(RecordSinkFactoryImpl.class, "set" + type.getFieldVector().getSimpleName() + "Null", vectorVariable, index)), Expressions.statement(Expressions.call(RecordSinkFactoryImpl.class, "set" + type.getFieldVector().getSimpleName(), vectorVariable, rowId, returnVariable))));<NEW_LINE>}<NEW_LINE>return Expressions.block(statements);<NEW_LINE>} | parameter(type.getFieldVector()); |
1,262,735 | public void save(@NonNull final SecurPharmProduct product) {<NEW_LINE>I_M_Securpharm_Productdata_Result record = null;<NEW_LINE>if (product.getId() != null) {<NEW_LINE>record = load(product.getId(), I_M_Securpharm_Productdata_Result.class);<NEW_LINE>}<NEW_LINE>if (record == null) {<NEW_LINE>record = newInstance(I_M_Securpharm_Productdata_Result.class);<NEW_LINE>}<NEW_LINE>record.setIsError(product.isError());<NEW_LINE>record.setLastResultCode(product.getResultCode());<NEW_LINE>record.setLastResultMessage(product.getResultMessage());<NEW_LINE>record.setM_HU_ID(product.getHuId().getRepoId());<NEW_LINE>//<NEW_LINE>// Product data<NEW_LINE>final ProductDetails productDetails = product.getProductDetails();<NEW_LINE>record.setExpirationDate(productDetails != null ? productDetails.getExpirationDate().toTimestamp() : null);<NEW_LINE>record.setLotNumber(productDetails != null ? productDetails.getLot() : null);<NEW_LINE>record.setProductCode(productDetails != null ? <MASK><NEW_LINE>record.setProductCodeType(productDetails != null ? productDetails.getProductCodeType().name() : null);<NEW_LINE>record.setSerialNumber(productDetails != null ? productDetails.getSerialNumber() : null);<NEW_LINE>record.setActiveStatus(productDetails != null ? productDetails.getActiveStatus().toYesNoString() : null);<NEW_LINE>record.setInactiveReason(productDetails != null ? productDetails.getInactiveReason() : null);<NEW_LINE>record.setIsDecommissioned(productDetails != null ? productDetails.isDecommissioned() : false);<NEW_LINE>record.setDecommissionedServerTransactionId(productDetails != null ? productDetails.getDecommissionedServerTransactionId() : null);<NEW_LINE>saveRecord(record);<NEW_LINE>final SecurPharmProductId productId = SecurPharmProductId.ofRepoId(record.getM_Securpharm_Productdata_Result_ID());<NEW_LINE>product.setId(productId);<NEW_LINE>} | productDetails.getProductCode() : null); |
573,199 | final GetComplianceSummaryResult executeGetComplianceSummary(GetComplianceSummaryRequest getComplianceSummaryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getComplianceSummaryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetComplianceSummaryRequest> request = null;<NEW_LINE>Response<GetComplianceSummaryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetComplianceSummaryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getComplianceSummaryRequest));<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, "Resource Groups Tagging API");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetComplianceSummary");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetComplianceSummaryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new GetComplianceSummaryResultJsonUnmarshaller()); |
700,028 | protected Method rewriteMethod(final File classFile) throws InvocationTargetException {<NEW_LINE>Method m = null;<NEW_LINE>// now make a class out of the stream<NEW_LINE>try {<NEW_LINE>final SoftReference<Method> ref = templateMethodCache.get(classFile);<NEW_LINE>if (ref != null) {<NEW_LINE>m = ref.get();<NEW_LINE>if (m == null) {<NEW_LINE>templateMethodCache.remove(classFile);<NEW_LINE>} else {<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Class<?> c = provider.loadClass(classFile);<NEW_LINE>final Class<?>[] params = (Class<?>[]) Array.newInstance(Class.class, 3);<NEW_LINE>params[0] = RequestHeader.class;<NEW_LINE>params[1] = serverObjects.class;<NEW_LINE>params[2] = serverSwitch.class;<NEW_LINE>m = c.getMethod("respond", params);<NEW_LINE>if (MemoryControl.shortStatus()) {<NEW_LINE>templateMethodCache.clear();<NEW_LINE>} else {<NEW_LINE>// store the method into the cache<NEW_LINE>templateMethodCache.put(classFile, new SoftReference<Method>(m));<NEW_LINE>}<NEW_LINE>} catch (final ClassNotFoundException e) {<NEW_LINE>ConcurrentLog.severe("FILEHANDLER", "YaCyDefaultServlet: class " + classFile + " is missing:" + e.getMessage());<NEW_LINE>throw new InvocationTargetException(e, "class " + classFile + " is missing:" + e.getMessage());<NEW_LINE>} catch (final NoSuchMethodException e) {<NEW_LINE>ConcurrentLog.severe("FILEHANDLER", "YaCyDefaultServlet: method 'respond' not found in class " + classFile + ": " + e.getMessage());<NEW_LINE>throw new InvocationTargetException(e, "method 'respond' not found in class " + classFile + <MASK><NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>} | ": " + e.getMessage()); |
359,411 | public static void main(String... args) {<NEW_LINE>ArgParser parser = new ArgParser(args);<NEW_LINE>LibUtilities.getInstance().bind();<NEW_LINE>if (parser.intercept()) {<NEW_LINE>System.exit(parser.getExitCode());<NEW_LINE>}<NEW_LINE>SingleInstanceChecker.stealWebsocket = parser.hasFlag(ArgValue.STEAL);<NEW_LINE>setupFileLogging();<NEW_LINE>log.info(Constants.ABOUT_TITLE + " version: {}", Constants.VERSION);<NEW_LINE>log.info(Constants.ABOUT_TITLE + " vendor: {}", Constants.ABOUT_COMPANY);<NEW_LINE>log.info("Java version: {}", Constants.JAVA_VERSION.toString());<NEW_LINE>log.info("Java vendor: {}", Constants.JAVA_VENDOR);<NEW_LINE>CertificateManager certManager = null;<NEW_LINE>try {<NEW_LINE>// Gets and sets the SSL info, properties file<NEW_LINE>certManager = Installer.<MASK><NEW_LINE>trayProperties = certManager.getProperties();<NEW_LINE>// Reoccurring (e.g. hourly) cert expiration check<NEW_LINE>new ExpiryTask(certManager).schedule();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Something went critically wrong loading HTTPS", e);<NEW_LINE>}<NEW_LINE>Installer.getInstance().addUserSettings();<NEW_LINE>// Load overridable preferences set in qz-tray.properties file<NEW_LINE>NetworkUtilities.setPreferences(certManager.getProperties());<NEW_LINE>SingleInstanceChecker.setPreferences(certManager.getProperties());<NEW_LINE>// Linux needs the cert installed in user-space on every launch for Chrome SSL to work<NEW_LINE>if (!SystemUtilities.isWindows() && !SystemUtilities.isMac()) {<NEW_LINE>X509Certificate caCert = certManager.getKeyPair(KeyPairWrapper.Type.CA).getCert();<NEW_LINE>// Only install if a CA cert exists (e.g. one we generated)<NEW_LINE>if (caCert != null) {<NEW_LINE>NativeCertificateInstaller.getInstance().install(certManager.getKeyPair(KeyPairWrapper.Type.CA).getCert());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>log.info("Starting {} {}", Constants.ABOUT_TITLE, Constants.VERSION);<NEW_LINE>// Start the WebSocket<NEW_LINE>PrintSocketServer.runServer(certManager, parser.isHeadless());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Could not start tray manager", e);<NEW_LINE>}<NEW_LINE>log.warn("The web socket server is no longer running");<NEW_LINE>} | getInstance().certGen(false); |
272,597 | public void onBindViewHolder(final BasicMessageVH holder, int position) {<NEW_LINE>MessageItem messageItem = getMessageItem(position);<NEW_LINE>if (messageItem == null) {<NEW_LINE>LogManager.w(LOG_TAG, "onBindViewHolder Null message item. Position: " + position);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// setup message uniqueId<NEW_LINE>if (holder instanceof MessageVH)<NEW_LINE>((MessageVH) holder)<MASK><NEW_LINE>// groupchat user<NEW_LINE>GroupchatUser groupchatUser = GroupchatUserManager.getInstance().getGroupchatUser(messageItem.getGroupchatUserId());<NEW_LINE>MessagesAdapter.MessageExtraData extraData = new MessagesAdapter.MessageExtraData(null, null, null, this.extraData.getContext(), messageItem.getOriginalFrom(), this.extraData.getColorStateList(), groupchatUser, this.extraData.getAccountMainColor(), this.extraData.getMentionColor(), false, false, false, false, false, false);<NEW_LINE>final int viewType = getItemViewType(position);<NEW_LINE>switch(viewType) {<NEW_LINE>case VIEW_TYPE_MESSAGE_NOFLEX:<NEW_LINE>((NoFlexForwardedVH) holder).bind(messageItem, extraData, messageItem.getAccount().getFullJid().asBareJid().toString());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>((ForwardedVH) holder).bind(messageItem, extraData, messageItem.getAccount().getFullJid().asBareJid().toString());<NEW_LINE>}<NEW_LINE>} | .messageId = messageItem.getUniqueId(); |
637,496 | public void removeOwner(CommandContext args, Actor sender) throws CommandException {<NEW_LINE>warnAboutSaveFailures(sender);<NEW_LINE>// Get the world<NEW_LINE>World world = checkWorld(args, sender, 'w');<NEW_LINE>String <MASK><NEW_LINE>RegionManager manager = checkRegionManager(world);<NEW_LINE>ProtectedRegion region = checkExistingRegion(manager, id, true);<NEW_LINE>// Check permissions<NEW_LINE>if (!getPermissionModel(sender).mayRemoveOwners(region)) {<NEW_LINE>throw new CommandPermissionsException();<NEW_LINE>}<NEW_LINE>Callable<DefaultDomain> callable;<NEW_LINE>if (args.hasFlag('a')) {<NEW_LINE>callable = region::getOwners;<NEW_LINE>} else {<NEW_LINE>if (args.argsLength() < 2) {<NEW_LINE>throw new CommandException("List some names to remove, or use -a to remove all.");<NEW_LINE>}<NEW_LINE>// Resolve owners asynchronously<NEW_LINE>DomainInputResolver resolver = new DomainInputResolver(WorldGuard.getInstance().getProfileService(), args.getParsedPaddedSlice(1, 0));<NEW_LINE>resolver.setLocatorPolicy(args.hasFlag('n') ? UserLocatorPolicy.NAME_ONLY : UserLocatorPolicy.UUID_AND_NAME);<NEW_LINE>callable = resolver;<NEW_LINE>}<NEW_LINE>final String description = String.format("Removing owners from the region '%s' on '%s'", region.getId(), world.getName());<NEW_LINE>AsyncCommandBuilder.wrap(callable, sender).registerWithSupervisor(worldGuard.getSupervisor(), description).sendMessageAfterDelay("(Please wait... querying player names...)").onSuccess(String.format("Region '%s' updated with owners removed.", region.getId()), region.getOwners()::removeAll).onFailure("Failed to remove owners", worldGuard.getExceptionConverter()).buildAndExec(worldGuard.getExecutorService());<NEW_LINE>} | id = args.getString(0); |
485,603 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int result = controller.rollDice(outcome, source, game, 6);<NEW_LINE>Player player = game.getPlayer(getTargetPointer().getFirst(game, source));<NEW_LINE>if (player != null) {<NEW_LINE>player.damage(result, source.getSourceId(), source, game);<NEW_LINE>}<NEW_LINE>Permanent permanent = source.getSourcePermanentIfItStillExists(game);<NEW_LINE>if (permanent == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Set<UUID> opponents = game.getOpponents(source.getControllerId());<NEW_LINE>if (player != null) {<NEW_LINE>opponents.<MASK><NEW_LINE>}<NEW_LINE>Player opponent = game.getPlayer(RandomUtil.randomFromCollection(opponents));<NEW_LINE>if (opponent == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>opponent.addAttachment(permanent.getId(), source, game);<NEW_LINE>return true;<NEW_LINE>} | remove(player.getId()); |
497,104 | public static void verifyOptionsEqualsHashcode(ParserOptions options1, ParserOptions options2, ParserOptions options3, ParserOptions options4) {<NEW_LINE>// Objects should be different<NEW_LINE>Assert.assertNotSame(options1, options2);<NEW_LINE><MASK><NEW_LINE>Assert.assertNotSame(options1, options3);<NEW_LINE>Assert.assertNotSame(options2, options3);<NEW_LINE>Assert.assertNotSame(options2, options4);<NEW_LINE>Assert.assertNotSame(options3, options4);<NEW_LINE>// Check all 16 equality combinations<NEW_LINE>Assert.assertEquals(options1, options1);<NEW_LINE>Assert.assertFalse(options1.equals(options2));<NEW_LINE>Assert.assertEquals(options1, options3);<NEW_LINE>Assert.assertFalse(options1.equals(options4));<NEW_LINE>Assert.assertFalse(options2.equals(options1));<NEW_LINE>Assert.assertEquals(options2, options2);<NEW_LINE>Assert.assertFalse(options2.equals(options3));<NEW_LINE>Assert.assertEquals(options2, options4);<NEW_LINE>Assert.assertEquals(options3, options1);<NEW_LINE>Assert.assertFalse(options3.equals(options2));<NEW_LINE>Assert.assertEquals(options3, options3);<NEW_LINE>Assert.assertFalse(options3.equals(options4));<NEW_LINE>Assert.assertFalse(options4.equals(options1));<NEW_LINE>Assert.assertEquals(options4, options2);<NEW_LINE>Assert.assertFalse(options4.equals(options3));<NEW_LINE>Assert.assertEquals(options4, options4);<NEW_LINE>// Hashcodes should match up<NEW_LINE>Assert.assertNotEquals(options1.hashCode(), options2.hashCode());<NEW_LINE>Assert.assertEquals(options1.hashCode(), options3.hashCode());<NEW_LINE>Assert.assertNotEquals(options1.hashCode(), options4.hashCode());<NEW_LINE>Assert.assertNotEquals(options2.hashCode(), options3.hashCode());<NEW_LINE>Assert.assertEquals(options2.hashCode(), options4.hashCode());<NEW_LINE>Assert.assertNotEquals(options3.hashCode(), options4.hashCode());<NEW_LINE>} | Assert.assertNotSame(options1, options2); |
951,544 | protected static void consume_rg(GraphicsState graphicState, Stack stack, Library library) {<NEW_LINE>if (stack.size() >= 3) {<NEW_LINE>float b = ((Number) stack.pop()).floatValue();<NEW_LINE>float gg = ((Number) stack.pop()).floatValue();<NEW_LINE>float r = ((Number) stack.<MASK><NEW_LINE>b = Math.max(0.0f, Math.min(1.0f, b));<NEW_LINE>gg = Math.max(0.0f, Math.min(1.0f, gg));<NEW_LINE>r = Math.max(0.0f, Math.min(1.0f, r));<NEW_LINE>// set fill colour<NEW_LINE>graphicState.setFillColorSpace(PColorSpace.getColorSpace(library, DeviceRGB.DEVICERGB_KEY));<NEW_LINE>graphicState.setFillColor(new Color(r, gg, b));<NEW_LINE>}<NEW_LINE>} | pop()).floatValue(); |
270,396 | private void fillSegmentInfo(SegmentReader segmentReader, boolean search, Map<String, Segment> segments) {<NEW_LINE>SegmentCommitInfo info = segmentReader.getSegmentInfo();<NEW_LINE>assert segments.containsKey(info.info.name) == false;<NEW_LINE>Segment segment = new Segment(info.info.name);<NEW_LINE>segment.search = search;<NEW_LINE>segment<MASK><NEW_LINE>segment.delDocCount = segmentReader.numDeletedDocs();<NEW_LINE>segment.version = info.info.getVersion();<NEW_LINE>segment.compound = info.info.getUseCompoundFile();<NEW_LINE>try {<NEW_LINE>segment.sizeInBytes = info.sizeInBytes();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.trace(() -> new ParameterizedMessage("failed to get size for [{}]", info.info.name), e);<NEW_LINE>}<NEW_LINE>segment.segmentSort = info.info.getIndexSort();<NEW_LINE>segment.attributes = info.info.getAttributes();<NEW_LINE>// TODO: add more fine grained mem stats values to per segment info here<NEW_LINE>segments.put(info.info.name, segment);<NEW_LINE>} | .docCount = segmentReader.numDocs(); |
1,387,158 | public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {<NEW_LINE>try {<NEW_LINE>Object value;<NEW_LINE>final JSONLexer lexer = parser.lexer;<NEW_LINE>final int token = lexer.token();<NEW_LINE>if (token == JSONToken.LITERAL_INT) {<NEW_LINE>int intValue = lexer.intValue();<NEW_LINE>lexer.nextToken(JSONToken.COMMA);<NEW_LINE>if (intValue < 0 || intValue > ordinalEnums.length) {<NEW_LINE>throw new JSONException("parse enum " + enumClass.getName() + " error, value : " + intValue);<NEW_LINE>}<NEW_LINE>return (T) ordinalEnums[intValue];<NEW_LINE>} else if (token == JSONToken.LITERAL_STRING) {<NEW_LINE>String name = lexer.stringVal();<NEW_LINE>lexer.nextToken(JSONToken.COMMA);<NEW_LINE>if (name.length() == 0) {<NEW_LINE>return (T) null;<NEW_LINE>}<NEW_LINE>long hash = 0xcbf29ce484222325L;<NEW_LINE>for (int j = 0; j < name.length(); ++j) {<NEW_LINE>char ch = name.charAt(j);<NEW_LINE>hash ^= ch;<NEW_LINE>hash *= 0x100000001b3L;<NEW_LINE>}<NEW_LINE>return (T) getEnumByHashCode(hash);<NEW_LINE>} else if (token == JSONToken.NULL) {<NEW_LINE>value = null;<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>value = parser.parse();<NEW_LINE>}<NEW_LINE>throw new JSONException("parse enum " + enumClass.getName() + " error, value : " + value);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JSONException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | lexer.nextToken(JSONToken.COMMA); |
674,018 | public IHUQueryBuilder createHUsAvailableToIssueQuery(@NonNull final I_PP_Order_BOMLine ppOrderBomLine) {<NEW_LINE>final WarehouseId warehouseId = WarehouseId.ofRepoId(ppOrderBomLine.getM_Warehouse_ID());<NEW_LINE>final Set<WarehouseId> issueFromWarehouseIds = warehouseDAO.<MASK><NEW_LINE>final AttributeSetInstanceId expectedASI = AttributeSetInstanceId.ofRepoIdOrNone(ppOrderBomLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet storageRelevantAttributeSet = attributeSetInstanceBL.getImmutableAttributeSetById(expectedASI).filterOnlyStorageRelevantAttributes();<NEW_LINE>return handlingUnitsDAO.createHUQueryBuilder().addOnlyWithProductId(ProductId.ofRepoId(ppOrderBomLine.getM_Product_ID())).addOnlyInWarehouseId(WarehouseId.ofRepoId(ppOrderBomLine.getM_Warehouse_ID())).addHUStatusToInclude(X_M_HU.HUSTATUS_Active).addOnlyWithAttributes(storageRelevantAttributeSet).setExcludeReserved().setOnlyTopLevelHUs().onlyNotLocked();<NEW_LINE>} | getWarehouseIdsOfSameGroup(warehouseId, WarehouseGroupAssignmentType.MANUFACTURING); |
1,120,234 | public Response intercept(@NonNull Chain chain) throws IOException {<NEW_LINE>Request request = chain.request();<NEW_LINE>byte[] messageBytes;<NEW_LINE>String apiKeyData;<NEW_LINE>byte[] apiSecret;<NEW_LINE>try {<NEW_LINE>JSONObject params = getParamsFromRequest(request);<NEW_LINE>if ("BCH2BTC".equalsIgnoreCase(params.optString("from") + "2" + params.optString("to"))) {<NEW_LINE>apiKeyData = API_KEY_DATA_BCH_TO_BTC;<NEW_LINE>apiSecret = API_SECRET_BCH_TO_BTC;<NEW_LINE>} else {<NEW_LINE>apiKeyData = API_KEY_DATA_ELSE;<NEW_LINE>apiSecret = API_SECRET_ELSE;<NEW_LINE>}<NEW_LINE>JSONObject requestBodyJson = new JSONObject().put("id", "test").put("jsonrpc", "2.0").put("method", getMethodFromRequest(request)).put("params", params);<NEW_LINE>messageBytes = requestBodyJson.toString().getBytes();<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] sha512bytes = Hmac.hmacSha512(apiSecret, messageBytes);<NEW_LINE>String signData = HexUtils.toHex(sha512bytes);<NEW_LINE>request = request.newBuilder().delete().addHeader("api-key", apiKeyData).addHeader("sign", signData).post(RequestBody.create(MediaType.parse("application/json; charset=UTF-8")<MASK><NEW_LINE>return chain.proceed(request);<NEW_LINE>} | , messageBytes)).build(); |
477,822 | private void completeTaskInstance(WorkflowContext.ActionContext actionContext) {<NEW_LINE>WorkflowTaskEntity taskEntity = actionContext.getTaskEntity();<NEW_LINE>TaskStatus taskStatus = toTaskState(actionContext.getAction());<NEW_LINE>taskEntity.setStatus(taskStatus.name());<NEW_LINE>taskEntity.setOperator(actionContext.getOperator());<NEW_LINE>taskEntity.setRemark(actionContext.getRemark());<NEW_LINE>UserTask userTask = (UserTask) actionContext.getTask();<NEW_LINE>try {<NEW_LINE>TaskForm taskForm = actionContext.getForm();<NEW_LINE>if (needForm(userTask, actionContext.getAction())) {<NEW_LINE>Preconditions.checkNotNull(taskForm, "form cannot be null");<NEW_LINE>Preconditions.checkTrue(taskForm.getClass().isAssignableFrom(userTask.getFormClass()), "form type not match, should be class " + userTask.getFormClass());<NEW_LINE>taskForm.validate();<NEW_LINE>taskEntity.setFormData(objectMapper.writeValueAsString(taskForm));<NEW_LINE>} else {<NEW_LINE>Preconditions.checkNull(taskForm, "no form required");<NEW_LINE>}<NEW_LINE>taskEntity<MASK><NEW_LINE>Map<String, Object> extMap = new HashMap<>();<NEW_LINE>if (StringUtils.isNotBlank(taskEntity.getExtParams())) {<NEW_LINE>extMap = objectMapper.readValue(taskEntity.getExtParams(), objectMapper.getTypeFactory().constructMapType(Map.class, String.class, Object.class));<NEW_LINE>if (WorkflowAction.TRANSFER.equals(actionContext.getAction())) {<NEW_LINE>extMap.put(WorkflowTaskEntity.EXT_TRANSFER_USER_KEY, actionContext.getTransferToUsers());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String extParams = objectMapper.writeValueAsString(extMap);<NEW_LINE>taskEntity.setExtParams(extParams);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>log.error("parse transfer users error: ", e);<NEW_LINE>throw new JsonException("parse transfer users error");<NEW_LINE>}<NEW_LINE>taskEntityMapper.update(taskEntity);<NEW_LINE>} | .setEndTime(new Date()); |
488,323 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>add_filter_result result = new add_filter_result();<NEW_LINE>if (e instanceof rpc_management_exception) {<NEW_LINE><MASK><NEW_LINE>result.setExIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | result.ex = (rpc_management_exception) e; |
1,738,798 | private void processCompleteSingleStep(final long threadId, final BigInteger resolvedAddress) {<NEW_LINE>final BigInteger lastIndirectCallAddress = lastHits.get(threadId);<NEW_LINE>if (lastIndirectCallAddress == null) {<NEW_LINE>// In rare cases we complete a single step without hitting a breakpoint<NEW_LINE>// first.<NEW_LINE>// This can happen because of a bug in the Win32 debug client that<NEW_LINE>// occurs because of a race condition in multi-threaded programs.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (resolvedAddresses) {<NEW_LINE>if (!resolvedAddresses.containsKey(lastIndirectCallAddress)) {<NEW_LINE>resolvedAddresses.put(lastIndirectCallAddress, new HashSet<ResolvedFunction>());<NEW_LINE>}<NEW_LINE>final ResolvedFunction resolvedFunction = <MASK><NEW_LINE>if (resolvedAddresses.get(lastIndirectCallAddress).add(resolvedFunction)) {<NEW_LINE>hitCounter.put(lastIndirectCallAddress, 0);<NEW_LINE>}<NEW_LINE>if (hitCounter.get(lastIndirectCallAddress) >= HIT_THRESHOLD) {<NEW_LINE>final IndirectCall indirectCall = IndirectCallResolver.findIndirectCall(debugger, indirectCallAddresses, lastIndirectCallAddress);<NEW_LINE>if (indirectCall != null) {<NEW_LINE>removeBreakpoint(indirectCall);<NEW_LINE>removedBreakpoints.add(indirectCall);<NEW_LINE>resolvedCall(lastIndirectCallAddress, resolvedFunction);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | resolveFunction(new Address(resolvedAddress)); |
500,183 | public static void main(String[] args) throws SQLException {<NEW_LINE>// For more connection related properties. Refer to<NEW_LINE>// the OracleConnection interface.<NEW_LINE>Properties properties = new Properties();<NEW_LINE>// Connection property to enable IAM token authentication.<NEW_LINE>// properties.put(OracleConnection.CONNECTION_PROPERTY_TOKEN_AUTHENTICATION, "OCI_TOKEN");<NEW_LINE>OracleDataSource ods = new OracleDataSource();<NEW_LINE>ods.setURL(DB_URL);<NEW_LINE>ods.setConnectionProperties(properties);<NEW_LINE>// With AutoCloseable, the connection is closed automatically.<NEW_LINE>try (OracleConnection connection = (OracleConnection) ods.getConnection()) {<NEW_LINE>// Get the JDBC driver name and version<NEW_LINE>DatabaseMetaData dbmd = connection.getMetaData();<NEW_LINE>System.out.println("Driver Name: " + dbmd.getDriverName());<NEW_LINE>System.out.println(<MASK><NEW_LINE>// Print some connection properties<NEW_LINE>System.out.println("Default Row Prefetch Value is: " + connection.getDefaultRowPrefetch());<NEW_LINE>System.out.println("Database Username is: " + connection.getUserName());<NEW_LINE>System.out.println();<NEW_LINE>// Perform a database operation<NEW_LINE>printTableNames(connection);<NEW_LINE>}<NEW_LINE>} | "Driver Version: " + dbmd.getDriverVersion()); |
722,008 | private List<JspCompletionItem> files(int offset, FileObject folder, String prefix, JspSyntaxSupport sup) {<NEW_LINE>ArrayList<JspCompletionItem> res = new ArrayList<JspCompletionItem>();<NEW_LINE>TreeMap<String, JspCompletionItem> resFolders = new TreeMap<String, JspCompletionItem>();<NEW_LINE>TreeMap<String, JspCompletionItem> resFiles = new TreeMap<String, JspCompletionItem>();<NEW_LINE>Enumeration<? extends FileObject> files = folder.getChildren(false);<NEW_LINE>while (files.hasMoreElements()) {<NEW_LINE>FileObject file = files.nextElement();<NEW_LINE>String fname = file.getNameExt();<NEW_LINE>if (fname.startsWith(prefix) && !"cvs".equalsIgnoreCase(fname)) {<NEW_LINE>if (file.isFolder())<NEW_LINE>resFolders.put(file.getNameExt(), JspCompletionItem.createFileCompletionItem(file.getNameExt() + "/", offset, java.awt.Color.BLUE, PACKAGE_ICON));<NEW_LINE>else {<NEW_LINE>java.awt.Image icon = JspUtils.getIcon(file);<NEW_LINE>if (icon != null)<NEW_LINE>resFiles.put(file.getNameExt(), JspCompletionItem.createFileCompletionItem(file.getNameExt(), offset, java.awt.Color.BLACK, new javax.swing.ImageIcon(icon)));<NEW_LINE>else<NEW_LINE>resFiles.put(file.getNameExt(), JspCompletionItem.createFileCompletionItem(file.getNameExt(), offset, java.awt.Color.BLACK, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>res.addAll(resFolders.values());<NEW_LINE>res.<MASK><NEW_LINE>return res;<NEW_LINE>} | addAll(resFiles.values()); |
1,155,458 | public <T> GeoResults<T> geoNear(NearQuery near, Class<?> domainType, String collectionName, Class<T> returnType) {<NEW_LINE>if (near == null) {<NEW_LINE>throw new InvalidDataAccessApiUsageException("NearQuery must not be null!");<NEW_LINE>}<NEW_LINE>if (domainType == null) {<NEW_LINE>throw new InvalidDataAccessApiUsageException("Entity class must not be null!");<NEW_LINE>}<NEW_LINE>Assert.notNull(collectionName, "CollectionName must not be null!");<NEW_LINE>Assert.notNull(returnType, "ReturnType must not be null!");<NEW_LINE>String collection = StringUtils.hasText(collectionName) ? collectionName : getCollectionName(domainType);<NEW_LINE>String distanceField = operations.nearQueryDistanceFieldName(domainType);<NEW_LINE>Aggregation $geoNear = TypedAggregation.newAggregation(domainType, Aggregation.geoNear(near, distanceField)).withOptions(AggregationOptions.builder().collation(near.getCollation()).build());<NEW_LINE>AggregationResults<Document> results = aggregate($geoNear, collection, Document.class);<NEW_LINE>EntityProjection<T, ?> projection = operations.introspectProjection(returnType, domainType);<NEW_LINE>DocumentCallback<GeoResult<T>> callback = new GeoNearResultDocumentCallback<>(distanceField, new ProjectingReadCallback<>(mongoConverter, projection, collection), near.getMetric());<NEW_LINE>List<GeoResult<T>> <MASK><NEW_LINE>BigDecimal aggregate = BigDecimal.ZERO;<NEW_LINE>for (Document element : results) {<NEW_LINE>GeoResult<T> geoResult = callback.doWith(element);<NEW_LINE>aggregate = aggregate.add(BigDecimal.valueOf(geoResult.getDistance().getValue()));<NEW_LINE>result.add(geoResult);<NEW_LINE>}<NEW_LINE>Distance avgDistance = new Distance(result.size() == 0 ? 0 : aggregate.divide(new BigDecimal(result.size()), RoundingMode.HALF_UP).doubleValue(), near.getMetric());<NEW_LINE>return new GeoResults<>(result, avgDistance);<NEW_LINE>} | result = new ArrayList<>(); |
1,773,629 | private void processColors() {<NEW_LINE>try {<NEW_LINE>Matcher matcher = COLOR_PATTERN.matcher(message);<NEW_LINE>boolean result = matcher.find();<NEW_LINE>if (result) {<NEW_LINE>StringBuffer sb = new <MASK><NEW_LINE>do {<NEW_LINE>int count = matcher.groupCount();<NEW_LINE>for (int i = 1; i < count && matcher.group(i) != null; i++) {<NEW_LINE>int code = Integer.parseInt(matcher.group(i));<NEW_LINE>if (code >= 30 && code <= 36 && color == null) {<NEW_LINE>color = COLOR_TABLE[code - 30];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matcher.appendReplacement(sb, "");<NEW_LINE>result = matcher.find();<NEW_LINE>} while (result);<NEW_LINE>matcher.appendTail(sb);<NEW_LINE>message = sb.toString();<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("payara").log(Level.INFO, ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>if (color == null && level > 0) {<NEW_LINE>if (level <= Level.FINE.intValue()) {<NEW_LINE>color = LOG_GREEN;<NEW_LINE>} else if (level <= Level.INFO.intValue()) {<NEW_LINE>color = Color.GRAY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | StringBuffer(message.length()); |
253,688 | public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>init();<NEW_LINE>return new OResultSet() {<NEW_LINE><NEW_LINE>private int currentElement = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>if (txEntries == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (currentElement >= nRecords) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return txEntries.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OResult next() {<NEW_LINE>long begin = profilingEnabled ? System.nanoTime() : 0;<NEW_LINE>try {<NEW_LINE>if (txEntries == null) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>if (currentElement >= nRecords) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>if (!txEntries.hasNext()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>ORecord record = txEntries.next();<NEW_LINE>currentElement++;<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>result.setElement(record);<NEW_LINE>ctx.setVariable("$current", result);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>if (profilingEnabled) {<NEW_LINE>cost += (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Optional<OExecutionPlan> getExecutionPlan() {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Long> getQueryStats() {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | System.nanoTime() - begin); |
308,407 | public static StatementExecutorResponse validate(final ConfiguredStatement<CreateConnector> statement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {<NEW_LINE>final CreateConnector createConnector = statement.getStatement();<NEW_LINE>final <MASK><NEW_LINE>if (checkForExistingConnector(statement, createConnector, client)) {<NEW_LINE>final String errorMsg = String.format("Connector %s already exists", createConnector.getName());<NEW_LINE>throw new KsqlRestException(EndpointResponse.create().status(HttpStatus.SC_CONFLICT).entity(new KsqlErrorMessage(Errors.toErrorCode(HttpStatus.SC_CONFLICT), errorMsg)).build());<NEW_LINE>}<NEW_LINE>final List<String> errors = validateConfigs(createConnector, client);<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>final String errorMessage = "Validation error: " + String.join("\n", errors);<NEW_LINE>throw new KsqlException(errorMessage);<NEW_LINE>}<NEW_LINE>return StatementExecutorResponse.handled(Optional.of(new CreateConnectorEntity(statement.getStatementText(), DUMMY_CREATE_RESPONSE)));<NEW_LINE>} | ConnectClient client = serviceContext.getConnectClient(); |
1,480,590 | Span generateSpan(SpanData spanData) {<NEW_LINE>Endpoint endpoint = getEndpoint(spanData);<NEW_LINE>long startTimestamp = toEpochMicros(spanData.getStartEpochNanos());<NEW_LINE>long endTimestamp = toEpochMicros(spanData.getEndEpochNanos());<NEW_LINE>Span.Builder spanBuilder = Span.newBuilder().traceId(spanData.getTraceId()).id(spanData.getSpanId()).kind(toSpanKind(spanData)).name(spanData.getName()).timestamp(toEpochMicros(spanData.getStartEpochNanos())).duration(Math.max(1, endTimestamp - startTimestamp)).localEndpoint(endpoint);<NEW_LINE>if (spanData.getParentSpanContext().isValid()) {<NEW_LINE>spanBuilder.parentId(spanData.getParentSpanId());<NEW_LINE>}<NEW_LINE>Attributes spanAttributes = spanData.getAttributes();<NEW_LINE>spanAttributes.forEach((key, value) -> spanBuilder.putTag(key.getKey(), valueToString(key, value)));<NEW_LINE>int droppedAttributes = spanData.getTotalAttributeCount() - spanAttributes.size();<NEW_LINE>if (droppedAttributes > 0) {<NEW_LINE>spanBuilder.putTag(OTEL_DROPPED_ATTRIBUTES_COUNT, String.valueOf(droppedAttributes));<NEW_LINE>}<NEW_LINE>StatusData status = spanData.getStatus();<NEW_LINE>// include status code & error.<NEW_LINE>if (status.getStatusCode() != StatusCode.UNSET) {<NEW_LINE>spanBuilder.putTag(OTEL_STATUS_CODE, status.getStatusCode().toString());<NEW_LINE>// add the error tag, if it isn't already in the source span.<NEW_LINE>if (status.getStatusCode() == StatusCode.ERROR && spanAttributes.get(STATUS_ERROR) == null) {<NEW_LINE>spanBuilder.putTag(STATUS_ERROR.getKey(), nullToEmpty(status.getDescription()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InstrumentationScopeInfo instrumentationScopeInfo = spanData.getInstrumentationScopeInfo();<NEW_LINE>if (!instrumentationScopeInfo.getName().isEmpty()) {<NEW_LINE>spanBuilder.putTag(KEY_INSTRUMENTATION_SCOPE_NAME, instrumentationScopeInfo.getName());<NEW_LINE>// Include instrumentation library name for backwards compatibility<NEW_LINE>spanBuilder.putTag(KEY_INSTRUMENTATION_LIBRARY_NAME, instrumentationScopeInfo.getName());<NEW_LINE>}<NEW_LINE>if (instrumentationScopeInfo.getVersion() != null) {<NEW_LINE>spanBuilder.putTag(KEY_INSTRUMENTATION_SCOPE_VERSION, instrumentationScopeInfo.getVersion());<NEW_LINE>// Include instrumentation library name for backwards compatibility<NEW_LINE>spanBuilder.putTag(KEY_INSTRUMENTATION_LIBRARY_VERSION, instrumentationScopeInfo.getVersion());<NEW_LINE>}<NEW_LINE>for (EventData annotation : spanData.getEvents()) {<NEW_LINE>spanBuilder.addAnnotation(toEpochMicros(annotation.getEpochNanos()), annotation.getName());<NEW_LINE>}<NEW_LINE>int droppedEvents = spanData.getTotalRecordedEvents() - spanData<MASK><NEW_LINE>if (droppedEvents > 0) {<NEW_LINE>spanBuilder.putTag(OTEL_DROPPED_EVENTS_COUNT, String.valueOf(droppedEvents));<NEW_LINE>}<NEW_LINE>return spanBuilder.build();<NEW_LINE>} | .getEvents().size(); |
433,657 | public void onBindItemViewHolder(RecentPhotoViewHolder viewHolder, @NonNull Cursor cursor) {<NEW_LINE>viewHolder.imageView.setImageDrawable(null);<NEW_LINE>long rowId = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore<MASK><NEW_LINE>long dateTaken = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATE_TAKEN));<NEW_LINE>long dateModified = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.DATE_MODIFIED));<NEW_LINE>String mimeType = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.MIME_TYPE));<NEW_LINE>int orientation = cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns.ORIENTATION));<NEW_LINE>final Uri uri = ContentUris.withAppendedId(RecentPhotosLoader.BASE_URL, rowId);<NEW_LINE>Key signature = new MediaStoreSignature(mimeType, dateModified, orientation);<NEW_LINE>GlideApp.with(getContext().getApplicationContext()).load(uri).signature(signature).diskCacheStrategy(DiskCacheStrategy.NONE).into(viewHolder.imageView);<NEW_LINE>viewHolder.imageView.setOnClickListener(v -> {<NEW_LINE>if (clickedListener != null)<NEW_LINE>clickedListener.onItemClicked(uri);<NEW_LINE>});<NEW_LINE>} | .Images.ImageColumns._ID)); |
1,834,837 | private void showStatsLegend(GraphicsContext gc) {<NEW_LINE>JITStats stats = mainUI.getJITDataModel().getJITStats();<NEW_LINE>StringBuilder compiledStatsBuilder = new StringBuilder();<NEW_LINE>compiledStatsBuilder.append("Total Compilations: ").append(stats.getTotalCompiledMethods());<NEW_LINE>compiledStatsBuilder.append(" (C1: ").append(stats.getCountC1()).append(S_CLOSE_PARENTHESES);<NEW_LINE>compiledStatsBuilder.append(" (C2: ").append(stats.getCountC2()).append(S_CLOSE_PARENTHESES);<NEW_LINE>compiledStatsBuilder.append(" (C2N: ").append(stats.getCountC2N<MASK><NEW_LINE>compiledStatsBuilder.append(" (OSR: ").append(stats.getCountOSR()).append(S_CLOSE_PARENTHESES);<NEW_LINE>setStrokeForText();<NEW_LINE>gc.fillText(compiledStatsBuilder.toString(), fix(graphGapLeft), fix(2));<NEW_LINE>} | ()).append(S_CLOSE_PARENTHESES); |
1,579,210 | protected BaseClient loadClient(Connection conn, String clientId) {<NEW_LINE>String methodName = "findClient";<NEW_LINE>_log.entering(CLASS, methodName, new Object[] { clientId });<NEW_LINE>BaseClient result = null;<NEW_LINE>ResultSet queryResults = null;<NEW_LINE>PreparedStatement st = null;<NEW_LINE>try {<NEW_LINE>String query = "SELECT * FROM " + tableName + " WHERE " + TableConstants.COL_CC2_COMPONENTID <MASK><NEW_LINE>st = conn.prepareStatement(query);<NEW_LINE>st.setString(1, componentId);<NEW_LINE>st.setString(2, clientId);<NEW_LINE>queryResults = st.executeQuery();<NEW_LINE>while (queryResults != null && result == null && queryResults.next()) {<NEW_LINE>result = createClient(queryResults, clientId);<NEW_LINE>cache.put(result.getClientId(), result);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// log but don't fail<NEW_LINE>_log.logp(Level.SEVERE, CLASS, methodName, e.getMessage(), e);<NEW_LINE>} finally {<NEW_LINE>closeResultSet(queryResults);<NEW_LINE>if (st != null) {<NEW_LINE>try {<NEW_LINE>st.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>_log.logp(Level.SEVERE, CLASS, methodName, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_log.exiting(CLASS, methodName, result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | + " = ? AND " + TableConstants.COL_CC2_CLIENTID + " = ?"; |
1,811,684 | public void exportElement(JRPdfExporterContext exporterContext, JRGenericPrintElement element) {<NEW_LINE>JRPrintText labelPrintText = (JRPrintText) element.getParameterValue(IconLabelElement.PARAMETER_LABEL_TEXT_ELEMENT);<NEW_LINE>if (// FIXMEINPUT deal with xml serialization<NEW_LINE>labelPrintText == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JRBasePrintFrame frame = new JRBasePrintFrame(element.getDefaultStyleProvider());<NEW_LINE>frame.setX(element.getX());<NEW_LINE>frame.setY(element.getY());<NEW_LINE>frame.setWidth(element.getWidth());<NEW_LINE>frame.setHeight(element.getHeight());<NEW_LINE>frame.setStyle(element.getStyle());<NEW_LINE>frame.setBackcolor(element.getBackcolor());<NEW_LINE>frame.setForecolor(element.getForecolor());<NEW_LINE>frame.setMode(element.getModeValue());<NEW_LINE>JRLineBox lineBox = (JRLineBox) element.getParameterValue(IconLabelElement.PARAMETER_LINE_BOX);<NEW_LINE>if (lineBox != null) {<NEW_LINE>frame.copyBox(lineBox);<NEW_LINE>}<NEW_LINE>frame.addElement(labelPrintText);<NEW_LINE>JRPrintText iconPrintText = (JRPrintText) element.getParameterValue(IconLabelElement.PARAMETER_ICON_TEXT_ELEMENT);<NEW_LINE>if (// FIXMEINPUT deal with xml serialization<NEW_LINE>iconPrintText != null) {<NEW_LINE>frame.addElement(iconPrintText);<NEW_LINE>}<NEW_LINE>JRPdfExporter exporter = <MASK><NEW_LINE>try {<NEW_LINE>exporter.exportFrame(frame);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JRRuntimeException(e);<NEW_LINE>}<NEW_LINE>} | (JRPdfExporter) exporterContext.getExporterRef(); |
114,553 | public static String[] usage() {<NEW_LINE>return new String[] { "less - file pager", "Usage: less [OPTIONS] [FILES]", " -? --help Show help", " -e --quit-at-eof Exit on second EOF", " -E --QUIT-AT-EOF Exit on EOF", " -F --quit-if-one-screen Exit if entire file fits on first screen", " -q --quiet --silent Silent mode", " -Q --QUIET --SILENT Completely silent", " -S --chop-long-lines Do not fold long lines", " -i --ignore-case Search ignores lowercase case", " -I --IGNORE-CASE Search ignores all case", " -x --tabs=N[,...] Set tab stops", " -N --LINE-NUMBERS Display line number for each line", " -Y --syntax=name The name of the syntax highlighting to use.", <MASK><NEW_LINE>} | " --no-init Disable terminal initialization", " --no-keypad Disable keypad handling", " --ignorercfiles Don't look at the system's lessrc nor at the user's lessrc.", " -H --historylog=name Log search strings to file, so they can be retrieved in later sessions" }; |
8,953 | private static void fillDocumentsTableArrays() {<NEW_LINE>if (documentsTableID == null) {<NEW_LINE>String sql = "SELECT t.AD_Table_ID, t.TableName " + "FROM AD_Table t, AD_Column c " + "WHERE t.AD_Table_ID=c.AD_Table_ID AND " + "c.ColumnName='Posted' AND " + "IsView='N' " + "ORDER BY t.AD_Table_ID";<NEW_LINE>ArrayList<Integer> tableIDs = new ArrayList<Integer>();<NEW_LINE>ArrayList<String> tableNames = new ArrayList<String>();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>tableIDs.add(rs.getInt(1));<NEW_LINE>tableNames.add(rs.getString(2));<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>// Convert to array<NEW_LINE>documentsTableID = new int[tableIDs.size()];<NEW_LINE>documentsTableName = new String[tableIDs.size()];<NEW_LINE>for (int i = 0; i < documentsTableID.length; i++) {<NEW_LINE>documentsTableID[i] = tableIDs.get(i);<NEW_LINE>documentsTableName[i] = tableNames.get(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new DBException(e, sql); |
1,801,341 | // ---------------------------------------------------------------- print<NEW_LINE>public void printBeans(final int width) {<NEW_LINE>final Print print = new Print();<NEW_LINE>print.line("Beans", width);<NEW_LINE>final List<BeanDefinition> beanDefinitionList = new ArrayList<>();<NEW_LINE>final <MASK><NEW_LINE>final String prefix = appName + ".";<NEW_LINE>petiteContainer.forEachBean(beanDefinitionList::add);<NEW_LINE>beanDefinitionList.stream().sorted((bd1, bd2) -> {<NEW_LINE>if (bd1.name().startsWith(prefix)) {<NEW_LINE>if (bd2.name().startsWith(prefix)) {<NEW_LINE>return bd1.name().compareTo(bd2.name());<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (bd2.name().startsWith(prefix)) {<NEW_LINE>if (bd1.name().startsWith(prefix)) {<NEW_LINE>return bd1.name().compareTo(bd2.name());<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return bd1.name().compareTo(bd2.name());<NEW_LINE>}).forEach(beanDefinition -> {<NEW_LINE>print.out(Chalk256.chalk().yellow(), scopeName(beanDefinition), 10);<NEW_LINE>print.space();<NEW_LINE>print.outLeftRightNewLine(Chalk256.chalk().green(), beanDefinition.name(), Chalk256.chalk().blue(), ClassUtil.getShortClassName(beanDefinition.type(), 2), width - 10 - 1);<NEW_LINE>});<NEW_LINE>print.line(width);<NEW_LINE>} | String appName = appNameSupplier.get(); |
202,285 | public void handleMessage(int group, byte cmd1, Msg msg, DeviceFeature f, String fromPort) {<NEW_LINE>InsteonDevice dev = f.getDevice();<NEW_LINE>if (!msg.isExtended()) {<NEW_LINE>logger.trace("{} device {} ignoring non-extended msg {}", nm(), dev.getAddress(), msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int cmd2 = msg.getByte("command2") & 0xff;<NEW_LINE>switch(cmd2) {<NEW_LINE>case // this is a product data response message<NEW_LINE>0x00:<NEW_LINE>int batteryLevel = msg.getByte("userData4") & 0xff;<NEW_LINE>int batteryWatermark = msg.getByte("userData7") & 0xff;<NEW_LINE>logger.debug("{}: {} got light level: {}, battery level: {}", nm(), dev.getAddress(), batteryWatermark, batteryLevel);<NEW_LINE>m_feature.publish(new DecimalType(batteryWatermark), StateChangeType.CHANGED, "field", "battery_watermark_level");<NEW_LINE>m_feature.publish(new DecimalType(batteryLevel), StateChangeType.CHANGED, "field", "battery_level");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (FieldException e) {<NEW_LINE>logger.error("error parsing {}: ", msg, e);<NEW_LINE>}<NEW_LINE>} | warn("unknown cmd2 = {} in info reply message {}", cmd2, msg); |
6,032 | private void parseInternal(DefaultCommandLine cl, String[] args) {<NEW_LINE>cl.setRawArguments(args);<NEW_LINE>String lastOptionName = null;<NEW_LINE>for (String arg : args) {<NEW_LINE>if (arg == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isNotEmpty(trimmed)) {<NEW_LINE>if (trimmed.charAt(0) == '"' && trimmed.charAt(trimmed.length() - 1) == '"') {<NEW_LINE>trimmed = trimmed.substring(1, trimmed.length() - 1);<NEW_LINE>}<NEW_LINE>if (trimmed.charAt(0) == '-') {<NEW_LINE>lastOptionName = processOption(cl, trimmed);<NEW_LINE>} else {<NEW_LINE>if (lastOptionName != null) {<NEW_LINE>Option opt = declaredOptions.get(lastOptionName);<NEW_LINE>if (opt != null) {<NEW_LINE>cl.addDeclaredOption(opt, trimmed);<NEW_LINE>} else {<NEW_LINE>cl.addUndeclaredOption(lastOptionName, trimmed);<NEW_LINE>}<NEW_LINE>lastOptionName = null;<NEW_LINE>} else {<NEW_LINE>cl.addRemainingArg(trimmed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String trimmed = arg.trim(); |
614,818 | public void onChatMessage(ChatMessage chatMessage) {<NEW_LINE>// Start sending old messages right after the welcome message, as that is most reliable source<NEW_LINE>// of information that chat history was reset<NEW_LINE>ChatMessageType chatMessageType = chatMessage.getType();<NEW_LINE>if (chatMessageType == ChatMessageType.WELCOME && StringUtils.startsWithIgnoreCase(chatMessage.getMessage(), WELCOME_MESSAGE)) {<NEW_LINE>if (!config.retainChatHistory()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (MessageNode queuedMessage : messageQueue) {<NEW_LINE>final MessageNode node = client.addChatMessage(queuedMessage.getType(), queuedMessage.getName(), queuedMessage.getValue(), queuedMessage.getSender(), false);<NEW_LINE>node.setRuneLiteFormatMessage(queuedMessage.getRuneLiteFormatMessage());<NEW_LINE>node.setTimestamp(queuedMessage.getTimestamp());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(chatMessageType) {<NEW_LINE>case PRIVATECHATOUT:<NEW_LINE>case PRIVATECHAT:<NEW_LINE>case MODPRIVATECHAT:<NEW_LINE>final String name = Text.<MASK><NEW_LINE>// Remove to ensure uniqueness & its place in history<NEW_LINE>if (!friends.remove(name)) {<NEW_LINE>// If the friend didn't previously exist ensure deque capacity doesn't increase by adding them<NEW_LINE>if (friends.size() >= FRIENDS_MAX_SIZE) {<NEW_LINE>friends.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>friends.add(name);<NEW_LINE>// intentional fall-through<NEW_LINE>case PUBLICCHAT:<NEW_LINE>case MODCHAT:<NEW_LINE>case FRIENDSCHAT:<NEW_LINE>case CLAN_GUEST_CHAT:<NEW_LINE>case CLAN_GUEST_MESSAGE:<NEW_LINE>case CLAN_CHAT:<NEW_LINE>case CLAN_MESSAGE:<NEW_LINE>case CLAN_GIM_CHAT:<NEW_LINE>case CLAN_GIM_MESSAGE:<NEW_LINE>case CONSOLE:<NEW_LINE>messageQueue.offer(chatMessage.getMessageNode());<NEW_LINE>}<NEW_LINE>} | removeTags(chatMessage.getName()); |
4,603 | public void onResult(SQLQueryResult<Map<String, String>> result) {<NEW_LINE>// SQLQueryResult<Map<String, String>> queryRestl=new SQLQueryResult<Map<String, String>>(this.result,!failed, dataNode,errorMsg);<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>LOGGER.debug("onResult success on xa rollback {},{}", xaId, participantLogEntry.resourceName);<NEW_LINE>// recovery log<NEW_LINE>CoordinatorLogEntry coordinatorLogEntry = MultiNodeCoordinator.inMemoryRepository.get(xaId);<NEW_LINE>for (int i = 0; i < coordinatorLogEntry.participants.length; i++) {<NEW_LINE>if (coordinatorLogEntry.participants[i].resourceName.equals(participantLogEntry.resourceName)) {<NEW_LINE>coordinatorLogEntry.participants[<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>MultiNodeCoordinator.inMemoryRepository.put(xaId, coordinatorLogEntry);<NEW_LINE>MultiNodeCoordinator.fileRepository.writeCheckpoint(xaId, MultiNodeCoordinator.inMemoryRepository.getAllCoordinatorLogEntries());<NEW_LINE>} else {<NEW_LINE>String errorMsg = result.getErrMsg();<NEW_LINE>LOGGER.error(errorMsg);<NEW_LINE>if (errorMsg.indexOf("Unknown XID") > -1) {<NEW_LINE>// todo unknow xaId<NEW_LINE>CoordinatorLogEntry coordinatorLogEntry = MultiNodeCoordinator.inMemoryRepository.get(xaId);<NEW_LINE>for (int i = 0; i < coordinatorLogEntry.participants.length; i++) {<NEW_LINE>if (coordinatorLogEntry.participants[i].resourceName.equals(participantLogEntry.resourceName)) {<NEW_LINE>coordinatorLogEntry.participants[i].txState = TxState.TX_ROLLBACKED_STATE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MultiNodeCoordinator.inMemoryRepository.put(xaId, coordinatorLogEntry);<NEW_LINE>MultiNodeCoordinator.fileRepository.writeCheckpoint(xaId, MultiNodeCoordinator.inMemoryRepository.getAllCoordinatorLogEntries());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug("[CALLBACK][XA ROLLBACK] when Mycat start");<NEW_LINE>} | i].txState = TxState.TX_ROLLBACKED_STATE; |
198,824 | private void registerUnlockReceiver() {<NEW_LINE>try {<NEW_LINE>IntentFilter intentFilter = new IntentFilter();<NEW_LINE>intentFilter.addAction(Intent.ACTION_USER_UNLOCKED);<NEW_LINE>ActivityManagerService.registerReceiver("android", null, new IIntentReceiver.Stub() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered, boolean sticky, int sendingUser) {<NEW_LINE>getExecutorService().submit(() -> dispatchUserUnlocked(intent));<NEW_LINE>try {<NEW_LINE>ActivityManagerService.finishReceiver(this, resultCode, data, extras, false, intent.getFlags());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Log.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, intentFilter, null, 0, 0);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Log.e(TAG, "register unlock receiver", e);<NEW_LINE>}<NEW_LINE>Log.d(TAG, "registered unlock receiver");<NEW_LINE>} | e(TAG, "finish receiver", e); |
1,244,745 | public void run() {<NEW_LINE>logger.info("Starting server.");<NEW_LINE>InetAddress localAddr = MaryProperties.needInetAddress("socket.addr");<NEW_LINE>int localPort = MaryProperties.needInteger("socket.port");<NEW_LINE>HttpParams params = new BasicHttpParams();<NEW_LINE>// 0 means no timeout, any positive value means time out in miliseconds (i.e. 50000 for 50 seconds)<NEW_LINE>params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0).setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024).setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false).setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true).setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");<NEW_LINE>BasicHttpProcessor httpproc = new BasicHttpProcessor();<NEW_LINE>httpproc.addInterceptor(new ResponseDate());<NEW_LINE>httpproc.addInterceptor(new ResponseServer());<NEW_LINE>httpproc.addInterceptor(new ResponseContent());<NEW_LINE>httpproc.addInterceptor(new ResponseConnControl());<NEW_LINE>BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(httpproc, new DefaultHttpResponseFactory(), new DefaultConnectionReuseStrategy(), params);<NEW_LINE>// Set up request handlers<NEW_LINE>HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();<NEW_LINE>registry.register("/process", new SynthesisRequestHandler());<NEW_LINE>InfoRequestHandler infoRH = new InfoRequestHandler();<NEW_LINE>registry.register("/version", infoRH);<NEW_LINE>registry.register("/datatypes", infoRH);<NEW_LINE>registry.register("/locales", infoRH);<NEW_LINE>registry.register("/voices", infoRH);<NEW_LINE>registry.register("/audioformats", infoRH);<NEW_LINE>registry.register("/exampletext", infoRH);<NEW_LINE>registry.register("/audioeffects", infoRH);<NEW_LINE>registry.register("/audioeffect-default-param", infoRH);<NEW_LINE>registry.register("/audioeffect-full", infoRH);<NEW_LINE>registry.register("/audioeffect-help", infoRH);<NEW_LINE>registry.register("/audioeffect-is-hmm-effect", infoRH);<NEW_LINE>registry.register("/features", infoRH);<NEW_LINE>registry.register("/features-discrete", infoRH);<NEW_LINE>registry.register("/vocalizations", infoRH);<NEW_LINE>registry.register("/styles", infoRH);<NEW_LINE>registry.register<MASK><NEW_LINE>handler.setHandlerResolver(registry);<NEW_LINE>// Provide an event logger<NEW_LINE>handler.setEventListener(new EventLogger());<NEW_LINE>IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);<NEW_LINE>int numParallelThreads = MaryProperties.getInteger("server.http.parallelthreads", 5);<NEW_LINE>logger.info("Waiting for client to connect on port " + localPort);<NEW_LINE>try {<NEW_LINE>ListeningIOReactor ioReactor = new DefaultListeningIOReactor(numParallelThreads, params);<NEW_LINE>ioReactor.listen(new InetSocketAddress(localAddr, localPort));<NEW_LINE>isReady = true;<NEW_LINE>ioReactor.execute(ioEventDispatch);<NEW_LINE>} catch (InterruptedIOException ex) {<NEW_LINE>logger.info("Interrupted", ex);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.info("Problem with HTTP connection", e);<NEW_LINE>}<NEW_LINE>logger.debug("Shutdown");<NEW_LINE>} | ("*", new FileRequestHandler()); |
1,092,859 | public Request<GetQueueAttributesRequest> marshall(GetQueueAttributesRequest getQueueAttributesRequest) {<NEW_LINE>if (getQueueAttributesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(GetQueueAttributesRequest)");<NEW_LINE>}<NEW_LINE>Request<GetQueueAttributesRequest> request = new DefaultRequest<GetQueueAttributesRequest>(getQueueAttributesRequest, "AmazonSQS");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2012-11-05");<NEW_LINE>String prefix;<NEW_LINE>if (getQueueAttributesRequest.getQueueUrl() != null) {<NEW_LINE>prefix = "QueueUrl";<NEW_LINE>String queueUrl = getQueueAttributesRequest.getQueueUrl();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(queueUrl));<NEW_LINE>}<NEW_LINE>if (getQueueAttributesRequest.getAttributeNames() != null) {<NEW_LINE>prefix = "AttributeName";<NEW_LINE>java.util.List<String> attributeNames = getQueueAttributesRequest.getAttributeNames();<NEW_LINE>int attributeNamesIndex = 1;<NEW_LINE>String attributeNamesPrefix = prefix;<NEW_LINE>for (String attributeNamesItem : attributeNames) {<NEW_LINE>prefix = attributeNamesPrefix + "." + attributeNamesIndex;<NEW_LINE>if (attributeNamesItem != null) {<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(attributeNamesItem));<NEW_LINE>}<NEW_LINE>attributeNamesIndex++;<NEW_LINE>}<NEW_LINE>prefix = attributeNamesPrefix;<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Action", "GetQueueAttributes"); |
94,345 | public Set<DataObject> instantiate(TemplateWizard wizard) throws IOException {<NEW_LINE>FileObject targetFolder = Templates.getTargetFolder(wizard);<NEW_LINE>String targetName = Templates.getTargetName(wizard);<NEW_LINE>DataFolder dataFolder = DataFolder.findFolder(targetFolder);<NEW_LINE>FileObject template = Templates.getTemplate(wizard);<NEW_LINE>DataObject dTemplate = DataObject.find(template);<NEW_LINE>Map<String, Object> templateProperties = new <MASK><NEW_LINE>String tagName = (String) wizard.getProperty(FacesComponentPanel.PROP_TAG_NAME);<NEW_LINE>String tagNamespace = (String) wizard.getProperty(FacesComponentPanel.PROP_TAG_NAMESPACE);<NEW_LINE>Boolean createSampleCode = (Boolean) wizard.getProperty(FacesComponentPanel.PROP_SAMPLE_CODE);<NEW_LINE>if (!tagName.isEmpty() && !tagName.equals(tagNameForClassName(targetName))) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("tagName", tagName);<NEW_LINE>}<NEW_LINE>if (!tagNamespace.isEmpty() && !tagNamespace.equals(DEFAULT_COMPONENT_NS)) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("tagNamespace", tagNamespace);<NEW_LINE>}<NEW_LINE>if (createSampleCode) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("sampleCode", Boolean.TRUE);<NEW_LINE>}<NEW_LINE>DataObject result = dTemplate.createFromTemplate(dataFolder, targetName, templateProperties);<NEW_LINE>return Collections.singleton(result);<NEW_LINE>} | HashMap<String, Object>(); |
1,277,557 | public void lookupASN(final InetAddress address, final NetworkAdminASNListener listener) {<NEW_LINE>synchronized (async_asn_history) {<NEW_LINE>NetworkAdminASN existing = async_asn_history.get(address);<NEW_LINE>if (existing != null) {<NEW_LINE>listener.success(existing);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int queue_size = async_asn_dispacher.getQueueSize();<NEW_LINE>if (queue_size >= MAX_ASYNC_ASN_LOOKUPS) {<NEW_LINE>listener.failed(new NetworkAdminException("Too many outstanding lookups"));<NEW_LINE>} else {<NEW_LINE>async_asn_dispacher.dispatch(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>synchronized (async_asn_history) {<NEW_LINE>NetworkAdminASN <MASK><NEW_LINE>if (existing != null) {<NEW_LINE>listener.success(existing);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>NetworkAdminASNLookupImpl lookup = new NetworkAdminASNLookupImpl(address);<NEW_LINE>NetworkAdminASNImpl result = lookup.lookup();<NEW_LINE>synchronized (async_asn_history) {<NEW_LINE>async_asn_history.put(address, result);<NEW_LINE>}<NEW_LINE>listener.success(result);<NEW_LINE>} catch (NetworkAdminException e) {<NEW_LINE>listener.failed(e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>listener.failed(new NetworkAdminException("lookup failed", e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | existing = async_asn_history.get(address); |
469,839 | public void updateConfig(final String config) throws IOException {<NEW_LINE>if (config == null) {<NEW_LINE>throw new StorageAdapterException("Remote adapter needs a config.");<NEW_LINE>}<NEW_LINE>this.updateNetworkConfig(config);<NEW_LINE>final JsonNode configsJson = JMapper.MAP.readTree(config);<NEW_LINE>if (configsJson.has("locationHint")) {<NEW_LINE>this.setLocationHint(configsJson.get("locationHint").asText());<NEW_LINE>}<NEW_LINE>if (configsJson.has("hosts") && configsJson.get("hosts").isArray()) {<NEW_LINE>final ArrayNode hosts = (ArrayNode) configsJson.get("hosts");<NEW_LINE>// Create a temporary dictionary.<NEW_LINE>final Map<String, String> hostsDict = new LinkedHashMap<>();<NEW_LINE>// Iterate through all of the items in the hosts array.<NEW_LINE>for (final JsonNode host : hosts) {<NEW_LINE>// Get the property's key and value and save it to the dictionary.<NEW_LINE>host.fields().forEachRemaining(entry -> {<NEW_LINE>hostsDict.put(entry.getKey(), entry.<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>this.hosts = hostsDict;<NEW_LINE>}<NEW_LINE>} | getValue().asText()); |
337,920 | public CacheData addCacheDataIfAbsent(String dataId, String group, String tenant) throws NacosException {<NEW_LINE>CacheData cache = getCache(dataId, group, tenant);<NEW_LINE>if (null != cache) {<NEW_LINE>return cache;<NEW_LINE>}<NEW_LINE>String key = GroupKey.getKeyTenant(dataId, group, tenant);<NEW_LINE>synchronized (cacheMap) {<NEW_LINE>CacheData cacheFromMap = getCache(dataId, group, tenant);<NEW_LINE>// multiple listeners on the same dataid+group and race condition,so<NEW_LINE>// double check again<NEW_LINE>// other listener thread beat me to set to cacheMap<NEW_LINE>if (null != cacheFromMap) {<NEW_LINE>cache = cacheFromMap;<NEW_LINE>// reset so that server not hang this check<NEW_LINE>cache.setInitializing(true);<NEW_LINE>} else {<NEW_LINE>cache = new CacheData(configFilterChainManager, agent.getName(), dataId, group, tenant);<NEW_LINE>// fix issue # 1317<NEW_LINE>if (enableRemoteSyncConfig) {<NEW_LINE>String content = getServerConfig(dataId, group, tenant, 3000L);<NEW_LINE>cache.setContent(content);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, CacheData> copy = new HashMap<String, CacheData>(cacheMap.get());<NEW_LINE><MASK><NEW_LINE>cacheMap.set(copy);<NEW_LINE>}<NEW_LINE>LOGGER.info("[{}] [subscribe] {}", agent.getName(), key);<NEW_LINE>MetricsMonitor.getListenConfigCountMonitor().set(cacheMap.get().size());<NEW_LINE>return cache;<NEW_LINE>} | copy.put(key, cache); |
1,320,563 | protected JFreeChart createHighLowChart() throws JRException {<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createHighLowChart(evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression(((JRHighLowPlot) getPlot()).getTimeAxisLabelExpression()), evaluateTextExpression(((JRHighLowPlot) getPlot()).getValueAxisLabelExpression()), (DefaultHighLowDataset) <MASK><NEW_LINE>configureChart(jfreeChart, getPlot());<NEW_LINE>XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();<NEW_LINE>JRHighLowPlot highLowPlot = (JRHighLowPlot) getPlot();<NEW_LINE>HighLowRenderer hlRenderer = (HighLowRenderer) xyPlot.getRenderer();<NEW_LINE>boolean isShowOpenTicks = highLowPlot.getShowOpenTicks() == null ? false : highLowPlot.getShowOpenTicks();<NEW_LINE>boolean isShowCloseTicks = highLowPlot.getShowCloseTicks() == null ? false : highLowPlot.getShowCloseTicks();<NEW_LINE>hlRenderer.setDrawOpenTicks(isShowOpenTicks);<NEW_LINE>hlRenderer.setDrawCloseTicks(isShowCloseTicks);<NEW_LINE>// Handle the axis formating for the category axis<NEW_LINE>configureAxis(xyPlot.getDomainAxis(), highLowPlot.getTimeAxisLabelFont(), highLowPlot.getTimeAxisLabelColor(), highLowPlot.getTimeAxisTickLabelFont(), highLowPlot.getTimeAxisTickLabelColor(), highLowPlot.getTimeAxisTickLabelMask(), highLowPlot.getTimeAxisVerticalTickLabels(), highLowPlot.getOwnTimeAxisLineColor(), false, (Comparable<?>) evaluateExpression(highLowPlot.getDomainAxisMinValueExpression()), (Comparable<?>) evaluateExpression(highLowPlot.getDomainAxisMaxValueExpression()));<NEW_LINE>// Handle the axis formating for the value axis<NEW_LINE>configureAxis(xyPlot.getRangeAxis(), highLowPlot.getValueAxisLabelFont(), highLowPlot.getValueAxisLabelColor(), highLowPlot.getValueAxisTickLabelFont(), highLowPlot.getValueAxisTickLabelColor(), highLowPlot.getValueAxisTickLabelMask(), highLowPlot.getValueAxisVerticalTickLabels(), highLowPlot.getOwnValueAxisLineColor(), true, (Comparable<?>) evaluateExpression(highLowPlot.getRangeAxisMinValueExpression()), (Comparable<?>) evaluateExpression(highLowPlot.getRangeAxisMaxValueExpression()));<NEW_LINE>return jfreeChart;<NEW_LINE>} | getDataset(), isShowLegend()); |
1,223,681 | // if the previous header is not present yet, we need to go deeper<NEW_LINE>@VisibleForTesting<NEW_LINE>protected CompletableFuture<Void> possiblyMoreBackwardSteps(final BlockHeader blockHeader) {<NEW_LINE>CompletableFuture<Void> completableFuture = new CompletableFuture<>();<NEW_LINE>if (context.getProtocolContext().getBlockchain().contains(blockHeader.getHash())) {<NEW_LINE>LOG.info("Backward Phase finished.");<NEW_LINE>completableFuture.complete(null);<NEW_LINE>return completableFuture;<NEW_LINE>}<NEW_LINE>if (context.getProtocolContext().getBlockchain().getChainHead().getHeight() > blockHeader.getNumber() - 1) {<NEW_LINE>LOG.warn("Backward sync is following unknown branch {} ({}) and reached bellow previous head {}({})", blockHeader.getNumber(), blockHeader.getHash(), context.getProtocolContext().getBlockchain().getChainHead().getHeight(), context.getProtocolContext().getBlockchain().getChainHead().<MASK><NEW_LINE>}<NEW_LINE>LOG.debug("Backward sync did not reach a know block, need to go deeper");<NEW_LINE>completableFuture.complete(null);<NEW_LINE>return completableFuture.thenCompose(this::executeAsync);<NEW_LINE>} | getHash().toHexString()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.