idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
24,000 | protected void doProcessQueuedOps ( PersistentCollection collection , Serializable key , int nextIndex , SharedSessionContractImplementor session ) throws HibernateException { } | once we re on ORM 5 |
24,001 | public boolean isIdProperty ( OgmEntityPersister persister , List < String > namesWithoutAlias ) { String join = StringHelper . join ( namesWithoutAlias , "." ) ; Type propertyType = persister . getPropertyType ( namesWithoutAlias . get ( 0 ) ) ; String [ ] identifierColumnNames = persister . getIdentifierColumnNames (... | Check if the property is part of the identifier of the entity . |
24,002 | public void deploySchema ( String generatedProtobufName , RemoteCache < String , String > protobufCache , SchemaCapture schemaCapture , SchemaOverride schemaOverrideService , URL schemaOverrideResource ) { if ( schemaOverrideService != null || schemaOverrideResource != null ) { cachedSchema = new SchemaValidator ( this... | Typically this is transparently handled by using the Protostream codecs but be aware of it when bypassing Protostream . |
24,003 | public static void archiveFile ( final ArchiveOutputStream out , final VirtualFileDescriptor source , final long fileSize ) throws IOException { if ( ! source . hasContent ( ) ) { throw new IllegalArgumentException ( "Provided source is not a file: " + source . getPath ( ) ) ; } if ( out instanceof TarArchiveOutputStre... | Adds the file to the tar archive represented by output stream . It s caller s responsibility to close output stream properly . |
24,004 | void setRightChild ( final byte b , final MutableNode child ) { final ChildReference right = children . getRight ( ) ; if ( right == null || ( right . firstByte & 0xff ) != ( b & 0xff ) ) { throw new IllegalArgumentException ( ) ; } children . setAt ( children . size ( ) - 1 , new ChildReferenceMutable ( b , child ) ) ... | Sets in - place the right child with the same first byte . |
24,005 | public boolean needMerge ( final BasePage left , final BasePage right ) { final int leftSize = left . getSize ( ) ; final int rightSize = right . getSize ( ) ; return leftSize == 0 || rightSize == 0 || leftSize + rightSize <= ( ( ( isDupTree ( left ) ? getDupPageMaxSize ( ) : getPageMaxSize ( ) ) * 7 ) >> 3 ) ; } | Is invoked on the leaf deletion only . |
24,006 | static MetaTreeImpl . Proto saveMetaTree ( final ITreeMutable metaTree , final EnvironmentImpl env , final ExpiredLoggableCollection expired ) { final long newMetaTreeAddress = metaTree . save ( ) ; final Log log = env . getLog ( ) ; final int lastStructureId = env . getLastStructureId ( ) ; final long dbRootAddress = ... | Saves meta tree writes database root and flushes the log . |
24,007 | @ SuppressWarnings ( { "OverlyLongMethod" } ) public void clearProperties ( final PersistentStoreTransaction txn , final Entity entity ) { final Transaction envTxn = txn . getEnvironmentTransaction ( ) ; final PersistentEntityId id = ( PersistentEntityId ) entity . getId ( ) ; final int entityTypeId = id . getTypeId ( ... | Clears all properties of specified entity . |
24,008 | boolean deleteEntity ( final PersistentStoreTransaction txn , final PersistentEntity entity ) { clearProperties ( txn , entity ) ; clearBlobs ( txn , entity ) ; deleteLinks ( txn , entity ) ; final PersistentEntityId id = entity . getId ( ) ; final int entityTypeId = id . getTypeId ( ) ; final long entityLocalId = id .... | Deletes specified entity clearing all its properties and deleting all its outgoing links . |
24,009 | private void deleteLinks ( final PersistentStoreTransaction txn , final PersistentEntity entity ) { final PersistentEntityId id = entity . getId ( ) ; final int entityTypeId = id . getTypeId ( ) ; final long entityLocalId = id . getLocalId ( ) ; final Transaction envTxn = txn . getEnvironmentTransaction ( ) ; final Lin... | Deletes all outgoing links of specified entity . |
24,010 | public int getEntityTypeId ( final String entityType , final boolean allowCreate ) { return getEntityTypeId ( txnProvider , entityType , allowCreate ) ; } | Gets or creates id of the entity type . |
24,011 | public int getPropertyId ( final PersistentStoreTransaction txn , final String propertyName , final boolean allowCreate ) { return allowCreate ? propertyIds . getOrAllocateId ( txn , propertyName ) : propertyIds . getId ( txn , propertyName ) ; } | Gets id of a property and creates the new one if necessary . |
24,012 | public int getLinkId ( final PersistentStoreTransaction txn , final String linkName , final boolean allowCreate ) { return allowCreate ? linkIds . getOrAllocateId ( txn , linkName ) : linkIds . getId ( txn , linkName ) ; } | Gets id of a link and creates the new one if necessary . |
24,013 | public synchronized void start ( ) { if ( ! started . getAndSet ( true ) ) { finished . set ( false ) ; thread . start ( ) ; } } | Starts processor thread . |
24,014 | public void finish ( ) { if ( started . get ( ) && ! finished . getAndSet ( true ) ) { waitUntilFinished ( ) ; super . finish ( ) ; createProcessorThread ( ) ; clearQueues ( ) ; started . set ( false ) ; } } | Signals that the processor to finish and waits until it finishes . |
24,015 | int acquireTransaction ( final Thread thread ) { try ( CriticalSection ignored = criticalSection . enter ( ) ) { final int currentThreadPermits = getThreadPermitsToAcquire ( thread ) ; waitForPermits ( thread , currentThreadPermits > 0 ? nestedQueue : regularQueue , 1 , currentThreadPermits ) ; } return 1 ; } | Acquire transaction with a single permit in a thread . Transactions are acquired reentrantly i . e . with respect to transactions already acquired in the thread . |
24,016 | void releaseTransaction ( final Thread thread , final int permits ) { try ( CriticalSection ignored = criticalSection . enter ( ) ) { int currentThreadPermits = getThreadPermits ( thread ) ; if ( permits > currentThreadPermits ) { throw new ExodusException ( "Can't release more permits than it was acquired" ) ; } acqui... | Release transaction that was acquired in a thread with specified permits . |
24,017 | private int tryAcquireExclusiveTransaction ( final Thread thread , final int timeout ) { long nanos = TimeUnit . MILLISECONDS . toNanos ( timeout ) ; try ( CriticalSection ignored = criticalSection . enter ( ) ) { if ( getThreadPermits ( thread ) > 0 ) { throw new ExodusException ( "Exclusive transaction can't be neste... | Wait for exclusive permit during a timeout in milliseconds . |
24,018 | protected boolean waitForJobs ( ) throws InterruptedException { final Pair < Long , Job > peekPair ; try ( Guard ignored = timeQueue . lock ( ) ) { peekPair = timeQueue . peekPair ( ) ; } if ( peekPair == null ) { awake . acquire ( ) ; return true ; } final long timeout = Long . MAX_VALUE - peekPair . getFirst ( ) - Sy... | returns true if a job was queued within a timeout |
24,019 | void apply ( ) { final FlushLog log = new FlushLog ( ) ; store . logOperations ( txn , log ) ; final BlobVault blobVault = store . getBlobVault ( ) ; if ( blobVault . requiresTxn ( ) ) { try { blobVault . flushBlobs ( blobStreams , blobFiles , deferredBlobsToDelete , txn ) ; } catch ( Exception e ) { throw ExodusExcept... | exposed only for tests |
24,020 | private String getFQName ( final String localName , Object ... params ) { final StringBuilder builder = new StringBuilder ( ) ; builder . append ( storeName ) ; builder . append ( '.' ) ; builder . append ( localName ) ; for ( final Object param : params ) { builder . append ( '#' ) ; builder . append ( param ) ; } ret... | Gets fully - qualified name of a table or sequence . |
24,021 | public static void writeUTF ( final OutputStream stream , final String str ) throws IOException { try ( DataOutputStream dataStream = new DataOutputStream ( stream ) ) { int len = str . length ( ) ; if ( len < SINGLE_UTF_CHUNK_SIZE ) { dataStream . writeUTF ( str ) ; } else { int startIndex = 0 ; int endIndex ; do { en... | Writes long strings to output stream as several chunks . |
24,022 | public static String readUTF ( final InputStream stream ) throws IOException { final DataInputStream dataInput = new DataInputStream ( stream ) ; if ( stream instanceof ByteArraySizedInputStream ) { final ByteArraySizedInputStream sizedStream = ( ByteArraySizedInputStream ) stream ; final int streamSize = sizedStream .... | Reads a string from input stream saved as a sequence of UTF chunks . |
24,023 | protected long save ( ) { ReclaimFlag flag = saveChildren ( ) ; final byte type = getType ( ) ; final BTreeBase tree = getTree ( ) ; final int structureId = tree . structureId ; final Log log = tree . log ; if ( flag == ReclaimFlag . PRESERVE ) { if ( log . getWrittenHighAddress ( ) % log . getFileLengthBound ( ) == 0 ... | Save page to log |
24,024 | public EnvironmentConfig setSetting ( final String key , final Object value ) { return ( EnvironmentConfig ) super . setSetting ( key , value ) ; } | Sets the value of the setting with the specified key . |
24,025 | public final String getStringContent ( final long blobHandle , final Transaction txn ) throws IOException { String result ; result = stringContentCache . tryKey ( this , blobHandle ) ; if ( result == null ) { final InputStream content = getContent ( blobHandle , txn ) ; if ( content == null ) { logger . error ( "Blob s... | Returns string content of blob identified by specified blob handle . String contents cache is used . |
24,026 | public final Job queueIn ( final Job job , final long millis ) { return pushAt ( job , System . currentTimeMillis ( ) + millis ) ; } | Queues a job for execution in specified time . |
24,027 | public void put ( final Transaction txn , final long localId , final int blobId , final ByteIterable value ) { primaryStore . put ( txn , PropertyKey . propertyKeyToEntry ( new PropertyKey ( localId , blobId ) ) , value ) ; allBlobsIndex . put ( txn , IntegerBinding . intToCompressedEntry ( blobId ) , LongBinding . lon... | Setter for blob handle value . |
24,028 | public void put ( final PersistentStoreTransaction txn , final long localId , final ByteIterable value , final ByteIterable oldValue , final int propertyId , final ComparableValueType type ) { final Store valueIdx = getOrCreateValueIndex ( txn , propertyId ) ; final ByteIterable key = PropertyKey . propertyKeyToEntry (... | Setter for property value . Doesn t affect entity version and doesn t invalidate any of the cached entity iterables . |
24,029 | public Iterator < K > tailIterator ( final K key ) { return new Iterator < K > ( ) { private Stack < TreePos < K > > stack ; private boolean hasNext ; private boolean hasNextValid ; public boolean hasNext ( ) { if ( hasNextValid ) { return hasNext ; } hasNextValid = true ; if ( stack == null ) { Node < K > root = getRo... | Returns an iterator that iterates over all elements greater or equal to key in ascending order |
24,030 | public ByteIterable get ( final Transaction txn , final ByteIterable first ) { return this . first . get ( txn , first ) ; } | Search for the first entry in the first database . Use this method for databases configured with no duplicates . |
24,031 | public ByteIterable get2 ( final Transaction txn , final ByteIterable second ) { return this . second . get ( txn , second ) ; } | Search for the second entry in the second database . Use this method for databases configured with no duplicates . |
24,032 | public void close ( ) { if ( closed ) return ; closed = true ; tcpSocketConsumer . prepareToShutdown ( ) ; if ( shouldSendCloseMessage ) eventLoop . addHandler ( new EventHandler ( ) { public boolean action ( ) throws InvalidEventHandlerException { try { TcpChannelHub . this . sendCloseMessage ( ) ; tcpSocketConsumer .... | called when we are completed finished with using the TcpChannelHub |
24,033 | private void sendCloseMessage ( ) { this . lock ( ( ) -> { TcpChannelHub . this . writeMetaDataForKnownTID ( 0 , outWire , null , 0 ) ; TcpChannelHub . this . outWire . writeDocument ( false , w -> w . writeEventName ( EventId . onClientClosing ) . text ( "" ) ) ; } , TryLock . LOCK ) ; try { final boolean await = rece... | used to signal to the server that the client is going to drop the connection and waits up to one second for the server to acknowledge the receipt of this message |
24,034 | public long nextUniqueTransaction ( long timeMs ) { long id = timeMs ; for ( ; ; ) { long old = transactionID . get ( ) ; if ( old >= id ) id = old + 1 ; if ( transactionID . compareAndSet ( old , id ) ) break ; } return id ; } | the transaction id are generated as unique timestamps |
24,035 | public void checkConnection ( ) { long start = Time . currentTimeMillis ( ) ; while ( clientChannel == null ) { tcpSocketConsumer . checkNotShutdown ( ) ; if ( start + timeoutMs > Time . currentTimeMillis ( ) ) try { condition . await ( 1 , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { throw new IORu... | blocks until there is a connection |
24,036 | protected boolean closeAtomically ( ) { if ( isClosed . compareAndSet ( false , true ) ) { Closeable . closeQuietly ( networkStatsListener ) ; return true ; } else { return false ; } } | Close the connection atomically . |
24,037 | private void onRead0 ( ) { assert inWire . startUse ( ) ; ensureCapacity ( ) ; try { while ( ! inWire . bytes ( ) . isEmpty ( ) ) { try ( DocumentContext dc = inWire . readingDocument ( ) ) { if ( ! dc . isPresent ( ) ) return ; try { if ( YamlLogging . showServerReads ( ) ) logYaml ( dc ) ; onRead ( dc , outWire ) ; o... | process all messages in this batch provided there is plenty of output space . |
24,038 | private boolean hasReceivedHeartbeat ( ) { long currentTimeMillis = System . currentTimeMillis ( ) ; boolean result = lastTimeMessageReceived + heartbeatTimeoutMs >= currentTimeMillis ; if ( ! result ) Jvm . warn ( ) . on ( getClass ( ) , Integer . toHexString ( hashCode ( ) ) + " missed heartbeat, lastTimeMessageRecei... | called periodically to check that the heartbeat has been received |
24,039 | public boolean mapsCell ( String cell ) { return mappedCells . stream ( ) . anyMatch ( x -> x . equals ( cell ) ) ; } | Returns if this maps the specified cell . |
24,040 | public double getDegrees ( ) { double kms = getValue ( GeoDistanceUnit . KILOMETRES ) ; return DistanceUtils . dist2Degrees ( kms , DistanceUtils . EARTH_MEAN_RADIUS_KM ) ; } | Return the numeric distance value in degrees . |
24,041 | public NRShape makeShape ( Date from , Date to ) { UnitNRShape fromShape = tree . toUnitShape ( from ) ; UnitNRShape toShape = tree . toUnitShape ( to ) ; return tree . toRangeShape ( fromShape , toShape ) ; } | Makes an spatial shape representing the time range defined by the two specified dates . |
24,042 | public static int validateGeohashMaxLevels ( Integer userMaxLevels , int defaultMaxLevels ) { int maxLevels = userMaxLevels == null ? defaultMaxLevels : userMaxLevels ; if ( maxLevels < 1 || maxLevels > GeohashPrefixTree . getMaxLevelsPossible ( ) ) { throw new IndexException ( "max_levels must be in range [1, {}], but... | Checks if the specified max levels is correct . |
24,043 | public static Double checkLatitude ( String name , Double latitude ) { if ( latitude == null ) { throw new IndexException ( "{} required" , name ) ; } else if ( latitude < MIN_LATITUDE || latitude > MAX_LATITUDE ) { throw new IndexException ( "{} must be in range [{}, {}], but found {}" , name , MIN_LATITUDE , MAX_LATI... | Checks if the specified latitude is correct . |
24,044 | public static Double checkLongitude ( String name , Double longitude ) { if ( longitude == null ) { throw new IndexException ( "{} required" , name ) ; } else if ( longitude < MIN_LONGITUDE || longitude > MAX_LONGITUDE ) { throw new IndexException ( "{} must be in range [{}, {}], but found {}" , name , MIN_LONGITUDE , ... | Checks if the specified longitude is correct . |
24,045 | public Set < String > postProcessingFields ( ) { Set < String > fields = new LinkedHashSet < > ( ) ; query . forEach ( condition -> fields . addAll ( condition . postProcessingFields ( ) ) ) ; sort . forEach ( condition -> fields . addAll ( condition . postProcessingFields ( ) ) ) ; return fields ; } | Returns the names of the involved fields when post processing . |
24,046 | public static Index index ( String keyspace , String table , String name ) { return new Index ( table , name ) . keyspace ( keyspace ) ; } | Returns a new index creation statement using the session s keyspace . |
24,047 | public GeoShapeMapper transform ( GeoTransformation ... transformations ) { if ( this . transformations == null ) { this . transformations = Arrays . asList ( transformations ) ; } else { this . transformations . addAll ( Arrays . asList ( transformations ) ) ; } return this ; } | Sets the transformations to be applied to the shape before indexing it . |
24,048 | @ JsonProperty ( "paging" ) void paging ( String paging ) { builder . paging ( IndexPagingState . fromByteBuffer ( ByteBufferUtils . byteBuffer ( paging ) ) ) ; } | Sets the specified starting partition key . |
24,049 | public boolean mapsCell ( String cell ) { return mappers . values ( ) . stream ( ) . anyMatch ( mapper -> mapper . mapsCell ( cell ) ) ; } | Returns if this has any mapping for the specified cell . |
24,050 | private static String convertPathToResource ( String path ) { File file = new File ( path ) ; List < String > parts = new ArrayList < String > ( ) ; do { parts . add ( file . getName ( ) ) ; file = file . getParentFile ( ) ; } while ( file != null ) ; StringBuffer sb = new StringBuffer ( ) ; int size = parts . size ( )... | Converts any path into something that can be placed in an Android directory . |
24,051 | public static String formatDateTime ( Context context , ReadablePartial time , int flags ) { return android . text . format . DateUtils . formatDateTime ( context , toMillis ( time ) , flags | FORMAT_UTC ) ; } | Formats a date or a time according to the local conventions . |
24,052 | public static String formatDateRange ( Context context , ReadablePartial start , ReadablePartial end , int flags ) { return formatDateRange ( context , toMillis ( start ) , toMillis ( end ) , flags ) ; } | Formats a date or a time range according to the local conventions . |
24,053 | public static CharSequence getRelativeTimeSpanString ( Context context , ReadableInstant time , int flags ) { boolean abbrevRelative = ( flags & ( FORMAT_ABBREV_RELATIVE | FORMAT_ABBREV_ALL ) ) != 0 ; DateTime now = DateTime . now ( time . getZone ( ) ) . withMillisOfSecond ( 0 ) ; DateTime timeDt = new DateTime ( time... | Returns a string describing time as a time relative to now . |
24,054 | public static CharSequence formatDuration ( Context context , ReadableDuration readableDuration ) { Resources res = context . getResources ( ) ; Duration duration = readableDuration . toDuration ( ) ; final int hours = ( int ) duration . getStandardHours ( ) ; if ( hours != 0 ) { return res . getQuantityString ( R . pl... | Return given duration in a human - friendly format . For example 4 minutes or 1 second . Returns only largest meaningful unit of time from seconds up to hours . |
24,055 | public DateTimeZone getZone ( String id ) { if ( id == null ) { return null ; } Object obj = iZoneInfoMap . get ( id ) ; if ( obj == null ) { return null ; } if ( id . equals ( obj ) ) { return loadZoneData ( id ) ; } if ( obj instanceof SoftReference < ? > ) { @ SuppressWarnings ( "unchecked" ) SoftReference < DateTim... | If an error is thrown while loading zone data the exception is logged to system error and null is returned for this and all future requests . |
24,056 | public void addNotification ( final DesignerNotificationEvent event ) { if ( user . getIdentifier ( ) . equals ( event . getUserId ( ) ) ) { if ( event . getNotification ( ) != null && ! event . getNotification ( ) . equals ( "openinxmleditor" ) ) { final NotificationPopupView view = new NotificationPopupView ( ) ; act... | Display a Notification message |
24,057 | private void remove ( ) { if ( removing ) { return ; } if ( deactiveNotifications . size ( ) == 0 ) { return ; } removing = true ; final NotificationPopupView view = deactiveNotifications . get ( 0 ) ; final LinearFadeOutAnimation fadeOutAnimation = new LinearFadeOutAnimation ( view ) { public void onUpdate ( double pr... | Remove a notification message . Recursive until all pending removals have been completed . |
24,058 | public static String readDesignerVersion ( ServletContext context ) { String retStr = "" ; BufferedReader br = null ; try { InputStream inputStream = context . getResourceAsStream ( "/META-INF/MANIFEST.MF" ) ; br = new BufferedReader ( new InputStreamReader ( inputStream , "UTF-8" ) ) ; String line ; while ( ( line = b... | Returns the designer version from the manifest . |
24,059 | public boolean isDuplicateName ( String name ) { if ( name == null || name . trim ( ) . isEmpty ( ) ) { return false ; } List < AssignmentRow > as = view . getAssignmentRows ( ) ; if ( as != null && ! as . isEmpty ( ) ) { int nameCount = 0 ; for ( AssignmentRow row : as ) { if ( name . trim ( ) . compareTo ( row . getN... | Tests whether a Row name occurs more than once in the list of rows |
24,060 | public String getValueForDisplayValue ( final String key ) { if ( mapDisplayValuesToValues . containsKey ( key ) ) { return mapDisplayValuesToValues . get ( key ) ; } return key ; } | Returns real unquoted value for a DisplayValue |
24,061 | public List < AssignmentRow > getAssignmentRows ( VariableType varType ) { List < AssignmentRow > rows = new ArrayList < AssignmentRow > ( ) ; List < Variable > handledVariables = new ArrayList < Variable > ( ) ; for ( Assignment assignment : assignments ) { if ( assignment . getVariableType ( ) == varType ) { String d... | Gets a list of AssignmentRows based on the current Assignments |
24,062 | public static Diagram parseJson ( String json , Boolean keepGlossaryLink ) throws JSONException { JSONObject modelJSON = new JSONObject ( json ) ; return parseJson ( modelJSON , keepGlossaryLink ) ; } | Parse the json string to the diagram model assumes that the json is hierarchical ordered |
24,063 | public static Diagram parseJson ( JSONObject json , Boolean keepGlossaryLink ) throws JSONException { ArrayList < Shape > shapes = new ArrayList < Shape > ( ) ; HashMap < String , JSONObject > flatJSON = flatRessources ( json ) ; for ( String resourceId : flatJSON . keySet ( ) ) { parseRessource ( shapes , flatJSON , r... | do the parsing on an JSONObject assumes that the json is hierarchical ordered so all shapes are reachable over child relations |
24,064 | private static void parseRessource ( ArrayList < Shape > shapes , HashMap < String , JSONObject > flatJSON , String resourceId , Boolean keepGlossaryLink ) throws JSONException { JSONObject modelJSON = flatJSON . get ( resourceId ) ; Shape current = getShapeWithId ( modelJSON . getString ( "resourceId" ) , shapes ) ; p... | Parse one resource to a shape object and add it to the shapes array |
24,065 | private static void parseStencil ( JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "stencil" ) ) { JSONObject stencil = modelJSON . getJSONObject ( "stencil" ) ; String stencilString = "" ; if ( stencil . has ( "id" ) ) { stencilString = stencil . getString ( "id" ) ; } current . se... | parse the stencil out of a JSONObject and set it to the current shape |
24,066 | private static void parseStencilSet ( JSONObject modelJSON , Diagram current ) throws JSONException { if ( modelJSON . has ( "stencilset" ) ) { JSONObject object = modelJSON . getJSONObject ( "stencilset" ) ; String url = null ; String namespace = null ; if ( object . has ( "url" ) ) { url = object . getString ( "url" ... | crates a StencilSet object and add it to the current diagram |
24,067 | @ SuppressWarnings ( "unchecked" ) private static void parseProperties ( JSONObject modelJSON , Shape current , Boolean keepGlossaryLink ) throws JSONException { if ( modelJSON . has ( "properties" ) ) { JSONObject propsObject = modelJSON . getJSONObject ( "properties" ) ; Iterator < String > keys = propsObject . keys ... | create a HashMap form the json properties and add it to the shape |
24,068 | private static void parseSsextensions ( JSONObject modelJSON , Diagram current ) throws JSONException { if ( modelJSON . has ( "ssextensions" ) ) { JSONArray array = modelJSON . getJSONArray ( "ssextensions" ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { current . addSsextension ( array . getString ( i ) ) ; }... | adds all json extension to an diagram |
24,069 | private static void parseOutgoings ( ArrayList < Shape > shapes , JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "outgoing" ) ) { ArrayList < Shape > outgoings = new ArrayList < Shape > ( ) ; JSONArray outgoingObject = modelJSON . getJSONArray ( "outgoing" ) ; for ( int i = 0 ; i <... | parse the outgoings form an json object and add all shape references to the current shapes add new shapes to the shape array |
24,070 | private static void parseChildShapes ( ArrayList < Shape > shapes , JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "childShapes" ) ) { ArrayList < Shape > childShapes = new ArrayList < Shape > ( ) ; JSONArray childShapeObject = modelJSON . getJSONArray ( "childShapes" ) ; for ( int... | creates a shape list containing all child shapes and set it to the current shape new shape get added to the shape array |
24,071 | private static void parseDockers ( JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "dockers" ) ) { ArrayList < Point > dockers = new ArrayList < Point > ( ) ; JSONArray dockersObject = modelJSON . getJSONArray ( "dockers" ) ; for ( int i = 0 ; i < dockersObject . length ( ) ; i ++ )... | creates a point array of all dockers and add it to the current shape |
24,072 | private static void parseBounds ( JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "bounds" ) ) { JSONObject boundsObject = modelJSON . getJSONObject ( "bounds" ) ; current . setBounds ( new Bounds ( new Point ( boundsObject . getJSONObject ( "lowerRight" ) . getDouble ( "x" ) , boun... | creates a bounds object with both point parsed from the json and set it to the current shape |
24,073 | private static void parseTarget ( ArrayList < Shape > shapes , JSONObject modelJSON , Shape current ) throws JSONException { if ( modelJSON . has ( "target" ) ) { JSONObject targetObject = modelJSON . getJSONObject ( "target" ) ; if ( targetObject . has ( "resourceId" ) ) { current . setTarget ( getShapeWithId ( target... | parse the target resource and add it to the current shape |
24,074 | public static HashMap < String , JSONObject > flatRessources ( JSONObject object ) throws JSONException { HashMap < String , JSONObject > result = new HashMap < String , JSONObject > ( ) ; if ( object . has ( "resourceId" ) && object . has ( "childShapes" ) ) { result . put ( object . getString ( "resourceId" ) , objec... | Prepare a model JSON for analyze resolves the hierarchical structure creates a HashMap which contains all resourceIds as keys and for each key the JSONObject all id are keys of this map |
24,075 | public void setInvalidValues ( final Set < String > invalidValues , final boolean isCaseSensitive , final String invalidValueErrorMessage ) { if ( isCaseSensitive ) { this . invalidValues = invalidValues ; } else { this . invalidValues = new HashSet < String > ( ) ; for ( String value : invalidValues ) { this . invalid... | Sets the invalid values for the TextBox |
24,076 | public void setRegExp ( final String pattern , final String invalidCharactersInNameErrorMessage , final String invalidCharacterTypedMessage ) { regExp = RegExp . compile ( pattern ) ; this . invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage ; this . invalidCharacterTypedMessage = invalidCharacte... | Sets the RegExp pattern for the TextBox |
24,077 | public HashMap < String , String > getProperties ( ) { if ( this . properties == null ) { this . properties = new HashMap < String , String > ( ) ; } return properties ; } | return a HashMap with all properties name as key value as value |
24,078 | public String putProperty ( String key , String value ) { return this . getProperties ( ) . put ( key , value ) ; } | changes an existing property with the same name or adds a new one |
24,079 | List < String > getRuleFlowNames ( HttpServletRequest req ) { final String [ ] projectAndBranch = getProjectAndBranchNames ( req ) ; List < RefactoringPageRow > results = queryService . query ( DesignerFindRuleFlowNamesQuery . NAME , new HashSet < ValueIndexTerm > ( ) { { add ( new ValueSharedPartIndexTerm ( "*" , Part... | package scope in order to test the method |
24,080 | public static Map < String , IDiagramPlugin > getLocalPluginsRegistry ( ServletContext context ) { if ( LOCAL == null ) { LOCAL = initializeLocalPlugins ( context ) ; } return LOCAL ; } | Initialize the local plugins registry |
24,081 | public boolean addSsextension ( String ssExt ) { if ( this . ssextensions == null ) { this . ssextensions = new ArrayList < String > ( ) ; } return this . ssextensions . add ( ssExt ) ; } | Add an additional SSExtension |
24,082 | private static JSONObject parseStencil ( String stencilId ) throws JSONException { JSONObject stencilObject = new JSONObject ( ) ; stencilObject . put ( "id" , stencilId . toString ( ) ) ; return stencilObject ; } | Delivers the correct JSON Object for the stencilId |
24,083 | private static JSONArray parseChildShapesRecursive ( ArrayList < Shape > childShapes ) throws JSONException { if ( childShapes != null ) { JSONArray childShapesArray = new JSONArray ( ) ; for ( Shape childShape : childShapes ) { JSONObject childShapeObject = new JSONObject ( ) ; childShapeObject . put ( "resourceId" , ... | Parses all child Shapes recursively and adds them to the correct JSON Object |
24,084 | private static JSONObject parseTarget ( Shape target ) throws JSONException { JSONObject targetObject = new JSONObject ( ) ; targetObject . put ( "resourceId" , target . getResourceId ( ) . toString ( ) ) ; return targetObject ; } | Delivers the correct JSON Object for the target |
24,085 | private static JSONArray parseDockers ( ArrayList < Point > dockers ) throws JSONException { if ( dockers != null ) { JSONArray dockersArray = new JSONArray ( ) ; for ( Point docker : dockers ) { JSONObject dockerObject = new JSONObject ( ) ; dockerObject . put ( "x" , docker . getX ( ) . doubleValue ( ) ) ; dockerObje... | Delivers the correct JSON Object for the dockers |
24,086 | private static JSONArray parseOutgoings ( ArrayList < Shape > outgoings ) throws JSONException { if ( outgoings != null ) { JSONArray outgoingsArray = new JSONArray ( ) ; for ( Shape outgoing : outgoings ) { JSONObject outgoingObject = new JSONObject ( ) ; outgoingObject . put ( "resourceId" , outgoing . getResourceId ... | Delivers the correct JSON Object for outgoings |
24,087 | private static JSONObject parseProperties ( HashMap < String , String > properties ) throws JSONException { if ( properties != null ) { JSONObject propertiesObject = new JSONObject ( ) ; for ( String key : properties . keySet ( ) ) { String propertyValue = properties . get ( key ) ; if ( propertyValue . startsWith ( "{... | Delivers the correct JSON Object for properties |
24,088 | private static JSONArray parseStencilSetExtensions ( ArrayList < String > extensions ) { if ( extensions != null ) { JSONArray extensionsArray = new JSONArray ( ) ; for ( String extension : extensions ) { extensionsArray . put ( extension . toString ( ) ) ; } return extensionsArray ; } return new JSONArray ( ) ; } | Delivers the correct JSON Object for the Stencilset Extensions |
24,089 | private static JSONObject parseStencilSet ( StencilSet stencilSet ) throws JSONException { if ( stencilSet != null ) { JSONObject stencilSetObject = new JSONObject ( ) ; stencilSetObject . put ( "url" , stencilSet . getUrl ( ) . toString ( ) ) ; stencilSetObject . put ( "namespace" , stencilSet . getNamespace ( ) . toS... | Delivers the correct JSON Object for the Stencilset |
24,090 | private static JSONObject parseBounds ( Bounds bounds ) throws JSONException { if ( bounds != null ) { JSONObject boundsObject = new JSONObject ( ) ; JSONObject lowerRight = new JSONObject ( ) ; JSONObject upperLeft = new JSONObject ( ) ; lowerRight . put ( "x" , bounds . getLowerRight ( ) . getX ( ) . doubleValue ( ) ... | Delivers the correct JSON Object for the Bounds |
24,091 | public static String createQuotedConstant ( String str ) { if ( str == null || str . isEmpty ( ) ) { return str ; } try { Double . parseDouble ( str ) ; } catch ( NumberFormatException nfe ) { return "\"" + str + "\"" ; } return str ; } | Puts strings inside quotes and numerics are left as they are . |
24,092 | public static String createUnquotedConstant ( String str ) { if ( str == null || str . isEmpty ( ) ) { return str ; } if ( str . startsWith ( "\"" ) ) { str = str . substring ( 1 ) ; } if ( str . endsWith ( "\"" ) ) { str = str . substring ( 0 , str . length ( ) - 1 ) ; } return str ; } | Removes double - quotes from around a string |
24,093 | public static boolean isQuotedConstant ( String str ) { if ( str == null || str . isEmpty ( ) ) { return false ; } return ( str . startsWith ( "\"" ) && str . endsWith ( "\"" ) ) ; } | Returns true if string starts and ends with double - quote |
24,094 | public String urlEncode ( String s ) { if ( s == null || s . isEmpty ( ) ) { return s ; } return URL . encodeQueryString ( s ) ; } | URLEncode a string |
24,095 | public String urlDecode ( String s ) { if ( s == null || s . isEmpty ( ) ) { return s ; } return URL . decodeQueryString ( s ) ; } | URLDecode a string |
24,096 | private Bpmn2Resource unmarshall ( JsonParser parser , String preProcessingData ) throws IOException { try { parser . nextToken ( ) ; ResourceSet rSet = new ResourceSetImpl ( ) ; rSet . getResourceFactoryRegistry ( ) . getExtensionToFactoryMap ( ) . put ( "bpmn2" , new JBPMBpmn2ResourceFactoryImpl ( ) ) ; Bpmn2Resource... | Start unmarshalling using the parser . |
24,097 | public void revisitThrowEvents ( Definitions def ) { List < RootElement > rootElements = def . getRootElements ( ) ; List < Signal > toAddSignals = new ArrayList < Signal > ( ) ; Set < Error > toAddErrors = new HashSet < Error > ( ) ; Set < Escalation > toAddEscalations = new HashSet < Escalation > ( ) ; Set < Message ... | Updates event definitions for all throwing events . |
24,098 | private void revisitGateways ( Definitions def ) { List < RootElement > rootElements = def . getRootElements ( ) ; for ( RootElement root : rootElements ) { if ( root instanceof Process ) { setGatewayInfo ( ( Process ) root ) ; } } } | Updates the gatewayDirection attributes of all gateways . |
24,099 | private void revisitMessages ( Definitions def ) { List < RootElement > rootElements = def . getRootElements ( ) ; List < ItemDefinition > toAddDefinitions = new ArrayList < ItemDefinition > ( ) ; for ( RootElement root : rootElements ) { if ( root instanceof Message ) { if ( ! existsMessageItemDefinition ( rootElement... | Revisit message to set their item ref to a item definition |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.