content stringlengths 40 137k |
|---|
"public boolean isEmpty() {\n final NodeEngine nodeEngine = getNodeEngine();\n try {\n MapIsEmptyOperation mapIsEmptyOperation = new MapIsEmptyOperation(name);\n Map<Integer, Object> results = nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME, mapIsEmptyOperation);\n for (Object result : results.values()) {\n if (!(Boolean) getService().toObject(result))\n return false;\n }\n return true;\n } catch (Throwable t) {\n throw ExceptionUtil.rethrow(t);\n }\n}\n"
|
"public synchronized void release(WireStore store) {\n store.release();\n if (store.refCount() <= 0) {\n stores.remove(new RollDetails(store.cycle(), store.epoch()));\n }\n}\n"
|
"public final boolean formMultiBlock() {\n if (this.worldObj.isRemote) {\n return false;\n }\n final int xPosNew = findEnd(ForgeDirection.WEST);\n final int yPosNew = findEnd(ForgeDirection.DOWN);\n final int zPosNew = findEnd(ForgeDirection.NORTH);\n final int xSizeNew = xPosNew + findEnd(ForgeDirection.EAST) + 1;\n final int ySizeNew = yPosNew + findEnd(ForgeDirection.UP) + 1;\n final int zSizeNew = zPosNew + findEnd(ForgeDirection.SOUTH) + 1;\n final int anchorXNew = this.xCoord - xPosNew;\n final int anchorYNew = this.yCoord - yPosNew;\n final int anchorZNew = this.zCoord - zPosNew;\n if (xSizeNew == 1 && ySizeNew == 1 && zSizeNew == 1) {\n return false;\n }\n for (int x = 0; x < xSizeNew; x++) {\n for (int y = 0; y < ySizeNew; y++) {\n for (int z = 0; z < zSizeNew; z++) {\n if (!this.canJoinMultiBlock(this.worldObj.getTileEntity(anchorXNew + x, anchorYNew + y, anchorZNew + z))) {\n return false;\n }\n }\n }\n }\n for (int x = 0; x < xSizeNew; x++) {\n for (int y = 0; y < ySizeNew; y++) {\n for (int z = 0; z < zSizeNew; z++) {\n TileEntity te = this.worldObj.getTileEntity(anchorXNew + x, anchorYNew + y, anchorZNew + z);\n if (te instanceof TileEntityMultiBlock) {\n TileEntityMultiBlock teMB = ((TileEntityMultiBlock) te);\n teMB.breakupMultiBlock();\n teMB.component = new MultiBlockComponent(anchorXNew, anchorYNew, anchorZNew, x, y, z, xSizeNew, ySizeNew, zSizeNew);\n teMB.addBlock();\n teMB.markForUpdate();\n } else {\n LogHelper.debug(\"String_Node_Str\");\n }\n }\n }\n }\n return true;\n}\n"
|
"private void handlePatch(PatchTableMessage m) throws BadPacketException {\n if (sequenceSize != -1 && sequenceSize != m.getSequenceSize())\n throw new BadPacketException(\"String_Node_Str\" + m.getSequenceSize() + \"String_Node_Str\" + sequenceSize);\n if (sequenceNumber == -1 ? m.getSequenceNumber() != 1 : sequenceNumber + 1 != m.getSequenceNumber())\n throw new BadPacketException(\"String_Node_Str\" + m.getSequenceNumber() + \"String_Node_Str\" + sequenceNumber);\n byte[] data = m.getData();\n if (m.getCompressor() == PatchTableMessage.COMPRESSOR_DEFLATE) {\n try {\n if (m.getSequenceNumber() == 1)\n uncompressor = new Inflater();\n Assert.that(uncompressor != null, \"String_Node_Str\");\n data = uncompress(data);\n } catch (IOException e) {\n throw new BadPacketException(\"String_Node_Str\" + e);\n }\n } else if (m.getCompressor() != PatchTableMessage.COMPRESSOR_NONE) {\n throw new BadPacketException(\"String_Node_Str\");\n }\n if (m.getEntryBits() == 4)\n data = unhalve(data);\n else if (m.getEntryBits() != 8)\n throw new BadPacketException(\"String_Node_Str\");\n for (int i = 0; i < data.length; i++) {\n try {\n boolean wasInfinity = (table[nextPatch] >= infinity);\n table[nextPatch] += data[i];\n boolean isInfinity = (table[nextPatch] >= infinity);\n if (wasInfinity && !isInfinity)\n entries++;\n else if (!wasInfinity && isInfinity)\n entries--;\n } catch (IndexOutOfBoundsException e) {\n throw new BadPacketException(\"String_Node_Str\" + nextPatch + \"String_Node_Str\" + data.length + \"String_Node_Str\");\n }\n nextPatch++;\n }\n if (m.getSequenceNumber() != m.getSequenceSize()) {\n this.sequenceNumber = m.getSequenceNumber();\n } else {\n this.sequenceNumber = -1;\n this.sequenceSize = -1;\n this.nextPatch = 0;\n }\n}\n"
|
"public void pushForStatement(String variable, String initExpr, String satExpr) {\n String name = _getNextIfSymbol();\n _currentIfTree = _currentIfTree.addChild(name);\n _currentIfTree.isForStatement = true;\n _currentIfTree.variable = variable;\n _currentIfTree.initExpr = initExpr;\n _currentIfTree.satExpr = satExpr;\n}\n"
|
"public Object evaluate(Property property, Object storedValue) {\n if (storedValue == null) {\n return storedValue;\n }\n List<?> possibleValues = property.getPossibleValues();\n if (possibleValues != null) {\n if (storedValue instanceof String && !ContextParameterUtils.isContainContextParam((String) storedValue)) {\n for (Object possibleValue : possibleValues) {\n if (possibleValue.toString().equals(storedValue)) {\n return possibleValue;\n }\n }\n }\n }\n if (storedValue instanceof Schema || storedValue instanceof List || storedValue instanceof Enum || storedValue instanceof Boolean) {\n return storedValue;\n }\n IContext context = null;\n if (node != null) {\n IProcess process = node.getProcess();\n if (process != null) {\n IContextManager cm = process.getContextManager();\n if (cm != null) {\n context = cm.getDefaultContext();\n }\n }\n }\n String stringStoredValue = String.valueOf(storedValue);\n if (context != null && ContextParameterUtils.isContainContextParam(stringStoredValue)) {\n stringStoredValue = ContextParameterUtils.parseScriptContextCode(stringStoredValue, context);\n }\n if (GenericTypeUtils.isStringType(property)) {\n return TalendQuoteUtils.removeQuotes(String.valueOf(storedValue));\n }\n return storedValue;\n}\n"
|
"protected GenericsType[] makeGenericsType(AST rootNode) {\n AST typeParameter = rootNode.getFirstChild();\n LinkedList ret = new LinkedList();\n assertNodeType(TYPE_PARAMETER, typeParameter);\n while (isType(TYPE_PARAMETER, typeParameter)) {\n AST typeNode = typeParameter.getFirstChild();\n ClassNode type = makeType(typeParameter);\n GenericsType gt = new GenericsType(type, makeGenericsBounds(typeNode, TYPE_UPPER_BOUNDS), null);\n configureAST(gt, typeParameter);\n ret.add(gt);\n typeParameter = typeParameter.getNextSibling();\n }\n return (GenericsType[]) ret.toArray(new GenericsType[ret.size()]);\n}\n"
|
"public void getRecords(MultiResultSet results, Set<Comparable> values) {\n takeReadLock();\n try {\n for (Comparable value : values) {\n ConcurrentMap<Data, QueryableEntry> records;\n if (value instanceof IndexImpl.NullObject) {\n records = recordsWithNullValue;\n } else {\n records = recordMap.get(value);\n }\n if (records != null) {\n results.addResultSet(records);\n }\n }\n }\n}\n"
|
"public boolean resetSkills() {\n if (skills == null)\n return false;\n for (DBSkills s : skills) {\n removeSkill(s.getSkillName());\n }\n if (removeMoney == true)\n this.account.subtract(getResetCost());\n return true;\n}\n"
|
"private static void from_NBU8_to_IU8(InterleavedU8 dst, byte[] srcData, int srcOffset, int srcStrideDiff) {\n int length = dst.width * dst.numBands;\n for (int y = 0; y < dst.height; y++) {\n int indexDst = dst.startIndex + dst.stride * y;\n int indexSrc = srcOffset + y * (length + srcStrideDiff);\n System.arraycopy(srcData, indexSrc, dst.data, indexDst, length);\n }\n}\n"
|
"public static void addGroundingsToBuilderByExtension(List<Rule> rules, ProbabilisticSoftLogicProblem.Builder builder, ProbabilisticSoftLogicPredicateManager predicateManager) {\n HashSet<Integer> newPredicates = new HashSet<>();\n List<HashSet<String>> groundingsAlreadyAdded = new ArrayList<>();\n for (int i = 0; i < rules.size(); ++i) {\n groundingsAlreadyAdded.add(new HashSet<>());\n }\n for (String predicateName : predicateManager.getPredicateNames()) {\n for (int id : predicateManager.getIdsForPredicateName(predicateName)) {\n newPredicates.add(id);\n }\n }\n while (!newPredicates.isEmpty()) {\n HashSet<Integer> currentPredicates = newPredicates;\n newPredicates = new HashSet<>();\n for (int indexRule = 0; indexRule < rules.size(); ++indexRule) {\n for (int predicateId : currentPredicates) {\n rules.get(indexRule).extendGroundingsAndAddToBuilder(predicateManager.getPredicateFromId(predicateId), builder, predicateManager, groundingsAlreadyAdded.get(indexRule), newPredicates);\n }\n }\n }\n}\n"
|
"public String getName() {\n return info.getName().replace(\"String_Node_Str\", \"String_Node_Str\");\n}\n"
|
"public static String[] getFields(Context ctx) {\n Class rStringClass = resolveRClass(ctx.getPackageName());\n if (rStringClass != null) {\n return getDefinedFonts(ctx, rStringClass.getFields());\n }\n return new String[0];\n}\n"
|
"private static synchronized void initExternalStorage(Context context) {\n if (sFileExternDir == null) {\n SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());\n mUseInternal = settings.getBoolean(\"String_Node_Str\", false);\n if (mUseInternal)\n mFileExternDir = context.getDir(AppConstants.FOLDER_PROJECTS_NAME, Context.MODE_WORLD_WRITEABLE | Context.MODE_WORLD_READABLE);\n else\n mFileExternDir = new File(context.getExternalFilesDir(null), AppConstants.FOLDER_PROJECTS_NAME);\n mFileExternDir.mkdirs();\n }\n}\n"
|
"protected Bundle getAndSetEipServiceJson() {\n Bundle result = new Bundle();\n String eip_service_json_string = \"String_Node_Str\";\n if (go_ahead) {\n try {\n JSONObject provider_json = new JSONObject(preferences.getString(Provider.KEY, \"String_Node_Str\"));\n String eip_service_url = provider_json.getString(Provider.API_URL) + \"String_Node_Str\" + provider_json.getString(Provider.API_VERSION) + \"String_Node_Str\" + EIP.SERVICE_API_PATH;\n eip_service_json_string = downloadWithProviderCA(eip_service_url);\n JSONObject eip_service_json = new JSONObject(eip_service_json_string);\n eip_service_json.getInt(Provider.API_RETURN_SERIAL);\n preferences.edit().putString(Constants.KEY, eip_service_json.toString()).commit();\n result.putBoolean(RESULT_KEY, true);\n } catch (NullPointerException | JSONException e) {\n String reason_to_fail = pickErrorMessage(eip_service_json_string);\n result.putString(ERRORS, reason_to_fail);\n result.putBoolean(RESULT_KEY, false);\n }\n }\n return result;\n}\n"
|
"private List<SwitchInfo> getSwitchInfoSetName(List<SwitchInfo> switches) {\n LOGGER.info(\"String_Node_Str\");\n if (switches != null && !StringUtils.isEmpty(switches)) {\n Map<String, String> csNames = getCustomSwitchNameFromFile();\n for (SwitchInfo switchInfo : switches) {\n switchInfo.setName(customSwitchName(csNames, switchInfo.getSwitchId()));\n }\n }\n return switches;\n}\n"
|
"public static EventHolder parse(AbstractDefinition tableDefinition, StreamEventPool tableStreamEventPool) {\n ZeroStreamEventConverter eventConverter = new ZeroStreamEventConverter();\n String primaryKeyAttribute = null;\n int primaryKeyPosition = -1;\n Map<String, Integer> indexMetaData = new HashMap<String, Integer>();\n Annotation primaryKeyAnnotation = AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_PRIMARY_KEY, tableDefinition.getAnnotations());\n if (primaryKeyAnnotation != null) {\n if (primaryKeyAnnotation.getElements().size() > 1) {\n throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + \"String_Node_Str\" + primaryKeyAnnotation.getElements().size() + \"String_Node_Str\");\n }\n if (primaryKeyAnnotation.getElements().size() == 0) {\n throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_PRIMARY_KEY + \"String_Node_Str\" + primaryKeyAnnotation.getElements().size() + \"String_Node_Str\");\n }\n primaryKeyAttribute = primaryKeyAnnotation.getElements().get(0).getValue().trim();\n primaryKeyPosition = tableDefinition.getAttributePosition(primaryKeyAttribute);\n }\n Annotation indexAnnotation = AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX, tableDefinition.getAnnotations());\n if (indexAnnotation != null) {\n if (indexAnnotation.getElements().size() == 0) {\n throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX + \"String_Node_Str\" + indexAnnotation.getElements().size() + \"String_Node_Str\");\n }\n for (Element element : indexAnnotation.getElements()) {\n indexMetaData.put(element.getValue().trim(), tableDefinition.getAttributePosition(element.getValue().trim()));\n }\n }\n Annotation indexByAnnotation = AnnotationHelper.getAnnotation(SiddhiConstants.ANNOTATION_INDEX_BY, tableDefinition.getAnnotations());\n if (indexByAnnotation != null) {\n if (primaryKeyAttribute != null) {\n log.info(\"String_Node_Str\" + SiddhiConstants.ANNOTATION_INDEX_BY + \"String_Node_Str\" + SiddhiConstants.ANNOTATION_PRIMARY_KEY + \"String_Node_Str\" + tableDefinition.getId());\n } else {\n if (indexByAnnotation.getElements().size() > 1) {\n throw new OperationNotSupportedException(SiddhiConstants.ANNOTATION_INDEX_BY + \"String_Node_Str\" + indexByAnnotation.getElements().size() + \"String_Node_Str\");\n }\n if (indexByAnnotation.getElements().size() == 0) {\n throw new ExecutionPlanValidationException(SiddhiConstants.ANNOTATION_INDEX_BY + \"String_Node_Str\" + indexByAnnotation.getElements().size() + \"String_Node_Str\");\n }\n primaryKeyAttribute = indexByAnnotation.getElements().get(0).getValue().trim();\n primaryKeyPosition = tableDefinition.getAttributePosition(primaryKeyAttribute);\n } else {\n log.info(\"String_Node_Str\" + SiddhiConstants.ANNOTATION_INDEX_BY + \"String_Node_Str\" + SiddhiConstants.ANNOTATION_PRIMARY_KEY + \"String_Node_Str\" + tableDefinition.getId());\n }\n }\n if (primaryKeyAttribute != null || indexMetaData.size() > 0) {\n return new IndexEventHolder(tableStreamEventPool, eventConverter, primaryKeyPosition, primaryKeyAttribute, indexMetaData);\n } else {\n return new ListEventHolder(tableStreamEventPool, eventConverter);\n }\n}\n"
|
"protected void discover() {\n for (Class<? extends Annotation> clazz : interestingAnnotations) addAnnotation(clazz);\n Class ctorType = null;\n for (Annotation an : foundAnnotations.values()) {\n try {\n Method m = an.getClass().getMethod(\"String_Node_Str\");\n m.setAccessible(true);\n Object o = m.invoke(an);\n if (o != null && !(o.equals(Object.class))) {\n ctorType = (Class) o;\n break;\n }\n } catch (NoSuchMethodException e) {\n } catch (IllegalArgumentException e) {\n log.warning(\"String_Node_Str\", e);\n } catch (Exception e) {\n log.warning(\"String_Node_Str\", e);\n }\n }\n if (ctorType != null)\n try {\n ctor = ctorType.getDeclaredConstructor();\n ctor.setAccessible(true);\n } catch (NoSuchMethodException e) {\n if (!hasAnnotation(ConstructorArgs.class))\n throw new MappingException(\"String_Node_Str\" + field.getType().getName(), e);\n }\n else {\n try {\n ctor = field.getType().getDeclaredConstructor();\n ctor.setAccessible(true);\n } catch (NoSuchMethodException e) {\n } catch (SecurityException e) {\n }\n }\n this.name = getMappedFieldName();\n Class type = field.getType();\n Type gType = field.getGenericType();\n TypeVariable<GenericDeclaration> tv = null;\n ParameterizedType pt = null;\n if (gType instanceof TypeVariable)\n tv = (TypeVariable<GenericDeclaration>) gType;\n else if (gType instanceof ParameterizedType)\n pt = (ParameterizedType) gType;\n if (tv != null) {\n type = ReflectionUtils.getTypeArgument(persistedClass, tv);\n } else if (pt != null) {\n log.debug(\"String_Node_Str\" + pt);\n }\n if (Object.class.equals(type) && (tv != null || pt != null))\n throw new MappingException(\"String_Node_Str\" + field.getName() + \"String_Node_Str\" + field.getDeclaringClass());\n if (type.isArray() || Collection.class.isAssignableFrom(type) || Map.class.isAssignableFrom(type)) {\n isSingleValue = false;\n isMap = Map.class.isAssignableFrom(type);\n isSet = Set.class.isAssignableFrom(type);\n isCollection = Collection.class.isAssignableFrom(type);\n isArray = type.isArray();\n if (!isMap && !isSet && !isCollection && !isArray)\n throw new MappingException(\"String_Node_Str\" + type);\n subType = (type.isArray()) ? type.getComponentType() : ReflectionUtils.getParameterizedType(field, (isMap) ? 1 : 0);\n if (isMap)\n mapKeyType = ReflectionUtils.getParameterizedType(field, 0);\n }\n isMongoType = ReflectionUtils.isPropertyType(type);\n if (!isMongoType && subType != null)\n isMongoType = ReflectionUtils.isPropertyType(subType);\n if (!isMongoType && !isSingleValue && (subType == null || subType.equals(Object.class))) {\n log.warning(\"String_Node_Str\" + getFullName() + \"String_Node_Str\" + subType);\n isMongoType = true;\n }\n}\n"
|
"public String toString() {\n return \"String_Node_Str\" + exception.getMessage();\n}\n"
|
"private void checkForRDBMS(EntityMetadata metadata) {\n if (Constants.RDBMS_CLIENT_FACTORY.equalsIgnoreCase(client)) {\n metadata.setPersistenceUnit(persistenceUnit);\n }\n}\n"
|
"protected boolean doBuild(AjBuildConfig buildConfig, IMessageHandler baseHandler, boolean batch) throws IOException, AbortException {\n batchCompile = batch;\n try {\n if (batch) {\n this.state = new AjState(this);\n }\n boolean canIncremental = state.prepareForNextBuild(buildConfig);\n if (!canIncremental && !batch) {\n return doBuild(buildConfig, baseHandler, true);\n }\n this.handler = CountingMessageHandler.makeCountingMessageHandler(baseHandler);\n String check = checkRtJar(buildConfig);\n if (check != null) {\n if (FAIL_IF_RUNTIME_NOT_FOUND) {\n MessageUtil.error(handler, check);\n return false;\n } else {\n MessageUtil.warn(handler, check);\n }\n }\n setBuildConfig(buildConfig);\n setupModel();\n if (batch) {\n initBcelWorld(handler);\n }\n if (handler.hasErrors()) {\n return false;\n }\n if (buildConfig.getOutputJar() != null) {\n if (!openOutputStream(buildConfig.getOutputJar()))\n return false;\n }\n if (batch) {\n if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {\n bcelWorld.setModel(AsmManager.getDefault().getHierarchy());\n }\n performCompilation(buildConfig.getFiles());\n if (handler.hasErrors()) {\n return false;\n }\n } else {\n List files = state.getFilesToCompile(true);\n for (int i = 0; (i < 5) && !files.isEmpty(); i++) {\n performCompilation(files);\n if (handler.hasErrors()) {\n return false;\n }\n files = state.getFilesToCompile(false);\n }\n if (!files.isEmpty()) {\n return batchBuild(buildConfig, baseHandler);\n }\n }\n if (buildConfig.isEmacsSymMode()) {\n new org.aspectj.ajdt.internal.core.builder.EmacsStructureModelManager().externalizeModel();\n }\n state.successfulCompile(buildConfig);\n copyResourcesToDestination();\n if (buildConfig.isGenerateModelMode()) {\n AsmManager.getDefault().fireModelUpdated();\n }\n return !handler.hasErrors();\n } finally {\n if (zos != null) {\n zos.close();\n }\n handler = null;\n }\n}\n"
|
"public void endCell(ICellContent cell) {\n engine.endCell(cell);\n}\n"
|
"public boolean isDeleted() {\n return getProperty().getItem().getState().isDeleted();\n}\n"
|
"public void onMovedToScrapHeap(View view) {\n WPNetworkImageView niv = (WPNetworkImageView) view.findViewById(R.id.theme_grid_item_image);\n if (niv != null) {\n String requestUrl = (String) niv.getTag();\n if (requestUrl != null) {\n ImageContainer container = WordPress.sImageLoader.get(requestUrl, new ImageListener() {\n public void onErrorResponse(VolleyError error) {\n }\n public void onResponse(ImageContainer response, boolean isImmediate) {\n }\n });\n container.cancelRequest();\n }\n }\n}\n"
|
"public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object objectValue, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext, XPathFragment rootFragment) {\n XPathFragment xmlRootFrag = null;\n if (objectValue instanceof XMLRoot) {\n XMLRoot xmlRoot = (XMLRoot) objectValue;\n xmlRootFrag = new XPathFragment();\n if (xmlRoot.getNamespaceURI() != null && !xmlRoot.getNamespaceURI().equals(namespaceResolver.getDefaultNamespaceURI())) {\n String prefix = namespaceResolver.resolveNamespaceURI(xmlRoot.getNamespaceURI());\n xmlRootFrag.setXPath(prefix + XMLConstants.COLON + xmlRootFrag.getLocalName());\n }\n }\n XMLMarshaller marshaller = marshalRecord.getMarshaller();\n if (xmlBinaryDataMapping.getConverter() != null) {\n Converter converter = xmlBinaryDataMapping.getConverter();\n if (converter instanceof XMLConverter) {\n objectValue = ((XMLConverter) converter).convertObjectValueToDataValue(objectValue, session, marshaller);\n } else {\n objectValue = converter.convertObjectValueToDataValue(objectValue, session);\n }\n }\n XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);\n if (objectValue == null) {\n marshalRecord.closeStartGroupingElements(groupingFragment);\n return true;\n }\n if (!xPathFragment.isAttribute()) {\n marshalRecord.closeStartGroupingElements(groupingFragment);\n XPathFragment elementFragment = xPathFragment;\n if (xmlRootFrag != null) {\n elementFragment = xmlRootFrag;\n }\n if (!xPathFragment.isSelfFragment) {\n marshalRecord.openStartElement(elementFragment, namespaceResolver);\n marshalRecord.closeStartElement();\n }\n }\n String c_id = null;\n byte[] bytes = null;\n String mimeType = this.xmlBinaryDataMapping.getMimeType(object);\n if (mimeType == null) {\n mimeType = \"String_Node_Str\";\n }\n if (xmlBinaryDataMapping.isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {\n if (xmlBinaryDataMapping.getAttributeClassification() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {\n c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) objectValue);\n } else {\n XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(objectValue, marshaller, xmlBinaryDataMapping.getMimeType(object));\n bytes = data.getData();\n c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);\n }\n } else if (marshalRecord.isXOPPackage() && !xmlBinaryDataMapping.shouldInlineBinaryData()) {\n XPathFragment lastFrag = ((XMLField) xmlBinaryDataMapping.getField()).getLastXPathFragment();\n if (xmlRootFrag != null) {\n lastFrag = xmlRootFrag;\n }\n String localName = null;\n String namespaceUri = null;\n if (rootFragment != null) {\n localName = rootFragment.getLocalName();\n namespaceUri = rootFragment.getNamespaceURI();\n }\n if (!lastFrag.isSelfFragment) {\n localName = lastFrag.getLocalName();\n namespaceUri = lastFrag.getNamespaceURI();\n }\n if (objectValue.getClass() == ClassConstants.APBYTE) {\n bytes = (byte[]) objectValue;\n c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.xmlBinaryDataMapping.getMimeType(object), localName, namespaceUri);\n } else if (xmlBinaryDataMapping.getAttributeClassification() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {\n c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) objectValue, localName, namespaceUri);\n } else {\n XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(objectValue, marshaller, xmlBinaryDataMapping.getMimeType(object));\n bytes = data.getData();\n c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, data.getMimeType(), localName, namespaceUri);\n }\n }\n if (xPathFragment.isAttribute()) {\n if (c_id != null) {\n marshalRecord.attribute(xPathFragment, namespaceResolver, c_id);\n } else {\n String value = getValueToWrite(((XMLField) xmlBinaryDataMapping.getField()).getSchemaType(), objectValue, session);\n marshalRecord.attribute(xPathFragment, namespaceResolver, value);\n }\n marshalRecord.closeStartGroupingElements(groupingFragment);\n return true;\n }\n if (xmlBinaryDataMapping.isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {\n if (c_id != null) {\n marshalRecord.characters(c_id);\n } else {\n marshalRecord.characters(((XMLField) xmlBinaryDataMapping.getField()).getSchemaType(), objectValue, mimeType, false);\n }\n } else {\n if (marshalRecord.isXOPPackage() && !xmlBinaryDataMapping.shouldInlineBinaryData()) {\n if (c_id == null) {\n marshalRecord.characters(((XMLField) xmlBinaryDataMapping.getField()).getSchemaType(), objectValue, mimeType, false);\n } else {\n String xopPrefix = null;\n if (namespaceResolver != null) {\n xopPrefix = namespaceResolver.resolveNamespaceURI(XMLConstants.XOP_URL);\n }\n boolean addDeclaration = false;\n if (xopPrefix == null || namespaceResolver == null) {\n addDeclaration = true;\n xopPrefix = XMLConstants.XOP_PREFIX;\n namespaceResolver = new NamespaceResolver();\n namespaceResolver.put(xopPrefix, XMLConstants.XOP_URL);\n }\n XPathFragment xopInclude = new XPathFragment(xopPrefix + \"String_Node_Str\");\n xopInclude.setNamespaceURI(XMLConstants.XOP_URL);\n marshalRecord.openStartElement(xopInclude, namespaceResolver);\n marshalRecord.attribute(XMLConstants.EMPTY_STRING, \"String_Node_Str\", \"String_Node_Str\", c_id);\n if (addDeclaration) {\n marshalRecord.attribute(XMLConstants.XMLNS_URL, xopPrefix, XMLConstants.XMLNS + XMLConstants.COLON + xopPrefix, XMLConstants.XOP_URL);\n }\n marshalRecord.closeStartElement();\n marshalRecord.endElement(xopInclude, namespaceResolver);\n }\n } else {\n marshalRecord.characters(((XMLField) xmlBinaryDataMapping.getField()).getSchemaType(), objectValue, mimeType, false);\n }\n }\n if (!xPathFragment.isSelfFragment()) {\n marshalRecord.endElement(xPathFragment, namespaceResolver);\n }\n return true;\n}\n"
|
"private void initComponents() {\n jScrollPane1 = new javax.swing.JScrollPane();\n _modelsListTable = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n _totalModelsLabel = new java.awt.Label();\n _numberOfModelsLabel = new java.awt.Label();\n _previousPageButton = new java.awt.Button();\n _pageNumberCombo = new javax.swing.JComboBox();\n _nextPageButton = new java.awt.Button();\n _hintLabel = new java.awt.Label();\n _hintLabel.setFont(new java.awt.Font(\"String_Node_Str\", 1, 12));\n _hintLabel.setText(\"String_Node_Str\");\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setResizable(false);\n _setTableData();\n _setPageNumbers();\n jScrollPane1.setViewportView(_modelsListTable);\n _modelsListTable.addMouseListener(new MouseAdapter() {\n public void mouseClicked(MouseEvent e) {\n if (e.getClickCount() == 2) {\n javax.swing.JTable target = (javax.swing.JTable) e.getSource();\n int row = target.getSelectedRow();\n int column = target.getSelectedColumn();\n _loadModel((String) target.getValueAt(row, 1));\n }\n }\n });\n _totalModelsLabel.setFont(new java.awt.Font(\"String_Node_Str\", 1, 12));\n _totalModelsLabel.setName(\"String_Node_Str\");\n _totalModelsLabel.setText(\"String_Node_Str\");\n _noOfModelsLabel.setName(\"String_Node_Str\");\n _noOfModelsLabel.setText(Integer.toString(_noOfModels));\n _previousPageButton.setLabel(\"String_Node_Str\");\n _previousPageButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _gotToPreviousPage(evt);\n }\n });\n _pageNumberCombo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _gotoPage(evt);\n }\n });\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addComponent(_totalModelsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(_noOfModelsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 148, Short.MAX_VALUE).addComponent(_previousPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(_pageNumberCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)));\n jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(_totalModelsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(_noOfModelsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(_pageNumberCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(_previousPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n _nextPageButton.setLabel(\"String_Node_Str\");\n _nextPageButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _goToNextPage(evt);\n }\n });\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(_hintLabel, javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE).addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup().addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(_nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap()));\n layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(_hintLabel).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(_nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addContainerGap()));\n pack();\n}\n"
|
"public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {\n if (value instanceof JProgressBar)\n return (JProgressBar) value;\n Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);\n if (!isSelected) {\n DownloadLink dLink = allLinks.get(row);\n if (!dLink.isEnabled()) {\n c.setBackground(COLOR_DISABLED);\n } else if (dLink.getRemainingWaittime() > 0) {\n c.setBackground(COLOR_WAIT);\n } else if (dLink.getStatus() == DownloadLink.STATUS_DONE) {\n c.setBackground(COLOR_DONE);\n } else if (dLink.getStatus() != DownloadLink.STATUS_TODO && dLink.getStatus() != DownloadLink.STATUS_ERROR_DOWNLOAD_LIMIT && dLink.getStatus() != DownloadLink.STATUS_DOWNLOAD_IN_PROGRESS) {\n c.setBackground(COLOR_ERROR);\n } else {\n c.setBackground(Color.WHITE);\n }\n return c;\n}\n"
|
"private Branch[] getBranches() {\n ArrayList<String> mirrors = new ArrayList<String>();\n for (String m : UPDATE_MIRROR) mirrors.add(m);\n for (int i = 0; i < UPDATE_MIRROR.length; i++) {\n String serv = mirrors.remove((int) (Math.random() * (UPDATE_MIRROR.length - 1 - i)));\n try {\n br.getPage(serv + \"String_Node_Str\");\n if (br.getRequest().getHttpConnection().isOK()) {\n String[] bs = Regex.getLines(br.toString());\n ArrayList<Branch> ret = new ArrayList<Branch>();\n this.branches = new Branch[bs.length];\n for (int ii = 0; ii < bs.length; ii++) {\n Branch branch = new Branch(bs[ii]);\n if (branch.isBeta() && betaBranch == null) {\n betaBranch = branch;\n } else if (!branch.isBeta()) {\n ret.add(branch);\n }\n }\n branches = ret.toArray(new Branch[] {});\n System.out.println(\"String_Node_Str\" + serv + \"String_Node_Str\" + br);\n return branches;\n }\n } catch (Exception e) {\n e.printStackTrace();\n errorWait();\n }\n System.err.println(\"String_Node_Str\" + serv);\n }\n branches = new Branch[] {};\n return branches;\n}\n"
|
"public XPathNode addChild(XPathFragment anXPathFragment, NodeValue aNodeValue, NamespaceResolver namespaceResolver) {\n if (null != anXPathFragment && anXPathFragment.nameIsText()) {\n if (aNodeValue.isOwningNode(anXPathFragment)) {\n XPathNode textXPathNode = this.getTextNode();\n if (textXPathNode == null) {\n textXPathNode = new XPathNode();\n }\n textXPathNode.setParent(this);\n textXPathNode.setXPathFragment(anXPathFragment);\n if (aNodeValue.isMarshalNodeValue()) {\n textXPathNode.setMarshalNodeValue(aNodeValue);\n }\n if (aNodeValue.isUnmarshalNodeValue()) {\n textXPathNode.setUnmarshalNodeValue(aNodeValue);\n }\n this.setTextNode(textXPathNode);\n if (null == nonAttributeChildren) {\n nonAttributeChildren = new ArrayList();\n }\n nonAttributeChildren.add(textXPathNode);\n return textXPathNode;\n }\n }\n if (anXPathFragment != null && namespaceResolver != null && anXPathFragment.getNamespaceURI() == null && !anXPathFragment.nameIsText()) {\n if (!anXPathFragment.isAttribute()) {\n anXPathFragment.setNamespaceURI(namespaceResolver.resolveNamespacePrefix(anXPathFragment.getPrefix()));\n } else if (anXPathFragment.hasNamespace()) {\n anXPathFragment.setNamespaceURI(namespaceResolver.resolveNamespacePrefix(anXPathFragment.getPrefix()));\n }\n }\n XPathNode xPathNode = new XPathNode();\n xPathNode.setXPathFragment(anXPathFragment);\n List children;\n Map childrenMap;\n if ((anXPathFragment != null) && anXPathFragment.isAttribute()) {\n if (null == attributeChildren) {\n attributeChildren = new ArrayList();\n }\n if (null == attributeChildrenMap) {\n attributeChildrenMap = new HashMap();\n }\n children = attributeChildren;\n childrenMap = attributeChildrenMap;\n } else {\n if (null == nonAttributeChildren) {\n nonAttributeChildren = new ArrayList();\n }\n if (null == nonAttributeChildrenMap) {\n nonAttributeChildrenMap = new HashMap();\n }\n children = nonAttributeChildren;\n childrenMap = nonAttributeChildrenMap;\n }\n if (null == anXPathFragment) {\n if (aNodeValue.isMarshalNodeValue()) {\n xPathNode.setMarshalNodeValue(aNodeValue);\n }\n if (aNodeValue.isUnmarshalNodeValue() && xPathNode.getUnmarshalNodeValue() == null) {\n xPathNode.setUnmarshalNodeValue(aNodeValue);\n }\n xPathNode.setParent(this);\n if (aNodeValue instanceof XMLAnyAttributeMappingNodeValue) {\n setAnyAttributeNodeValue((XMLAnyAttributeMappingNodeValue) aNodeValue);\n anyAttributeNode = xPathNode;\n } else {\n if (!children.contains(xPathNode)) {\n children.add(xPathNode);\n }\n setAnyNode(xPathNode);\n }\n return xPathNode;\n }\n boolean isSelfFragment = XPathFragment.SELF_FRAGMENT.equals(anXPathFragment);\n if (isSelfFragment) {\n children.add(xPathNode);\n if (null == selfChildren) {\n selfChildren = new ArrayList<XPathNode>();\n }\n selfChildren.add(xPathNode);\n } else {\n int index = children.indexOf(xPathNode);\n if (index >= 0) {\n xPathNode = (XPathNode) children.get(index);\n } else {\n xPathNode.setParent(this);\n if (!children.contains(xPathNode)) {\n children.add(xPathNode);\n }\n childrenMap.put(anXPathFragment, xPathNode);\n }\n }\n if (aNodeValue.isOwningNode(anXPathFragment)) {\n if (aNodeValue.isMarshalNodeValue()) {\n xPathNode.setMarshalNodeValue(aNodeValue);\n }\n if (aNodeValue.isUnmarshalNodeValue() && xPathNode.getUnmarshalNodeValue() == null) {\n xPathNode.setUnmarshalNodeValue(aNodeValue);\n }\n } else {\n XPathFragment nextFragment = anXPathFragment.getNextFragment();\n xPathNode.addChild(nextFragment, aNodeValue, namespaceResolver);\n }\n return xPathNode;\n}\n"
|
"public void setInventorySlotContents(ItemStack me, int var1, ItemStack stack) {\n if (!me.hasTagCompound()) {\n me.setTagCompound(new NBTTagCompound());\n }\n if (!me.stackTagCompound.hasKey(\"String_Node_Str\")) {\n me.stackTagCompound.setTag(\"String_Node_Str\", new NBTTagCompound());\n }\n if (me.stackTagCompound.getCompoundTag(\"String_Node_Str\").hasKey(Integer.toString(var1))) {\n me.stackTagCompound.getCompoundTag(\"String_Node_Str\").removeTag(Integer.toString(var1));\n }\n NBTTagCompound stc = new NBTTagCompound();\n if (stack != null) {\n stack.writeToNBT(stc);\n me.stackTagCompound.getCompoundTag(\"String_Node_Str\").setTag(Integer.toString(var1), stc);\n if (var1 == 5 && slot == 1) {\n if (!me.stackTagCompound.hasKey(\"String_Node_Str\")) {\n me.stackTagCompound.setInteger(\"String_Node_Str\", 0);\n }\n me.stackTagCompound.setInteger(\"String_Node_Str\", ((IExosuitTank) stack.getItem()).getStorage(me));\n if (stack.getItem() instanceof BlockTankItem && stack.getItemDamage() == 1) {\n me.stackTagCompound.setInteger(\"String_Node_Str\", me.stackTagCompound.getInteger(\"String_Node_Str\"));\n }\n }\n }\n this.hasPlates(me);\n}\n"
|
"protected void setup(Context context) throws IOException, InterruptedException {\n super.setup(context);\n Configuration conf = context.getConfiguration();\n try {\n representativePoints = CDbwMapper.getRepresentativePoints(conf);\n } catch (NumberFormatException e) {\n throw new IllegalStateException(e);\n } catch (SecurityException e) {\n throw new IllegalStateException(e);\n } catch (IllegalArgumentException e) {\n throw new IllegalStateException(e);\n }\n}\n"
|
"public int compare(MapEntry o1, MapEntry o2) {\n int result = comparator.compare(o1, o2);\n if (result == 0) {\n Record r1 = (Record) o1;\n Record r2 = (Record) o2;\n return (r1.getId() > r2.getId()) ? 1 : -1;\n } else {\n return result;\n }\n}\n"
|
"private static List<String> extractTables(String database, BufferedReader reader, File metaTmpDir) throws IOException {\n File tableDescDir = new File(metaTmpDir, TABLE_FOLDER_NAME);\n File tableExdDir = new File(metaTmpDir, TABLE_EXD_FOLDER_NAME);\n mkdirs(tableDescDir);\n mkdirs(tableExdDir);\n List<TableDesc> tableDescList = new ArrayList<TableDesc>();\n List<Map<String, String>> tableAttrsList = new ArrayList<Map<String, String>>();\n getTables(database, reader, tableDescList, tableAttrsList);\n List<String> loadedTables = Lists.newArrayList();\n for (TableDesc table : tableDescList) {\n File file = new File(tableDescDir, table.getName().toUpperCase() + \"String_Node_Str\" + OUTPUT_SURFIX);\n JsonUtil.writeValueIndent(new FileOutputStream(file), table);\n loadedTables.add(table.getDatabase() + \"String_Node_Str\" + table.getName());\n }\n for (Map<String, String> tableAttrs : tableAttrsList) {\n File file = new File(tableExdDir, tableAttrs.get(\"String_Node_Str\").toUpperCase() + \"String_Node_Str\" + OUTPUT_SURFIX);\n JsonUtil.writeValueIndent(new FileOutputStream(file), tableAttrs);\n }\n return loadedTables;\n}\n"
|
"public org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle();\n copyResource(src, tgt);\n tgt.setType(convertBundleType(src.getType()));\n if (src.hasTotal())\n tgt.setTotal(src.getTotal());\n for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));\n for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t));\n if (src.hasSignature())\n tgt.setSignature(convertSignature(src.getSignature()));\n return tgt;\n}\n"
|
"public void testDirectAccess() throws Exception {\n Logging.logMessage(Logging.LEVEL_DEBUG, Category.test, this, BufferPool.getStatus());\n database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 0, 0, 0, SyncMode.ASYNC, 0, 50, compression, maxNumRecs, maxBlockFileSize, true, 0, Logging.LEVEL_DEBUG));\n Database db = database.getDatabaseManager().createDatabase(\"String_Node_Str\", 2);\n for (int i = 0; i < 100000; i++) {\n DatabaseInsertGroup ir = db.createInsertGroup();\n ir.addInsert(0, (i + \"String_Node_Str\").getBytes(), \"String_Node_Str\".getBytes());\n ir.addInsert(1, (i + \"String_Node_Str\").getBytes(), \"String_Node_Str\".getBytes());\n db.insert(ir, null).get();\n }\n Logging.logMessage(Logging.LEVEL_DEBUG, Category.test, this, BufferPool.getStatus());\n database.getCheckpointer().checkpoint();\n for (int i = 0; i < 100000; i++) {\n byte[] v0 = db.lookup(0, (i + \"String_Node_Str\").getBytes(), null).get();\n byte[] v1 = db.lookup(1, (i + \"String_Node_Str\").getBytes(), null).get();\n assertEquals(\"String_Node_Str\", new String(v0));\n assertEquals(\"String_Node_Str\", new String(v1));\n }\n Logging.logMessage(Logging.LEVEL_DEBUG, Category.test, this, BufferPool.getStatus());\n}\n"
|
"public void setAll(int capacity, int value) {\n ensureCapacity0(capacity);\n pos = capacity;\n Arrays.fill(buffer, value);\n}\n"
|
"public String getStatus() {\n rwLock.readLock().lock();\n try {\n return status;\n }\n}\n"
|
"public <E> IList<E> getList(String name) {\n return (IList<E>) getClientProxy(Prefix.AS_LIST + name);\n}\n"
|
"protected void onDataChanged() {\n super.onDataChanged();\n if (!mSeries.isEmpty()) {\n int seriesCount = mSeries.size();\n float maxValue = 0;\n for (ValueLineSeries series : mSeries) {\n for (ValueLinePoint point : series.getSeries()) {\n if (point.getValue() > maxValue)\n maxValue = point.getValue();\n }\n }\n float heightMultiplier = mUseableGraphHeight / maxValue;\n for (ValueLineSeries series : mSeries) {\n int seriesPointCount = series.getSeries().size();\n if (seriesPointCount <= 1) {\n Log.w(LOG_TAG, \"String_Node_Str\");\n } else {\n float widthOffset = mGraphWidth / seriesPointCount;\n widthOffset += widthOffset / seriesPointCount;\n float currentOffset = 0;\n series.setWidthOffset(widthOffset);\n if (mUseCubic) {\n widthOffset = mWidth / (seriesPointCount - 1);\n }\n float firstX = currentOffset;\n float firstY = (mUseableGraphHeight + mTopPadding) - (series.getSeries().get(0).getValue() * heightMultiplier);\n Path path = new Path();\n path.moveTo(firstX, firstY);\n series.getSeries().get(0).setCoordinates(new Point2D(firstX, firstY));\n if (mUseCubic) {\n Point2D P1 = new Point2D();\n Point2D P2 = new Point2D();\n Point2D P3 = new Point2D();\n for (int i = 0; i < seriesPointCount; i++) {\n if ((seriesPointCount - i) < 3) {\n P1.setX(currentOffset);\n P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));\n P2.setX(mGraphWidth);\n P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));\n calculatePointDiff(P1, P2, P1, mSecondMultiplier);\n P3.setX(mGraphWidth);\n P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));\n calculatePointDiff(P2, P3, P3, mFirstMultiplier);\n path.cubicTo(P1.getX(), P1.getY(), P2.getX(), P2.getY(), P3.getX(), P3.getY());\n series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(), P2.getY()));\n break;\n } else {\n P1.setX(currentOffset);\n P1.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i).getValue() * heightMultiplier));\n P2.setX(currentOffset + widthOffset);\n P2.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 1).getValue() * heightMultiplier));\n calculatePointDiff(P1, P2, P1, mSecondMultiplier);\n P3.setX(currentOffset + (2 * widthOffset));\n P3.setY((mUseableGraphHeight + mTopPadding) - (series.getSeries().get(i + 2).getValue() * heightMultiplier));\n calculatePointDiff(P2, P3, P3, mFirstMultiplier);\n series.getSeries().get(i + 1).setCoordinates(new Point2D(P2.getX(), P2.getY()));\n }\n currentOffset += widthOffset;\n path.cubicTo(P1.getX(), P1.getY(), P2.getX(), P2.getY(), P3.getX(), P3.getY());\n }\n } else {\n boolean first = true;\n int count = 1;\n for (ValueLinePoint point : series.getSeries()) {\n if (first) {\n first = false;\n continue;\n }\n currentOffset += widthOffset;\n if (count == seriesPointCount - 1) {\n if (currentOffset < mGraphWidth) {\n currentOffset = mGraphWidth;\n }\n }\n point.setCoordinates(new Point2D(currentOffset, (mUseableGraphHeight + mTopPadding) - (point.getValue() * heightMultiplier)));\n path.lineTo(point.getCoordinates().getX(), point.getCoordinates().getY());\n count++;\n }\n }\n if (mUseOverlapFill || seriesCount == 1) {\n path.lineTo(mGraphWidth, mGraphHeight);\n path.lineTo(0, mGraphHeight);\n path.lineTo(firstX, firstY);\n }\n series.setPath(path);\n }\n }\n if (!mUseCustomLegend) {\n int index = 0;\n int size = mSeries.get(0).getSeries().size();\n if (size > 1) {\n for (ValueLinePoint valueLinePoint : mSeries.get(0).getSeries()) {\n if (!(index == 0 || index == size - 1)) {\n valueLinePoint.setLegendBounds(new RectF(valueLinePoint.getCoordinates().getX() - mSeries.get(0).getWidthOffset() / 2, 0, valueLinePoint.getCoordinates().getX() + mSeries.get(0).getWidthOffset() / 2, mLegendHeight));\n } else {\n valueLinePoint.setIgnore(true);\n }\n index++;\n }\n Utils.calculateLegendInformation(mSeries.get(0).getSeries(), 0, mLegendPaint);\n }\n }\n if (mShowIndicator && mSeries.size() == 1) {\n int size = mSeries.get(0).getSeries().size();\n int index;\n if (size > 1) {\n if (size == 3) {\n index = size / 2;\n } else {\n index = (size / 2) - 1;\n }\n mFocusedPoint = mSeries.get(0).getSeries().get(index);\n mTouchedArea.setX(mFocusedPoint.getCoordinates().getX());\n mTouchedArea.setY(mFocusedPoint.getCoordinates().getY());\n calculateValueTextHeight();\n }\n }\n }\n}\n"
|
"private void initUIContentForComboBuildInTypes() {\n comboBuildInTypes.removeSelectionChangedListener(buildInChangedListener);\n comboBuildInTypes.setInput(Util.getAllBuildInTypes(xsdSimpleType.getSchema()));\n if (xsdSimpleType.getBaseType() != null) {\n comboBuildInTypes.setSelection(new StructuredSelection(xsdSimpleType.getBaseType()));\n }\n radBuildInTypes.setSelection(!comboBuildInTypes.getSelection().isEmpty());\n comboBuildInTypes.addSelectionChangedListener(buildInChangedListener);\n}\n"
|
"public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {\n super.configure(name, params);\n Map<String, String> dbParams = _configDao.getConfiguration(params);\n _cidr = dbParams.get(Config.ControlCidr.toString());\n if (_cidr == null) {\n _cidr = \"String_Node_Str\";\n }\n _gateway = dbParams.get(Config.ControlGateway);\n if (_gateway == null) {\n _gateway = NetUtils.getLinkLocalGateway();\n }\n s_logger.info(\"String_Node_Str\" + _cidr + \"String_Node_Str\" + _gateway);\n return true;\n}\n"
|
"public static void initModifiers(AbstractCoreItem ingredient, GameCharacter tattooBearer, InventorySlot tattooSlot) {\n EnchantmentDialogue.ingredient = ingredient;\n EnchantmentDialogue.tattooBearer = tattooBearer;\n EnchantmentDialogue.tattooSlot = tattooSlot;\n if (ingredient instanceof AbstractClothing || ingredient instanceof Tattoo) {\n EnchantmentDialogue.effects = new ArrayList<>(ingredient.getEffects());\n if (ingredient instanceof Tattoo && tattooBearer.getTattooInSlot(tattooSlot) == ingredient) {\n EnchantmentDialogue.isEquipped = true;\n EnchantmentDialogue.isEquippedIn = tattooSlot;\n EnchantmentDialogue.isEquippedTo = tattooBearer;\n }\n } else {\n EnchantmentDialogue.effects = new ArrayList<>();\n }\n if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getPrimaryModifiers().contains(EnchantmentDialogue.primaryMod)) {\n EnchantmentDialogue.primaryMod = EnchantmentDialogue.ingredient.getEnchantmentEffect().getPrimaryModifiers().get(0);\n }\n if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getSecondaryModifiers(EnchantmentDialogue.primaryMod).contains(EnchantmentDialogue.secondaryMod)) {\n EnchantmentDialogue.secondaryMod = EnchantmentDialogue.ingredient.getEnchantmentEffect().getSecondaryModifiers(EnchantmentDialogue.primaryMod).get(0);\n }\n if (!EnchantmentDialogue.ingredient.getEnchantmentEffect().getPotencyModifiers(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod).contains(EnchantmentDialogue.potency)) {\n EnchantmentDialogue.potency = TFPotency.MINOR_BOOST;\n }\n if (EnchantmentDialogue.limit <= EnchantmentDialogue.ingredient.getEnchantmentEffect().getLimits(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod)) {\n EnchantmentDialogue.limit = EnchantmentDialogue.ingredient.getEnchantmentEffect().getLimits(EnchantmentDialogue.primaryMod, EnchantmentDialogue.secondaryMod);\n }\n}\n"
|
"public int compareTo(final AnnotationInfo o) {\n final int diff = getAnnotationName().compareTo(o.getAnnotationName());\n if (diff != 0) {\n return diff;\n }\n if (annotationParamValues == null && o.annotationParamValues == null) {\n return 0;\n } else if (annotationParamValues == null) {\n return -1;\n } else if (o.annotationParamValues == null) {\n return 1;\n } else {\n for (int i = 0, max = Math.max(annotationParamValues.size(), o.annotationParamValues.size()); i < max; i++) {\n if (i >= annotationParamValues.size()) {\n return -1;\n } else if (i >= o.annotationParamValues.size()) {\n return 1;\n } else {\n final int diff2 = annotationParamValues.get(i).compareTo(o.annotationParamValues.get(i));\n if (diff2 != 0) {\n return diff2;\n }\n }\n }\n }\n return 0;\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n MageObject sourceObject = source.getSourceObject(game);\n if (sourceObject != null && controller != null) {\n Permanent permanentLeftBattlefield = (Permanent) getValue(\"String_Node_Str\");\n if (permanentLeftBattlefield == null) {\n Logger.getLogger(ReturnFromExileForSourceEffect.class).error(\"String_Node_Str\" + sourceObject.getName());\n return false;\n }\n ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), permanentLeftBattlefield.getZoneChangeCounter(game)));\n if (exile != null) {\n controller.moveCards(exile.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);\n }\n game.getExile().getExileZone(exileId).clear();\n return true;\n }\n return false;\n}\n"
|
"public ResultTransformation process(SheetTransformer sheetTransformer) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + var + \"String_Node_Str\" + items);\n log.debug(\"String_Node_Str\" + tagContext);\n log.debug(\"String_Node_Str\" + itemsCollection);\n }\n Block body = tagContext.getTagBody();\n if (body.getNumberOfRows() == 1) {\n return processOneRowTag(sheetTransformer);\n }\n int shiftNumber = 0;\n if (itemsCollection != null && !itemsCollection.isEmpty()) {\n tagContext.getSheetTransformationController().removeBorders(body);\n shiftNumber += -2;\n ResultTransformation shift = new ResultTransformation(0);\n Map beans = tagContext.getBeans();\n int k = 0;\n ResultTransformation processResult;\n int startRowNum, endRowNum;\n if (groupBy == null || groupBy.length() == 0) {\n Collection c2 = new ArrayList();\n for (Iterator iterator = itemsCollection.iterator(); iterator.hasNext(); ) {\n Object o = iterator.next();\n beans.put(var, o);\n if (ReportUtil.shouldSelectCollectionData(beans, select, configuration)) {\n c2.add(o);\n }\n }\n shiftNumber += tagContext.getSheetTransformationController().duplicateDown(body, c2.size() - 1);\n for (Iterator iterator = c2.iterator(); iterator.hasNext(); ) {\n Object o = iterator.next();\n beans.put(var, o);\n try {\n startRowNum = body.getStartRowNum() + shift.getLastRowShift() + body.getNumberOfRows() * k++;\n endRowNum = startRowNum + body.getNumberOfRows() - 1;\n processResult = sheetTransformer.processRows(tagContext.getSheetTransformationController(), tagContext.getSheet(), startRowNum, endRowNum, beans, null);\n shift.add(processResult);\n } catch (ParsePropertyException e) {\n log.error(\"String_Node_Str\", e);\n throw new RuntimeException(\"String_Node_Str\", e);\n }\n }\n } else {\n try {\n Collection groupedData = ReportUtil.groupCollectionData(itemsCollection, groupBy, groupOrder, select, configuration);\n shiftNumber += tagContext.getSheetTransformationController().duplicateDown(body, groupedData.size() - 1);\n Object savedGroupData = null;\n if (beans.containsKey(GROUP_DATA_KEY)) {\n savedGroupData = beans.get(GROUP_DATA_KEY);\n }\n for (Iterator iterator = groupedData.iterator(); iterator.hasNext(); ) {\n GroupData groupData = (GroupData) iterator.next();\n beans.put(GROUP_DATA_KEY, groupData);\n try {\n startRowNum = body.getStartRowNum() + shift.getLastRowShift() + body.getNumberOfRows() * k++;\n endRowNum = startRowNum + body.getNumberOfRows() - 1;\n processResult = sheetTransformer.processRows(tagContext.getSheetTransformationController(), tagContext.getSheet(), startRowNum, endRowNum, beans, null);\n shift.add(processResult);\n } catch (ParsePropertyException e) {\n log.error(\"String_Node_Str\", e);\n }\n }\n beans.remove(GROUP_DATA_KEY);\n if (savedGroupData != null) {\n beans.put(GROUP_DATA_KEY, savedGroupData);\n }\n } catch (NoSuchMethodException e) {\n log.error(e, new Exception(\"String_Node_Str\" + groupBy, e));\n } catch (IllegalAccessException e) {\n log.error(e, new Exception(\"String_Node_Str\" + groupBy, e));\n } catch (InvocationTargetException e) {\n log.error(e, new Exception(\"String_Node_Str\" + groupBy, e));\n }\n }\n shift.add(new ResultTransformation(shiftNumber, shiftNumber));\n shift.setTagProcessResult(true);\n return shift;\n } else {\n log.warn(\"String_Node_Str\" + items + \"String_Node_Str\");\n tagContext.getSheetTransformationController().removeBodyRows(body);\n ResultTransformation shift = new ResultTransformation(0);\n shift.add(new ResultTransformation(-1, -body.getNumberOfRows()));\n shift.setLastProcessedRow(-1);\n shift.setTagProcessResult(true);\n return shift;\n }\n}\n"
|
"public void refresh() {\n TreeObject selectedObject = null;\n boolean isRoot = false;\n if (selection.getFirstElement() instanceof TreeObject) {\n selectedObject = (TreeObject) selection.getFirstElement();\n }\n if (selectedObject.getType() == TreeObject._SERVER_) {\n isRoot = true;\n }\n for (TreeObject obj : checkItems) {\n if (obj instanceof TreeParent) {\n repositoryNodes.addAll(Util.getChildrenObj((TreeParent) obj));\n } else {\n repositoryNodes.add(obj);\n }\n }\n if (isImport || !isRoot)\n ((CheckboxTreeViewer) viewer).setCheckedElements(repositoryNodes.toArray());\n}\n"
|
"public boolean match(Shadow shadow, World world) {\n if (super.match(shadow, world)) {\n IMessage message = new Message(msg, shadow.toString(), isError ? IMessage.ERROR : IMessage.WARNING, shadow.getSourceLocation(), null, new ISourceLocation[] { this.getSourceLocation() }, true, 0, -1, -1);\n world.getMessageHandler().handleMessage(message);\n if (world.xrefHandler != null) {\n world.xrefHandler.addCrossReference(this.getSourceLocation(), shadow.getSourceLocation(), (this.isError ? IRelationship.Kind.DECLARE_ERROR : IRelationship.Kind.DECLARE_WARNING), false);\n }\n if (world.getModel() != null) {\n AsmRelationshipProvider.checkerMunger(world.getModel(), shadow, this);\n }\n }\n return false;\n}\n"
|
"public void checkResourceLimit(Account account, ResourceType type, long... count) throws ResourceAllocationException {\n long numResources = ((count.length == 0) ? 1 : count[0]);\n Project project = null;\n if (_accountMgr.isAdmin(account.getType())) {\n return;\n }\n if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {\n project = _projectDao.findByProjectAccountId(account.getId());\n }\n Transaction txn = Transaction.currentTxn();\n txn.start();\n try {\n Set<Long> rowIdsToLock = _resourceCountDao.listAllRowsToUpdate(account.getId(), ResourceOwnerType.Account, type);\n SearchCriteria<ResourceCountVO> sc = ResourceCountSearch.create();\n sc.setParameters(\"String_Node_Str\", rowIdsToLock.toArray());\n _resourceCountDao.lockRows(sc, null, true);\n long accountLimit = findCorrectResourceLimitForAccount(account, type);\n long potentialCount = _resourceCountDao.getResourceCount(account.getId(), ResourceOwnerType.Account, type) + numResources;\n if (accountLimit != Resource.RESOURCE_UNLIMITED && potentialCount > accountLimit) {\n String message = \"String_Node_Str\" + type + \"String_Node_Str\" + account.getAccountName() + \"String_Node_Str\" + account.getDomainId() + \"String_Node_Str\";\n if (project != null) {\n message = \"String_Node_Str\" + type + \"String_Node_Str\" + project.getName() + \"String_Node_Str\" + account.getDomainId() + \"String_Node_Str\";\n }\n throw new ResourceAllocationException(message, type);\n }\n Long domainId = null;\n if (project != null) {\n domainId = project.getDomainId();\n } else {\n domainId = account.getDomainId();\n }\n while (domainId != null) {\n DomainVO domain = _domainDao.findById(domainId);\n ResourceLimitVO domainLimit = _resourceLimitDao.findByOwnerIdAndType(domainId, ResourceOwnerType.Domain, type);\n if (domainLimit != null) {\n long domainCount = _resourceCountDao.getResourceCount(domainId, ResourceOwnerType.Domain, type);\n if ((domainCount + numResources) > domainLimit.getMax().longValue()) {\n throw new ResourceAllocationException(\"String_Node_Str\" + type + \"String_Node_Str\" + domainId + \"String_Node_Str\", type);\n }\n }\n domainId = domain.getParent();\n }\n } finally {\n txn.commit();\n }\n}\n"
|
"private void lsAsync() {\n if (getCachedIcon() == null || getCachedIcon() == NOT_ACCESSIBLE_ICON) {\n setCachedIcon(FileIcons.getFileIcon(getProxiedFile()));\n }\n AbstractFile[] children = null;\n try {\n children = file.ls(cache.getFilter());\n } catch (Exception e) {\n e.printStackTrace();\n children = new AbstractFile[0];\n cachedIcon = IconManager.getIcon(IconManager.FILE_ICON_SET, CustomFileIconProvider.NOT_ACCESSIBLE_FILE);\n }\n Arrays.sort(children, cache.getSort());\n Icon[] icons = new Icon[children.length];\n for (int i = 0; i < children.length; i++) {\n icons[i] = FileIcons.getFileIcon(children[i]);\n }\n synchronized (cache) {\n for (int i = 0; i < children.length; i++) {\n CachedDirectory cachedChild = cache.getOrAdd(children[i]);\n cachedChild.setCachedIcon(icons[i]);\n }\n }\n final AbstractFile[] children2 = children;\n try {\n SwingUtilities.invokeAndWait(new Runnable() {\n public void run() {\n setLsCache(children2, file.getDate());\n }\n });\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n}\n"
|
"static Expression applyStreamingPrintDirectives(List<PrintDirectiveNode> directives, Expression appendable, BasicExpressionCompiler basic, JbcSrcPluginContext renderContext) {\n for (PrintDirectiveNode directive : Lists.reverse(directives)) {\n appendable = ((SoyJbcSrcPrintDirective.Streamable) directive.getPrintDirective()).applyForJbcSrcStreaming(renderContext, appendable, basic.compileToList(directive.getArgs()));\n }\n return appendable;\n}\n"
|
"private static void parseHeaders(LinkedHashMap map, String data) {\n for (String line : data.split(\"String_Node_Str\")) {\n String[] parts = line.split(\"String_Node_Str\", 2);\n if (parts.length == 2) {\n map.put(parts[0].trim(), parts[1].trim());\n }\n }\n}\n"
|
"protected TestResult checkSessionInvalidated(PortletRequest request) {\n TestResult result = new TestResult();\n result.setDescription(\"String_Node_Str\" + \"String_Node_Str\");\n result.setSpecPLT(\"String_Node_Str\");\n String maxInactiveIntervalSet = request.getParameter(MAX_INACTIVE_INTERVAL_SET);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + MAX_INACTIVE_INTERVAL_SET + \"String_Node_Str\" + maxInactiveIntervalSet);\n }\n if (Boolean.TRUE.toString().equals(maxInactiveIntervalSet)) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + System.currentTimeMillis() + \"String_Node_Str\");\n }\n PortletSession session = request.getPortletSession(false);\n if (session == null) {\n result.setReturnCode(TestResult.PASSED);\n } else {\n result.setReturnCode(TestResult.FAILED);\n result.setResultMessage(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n } else {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"String_Node_Str\" + \"String_Node_Str\" + System.currentTimeMillis() + \"String_Node_Str\");\n }\n PortletSession session = request.getPortletSession(true);\n session.setMaxInactiveInterval(5);\n result.setReturnCode(TestResult.WARNING);\n result.setResultMessage(\"String_Node_Str\");\n }\n return result;\n}\n"
|
"public boolean onTouch(View v, MotionEvent event) {\n float pos = event.getY();\n if (event.getAction() == 0)\n mLastYPos = pos;\n if (event.getAction() > 1) {\n int scrollThreshold = DisplayUtils.dpToPx(getActivity(), 2);\n if (((mLastYPos - pos) > scrollThreshold) || ((pos - mLastYPos) > scrollThreshold))\n mScrollDetected = true;\n }\n mLastYPos = pos;\n if (event.getAction() == MotionEvent.ACTION_UP) {\n if (mActivity != null && mActivity.getSupportActionBar().isShowing()) {\n setContentEditingModeVisible(true);\n return false;\n }\n }\n if (event.getAction() == MotionEvent.ACTION_UP && !mScrollDetected) {\n Layout layout = ((TextView) v).getLayout();\n int x = (int) event.getX();\n int y = (int) event.getY();\n x += v.getScrollX();\n y += v.getScrollY();\n if (layout != null) {\n int line = layout.getLineForVertical(y);\n int charPosition = layout.getOffsetForHorizontal(line, x);\n Spannable s = mContentEditText.getText();\n if (s == null)\n return false;\n WPImageSpan[] image_spans = s.getSpans(charPosition, charPosition, WPImageSpan.class);\n if (image_spans.length != 0) {\n final WPImageSpan span = image_spans[0];\n MediaFile mediaFile = span.getMediaFile();\n if (mediaFile == null)\n return false;\n if (!mediaFile.isVideo()) {\n LayoutInflater factory = LayoutInflater.from(getActivity());\n final View alertView = factory.inflate(R.layout.alert_image_options, null);\n if (alertView == null)\n return false;\n final EditText imageWidthText = (EditText) alertView.findViewById(R.id.imageWidthText);\n final EditText titleText = (EditText) alertView.findViewById(R.id.title);\n final EditText caption = (EditText) alertView.findViewById(R.id.caption);\n final CheckBox featuredCheckBox = (CheckBox) alertView.findViewById(R.id.featuredImage);\n final CheckBox featuredInPostCheckBox = (CheckBox) alertView.findViewById(R.id.featuredInPost);\n if (WordPress.getCurrentBlog().isFeaturedImageCapable()) {\n featuredCheckBox.setVisibility(View.VISIBLE);\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n }\n featuredCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n } else {\n featuredInPostCheckBox.setVisibility(View.GONE);\n }\n }\n });\n final SeekBar seekBar = (SeekBar) alertView.findViewById(R.id.imageWidth);\n final Spinner alignmentSpinner = (Spinner) alertView.findViewById(R.id.alignment_spinner);\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.alignment_array, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n alignmentSpinner.setAdapter(adapter);\n imageWidthText.setText(String.valueOf(mediaFile.getWidth()) + \"String_Node_Str\");\n seekBar.setProgress(mediaFile.getWidth());\n titleText.setText(mediaFile.getTitle());\n caption.setText(mediaFile.getCaption());\n featuredCheckBox.setChecked(mediaFile.isFeatured());\n if (mediaFile.isFeatured())\n featuredInPostCheckBox.setVisibility(View.VISIBLE);\n else\n featuredInPostCheckBox.setVisibility(View.GONE);\n featuredInPostCheckBox.setChecked(mediaFile.isFeaturedInPost());\n alignmentSpinner.setSelection(mediaFile.getHorizontalAlignment(), true);\n final int maxWidth = MediaUtils.getMinimumImageWidth(getActivity(), span.getImageSource());\n seekBar.setMax(maxWidth / 10);\n if (mediaFile.getWidth() != 0)\n seekBar.setProgress(mediaFile.getWidth() / 10);\n seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n public void onStopTrackingTouch(SeekBar seekBar) {\n }\n public void onStartTrackingTouch(SeekBar seekBar) {\n }\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n if (progress == 0)\n progress = 1;\n imageWidthText.setText(progress * 10 + \"String_Node_Str\");\n }\n });\n imageWidthText.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n public void onFocusChange(View v, boolean hasFocus) {\n if (hasFocus) {\n imageWidthText.setText(\"String_Node_Str\");\n }\n }\n });\n imageWidthText.setOnEditorActionListener(new TextView.OnEditorActionListener() {\n public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {\n int width = getEditTextIntegerClamped(imageWidthText, 10, maxWidth);\n seekBar.setProgress(width / 10);\n imageWidthText.setSelection((String.valueOf(width).length()));\n InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(imageWidthText.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);\n return true;\n }\n });\n AlertDialog ad = new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.image_settings)).setView(alertView).setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n String title = (titleText.getText() != null) ? titleText.getText().toString() : \"String_Node_Str\";\n MediaFile mediaFile = span.getMediaFile();\n if (mediaFile == null)\n return;\n mediaFile.setTitle(title);\n mediaFile.setHorizontalAlignment(alignmentSpinner.getSelectedItemPosition());\n mediaFile.setWidth(getEditTextIntegerClamped(imageWidthText, 10, maxWidth));\n String captionText = (caption.getText() != null) ? caption.getText().toString() : \"String_Node_Str\";\n mediaFile.setCaption(captionText);\n mediaFile.setFeatured(featuredCheckBox.isChecked());\n if (featuredCheckBox.isChecked()) {\n Spannable contentSpannable = mContentEditText.getText();\n WPImageSpan[] postImageSpans = contentSpannable.getSpans(0, contentSpannable.length(), WPImageSpan.class);\n if (postImageSpans.length > 1) {\n for (WPImageSpan postImageSpan : postImageSpans) {\n if (postImageSpan != span) {\n MediaFile postMediaFile = postImageSpan.getMediaFile();\n postMediaFile.setFeatured(false);\n postMediaFile.setFeaturedInPost(false);\n postMediaFile.save();\n }\n }\n }\n }\n mediaFile.setFeaturedInPost(featuredInPostCheckBox.isChecked());\n mediaFile.save();\n }\n }).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int whichButton) {\n dialog.dismiss();\n }\n }).create();\n ad.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);\n ad.show();\n mScrollDetected = false;\n return true;\n }\n } else {\n mContentEditText.setMovementMethod(ArrowKeyMovementMethod.getInstance());\n int selectionStart = mContentEditText.getSelectionStart();\n if (selectionStart >= 0 && mContentEditText.getSelectionEnd() >= selectionStart)\n mContentEditText.setSelection(selectionStart, mContentEditText.getSelectionEnd());\n }\n MediaGalleryImageSpan[] gallerySpans = s.getSpans(charPosition, charPosition, MediaGalleryImageSpan.class);\n if (gallerySpans.length > 0) {\n final MediaGalleryImageSpan gallerySpan = gallerySpans[0];\n startMediaGalleryActivity(gallerySpan.getMediaGallery());\n }\n }\n } else if (event.getAction() == 1) {\n mScrollDetected = false;\n }\n return false;\n}\n"
|
"private void startDragResizing(Rect initialBounds) {\n if (!mDragResizing) {\n mDragResizing = true;\n synchronized (mWindowCallbacks) {\n for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {\n mWindowCallbacks.get(i).onWindowDragResizeStart(initialBounds, fullscreen, systemInsets, stableInsets);\n }\n }\n mFullRedrawNeeded = true;\n }\n}\n"
|
"public T apply(U input) {\n return transformer.apply(ImmutableList.of(input));\n}\n"
|
"public int calculateSize() {\n int my_size = 0;\n my_size += object_data.calculateSize();\n return my_size;\n}\n"
|
"public static boolean implementsClass(ProcessingEnvironment processingEnvironment, String fqTn, TypeElement element) {\n TypeElement typeElement = processingEnvironment.getElementUtils().getTypeElement(fqTn);\n if (typeElement == null) {\n processingEnvironment.getMessager().printMessage(Diagnostic.Kind.ERROR, \"String_Node_Str\" + fqTn + \"String_Node_Str\" + \"String_Node_Str\");\n return false;\n } else {\n TypeMirror classMirror = typeElement.asType();\n return processingEnvironment.getTypeUtils().isAssignable(element.asType(), classMirror);\n }\n}\n"
|
"private boolean executeQuery(Indicator indicator, Connection connection, Expression query) throws AnalysisExecutionException {\n try {\n List<Object[]> myResultSet = executeQuery(catalogOrSchema, connection, query.getBody());\n indicator.storeSqlResults(myResultSet);\n } catch (SQLException e) {\n log.error(e, e);\n return false;\n }\n return true;\n}\n"
|
"public static void computePropertyMaxInformationLevel(Property property) {\n EList<Information> informations = property.getInformations();\n InformationLevel maxLevel = null;\n for (int i = 0; i < informations.size(); i++) {\n Information information = informations.get(i);\n if (i == 0) {\n maxLevel = information.getLevel();\n continue;\n }\n int value = information.getLevel().getValue();\n if (maxLevel == null || value > maxLevel.getValue()) {\n maxLevel = information.getLevel();\n }\n }\n if (maxLevel != null) {\n if (!maxLevel.equals(propertyMaxLevel)) {\n property.setMaxInformationLevel(maxLevel);\n isModified = true;\n }\n } else if (!InformationLevel.DEBUG_LITERAL.equals(propertyMaxLevel)) {\n property.setMaxInformationLevel(InformationLevel.DEBUG_LITERAL);\n }\n}\n"
|
"public Object[] getChildren(Object parent) {\n if (parent == null) {\n log.info(\"String_Node_Str\");\n return new Object[0];\n }\n return findChildren(parent);\n}\n"
|
"protected void match(JsonNode key, JsonNode value1, JsonNode value2, JsonCollector out) {\n JsonNode oldKeyPrimary = key;\n JsonNode oldKeyCurrent = ((ArrayNode) value2).get(0);\n BinarySparseMatrix current = (BinarySparseMatrix) ((ArrayNode) value2).get(1);\n if (oldKeyPrimary.equals(((ArrayNode) oldKeyCurrent).get(1))) {\n TransitiveClosure.warshall(current, (BinarySparseMatrix) value1, current);\n } else {\n TransitiveClosure.warshall((BinarySparseMatrix) value1, current, current);\n }\n out.collect(oldKeyCurrent, current);\n}\n"
|
"public PoolStatisticInfo getStatistics() {\n Long totalRmcHashrate = getHashRate();\n if (totalRmcHashrate == null) {\n totalRmcHashrate = 0L;\n Long yourRmcHashrate = getYourRmcHahrate(coluAccount.getAddress());\n if (yourRmcHashrate == null)\n yourRmcHashrate = 0L;\n return new PoolStatisticInfo(totalRmcHashrate, yourRmcHashrate);\n}\n"
|
"protected Control createDialogArea(Composite parent) {\n Composite container = (Composite) super.createDialogArea(parent);\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n GridData data = (GridData) container.getLayoutData();\n data.minimumHeight = 400;\n data.heightHint = 400;\n data.minimumWidth = 500;\n data.widthHint = 500;\n container.setLayoutData(data);\n createFilterField(container);\n Composite viewContainer = new Composite(container, SWT.BORDER);\n viewContainer.setLayout(new GridLayout());\n viewContainer.setLayoutData(new GridData(GridData.FILL_BOTH));\n RepositoryViewerProvider provider = new RepositoryViewerProvider() {\n protected IRepositoryNode getInputRoot(IProjectRepositoryNode projectRepoNode) {\n return typeProcessor.getInputRoot(projectRepoNode);\n }\n protected TreeViewer createTreeViewer(Composite parent, int style) {\n return new RepositoryTreeViewer(parent, style);\n }\n };\n repositoryTreeViewer = (RepositoryTreeViewer) provider.createViewer(viewContainer);\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n repositoryTreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));\n addFilter(textFilter);\n if (dbSupportFilter != null) {\n addFilter(dbSupportFilter);\n }\n if (additionalFilters != null) {\n addFilter(additionalFilters);\n }\n ViewerFilter filter = typeProcessor.makeFilter();\n if (!(ERepositoryObjectType.CONTEXT).equals(type)) {\n addFilter(filter);\n }\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n repositoryTreeViewer.expandAll();\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n selectNode();\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n repositoryTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {\n public void selectionChanged(SelectionChangedEvent event) {\n boolean highlightOKButton = isSelectionValid(event);\n getButton(IDialogConstants.OK_ID).setEnabled(highlightOKButton);\n }\n });\n repositoryTreeViewer.addDoubleClickListener(new IDoubleClickListener() {\n public void doubleClick(DoubleClickEvent event) {\n if (getButton(IDialogConstants.OK_ID).isEnabled()) {\n okPressed();\n }\n }\n });\n TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), \"String_Node_Str\");\n TimeMeasure.end(RepositoryReviewDialog.class.getSimpleName());\n TimeMeasure.display = false;\n TimeMeasure.displaySteps = false;\n TimeMeasure.measureActive = false;\n return container;\n}\n"
|
"public void repaintPick() {\n setDisplayListDirty(true);\n}\n"
|
"public boolean startElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Attributes atts) {\n try {\n XMLDescriptor xmlDescriptor = (XMLDescriptor) xmlCompositeCollectionMapping.getReferenceDescriptor();\n if (xmlDescriptor == null) {\n xmlDescriptor = findReferenceDescriptor(unmarshalRecord, atts, xmlCompositeCollectionMapping);\n }\n if (xmlCompositeCollectionMapping.getNullPolicy().valueIsNull(atts)) {\n getContainerPolicy().addInto(null, unmarshalRecord.getContainerInstance(this), unmarshalRecord.getSession());\n } else {\n XMLField xmlFld = (XMLField) this.xmlCompositeCollectionMapping.getField();\n if (xmlFld.hasLastXPathFragment()) {\n unmarshalRecord.setLeafElementType(xmlFld.getLastXPathFragment().getLeafElementType());\n }\n processChild(xPathFragment, unmarshalRecord, atts, xmlDescriptor);\n }\n processChild(xPathFragment, unmarshalRecord, atts, xmlDescriptor);\n } catch (SAXException e) {\n throw XMLMarshalException.unmarshalException(e);\n }\n return true;\n}\n"
|
"public void StartSync() {\n SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());\n if (mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING, null) == null)\n NewsReaderListActivity.StartLoginFragment((FragmentActivity) getActivity());\n else {\n try {\n if (!_ownCloudSyncService.isSyncRunning()) {\n new PostDelayHandler(getActivity()).stopRunningPostDelayHandler();\n Bundle accBundle = new Bundle();\n accBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\n AccountManager mAccountManager = AccountManager.get(getActivity());\n Account[] accounts = mAccountManager.getAccounts();\n for (Account acc : accounts) if (acc.type.equals(AccountGeneral.ACCOUNT_TYPE))\n ContentResolver.requestSync(acc, AccountGeneral.ACCOUNT_TYPE, accBundle);\n } else {\n ((NewsReaderListActivity) getActivity()).UpdateButtonLayout();\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n}\n"
|
"public void checkThrottleInterval() throws ClosedChannelException {\n final long time = System.currentTimeMillis();\n if (lastTime + throttleInterval >= time)\n return;\n lastTime = time;\n byteWritten = 0;\n for (SelectableChannel selectableChannel : channels) {\n Object attachment = null;\n try {\n final SelectionKey selectionKey = selectableChannel.keyFor(selector);\n if (selectionKey != null) {\n attachment = selectionKey.attachment();\n selectableChannel.register(selector, OP_WRITE, attachment);\n }\n } catch (IOException e) {\n if (LOG.isDebugEnabled())\n LOG.debug(\"String_Node_Str\", e);\n try {\n if (attachment != null)\n ((AbstractAttached) attachment).connector.connect();\n } catch (Exception e1) {\n LOG.error(\"String_Node_Str\", e);\n }\n }\n }\n}\n"
|
"public void execute(HierarchicalUndirectedGraph hgraph, AttributeModel attributeModel) {\n isCanceled = false;\n Progress.start(progress);\n Random rand = new Random();\n hgraph.readLock();\n structure = new Modularity.CommunityStructure(hgraph);\n double totalWeight = structure.graphWeightSum;\n double[] nodeDegrees = structure.weights.clone();\n if (isCanceled) {\n hgraph.readUnlockAll();\n return;\n }\n boolean someChange = true;\n while (someChange) {\n someChange = false;\n boolean localChange = true;\n while (localChange) {\n localChange = false;\n int start = 0;\n if (isRandomized) {\n start = Math.abs(rand.nextInt()) % structure.N;\n }\n int step = 0;\n for (int i = start; step < structure.N; i = (i + 1) % structure.N) {\n step++;\n double best = 0.;\n Community bestCommunity = null;\n Community nodecom = structure.nodeCommunities[i];\n Set<Community> iter = structure.nodeConnectionsWeight[i].keySet();\n for (Community com : iter) {\n double qValue = q(i, com);\n if (qValue > best) {\n best = qValue;\n bestCommunity = com;\n }\n }\n if ((structure.nodeCommunities[i] != bestCommunity) && (bestCommunity != null)) {\n structure.moveNodeTo(i, bestCommunity);\n localChange = true;\n }\n if (isCanceled) {\n hgraph.readUnlockAll();\n return;\n }\n }\n someChange = localChange || someChange;\n if (isCanceled) {\n hgraph.readUnlockAll();\n return;\n }\n }\n if (someChange) {\n structure.zoomOut();\n }\n }\n int[] comStructure = new int[hgraph.getNodeCount()];\n int count = 0;\n double[] degreeCount = new double[structure.communities.size()];\n for (Community com : structure.communities) {\n for (Integer node : com.nodes) {\n Community hidden = structure.invMap.get(node);\n for (Integer nodeInt : hidden.nodes) {\n comStructure[nodeInt] = count;\n }\n }\n count++;\n }\n for (Node node : hgraph.getNodes()) {\n int index = structure.map.get(node);\n if (useWeight) {\n degreeCount[comStructure[index]] += nodeDegrees[index];\n } else {\n degreeCount[comStructure[index]] += hgraph.getTotalDegree(node);\n }\n }\n modularity = finalQ(comStructure, degreeCount, hgraph, attributeModel, totalWeight);\n hgraph.readUnlock();\n}\n"
|
"public SignEncryptResult execute(SignEncryptParcel input) {\n OperationLog log = new OperationLog();\n log.add(LogType.MSG_SE, 0);\n ArrayDeque<Uri> inputUris = new ArrayDeque<>(input.getInputUris());\n ArrayDeque<Uri> outputUris = new ArrayDeque<>(input.getOutputUris());\n byte[] inputBytes = input.getBytes();\n byte[] outputBytes = null;\n ArrayList<PgpSignEncryptResult> results = new ArrayList<>();\n do {\n if (checkCancelled()) {\n log.add(LogType.MSG_OPERATION_CANCELLED, 0);\n return new SignEncryptResult(SignEncryptResult.RESULT_CANCELLED, log, results);\n }\n InputData inputData;\n {\n if (inputBytes != null) {\n log.add(LogType.MSG_SE_INPUT_BYTES, 1);\n InputStream is = new ByteArrayInputStream(inputBytes);\n inputData = new InputData(is, inputBytes.length);\n inputBytes = null;\n } else {\n if (inputUris.isEmpty()) {\n log.add(LogType.MSG_SE_ERROR_NO_INPUT, 1);\n return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);\n }\n log.add(LogType.MSG_SE_INPUT_URI, 1);\n Uri uri = inputUris.removeFirst();\n try {\n InputStream is = mContext.getContentResolver().openInputStream(uri);\n long fileSize = FileHelper.getFileSize(mContext, uri, 0);\n String filename = FileHelper.getFilename(mContext, uri);\n inputData = new InputData(is, fileSize, filename);\n } catch (FileNotFoundException e) {\n log.add(LogType.MSG_SE_ERROR_INPUT_URI_NOT_FOUND, 1);\n return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);\n }\n }\n }\n OutputStream outStream;\n {\n if (!outputUris.isEmpty()) {\n try {\n Uri outputUri = outputUris.removeFirst();\n outStream = mContext.getContentResolver().openOutputStream(outputUri);\n } catch (FileNotFoundException e) {\n log.add(LogType.MSG_SE_ERROR_OUTPUT_URI_NOT_FOUND, 1);\n return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);\n }\n } else {\n if (outputBytes != null) {\n log.add(LogType.MSG_SE_ERROR_TOO_MANY_INPUTS, 1);\n return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);\n }\n outStream = new ByteArrayOutputStream();\n }\n }\n PgpSignEncryptOperation op = new PgpSignEncryptOperation(mContext, mProviderHelper, new ProgressScaler(mProgressable, 100 * count / total, 100 * ++count / total, 100), mCancelled);\n PgpSignEncryptResult result = op.execute(input, inputData, outStream);\n results.add(result);\n log.add(result, 2);\n if (result.isPending()) {\n return new SignEncryptResult(SignEncryptResult.RESULT_PENDING, log, results);\n }\n if (!result.success()) {\n return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);\n }\n if (outStream instanceof ByteArrayOutputStream) {\n outputBytes = ((ByteArrayOutputStream) outStream).toByteArray();\n }\n } while (!inputUris.isEmpty());\n if (!outputUris.isEmpty()) {\n log.add(LogType.MSG_SE_WARN_OUTPUT_LEFT, 1);\n }\n log.add(LogType.MSG_SE_SUCCESS, 1);\n return new SignEncryptResult(SignEncryptResult.RESULT_OK, log, results, outputBytes);\n}\n"
|
"public Iterator<T> iterator(final int first, final int count) {\n final List<T> tasks = new ArrayList<T>();\n for (T task : (List<T>) restClient.listTasks(reference, (first / paginatorRows) + 1, paginatorRows)) {\n if (task instanceof SchedTaskTO && ((SchedTaskTO) task).getLastExec() == null && task.getExecutions() != null && !task.getExecutions().isEmpty()) {\n Collections.sort(task.getExecutions(), new Comparator<TaskExecTO>() {\n public int compare(final TaskExecTO left, final TaskExecTO right) {\n return left.getStartDate().compareTo(right.getStartDate());\n }\n });\n ((SchedTaskTO) task).setLastExec(task.getExecutions().get(task.getExecutions().size() - 1).getStartDate());\n }\n tasks.add(task);\n }\n Collections.sort(tasks, comparator);\n return tasks.iterator();\n}\n"
|
"private Object loadProperty(String stringValue) {\n Object boundValue = stringValue;\n try {\n boundValue = Long.parseLong(stringValue);\n } catch (NumberFormatException ex1) {\n try {\n boundValue = Double.parseDouble(stringValue);\n } catch (NumberFormatException ex2) {\n try {\n boundValue = Boolean.parseBoolean(stringValue);\n } catch (NumberFormatException ex3) {\n boundValue = stringValue;\n }\n }\n }\n return boundValue;\n}\n"
|
"public void testCreate() throws PersistenceException, CoreException, LoginException {\n repositoryFactory.logOnProject(sampleProject);\n Property property = PropertiesFactory.eINSTANCE.createProperty();\n property.setAuthor(sampleProject.getAuthor());\n property.setVersion(VersionUtils.DEFAULT_VERSION);\n property.setLabel(\"String_Node_Str\");\n property.setDisplayName(\"String_Node_Str\");\n property.setStatusCode(\"String_Node_Str\");\n property.setId(repositoryFactory.getNextId());\n ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();\n processItem.setProperty(property);\n ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();\n processItem.setProcess(process);\n assertNull(processItem.eResource());\n repositoryFactory.create(sampleProject, processItem, new Path(\"String_Node_Str\"), false);\n assertNotNull(processItem.eResource());\n IProject project = ResourceUtils.getProject(sampleProject.getTechnicalLabel());\n checkFileExists(project, ERepositoryObjectType.PROCESS, \"String_Node_Str\", \"String_Node_Str\", VersionUtils.DEFAULT_VERSION);\n repositoryFactory.deleteObjectPhysical(sampleProject, new RepositoryObject(property), false);\n checkFileNotExists(project, ERepositoryObjectType.PROCESS, \"String_Node_Str\", \"String_Node_Str\", VersionUtils.DEFAULT_VERSION);\n}\n"
|
"public Class<? extends InputFormat> getInputFormatClass() {\n return HiveStreamInputFormat.class;\n}\n"
|
"public void traverse() {\n FLASHPhaseConfiguration outerLoopConfiguration;\n if (config.isBinaryPhaseRequired()) {\n outerLoopConfiguration = config.getBinaryPhaseConfiguration();\n } else {\n outerLoopConfiguration = config.getLinearPhaseConfiguration();\n }\n checker.getHistory().setStorageStrategy(config.getSnapshotStorageStrategy());\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>(solutionSpace.getTop().getLevel() + 1, strategy);\n Transformation bottom = solutionSpace.getBottom();\n Transformation top = solutionSpace.getTop();\n TransformationResult result = checker.check(bottom);\n bottom.setProperty(solutionSpace.getPropertyForceSnapshot());\n bottom.setData(result);\n for (int level = bottom.getLevel(); level <= top.getLevel(); level++) {\n for (int id : getSortedUnprocessedNodes(level, outerLoopConfiguration.getTriggerSkip())) {\n Transformation transformation = solutionSpace.getTransformation(id);\n if (config.isBinaryPhaseRequired()) {\n binarySearch(transformation, queue);\n } else {\n linearSearch(transformation);\n }\n }\n }\n computeUtilityForMonotonicMetrics(bottom);\n computeUtilityForMonotonicMetrics(top);\n bottom.setData(null);\n if (potentiallyInsufficientUtility != null) {\n potentiallyInsufficientUtility.clear();\n }\n}\n"
|
"private void schedule() {\n if (scheduled.get()) {\n return;\n }\n if (!scheduled.compareAndSet(false, true)) {\n return;\n }\n ioSelector.addTaskAndWakeup(this);\n}\n"
|
"public String toXML() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"String_Node_Str\");\n sb.append(\"String_Node_Str\" + getName() + \"String_Node_Str\");\n sb.append(\"String_Node_Str\" + getAmountAs(getUnits()) + \"String_Node_Str\");\n sb.append(\"String_Node_Str\" + getUnits() + \"String_Node_Str\");\n sb.append(\"String_Node_Str\" + stage + \"String_Node_Str\");\n sb.append(\"String_Node_Str\" + time + \"String_Node_Str\");\n sb.append(\"String_Node_Str\" + SBStringUtils.subEntities(comments) + \"String_Node_Str\");\n sb.append(\"String_Node_Str\");\n return sb.toString();\n}\n"
|
"public void addPages() {\n if (isToolbar) {\n pathToSave = null;\n }\n propertiesWizardPage = new Step0WizardPage(connectionProperty, pathToSave, JSONRepositoryNodeType.JSON, !isRepositoryObjectEditable(), creation);\n jsonFileSelectPage = new JSONFileSelectWizardPage(creation, connectionItem, isRepositoryObjectEditable(), existingNames);\n setDefaultPageImageDescriptor(ImageProvider.getImageDesc(JSONImage.JSON_ICON32));\n if (connection != null) {\n List schemas = connection.getSchema();\n if (!schemas.isEmpty()) {\n JSONXPathLoopDescriptor currentSchema = (JSONXPathLoopDescriptor) schemas.get(0);\n oldAbstractQueryPath = currentSchema.getAbsoluteXPathQuery();\n }\n }\n if (creation) {\n setWindowTitle(\"String_Node_Str\");\n propertiesWizardPage.setTitle(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n propertiesWizardPage.setDescription(\"String_Node_Str\");\n addPage(propertiesWizardPage);\n propertiesWizardPage.setPageComplete(false);\n jsonFileSelectPage.setTitle(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n jsonFileSelectPage.setDescription(\"String_Node_Str\");\n addPage(jsonFileSelectPage);\n jsonFileSelectPage.setPageComplete(true);\n } else {\n setWindowTitle(\"String_Node_Str\");\n propertiesWizardPage.setTitle(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n propertiesWizardPage.setDescription(\"String_Node_Str\");\n addPage(propertiesWizardPage);\n jsonFileSelectPage.setTitle(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n jsonFileSelectPage.setDescription(\"String_Node_Str\");\n addPage(jsonFileSelectPage);\n jsonFileSelectPage.setPageComplete(true);\n }\n}\n"
|
"protected void getClusterData(Set<ClusterDataHolder> clusterData, Collection<Group> groups) {\n for (Group group : groups) {\n if (group.getClusterDataMap() != null && !group.getClusterDataMap().isEmpty()) {\n clusterData.addAll(group.getClusterDataMap().values());\n }\n if (group.getGroups() != null && !group.getGroups().isEmpty()) {\n getClusterData(clusterData, group.getGroups());\n }\n }\n}\n"
|
"protected void _updateInputTokenConsumptionRates(TypedCompositeActor actor) throws IllegalActionException {\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + \"String_Node_Str\" + actor.getFullName());\n Iterator refineInPorts = actor.inputPortList().iterator();\n ComponentEntity refineInPortContainer = (ComponentEntity) actor.getContainer();\n while (refineInPorts.hasNext()) {\n IOPort refineInPort = (IOPort) refineInPorts.next();\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + refineInPort.getFullName());\n Iterator inPortsOutside = refineInPort.deepConnectedInPortList().iterator();\n if (!inPortsOutside.hasNext()) {\n throw new IllegalActionException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n while (inPortsOutside.hasNext()) {\n IOPort inputPortOutside = (IOPort) inPortsOutside.next();\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + \"String_Node_Str\" + inputPortOutside.getFullName());\n ComponentEntity thisPortContainer = (ComponentEntity) inputPortOutside.getContainer();\n if (thisPortContainer.getFullName() == refineInPortContainer.getFullName()) {\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + \"String_Node_Str\" + inputPortOutside.getFullName());\n List listOfPorts = refineInPort.insidePortList();\n int refineInPortRate;\n if (listOfPorts.isEmpty()) {\n refineInPortRate = 0;\n } else {\n IOPort portWithRateInfo = (IOPort) listOfPorts.get(0);\n refineInPortRate = _getTokenConsumptionRate(portWithRateInfo);\n }\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + refineInPort.getFullName() + \"String_Node_Str\" + _getTokenConsumptionRate(refineInPort));\n if (_debug_info)\n System.out.println(getName() + \"String_Node_Str\" + refineInPortRate);\n _setTokenConsumptionRate(refineInPortContainer, inputPortOutside, refineInPortRate);\n }\n }\n }\n}\n"
|
"public void startDocument() throws SAXException {\n try {\n reset();\n if (writeXmlDecl) {\n String e = \"String_Node_Str\";\n if (encoding != null)\n e = \"String_Node_Str\" + encoding + '\\\"';\n writeXmlDecl(\"String_Node_Str\" + e + \"String_Node_Str\");\n }\n if (header != null)\n write(header);\n super.startDocument();\n } catch (IOException e) {\n throw new SAXException(e);\n }\n}\n"
|
"public String getValue() {\n String retVal = super.getValue();\n if (retVal == null && myHaveComponentParts) {\n if (isLocal() || isUrn()) {\n return myUnqualifiedId;\n }\n StringBuilder b = new StringBuilder();\n if (isNotBlank(myBaseUrl)) {\n b.append(myBaseUrl);\n if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') {\n b.append('/');\n }\n }\n if (isNotBlank(myResourceType)) {\n b.append(myResourceType);\n }\n if (b.length() > 0 && isNotBlank(myUnqualifiedId)) {\n b.append('/');\n }\n if (isNotBlank(myUnqualifiedId)) {\n b.append(myUnqualifiedId);\n } else if (isNotBlank(myUnqualifiedVersionId)) {\n b.append('/');\n }\n b.append(myUnqualifiedId);\n if (isNotBlank(myUnqualifiedVersionId)) {\n b.append('/');\n b.append(\"String_Node_Str\");\n b.append('/');\n b.append(myUnqualifiedVersionId);\n }\n retVal = b.toString();\n super.setValue(retVal);\n }\n return retVal;\n}\n"
|
"public boolean equals(IssueRelationship that) {\n if (type != that.type) {\n return false;\n }\n if (owner != null ? !owner.equals(that.owner) : that.owner != null) {\n return false;\n }\n if (!related.equals(that.related)) {\n return false;\n }\n return true;\n}\n"
|
"public void drop(DropTargetEvent event) {\n DropTarget dropTarget = (DropTarget) event.getSource();\n Control control = dropTarget.getControl();\n XmlToSchemaDraggedData draggedData = XPathTransfer.getInstance().getDraggedData();\n List<TransferableXPathEntry> transferableEntryList = draggedData.getTransferableEntryList();\n ExtractionLoopWithXPathEditorView loopTableEditorView = linker.getLoopTableEditorView();\n if (loopTableEditorView.isReadOnly()) {\n return;\n }\n ExtendedTableModel<XmlXPathLoopDescriptor> extendedTableModel = loopTableEditorView.getExtendedTableModel();\n XmlXPathLoopDescriptor pathLoopDescriptor = extendedTableModel.getBeansList().get(0);\n if (linker.isLoopTable((Table) control)) {\n if (transferableEntryList.size() > 0) {\n String absoluteXPath = transferableEntryList.get(0).getAbsoluteXPath();\n TableViewerCreatorColumn xpathColumn = linker.getLoopTableEditorView().getXPathColumn();\n Display display = linker.getTree().getDisplay();\n Cursor cursor = new Cursor(display, SWT.CURSOR_WAIT);\n linker.getTree().getShell().setCursor(cursor);\n loopTableEditorView.getTableViewerCreator().setBeanValue(xpathColumn, pathLoopDescriptor, absoluteXPath, true);\n linker.getTree().getShell().setCursor(null);\n }\n } else {\n ExtractionFieldsWithXPathEditorView tableEditorView = linker.getFieldsTableEditorView();\n Integer startInsertAtThisIndex = TableUtils.getItemIndexWhereInsertFromPosition(fieldsTable, new Point(event.x, event.y));\n List<SchemaTarget> list = new ArrayList<SchemaTarget>(transferableEntryList.size());\n for (TransferableXPathEntry entry : transferableEntryList) {\n ArrayList<String> loopXpathNodes = linker.getLoopXpathNodes();\n if (loopXpathNodes.size() > 0) {\n String loopPath = loopXpathNodes.get(0);\n String relativeXPath = XPathPopulationUtil.populateColumnPath(loopPath, entry.getAbsoluteXPath());\n if (relativeXPath.startsWith(\"String_Node_Str\")) {\n relativeXPath = relativeXPath.substring(1);\n }\n if (relativeXPath.endsWith(\"String_Node_Str\")) {\n relativeXPath = relativeXPath.substring(0, relativeXPath.length() - 1);\n }\n if (relativeXPath.trim().equals(\"String_Node_Str\")) {\n relativeXPath = \"String_Node_Str\";\n }\n SchemaTarget newTargetEntry = linker.getNewSchemaTargetEntry(relativeXPath);\n String name = extractColumnName(extractTagName(relativeXPath), fullSchemaTargetList);\n newTargetEntry.setTagName(name);\n list.add(newTargetEntry);\n }\n }\n tableEditorView.getTableViewerCreator().getTableViewer().refresh();\n loopTable.deselectAll();\n fieldsTable.deselectAll();\n linker.getTree().deselectAll();\n if (list.size() > 0) {\n ExtendedTableAddCommand addCommand = new ExtendedTableAddCommand(tableEditorView.getModel(), list, startInsertAtThisIndex);\n tableEditorView.getExtendedTableViewer().executeCommand(addCommand);\n }\n }\n linker.updateLinksStyleAndControlsSelection(control, true);\n}\n"
|
"public void fire() throws IllegalActionException {\n super.fire();\n double currentTime = getDirector().getCurrentTime();\n double periodValue = ((DoubleToken) period.getToken()).doubleValue();\n _tentativeCycleStartTime = _cycleStartTime;\n _tentativeCurrentValue = _currentValue;\n _tentativePhase = _phase;\n _tentativeNextFiringTime = -1.0;\n while (_tentativeCycleStartTime + prd <= currentTime) {\n _tentativeCycleStartTime += prd;\n }\n double[][] offsts = ((DoubleMatrixToken) offsets.getToken()).doubleMatrix();\n ArrayToken val = (ArrayToken) (values.getToken());\n if (offsts[0].length != val.length()) {\n throw new IllegalActionException(this, \"String_Node_Str\");\n }\n while (currentTime >= _tentativeCycleStartTime + offsts[0][_tentativePhase]) {\n _tentativeCurrentValue = _getValue(_tentativePhase);\n _tentativePhase++;\n if (_tentativePhase >= offsts[0].length) {\n _tentativePhase = 0;\n _tentativeCycleStartTime += prd;\n }\n if (offsts[0][_tentativePhase] >= prd) {\n throw new IllegalActionException(this, \"String_Node_Str\" + _tentativePhase + \"String_Node_Str\" + offsts[0][_tentativePhase] + \"String_Node_Str\" + \"String_Node_Str\" + prd);\n }\n _tentativeNextFiringTime = _tentativeCycleStartTime + offsts[0][_tentativePhase];\n }\n output.send(0, _tentativeCurrentValue);\n}\n"
|
"public boolean equals(Object o) {\n if (this == o)\n return true;\n if (o == null || getClass() != o.getClass())\n return false;\n Bean bean = (Bean) o;\n return $.eq(foo, bean.foo) && $.eq(C.Map(map), C.Map(bean.map));\n}\n"
|
"public void widgetSelected(SelectionEvent event) {\n updateStructureHandle();\n OdaDataSetParameterHandle dataSetParameterHandle = (OdaDataSetParameterHandle) structureHandle;\n String originalParamName = dataSetParameterHandle.getParamName();\n ParameterDialog dialog = null;\n ParameterHandle handle = ParameterPageUtil.getScalarParameter(linkToSalarParameter.getText(), false);\n boolean isCreateMode = true;\n if (handle == null) {\n handle = (ScalarParameterHandle) ElementProcessorFactory.createProcessor(\"String_Node_Str\").createElement(null);\n dialog = new ParameterDialog(ParameterInputDialog.this.getParentShell(), Messages.getString(\"String_Node_Str\"), false);\n if (dataSetParameterHandle != null) {\n executeLinkedReportParameterUpdate(handle, dataSetParameterHandle);\n }\n isCreateMode = true;\n } else {\n dialog = new ParameterDialog(ParameterInputDialog.this.getParentShell(), Messages.getString(\"String_Node_Str\"), false);\n isCreateMode = false;\n }\n ScalarParameterListener scalarParameterListener = new ScalarParameterListener();\n handle.addListener(scalarParameterListener);\n dialog.setInput(handle);\n if (dialog.open() == OK) {\n if (dialog.getResult() instanceof ParameterHandle) {\n ParameterHandle paramerHandle = (ParameterHandle) dialog.getResult();\n if (isCreateMode) {\n SlotHandle parameterSlotHandle = Utility.getReportModuleHandle().getParameters();\n try {\n parameterSlotHandle.add(paramerHandle);\n linkToSalarParameter.add(paramerHandle.getQualifiedName());\n } catch (ContentException e) {\n ExceptionHandler.handle(e);\n } catch (NameException e) {\n ExceptionHandler.handle(e);\n }\n }\n linkToSalarParameter.setItems(ParameterPageUtil.getLinkedReportParameterNames((OdaDataSetParameterHandle) structureHandle));\n originalLinkToParamName = paramerHandle.getQualifiedName();\n linkToSalarParameter.select(Utility.findIndex(linkToSalarParameter.getItems(), paramerHandle.getQualifiedName()));\n }\n } else {\n dataSetParameterHandle.setParamName(originalParamName);\n }\n}\n"
|
"private void tryNotifyTimeSet() {\n if (mTimeSetCallback != null && !mIsCanceled) {\n mTimePicker.clearFocus();\n mTimeSetCallback.onTimeSet(mTimePicker, mTimePicker.getCurrentHour(), mTimePicker.getCurrentMinute());\n }\n}\n"
|
"private void callListener(ListenerItem listenerItem, EntryEvent event) {\n Object listener = listenerItem.listener;\n EntryEventType entryEventType = event.getEventType();\n if (listenerItem.instanceType == Instance.InstanceType.MAP) {\n if (!listenerItem.name.startsWith(\"String_Node_Str\")) {\n Object proxy = node.factory.getOrCreateProxyByName(listenerItem.name);\n if (proxy instanceof MProxy) {\n MProxy mProxy = (MProxy) proxy;\n mProxy.getMapOperationStats().incrementReceivedEvents();\n }\n }\n }\n switch(listenerItem.instanceType) {\n case MAP:\n case MULTIMAP:\n EntryListener entryListener = (EntryListener) listener;\n switch(entryEventType) {\n case ADDED:\n entryListener.entryAdded(event2);\n break;\n case REMOVED:\n entryListener.entryRemoved(event);\n break;\n case UPDATED:\n entryListener.entryUpdated(event);\n break;\n case EVICTED:\n entryListener.entryEvicted(event);\n break;\n }\n break;\n case SET:\n case LIST:\n ItemListener itemListener = (ItemListener) listener;\n switch(entryEventType) {\n case ADDED:\n itemListener.itemAdded(event.getKey());\n break;\n case REMOVED:\n itemListener.itemRemoved(event.getKey());\n break;\n }\n break;\n case TOPIC:\n MessageListener messageListener = (MessageListener) listener;\n messageListener.onMessage(event.getValue());\n break;\n case QUEUE:\n ItemListener queueItemListener = (ItemListener) listener;\n switch(entryEventType) {\n case ADDED:\n queueItemListener.itemAdded(event.getValue());\n break;\n case REMOVED:\n queueItemListener.itemRemoved(event.getValue());\n break;\n }\n break;\n }\n}\n"
|
"public DeploymentDescriptorFile getGFConfigurationDDFile() {\n if (gfEjbRuntimeDD == null) {\n gfEjbRuntimeDD = new GFEjbRuntimeDDFile();\n }\n return gfEjbRuntimeDD;\n}\n"
|
"public int getColumnIndex(Object dataset, Comparable key) {\n if (isTOPChartInstalled()) {\n return chartService.getColumnIndex(dataset, key);\n }\n return Integer.MIN_VALUE;\n}\n"
|
"protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) {\n textRect.x = textRect.y = iconRect.x = iconRect.y = 0;\n View v = getTextViewForTab(tabIndex);\n if (v != null) {\n tabPane.putClientProperty(\"String_Node_Str\", v);\n }\n SwingUtilities.layoutCompoundLabel((JComponent) tabPane, metrics, title, icon, SwingUtilities.CENTER, SwingUtilities.LEFT, SwingUtilities.CENTER, SwingUtilities.CENTER, tabRect, iconRect, textRect, 0);\n tabPane.putClientProperty(\"String_Node_Str\", null);\n if (icon != null) {\n iconRect.y = iconRect.y + 2;\n iconRect.x = tabRect.x + 7;\n }\n textRect.y = textRect.y + 2;\n textRect.x = iconRect.x + iconRect.width + 5;\n}\n"
|
"public int compareTo(Object other) {\n int result = other != null ? -1 : 1;\n if (other instanceof IAtsUser) {\n String otherName = ((IAtsUser) other).getName();\n String thisName = getName();\n if (thisName == null && otherName == null) {\n result = 0;\n } else if (thisName != null && otherName == null) {\n result = 1;\n } else if (thisName != null && otherName != null) {\n result = thisName.compareTo(otherName);\n }\n }\n return -1;\n}\n"
|
"private void commit() {\n Logs.exhaust().trace(\"String_Node_Str\" + this.currentTransition.get());\n if (!this.state.isMarked()) {\n IllegalStateException ex = Exceptions.trace(new IllegalStateException(\"String_Node_Str\" + this.toString()));\n LOG.error(ex, ex);\n throw ex;\n } else {\n ActiveTransition tr = this.currentTransition.getAndSet(null);\n this.state.set(tr.getTransitionRule().getToState(), tr.getTransitionRule().getToStateMark());\n if (!tr.getTransitionRule().getFromState().equals(tr.getTransitionRule().getToState())) {\n this.state.set(tr.getTransitionRule().getToState(), false);\n this.fireInListeners(tr.getTransitionRule().getToState());\n } else {\n this.state.set(tr.getTransitionRule().getToState(), false);\n }\n EventRecord.caller(this.getClass(), EventType.TRANSITION_FUTURE, \"String_Node_Str\" + this.parent.toString() + \"String_Node_Str\" + this.parent.getClass().getCanonicalName() + \"String_Node_Str\").trace();\n tr.getTransitionFuture().set(this.parent);\n }\n}\n"
|
"private void prepareLevels(QueryDefinition query, TabularHierarchyHandle hierHandle, List metaList, String dimName) throws BirtException {\n try {\n List levels = hierHandle.getContents(TabularHierarchyHandle.LEVELS_PROP);\n for (int j = 0; j < levels.size(); j++) {\n TabularLevelHandle level = (TabularLevelHandle) levels.get(j);\n DataSetIterator.ColumnMeta temp = null;\n String exprString = ExpressionUtil.createJSDataSetRowExpression(level.getColumnName());\n int type = DataAdapterUtil.adaptModelDataType(level.getDataType());\n if (type == DataType.UNKNOWN_TYPE || type == DataType.ANY_TYPE)\n type = DataType.STRING_TYPE;\n if (level.getDateTimeLevelType() != null) {\n temp = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, level.getName()), new DataSetIterator.DataProcessorWrapper(GroupCalculatorFactory.getGroupCalculator(IGroupDefinition.NUMERIC_INTERVAL, DataType.INTEGER_TYPE, String.valueOf(DataSetIterator.getDefaultStartValue(level.getDateTimeLevelType(), level.getIntervalBase())), level.getIntervalRange(), sessionContext.getDataEngineContext().getLocale(), sessionContext.getDataEngineContext().getTimeZone())), DataSetIterator.ColumnMeta.LEVEL_KEY_TYPE);\n temp.setDataType(DataType.INTEGER_TYPE);\n exprString = DataSetIterator.createDateTransformerExpr(level.getDateTimeLevelType(), exprString);\n } else {\n IDataProcessor processor = null;\n if (DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals(level.getLevelType())) {\n int interval = GroupAdapter.intervalFromModel(level.getInterval());\n if (interval != IGroupDefinition.NO_INTERVAL)\n processor = new DataSetIterator.DataProcessorWrapper(GroupCalculatorFactory.getGroupCalculator(interval, type, level.getIntervalBase(), level.getIntervalRange(), sessionContext.getDataEngineContext().getLocale(), sessionContext.getDataEngineContext().getTimeZone()));\n } else if (DesignChoiceConstants.LEVEL_TYPE_MIRRORED.equals(level.getLevelType())) {\n Iterator it = level.staticValuesIterator();\n List dispExpr = new ArrayList();\n List filterExpr = new ArrayList();\n while (it.hasNext()) {\n RuleHandle o = (RuleHandle) it.next();\n dispExpr.add(o.getDisplayExpression());\n filterExpr.add(o.getRuleExpression());\n }\n exprString = \"String_Node_Str\";\n if (level.getDefaultValue() != null) {\n exprString += \"String_Node_Str\" + JavascriptEvalUtil.transformToJsConstants(level.getDefaultValue()) + \"String_Node_Str\";\n }\n for (int i = 0; i < dispExpr.size(); i++) {\n String disp = \"String_Node_Str\" + JavascriptEvalUtil.transformToJsConstants(String.valueOf(dispExpr.get(i))) + \"String_Node_Str\";\n String filter = String.valueOf(filterExpr.get(i));\n exprString += \"String_Node_Str\" + filter + \"String_Node_Str\" + disp + \"String_Node_Str\";\n }\n }\n temp = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, level.getName()), processor, DataSetIterator.ColumnMeta.LEVEL_KEY_TYPE);\n temp.setDataType(type);\n }\n metaList.add(temp);\n Iterator it = level.attributesIterator();\n while (it.hasNext()) {\n LevelAttributeHandle levelAttr = (LevelAttributeHandle) it.next();\n IDataProcessor processor = null;\n String bindingExpr = null;\n if (level.getDateTimeLevelType() != null && DataSetIterator.DATE_TIME_ATTR_NAME.equals(levelAttr.getName())) {\n processor = new DataSetIterator.DateTimeAttributeProcessor(level.getDateTimeLevelType(), this.sessionContext.getDataEngineContext().getLocale(), sessionContext.getDataEngineContext().getTimeZone());\n bindingExpr = ExpressionUtil.createJSDataSetRowExpression(level.getColumnName());\n } else {\n bindingExpr = ExpressionUtil.createJSDataSetRowExpression(levelAttr.getName());\n }\n DataSetIterator.ColumnMeta meta = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, OlapExpressionUtil.getAttributeColumnName(level.getName(), levelAttr.getName())), processor, DataSetIterator.ColumnMeta.UNKNOWN_TYPE);\n meta.setDataType(DataAdapterUtil.adaptModelDataType(levelAttr.getDataType()));\n metaList.add(meta);\n query.addBinding(new Binding(meta.getName(), new ScriptExpression(bindingExpr)));\n }\n if (DesignChoiceConstants.LEVEL_TYPE_DYNAMIC.equals(level.getLevelType()) && level.getDisplayColumnName() != null) {\n DataSetIterator.ColumnMeta meta = new DataSetIterator.ColumnMeta(DataSetIterator.createLevelName(dimName, OlapExpressionUtil.getDisplayColumnName(level.getName())), null, DataSetIterator.ColumnMeta.UNKNOWN_TYPE);\n meta.setDataType(DataType.STRING_TYPE);\n metaList.add(meta);\n ExpressionHandle displayExprHandle = level.getExpressionProperty(ITabularLevelModel.DISPLAY_COLUMN_NAME_PROP);\n if (displayExprHandle != null) {\n query.addBinding(new Binding(meta.getName(), modelAdaptor.adaptJSExpression(displayExprHandle.getStringExpression(), displayExprHandle.getType())));\n }\n }\n String levelName = DataSetIterator.createLevelName(dimName, level.getName());\n query.addBinding(new Binding(levelName, new ScriptExpression(exprString, type)));\n GroupDefinition gd = new GroupDefinition(String.valueOf(query.getGroups().size()));\n gd.setKeyExpression(ExpressionUtil.createJSRowExpression(levelName));\n if (level.getLevelType() != null && level.getDateTimeLevelType() == null) {\n gd.setIntervalRange(level.getIntervalRange());\n gd.setIntervalStart(level.getIntervalBase());\n gd.setInterval(GroupAdapter.intervalFromModel(level.getInterval()));\n }\n if (level.getDateTimeLevelType() != null) {\n gd.setIntervalRange(level.getIntervalRange() == 0 ? 1 : level.getIntervalRange());\n gd.setIntervalStart(String.valueOf(DataSetIterator.getDefaultStartValue(level.getDateTimeLevelType(), level.getIntervalBase())));\n gd.setInterval(IGroupDefinition.NUMERIC_INTERVAL);\n }\n query.addGroup(gd);\n }\n } catch (DataException e) {\n throw new AdapterException(e.getLocalizedMessage(), e);\n }\n}\n"
|
"public void saveSession(String name) throws OpcontrolException {\n SessionManager sessMan;\n try {\n sessMan = new SessionManager(SessionManager.SESSION_LOCATION);\n for (String event : sessMan.getSessionEvents(SessionManager.CURRENT)) {\n sessMan.addSession(name, event);\n String oldFile = SessionManager.OPXML_PREFIX + SessionManager.MODEL_DATA + event + SessionManager.CURRENT;\n String newFile = SessionManager.OPXML_PREFIX + SessionManager.MODEL_DATA + event + name;\n Process p = Runtime.getRuntime().exec(\"String_Node_Str\" + oldFile + \"String_Node_Str\" + newFile);\n p.waitFor();\n }\n sessMan.write();\n } catch (FileNotFoundException e) {\n } catch (IOException | InterruptedException e) {\n e.printStackTrace();\n }\n}\n"
|
"public void lights() {\n enableLights();\n int colorModeSaved = colorMode;\n colorMode = RGB;\n lightFalloff(1, 0, 0);\n lightSpecular(0, 0, 0);\n ambientLight(colorModeX * 0.5f, colorModeY * 0.5f, colorModeZ * 0.5f);\n directionalLight(colorModeX * 0.5f, colorModeY * 0.5f, colorModeZ * 0.5f, 0, 0, -1);\n colorMode = colorModeSaved;\n}\n"
|
"public IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule) {\n IpForwardingRuleResponse response = new IpForwardingRuleResponse();\n response.setId(fwRule.getUuid());\n response.setProtocol(fwRule.getProtocol());\n IpAddress ip = ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());\n response.setPublicIpAddressId(ip.getId());\n response.setPublicIpAddress(ip.getAddress().addr());\n if (ip != null && fwRule.getDestIpAddress() != null) {\n UserVm vm = ApiDBUtils.findUserVmById(ip.getAssociatedWithVmId());\n if (vm != null) {\n response.setVirtualMachineId(vm.getUuid());\n response.setVirtualMachineName(vm.getHostName());\n if (vm.getDisplayName() != null) {\n response.setVirtualMachineDisplayName(vm.getDisplayName());\n } else {\n response.setVirtualMachineDisplayName(vm.getHostName());\n }\n }\n }\n FirewallRule.State state = fwRule.getState();\n String stateToSet = state.toString();\n if (state.equals(FirewallRule.State.Revoke)) {\n stateToSet = \"String_Node_Str\";\n }\n response.setStartPort(fwRule.getSourcePortStart());\n response.setEndPort(fwRule.getSourcePortEnd());\n response.setProtocol(fwRule.getProtocol());\n response.setState(stateToSet);\n response.setObjectName(\"String_Node_Str\");\n return response;\n}\n"
|
"public PrivateGateway applyVpcPrivateGateway(long gatewayId, boolean destroyOnFailure) throws ConcurrentOperationException, ResourceUnavailableException {\n VpcGatewayVO vo = _vpcGatewayDao.findById(gatewayId);\n boolean success = true;\n try {\n PrivateGateway gateway = getVpcPrivateGateway(gatewayId);\n for (VpcProvider provider : getVpcElements()) {\n if (providersToImplement.contains(provider.getProvider())) {\n if (!provider.createPrivateGateway(gateway)) {\n success = false;\n }\n }\n }\n if (success) {\n s_logger.debug(\"String_Node_Str\" + gateway + \"String_Node_Str\");\n if (vo.getState() != VpcGateway.State.Ready) {\n vo.setState(VpcGateway.State.Ready);\n _vpcGatewayDao.update(vo.getId(), vo);\n s_logger.debug(\"String_Node_Str\" + gateway + \"String_Node_Str\" + VpcGateway.State.Ready);\n }\n return getVpcPrivateGateway(gatewayId);\n } else {\n s_logger.warn(\"String_Node_Str\" + gateway + \"String_Node_Str\");\n return null;\n }\n } finally {\n if (!success) {\n if (destroyOnFailure) {\n s_logger.debug(\"String_Node_Str\" + vo + \"String_Node_Str\");\n if (deletePrivateGatewayFromTheDB(getVpcPrivateGateway(gatewayId))) {\n s_logger.warn(\"String_Node_Str\" + vo + \"String_Node_Str\");\n } else {\n s_logger.warn(\"String_Node_Str\" + vo + \"String_Node_Str\");\n }\n }\n }\n }\n}\n"
|
"public void readRow(XMLStreamReader reader, AbstractAttributeModel model, AttributeTableImpl table, AttributeRowImpl row) throws XMLStreamException {\n row.setRowVersion(Integer.parseInt(reader.getAttributeValue(null, \"String_Node_Str\")));\n AttributeColumnImpl col = null;\n String value = \"String_Node_Str\";\n boolean end = false;\n while (reader.hasNext() && !end) {\n int t = reader.next();\n switch(t) {\n case XMLStreamReader.START_ELEMENT:\n String name = reader.getLocalName();\n if (ELEMENT_VALUE.equalsIgnoreCase(name)) {\n col = (AttributeColumnImpl) table.getColumn(Integer.parseInt(reader.getAttributeValue(null, \"String_Node_Str\")));\n }\n break;\n case XMLStreamReader.CHARACTERS:\n if (!reader.isWhiteSpace() && col != null) {\n value += reader.getText();\n }\n break;\n case XMLStreamReader.END_ELEMENT:\n if (ELEMENT_NODE_ROW.equalsIgnoreCase(reader.getLocalName()) || ELEMENT_EDGE_ROW.equalsIgnoreCase(reader.getLocalName())) {\n end = true;\n }\n if (!value.isEmpty() && col != null) {\n AttributeType type = col.getType();\n Object v = type.parse(value);\n v = model.getManagedValue(v, type);\n row.setValue(col, v);\n }\n value = \"String_Node_Str\";\n col = null;\n break;\n }\n }\n}\n"
|
"private void createNewLineWithJavaUDI() {\n EList<TaggedValue> tvs = definition.getTaggedValue();\n String classNameStr = null;\n String jarPathStr = \"String_Node_Str\";\n for (TaggedValue tv : tvs) {\n if (tv.getTag().equals(PluginConstant.CLASS_NAME_TEXT)) {\n classNameStr = tv.getValue();\n continue;\n }\n if (tv.getTag().equals(PluginConstant.JAR_FILE_PATH)) {\n jarPathStr = tv.getValue();\n }\n }\n if (classNameStr == null) {\n return;\n }\n final Composite lineComp = new Composite(expressionComp, SWT.NONE);\n lineComp.setLayout(new GridLayout(2, false));\n final CCombo combo = new CCombo(lineComp, SWT.BORDER);\n combo.setLayoutData(new GridData());\n ((GridData) combo.getLayoutData()).widthHint = 150;\n combo.setEditable(false);\n combo.setItems(allDBTypeList.toArray(new String[allDBTypeList.size()]));\n combo.setText(PatternLanguageType.JAVA.getName());\n combo.addSelectionListener(new LangCombSelectionListener());\n tempExpressionMap.put(combo, BooleanExpressionHelper.createExpression(combo.getText(), null));\n final Composite detailComp = new Composite(combo.getParent(), SWT.NONE);\n widgetMap.put(combo, detailComp);\n detailComp.setLayout(new GridLayout(4, false));\n Text classNameText = new Text(detailComp, SWT.BORDER);\n classNameText.setLayoutData(new GridData(GridData.FILL_BOTH));\n ((GridData) classNameText.getLayoutData()).widthHint = 250;\n classNameText.setText(classNameStr);\n classNameText.addModifyListener(new NeedToSetDirtyListener());\n final Text jarPathText = new Text(detailComp, SWT.BORDER);\n jarPathText.setLayoutData(new GridData(GridData.FILL_BOTH));\n ((GridData) jarPathText.getLayoutData()).widthHint = 350;\n jarPathText.setText(jarPathStr);\n jarPathText.addModifyListener(new NeedToSetDirtyListener());\n Button button = new Button(detailComp, SWT.PUSH);\n button.setText(\"String_Node_Str\");\n button.addSelectionListener(new SelectionAdapter() {\n public void widgetSelected(SelectionEvent e) {\n FileDialog dialog = new FileDialog(combo.getParent().getShell(), SWT.NONE);\n dialog.setFilterExtensions(new String[] { \"String_Node_Str\" });\n String path = dialog.open();\n if (path != null) {\n jarPathText.setText(path);\n }\n }\n });\n combo.setData(PluginConstant.CLASS_NAME_TEXT, classNameText);\n combo.setData(PluginConstant.JAR_FILE_PATH, jarPathText);\n createExpressionDelButton(detailComp, combo);\n GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(detailComp);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.