idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,793,872 | public String info(final Collection<ObjectName> objectNames) {<NEW_LINE>final Set<String> alreadyDone = new HashSet<>();<NEW_LINE><MASK><NEW_LINE>if (!objectNames.isEmpty()) {<NEW_LINE>final String NL = StringUtil.LS;<NEW_LINE>for (final ObjectName objectName : objectNames) {<NEW_LINE>final MBeanInfo mbeanInfo = getProxyFactory().getMBeanInfo(objectName);<NEW_LINE>if (mbeanInfo == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Don't generate info if we've seen that type/class combination already<NEW_LINE>final String type = Util.getTypeProp(objectName);<NEW_LINE>final String classname = mbeanInfo.getClassName();<NEW_LINE>if (alreadyDone.contains(type) && alreadyDone.contains(classname)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>alreadyDone.add(type);<NEW_LINE>alreadyDone.add(classname);<NEW_LINE>buf.append("MBeanInfo for ").append(objectName).append(NL);<NEW_LINE>buf.append(java(objectName));<NEW_LINE>buf.append(NL).append(NL).append(NL).append(NL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.append("Matched ").append(objectNames.size()).append(" mbean(s).");<NEW_LINE>return buf.toString();<NEW_LINE>} | final StringBuilder buf = new StringBuilder(); |
1,494,106 | public static DWARFAbbreviation read(BinaryReader reader, DWARFProgram prog, TaskMonitor monitor) throws IOException, CancelledException {<NEW_LINE>int ac = LEB128.readAsUInt32(reader);<NEW_LINE>if (ac == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int tag = LEB128.readAsUInt32(reader);<NEW_LINE>DWARFChildren hasChildren = DWARFChildren.find((int) reader.readNextByte());<NEW_LINE>// Read each attribute specification until attribute and its value is 0<NEW_LINE>List<DWARFAttributeSpecification> tmpAttrSpecs = new ArrayList<>();<NEW_LINE>DWARFAttributeSpecification attr;<NEW_LINE>while ((attr = DWARFAttributeSpecification.read(reader)) != null) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>tmpAttrSpecs.add(prog.internAttributeSpec(attr));<NEW_LINE>}<NEW_LINE>DWARFAttributeSpecification[] attrSpecArray = tmpAttrSpecs.toArray(new DWARFAttributeSpecification<MASK><NEW_LINE>DWARFAbbreviation result = new DWARFAbbreviation(ac, tag, hasChildren == DWARFChildren.DW_CHILDREN_yes, attrSpecArray);<NEW_LINE>return result;<NEW_LINE>} | [tmpAttrSpecs.size()]); |
426,702 | private void readInput(BufferedReader in) throws Exception {<NEW_LINE>// GET RID OF COMMENT LINES<NEW_LINE>String line = in.readLine();<NEW_LINE>while (line.trim().startsWith("#")) {<NEW_LINE>line = in.readLine();<NEW_LINE>}<NEW_LINE>// READ LATTICE<NEW_LINE>latticeWords = new ArrayList<>();<NEW_LINE>Pattern wordLinePattern = Pattern.compile("(\\d+)\\s+(\\d+)\\s+lm=(-?\\d+\\.\\d+),am=(-?\\d+\\.\\d+)\\s+([^( ]+)(?:\\((\\d+)\\))?.*");<NEW_LINE>Matcher wordLineMatcher = wordLinePattern.matcher(line);<NEW_LINE>while (wordLineMatcher.matches()) {<NEW_LINE>int startNode = Integer.parseInt(wordLineMatcher.group(1)) - 1;<NEW_LINE>int endNode = Integer.parseInt(wordLineMatcher.group(2)) - 1;<NEW_LINE>double lm = Double.parseDouble(wordLineMatcher.group(3));<NEW_LINE>double am = Double.parseDouble(wordLineMatcher.group(4));<NEW_LINE>String word = wordLineMatcher.group(5).toLowerCase();<NEW_LINE>String <MASK><NEW_LINE>if (word.equalsIgnoreCase("<s>")) {<NEW_LINE>line = in.readLine();<NEW_LINE>wordLineMatcher = wordLinePattern.matcher(line);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (word.equalsIgnoreCase("</s>")) {<NEW_LINE>word = Lexicon.BOUNDARY;<NEW_LINE>}<NEW_LINE>int pronunciation;<NEW_LINE>if (pronun == null) {<NEW_LINE>pronunciation = 0;<NEW_LINE>} else {<NEW_LINE>pronunciation = Integer.parseInt(pronun);<NEW_LINE>}<NEW_LINE>LatticeWord lw = new LatticeWord(word, startNode, endNode, lm, am, pronunciation, mergeType);<NEW_LINE>if (DEBUG) {<NEW_LINE>log.info(lw);<NEW_LINE>}<NEW_LINE>latticeWords.add(lw);<NEW_LINE>line = in.readLine();<NEW_LINE>wordLineMatcher = wordLinePattern.matcher(line);<NEW_LINE>}<NEW_LINE>// GET NUMBER OF NODES<NEW_LINE>numStates = Integer.parseInt(line.trim());<NEW_LINE>if (DEBUG) {<NEW_LINE>log.info(numStates);<NEW_LINE>}<NEW_LINE>// READ NODE TIMES<NEW_LINE>nodeTimes = new int[numStates];<NEW_LINE>Pattern nodeTimePattern = Pattern.compile("(\\d+)\\s+t=(\\d+)\\s*");<NEW_LINE>Matcher nodeTimeMatcher;<NEW_LINE>for (int i = 0; i < numStates; i++) {<NEW_LINE>nodeTimeMatcher = nodeTimePattern.matcher(in.readLine());<NEW_LINE>if (!nodeTimeMatcher.matches()) {<NEW_LINE>log.info("Input File Error");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// assert ((Integer.parseInt(nodeTimeMatcher.group(1))-1) == i) ;<NEW_LINE>nodeTimes[i] = Integer.parseInt(nodeTimeMatcher.group(2));<NEW_LINE>if (DEBUG) {<NEW_LINE>log.info(i + "\tt=" + nodeTimes[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | pronun = wordLineMatcher.group(6); |
577,377 | private void ekskey(byte[] data, byte[] key) {<NEW_LINE>int i;<NEW_LINE>int[] koffp = { 0 };<NEW_LINE>int[] doffp = { 0 };<NEW_LINE>int[] lr = { 0, 0 };<NEW_LINE>int plen = P.length, slen = S.length;<NEW_LINE>for (i = 0; i < plen; i++) P[i] = P[i] ^ streamToWord(key, koffp);<NEW_LINE>for (i = 0; i < plen; i += 2) {<NEW_LINE>lr[0] ^= streamToWord(data, doffp);<NEW_LINE>lr[1] ^= streamToWord(data, doffp);<NEW_LINE>encipher(lr, 0);<NEW_LINE>P[i] = lr[0];<NEW_LINE>P[i + 1] = lr[1];<NEW_LINE>}<NEW_LINE>for (i = 0; i < slen; i += 2) {<NEW_LINE>lr[0<MASK><NEW_LINE>lr[1] ^= streamToWord(data, doffp);<NEW_LINE>encipher(lr, 0);<NEW_LINE>S[i] = lr[0];<NEW_LINE>S[i + 1] = lr[1];<NEW_LINE>}<NEW_LINE>} | ] ^= streamToWord(data, doffp); |
848,003 | private void processBackgroundImage(String cssUrl, String cssContent, Map<String, Object> filesToUpdate) throws URISyntaxException, IOException {<NEW_LINE>// Current restriction : only one image is supported and the relevant property in CSS file has to be 'background-image: url(images/custom-logo.png);'<NEW_LINE>if (!cssContent.contains(EXPECTED_BACKGROUND_IMAGE)) {<NEW_LINE>throw new IllegalArgumentException(Tr.formatMessage(tc, "UNSUPPORTED_CSS_VALUE", "background-image", EXPECTED_BACKGROUND_IMAGE));<NEW_LINE>}<NEW_LINE>String parentPath = PathUtils.getParent(cssUrl);<NEW_LINE>if (!parentPath.endsWith("/")) {<NEW_LINE>parentPath = parentPath.concat("/");<NEW_LINE>}<NEW_LINE>String backgroundImagePath = parentPath.concat(PATH_IMAGES_CUSTOM_LOGO);<NEW_LINE>if (OpenAPIUtils.isEventEnabled(tc)) {<NEW_LINE>Tr.<MASK><NEW_LINE>}<NEW_LINE>Object image = null;<NEW_LINE>if (backgroundImagePath.startsWith("http:") || backgroundImagePath.startsWith("https:")) {<NEW_LINE>image = new URL(backgroundImagePath);<NEW_LINE>} else {<NEW_LINE>image = new File(new URI(backgroundImagePath));<NEW_LINE>}<NEW_LINE>// ensure that the specified image is valid and exists<NEW_LINE>validateImage(image);<NEW_LINE>filesToUpdate.put(PATH_CSS_IMAGES_CUSTOM_LOGO, image);<NEW_LINE>if (OpenAPIUtils.isEventEnabled(tc)) {<NEW_LINE>Tr.event(tc, "Added image to map at " + PATH_CSS_IMAGES_CUSTOM_LOGO);<NEW_LINE>}<NEW_LINE>} | event(tc, "backgroundImagePath=" + backgroundImagePath); |
1,357,960 | protected void createParameterGroups(Composite parent) {<NEW_LINE>Composite composite = new Composite(parent, SWT.NO_FOCUS);<NEW_LINE>composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));<NEW_LINE>GridLayout layout = new GridLayout(2, true);<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>layout.verticalSpacing = convertVerticalDLUsToPixels(VERTICAL_SPACING);<NEW_LINE>layout.horizontalSpacing = convertHorizontalDLUsToPixels(HORIZONTAL_SPACING);<NEW_LINE>composite.setLayout(layout);<NEW_LINE>Composite directionGroup = createParameterGroup(composite, 1, Messages.FindReplaceDialog_8);<NEW_LINE>createParameterWidget(directionGroup, SWT.RADIO, Messages.FindReplaceDialog_9, IFindReplaceProvider.PARAM_FORWARD);<NEW_LINE>createParameterWidget(directionGroup, SWT.RADIO, Messages.FindReplaceDialog_10, IFindReplaceProvider.PARAM_BACKWARD);<NEW_LINE>Composite scopeGroup = createParameterGroup(composite, 1, Messages.FindReplaceDialog_11);<NEW_LINE>createParameterWidget(scopeGroup, SWT.RADIO, Messages.FindReplaceDialog_12, IFindReplaceProvider.PARAM_SELECTED_MODEL);<NEW_LINE>createParameterWidget(scopeGroup, SWT.RADIO, <MASK><NEW_LINE>Composite optionGroup = createParameterGroup(composite, 2, Messages.FindReplaceDialog_14);<NEW_LINE>((GridData) optionGroup.getLayoutData()).horizontalSpan = 2;<NEW_LINE>createParameterWidget(optionGroup, SWT.CHECK, Messages.FindReplaceDialog_15, IFindReplaceProvider.PARAM_CASE_SENSITIVE);<NEW_LINE>createParameterWidget(optionGroup, SWT.CHECK, Messages.FindReplaceDialog_17, IFindReplaceProvider.PARAM_INCLUDE_FOLDERS);<NEW_LINE>createParameterWidget(optionGroup, SWT.CHECK, Messages.FindReplaceDialog_16, IFindReplaceProvider.PARAM_WHOLE_WORD);<NEW_LINE>createParameterWidget(optionGroup, SWT.CHECK, Messages.FindReplaceDialog_18, IFindReplaceProvider.PARAM_INCLUDE_RELATIONS);<NEW_LINE>} | Messages.FindReplaceDialog_13, IFindReplaceProvider.PARAM_ALL_MODELS); |
868,085 | protected void paintContent(@NotNull final Graphics2D g2d, @NotNull final C c, @NotNull final D d, @NotNull final Rectangle bounds) {<NEW_LINE>final Stroke os = GraphicsUtils.setupStroke(g2d, stroke, stroke != null);<NEW_LINE>final Paint op = GraphicsUtils.setupPaint(g2d, color);<NEW_LINE>final GeneralPath gp = new GeneralPath();<NEW_LINE>gp.moveTo(bounds.x + bounds.width * 0.1875, bounds.<MASK><NEW_LINE>gp.lineTo(bounds.x + bounds.width * 0.4575, bounds.y + bounds.height * 0.6875);<NEW_LINE>gp.lineTo(bounds.x + bounds.width * 0.875, bounds.y + bounds.height * 0.125);<NEW_LINE>g2d.draw(gp);<NEW_LINE>GraphicsUtils.restorePaint(g2d, op);<NEW_LINE>GraphicsUtils.restoreStroke(g2d, os);<NEW_LINE>} | y + bounds.height * 0.375); |
1,124,256 | public static void applyAccountStorageSyncUpdates(@NonNull Context context, @NonNull Recipient self, @NonNull StorageRecordUpdate<SignalAccountRecord> update, boolean fetchProfile) {<NEW_LINE>SignalDatabase.recipients().applyStorageSyncAccountUpdate(update);<NEW_LINE>TextSecurePreferences.setReadReceiptsEnabled(context, update.getNew().isReadReceiptsEnabled());<NEW_LINE>TextSecurePreferences.setTypingIndicatorsEnabled(context, update.getNew().isTypingIndicatorsEnabled());<NEW_LINE>TextSecurePreferences.setShowUnidentifiedDeliveryIndicatorsEnabled(context, update.getNew().isSealedSenderIndicatorsEnabled());<NEW_LINE>SignalStore.settings().setLinkPreviewsEnabled(update.getNew().isLinkPreviewsEnabled());<NEW_LINE>SignalStore.phoneNumberPrivacy().setPhoneNumberListingMode(update.getNew().isPhoneNumberUnlisted() ? PhoneNumberPrivacyValues.PhoneNumberListingMode.UNLISTED : PhoneNumberPrivacyValues.PhoneNumberListingMode.LISTED);<NEW_LINE>SignalStore.phoneNumberPrivacy().setPhoneNumberSharingMode(StorageSyncModels.remoteToLocalPhoneNumberSharingMode(update.getNew().getPhoneNumberSharingMode()));<NEW_LINE>SignalStore.settings().setPreferSystemContactPhotos(update.getNew().isPreferContactAvatars());<NEW_LINE>SignalStore.paymentsValues().setEnabledAndEntropy(update.getNew().getPayments().isEnabled(), Entropy.fromBytes(update.getNew().getPayments().getEntropy(<MASK><NEW_LINE>SignalStore.settings().setUniversalExpireTimer(update.getNew().getUniversalExpireTimer());<NEW_LINE>SignalStore.emojiValues().setReactions(update.getNew().getDefaultReactions());<NEW_LINE>SignalStore.signalDonationsValues().setDisplayBadgesOnProfile(update.getNew().isDisplayBadgesOnProfile());<NEW_LINE>if (update.getNew().isSubscriptionManuallyCancelled()) {<NEW_LINE>SignalStore.signalDonationsValues().markUserManuallyCancelled();<NEW_LINE>SignalStore.signalDonationsValues().setUnexpectedSubscriptionCancelationReason(null);<NEW_LINE>} else {<NEW_LINE>SignalStore.signalDonationsValues().clearUserManuallyCancelled();<NEW_LINE>}<NEW_LINE>Subscriber subscriber = StorageSyncModels.remoteToLocalSubscriber(update.getNew().getSubscriber());<NEW_LINE>if (subscriber != null) {<NEW_LINE>SignalStore.signalDonationsValues().setSubscriber(subscriber);<NEW_LINE>}<NEW_LINE>if (fetchProfile && update.getNew().getAvatarUrlPath().isPresent()) {<NEW_LINE>ApplicationDependencies.getJobManager().add(new RetrieveProfileAvatarJob(self, update.getNew().getAvatarUrlPath().get()));<NEW_LINE>}<NEW_LINE>} | ).orElse(null))); |
377,513 | private void processData(final LayerLightEngine<?, ?> lightProvider, final boolean doSkylight, final boolean skipEdgeLightPropagation, final CallbackInfo ci) {<NEW_LINE>// Process light removal<NEW_LINE>for (final long cPos : this.removedChunks) {<NEW_LINE>for (int y = -1; y < 17; ++y) {<NEW_LINE>final long sectionPos = SectionPos.asLong(SectionPos.x(cPos), y, SectionPos.z(cPos));<NEW_LINE>this.queuedSections.remove(sectionPos);<NEW_LINE>if (this.storingLightForSection(sectionPos)) {<NEW_LINE>this.clearQueuedSectionBlocks(lightProvider, sectionPos);<NEW_LINE>if (this.changedSections.add(sectionPos))<NEW_LINE>this.updatingSectionData.copyDataLayer(sectionPos);<NEW_LINE>Arrays.fill(this.getDataLayer(sectionPos, true).getData(), (byte) 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.processRemoveLightData(cPos);<NEW_LINE>}<NEW_LINE>this.removedChunks.clear();<NEW_LINE>// Process relighting<NEW_LINE>for (final long cPos : this.relightChunks) <MASK><NEW_LINE>this.relightChunks.clear();<NEW_LINE>} | this.processRelight(lightProvider, cPos); |
243,846 | public static QueryAccountBillResponse unmarshall(QueryAccountBillResponse queryAccountBillResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryAccountBillResponse.setRequestId(_ctx.stringValue("QueryAccountBillResponse.RequestId"));<NEW_LINE>queryAccountBillResponse.setCode(_ctx.stringValue("QueryAccountBillResponse.Code"));<NEW_LINE>queryAccountBillResponse.setMessage(_ctx.stringValue("QueryAccountBillResponse.Message"));<NEW_LINE>queryAccountBillResponse.setSuccess(_ctx.booleanValue("QueryAccountBillResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum<MASK><NEW_LINE>data.setBillingCycle(_ctx.stringValue("QueryAccountBillResponse.Data.BillingCycle"));<NEW_LINE>data.setAccountID(_ctx.stringValue("QueryAccountBillResponse.Data.AccountID"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryAccountBillResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("QueryAccountBillResponse.Data.TotalCount"));<NEW_LINE>data.setAccountName(_ctx.stringValue("QueryAccountBillResponse.Data.AccountName"));<NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryAccountBillResponse.Data.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setPipCode(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].PipCode"));<NEW_LINE>item.setPretaxAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].PretaxAmount"));<NEW_LINE>item.setBillingDate(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].BillingDate"));<NEW_LINE>item.setProductName(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].ProductName"));<NEW_LINE>item.setAdjustAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].AdjustAmount"));<NEW_LINE>item.setOwnerName(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].OwnerName"));<NEW_LINE>item.setCurrency(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].Currency"));<NEW_LINE>item.setBillAccountName(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].BillAccountName"));<NEW_LINE>item.setSubscriptionType(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].SubscriptionType"));<NEW_LINE>item.setDeductedByCashCoupons(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].DeductedByCashCoupons"));<NEW_LINE>item.setBizType(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].BizType"));<NEW_LINE>item.setOwnerID(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].OwnerID"));<NEW_LINE>item.setDeductedByPrepaidCard(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].DeductedByPrepaidCard"));<NEW_LINE>item.setDeductedByCoupons(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].DeductedByCoupons"));<NEW_LINE>item.setBillAccountID(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].BillAccountID"));<NEW_LINE>item.setPaymentAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].PaymentAmount"));<NEW_LINE>item.setInvoiceDiscount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].InvoiceDiscount"));<NEW_LINE>item.setOutstandingAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].OutstandingAmount"));<NEW_LINE>item.setCostUnit(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].CostUnit"));<NEW_LINE>item.setPretaxGrossAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].PretaxGrossAmount"));<NEW_LINE>item.setCashAmount(_ctx.floatValue("QueryAccountBillResponse.Data.Items[" + i + "].CashAmount"));<NEW_LINE>item.setProductCode(_ctx.stringValue("QueryAccountBillResponse.Data.Items[" + i + "].ProductCode"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>queryAccountBillResponse.setData(data);<NEW_LINE>return queryAccountBillResponse;<NEW_LINE>} | (_ctx.integerValue("QueryAccountBillResponse.Data.PageNum")); |
1,556,774 | private boolean sanitizePrevious(Sanitize sanitizing, Context context, int offset, TokenCondition condition) {<NEW_LINE>TokenSequence<? extends JsTokenId> ts = LexUtilities.getTokenSequence(context.getSnapshot(), 0, language);<NEW_LINE>if (ts != null) {<NEW_LINE>ts.move(offset);<NEW_LINE>int start = -1;<NEW_LINE>while (ts.movePrevious()) {<NEW_LINE>if (condition.found(ts.token().id())) {<NEW_LINE>start = ts.offset();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (start >= 0) {<NEW_LINE>int end = offset;<NEW_LINE>if (ts.moveNext()) {<NEW_LINE>end = ts.offset();<NEW_LINE>}<NEW_LINE>StringBuilder builder = new <MASK><NEW_LINE>erase(builder, start, end);<NEW_LINE>context.setSanitizedSource(builder.toString());<NEW_LINE>context.setSanitization(sanitizing);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | StringBuilder(context.getOriginalSource()); |
813,349 | private List<Token> enqueueHiddens(Token t) {<NEW_LINE>List<Token> newlines = new ArrayList<Token>();<NEW_LINE>if (inSingle && t.getType() == Token.EOF) {<NEW_LINE>int k = 1;<NEW_LINE>while (stream.size() > lastTokenAddedIndex + k) {<NEW_LINE>Token hidden = stream.get(lastTokenAddedIndex + k);<NEW_LINE>if (hidden.getType() == PythonLexer.COMMENT) {<NEW_LINE>String text = hidden.getText();<NEW_LINE>int <MASK><NEW_LINE>i = text.indexOf("\n", i + 1);<NEW_LINE>while (i != -1) {<NEW_LINE>newlines.add(hidden);<NEW_LINE>lastTokenAddedIndex++;<NEW_LINE>i = text.indexOf("\n", i + 1);<NEW_LINE>}<NEW_LINE>k++;<NEW_LINE>} else if (hidden.getType() == PythonLexer.NEWLINE) {<NEW_LINE>generateNewline(hidden);<NEW_LINE>lastTokenAddedIndex++;<NEW_LINE>break;<NEW_LINE>} else if (hidden.getType() == PythonLexer.LEADING_WS) {<NEW_LINE>k++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<? extends Token> hiddenTokens = stream.getTokens(lastTokenAddedIndex + 1, t.getTokenIndex() - 1);<NEW_LINE>if (hiddenTokens != null) {<NEW_LINE>tokens.addAll(hiddenTokens);<NEW_LINE>}<NEW_LINE>lastTokenAddedIndex = t.getTokenIndex();<NEW_LINE>return newlines;<NEW_LINE>} | i = text.indexOf("\n"); |
109,028 | public static void main(String[] args) {<NEW_LINE>if (args.length > 0 && args[0].charAt(0) != '-') {<NEW_LINE>Class<?> cls = ELKIServiceRegistry.findImplementation(AbstractApplication.class, args[0]);<NEW_LINE>if (cls != null) {<NEW_LINE>try {<NEW_LINE>Method m = cls.getMethod("main", String[].class);<NEW_LINE>Object a = Arrays.copyOfRange(args, 1, args.length);<NEW_LINE>m.invoke(null, a);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>LoggingUtil.exception(e.getCause());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LoggingUtil.exception(e);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method m = DEFAULT_APPLICATION.getMethod("main", String[].class);<NEW_LINE>m.invoke<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LoggingUtil.exception(e);<NEW_LINE>}<NEW_LINE>} | (null, (Object) args); |
1,460,170 | public void grow() {<NEW_LINE>if (this.destination.offset == Offset.UNSET) {<NEW_LINE>throw new InternalCompilerException("Cannot relocate branch to unset destination offset");<NEW_LINE>}<NEW_LINE>int offset = this.destination.offset - this.source.offset;<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>final int opcodeJsr = Opcode.JSR;<NEW_LINE>if (!this.expanded && (offset > Short.MAX_VALUE || offset < Short.MIN_VALUE)) {<NEW_LINE>// we want to insert the data without skewing our source position,<NEW_LINE>// so we will cache it and then restore it later.<NEW_LINE>final int pos = this.source.offset;<NEW_LINE>CodeContext.<MASK><NEW_LINE>{<NEW_LINE>// Promotion to a wide instruction only requires 2 extra bytes. Everything else requires a new<NEW_LINE>// GOTO_W instruction after a negated if (5 extra bytes).<NEW_LINE>CodeContext.this.makeSpace(this.opcode == Opcode.GOTO || this.opcode == opcodeJsr ? 2 : 5);<NEW_LINE>}<NEW_LINE>CodeContext.this.popInserter();<NEW_LINE>this.source.offset = pos;<NEW_LINE>this.expanded = true;<NEW_LINE>}<NEW_LINE>} | this.pushInserter(this.source); |
452,965 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 2);<NEW_LINE>final String uri = sources[0].toString();<NEW_LINE>final String body = sources[1].toString();<NEW_LINE>String contentType = "application/json";<NEW_LINE>String charset = "utf-8";<NEW_LINE>// override default content type<NEW_LINE>if (sources.length >= 3 && sources[2] != null) {<NEW_LINE>contentType = <MASK><NEW_LINE>}<NEW_LINE>// override default content type<NEW_LINE>if (sources.length >= 4 && sources[3] != null) {<NEW_LINE>charset = sources[3].toString();<NEW_LINE>}<NEW_LINE>final Map<String, String> responseData = HttpHelper.patch(uri, body, null, null, ctx.getHeaders(), charset);<NEW_LINE>final int statusCode = Integer.parseInt(responseData.get("status"));<NEW_LINE>responseData.remove("status");<NEW_LINE>final String responseBody = responseData.get("body");<NEW_LINE>responseData.remove("body");<NEW_LINE>final GraphObjectMap response = new GraphObjectMap();<NEW_LINE>if ("application/json".equals(contentType)) {<NEW_LINE>final FromJsonFunction fromJsonFunction = new FromJsonFunction();<NEW_LINE>response.setProperty(new StringProperty("body"), fromJsonFunction.apply(ctx, caller, new Object[] { responseBody }));<NEW_LINE>} else {<NEW_LINE>response.setProperty(new StringProperty("body"), responseBody);<NEW_LINE>}<NEW_LINE>response.setProperty(new IntProperty("status"), statusCode);<NEW_LINE>final GraphObjectMap map = new GraphObjectMap();<NEW_LINE>for (final Map.Entry<String, String> entry : responseData.entrySet()) {<NEW_LINE>map.put(new StringProperty(entry.getKey()), entry.getValue());<NEW_LINE>}<NEW_LINE>response.setProperty(new StringProperty("headers"), map);<NEW_LINE>return response;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logParameterError(caller, sources, e.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | sources[2].toString(); |
1,172,202 | TextInfoWidget createWidgetControl(@NonNull MapActivity mapActivity, String widgetId) {<NEW_LINE>TextInfoWidget control = new RightTextInfoWidget(mapActivity) {<NEW_LINE><NEW_LINE>private boolean init = true;<NEW_LINE><NEW_LINE>private String cachedTxt;<NEW_LINE><NEW_LINE>private String cachedSubtext;<NEW_LINE><NEW_LINE>private Boolean cachedNight;<NEW_LINE><NEW_LINE>private Integer cachedIcon;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void updateInfo(@Nullable DrawSettings drawSettings) {<NEW_LINE>AidlMapWidgetWrapper widget = widgets.get(widgetId);<NEW_LINE>if (widget != null) {<NEW_LINE>String txt = widget.getText();<NEW_LINE>String subtext = widget.getDescription();<NEW_LINE>boolean night = drawSettings <MASK><NEW_LINE>int icon = AndroidUtils.getDrawableId(app, night ? widget.getDarkIconName() : widget.getLightIconName());<NEW_LINE>if (init || !Algorithms.objectEquals(txt, cachedTxt) || !Algorithms.objectEquals(subtext, cachedSubtext) || !Algorithms.objectEquals(night, cachedNight) || !Algorithms.objectEquals(icon, cachedIcon)) {<NEW_LINE>init = false;<NEW_LINE>cachedTxt = txt;<NEW_LINE>cachedSubtext = subtext;<NEW_LINE>cachedNight = night;<NEW_LINE>cachedIcon = icon;<NEW_LINE>setText(txt, subtext);<NEW_LINE>if (icon != 0) {<NEW_LINE>setImageDrawable(icon);<NEW_LINE>} else {<NEW_LINE>setImageDrawable(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setText(null, null);<NEW_LINE>setImageDrawable(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>control.updateInfo(null);<NEW_LINE>control.setOnClickListener(v -> {<NEW_LINE>AidlMapWidgetWrapper widget = widgets.get(widgetId);<NEW_LINE>if (widget != null && widget.getIntentOnClick() != null) {<NEW_LINE>app.startActivity(widget.getIntentOnClick());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return control;<NEW_LINE>} | != null && drawSettings.isNightMode(); |
1,608,475 | public void onAlbumClicked(View view, Album album) {<NEW_LINE>MusicPlayerAlbumDemoFragment fragment = MusicPlayerAlbumDemoFragment.newInstance(album.id);<NEW_LINE>MaterialContainerTransform transform = new MaterialContainerTransform(requireContext(), /* entering= */<NEW_LINE>true);<NEW_LINE>fragment.setSharedElementEnterTransition(transform);<NEW_LINE>// Use a Hold transition to keep this fragment visible beneath the MaterialContainerTransform<NEW_LINE>// that transitions to the album details screen. Without a Hold, this fragment would disappear<NEW_LINE>// as soon its container is replaced with a new Fragment.<NEW_LINE>Hold hold = new Hold();<NEW_LINE>// Add root view as target for the Hold so that the entire view hierarchy is held in place as<NEW_LINE>// one instead of each child view individually. Helps keep shadows during the transition.<NEW_LINE>hold.addTarget(R.id.container);<NEW_LINE>hold.<MASK><NEW_LINE>setExitTransition(hold);<NEW_LINE>getParentFragmentManager().beginTransaction().addSharedElement(view, ViewCompat.getTransitionName(view)).replace(R.id.fragment_container, fragment, MusicPlayerAlbumDemoFragment.TAG).addToBackStack(MusicPlayerAlbumDemoFragment.TAG).commit();<NEW_LINE>} | setDuration(transform.getDuration()); |
569,699 | public OperatorStr visitPhysicalHashAggregate(OptExpression optExpression, OperatorPrinter.ExplainContext context) {<NEW_LINE>OperatorStr child = visit(optExpression.getInputs().get(0), new ExplainContext(context.step + 1));<NEW_LINE>PhysicalHashAggregateOperator aggregate = (PhysicalHashAggregateOperator) optExpression.getOp();<NEW_LINE>StringBuilder sb = new StringBuilder("- AGGREGATE(").append(aggregate.getType<MASK><NEW_LINE>sb.append("[").append(aggregate.getGroupBys().stream().map(c -> new ExpressionPrinter().print(c)).collect(Collectors.joining(", "))).append("]");<NEW_LINE>sb.append(buildOutputColumns(aggregate, ""));<NEW_LINE>sb.append("\n");<NEW_LINE>buildCostEstimate(sb, optExpression, context.step);<NEW_LINE>for (Map.Entry<ColumnRefOperator, CallOperator> entry : aggregate.getAggregations().entrySet()) {<NEW_LINE>String analyticCallString = new ExpressionPrinter().print(entry.getKey()) + " := " + new ExpressionPrinter().print(entry.getValue());<NEW_LINE>buildOperatorProperty(sb, analyticCallString, context.step);<NEW_LINE>}<NEW_LINE>buildCommonProperty(sb, aggregate, context.step);<NEW_LINE>return new OperatorStr(sb.toString(), context.step, Collections.singletonList(child));<NEW_LINE>} | ()).append(") "); |
597,865 | public static File installBrokerCertificate(AsyncTestSpecification specification) throws Exception {<NEW_LINE>String caCertPem = specification.getSecret().getCaCertPem();<NEW_LINE>// First compute a stripped PEM certificate and decode it from base64.<NEW_LINE>String strippedPem = caCertPem.replaceAll(BEGIN_CERTIFICATE, "").replaceAll(END_CERTIFICATE, "");<NEW_LINE>InputStream is = new ByteArrayInputStream(org.apache.commons.codec.binary.Base64.decodeBase64(strippedPem));<NEW_LINE>// Generate a new x509 certificate from the stripped decoded pem.<NEW_LINE>CertificateFactory cf = CertificateFactory.getInstance("X.509");<NEW_LINE>X509Certificate caCert = (X509Certificate) cf.generateCertificate(is);<NEW_LINE>// Create a new TrustStore using KeyStore API.<NEW_LINE>char[] password = TRUSTSTORE_PASSWORD.toCharArray();<NEW_LINE>KeyStore ks = KeyStore.<MASK><NEW_LINE>ks.load(null, password);<NEW_LINE>ks.setCertificateEntry("root", caCert);<NEW_LINE>File trustStore = File.createTempFile("microcks-truststore-" + System.currentTimeMillis(), ".jks");<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(trustStore)) {<NEW_LINE>ks.store(fos, password);<NEW_LINE>}<NEW_LINE>return trustStore;<NEW_LINE>} | getInstance(KeyStore.getDefaultType()); |
78,147 | public void deserialize(ByteBuf input) {<NEW_LINE>int featsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (featsFlag > 0) {<NEW_LINE>feats = (IntFloatVector) ByteBufSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (neighborsFlag > 0) {<NEW_LINE>neighbors = ByteBufSerdeUtils.deserializeLongs(input);<NEW_LINE>}<NEW_LINE>int typesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (typesFlag > 0) {<NEW_LINE>types = ByteBufSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeTypesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeTypesFlag > 0) {<NEW_LINE>edgeTypes = ByteBufSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeFeaturesFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeFeaturesFlag > 0) {<NEW_LINE>int len = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>edgeFeatures = new IntFloatVector[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>edgeFeatures[i] = (IntFloatVector) ByteBufSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (weightsFlag > 0) {<NEW_LINE>weights = ByteBufSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>int labelsFlag = ByteBufSerdeUtils.deserializeInt(input);<NEW_LINE>if (labelsFlag > 0) {<NEW_LINE>weights = ByteBufSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>} | neighborsFlag = ByteBufSerdeUtils.deserializeInt(input); |
1,650,144 | private void deliverSuccessResponse(ANResponse response) {<NEW_LINE>if (mJSONObjectRequestListener != null) {<NEW_LINE>mJSONObjectRequestListener.onResponse((JSONObject) response.getResult());<NEW_LINE>} else if (mJSONArrayRequestListener != null) {<NEW_LINE>mJSONArrayRequestListener.onResponse((JSONArray) response.getResult());<NEW_LINE>} else if (mStringRequestListener != null) {<NEW_LINE>mStringRequestListener.onResponse((String) response.getResult());<NEW_LINE>} else if (mBitmapRequestListener != null) {<NEW_LINE>mBitmapRequestListener.onResponse((Bitmap) response.getResult());<NEW_LINE>} else if (mParsedRequestListener != null) {<NEW_LINE>mParsedRequestListener.onResponse(response.getResult());<NEW_LINE>} else if (mOkHttpResponseAndJSONObjectRequestListener != null) {<NEW_LINE>mOkHttpResponseAndJSONObjectRequestListener.onResponse(response.getOkHttpResponse(), (JSONObject) response.getResult());<NEW_LINE>} else if (mOkHttpResponseAndJSONArrayRequestListener != null) {<NEW_LINE>mOkHttpResponseAndJSONArrayRequestListener.onResponse(response.getOkHttpResponse(), (JSONArray) response.getResult());<NEW_LINE>} else if (mOkHttpResponseAndStringRequestListener != null) {<NEW_LINE>mOkHttpResponseAndStringRequestListener.onResponse(response.getOkHttpResponse(), (String) response.getResult());<NEW_LINE>} else if (mOkHttpResponseAndBitmapRequestListener != null) {<NEW_LINE>mOkHttpResponseAndBitmapRequestListener.onResponse(response.getOkHttpResponse(), (<MASK><NEW_LINE>} else if (mOkHttpResponseAndParsedRequestListener != null) {<NEW_LINE>mOkHttpResponseAndParsedRequestListener.onResponse(response.getOkHttpResponse(), response.getResult());<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>} | Bitmap) response.getResult()); |
502,108 | final DeleteStageResult executeDeleteStage(DeleteStageRequest deleteStageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteStageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteStageRequest> request = null;<NEW_LINE>Response<DeleteStageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteStageRequestProtocolMarshaller(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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteStageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteStageResultJsonUnmarshaller());<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(deleteStageRequest)); |
668,112 | final CreateLoadBalancerResult executeCreateLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLoadBalancerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLoadBalancerRequest> request = null;<NEW_LINE>Response<CreateLoadBalancerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLoadBalancerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLoadBalancerRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLoadBalancer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLoadBalancerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLoadBalancerResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
726,887 | public <T, B> ByteBuffer<B> encode(T object, ByteBufferFactory<?, B> allocator) {<NEW_LINE>Event<Object> event;<NEW_LINE>if (object instanceof Event) {<NEW_LINE>event = (Event<Object>) object;<NEW_LINE>} else {<NEW_LINE>event = Event.of(object);<NEW_LINE>}<NEW_LINE>Object data = event.getData();<NEW_LINE>byte[] body;<NEW_LINE>if (data instanceof CharSequence) {<NEW_LINE>body = data.toString().getBytes(defaultCharset);<NEW_LINE>} else {<NEW_LINE>MediaTypeCodec jsonCodec = resolveMediaTypeCodecRegistry().findCodec(MediaType.APPLICATION_JSON_TYPE).orElseThrow(() -> new CodecException("No possible JSON encoders found!"));<NEW_LINE>body = jsonCodec.encode(data);<NEW_LINE>}<NEW_LINE>ByteBuffer eventData = allocator.buffer(body.length + 10);<NEW_LINE>writeAttribute(eventData, COMMENT_PREFIX, event.getComment());<NEW_LINE>writeAttribute(eventData, ID_PREFIX, event.getId());<NEW_LINE>writeAttribute(eventData, EVENT_PREFIX, event.getName());<NEW_LINE>Duration retry = event.getRetry();<NEW_LINE>if (retry != null) {<NEW_LINE>writeAttribute(eventData, RETRY_PREFIX, String.valueOf(retry.toMillis()));<NEW_LINE>}<NEW_LINE>// Write the data<NEW_LINE>int start = 0;<NEW_LINE>while (start < body.length) {<NEW_LINE>int end = indexOf(body<MASK><NEW_LINE>if (end == -1) {<NEW_LINE>end = body.length - 1;<NEW_LINE>}<NEW_LINE>eventData.write(DATA_PREFIX).write(body, start, end - start + 1);<NEW_LINE>start = end + 1;<NEW_LINE>}<NEW_LINE>// Write new lines for event separation<NEW_LINE>eventData.write(NEWLINE).write(NEWLINE);<NEW_LINE>return eventData;<NEW_LINE>} | , (byte) '\n', start); |
1,717,016 | private static Element createStyleElement(HTMLConversionContext conversionContext, Document document, StringBuilder buffer) {<NEW_LINE><MASK><NEW_LINE>boolean hasDefaultHeader = false;<NEW_LINE>boolean hasDefaultFooter = false;<NEW_LINE>// TODO: This doesn't quite work as the defaultHeader and defaultFooter are per section,<NEW_LINE>// but this definition is on the document level.<NEW_LINE>// To access the first section, we have to call first a next() and later return to start()<NEW_LINE>try {<NEW_LINE>// conversionContext.getSections().next(); // causes exception<NEW_LINE>hasDefaultHeader = XsltCommonFunctions.hasDefaultHeader(conversionContext);<NEW_LINE>hasDefaultFooter = XsltCommonFunctions.hasDefaultHeader(conversionContext);<NEW_LINE>} finally {<NEW_LINE>// conversionContext.getSections().start();<NEW_LINE>}<NEW_LINE>HtmlCssHelper.createDefaultCss(hasDefaultHeader, hasDefaultFooter, buffer);<NEW_LINE>HtmlCssHelper.createCssForStyles(conversionContext.getWmlPackage(), conversionContext.getStyleTree(), buffer);<NEW_LINE>if ((userCSS != null) && (userCSS.length() > 0)) {<NEW_LINE>buffer.append(userCSS);<NEW_LINE>}<NEW_LINE>return conversionContext.createStyleElement(document, buffer.toString());<NEW_LINE>} | String userCSS = conversionContext.getUserCSS(); |
1,325,817 | private void purgeLeftPeaks() {<NEW_LINE>for (SystemInfo system : sheet.getSystems()) {<NEW_LINE>for (Staff staff : system.getStaves()) {<NEW_LINE>final StaffProjector projector = projectorOf(staff);<NEW_LINE>final Set<StaffPeak> toRemove = new LinkedHashSet<>();<NEW_LINE>final int xLeft = staff.getAbscissa(LEFT);<NEW_LINE>for (StaffPeak peak : projector.getPeaks()) {<NEW_LINE>if (peak.getStart() > xLeft) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!peak.isStaffEnd(LEFT) && !peak.isBrace() && !peak.isBracket()) {<NEW_LINE>if (peak.isVip()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>toRemove.add(peak);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!toRemove.isEmpty()) {<NEW_LINE>logger.debug("Staff#{} removing lefts {}", staff.getId(), toRemove);<NEW_LINE>projector.removePeaks(toRemove);<NEW_LINE>deleteRelatedColumns(system, toRemove);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | logger.info("VIP removing left {}", peak); |
920,059 | final UpdateFunctionConfigurationResult executeUpdateFunctionConfiguration(UpdateFunctionConfigurationRequest updateFunctionConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateFunctionConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateFunctionConfigurationRequest> request = null;<NEW_LINE>Response<UpdateFunctionConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateFunctionConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateFunctionConfigurationRequest));<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, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateFunctionConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateFunctionConfigurationResult>> 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 UpdateFunctionConfigurationResultJsonUnmarshaller()); |
557,318 | private void updateSelectionToolbar() {<NEW_LINE><MASK><NEW_LINE>selectAllButton.setEnabled(!support.isSelectAll());<NEW_LINE>clearTimestampSelectionButton.setEnabled(support.isTimestampSelection(false));<NEW_LINE>int startIndex = support.getStartIndex();<NEW_LINE>int endIndex = support.getEndIndex();<NEW_LINE>String selection = " " + Bundle.LBL_Selection() + " ";<NEW_LINE>if (startIndex == -1) {<NEW_LINE>selection += Bundle.LBL_None();<NEW_LINE>} else if (startIndex == endIndex) {<NEW_LINE>// NOI18N<NEW_LINE>selection += df.format(support.getTimestamp(startIndex)) + ", " + Bundle.LBL_SingleSample(startIndex);<NEW_LINE>} else {<NEW_LINE>long startTime = support.getTimestamp(startIndex);<NEW_LINE>long endTime = support.getTimestamp(endIndex);<NEW_LINE>selection += Bundle.LBL_TwoTimes(df.format(startTime), df.format(endTime));<NEW_LINE>selection += " (" + (endTime - startTime) + " ms)";<NEW_LINE>selection += ", " + Bundle.LBL_TwoSamples(startIndex, endIndex);<NEW_LINE>}<NEW_LINE>if (support.isSelectAll())<NEW_LINE>selection += ", " + Bundle.LBL_EntireSnapshot();<NEW_LINE>selectionLabel.setText(selection);<NEW_LINE>} | TimelineSupport support = model.getTimelineSupport(); |
191,078 | public UpdateBasePathMappingResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateBasePathMappingResult updateBasePathMappingResult = new UpdateBasePathMappingResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateBasePathMappingResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("basePath", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateBasePathMappingResult.setBasePath(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("restApiId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateBasePathMappingResult.setRestApiId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("stage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateBasePathMappingResult.setStage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateBasePathMappingResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,807,648 | public void createDatabase(MetastoreContext metastoreContext, Database database) {<NEW_LINE>if (!database.getLocation().isPresent() && defaultDir.isPresent()) {<NEW_LINE>String databaseLocation = new Path(defaultDir.get(), database.<MASK><NEW_LINE>database = Database.builder(database).setLocation(Optional.of(databaseLocation)).build();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DatabaseInput databaseInput = GlueInputConverter.convertDatabase(database);<NEW_LINE>stats.getCreateDatabase().record(() -> glueClient.createDatabase(new CreateDatabaseRequest().withCatalogId(catalogId).withDatabaseInput(databaseInput)));<NEW_LINE>} catch (AlreadyExistsException e) {<NEW_LINE>throw new SchemaAlreadyExistsException(database.getDatabaseName());<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>throw new PrestoException(HIVE_METASTORE_ERROR, e);<NEW_LINE>}<NEW_LINE>if (database.getLocation().isPresent()) {<NEW_LINE>createDirectory(hdfsContext, hdfsEnvironment, new Path(database.getLocation().get()));<NEW_LINE>}<NEW_LINE>} | getDatabaseName()).toString(); |
1,008,170 | protected NamedDataSchema parse(InputStream inputStream, final DataSchemaLocation location, String name, StringBuilder errorMessageBuilder) {<NEW_LINE>NamedDataSchema schema = null;<NEW_LINE>PegasusSchemaParser parser = _parserFactory.create(_dependencyResolver);<NEW_LINE>parser.setLocation(location);<NEW_LINE>parser.parse(new FilterInputStream(inputStream) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return location.toString();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (parser.hasError()) {<NEW_LINE>errorMessageBuilder.append("Error parsing ").append(location).append(" for \"").append(name).append("\".\n");<NEW_LINE>errorMessageBuilder.append(parser.errorMessageBuilder());<NEW_LINE>errorMessageBuilder.append("Done parsing ").append<MASK><NEW_LINE>addBadLocation(location);<NEW_LINE>} else {<NEW_LINE>DataSchema found = _nameToDataSchema.get(name);<NEW_LINE>if (found != null && found instanceof NamedDataSchema) {<NEW_LINE>schema = (NamedDataSchema) found;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return schema;<NEW_LINE>} | (location).append(".\n"); |
1,623,073 | public BankOrder mergeBankOrders(Collection<BankOrder> bankOrders) throws AxelorException {<NEW_LINE>if (bankOrders == null || bankOrders.size() <= 1) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_INCONSISTENCY, IExceptionMessage.BANK_ORDER_MERGE_AT_LEAST_TWO_BANK_ORDERS);<NEW_LINE>}<NEW_LINE>this.checkSameElements(bankOrders);<NEW_LINE>BankOrder bankOrder = bankOrders.iterator().next();<NEW_LINE>bankOrders.remove(bankOrder);<NEW_LINE>bankOrder.setSenderLabel(null);<NEW_LINE>bankOrder.setSenderReference(null);<NEW_LINE>bankOrder.setBankOrderDate(Beans.get(AppBaseService.class).getTodayDate(bankOrder.getSenderCompany()));<NEW_LINE>bankOrder.setSignatoryUser(null);<NEW_LINE>bankOrder.setSignatoryEbicsUser(null);<NEW_LINE><MASK><NEW_LINE>for (BankOrderLine bankOrderLine : this.getAllBankOrderLineList(bankOrders)) {<NEW_LINE>bankOrder.addBankOrderLineListItem(bankOrderLine);<NEW_LINE>}<NEW_LINE>bankOrderRepo.save(bankOrder);<NEW_LINE>for (BankOrder bankOrderToRemove : bankOrders) {<NEW_LINE>bankOrderToRemove = bankOrderRepo.find(bankOrderToRemove.getId());<NEW_LINE>List<InvoicePayment> invoicePaymentList = invoicePaymentRepo.findByBankOrder(bankOrderToRemove).fetch();<NEW_LINE>for (InvoicePayment invoicePayment : invoicePaymentList) {<NEW_LINE>invoicePayment.setBankOrder(bankOrder);<NEW_LINE>}<NEW_LINE>bankOrderRepo.remove(bankOrderToRemove);<NEW_LINE>}<NEW_LINE>if (paymentMode.getConsoBankOrderLinePerPartner()) {<NEW_LINE>consolidatePerPartner(bankOrder);<NEW_LINE>}<NEW_LINE>bankOrderService.updateTotalAmounts(bankOrder);<NEW_LINE>return bankOrderRepo.save(bankOrder);<NEW_LINE>} | PaymentMode paymentMode = bankOrder.getPaymentMode(); |
1,128,841 | public void configure(Archive archive) throws IOException {<NEW_LINE>List<String> dirContent = new ArrayList<String>();<NEW_LINE>filterDirectory(dirContent, dirPattern, "");<NEW_LINE>for (String file : dirContent) {<NEW_LINE>Path originalPath = new File(<MASK><NEW_LINE>if (originalPath.toFile().isDirectory())<NEW_LINE>continue;<NEW_LINE>// Create a temporary file. We will write the filtered content to this file and include it in the archive.<NEW_LINE>Path tempFile = Files.createTempFile(null, null);<NEW_LINE>String originalFile = new String(Files.readAllBytes(originalPath));<NEW_LINE>String newFile = obscuredValuePattern.matcher(originalFile).replaceAll(OBSCURED_VALUE);<NEW_LINE>newFile = wlpPasswordEncryptionPattern.matcher(newFile).replaceAll(WLP_PASSWORD_ENCYRPTION_STRING + "=*****");<NEW_LINE>Files.write(tempFile, newFile.getBytes());<NEW_LINE>archive.addFileEntry(file, tempFile.toFile());<NEW_LINE>}<NEW_LINE>} | source, file).toPath(); |
399,735 | public File putFilesIdRemoveSharedLink(String fields, String fileId, FilesFileIdremoveSharedLinkBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'fields' is set<NEW_LINE>if (fields == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'fields' when calling putFilesIdRemoveSharedLink");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'fileId' is set<NEW_LINE>if (fileId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'fileId' when calling putFilesIdRemoveSharedLink");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/files/{file_id}#remove_shared_link".replaceAll("\\{" + "file_id" + "\\}", apiClient.escapeString(fileId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "fields", fields));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<File> localVarReturnType = new GenericType<File>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarAuthNames = new String[] {}; |
56,228 | public SearchContextHighlight build(QueryShardContext context) throws IOException {<NEW_LINE>// create template global options that are later merged with any partial field options<NEW_LINE>final SearchContextHighlight.FieldOptions.Builder globalOptionsBuilder = new SearchContextHighlight.FieldOptions.Builder();<NEW_LINE>globalOptionsBuilder.encoder(this.encoder);<NEW_LINE>transferOptions(this, globalOptionsBuilder, context);<NEW_LINE>// overwrite unset global options by default values<NEW_LINE>globalOptionsBuilder.merge(defaultOptions);<NEW_LINE>// create field options<NEW_LINE>Collection<org.elasticsearch.search.fetch.subphase.highlight.SearchContextHighlight.Field> fieldOptions = new ArrayList<>();<NEW_LINE>for (Field field : this.fields) {<NEW_LINE>final SearchContextHighlight.FieldOptions.Builder fieldOptionsBuilder = new SearchContextHighlight.FieldOptions.Builder();<NEW_LINE>fieldOptionsBuilder.fragmentOffset(field.fragmentOffset);<NEW_LINE>if (field.matchedFields != null) {<NEW_LINE>Set<String> matchedFields = new HashSet<<MASK><NEW_LINE>Collections.addAll(matchedFields, field.matchedFields);<NEW_LINE>fieldOptionsBuilder.matchedFields(matchedFields);<NEW_LINE>}<NEW_LINE>transferOptions(field, fieldOptionsBuilder, context);<NEW_LINE>fieldOptions.add(new SearchContextHighlight.Field(field.name(), fieldOptionsBuilder.merge(globalOptionsBuilder.build()).build()));<NEW_LINE>}<NEW_LINE>return new SearchContextHighlight(fieldOptions);<NEW_LINE>} | >(field.matchedFields.length); |
279,930 | public Expr apply(final List<Expr> args) {<NEW_LINE>if (args.size() < 2 || args.size() > 3) {<NEW_LINE>throw new IAE("Function[%s] must have 2 or 3 arguments", name());<NEW_LINE>}<NEW_LINE>final Expr arg = args.get(0);<NEW_LINE>final Expr patternExpr = args.get(1);<NEW_LINE>final Expr escapeExpr = args.size() > 2 ? args.get(2) : null;<NEW_LINE>if (!patternExpr.isLiteral() || (escapeExpr != null && !escapeExpr.isLiteral())) {<NEW_LINE>throw new IAE("pattern and escape must be literals");<NEW_LINE>}<NEW_LINE>final String escape = escapeExpr == null ? null : (String) escapeExpr.getLiteralValue();<NEW_LINE>final Character escapeChar;<NEW_LINE>if (escape != null && escape.length() != 1) {<NEW_LINE>throw new IllegalArgumentException("Escape must be null or a single character");<NEW_LINE>} else {<NEW_LINE>escapeChar = escape == null ? null : escape.charAt(0);<NEW_LINE>}<NEW_LINE>final LikeDimFilter.LikeMatcher likeMatcher = LikeDimFilter.LikeMatcher.from(NullHandling.nullToEmptyIfNeeded((String) patternExpr.getLiteralValue()), escapeChar);<NEW_LINE>class LikeExtractExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr {<NEW_LINE><NEW_LINE>private LikeExtractExpr(Expr arg) {<NEW_LINE>super(FN_NAME, arg);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public ExprEval eval(final ObjectBinding bindings) {<NEW_LINE>return ExprEval.ofLongBoolean(likeMatcher.matches(arg.eval(bindings).asString()));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Expr visit(Shuttle shuttle) {<NEW_LINE>return shuttle.visit(apply(shuttle.visitAll(args)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>@Override<NEW_LINE>public ExpressionType getOutputType(InputBindingInspector inspector) {<NEW_LINE>return ExpressionType.LONG;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String stringify() {<NEW_LINE>if (escapeExpr != null) {<NEW_LINE>return StringUtils.format("%s(%s, %s, %s)", FN_NAME, arg.stringify(), patternExpr.stringify(<MASK><NEW_LINE>}<NEW_LINE>return StringUtils.format("%s(%s, %s)", FN_NAME, arg.stringify(), patternExpr.stringify());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LikeExtractExpr(arg);<NEW_LINE>} | ), escapeExpr.stringify()); |
1,541,454 | public DescribeClientVpnEndpointsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeClientVpnEndpointsResult describeClientVpnEndpointsResult = new DescribeClientVpnEndpointsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeClientVpnEndpointsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("clientVpnEndpoint", targetDepth)) {<NEW_LINE>describeClientVpnEndpointsResult.withClientVpnEndpoints(new ArrayList<ClientVpnEndpoint>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("clientVpnEndpoint/item", targetDepth)) {<NEW_LINE>describeClientVpnEndpointsResult.withClientVpnEndpoints(ClientVpnEndpointStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeClientVpnEndpointsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeClientVpnEndpointsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
286,806 | public DataStorage unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DataStorage dataStorage = new DataStorage();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("CwLog", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dataStorage.setCwLog(CwLogJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return dataStorage;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,598,834 | public void onTurnOn() {<NEW_LINE>super.onTurnOn();<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {<NEW_LINE>MatrixLog.w(TAG, "only support >= android 8.0 for the moment");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mCore.getConfig().isAmsHookEnabled || ((mCore.getConfig().amsHookEnableFlag & AMS_HOOK_FLAG_BT) == AMS_HOOK_FLAG_BT)) {<NEW_LINE>mListener = new BluetoothManagerServiceHooker.IListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRegisterScanner() {<NEW_LINE>String stack = shouldTracing() ? BatteryCanaryUtil.stackTraceToString(new Throwable().getStackTrace()) : "";<NEW_LINE>MatrixLog.i(TAG, "#onRegisterScanner, stack = " + stack);<NEW_LINE>mTracing.setStack(stack);<NEW_LINE>mTracing.onRegisterScanner();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartDiscovery() {<NEW_LINE>String stack = shouldTracing() ? BatteryCanaryUtil.stackTraceToString(new Throwable(<MASK><NEW_LINE>MatrixLog.i(TAG, "#onStartDiscovery, stack = " + stack);<NEW_LINE>mTracing.setStack(stack);<NEW_LINE>mTracing.onStartDiscovery();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartScan(int scanId, @Nullable ScanSettings scanSettings) {<NEW_LINE>// callback from H handler<NEW_LINE>MatrixLog.i(TAG, "#onStartScan, id = " + scanId);<NEW_LINE>mTracing.onStartScan();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartScanForIntent(@Nullable ScanSettings scanSettings) {<NEW_LINE>// callback from H handler<NEW_LINE>MatrixLog.i(TAG, "#onStartScanForIntent");<NEW_LINE>mTracing.onStartScan();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>BluetoothManagerServiceHooker.addListener(mListener);<NEW_LINE>}<NEW_LINE>} | ).getStackTrace()) : ""; |
1,495,050 | // region Meta.Method<NEW_LINE>@TruffleBoundary<NEW_LINE>public Object invokeWithConversions(Object self, Object... args) {<NEW_LINE>getContext().getJNI().clearPendingException();<NEW_LINE>assert args.length == Signatures.parameterCount(getParsedSignature());<NEW_LINE>// assert !isStatic() || ((StaticObject) self).isStatic();<NEW_LINE>final Object[] filteredArgs;<NEW_LINE>if (isStatic()) {<NEW_LINE>getDeclaringKlass().safeInitialize();<NEW_LINE>filteredArgs = new Object[args.length];<NEW_LINE>for (int i = 0; i < filteredArgs.length; ++i) {<NEW_LINE>filteredArgs[i] = getMeta().toGuestBoxed(args[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>filteredArgs = new <MASK><NEW_LINE>filteredArgs[0] = getMeta().toGuestBoxed(self);<NEW_LINE>for (int i = 1; i < filteredArgs.length; ++i) {<NEW_LINE>filteredArgs[i] = getMeta().toGuestBoxed(args[i - 1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getMeta().toHostBoxed(getCallTarget().call(filteredArgs));<NEW_LINE>} | Object[args.length + 1]; |
1,534,370 | private void teleportBack(final CommandSource sender, final User user, final String commandLabel) throws Exception {<NEW_LINE>if (user.getLastLocation() == null) {<NEW_LINE>throw new Exception(tl("noLocationFound"));<NEW_LINE>}<NEW_LINE>final String lastWorldName = user.getLastLocation().getWorld().getName();<NEW_LINE>User requester = null;<NEW_LINE>if (sender.isPlayer()) {<NEW_LINE>requester = ess.getUser(sender.getPlayer());<NEW_LINE>if (user.getWorld() != user.getLastLocation().getWorld() && this.ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + lastWorldName)) {<NEW_LINE>throw new Exception(tl("noPerm", "essentials.worlds." + lastWorldName));<NEW_LINE>}<NEW_LINE>if (!requester.isAuthorized("essentials.back.into." + lastWorldName)) {<NEW_LINE>throw new Exception(tl("noPerm", "essentials.back.into." + lastWorldName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (requester == null) {<NEW_LINE>user.getAsyncTeleport().back(null, null, getNewExceptionFuture(sender, commandLabel));<NEW_LINE>} else if (!requester.equals(user)) {<NEW_LINE>final Trade charge = new Trade(this.<MASK><NEW_LINE>charge.isAffordableFor(requester);<NEW_LINE>user.getAsyncTeleport().back(requester, charge, getNewExceptionFuture(sender, commandLabel));<NEW_LINE>} else {<NEW_LINE>final Trade charge = new Trade(this.getName(), this.ess);<NEW_LINE>charge.isAffordableFor(user);<NEW_LINE>user.getAsyncTeleport().back(charge, getNewExceptionFuture(sender, commandLabel));<NEW_LINE>}<NEW_LINE>throw new NoChargeException();<NEW_LINE>} | getName(), this.ess); |
960,618 | public Policy putPolicy(String domainName, String policyName, String auditRef, Policy policy) {<NEW_LINE>WebTarget target = base.path("/domain/{domainName}/policy/{policyName}").resolveTemplate("domainName", domainName<MASK><NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>if (auditRef != null) {<NEW_LINE>invocationBuilder = invocationBuilder.header("Y-Audit-Ref", auditRef);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.put(javax.ws.rs.client.Entity.entity(policy, "application/json"));<NEW_LINE>int code = response.getStatus();<NEW_LINE>switch(code) {<NEW_LINE>case 204:<NEW_LINE>return null;<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>} | ).resolveTemplate("policyName", policyName); |
537,190 | public void marshall(AwsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getAutoprovision(), AUTOPROVISION_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getDriver(), DRIVER_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getDriverOpts(), DRIVEROPTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getLabels(), LABELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | awsEcsTaskDefinitionVolumesDockerVolumeConfigurationDetails.getScope(), SCOPE_BINDING); |
849,998 | private void shutdown(ContainerTracker.ContainerShutdownDescriptor descriptor, boolean keepContainer, boolean removeVolumes) throws DockerAccessException, ExecException {<NEW_LINE>String containerId = descriptor.getContainerId();<NEW_LINE>StopMode stopMode = descriptor.getStopMode();<NEW_LINE>if (descriptor.getPreStop() != null) {<NEW_LINE>try {<NEW_LINE>execInContainer(containerId, descriptor.getPreStop(), descriptor.getImageConfiguration());<NEW_LINE>} catch (DockerAccessException e) {<NEW_LINE>log.error("%s", e.getMessage());<NEW_LINE>} catch (ExecException e) {<NEW_LINE>if (descriptor.isBreakOnError()) {<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>log.warn("Cannot run preStop: %s", e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stopMode.equals(StopMode.graceful)) {<NEW_LINE>int killGracePeriod = adjustGracePeriod(descriptor.getKillGracePeriod());<NEW_LINE>log.debug("shutdown will wait max of %d seconds before removing container", killGracePeriod);<NEW_LINE>long waited;<NEW_LINE>if (killGracePeriod == 0) {<NEW_LINE>docker.stopContainer(containerId, 0);<NEW_LINE>waited = 0;<NEW_LINE>} else {<NEW_LINE>waited = shutdownAndWait(containerId, killGracePeriod);<NEW_LINE>}<NEW_LINE>log.info("%s: Stop%s container %s after %s ms", descriptor.getDescription(), (keepContainer ? "" : " and removed"), containerId.substring(0, 12), waited);<NEW_LINE>} else if (stopMode.equals(StopMode.kill)) {<NEW_LINE>docker.killContainer(containerId);<NEW_LINE>log.info("%s: Killed%s container %s.", descriptor.getDescription(), (keepContainer ? "" : " and removed"), containerId<MASK><NEW_LINE>}<NEW_LINE>if (!keepContainer) {<NEW_LINE>removeContainer(descriptor, removeVolumes, containerId);<NEW_LINE>}<NEW_LINE>} | .subSequence(0, 12)); |
708,831 | private static void putEdges(ContentResolver resolver, Cursor media, WritableMap response, int limit, Set<String> include) {<NEW_LINE>WritableArray edges = new WritableNativeArray();<NEW_LINE>media.moveToFirst();<NEW_LINE>int mimeTypeIndex = media.getColumnIndex(Images.Media.MIME_TYPE);<NEW_LINE>int groupNameIndex = media.getColumnIndex(Images.Media.BUCKET_DISPLAY_NAME);<NEW_LINE>int dateTakenIndex = media.getColumnIndex(Images.Media.DATE_TAKEN);<NEW_LINE>int dateAddedIndex = media.<MASK><NEW_LINE>int dateModifiedIndex = media.getColumnIndex(MediaStore.MediaColumns.DATE_MODIFIED);<NEW_LINE>int widthIndex = media.getColumnIndex(MediaStore.MediaColumns.WIDTH);<NEW_LINE>int heightIndex = media.getColumnIndex(MediaStore.MediaColumns.HEIGHT);<NEW_LINE>int sizeIndex = media.getColumnIndex(MediaStore.MediaColumns.SIZE);<NEW_LINE>int dataIndex = media.getColumnIndex(MediaStore.MediaColumns.DATA);<NEW_LINE>boolean includeLocation = include.contains(INCLUDE_LOCATION);<NEW_LINE>boolean includeFilename = include.contains(INCLUDE_FILENAME);<NEW_LINE>boolean includeFileSize = include.contains(INCLUDE_FILE_SIZE);<NEW_LINE>boolean includeImageSize = include.contains(INCLUDE_IMAGE_SIZE);<NEW_LINE>boolean includePlayableDuration = include.contains(INCLUDE_PLAYABLE_DURATION);<NEW_LINE>for (int i = 0; i < limit && !media.isAfterLast(); i++) {<NEW_LINE>WritableMap edge = new WritableNativeMap();<NEW_LINE>WritableMap node = new WritableNativeMap();<NEW_LINE>boolean imageInfoSuccess = putImageInfo(resolver, media, node, widthIndex, heightIndex, sizeIndex, dataIndex, mimeTypeIndex, includeFilename, includeFileSize, includeImageSize, includePlayableDuration);<NEW_LINE>if (imageInfoSuccess) {<NEW_LINE>putBasicNodeInfo(media, node, mimeTypeIndex, groupNameIndex, dateTakenIndex, dateAddedIndex, dateModifiedIndex);<NEW_LINE>putLocationInfo(media, node, dataIndex, includeLocation);<NEW_LINE>edge.putMap("node", node);<NEW_LINE>edges.pushMap(edge);<NEW_LINE>} else {<NEW_LINE>// we skipped an image because we couldn't get its details (e.g. width/height), so we<NEW_LINE>// decrement i in order to correctly reach the limit, if the cursor has enough rows<NEW_LINE>i--;<NEW_LINE>}<NEW_LINE>media.moveToNext();<NEW_LINE>}<NEW_LINE>response.putArray("edges", edges);<NEW_LINE>} | getColumnIndex(MediaStore.MediaColumns.DATE_ADDED); |
668,510 | protected static int handleRaiseException(final RaiseException ex) {<NEW_LINE><MASK><NEW_LINE>final Ruby runtime = raisedException.getRuntime();<NEW_LINE>if (runtime.getSystemExit().isInstance(raisedException)) {<NEW_LINE>IRubyObject status = raisedException.callMethod(runtime.getCurrentContext(), "status");<NEW_LINE>if (status != null && !status.isNil()) {<NEW_LINE>return RubyNumeric.fix2int(status);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} else if (runtime.getSignalException().isInstance(raisedException)) {<NEW_LINE>IRubyObject status = raisedException.callMethod(runtime.getCurrentContext(), "signo");<NEW_LINE>if (status != null && !status.isNil()) {<NEW_LINE>return RubyNumeric.fix2int(status) + 128;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>TraceType traceType = runtime.getInstanceConfig().getTraceType();<NEW_LINE>boolean isatty = runtime.getPosix().isatty(FileDescriptor.err);<NEW_LINE>System.err.print(traceType.printBacktrace(raisedException, isatty));<NEW_LINE>for (Object cause = raisedException.getCause(); cause != null && cause instanceof RubyException; cause = ((RubyException) cause).getCause()) {<NEW_LINE>System.err.print(traceType.printBacktrace((RubyException) cause, isatty));<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>} | RubyException raisedException = ex.getException(); |
957,416 | public Socket createSocket(String host, int port) throws IOException {<NEW_LINE>char[] passphrase = null;<NEW_LINE>if (keyStorePassword != null) {<NEW_LINE>passphrase = keyStorePassword.toCharArray();<NEW_LINE>}<NEW_LINE>KeyStore keyStore = null;<NEW_LINE>if (keyStoreLocation != null) {<NEW_LINE>keyStore = loadStore(keyStoreLocation, passphrase, keyStoreType);<NEW_LINE>}<NEW_LINE>KeyStore trustStore;<NEW_LINE>if (trustStoreLocation != null) {<NEW_LINE>trustStore = loadStore(trustStoreLocation, trustStorePassword.toCharArray(), trustStoreType);<NEW_LINE>} else {<NEW_LINE>trustStore = keyStore;<NEW_LINE>}<NEW_LINE>if (alias == null) {<NEW_LINE>throw new IOException("SSL certificate alias cannot be null; MUST be set for SSLServerSocketFactory!");<NEW_LINE>}<NEW_LINE>KeyManagerFactory kmf;<NEW_LINE>SSLContext ctx;<NEW_LINE>try {<NEW_LINE>kmf = KeyManagerFactory.<MASK><NEW_LINE>kmf.init(keyStore, passphrase);<NEW_LINE>ctx = SSLContext.getInstance("TLS");<NEW_LINE>TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());<NEW_LINE>tmf.init(trustStore);<NEW_LINE>ctx.init(AliasKeyManager.wrap(kmf.getKeyManagers(), alias), tmf.getTrustManagers(), null);<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>SSLSocketFactory factory = ctx.getSocketFactory();<NEW_LINE>if (factory == null) {<NEW_LINE>throw new IOException("Unable to obtain SSLSocketFactory for provided KeyStore");<NEW_LINE>}<NEW_LINE>return factory.createSocket(host, port);<NEW_LINE>} | getInstance(KeyManagerFactory.getDefaultAlgorithm()); |
988,859 | private static void v1doc(Path basedir, Path output) throws Exception {<NEW_LINE>Path v1source = basedir.resolve("v1");<NEW_LINE>FileUtils.cleanDirectory(v1source.toFile());<NEW_LINE>Files.createDirectories(v1source);<NEW_LINE>Git git = new <MASK><NEW_LINE>git.clone("--single-branch", "--branch", "gh-pages");<NEW_LINE>Path v1target = output.resolve("v1");<NEW_LINE>FileUtils.copyDirectory(v1source.toFile(), v1target.toFile());<NEW_LINE>Collection<File> files = FileUtils.listFiles(v1target.toFile(), new String[] { "html" }, true);<NEW_LINE>for (File index : files) {<NEW_LINE>String content = // remove/replace redirection<NEW_LINE>FileUtils.readFileToString(index, "UTF-8").replace("http://jooby.org", "https://jooby.org").replace("href=\"/resources", "href=\"/v1/resources").replace("src=\"/resources", "src=\"/v1/resources").replace("href=\"https://jooby.org/resources", "href=\"/v1/resources").replace("src=\"https://jooby.org/resources", "src=\"/v1/resources").replace("href=\"resources", "href=\"/v1/resources").replace("src=\"resources", "src=\"/v1/resources").replace("src=\"http://ajax.", "src=\"https://ajax.").replace("<meta http-equiv=\"refresh\" content=\"0; URL=https://jooby.io\" />", "");<NEW_LINE>Document doc = Jsoup.parse(content);<NEW_LINE>doc.select("a").forEach(a -> {<NEW_LINE>String href = a.attr("href");<NEW_LINE>if (!href.startsWith("http") && !href.startsWith("#")) {<NEW_LINE>href = "/v1" + href;<NEW_LINE>a.attr("href", href);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>FileUtils.writeStringToFile(index, doc.toString(), "UTF-8");<NEW_LINE>}<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve(".git").toFile());<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve(".gitignore").toFile());<NEW_LINE>FileUtils.deleteQuietly(v1target.resolve("CNAME").toFile());<NEW_LINE>} | Git("jooby-project", "jooby", v1source); |
118,502 | public void applyBlock(BlockCapsule blockCapsule) {<NEW_LINE>WitnessCapsule wc;<NEW_LINE>long blockNum = blockCapsule.getNum();<NEW_LINE>long blockTime = blockCapsule.getTimeStamp();<NEW_LINE>byte[] blockWitness = blockCapsule.getWitnessAddress().toByteArray();<NEW_LINE>wc = consensusDelegate.getWitness(blockWitness);<NEW_LINE>wc.setTotalProduced(wc.getTotalProduced() + 1);<NEW_LINE>wc.setLatestBlockNum(blockNum);<NEW_LINE>wc.setLatestSlotNum(dposSlot.getAbSlot(blockTime));<NEW_LINE>consensusDelegate.saveWitness(wc);<NEW_LINE>long slot = 1;<NEW_LINE>if (blockNum != 1) {<NEW_LINE>slot = dposSlot.getSlot(blockTime);<NEW_LINE>}<NEW_LINE>for (int i = 1; i < slot; ++i) {<NEW_LINE>byte[] witness = dposSlot.getScheduledWitness(i).toByteArray();<NEW_LINE><MASK><NEW_LINE>wc.setTotalMissed(wc.getTotalMissed() + 1);<NEW_LINE>consensusDelegate.saveWitness(wc);<NEW_LINE>logger.info("Current block: {}, witness: {} totalMissed: {}", blockNum, wc.createReadableString(), wc.getTotalMissed());<NEW_LINE>consensusDelegate.applyBlock(false);<NEW_LINE>}<NEW_LINE>consensusDelegate.applyBlock(true);<NEW_LINE>} | wc = consensusDelegate.getWitness(witness); |
1,275,358 | public final <T> Lookup.Item<T> lookupItem(Lookup.Template<T> template) {<NEW_LINE>AbstractLookup.this.beforeLookup(template);<NEW_LINE>ArrayList<Pair<T>> list = null;<NEW_LINE>AbstractLookup.Storage<?> t = enterStorage();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>en = t.lookup(template.getType());<NEW_LINE>return findSmallest(en, template, false);<NEW_LINE>} catch (AbstractLookup.ISE ex) {<NEW_LINE>// not possible to enumerate the exception, ok, copy it<NEW_LINE>// to create new<NEW_LINE>list = new ArrayList<Pair<T>>();<NEW_LINE>// this should get all the items without any checks<NEW_LINE>en = t.lookup(null);<NEW_LINE>// the checks will be done out side of the storage<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>list.add(en.nextElement());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>exitStorage();<NEW_LINE>}<NEW_LINE>return findSmallest(Collections.enumeration(list), template, true);<NEW_LINE>} | Enumeration<Pair<T>> en; |
1,679,294 | public DeleteProfileObjectTypeResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteProfileObjectTypeResult deleteProfileObjectTypeResult = new DeleteProfileObjectTypeResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteProfileObjectTypeResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteProfileObjectTypeResult.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteProfileObjectTypeResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
195,424 | private int connectToLongestChain(Map<Long, List<NetworkRouteSegmentChain>> chains, Map<Long, List<NetworkRouteSegmentChain>> endChains, int rad) {<NEW_LINE>List<NetworkRouteSegmentChain> chainsFlat = new ArrayList<NetworkRouteSegmentChain>();<NEW_LINE>for (List<NetworkRouteSegmentChain> ch : chains.values()) {<NEW_LINE>chainsFlat.addAll(ch);<NEW_LINE>}<NEW_LINE>Collections.sort(chainsFlat, new Comparator<NetworkRouteSegmentChain>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(NetworkRouteSegmentChain o1, NetworkRouteSegmentChain o2) {<NEW_LINE>return -Integer.compare(o1.getSize(), o2.getSize());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int mergedCount = 0;<NEW_LINE>for (int i = 0; i < chainsFlat.size(); ) {<NEW_LINE>NetworkRouteSegmentChain first = chainsFlat.get(i);<NEW_LINE>boolean merged = false;<NEW_LINE>for (int j = i + 1; j < chainsFlat.size() && !merged; j++) {<NEW_LINE>NetworkRouteSegmentChain second = chainsFlat.get(j);<NEW_LINE>if (MapUtils.squareRootDist31(first.getEndPointX(), first.getEndPointY(), second.getEndPointX(), second.getEndPointY()) < rad) {<NEW_LINE>NetworkRouteSegmentChain secondReversed = chainReverse(chains, endChains, second);<NEW_LINE>chainAdd(chains, endChains, first, secondReversed);<NEW_LINE>chainsFlat.remove(j);<NEW_LINE>merged = true;<NEW_LINE>} else if (MapUtils.squareRootDist31(first.start.getStartPointX(), first.start.getStartPointY(), second.start.getStartPointX(), second.start.getStartPointY()) < rad) {<NEW_LINE>NetworkRouteSegmentChain firstReversed = chainReverse(chains, endChains, first);<NEW_LINE>chainAdd(chains, endChains, firstReversed, second);<NEW_LINE>chainsFlat.remove(j);<NEW_LINE>chainsFlat.set(i, firstReversed);<NEW_LINE>merged = true;<NEW_LINE>} else if (MapUtils.squareRootDist31(first.getEndPointX(), first.getEndPointY(), second.start.getStartPointX(), second.start.getStartPointY()) < rad) {<NEW_LINE>chainAdd(<MASK><NEW_LINE>chainsFlat.remove(j);<NEW_LINE>merged = true;<NEW_LINE>} else if (MapUtils.squareRootDist31(second.getEndPointX(), second.getEndPointY(), first.start.getStartPointX(), first.start.getStartPointY()) < rad) {<NEW_LINE>chainAdd(chains, endChains, second, first);<NEW_LINE>chainsFlat.remove(i);<NEW_LINE>merged = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!merged) {<NEW_LINE>i++;<NEW_LINE>} else {<NEW_LINE>// start over<NEW_LINE>i = 0;<NEW_LINE>mergedCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(String.format("Connect longest alternative chains: %d (radius %d)", mergedCount, rad));<NEW_LINE>return mergedCount;<NEW_LINE>} | chains, endChains, first, second); |
1,115,281 | /*<NEW_LINE>* Retrieves the selection region from the program, builds the search string, and pops<NEW_LINE>* up the MemSearchDialog<NEW_LINE>*/<NEW_LINE>private void processAction(NavigatableActionContext context, boolean useOps, boolean useConsts) {<NEW_LINE>NavigatableActionContext newContext = (NavigatableActionContext) context.getContextObject();<NEW_LINE>// Grab the program and selection from the context.<NEW_LINE>Program program = newContext.getProgram();<NEW_LINE>ProgramSelection selection = newContext.getSelection();<NEW_LINE>// If there are multiple regions selected, let the user know via popup and<NEW_LINE>// exit. This is not allowed.<NEW_LINE>// Note: We could disable the menu items and not allow this operation to<NEW_LINE>// be initiated at all, but the decision was made to do it this way<NEW_LINE>// so it's more obvious to the user why the operation is invalid.<NEW_LINE>if (selection.getNumAddressRanges() > 1) {<NEW_LINE>Msg.showInfo(this, context.getComponentProvider().getComponent(), "Mnemonic Search Error", "Multiple selected regions are not allowed; please limit to one.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Store the mask information (this is based solely on the menu action<NEW_LINE>// that initiated this whole operation.<NEW_LINE>SLMaskControl maskControl = new SLMaskControl(useOps, useConsts);<NEW_LINE>MaskGenerator generator = new MaskGenerator(maskControl);<NEW_LINE>MaskValue mask = generator.getMask(program, selection);<NEW_LINE>// Now build the search string and set up the search service. This preps the mem search<NEW_LINE>// dialog with the proper search string.<NEW_LINE>if (mask != null) {<NEW_LINE>maskedBitString = createMaskedBitString(mask.getValue(), mask.getMask());<NEW_LINE>byte[<MASK><NEW_LINE>MemorySearchService memorySearchService = tool.getService(MemorySearchService.class);<NEW_LINE>memorySearchService.setIsMnemonic(true);<NEW_LINE>memorySearchService.search(maskedBytes, newContext);<NEW_LINE>memorySearchService.setSearchText(maskedBitString);<NEW_LINE>}<NEW_LINE>} | ] maskedBytes = maskedBitString.getBytes(); |
295,216 | public Object clone() {<NEW_LINE>Component c = new Component();<NEW_LINE>c.type = type;<NEW_LINE>c.iType = iType;<NEW_LINE>c.id = id;<NEW_LINE>c.ignoreValue = ignoreValue;<NEW_LINE>c.multipleIds = multipleIds;<NEW_LINE>c.required = required;<NEW_LINE>if (method != null)<NEW_LINE>c.method = (Method) method.clone();<NEW_LINE>if (field != null)<NEW_LINE>c.field = (Field) field.clone();<NEW_LINE>c.index = index;<NEW_LINE>if (values != null) {<NEW_LINE>c.values = new HashMap();<NEW_LINE>for (Iterator i = values.keySet().iterator(); i.hasNext(); ) {<NEW_LINE>Object key = i.next();<NEW_LINE>c.values.put(key, ((Value) values.get(key)).clone());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (notValues != null) {<NEW_LINE><MASK><NEW_LINE>for (Iterator i = notValues.keySet().iterator(); i.hasNext(); ) {<NEW_LINE>Object key = i.next();<NEW_LINE>c.notValues.put(key, ((NotValue) notValues.get(key)).clone());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (valueRanges != null) {<NEW_LINE>c.valueRanges = new ArrayList();<NEW_LINE>if (valueRanges != null) {<NEW_LINE>c.valueRanges = new ArrayList();<NEW_LINE>for (Iterator i = valueRanges.iterator(); i.hasNext(); ) {<NEW_LINE>c.valueRanges.add(((Range) i.next()).clone());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (notValueRanges != null) {<NEW_LINE>c.notValueRanges = new ArrayList();<NEW_LINE>if (notValueRanges != null) {<NEW_LINE>c.notValueRanges = new ArrayList();<NEW_LINE>for (Iterator i = notValueRanges.iterator(); i.hasNext(); ) {<NEW_LINE>c.notValueRanges.add(((Range) i.next()).clone());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return c;<NEW_LINE>} | c.notValues = new HashMap(); |
791,124 | public void init(final PwmApplication pwmApplication, final HttpClientService httpClientService, final PwmHttpClientConfiguration pwmHttpClientConfiguration) throws PwmUnrecoverableException {<NEW_LINE>this.<MASK><NEW_LINE>this.pwmHttpClientConfiguration = pwmHttpClientConfiguration;<NEW_LINE>this.httpClientService = Objects.requireNonNull(httpClientService);<NEW_LINE>final AppConfig appConfig = pwmApplication.getConfig();<NEW_LINE>final HttpTrustManagerHelper trustManagerHelper = new HttpTrustManagerHelper(pwmApplication.getConfig(), pwmHttpClientConfiguration);<NEW_LINE>this.trustManagers = trustManagerHelper.makeTrustManager();<NEW_LINE>try {<NEW_LINE>final SSLContext sslContext = SSLContext.getInstance("TLS");<NEW_LINE>sslContext.init(null, this.trustManagers, pwmApplication.getSecureService().pwmRandom());<NEW_LINE>final SSLParameters sslParameters = new SSLParameters();<NEW_LINE>if (!trustManagerHelper.hostnameVerificationEnabled()) {<NEW_LINE>sslParameters.setEndpointIdentificationAlgorithm(null);<NEW_LINE>}<NEW_LINE>final int connectTimeoutMs = Integer.parseInt(appConfig.readAppProperty(AppProperty.HTTP_CLIENT_CONNECT_TIMEOUT_MS));<NEW_LINE>final HttpClient.Builder builder = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.NORMAL).connectTimeout(Duration.ofMillis(connectTimeoutMs)).sslContext(sslContext).sslParameters(sslParameters);<NEW_LINE>applyProxyConfig(pwmApplication, builder);<NEW_LINE>this.httpClient = builder.build();<NEW_LINE>} catch (final NoSuchAlgorithmException | KeyManagementException e) {<NEW_LINE>final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_INTERNAL, "error creating Java HTTP Client: " + e.getMessage());<NEW_LINE>throw new PwmUnrecoverableException(errorInformation);<NEW_LINE>}<NEW_LINE>} | pwmApplication = Objects.requireNonNull(pwmApplication); |
1,672,345 | public static CompStreamKeyValuePart[] splitStream(MatrixMeta matrixMeta, Vector[] vectors) {<NEW_LINE>PartitionKey[<MASK><NEW_LINE>// Use comp key value part<NEW_LINE>CompStreamKeyValuePart[] dataParts = new CompStreamKeyValuePart[matrixParts.length];<NEW_LINE>KeyValuePart[][] subDataParts = new KeyValuePart[vectors.length][];<NEW_LINE>// Split each vector<NEW_LINE>for (int i = 0; i < subDataParts.length; i++) {<NEW_LINE>subDataParts[i] = split(matrixMeta, vectors[i]);<NEW_LINE>}<NEW_LINE>// Combine sub data part<NEW_LINE>for (int i = 0; i < dataParts.length; i++) {<NEW_LINE>dataParts[i] = new CompStreamKeyValuePart(vectors.length);<NEW_LINE>for (int j = 0; j < vectors.length; j++) {<NEW_LINE>dataParts[i].add(subDataParts[j][i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dataParts;<NEW_LINE>} | ] matrixParts = matrixMeta.getPartitionKeys(); |
1,671,320 | public void addAll(final List<? extends Entry> entries, final OBinarySerializer<K> keySerializer, final boolean isEncrypted) {<NEW_LINE>final int currentSize = size();<NEW_LINE>final boolean isLeaf = isLeaf();<NEW_LINE>if (!isLeaf) {<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>final NonLeafEntry entry = (NonLeafEntry) entries.get(i);<NEW_LINE>doAddNonLeafEntry(i + currentSize, entry.key, entry.leftChild, entry.rightChild, false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>final LeafEntry entry = (LeafEntry) entries.get(i);<NEW_LINE>final byte[] key = entry.key;<NEW_LINE>final List<ORID> values = entry.values;<NEW_LINE>if (!values.isEmpty()) {<NEW_LINE>doCreateMainLeafEntry(i + currentSize, key, values.get(0), entry.mId);<NEW_LINE>} else {<NEW_LINE>doCreateMainLeafEntry(i + currentSize, key, null, entry.mId);<NEW_LINE>}<NEW_LINE>if (values.size() > 1) {<NEW_LINE>appendNewLeafEntries(i + currentSize, values.subList(1, values.size()), entry.entriesCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setIntValue(SIZE_OFFSET, currentSize + entries.size());<NEW_LINE>if (isLeaf) {<NEW_LINE>// noinspection unchecked<NEW_LINE>addPageOperation(new CellBTreeMultiValueV2BucketAddAllLeafEntriesPO(currentSize, (List<LeafEntry><MASK><NEW_LINE>} else {<NEW_LINE>// noinspection unchecked<NEW_LINE>addPageOperation(new CellBTreeMultiValueV2BucketAddAllNonLeafEntriesPO(currentSize, (List<NonLeafEntry>) entries, keySerializer, isEncrypted));<NEW_LINE>}<NEW_LINE>} | ) entries, keySerializer, isEncrypted)); |
1,002,125 | public Object clone() {<NEW_LINE>GZIPHeader gheader = new GZIPHeader();<NEW_LINE>byte[] tmp;<NEW_LINE>if (gheader.extra != null) {<NEW_LINE>tmp = new byte[gheader.extra.length];<NEW_LINE>System.arraycopy(gheader.extra, 0, <MASK><NEW_LINE>gheader.extra = tmp;<NEW_LINE>}<NEW_LINE>if (gheader.name != null) {<NEW_LINE>tmp = new byte[gheader.name.length];<NEW_LINE>System.arraycopy(gheader.name, 0, tmp, 0, tmp.length);<NEW_LINE>gheader.name = tmp;<NEW_LINE>}<NEW_LINE>if (gheader.comment != null) {<NEW_LINE>tmp = new byte[gheader.comment.length];<NEW_LINE>System.arraycopy(gheader.comment, 0, tmp, 0, tmp.length);<NEW_LINE>gheader.comment = tmp;<NEW_LINE>}<NEW_LINE>return gheader;<NEW_LINE>} | tmp, 0, tmp.length); |
377,917 | final DescribeRecommendationExportJobsResult executeDescribeRecommendationExportJobs(DescribeRecommendationExportJobsRequest describeRecommendationExportJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRecommendationExportJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRecommendationExportJobsRequest> request = null;<NEW_LINE>Response<DescribeRecommendationExportJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRecommendationExportJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRecommendationExportJobsRequest));<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, "Compute Optimizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRecommendationExportJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRecommendationExportJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRecommendationExportJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,182,871 | public static ComplexNumber divide(ComplexNumber z1, ComplexNumber z2) {<NEW_LINE>ArgChecker.notNull(z1, "z1");<NEW_LINE><MASK><NEW_LINE>double a = z1.getReal();<NEW_LINE>double b = z1.getImaginary();<NEW_LINE>double c = z2.getReal();<NEW_LINE>double d = z2.getImaginary();<NEW_LINE>if (Math.abs(c) > Math.abs(d)) {<NEW_LINE>double dOverC = d / c;<NEW_LINE>double denom = c + d * dOverC;<NEW_LINE>return new ComplexNumber((a + b * dOverC) / denom, (b - a * dOverC) / denom);<NEW_LINE>}<NEW_LINE>double cOverD = c / d;<NEW_LINE>double denom = c * cOverD + d;<NEW_LINE>return new ComplexNumber((a * cOverD + b) / denom, (b * cOverD - a) / denom);<NEW_LINE>} | ArgChecker.notNull(z2, "z2"); |
1,285,896 | public void onPublish(InterceptPublishMessage msg) {<NEW_LINE>String clientId = msg.getClientID();<NEW_LINE>ByteBuf payload = msg.getPayload();<NEW_LINE><MASK><NEW_LINE>String username = msg.getUsername();<NEW_LINE>MqttQoS qos = msg.getQos();<NEW_LINE>LOG.debug("Receive publish message. clientId: {}, username: {}, qos: {}, topic: {}, payload: {}", clientId, username, qos, topic, payload);<NEW_LINE>List<Message> events = payloadFormat.format(payload);<NEW_LINE>if (events == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// since device ids from messages maybe different, so we use the InsertPlan not<NEW_LINE>// InsertTabletPlan.<NEW_LINE>for (Message event : events) {<NEW_LINE>if (event == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean status = false;<NEW_LINE>try {<NEW_LINE>PartialPath path = new PartialPath(event.getDevice());<NEW_LINE>InsertRowPlan plan = new InsertRowPlan(path, event.getTimestamp(), event.getMeasurements().toArray(new String[0]), event.getValues().toArray(new String[0]));<NEW_LINE>TSStatus tsStatus = serviceProvider.checkAuthority(plan, sessionId);<NEW_LINE>if (tsStatus != null) {<NEW_LINE>LOG.warn(tsStatus.message);<NEW_LINE>} else {<NEW_LINE>status = serviceProvider.executeNonQuery(plan);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("meet error when inserting device {}, measurements {}, at time {}, because ", event.getDevice(), event.getMeasurements(), event.getTimestamp(), e);<NEW_LINE>}<NEW_LINE>LOG.debug("event process result: {}", status);<NEW_LINE>}<NEW_LINE>} | String topic = msg.getTopicName(); |
91,457 | synchronized public void readMetadata(@NonNull BackupFiles.BackupFile backupFile) throws IOException {<NEW_LINE>String metadata = FileUtils.getFileContent(backupFile.getMetadataFile());<NEW_LINE>if (TextUtils.isEmpty(metadata)) {<NEW_LINE>throw new IOException("Empty JSON string for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JSONObject rootObject = new JSONObject(metadata);<NEW_LINE>this.metadata = new Metadata();<NEW_LINE>this.metadata.backupPath = backupFile.getBackupPath();<NEW_LINE>this.metadata.backupName = this<MASK><NEW_LINE>this.metadata.label = rootObject.getString("label");<NEW_LINE>this.metadata.packageName = rootObject.getString("package_name");<NEW_LINE>this.metadata.versionName = rootObject.getString("version_name");<NEW_LINE>this.metadata.versionCode = rootObject.getLong("version_code");<NEW_LINE>this.metadata.dataDirs = JSONUtils.getArray(String.class, rootObject.getJSONArray("data_dirs"));<NEW_LINE>this.metadata.isSystem = rootObject.getBoolean("is_system");<NEW_LINE>this.metadata.isSplitApk = rootObject.getBoolean("is_split_apk");<NEW_LINE>this.metadata.splitConfigs = JSONUtils.getArray(String.class, rootObject.getJSONArray("split_configs"));<NEW_LINE>this.metadata.hasRules = rootObject.getBoolean("has_rules");<NEW_LINE>this.metadata.backupTime = rootObject.getLong("backup_time");<NEW_LINE>this.metadata.checksumAlgo = rootObject.getString("checksum_algo");<NEW_LINE>this.metadata.crypto = rootObject.getString("crypto");<NEW_LINE>readCrypto(rootObject);<NEW_LINE>this.metadata.version = rootObject.getInt("version");<NEW_LINE>this.metadata.apkName = rootObject.getString("apk_name");<NEW_LINE>this.metadata.instructionSet = rootObject.getString("instruction_set");<NEW_LINE>this.metadata.flags = new BackupFlags(rootObject.getInt("flags"));<NEW_LINE>this.metadata.userHandle = rootObject.getInt("user_handle");<NEW_LINE>this.metadata.tarType = rootObject.getString("tar_type");<NEW_LINE>this.metadata.keyStore = rootObject.getBoolean("key_store");<NEW_LINE>this.metadata.installer = JSONUtils.getString(rootObject, "installer", BuildConfig.APPLICATION_ID);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new IOException(e.getMessage() + " for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>} | .metadata.backupPath.getName(); |
1,060,928 | // operationName<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>@Override<NEW_LINE>public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) {<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_SYSTEM, getter.system(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_DESTINATION_KIND, getter.destinationKind(request));<NEW_LINE>boolean isTemporaryDestination = getter.temporaryDestination(request);<NEW_LINE>if (isTemporaryDestination) {<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_TEMP_DESTINATION, true);<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_DESTINATION, TEMP_DESTINATION_NAME);<NEW_LINE>} else {<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_DESTINATION<MASK><NEW_LINE>}<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_PROTOCOL, getter.protocol(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_PROTOCOL_VERSION, getter.protocolVersion(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_URL, getter.url(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_CONVERSATION_ID, getter.conversationId(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, getter.messagePayloadSize(request));<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, getter.messagePayloadCompressedSize(request));<NEW_LINE>if (operation == RECEIVE || operation == PROCESS) {<NEW_LINE>set(attributes, SemanticAttributes.MESSAGING_OPERATION, operation.operationName());<NEW_LINE>}<NEW_LINE>} | , getter.destination(request)); |
188,947 | /*<NEW_LINE>* Create an authentication request that will send to openID provider for authentication<NEW_LINE>*/<NEW_LINE>public void createAuthRequest(ServletRequest request, ServletResponse response) throws ServletException, Exception {<NEW_LINE>HttpServletRequest req = (HttpServletRequest) request;<NEW_LINE>HttpServletResponse resp = (HttpServletResponse) response;<NEW_LINE>// 1. get openID Identifier<NEW_LINE>String identifier = (String) req.getAttribute(OpenidConstants.OPENID_IDENTIFIER);<NEW_LINE>if (identifier == null) {<NEW_LINE>identifier = req.getParameter(OpenidConstants.OPENID_IDENTIFIER);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "openID identifier from request parameter:" + identifier);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "openID identifier from request attribute(TAI):" + identifier);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 2. do OP discovery<NEW_LINE>DiscoveryInformation discoveryInformation = utils.discoverOpenID(consumerManager, identifier);<NEW_LINE>// 3. create a uniqueKey using digest for looping back after authentication<NEW_LINE><MASK><NEW_LINE>// 4. create return URL.<NEW_LINE>String return_to_url = utils.createReturnToUrl(req, uniqueKey);<NEW_LINE>// 5. get RP realm<NEW_LINE>String rpRealm = utils.getRpRealm(req);<NEW_LINE>// 6. build an authentication request message for the user specified in the discovery information provided as a parameter.<NEW_LINE>AuthRequest authRequest = null;<NEW_LINE>try {<NEW_LINE>authRequest = consumerManager.authenticate(discoveryInformation, return_to_url, rpRealm);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Tr.error(tc, "OPENID_AUTHENTICATE_FAILED", new Object[] { identifier });<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>// 7. add additional UserInfo attributes to authRequest<NEW_LINE>utils.addUserInfoAttributes(authRequest);<NEW_LINE>// 8. redirect to OP for authentication<NEW_LINE>resp.setStatus(javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED);<NEW_LINE>resp.sendRedirect(authRequest.getDestinationUrl(true));<NEW_LINE>// 9. cached the discoveryInformation<NEW_LINE>requestCache.put(uniqueKey, discoveryInformation);<NEW_LINE>} | String uniqueKey = MessageDigestUtil.getDigest(); |
1,185,684 | private static List<UniverseDefinitionTaskParams.Cluster> mapClustersInParams(ObjectNode formData, boolean failIfNotPresent) throws JsonProcessingException {<NEW_LINE>ArrayNode clustersJsonArray = (ArrayNode) formData.get("clusters");<NEW_LINE>if (clustersJsonArray == null) {<NEW_LINE>if (failIfNotPresent) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "clusters: This field is required");<NEW_LINE>} else {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayNode newClustersJsonArray = Json.newArray();<NEW_LINE>List<UniverseDefinitionTaskParams.Cluster> clusters = new ArrayList<>();<NEW_LINE>for (int i = 0; i < clustersJsonArray.size(); ++i) {<NEW_LINE>ObjectNode clusterJson = (ObjectNode) clustersJsonArray.get(i);<NEW_LINE>ObjectNode userIntent = (ObjectNode) clusterJson.get("userIntent");<NEW_LINE>if (userIntent == null) {<NEW_LINE>if (failIfNotPresent) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "userIntent: This field is required");<NEW_LINE>} else {<NEW_LINE>newClustersJsonArray.add(clusterJson);<NEW_LINE>UniverseDefinitionTaskParams.Cluster cluster = (new ObjectMapper()).treeToValue(clusterJson, UniverseDefinitionTaskParams.Cluster.class);<NEW_LINE>clusters.add(cluster);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: (ram) add tests for all these.<NEW_LINE>Map<String, String> masterGFlagsMap = serializeGFlagListToMap(userIntent, "masterGFlags");<NEW_LINE>Map<String, String> tserverGFlagsMap = serializeGFlagListToMap(userIntent, "tserverGFlags");<NEW_LINE>Map<String, String> instanceTags = serializeGFlagListToMap(userIntent, "instanceTags");<NEW_LINE>clusterJson.set("userIntent", userIntent);<NEW_LINE>newClustersJsonArray.add(clusterJson);<NEW_LINE>UniverseDefinitionTaskParams.Cluster cluster = (new ObjectMapper()).treeToValue(clusterJson, UniverseDefinitionTaskParams.Cluster.class);<NEW_LINE>cluster.userIntent.masterGFlags = masterGFlagsMap;<NEW_LINE>cluster.userIntent.tserverGFlags = tserverGFlagsMap;<NEW_LINE>cluster.userIntent.instanceTags = instanceTags;<NEW_LINE>clusters.add(cluster);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return clusters;<NEW_LINE>} | formData.set("clusters", newClustersJsonArray); |
1,425,126 | private void updateListeners() {<NEW_LINE>final boolean useLocation = mRunning && mMode != 0 && !mIitc.isLoading();<NEW_LINE>final boolean useOrientation = useLocation && mMode == 2;<NEW_LINE>if (useLocation && !mLocationRegistered) {<NEW_LINE>try {<NEW_LINE>mLocationManager.requestLocationUpdates(LocationManager.<MASK><NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>// if the given provider doesn't exist<NEW_LINE>Log.w(e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>// if the given provider doesn't exist<NEW_LINE>Log.w(e);<NEW_LINE>}<NEW_LINE>mLocationRegistered = true;<NEW_LINE>}<NEW_LINE>if (!useLocation && mLocationRegistered) {<NEW_LINE>mLocationManager.removeUpdates(this);<NEW_LINE>mLocationRegistered = false;<NEW_LINE>}<NEW_LINE>if (useOrientation && !mOrientationRegistered) {<NEW_LINE>mCompass.registerListener(this);<NEW_LINE>mOrientationRegistered = true;<NEW_LINE>}<NEW_LINE>if (!useOrientation && mOrientationRegistered) {<NEW_LINE>mCompass.unregisterListener(this);<NEW_LINE>mOrientationRegistered = false;<NEW_LINE>}<NEW_LINE>} | NETWORK_PROVIDER, 0, 0, this); |
251,095 | public DataxTaskExecutionContext generateExtendedContext(ResourceParametersHelper parametersHelper) {<NEW_LINE>DataxTaskExecutionContext dataxTaskExecutionContext = new DataxTaskExecutionContext();<NEW_LINE>if (customConfig == Flag.YES.ordinal()) {<NEW_LINE>return dataxTaskExecutionContext;<NEW_LINE>}<NEW_LINE>DataSourceParameters dbSource = (DataSourceParameters) parametersHelper.<MASK><NEW_LINE>DataSourceParameters dbTarget = (DataSourceParameters) parametersHelper.getResourceParameters(ResourceType.DATASOURCE, dataTarget);<NEW_LINE>if (Objects.nonNull(dbSource)) {<NEW_LINE>dataxTaskExecutionContext.setDataSourceId(dataSource);<NEW_LINE>dataxTaskExecutionContext.setSourcetype(dbSource.getType());<NEW_LINE>dataxTaskExecutionContext.setSourceConnectionParams(dbSource.getConnectionParams());<NEW_LINE>}<NEW_LINE>if (Objects.nonNull(dbTarget)) {<NEW_LINE>dataxTaskExecutionContext.setDataTargetId(dataTarget);<NEW_LINE>dataxTaskExecutionContext.setTargetType(dbTarget.getType());<NEW_LINE>dataxTaskExecutionContext.setTargetConnectionParams(dbTarget.getConnectionParams());<NEW_LINE>}<NEW_LINE>return dataxTaskExecutionContext;<NEW_LINE>} | getResourceParameters(ResourceType.DATASOURCE, dataSource); |
942,368 | protected void init(int row, int column) {<NEW_LINE>updateService();<NEW_LINE>editor = new DataTypeSelectionEditor(service, getAllowed(row, column));<NEW_LINE>editor.setPreferredDataTypeManager(getPreferredDataTypeManager(row, column));<NEW_LINE>editor.setTabCommitsEdit(true);<NEW_LINE>editor.setConsumeEnterKeyPress(false);<NEW_LINE>final DropDownSelectionTextField<DataType<MASK><NEW_LINE>textField.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));<NEW_LINE>CellEditorUtils.onOneFocus(textField, () -> textField.selectAll());<NEW_LINE>editor.addCellEditorListener(cellEditorListener);<NEW_LINE>editorPanel = new JPanel(new BorderLayout()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void requestFocus() {<NEW_LINE>textField.requestFocus();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>editorPanel.add(textField, BorderLayout.CENTER);<NEW_LINE>editorPanel.add(dataTypeChooserButton, BorderLayout.EAST);<NEW_LINE>} | > textField = editor.getDropDownTextField(); |
535,218 | public void add(HeapHistogram second) {<NEW_LINE>final Map<String, ClassInfo> classesMap <MASK><NEW_LINE>final Map<String, ClassInfo> permGenMap = new HashMap<>(1024);<NEW_LINE>for (final ClassInfo classInfo : classes) {<NEW_LINE>addClassInfo(classInfo, classesMap);<NEW_LINE>}<NEW_LINE>for (final ClassInfo classInfo : permGenClasses) {<NEW_LINE>addClassInfo(classInfo, permGenMap);<NEW_LINE>}<NEW_LINE>for (final ClassInfo classInfo : second.getHeapHistogram()) {<NEW_LINE>addClassInfo(classInfo, classesMap);<NEW_LINE>}<NEW_LINE>for (final ClassInfo classInfo : second.getPermGenHistogram()) {<NEW_LINE>addClassInfo(classInfo, permGenMap);<NEW_LINE>}<NEW_LINE>totalHeapBytes += second.getTotalHeapBytes();<NEW_LINE>totalHeapInstances += second.getTotalHeapInstances();<NEW_LINE>totalPermGenBytes += second.getTotalPermGenBytes();<NEW_LINE>totalPermgenInstances += second.getTotalPermGenInstances();<NEW_LINE>classes.clear();<NEW_LINE>classes.addAll(classesMap.values());<NEW_LINE>permGenClasses.clear();<NEW_LINE>permGenClasses.addAll(permGenMap.values());<NEW_LINE>sort();<NEW_LINE>sourceDisplayed = sourceDisplayed || second.isSourceDisplayed();<NEW_LINE>} | = new HashMap<>(1024); |
988,681 | private DetailedExitCode checkCwdInWorkspace(EventHandler eventHandler) {<NEW_LINE>if (!commandAnnotation.mustRunInWorkspace()) {<NEW_LINE>return DetailedExitCode.success();<NEW_LINE>}<NEW_LINE>if (!workspace.getDirectories().inWorkspace()) {<NEW_LINE>String message = "The '" + commandAnnotation.name() + "' command is only supported from within a workspace" + " (below a directory having a WORKSPACE file).\n" + "See documentation at" + " https://bazel.build/concepts/build-ref#workspace";<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>Path workspacePath = workspace.getWorkspace();<NEW_LINE>// TODO(kchodorow): Remove this once spaces are supported.<NEW_LINE>if (workspacePath.getPathString().contains(" ")) {<NEW_LINE>String message = runtime.getProductName() + " does not currently work properly from paths " + "containing spaces (" + workspacePath + ").";<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return createDetailedExitCode(message, Code.SPACES_IN_WORKSPACE_PATH);<NEW_LINE>}<NEW_LINE>if (workspacePath.getParentDirectory() != null) {<NEW_LINE>Path doNotBuild = workspacePath.getParentDirectory().getRelative(BlazeWorkspace.DO_NOT_BUILD_FILE_NAME);<NEW_LINE>if (doNotBuild.exists()) {<NEW_LINE>if (!commandAnnotation.canRunInOutputDirectory()) {<NEW_LINE>String message = getNotInRealWorkspaceError(doNotBuild);<NEW_LINE>eventHandler.handle(Event.error(message));<NEW_LINE>return createDetailedExitCode(message, Code.IN_OUTPUT_DIRECTORY);<NEW_LINE>} else {<NEW_LINE>eventHandler.handle(Event.warn(runtime.getProductName() + " is run from output directory. This is unsound."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DetailedExitCode.success();<NEW_LINE>} | createDetailedExitCode(message, Code.NOT_IN_WORKSPACE); |
1,507,298 | final UpdateLedgerPermissionsModeResult executeUpdateLedgerPermissionsMode(UpdateLedgerPermissionsModeRequest updateLedgerPermissionsModeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateLedgerPermissionsModeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateLedgerPermissionsModeRequest> request = null;<NEW_LINE>Response<UpdateLedgerPermissionsModeResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateLedgerPermissionsModeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateLedgerPermissionsModeRequest));<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, "QLDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateLedgerPermissionsMode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateLedgerPermissionsModeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateLedgerPermissionsModeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
514,745 | public void enterCip_transform_set(Cip_transform_setContext ctx) {<NEW_LINE>if (_currentIpsecTransformSet != null) {<NEW_LINE>throw new BatfishException("IpsecTransformSet should be null!");<NEW_LINE>}<NEW_LINE>_currentIpsecTransformSet = new IpsecTransformSet(ctx.name.getText());<NEW_LINE>_configuration.defineStructure(IPSEC_TRANSFORM_SET, ctx.name.getText(), ctx);<NEW_LINE>if (ctx.ipsec_encryption() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm(ctx.ipsec_encryption()));<NEW_LINE>} else if (ctx.ipsec_encryption_aruba() != null) {<NEW_LINE>_currentIpsecTransformSet.setEncryptionAlgorithm(toEncryptionAlgorithm<MASK><NEW_LINE>}<NEW_LINE>// If any encryption algorithm was set then ESP protocol is used<NEW_LINE>if (_currentIpsecTransformSet.getEncryptionAlgorithm() != null) {<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(IpsecProtocol.ESP);<NEW_LINE>}<NEW_LINE>if (ctx.ipsec_authentication() != null) {<NEW_LINE>_currentIpsecTransformSet.setAuthenticationAlgorithm(toIpsecAuthenticationAlgorithm(ctx.ipsec_authentication()));<NEW_LINE>_currentIpsecTransformSet.getProtocols().add(toProtocol(ctx.ipsec_authentication()));<NEW_LINE>}<NEW_LINE>} | (ctx.ipsec_encryption_aruba())); |
1,598,676 | private void initializeComponents(DynamicsModifier.Angular aValue, String charTitle) {<NEW_LINE>JPanel contentPanel = getContentPanel();<NEW_LINE>{<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>contentPanel.add(panel, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, <MASK><NEW_LINE>}<NEW_LINE>{<NEW_LINE>contentPanel.add(magnitudePanel = new ScaledNumericPanel(editor, aValue == null ? null : aValue.strengthValue, charTitle, "Strength", "In world units per second.", true), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>contentPanel.add(phiPanel = new ScaledNumericPanel(editor, aValue == null ? null : aValue.phiValue, charTitle, "Azimuth", "Rotation starting on Y", true), new GridBagConstraints(0, 4, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>contentPanel.add(thetaPanel = new ScaledNumericPanel(editor, aValue == null ? null : aValue.thetaValue, charTitle, "Polar angle", "around Y axis on XZ plane", true), new GridBagConstraints(0, 3, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>JPanel spacer = new JPanel();<NEW_LINE>spacer.setPreferredSize(new Dimension());<NEW_LINE>contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));<NEW_LINE>}<NEW_LINE>magnitudePanel.setIsAlwayShown(true);<NEW_LINE>phiPanel.setIsAlwayShown(true);<NEW_LINE>thetaPanel.setIsAlwayShown(true);<NEW_LINE>isGlobalCheckBox.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>AngularVelocityPanel.this.value.isGlobal = isGlobalCheckBox.isSelected();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | 0), 0, 0)); |
1,512,676 | public static Definition translate(Raml raml) throws TranslationException {<NEW_LINE>Definition definition = new Definition();<NEW_LINE>if (raml.getVersion() != null) {<NEW_LINE>definition.setVersion(raml.getVersion().substring(1));<NEW_LINE>// def.setEndpoint(raml.getBaseUri().replace("{version}",<NEW_LINE>// raml.getVersion()));<NEW_LINE>} else {<NEW_LINE>// def.setEndpoint(raml.getBaseUri());<NEW_LINE>}<NEW_LINE>Contract contract = new Contract();<NEW_LINE>definition.setContract(contract);<NEW_LINE>contract.<MASK><NEW_LINE>// TODO add section sorting strategies<NEW_LINE>// TODO String defaultMediaType = raml.getMediaType();<NEW_LINE>List<PathVariable> rootPathVariables = new ArrayList<>();<NEW_LINE>for (Entry<String, UriParameter> entry : raml.getBaseUriParameters().entrySet()) {<NEW_LINE>rootPathVariables.add(getPathVariable(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>for (Map<String, String> schema : raml.getSchemas()) {<NEW_LINE>for (Entry<String, String> entry : schema.entrySet()) {<NEW_LINE>Representation representation = new Representation();<NEW_LINE>representation.setName(entry.getKey());<NEW_LINE>representation.setDescription(entry.getValue());<NEW_LINE>// TODO get the schema !!!<NEW_LINE>// TODO set representations's sections<NEW_LINE>// representation.getSections().add(section.getName());<NEW_LINE>contract.getRepresentations().add(representation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Resources<NEW_LINE>for (Entry<String, org.raml.model.Resource> entry : raml.getResources().entrySet()) {<NEW_LINE>org.raml.model.Resource resource = entry.getValue();<NEW_LINE>contract.getResources().addAll(getResource(ConversionUtils.processResourceName(resource.getUri()), resource, rootPathVariables));<NEW_LINE>}<NEW_LINE>return definition;<NEW_LINE>} | setName(raml.getTitle()); |
1,771,402 | public /*<NEW_LINE>private class CorpusWordCounts {<NEW_LINE>Alphabet unigramAlphabet;<NEW_LINE>FeatureCounter unigramCounts = new FeatureCounter(unigramAlphabet);<NEW_LINE>public CorpusWordCounts(Alphabet alphabet) {<NEW_LINE>unigramAlphabet = alphabet;<NEW_LINE>}<NEW_LINE>private double mylog(double x) { return (x == 0) ? -1000000.0 : Math.log(x); }<NEW_LINE>// The likelihood ratio significance test<NEW_LINE>private double significanceTest(int thisUnigramCount, int nextUnigramCount, int nextBigramCount, int nextTotalCount, int minCount) {<NEW_LINE>if (nextBigramCount < minCount) return -1.0;<NEW_LINE>assert(nextUnigramCount >= nextBigramCount);<NEW_LINE>double log_pi_vu = mylog(nextBigramCount) - mylog(thisUnigramCount);<NEW_LINE>double log_pi_vnu = mylog(nextUnigramCount - nextBigramCount<MASK><NEW_LINE>double log_pi_v_old = mylog(nextUnigramCount) - mylog(nextTotalCount);<NEW_LINE>double log_1mp_v = mylog(1 - Math.exp(log_pi_vnu));<NEW_LINE>double log_1mp_vu = mylog(1 - Math.exp(log_pi_vu));<NEW_LINE>return 2 * (nextBigramCount * log_pi_vu +<NEW_LINE>(nextUnigramCount - nextBigramCount) * log_pi_vnu -<NEW_LINE>nextUnigramCount * log_pi_v_old +<NEW_LINE>(thisUnigramCount- nextBigramCount) * (log_1mp_vu - log_1mp_v));<NEW_LINE>}<NEW_LINE>public int[] significantBigrams(int word) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>void write(File f) {<NEW_LINE>try {<NEW_LINE>ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));<NEW_LINE>oos.writeObject(this);<NEW_LINE>oos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("LDAHyper.write: Exception writing LDAHyper to file " + f + ": " + e);<NEW_LINE>}<NEW_LINE>} | ) - mylog(nextTotalCount - nextBigramCount); |
1,393,591 | public Hcl visitForObject(Hcl.ForObject forObject, PrintOutputCapture<P> p) {<NEW_LINE>visitSpace(forObject.getPrefix(), Space.Location.FOR_OBJECT, p);<NEW_LINE>visitMarkers(forObject.getMarkers(), p);<NEW_LINE>p.out.append("{");<NEW_LINE>visit(forObject.getIntro(), p);<NEW_LINE>visitLeftPadded(":", forObject.getPadding().getUpdateName(), HclLeftPadded.Location.FOR_UPDATE, p);<NEW_LINE>visitLeftPadded("=>", forObject.getPadding().getUpdateValue(), HclLeftPadded.Location.FOR_UPDATE_VALUE, p);<NEW_LINE>if (forObject.getEllipsis() != null) {<NEW_LINE>visitSpace(forObject.getEllipsis().getPrefix(), Space.Location.FOR_UPDATE_VALUE_ELLIPSIS, p);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (forObject.getPadding().getCondition() != null) {<NEW_LINE>visitLeftPadded("if", forObject.getPadding().getCondition(), HclLeftPadded.Location.FOR_CONDITION, p);<NEW_LINE>}<NEW_LINE>visitSpace(forObject.getEnd(), Space.Location.FOR_OBJECT_SUFFIX, p);<NEW_LINE>p.out.append("}");<NEW_LINE>return forObject;<NEW_LINE>} | p.out.append("..."); |
1,807,538 | public void marshall(Eac3Settings eac3Settings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (eac3Settings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getAttenuationControl(), ATTENUATIONCONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getBitrate(), BITRATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getBitstreamMode(), BITSTREAMMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getCodingMode(), CODINGMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getDcFilter(), DCFILTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getDialnorm(), DIALNORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getDrcLine(), DRCLINE_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getDrcRf(), DRCRF_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLfeControl(), LFECONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLfeFilter(), LFEFILTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLoRoCenterMixLevel(), LOROCENTERMIXLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLoRoSurroundMixLevel(), LOROSURROUNDMIXLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLtRtCenterMixLevel(), LTRTCENTERMIXLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getLtRtSurroundMixLevel(), LTRTSURROUNDMIXLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(eac3Settings.getPassthroughControl(), PASSTHROUGHCONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getPhaseControl(), PHASECONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getStereoDownmix(), STEREODOWNMIX_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getSurroundExMode(), SURROUNDEXMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(eac3Settings.getSurroundMode(), SURROUNDMODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | eac3Settings.getMetadataControl(), METADATACONTROL_BINDING); |
1,311,817 | private void drawDocumentBox(Point[] points, Size stdSize) {<NEW_LINE>Path path = new Path();<NEW_LINE>HUDCanvasView hud = mMainActivity.getHUD();<NEW_LINE>// ATTENTION: axis are swapped<NEW_LINE>float previewWidth = (float) stdSize.height;<NEW_LINE>float previewHeight = (float) stdSize.width;<NEW_LINE>path.moveTo(previewWidth - (float) points[0].y, (float) points[0].x);<NEW_LINE>path.lineTo(previewWidth - (float) points[1].y, (float) points[1].x);<NEW_LINE>path.lineTo(previewWidth - (float) points[2].y, (float) points[2].x);<NEW_LINE>path.lineTo(previewWidth - (float) points[3].y, (float) points[3].x);<NEW_LINE>path.close();<NEW_LINE>PathShape newBox = new PathShape(path, previewWidth, previewHeight);<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setColor(Color.argb(64<MASK><NEW_LINE>Paint border = new Paint();<NEW_LINE>border.setColor(Color.rgb(0, 255, 0));<NEW_LINE>border.setStrokeWidth(5);<NEW_LINE>hud.clear();<NEW_LINE>hud.addShape(newBox, paint, border);<NEW_LINE>mMainActivity.invalidateHUD();<NEW_LINE>} | , 0, 255, 0)); |
518,699 | public void validateCall(SqlCall call, SqlValidatorScope scope) {<NEW_LINE>final SqlOperator operator = call.getOperator();<NEW_LINE>if ((call.operandCount() == 0) && (operator.getSyntax() == SqlSyntax.FUNCTION_ID) && !call.isExpanded() && !conformance.allowNiladicParentheses()) {<NEW_LINE>// For example, "LOCALTIME()" is illegal. (It should be<NEW_LINE>// "LOCALTIME", which would have been handled as a<NEW_LINE>// SqlIdentifier.)<NEW_LINE>throw handleUnresolvedFunction(call, (SqlFunction) operator, ImmutableList.<RelDataType>of(), null);<NEW_LINE>}<NEW_LINE>SqlValidatorScope <MASK><NEW_LINE>if (operator instanceof SqlFunction && ((SqlFunction) operator).getFunctionType() == SqlFunctionCategory.MATCH_RECOGNIZE && !(operandScope instanceof MatchRecognizeScope)) {<NEW_LINE>throw newValidationError(call, Static.RESOURCE.functionMatchRecognizeOnly(call.toString()));<NEW_LINE>}<NEW_LINE>// Delegate validation to the operator.<NEW_LINE>operator.validateCall(call, this, scope, operandScope);<NEW_LINE>} | operandScope = scope.getOperandScope(call); |
300,997 | private void aztecRegisterFailedMediaForThisPost(PostModel post) {<NEW_LINE>// there could be failed media in the post, that has not been registered in the UploadStore because<NEW_LINE>// the media was being uploaded separately (i.e. the user included media, started uploading within<NEW_LINE>// the editor, and such media failed _before_ exiting the eidtor, thus the registration never happened.<NEW_LINE>// We're recovering the information here so we make sure to rebuild the status only when the user taps<NEW_LINE>// on Retry.<NEW_LINE>List<String> mediaIds = AztecEditorFragment.getMediaMarkedFailedInPostContent(this, post.getContent());<NEW_LINE>if (mediaIds != null && !mediaIds.isEmpty()) {<NEW_LINE>ArrayList<MediaModel> mediaList = new ArrayList<>();<NEW_LINE>for (String mediaId : mediaIds) {<NEW_LINE>MediaModel media = mMediaStore.getMediaWithLocalId(StringUtils.stringToInt(mediaId));<NEW_LINE>if (media != null) {<NEW_LINE>mediaList.add(media);<NEW_LINE>// if this media item didn't have the Postid set, let's set it as we found it<NEW_LINE>// in the Post body anyway. So let's fix that now.<NEW_LINE>if (media.getLocalPostId() == 0) {<NEW_LINE>media.setLocalPostId(post.getId());<NEW_LINE>mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(media));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!mediaList.isEmpty()) {<NEW_LINE>// given we found failed media within this Post, let's also cancel the media error<NEW_LINE>mPostUploadNotifier.cancelFinalNotificationForMedia(this, mSiteStore.getSiteByLocalId<MASK><NEW_LINE>// now we have a list. Let' register this list.<NEW_LINE>mUploadStore.registerPostModel(post, mediaList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (post.getLocalSiteId())); |
1,669,937 | public int compareTo(getActiveCompactions_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSuccess()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSec(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSec()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sec, other.sec);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | ), other.isSetSec()); |
1,799,700 | private Map<String, List<String>> buildELBtoASGMap() {<NEW_LINE>AWSClient awsClient = getAWSClient();<NEW_LINE>LOGGER.info(String.format("Getting all ELBs associated with ASGs in region %s", awsClient.region()));<NEW_LINE>List<AutoScalingGroup> autoScalingGroupList = awsClient.describeAutoScalingGroups();<NEW_LINE>HashMap<String, List<String>> asgMap = new HashMap<>();<NEW_LINE>for (AutoScalingGroup asg : autoScalingGroupList) {<NEW_LINE>String asgName = asg.getAutoScalingGroupName();<NEW_LINE>if (asg.getLoadBalancerNames() != null) {<NEW_LINE>for (String elbName : asg.getLoadBalancerNames()) {<NEW_LINE>List<String> asgList = asgMap.get(elbName);<NEW_LINE>if (asgList == null) {<NEW_LINE>asgList = new ArrayList<>();<NEW_LINE>asgMap.put(elbName, asgList);<NEW_LINE>}<NEW_LINE>asgList.add(asgName);<NEW_LINE>LOGGER.debug(String.format<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return asgMap;<NEW_LINE>} | ("Found ASG %s associated with ELB %s", asgName, elbName)); |
974,318 | private MInOutLine createLine(MInvoice invoice, MInvoiceLine invoiceLine) {<NEW_LINE>final IInvoiceBL invoiceBL = Services.get(IInvoiceBL.class);<NEW_LINE>final IMatchInvDAO matchInvDAO = Services.get(IMatchInvDAO.class);<NEW_LINE>final StockQtyAndUOMQty qtyMatched = matchInvDAO.retrieveQtyMatched(invoiceLine);<NEW_LINE>final StockQtyAndUOMQty qtyInvoiced = StockQtyAndUOMQtys.create(invoiceLine.getQtyInvoiced(), ProductId.ofRepoId(invoiceLine.getM_Product_ID()), invoiceLine.getQtyEntered(), UomId.ofRepoId<MASK><NEW_LINE>final StockQtyAndUOMQty qtyNotMatched = StockQtyAndUOMQtys.subtract(qtyInvoiced, qtyMatched);<NEW_LINE>// If is fully matched don't create anything<NEW_LINE>if (qtyNotMatched.signum() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MInOut inout = getCreateHeader(invoice);<NEW_LINE>MInOutLine sLine = new MInOutLine(inout);<NEW_LINE>// Locator<NEW_LINE>// Locator<NEW_LINE>sLine.// Locator<NEW_LINE>setInvoiceLine(// Locator<NEW_LINE>invoiceLine, 0, invoice.isSOTrx() ? qtyNotMatched.getStockQty().toBigDecimal() : ZERO);<NEW_LINE>sLine.setQtyEntered(qtyNotMatched.getUOMQtyNotNull().toBigDecimal());<NEW_LINE>sLine.setMovementQty(qtyNotMatched.getStockQty().toBigDecimal());<NEW_LINE>if (invoiceBL.isCreditMemo(invoice)) {<NEW_LINE>sLine.setQtyEntered(sLine.getQtyEntered().negate());<NEW_LINE>sLine.setMovementQty(sLine.getMovementQty().negate());<NEW_LINE>}<NEW_LINE>sLine.saveEx();<NEW_LINE>//<NEW_LINE>invoiceLine.setM_InOutLine_ID(sLine.getM_InOutLine_ID());<NEW_LINE>invoiceLine.saveEx();<NEW_LINE>//<NEW_LINE>return sLine;<NEW_LINE>} | (invoiceLine.getC_UOM_ID())); |
1,226,635 | private void updateExecutableFlow(final ExecutableFlow flow, final EncodingType encType) throws ExecutorManagerException {<NEW_LINE>final <MASK><NEW_LINE>byte[] data = null;<NEW_LINE>try {<NEW_LINE>// If this action fails, the execution must be failed.<NEW_LINE>final String json = JSONUtils.toJSON(flow.toObject());<NEW_LINE>final byte[] stringData = json.getBytes("UTF-8");<NEW_LINE>data = stringData;<NEW_LINE>// Todo kunkun-tang: use a common method to transform stringData to data.<NEW_LINE>if (encType == EncodingType.GZIP) {<NEW_LINE>data = GZIPUtils.gzipBytes(stringData);<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>flow.setStatus(Status.FAILED);<NEW_LINE>updateExecutableFlowStatusInDB(flow);<NEW_LINE>throw new ExecutorManagerException("Error encoding the execution flow. Execution Id = " + flow.getExecutionId());<NEW_LINE>} catch (final RuntimeException re) {<NEW_LINE>flow.setStatus(Status.FAILED);<NEW_LINE>// Likely due to serialization error<NEW_LINE>if (data == null && re instanceof NullPointerException) {<NEW_LINE>logger.warn("Failed to serialize executable flow for " + flow.getExecutionId());<NEW_LINE>logger.warn("NPE stacktrace" + ExceptionUtils.getStackTrace(re));<NEW_LINE>}<NEW_LINE>updateExecutableFlowStatusInDB(flow);<NEW_LINE>throw new ExecutorManagerException("Error encoding the execution flow due to " + "RuntimeException. Execution Id = " + flow.getExecutionId(), re);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.dbOperator.update(UPDATE_EXECUTABLE_FLOW_DATA, flow.getStatus().getNumVal(), flow.getUpdateTime(), flow.getStartTime(), flow.getEndTime(), encType.getNumVal(), data, flow.getExecutionId());<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new ExecutorManagerException("Error updating flow.", e);<NEW_LINE>}<NEW_LINE>} | String UPDATE_EXECUTABLE_FLOW_DATA = "UPDATE execution_flows " + "SET status=?,update_time=?,start_time=?,end_time=?,enc_type=?,flow_data=? " + "WHERE exec_id=?"; |
1,428,932 | public boolean applyAppOpsAndPerms() {<NEW_LINE>if (mPackageInfo == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean isSuccessful = true;<NEW_LINE>int uid = mPackageInfo.applicationInfo.uid;<NEW_LINE>AppOpsService appOpsService = new AppOpsService();<NEW_LINE>// Apply all app ops<NEW_LINE>for (AppOpRule appOp : getAll(AppOpRule.class)) {<NEW_LINE>try {<NEW_LINE>appOpsService.setMode(appOp.getOp(), uid, packageName, appOp.getMode());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>isSuccessful = false;<NEW_LINE>Log.e(TAG, "Could not set mode " + appOp.getMode() + " for app op " + appOp.getOp(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Apply all permissions<NEW_LINE>for (PermissionRule permissionRule : getAll(PermissionRule.class)) {<NEW_LINE>Permission permission = permissionRule.getPermission(true);<NEW_LINE>try {<NEW_LINE>permission.setAppOpAllowed(permission.getAppOp() != OP_NONE && appOpsService.checkOperation(permission.getAppOp(), uid, packageName) == AppOpsManager.MODE_ALLOWED);<NEW_LINE>if (permission.isGranted()) {<NEW_LINE>PermUtils.grantPermission(mPackageInfo, permission, appOpsService, true, true);<NEW_LINE>} else {<NEW_LINE>PermUtils.revokePermission(<MASK><NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>isSuccessful = false;<NEW_LINE>Log.e(TAG, "Could not " + (permission.isGranted() ? "grant" : "revoke") + " " + permissionRule.name, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isSuccessful;<NEW_LINE>} | mPackageInfo, permission, appOpsService, true); |
455,248 | public void start(WorkflowModel workflow, TaskModel task, WorkflowExecutor executor) {<NEW_LINE>final Map<String, Object> taskInput = task.getInputData();<NEW_LINE>final String queryExpression = (String) taskInput.get(QUERY_EXPRESSION_PARAMETER);<NEW_LINE>if (queryExpression == null) {<NEW_LINE>task.setReasonForIncompletion("Missing '" + QUERY_EXPRESSION_PARAMETER + "' in input parameters");<NEW_LINE>task.setStatus(TaskModel.Status.FAILED);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final JsonNode input = objectMapper.valueToTree(taskInput);<NEW_LINE>final JsonQuery query = queryCache.get(queryExpression);<NEW_LINE>final Scope childScope = Scope.newChildScope(rootScope);<NEW_LINE>final List<JsonNode> result = query.apply(childScope, input);<NEW_LINE>task.setStatus(TaskModel.Status.COMPLETED);<NEW_LINE>if (result == null) {<NEW_LINE>task.addOutput(OUTPUT_RESULT, null);<NEW_LINE>task.addOutput(OUTPUT_RESULT_LIST, null);<NEW_LINE>} else if (result.isEmpty()) {<NEW_LINE>task.addOutput(OUTPUT_RESULT, null);<NEW_LINE>task.addOutput(OUTPUT_RESULT_LIST, result);<NEW_LINE>} else {<NEW_LINE>task.addOutput(OUTPUT_RESULT, result.get(0));<NEW_LINE>task.addOutput(OUTPUT_RESULT_LIST, result);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error("Error executing task: {} in workflow: {}", task.getTaskId(), <MASK><NEW_LINE>task.setStatus(TaskModel.Status.FAILED);<NEW_LINE>final String message = extractFirstValidMessage(e);<NEW_LINE>task.setReasonForIncompletion(message);<NEW_LINE>task.addOutput(OUTPUT_ERROR, message);<NEW_LINE>}<NEW_LINE>} | workflow.getWorkflowId(), e); |
999,887 | public boolean place(Item item, Block block, Block target, BlockFace face, double fx, double fy, double fz, Player player) {<NEW_LINE>int[] faces = { 2, 5, 3, 4 };<NEW_LINE>this.setDamage(faces[player != null ? player.getDirection().getHorizontalIndex() : 0]);<NEW_LINE>this.getLevel().setBlock(block, this, true, true);<NEW_LINE>CompoundTag nbt = new CompoundTag("").putString("id", BlockEntity.ENDER_CHEST).putInt("x", (int) this.x).putInt("y", (int) this.y).putInt("z", (int) this.z);<NEW_LINE>if (item.hasCustomName()) {<NEW_LINE>nbt.putString("CustomName", item.getCustomName());<NEW_LINE>}<NEW_LINE>if (item.hasCustomBlockData()) {<NEW_LINE>Map<String, Tag> customData = item<MASK><NEW_LINE>for (Map.Entry<String, Tag> tag : customData.entrySet()) {<NEW_LINE>nbt.put(tag.getKey(), tag.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BlockEntityEnderChest ender = (BlockEntityEnderChest) BlockEntity.createBlockEntity(BlockEntity.ENDER_CHEST, this.getLevel().getChunk((int) this.x >> 4, (int) this.z >> 4), nbt);<NEW_LINE>return ender != null;<NEW_LINE>} | .getCustomBlockData().getTags(); |
1,059,419 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>if (ServletFileUpload.isMultipartContent(request)) {<NEW_LINE>DiskFileItemFactory factory = new DiskFileItemFactory();<NEW_LINE>factory.setSizeThreshold(MEMORY_THRESHOLD);<NEW_LINE>factory.setRepository(new File(System.getProperty("java.io.tmpdir")));<NEW_LINE>ServletFileUpload upload = new ServletFileUpload(factory);<NEW_LINE>upload.setFileSizeMax(MAX_FILE_SIZE);<NEW_LINE>upload.setSizeMax(MAX_REQUEST_SIZE);<NEW_LINE>String uploadPath = getServletContext().getRealPath("") + File.separator + UPLOAD_DIRECTORY;<NEW_LINE>File uploadDir = new File(uploadPath);<NEW_LINE>if (!uploadDir.exists()) {<NEW_LINE>uploadDir.mkdir();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<FileItem> formItems = upload.parseRequest(request);<NEW_LINE>if (formItems != null && formItems.size() > 0) {<NEW_LINE>for (FileItem item : formItems) {<NEW_LINE>if (!item.isFormField()) {<NEW_LINE>String fileName = new File(item.getName()).getName();<NEW_LINE>String filePath = uploadPath + File.separator + fileName;<NEW_LINE>File storeFile = new File(filePath);<NEW_LINE>item.write(storeFile);<NEW_LINE>request.setAttribute("message", "File " + fileName + " has uploaded successfully!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>request.setAttribute("message", <MASK><NEW_LINE>}<NEW_LINE>getServletContext().getRequestDispatcher("/result.jsp").forward(request, response);<NEW_LINE>}<NEW_LINE>} | "There was an error: " + ex.getMessage()); |
1,588,917 | public void internalRun(T2 runContext) throws Exception {<NEW_LINE>WsdlTestCase testCase = getTestCase();<NEW_LINE>gotoStepIndex = -1;<NEW_LINE>testStepResults.clear();<NEW_LINE>// create state for testcase if specified<NEW_LINE>if (testCase.getKeepSession()) {<NEW_LINE>if (!(runContext.getProperty(SubmitContext.HTTP_STATE_PROPERTY) instanceof BasicHttpContext)) {<NEW_LINE>runContext.setProperty(SubmitContext.HTTP_STATE_PROPERTY, HttpClientSupport.createEmptyContext());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>runContext.setProperty(SubmitContext.HTTP_STATE_PROPERTY, null);<NEW_LINE>}<NEW_LINE>fillInTestRunnableListeners();<NEW_LINE>runSetupScripts(runContext);<NEW_LINE>if (!isRunning()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (testCase.getTimeout() > 0) {<NEW_LINE>startTimeoutTimer(testCase.getTimeout());<NEW_LINE>}<NEW_LINE>notifyBeforeRun();<NEW_LINE>if (!isRunning()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>initCount = getStartStep();<NEW_LINE>setStartTime();<NEW_LINE>for (; initCount < testCase.getTestStepCount() && isRunning(); initCount++) {<NEW_LINE>WsdlTestStep testStep = testCase.getTestStepAt(initCount);<NEW_LINE>if (testStep.isDisabled()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>setStatus(Status.FAILED);<NEW_LINE>SoapUI.logError(e);<NEW_LINE>throw new Exception("Failed to prepare testStep [" + testStep.getName() + "]; " + e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int currentStepIndex = startStep;<NEW_LINE>runContext.setCurrentStep(currentStepIndex);<NEW_LINE>for (; isRunning() && currentStepIndex < testCase.getTestStepCount(); currentStepIndex++) {<NEW_LINE>if ((currentStepIndex = runCurrentTestStep(runContext, currentStepIndex)) == -2) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>failTestRunnableOnErrors(runContext);<NEW_LINE>preserveContext(getRunContext());<NEW_LINE>} | testStep.prepare(this, runContext); |
1,644,051 | public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) {<NEW_LINE>super.onDataReceived(device, data);<NEW_LINE>if (data.size() < 5) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int offset = 0;<NEW_LINE>final int flags = data.getIntValue(Data.FORMAT_UINT8, offset);<NEW_LINE>final int unit = (flags & 0x01) == UNIT_C ? UNIT_C : UNIT_F;<NEW_LINE>final boolean timestampPresent = (flags & 0x02) != 0;<NEW_LINE>final boolean temperatureTypePresent = (flags & 0x04) != 0;<NEW_LINE>offset += 1;<NEW_LINE>if (data.size() < 5 + (timestampPresent ? 7 : 0) + (temperatureTypePresent ? 1 : 0)) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final float temperature = data.getFloatValue(Data.FORMAT_FLOAT, 1);<NEW_LINE>offset += 4;<NEW_LINE>Calendar calendar = null;<NEW_LINE>if (timestampPresent) {<NEW_LINE>calendar = DateTimeDataCallback.readDateTime(data, offset);<NEW_LINE>offset += 7;<NEW_LINE>}<NEW_LINE>Integer type = null;<NEW_LINE>if (temperatureTypePresent) {<NEW_LINE>type = data.getIntValue(Data.FORMAT_UINT8, offset);<NEW_LINE>// offset += 1;<NEW_LINE>}<NEW_LINE>onTemperatureMeasurementReceived(device, <MASK><NEW_LINE>} | temperature, unit, calendar, type); |
904,980 | public Object newInstance(final Class<?> type) {<NEW_LINE>ErrorWritingException ex = null;<NEW_LINE>if (type == void.class || type == Void.class) {<NEW_LINE>ex = new ConversionException("Security alert: Marshalling rejected");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>for (final Constructor<?> constructor : type.getDeclaredConstructors()) {<NEW_LINE>if (constructor.getParameterTypes().length == 0) {<NEW_LINE>if (!constructor.isAccessible()) {<NEW_LINE>constructor.setAccessible(true);<NEW_LINE>}<NEW_LINE>return constructor.newInstance(new Object[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Serializable.class.isAssignableFrom(type)) {<NEW_LINE>return instantiateUsingSerialization(type);<NEW_LINE>} else {<NEW_LINE>ex = new ObjectAccessException("Cannot construct type as it does not have a no-args constructor");<NEW_LINE>}<NEW_LINE>} catch (final InstantiationException | IllegalAccessException e) {<NEW_LINE>ex = new ObjectAccessException("Cannot construct type", e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>if (e.getTargetException() instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) e.getTargetException();<NEW_LINE>} else if (e.getTargetException() instanceof Error) {<NEW_LINE>throw (Error) e.getTargetException();<NEW_LINE>} else {<NEW_LINE>ex = new ObjectAccessException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ex.add("construction-type", type.getName());<NEW_LINE>throw ex;<NEW_LINE>} | "Constructor for type threw an exception", e.getTargetException()); |
923,737 | private ListenableFuture<?> rollupHistogramFromRows(RollupParams rollup, AggregateQuery query, Iterable<Row> rows, ScratchBuffer scratchBuffer) throws Exception {<NEW_LINE>double totalDurationNanos = 0;<NEW_LINE>long transactionCount = 0;<NEW_LINE>LazyHistogram durationNanosHistogram = new LazyHistogram();<NEW_LINE>for (Row row : rows) {<NEW_LINE>int i = 0;<NEW_LINE>totalDurationNanos += row.getDouble(i++);<NEW_LINE>transactionCount += row.getLong(i++);<NEW_LINE>ByteBuffer bytes = checkNotNull(row.getBytes(i++));<NEW_LINE>durationNanosHistogram.merge(Aggregate.Histogram.parseFrom(bytes));<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement;<NEW_LINE>if (query.transactionName() == null) {<NEW_LINE>boundStatement = getInsertOverallPS(histogramTable, rollup.rollupLevel()).bind();<NEW_LINE>} else {<NEW_LINE>boundStatement = getInsertTransactionPS(histogramTable, rollup.rollupLevel()).bind();<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, rollup.agentRollupId());<NEW_LINE>boundStatement.setString(i++, query.transactionType());<NEW_LINE>if (query.transactionName() != null) {<NEW_LINE>boundStatement.setString(i<MASK><NEW_LINE>}<NEW_LINE>boundStatement.setTimestamp(i++, new Date(query.to()));<NEW_LINE>boundStatement.setDouble(i++, totalDurationNanos);<NEW_LINE>boundStatement.setLong(i++, transactionCount);<NEW_LINE>boundStatement.setBytes(i++, toByteBuffer(durationNanosHistogram.toProto(scratchBuffer)));<NEW_LINE>boundStatement.setInt(i++, rollup.adjustedTTL().generalTTL());<NEW_LINE>return session.writeAsync(boundStatement);<NEW_LINE>} | ++, query.transactionName()); |
1,006,841 | private Schema avroType(com.google.cloud.teleport.spanner.common.Type spannerType) {<NEW_LINE>switch(spannerType.getCode()) {<NEW_LINE>case BOOL:<NEW_LINE>return SchemaBuilder.builder().booleanType();<NEW_LINE>case INT64:<NEW_LINE>return SchemaBuilder.builder().longType();<NEW_LINE>case FLOAT64:<NEW_LINE>return SchemaBuilder.builder().doubleType();<NEW_LINE>case STRING:<NEW_LINE>case DATE:<NEW_LINE>case JSON:<NEW_LINE>return SchemaBuilder.builder().stringType();<NEW_LINE>case BYTES:<NEW_LINE>return SchemaBuilder.builder().bytesType();<NEW_LINE>case TIMESTAMP:<NEW_LINE>return shouldExportTimestampAsLogicalType ? LogicalTypes.timestampMicros().addToSchema(SchemaBuilder.builder().longType()) : SchemaBuilder.builder().stringType();<NEW_LINE>case NUMERIC:<NEW_LINE>return LogicalTypes.decimal(NumericUtils.PRECISION, NumericUtils.SCALE).addToSchema(SchemaBuilder.builder().bytesType());<NEW_LINE>case ARRAY:<NEW_LINE>Schema avroItemsType = avroType(spannerType.getArrayElementType());<NEW_LINE>return SchemaBuilder.builder().array().items().type(wrapAsNullable(avroItemsType));<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new IllegalArgumentException("Unknown spanner type " + spannerType); |
1,375,843 | final ListModelExplainabilityJobDefinitionsResult executeListModelExplainabilityJobDefinitions(ListModelExplainabilityJobDefinitionsRequest listModelExplainabilityJobDefinitionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listModelExplainabilityJobDefinitionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListModelExplainabilityJobDefinitionsRequest> request = null;<NEW_LINE>Response<ListModelExplainabilityJobDefinitionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListModelExplainabilityJobDefinitionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listModelExplainabilityJobDefinitionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListModelExplainabilityJobDefinitions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListModelExplainabilityJobDefinitionsResult>> 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 ListModelExplainabilityJobDefinitionsResultJsonUnmarshaller()); |
75,154 | public OrderableClusterOption unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>OrderableClusterOption orderableClusterOption = new OrderableClusterOption();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 3;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return orderableClusterOption;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ClusterVersion", targetDepth)) {<NEW_LINE>orderableClusterOption.setClusterVersion(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ClusterType", targetDepth)) {<NEW_LINE>orderableClusterOption.setClusterType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("NodeType", targetDepth)) {<NEW_LINE>orderableClusterOption.setNodeType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("AvailabilityZones", targetDepth)) {<NEW_LINE>orderableClusterOption.withAvailabilityZones(new ArrayList<AvailabilityZone>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("AvailabilityZones/AvailabilityZone", targetDepth)) {<NEW_LINE>orderableClusterOption.withAvailabilityZones(AvailabilityZoneStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return orderableClusterOption;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
567,012 | public void saveSchemeIdsForContentType(final ContentType contentType, final Set<String> schemesIds) throws DotDataException {<NEW_LINE>try {<NEW_LINE>Logger.info(WorkflowAPIImpl.class, String.format("Saving Schemas [ %s ] for Content type '%s'", String.join(",", schemesIds), contentType.inode()));<NEW_LINE>SecurityLogger.logInfo(this.getClass(), () -> String.format("Saving Schemas [ %s ] for Content type '%s'", String.join(",", schemesIds), contentType.inode()));<NEW_LINE>workFlowFactory.saveSchemeIdsForContentType(contentType.inode(), schemesIds.stream().map(this::getLongIdForScheme).collect(Collectors.toSet()), this::consumeWorkflowTask);<NEW_LINE>if (schemesIds.isEmpty()) {<NEW_LINE>contentTypeAPI.updateModDate(contentType);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (final DotDataException | DotSecurityException e) {<NEW_LINE>Logger.error(WorkflowAPIImpl.class, String.format("Error saving Schemas [ %s ] for Content Type '%s': %s", String.join(",", schemesIds), contentType.inode(), e.getMessage()));<NEW_LINE>}<NEW_LINE>} | this.cleanInvalidDefaultActionForContentType(contentType, schemesIds); |
1,234,131 | public com.amazonaws.services.organizations.model.SourceParentNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.organizations.model.SourceParentNotFoundException sourceParentNotFoundException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return sourceParentNotFoundException;<NEW_LINE>} | organizations.model.SourceParentNotFoundException(null); |
1,345,725 | public Optional<PromoCodeDiscount> handleDynamicDiscount(Event event, Map<Integer, Long> quantityByCategory, String reservationId) {<NEW_LINE>try {<NEW_LINE>var values = new HashMap<String, Object>();<NEW_LINE><MASK><NEW_LINE>values.put(RESERVATION_ID, reservationId);<NEW_LINE>var dynamicDiscountResult = syncCall(ExtensionEvent.DYNAMIC_DISCOUNT_APPLICATION, event, values, DynamicDiscount.class);<NEW_LINE>if (dynamicDiscountResult == null || dynamicDiscountResult.getDiscountType() == PromoCodeDiscount.DiscountType.NONE) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>var now = ZonedDateTime.now(ClockProvider.clock());<NEW_LINE>// dynamic discount is supposed to return a formatted amount in the event's currency<NEW_LINE>var discountAmount = new BigDecimal(dynamicDiscountResult.getAmount());<NEW_LINE>int discountAmountInCents = dynamicDiscountResult.getDiscountType() == PERCENTAGE ? discountAmount.intValue() : MonetaryUtil.unitToCents(discountAmount, event.getCurrency());<NEW_LINE>return Optional.of(new PromoCodeDiscount(Integer.MIN_VALUE, dynamicDiscountResult.getCode(), event.getId(), event.getOrganizationId(), now.minusSeconds(1), event.getBegin().withZoneSameInstant(now.getZone()), discountAmountInCents, dynamicDiscountResult.getDiscountType(), null, null, null, null, CodeType.DYNAMIC, null, event.getCurrency()));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.warn("got exception while firing DYNAMIC_DISCOUNT_APPLICATION event", ex);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | values.put("quantityByCategory", quantityByCategory); |
480,066 | private void fillPicks() {<NEW_LINE>// Price List<NEW_LINE>String sql = "SELECT M_PriceList_Version.M_PriceList_Version_ID," + " M_PriceList_Version.Name || ' (' || c.Iso_Code || ')' AS ValueName " + "FROM M_PriceList_Version, M_PriceList pl, C_Currency c " + "WHERE M_PriceList_Version.M_PriceList_ID=pl.M_PriceList_ID" + " AND pl.C_Currency_ID=c.C_Currency_ID" + " AND M_PriceList_Version.IsActive='Y' AND pl.IsActive='Y'";<NEW_LINE>// Add Access & Order<NEW_LINE>// fully qualidfied - RO<NEW_LINE>sql = MRole.getDefault().addAccessSQL(sql, "M_PriceList_Version", true, false) + " ORDER BY M_PriceList_Version.Name";<NEW_LINE>try {<NEW_LINE>pickPriceList.addItem(new KeyNamePair(0, ""));<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair kn = new KeyNamePair(rs.getInt(1), rs.getString(2));<NEW_LINE>pickPriceList.addItem(kn);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>// Warehouse<NEW_LINE>sql = "SELECT M_Warehouse_ID, Value || ' - ' || Name AS ValueName " + "FROM M_Warehouse " + "WHERE IsActive='Y'";<NEW_LINE>sql = MRole.getDefault().addAccessSQL(sql, "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO) + " ORDER BY Value";<NEW_LINE>pickWarehouse.addItem(new KeyNamePair(0, ""));<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>KeyNamePair kn = new KeyNamePair(rs.getInt("M_Warehouse_ID"), rs.getString("ValueName"));<NEW_LINE>pickWarehouse.addItem(kn);<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(<MASK><NEW_LINE>}<NEW_LINE>} | Level.SEVERE, sql, e); |
308,886 | public Map<String, Object> perform() {<NEW_LINE>// Keeps a list of users<NEW_LINE>ArrayList<Map<String, String>> list = null;<NEW_LINE>// Keeps the objects in container needed by the Ajax proxy (client-side)<NEW_LINE>Map<String, Object> results = new HashMap<String, Object>(2);<NEW_LINE>// Keeps the grand total of items<NEW_LINE>int totalItemCount = 0;<NEW_LINE>// (No. of users)<NEW_LINE>List<User> users = null;<NEW_LINE>int realUserCount = 0;<NEW_LINE>// Step 1. Retrieve users, beginning from "start" parameter, up to a number of "limit" items, filtered by "filter" parameter.<NEW_LINE>try {<NEW_LINE>totalItemCount = getUserCount();<NEW_LINE>if (start < totalItemCount) {<NEW_LINE>users = getUsers();<NEW_LINE>realUserCount = users.size();<NEW_LINE>}<NEW_LINE>// Step 2. Assemble all of this information into an appropriate container to the view<NEW_LINE>if (users != null) {<NEW_LINE>int pageSize = realUserCount;<NEW_LINE>list = new ArrayList<Map<String, String>>(pageSize);<NEW_LINE>for (User aUser : users) {<NEW_LINE>Map<String, String> aRecord = new HashMap<String, String>();<NEW_LINE>String fullName = aUser.getFullName();<NEW_LINE>fullName = (UtilMethods.isSet(fullName) ? fullName : " ");<NEW_LINE>String emailAddress = aUser.getEmailAddress();<NEW_LINE>emailAddress = (UtilMethods.isSet(emailAddress) ? emailAddress : " ");<NEW_LINE>aRecord.put("id", aUser.getUserId());<NEW_LINE>aRecord.put("type", USER_TYPE_VALUE);<NEW_LINE>aRecord.put("name", fullName);<NEW_LINE>aRecord.put("emailaddress", emailAddress);<NEW_LINE>list.add(aRecord);<NEW_LINE>}<NEW_LINE>} else // No users retrieved. So create an empty list.<NEW_LINE>{<NEW_LINE>list = new ArrayList<Map<String, String>>(0);<NEW_LINE>}<NEW_LINE>// end if<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Logger.warn(UserAjax.class, "::processUsersList -> Could not process list of users.");<NEW_LINE>list = new ArrayList<Map<<MASK><NEW_LINE>}<NEW_LINE>results.put("data", list);<NEW_LINE>results.put("total", totalItemCount);<NEW_LINE>return results;<NEW_LINE>} | String, String>>(0); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.