idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,702,813 | public static void expandTemplate(@Nonnull String key, @Nonnull CustomTemplateCallback callback, @Nonnull Editor editor, @Nonnull PostfixTemplateProvider provider, @Nonnull PostfixTemplate postfixTemplate) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>FeatureUsageTracker.getInstance().triggerFeatureUsed("editing.completion.postfix");<NEW_LINE>final PsiFile file = callback<MASK><NEW_LINE>if (isApplicableTemplate(provider, key, file, editor, postfixTemplate)) {<NEW_LINE>int offset = deleteTemplateKey(file, editor, key);<NEW_LINE>try {<NEW_LINE>provider.preExpand(file, editor);<NEW_LINE>PsiElement context = CustomTemplateCallback.getContext(file, positiveOffset(offset));<NEW_LINE>expandTemplate(postfixTemplate, editor, context);<NEW_LINE>} finally {<NEW_LINE>provider.afterExpand(file, editor);<NEW_LINE>}<NEW_LINE>} else // don't care about errors in multiCaret mode<NEW_LINE>if (editor.getCaretModel().getAllCarets().size() == 1) {<NEW_LINE>LOG.error("Template not found by key: " + key + "; offset = " + callback.getOffset(), AttachmentFactory.createAttachment(callback.getFile().getVirtualFile()));<NEW_LINE>}<NEW_LINE>} | .getContext().getContainingFile(); |
403,724 | public static byte[] shiftLeft(byte[] byteArray, int shiftBitCount) {<NEW_LINE>// Code taken from the Apache 2 licensed library<NEW_LINE>// https://github.com/patrickfav/bytes-java/blob/master/src/main/java/at/favre/lib/bytes/Util.java<NEW_LINE>final int shiftMod = shiftBitCount % 8;<NEW_LINE>final byte carryMask = (byte) ((1 << shiftMod) - 1);<NEW_LINE>final <MASK><NEW_LINE>int sourceIndex;<NEW_LINE>for (int i = 0; i < byteArray.length; i++) {<NEW_LINE>sourceIndex = i + offsetBytes;<NEW_LINE>if (sourceIndex >= byteArray.length) {<NEW_LINE>byteArray[i] = 0;<NEW_LINE>} else {<NEW_LINE>byte src = byteArray[sourceIndex];<NEW_LINE>byte dst = (byte) (src << shiftMod);<NEW_LINE>if (sourceIndex + 1 < byteArray.length) {<NEW_LINE>dst |= byteArray[sourceIndex + 1] >>> (8 - shiftMod) & carryMask;<NEW_LINE>}<NEW_LINE>byteArray[i] = dst;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return byteArray;<NEW_LINE>} | int offsetBytes = (shiftBitCount / 8); |
1,346,273 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>customizer = new javax.swing.JPanel();<NEW_LINE>resizingCheckBox = new javax.swing.JCheckBox();<NEW_LINE>reorderingCheckBox = new javax.swing.JCheckBox();<NEW_LINE>FormListener formListener = new FormListener();<NEW_LINE>// NOI18N<NEW_LINE>resizingCheckBox.setText(org.openide.util.NbBundle.getMessage(JTableHeaderEditor.class, "TableHeaderEditor_Resizing"));<NEW_LINE>resizingCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>resizingCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));<NEW_LINE>resizingCheckBox.addActionListener(formListener);<NEW_LINE>// NOI18N<NEW_LINE>reorderingCheckBox.setText(org.openide.util.NbBundle.getMessage(JTableHeaderEditor.class, "TableHeaderEditor_Reordering"));<NEW_LINE>reorderingCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>reorderingCheckBox.setMargin(new java.awt.Insets(0<MASK><NEW_LINE>reorderingCheckBox.addActionListener(formListener);<NEW_LINE>javax.swing.GroupLayout customizerLayout = new javax.swing.GroupLayout(customizer);<NEW_LINE>customizer.setLayout(customizerLayout);<NEW_LINE>customizerLayout.setHorizontalGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(customizerLayout.createSequentialGroup().addContainerGap().addGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(resizingCheckBox).addComponent(reorderingCheckBox)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>customizerLayout.setVerticalGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(customizerLayout.createSequentialGroup().addContainerGap().addComponent(resizingCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(reorderingCheckBox).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>} | , 0, 0, 0)); |
121,567 | protected DBTraceInstruction doCreate(Range<Long> lifespan, Address address, InstructionPrototype prototype, ProcessorContextView context) throws CodeUnitInsertionException, AddressOverflowException {<NEW_LINE>Address endAddress = address.addNoWrap(prototype.getLength() - 1);<NEW_LINE>AddressRangeImpl createdRange <MASK><NEW_LINE>// First, truncate lifespan to the next unit in the range, if end is unbounded<NEW_LINE>if (!lifespan.hasUpperBound()) {<NEW_LINE>lifespan = space.instructions.truncateSoonestDefined(lifespan, createdRange);<NEW_LINE>lifespan = space.definedData.truncateSoonestDefined(lifespan, createdRange);<NEW_LINE>}<NEW_LINE>// Second, truncate lifespan to the next change of bytes in the range<NEW_LINE>// Then, check that against existing code units.<NEW_LINE>DBTraceMemorySpace memSpace = space.trace.getMemoryManager().getMemorySpace(space.space, true);<NEW_LINE>long endSnap = memSpace.getFirstChange(lifespan, createdRange);<NEW_LINE>if (endSnap == Long.MIN_VALUE) {<NEW_LINE>endSnap = DBTraceUtils.upperEndpoint(lifespan);<NEW_LINE>} else {<NEW_LINE>endSnap--;<NEW_LINE>}<NEW_LINE>TraceAddressSnapRange tasr = new ImmutableTraceAddressSnapRange(createdRange, DBTraceUtils.toRange(DBTraceUtils.lowerEndpoint(lifespan), endSnap));<NEW_LINE>if (!space.undefinedData.coversRange(tasr)) {<NEW_LINE>// TODO: Figure out the conflicting unit or snap boundary?<NEW_LINE>throw new CodeUnitInsertionException("Code units cannot overlap");<NEW_LINE>}<NEW_LINE>doSetContexts(tasr, prototype.getLanguage(), context);<NEW_LINE>DBTraceInstruction created = space.instructionMapSpace.put(tasr, null);<NEW_LINE>created.set(prototype, context);<NEW_LINE>cacheForContaining.notifyNewEntry(lifespan, createdRange, created);<NEW_LINE>cacheForSequence.notifyNewEntry(lifespan, createdRange, created);<NEW_LINE>space.undefinedData.invalidateCache();<NEW_LINE>// TODO: Save the context register into the context manager? Flow it?<NEW_LINE>// TODO: Ensure cached undefineds don't extend into defined stuff<NEW_LINE>// TODO: Explicitly remove undefined from cache, or let weak refs take care of it?<NEW_LINE>return created;<NEW_LINE>} | = new AddressRangeImpl(address, endAddress); |
126,197 | public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>System.out.println("Input :");<NEW_LINE>System.out.println("Enter the row size");<NEW_LINE>int row = sc.nextInt();<NEW_LINE>System.out.println("Enter the column size");<NEW_LINE>int colmn = sc.nextInt();<NEW_LINE>int[][] sparseMatrix = new int[row][colmn];<NEW_LINE>System.out.println("Enter the element of 2-D matrix");<NEW_LINE>for (int loop = 0; loop < row; loop++) {<NEW_LINE>for (int inloop = 0; inloop < colmn; inloop++) {<NEW_LINE>sparseMatrix[loop][inloop] = sc.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>for (int loop = 0; loop < row; loop++) {<NEW_LINE>for (int inloop = 0; inloop < colmn; inloop++) {<NEW_LINE>if (sparseMatrix[loop][inloop] != 0) {<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[][] tripletMatrix = new int[count][3];<NEW_LINE>int index = 0;<NEW_LINE>for (int loop = 0; loop < row; loop++) {<NEW_LINE>for (int inloop = 0; inloop < colmn; inloop++) {<NEW_LINE>if (sparseMatrix[loop][inloop] != 0) {<NEW_LINE>tripletMatrix[index][0] = loop;<NEW_LINE>tripletMatrix[index][1] = inloop;<NEW_LINE>tripletMatrix[index][2] = sparseMatrix[loop][inloop];<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Output :");<NEW_LINE>System.out.println("Triplet Matrix Representation :-");<NEW_LINE><MASK><NEW_LINE>for (int loop = 0; loop < count; loop++) {<NEW_LINE>for (int inloop = 0; inloop < 3; inloop++) {<NEW_LINE>System.out.print(tripletMatrix[loop][inloop]);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>} | System.out.println("rows columns values"); |
104,034 | private void initInputMethodHandling() {<NEW_LINE>if (Platform.isSupported(ConditionalFeature.INPUT_METHOD)) {<NEW_LINE>setOnInputMethodTextChanged<MASK><NEW_LINE>// Both of these have to be set for input composition to work !<NEW_LINE>setInputMethodRequests(new InputMethodRequests() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Point2D getTextLocation(int offset) {<NEW_LINE>return getCaretBounds().or(() -> getCharacterBoundsOnScreen(offset, offset)).map(cb -> new Point2D(cb.getMaxX() - 5, cb.getMaxY())).orElseGet(() -> new Point2D(10, 10));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getLocationOffset(int x, int y) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancelLatestCommittedText() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSelectedText() {<NEW_LINE>return getSelectedText();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | (event -> handleInputMethodEvent(event)); |
561,647 | private Video createPinnedPlaylist(Video video) {<NEW_LINE>if (video == null || !video.hasPlaylist()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Video section = new Video();<NEW_LINE>section.itemType = video.itemType;<NEW_LINE>section.playlistId = video.playlistId;<NEW_LINE>section.playlistParams = video.playlistParams;<NEW_LINE>// Trying to properly format channel playlists, mixes etc<NEW_LINE>boolean isChannelPlaylistItem = video.getGroupTitle() != null && video.belongsToSameAuthorGroup() && video.belongsToSamePlaylistGroup();<NEW_LINE>boolean isUserPlaylistItem = video.getGroupTitle() != null && video.belongsToSamePlaylistGroup();<NEW_LINE>String title = isChannelPlaylistItem ? video.extractAuthor() <MASK><NEW_LINE>String subtitle = isChannelPlaylistItem || isUserPlaylistItem ? video.getGroupTitle() : video.extractAuthor();<NEW_LINE>section.title = title != null && subtitle != null ? String.format("%s - %s", title, subtitle) : String.format("%s", title != null ? title : subtitle);<NEW_LINE>section.cardImageUrl = video.cardImageUrl;<NEW_LINE>return section;<NEW_LINE>} | : isUserPlaylistItem ? null : video.title; |
242,721 | public UpdatePlaceIndexResult updatePlaceIndex(UpdatePlaceIndexRequest updatePlaceIndexRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePlaceIndexRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdatePlaceIndexRequest> request = null;<NEW_LINE>Response<UpdatePlaceIndexResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePlaceIndexRequestMarshaller().marshall(updatePlaceIndexRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdatePlaceIndexResult, JsonUnmarshallerContext> unmarshaller = new UpdatePlaceIndexResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdatePlaceIndexResult> responseHandler = new JsonResponseHandler<UpdatePlaceIndexResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
146,074 | protected QuantileResult expectedShortfall(double level, DoubleArray sample) {<NEW_LINE>ArgChecker.isTrue(level > 0, "Quantile should be above 0.");<NEW_LINE>ArgChecker.isTrue(level < 1, "Quantile should be below 1.");<NEW_LINE>int sampleSize = sampleCorrection(sample.size());<NEW_LINE>double fractionalIndex = level * sampleSize + indexCorrection();<NEW_LINE>double adjustedLevel = checkIndex(fractionalIndex, sample.size(), true);<NEW_LINE>double[] order = createIndexArray(sample.size());<NEW_LINE>double[] s = sample.toArray();<NEW_LINE>DoubleArrayMath.sortPairs(s, order);<NEW_LINE>int lowerIndex = (int) Math.floor(adjustedLevel);<NEW_LINE>int upperIndex = (int) Math.ceil(adjustedLevel);<NEW_LINE>int[] indices = new int[upperIndex];<NEW_LINE>double[] weights = new double[upperIndex];<NEW_LINE>double interval = 1d / (double) sampleSize;<NEW_LINE>weights[0] = interval * (Math.min(fractionalIndex, 1d) - indexCorrection());<NEW_LINE>double losses = s[0] * weights[0];<NEW_LINE>for (int i = 0; i < lowerIndex - 1; i++) {<NEW_LINE>losses += 0.5 * (s[i] + s[i + 1]) * interval;<NEW_LINE>indices[i] = (int) order[i];<NEW_LINE><MASK><NEW_LINE>weights[i + 1] += 0.5 * interval;<NEW_LINE>}<NEW_LINE>if (lowerIndex != upperIndex) {<NEW_LINE>double lowerWeight = upperIndex - adjustedLevel;<NEW_LINE>double upperWeight = 1d - lowerWeight;<NEW_LINE>double quantile = lowerWeight * s[lowerIndex - 1] + upperWeight * s[upperIndex - 1];<NEW_LINE>losses += 0.5 * (s[lowerIndex - 1] + quantile) * interval * upperWeight;<NEW_LINE>indices[lowerIndex - 1] = (int) order[lowerIndex - 1];<NEW_LINE>indices[upperIndex - 1] = (int) order[upperIndex - 1];<NEW_LINE>weights[lowerIndex - 1] += 0.5 * (1d + lowerWeight) * interval * upperWeight;<NEW_LINE>weights[upperIndex - 1] = 0.5 * upperWeight * interval * upperWeight;<NEW_LINE>}<NEW_LINE>if (fractionalIndex > sample.size()) {<NEW_LINE>losses += s[sample.size() - 1] * (fractionalIndex - sample.size()) * interval;<NEW_LINE>indices[sample.size() - 1] = (int) order[sample.size() - 1];<NEW_LINE>weights[sample.size() - 1] += (fractionalIndex - sample.size()) * interval;<NEW_LINE>}<NEW_LINE>return QuantileResult.of(losses / level, indices, DoubleArray.ofUnsafe(weights).dividedBy(level));<NEW_LINE>} | weights[i] += 0.5 * interval; |
896,154 | public void write(AwtImage image, ImageMetadata metadata, OutputStream out) throws IOException {<NEW_LINE>if (image.awt().getType() == BufferedImage.TYPE_INT_ARGB) {<NEW_LINE>ImageInfo imi = new ImageInfo(image.width, image.height, 8, true);<NEW_LINE>ar.com.hjg.pngj.PngWriter writer = new ar.com.hjg.pngj.PngWriter(out, imi);<NEW_LINE>writer.setCompLevel(compressionLevel);<NEW_LINE>writer.setFilterType(FilterType.FILTER_DEFAULT);<NEW_LINE>DataBufferInt db = (DataBufferInt) image.awt().getRaster().getDataBuffer();<NEW_LINE>if (db.getNumBanks() != 1)<NEW_LINE>throw new RuntimeException("This method expects one bank");<NEW_LINE>SinglePixelPackedSampleModel samplemodel = (SinglePixelPackedSampleModel) image.awt().getSampleModel();<NEW_LINE>ImageLineInt line = new ImageLineInt(imi);<NEW_LINE>int[] dbbuf = db.getData();<NEW_LINE>for (int row = 0; row < imi.rows; row++) {<NEW_LINE>int elem = samplemodel.getOffset(0, row);<NEW_LINE>int j = 0;<NEW_LINE>for (int col = 0; col < imi.cols; col++) {<NEW_LINE>int sample = dbbuf[elem];<NEW_LINE>elem = elem + 1;<NEW_LINE>// R<NEW_LINE>line.getScanline()[j] = (sample & 0xFF0000) >> 16;<NEW_LINE>j = j + 1;<NEW_LINE>// G<NEW_LINE>line.getScanline()[j] = (sample & 0xFF00) >> 8;<NEW_LINE>j = j + 1;<NEW_LINE>// B<NEW_LINE>line.getScanline(<MASK><NEW_LINE>j = j + 1;<NEW_LINE>// A<NEW_LINE>line.getScanline()[j] = ((sample & 0xFF000000) >> 24) & 0xFF;<NEW_LINE>j = j + 1;<NEW_LINE>}<NEW_LINE>writer.writeRow(line, row);<NEW_LINE>}<NEW_LINE>// end calls close<NEW_LINE>writer.end();<NEW_LINE>} else {<NEW_LINE>ImageIO.write(image.awt(), "png", out);<NEW_LINE>}<NEW_LINE>} | )[j] = sample & 0xFF; |
640,995 | final DescribeModelPackagingJobResult executeDescribeModelPackagingJob(DescribeModelPackagingJobRequest describeModelPackagingJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeModelPackagingJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeModelPackagingJobRequest> request = null;<NEW_LINE>Response<DescribeModelPackagingJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeModelPackagingJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeModelPackagingJobRequest));<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, "LookoutVision");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeModelPackagingJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeModelPackagingJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeModelPackagingJob"); |
1,830,183 | public Request<DeleteAnalysisSchemeRequest> marshall(DeleteAnalysisSchemeRequest deleteAnalysisSchemeRequest) {<NEW_LINE>if (deleteAnalysisSchemeRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DeleteAnalysisSchemeRequest> request = new DefaultRequest<DeleteAnalysisSchemeRequest>(deleteAnalysisSchemeRequest, "AmazonCloudSearchv2");<NEW_LINE>request.addParameter("Action", "DeleteAnalysisScheme");<NEW_LINE>request.addParameter("Version", "2013-01-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (deleteAnalysisSchemeRequest.getDomainName() != null) {<NEW_LINE>request.addParameter("DomainName", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (deleteAnalysisSchemeRequest.getAnalysisSchemeName() != null) {<NEW_LINE>request.addParameter("AnalysisSchemeName", StringUtils.fromString(deleteAnalysisSchemeRequest.getAnalysisSchemeName()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (deleteAnalysisSchemeRequest.getDomainName())); |
113,193 | private void readField(BytesRef type, FieldInfo fieldInfo, StoredFieldVisitor visitor) throws IOException {<NEW_LINE>readLine();<NEW_LINE>assert StringHelper.startsWith(scratch.get(), VALUE);<NEW_LINE>if (type == TYPE_STRING) {<NEW_LINE>byte[] bytes = new byte[scratch.length() - VALUE.length];<NEW_LINE>System.arraycopy(scratch.bytes(), VALUE.length, bytes, 0, bytes.length);<NEW_LINE>visitor.stringField(fieldInfo, new String(bytes, 0, bytes.length, StandardCharsets.UTF_8));<NEW_LINE>} else if (type == TYPE_BINARY) {<NEW_LINE>byte[] copy = new byte[scratch.length() - VALUE.length];<NEW_LINE>System.arraycopy(scratch.bytes(), VALUE.length, copy, 0, copy.length);<NEW_LINE>visitor.binaryField(fieldInfo, copy);<NEW_LINE>} else if (type == TYPE_INT) {<NEW_LINE>scratchUTF16.copyUTF8Bytes(scratch.bytes(), VALUE.length, scratch.length() - VALUE.length);<NEW_LINE>visitor.intField(fieldInfo, Integer.parseInt<MASK><NEW_LINE>} else if (type == TYPE_LONG) {<NEW_LINE>scratchUTF16.copyUTF8Bytes(scratch.bytes(), VALUE.length, scratch.length() - VALUE.length);<NEW_LINE>visitor.longField(fieldInfo, Long.parseLong(scratchUTF16.toString()));<NEW_LINE>} else if (type == TYPE_FLOAT) {<NEW_LINE>scratchUTF16.copyUTF8Bytes(scratch.bytes(), VALUE.length, scratch.length() - VALUE.length);<NEW_LINE>visitor.floatField(fieldInfo, Float.parseFloat(scratchUTF16.toString()));<NEW_LINE>} else if (type == TYPE_DOUBLE) {<NEW_LINE>scratchUTF16.copyUTF8Bytes(scratch.bytes(), VALUE.length, scratch.length() - VALUE.length);<NEW_LINE>visitor.doubleField(fieldInfo, Double.parseDouble(scratchUTF16.toString()));<NEW_LINE>}<NEW_LINE>} | (scratchUTF16.toString())); |
1,194,816 | private static CurveNode curveFraCurveNode(String conventionStr, String timeStr, String label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order) {<NEW_LINE>Matcher matcher = FRA_TIME_REGEX.matcher(timeStr.toUpperCase(Locale.ENGLISH));<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("Invalid time format for FRA: {}", timeStr));<NEW_LINE>}<NEW_LINE>Period periodToStart = Period.parse("P" + matcher<MASK><NEW_LINE>Period periodToEnd = Period.parse("P" + matcher.group(2) + "M");<NEW_LINE>FraConvention convention = FraConvention.of(conventionStr);<NEW_LINE>FraTemplate template = FraTemplate.of(periodToStart, periodToEnd, convention);<NEW_LINE>return FraCurveNode.builder().template(template).rateId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build();<NEW_LINE>} | .group(1) + "M"); |
301,318 | protected void filterFeeds() {<NEW_LINE>final String repository;<NEW_LINE>if (repositorySelector.getSelectedIndex() > -1) {<NEW_LINE>repository = repositorySelector.getSelectedItem().toString();<NEW_LINE>} else {<NEW_LINE>repository = ALL;<NEW_LINE>}<NEW_LINE>final String author;<NEW_LINE>if (authorSelector.getSelectedIndex() > -1) {<NEW_LINE>author = authorSelector.getSelectedItem().toString();<NEW_LINE>} else {<NEW_LINE>author = ALL;<NEW_LINE>}<NEW_LINE>if (repository.equals(ALL) && author.equals(ALL)) {<NEW_LINE>table.setRowSorter(defaultSorter);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int repositoryIndex = FeedEntryTableModel.Columns.Repository.ordinal();<NEW_LINE>final int authorIndex = FeedEntryTableModel.Columns.Author.ordinal();<NEW_LINE>RowFilter<FeedEntryTableModel, Object> containsFilter;<NEW_LINE>if (repository.equals(ALL)) {<NEW_LINE>// author filter<NEW_LINE>containsFilter = new RowFilter<FeedEntryTableModel, Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean include(Entry<? extends FeedEntryTableModel, ? extends Object> entry) {<NEW_LINE>return entry.getStringValue(authorIndex).equalsIgnoreCase(author);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (author.equals(ALL)) {<NEW_LINE>// repository filter<NEW_LINE>containsFilter = new RowFilter<FeedEntryTableModel, Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean include(Entry<? extends FeedEntryTableModel, ? extends Object> entry) {<NEW_LINE>return entry.getStringValue(repositoryIndex).equalsIgnoreCase(repository);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>// repository-author filter<NEW_LINE>containsFilter = new RowFilter<FeedEntryTableModel, Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean include(Entry<? extends FeedEntryTableModel, ? extends Object> entry) {<NEW_LINE>boolean authorMatch = entry.getStringValue(authorIndex).equalsIgnoreCase(author);<NEW_LINE>boolean repositoryMatch = entry.getStringValue<MASK><NEW_LINE>return authorMatch && repositoryMatch;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>TableRowSorter<FeedEntryTableModel> sorter = new TableRowSorter<FeedEntryTableModel>(tableModel);<NEW_LINE>sorter.setRowFilter(containsFilter);<NEW_LINE>table.setRowSorter(sorter);<NEW_LINE>} | (repositoryIndex).equalsIgnoreCase(repository); |
1,013,780 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String workId, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Work work = null;<NEW_LINE>Req req = new Req();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(workId, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>if (effectivePerson.isNotManager()) {<NEW_LINE>WoWorkControl workControl = business.getControl(<MASK><NEW_LINE>if (!workControl.getAllowProcessing()) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(wi.getAttachmentList())) {<NEW_LINE>for (WiAttachment w : wi.getAttachmentList()) {<NEW_LINE>Attachment o = emc.find(w.getId(), Attachment.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new ExceptionEntityNotExist(w.getId(), Attachment.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, o.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, o.getJob());<NEW_LINE>}<NEW_LINE>ReqAttachment q = new ReqAttachment();<NEW_LINE>q.setId(o.getId());<NEW_LINE>q.setName(w.getName());<NEW_LINE>q.setSite(w.getSite());<NEW_LINE>q.setSoftCopy(true);<NEW_LINE>req.getAttachmentList().add(q);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(req.getAttachmentList())) {<NEW_LINE>wos = ThisApplication.context().applications().postQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class, Applications.joinQueryUri("attachment", "copy", "work", work.getId()), req, work.getJob()).getDataAsList(Wo.class);<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>} | effectivePerson, work, WoWorkControl.class); |
657,273 | void applyChanges() {<NEW_LINE>if (!initialized)<NEW_LINE>return;<NEW_LINE>String antHome = tfAntHome.getText().trim();<NEW_LINE>AntSettings.<MASK><NEW_LINE>if (AntSettings.getAutoCloseTabs() != cbReuseOutput.isSelected()) {<NEW_LINE>AntSettings.setAutoCloseTabs(cbReuseOutput.isSelected());<NEW_LINE>}<NEW_LINE>if (AntSettings.getSaveAll() != cbSaveFiles.isSelected()) {<NEW_LINE>AntSettings.setSaveAll(cbSaveFiles.isSelected());<NEW_LINE>}<NEW_LINE>if (AntSettings.getAlwaysShowOutput() != cbAlwaysShowOutput.isSelected()) {<NEW_LINE>AntSettings.setAlwaysShowOutput(cbAlwaysShowOutput.isSelected());<NEW_LINE>}<NEW_LINE>if (AntSettings.getVerbosity() != cbVerbosity.getSelectedIndex() + 1) {<NEW_LINE>AntSettings.setVerbosity(cbVerbosity.getSelectedIndex() + 1);<NEW_LINE>}<NEW_LINE>if (!AntSettings.getProperties().equals(properties)) {<NEW_LINE>AntSettings.setProperties(properties);<NEW_LINE>}<NEW_LINE>if (!AntSettings.getExtraClasspath().equals(classpath)) {<NEW_LINE>AntSettings.setExtraClasspath(classpath);<NEW_LINE>}<NEW_LINE>changed = false;<NEW_LINE>} | setAntHome(new File(antHome)); |
888,540 | protected void handleMultiformPost(final HttpServletRequest req, final HttpServletResponse resp, final Map<String, Object> params, final Session session) throws ServletException, IOException {<NEW_LINE>// Looks like a duplicate, but this is a move away from the regular<NEW_LINE>// multiform post + redirect<NEW_LINE>// to a more ajax like command.<NEW_LINE>if (params.containsKey("ajax")) {<NEW_LINE>final String action = (String) params.get("ajax");<NEW_LINE>final HashMap<String, String> ret = new HashMap<>();<NEW_LINE>if (API_UPLOAD.equals(action)) {<NEW_LINE>ajaxHandleUpload(req, resp, ret, params, session);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else if (params.containsKey("action")) {<NEW_LINE>final String action = (String) params.get("action");<NEW_LINE>if (API_UPLOAD.equals(action)) {<NEW_LINE>handleUpload(req, resp, params, session);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.writeJSON(resp, ret); |
1,689,448 | public void showDownloadControls(boolean needToShow) {<NEW_LINE>// 2 modes:<NEW_LINE>// - only message;<NEW_LINE>// - message + download controls and buttons<NEW_LINE>this.panelGlobal.setVisible(true);<NEW_LINE>// stop button only for loading mode<NEW_LINE>this.buttonStop.setVisible(!needToShow);<NEW_LINE>this.tabsList.setVisible(needToShow);<NEW_LINE><MASK><NEW_LINE>// auto-size form<NEW_LINE>if (needToShow) {<NEW_LINE>this.setWindowSize(this.sizeModeMessageAndControls.width, this.sizeModeMessageAndControls.height);<NEW_LINE>} else {<NEW_LINE>this.setWindowSize(this.sizeModeMessageOnly.width, this.sizeModeMessageOnly.height);<NEW_LINE>}<NEW_LINE>this.makeWindowCentered();<NEW_LINE>// this.setLocationRelativeTo(null); // center screen //FIX<NEW_LINE>// icons on tabs left side<NEW_LINE>setTabTitle(0, "Standard download", "/buttons/card_panel.png");<NEW_LINE>setTabTitle(1, "Custom download", "/buttons/list_panel.png");<NEW_LINE>// TODO: add manual mode as tab<NEW_LINE>this.tabsList.getTabComponentAt(1).setEnabled(false);<NEW_LINE>this.tabsList.setEnabledAt(1, false);<NEW_LINE>} | this.panelCommands.setVisible(needToShow); |
1,403,110 | public void run(RegressionEnvironment env) {<NEW_LINE>MyUnmatchedListener listener = new MyUnmatchedListener();<NEW_LINE>env.eventService().setUnmatchedListener(listener);<NEW_LINE>// create insert into<NEW_LINE>env.compileDeploy("@name('s0') insert into MyEvent select theString from SupportBean");<NEW_LINE>// no statement, should be unmatched<NEW_LINE>sendEvent(env, "E1");<NEW_LINE>assertEquals(1, listener.getReceived().size());<NEW_LINE>assertEquals("E1", listener.getReceived().get(0).get("theString"));<NEW_LINE>listener.reset();<NEW_LINE>// stop insert into, now SupportBean itself is unmatched<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>SupportBean theEvent = sendEvent(env, "E2");<NEW_LINE>assertEquals(1, listener.getReceived().size());<NEW_LINE>assertSame(theEvent, listener.getReceived().get(0).getUnderlying());<NEW_LINE>listener.reset();<NEW_LINE>// start insert-into<NEW_LINE>sendEvent(env, "E3");<NEW_LINE>assertEquals(1, listener.<MASK><NEW_LINE>assertEquals("E3", listener.getReceived().get(0).get("theString"));<NEW_LINE>listener.reset();<NEW_LINE>} | getReceived().size()); |
983,137 | private ArrayList<LogChannel> collectChannels(long startingTxId, LogPosition minimalLogPosition, long minimalVersion, ClosedTransactionMetadata lastClosedTransaction) throws IOException {<NEW_LINE>var highestLogPosition = lastClosedTransaction.getLogPosition();<NEW_LINE>var highestTxId = lastClosedTransaction.getTransactionId();<NEW_LINE><MASK><NEW_LINE>int exposedChannels = (int) ((highestLogVersion - minimalVersion) + 1);<NEW_LINE>var channels = new ArrayList<LogChannel>(exposedChannels);<NEW_LINE>var internalChannels = LongObjectMaps.mutable.<StoreChannel>ofInitialCapacity(exposedChannels);<NEW_LINE>for (long version = minimalVersion; version <= highestLogVersion; version++) {<NEW_LINE>var startPositionTxId = logFileTransactionId(startingTxId, minimalVersion, version);<NEW_LINE>var readOnlyStoreChannel = new ReadOnlyStoreChannel(logFile, version);<NEW_LINE>if (version == minimalVersion) {<NEW_LINE>readOnlyStoreChannel.position(minimalLogPosition.getByteOffset());<NEW_LINE>}<NEW_LINE>internalChannels.put(version, readOnlyStoreChannel);<NEW_LINE>var endOffset = version < highestLogVersion ? readOnlyStoreChannel.size() : highestLogPosition.getByteOffset();<NEW_LINE>var lastTxId = version < highestLogVersion ? getHeaderLastCommittedTx(version + 1) : highestTxId;<NEW_LINE>channels.add(new LogChannel(startPositionTxId, readOnlyStoreChannel, endOffset, lastTxId));<NEW_LINE>}<NEW_LINE>logFile.registerExternalReaders(internalChannels);<NEW_LINE>return channels;<NEW_LINE>} | var highestLogVersion = highestLogPosition.getLogVersion(); |
1,281,737 | private void filterData() {<NEW_LINE>if (filter != null) {<NEW_LINE>invokeInEDT(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>final int oldSize = included.size();<NEW_LINE>final List<T> <MASK><NEW_LINE>for (T item : list) {<NEW_LINE>if (filter.accept(item)) {<NEW_LINE>newIncluded.add(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>included = newIncluded;<NEW_LINE>final int newSize = included.size();<NEW_LINE>fireContentsChanged(this, 0, Math.max(0, Math.min(oldSize - 1, newSize - 1)));<NEW_LINE>if (oldSize < newSize) {<NEW_LINE>fireIntervalAdded(this, oldSize, newSize - 1);<NEW_LINE>} else if (oldSize > newSize) {<NEW_LINE>fireIntervalRemoved(this, newSize, oldSize - 1);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | newIncluded = new ArrayList<>(); |
107,387 | public static boolean canAddTo(JMeterTreeNode parentNode, JMeterTreeNode[] nodes) {<NEW_LINE>if (parentNode == null || foundClass(nodes, new Class[] { TestPlan.class })) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TestElement parent = parentNode.getTestElement();<NEW_LINE>// Force TestFragment to only be pastable under a Test Plan<NEW_LINE>if (foundClass(nodes, new Class[] { TestFragmentController.class })) {<NEW_LINE>return parent instanceof TestPlan;<NEW_LINE>}<NEW_LINE>// Cannot move Non-Test Elements from root of Test Plan or Test Fragment<NEW_LINE>if (foundMenuCategories(nodes, NON_TEST_ELEMENTS) && !(parent instanceof TestPlan || parent instanceof TestFragmentController)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (parent instanceof TestPlan) {<NEW_LINE>List<Class<?>> samplerAndController = Arrays.asList(<MASK><NEW_LINE>List<Class<?>> exceptions = Arrays.asList(AbstractThreadGroup.class, NonTestElement.class);<NEW_LINE>return !foundClass(nodes, samplerAndController, exceptions);<NEW_LINE>}<NEW_LINE>// AbstractThreadGroup is only allowed under a TestPlan<NEW_LINE>if (foundClass(nodes, new Class[] { AbstractThreadGroup.class })) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Includes thread group; anything goes<NEW_LINE>if (parent instanceof Controller) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// No Samplers and Controllers<NEW_LINE>if (parent instanceof Sampler) {<NEW_LINE>return !foundClass(nodes, new Class[] { Sampler.class, Controller.class });<NEW_LINE>}<NEW_LINE>// All other<NEW_LINE>return false;<NEW_LINE>} | Sampler.class, Controller.class); |
1,449,326 | public void onBlockPlace(BlockPlaceEvent event) {<NEW_LINE>if (event instanceof BlockMultiPlaceEvent)<NEW_LINE>return;<NEW_LINE>BlockState previousState = event.getBlockReplacedState();<NEW_LINE>// Some blocks, like tall grass and fire, get replaced<NEW_LINE>if (previousState.getType() != Material.AIR && previousState.getType() != event.getBlockReplacedState().getType()) {<NEW_LINE>Events.fireToCancel(event, new BreakBlockEvent(event, create(event.getPlayer()), previousState.getLocation(), previousState.getType()));<NEW_LINE>}<NEW_LINE>if (!event.isCancelled()) {<NEW_LINE>ItemStack itemStack = new ItemStack(event.getBlockPlaced().getType(), 1);<NEW_LINE>Events.fireToCancel(event, new UseItemEvent(event, create(event.getPlayer()), event.getPlayer().getWorld(), itemStack));<NEW_LINE>}<NEW_LINE>if (!event.isCancelled()) {<NEW_LINE>Events.fireToCancel(event, new PlaceBlockEvent(event, create(event.getPlayer())<MASK><NEW_LINE>}<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>playDenyEffect(event.getPlayer(), event.getBlockPlaced().getLocation().add(0.5, 0.5, 0.5));<NEW_LINE>}<NEW_LINE>} | , event.getBlock())); |
332,334 | void parseShape(Object3D parent, Element shape) throws XPathExpressionException {<NEW_LINE>Node node;<NEW_LINE>NodeList nodes;<NEW_LINE>XPathExpression expr;<NEW_LINE>XPath xpath = xPathfactory.newXPath();<NEW_LINE>expr = xpath.compile(".//*[@DEF]");<NEW_LINE>nodes = (NodeList) expr.evaluate(shape, XPathConstants.NODESET);<NEW_LINE>node = nodes.item(0);<NEW_LINE>String name = (node == null) ? "" : node.getAttributes().getNamedItem("DEF").getNodeValue().trim();<NEW_LINE><MASK><NEW_LINE>nodes = (NodeList) expr.evaluate(shape, XPathConstants.NODESET);<NEW_LINE>node = nodes.item(0);<NEW_LINE>boolean solid = false;<NEW_LINE>if (node != null) {<NEW_LINE>String value = node.getAttributes().getNamedItem("solid").getNodeValue();<NEW_LINE>solid = Boolean.parseBoolean(value.trim());<NEW_LINE>}<NEW_LINE>Object3D obj = parseGeometry(shape);<NEW_LINE>Material material = parseMaterial(shape);<NEW_LINE>if ((obj != null) && (material != null)) {<NEW_LINE>obj.setName(name);<NEW_LINE>obj.setDoubleSided(solid);<NEW_LINE>obj.setMaterial(material);<NEW_LINE>parent.addChild(obj);<NEW_LINE>}<NEW_LINE>} | expr = xpath.compile(".//*[@solid]"); |
1,513,071 | public static void deleteLocalInstructionComment(final SQLProvider provider, final INaviCodeNode codeNode, final INaviInstruction instruction, final Integer commentId, final Integer userId) throws CouldntDeleteException {<NEW_LINE>Preconditions.checkNotNull(codeNode, "IE02432: codeNode argument can not be null");<NEW_LINE>Preconditions.checkNotNull(provider, "IE02433: provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(instruction, "IE02434: instruction argument can not be null");<NEW_LINE>Preconditions.checkNotNull(commentId, "IE02435: comment argument can not be null");<NEW_LINE><MASK><NEW_LINE>final String function = " { ? = call delete_local_instruction_comment(?, ?, ?, ?, ?) } ";<NEW_LINE>try {<NEW_LINE>final CallableStatement deleteCommentStatement = provider.getConnection().getConnection().prepareCall(function);<NEW_LINE>try {<NEW_LINE>deleteCommentStatement.registerOutParameter(1, Types.INTEGER);<NEW_LINE>deleteCommentStatement.setInt(2, instruction.getModule().getConfiguration().getId());<NEW_LINE>deleteCommentStatement.setInt(3, codeNode.getId());<NEW_LINE>deleteCommentStatement.setObject(4, instruction.getAddress().toBigInteger(), Types.BIGINT);<NEW_LINE>deleteCommentStatement.setInt(5, commentId);<NEW_LINE>deleteCommentStatement.setInt(6, userId);<NEW_LINE>deleteCommentStatement.execute();<NEW_LINE>deleteCommentStatement.getInt(1);<NEW_LINE>if (deleteCommentStatement.wasNull()) {<NEW_LINE>throw new IllegalArgumentException("Error: the comment id returned from the database was null");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>deleteCommentStatement.close();<NEW_LINE>}<NEW_LINE>} catch (final SQLException exception) {<NEW_LINE>throw new CouldntDeleteException(exception);<NEW_LINE>}<NEW_LINE>} | Preconditions.checkNotNull(userId, "IE02436: userId argument can not be null"); |
1,290,331 | public ServiceRegistry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ServiceRegistry serviceRegistry = new ServiceRegistry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("registryArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceRegistry.setRegistryArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("port", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceRegistry.setPort(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("containerName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceRegistry.setContainerName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("containerPort", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceRegistry.setContainerPort(context.getUnmarshaller(Integer.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 serviceRegistry;<NEW_LINE>} | class).unmarshall(context)); |
377,226 | private <T> void processProviders(Class<T> interfaceClass) {<NEW_LINE>Object providersFromJerseyConfig = clientBuilder.getConfiguration().getProperty(interfaceClass.getName() + CONFIG_PROVIDERS);<NEW_LINE>if (providersFromJerseyConfig instanceof String && !((String) providersFromJerseyConfig).isEmpty()) {<NEW_LINE>String[] providerArray = ((String) providersFromJerseyConfig).split(PROVIDER_SEPARATOR);<NEW_LINE>processConfigProviders(interfaceClass, providerArray);<NEW_LINE>}<NEW_LINE>Optional<String> providersFromConfig = config.getOptionalValue(interfaceClass.getName() + CONFIG_PROVIDERS, String.class);<NEW_LINE>providersFromConfig.ifPresent(providers -> {<NEW_LINE>if (!providers.isEmpty()) {<NEW_LINE>String[] providerArray = providersFromConfig.get().split(PROVIDER_SEPARATOR);<NEW_LINE>processConfigProviders(interfaceClass, providerArray);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RegisterProvider[] registerProviders = interfaceClass.getAnnotationsByType(RegisterProvider.class);<NEW_LINE>for (RegisterProvider registerProvider : registerProviders) {<NEW_LINE>register(registerProvider.value(), registerProvider.priority() < 0 ? Priorities.<MASK><NEW_LINE>}<NEW_LINE>} | USER : registerProvider.priority()); |
1,716,556 | private static Intent createActivityChooserIntent(Context context, Intent intent, Uri uri) {<NEW_LINE>final PackageManager pm = context.getPackageManager();<NEW_LINE>final List<ResolveInfo> activities = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);<NEW_LINE>final ArrayList<Intent> chooserIntents = new ArrayList<>();<NEW_LINE>final String ourPackageName = context.getPackageName();<NEW_LINE>Collections.sort(activities, new ResolveInfo.DisplayNameComparator(pm));<NEW_LINE>for (ResolveInfo resInfo : activities) {<NEW_LINE>ActivityInfo info = resInfo.activityInfo;<NEW_LINE>if (!info.enabled || !info.exported) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (info.packageName.equals(ourPackageName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Intent targetIntent = new Intent(intent);<NEW_LINE>targetIntent.setPackage(info.packageName);<NEW_LINE>targetIntent.setDataAndType(uri, intent.getType());<NEW_LINE>chooserIntents.add(targetIntent);<NEW_LINE>}<NEW_LINE>if (chooserIntents.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Intent lastIntent = chooserIntents.remove(chooserIntents.size() - 1);<NEW_LINE>if (chooserIntents.isEmpty()) {<NEW_LINE>// there was only one, no need to show the chooser<NEW_LINE>return lastIntent;<NEW_LINE>}<NEW_LINE>Intent chooserIntent = <MASK><NEW_LINE>String extraName = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? Intent.EXTRA_ALTERNATE_INTENTS : Intent.EXTRA_INITIAL_INTENTS;<NEW_LINE>chooserIntent.putExtra(extraName, chooserIntents.toArray(new Intent[0]));<NEW_LINE>return chooserIntent;<NEW_LINE>} | Intent.createChooser(lastIntent, null); |
283,636 | public void addDpdkPort(String bridgeName, String port, String vlan, DpdkHelper.VHostUserMode vHostUserMode, String dpdkOvsPath) {<NEW_LINE>String type = vHostUserMode == DpdkHelper.VHostUserMode.SERVER ? dpdkPortVhostUserType : dpdkPortVhostUserClientType;<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>stringBuilder.append(String.format("ovs-vsctl add-port %s %s ", bridgeName, port));<NEW_LINE>if (Integer.parseInt(vlan) > 0 && Integer.parseInt(vlan) < 4095) {<NEW_LINE>stringBuilder.append(String.format("vlan_mode=access tag=%s ", vlan));<NEW_LINE>}<NEW_LINE>stringBuilder.append(String.format("-- set Interface %s type=%s", port, type));<NEW_LINE>if (vHostUserMode == DpdkHelper.VHostUserMode.CLIENT) {<NEW_LINE>stringBuilder.append(String.format(" options:vhost-server-path=%s/%s", dpdkOvsPath, port));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>s_logger.debug("DPDK property enabled, executing: " + cmd);<NEW_LINE>Script.runSimpleBashScript(cmd);<NEW_LINE>} | String cmd = stringBuilder.toString(); |
577,392 | public RemediationActionWithOrder unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RemediationActionWithOrder remediationActionWithOrder = new RemediationActionWithOrder();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RemediationAction", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>remediationActionWithOrder.setRemediationAction(RemediationActionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Order", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>remediationActionWithOrder.setOrder(context.getUnmarshaller(Integer.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 remediationActionWithOrder;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,218,449 | private void showProfilerSnapshot(ActionEvent e) {<NEW_LINE>File tempFile = null;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>tempFile = File.createTempFile("selfsampler", ".npss");<NEW_LINE><MASK><NEW_LINE>try (OutputStream os = new FileOutputStream(tempFile)) {<NEW_LINE>os.write(slownData.getNpsContent());<NEW_LINE>}<NEW_LINE>File varLogs = logsDirectory();<NEW_LINE>// NOI18N<NEW_LINE>File gestures = (varLogs != null) ? new File(varLogs, "uigestures") : null;<NEW_LINE>SelfSampleVFS fs;<NEW_LINE>if (gestures != null && gestures.exists()) {<NEW_LINE>fs = new SelfSampleVFS(new String[] { "selfsampler.npss", "selfsampler.log" }, new File[] { tempFile, gestures });<NEW_LINE>} else {<NEW_LINE>fs = new SelfSampleVFS(new String[] { "selfsampler.npss" }, new File[] { tempFile });<NEW_LINE>}<NEW_LINE>FileObject fo = fs.findResource("selfsampler.npss");<NEW_LINE>final Node obj = DataObject.find(fo).getNodeDelegate();<NEW_LINE>Action a = obj.getPreferredAction();<NEW_LINE>if (a instanceof ContextAwareAction) {<NEW_LINE>a = ((ContextAwareAction) a).createContextAwareInstance(obj.getLookup());<NEW_LINE>}<NEW_LINE>a.actionPerformed(e);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} finally {<NEW_LINE>if (tempFile != null)<NEW_LINE>tempFile.deleteOnExit();<NEW_LINE>}<NEW_LINE>} | tempFile = FileUtil.normalizeFile(tempFile); |
801,743 | private Class<?> resolveGenericType(Node argument, String typeImage) {<NEW_LINE>List<ASTTypeParameter> types = new ArrayList<>();<NEW_LINE>// first search only within the same method<NEW_LINE>ASTClassOrInterfaceBodyDeclaration firstParentOfType = argument.getFirstParentOfType(ASTClassOrInterfaceBodyDeclaration.class);<NEW_LINE>if (firstParentOfType != null) {<NEW_LINE>types.addAll(firstParentOfType<MASK><NEW_LINE>}<NEW_LINE>// then search class level types, from inner-most to outer-most<NEW_LINE>List<ASTClassOrInterfaceDeclaration> enclosingClasses = argument.getParentsOfType(ASTClassOrInterfaceDeclaration.class);<NEW_LINE>for (ASTClassOrInterfaceDeclaration enclosing : enclosingClasses) {<NEW_LINE>ASTTypeParameters classLevelTypeParameters = enclosing.getFirstChildOfType(ASTTypeParameters.class);<NEW_LINE>if (classLevelTypeParameters != null) {<NEW_LINE>types.addAll(classLevelTypeParameters.findDescendantsOfType(ASTTypeParameter.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resolveGenericType(typeImage, types);<NEW_LINE>} | .findDescendantsOfType(ASTTypeParameter.class)); |
1,468,812 | // ===<NEW_LINE>// Methods for: InitializingBean<NEW_LINE>// ===<NEW_LINE>@Override<NEW_LINE>public void afterPropertiesSet() {<NEW_LINE>Map<String, CustomConverter> contextCustomConvertersWithId = getApplicationContext().getBeansOfType(CustomConverter.class);<NEW_LINE>Map<String, BeanMappingBuilder> contextBeanMappingBuilders = getApplicationContext().getBeansOfType(BeanMappingBuilder.class);<NEW_LINE>Map<String, EventListener> contextEventListeners = getApplicationContext().getBeansOfType(EventListener.class);<NEW_LINE>Map<String, BeanFactory> contextBeanFactories = getApplicationContext().getBeansOfType(BeanFactory.class);<NEW_LINE>Map<String, DozerBeanMapperBuilderCustomizer> contextBuilderCustomizers = getApplicationContext().getBeansOfType(DozerBeanMapperBuilderCustomizer.class);<NEW_LINE>customConverters.addAll(contextCustomConvertersWithId.values());<NEW_LINE>mappingBuilders.<MASK><NEW_LINE>beanFactories.putAll(contextBeanFactories);<NEW_LINE>eventListeners.addAll(contextEventListeners.values());<NEW_LINE>customConvertersWithId.putAll(contextCustomConvertersWithId);<NEW_LINE>builderCustomizers.addAll(contextBuilderCustomizers.values());<NEW_LINE>DozerBeanMapperBuilder builder = DozerBeanMapperBuilder.create().withMappingFiles(mappingFileUrls).withCustomFieldMapper(customFieldMapper).withCustomConverters(customConverters).withMappingBuilders(mappingBuilders).withEventListeners(eventListeners).withBeanFactorys(beanFactories).withCustomConvertersWithIds(customConvertersWithId);<NEW_LINE>builderCustomizers.forEach(customizer -> customizer.customize(builder));<NEW_LINE>this.mapper = builder.build();<NEW_LINE>} | addAll(contextBeanMappingBuilders.values()); |
1,686,441 | private void initKnownContainers(Map<IJavaProject, Map<IPath, IClasspathContainer>> perProjectContainers, IProgressMonitor monitor) throws JavaModelException {<NEW_LINE>Iterator<Entry<IJavaProject, Map<IPath, IClasspathContainer>>> entriesIterator = perProjectContainers.entrySet().iterator();<NEW_LINE>List<SetContainerOperation> operations = new ArrayList<>();<NEW_LINE>while (entriesIterator.hasNext()) {<NEW_LINE>Entry<IJavaProject, Map<IPath, IClasspathContainer>> entry = entriesIterator.next();<NEW_LINE>IJavaProject project = entry.getKey();<NEW_LINE>Map<IPath, IClasspathContainer> perPathContainers = entry.getValue();<NEW_LINE>Iterator<Entry<IPath, IClasspathContainer>> containersIterator = perPathContainers<MASK><NEW_LINE>while (containersIterator.hasNext()) {<NEW_LINE>Entry<IPath, IClasspathContainer> containerEntry = containersIterator.next();<NEW_LINE>IPath containerPath = containerEntry.getKey();<NEW_LINE>IClasspathContainer container = containerEntry.getValue();<NEW_LINE>SetContainerOperation operation = new SetContainerOperation(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container });<NEW_LINE>operations.add(operation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// operation.runOperation() below could put something into the map again<NEW_LINE>// so we clear the map to make sure we only see new content there<NEW_LINE>perProjectContainers.clear();<NEW_LINE>for (SetContainerOperation operation : operations) {<NEW_LINE>operation.runOperation(monitor);<NEW_LINE>}<NEW_LINE>} | .entrySet().iterator(); |
26,625 | public boolean onTouch(View v, MotionEvent event) {<NEW_LINE>resetNoTouchTimer(getActionBar().isShowing() && mHudVisible == false);<NEW_LINE>mGesDetect.onTouchEvent(event);<NEW_LINE>// Pass the touch event to the native layer for camera control.<NEW_LINE>// Single touch to rotate the camera around the device.<NEW_LINE>// Two fingers to zoom in and out.<NEW_LINE>int pointCount = event.getPointerCount();<NEW_LINE>if (pointCount == 1) {<NEW_LINE>float normalizedX = event.<MASK><NEW_LINE>float normalizedY = event.getY(0) / mScreenSize.y;<NEW_LINE>RTABMapLib.onTouchEvent(nativeApplication, 1, event.getActionMasked(), normalizedX, normalizedY, 0.0f, 0.0f);<NEW_LINE>}<NEW_LINE>if (pointCount == 2) {<NEW_LINE>if (event.getActionMasked() == MotionEvent.ACTION_POINTER_UP) {<NEW_LINE>int index = event.getActionIndex() == 0 ? 1 : 0;<NEW_LINE>float normalizedX = event.getX(index) / mScreenSize.x;<NEW_LINE>float normalizedY = event.getY(index) / mScreenSize.y;<NEW_LINE>RTABMapLib.onTouchEvent(nativeApplication, 1, MotionEvent.ACTION_DOWN, normalizedX, normalizedY, 0.0f, 0.0f);<NEW_LINE>} else {<NEW_LINE>float normalizedX0 = event.getX(0) / mScreenSize.x;<NEW_LINE>float normalizedY0 = event.getY(0) / mScreenSize.y;<NEW_LINE>float normalizedX1 = event.getX(1) / mScreenSize.x;<NEW_LINE>float normalizedY1 = event.getY(1) / mScreenSize.y;<NEW_LINE>RTABMapLib.onTouchEvent(nativeApplication, 2, event.getActionMasked(), normalizedX0, normalizedY0, normalizedX1, normalizedY1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getX(0) / mScreenSize.x; |
587,882 | public VpcPeeringConnectionStateReason unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>VpcPeeringConnectionStateReason vpcPeeringConnectionStateReason = new VpcPeeringConnectionStateReason();<NEW_LINE><MASK><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 vpcPeeringConnectionStateReason;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>vpcPeeringConnectionStateReason.setCode(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("message", targetDepth)) {<NEW_LINE>vpcPeeringConnectionStateReason.setMessage(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return vpcPeeringConnectionStateReason;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
399,232 | public static synchronized Note buildFromBase64EncodedData(String noteId, String base64FullNoteData) {<NEW_LINE>Note note = null;<NEW_LINE>if (base64FullNoteData == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] b64DecodedPayload = Base64.decode(base64FullNoteData, Base64.DEFAULT);<NEW_LINE>// Decompress the payload<NEW_LINE>Inflater decompresser = new Inflater();<NEW_LINE>decompresser.setInput(b64DecodedPayload, 0, b64DecodedPayload.length);<NEW_LINE>// max length an Android PN payload can have<NEW_LINE>byte[] result = new byte[4096];<NEW_LINE>int resultLength = 0;<NEW_LINE>try {<NEW_LINE>resultLength = decompresser.inflate(result);<NEW_LINE>decompresser.end();<NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Can't decompress the PN BlockListPayload. It could be > 4K", e);<NEW_LINE>}<NEW_LINE>String out = null;<NEW_LINE>try {<NEW_LINE>out = new String(result, 0, resultLength, "UTF8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Notification data contains non UTF8 characters.", e);<NEW_LINE>}<NEW_LINE>if (out != null) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (jsonObject.has("notes")) {<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("notes");<NEW_LINE>if (jsonArray != null && jsonArray.length() == 1) {<NEW_LINE>jsonObject = jsonArray.getJSONObject(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>note = new Note(noteId, jsonObject);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Can't parse the Note JSON received in the PN", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return note;<NEW_LINE>} | JSONObject jsonObject = new JSONObject(out); |
1,033,604 | private WebfluxRouteElement[] extractAcceptTypes(MethodInvocation routerInvocation, TextDocument doc) {<NEW_LINE>WebfluxAcceptTypeFinder typeFinder = new WebfluxAcceptTypeFinder(doc);<NEW_LINE>List<?> arguments = routerInvocation.arguments();<NEW_LINE>for (Object argument : arguments) {<NEW_LINE>if (argument != null && argument instanceof ASTNode) {<NEW_LINE>((ASTNode<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<WebfluxRouteElement> acceptTypes = typeFinder.getAcceptTypes();<NEW_LINE>extractNestedValue(routerInvocation, acceptTypes, (methodInvocation) -> {<NEW_LINE>IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();<NEW_LINE>try {<NEW_LINE>if (methodBinding != null && WebfluxUtils.REQUEST_PREDICATE_ACCEPT_TYPE_METHOD.equals(methodBinding.getName())) {<NEW_LINE>SimpleName nameArgument = WebfluxUtils.extractSimpleNameArgument(methodInvocation);<NEW_LINE>if (nameArgument != null && nameArgument.getFullyQualifiedName() != null) {<NEW_LINE>Range range = doc.toRange(nameArgument.getStartPosition(), nameArgument.getLength());<NEW_LINE>return new WebfluxRouteElement(nameArgument.getFullyQualifiedName().toString(), range);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return (WebfluxRouteElement[]) acceptTypes.toArray(new WebfluxRouteElement[acceptTypes.size()]);<NEW_LINE>} | ) argument).accept(typeFinder); |
123,301 | public File prepareDownloadFile(Response response) throws IOException {<NEW_LINE>String filename = null;<NEW_LINE>String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");<NEW_LINE>if (contentDisposition != null && !"".equals(contentDisposition)) {<NEW_LINE>// Get filename from the Content-Disposition header.<NEW_LINE>Pattern <MASK><NEW_LINE>Matcher matcher = pattern.matcher(contentDisposition);<NEW_LINE>if (matcher.find())<NEW_LINE>filename = matcher.group(1);<NEW_LINE>}<NEW_LINE>String prefix = null;<NEW_LINE>String suffix = null;<NEW_LINE>if (filename == null) {<NEW_LINE>prefix = "download-";<NEW_LINE>suffix = "";<NEW_LINE>} else {<NEW_LINE>int pos = filename.lastIndexOf(".");<NEW_LINE>if (pos == -1) {<NEW_LINE>prefix = filename + "-";<NEW_LINE>} else {<NEW_LINE>prefix = filename.substring(0, pos) + "-";<NEW_LINE>suffix = filename.substring(pos);<NEW_LINE>}<NEW_LINE>// Files.createTempFile requires the prefix to be at least three characters long<NEW_LINE>if (prefix.length() < 3)<NEW_LINE>prefix = "download-";<NEW_LINE>}<NEW_LINE>if (tempFolderPath == null)<NEW_LINE>return Files.createTempFile(prefix, suffix).toFile();<NEW_LINE>else<NEW_LINE>return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();<NEW_LINE>} | pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); |
191,498 | public void closeAllConsumersForReceiveExclusive() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "closeAllConsumersForReceiveExclusive");<NEW_LINE>Iterator<DispatchableKey> itr = null;<NEW_LINE>Iterator<DispatchableKey> clonedItr = null;<NEW_LINE>// The consumerPoints list is cloned for the notifyException<NEW_LINE>// call.<NEW_LINE>synchronized (consumerPoints) {<NEW_LINE>// since the close of the underlying session causes the consumer point to<NEW_LINE>// be removed from the list we have to take a clone of the list<NEW_LINE>clonedItr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();<NEW_LINE>itr = ((LinkedList<DispatchableKey>) consumerPoints.clone()).iterator();<NEW_LINE>}<NEW_LINE>// Defect 360452<NEW_LINE>// Iterate twice to avoid deadlock. First iteration to mark<NEW_LINE>// as not ready. This ensure no messages on the destination<NEW_LINE>// will arrive at the consumers.<NEW_LINE>synchronized (_baseDestHandler.getReadyConsumerPointLock()) {<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>DispatchableKey consumerKey = itr.next();<NEW_LINE>// If we're making the consumer notReady then we must also remove<NEW_LINE>// them from the list of ready consumers that we hold<NEW_LINE>if (consumerKey.isKeyReady())<NEW_LINE>removeReadyConsumer(consumerKey.getParent(<MASK><NEW_LINE>consumerKey.markNotReady();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Second iteration to close sessions outside of readyConsumerPointLock<NEW_LINE>// to avoid deadlock with receive.<NEW_LINE>while (clonedItr.hasNext()) {<NEW_LINE>DispatchableKey consumerKey = clonedItr.next();<NEW_LINE>consumerKey.getConsumerPoint().implicitClose(null, null, _messageProcessor.getMessagingEngineUuid());<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "closeAllConsumersForReceiveExclusive");<NEW_LINE>} | ), consumerKey.isSpecific()); |
922,158 | public void check(Field field, String value, JpaObject jpa, CheckPersist checkPersist, CheckPersistType checkPersistType) throws Exception {<NEW_LINE>if (Objects.equals(checkPersistType, CheckPersistType.all) || Objects.equals(checkPersistType, CheckPersistType.baseOnly)) {<NEW_LINE>this.allowEmpty(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.length(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.simply(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.fileName(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.mail(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.mobile(field, <MASK><NEW_LINE>this.pattern(field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>}<NEW_LINE>if (Objects.equals(checkPersistType, CheckPersistType.all) || Objects.equals(checkPersistType, CheckPersistType.citationOnly)) {<NEW_LINE>this.citationExists(this.emc, field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>this.citationNotExists(this.emc, field, value, jpa, checkPersist, checkPersistType);<NEW_LINE>}<NEW_LINE>} | value, jpa, checkPersist, checkPersistType); |
1,850,960 | protected void addGuiElements() {<NEW_LINE>super.addGuiElements();<NEW_LINE>addRenderableWidget(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75)).warning(WarningType.NOT_ENOUGH_ENERGY, tile.getWarningCheck(RecipeError.NOT_ENOUGH_ENERGY)).warning(WarningType.NOT_ENOUGH_ENERGY_REDUCED_RATE, tile.getWarningCheck(RecipeError.NOT_ENOUGH_ENERGY_REDUCED_RATE));<NEW_LINE>addRenderableWidget(new GuiEnergyTab(this, tile.getEnergyContainer<MASK><NEW_LINE>addRenderableWidget(new GuiGasGauge(() -> tile.injectTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 7, 4)).warning(WarningType.NO_MATCHING_RECIPE, tile.getWarningCheck(RecipeError.NOT_ENOUGH_SECONDARY_INPUT));<NEW_LINE>addRenderableWidget(new GuiMergedChemicalTankGauge<>(() -> tile.outputTank, () -> tile, GaugeType.STANDARD, this, 131, 13)).warning(WarningType.NO_SPACE_IN_OUTPUT, tile.getWarningCheck(RecipeError.NOT_ENOUGH_OUTPUT_SPACE));<NEW_LINE>addRenderableWidget(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 64, 40).jeiCategory(tile)).warning(WarningType.INPUT_DOESNT_PRODUCE_OUTPUT, tile.getWarningCheck(RecipeError.INPUT_DOESNT_PRODUCE_OUTPUT));<NEW_LINE>} | (), tile::getActive)); |
404,616 | private void calculateConfig(ImageReader imageReader, DecodeFormat format, boolean isHardwareConfigAllowed, boolean isExifOrientationRequired, BitmapFactory.Options optionsWithScaling, int targetWidth, int targetHeight) {<NEW_LINE>if (hardwareConfigState.setHardwareConfigIfAllowed(targetWidth, targetHeight, optionsWithScaling, isHardwareConfigAllowed, isExifOrientationRequired)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Changing configs can cause skewing on 4.1, see issue #128.<NEW_LINE>if (format == DecodeFormat.PREFER_ARGB_8888 || Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {<NEW_LINE>optionsWithScaling.inPreferredConfig = Bitmap.Config.ARGB_8888;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean hasAlpha = false;<NEW_LINE>try {<NEW_LINE>hasAlpha = imageReader.getImageType().hasAlpha();<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (Log.isLoggable(TAG, Log.DEBUG)) {<NEW_LINE>Log.d(TAG, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>optionsWithScaling.inPreferredConfig = hasAlpha ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565;<NEW_LINE>if (optionsWithScaling.inPreferredConfig == Config.RGB_565) {<NEW_LINE>optionsWithScaling.inDither = true;<NEW_LINE>}<NEW_LINE>} | "Cannot determine whether the image has alpha or not from header" + ", format " + format, e); |
1,658,149 | Node<K, V> findNode(K key) {<NEW_LINE>java.lang.Comparable<K> object = comparator == null ? toComparable((K) key) : null;<NEW_LINE>K keyK = (K) key;<NEW_LINE>Node<K, V> node = root;<NEW_LINE>while (node != null) {<NEW_LINE><MASK><NEW_LINE>int left_idx = node.left_idx;<NEW_LINE>int result = cmp(object, keyK, keys[left_idx]);<NEW_LINE>if (result < 0) {<NEW_LINE>node = node.left;<NEW_LINE>} else if (result == 0) {<NEW_LINE>return node;<NEW_LINE>} else {<NEW_LINE>int right_idx = node.right_idx;<NEW_LINE>if (left_idx != right_idx) {<NEW_LINE>result = cmp(object, keyK, keys[right_idx]);<NEW_LINE>}<NEW_LINE>if (result > 0) {<NEW_LINE>node = node.right;<NEW_LINE>} else {<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | K[] keys = node.keys; |
262,127 | public Future<T> parse(DataEmitter emitter) {<NEW_LINE>final String charset = emitter.charset();<NEW_LINE>return new ByteBufferListParser().parse(emitter).thenConvert(result -> {<NEW_LINE>JsonParser parser = new JsonParser();<NEW_LINE>ByteBufferListInputStream bis = new ByteBufferListInputStream(result);<NEW_LINE>InputStreamReader isr;<NEW_LINE>if (forcedCharset != null)<NEW_LINE>isr <MASK><NEW_LINE>else if (charset != null)<NEW_LINE>isr = new InputStreamReader(bis, charset);<NEW_LINE>else<NEW_LINE>isr = new InputStreamReader(bis);<NEW_LINE>JsonElement parsed = parser.parse(new JsonReader(isr));<NEW_LINE>if (parsed.isJsonNull() || parsed.isJsonPrimitive())<NEW_LINE>throw new JsonParseException("unable to parse json");<NEW_LINE>if (!clazz.isInstance(parsed))<NEW_LINE>throw new ClassCastException(parsed.getClass().getCanonicalName() + " can not be casted to " + clazz.getCanonicalName());<NEW_LINE>return (T) parsed;<NEW_LINE>});<NEW_LINE>} | = new InputStreamReader(bis, forcedCharset); |
1,682,522 | public static NamedComponentReference<? extends GlobalSimpleType> populateSimpleType(final Datatype d, final SchemaModel sm, final SchemaComponent st, SchemaGenerator.PrimitiveCart pc) {<NEW_LINE>NamedComponentReference ref = null;<NEW_LINE>if (!d.hasFacets()) {<NEW_LINE>if (d instanceof UnionType) {<NEW_LINE>Union u = createUnion(sm, st);<NEW_LINE>for (Datatype m : ((UnionType) d).getMemberTypes()) {<NEW_LINE>ref = <MASK><NEW_LINE>u.addMemberType(ref);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ref = createFacets(d, sm, st, pc);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (d instanceof UnionType) {<NEW_LINE>Union u = createUnion(sm, st);<NEW_LINE>for (Datatype m : ((UnionType) d).getMemberTypes()) {<NEW_LINE>LocalSimpleType lst2 = createLocalSimpleType(sm, u);<NEW_LINE>// ref = createPrimitiveType(m, lst2, pc);<NEW_LINE>ref = createFacets(m, sm, lst2, pc);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// ref = createPrimitiveType(d, st, pc);<NEW_LINE>ref = createFacets(d, sm, st, pc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ref;<NEW_LINE>} | createPrimitiveType(m, u, pc); |
975,426 | public com.amazonaws.services.forecast.model.ResourceAlreadyExistsException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.forecast.model.ResourceAlreadyExistsException resourceAlreadyExistsException = new com.amazonaws.services.forecast.model.ResourceAlreadyExistsException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 resourceAlreadyExistsException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
718,486 | final DeletePartnerResult executeDeletePartner(DeletePartnerRequest deletePartnerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePartnerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePartnerRequest> request = null;<NEW_LINE>Response<DeletePartnerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePartnerRequestMarshaller().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, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePartner");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeletePartnerResult> responseHandler = new StaxResponseHandler<DeletePartnerResult>(new DeletePartnerResultStaxUnmarshaller());<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(deletePartnerRequest)); |
183,768 | private List<FacetResult> facetsWithSearch() throws IOException {<NEW_LINE>DirectoryReader indexReader = DirectoryReader.open(indexDir);<NEW_LINE>IndexSearcher searcher = new IndexSearcher(indexReader);<NEW_LINE><MASK><NEW_LINE>FacetsCollector fc = new FacetsCollector();<NEW_LINE>// MatchAllDocsQuery is for "browsing" (counts facets<NEW_LINE>// for all non-deleted docs in the index); normally<NEW_LINE>// you'd use a "normal" query:<NEW_LINE>FacetsCollector.search(searcher, new MatchAllDocsQuery(), 10, fc);<NEW_LINE>// Retrieve results<NEW_LINE>List<FacetResult> results = new ArrayList<>();<NEW_LINE>// Count both "Publish Date" and "Author" dimensions<NEW_LINE>Facets facets = new FastTaxonomyFacetCounts(taxoReader, config, fc);<NEW_LINE>results.add(facets.getTopChildren(10, "Author"));<NEW_LINE>results.add(facets.getTopChildren(10, "Publish Date"));<NEW_LINE>indexReader.close();<NEW_LINE>taxoReader.close();<NEW_LINE>return results;<NEW_LINE>} | TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir); |
1,754,214 | public ParameterSpecification create(ParameterSpecificationContext context) {<NEW_LINE>SimpleParameterSpecification simpleParameter = context.getSimpleParameter();<NEW_LINE>SimpleParameterSpecification validSimpleParameter = null;<NEW_LINE>ContentSpecification validContentEncoding = null;<NEW_LINE>if (simpleParameter != null) {<NEW_LINE>ModelSpecification model = simpleParameter.getModel();<NEW_LINE>if (model != null) {<NEW_LINE>if (model.getScalar().isPresent()) {<NEW_LINE>validSimpleParameter = context.getSimpleParameterSpecificationBuilder().copyOf(simpleParameter).explode(simpleParameter.getExplode()).style(ParameterStyle.FORM).build();<NEW_LINE>} else if (model.getCollection().isPresent()) {<NEW_LINE>ParameterStyle style = VALID_COLLECTION_STYLES.contains(simpleParameter.getStyle()) ? simpleParameter.getStyle() : simpleParameter.nullSafeIsExplode() ? ParameterStyle.FORM : ParameterStyle.PIPEDELIMITED;<NEW_LINE>validSimpleParameter = context.getSimpleParameterSpecificationBuilder().copyOf(simpleParameter).explode(simpleParameter.getExplode()).style(style).collectionFormat(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (validSimpleParameter == null) {<NEW_LINE>ParameterStyle style = VALID_OBJECT_STYLES.contains(simpleParameter.getStyle()) ? simpleParameter.getStyle() : simpleParameter.nullSafeIsExplode() ? ParameterStyle.FORM : ParameterStyle.DEEPOBJECT;<NEW_LINE>validSimpleParameter = context.getSimpleParameterSpecificationBuilder().copyOf(simpleParameter).explode(style == ParameterStyle.DEEPOBJECT ? Boolean.TRUE : simpleParameter.getExplode()).style(style).collectionFormat(null).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (context.getContentParameter() != null) {<NEW_LINE>validContentEncoding = context.getContentSpecificationBuilder().copyOf(context.getContentParameter()).build();<NEW_LINE>}<NEW_LINE>return new ParameterSpecification(validSimpleParameter, validContentEncoding);<NEW_LINE>} | CollectionFormat.MULTI).build(); |
390,588 | private void saveAsyncImpl(@Nonnull UIAccess uiAccess) {<NEW_LINE>ApplicationEx application = (ApplicationEx) getApplication();<NEW_LINE>if (application.isDoNotSave()) {<NEW_LINE>// no need to save<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!mySavingInProgress.compareAndSet(false, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// HeavyProcessLatch.INSTANCE.prioritizeUiActivity();<NEW_LINE>try {<NEW_LINE>if (!isDefault()) {<NEW_LINE>String projectBasePath = getStateStore().getProjectBasePath();<NEW_LINE>if (projectBasePath != null) {<NEW_LINE>File projectDir = new File(projectBasePath);<NEW_LINE>File nameFile = new File(projectDir, DIRECTORY_STORE_FOLDER + "/" + NAME_FILE);<NEW_LINE>if (!projectDir.getName().equals(getName())) {<NEW_LINE>try {<NEW_LINE>FileUtil.writeToFile(nameFile, getName());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Unable to store project name", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>FileUtil.delete(nameFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StoreUtil.saveAsync(getStateStore(), uiAccess, this);<NEW_LINE>} finally {<NEW_LINE>mySavingInProgress.set(false);<NEW_LINE>application.getMessageBus().syncPublisher(ProjectSaved<MASK><NEW_LINE>}<NEW_LINE>} | .TOPIC).saved(this); |
1,644,212 | private void decodeAnnotation() {<NEW_LINE>this.readOffset = 0;<NEW_LINE>int utf8Offset = this.constantPoolOffsets[u2At(0)] - this.structOffset;<NEW_LINE>this.typename = utf8At(utf8Offset + 3, u2At(utf8Offset + 1));<NEW_LINE>int numberOfPairs = u2At(2);<NEW_LINE>// u2 type_index + u2 num_member_value_pair<NEW_LINE>this.readOffset += 4;<NEW_LINE>ElementValuePairInfo[] decodedPairs = numberOfPairs == 0 ? ElementValuePairInfo<MASK><NEW_LINE>int i = 0;<NEW_LINE>try {<NEW_LINE>while (i < numberOfPairs) {<NEW_LINE>// u2 member_name_index;<NEW_LINE>utf8Offset = this.constantPoolOffsets[u2At(this.readOffset)] - this.structOffset;<NEW_LINE>char[] membername = utf8At(utf8Offset + 3, u2At(utf8Offset + 1));<NEW_LINE>this.readOffset += 2;<NEW_LINE>Object value = decodeDefaultValue();<NEW_LINE>decodedPairs[i++] = new ElementValuePairInfo(membername, value);<NEW_LINE>}<NEW_LINE>this.pairs = decodedPairs;<NEW_LINE>} catch (RuntimeException any) {<NEW_LINE>sanitizePairs(decodedPairs);<NEW_LINE>StringBuilder newMessage = new StringBuilder(any.getMessage());<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>newMessage.append(" while decoding pair #").append(i).append(" of annotation @").append(this.typename);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>newMessage.append(", bytes at structOffset ").append(this.structOffset).append(":");<NEW_LINE>int offset = this.structOffset;<NEW_LINE>while (offset <= this.structOffset + this.readOffset && offset < this.reference.length) {<NEW_LINE>newMessage.append(' ').append(Integer.toHexString(this.reference[offset++] & 0xFF));<NEW_LINE>}<NEW_LINE>throw new IllegalStateException(newMessage.toString(), any);<NEW_LINE>}<NEW_LINE>} | .NoMembers : new ElementValuePairInfo[numberOfPairs]; |
67,226 | private static void checkCompatibleTypes(SerializedColumnHeader expected, SerializedColumnHeader other, int tableIdx, int columnIdx) {<NEW_LINE>DType dtype = expected.getType();<NEW_LINE>if (!dtype.equals(other.getType())) {<NEW_LINE>throw new IllegalArgumentException("Type mismatch at table " + tableIdx + "column " + columnIdx + " expected " + dtype + " but found " + other.getType());<NEW_LINE>}<NEW_LINE>if (dtype.isNestedType()) {<NEW_LINE>SerializedColumnHeader[] expectedChildren = expected.getChildren();<NEW_LINE>SerializedColumnHeader[<MASK><NEW_LINE>if (expectedChildren.length != otherChildren.length) {<NEW_LINE>throw new IllegalArgumentException("Child count mismatch at table " + tableIdx + "column " + columnIdx + " expected " + expectedChildren.length + " but found " + otherChildren.length);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < expectedChildren.length; i++) {<NEW_LINE>checkCompatibleTypes(expectedChildren[i], otherChildren[i], tableIdx, columnIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] otherChildren = other.getChildren(); |
1,385,134 | public void removeUpdate(javax.swing.event.DocumentEvent p0) {<NEW_LINE>Element root = rootRef.get();<NEW_LINE>int elem = root.getElementCount();<NEW_LINE>int delta = lines - elem;<NEW_LINE>lines = elem;<NEW_LINE><MASK><NEW_LINE>if (doc == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int lineNumber = NbDocument.findLineNumber(doc, p0.getOffset());<NEW_LINE>if (delta > 0) {<NEW_LINE>struct.deleteLines(lineNumber, delta);<NEW_LINE>}<NEW_LINE>if (support == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Line.Set set = support.getLineSet();<NEW_LINE>if (!(set instanceof DocumentLine.Set)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Notify lineSet there was changed range of lines.<NEW_LINE>((DocumentLine.Set) set).linesChanged(lineNumber, lineNumber + delta, p0);<NEW_LINE>if (delta > 0) {<NEW_LINE>// Notify Line.Set there was moved range of lines.<NEW_LINE>((DocumentLine.Set) set).linesMoved(lineNumber, elem);<NEW_LINE>}<NEW_LINE>} | StyledDocument doc = support.getDocument(); |
599,670 | protected String doIt() throws Exception {<NEW_LINE>log.info("M_MatchPO_ID=" + p_M_MatchPO_ID);<NEW_LINE>MMatchPO po = new MMatchPO(getCtx(), p_M_MatchPO_ID, get_TrxName());<NEW_LINE>if (po.get_ID() == 0)<NEW_LINE>throw new AdempiereUserError("@NotFound@ @M_MatchPO_ID@ " + p_M_MatchPO_ID);<NEW_LINE>//<NEW_LINE>MOrderLine orderLine = null;<NEW_LINE>boolean isMatchReceipt = (po.getM_InOutLine_ID() != 0);<NEW_LINE>if (isMatchReceipt) {<NEW_LINE>orderLine = new MOrderLine(getCtx(), po.<MASK><NEW_LINE>orderLine.setQtyReserved(orderLine.getQtyReserved().add(po.getQty()));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (po.delete(true)) {<NEW_LINE>if (isMatchReceipt) {<NEW_LINE>if (!orderLine.save(get_TrxName()))<NEW_LINE>throw new AdempiereUserError("Delete MatchPO failed to restore PO's On Ordered Qty");<NEW_LINE>}<NEW_LINE>return "@OK@";<NEW_LINE>}<NEW_LINE>po.saveEx();<NEW_LINE>return "@Error@";<NEW_LINE>} | getC_OrderLine_ID(), get_TrxName()); |
660,454 | public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {<NEW_LINE><MASK><NEW_LINE>if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {<NEW_LINE>int x = (int) event.getX();<NEW_LINE>int y = (int) event.getY();<NEW_LINE>x -= widget.getTotalPaddingLeft();<NEW_LINE>y -= widget.getTotalPaddingTop();<NEW_LINE>x += widget.getScrollX();<NEW_LINE>y += widget.getScrollY();<NEW_LINE>Layout layout = widget.getLayout();<NEW_LINE>int line = layout.getLineForVertical(y);<NEW_LINE>int off = layout.getOffsetForHorizontal(line, x);<NEW_LINE>LongClickCopySpan[] longClickCopySpan = buffer.getSpans(off, off, LongClickCopySpan.class);<NEW_LINE>if (longClickCopySpan.length != 0) {<NEW_LINE>LongClickCopySpan aSingleSpan = longClickCopySpan[0];<NEW_LINE>if (action == MotionEvent.ACTION_DOWN) {<NEW_LINE>Selection.setSelection(buffer, buffer.getSpanStart(aSingleSpan), buffer.getSpanEnd(aSingleSpan));<NEW_LINE>aSingleSpan.setHighlighted(true, ContextCompat.getColor(widget.getContext(), R.color.touch_highlight));<NEW_LINE>} else {<NEW_LINE>Selection.removeSelection(buffer);<NEW_LINE>aSingleSpan.setHighlighted(false, Color.TRANSPARENT);<NEW_LINE>}<NEW_LINE>this.currentSpan = aSingleSpan;<NEW_LINE>this.widget = widget;<NEW_LINE>return gestureDetector.onTouchEvent(event);<NEW_LINE>}<NEW_LINE>} else if (action == MotionEvent.ACTION_CANCEL) {<NEW_LINE>// Remove Selections.<NEW_LINE>LongClickCopySpan[] spans = buffer.getSpans(Selection.getSelectionStart(buffer), Selection.getSelectionEnd(buffer), LongClickCopySpan.class);<NEW_LINE>for (LongClickCopySpan aSpan : spans) {<NEW_LINE>aSpan.setHighlighted(false, Color.TRANSPARENT);<NEW_LINE>}<NEW_LINE>Selection.removeSelection(buffer);<NEW_LINE>return gestureDetector.onTouchEvent(event);<NEW_LINE>}<NEW_LINE>return super.onTouchEvent(widget, buffer, event);<NEW_LINE>} | int action = event.getAction(); |
1,470,190 | public ConfigValidationResult validateConfig(BaseConfig oldConfig, AuthConfig newConfig, BaseConfig newBaseConfig) {<NEW_LINE>List<String> errors = new ArrayList<>();<NEW_LINE>List<String> warnings = new ArrayList<>();<NEW_LINE>if (authType != AuthType.NONE && users.isEmpty()) {<NEW_LINE>errors.add("You've enabled security but not defined any users");<NEW_LINE>} else if (authType != AuthType.NONE && restrictAdmin && users.stream().noneMatch(UserAuthConfig::isMaySeeAdmin)) {<NEW_LINE>errors.add("You've restricted admin access but no user has admin rights");<NEW_LINE>} else if (authType != AuthType.NONE && !restrictSearch && !restrictAdmin) {<NEW_LINE>errors.add("You haven't enabled any access restrictions. Auth will not take any effect");<NEW_LINE>}<NEW_LINE>Set<String> usernames = new HashSet<>();<NEW_LINE>List<String> duplicateUsernames = new ArrayList<>();<NEW_LINE>for (UserAuthConfig user : users) {<NEW_LINE>if (usernames.contains(user.getUsername())) {<NEW_LINE>duplicateUsernames.<MASK><NEW_LINE>}<NEW_LINE>usernames.add(user.getUsername());<NEW_LINE>}<NEW_LINE>if (!duplicateUsernames.isEmpty()) {<NEW_LINE>errors.add("The following user names are not unique: " + Joiner.on(", ").join(duplicateUsernames));<NEW_LINE>}<NEW_LINE>if (!authHeaderIpRanges.isEmpty()) {<NEW_LINE>authHeaderIpRanges.forEach(x -> {<NEW_LINE>Matcher matcher = Pattern.compile("^((?:[0-9]{1,3}\\.){3}[0-9]{1,3}(-(?:[0-9]{1,3}\\.){3}[0-9]{1,3})?,?)+$").matcher(x);<NEW_LINE>if (!matcher.matches()) {<NEW_LINE>errors.add("IP range " + x + " is invalid");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return new ConfigValidationResult(errors.isEmpty(), isRestartNeeded(oldConfig.getAuth()), errors, warnings);<NEW_LINE>} | add(user.getUsername()); |
1,834,114 | public static QueryDomainListResponse unmarshall(QueryDomainListResponse queryDomainListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryDomainListResponse.setRequestId(_ctx.stringValue("QueryDomainListResponse.RequestId"));<NEW_LINE>queryDomainListResponse.setTotalItemNum(_ctx.integerValue("QueryDomainListResponse.TotalItemNum"));<NEW_LINE>queryDomainListResponse.setCurrentPageNum(_ctx.integerValue("QueryDomainListResponse.CurrentPageNum"));<NEW_LINE>queryDomainListResponse.setTotalPageNum<MASK><NEW_LINE>queryDomainListResponse.setPageSize(_ctx.integerValue("QueryDomainListResponse.PageSize"));<NEW_LINE>queryDomainListResponse.setPrePage(_ctx.booleanValue("QueryDomainListResponse.PrePage"));<NEW_LINE>queryDomainListResponse.setNextPage(_ctx.booleanValue("QueryDomainListResponse.NextPage"));<NEW_LINE>List<Domain> data = new ArrayList<Domain>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryDomainListResponse.Data.Length"); i++) {<NEW_LINE>Domain domain = new Domain();<NEW_LINE>domain.setDomainName(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainName"));<NEW_LINE>domain.setInstanceId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].InstanceId"));<NEW_LINE>domain.setExpirationDate(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ExpirationDate"));<NEW_LINE>domain.setRegistrationDate(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].RegistrationDate"));<NEW_LINE>domain.setDomainType(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainType"));<NEW_LINE>domain.setDomainStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainStatus"));<NEW_LINE>domain.setProductId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ProductId"));<NEW_LINE>domain.setExpirationDateLong(_ctx.longValue("QueryDomainListResponse.Data[" + i + "].ExpirationDateLong"));<NEW_LINE>domain.setRegistrationDateLong(_ctx.longValue("QueryDomainListResponse.Data[" + i + "].RegistrationDateLong"));<NEW_LINE>domain.setPremium(_ctx.booleanValue("QueryDomainListResponse.Data[" + i + "].Premium"));<NEW_LINE>domain.setDomainAuditStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainAuditStatus"));<NEW_LINE>domain.setExpirationDateStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ExpirationDateStatus"));<NEW_LINE>domain.setRegistrantType(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].RegistrantType"));<NEW_LINE>domain.setDomainGroupId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainGroupId"));<NEW_LINE>domain.setRemark(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].Remark"));<NEW_LINE>domain.setDomainGroupName(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainGroupName"));<NEW_LINE>domain.setExpirationCurrDateDiff(_ctx.integerValue("QueryDomainListResponse.Data[" + i + "].ExpirationCurrDateDiff"));<NEW_LINE>data.add(domain);<NEW_LINE>}<NEW_LINE>queryDomainListResponse.setData(data);<NEW_LINE>return queryDomainListResponse;<NEW_LINE>} | (_ctx.integerValue("QueryDomainListResponse.TotalPageNum")); |
8,706 | public Future<Void> streamToFileSystem(String filename) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (pipe != null) {<NEW_LINE>return context.failedFuture("Already streaming");<NEW_LINE>}<NEW_LINE>pipe = pipe().endOnComplete(true);<NEW_LINE>}<NEW_LINE>FileSystem fs = context.owner().fileSystem();<NEW_LINE>Future<AsyncFile> fut = fs.open<MASK><NEW_LINE>fut.onFailure(err -> {<NEW_LINE>pipe.close();<NEW_LINE>});<NEW_LINE>return fut.compose(f -> {<NEW_LINE>Future<Void> to = pipe.to(f);<NEW_LINE>return to.compose(v -> {<NEW_LINE>synchronized (HttpServerFileUploadImpl.this) {<NEW_LINE>if (!cancelled) {<NEW_LINE>file = f;<NEW_LINE>return context.succeededFuture();<NEW_LINE>}<NEW_LINE>fs.delete(filename);<NEW_LINE>return context.failedFuture("Streaming aborted");<NEW_LINE>}<NEW_LINE>}, err -> {<NEW_LINE>fs.delete(filename);<NEW_LINE>return context.failedFuture(err);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | (filename, new OpenOptions()); |
461,861 | public static boolean isOutputSoapEncoded(BindingOperation bindingOperation) {<NEW_LINE>if (bindingOperation == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (bindingOutput == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SOAPBody soapBody = WsdlUtils.getExtensiblityElement(bindingOutput.getExtensibilityElements(), SOAPBody.class);<NEW_LINE>if (soapBody != null) {<NEW_LINE>return soapBody.getUse() != null && soapBody.getUse().equalsIgnoreCase("encoded") && (soapBody.getEncodingStyles() == null || soapBody.getEncodingStyles().contains("http://schemas.xmlsoap.org/soap/encoding/"));<NEW_LINE>}<NEW_LINE>SOAP12Body soap12Body = WsdlUtils.getExtensiblityElement(bindingOutput.getExtensibilityElements(), SOAP12Body.class);<NEW_LINE>if (soap12Body != null) {<NEW_LINE>return soap12Body.getUse() != null && soap12Body.getUse().equalsIgnoreCase("encoded") && (soap12Body.getEncodingStyle() == null || soap12Body.getEncodingStyle().equals("http://schemas.xmlsoap.org/soap/encoding/"));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | BindingOutput bindingOutput = bindingOperation.getBindingOutput(); |
880,089 | public void onLoad(final LicenseManager licenseManager) {<NEW_LINE>// read configuration..<NEW_LINE>checkString("paypal.mode", Settings.getOrCreateStringSetting("paypal", "mode").getValue(), "paypal.mode not set, please set to either sandbox or live.");<NEW_LINE>checkString("paypal.username", Settings.getOrCreateStringSetting("paypal", "username").getValue(), "paypal.username not set in structr.conf.");<NEW_LINE>checkString("paypal.password", Settings.getOrCreateStringSetting("paypal", "password").getValue(), "paypal.password not set in structr.conf.");<NEW_LINE>checkString("paypal.signature", Settings.getOrCreateStringSetting("paypal", "signature").getValue(), "paypal.signature not set in structr.conf.");<NEW_LINE>checkString("paypal.redirect", Settings.getOrCreateStringSetting("paypal", "redirect"<MASK><NEW_LINE>checkString("stripe.apikey", Settings.getOrCreateStringSetting("stripe", "apikey").getValue(), "stripe.apikey not set in structr.conf.");<NEW_LINE>} | ).getValue(), "paypal.redirect not set in structr.conf."); |
1,230,259 | public static GetSimilarPhotosResponse unmarshall(GetSimilarPhotosResponse getSimilarPhotosResponse, UnmarshallerContext context) {<NEW_LINE>getSimilarPhotosResponse.setRequestId(context.stringValue("GetSimilarPhotosResponse.RequestId"));<NEW_LINE>getSimilarPhotosResponse.setCode(context.stringValue("GetSimilarPhotosResponse.Code"));<NEW_LINE>getSimilarPhotosResponse.setMessage(context.stringValue("GetSimilarPhotosResponse.Message"));<NEW_LINE>getSimilarPhotosResponse.setAction(context.stringValue("GetSimilarPhotosResponse.Action"));<NEW_LINE>List<Photo> photos = new ArrayList<Photo>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetSimilarPhotosResponse.Photos.Length"); i++) {<NEW_LINE>Photo photo = new Photo();<NEW_LINE>photo.setId(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Id"));<NEW_LINE>photo.setIdStr(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].IdStr"));<NEW_LINE>photo.setTitle(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].Title"));<NEW_LINE>photo.setFileId(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].FileId"));<NEW_LINE>photo.setLocation(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].Location"));<NEW_LINE>photo.setState(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].State"));<NEW_LINE>photo.setMd5(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].Md5"));<NEW_LINE>photo.setIsVideo(context.booleanValue("GetSimilarPhotosResponse.Photos[" + i + "].IsVideo"));<NEW_LINE>photo.setRemark(context.stringValue("GetSimilarPhotosResponse.Photos[" + i + "].Remark"));<NEW_LINE>photo.setSize(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Size"));<NEW_LINE>photo.setWidth(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Width"));<NEW_LINE>photo.setHeight(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Height"));<NEW_LINE>photo.setCtime(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Ctime"));<NEW_LINE>photo.setMtime(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].Mtime"));<NEW_LINE>photo.setTakenAt(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].TakenAt"));<NEW_LINE>photo.setInactiveTime(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].InactiveTime"));<NEW_LINE>photo.setShareExpireTime(context.longValue("GetSimilarPhotosResponse.Photos[" + i + "].ShareExpireTime"));<NEW_LINE>photo.setLike(context.longValue<MASK><NEW_LINE>photos.add(photo);<NEW_LINE>}<NEW_LINE>getSimilarPhotosResponse.setPhotos(photos);<NEW_LINE>return getSimilarPhotosResponse;<NEW_LINE>} | ("GetSimilarPhotosResponse.Photos[" + i + "].Like")); |
1,004,806 | public CodecDocument openDocumentInner(final String fileName, String password) {<NEW_LINE><MASK><NEW_LINE>Map<String, String> notes = null;<NEW_LINE>if (AppState.get().isShowFooterNotesInText) {<NEW_LINE>notes = getNotes(fileName);<NEW_LINE>LOG.d("footer-notes-extracted");<NEW_LINE>}<NEW_LINE>if ((BookCSS.get().isAutoHypens || AppState.get().isReferenceMode || AppState.get().isShowFooterNotesInText) && !cacheFile.isFile()) {<NEW_LINE>EpubExtractor.proccessHypens(fileName, cacheFile.getPath(), notes);<NEW_LINE>}<NEW_LINE>if (TempHolder.get().loadingCancelled) {<NEW_LINE>removeTempFiles();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String bookPath = (BookCSS.get().isAutoHypens || AppState.get().isReferenceMode || AppState.get().isShowFooterNotesInText) ? cacheFile.getPath() : fileName;<NEW_LINE>final MuPdfDocument muPdfDocument = new MuPdfDocument(this, MuPdfDocument.FORMAT_PDF, bookPath, password);<NEW_LINE>if (notes != null) {<NEW_LINE>muPdfDocument.setFootNotes(notes);<NEW_LINE>}<NEW_LINE>new Thread("@T openDocument") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>muPdfDocument.setMediaAttachment(EpubExtractor.getAttachments(fileName));<NEW_LINE>if (muPdfDocument.getFootNotes() == null) {<NEW_LINE>muPdfDocument.setFootNotes(getNotes(fileName));<NEW_LINE>}<NEW_LINE>removeTempFiles();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>return muPdfDocument;<NEW_LINE>} | LOG.d(TAG, fileName); |
862,286 | protected void openTorrent(String text, String newReferrer) {<NEW_LINE>if (newReferrer != null && newReferrer.length() > 0) {<NEW_LINE>if (!referrers.contains(newReferrer)) {<NEW_LINE>referrers.add(newReferrer);<NEW_LINE>COConfigurationManager.setParameter("url_open_referrers", referrers);<NEW_LINE>COConfigurationManager.save();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>COConfigurationManager.save();<NEW_LINE>}<NEW_LINE>final String[] splitters = { "\r\n", "\n", "\r", "\t" };<NEW_LINE>String[] lines = null;<NEW_LINE>for (int i = 0; i < splitters.length; i++) {<NEW_LINE>if (text.contains(splitters[i])) {<NEW_LINE>lines = text.split(splitters[i]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lines == null) {<NEW_LINE>lines = new String[] { text };<NEW_LINE>}<NEW_LINE>TorrentOpener.openTorrentsFromStrings(new TorrentOpenOptions(null), parent, null, lines, newReferrer, this, false);<NEW_LINE>} | COConfigurationManager.setParameter(CONFIG_REFERRER_DEFAULT, newReferrer); |
1,106,830 | public void addTab(String tabName, GridTab gTab, Component tabElement) {<NEW_LINE>int index = getTabCount();<NEW_LINE>tabNames.add(tabName);<NEW_LINE>gTabs.add(gTab);<NEW_LINE>components.add(tabElement);<NEW_LINE>try {<NEW_LINE>log.fine(tabName + " GridTab.Icon:" + gTab.getIcon() + " tabElement:" + tabElement + " GridTab.Description:" + gTab.getDescription());<NEW_LINE>super.addTab(tabName, gTab.getIcon(), tabElement, gTab.getDescription());<NEW_LINE>} catch (ArrayIndexOutOfBoundsException e) {<NEW_LINE>// See https://github.com/adempiere/adempiere/issues/2424<NEW_LINE>log.config(e.toString() + " catched. addTab(" + tabName + ")! Do not rethrow to the ui.");<NEW_LINE>}<NEW_LINE>ArrayList<String> dependents = gTab.getDependentOn();<NEW_LINE>for (int i = 0; i < dependents.size(); i++) {<NEW_LINE>String name = dependents.get(i);<NEW_LINE>if (!m_dependents.contains(name))<NEW_LINE>m_dependents.add(name);<NEW_LINE>}<NEW_LINE>if (s_disabledIcon == null)<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>setDisabledIconAt(index, s_disabledIcon);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// See https://github.com/adempiere/adempiere/issues/2424<NEW_LINE>log.config(e.toString() + " catched. setDisabledIconAt! Do not rethrow to the ui.");<NEW_LINE>}<NEW_LINE>} | s_disabledIcon = Env.getImageIcon("Cancel10.gif"); |
291,182 | public static DescribeDnsGtmInstancesResponse unmarshall(DescribeDnsGtmInstancesResponse describeDnsGtmInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDnsGtmInstancesResponse.setRequestId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.RequestId"));<NEW_LINE>describeDnsGtmInstancesResponse.setPageSize(_ctx.integerValue("DescribeDnsGtmInstancesResponse.PageSize"));<NEW_LINE>describeDnsGtmInstancesResponse.setPageNumber(_ctx.integerValue("DescribeDnsGtmInstancesResponse.PageNumber"));<NEW_LINE>describeDnsGtmInstancesResponse.setTotalPages(_ctx.integerValue("DescribeDnsGtmInstancesResponse.TotalPages"));<NEW_LINE>describeDnsGtmInstancesResponse.setTotalItems(_ctx.integerValue("DescribeDnsGtmInstancesResponse.TotalItems"));<NEW_LINE>List<GtmInstance> gtmInstances = new ArrayList<GtmInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDnsGtmInstancesResponse.GtmInstances.Length"); i++) {<NEW_LINE>GtmInstance gtmInstance = new GtmInstance();<NEW_LINE>gtmInstance.setPaymentType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].PaymentType"));<NEW_LINE>gtmInstance.setExpireTime(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ExpireTime"));<NEW_LINE>gtmInstance.setCreateTime(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].CreateTime"));<NEW_LINE>gtmInstance.setSmsQuota(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].SmsQuota"));<NEW_LINE>gtmInstance.setInstanceId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].InstanceId"));<NEW_LINE>gtmInstance.setExpireTimestamp(_ctx.longValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ExpireTimestamp"));<NEW_LINE>gtmInstance.setResourceGroupId(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].ResourceGroupId"));<NEW_LINE>gtmInstance.setVersionCode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].VersionCode"));<NEW_LINE>gtmInstance.setTaskQuota(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].TaskQuota"));<NEW_LINE>gtmInstance.setCreateTimestamp(_ctx.longValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].CreateTimestamp"));<NEW_LINE>Config config = new Config();<NEW_LINE>config.setTtl(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.Ttl"));<NEW_LINE>config.setAlertGroup(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertGroup"));<NEW_LINE>config.setPublicZoneName(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicZoneName"));<NEW_LINE>config.setCnameType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.CnameType"));<NEW_LINE>config.setStrategyMode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.StrategyMode"));<NEW_LINE>config.setInstanceName(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.InstanceName"));<NEW_LINE>config.setPublicCnameMode(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicCnameMode"));<NEW_LINE>config.setPublicUserDomainName(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicUserDomainName"));<NEW_LINE>config.setPublicRr(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.PublicRr"));<NEW_LINE>List<AlertConfigItem> alertConfig = new ArrayList<AlertConfigItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig.Length"); j++) {<NEW_LINE>AlertConfigItem alertConfigItem = new AlertConfigItem();<NEW_LINE>alertConfigItem.setSmsNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].SmsNotice"));<NEW_LINE>alertConfigItem.setNoticeType(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].NoticeType"));<NEW_LINE>alertConfigItem.setEmailNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i <MASK><NEW_LINE>alertConfigItem.setDingtalkNotice(_ctx.stringValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].Config.AlertConfig[" + j + "].DingtalkNotice"));<NEW_LINE>alertConfig.add(alertConfigItem);<NEW_LINE>}<NEW_LINE>config.setAlertConfig(alertConfig);<NEW_LINE>gtmInstance.setConfig(config);<NEW_LINE>UsedQuota usedQuota = new UsedQuota();<NEW_LINE>usedQuota.setEmailUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.EmailUsedCount"));<NEW_LINE>usedQuota.setTaskUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.TaskUsedCount"));<NEW_LINE>usedQuota.setSmsUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.SmsUsedCount"));<NEW_LINE>usedQuota.setDingtalkUsedCount(_ctx.integerValue("DescribeDnsGtmInstancesResponse.GtmInstances[" + i + "].UsedQuota.DingtalkUsedCount"));<NEW_LINE>gtmInstance.setUsedQuota(usedQuota);<NEW_LINE>gtmInstances.add(gtmInstance);<NEW_LINE>}<NEW_LINE>describeDnsGtmInstancesResponse.setGtmInstances(gtmInstances);<NEW_LINE>return describeDnsGtmInstancesResponse;<NEW_LINE>} | + "].Config.AlertConfig[" + j + "].EmailNotice")); |
401,999 | protected GroupInfo<MetaPropertyPath> groupItems(int propertyIndex, @Nullable GroupInfo parent, List<GroupInfo> children, E item, LinkedMap<MetaPropertyPath, Object> groupValues) {<NEW_LINE>MetaPropertyPath property = (MetaPropertyPath) groupProperties[propertyIndex++];<NEW_LINE>Object itemValue = getValueByProperty(item, property);<NEW_LINE>groupValues.put(property, itemValue);<NEW_LINE>GroupInfo<MetaPropertyPath> groupInfo = new GroupInfo<>(groupValues);<NEW_LINE>itemGroups.put(item.getId(), groupInfo);<NEW_LINE>if (!parents.containsKey(groupInfo)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (!children.contains(groupInfo)) {<NEW_LINE>children.add(groupInfo);<NEW_LINE>}<NEW_LINE>List<GroupInfo> groupChildren = this.children.computeIfAbsent(groupInfo, k -> new ArrayList<>());<NEW_LINE>if (propertyIndex < groupProperties.length) {<NEW_LINE>groupInfo = groupItems(propertyIndex, groupInfo, groupChildren, item, groupValues);<NEW_LINE>}<NEW_LINE>return groupInfo;<NEW_LINE>} | parents.put(groupInfo, parent); |
369,535 | private void printThreadSummary(ImageProcess ip) {<NEW_LINE>// Prints a summary list of native thread IDs<NEW_LINE>int count = 0;<NEW_LINE>Iterator<?<MASK><NEW_LINE>while (itThread.hasNext()) {<NEW_LINE>Object next = itThread.next();<NEW_LINE>if (next instanceof CorruptData) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ImageThread it = (ImageThread) next;<NEW_LINE>if (count % 8 == 0) {<NEW_LINE>out.println();<NEW_LINE>if (0 == count) {<NEW_LINE>out.println();<NEW_LINE>out.println("Native thread IDs for current process:");<NEW_LINE>}<NEW_LINE>out.print(" ");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>out.print(Utils.padWithSpaces(it.getID(), 8));<NEW_LINE>} catch (CorruptDataException e) {<NEW_LINE>out.print(Exceptions.getCorruptDataExceptionString());<NEW_LINE>}<NEW_LINE>count += 1;<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>} | > itThread = ip.getThreads(); |
1,071,902 | private ResponseSpec createUserRequestCreation(User user) throws WebClientResponseException {<NEW_LINE>Object postBody = user;<NEW_LINE>// verify the required parameter 'user' is set<NEW_LINE>if (user == null) {<NEW_LINE>throw new WebClientResponseException("Missing the required parameter 'user' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(<MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> pathParams = new HashMap<String, Object>();<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | ), null, null, null); |
348,331 | private void addHighlightElements(String query, int parent, String code, int index) {<NEW_LINE>NodeList<Element> els = DomUtils.querySelectorAll(Document.get().getBody(), query);<NEW_LINE>// guard against queries that might select an excessive number<NEW_LINE>// of UI elements<NEW_LINE>int n = Math.min(HIGHLIGHT_ELEMENT_MAX, els.getLength());<NEW_LINE>if (n == 0)<NEW_LINE>return;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>// retrieve the requested element (selecting a parent if so requested)<NEW_LINE>Element el = els.getItem(i);<NEW_LINE>for (int j = 0; j < parent; j++) el = el.getParentElement();<NEW_LINE>// create highlight element<NEW_LINE>Element highlightEl = Document.get().createDivElement();<NEW_LINE>if (!RStudioGinjector.INSTANCE.getUserPrefs().reducedMotion().getValue())<NEW_LINE>highlightEl.addClassName(RES.styles().highlightEl());<NEW_LINE>else<NEW_LINE>highlightEl.addClassName(RES.<MASK><NEW_LINE>Document.get().getBody().appendChild(highlightEl);<NEW_LINE>// record the pair of elements<NEW_LINE>if (StringUtil.isNullOrEmpty(code))<NEW_LINE>highlightPairs_.add(new HighlightPair(el, highlightEl));<NEW_LINE>else<NEW_LINE>highlightPairs_.add(new HighlightPair(el, highlightEl, code, this, index));<NEW_LINE>}<NEW_LINE>repositionTimer_.schedule(REPOSITION_DELAY_MS);<NEW_LINE>repositionHighlighters();<NEW_LINE>} | styles().staticHighlightEl()); |
855,443 | protected Integer run(IPersistentMap map) {<NEW_LINE>ESeq vals = ERT.NIL;<NEW_LINE>int initial_count = sizeRef.get();<NEW_LINE>EObject key = matcher.getTupleKey(keypos1);<NEW_LINE>if (key == null) {<NEW_LINE>vals = matcher.matching_values_bag(vals, (Map<EObject, IPersistentCollection>) map);<NEW_LINE>} else {<NEW_LINE>IPersistentCollection coll = (IPersistentCollection) map.valAt(key);<NEW_LINE>if (coll != null) {<NEW_LINE>vals = matcher.matching_values_coll(vals, coll.seq());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>for (; !vals.isNil(); vals = vals.tail()) {<NEW_LINE>try {<NEW_LINE>ETuple val = (ETuple) vals.head();<NEW_LINE>key = val.elm(keypos1);<NEW_LINE>IPersistentCollection coll = (IPersistentCollection) map.valAt(key);<NEW_LINE>if (coll instanceof IPersistentSet) {<NEW_LINE>IPersistentSet set = (IPersistentSet) coll;<NEW_LINE>set = set.disjoin(val);<NEW_LINE>if (set != coll) {<NEW_LINE>count += 1;<NEW_LINE>if (set.count() == 0) {<NEW_LINE>map = map.without(key);<NEW_LINE>} else {<NEW_LINE>map = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (coll instanceof IPersistentBag) {<NEW_LINE>IPersistentBag bag = (IPersistentBag) coll;<NEW_LINE>bag = bag.disjoin(val);<NEW_LINE>if (bag != coll) {<NEW_LINE>count += 1;<NEW_LINE>if (bag.count() == 0) {<NEW_LINE>map = map.without(key);<NEW_LINE>} else {<NEW_LINE>map = map.assoc(key, bag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// should not happen!<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>set(map);<NEW_LINE>sizeRef.set(initial_count - count);<NEW_LINE>return count;<NEW_LINE>} | map.assoc(key, set); |
205,465 | public static String renderResponseContent(String requestBody, String requestResourcePath, HttpServletRequest request, Response response) {<NEW_LINE>if (response.getContent().contains(TemplateEngine.DEFAULT_EXPRESSION_PREFIX)) {<NEW_LINE>log.debug("Response contains dynamic EL expression, rendering it...");<NEW_LINE>TemplateEngine engine = TemplateEngineFactory.getTemplateEngine();<NEW_LINE>// Create and fill an evaluable request object.<NEW_LINE>EvaluableRequest evaluableRequest = new EvaluableRequest(requestBody, requestResourcePath != null ? requestResourcePath.split("/") : null);<NEW_LINE>// Adding query parameters...<NEW_LINE>Map<String, String> evaluableParams = new HashMap<>();<NEW_LINE>List<String> parameterNames = Collections.<MASK><NEW_LINE>for (String parameter : parameterNames) {<NEW_LINE>evaluableParams.put(parameter, request.getParameter(parameter));<NEW_LINE>}<NEW_LINE>evaluableRequest.setParams(evaluableParams);<NEW_LINE>// Adding headers...<NEW_LINE>Map<String, String> evaluableHeaders = new HashMap<>();<NEW_LINE>List<String> headerNames = Collections.list(request.getHeaderNames());<NEW_LINE>for (String header : headerNames) {<NEW_LINE>evaluableHeaders.put(header, request.getHeader(header));<NEW_LINE>}<NEW_LINE>evaluableRequest.setHeaders(evaluableHeaders);<NEW_LINE>// Register the request variable and evaluate the response.<NEW_LINE>engine.getContext().setVariable("request", evaluableRequest);<NEW_LINE>try {<NEW_LINE>return engine.getValue(response.getContent());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.error("Failing at evaluating template " + response.getContent(), t);<NEW_LINE>return response.getContent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response.getContent();<NEW_LINE>} | list(request.getParameterNames()); |
809,210 | public void write(Node node, EntityMetadata entityMetadata, String persistenceUnit, ConsistencyLevel consistencyLevel, CassandraDataHandler cdHandler) {<NEW_LINE>// Index in Inverted Index table if applicable<NEW_LINE>boolean invertedIndexingApplicable = <MASK><NEW_LINE>if (invertedIndexingApplicable) {<NEW_LINE>String indexColumnFamily = CassandraIndexHelper.getInvertedIndexTableName(entityMetadata.getTableName());<NEW_LINE>Mutator mutator = pelopsClient.getMutator();<NEW_LINE>List<ThriftRow> indexThriftyRows = ((PelopsDataHandler) cdHandler).toIndexThriftRow(node.getData(), entityMetadata, indexColumnFamily);<NEW_LINE>for (ThriftRow thriftRow : indexThriftyRows) {<NEW_LINE>List<Column> thriftColumns = thriftRow.getColumns();<NEW_LINE>List<SuperColumn> thriftSuperColumns = thriftRow.getSuperColumns();<NEW_LINE>if (thriftColumns != null && !thriftColumns.isEmpty()) {<NEW_LINE>// Bytes.fromL<NEW_LINE>mutator.writeColumns(thriftRow.getColumnFamilyName(), Bytes.fromByteBuffer(CassandraUtilities.toBytes(thriftRow.getId(), thriftRow.getId().getClass())), Arrays.asList(thriftRow.getColumns().toArray(new Column[0])));<NEW_LINE>}<NEW_LINE>if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {<NEW_LINE>for (SuperColumn sc : thriftSuperColumns) {<NEW_LINE>mutator.writeSubColumns(thriftRow.getColumnFamilyName(), Bytes.fromByteBuffer(CassandraUtilities.toBytes(thriftRow.getId(), thriftRow.getId().getClass())), Bytes.fromByteArray(sc.getName()), sc.getColumns());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mutator.execute(consistencyLevel);<NEW_LINE>indexThriftyRows = null;<NEW_LINE>}<NEW_LINE>} | CassandraIndexHelper.isInvertedIndexingApplicable(entityMetadata, useSecondryIndex); |
1,310,120 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.commands.spi.ICommandExecutionEncoder#encodeSystemCommand(com.<NEW_LINE>* sitewhere.spi.device.command.ISystemCommand,<NEW_LINE>* com.sitewhere.spi.device.IDeviceNestingContext, java.util.List)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public byte[] encodeSystemCommand(ISystemCommand command, IDeviceNestingContext nested, List<? extends IDeviceAssignment> assignments) throws SiteWhereException {<NEW_LINE>switch(command.getType()) {<NEW_LINE>case RegistrationAck:<NEW_LINE>{<NEW_LINE>IRegistrationAckCommand ack = (IRegistrationAckCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>switch(ack.getReason()) {<NEW_LINE>case AlreadyRegistered:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.ALREADY_REGISTERED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case NewRegistration:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.NEW_REGISTRATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeRegistrationAck(builder.build());<NEW_LINE>}<NEW_LINE>case RegistrationFailure:<NEW_LINE>{<NEW_LINE>IRegistrationFailureCommand fail = (IRegistrationFailureCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>builder.setState(RegistrationAckState.REGISTRATION_ERROR);<NEW_LINE>builder.setErrorMessage(GOptionalString.newBuilder().setValue(fail.getErrorMessage()));<NEW_LINE>switch(fail.getReason()) {<NEW_LINE>case NewDevicesNotAllowed:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.NEW_DEVICES_NOT_ALLOWED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case InvalidDeviceTypeToken:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.INVALID_SPECIFICATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SiteTokenRequired:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.SITE_TOKEN_REQUIRED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeRegistrationAck(builder.build());<NEW_LINE>}<NEW_LINE>case DeviceStreamAck:<NEW_LINE>{<NEW_LINE>IDeviceStreamAckCommand ack = (IDeviceStreamAckCommand) command;<NEW_LINE>DeviceStreamAck.Builder builder = DeviceStreamAck.newBuilder();<NEW_LINE>switch(ack.getStatus()) {<NEW_LINE>case DeviceStreamCreated:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_CREATED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamExists:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_EXISTS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamFailed:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_FAILED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeDeviceStreamAck(builder.build());<NEW_LINE>}<NEW_LINE>case SendDeviceStreamData:<NEW_LINE>{<NEW_LINE>ISendDeviceStreamDataCommand send = (ISendDeviceStreamDataCommand) command;<NEW_LINE>DeviceStreamData.Builder builder = DeviceStreamData.newBuilder();<NEW_LINE>builder.setDeviceToken(GOptionalString.newBuilder().setValue(send.getDeviceToken()));<NEW_LINE>builder.setSequenceNumber(GOptionalFixed64.newBuilder().setValue(send.getSequenceNumber()));<NEW_LINE>builder.setData(ByteString.copyFrom(send.getData()));<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>case DeviceMappingAck:<NEW_LINE>{<NEW_LINE>String json = MarshalUtils.marshalJsonAsPrettyString(command);<NEW_LINE>getLogger().warn("No protocol buffer encoding implemented for sending device mapping acknowledgement.");<NEW_LINE>getLogger().info("JSON representation of command is:\n" + json + "\n");<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SiteWhereException("Unable to encode command: " + command.getClass().getName());<NEW_LINE>} | encodeSendDeviceStreamData(builder.build()); |
1,203,427 | private void fireProgressEvent(int state, int progress, String messageKey, RepositoryResource installResource) throws InstallException {<NEW_LINE>String resourceName = null;<NEW_LINE>if (installResource instanceof EsaResource) {<NEW_LINE>EsaResource esar = ((EsaResource) installResource);<NEW_LINE>if (esar.getVisibility().equals(Visibility.PUBLIC) || esar.getVisibility().equals(Visibility.INSTALL)) {<NEW_LINE>resourceName = (esar.getShortName() == null) ? installResource.getName() : esar.getShortName();<NEW_LINE>} else if (!firePublicAssetOnly && messageKey.equals("STATE_DOWNLOADING")) {<NEW_LINE>messageKey = "STATE_DOWNLOADING_DEPENDENCY";<NEW_LINE>resourceName = "";<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (installResource instanceof SampleResource) {<NEW_LINE>SampleResource sr = ((SampleResource) installResource);<NEW_LINE>resourceName = sr.getShortName() == null ? installResource.getName() : sr.getShortName();<NEW_LINE>} else {<NEW_LINE>resourceName = installResource.getName();<NEW_LINE>}<NEW_LINE>fireProgressEvent(state, progress, Messages.INSTALL_KERNEL_MESSAGES<MASK><NEW_LINE>} | .getLogMessage(messageKey, resourceName)); |
1,578,725 | public <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> writeStatsRequest(OFStatsRequest<REPLY> request) {<NEW_LINE>if (!isConnected()) {<NEW_LINE>return Futures.immediateFailedFuture(<MASK><NEW_LINE>}<NEW_LINE>final DeliverableListenableFuture<List<REPLY>> future = new DeliverableListenableFuture<List<REPLY>>(request);<NEW_LINE>Deliverable<REPLY> deliverable = new Deliverable<REPLY>() {<NEW_LINE><NEW_LINE>private final List<REPLY> results = Collections.synchronizedList(new ArrayList<REPLY>());<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void deliver(REPLY reply) {<NEW_LINE>results.add(reply);<NEW_LINE>if (!reply.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {<NEW_LINE>// done<NEW_LINE>future.deliver(results);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void deliverError(Throwable cause) {<NEW_LINE>future.deliverError(cause);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isDone() {<NEW_LINE>return future.isDone();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean cancel(boolean mayInterruptIfRunning) {<NEW_LINE>return future.cancel(mayInterruptIfRunning);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OFMessage getRequest() {<NEW_LINE>return future.getRequest();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>registerDeliverable(request.getXid(), deliverable);<NEW_LINE>this.write(request);<NEW_LINE>return future;<NEW_LINE>} | new SwitchDisconnectedException(getDatapathId())); |
999,600 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>ExpressionFactory factory = ExpressionFactory.newInstance();<NEW_LINE>ELContextImpl context = new ELContextImpl(factory);<NEW_LINE>PrintWriter pw = response.getWriter();<NEW_LINE>ELResolver elResolver = ELContextImpl.getDefaultResolver(factory);<NEW_LINE>// Getting all EL Resolvers from the CompositeELResolver<NEW_LINE>pw.println("ELResolvers.");<NEW_LINE>ELResolver[] resolvers = getELResolvers(elResolver, pw);<NEW_LINE>if (checkOrderAndSize(resolvers, pw)) {<NEW_LINE>pw.println("The order and number of ELResolvers from the CompositeELResolver are correct!");<NEW_LINE>} else {<NEW_LINE>pw.println("Error: Order and number of ELResolvers are incorrect!");<NEW_LINE>}<NEW_LINE>// Test the behavior of the new ELResolvers. That is the StaticFieldELResolver and StreamELResolver.<NEW_LINE>pw.println("\nTesting implementation.");<NEW_LINE>try {<NEW_LINE>ELClass elClass = new ELClass(Boolean.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Boolean.TRUE (Expected: true): " + elResolver.getValue(context, elClass, "TRUE"));<NEW_LINE>elClass = new ELClass(Integer.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Integer.parseInt (Expected: 86): " + elResolver.invoke(context, elClass, "parseInt", new Class<?>[] { String.class, Integer.class }, new Object[] { "1010110", 2 }));<NEW_LINE>Stream stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with distinct method (Expected: [1, 4, 3, 2, 5]): " + stream.distinct().toList());<NEW_LINE>ELProcessor elp = new ELProcessor();<NEW_LINE>LambdaExpression expression = (LambdaExpression) elp.eval("e->e>2");<NEW_LINE>stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with filter method (Expected: [4, 3, 5, 3]): " + stream.filter(expression).toList());<NEW_LINE>} catch (Exception e) {<NEW_LINE>pw.println(<MASK><NEW_LINE>pw.println("Test Failed. An exception was thrown: " + e.toString());<NEW_LINE>}<NEW_LINE>} | "Exception caught: " + e.getMessage()); |
260,075 | private void routeWithMultipleTables(final RouteContext routeContext, final ShardingRule shardingRule) throws ShardingSphereConfigurationException {<NEW_LINE>List<RouteMapper> tableMappers = new ArrayList<>(logicTables.size());<NEW_LINE>Set<String> availableDatasourceNames = Collections.emptySet();<NEW_LINE>boolean first = true;<NEW_LINE>for (String each : logicTables) {<NEW_LINE>TableRule <MASK><NEW_LINE>DataNode dataNode = tableRule.getActualDataNodes().get(0);<NEW_LINE>tableMappers.add(new RouteMapper(each, dataNode.getTableName()));<NEW_LINE>Set<String> currentDataSourceNames = tableRule.getActualDataNodes().stream().map(DataNode::getDataSourceName).collect(Collectors.toCollection(() -> new HashSet<>(tableRule.getActualDatasourceNames().size())));<NEW_LINE>if (first) {<NEW_LINE>availableDatasourceNames = currentDataSourceNames;<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>availableDatasourceNames = Sets.intersection(availableDatasourceNames, currentDataSourceNames);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (availableDatasourceNames.isEmpty()) {<NEW_LINE>throw new ShardingSphereConfigurationException("Cannot find actual datasource intersection for logic tables: %s", logicTables);<NEW_LINE>}<NEW_LINE>String dataSourceName = getRandomDataSourceName(availableDatasourceNames);<NEW_LINE>routeContext.getRouteUnits().add(new RouteUnit(new RouteMapper(dataSourceName, dataSourceName), tableMappers));<NEW_LINE>} | tableRule = shardingRule.getTableRule(each); |
287,676 | public String createStreamInfo(InlongStreamInfo streamInfo) {<NEW_LINE>String path = HTTP_PATH + "/stream/save";<NEW_LINE>final String stream = GsonUtil.toJson(streamInfo);<NEW_LINE>final RequestBody streamBody = RequestBody.create(MediaType.parse("application/json"), stream);<NEW_LINE>final String url = formatUrl(path);<NEW_LINE>Request request = new Request.Builder().url(url).method("POST", streamBody).build();<NEW_LINE>Call call = httpClient.newCall(request);<NEW_LINE>try {<NEW_LINE>okhttp3.Response response = call.execute();<NEW_LINE>assert response.body() != null;<NEW_LINE>String body = response.body().string();<NEW_LINE>assertHttpSuccess(response, body, path);<NEW_LINE>Response responseBody = InlongParser.parseResponse(body);<NEW_LINE>AssertUtil.isTrue(responseBody.getErrMsg() == null, String.format("Inlong request failed: %s", responseBody.getErrMsg()));<NEW_LINE>return responseBody.getData().toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(String.format("Inlong stream save failed: %s", e<MASK><NEW_LINE>}<NEW_LINE>} | .getMessage()), e); |
724,042 | private void handlePutAndGetOps(AbstractConstantPoolInfoJava poolRef, Record res, String op) {<NEW_LINE>int name_and_type_index = ((ConstantPoolFieldReferenceInfo) poolRef).getNameAndTypeIndex();<NEW_LINE>ConstantPoolNameAndTypeInfo fieldNameAndType <MASK><NEW_LINE>int name_index = fieldNameAndType.getNameIndex();<NEW_LINE>switch(op) {<NEW_LINE>case CPOOL_GETFIELD:<NEW_LINE>case CPOOL_PUTFIELD:<NEW_LINE>res.token = ((ConstantPoolUtf8Info) constantPool[name_index]).getString();<NEW_LINE>break;<NEW_LINE>case CPOOL_GETSTATIC:<NEW_LINE>case CPOOL_PUTSTATIC:<NEW_LINE>int class_index = ((ConstantPoolFieldReferenceInfo) poolRef).getClassIndex();<NEW_LINE>ConstantPoolClassInfo classInfo = (ConstantPoolClassInfo) constantPool[class_index];<NEW_LINE>int classNameIndex = classInfo.getNameIndex();<NEW_LINE>String fullyQualifiedName = ((ConstantPoolUtf8Info) constantPool[classNameIndex]).getString();<NEW_LINE>String className = getClassName(fullyQualifiedName);<NEW_LINE>res.token = className + "." + ((ConstantPoolUtf8Info) constantPool[name_index]).getString();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Invalid op: " + op);<NEW_LINE>}<NEW_LINE>res.tag = ConstantPool.POINTER_FIELD;<NEW_LINE>int descriptor_index = fieldNameAndType.getDescriptorIndex();<NEW_LINE>ConstantPoolUtf8Info descriptorInfo = (ConstantPoolUtf8Info) constantPool[descriptor_index];<NEW_LINE>String descriptor = descriptorInfo.getString();<NEW_LINE>DataType type = DescriptorDecoder.getDataTypeOfDescriptor(descriptor, dtManager);<NEW_LINE>res.type = new PointerDataType(type);<NEW_LINE>} | = (ConstantPoolNameAndTypeInfo) constantPool[name_and_type_index]; |
942,555 | public void deleteDatasetTags(DeleteDatasetTags request, StreamObserver<DeleteDatasetTags.Response> responseObserver) {<NEW_LINE>try {<NEW_LINE>// Request Parameter Validation<NEW_LINE>String errorMessage = null;<NEW_LINE>if (request.getId().isEmpty() && request.getTagsList().isEmpty() && !request.getDeleteAll()) {<NEW_LINE>errorMessage = "Dataset ID and Dataset tags not found in DeleteDatasetTags request";<NEW_LINE>} else if (request.getId().isEmpty()) {<NEW_LINE>errorMessage = ModelDBMessages.DATASET_ID_NOT_FOUND_IN_REQUEST;<NEW_LINE>} else if (request.getTagsList().isEmpty() && !request.getDeleteAll()) {<NEW_LINE>errorMessage = "Dataset tags not found in DeleteDatasetTags request";<NEW_LINE>}<NEW_LINE>if (errorMessage != null) {<NEW_LINE>throw new InvalidArgumentException(errorMessage);<NEW_LINE>}<NEW_LINE>// Validate if current user has access to the entity or not<NEW_LINE>mdbRoleService.validateEntityUserWithUserInfo(ModelDBServiceResourceTypes.DATASET, request.getId(), ModelDBServiceActions.UPDATE);<NEW_LINE>var updatedDataset = repositoryDAO.deleteDatasetTags(metadataDAO, request.getId(), request.getTagsList(), request.getDeleteAll());<NEW_LINE>var response = DeleteDatasetTags.Response.newBuilder().setDataset(updatedDataset).build();<NEW_LINE>// Add succeeded event in local DB<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>if (request.getDeleteAll()) {<NEW_LINE>extraField.put("tags_delete_all", true);<NEW_LINE>} else {<NEW_LINE>extraField.put("tags", new Gson().toJsonTree(request.getTagsList(), new TypeToken<ArrayList<String>>() {<NEW_LINE>}.getType()));<NEW_LINE>}<NEW_LINE>addEvent(response.getDataset().getId(), Optional.of(response.getDataset().getWorkspaceServiceId()), UPDATE_DATASET_EVENT_TYPE, Optional.of("tags"), extraField, "dataset tags deleted successfully");<NEW_LINE>responseObserver.onNext(response);<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e, DeleteDatasetTags.Response.getDefaultInstance());<NEW_LINE>}<NEW_LINE>} | extraField = new HashMap<>(); |
1,651,258 | public Consumer<Assembler.CodeAnnotation> newConsumer(CompilationResult compilationResult) {<NEW_LINE>return new Consumer<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(Assembler.CodeAnnotation annotation) {<NEW_LINE>if (annotation instanceof SingleInstructionAnnotation) {<NEW_LINE>compilationResult.addAnnotation(new SingleInstructionNativeImagePatcher((SingleInstructionAnnotation) annotation));<NEW_LINE>} else if (annotation instanceof AArch64MacroAssembler.MovSequenceAnnotation) {<NEW_LINE>compilationResult.addAnnotation(new MovSequenceNativeImagePatcher((AArch64MacroAssembler.MovSequenceAnnotation) annotation));<NEW_LINE>} else if (annotation instanceof AArch64MacroAssembler.AdrpLdrMacroInstruction) {<NEW_LINE>compilationResult.addAnnotation(new AdrpLdrMacroInstructionNativeImagePatcher(<MASK><NEW_LINE>} else if (annotation instanceof AArch64MacroAssembler.AdrpAddMacroInstruction) {<NEW_LINE>compilationResult.addAnnotation(new AdrpAddMacroInstructionNativeImagePatcher((AArch64MacroAssembler.AdrpAddMacroInstruction) annotation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | (AArch64MacroAssembler.AdrpLdrMacroInstruction) annotation)); |
1,554,547 | protected void addSupportingTokens(List<WSEncryptionPart> sigs) throws WSSecurityException {<NEW_LINE>Collection<AssertionInfo> sgndSuppTokens = PolicyUtils.<MASK><NEW_LINE>List<SupportingToken> sigSuppTokList = this.handleSupportingTokens(sgndSuppTokens, false);<NEW_LINE>Collection<AssertionInfo> endSuppTokens = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.ENDORSING_SUPPORTING_TOKENS);<NEW_LINE>endSuppTokList = this.handleSupportingTokens(endSuppTokens, true);<NEW_LINE>Collection<AssertionInfo> sgndEndSuppTokens = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_ENDORSING_SUPPORTING_TOKENS);<NEW_LINE>sgndEndSuppTokList = this.handleSupportingTokens(sgndEndSuppTokens, true);<NEW_LINE>Collection<AssertionInfo> sgndEncryptedSuppTokens = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS);<NEW_LINE>List<SupportingToken> sgndEncSuppTokList = this.handleSupportingTokens(sgndEncryptedSuppTokens, false);<NEW_LINE>Collection<AssertionInfo> endorsingEncryptedSuppTokens = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);<NEW_LINE>endSuppTokList.addAll(this.handleSupportingTokens(endorsingEncryptedSuppTokens, true));<NEW_LINE>Collection<AssertionInfo> sgndEndEncSuppTokens = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);<NEW_LINE>sgndEndSuppTokList.addAll(this.handleSupportingTokens(sgndEndEncSuppTokens, true));<NEW_LINE>Collection<AssertionInfo> supportingToks = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.SUPPORTING_TOKENS);<NEW_LINE>this.handleSupportingTokens(supportingToks, false);<NEW_LINE>Collection<AssertionInfo> encryptedSupportingToks = PolicyUtils.getAllAssertionsByLocalname(aim, SPConstants.ENCRYPTED_SUPPORTING_TOKENS);<NEW_LINE>this.handleSupportingTokens(encryptedSupportingToks, false);<NEW_LINE>// Setup signature parts<NEW_LINE>addSignatureParts(sigSuppTokList, sigs);<NEW_LINE>addSignatureParts(sgndEncSuppTokList, sigs);<NEW_LINE>addSignatureParts(sgndEndSuppTokList, sigs);<NEW_LINE>} | getAllAssertionsByLocalname(aim, SPConstants.SIGNED_SUPPORTING_TOKENS); |
916,248 | private Set<HuId> createCUsBatch(final HUEditorRow.HUEditorRowHierarchy huEditorRowHierarchy, final int maxCUsAllowedPerBatch) {<NEW_LINE>final Set<HuId> splitCUIDs = new HashSet<>();<NEW_LINE>final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class);<NEW_LINE>final HUEditorRow cuRow = huEditorRowHierarchy.getCuRow();<NEW_LINE>final HUEditorRow parentRow = huEditorRowHierarchy.getParentRow();<NEW_LINE>final int initialQtyCU = cuRow.getQtyCU().intValueExact();<NEW_LINE>I_M_HU huToSplit = cuRow.getM_HU();<NEW_LINE>int numberOfCUsToCreate;<NEW_LINE>if (parentRow == null) {<NEW_LINE>// The CU will not be split when its qty gets to 1. So make sure the selected CU gets in the list of split CUs<NEW_LINE>final int selectedCUID = huToSplit.getM_HU_ID();<NEW_LINE>splitCUIDs.add(HuId.ofRepoId(selectedCUID));<NEW_LINE>numberOfCUsToCreate = maxCUsAllowedPerBatch < initialQtyCU ? maxCUsAllowedPerBatch : initialQtyCU;<NEW_LINE>for (int i = 0; i < numberOfCUsToCreate; i++) {<NEW_LINE>final List<I_M_HU> createdCUs = newHUTransformation().cuToNewCU(huToSplit, Quantity.of(BigDecimal.ONE, cuRow.getC_UOM()));<NEW_LINE>final Predicate<? super I_M_HU> //<NEW_LINE>newCUisDifferentFromInputHU = createdHU -> createdHU.getM_HU_ID() != cuRow.getHuId().getRepoId();<NEW_LINE>splitCUIDs.addAll(createdCUs.stream().filter(newCUisDifferentFromInputHU).map(I_M_HU::getM_HU_ID).map(HuId::ofRepoId).collect(ImmutableSet.toImmutableSet()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Check.assume(parentRow.isTU(), " Parent row must be TU: " + parentRow);<NEW_LINE>I_M_HU parentHU = parentRow.getM_HU();<NEW_LINE>if (isAggregateHU(parentRow)) {<NEW_LINE>final HUEditorRow luRow = huEditorRowHierarchy.getTopLevelRow();<NEW_LINE>parentHU = createNonAggregatedTU(parentRow, luRow);<NEW_LINE>huToSplit = handlingUnitsDAO.retrieveIncludedHUs(parentHU).get(0);<NEW_LINE>}<NEW_LINE>final int tuCapacity = calculateTUCapacity(parentHU);<NEW_LINE>numberOfCUsToCreate = Util.<MASK><NEW_LINE>for (int i = 0; i < numberOfCUsToCreate; i++) {<NEW_LINE>final List<I_M_HU> createdCUs = newHUTransformation().cuToExistingTU(huToSplit, Quantity.of(BigDecimal.ONE, cuRow.getC_UOM()), parentHU);<NEW_LINE>splitCUIDs.addAll(createdCUs.stream().map(I_M_HU::getM_HU_ID).map(HuId::ofRepoId).collect(ImmutableSet.toImmutableSet()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return splitCUIDs;<NEW_LINE>} | getMinimumOfThree(tuCapacity, maxCUsAllowedPerBatch, initialQtyCU); |
1,581,361 | public void destroy() {<NEW_LINE>// destory executor-server<NEW_LINE>stopRpcProvider();<NEW_LINE>// destory jobThreadRepository<NEW_LINE>if (jobThreadRepository.size() > 0) {<NEW_LINE>for (Map.Entry<Integer, JobThread> item : jobThreadRepository.entrySet()) {<NEW_LINE>removeJobThread(item.getKey(), "web container destroy and kill the job.");<NEW_LINE>JobThread oldJobThread = removeJobThread(item.getKey(), "web container destroy and kill the job.");<NEW_LINE>// wait for job thread push result to callback queue<NEW_LINE>if (oldJobThread != null) {<NEW_LINE>try {<NEW_LINE>oldJobThread.join();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error(">>>>>>>>>>> datax-web, JobThread destroy(join) error, jobId:{}", item.getKey(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jobThreadRepository.clear();<NEW_LINE>}<NEW_LINE>jobHandlerRepository.clear();<NEW_LINE>// destory JobLogFileCleanThread<NEW_LINE>JobLogFileCleanThread.getInstance().toStop();<NEW_LINE>// destory TriggerCallbackThread<NEW_LINE>TriggerCallbackThread.getInstance().toStop();<NEW_LINE>// destory ProcessCallbackThread<NEW_LINE>ProcessCallbackThread<MASK><NEW_LINE>} | .getInstance().toStop(); |
385,720 | private static void putRotatedQuad(ByteBuffer texCoordsBuffer, Rect r, float xs, float ys) {<NEW_LINE>float x0 = r.x;<NEW_LINE>float y0 = r.y;<NEW_LINE>float x1 <MASK><NEW_LINE>float y1 = r.y + r.height;<NEW_LINE>float w2 = r.width * 0.5f;<NEW_LINE>float h2 = r.height * 0.5f;<NEW_LINE>putTexCoord(texCoordsBuffer, x0 * xs, 1.0f - y0 * ys);<NEW_LINE>putTexCoord(texCoordsBuffer, x1 * xs, 1.0f - y0 * ys);<NEW_LINE>putTexCoord(texCoordsBuffer, x1 * xs, 1.0f - y1 * ys);<NEW_LINE>putTexCoord(texCoordsBuffer, x0 * xs, 1.0f - y1 * ys);<NEW_LINE>} | = r.x + r.width; |
1,635,516 | public boolean verifySplitBrainMergeMemberListVersion(SplitBrainJoinMessage joinMessage) {<NEW_LINE>Address caller = joinMessage.getAddress();<NEW_LINE>int callerMemberListVersion = joinMessage.getMemberListVersion();<NEW_LINE>clusterServiceLock.lock();<NEW_LINE>try {<NEW_LINE>if (!clusterService.isMaster()) {<NEW_LINE>logger.warning("Cannot verify member list version: " + <MASK><NEW_LINE>return false;<NEW_LINE>} else if (clusterService.getClusterJoinManager().isMastershipClaimInProgress()) {<NEW_LINE>logger.warning("Cannot verify member list version: " + callerMemberListVersion + " from " + caller + " because mastership claim is in progress");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>MemberMap memberMap = getMemberMap();<NEW_LINE>if (memberMap.getVersion() < callerMemberListVersion) {<NEW_LINE>int newVersion = callerMemberListVersion + 1;<NEW_LINE>logger.info("Updating local member list version: " + memberMap.getVersion() + " to " + newVersion + " because of split brain merge caller: " + caller + " with member list version: " + callerMemberListVersion);<NEW_LINE>MemberImpl[] members = memberMap.getMembers().toArray(new MemberImpl[0]);<NEW_LINE>MemberMap newMemberMap = MemberMap.createNew(newVersion, members);<NEW_LINE>setMembers(newMemberMap);<NEW_LINE>sendMemberListToOthers();<NEW_LINE>clusterService.printMemberList();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>clusterServiceLock.unlock();<NEW_LINE>}<NEW_LINE>} | callerMemberListVersion + " from " + caller + " because this node is not master"); |
1,108,775 | public void deserialize(DataInputStream input) throws IOException {<NEW_LINE>int featsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (featsFlag > 0) {<NEW_LINE>feats = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>int neighborsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (neighborsFlag > 0) {<NEW_LINE>neighbors = StreamSerdeUtils.deserializeLongs(input);<NEW_LINE>}<NEW_LINE>int typesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (typesFlag > 0) {<NEW_LINE>types = StreamSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeTypesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeTypesFlag > 0) {<NEW_LINE>edgeTypes = StreamSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeFeaturesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeFeaturesFlag > 0) {<NEW_LINE>int len = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>edgeFeatures = new IntFloatVector[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>edgeFeatures[i] = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (weightsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>int labelsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (labelsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>} | weightsFlag = StreamSerdeUtils.deserializeInt(input); |
381,349 | private void sendNodeStatsReport() {<NEW_LINE>final boolean isMiningEnabled;<NEW_LINE>if (miningCoordinator instanceof CliqueMiningCoordinator) {<NEW_LINE>isMiningEnabled = ((CliqueMiningCoordinator) miningCoordinator).isSigner();<NEW_LINE>} else {<NEW_LINE>isMiningEnabled = miningCoordinator.isMining();<NEW_LINE>}<NEW_LINE>final boolean isSyncing = syncState.isInSync();<NEW_LINE>final long gasPrice = suggestGasPrice(blockchainQueries.<MASK><NEW_LINE>final long hashrate = miningCoordinator.hashesPerSecond().orElse(0L);<NEW_LINE>final int peersNumber = protocolManager.ethContext().getEthPeers().peerCount();<NEW_LINE>final NodeStatsReport nodeStatsReport = ImmutableNodeStatsReport.builder().id(enodeURL.getNodeId().toHexString()).stats(true, isMiningEnabled, hashrate, peersNumber, gasPrice, isSyncing, 100).build();<NEW_LINE>sendMessage(webSocket, new EthStatsRequest(STATS, nodeStatsReport));<NEW_LINE>} | getBlockchain().getChainHeadBlock()); |
86,029 | protected void registerDefaultRecipes() {<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.WHEAT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.<MASK><NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.CARROT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.POTATO_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.SEEDS_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.BEETROOT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.MELON_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.APPLE_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.KELP_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.COCOA_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>registerRecipe(30, new ItemStack[] { SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_FERTILIZER, OrganicFertilizer.OUTPUT) });<NEW_LINE>} | WHEAT_FERTILIZER, OrganicFertilizer.OUTPUT) }); |
1,618,682 | public AddOnLibrary importFromFile(File file) throws IOException {<NEW_LINE>var diiBuilder = AddOnLibraryDto.newBuilder();<NEW_LINE>try (var zip = new ZipFile(file)) {<NEW_LINE>ZipEntry entry = zip.getEntry(LIBRARY_INFO_FILE);<NEW_LINE>if (entry == null) {<NEW_LINE>throw new IOException(I18N.getText("library.error.addOn.noConfigFile", file.getPath()));<NEW_LINE>}<NEW_LINE>var builder = AddOnLibraryDto.newBuilder();<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.getInputStream(entry)), builder);<NEW_LINE>// MT MacroScript properties<NEW_LINE>var pathAssetMap = processAssets(builder.getNamespace(), zip);<NEW_LINE>var mtsPropBuilder = MTScriptPropertiesDto.newBuilder();<NEW_LINE>ZipEntry mtsPropsZipEntry = zip.getEntry(MACROSCRIPT_PROPERTY_FILE);<NEW_LINE>if (mtsPropsZipEntry != null) {<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.<MASK><NEW_LINE>}<NEW_LINE>// Event properties<NEW_LINE>var eventPropBuilder = AddOnLibraryEventsDto.newBuilder();<NEW_LINE>ZipEntry eventsZipEntry = zip.getEntry(EVENT_PROPERTY_FILE);<NEW_LINE>if (eventsZipEntry != null) {<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.getInputStream(eventsZipEntry)), eventPropBuilder);<NEW_LINE>}<NEW_LINE>var addOnLib = builder.build();<NEW_LINE>byte[] data = Files.readAllBytes(file.toPath());<NEW_LINE>var asset = Type.MTLIB.getFactory().apply(addOnLib.getNamespace(), data);<NEW_LINE>addAsset(asset);<NEW_LINE>return AddOnLibrary.fromDto(asset.getMD5Key(), addOnLib, mtsPropBuilder.build(), eventPropBuilder.build(), pathAssetMap);<NEW_LINE>}<NEW_LINE>} | getInputStream(mtsPropsZipEntry)), mtsPropBuilder); |
548,620 | public Map<String, Boolean> toLegacyMapFormat() {<NEW_LINE>Map<String, Boolean> legacyFormat = new HashMap<>();<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_MODIFY_COURSE, canModifyCourse);<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_MODIFY_INSTRUCTOR, canModifyInstructor);<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_MODIFY_SESSION, canModifySession);<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_MODIFY_STUDENT, canModifyStudent);<NEW_LINE>legacyFormat.put(<MASK><NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_VIEW_SESSION_IN_SECTIONS, canViewSessionInSections);<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_SUBMIT_SESSION_IN_SECTIONS, canSubmitSessionInSections);<NEW_LINE>legacyFormat.put(Const.InstructorPermissions.CAN_MODIFY_SESSION_COMMENT_IN_SECTIONS, canModifySessionCommentsInSections);<NEW_LINE>return legacyFormat;<NEW_LINE>} | Const.InstructorPermissions.CAN_VIEW_STUDENT_IN_SECTIONS, canViewStudentInSections); |
1,082,515 | void analyze(Locals locals) {<NEW_LINE>captured = locals.getVariable(location, variable);<NEW_LINE>if (expected == null) {<NEW_LINE>if (captured.clazz == def.class) {<NEW_LINE>// dynamic implementation<NEW_LINE>defPointer = "D" <MASK><NEW_LINE>} else {<NEW_LINE>// typed implementation<NEW_LINE>defPointer = "S" + PainlessLookupUtility.typeToCanonicalTypeName(captured.clazz) + "." + call + ",1";<NEW_LINE>}<NEW_LINE>actual = String.class;<NEW_LINE>} else {<NEW_LINE>defPointer = null;<NEW_LINE>// static case<NEW_LINE>if (captured.clazz != def.class) {<NEW_LINE>ref = FunctionRef.create(locals.getPainlessLookup(), locals.getMethods(), location, expected, PainlessLookupUtility.typeToCanonicalTypeName(captured.clazz), call, 1);<NEW_LINE>}<NEW_LINE>actual = expected;<NEW_LINE>}<NEW_LINE>} | + variable + "." + call + ",1"; |
1,613,840 | protected boolean isEnabledForContext(SymbolTreeActionContext context) {<NEW_LINE>TreePath[] selectionPaths = context.getSelectedSymbolTreePaths();<NEW_LINE>if (selectionPaths.length != 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Object object = selectionPaths[0].getLastPathComponent();<NEW_LINE>if (object instanceof ClassCategoryNode) {<NEW_LINE>return true;<NEW_LINE>} else if (object instanceof SymbolNode) {<NEW_LINE>SymbolNode symbolNode = (SymbolNode) object;<NEW_LINE><MASK><NEW_LINE>SymbolType symbolType = symbol.getSymbolType();<NEW_LINE>if (symbolType == SymbolType.NAMESPACE) {<NEW_LINE>// allow SymbolType to perform additional checks<NEW_LINE>Namespace parentNamespace = (Namespace) symbol.getObject();<NEW_LINE>return SymbolType.CLASS.isValidParent(context.getProgram(), parentNamespace, Address.NO_ADDRESS, parentNamespace.isExternal());<NEW_LINE>}<NEW_LINE>return (symbolType == SymbolType.CLASS || symbolType == SymbolType.LIBRARY);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Symbol symbol = symbolNode.getSymbol(); |
1,701,875 | public void densify(List<String> featureList) {<NEW_LINE>// Ensure we have enough space.<NEW_LINE>if (featureList.size() > featureNames.length) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int insertedCount = 0;<NEW_LINE>int curPos = 0;<NEW_LINE>for (String curName : featureList) {<NEW_LINE>// If we've reached the end of our old feature set, just insert.<NEW_LINE>if (curPos == size) {<NEW_LINE>featureNames[size + insertedCount] = curName;<NEW_LINE>insertedCount++;<NEW_LINE>} else {<NEW_LINE>// Check to see if our insertion candidate is the same as the current feature name.<NEW_LINE>int comparison = curName.compareTo(featureNames[curPos]);<NEW_LINE>if (comparison < 0) {<NEW_LINE>// If it's earlier, insert it.<NEW_LINE>featureNames[size + insertedCount] = curName;<NEW_LINE>insertedCount++;<NEW_LINE>} else if (comparison == 0) {<NEW_LINE>// Otherwise just bump our pointer, we've already got this feature.<NEW_LINE>curPos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Bump the size up by the number of inserted features.<NEW_LINE>size += insertedCount;<NEW_LINE>// Sort the features<NEW_LINE>sort();<NEW_LINE>} | growArray(featureList.size()); |
462,617 | private void mergeCategory(String categoryName, DiskIndex onDisk, int[] positions, OutputStream stream) throws IOException {<NEW_LINE>Map<String, Object> wordsToDocs = this.categoryTables.get(categoryName);<NEW_LINE>if (wordsToDocs == null) {<NEW_LINE>wordsToDocs = new HashMap<String, Object>(3);<NEW_LINE>}<NEW_LINE>Map<String, Object> oldWordsToDocs = onDisk.readCategoryTable(categoryName, true);<NEW_LINE>if (oldWordsToDocs != null) {<NEW_LINE>nextWord: for (Map.Entry<String, Object> entry : oldWordsToDocs.entrySet()) {<NEW_LINE>String oldWord = entry.getKey();<NEW_LINE>if (oldWord == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<Integer> oldDocNumbers = (List<Integer>) entry.getValue();<NEW_LINE>List<Integer> mappedNumbers = new ArrayList<Integer>(oldDocNumbers.size());<NEW_LINE>for (Integer oldDocNumber : oldDocNumbers) {<NEW_LINE>int pos = positions[oldDocNumber];<NEW_LINE>if (// forget any reference to a document which was deleted or re_indexed<NEW_LINE>pos > RE_INDEXED) {<NEW_LINE>mappedNumbers.add(pos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mappedNumbers.isEmpty()) {<NEW_LINE>// skip words which no longer have any references<NEW_LINE>continue nextWord;<NEW_LINE>}<NEW_LINE>Object o = wordsToDocs.get(oldWord);<NEW_LINE>if (o == null) {<NEW_LINE>wordsToDocs.put(oldWord, mappedNumbers);<NEW_LINE>} else {<NEW_LINE>List<Integer> list = null;<NEW_LINE>if (o instanceof List<?>) {<NEW_LINE>list = (List<Integer>) o;<NEW_LINE>} else {<NEW_LINE>list = new ArrayList<Integer>();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>list.addAll(mappedNumbers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// flush cached table<NEW_LINE>onDisk.categoryTables.put(categoryName, null);<NEW_LINE>}<NEW_LINE>writeCategoryTable(categoryName, wordsToDocs, stream);<NEW_LINE>} | wordsToDocs.put(oldWord, list); |
536,429 | public static DetectRibFractureResponse unmarshall(DetectRibFractureResponse detectRibFractureResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectRibFractureResponse.setRequestId(_ctx.stringValue("DetectRibFractureResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setResultURL(_ctx.stringValue("DetectRibFractureResponse.Data.ResultURL"));<NEW_LINE>List<Float> origin = new ArrayList<Float>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectRibFractureResponse.Data.Origin.Length"); i++) {<NEW_LINE>origin.add(_ctx.floatValue("DetectRibFractureResponse.Data.Origin[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setOrigin(origin);<NEW_LINE>List<Float> spacing = new ArrayList<Float>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectRibFractureResponse.Data.Spacing.Length"); i++) {<NEW_LINE>spacing.add(_ctx.floatValue("DetectRibFractureResponse.Data.Spacing[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setSpacing(spacing);<NEW_LINE>List<DetectionsItem> detections = new ArrayList<DetectionsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectRibFractureResponse.Data.Detections.Length"); i++) {<NEW_LINE>DetectionsItem detectionsItem = new DetectionsItem();<NEW_LINE>detectionsItem.setFractureCategory(_ctx.stringValue("DetectRibFractureResponse.Data.Detections[" + i + "].FractureCategory"));<NEW_LINE>detectionsItem.setFractureConfidence(_ctx.floatValue("DetectRibFractureResponse.Data.Detections[" + i + "].FractureConfidence"));<NEW_LINE>detectionsItem.setFractureLocation(_ctx.stringValue("DetectRibFractureResponse.Data.Detections[" + i + "].FractureLocation"));<NEW_LINE>detectionsItem.setFractureSegment(_ctx.longValue("DetectRibFractureResponse.Data.Detections[" + i + "].FractureSegment"));<NEW_LINE>detectionsItem.setFractureId(_ctx.integerValue<MASK><NEW_LINE>List<Integer> coordinateImage = new ArrayList<Integer>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectRibFractureResponse.Data.Detections[" + i + "].CoordinateImage.Length"); j++) {<NEW_LINE>coordinateImage.add(_ctx.integerValue("DetectRibFractureResponse.Data.Detections[" + i + "].CoordinateImage[" + j + "]"));<NEW_LINE>}<NEW_LINE>detectionsItem.setCoordinateImage(coordinateImage);<NEW_LINE>List<Integer> coordinates = new ArrayList<Integer>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DetectRibFractureResponse.Data.Detections[" + i + "].Coordinates.Length"); j++) {<NEW_LINE>coordinates.add(_ctx.integerValue("DetectRibFractureResponse.Data.Detections[" + i + "].Coordinates[" + j + "]"));<NEW_LINE>}<NEW_LINE>detectionsItem.setCoordinates(coordinates);<NEW_LINE>detections.add(detectionsItem);<NEW_LINE>}<NEW_LINE>data.setDetections(detections);<NEW_LINE>detectRibFractureResponse.setData(data);<NEW_LINE>return detectRibFractureResponse;<NEW_LINE>} | ("DetectRibFractureResponse.Data.Detections[" + i + "].FractureId")); |
894,726 | public CustomPluginFileDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CustomPluginFileDescription customPluginFileDescription = new CustomPluginFileDescription();<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("fileMd5", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customPluginFileDescription.setFileMd5(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("fileSize", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>customPluginFileDescription.setFileSize(context.getUnmarshaller(Long.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 customPluginFileDescription;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,598,739 | /* package */<NEW_LINE>Optional<IPair<StockQtyAndUOMQty, Money>> sumupQtyInvoicedAndNetAmtInvoiced(final I_C_Invoice_Candidate ic) {<NEW_LINE>if (ic.getC_Currency_ID() <= 0 || ic.getC_UOM_ID() <= 0) {<NEW_LINE>// if those two columns are not yet set, then for sure nothing is invoiced yet either<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final List<I_C_Invoice_Line_Alloc> ilas = invoiceCandDAO.retrieveIlaForIc(InvoiceCandidateIds.ofRecord(ic));<NEW_LINE>final ProductId productId = ProductId.ofRepoId(ic.getM_Product_ID());<NEW_LINE>final UomId icUomId = UomId.ofRepoId(ic.getC_UOM_ID());<NEW_LINE>StockQtyAndUOMQty qtyInvoicedSum = StockQtyAndUOMQtys.createZero(productId, icUomId);<NEW_LINE>final CurrencyId icCurrencyId = CurrencyId.ofRepoId(ic.getC_Currency_ID());<NEW_LINE>Money netAmtInvoiced = Money.zero(icCurrencyId);<NEW_LINE>for (final I_C_Invoice_Line_Alloc ila : ilas) {<NEW_LINE>// we don't need to check the invoice's DocStatus. If the ila is there, we count it.<NEW_LINE>// @formatter:off<NEW_LINE>// final I_C_InvoiceLine invoiceLine = InterfaceWrapperHelper.create(ila.getC_InvoiceLine(), I_C_InvoiceLine.class);<NEW_LINE>// final IDocActionBL docActionBL = Services.get(IDocActionBL.class);<NEW_LINE>//<NEW_LINE>// if (docActionBL.isStatusOneOf(invoiceLine.getC_Invoice(),<NEW_LINE>// DocAction.STATUS_Completed,<NEW_LINE>// DocAction.STATUS_Closed,<NEW_LINE>// DocAction.STATUS_Reversed,<NEW_LINE>// DocAction.STATUS_InProgress)) // 06162 InProgress invoices shall also be processed<NEW_LINE>// {<NEW_LINE>// @formatter:on<NEW_LINE>final StockQtyAndUOMQty ilaQtysInvoiced = StockQtyAndUOMQtys.create(ila.getQtyInvoiced(), productId, ila.getQtyInvoicedInUOM(), UomId.ofRepoIdOrNull(ila.getC_UOM_ID()));<NEW_LINE>qtyInvoicedSum = StockQtyAndUOMQtys.add(qtyInvoicedSum, ilaQtysInvoiced);<NEW_LINE>//<NEW_LINE>// 07202: We update the net amount invoice according to price UOM.<NEW_LINE>// final BigDecimal priceActual = ic.getPriceActual();<NEW_LINE>final ProductPrice priceActual = ProductPrice.builder().money(Money.of(ic.getPriceActual(), icCurrencyId)).productId(productId).uomId(icUomId).build();<NEW_LINE>final Quantity qtyInvoicedInUOM = extractQtyInvoiced(ila);<NEW_LINE>final Money amountInvoiced = SpringContextHolder.instance.getBean(MoneyService.class<MASK><NEW_LINE>if (amountInvoiced == null) {<NEW_LINE>netAmtInvoiced = null;<NEW_LINE>}<NEW_LINE>if (netAmtInvoiced != null) {<NEW_LINE>netAmtInvoiced = netAmtInvoiced.add(amountInvoiced);<NEW_LINE>}<NEW_LINE>// @formatter:off<NEW_LINE>// }<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>final IPair<StockQtyAndUOMQty, Money> qtyAndNetAmtInvoiced = ImmutablePair.of(qtyInvoicedSum, netAmtInvoiced);<NEW_LINE>return Optional.of(qtyAndNetAmtInvoiced);<NEW_LINE>} | ).multiply(qtyInvoicedInUOM, priceActual); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.