idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,758,339 | private static void copyLiteral(byte[] input, int ipIndex, byte[] output, int opIndex, int length) throws CorruptionException {<NEW_LINE>assert length > 0;<NEW_LINE>assert ipIndex >= 0;<NEW_LINE>assert opIndex >= 0;<NEW_LINE>int spaceLeft = output.length - opIndex;<NEW_LINE>int readableBytes = input.length - ipIndex;<NEW_LINE>if (readableBytes < length || spaceLeft < length) {<NEW_LINE>throw new CorruptionException("Corrupt literal length");<NEW_LINE>}<NEW_LINE>if (length <= 16 && spaceLeft >= 16 && readableBytes >= 16) {<NEW_LINE>copyLong(input, ipIndex, output, opIndex);<NEW_LINE>copyLong(input, ipIndex + 8, output, opIndex + 8);<NEW_LINE>} else {<NEW_LINE>int fastLength = length & 0xFFFFFFF8;<NEW_LINE>if (fastLength <= 64) {<NEW_LINE>// copy long-by-long<NEW_LINE>for (int i = 0; i < fastLength; i += 8) {<NEW_LINE>copyLong(input, ipIndex + i, output, opIndex + i);<NEW_LINE>}<NEW_LINE>// copy byte-by-byte<NEW_LINE>int slowLength = length & 0x7;<NEW_LINE>// NOTE: This is not a manual array copy. We are copying an overlapping region<NEW_LINE>// and we want input data to repeat as it is recopied. see incrementalCopy below.<NEW_LINE>// noinspection ManualArrayCopy<NEW_LINE>for (int i = 0; i < slowLength; i += 1) {<NEW_LINE>output[opIndex + fastLength + i] = input[ipIndex + fastLength + i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SnappyInternalUtils.copyMemory(input, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ipIndex, output, opIndex, length); |
280,730 | public void testCriteriaQuery_char(TestExecutionContext testExecCtx, TestExecutionResources testExecResources, Object managedComponentObject) throws Throwable {<NEW_LINE>final String testName = getTestName();<NEW_LINE>// Verify parameters<NEW_LINE>if (testExecCtx == null || testExecResources == null) {<NEW_LINE>Assert.fail(testName + ": Missing context and/or resources. Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JPAResource jpaResource = testExecResources.getJpaResourceMap().get("test-jpa-resource");<NEW_LINE>if (jpaResource == null) {<NEW_LINE>Assert.fail("Missing JPAResource 'test-jpa-resource'). Cannot execute the test.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process Test Properties<NEW_LINE>final Map<String, Serializable> testProps = testExecCtx.getProperties();<NEW_LINE>if (testProps != null) {<NEW_LINE>for (String key : testProps.keySet()) {<NEW_LINE>System.out.println("Test Property: " + key + " = " + testProps.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EntityManager em = jpaResource.getEm();<NEW_LINE>TransactionJacket tx = jpaResource.getTj();<NEW_LINE>// Execute Test Case<NEW_LINE>try {<NEW_LINE>tx.beginTransaction();<NEW_LINE>if (jpaResource.getPcCtxInfo().getPcType() == PersistenceContextType.APPLICATION_MANAGED_JTA)<NEW_LINE>em.joinTransaction();<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Entity0003> cq = cb.createQuery(Entity0003.class);<NEW_LINE>Root<Entity0003> root = cq.from(Entity0003.class);<NEW_LINE>cq.select(root);<NEW_LINE>TypedQuery<Entity0003> tq = em.createQuery(cq);<NEW_LINE>Entity0003 findEntity = tq.getSingleResult();<NEW_LINE>System.<MASK><NEW_LINE>assertNotNull("Did not find entity in criteria query", findEntity);<NEW_LINE>assertTrue("Entity returned by find was not contained in the persistence context.", em.contains(findEntity));<NEW_LINE>assertEquals('a', findEntity.getEntity0003_id());<NEW_LINE>assertEquals("Entity0003_STRING01", findEntity.getEntity0003_string01());<NEW_LINE>assertEquals("Entity0003_STRING02", findEntity.getEntity0003_string02());<NEW_LINE>assertEquals("Entity0003_STRING03", findEntity.getEntity0003_string03());<NEW_LINE>tx.commitTransaction();<NEW_LINE>} finally {<NEW_LINE>System.out.println(testName + ": End");<NEW_LINE>}<NEW_LINE>} | out.println("Object returned by query: " + findEntity); |
703,634 | public void visitDataMatrix(DataMatrixComponent dataMatrix) {<NEW_LINE>DataMatrixBean dataMatrixBean = new DataMatrixBean();<NEW_LINE>barcodeBean = dataMatrixBean;<NEW_LINE>evaluateDataMatrix(dataMatrix);<NEW_LINE>setBaseAttributes(dataMatrix);<NEW_LINE>if (dataMatrix.getShape() != null) {<NEW_LINE>dataMatrixBean.setShape(SymbolShapeHint.byName(dataMatrix.getShape()));<NEW_LINE>}<NEW_LINE>Dimension minSymbolDimension = null;<NEW_LINE>if (dataMatrix.getMinSymbolWidth() != null) {<NEW_LINE>if (dataMatrix.getMinSymbolHeight() != null) {<NEW_LINE>minSymbolDimension = new Dimension(dataMatrix.getMinSymbolWidth(), dataMatrix.getMinSymbolHeight());<NEW_LINE>} else {<NEW_LINE>minSymbolDimension = new Dimension(dataMatrix.getMinSymbolWidth(<MASK><NEW_LINE>}<NEW_LINE>} else if (dataMatrix.getMinSymbolHeight() != null) {<NEW_LINE>minSymbolDimension = new Dimension(dataMatrix.getMinSymbolHeight(), dataMatrix.getMinSymbolHeight());<NEW_LINE>}<NEW_LINE>if (minSymbolDimension != null) {<NEW_LINE>dataMatrixBean.setMinSize(minSymbolDimension);<NEW_LINE>}<NEW_LINE>Dimension maxSymbolDimension = null;<NEW_LINE>if (dataMatrix.getMaxSymbolWidth() != null) {<NEW_LINE>if (dataMatrix.getMaxSymbolHeight() != null) {<NEW_LINE>maxSymbolDimension = new Dimension(dataMatrix.getMaxSymbolWidth(), dataMatrix.getMaxSymbolHeight());<NEW_LINE>} else {<NEW_LINE>maxSymbolDimension = new Dimension(dataMatrix.getMaxSymbolWidth(), dataMatrix.getMaxSymbolWidth());<NEW_LINE>}<NEW_LINE>} else if (dataMatrix.getMaxSymbolHeight() != null) {<NEW_LINE>maxSymbolDimension = new Dimension(dataMatrix.getMaxSymbolHeight(), dataMatrix.getMaxSymbolHeight());<NEW_LINE>}<NEW_LINE>if (maxSymbolDimension != null) {<NEW_LINE>dataMatrixBean.setMaxSize(maxSymbolDimension);<NEW_LINE>}<NEW_LINE>evaluateBarcodeRenderable(dataMatrix);<NEW_LINE>} | ), dataMatrix.getMinSymbolWidth()); |
614,482 | public boolean serviceAdded(ServiceReference serviceRef, ContextHandler context) {<NEW_LINE>if (context == null || serviceRef == null)<NEW_LINE>return false;<NEW_LINE>if (context instanceof org.eclipse.jetty.webapp.WebAppContext)<NEW_LINE>// the ServiceWebAppProvider will deploy it<NEW_LINE>return false;<NEW_LINE>String watermark = (String) serviceRef.getProperty(OSGiWebappConstants.WATERMARK);<NEW_LINE>if (watermark != null && !"".equals(watermark))<NEW_LINE>// this service represents a contexthandler that has already been registered as a service by another of our deployers<NEW_LINE>return false;<NEW_LINE>ClassLoader cl = Thread.currentThread().getContextClassLoader();<NEW_LINE>Thread.currentThread().setContextClassLoader(getServerInstanceWrapper().getParentClassLoaderForWebapps());<NEW_LINE>try {<NEW_LINE>// See if there is a context file to apply to this pre-made context<NEW_LINE>String contextFile = (String) serviceRef.getProperty(OSGiWebappConstants.JETTY_CONTEXT_FILE_PATH);<NEW_LINE>String[] keys = serviceRef.getPropertyKeys();<NEW_LINE>Dictionary<String, Object> properties = new Hashtable<>();<NEW_LINE>if (keys != null) {<NEW_LINE>for (String key : keys) {<NEW_LINE>properties.put(key, serviceRef.getProperty(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Bundle bundle = serviceRef.getBundle();<NEW_LINE>String originId = bundle.getSymbolicName() + "-" + bundle.getVersion().toString() + "-" + (contextFile != null ? contextFile : serviceRef<MASK><NEW_LINE>ServiceApp app = new ServiceApp(getDeploymentManager(), this, bundle, properties, contextFile, originId);<NEW_LINE>// set the pre=made ContextHandler instance<NEW_LINE>app.setHandler(context);<NEW_LINE>_serviceMap.put(serviceRef, app);<NEW_LINE>getDeploymentManager().addApp(app);<NEW_LINE>return true;<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(cl);<NEW_LINE>}<NEW_LINE>} | .getProperty(Constants.SERVICE_ID)); |
1,206,987 | private // NOSONAR complexity<NEW_LINE>// NOSONAR complexity<NEW_LINE>void // NOSONAR complexity<NEW_LINE>addHeader(// NOSONAR complexity<NEW_LINE>Element element, // NOSONAR complexity<NEW_LINE>ManagedMap<String, Object> headers, ParserContext parserContext, String headerName, Element headerElement, String headerType, @Nullable String expressionArg, String overwrite) {<NEW_LINE>String value = headerElement.getAttribute("value");<NEW_LINE>String ref = headerElement.getAttribute(REF_ATTRIBUTE);<NEW_LINE>String method = headerElement.getAttribute(METHOD_ATTRIBUTE);<NEW_LINE>String expression = expressionArg;<NEW_LINE>if (expression == null) {<NEW_LINE>expression = headerElement.getAttribute(EXPRESSION_ATTRIBUTE);<NEW_LINE>}<NEW_LINE>Element beanElement = null;<NEW_LINE>Element scriptElement = null;<NEW_LINE>Element expressionElement = null;<NEW_LINE>List<Element> subElements = DomUtils.getChildElements(headerElement);<NEW_LINE>if (!subElements.isEmpty()) {<NEW_LINE>Element subElement = subElements.get(0);<NEW_LINE>String subElementLocalName = subElement.getLocalName();<NEW_LINE>if ("bean".equals(subElementLocalName)) {<NEW_LINE>beanElement = subElement;<NEW_LINE>} else if ("script".equals(subElementLocalName)) {<NEW_LINE>scriptElement = subElement;<NEW_LINE>} else if ("expression".equals(subElementLocalName)) {<NEW_LINE>expressionElement = subElement;<NEW_LINE>}<NEW_LINE>if (beanElement == null && scriptElement == null && expressionElement == null) {<NEW_LINE>parserContext.getReaderContext(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(expression) && expressionElement != null) {<NEW_LINE>parserContext.getReaderContext().error("The 'expression' attribute and sub-element are mutually exclusive", element);<NEW_LINE>}<NEW_LINE>boolean isValue = StringUtils.hasText(value);<NEW_LINE>boolean isRef = StringUtils.hasText(ref);<NEW_LINE>boolean hasMethod = StringUtils.hasText(method);<NEW_LINE>boolean isExpression = StringUtils.hasText(expression) || expressionElement != null;<NEW_LINE>boolean isScript = scriptElement != null;<NEW_LINE>BeanDefinition innerComponentDefinition = null;<NEW_LINE>if (beanElement != null) {<NEW_LINE>innerComponentDefinition = // NOSONAR never null<NEW_LINE>parserContext.getDelegate().parseBeanDefinitionElement(beanElement).getBeanDefinition();<NEW_LINE>} else if (isScript) {<NEW_LINE>innerComponentDefinition = parserContext.getDelegate().parseCustomElement(scriptElement);<NEW_LINE>}<NEW_LINE>BeanDefinitionBuilder valueProcessorBuilder = valueProcessor(element, parserContext, headerName, headerElement, headerType, overwrite, value, ref, method, expression, expressionElement, isValue, isRef, hasMethod, isExpression, isScript, innerComponentDefinition);<NEW_LINE>headers.put(headerName, valueProcessorBuilder.getBeanDefinition());<NEW_LINE>} | ).error("Only 'bean', 'script' or 'expression' can be defined as a sub-element", element); |
1,022,919 | private void processILeappFile(Content dataSource, Case currentCase, DataSourceIngestModuleProgress statusHelper, int filesProcessedCount, AbstractFile iLeappFile) {<NEW_LINE>statusHelper.progress(NbBundle.getMessage(this.getClass(), "ILeappAnalyzerIngestModule.processing.file", iLeappFile.getName()), filesProcessedCount);<NEW_LINE>// NON-NLS<NEW_LINE>String currentTime = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss z", Locale.US).<MASK><NEW_LINE>Path moduleOutputPath = Paths.get(currentCase.getModuleDirectory(), ILEAPP, currentTime);<NEW_LINE>try {<NEW_LINE>Files.createDirectories(moduleOutputPath);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.SEVERE, String.format("Error creating iLeapp output directory %s", moduleOutputPath.toString()), ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProcessBuilder iLeappCommand = buildiLeappCommand(moduleOutputPath, iLeappFile.getLocalAbsPath(), iLeappFile.getNameExtension());<NEW_LINE>try {<NEW_LINE>int result = ExecUtil.execute(iLeappCommand, new DataSourceIngestModuleProcessTerminator(context, true));<NEW_LINE>if (result != 0) {<NEW_LINE>logger.log(Level.WARNING, String.format("Error when trying to execute iLeapp program getting file paths to search for result is %d", result));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addILeappReportToReports(moduleOutputPath, currentCase);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.log(Level.SEVERE, String.format("Error when trying to execute iLeapp program against file %s", iLeappFile.getLocalAbsPath()), ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (context.dataSourceIngestIsCancelled()) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "ILeapp Analyser ingest module run was canceled");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>iLeappFileProcessor.processFiles(dataSource, moduleOutputPath, iLeappFile, statusHelper);<NEW_LINE>} | format(System.currentTimeMillis()); |
1,162,571 | public static DescribeVulMachineListResponse unmarshall(DescribeVulMachineListResponse describeVulMachineListResponse, UnmarshallerContext context) {<NEW_LINE>describeVulMachineListResponse.setRequestId<MASK><NEW_LINE>describeVulMachineListResponse.setTotalCount(context.integerValue("DescribeVulMachineListResponse.TotalCount"));<NEW_LINE>List<MachineStatistic> machineStatistics = new ArrayList<MachineStatistic>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVulMachineListResponse.MachineStatistics.Length"); i++) {<NEW_LINE>MachineStatistic machineStatistic = new MachineStatistic();<NEW_LINE>machineStatistic.setUuid(context.stringValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].Uuid"));<NEW_LINE>machineStatistic.setCveNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CveNum"));<NEW_LINE>machineStatistic.setEmgNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].EmgNum"));<NEW_LINE>machineStatistic.setSysNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].SysNum"));<NEW_LINE>machineStatistic.setCmsNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsNum"));<NEW_LINE>machineStatistic.setCmsDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsDealedTotalNum"));<NEW_LINE>machineStatistic.setVulDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulDealedTotalNum"));<NEW_LINE>machineStatistic.setVulAsapSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulAsapSum"));<NEW_LINE>machineStatistic.setVulLaterSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLaterSum"));<NEW_LINE>machineStatistic.setVulNntfSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulNntfSum"));<NEW_LINE>machineStatistic.setVulSeriousTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulSeriousTotal"));<NEW_LINE>machineStatistic.setVulHighTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulHighTotal"));<NEW_LINE>machineStatistic.setVulMediumTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulMediumTotal"));<NEW_LINE>machineStatistic.setVulLowTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLowTotal"));<NEW_LINE>machineStatistics.add(machineStatistic);<NEW_LINE>}<NEW_LINE>describeVulMachineListResponse.setMachineStatistics(machineStatistics);<NEW_LINE>return describeVulMachineListResponse;<NEW_LINE>} | (context.stringValue("DescribeVulMachineListResponse.RequestId")); |
517,680 | // Rendering-type stuff<NEW_LINE>public void findHMDTextureSize() {<NEW_LINE>// Texture sizes<NEW_LINE>// pixelsPerDisplayPixel<NEW_LINE>float pixelScaling = 1.0f;<NEW_LINE>OVRSizei leftTextureSize = OVRSizei.malloc();<NEW_LINE>ovr_GetFovTextureSize(session, ovrEye_Left, fovPorts[ovrEye_Left], pixelScaling, leftTextureSize);<NEW_LINE><MASK><NEW_LINE>ovr_GetFovTextureSize(session, ovrEye_Right, fovPorts[ovrEye_Right], pixelScaling, rightTextureSize);<NEW_LINE>if (leftTextureSize.w() != rightTextureSize.w()) {<NEW_LINE>throw new IllegalStateException("Texture sizes do not match [horizontal]");<NEW_LINE>}<NEW_LINE>if (leftTextureSize.h() != rightTextureSize.h()) {<NEW_LINE>throw new IllegalStateException("Texture sizes do not match [vertical]");<NEW_LINE>}<NEW_LINE>textureW = leftTextureSize.w();<NEW_LINE>textureH = leftTextureSize.h();<NEW_LINE>leftTextureSize.free();<NEW_LINE>rightTextureSize.free();<NEW_LINE>} | OVRSizei rightTextureSize = OVRSizei.malloc(); |
1,592,196 | static AnnotationTargetAllowed isAnnotationTargetAllowed(Annotation annotation, BlockScope scope, TypeBinding annotationType, int kind) {<NEW_LINE>// could be forward reference<NEW_LINE><MASK><NEW_LINE>if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {<NEW_LINE>// does not specify any target restriction - all locations are possible<NEW_LINE>return AnnotationTargetAllowed.YES;<NEW_LINE>}<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=391201<NEW_LINE>if ((metaTagBits & TagBits.SE7AnnotationTargetMASK) == 0 && (metaTagBits & (TagBits.AnnotationForTypeUse | TagBits.AnnotationForTypeParameter)) != 0) {<NEW_LINE>if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) {<NEW_LINE>switch(kind) {<NEW_LINE>case Binding.PACKAGE:<NEW_LINE>case Binding.TYPE:<NEW_LINE>case Binding.GENERIC_TYPE:<NEW_LINE>case Binding.METHOD:<NEW_LINE>case Binding.FIELD:<NEW_LINE>case Binding.LOCAL:<NEW_LINE>case Binding.RECORD_COMPONENT:<NEW_LINE>scope.problemReporter().invalidUsageOfTypeAnnotations(annotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isAnnotationTargetAllowed(annotation.recipient, scope, annotationType, kind, metaTagBits);<NEW_LINE>} | long metaTagBits = annotationType.getAnnotationTagBits(); |
834,750 | public Node toNode(AbstractWmlConversionContext context, FldSimpleModel model, Document doc) throws TransformerException {<NEW_LINE>String bookmarkId = model.getFldParameters().get(0);<NEW_LINE>Node content = model.getContent();<NEW_LINE>Node literalNode = null;<NEW_LINE>AbstractHyperlinkWriterModel hyperlinkModel = null;<NEW_LINE>DocumentFragment docFrag = null;<NEW_LINE>String textcontent = null;<NEW_LINE>List<String> textcontentitems = null;<NEW_LINE>String textcontentitem = null;<NEW_LINE>if (FormattingSwitchHelper.hasSwitch("\\p", model.getFldParameters())) {<NEW_LINE>textcontent = getTextcontent(content);<NEW_LINE>textcontentitems = splitTextcontent(textcontent);<NEW_LINE>// textcontentitems == null -> no page number (above/below)<NEW_LINE>// textcontentitems != null -> split [literal,] # marker [, literal]<NEW_LINE>if (textcontentitems != null) {<NEW_LINE>docFrag = doc.createDocumentFragment();<NEW_LINE>for (int i = 0; i < textcontentitems.size(); i++) {<NEW_LINE>textcontentitem = textcontentitems.get(i);<NEW_LINE>if ("#".equals(textcontentitem)) {<NEW_LINE>docFrag.appendChild(createPageref(context, doc, bookmarkId));<NEW_LINE>} else {<NEW_LINE>literalNode = doc.createDocumentFragment();<NEW_LINE>XmlUtils.treeCopy(content, literalNode);<NEW_LINE>literalNode = literalNode.getFirstChild();<NEW_LINE>setTextcontent(literalNode, textcontentitem);<NEW_LINE>docFrag.appendChild(literalNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>content = docFrag;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>content = doc.createDocumentFragment();<NEW_LINE>content.appendChild(createPageref(context, doc, bookmarkId));<NEW_LINE>}<NEW_LINE>if (FormattingSwitchHelper.hasSwitch("\\h", model.getFldParameters())) {<NEW_LINE>hyperlinkModel = new AbstractHyperlinkWriterModel();<NEW_LINE>// the bookmark is the target, \h gets ignored<NEW_LINE>hyperlinkModel.build(context, model, content);<NEW_LINE>content = HyperlinkUtil.toNode(outputType, <MASK><NEW_LINE>}<NEW_LINE>return content;<NEW_LINE>} | context, hyperlinkModel, content, doc); |
1,750,240 | public void clearDuplicateRefreshTokens() {<NEW_LINE>Query query = manager.createQuery("select a.jwt, count(1) as c from OAuth2RefreshTokenEntity a GROUP BY a.jwt HAVING count(1) > 1");<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<Object[]> resultList = query.getResultList();<NEW_LINE>List<JWT> <MASK><NEW_LINE>for (Object[] r : resultList) {<NEW_LINE>logger.warn("Found duplicate refresh tokens: {}, {}", ((JWT) r[0]).serialize(), r[1]);<NEW_LINE>values.add((JWT) r[0]);<NEW_LINE>}<NEW_LINE>if (values.size() > 0) {<NEW_LINE>CriteriaBuilder cb = manager.getCriteriaBuilder();<NEW_LINE>CriteriaDelete<OAuth2RefreshTokenEntity> criteriaDelete = cb.createCriteriaDelete(OAuth2RefreshTokenEntity.class);<NEW_LINE>Root<OAuth2RefreshTokenEntity> root = criteriaDelete.from(OAuth2RefreshTokenEntity.class);<NEW_LINE>criteriaDelete.where(root.get("jwt").in(values));<NEW_LINE>int result = manager.createQuery(criteriaDelete).executeUpdate();<NEW_LINE>logger.warn("Deleted {} duplicate refresh tokens", result);<NEW_LINE>}<NEW_LINE>} | values = new ArrayList<>(); |
1,269,601 | public void closeElement(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {<NEW_LINE>super.closeElement(element, attributes, content, warnings);<NEW_LINE>try {<NEW_LINE>if (RocksimCommonConstants.OD.equals(element)) {<NEW_LINE>bodyTube.setOuterRadius(Double.parseDouble(content) / RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.ID.equals(element)) {<NEW_LINE>final double r = Double.parseDouble(content) / RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS;<NEW_LINE>bodyTube.setInnerRadius(r);<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.LEN.equals(element)) {<NEW_LINE>bodyTube.setLength(Double.parseDouble(content) / RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.IS_MOTOR_MOUNT.equals(element)) {<NEW_LINE>bodyTube.setMotorMount("1".equals(content));<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.ENGINE_OVERHANG.equals(element)) {<NEW_LINE>bodyTube.setMotorOverhang(Double.parseDouble(content) / RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.MATERIAL.equals(element)) {<NEW_LINE>setMaterialName(content);<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.RADIAL_ANGLE.equals(element)) {<NEW_LINE>bodyTube.setRadialDirection(Double.parseDouble(content));<NEW_LINE>}<NEW_LINE>if (RocksimCommonConstants.RADIAL_LOC.equals(element)) {<NEW_LINE>bodyTube.setRadialPosition(Double.parseDouble<MASK><NEW_LINE>}<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>warnings.add("Could not convert " + element + " value of " + content + ". It is expected to be a number.");<NEW_LINE>}<NEW_LINE>} | (content) / RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH); |
1,228,370 | public ASTNode visitUsingClause(final UsingClauseContext ctx) {<NEW_LINE>if (null != ctx.tableName()) {<NEW_LINE>SimpleTableSegment result = (SimpleTableSegment) <MASK><NEW_LINE>if (null != ctx.alias()) {<NEW_LINE>result.setAlias((AliasSegment) visit(ctx.alias()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (null != ctx.viewName()) {<NEW_LINE>SimpleTableSegment result = (SimpleTableSegment) visit(ctx.viewName());<NEW_LINE>if (null != ctx.alias()) {<NEW_LINE>result.setAlias((AliasSegment) visit(ctx.alias()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>OracleSelectStatement subquery = (OracleSelectStatement) visit(ctx.subquery());<NEW_LINE>SubquerySegment subquerySegment = new SubquerySegment(ctx.subquery().start.getStartIndex(), ctx.subquery().stop.getStopIndex(), subquery);<NEW_LINE>SubqueryTableSegment result = new SubqueryTableSegment(subquerySegment);<NEW_LINE>if (null != ctx.alias()) {<NEW_LINE>result.setAlias((AliasSegment) visit(ctx.alias()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | visit(ctx.tableName()); |
388,298 | public int showDirectoryFxDialog(final String method) {<NEW_LINE>try {<NEW_LINE>final Object directoryChooser = directoryChooserClass.getConstructor().newInstance();<NEW_LINE>// create a callable lambda<NEW_LINE>selectedFile = runLater(() -> {<NEW_LINE>// set window title<NEW_LINE>Method setTitleMethod = directoryChooserClass.getMethod("setTitle", String.class);<NEW_LINE>setTitleMethod.invoke(directoryChooser, dialogTitle);<NEW_LINE>// set current directory<NEW_LINE>Method setInitialDirectory = directoryChooserClass.getMethod("setInitialDirectory", File.class);<NEW_LINE>setInitialDirectory.invoke(directoryChooser, currentDirectory);<NEW_LINE>Method showDialogMethod = directoryChooserClass.getMethod(method, windowClass);<NEW_LINE>Object file = showDialogMethod.invoke(directoryChooser, (Object) null);<NEW_LINE>return (File) file;<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return JFileChooser.ERROR_OPTION;<NEW_LINE>}<NEW_LINE>if (selectedFile == null) {<NEW_LINE>return JFileChooser.CANCEL_OPTION;<NEW_LINE>}<NEW_LINE>return JFileChooser.APPROVE_OPTION;<NEW_LINE>} | System.out.println(e); |
1,452,104 | public Aggregation toDruidAggregation(PlannerContext plannerContext, RowSignature rowSignature, VirtualColumnRegistry virtualColumnRegistry, RexBuilder rexBuilder, String name, AggregateCall aggregateCall, Project project, List<Aggregation> existingAggregations, boolean finalizeAggregations) {<NEW_LINE>final RexNode inputOperand = Expressions.fromFieldAccess(rowSignature, project, aggregateCall.getArgList().get(0));<NEW_LINE>final DruidExpression input = Aggregations.toDruidExpressionForNumericAggregator(plannerContext, rowSignature, inputOperand);<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final AggregatorFactory aggregatorFactory;<NEW_LINE>final RelDataType dataType = inputOperand.getType();<NEW_LINE>final ColumnType inputType = Calcites.getColumnTypeForRelDataType(dataType);<NEW_LINE>final DimensionSpec dimensionSpec;<NEW_LINE>final String aggName = <MASK><NEW_LINE>final SqlAggFunction func = calciteFunction();<NEW_LINE>final String estimator;<NEW_LINE>final String inputTypeName;<NEW_LINE>PostAggregator postAggregator = null;<NEW_LINE>if (input.isSimpleExtraction()) {<NEW_LINE>dimensionSpec = input.getSimpleExtraction().toDimensionSpec(null, inputType);<NEW_LINE>} else {<NEW_LINE>String virtualColumnName = virtualColumnRegistry.getOrCreateVirtualColumnForExpression(input, dataType);<NEW_LINE>dimensionSpec = new DefaultDimensionSpec(virtualColumnName, null, inputType);<NEW_LINE>}<NEW_LINE>if (inputType == null) {<NEW_LINE>throw new IAE("VarianceSqlAggregator[%s] has invalid inputType", func);<NEW_LINE>}<NEW_LINE>if (inputType.isNumeric()) {<NEW_LINE>inputTypeName = StringUtils.toLowerCase(inputType.getType().name());<NEW_LINE>} else {<NEW_LINE>throw new IAE("VarianceSqlAggregator[%s] has invalid inputType[%s]", func, inputType.asTypeString());<NEW_LINE>}<NEW_LINE>if (func == SqlStdOperatorTable.VAR_POP || func == SqlStdOperatorTable.STDDEV_POP) {<NEW_LINE>estimator = "population";<NEW_LINE>} else {<NEW_LINE>estimator = "sample";<NEW_LINE>}<NEW_LINE>aggregatorFactory = new VarianceAggregatorFactory(aggName, dimensionSpec.getDimension(), estimator, inputTypeName);<NEW_LINE>if (func == SqlStdOperatorTable.STDDEV_POP || func == SqlStdOperatorTable.STDDEV_SAMP || func == SqlStdOperatorTable.STDDEV) {<NEW_LINE>postAggregator = new StandardDeviationPostAggregator(name, aggregatorFactory.getName(), estimator);<NEW_LINE>}<NEW_LINE>return Aggregation.create(ImmutableList.of(aggregatorFactory), postAggregator);<NEW_LINE>} | StringUtils.format("%s:agg", name); |
1,378,428 | private static String findInstallArea() {<NEW_LINE>// NOI18N<NEW_LINE>String ia = System.getProperty("netbeans.home");<NEW_LINE>LOG.log(Level.FINE, "Home is {0}", ia);<NEW_LINE>// NOI18N<NEW_LINE>String rest = System.getProperty("netbeans.dirs");<NEW_LINE>if (rest != null) {<NEW_LINE>for (String c : rest.split(File.pathSeparator)) {<NEW_LINE>File cf = new File(c);<NEW_LINE>if (!cf.isAbsolute() || !cf.exists()) {<NEW_LINE>LOG.log(Level.FINE, "Skipping non-existent {0}", c);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int prefix = findCommonPrefix(ia, c);<NEW_LINE>if (prefix == ia.length()) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (prefix <= 3) {<NEW_LINE>LOG.log(Level.WARNING, "Cannot compute install area. No common prefix between {0} and {1}", new Object[] { ia, c });<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, "Prefix shortened by {0} to {1} chars", new Object[] { c, prefix });<NEW_LINE>ia = ia.substring(0, prefix);<NEW_LINE>LOG.log(Level.FINE, "New prefix {0}", ia);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.fine("No dirs");<NEW_LINE>}<NEW_LINE>return ia;<NEW_LINE>} | Level.FINE, "No change to prefix by {0}", c); |
1,194,569 | public int write(Tablet tablet) throws WriteProcessException {<NEW_LINE>int maxPointCount = 0, pointCount;<NEW_LINE>List<MeasurementSchema> timeseries = tablet.getSchemas();<NEW_LINE>for (int column = 0; column < timeseries.size(); column++) {<NEW_LINE>String measurementId = timeseries.get(column).getMeasurementId();<NEW_LINE>TSDataType tsDataType = timeseries.get(column).getType();<NEW_LINE>pointCount = 0;<NEW_LINE>for (int row = 0; row < tablet.rowSize; row++) {<NEW_LINE>// check isNull in tablet<NEW_LINE>if (tablet.bitMaps != null && tablet.bitMaps[column] != null && tablet.bitMaps[column].isMarked(row)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long time = tablet.timestamps[row];<NEW_LINE>checkIsHistoryData(measurementId, time);<NEW_LINE>pointCount++;<NEW_LINE>switch(tsDataType) {<NEW_LINE>case INT32:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((int[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((long[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((float[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((double[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((boolean[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>chunkWriters.get(measurementId).write(time, ((Binary[]) tablet.values[column])[row]);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnSupportedDataTypeException(String.format("Data type %s is not supported.", tsDataType));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>maxPointCount = Math.max(pointCount, maxPointCount);<NEW_LINE>}<NEW_LINE>return maxPointCount;<NEW_LINE>} | lastTimeMap.put(measurementId, time); |
1,801,046 | private HeroicConfig config(LoadingComponent loading) throws Exception {<NEW_LINE>HeroicConfig.Builder builder = HeroicConfig.builder();<NEW_LINE>for (final HeroicProfile profile : profiles) {<NEW_LINE>log.info("Loading profile '{}' (params: {})", profile.description(), params);<NEW_LINE>final ExtraParameters p = profile.scope().map(params::scope).orElse(params);<NEW_LINE>builder = builder.merge(profile.build(p));<NEW_LINE>}<NEW_LINE>for (final HeroicConfig.Builder fragment : configFragments) {<NEW_LINE>builder = builder.merge(fragment);<NEW_LINE>}<NEW_LINE>final ObjectMapper mapper = loading.configMapper().copy();<NEW_LINE>// TODO: figure out where to put this<NEW_LINE>mapper.addMixIn(JettyConnectionFactory.Builder.class, TypeNameMixin.class);<NEW_LINE>if (configPath.isPresent()) {<NEW_LINE>builder = HeroicConfig.loadConfig(mapper, configPath.get()).map(builder::merge).orElse(builder);<NEW_LINE>}<NEW_LINE>if (configStream.isPresent()) {<NEW_LINE>builder = HeroicConfig.loadConfigStream(mapper, configStream.get().get()).map(builder<MASK><NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | ::merge).orElse(builder); |
1,219,074 | private void scanNonCollectableObjectsInternal(long memoryType) throws CorruptDataException {<NEW_LINE><MASK><NEW_LINE>while (regionIterator.hasNext()) {<NEW_LINE>GCHeapRegionDescriptor region = regionIterator.next();<NEW_LINE>if (new UDATA(region.getTypeFlags()).allBitsIn(memoryType)) {<NEW_LINE>GCObjectHeapIterator objectIterator = GCObjectHeapIterator.fromHeapRegionDescriptor(region, true, false);<NEW_LINE>while (objectIterator.hasNext()) {<NEW_LINE>J9ObjectPointer object = objectIterator.next();<NEW_LINE>doClassSlot(J9ObjectHelper.clazz(object));<NEW_LINE>GCObjectIterator fieldIterator = GCObjectIterator.fromJ9Object(object, true);<NEW_LINE>GCObjectIterator fieldAddressIterator = GCObjectIterator.fromJ9Object(object, true);<NEW_LINE>while (fieldIterator.hasNext()) {<NEW_LINE>doNonCollectableObjectSlot(fieldIterator.next(), fieldAddressIterator.nextAddress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | GCHeapRegionIterator regionIterator = GCHeapRegionIterator.from(); |
755,349 | public DeleteFleetLocationsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteFleetLocationsResult deleteFleetLocationsResult = new DeleteFleetLocationsResult();<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 deleteFleetLocationsResult;<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("FleetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteFleetLocationsResult.setFleetId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FleetArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteFleetLocationsResult.setFleetArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LocationStates", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteFleetLocationsResult.setLocationStates(new ListUnmarshaller<LocationState>(LocationStateJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteFleetLocationsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
485,301 | public Mono<AmqpReceiveLink> createConsumer(String linkName, String entityPath, Duration timeout, AmqpRetryPolicy retry, EventPosition eventPosition, ReceiveOptions options) {<NEW_LINE>Objects.requireNonNull(linkName, "'linkName' cannot be null.");<NEW_LINE>Objects.requireNonNull(entityPath, "'entityPath' cannot be null.");<NEW_LINE>Objects.requireNonNull(timeout, "'timeout' cannot be null.");<NEW_LINE>Objects.requireNonNull(retry, "'retry' cannot be null.");<NEW_LINE>Objects.requireNonNull(eventPosition, "'eventPosition' cannot be null.");<NEW_LINE><MASK><NEW_LINE>final String eventPositionExpression = getExpression(eventPosition);<NEW_LINE>final Map<Symbol, Object> filter = new HashMap<>();<NEW_LINE>filter.put(AmqpConstants.STRING_FILTER, new UnknownDescribedType(AmqpConstants.STRING_FILTER, eventPositionExpression));<NEW_LINE>final Map<Symbol, Object> properties = new HashMap<>();<NEW_LINE>if (options.getOwnerLevel() != null) {<NEW_LINE>properties.put(EPOCH, options.getOwnerLevel());<NEW_LINE>}<NEW_LINE>final Symbol[] desiredCapabilities = options.getTrackLastEnqueuedEventProperties() ? new Symbol[] { ENABLE_RECEIVER_RUNTIME_METRIC_NAME } : null;<NEW_LINE>// Use explicit settlement via dispositions (not pre-settled)<NEW_LINE>return createConsumer(linkName, entityPath, timeout, retry, filter, properties, desiredCapabilities, SenderSettleMode.UNSETTLED, ReceiverSettleMode.SECOND);<NEW_LINE>} | Objects.requireNonNull(options, "'options' cannot be null."); |
1,629,672 | private Mono<Response<Flux<ByteBuffer>>> startAssessmentWithResponseAsync(String resourceGroupName, String sqlVirtualMachineName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (sqlVirtualMachineName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.startAssessment(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, this.client.getSubscriptionId(), this.client.getApiVersion(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,766,487 | public boolean enforceEdge(int x, int y, ICause cause) throws ContradictionException {<NEW_LINE>assert cause != null;<NEW_LINE>boolean addX = !LB.containsNode(x);<NEW_LINE>boolean addY <MASK><NEW_LINE>if (UB.containsEdge(x, y)) {<NEW_LINE>if (LB.addEdge(x, y)) {<NEW_LINE>if (reactOnModification) {<NEW_LINE>delta.add(x, GraphDelta.EDGE_ENFORCED_TAIL, cause);<NEW_LINE>delta.add(y, GraphDelta.EDGE_ENFORCED_HEAD, cause);<NEW_LINE>if (addX) {<NEW_LINE>delta.add(x, GraphDelta.NODE_ENFORCED, cause);<NEW_LINE>}<NEW_LINE>if (addY) {<NEW_LINE>delta.add(y, GraphDelta.NODE_ENFORCED, cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addX || addY) {<NEW_LINE>notifyPropagators(GraphEventType.ADD_NODE, cause);<NEW_LINE>}<NEW_LINE>notifyPropagators(GraphEventType.ADD_EDGE, cause);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>this.contradiction(cause, "enforce edge which is not in the domain");<NEW_LINE>return false;<NEW_LINE>} | = !LB.containsNode(y); |
1,845,595 | public void validate(Object value) throws ValidationException {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MessageTools messages = AppBeans.get(MessageTools.NAME);<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new ValidationException(messages.loadString(messagesPack, message));<NEW_LINE>}<NEW_LINE>String s = (String) value;<NEW_LINE>s = s.trim();<NEW_LINE>if ("".equals(value)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Matcher matcher = Pattern.compile<MASK><NEW_LINE>if (!matcher.find()) {<NEW_LINE>throw new ValidationException(messages.loadString(messagesPack, message));<NEW_LINE>}<NEW_LINE>double size = Double.parseDouble(matcher.group(1));<NEW_LINE>String symbol = matcher.group(2);<NEW_LINE>if ("%".equals(symbol)) {<NEW_LINE>if (size < 1 || size > MAX_SIZE_PERCENTS) {<NEW_LINE>throw new ValidationException(messages.loadString(messagesPack, message));<NEW_LINE>}<NEW_LINE>} else if ("px".equals(symbol) || symbol == null) {<NEW_LINE>if (size < 1 || size > MAX_SIZE_PIXELS) {<NEW_LINE>throw new ValidationException(messages.loadString(messagesPack, message));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (SIZE_PATTERN).matcher(s); |
266,915 | protected void discover(final Class clazz, final String property) {<NEW_LINE>try {<NEW_LINE>Object[] params = {};<NEW_LINE>StringBuilder sb = new StringBuilder("is");<NEW_LINE>sb.append(property);<NEW_LINE>setMethod(getIntrospector().getMethod(clazz, sb.toString(), params));<NEW_LINE>if (!isAlive()) {<NEW_LINE>char c = sb.charAt(2);<NEW_LINE>if (Character.isLowerCase(c)) {<NEW_LINE>sb.setCharAt(2, Character.toUpperCase(c));<NEW_LINE>} else {<NEW_LINE>sb.setCharAt(2, Character.toLowerCase(c));<NEW_LINE>}<NEW_LINE>setMethod(getIntrospector().getMethod(clazz, sb<MASK><NEW_LINE>}<NEW_LINE>if (isAlive()) {<NEW_LINE>if (getMethod().getReturnType() != Boolean.TYPE && getMethod().getReturnType() != Boolean.class) {<NEW_LINE>setMethod(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = "Exception while looking for boolean property getter for '" + property;<NEW_LINE>Logger.error(this, msg, e);<NEW_LINE>throw new VelocityException(msg, e);<NEW_LINE>}<NEW_LINE>} | .toString(), params)); |
500,251 | private void pushByFloatMath(int seen, Item it, Item it2) {<NEW_LINE>Item result;<NEW_LINE>@SpecialKind<NEW_LINE>int specialKind = Item.FLOAT_MATH;<NEW_LINE>if ((it.getConstant() instanceof Float) && it2.getConstant() instanceof Float) {<NEW_LINE>if (seen == FADD) {<NEW_LINE>result = new Item("F", Float.valueOf(constantToFloat(it2<MASK><NEW_LINE>} else if (seen == FSUB) {<NEW_LINE>result = new Item("F", Float.valueOf(constantToFloat(it2) - constantToFloat(it)));<NEW_LINE>} else if (seen == FMUL) {<NEW_LINE>result = new Item("F", Float.valueOf(constantToFloat(it2) * constantToFloat(it)));<NEW_LINE>} else if (seen == FDIV) {<NEW_LINE>result = new Item("F", Float.valueOf(constantToFloat(it2) / constantToFloat(it)));<NEW_LINE>} else if (seen == FREM) {<NEW_LINE>result = new Item("F", Float.valueOf(constantToFloat(it2) % constantToFloat(it)));<NEW_LINE>} else {<NEW_LINE>result = new Item("F");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result = new Item("F");<NEW_LINE>if (seen == DDIV) {<NEW_LINE>specialKind = Item.NASTY_FLOAT_MATH;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setSpecialKind(specialKind);<NEW_LINE>push(result);<NEW_LINE>} | ) + constantToFloat(it))); |
342,130 | private static void parseSearchProfileResultsEntry(XContentParser parser, Map<String, ProfileShardResult> searchProfileResults) throws IOException {<NEW_LINE>XContentParser.Token token = parser.currentToken();<NEW_LINE>ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser);<NEW_LINE>List<QueryProfileShardResult> queryProfileResults = new ArrayList<>();<NEW_LINE>AggregationProfileShardResult aggProfileShardResult = null;<NEW_LINE>String id = null;<NEW_LINE>String currentFieldName = null;<NEW_LINE>long inboundNetworkTime = 0;<NEW_LINE>long outboundNetworkTime = 0;<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {<NEW_LINE>if (token == XContentParser.Token.FIELD_NAME) {<NEW_LINE>currentFieldName = parser.currentName();<NEW_LINE>} else if (token.isValue()) {<NEW_LINE>if (ID_FIELD.equals(currentFieldName)) {<NEW_LINE>id = parser.text();<NEW_LINE>} else if (INBOUND_NETWORK_FIELD.equals(currentFieldName)) {<NEW_LINE>inboundNetworkTime = parser.longValue();<NEW_LINE>} else if (OUTBOUND_NETWORK_FIELD.equals(currentFieldName)) {<NEW_LINE>outboundNetworkTime = parser.longValue();<NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>} else if (token == XContentParser.Token.START_ARRAY) {<NEW_LINE>if (SEARCHES_FIELD.equals(currentFieldName)) {<NEW_LINE>while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {<NEW_LINE>queryProfileResults.add(QueryProfileShardResult.fromXContent(parser));<NEW_LINE>}<NEW_LINE>} else if (AggregationProfileShardResult.AGGREGATIONS.equals(currentFieldName)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NetworkTime networkTime = new NetworkTime(inboundNetworkTime, outboundNetworkTime);<NEW_LINE>searchProfileResults.put(id, new ProfileShardResult(queryProfileResults, aggProfileShardResult, networkTime));<NEW_LINE>} | aggProfileShardResult = AggregationProfileShardResult.fromXContent(parser); |
1,185,494 | public static void apply(StringBuilder dest, CharSequence diff) {<NEW_LINE>try {<NEW_LINE>if (diff == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int pos = dest.length() - 1;<NEW_LINE>if (pos < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// orig == ""<NEW_LINE>for (int i = 0; i < diff.length() / 2; i++) {<NEW_LINE>char cmd = diff.charAt(2 * i);<NEW_LINE>char param = diff.charAt(2 * i + 1);<NEW_LINE>int par_num <MASK><NEW_LINE>switch(cmd) {<NEW_LINE>case '-':<NEW_LINE>pos = pos - par_num + 1;<NEW_LINE>break;<NEW_LINE>case 'R':<NEW_LINE>dest.setCharAt(pos, param);<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>int o = pos;<NEW_LINE>pos -= par_num - 1;<NEW_LINE>// String s = orig.toString();<NEW_LINE>// s = s.substring( 0, pos ) + s.substring( o + 1 );<NEW_LINE>// orig = new StringBuffer( s );<NEW_LINE>dest.delete(pos, o + 1);<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>dest.insert(pos += 1, param);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>pos--;<NEW_LINE>}<NEW_LINE>} catch (@SuppressWarnings("unused") StringIndexOutOfBoundsException x) {<NEW_LINE>// x.printStackTrace();<NEW_LINE>} catch (@SuppressWarnings("unused") ArrayIndexOutOfBoundsException x) {<NEW_LINE>// x.printStackTrace();<NEW_LINE>}<NEW_LINE>} | = (param - 'a' + 1); |
951,797 | public void urlVariableNameExistsInEnclosingAnnotation(Element element, ElementValidation validation) {<NEW_LINE>Set<String> validRestMethodAnnotationNames = new HashSet<>();<NEW_LINE>for (Class<? extends Annotation> validAnnotation : REST_ANNOTATION_CLASSES) {<NEW_LINE>validRestMethodAnnotationNames.add(validAnnotation.getCanonicalName());<NEW_LINE>}<NEW_LINE>String url = null;<NEW_LINE>for (AnnotationMirror annotationMirror : element.getEnclosingElement().getAnnotationMirrors()) {<NEW_LINE>if (validRestMethodAnnotationNames.contains(annotationMirror.getAnnotationType().toString())) {<NEW_LINE>url = restAnnotationHelper.extractAnnotationParameter(element.getEnclosingElement(), annotationMirror.getAnnotationType().toString(), "value");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> urlVariableNames = restAnnotationHelper.extractUrlVariableNames(url);<NEW_LINE>String expectedUrlVariableName = restAnnotationHelper.getUrlVariableCorrespondingTo((VariableElement) element);<NEW_LINE>if (!urlVariableNames.contains(expectedUrlVariableName)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | validation.addError(element, "%s annotated parameter is has no corresponding url variable"); |
255,056 | // invalidateIt<NEW_LINE>@Override<NEW_LINE>public String prepareIt() {<NEW_LINE>log.info(toString());<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>// Std Period open?<NEW_LINE>if (!MPeriod.isOpen(getCtx(), getUpdated(), MDocType.DOCBASETYPE_MaterialMovement, getAD_Org_ID())) {<NEW_LINE>m_processMsg = "@PeriodClosed@";<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>MMovementLineConfirm<MASK><NEW_LINE>if (lines.length == 0) {<NEW_LINE>m_processMsg = "@NoLines@";<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>boolean difference = false;<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>if (!lines[i].isFullyConfirmed()) {<NEW_LINE>difference = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>//<NEW_LINE>m_justPrepared = true;<NEW_LINE>if (!DOCACTION_Complete.equals(getDocAction()))<NEW_LINE>setDocAction(DOCACTION_Complete);<NEW_LINE>return IDocument.STATUS_InProgress;<NEW_LINE>} | [] lines = getLines(true); |
899,154 | public void marshall(ResourceShareAssociation resourceShareAssociation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (resourceShareAssociation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getResourceShareArn(), RESOURCESHAREARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getResourceShareName(), RESOURCESHARENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getAssociatedEntity(), ASSOCIATEDENTITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getAssociationType(), ASSOCIATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(resourceShareAssociation.getExternal(), EXTERNAL_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | resourceShareAssociation.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); |
1,017,348 | private void runTest(String testMethod, PrintWriter pw, HttpServletRequest req, HttpServletResponse resp) {<NEW_LINE>try {<NEW_LINE>Method testM = this.getClass().getDeclaredMethod(testMethod, new Class[] { Map.class, StringBuilder.class });<NEW_LINE>Map<String, String> m = new <MASK><NEW_LINE>Iterator itr = req.getParameterMap().keySet().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>String key = (String) itr.next();<NEW_LINE>if (key.indexOf("@") == 0) {<NEW_LINE>m.put(key.substring(1), req.getParameter(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>m.put("serverIP", req.getLocalAddr());<NEW_LINE>m.put("serverPort", String.valueOf(req.getLocalPort()));<NEW_LINE>StringBuilder ret = new StringBuilder();<NEW_LINE>testM.invoke(this, m, ret);<NEW_LINE>pw.write(ret.toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>}<NEW_LINE>} | HashMap<String, String>(); |
577,339 | public void addSingleJob(JobKey jobKey, TriggerKey triggerKey, Class jobClass, Date date, JobDataMap jobDataMap) {<NEW_LINE>try {<NEW_LINE>LogUtil.info("addSingleJob: " + triggerKey.getName() + "," + triggerKey.getGroup());<NEW_LINE>JobBuilder jobBuilder = JobBuilder.newJob(jobClass).withIdentity(jobKey);<NEW_LINE>if (jobDataMap != null) {<NEW_LINE>jobBuilder.usingJobData(jobDataMap);<NEW_LINE>}<NEW_LINE>JobDetail jobDetail = jobBuilder.build();<NEW_LINE>TriggerBuilder<Trigger> triggerBuilder = TriggerBuilder.newTrigger();<NEW_LINE>triggerBuilder.withIdentity(triggerKey);<NEW_LINE>triggerBuilder.startAt(date);<NEW_LINE>Trigger trigger = triggerBuilder.build();<NEW_LINE>scheduler.scheduleJob(jobDetail, trigger);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LogUtil.error(<MASK><NEW_LINE>DataEaseException.throwException(e);<NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,029,176 | public static void registerFrameWithoutBoxingPlugins(InvocationPlugins plugins, MetaAccessProvider metaAccess, boolean canDelayIntrinsification, ConstantReflectionProvider constantReflection, KnownTruffleTypes types, EconomicSet<ResolvedJavaType> primitiveBoxingTypes) {<NEW_LINE>ResolvedJavaType frameWithoutBoxingType = getRuntime().resolveType(metaAccess, "com.oracle.truffle.api.impl.FrameWithoutBoxing");<NEW_LINE>Registration r = new Registration(plugins, new ResolvedJavaSymbol(frameWithoutBoxingType));<NEW_LINE>registerFrameMethods(r, constantReflection, types);<NEW_LINE>registerUnsafeCast(r, canDelayIntrinsification, primitiveBoxingTypes);<NEW_LINE>registerUnsafeLoadStorePlugins(r, canDelayIntrinsification, null, JavaKind.Long, JavaKind.Object);<NEW_LINE>registerFrameAccessors(r, <MASK><NEW_LINE>registerFrameAccessors(r, JavaKind.Long, constantReflection, types);<NEW_LINE>registerFrameAccessors(r, JavaKind.Int, constantReflection, types);<NEW_LINE>registerFrameAccessors(r, JavaKind.Double, constantReflection, types);<NEW_LINE>registerFrameAccessors(r, JavaKind.Float, constantReflection, types);<NEW_LINE>registerFrameAccessors(r, JavaKind.Boolean, constantReflection, types);<NEW_LINE>registerFrameAccessors(r, JavaKind.Byte, constantReflection, types);<NEW_LINE>registerFrameTagAccessor(r);<NEW_LINE>registerFrameAuxiliaryAccessors(r);<NEW_LINE>} | JavaKind.Object, constantReflection, types); |
424,227 | private List<String> list(Business business, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Portal.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Portal> root = cq.from(Portal.class);<NEW_LINE>Predicate p = cb.or(cb.isNull(root.get(Portal_.pcClient)), cb.isTrue(root.<MASK><NEW_LINE>if (effectivePerson.isNotManager() && (!business.organization().person().hasRole(effectivePerson, OrganizationDefinition.PortalManager))) {<NEW_LINE>List<String> identities = business.organization().identity().listWithPerson(effectivePerson.getDistinguishedName());<NEW_LINE>List<String> units = business.organization().unit().listWithPersonSupNested(effectivePerson.getDistinguishedName());<NEW_LINE>Predicate who = cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName());<NEW_LINE>who = cb.or(who, cb.isMember(effectivePerson.getDistinguishedName(), root.get(Portal_.controllerList)));<NEW_LINE>who = cb.or(who, cb.and(cb.isEmpty(root.get(Portal_.availableIdentityList)), cb.isEmpty(root.get(Portal_.availableUnitList))));<NEW_LINE>who = cb.or(who, root.get(Portal_.availableIdentityList).in(identities));<NEW_LINE>who = cb.or(who, root.get(Portal_.availableUnitList).in(units));<NEW_LINE>p = cb.and(p, who);<NEW_LINE>}<NEW_LINE>cq.select(root.get(Portal_.id)).where(p);<NEW_LINE>return em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>} | get(Portal_.pcClient))); |
884,172 | private Symbol markupDescriptorEntry(Address entryAddr, boolean isGlobal, ElfLoadHelper elfLoadHelper) {<NEW_LINE>Program program = elfLoadHelper.getProgram();<NEW_LINE>// markup function descriptor (3 elements, 24-bytes)<NEW_LINE>Data refPtr = elfLoadHelper.createData(entryAddr, PointerDataType.dataType);<NEW_LINE>Data tocPtr = elfLoadHelper.createData(entryAddr.add(program.getDefaultPointerSize()), PointerDataType.dataType);<NEW_LINE>// TODO: uncertain what 3rd procedure descriptor element represents<NEW_LINE>elfLoadHelper.createData(entryAddr.add(2 * program.getDefaultPointerSize()), QWordDataType.dataType);<NEW_LINE>if (refPtr == null || tocPtr == null) {<NEW_LINE>Msg.error(this, "Failed to process PPC64 descriptor at " + entryAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Address refAddr = (Address) refPtr.getValue();<NEW_LINE>if (refAddr == null || program.getMemory().getBlock(refAddr) == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ElfDefaultGotPltMarkup.setConstant(refPtr);<NEW_LINE>ElfDefaultGotPltMarkup.setConstant(tocPtr);<NEW_LINE>Function function = program.getListing().getFunctionAt(refAddr);<NEW_LINE>if (function == null) {<NEW_LINE>// Check for potential pointer table (unsure a non-function would be referenced by OPD section)<NEW_LINE>Relocation reloc = program.<MASK><NEW_LINE>if (reloc != null && reloc.getType() == PowerPC64_ElfRelocationConstants.R_PPC64_RELATIVE) {<NEW_LINE>return program.getSymbolTable().getPrimarySymbol(refAddr);<NEW_LINE>}<NEW_LINE>// Otherwise, create function at OPD referenced location<NEW_LINE>function = elfLoadHelper.createOneByteFunction(null, refAddr, isGlobal);<NEW_LINE>}<NEW_LINE>// set r2 to TOC base for each function<NEW_LINE>Address tocAddr = (Address) tocPtr.getValue();<NEW_LINE>if (tocAddr != null) {<NEW_LINE>Register r2reg = program.getRegister("r2");<NEW_LINE>RegisterValue tocValue = new RegisterValue(r2reg, tocAddr.getOffsetAsBigInteger());<NEW_LINE>try {<NEW_LINE>program.getProgramContext().setRegisterValue(refAddr, refAddr, tocValue);<NEW_LINE>} catch (ContextChangeException e) {<NEW_LINE>throw new AssertException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return function.getSymbol();<NEW_LINE>} | getRelocationTable().getRelocation(refAddr); |
1,696,174 | private void fillTypeCandidates(SSAVar ssaVar) {<NEW_LINE>TypeSearchVarInfo varInfo = state.getVarInfo(ssaVar);<NEW_LINE>ArgType immutableType = ssaVar.getImmutableType();<NEW_LINE>if (immutableType != null) {<NEW_LINE>varInfo.markResolved(immutableType);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArgType currentType = ssaVar.getTypeInfo().getType();<NEW_LINE>if (currentType.isTypeKnown()) {<NEW_LINE>varInfo.markResolved(currentType);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<ArgType> assigns = new LinkedHashSet<>();<NEW_LINE>Set<ArgType> uses = new LinkedHashSet<>();<NEW_LINE>Set<ITypeBound> bounds = ssaVar.getTypeInfo().getBounds();<NEW_LINE>for (ITypeBound bound : bounds) {<NEW_LINE>if (bound.getBound() == BoundEnum.ASSIGN) {<NEW_LINE>assigns.add(bound.getType());<NEW_LINE>} else {<NEW_LINE>uses.add(bound.getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<ArgType> candidateTypes = new LinkedHashSet<>();<NEW_LINE>addCandidateTypes(bounds, candidateTypes, assigns);<NEW_LINE>addCandidateTypes(bounds, candidateTypes, uses);<NEW_LINE>for (ArgType assignType : assigns) {<NEW_LINE>addCandidateTypes(bounds, candidateTypes, getWiderTypes(assignType));<NEW_LINE>}<NEW_LINE>for (ArgType useType : uses) {<NEW_LINE>addCandidateTypes(bounds, candidateTypes, getNarrowTypes(useType));<NEW_LINE>}<NEW_LINE>addUsageTypeCandidates(ssaVar, bounds, candidateTypes);<NEW_LINE>int size = candidateTypes.size();<NEW_LINE>if (size == 0) {<NEW_LINE>varInfo.setTypeResolved(true);<NEW_LINE>varInfo.setCurrentType(ArgType.UNKNOWN);<NEW_LINE>varInfo.setCandidateTypes(Collections.emptyList());<NEW_LINE>} else if (size == 1) {<NEW_LINE>varInfo.setTypeResolved(true);<NEW_LINE>varInfo.setCurrentType(candidateTypes.iterator().next());<NEW_LINE>varInfo.setCandidateTypes(Collections.emptyList());<NEW_LINE>} else {<NEW_LINE>varInfo.setTypeResolved(false);<NEW_LINE>varInfo.setCurrentType(ArgType.UNKNOWN);<NEW_LINE>ArrayList<ArgType> types = new ArrayList<>(candidateTypes);<NEW_LINE>types.sort(typeCompare.getReversedComparator());<NEW_LINE>varInfo.setCandidateTypes<MASK><NEW_LINE>}<NEW_LINE>} | (Collections.unmodifiableList(types)); |
899,521 | public static GetQuotaAlarmResponse unmarshall(GetQuotaAlarmResponse getQuotaAlarmResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQuotaAlarmResponse.setRequestId(_ctx.stringValue("GetQuotaAlarmResponse.RequestId"));<NEW_LINE>QuotaAlarm quotaAlarm = new QuotaAlarm();<NEW_LINE>quotaAlarm.setAlarmId(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.AlarmId"));<NEW_LINE>quotaAlarm.setQuotaActionCode(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.QuotaActionCode"));<NEW_LINE>quotaAlarm.setQuotaValue<MASK><NEW_LINE>quotaAlarm.setThresholdPercent(_ctx.floatValue("GetQuotaAlarmResponse.QuotaAlarm.ThresholdPercent"));<NEW_LINE>quotaAlarm.setAlarmName(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.AlarmName"));<NEW_LINE>quotaAlarm.setProductCode(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.ProductCode"));<NEW_LINE>quotaAlarm.setNotifyTarget(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.NotifyTarget"));<NEW_LINE>quotaAlarm.setCreateTime(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.CreateTime"));<NEW_LINE>quotaAlarm.setQuotaDimension(_ctx.mapValue("GetQuotaAlarmResponse.QuotaAlarm.QuotaDimension"));<NEW_LINE>quotaAlarm.setQuotaUsage(_ctx.floatValue("GetQuotaAlarmResponse.QuotaAlarm.QuotaUsage"));<NEW_LINE>quotaAlarm.setThreshold(_ctx.floatValue("GetQuotaAlarmResponse.QuotaAlarm.Threshold"));<NEW_LINE>quotaAlarm.setThresholdType(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.ThresholdType"));<NEW_LINE>List<String> notifyChannels = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQuotaAlarmResponse.QuotaAlarm.NotifyChannels.Length"); i++) {<NEW_LINE>notifyChannels.add(_ctx.stringValue("GetQuotaAlarmResponse.QuotaAlarm.NotifyChannels[" + i + "]"));<NEW_LINE>}<NEW_LINE>quotaAlarm.setNotifyChannels(notifyChannels);<NEW_LINE>getQuotaAlarmResponse.setQuotaAlarm(quotaAlarm);<NEW_LINE>return getQuotaAlarmResponse;<NEW_LINE>} | (_ctx.floatValue("GetQuotaAlarmResponse.QuotaAlarm.QuotaValue")); |
118,882 | public SdkHttpRequest modifyHttpRequest(Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) {<NEW_LINE>ChecksumSpecs checksumSpecs = HttpChecksumUtils.checksumSpecWithRequestAlgorithm(executionAttributes).orElse(null);<NEW_LINE>if (checksumSpecs == null || checksumSpecs.headerName() == null || !HttpChecksumUtils.isTrailerBasedChecksumForClientType(executionAttributes, context.httpRequest(), ClientType.ASYNC, checksumSpecs, context.asyncRequestBody().isPresent(), context.requestBody().map(requestBody -> requestBody.contentStreamProvider() != null).orElse(false))) {<NEW_LINE>return context.httpRequest();<NEW_LINE>}<NEW_LINE>long checksumContentLength = ChunkContentUtils.calculateChecksumContentLength(checksumSpecs.algorithm(), checksumSpecs.headerName());<NEW_LINE>long originalContentLength = context.asyncRequestBody().isPresent() ? context.asyncRequestBody().get().contentLength(<MASK><NEW_LINE>return updateHeadersForTrailerChecksum(context, checksumSpecs, checksumContentLength, originalContentLength);<NEW_LINE>} | ).orElse(0L) : 0; |
965,621 | public static ItemStack fillItem(Level world, int requiredAmount, ItemStack stack, FluidStack availableFluid) {<NEW_LINE>FluidStack toFill = availableFluid.copy();<NEW_LINE>toFill.setAmount(requiredAmount);<NEW_LINE>availableFluid.shrink(requiredAmount);<NEW_LINE>if (stack.getItem() == Items.GLASS_BOTTLE && canFillGlassBottleInternally(toFill)) {<NEW_LINE>ItemStack fillBottle = ItemStack.EMPTY;<NEW_LINE>if (FluidHelper.isWater(toFill.getFluid()))<NEW_LINE>fillBottle = PotionUtils.setPotion(new ItemStack(Items<MASK><NEW_LINE>else<NEW_LINE>fillBottle = PotionFluidHandler.fillBottle(stack, toFill);<NEW_LINE>stack.shrink(1);<NEW_LINE>return fillBottle;<NEW_LINE>}<NEW_LINE>ItemStack split = stack.copy();<NEW_LINE>split.setCount(1);<NEW_LINE>LazyOptional<IFluidHandlerItem> capability = split.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY);<NEW_LINE>IFluidHandlerItem tank = capability.orElse(null);<NEW_LINE>if (tank == null)<NEW_LINE>return ItemStack.EMPTY;<NEW_LINE>tank.fill(toFill, FluidAction.EXECUTE);<NEW_LINE>ItemStack container = tank.getContainer().copy();<NEW_LINE>stack.shrink(1);<NEW_LINE>return container;<NEW_LINE>} | .POTION), Potions.WATER); |
994,252 | final DescribeRecipeResult executeDescribeRecipe(DescribeRecipeRequest describeRecipeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRecipeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRecipeRequest> request = null;<NEW_LINE>Response<DescribeRecipeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRecipeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRecipeRequest));<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, "Personalize");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRecipe");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRecipeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRecipeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
284,202 | private static void handleMultipleImpl(List<String> interfaceClasses, List<Object> value) throws Exception {<NEW_LINE>List<Object> arrays = interfaceClasses.stream().map(c -> {<NEW_LINE>try {<NEW_LINE>return Array.newInstance(Class.forName(c), value.size());<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new RuntimeException("ClassNotFoundException for " + c, e);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>for (int i = 0; i < value.size(); i++) {<NEW_LINE>Object object = value.get(i);<NEW_LINE>if (object instanceof String) {<NEW_LINE>Class implClass = Class.forName((String<MASK><NEW_LINE>for (Object array : arrays) {<NEW_LINE>Array.set(array, i, construct(implClass));<NEW_LINE>}<NEW_LINE>} else if (object instanceof Map) {<NEW_LINE>Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) object;<NEW_LINE>List<Object> constructedClasses = constructAndAddToServiceMap(interfaceClasses, map);<NEW_LINE>for (Object array : arrays) {<NEW_LINE>Array.set(array, i, constructedClasses.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < interfaceClasses.size(); i++) {<NEW_LINE>serviceMap.put(interfaceClasses.get(i), arrays.get(i));<NEW_LINE>}<NEW_LINE>} | ) value.get(i)); |
630,065 | public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {<NEW_LINE>// return variable that accumulates replacements<NEW_LINE><MASK><NEW_LINE>final serverObjects prop = new serverObjects();<NEW_LINE>// get segment<NEW_LINE>Segment indexSegment = sb.index;<NEW_LINE>if (post == null) {<NEW_LINE>prop.put("linkfreq", sb.getConfigLong("defaultLinkReceiveFrequency", 30));<NEW_LINE>prop.put("wordfreq", sb.getConfigLong("defaultWordReceiveFrequency", 10));<NEW_LINE>prop.put("dtable", "");<NEW_LINE>prop.put("rtable", "");<NEW_LINE>prop.putNum("wcount", indexSegment.RWICount());<NEW_LINE>prop.putNum("ucount", indexSegment.fulltext().collectionSize());<NEW_LINE>// be save<NEW_LINE>return prop;<NEW_LINE>}<NEW_LINE>if (post.containsKey("indexsharesetting")) {<NEW_LINE>sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, post.containsKey("distribute"));<NEW_LINE>sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, post.containsKey("receive"));<NEW_LINE>sb.setConfig("defaultLinkReceiveFrequency", post.getInt("linkfreq", 30));<NEW_LINE>sb.setConfig("defaultWordReceiveFrequency", post.getInt("wordfreq", 10));<NEW_LINE>}<NEW_LINE>// insert constants<NEW_LINE>prop.putNum("wcount", indexSegment.RWICount());<NEW_LINE>prop.putNum("ucount", indexSegment.fulltext().collectionSize());<NEW_LINE>// return rewrite properties<NEW_LINE>return prop;<NEW_LINE>} | final Switchboard sb = (Switchboard) env; |
1,141,692 | public void newStreamWithData() throws Exception {<NEW_LINE>HTTP2Client http2Client = new HTTP2Client();<NEW_LINE>http2Client.start();<NEW_LINE>// tag::newStreamWithData[]<NEW_LINE>SocketAddress serverAddress = new InetSocketAddress("localhost", 8080);<NEW_LINE>CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter());<NEW_LINE>Session session = sessionCF.get();<NEW_LINE>// Configure the request headers.<NEW_LINE>HttpFields requestHeaders = HttpFields.build().put(HttpHeader.CONTENT_TYPE, "application/json");<NEW_LINE>// The request metadata with method, URI and headers.<NEW_LINE>MetaData.Request request = new MetaData.Request("POST", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders);<NEW_LINE>// The HTTP/2 HEADERS frame, with endStream=false to<NEW_LINE>// signal that there will be more frames in this stream.<NEW_LINE>HeadersFrame headersFrame = new HeadersFrame(request, null, false);<NEW_LINE>// Open a Stream by sending the HEADERS frame.<NEW_LINE>CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter());<NEW_LINE>// Block to obtain the Stream.<NEW_LINE>// Alternatively you can use the CompletableFuture APIs to avoid blocking.<NEW_LINE>Stream stream = streamCF.get();<NEW_LINE>// The request content, in two chunks.<NEW_LINE>String content1 = "{\"greet\": \"hello world\"}";<NEW_LINE>ByteBuffer buffer1 = StandardCharsets.UTF_8.encode(content1);<NEW_LINE>String content2 = "{\"user\": \"jetty\"}";<NEW_LINE>ByteBuffer buffer2 = StandardCharsets.UTF_8.encode(content2);<NEW_LINE>// Send the first DATA frame on the stream, with endStream=false<NEW_LINE>// to signal that there are more frames in this stream.<NEW_LINE>CompletableFuture<Stream> dataCF1 = stream.data(new DataFrame(stream.getId(), buffer1, false));<NEW_LINE>// Only when the first chunk has been sent we can send the second,<NEW_LINE>// with endStream=true to signal that there are no more frames.<NEW_LINE>dataCF1.thenCompose(s -> s.data(new DataFrame(s.getId(<MASK><NEW_LINE>// end::newStreamWithData[]<NEW_LINE>} | ), buffer2, true))); |
410,471 | protected void doStart() throws Exception {<NEW_LINE>if (!_dsProvided) {<NEW_LINE>boolean blankCustomnamespace = <MASK><NEW_LINE>boolean blankCustomHost = StringUtil.isBlank(getHost());<NEW_LINE>boolean blankCustomProjectId = StringUtil.isBlank(getProjectId());<NEW_LINE>if (blankCustomnamespace && blankCustomHost && blankCustomProjectId)<NEW_LINE>_datastore = DatastoreOptions.getDefaultInstance().getService();<NEW_LINE>else {<NEW_LINE>DatastoreOptions.Builder builder = DatastoreOptions.newBuilder();<NEW_LINE>if (!blankCustomnamespace)<NEW_LINE>builder.setNamespace(getNamespace());<NEW_LINE>if (!blankCustomHost)<NEW_LINE>builder.setHost(getHost());<NEW_LINE>if (!blankCustomProjectId)<NEW_LINE>builder.setProjectId(getProjectId());<NEW_LINE>_datastore = builder.build().getService();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_model == null) {<NEW_LINE>_model = new EntityDataModel();<NEW_LINE>addBean(_model, true);<NEW_LINE>}<NEW_LINE>_keyFactory = _datastore.newKeyFactory().setKind(_model.getKind());<NEW_LINE>_indexesPresent = checkIndexes();<NEW_LINE>if (!_indexesPresent)<NEW_LINE>LOG.warn("Session indexes not uploaded, falling back to less efficient queries");<NEW_LINE>super.doStart();<NEW_LINE>} | StringUtil.isBlank(getNamespace()); |
1,354,567 | protected void performAction(final File repository, final File[] roots, final VCSContext context) {<NEW_LINE>RepositoryInfo info = RepositoryInfo.getInstance(repository);<NEW_LINE>info.refresh();<NEW_LINE>if (!canCommit(repository, info)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final GitRepositoryState state = info.getRepositoryState();<NEW_LINE><MASK><NEW_LINE>final String mergeCommitMessage = getMergeCommitMessage(repository, state);<NEW_LINE>final String title = Bundle.CTL_CommitPanel_title(Utils.getContextDisplayName(context), info.getActiveBranch().getName());<NEW_LINE>EventQueue.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>GitCommitPanel panel = state == GitRepositoryState.MERGING_RESOLVED || state == GitRepositoryState.CHERRY_PICKING_RESOLVED ? GitCommitPanelMerged.create(roots, repository, user, mergeCommitMessage) : GitCommitPanel.create(roots, repository, user, isFromGitView(context));<NEW_LINE>VCSCommitTable<GitLocalFileNode> table = panel.getCommitTable();<NEW_LINE>// NOI18N<NEW_LINE>boolean ok = panel.open(context, new HelpCtx("org.netbeans.modules.git.ui.commit.CommitAction"), title);<NEW_LINE>if (ok) {<NEW_LINE>final List<GitLocalFileNode> commitFiles = table.getCommitFiles();<NEW_LINE>// NOI18N<NEW_LINE>GitModuleConfig.getDefault().setLastCanceledCommitMessage("");<NEW_LINE>panel.getParameters().storeCommitMessage();<NEW_LINE>final VCSCommitFilter selectedFilter = panel.getSelectedFilter();<NEW_LINE>RequestProcessor rp = Git.getInstance().getRequestProcessor(repository);<NEW_LINE>GitProgressSupport support = new CommitProgressSupport(panel, commitFiles, selectedFilter, state);<NEW_LINE>// NOI18N<NEW_LINE>support.start(rp, repository, org.openide.util.NbBundle.getMessage(CommitAction.class, "LBL_Commit_Progress"));<NEW_LINE>} else if (!panel.getParameters().getCommitMessage().isEmpty()) {<NEW_LINE>GitModuleConfig.getDefault().setLastCanceledCommitMessage(panel.getParameters().getCommitMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | final GitUser user = identifyUser(repository); |
1,845,786 | public List<String> autoDetectEncoding(byte[] rawtext) {<NEW_LINE>scores[GB2312] = gb2312_probability(rawtext);<NEW_LINE>scores[GBK] = gbk_probability(rawtext);<NEW_LINE>scores[GB18030] = gb18030_probability(rawtext);<NEW_LINE>scores[HZ] = hz_probability(rawtext);<NEW_LINE>scores[BIG5] = big5_probability(rawtext);<NEW_LINE>scores[CNS11643] = euc_tw_probability(rawtext);<NEW_LINE>scores[ISO2022CN] = iso_2022_cn_probability(rawtext);<NEW_LINE>scores[UTF8] = utf8_probability(rawtext);<NEW_LINE>scores[UNICODE] = utf16_probability(rawtext);<NEW_LINE>scores<MASK><NEW_LINE>scores[CP949] = cp949_probability(rawtext);<NEW_LINE>scores[JOHAB] = 0;<NEW_LINE>scores[ISO2022KR] = iso_2022_kr_probability(rawtext);<NEW_LINE>scores[ASCII] = ascii_probability(rawtext);<NEW_LINE>scores[SJIS] = sjis_probability(rawtext);<NEW_LINE>scores[EUC_JP] = euc_jp_probability(rawtext);<NEW_LINE>scores[ISO2022JP] = iso_2022_jp_probability(rawtext);<NEW_LINE>scores[UNICODET] = 0;<NEW_LINE>scores[UNICODE_ESCAPE] = utf16_escape_probability(rawtext);<NEW_LINE>scores[ISO2022CN_GB] = 0;<NEW_LINE>scores[ISO2022CN_CNS] = 0;<NEW_LINE>scores[OTHER] = 0;<NEW_LINE>// Tabulate Scores<NEW_LINE>int index, maxscore = 0;<NEW_LINE>int encoding_guess = OTHER;<NEW_LINE>List<String> lls = new ArrayList<String>();<NEW_LINE>for (index = 0; index < TOTALTYPES; index++) {<NEW_LINE>if (debug && scores[index] > 0)<NEW_LINE>System.err.println("Encoding " + nicename[index] + " score " + scores[index]);<NEW_LINE>if (scores[index] >= maxscore) {<NEW_LINE>encoding_guess = index;<NEW_LINE>if (scores[index] > maxscore) {<NEW_LINE>lls.clear();<NEW_LINE>}<NEW_LINE>maxscore = scores[index];<NEW_LINE>lls.add(nicename[index]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Return OTHER if nothing scored above 50<NEW_LINE>if (maxscore <= 50) {<NEW_LINE>encoding_guess = OTHER;<NEW_LINE>lls.clear();<NEW_LINE>lls.add("OTHER");<NEW_LINE>}<NEW_LINE>return lls;<NEW_LINE>} | [EUC_KR] = euc_kr_probability(rawtext); |
1,014,360 | public Object execute(CommandLine commandLine) throws Exception {<NEW_LINE>String file = commandLine.getValue(Options.FILE_OPTION);<NEW_LINE>String projectName = commandLine.getValue(Options.PROJECT_OPTION);<NEW_LINE>// only refresh the file.<NEW_LINE>if (!commandLine.hasOption(Options.VALIDATE_OPTION)) {<NEW_LINE>// getting the file will refresh it.<NEW_LINE>ProjectUtils.getFile(projectName, file);<NEW_LINE>// validate the src file.<NEW_LINE>} else {<NEW_LINE>// JavaScriptUtils refreshes the file when getting it.<NEW_LINE>IJavaScriptUnit src = <MASK><NEW_LINE>IJavaScriptUnit workingCopy = src.getWorkingCopy(null);<NEW_LINE>ProblemRequestor requestor = new ProblemRequestor();<NEW_LINE>try {<NEW_LINE>workingCopy.discardWorkingCopy();<NEW_LINE>// deprecated, so do what the non-deprecated version does, just using<NEW_LINE>// our ProblemRequestor instead of the working copy owner.<NEW_LINE>// workingCopy.becomeWorkingCopy(requestor, null);<NEW_LINE>BecomeWorkingCopyOperation operation = new BecomeWorkingCopyOperation((org.eclipse.wst.jsdt.internal.core.CompilationUnit) workingCopy, requestor);<NEW_LINE>operation.runOperation(null);<NEW_LINE>} finally {<NEW_LINE>workingCopy.discardWorkingCopy();<NEW_LINE>}<NEW_LINE>List<IProblem> problems = requestor.getProblems();<NEW_LINE>ArrayList<Error> errors = new ArrayList<Error>();<NEW_LINE>String filename = src.getResource().getLocation().toOSString();<NEW_LINE>FileOffsets offsets = FileOffsets.compile(filename);<NEW_LINE>for (IProblem problem : problems) {<NEW_LINE>int[] lineColumn = offsets.offsetToLineColumn(problem.getSourceStart());<NEW_LINE>// one day vim might support ability to mark the offending text.<NEW_LINE>errors.add(new Error(problem.getMessage(), filename, lineColumn[0], lineColumn[1], problem.isWarning()));<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | JavaScriptUtils.getJavaScriptUnit(projectName, file); |
564,064 | protected boolean matchesRegistrationContext(String layer, String appContext, RegistrationContext context) {<NEW_LINE>boolean match = false;<NEW_LINE>if (context != null) {<NEW_LINE>String ctxLayer = context.getMessageLayer();<NEW_LINE><MASK><NEW_LINE>if (ctxLayer != null && ctxId != null) {<NEW_LINE>// layer & appContext must match<NEW_LINE>match = ctxLayer.equals(layer) && ctxId.equals(appContext);<NEW_LINE>} else if (ctxLayer == null && ctxId == null) {<NEW_LINE>// anything is a match<NEW_LINE>match = true;<NEW_LINE>} else if (ctxLayer == null && ctxId != null) {<NEW_LINE>// appContext must match<NEW_LINE>match = ctxId.equals(appContext);<NEW_LINE>} else if (ctxLayer != null && ctxId == null) {<NEW_LINE>// layer must match<NEW_LINE>match = ctxLayer.equals(layer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return match;<NEW_LINE>} | String ctxId = context.getAppContext(); |
397,504 | public static String remainingTime(Context context, long time_s) {<NEW_LINE>// Time in unit x<NEW_LINE>int time_x;<NEW_LINE>// Time not counted in the number in unit x<NEW_LINE>int remaining_seconds;<NEW_LINE>// Time in the unit smaller than x<NEW_LINE>int remaining;<NEW_LINE>Resources res = context.getResources();<NEW_LINE>if (time_s < TIME_HOUR_LONG) {<NEW_LINE>// get time remaining, but never less than 1<NEW_LINE>time_x = Math.max((int) Math.round(time_s / TIME_MINUTE), 1);<NEW_LINE>return res.getQuantityString(R.plurals.reviewer_window_title, time_x, time_x);<NEW_LINE>// It used to be minutes only. So the word "minutes" is not<NEW_LINE>// explicitly written in the ressource name.<NEW_LINE>} else if (time_s < TIME_DAY_LONG) {<NEW_LINE>time_x = (int) (time_s / TIME_HOUR_LONG);<NEW_LINE>remaining_seconds = (int) (time_s % TIME_HOUR_LONG);<NEW_LINE>remaining = (int) Math.round<MASK><NEW_LINE>return res.getQuantityString(R.plurals.reviewer_window_title_hours, time_x, time_x, remaining);<NEW_LINE>} else {<NEW_LINE>time_x = (int) (time_s / TIME_DAY_LONG);<NEW_LINE>remaining_seconds = (int) ((float) time_s % TIME_DAY_LONG);<NEW_LINE>remaining = (int) Math.round(remaining_seconds / TIME_HOUR);<NEW_LINE>return res.getQuantityString(R.plurals.reviewer_window_title_days, time_x, time_x, remaining);<NEW_LINE>}<NEW_LINE>} | ((float) remaining_seconds / TIME_MINUTE); |
1,473,794 | public StaticObject toGuestComponent(Meta meta, ObjectKlass klass) {<NEW_LINE>assert meta.getJavaVersion().java16OrLater();<NEW_LINE>RuntimeConstantPool pool = klass.getConstantPool();<NEW_LINE>StaticObject component = meta.java_lang_reflect_RecordComponent.allocateInstance();<NEW_LINE>Symbol<Name> nameSymbol = pool.symbolAt(name);<NEW_LINE>Symbol<Type> typeSymbol = pool.symbolAt(descriptor);<NEW_LINE>Symbol<Signature> signature = meta.getSignatures().makeRaw(typeSymbol);<NEW_LINE>meta.java_lang_reflect_RecordComponent_clazz.setObject(component, klass.mirror());<NEW_LINE>meta.java_lang_reflect_RecordComponent_name.setObject(component, meta.toGuestString(nameSymbol));<NEW_LINE>meta.java_lang_reflect_RecordComponent_type.setObject(component, meta.resolveSymbolAndAccessCheck(typeSymbol, klass).mirror());<NEW_LINE>// Find and set accessor<NEW_LINE>Method m = klass.lookupMethod(nameSymbol, signature);<NEW_LINE>boolean validMethod = m != null && !m.isStatic() && !m.isConstructor();<NEW_LINE>meta.java_lang_reflect_RecordComponent_accessor.setObject(component, validMethod ? m.makeMirror() : StaticObject.NULL);<NEW_LINE>// Find and set generic signature<NEW_LINE>SignatureAttribute genericSignatureAttribute = (SignatureAttribute) getAttribute(SignatureAttribute.NAME);<NEW_LINE>meta.java_lang_reflect_RecordComponent_signature.setObject(component, genericSignatureAttribute != null ? meta.toGuestString(pool.symbolAt(genericSignatureAttribute.getSignatureIndex(<MASK><NEW_LINE>// Find and set annotations<NEW_LINE>doAnnotation(component, Name.RuntimeVisibleAnnotations, meta.java_lang_reflect_RecordComponent_annotations, meta);<NEW_LINE>doAnnotation(component, Name.RuntimeVisibleTypeAnnotations, meta.java_lang_reflect_RecordComponent_typeAnnotations, meta);<NEW_LINE>return component;<NEW_LINE>} | ))) : StaticObject.NULL); |
826,869 | private void buildLeafClusters(int split, FiniteProgress progress) {<NEW_LINE>final Logging log = getLogger();<NEW_LINE>final DBIDVar tmp = DBIDUtil.newVar();<NEW_LINE>final <MASK><NEW_LINE>// Process merges backwards, starting at the split point (less<NEW_LINE>// allocations). We build a map (merge number -> cluster number), and add<NEW_LINE>// singleton objects to their clusters.<NEW_LINE>for (int i = split - 1; i >= 0; --i) {<NEW_LINE>final int a = merges.getMergeA(i), b = merges.getMergeB(i);<NEW_LINE>// no longer needed<NEW_LINE>int c = leafMap.remove(i + n);<NEW_LINE>ModifiableDBIDs ci = null;<NEW_LINE>if (c < 0) {<NEW_LINE>// not yet created<NEW_LINE>// next index<NEW_LINE>c = clusterMembers.size();<NEW_LINE>ci = DBIDUtil.newArray();<NEW_LINE>clusterMembers.add(ci);<NEW_LINE>leafTop.add(i);<NEW_LINE>} else {<NEW_LINE>ci = clusterMembers.get(c);<NEW_LINE>}<NEW_LINE>if (b < n) {<NEW_LINE>// b is singleton, add<NEW_LINE>ci.add(merges.assignVar(b, tmp));<NEW_LINE>} else {<NEW_LINE>// ca = c<NEW_LINE>leafMap.put(b, c);<NEW_LINE>}<NEW_LINE>if (a < n) {<NEW_LINE>// a is singleton, add<NEW_LINE>ci.add(merges.assignVar(a, tmp));<NEW_LINE>} else {<NEW_LINE>// ca = c<NEW_LINE>leafMap.put(a, c);<NEW_LINE>}<NEW_LINE>log.incrementProcessed(progress);<NEW_LINE>}<NEW_LINE>} | int n = merges.size(); |
1,597,825 | public RationalNumbersRobust minus(RationalNumbersRobust b) {<NEW_LINE>assert this.numerator * b.denominator <= Integer.MAX_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE;<NEW_LINE>assert b.numerator * this.denominator <= Integer.MAX_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE;<NEW_LINE>assert this.numerator * b<MASK><NEW_LINE>assert b.numerator * this.denominator >= Integer.MIN_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE;<NEW_LINE>long newNumeratorA = this.numerator() * b.denominator();<NEW_LINE>long newNumeratorB = b.numerator() * this.denominator();<NEW_LINE>assert newNumeratorA - newNumeratorB >= Integer.MIN_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE;<NEW_LINE>int resultNumerator = (int) (newNumeratorA - newNumeratorB);<NEW_LINE>assert this.denominator * b.denominator <= Integer.MAX_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE;<NEW_LINE>int resultDenominator = this.denominator() * b.denominator();<NEW_LINE>return new RationalNumbersRobust(resultNumerator, resultDenominator);<NEW_LINE>} | .denominator >= Integer.MIN_VALUE : ASSERT_AVOIDING_OVERFLOW_MESSAGE; |
1,287,885 | private void initRootModules(LookupEnvironment environment, FileSystem fileSystem) {<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>for (String m : this.rootModules) {<NEW_LINE>ModuleBinding mod = environment.getModule(m.toCharArray());<NEW_LINE>if (mod == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException(this.bind("configure.invalidModuleName", m));<NEW_LINE>}<NEW_LINE>PackageBinding[] exports = mod.getExports();<NEW_LINE>for (PackageBinding packageBinding : exports) {<NEW_LINE>String qName = CharOperation.toString(packageBinding.compoundName);<NEW_LINE>String existing = map.get(qName);<NEW_LINE>if (existing != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException(this.bind("configure.packageConflict", new String[] { qName, existing, m }));<NEW_LINE>// report an error and bail out<NEW_LINE>}<NEW_LINE>map.put(qName, m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.limitedModules != null) {<NEW_LINE>for (String m : this.limitedModules) {<NEW_LINE>ModuleBinding mod = environment.<MASK><NEW_LINE>if (mod == null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>throw new IllegalArgumentException(this.bind("configure.invalidModuleName", m));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getModule(m.toCharArray()); |
451,483 | public IRubyObject to_str(ThreadContext context) {<NEW_LINE>if (message == null)<NEW_LINE>return context.nil;<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>RubyString description = null;<NEW_LINE>boolean singleton = false;<NEW_LINE>if (object == context.nil) {<NEW_LINE>// "nil"<NEW_LINE>description = RubyNil.inspect(runtime);<NEW_LINE>} else if (object == context.tru) {<NEW_LINE>// "true"<NEW_LINE>description = RubyString.newStringShared(runtime, RubyBoolean.TRUE_BYTES);<NEW_LINE>} else if (object == context.fals) {<NEW_LINE>// "false"<NEW_LINE>description = RubyString.newStringShared(runtime, RubyBoolean.FALSE_BYTES);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>description = RubyObject.inspect(context, object).asString();<NEW_LINE>} catch (JumpException e) {<NEW_LINE>context.setErrorInfo(context.nil);<NEW_LINE>}<NEW_LINE>if (description == null || description.size() > 65) {<NEW_LINE>description = object<MASK><NEW_LINE>}<NEW_LINE>singleton = description.size() > 0 && description.getByteList().get(0) == '#';<NEW_LINE>}<NEW_LINE>RubyString separator;<NEW_LINE>RubyString className;<NEW_LINE>if (!singleton) {<NEW_LINE>separator = RubyString.newString(runtime, (byte) ':');<NEW_LINE>className = RubyString.newString(runtime, object.getMetaClass().getRealClass().getName());<NEW_LINE>} else {<NEW_LINE>className = separator = RubyString.newEmptyString(runtime);<NEW_LINE>}<NEW_LINE>// RubyString name = this.name.asString(); // Symbol -> String<NEW_LINE>RubyArray arr = RubyArray.newArray(runtime, this.name, description, separator, className);<NEW_LINE>// name.size()<NEW_LINE>ByteList msgBytes = new ByteList(message.length() + description.size() + 16, USASCIIEncoding.INSTANCE);<NEW_LINE>Sprintf.sprintf(msgBytes, message, arr);<NEW_LINE>return runtime.newString(msgBytes);<NEW_LINE>} | .anyToString().asString(); |
1,052,220 | public static ExecutionStatus tryCatchException(Exception e) {<NEW_LINE>ExecutionStatus responseResult = new ExecutionStatus();<NEW_LINE>if (e instanceof QueryProcessException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((QueryProcessException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageGroupNotSetException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((StorageGroupNotSetException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageEngineException) {<NEW_LINE>responseResult.<MASK><NEW_LINE>responseResult.setCode(((StorageEngineException) e).getErrorCode());<NEW_LINE>} else if (e instanceof AuthException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(Status.BAD_REQUEST.getStatusCode());<NEW_LINE>} else if (e instanceof IllegalPathException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IllegalPathException) e).getErrorCode());<NEW_LINE>} else if (e instanceof MetadataException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((MetadataException) e).getErrorCode());<NEW_LINE>} else if (e instanceof IoTDBException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IoTDBException) e).getErrorCode());<NEW_LINE>} else if (!(e instanceof IOException) && !(e instanceof NullPointerException)) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());<NEW_LINE>} else {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>}<NEW_LINE>LOGGER.warn(e.getMessage(), e);<NEW_LINE>return responseResult;<NEW_LINE>} | setMessage(e.getMessage()); |
1,405,951 | public void run(WorkingCopy workingCopy) throws IOException {<NEW_LINE>workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);<NEW_LINE>TypeElement typeElement = workingCopy.getElements().getTypeElement(className);<NEW_LINE>// NO18N<NEW_LINE>String methodName = "get" + Utils.makeJavaIdentifierPart(Utils.jndiNameToCamelCase<MASK><NEW_LINE>MethodModel methodModel = MethodModel.create(methodName, javax.sql.DataSource.class.getName(), body, Collections.<MethodModel.Variable>emptyList(), Collections.singletonList(javax.naming.NamingException.class.getName()), Collections.singleton(Modifier.PRIVATE));<NEW_LINE>MethodTree methodTree = MethodModelSupport.createMethodTree(workingCopy, methodModel);<NEW_LINE>methodTree = GeneratorUtilities.get(workingCopy).importFQNs(methodTree);<NEW_LINE>ClassTree classTree = workingCopy.getTrees().getTree(typeElement);<NEW_LINE>ClassTree modifiedClassTree = workingCopy.getTreeMaker().addClassMember(classTree, methodTree);<NEW_LINE>workingCopy.rewrite(classTree, modifiedClassTree);<NEW_LINE>} | (datasourceReferenceName, false, null)); |
374,062 | public static DevInterceptorInfo from(InterceptorInfo interceptor, CompletedApplicationClassPredicateBuildItem predicate) {<NEW_LINE>boolean isApplicationBean = predicate.<MASK><NEW_LINE>Set<Name> bindings = new HashSet<>();<NEW_LINE>for (AnnotationInstance binding : interceptor.getBindings()) {<NEW_LINE>bindings.add(Name.from(binding));<NEW_LINE>}<NEW_LINE>Map<InterceptionType, MethodInfo> intercepts = new HashMap<>();<NEW_LINE>if (interceptor.intercepts(InterceptionType.AROUND_INVOKE)) {<NEW_LINE>intercepts.put(InterceptionType.AROUND_INVOKE, interceptor.getAroundInvoke());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.AROUND_CONSTRUCT)) {<NEW_LINE>intercepts.put(InterceptionType.AROUND_CONSTRUCT, interceptor.getAroundConstruct());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.POST_CONSTRUCT)) {<NEW_LINE>intercepts.put(InterceptionType.POST_CONSTRUCT, interceptor.getPostConstruct());<NEW_LINE>}<NEW_LINE>if (interceptor.intercepts(InterceptionType.PRE_DESTROY)) {<NEW_LINE>intercepts.put(InterceptionType.PRE_DESTROY, interceptor.getPreDestroy());<NEW_LINE>}<NEW_LINE>return new DevInterceptorInfo(interceptor.getIdentifier(), Name.from(interceptor.getBeanClass()), bindings, interceptor.getPriority(), intercepts, isApplicationBean);<NEW_LINE>} | test(interceptor.getBeanClass()); |
701,812 | public void execute() {<NEW_LINE>ensureArgCount(2);<NEW_LINE>final String fullyQualifiedSegmentName = getArg(0);<NEW_LINE>final String segmentStoreHost = getArg(1);<NEW_LINE>@Cleanup<NEW_LINE>CuratorFramework zkClient = createZKClient();<NEW_LINE>@Cleanup<NEW_LINE>AdminSegmentHelper adminSegmentHelper = instantiateAdminSegmentHelper(zkClient);<NEW_LINE>CompletableFuture<WireCommands.StorageChunksListed> reply = adminSegmentHelper.listStorageChunks(fullyQualifiedSegmentName, new PravegaNodeUri(segmentStoreHost, getServiceConfig().getAdminGatewayPort()), super.authHelper.retrieveMasterToken());<NEW_LINE>List<WireCommands.ChunkInfo> chunks = reply.join().getChunks();<NEW_LINE>output("List of chunks for %s: ", fullyQualifiedSegmentName);<NEW_LINE>chunks.forEach(chunk -> {<NEW_LINE>output("- Chunk name = %s", chunk.getChunkName());<NEW_LINE>CHUNK_INFO_FIELD_MAP.forEach((name, f) -> output(" %s = %s", name, <MASK><NEW_LINE>output("");<NEW_LINE>});<NEW_LINE>} | f.apply(chunk))); |
1,740,050 | void postProcessAnnotations() {<NEW_LINE>Class<? extends Servlet<MASK><NEW_LINE>if (clazz == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Process RunAs<NEW_LINE>if (wcd.getRunAsIdentity() == null) {<NEW_LINE>String roleName = runAsRoleName;<NEW_LINE>if (roleName == null && clazz.isAnnotationPresent(RunAs.class)) {<NEW_LINE>RunAs runAs = clazz.getAnnotation(RunAs.class);<NEW_LINE>roleName = runAs.value();<NEW_LINE>}<NEW_LINE>if (roleName != null) {<NEW_LINE>super.setRunAsRole(roleName);<NEW_LINE>wbd.addRole(new Role(roleName));<NEW_LINE>RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor();<NEW_LINE>runAsDesc.setRoleName(roleName);<NEW_LINE>wcd.setRunAsIdentity(runAsDesc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Process ServletSecurity<NEW_LINE>ServletSecurityElement ssElement = servletSecurityElement;<NEW_LINE>if (servletSecurityElement == null && clazz.isAnnotationPresent(ServletSecurity.class)) {<NEW_LINE>ServletSecurity servletSecurity = clazz.getAnnotation(ServletSecurity.class);<NEW_LINE>ssElement = new ServletSecurityElement(servletSecurity);<NEW_LINE>}<NEW_LINE>if (ssElement != null) {<NEW_LINE>webModule.processServletSecurityElement(ssElement, wbd, wcd);<NEW_LINE>}<NEW_LINE>} | > clazz = wrapper.getServletClass(); |
1,799,731 | public AssetModelHierarchy unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssetModelHierarchy assetModelHierarchy = new AssetModelHierarchy();<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("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>assetModelHierarchy.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>assetModelHierarchy.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("childAssetModelId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>assetModelHierarchy.setChildAssetModelId(context.getUnmarshaller(String.<MASK><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 assetModelHierarchy;<NEW_LINE>} | class).unmarshall(context)); |
1,344 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE><MASK><NEW_LINE>// noinspection ConstantConditions<NEW_LINE>mRecyclerView = getView().findViewById(R.id.recycler_view);<NEW_LINE>mLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);<NEW_LINE>// drag & drop manager<NEW_LINE>mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();<NEW_LINE>mRecyclerViewDragDropManager.setDraggingItemShadowDrawable((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z3));<NEW_LINE>// Start dragging after long press<NEW_LINE>mRecyclerViewDragDropManager.setInitiateOnLongPress(true);<NEW_LINE>mRecyclerViewDragDropManager.setInitiateOnMove(false);<NEW_LINE>mRecyclerViewDragDropManager.setLongPressTimeout(750);<NEW_LINE>// adapter<NEW_LINE>final DraggableStaggeredGridExampleAdapter myItemAdapter = new DraggableStaggeredGridExampleAdapter(getDataProvider());<NEW_LINE>mAdapter = myItemAdapter;<NEW_LINE>// wrap for dragging<NEW_LINE>mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);<NEW_LINE>final GeneralItemAnimator animator = new DraggableItemAnimator();<NEW_LINE>mRecyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>// requires *wrapped* adapter<NEW_LINE>mRecyclerView.setAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>mRecyclerView.setHasFixedSize(false);<NEW_LINE>// additional decorations<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (supportsViewElevation()) {<NEW_LINE>// Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.<NEW_LINE>} else {<NEW_LINE>mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z1)));<NEW_LINE>}<NEW_LINE>mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);<NEW_LINE>// for debugging<NEW_LINE>// animator.setDebug(true);<NEW_LINE>// animator.setMoveDuration(2000);<NEW_LINE>} | super.onViewCreated(view, savedInstanceState); |
962,049 | public static void main(String[] args) {<NEW_LINE>String master = "https://localhost:8443/";<NEW_LINE>String podName = null;<NEW_LINE>if (args.length == 2) {<NEW_LINE>master = args[0];<NEW_LINE>podName = args[1];<NEW_LINE>}<NEW_LINE>if (args.length == 1) {<NEW_LINE>podName = args[0];<NEW_LINE>}<NEW_LINE>Config config = new ConfigBuilder().withMasterUrl(master).build();<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor();<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(config).build();<NEW_LINE>ExecWatch watch = client.pods().withName(podName).redirectingInput().redirectingOutput().redirectingError().redirectingErrorChannel().exec()) {<NEW_LINE>InputStreamPumper.pump(watch.getOutput(), (b, o, l) -> System.out.print(new String(b, <MASK><NEW_LINE>watch.getInput().write("ls -al\n".getBytes());<NEW_LINE>Thread.sleep(5 * 1000L);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw KubernetesClientException.launderThrowable(e);<NEW_LINE>} finally {<NEW_LINE>executorService.shutdownNow();<NEW_LINE>}<NEW_LINE>} | o, l)), executorService); |
23,023 | private void loadNode1060() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.NamespacesType_NamespaceIdentifier_Placeholder_NamespacePublicationDate, new QualifiedName(0, "NamespacePublicationDate"), new LocalizedText("en", "NamespacePublicationDate"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.DateTime, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.NamespacesType_NamespaceIdentifier_Placeholder_NamespacePublicationDate, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespacesType_NamespaceIdentifier_Placeholder_NamespacePublicationDate, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NamespacesType_NamespaceIdentifier_Placeholder_NamespacePublicationDate, Identifiers.HasProperty, Identifiers.NamespacesType_NamespaceIdentifier_Placeholder.expanded(), false));<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
1,202,670 | public void buildFieldSpecifications() {<NEW_LINE>Map<String, Integer> baseFieldToIndexMap = new HashMap<>();<NEW_LINE>this.typeState = stateEngine.getTypeState(type);<NEW_LINE>matchFieldSpecs <MASK><NEW_LINE>for (int i = 0; i < matchFields.length; i++) {<NEW_LINE>matchFieldSpecs[i] = getHollowHashIndexField(typeState, matchFields[i], baseFieldToIndexMap, true);<NEW_LINE>}<NEW_LINE>numMatchTraverserFields = baseFieldToIndexMap.size();<NEW_LINE>selectFieldSpec = getHollowHashIndexField(typeState, selectField, baseFieldToIndexMap, false);<NEW_LINE>String[] baseFields = new String[baseFieldToIndexMap.size()];<NEW_LINE>for (Map.Entry<String, Integer> entry : baseFieldToIndexMap.entrySet()) {<NEW_LINE>baseFields[entry.getValue()] = entry.getKey();<NEW_LINE>}<NEW_LINE>traverser = new HollowIndexerValueTraverser(stateEngine, type, baseFields);<NEW_LINE>} | = new HollowHashIndexField[matchFields.length]; |
1,557,943 | private void validatePath(PathFragment rootRelativePath, ArtifactRoot root) {<NEW_LINE>Preconditions.checkArgument<MASK><NEW_LINE>Preconditions.checkArgument(rootRelativePath.isAbsolute() == root.getRoot().isAbsolute(), rootRelativePath);<NEW_LINE>Preconditions.checkArgument(!rootRelativePath.containsUplevelReferences(), rootRelativePath);<NEW_LINE>Preconditions.checkArgument(root.getRoot().asPath().startsWith(execRootParent), "%s must start with %s, root = %s, root fs = %s, execRootParent fs = %s", root.getRoot(), execRootParent, root, root.getRoot().asPath().getFileSystem(), execRootParent.getFileSystem());<NEW_LINE>Preconditions.checkArgument(!root.getRoot().asPath().equals(execRootParent), "%s %s %s", root.getRoot(), execRootParent, root);<NEW_LINE>// TODO(bazel-team): this should only accept roots from derivedRoots.<NEW_LINE>// Preconditions.checkArgument(derivedRoots.contains(root), "%s not in %s", root, derivedRoots);<NEW_LINE>} | (!root.isSourceRoot()); |
1,805,385 | protected BrokeredIdentityContext exchangeExternalUserInfoValidationOnly(EventBuilder event, MultivaluedMap<String, String> params) {<NEW_LINE>String subjectToken = params.getFirst(OAuth2Constants.SUBJECT_TOKEN);<NEW_LINE>if (subjectToken == null) {<NEW_LINE>event.detail(Details.REASON, OAuth2Constants.SUBJECT_TOKEN + " param unset");<NEW_LINE>event.error(Errors.INVALID_TOKEN);<NEW_LINE>throw new ErrorResponseException(OAuthErrorException.INVALID_TOKEN, "token not set", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>String subjectTokenType = params.getFirst(OAuth2Constants.SUBJECT_TOKEN_TYPE);<NEW_LINE>if (subjectTokenType == null) {<NEW_LINE>subjectTokenType = OAuth2Constants.ACCESS_TOKEN_TYPE;<NEW_LINE>}<NEW_LINE>if (!OAuth2Constants.ACCESS_TOKEN_TYPE.equals(subjectTokenType)) {<NEW_LINE>event.detail(Details.<MASK><NEW_LINE>event.error(Errors.INVALID_TOKEN_TYPE);<NEW_LINE>throw new ErrorResponseException(OAuthErrorException.INVALID_TOKEN, "invalid token type", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>return validateExternalTokenThroughUserInfo(event, subjectToken, subjectTokenType);<NEW_LINE>} | REASON, OAuth2Constants.SUBJECT_TOKEN_TYPE + " invalid"); |
803,391 | public void execute(SensorContext context) {<NEW_LINE>Set<String> reports = new HashSet<>(Arrays.asList(context.config().<MASK><NEW_LINE>reports.addAll(Arrays.asList(context.config().getStringArray(JavaScriptPlugin.LCOV_REPORT_PATHS_ALIAS)));<NEW_LINE>logIfUsedProperty(context, JavaScriptPlugin.LCOV_REPORT_PATHS);<NEW_LINE>logIfUsedProperty(context, JavaScriptPlugin.LCOV_REPORT_PATHS_ALIAS);<NEW_LINE>if (context.config().hasKey(JavaScriptPlugin.LCOV_REPORT_PATHS) && context.config().hasKey(JavaScriptPlugin.LCOV_REPORT_PATHS_ALIAS)) {<NEW_LINE>LOG.info(String.format("Merging coverage reports from %s and %s.", JavaScriptPlugin.LCOV_REPORT_PATHS, JavaScriptPlugin.LCOV_REPORT_PATHS_ALIAS));<NEW_LINE>}<NEW_LINE>List<File> lcovFiles = getLcovFiles(context.fileSystem().baseDir(), reports);<NEW_LINE>if (lcovFiles.isEmpty()) {<NEW_LINE>LOG.warn("No coverage information will be saved because all LCOV files cannot be found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>saveCoverageFromLcovFiles(context, lcovFiles);<NEW_LINE>} | getStringArray(JavaScriptPlugin.LCOV_REPORT_PATHS))); |
1,115,829 | public JFreeChart createChart(ChartContext chartContext) throws JRException {<NEW_LINE>this.chartContext = chartContext;<NEW_LINE>this.fontUtil = FontUtil.<MASK><NEW_LINE>JFreeChart jfreeChart = null;<NEW_LINE>switch(getChart().getChartType()) {<NEW_LINE>case JRChart.CHART_TYPE_AREA:<NEW_LINE>jfreeChart = createAreaChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_BAR:<NEW_LINE>jfreeChart = createBarChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_BAR3D:<NEW_LINE>jfreeChart = createBar3DChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_BUBBLE:<NEW_LINE>jfreeChart = createBubbleChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_CANDLESTICK:<NEW_LINE>jfreeChart = createCandlestickChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_HIGHLOW:<NEW_LINE>jfreeChart = createHighLowChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_LINE:<NEW_LINE>jfreeChart = createLineChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_METER:<NEW_LINE>if (MeterShapeEnum.DIAL == ((JRMeterPlot) getPlot()).getShapeValue()) {<NEW_LINE>jfreeChart = createDialChart();<NEW_LINE>} else {<NEW_LINE>jfreeChart = createMeterChart();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_MULTI_AXIS:<NEW_LINE>// multi-axis charts are dealt with in JRFillChart<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_PIE:<NEW_LINE>jfreeChart = createPieChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_PIE3D:<NEW_LINE>jfreeChart = createPie3DChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_SCATTER:<NEW_LINE>jfreeChart = createScatterChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_STACKEDBAR:<NEW_LINE>jfreeChart = createStackedBarChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_STACKEDBAR3D:<NEW_LINE>jfreeChart = createStackedBar3DChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_THERMOMETER:<NEW_LINE>jfreeChart = createThermometerChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_TIMESERIES:<NEW_LINE>jfreeChart = createTimeSeriesChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_XYAREA:<NEW_LINE>jfreeChart = createXyAreaChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_XYBAR:<NEW_LINE>jfreeChart = createXYBarChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_XYLINE:<NEW_LINE>jfreeChart = createXyLineChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_STACKEDAREA:<NEW_LINE>jfreeChart = createStackedAreaChart();<NEW_LINE>break;<NEW_LINE>case JRChart.CHART_TYPE_GANTT:<NEW_LINE>jfreeChart = createGanttChart();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_UNSUPPORTED_CHART_TYPE, new Object[] { getChart().getChartType() });<NEW_LINE>}<NEW_LINE>return jfreeChart;<NEW_LINE>} | getInstance(chartContext.getJasperReportsContext()); |
649,592 | public ObjectTypeKey unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ObjectTypeKey objectTypeKey = new ObjectTypeKey();<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("StandardIdentifiers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>objectTypeKey.setStandardIdentifiers(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FieldNames", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>objectTypeKey.setFieldNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><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 objectTypeKey;<NEW_LINE>} | )).unmarshall(context)); |
1,215,073 | public void draw(ZoneRenderer renderer, Graphics2D g, Rectangle bounds) {<NEW_LINE>createShape(renderer.getScale());<NEW_LINE>int offU = getOffU(renderer);<NEW_LINE>int offV = getOffV(renderer);<NEW_LINE>int count = 0;<NEW_LINE>Object oldAntiAlias = SwingUtil.useAntiAliasing(g);<NEW_LINE>g.setColor(new Color(getZone().getGridColor()));<NEW_LINE>g.setStroke(new BasicStroke(AppState.getGridSize()));<NEW_LINE>for (double v = offV % (scaledMinorRadius * 2) - (scaledMinorRadius * 2); v < getRendererSizeV(renderer); v += scaledMinorRadius) {<NEW_LINE>double offsetU = (int) ((count & 1) == 0 ? 0 : -(scaledEdgeProjection + scaledEdgeLength));<NEW_LINE>count++;<NEW_LINE>double start = offU % (2 * scaledEdgeLength + 2 * scaledEdgeProjection) - (2 * scaledEdgeLength + 2 * scaledEdgeProjection);<NEW_LINE>double end = getRendererSizeU(renderer) + 2 * scaledEdgeLength + 2 * scaledEdgeProjection;<NEW_LINE>double incr = 2 * scaledEdgeLength + 2 * scaledEdgeProjection;<NEW_LINE>for (double u = start; u < end; u += incr) {<NEW_LINE>setGridDrawTranslation(<MASK><NEW_LINE>g.draw(scaledHex);<NEW_LINE>setGridDrawTranslation(g, -(u + offsetU), -v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAntiAlias);<NEW_LINE>} | g, u + offsetU, v); |
214,497 | private static void tryAssertionSortedMinMaxBy(RegressionEnvironment env, boolean soda, AtomicInteger milestone) {<NEW_LINE>String[] fields = "maxbyeveru,minbyeveru,sortedb".split(",");<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplDeclare = "@public create table varagg (" + "maxbyeveru maxbyever(intPrimitive) @type('SupportBean'), " + "minbyeveru minbyever(intPrimitive) @type('SupportBean'), " + "sortedb sorted(intPrimitive) @type('SupportBean'))";<NEW_LINE>env.compileDeploy(soda, eplDeclare, path);<NEW_LINE>String eplIterate = "@name('iterate') select varagg from SupportBean_S0#lastevent";<NEW_LINE>env.compileDeploy(soda, eplIterate, path);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>String eplBoundInto = "into table varagg select sorted() as sortedb from SupportBean#length(2)";<NEW_LINE>env.compileDeploy(soda, eplBoundInto, path);<NEW_LINE>String eplUnboundInto = "into table varagg select maxbyever() as maxbyeveru, minbyever() as minbyeveru from SupportBean";<NEW_LINE>env.compileDeploy(soda, eplUnboundInto, path);<NEW_LINE>SupportBean b1 = makeSendBean(env, "E1", 20);<NEW_LINE>SupportBean b2 = makeSendBean(env, "E2", 15);<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>SupportBean b3 = makeSendBean(env, "E3", 10);<NEW_LINE>env.assertIterator("iterate", iterator -> assertResults(iterator, fields, new Object[] { b1, b3, new Object[] { b3, b2 } }));<NEW_LINE>// invalid: bound aggregation into unbound max<NEW_LINE>env.<MASK><NEW_LINE>// invalid: unbound aggregation into bound max<NEW_LINE>env.tryInvalidCompile(path, "into table varagg select maxbyever() as sortedb from SupportBean#length(2)", "Incompatible aggregation function for table 'varagg' column 'sortedb', expecting 'sorted(intPrimitive)' and received 'maxbyever()': The required aggregation function name is 'sorted' and provided is 'maxbyever' [");<NEW_LINE>// valid: bound with unbound variable<NEW_LINE>String eplBoundIntoUnbound = "into table varagg select " + "maxbyever() as maxbyeveru, minbyever() as minbyeveru " + "from SupportBean#length(2)";<NEW_LINE>env.compileDeploy(soda, eplBoundIntoUnbound, path);<NEW_LINE>env.undeployAll();<NEW_LINE>} | tryInvalidCompile(path, "into table varagg select maxby(intPrimitive) as maxbyeveru from SupportBean#length(2)", "Failed to validate select-clause expression 'maxby(intPrimitive)': When specifying into-table a sort expression cannot be provided ["); |
1,740,145 | public int[] exclusiveTime(int n, List<String> logs) {<NEW_LINE>Stack<Integer> stack = new Stack<Integer>();<NEW_LINE>int[] result = new int[n];<NEW_LINE>String[] current = logs.get(0).split(":");<NEW_LINE>stack.push(Integer.parseInt(current[0]));<NEW_LINE>int i = 1;<NEW_LINE>int previous = Integer.parseInt(current[2]);<NEW_LINE>while (i < logs.size()) {<NEW_LINE>current = logs.get(i).split(":");<NEW_LINE>if (current[1].equals("start")) {<NEW_LINE>if (!stack.isEmpty()) {<NEW_LINE>result[stack.peek()] += Integer.parseInt(current[2]) - previous;<NEW_LINE>}<NEW_LINE>stack.push(Integer.<MASK><NEW_LINE>previous = Integer.parseInt(current[2]);<NEW_LINE>} else {<NEW_LINE>result[stack.peek()] += Integer.parseInt(current[2]) - previous + 1;<NEW_LINE>stack.pop();<NEW_LINE>previous = Integer.parseInt(current[2]) + 1;<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | parseInt(current[0])); |
458,164 | public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select irstream * from SupportMarketDataBean#length(3)#weighted_avg(price, volume)";<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env.sendEventBean(makeBean(10, 1000));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10d } }, new Object[][] { { "average", Double.NaN } });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeBean(11, 2000));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.666666666666666 } }, new Object[][] { { "average", 10.0 } });<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(makeBean(10.5, 1500));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.61111111111111 } }, new Object[][] <MASK><NEW_LINE>env.milestone(3);<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "average" }, new Object[][] { { 10.61111111111111 } });<NEW_LINE>env.sendEventBean(makeBean(9.5, 600));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.597560975609756 } }, new Object[][] { { "average", 10.61111111111111 } });<NEW_LINE>env.milestone(4);<NEW_LINE>env.undeployAll();<NEW_LINE>} | { { "average", 10.666666666666666 } }); |
91,372 | public void writeValue(ObjectValue objectValue, ValueFields valueFields) {<NEW_LINE>EntityManagerSession entityManagerSession = Context.getCommandContext().getSession(EntityManagerSession.class);<NEW_LINE>if (entityManagerSession == null) {<NEW_LINE>throw new ProcessEngineException(<MASK><NEW_LINE>} else {<NEW_LINE>// Before we set the value we must flush all pending changes from the entitymanager<NEW_LINE>// If we don't do this, in some cases the primary key will not yet be set in the object<NEW_LINE>// which will cause exceptions down the road.<NEW_LINE>entityManagerSession.flush();<NEW_LINE>}<NEW_LINE>Object value = objectValue.getValue();<NEW_LINE>if (value != null) {<NEW_LINE>String className = mappings.getJPAClassString(value);<NEW_LINE>String idString = mappings.getJPAIdString(value);<NEW_LINE>valueFields.setTextValue(className);<NEW_LINE>valueFields.setTextValue2(idString);<NEW_LINE>} else {<NEW_LINE>valueFields.setTextValue(null);<NEW_LINE>valueFields.setTextValue2(null);<NEW_LINE>}<NEW_LINE>} | "Cannot set JPA variable: " + EntityManagerSession.class + " not configured"); |
1,724,381 | // ActionListener<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent ev) {<NEW_LINE>Node[] nodes = tp.getExplorerManager().getSelectedNodes();<NEW_LINE>assert nodes != null && nodes.length > 0 : "Selected templates cannot be null or empty.";<NEW_LINE>Set<Node> nodes2open = getNodes2Open(nodes);<NEW_LINE>assert !nodes2open.isEmpty() : "Selected templates to open cannot by empty for nodes " + Arrays.asList(nodes);<NEW_LINE>Iterator<Node> it = nodes2open.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Node n = (Node) it.next();<NEW_LINE>EditCookie ec = n.getLookup().lookup(EditCookie.class);<NEW_LINE>if (ec != null) {<NEW_LINE>ec.edit();<NEW_LINE>} else {<NEW_LINE>OpenCookie oc = n.getLookup(<MASK><NEW_LINE>if (oc != null) {<NEW_LINE>oc.open();<NEW_LINE>} else {<NEW_LINE>assert false : "Node " + n + " has to have a EditCookie or OpenCookie.";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).lookup(OpenCookie.class); |
1,448,512 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);<NEW_LINE>getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>detectScreenRotate();<NEW_LINE>mSelectedModelIndex = 0;<NEW_LINE>mConfig.numThread = 4;<NEW_LINE>mConfig.forwardType = MNNForwardType.FORWARD_CPU.type;<NEW_LINE>prepareModels();<NEW_LINE>mForwardTypeSpinner = (Spinner) findViewById(R.id.forwardTypeSpinner);<NEW_LINE>mThreadNumSpinner = (Spinner) findViewById(R.id.threadsSpinner);<NEW_LINE>mThreadNumSpinner.setSelection(2);<NEW_LINE>mModelSpinner = (Spinner) findViewById(R.id.modelTypeSpinner);<NEW_LINE>mMoreDemoSpinner = (Spinner) findViewById(R.id.MoreDemo);<NEW_LINE>mFirstResult = findViewById(R.id.firstResult);<NEW_LINE>mSecondResult = findViewById(R.id.secondResult);<NEW_LINE>mThirdResult = findViewById(R.id.thirdResult);<NEW_LINE>mTimeTextView = findViewById(R.id.timeTextView);<NEW_LINE>mForwardTypeSpinner.setOnItemSelectedListener(VideoActivity.this);<NEW_LINE>mThreadNumSpinner.setOnItemSelectedListener(VideoActivity.this);<NEW_LINE>mModelSpinner.setOnItemSelectedListener(VideoActivity.this);<NEW_LINE>mMoreDemoSpinner.setOnItemSelectedListener(VideoActivity.this);<NEW_LINE>mLockUIRender.set(true);<NEW_LINE>clearUIForPrepareNet();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {<NEW_LINE>requestPermissions(new String[] { Manifest.permission.CAMERA }, 10);<NEW_LINE>} else {<NEW_LINE>handlePreViewCallBack();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handlePreViewCallBack();<NEW_LINE>}<NEW_LINE>mThread = new HandlerThread("MNNNet");<NEW_LINE>mThread.start();<NEW_LINE>mHandle = new <MASK><NEW_LINE>mHandle.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>prepareNet();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | Handler(mThread.getLooper()); |
1,669,333 | public ParticleEffect openEffect(File file, boolean replaceCurrentWorkspace) {<NEW_LINE>try {<NEW_LINE>ParticleEffect loadedEffect = load(file.getAbsolutePath(), ParticleEffect.class, null, new ParticleEffectLoader.ParticleEffectLoadParameter(particleSystem.getBatches()));<NEW_LINE>loadedEffect = loadedEffect.copy();<NEW_LINE>loadedEffect.init();<NEW_LINE>if (replaceCurrentWorkspace) {<NEW_LINE>effect = loadedEffect;<NEW_LINE>controllersData.clear();<NEW_LINE>particleSystem.removeAll();<NEW_LINE>particleSystem.add(effect);<NEW_LINE>for (ParticleController controller : effect.getControllers()) controllersData.<MASK><NEW_LINE>rebuildActiveControllers();<NEW_LINE>}<NEW_LINE>reloadRows();<NEW_LINE>return loadedEffect;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>System.out.println("Error loading effect: " + file.getAbsolutePath());<NEW_LINE>ex.printStackTrace();<NEW_LINE>JOptionPane.showMessageDialog(this, "Error opening effect.");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | add(new ControllerData(controller)); |
1,401,993 | private static JSFunctionData createPromiseRejectFunctionImpl(JSContext context) {<NEW_LINE>class PromiseRejectRootNode extends JavaScriptRootNode implements AsyncHandlerRootNode {<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private JavaScriptNode reasonNode;<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private PropertyGetNode getPromiseNode;<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private PropertyGetNode getAlreadyResolvedNode = PropertyGetNode.createGetHidden(ALREADY_RESOLVED_KEY, context);<NEW_LINE><NEW_LINE>@Child<NEW_LINE>private RejectPromiseNode rejectPromiseNode;<NEW_LINE><NEW_LINE>private final ConditionProfile alreadyResolvedProfile = ConditionProfile.createBinaryProfile();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object execute(VirtualFrame frame) {<NEW_LINE>init();<NEW_LINE>JSDynamicObject functionObject = JSFrameUtil.getFunctionObject(frame);<NEW_LINE>JSDynamicObject promise = (JSDynamicObject) getPromiseNode.getValue(functionObject);<NEW_LINE>Object reason = reasonNode.execute(frame);<NEW_LINE>AlreadyResolved alreadyResolved = (AlreadyResolved) getAlreadyResolvedNode.getValue(functionObject);<NEW_LINE>if (alreadyResolvedProfile.profile(alreadyResolved.value)) {<NEW_LINE>context.notifyPromiseRejectionTracker(promise, JSPromise.REJECTION_TRACKER_OPERATION_REJECT_AFTER_RESOLVED, reason);<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE>alreadyResolved.value = true;<NEW_LINE>return rejectPromiseNode.execute(promise, reason);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void init() {<NEW_LINE>if (reasonNode == null || getPromiseNode == null || rejectPromiseNode == null) {<NEW_LINE>CompilerDirectives.transferToInterpreterAndInvalidate();<NEW_LINE>reasonNode = insert(AccessIndexedArgumentNode.create(0));<NEW_LINE>getPromiseNode = insert(PropertyGetNode.createGetHidden(PROMISE_KEY, context));<NEW_LINE>rejectPromiseNode = insert(RejectPromiseNode.create(context));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AsyncStackTraceInfo getAsyncStackTraceInfo(JSFunctionObject handlerFunction) {<NEW_LINE>assert JSFunction.isJSFunction(handlerFunction) && ((RootCallTarget) JSFunction.getFunctionData(handlerFunction).getCallTarget(<MASK><NEW_LINE>JSDynamicObject promise = (JSDynamicObject) JSObjectUtil.getHiddenProperty(handlerFunction, PROMISE_KEY);<NEW_LINE>return new AsyncStackTraceInfo(promise, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return JSFunctionData.createCallOnly(context, new PromiseRejectRootNode().getCallTarget(), 1, Strings.EMPTY_STRING);<NEW_LINE>} | )).getRootNode() == this; |
1,578,349 | public ListWorldsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListWorldsResult listWorldsResult = new ListWorldsResult();<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 listWorldsResult;<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("worldSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listWorldsResult.setWorldSummaries(new ListUnmarshaller<WorldSummary>(WorldSummaryJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listWorldsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listWorldsResult;<NEW_LINE>} | )).unmarshall(context)); |
1,447,729 | protected void layoutLayout() {<NEW_LINE>Rectangle size = getClientArea();<NEW_LINE>if (expanded) {<NEW_LINE>int y = size.height - SASH_HEIGHT - BORDER_HEIGHT - titleHeight - drawerHeight;<NEW_LINE>main.setBounds(0, 0, size.width, y);<NEW_LINE>sash.setBounds(0, y, size.width, SASH_HEIGHT);<NEW_LINE>sash.setVisible(true);<NEW_LINE>border.setBounds(0, y + SASH_HEIGHT, size.width, BORDER_HEIGHT);<NEW_LINE>drawer.setBounds(0, y + SASH_HEIGHT + BORDER_HEIGHT + titleHeight, size.width, drawerHeight);<NEW_LINE>drawer.setVisible(true);<NEW_LINE>} else {<NEW_LINE>int y = size.height - BORDER_HEIGHT - titleHeight;<NEW_LINE>main.setBounds(0, 0, size.width, y);<NEW_LINE>sash.setBounds(0, 0, 0, 0);<NEW_LINE>sash.setVisible(false);<NEW_LINE>border.setBounds(0, <MASK><NEW_LINE>drawer.setBounds(0, 0, 0, 0);<NEW_LINE>drawer.setVisible(false);<NEW_LINE>}<NEW_LINE>} | y, size.width, BORDER_HEIGHT); |
1,820,572 | public RuleMatch[] match(AnalyzedSentence sentence) {<NEW_LINE>List<RuleMatch> <MASK><NEW_LINE>AnalyzedTokenReadings[] tokens = sentence.getTokens();<NEW_LINE>int startTokenIdx = -1;<NEW_LINE>String tkns = "";<NEW_LINE>for (int i = 0; i < tokens.length; i++) {<NEW_LINE>String tokenStr = tokens[i].getToken();<NEW_LINE>if (isPunctuation(tokenStr)) {<NEW_LINE>tkns += tokenStr;<NEW_LINE>if (startTokenIdx == -1) {<NEW_LINE>startTokenIdx = i;<NEW_LINE>}<NEW_LINE>if (i < tokens.length - 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tkns.length() >= 2 && !isPunctsJoinOk(tkns)) {<NEW_LINE>String msg = "bad duplication or combination of punctuation signs";<NEW_LINE>RuleMatch ruleMatch = new RuleMatch(this, sentence, tokens[startTokenIdx].getStartPos(), tokens[startTokenIdx].getStartPos() + tkns.length(), msg, "Punctuation problem");<NEW_LINE>ruleMatch.setSuggestedReplacement(tkns.substring(0, 1));<NEW_LINE>ruleMatches.add(ruleMatch);<NEW_LINE>}<NEW_LINE>tkns = "";<NEW_LINE>startTokenIdx = -1;<NEW_LINE>}<NEW_LINE>return toRuleMatchArray(ruleMatches);<NEW_LINE>} | ruleMatches = new ArrayList<>(); |
1,473,294 | public static VibroMode eventsVibroMuc() {<NEW_LINE>String value = getNotifString(R.string.<MASK><NEW_LINE>if (Application.getInstance().getString(R.string.events_vibro_disable).equals(value)) {<NEW_LINE>return VibroMode.disabled;<NEW_LINE>} else if (Application.getInstance().getString(R.string.events_vibro_bydefault).equals(value)) {<NEW_LINE>return VibroMode.defaultvibro;<NEW_LINE>} else if (Application.getInstance().getString(R.string.events_vibro_short).equals(value)) {<NEW_LINE>return VibroMode.shortvibro;<NEW_LINE>} else if (Application.getInstance().getString(R.string.events_vibro_long).equals(value)) {<NEW_LINE>return VibroMode.longvibro;<NEW_LINE>} else if (Application.getInstance().getString(R.string.events_vibro_if_silent).equals(value)) {<NEW_LINE>return VibroMode.onlyifsilent;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} | events_vibro_muc_key, R.string.events_vibro_bydefault); |
1,734,419 | private boolean startProcess() {<NEW_LINE>log.fine(processInstance.toString());<NEW_LINE>boolean started = false;<NEW_LINE>// hengsin, bug [ 1633995 ]<NEW_LINE>boolean clientOnly = false;<NEW_LINE>if (!processInstance.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>try {<NEW_LINE>Class<?> processClass = Class.forName(processInstance.getClassName());<NEW_LINE>if (ClientProcess.class.isAssignableFrom(processClass))<NEW_LINE>clientOnly = true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isServerProcess && !clientOnly) {<NEW_LINE>try {<NEW_LINE>Server server = CConnection.get().getServer();<NEW_LINE>if (server != null) {<NEW_LINE>// See ServerBean<NEW_LINE>processInstance = server.process(Env.getRemoteCallCtx(Env.getCtx()), processInstance);<NEW_LINE>log.finest("server => " + processInstance);<NEW_LINE>started = true;<NEW_LINE>}<NEW_LINE>} catch (UndeclaredThrowableException ex) {<NEW_LINE>Throwable cause = ex.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>if (cause instanceof InvalidClassException)<NEW_LINE>log.log(Level.SEVERE, "Version Server <> Client: " + cause.toString() + " - " + processInstance, ex);<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "AppsServer error(1b): " + cause.toString() + " - " + processInstance, ex);<NEW_LINE>} else<NEW_LINE>log.log(Level.SEVERE, " AppsServer error(1) - " + processInstance, ex);<NEW_LINE>started = false;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Throwable cause = ex.getCause();<NEW_LINE>if (cause == null)<NEW_LINE>cause = ex;<NEW_LINE>log.log(Level.SEVERE, "AppsServer error - " + processInstance, cause);<NEW_LINE>started = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Run locally<NEW_LINE>if (!started && (!isServerProcess || clientOnly)) {<NEW_LINE>if (processInstance.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>return ProcessUtil.startScriptProcess(Env.<MASK><NEW_LINE>} else {<NEW_LINE>if (processInstance.isManagedTransaction())<NEW_LINE>return ProcessUtil.startJavaProcess(Env.getCtx(), processInstance, transaction);<NEW_LINE>else<NEW_LINE>return ProcessUtil.startJavaProcess(Env.getCtx(), processInstance, transaction, processInstance.isManagedTransaction());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !processInstance.isError();<NEW_LINE>} | getCtx(), processInstance, transaction); |
275,517 | protected static Sequence fit(Matrix X, Matrix Y, double learning_rate, int iterrations) {<NEW_LINE>int n = X.getCols();<NEW_LINE>int m = X.getRows();<NEW_LINE>double[][] W = new double[n][1];<NEW_LINE>double b = 0;<NEW_LINE>Matrix WMatrix = new Matrix(W);<NEW_LINE>for (int i = 0; i < iterrations; i += 1) {<NEW_LINE>Matrix YPred = predict(X, WMatrix, b);<NEW_LINE>// calculate gradients<NEW_LINE>Matrix a1 = Y.minus(YPred);<NEW_LINE>Matrix a2 = X.transpose().times(a1);<NEW_LINE>Matrix dw = ((a2.divide(-1 / 2.0)).plus(WMatrix.divide(1 / 2.0))).divide(m);<NEW_LINE>double db = -2 * a1.elementSum() / m;<NEW_LINE>// update weights<NEW_LINE>WMatrix = WMatrix.minus(dw.divide(1 / learning_rate));<NEW_LINE>b = b - db * learning_rate;<NEW_LINE>}<NEW_LINE>Sequence result = new Sequence(2);<NEW_LINE>result.add(WMatrix<MASK><NEW_LINE>result.add(b);<NEW_LINE>return result;<NEW_LINE>} | .toSequence(null, true)); |
1,525,536 | private RelNode createOrPath(List<RelNode> paths, LogicalTableScan logicalTableScan) {<NEW_LINE>// To discover the same gsi merge them by or their predicates together is more efficient than union<NEW_LINE>List<RelNode> unionInputs = new ArrayList<>();<NEW_LINE>Map<String, RexNode> m = new LinkedHashMap<>();<NEW_LINE>RexBuilder rexBuilder = logicalTableScan.getCluster().getRexBuilder();<NEW_LINE>for (RelNode path : paths) {<NEW_LINE>if (path instanceof LogicalIndexScan) {<NEW_LINE>String gsiName = CBOUtil.getTableMeta(path.getTable()).getTableName();<NEW_LINE>RexNode predicate = indexScanDigestToPredicate.<MASK><NEW_LINE>RexNode orPredicate = m.get(gsiName);<NEW_LINE>if (orPredicate == null) {<NEW_LINE>orPredicate = predicate;<NEW_LINE>} else {<NEW_LINE>orPredicate = rexBuilder.makeCall(SqlStdOperatorTable.OR, predicate, orPredicate);<NEW_LINE>}<NEW_LINE>m.put(gsiName, orPredicate);<NEW_LINE>} else {<NEW_LINE>unionInputs.add(path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, RexNode> entry : m.entrySet()) {<NEW_LINE>final RelOptSchema catalog = RelUtils.buildCatalogReader(schemaName, PlannerContext.getPlannerContext(logicalTableScan).getExecutionContext());<NEW_LINE>RelOptTable indexTable = catalog.getTableForMember(ImmutableList.of(schemaName, entry.getKey()));<NEW_LINE>RelNode newPath = buildIndexAccess(indexTable, logicalTableScan.getTable(), entry.getValue(), logicalTableScan);<NEW_LINE>unionInputs.add(newPath);<NEW_LINE>}<NEW_LINE>LogicalUnion logicalUnion = LogicalUnion.create(unionInputs, false);<NEW_LINE>return logicalUnion;<NEW_LINE>} | get(path.getDigest()); |
510,078 | public boolean onPreferenceChange(Preference preference, Object newValue) {<NEW_LINE>int timeout = Util.objectToInt(newValue);<NEW_LINE>if (timeout > 0) {<NEW_LINE>Context context = preference.getContext();<NEW_LINE>boolean fromServer = coreKey.equals("delete_server_after");<NEW_LINE>int delCount = DcHelper.getContext(context).estimateDeletionCount(fromServer, timeout);<NEW_LINE>View gl = View.inflate(getActivity(), R.layout.dialog_with_checkbox, null);<NEW_LINE>CheckBox confirmCheckbox = gl.findViewById(R.id.dialog_checkbox);<NEW_LINE>TextView msg = gl.findViewById(R.id.dialog_message);<NEW_LINE>// If we'd use both `setMessage()` and `setView()` on the same AlertDialog, on small screens the<NEW_LINE>// "OK" and "Cancel" buttons would not be show. So, put the message into our custom view:<NEW_LINE>msg.setText(String.format(context.getString(fromServer ? R.string.autodel_server_ask : R.string.autodel_device_ask), delCount, getSelectedSummary(preference, newValue)));<NEW_LINE>confirmCheckbox.setText(R.string.autodel_confirm);<NEW_LINE>new AlertDialog.Builder(context).setTitle(preference.getTitle()).setView(gl).setPositiveButton(android.R.string.ok, (dialog, whichButton) -> {<NEW_LINE>if (confirmCheckbox.isChecked()) {<NEW_LINE>dcContext.setConfigInt(coreKey, timeout);<NEW_LINE>initAutodelFromCore();<NEW_LINE>} else {<NEW_LINE>onPreferenceChange(preference, newValue);<NEW_LINE>}<NEW_LINE>}).setNegativeButton(android.R.string.cancel, // Enable the user to quickly cancel if they are intimidated by the warnings :)<NEW_LINE>(dialog, whichButton) -> initAutodelFromCore()).// Enable the user to quickly cancel if they are intimidated by the warnings :)<NEW_LINE>setCancelable(true).setOnCancelListener(dialog -> <MASK><NEW_LINE>} else {<NEW_LINE>updateListSummary(preference, newValue);<NEW_LINE>dcContext.setConfigInt(coreKey, timeout);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | initAutodelFromCore()).show(); |
1,826,858 | public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent creatureToExile = game.getPermanent(getTargetPointer().getFirst(game, source));<NEW_LINE>Permanent portcullis = game.<MASK><NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (portcullis != null && creatureToExile != null && controller != null) {<NEW_LINE>UUID exileZoneId = CardUtil.getExileZoneId(game, creatureToExile.getId(), creatureToExile.getZoneChangeCounter(game));<NEW_LINE>controller.moveCardsToExile(creatureToExile, source, game, true, exileZoneId, portcullis.getName());<NEW_LINE>FixedTarget fixedTarget = new FixedTarget(portcullis, game);<NEW_LINE>Effect returnEffect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false);<NEW_LINE>returnEffect.setTargetPointer(new FixedTarget(creatureToExile.getId(), game.getState().getZoneChangeCounter(creatureToExile.getId())));<NEW_LINE>DelayedTriggeredAbility delayedAbility = new PortcullisReturnToBattlefieldTriggeredAbility(fixedTarget, returnEffect);<NEW_LINE>game.addDelayedTriggeredAbility(delayedAbility, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getPermanent(source.getSourceId()); |
1,254,854 | public static DescribeExportImageInfoResponse unmarshall(DescribeExportImageInfoResponse describeExportImageInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeExportImageInfoResponse.setRequestId(_ctx.stringValue("DescribeExportImageInfoResponse.RequestId"));<NEW_LINE>describeExportImageInfoResponse.setPageNumber(_ctx.integerValue("DescribeExportImageInfoResponse.PageNumber"));<NEW_LINE>describeExportImageInfoResponse.setPageSize(_ctx.integerValue("DescribeExportImageInfoResponse.PageSize"));<NEW_LINE>describeExportImageInfoResponse.setTotalCount(_ctx.integerValue("DescribeExportImageInfoResponse.TotalCount"));<NEW_LINE>List<Image> images = new ArrayList<Image>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeExportImageInfoResponse.Images.Length"); i++) {<NEW_LINE>Image image = new Image();<NEW_LINE>image.setArchitecture(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].Architecture"));<NEW_LINE>image.setCreationTime(_ctx.stringValue<MASK><NEW_LINE>image.setExportedImageURL(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].ExportedImageURL"));<NEW_LINE>image.setImageExportStatus(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].ImageExportStatus"));<NEW_LINE>image.setImageId(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].ImageId"));<NEW_LINE>image.setImageName(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].ImageName"));<NEW_LINE>image.setImageOwnerAlias(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].ImageOwnerAlias"));<NEW_LINE>image.setPlatform(_ctx.stringValue("DescribeExportImageInfoResponse.Images[" + i + "].Platform"));<NEW_LINE>images.add(image);<NEW_LINE>}<NEW_LINE>describeExportImageInfoResponse.setImages(images);<NEW_LINE>return describeExportImageInfoResponse;<NEW_LINE>} | ("DescribeExportImageInfoResponse.Images[" + i + "].CreationTime")); |
611,839 | private ContentValues createContentValuesBase(OCFile fileOrFolder) {<NEW_LINE>final ContentValues cv = new ContentValues();<NEW_LINE>cv.put(ProviderTableMeta.FILE_MODIFIED, fileOrFolder.getModificationTimestamp());<NEW_LINE>cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, fileOrFolder.getModificationTimestampAtLastSyncForData());<NEW_LINE>cv.put(ProviderTableMeta.FILE_PARENT, fileOrFolder.getParentId());<NEW_LINE>cv.put(ProviderTableMeta.FILE_CREATION, fileOrFolder.getCreationTimestamp());<NEW_LINE>cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, fileOrFolder.getMimeType());<NEW_LINE>cv.put(ProviderTableMeta.FILE_NAME, fileOrFolder.getFileName());<NEW_LINE>cv.put(ProviderTableMeta.FILE_PATH, fileOrFolder.getRemotePath());<NEW_LINE>cv.put(ProviderTableMeta.FILE_PATH_DECRYPTED, fileOrFolder.getDecryptedRemotePath());<NEW_LINE>cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, user.getAccountName());<NEW_LINE>cv.put(ProviderTableMeta.FILE_IS_ENCRYPTED, fileOrFolder.isEncrypted());<NEW_LINE>cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, fileOrFolder.getLastSyncDateForProperties());<NEW_LINE>cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, fileOrFolder.getLastSyncDateForData());<NEW_LINE>cv.put(ProviderTableMeta.FILE_ETAG, fileOrFolder.getEtag());<NEW_LINE>cv.put(ProviderTableMeta.FILE_ETAG_ON_SERVER, fileOrFolder.getEtagOnServer());<NEW_LINE>cv.put(ProviderTableMeta.FILE_SHARED_VIA_LINK, fileOrFolder.isSharedViaLink() ? 1 : 0);<NEW_LINE>cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, fileOrFolder.isSharedWithSharee() ? 1 : 0);<NEW_LINE>cv.put(ProviderTableMeta.<MASK><NEW_LINE>cv.put(ProviderTableMeta.FILE_REMOTE_ID, fileOrFolder.getRemoteId());<NEW_LINE>cv.put(ProviderTableMeta.FILE_FAVORITE, fileOrFolder.isFavorite());<NEW_LINE>cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, fileOrFolder.getUnreadCommentsCount());<NEW_LINE>cv.put(ProviderTableMeta.FILE_OWNER_ID, fileOrFolder.getOwnerId());<NEW_LINE>cv.put(ProviderTableMeta.FILE_OWNER_DISPLAY_NAME, fileOrFolder.getOwnerDisplayName());<NEW_LINE>cv.put(ProviderTableMeta.FILE_NOTE, fileOrFolder.getNote());<NEW_LINE>cv.put(ProviderTableMeta.FILE_SHAREES, new Gson().toJson(fileOrFolder.getSharees()));<NEW_LINE>cv.put(ProviderTableMeta.FILE_RICH_WORKSPACE, fileOrFolder.getRichWorkspace());<NEW_LINE>return cv;<NEW_LINE>} | FILE_PERMISSIONS, fileOrFolder.getPermissions()); |
11,560 | public void updateTask() {<NEW_LINE>EntityLivingBase entitylivingbase = attacker.getAttackTarget();<NEW_LINE>if (entitylivingbase == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);<NEW_LINE>double distToTargetSq = attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.getEntityBoundingBox().minY, entitylivingbase.posZ);<NEW_LINE>double attachRange = attacker.width * 2.0F * attacker.width * 2.0F + entitylivingbase.width;<NEW_LINE>--ticksUntilNextPathingAttempt;<NEW_LINE>if ((longMemory || attacker.getEntitySenses().canSee(entitylivingbase)) && ticksUntilNextPathingAttempt <= 0 && (targetX == 0.0D && targetY == 0.0D && targetZ == 0.0D || entitylivingbase.getDistanceSq(targetX, targetY, targetZ) >= 1.0D || attacker.getRNG().nextFloat() < 0.05F)) {<NEW_LINE>targetX = entitylivingbase.posX;<NEW_LINE>targetY = entitylivingbase.getEntityBoundingBox().minY;<NEW_LINE>targetZ = entitylivingbase.posZ;<NEW_LINE>// ticksUntilNextPathingAttempt = failedPathFindingPenalty + 4 + attacker.getRNG().nextInt(7);<NEW_LINE>// if (attacker.getNavigator().getPath() != null) {<NEW_LINE>// PathPoint finalPathPoint = attacker.getNavigator().getPath().getFinalPathPoint();<NEW_LINE>// if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) {<NEW_LINE>// failedPathFindingPenalty = 0;<NEW_LINE>// } else {<NEW_LINE>// failedPathFindingPenalty += 10;<NEW_LINE>// }<NEW_LINE>// } else {<NEW_LINE>// failedPathFindingPenalty += 10;<NEW_LINE>// }<NEW_LINE>if (distToTargetSq > 1024.0D) {<NEW_LINE>ticksUntilNextPathingAttempt += 10;<NEW_LINE>} else if (distToTargetSq > 256.0D) {<NEW_LINE>ticksUntilNextPathingAttempt += 5;<NEW_LINE>}<NEW_LINE>if (!attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, speedTowardsTarget)) {<NEW_LINE>ticksUntilNextPathingAttempt += 15;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ticksToNextAttack = Math.<MASK><NEW_LINE>if (distToTargetSq <= attachRange && ticksToNextAttack <= 20) {<NEW_LINE>ticksToNextAttack = attackFrequency;<NEW_LINE>if (Prep.isValid(attacker.getHeldItem(EnumHand.MAIN_HAND))) {<NEW_LINE>attacker.swingArm(EnumHand.MAIN_HAND);<NEW_LINE>}<NEW_LINE>attacker.attackEntityAsMob(entitylivingbase);<NEW_LINE>}<NEW_LINE>} | max(ticksToNextAttack - 1, 0); |
1,525,066 | private void addPropertiesSetups(File base, List<Setup> newSetups, int displayStatus) {<NEW_LINE>if (currentType == Setup.DIFFTYPE_REMOTE)<NEW_LINE>return;<NEW_LINE>DiffProvider diffAlgorithm = (DiffProvider) Lookup.getDefault().lookup(DiffProvider.class);<NEW_LINE>PropertiesClient client = new PropertiesClient(base);<NEW_LINE>try {<NEW_LINE>Map<String, byte[]> baseProps = client.getBaseProperties(currentType == Setup.DIFFTYPE_ALL);<NEW_LINE>Map<String, byte[]> localProps = client.getProperties();<NEW_LINE>Set<String> allProps = new TreeSet<String>(localProps.keySet());<NEW_LINE>allProps.addAll(baseProps.keySet());<NEW_LINE>for (String key : allProps) {<NEW_LINE>boolean isBase = baseProps.containsKey(key);<NEW_LINE>boolean isLocal = localProps.containsKey(key);<NEW_LINE>boolean propertiesDiffer = true;<NEW_LINE>if (isBase && isLocal) {<NEW_LINE>Property p1 = new Property(baseProps.get(key));<NEW_LINE>Property p2 = new Property(localProps.get(key));<NEW_LINE>Difference[] diffs = diffAlgorithm.computeDiff(p1.toReader(), p2.toReader());<NEW_LINE>propertiesDiffer <MASK><NEW_LINE>}<NEW_LINE>if (propertiesDiffer) {<NEW_LINE>Setup setup = new Setup(base, key, currentType);<NEW_LINE>setup.setNode(new DiffNode(setup, new SvnFileNode(base), displayStatus));<NEW_LINE>newSetups.add(setup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// no need to litter log with expected exceptions:<NEW_LINE>// when parent is not versioned, the exception will allways be thrown<NEW_LINE>FileInformation parentInfo = cache.getCachedStatus(base.getParentFile());<NEW_LINE>Level logLevel = parentInfo != null && (parentInfo.getStatus() & FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY) != 0 ? Level.FINE : Level.INFO;<NEW_LINE>Subversion.LOG.log(logLevel, null, e);<NEW_LINE>}<NEW_LINE>} | = (diffs.length != 0); |
1,552,383 | public PushPhysicalPlan buildPushPhysicalPlan(final LogicalPlanNode logicalPlanNode, final Context context, final Optional<PushOffsetRange> offsetRange, final Optional<String> catchupConsumerGroup) {<NEW_LINE>final String catchupConsumerGroupId = getConsumerGroupId(catchupConsumerGroup);<NEW_LINE>PushDataSourceOperator dataSourceOperator = null;<NEW_LINE>final OutputNode outputNode = logicalPlanNode.getNode().orElseThrow(() -> new IllegalArgumentException("Need an output node to build a plan"));<NEW_LINE>if (!(outputNode instanceof KsqlBareOutputNode)) {<NEW_LINE>throw new KsqlException("Push queries expect the root of the logical plan to be a " + "KsqlBareOutputNode.");<NEW_LINE>}<NEW_LINE>// We skip KsqlBareOutputNode in the translation since it only applies the LIMIT<NEW_LINE>PlanNode currentLogicalNode = outputNode.getSource();<NEW_LINE>AbstractPhysicalOperator prevPhysicalOp = null;<NEW_LINE>AbstractPhysicalOperator rootPhysicalOp = null;<NEW_LINE>while (true) {<NEW_LINE>AbstractPhysicalOperator currentPhysicalOp = null;<NEW_LINE>if (currentLogicalNode instanceof QueryProjectNode) {<NEW_LINE>currentPhysicalOp <MASK><NEW_LINE>} else if (currentLogicalNode instanceof QueryFilterNode) {<NEW_LINE>currentPhysicalOp = translateFilterNode((QueryFilterNode) currentLogicalNode);<NEW_LINE>} else if (currentLogicalNode instanceof DataSourceNode) {<NEW_LINE>currentPhysicalOp = translateDataSourceNode((DataSourceNode) currentLogicalNode, offsetRange, catchupConsumerGroupId);<NEW_LINE>dataSourceOperator = (PushDataSourceOperator) currentPhysicalOp;<NEW_LINE>} else {<NEW_LINE>throw new KsqlException(String.format("Error in translating logical to physical plan for scalable push queries:" + " unrecognized logical node %s.", currentLogicalNode));<NEW_LINE>}<NEW_LINE>if (prevPhysicalOp == null) {<NEW_LINE>rootPhysicalOp = currentPhysicalOp;<NEW_LINE>} else {<NEW_LINE>prevPhysicalOp.addChild(currentPhysicalOp);<NEW_LINE>}<NEW_LINE>prevPhysicalOp = currentPhysicalOp;<NEW_LINE>// Exit the loop when a leaf node is reached<NEW_LINE>if (currentLogicalNode.getSources().isEmpty()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (currentLogicalNode.getSources().size() > 1) {<NEW_LINE>throw new KsqlException("Push queries do not support joins or nested sub-queries yet.");<NEW_LINE>}<NEW_LINE>currentLogicalNode = currentLogicalNode.getSources().get(0);<NEW_LINE>}<NEW_LINE>if (dataSourceOperator == null) {<NEW_LINE>throw new IllegalStateException("DataSourceOperator cannot be null in Push physical plan");<NEW_LINE>}<NEW_LINE>return new PushPhysicalPlan(rootPhysicalOp, (rootPhysicalOp).getLogicalNode().getSchema(), queryId, catchupConsumerGroupId, dataSourceOperator.getScalablePushRegistry(), dataSourceOperator, context, querySourceType);<NEW_LINE>} | = translateProjectNode((QueryProjectNode) currentLogicalNode); |
558,754 | public void onAuthErrorRtsp() {<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>bStartStop.setText(getResources().getString<MASK><NEW_LINE>rtspCamera1.stopStream();<NEW_LINE>Toast.makeText(RtspActivity.this, "Auth error", Toast.LENGTH_SHORT).show();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && rtspCamera1.isRecording()) {<NEW_LINE>rtspCamera1.stopRecord();<NEW_LINE>PathUtils.updateGallery(getApplicationContext(), folder.getAbsolutePath() + "/" + currentDateAndTime + ".mp4");<NEW_LINE>bRecord.setText(R.string.start_record);<NEW_LINE>Toast.makeText(RtspActivity.this, "file " + currentDateAndTime + ".mp4 saved in " + folder.getAbsolutePath(), Toast.LENGTH_SHORT).show();<NEW_LINE>currentDateAndTime = "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (R.string.start_button)); |
705,828 | private void markupGnuHashTable(TaskMonitor monitor) {<NEW_LINE>ElfDynamicTable dynamicTable = elf.getDynamicTable();<NEW_LINE>if (dynamicTable == null || !dynamicTable.containsDynamicValue(ElfDynamicType.DT_GNU_HASH)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataType dt = DWordDataType.dataType;<NEW_LINE>Address hashTableAddr = null;<NEW_LINE>try {<NEW_LINE>long value = dynamicTable.getDynamicValue(ElfDynamicType.DT_GNU_HASH);<NEW_LINE>if (value == 0) {<NEW_LINE>// table has been stripped<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>hashTableAddr = getDefaultAddress(elf.adjustAddressForPrelink(value));<NEW_LINE>Address addr = hashTableAddr;<NEW_LINE>Data d = listing.createData(addr, dt);<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - nbucket");<NEW_LINE>long nbucket = d.getScalar(0).getUnsignedValue();<NEW_LINE>addr = addr.add(d.getLength());<NEW_LINE>d = listing.createData(addr, dt);<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - symbase");<NEW_LINE>long symbolBase = d.getScalar(0).getUnsignedValue();<NEW_LINE>addr = addr.add(d.getLength());<NEW_LINE>d = listing.createData(addr, dt);<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - bloom_size");<NEW_LINE>long bloomSize = d.getScalar(0).getUnsignedValue();<NEW_LINE>addr = addr.add(d.getLength());<NEW_LINE>d = listing.createData(addr, dt);<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - bloom_shift");<NEW_LINE>addr = addr.add(d.getLength());<NEW_LINE>DataType bloomDataType = elf.is64Bit() ? QWordDataType.dataType : DWordDataType.dataType;<NEW_LINE>d = listing.createData(addr, new ArrayDataType(bloomDataType, (int) bloomSize, bloomDataType.getLength()));<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - bloom");<NEW_LINE>addr = addr.add(d.getLength());<NEW_LINE>d = listing.createData(addr, new ArrayDataType(dt, (int) nbucket, dt.getLength()));<NEW_LINE>d.setComment(CodeUnit.EOL_COMMENT, "GNU Hash Table - chains");<NEW_LINE>addr = addr.<MASK><NEW_LINE>listing.setComment(addr, CodeUnit.EOL_COMMENT, "GNU Hash Table - chain");<NEW_LINE>// Rely on dynamic symbol table for number of symbols<NEW_LINE>ElfSymbolTable dynamicSymbolTable = elf.getDynamicSymbolTable();<NEW_LINE>if (dynamicSymbolTable == null) {<NEW_LINE>log("Failed to markup GNU Hash Table chain data - missing dynamic symbol table");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int chainSize = dynamicSymbolTable.getSymbolCount() - (int) symbolBase;<NEW_LINE>d = listing.createData(addr, new ArrayDataType(dt, chainSize, dt.getLength()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>log("Failed to properly markup GNU Hash table at " + hashTableAddr + ": " + getMessage(e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | add(d.getLength()); |
896,245 | private DefaultMutableTreeNode createCertificateNodes(X509Certificate[] certs) {<NEW_LINE>DefaultMutableTreeNode certsNode = new DefaultMutableTreeNode();<NEW_LINE>Set<X509Certificate> originalSet = new TreeSet<>(new X509CertificateComparator());<NEW_LINE>Collections.addAll(originalSet, certs);<NEW_LINE>Set<X509Certificate> certSet = new TreeSet<>(new X509CertificateComparator());<NEW_LINE>Collections.addAll(certSet, certs);<NEW_LINE>// first find certs with no issuer in set and add them to the tree<NEW_LINE>certSet.stream().filter(cert -> !isIssuerInSet(cert, certSet)).forEach(cert -> certsNode.add(new DefaultMutableTreeNode(cert)));<NEW_LINE>certSet.removeIf(cert -> !isIssuerInSet(cert, originalSet));<NEW_LINE>// then add root certs<NEW_LINE>certSet.stream().filter(X509CertUtil::isCertificateSelfSigned).forEach(cert -> certsNode.add(new DefaultMutableTreeNode(cert)));<NEW_LINE>certSet.removeIf(X509CertUtil::isCertificateSelfSigned);<NEW_LINE>// then attach the other certs to their issuers<NEW_LINE>while (!certSet.isEmpty()) {<NEW_LINE>List<X509Certificate> toBeRemoved = new ArrayList<>();<NEW_LINE>for (X509Certificate cert : certSet) {<NEW_LINE>DefaultMutableTreeNode <MASK><NEW_LINE>if (issuerNode != null) {<NEW_LINE>issuerNode.add(new DefaultMutableTreeNode(cert));<NEW_LINE>toBeRemoved.add(cert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>certSet.removeAll(toBeRemoved);<NEW_LINE>}<NEW_LINE>return certsNode;<NEW_LINE>} | issuerNode = findIssuer(cert, certsNode); |
1,801,588 | static void computeEq20(DMatrixRMaj X, DMatrixRMaj P, double[] output) {<NEW_LINE>final int N = X.numRows;<NEW_LINE>double a00 = 0, a01 = 0<MASK><NEW_LINE>for (int i = 0, index = 0; i < N; i++, index += 2) {<NEW_LINE>double x1 = X.data[index];<NEW_LINE>double x2 = X.data[index + 1];<NEW_LINE>double p1 = P.data[index];<NEW_LINE>double p2 = P.data[index + 1];<NEW_LINE>a00 += x1 * p1;<NEW_LINE>a01 += x1 * p2;<NEW_LINE>a10 += x2 * p1;<NEW_LINE>a11 += x2 * p2;<NEW_LINE>}<NEW_LINE>output[0] = -a00 / N;<NEW_LINE>output[1] = -a01 / N;<NEW_LINE>output[2] = -a10 / N;<NEW_LINE>output[3] = -a11 / N;<NEW_LINE>} | , a10 = 0, a11 = 0; |
245,301 | public JSONObject topicSize(String clusterAlias, String topic) {<NEW_LINE>String jmx = "";<NEW_LINE>JMXConnector connector = null;<NEW_LINE>List<MetadataInfo> leaders = kafkaService.findKafkaLeader(clusterAlias, topic);<NEW_LINE>long tpSize = 0L;<NEW_LINE>for (MetadataInfo leader : leaders) {<NEW_LINE>String jni = kafkaService.getBrokerJMXFromIds(clusterAlias, leader.getLeader());<NEW_LINE>jmx = String.format(SystemConfigUtils.getProperty(clusterAlias + ".efak.jmx.uri"), jni);<NEW_LINE>try {<NEW_LINE>JMXServiceURL jmxSeriverUrl = new JMXServiceURL(jmx);<NEW_LINE>connector = JMXFactoryUtils.connectWithTimeout(clusterAlias, jmxSeriverUrl, 30, TimeUnit.SECONDS);<NEW_LINE>MBeanServerConnection mbeanConnection = connector.getMBeanServerConnection();<NEW_LINE>String objectName = String.format(KafkaLog.SIZE.getValue(), topic, leader.getPartitionId());<NEW_LINE>Object size = mbeanConnection.getAttribute(new ObjectName(objectName), KafkaLog.VALUE.getValue());<NEW_LINE>tpSize += Long.parseLong(size.toString());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>ex.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>if (connector != null) {<NEW_LINE>try {<NEW_LINE>connector.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Close jmx connector has error, msg is " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StrUtils.stringifyByObject(tpSize);<NEW_LINE>} | "Get topic size from jmx has error, msg is " + ex.getMessage()); |
1,297,137 | private static void registerCodeCompletion(LayerBuilder b, String mimeType) {<NEW_LINE>// NOI18N<NEW_LINE>instanceFile(b, "Editors/" + mimeType + "/CompletionProviders", null, CodeTemplateCompletionProvider.class, null).write();<NEW_LINE>// NOI18N<NEW_LINE>instanceFile(b, "Editors/" + mimeType + "/CompletionProviders", null, GsfCompletionProvider.class, null).write();<NEW_LINE>// NOI18N<NEW_LINE>instanceFile(b, "Editors/" + mimeType + "/CompletionProviders", null, "org.netbeans.modules.parsing.ui.WaitScanFinishedCompletionProvider", null).write();<NEW_LINE>// NOI18N<NEW_LINE>instanceFile(b, "Editors/" + mimeType + "/HoverProviders", null, GsfHoverProvider.<MASK><NEW_LINE>// // Code Completion<NEW_LINE>// Element completionFolder = mkdirs(doc, "Editors/" + mimeType + "/CompletionProviders"); // NOI18N<NEW_LINE>// createFile(doc, completionFolder, "org-netbeans-lib-editor-codetemplates-CodeTemplateCompletionProvider.instance"); // NOI18N<NEW_LINE>// createFile(doc, completionFolder, "org-netbeans-modules-csl-editor-completion-GsfCompletionProvider.instance"); // NOI18N<NEW_LINE>} | class, null).write(); |
891,762 | public void swipeWithEvent(NSEvent event) {<NEW_LINE>if (event.deltaX().doubleValue() == kSwipeGestureLeft) {<NEW_LINE>BrowserController.this.backButtonClicked(event.id());<NEW_LINE>} else if (event.deltaX().doubleValue() == kSwipeGestureRight) {<NEW_LINE>BrowserController.this.forwardButtonClicked(event.id());<NEW_LINE>} else if (event.deltaY().doubleValue() == kSwipeGestureUp) {<NEW_LINE>NSInteger row = getSelectedBrowserView().selectedRow();<NEW_LINE>NSInteger next;<NEW_LINE>if (-1 == row.intValue()) {<NEW_LINE>// No current selection<NEW_LINE>next = new NSInteger(0);<NEW_LINE>} else {<NEW_LINE>next = new NSInteger(row.longValue() - 1);<NEW_LINE>}<NEW_LINE>BrowserController.this.getSelectedBrowserView().selectRowIndexes(NSIndexSet.indexSetWithIndex(next), false);<NEW_LINE>} else if (event.deltaY().doubleValue() == kSwipeGestureDown) {<NEW_LINE>NSInteger row = getSelectedBrowserView().selectedRow();<NEW_LINE>NSInteger next;<NEW_LINE>if (-1 == row.intValue()) {<NEW_LINE>// No current selection<NEW_LINE>next = new NSInteger(0);<NEW_LINE>} else {<NEW_LINE>next = new NSInteger(<MASK><NEW_LINE>}<NEW_LINE>BrowserController.this.getSelectedBrowserView().selectRowIndexes(NSIndexSet.indexSetWithIndex(next), false);<NEW_LINE>}<NEW_LINE>} | row.longValue() + 1); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.