signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SqlTransientExceptionDetector { /** * Determines if the SQL exception is a rollback exception
* @ param se the exception
* @ return true if it is a code 40nnn , otherwise false */
public static boolean isSqlStateRollbackException ( SQLException se ) { } } | String sqlState = se . getSQLState ( ) ; return sqlState != null && sqlState . startsWith ( "40" ) ; |
public class CodecCollector { /** * Creates the positions .
* @ param statsPositionList
* the stats position list
* @ param positionsData
* the positions data
* @ param docSet
* the doc set
* @ throws IOException
* Signals that an I / O exception has occurred . */
private static void createPositions ( List < ComponentPosition > statsPositionList , Map < Integer , Integer > positionsData , List < Integer > docSet ) throws IOException { } } | if ( statsPositionList != null ) { for ( ComponentPosition position : statsPositionList ) { position . dataCollector . initNewList ( 1 ) ; Integer tmpValue ; long [ ] values = new long [ docSet . size ( ) ] ; int value ; int number = 0 ; for ( int docId : docSet ) { tmpValue = positionsData . get ( docId ) ; value = tmpValue == null ? 0 : tmpValue . intValue ( ) ; if ( ( ( position . minimumLong == null ) || ( value >= position . minimumLong ) ) && ( ( position . maximumLong == null ) || ( value <= position . maximumLong ) ) ) { values [ number ] = value ; number ++ ; } } if ( number > 0 ) { position . dataCollector . add ( values , number ) ; } position . dataCollector . closeNewList ( ) ; } } |
public class AbstractActivator { /** * This method should be used to register services . Services registered with
* this method auto deregistered during bundle stop .
* @ param iface
* is the interface of the service to be used for later retrieval .
* @ param instance
* is an instance of the object to be registered as service for
* interface iface .
* @ param < T >
* is the service interface .
* @ return A { @ link ServiceRegistration } is returned of the newly registered
* service . */
public final < T > ServiceRegistration < ? > registerService ( Class < T > iface , T instance ) { } } | Hashtable < String , String > properties = new Hashtable < String , String > ( ) ; return registerService ( iface , instance , properties ) ; |
public class DatabaseUtils { /** * Reads a Double out of a column in a Cursor and writes it to a ContentValues .
* Adds nothing to the ContentValues if the column isn ' t present or if its value is null .
* @ param cursor The cursor to read from
* @ param column The column to read
* @ param values The { @ link ContentValues } to put the value into */
public static void cursorDoubleToContentValuesIfPresent ( Cursor cursor , ContentValues values , String column ) { } } | final int index = cursor . getColumnIndex ( column ) ; if ( index != - 1 && ! cursor . isNull ( index ) ) { values . put ( column , cursor . getDouble ( index ) ) ; } |
public class SetReplicationCommand { /** * Changes the replication level of directory or file with the path specified in args .
* @ param path The { @ link AlluxioURI } path as the input of the command
* @ param replicationMax the max replicas , null if not to set
* @ param replicationMin the min replicas , null if not to set
* @ param recursive Whether change the permission recursively
* @ throws AlluxioException when Alluxio exception occurs
* @ throws IOException when non - Alluxio exception occurs */
private void setReplication ( AlluxioURI path , Integer replicationMax , Integer replicationMin , boolean recursive ) throws AlluxioException , IOException { } } | SetAttributePOptions . Builder optionsBuilder = SetAttributePOptions . newBuilder ( ) . setRecursive ( recursive ) ; String message = "Changed the replication level of " + path + "\n" ; if ( replicationMax != null ) { optionsBuilder . setReplicationMax ( replicationMax ) ; message += "replicationMax was set to " + replicationMax + "\n" ; } if ( replicationMin != null ) { optionsBuilder . setReplicationMin ( replicationMin ) ; message += "replicationMin was set to " + replicationMin + "\n" ; } mFileSystem . setAttribute ( path , optionsBuilder . build ( ) ) ; System . out . println ( message ) ; |
public class Consumers { /** * Yields the last element .
* @ param < E > the iterable element type
* @ param iterable the iterable that will be consumed @ throw
* IllegalArgumentException if no element is found
* @ return the last element */
public static < E > E last ( Iterable < E > iterable ) { } } | dbc . precondition ( iterable != null , "cannot call last with a null iterable" ) ; return new LastElement < E > ( ) . apply ( iterable . iterator ( ) ) ; |
public class ALTaskTextViewerPanel { /** * Parses a PreviewCollection and return the resulting
* ParsedPreview object . If the PreviewCollection contains
* PreviewCollections again , it recursively adds their results . If it
* contains simple Previews , it adds their properties to the result .
* @ param pc PreviewCollection
* @ return relevant information contained in the PreviewCollection */
public ParsedPreview readCollection ( PreviewCollection < Preview > pc ) { } } | ParsedPreview pp = new ParsedPreview ( ) ; List < Preview > sps = pc . getPreviews ( ) ; if ( sps . size ( ) > 0 && sps . get ( 0 ) instanceof PreviewCollection ) { // members are PreviewCollections again
// NOTE : this assumes that all elements in sps are of the same type
for ( Preview sp : sps ) { @ SuppressWarnings ( "unchecked" ) ParsedPreview tmp = readCollection ( ( PreviewCollection < Preview > ) sp ) ; pp . add ( tmp ) ; } } else { // members are simple previews
for ( Preview sp : sps ) { ParsedPreview tmp = read ( sp ) ; pp . add ( tmp ) ; } } return pp ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcEventTriggerTypeEnum createIfcEventTriggerTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcEventTriggerTypeEnum result = IfcEventTriggerTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class AbstractBulkSplit { /** * Computes and returns the best split point .
* @ param numEntries the number of entries to be split
* @ param minEntries the number of minimum entries in the node to be split
* @ param maxEntries number of maximum entries in the node to be split
* @ return the best split point */
protected int chooseBulkSplitPoint ( int numEntries , int minEntries , int maxEntries ) { } } | if ( numEntries < minEntries ) { throw new IllegalArgumentException ( "numEntries < minEntries!" ) ; } if ( numEntries <= maxEntries ) { return numEntries ; } else if ( numEntries < maxEntries + minEntries ) { return ( numEntries - minEntries ) ; } else { return maxEntries ; } |
public class Strings { /** * JavaScript - escapes all the elements in the target set .
* @ param target the list of Strings to be escaped .
* If non - String objects , toString ( ) will be called .
* @ return a Set with the result of each
* each element of the target .
* @ since 2.0.11 */
public Set < String > setEscapeJavaScript ( final Set < ? > target ) { } } | if ( target == null ) { return null ; } final Set < String > result = new LinkedHashSet < String > ( target . size ( ) + 2 ) ; for ( final Object element : target ) { result . add ( escapeJavaScript ( element ) ) ; } return result ; |
public class Slot { /** * syntactic sugar */
public Slot addServiceType ( CodeableConcept t ) { } } | if ( t == null ) return this ; if ( this . serviceType == null ) this . serviceType = new ArrayList < CodeableConcept > ( ) ; this . serviceType . add ( t ) ; return this ; |
public class Spliterators { /** * Creates a { @ code Spliterator . OfLong } using a given
* { @ code LongStream . LongIterator } as the source of elements , and with a
* given initially reported size .
* < p > The spliterator is not
* < em > < a href = " Spliterator . html # binding " > late - binding < / a > < / em > , inherits
* the < em > fail - fast < / em > properties of the iterator , and implements
* { @ code trySplit } to permit limited parallelism .
* < p > Traversal of elements should be accomplished through the spliterator .
* The behaviour of splitting and traversal is undefined if the iterator is
* operated on after the spliterator is returned , or the initially reported
* size is not equal to the actual number of elements in the source .
* @ param iterator The iterator for the source
* @ param size The number of elements in the source , to be reported as
* initial { @ code estimateSize } .
* @ param characteristics Characteristics of this spliterator ' s source or
* elements . The characteristics { @ code SIZED } and { @ code SUBSIZED }
* are additionally reported unless { @ code CONCURRENT } is supplied .
* @ return A spliterator from an iterator
* @ throws NullPointerException if the given iterator is { @ code null } */
public static Spliterator . OfLong spliterator ( PrimitiveIterator . OfLong iterator , long size , int characteristics ) { } } | return new LongIteratorSpliterator ( Objects . requireNonNull ( iterator ) , size , characteristics ) ; |
public class AmazonSimpleDBUtil { /** * Encodes date value into string format that can be compared lexicographically
* @ param date
* date value to be encoded
* @ return string representation of the date value */
public static String encodeDate ( Date date ) { } } | SimpleDateFormat dateFormatter = new SimpleDateFormat ( dateFormat ) ; dateFormatter . setTimeZone ( TimeZone . getTimeZone ( UTC_TZ_ID ) ) ; /* Java doesn ' t handle ISO8601 nicely : need to add ' : ' manually */
String result = dateFormatter . format ( date ) ; return result . substring ( 0 , result . length ( ) - ENCODE_DATE_COLONS_INDEX ) + ":" + result . substring ( result . length ( ) - ENCODE_DATE_COLONS_INDEX ) ; |
public class CmsAttributeHandler { /** * Adds a new attribute value below the reference view . < p >
* @ param reference the reference value view */
public void addNewAttributeValue ( CmsAttributeValueView reference ) { } } | // make sure not to add more values than allowed
int maxOccurrence = getEntityType ( ) . getAttributeMaxOccurrence ( m_attributeName ) ; CmsEntityAttribute attribute = m_entity . getAttribute ( m_attributeName ) ; boolean mayHaveMore = ( ( attribute == null ) || ( attribute . getValueCount ( ) < maxOccurrence ) ) ; if ( mayHaveMore ) { if ( getAttributeType ( ) . isSimpleType ( ) ) { int valueIndex = reference . getValueIndex ( ) + 1 ; String defaultValue = m_widgetService . getDefaultAttributeValue ( m_attributeName , getSimplePath ( valueIndex ) ) ; I_CmsFormEditWidget widget = m_widgetService . getAttributeFormWidget ( m_attributeName ) ; boolean insertLast = false ; if ( reference . getElement ( ) . getNextSiblingElement ( ) == null ) { m_entity . addAttributeValue ( m_attributeName , defaultValue ) ; insertLast = true ; } else { valueIndex = reference . getValueIndex ( ) + 1 ; m_entity . insertAttributeValue ( m_attributeName , defaultValue , valueIndex ) ; m_widgetService . addChangedOrderPath ( getSimplePath ( - 1 ) ) ; } CmsAttributeValueView valueWidget = reference ; if ( reference . hasValue ( ) ) { valueWidget = new CmsAttributeValueView ( this , m_widgetService . getAttributeLabel ( m_attributeName ) , m_widgetService . getAttributeHelp ( m_attributeName ) ) ; if ( m_widgetService . isDisplaySingleLine ( m_attributeName ) ) { valueWidget . setCompactMode ( CmsAttributeValueView . COMPACT_MODE_SINGLE_LINE ) ; } if ( insertLast ) { ( ( FlowPanel ) reference . getParent ( ) ) . add ( valueWidget ) ; } else { ( ( FlowPanel ) reference . getParent ( ) ) . insert ( valueWidget , valueIndex ) ; } } valueWidget . setValueWidget ( widget , defaultValue , defaultValue , true ) ; } else { CmsEntity value = m_entityBackEnd . createEntity ( null , getAttributeType ( ) . getId ( ) ) ; insertValueAfterReference ( value , reference ) ; } CmsUndoRedoHandler handler = CmsUndoRedoHandler . getInstance ( ) ; if ( handler . isIntitalized ( ) ) { handler . addChange ( m_entity . getId ( ) , m_attributeName , reference . getValueIndex ( ) + 1 , ChangeType . add ) ; } } updateButtonVisisbility ( ) ; |
public class WebSocketConnection { /** * Sends text to the client .
* @ param data
* string data
* @ throws UnsupportedEncodingException */
public void send ( String data ) throws UnsupportedEncodingException { } } | log . trace ( "send message: {}" , data ) ; // process the incoming string
if ( StringUtils . isNotBlank ( data ) ) { send ( Packet . build ( data . getBytes ( "UTF8" ) , MessageType . TEXT ) ) ; } else { throw new UnsupportedEncodingException ( "Cannot send a null string" ) ; } |
public class SessionManagerMBeanImpl { /** * Send attribute change notification */
private void publishToRepository ( String attributeName , String attributeType , Object oldValue , Object newValue ) { } } | super . sendNotification ( new AttributeChangeNotification ( this , sequenceNum . incrementAndGet ( ) , System . currentTimeMillis ( ) , "" , attributeName , attributeType , oldValue , newValue ) ) ; |
public class DocPretty { /** * Print string , replacing all non - ascii character with unicode escapes . */
protected void print ( Object s ) throws IOException { } } | out . write ( Convert . escapeUnicode ( s . toString ( ) ) ) ; |
public class FileUtils { /** * Borra este directorio y todo lo que haya dentro .
* Si esto no es un directorio sale .
* @ param dir
* @ return */
public static boolean deleteDirRecursively ( File dir ) { } } | if ( ! dir . exists ( ) || ! dir . isDirectory ( ) ) { // No hay ficheros que borrar a si que OK
log . warn ( "El directorio:'" + dir . getAbsolutePath ( ) + "' no existe o no es un directorio" ) ; return false ; } // el fichero es un directorio
boolean succed = true ; File listFile [ ] = dir . listFiles ( ) ; for ( File file : listFile ) { if ( file . isDirectory ( ) ) { deleteDirRecursively ( file ) ; } else { if ( ! file . delete ( ) ) { log . warn ( "No se ha podido borrar el fichero:'" + file . getAbsolutePath ( ) + "'" ) ; succed = false ; } } } if ( ! dir . delete ( ) ) { log . warn ( "No se ha podido borrar el fichero:'" + dir . getAbsolutePath ( ) + "'" ) ; succed = false ; } return succed ; |
public class Interceptors { /** * Add the global service interceptor to intercept all the method enhanced by aop Enhancer . */
public Interceptors addGlobalServiceInterceptor ( Interceptor globalServiceInterceptor ) { } } | if ( globalServiceInterceptor == null ) { throw new IllegalArgumentException ( "globalServiceInterceptor can not be null." ) ; } InterceptorManager . me ( ) . addGlobalServiceInterceptor ( globalServiceInterceptor ) ; return this ; |
public class PostgreSqlEngine { /** * Converts a String value into a PG JSON value ready to be assigned to bind variables in Prepared Statements .
* @ param val The String representation of the JSON value .
* @ return The correspondent JSON value
* @ throws DatabaseEngineException if there is an error creating the value . It should never be thrown .
* @ since 2.1.5 */
private Object getJSONValue ( String val ) throws DatabaseEngineException { } } | try { PGobject dataObject = new PGobject ( ) ; dataObject . setType ( "jsonb" ) ; dataObject . setValue ( val ) ; return dataObject ; } catch ( final SQLException ex ) { throw new DatabaseEngineException ( "Error while mapping variables to database, value = " + val , ex ) ; } |
public class Shape { /** * Calculate the radius of a circle that can completely enclose this shape . */
protected void calculateRadius ( ) { } } | boundingCircleRadius = 0 ; for ( int i = 0 ; i < points . length ; i += 2 ) { float temp = ( ( points [ i ] - center [ 0 ] ) * ( points [ i ] - center [ 0 ] ) ) + ( ( points [ i + 1 ] - center [ 1 ] ) * ( points [ i + 1 ] - center [ 1 ] ) ) ; boundingCircleRadius = ( boundingCircleRadius > temp ) ? boundingCircleRadius : temp ; } boundingCircleRadius = ( float ) Math . sqrt ( boundingCircleRadius ) ; |
public class PairSampler { /** * Sample with replacement unordered pairs of integers .
* @ param minI The minimum value for i ( inclusive ) .
* @ param maxI The maximum value for i ( exclusive ) .
* @ param minJ The minimum value for j ( inclusive ) .
* @ param maxJ The maximum value for j ( exclusive ) .
* @ param prop The proportion of possible pairs to return .
* @ return A collection of unordered pairs represented as ordered pairs s . t . i < = j . */
public static Collection < UnorderedPair > sampleUnorderedPairs ( int minI , int maxI , int minJ , int maxJ , double prop ) { } } | int numI = maxI - minI ; int numJ = maxJ - minJ ; // Count the max number possible :
long maxPairs = PairSampler . countUnorderedPairs ( minI , maxI , minJ , maxJ ) ; Collection < UnorderedPair > samples ; if ( maxPairs < 400000000 || prop > 0.1 ) { samples = new ArrayList < UnorderedPair > ( ) ; int min = Math . min ( minI , minJ ) ; int max = Math . max ( maxI , maxJ ) ; for ( int i = min ; i < max ; i ++ ) { for ( int j = i ; j < max ; j ++ ) { if ( ( minI <= i && i < maxI && minJ <= j && j < maxJ ) || ( minJ <= i && i < maxJ && minI <= j && j < maxI ) ) { if ( prop >= 1.0 || Prng . nextDouble ( ) < prop ) { samples . add ( new UnorderedPair ( i , j ) ) ; } } } } } else { samples = new HashSet < UnorderedPair > ( ) ; double numSamples = maxPairs * prop ; while ( samples . size ( ) < numSamples ) { int i = Prng . nextInt ( numI ) + minI ; int j = Prng . nextInt ( numJ ) + minJ ; if ( i <= j ) { // We must reject samples for which j < i , or else we would
// be making pairs with i = = j half as likely .
samples . add ( new UnorderedPair ( i , j ) ) ; } } } return samples ; |
public class HoneycombBitmapFactory { /** * Creates a bitmap of the specified width and height .
* @ param width the width of the bitmap
* @ param height the height of the bitmap
* @ param bitmapConfig the { @ link android . graphics . Bitmap . Config }
* used to create the decoded Bitmap
* @ return a reference to the bitmap
* @ throws TooManyBitmapsException if the pool is full
* @ throws java . lang . OutOfMemoryError if the Bitmap cannot be allocated */
@ TargetApi ( Build . VERSION_CODES . HONEYCOMB_MR1 ) @ Override public CloseableReference < Bitmap > createBitmapInternal ( int width , int height , Bitmap . Config bitmapConfig ) { } } | if ( mImmutableBitmapFallback ) { return createFallbackBitmap ( width , height , bitmapConfig ) ; } CloseableReference < PooledByteBuffer > jpgRef = mJpegGenerator . generate ( ( short ) width , ( short ) height ) ; try { EncodedImage encodedImage = new EncodedImage ( jpgRef ) ; encodedImage . setImageFormat ( DefaultImageFormats . JPEG ) ; try { CloseableReference < Bitmap > bitmapRef = mPurgeableDecoder . decodeJPEGFromEncodedImage ( encodedImage , bitmapConfig , null , jpgRef . get ( ) . size ( ) ) ; if ( ! bitmapRef . get ( ) . isMutable ( ) ) { CloseableReference . closeSafely ( bitmapRef ) ; mImmutableBitmapFallback = true ; FLog . wtf ( TAG , "Immutable bitmap returned by decoder" ) ; // On some devices ( Samsung GT - S7580 ) the returned bitmap can be immutable , in that case
// let ' s jut use Bitmap . createBitmap ( ) to hopefully create a mutable one .
return createFallbackBitmap ( width , height , bitmapConfig ) ; } bitmapRef . get ( ) . setHasAlpha ( true ) ; bitmapRef . get ( ) . eraseColor ( Color . TRANSPARENT ) ; return bitmapRef ; } finally { EncodedImage . closeSafely ( encodedImage ) ; } } finally { jpgRef . close ( ) ; } |
public class StringGroovyMethods { /** * Appends a String to the string representation of this number .
* @ param value a Number
* @ param right a String
* @ return a String
* @ since 1.0 */
public static String plus ( Number value , String right ) { } } | return DefaultGroovyMethods . toString ( value ) + right ; |
public class SmbFile { /** * @ return
* @ throws CIFSException */
synchronized SmbTreeHandleImpl ensureTreeConnected ( ) throws CIFSException { } } | if ( this . treeHandle == null || ! this . treeHandle . isConnected ( ) ) { if ( this . treeHandle != null && this . transportContext . getConfig ( ) . isStrictResourceLifecycle ( ) ) { this . treeHandle . release ( ) ; } this . treeHandle = this . treeConnection . connectWrapException ( this . fileLocator ) ; this . treeHandle . ensureDFSResolved ( ) ; if ( this . transportContext . getConfig ( ) . isStrictResourceLifecycle ( ) ) { // one extra share to keep the tree alive
return this . treeHandle . acquire ( ) ; } return this . treeHandle ; } return this . treeHandle . acquire ( ) ; |
public class PlainTimestamp { /** * / * [ deutsch ]
* < p > Existiert dieser Zeitstempel in der angegebenen Zeitzone ? < / p >
* @ param tzid timezone id ( optional )
* @ return { @ code true } if this timestamp is valid in given timezone
* @ throws IllegalArgumentException if given timezone cannot be loaded */
public boolean isValid ( TZID tzid ) { } } | if ( tzid == null ) { return false ; } return ! Timezone . of ( tzid ) . isInvalid ( this . date , this . time ) ; |
public class CrystalGeometryTools { /** * Creates Cartesian coordinates for all Atoms in the Crystal . */
public static void fractionalToCartesian ( ICrystal crystal ) { } } | Iterator < IAtom > atoms = crystal . atoms ( ) . iterator ( ) ; Vector3d aAxis = crystal . getA ( ) ; Vector3d bAxis = crystal . getB ( ) ; Vector3d cAxis = crystal . getC ( ) ; while ( atoms . hasNext ( ) ) { IAtom atom = atoms . next ( ) ; Point3d fracPoint = atom . getFractionalPoint3d ( ) ; if ( fracPoint != null ) { atom . setPoint3d ( fractionalToCartesian ( aAxis , bAxis , cAxis , fracPoint ) ) ; } } |
public class StateMachineDefinition { /** * Get the ID of the state that has been defined first .
* @ returnID of the first state */
public Integer getFirstStateId ( ) { } } | Set < Integer > ids = states . inverse ( ) . keySet ( ) ; if ( ids . size ( ) < 1 ) { throw new IllegalStateException ( "There is no state defined." ) ; } Integer [ ] idsArray = new Integer [ ids . size ( ) ] ; Arrays . sort ( ids . toArray ( idsArray ) ) ; return idsArray [ 0 ] ; |
public class IfcRelDefinesByTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcObject > getRelatedObjects ( ) { } } | return ( EList < IfcObject > ) eGet ( Ifc4Package . Literals . IFC_REL_DEFINES_BY_TYPE__RELATED_OBJECTS , true ) ; |
public class WSJdbcCallableStatement { /** * Construct and track a new result set wrapper .
* @ param rsetImpl result set to wrap .
* @ return wrapper */
protected WSJdbcResultSet createWrapper ( ResultSet rsetImpl ) { } } | // If the childWrapper is null , and the childWrappers is null or
// empty , set the result set to childWrapper ;
// Otherwise , add the result set to childWrappers
WSJdbcResultSet rsetWrapper ; if ( childWrapper == null && ( childWrappers == null || childWrappers . isEmpty ( ) ) ) { childWrapper = rsetWrapper = mcf . jdbcRuntime . newResultSet ( rsetImpl , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Set the result set to child wrapper" ) ; } else { if ( childWrappers == null ) childWrappers = new ArrayList < Wrapper > ( 5 ) ; rsetWrapper = mcf . jdbcRuntime . newResultSet ( rsetImpl , this ) ; childWrappers . add ( rsetWrapper ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Add the result set to child wrappers list." ) ; } return rsetWrapper ; |
public class HttpComponentsRequestFactory { /** * Create a Commons HttpMethodBase object for the given HTTP method and URI specification .
* @ param method the HTTP method
* @ param uri the URI
* @ return the Commons HttpMethodBase object */
private static HttpUriRequest createHttpUriRequest ( String method , URI uri ) { } } | switch ( method ) { case "GET" : return new HttpGet ( uri ) ; case "HEAD" : return new HttpHead ( uri ) ; case "POST" : return new HttpPost ( uri ) ; case "PUT" : return new HttpPut ( uri ) ; case "PATCH" : return new HttpPatch ( uri ) ; case "DELETE" : return new HttpDelete ( uri ) ; case "OPTIONS" : return new HttpOptions ( uri ) ; case "TRACE" : return new HttpTrace ( uri ) ; default : throw new IllegalArgumentException ( "Invalid HTTP method: " + method ) ; } |
public class UDPBroadcastReceiver { /** * - - - DISCONNECT - - - */
@ Override protected void disconnect ( ) { } } | // Stop thread
super . disconnect ( ) ; // Stop broadcast receiver
if ( broadcastReceiver != null ) { try { broadcastReceiver . close ( ) ; } catch ( Exception ignored ) { } broadcastReceiver = null ; logger . info ( "Broadcast discovery service stopped on udp://" + udpAddress + ':' + udpPort + '.' ) ; } |
public class FileStorage { /** * Returns only the name of the file , whereas
* { @ link # filePath ( int ) } returns the path ( inside the torrent file ) with
* the filename appended .
* @ param index the file index
* @ return the file name */
public String fileName ( int index ) { } } | byte_vector v = fs . file_name ( index ) . to_bytes ( ) ; return Vectors . byte_vector2utf8 ( v ) ; |
public class RuleFactory { /** * Determine if specified string is a known operator .
* @ param symbol string
* @ return true if string is a known operator */
public boolean isRule ( final String symbol ) { } } | return ( ( symbol != null ) && ( RULES . contains ( symbol . toLowerCase ( Locale . ENGLISH ) ) ) ) ; |
public class ObjectsUtils { /** * Checks that the specified object reference is not null .
* @ param object the object reference to check for nullity
* @ param errorMessage detail message to be used in the event that a NullPointerException is
* thrown
* @ param < T > the type of the reference
* @ return object if not null */
public static < T > T requireNonNull ( T object , String errorMessage ) { } } | if ( object == null ) { throw new NullPointerException ( errorMessage ) ; } else { return object ; } |
public class VarConfig { /** * Gets the state ( in this config ) for a given variable . */
public int getState ( Var var ) { } } | Integer state = config . get ( var ) ; if ( state == null ) { throw new RuntimeException ( "VarConfig does not contain var: " + var ) ; } return state ; |
public class MessageProcessorMatching { /** * Method removeConsumerDispatcherMatchTarget
* Used to remove a ConsumerDispatcher from the MatchSpace .
* @ param consumerDispatcher The consumer dispatcher to remove */
public void removeConsumerDispatcherMatchTarget ( ConsumerDispatcher consumerDispatcher , SelectionCriteria selectionCriteria ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeConsumerDispatcherMatchTarget" , new Object [ ] { consumerDispatcher , selectionCriteria } ) ; // Remove the consumer point from the matchspace
// Set the CD and selection criteria into a wrapper that extends MatchTarget
MatchingConsumerDispatcherWithCriteira key = new MatchingConsumerDispatcherWithCriteira ( consumerDispatcher , selectionCriteria ) ; // Reset the CD flag to indicate that this subscription is not in the MatchSpace .
consumerDispatcher . setIsInMatchSpace ( false ) ; try { removeTarget ( key ) ; } catch ( MatchingException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerDispatcherMatchTarget" , "1:1312:1.117.1.11" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConsumerDispatcherMatchTarget" , "SICoreException" ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.matching.MessageProcessorMatching" , "1:1323:1.117.1.11" , e } ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.matching.MessageProcessorMatching" , "1:1331:1.117.1.11" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConsumerDispatcherMatchTarget" ) ; |
public class AmazonWorkMailClient { /** * Removes a member from the resource ' s set of delegates .
* @ param disassociateDelegateFromResourceRequest
* @ return Result of the DisassociateDelegateFromResource operation returned by the service .
* @ throws EntityNotFoundException
* The identifier supplied for the user , group , or resource does not exist in your organization .
* @ throws EntityStateException
* You are performing an operation on a user , group , or resource that isn ' t in the expected state , such as
* trying to delete an active user .
* @ throws InvalidParameterException
* One or more of the input parameters don ' t match the service ' s restrictions .
* @ throws OrganizationNotFoundException
* An operation received a valid organization identifier that either doesn ' t belong or exist in the system .
* @ throws OrganizationStateException
* The organization must have a valid state ( Active or Synchronizing ) to perform certain operations on the
* organization or its members .
* @ sample AmazonWorkMail . DisassociateDelegateFromResource
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / workmail - 2017-10-01 / DisassociateDelegateFromResource "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DisassociateDelegateFromResourceResult disassociateDelegateFromResource ( DisassociateDelegateFromResourceRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDisassociateDelegateFromResource ( request ) ; |
public class MendeleyConverter { /** * Converts the given Mendeley document to CSL item data
* @ param documentId the Mendeley document ' s ID . Will be used as citation
* key if the document does not contain its own
* @ param document the Mendeley document
* @ return the CSL item data */
public static CSLItemData convert ( String documentId , Map < String , Object > document ) { } } | // convert citation id
String id = ( String ) document . get ( FIELD_CITATION_KEY ) ; if ( id == null ) { id = documentId ; } // convert type
String mtype = strOrNull ( document . get ( FIELD_TYPE ) ) ; CSLType type = toType ( mtype ) ; CSLItemDataBuilder builder = new CSLItemDataBuilder ( ) . id ( id ) . type ( type ) ; // convert authors
if ( document . containsKey ( FIELD_AUTHORS ) ) { @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > al = ( List < Map < String , Object > > ) document . get ( FIELD_AUTHORS ) ; builder . author ( toAuthors ( al ) ) ; } // convert editors
if ( document . containsKey ( FIELD_EDITORS ) ) { @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > el = ( List < Map < String , Object > > ) document . get ( FIELD_EDITORS ) ; CSLName [ ] editors = toAuthors ( el ) ; builder . editor ( editors ) ; builder . collectionEditor ( editors ) ; builder . containerAuthor ( editors ) ; } if ( document . containsKey ( FIELD_SERIES_EDITOR ) ) { String seriesEditor = strOrNull ( document . get ( FIELD_SERIES_EDITOR ) ) ; if ( seriesEditor != null ) { CSLName [ ] sen = NameParser . parse ( seriesEditor ) ; builder . collectionEditor ( sen ) ; builder . containerAuthor ( sen ) ; } } // convert translators
if ( document . containsKey ( FIELD_TRANSLATORS ) ) { @ SuppressWarnings ( "unchecked" ) List < Map < String , Object > > tl = ( List < Map < String , Object > > ) document . get ( FIELD_TRANSLATORS ) ; builder . translator ( toAuthors ( tl ) ) ; } // convert issue date
if ( document . containsKey ( FIELD_YEAR ) ) { CSLDateBuilder db = new CSLDateBuilder ( ) ; int year = Integer . parseInt ( document . get ( FIELD_YEAR ) . toString ( ) ) ; if ( document . containsKey ( FIELD_MONTH ) ) { int month = Integer . parseInt ( document . get ( FIELD_MONTH ) . toString ( ) ) ; if ( document . containsKey ( FIELD_DAY ) ) { int day = Integer . parseInt ( document . get ( FIELD_DAY ) . toString ( ) ) ; db . dateParts ( year , month , day ) ; } else { db . dateParts ( year , month ) ; } } else { db . dateParts ( year ) ; } CSLDate d = db . build ( ) ; builder . issued ( d ) ; builder . eventDate ( d ) ; } // convert number
if ( document . containsKey ( FIELD_REVISION ) ) { builder . number ( strOrNull ( document . get ( FIELD_REVISION ) ) ) ; } else { builder . number ( strOrNull ( document . get ( FIELD_SERIES_NUMBER ) ) ) ; } // convert container title
String containerTitle ; if ( document . containsKey ( FIELD_SERIES ) ) { containerTitle = strOrNull ( document . get ( FIELD_SERIES ) ) ; } else { containerTitle = strOrNull ( document . get ( FIELD_SOURCE ) ) ; } builder . containerTitle ( containerTitle ) ; builder . collectionTitle ( containerTitle ) ; // convert publisher
if ( mtype . equalsIgnoreCase ( TYPE_PATENT ) && document . containsKey ( FIELD_SOURCE ) ) { builder . publisher ( strOrNull ( document . get ( FIELD_SOURCE ) ) ) ; } else { builder . publisher ( strOrNull ( document . get ( FIELD_PUBLISHER ) ) ) ; } // convert access date
if ( document . containsKey ( FIELD_ACCESSED ) ) { builder . accessed ( new CSLDateBuilder ( ) . raw ( strOrNull ( document . get ( FIELD_ACCESSED ) ) ) . build ( ) ) ; } // convert identifiers
if ( document . containsKey ( FIELD_IDENTIFIERS ) ) { @ SuppressWarnings ( "unchecked" ) Map < String , String > identifiers = ( Map < String , String > ) document . get ( FIELD_IDENTIFIERS ) ; builder . DOI ( identifiers . get ( IDENTIFIER_DOI ) ) ; builder . ISBN ( identifiers . get ( IDENTIFIER_ISBN ) ) ; builder . ISSN ( identifiers . get ( IDENTIFIER_ISSN ) ) ; builder . PMID ( identifiers . get ( IDENTIFIER_PMID ) ) ; } // convert keywords
if ( document . containsKey ( FIELD_KEYWORDS ) ) { @ SuppressWarnings ( "unchecked" ) List < String > keywords = ( List < String > ) document . get ( FIELD_KEYWORDS ) ; builder . keyword ( StringUtils . join ( keywords , ',' ) ) ; } // convert URL
if ( document . containsKey ( FIELD_WEBSITES ) ) { @ SuppressWarnings ( "unchecked" ) List < String > websites = ( List < String > ) document . get ( FIELD_WEBSITES ) ; if ( websites . size ( ) > 0 ) { // use the first website only
builder . URL ( websites . get ( 0 ) ) ; } } // convert other fields
builder . abstrct ( strOrNull ( document . get ( FIELD_ABSTRACT ) ) ) ; builder . chapterNumber ( strOrNull ( document . get ( FIELD_CHAPTER ) ) ) ; builder . eventPlace ( strOrNull ( document . get ( FIELD_CITY ) ) ) ; builder . publisherPlace ( strOrNull ( document . get ( FIELD_CITY ) ) ) ; builder . edition ( strOrNull ( document . get ( FIELD_EDITION ) ) ) ; builder . genre ( strOrNull ( document . get ( FIELD_GENRE ) ) ) ; builder . issue ( strOrNull ( document . get ( FIELD_ISSUE ) ) ) ; builder . language ( strOrNull ( document . get ( FIELD_LANGUAGE ) ) ) ; builder . medium ( strOrNull ( document . get ( FIELD_MEDIUM ) ) ) ; builder . page ( strOrNull ( document . get ( FIELD_PAGES ) ) ) ; builder . shortTitle ( strOrNull ( document . get ( FIELD_SHORT_TITLE ) ) ) ; builder . title ( strOrNull ( document . get ( FIELD_TITLE ) ) ) ; builder . volume ( strOrNull ( document . get ( FIELD_VOLUME ) ) ) ; return builder . build ( ) ; |
public class FieldDescriptorConstraints { /** * Checks that native primarykey fields have readonly access , and warns if not .
* @ param fieldDef The field descriptor
* @ param checkLevel The current check level ( this constraint is checked in basic and strict ) */
private void checkReadonlyAccessForNativePKs ( FieldDescriptorDef fieldDef , String checkLevel ) { } } | if ( CHECKLEVEL_NONE . equals ( checkLevel ) ) { return ; } String access = fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_ACCESS ) ; String autoInc = fieldDef . getProperty ( PropertyHelper . OJB_PROPERTY_AUTOINCREMENT ) ; if ( "database" . equals ( autoInc ) && ! "readonly" . equals ( access ) ) { LogHelper . warn ( true , FieldDescriptorConstraints . class , "checkAccess" , "The field " + fieldDef . getName ( ) + " in class " + fieldDef . getOwner ( ) . getName ( ) + " is set to database auto-increment. Therefore the field's access is set to 'readonly'." ) ; fieldDef . setProperty ( PropertyHelper . OJB_PROPERTY_ACCESS , "readonly" ) ; } |
public class DelimitedOutputFormat { @ Override public void close ( ) throws IOException { } } | if ( this . stream != null ) { this . stream . write ( this . buffer , 0 , this . pos ) ; } // close file stream
super . close ( ) ; |
public class JcCollection { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the last element of a collection < / i > < / div >
* < br / > */
@ SuppressWarnings ( "unchecked" ) public T last ( ) { } } | T ret ; if ( JcRelation . class . equals ( type ) ) { ret = ( T ) new JcRelation ( null , this , new FunctionInstance ( FUNCTION . Collection . LAST , 1 ) ) ; } else if ( JcNode . class . equals ( type ) ) { ret = ( T ) new JcNode ( null , this , new FunctionInstance ( FUNCTION . Collection . LAST , 1 ) ) ; } else { ret = ( T ) new JcValue ( null , this , new FunctionInstance ( FUNCTION . Collection . LAST , 1 ) ) ; } QueryRecorder . recordInvocationConditional ( this , "last" , ret ) ; return ret ; |
public class ReactionSchemeManipulator { /** * Get all ID of this IReactionSet .
* @ param scheme The IReactionScheme to analyze
* @ return A List with all ID */
public static List < String > getAllIDs ( IReactionScheme scheme ) { } } | List < String > IDlist = new ArrayList < String > ( ) ; if ( scheme . getID ( ) != null ) IDlist . add ( scheme . getID ( ) ) ; for ( IReaction reaction : scheme . reactions ( ) ) { IDlist . addAll ( ReactionManipulator . getAllIDs ( reaction ) ) ; } if ( scheme . getReactionSchemeCount ( ) != 0 ) for ( IReactionScheme rs : scheme . reactionSchemes ( ) ) { IDlist . addAll ( getAllIDs ( rs ) ) ; } return IDlist ; |
public class SubtitleChatOverlay { /** * Create a subtitle , but don ' t do anything funny with it . */
protected ChatGlyph createSubtitle ( ChatMessage message , int type , Graphics2D layoutGfx , boolean expires ) { } } | // we might need to modify the textual part with translations , but we can ' t do that to the
// message object , since other chatdisplays also get it .
String text = message . message ; Tuple < String , Boolean > finfo = _logic . decodeFormat ( type , message . getFormat ( ) ) ; String format = finfo . left ; boolean quotes = finfo . right ; // now format the text
if ( format != null ) { if ( quotes ) { text = "\"" + text + "\"" ; } text = " " + text ; text = xlate ( MessageBundle . tcompose ( format , ( ( UserMessage ) message ) . getSpeakerDisplayName ( ) ) ) + text ; } return createSubtitle ( layoutGfx , type , message . timestamp , null , 0 , text , expires ) ; |
public class Strands { /** * This utility method prints a stack - trace into a { @ link java . io . PrintWriter }
* @ param trace a stack trace ( such as returned from { @ link Strand # getStackTrace ( ) } .
* @ param out the { @ link java . io . PrintWriter } into which the stack trace will be printed . */
public static void printStackTrace ( StackTraceElement [ ] trace , java . io . PrintWriter out ) { } } | Strand . printStackTrace ( trace , out ) ; |
public class HibernateSessionService { /** * closeSession
* @ throws org . hibernate . HibernateException if any . */
public void closeSession ( ) throws HibernateException { } } | Session s = threadSession . get ( ) ; threadSession . set ( null ) ; if ( s != null ) { s . close ( ) ; } Transaction tx = threadTransaction . get ( ) ; if ( tx != null ) { threadTransaction . set ( null ) ; // log warning todo
} |
public class BoundedBuffer { /** * @ awisniew - ADDED
* ( non - Javadoc )
* @ see java . util . concurrent . BlockingQueue # drainTo ( java . util . Collection , int ) */
@ Override public int drainTo ( Collection < ? super T > c , int maxElements ) { } } | // TODO - The elements aren ' t added to the given collection . . .
if ( c == null ) throw new NullPointerException ( ) ; if ( c == this ) throw new IllegalArgumentException ( ) ; int n = Math . min ( maxElements , size ( ) ) ; int numRemaining = n ; synchronized ( this ) { synchronized ( lock ) { // Retrieve and remove at most n elements from the expedited buffer and add them to the passed collection
for ( int i = 0 ; i < n ; i ++ ) { T retrieved = expeditedExtract ( ) ; numRemaining = n - i ; if ( retrieved != null ) { numberOfUsedExpeditedSlots . getAndDecrement ( ) ; // TODO if expedited is added for put or offer with timeout add notification here
} else { break ; // retrieved is null so nothing left in the expedited buffer , move on to the main buffer
} } // Retrieve and remove at most numRemaining elements and add them to the passed collection
for ( int i = 0 ; i < numRemaining ; i ++ ) { T retrieved = extract ( ) ; numberOfUsedSlots . getAndDecrement ( ) ; if ( retrieved != null ) { notifyPut_ ( ) ; } } } } return n ; |
public class FSNamesystem { /** * Get a listing of all files at ' src ' . The Object [ ] array
* exists so we can return file attributes ( soon to be implemented ) */
public HdfsFileStatus [ ] getHdfsListing ( String src ) throws IOException { } } | getListingCheck ( src ) ; HdfsFileStatus [ ] stats = dir . getHdfsListing ( src ) ; if ( auditLog . isInfoEnabled ( ) ) { logAuditEvent ( getCurrentUGI ( ) , Server . getRemoteIp ( ) , "listStatus" , src , null , null ) ; } return stats ; |
public class AnnotatorPlugin { private JPanel getPnl_mainPanel ( ) { } } | if ( pnl_mainPanel == null ) { pnl_mainPanel = new JPanel ( ) ; GridBagLayout gbl_pathsPanel = new GridBagLayout ( ) ; gbl_pathsPanel . columnWeights = new double [ ] { 0.0 , 1.0 , 1.0 } ; gbl_pathsPanel . rowWeights = new double [ ] { 0.05 , 0.05 , 0.0 , 0.0 } ; pnl_mainPanel . setLayout ( gbl_pathsPanel ) ; GridBagConstraints gbc_selection = new GridBagConstraints ( ) ; gbc_selection . insets = new Insets ( 0 , 0 , 5 , 5 ) ; gbc_selection . fill = GridBagConstraints . HORIZONTAL ; gbc_selection . gridx = 0 ; gbc_selection . gridy = 0 ; pnl_mainPanel . add ( getPnl_selection ( ) , gbc_selection ) ; GridBagConstraints gbc_control = new GridBagConstraints ( ) ; gbc_control . insets = new Insets ( 0 , 0 , 5 , 5 ) ; gbc_control . fill = GridBagConstraints . HORIZONTAL ; gbc_control . gridx = 0 ; gbc_control . gridy = 1 ; pnl_mainPanel . add ( getPnl_control ( ) , gbc_control ) ; GridBagConstraints gbc_extractionScroll = new GridBagConstraints ( ) ; gbc_extractionScroll . insets = new Insets ( 0 , 0 , 0 , 5 ) ; gbc_extractionScroll . weighty = 1.0 ; gbc_extractionScroll . gridheight = 4 ; gbc_extractionScroll . fill = GridBagConstraints . BOTH ; gbc_extractionScroll . gridx = 1 ; gbc_extractionScroll . gridy = 0 ; pnl_mainPanel . add ( getScrl_tagTable ( ) , gbc_extractionScroll ) ; GridBagConstraints gbc_pnl_settings = new GridBagConstraints ( ) ; gbc_pnl_settings . insets = new Insets ( 0 , 0 , 5 , 5 ) ; gbc_pnl_settings . fill = GridBagConstraints . BOTH ; gbc_pnl_settings . gridx = 0 ; gbc_pnl_settings . gridy = 2 ; pnl_mainPanel . add ( getPnl_settings ( ) , gbc_pnl_settings ) ; GridBagConstraints gbc_pnl_info = new GridBagConstraints ( ) ; gbc_pnl_info . insets = new Insets ( 0 , 0 , 5 , 0 ) ; gbc_pnl_info . weighty = 1.0 ; gbc_pnl_info . weightx = 1.0 ; gbc_pnl_info . gridheight = 2 ; gbc_pnl_info . fill = GridBagConstraints . BOTH ; gbc_pnl_info . gridx = 2 ; gbc_pnl_info . gridy = 0 ; pnl_mainPanel . add ( getPanel_1 ( ) , gbc_pnl_info ) ; GridBagConstraints gbc_lblSelectionStatus = new GridBagConstraints ( ) ; gbc_lblSelectionStatus . anchor = GridBagConstraints . SOUTHEAST ; gbc_lblSelectionStatus . insets = new Insets ( 0 , 0 , 5 , 5 ) ; gbc_lblSelectionStatus . gridx = 2 ; gbc_lblSelectionStatus . gridy = 2 ; pnl_mainPanel . add ( getLblSelectionStatus ( ) , gbc_lblSelectionStatus ) ; GridBagConstraints gbc_storageButtonPanel = new GridBagConstraints ( ) ; gbc_storageButtonPanel . anchor = GridBagConstraints . EAST ; gbc_storageButtonPanel . fill = GridBagConstraints . VERTICAL ; gbc_storageButtonPanel . gridx = 2 ; gbc_storageButtonPanel . gridy = 3 ; pnl_mainPanel . add ( getStorageButtonPanel ( ) , gbc_storageButtonPanel ) ; } return pnl_mainPanel ; |
public class JvmExecutableImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EList < JvmTypeReference > getExceptions ( ) { } } | if ( exceptions == null ) { exceptions = new EObjectContainmentEList < JvmTypeReference > ( JvmTypeReference . class , this , TypesPackage . JVM_EXECUTABLE__EXCEPTIONS ) ; } return exceptions ; |
public class ProducerSequenceFactory { /** * Returns a sequence that can be used for a request for an encoded image from either network or
* local files .
* @ param imageRequest the request that will be submitted
* @ return the sequence that should be used to process the request */
public Producer < CloseableReference < PooledByteBuffer > > getEncodedImageProducerSequence ( ImageRequest imageRequest ) { } } | try { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . beginSection ( "ProducerSequenceFactory#getEncodedImageProducerSequence" ) ; } validateEncodedImageRequest ( imageRequest ) ; final Uri uri = imageRequest . getSourceUri ( ) ; switch ( imageRequest . getSourceUriType ( ) ) { case SOURCE_TYPE_NETWORK : return getNetworkFetchEncodedImageProducerSequence ( ) ; case SOURCE_TYPE_LOCAL_VIDEO_FILE : case SOURCE_TYPE_LOCAL_IMAGE_FILE : return getLocalFileFetchEncodedImageProducerSequence ( ) ; default : throw new IllegalArgumentException ( "Unsupported uri scheme for encoded image fetch! Uri is: " + getShortenedUriString ( uri ) ) ; } } finally { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . endSection ( ) ; } } |
public class Commands { /** * Runs a script from the specified file .
* @ param line Command line
* @ param callback Callback for command status */
public void run ( String line , DispatchCallback callback ) { } } | String filename ; if ( line . length ( ) == "run" . length ( ) || ( filename = sqlLine . dequote ( line . substring ( "run" . length ( ) + 1 ) ) ) == null ) { sqlLine . error ( "Usage: run <file name>" ) ; callback . setToFailure ( ) ; return ; } List < String > cmds = new LinkedList < > ( ) ; try { final Parser parser = sqlLine . getLineReader ( ) . getParser ( ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( expand ( filename ) ) , StandardCharsets . UTF_8 ) ) ) { // # # # NOTE : fix for sf . net bug 879427
final StringBuilder cmd = new StringBuilder ( ) ; boolean needsContinuation ; for ( ; ; ) { final String scriptLine = reader . readLine ( ) ; if ( scriptLine == null ) { break ; } // we ' re continuing an existing command
cmd . append ( " \n" ) ; cmd . append ( scriptLine ) ; try { needsContinuation = false ; parser . parse ( cmd . toString ( ) , cmd . length ( ) , Parser . ParseContext . ACCEPT_LINE ) ; } catch ( EOFError e ) { needsContinuation = true ; } if ( ! needsContinuation && ! cmd . toString ( ) . trim ( ) . isEmpty ( ) ) { cmds . add ( maybeTrim ( cmd . toString ( ) ) ) ; cmd . setLength ( 0 ) ; } } if ( SqlLineParser . isSql ( sqlLine , cmd . toString ( ) , Parser . ParseContext . ACCEPT_LINE ) ) { // # # # REVIEW : oops , somebody left the last command
// unterminated ; should we fix it for them or complain ?
// For now be nice and fix it .
cmd . append ( ";" ) ; cmds . add ( cmd . toString ( ) ) ; } } // success only if all the commands were successful
if ( sqlLine . runCommands ( cmds , callback ) == cmds . size ( ) ) { callback . setToSuccess ( ) ; } else { callback . setToFailure ( ) ; } } catch ( Exception e ) { callback . setToFailure ( ) ; sqlLine . error ( e ) ; } |
public class M3UAManagementImpl { /** * Create new { @ link AspFactoryImpl } without passing optional aspid
* @ param aspName
* @ param associationName
* @ return
* @ throws Exception */
public AspFactory createAspFactory ( String aspName , String associationName , boolean isHeartBeatEnabled ) throws Exception { } } | long aspid = 0L ; boolean regenerateFlag = true ; while ( regenerateFlag ) { aspid = AspFactoryImpl . generateId ( ) ; if ( aspfactories . size ( ) == 0 ) { // Special case where this is first Asp added
break ; } for ( FastList . Node < AspFactory > n = aspfactories . head ( ) , end = aspfactories . tail ( ) ; ( n = n . getNext ( ) ) != end ; ) { AspFactoryImpl aspFactoryImpl = ( AspFactoryImpl ) n . getValue ( ) ; if ( aspid == aspFactoryImpl . getAspid ( ) . getAspId ( ) ) { regenerateFlag = true ; break ; } else { regenerateFlag = false ; } } // for
} // while
return this . createAspFactory ( aspName , associationName , aspid , isHeartBeatEnabled ) ; |
public class TagletWriterImpl { /** * { @ inheritDoc } */
protected Content literalTagOutput ( Tag tag ) { } } | Content result = new StringContent ( utils . normalizeNewlines ( tag . text ( ) ) ) ; return result ; |
public class SendObjectMessageImpl { /** * / * ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . BaseCommand # execute ( ) */
@ SuppressWarnings ( "unchecked" ) @ Override public Boolean execute ( ) { } } | User sfsSender = CommandUtil . getSfsUser ( sender , api ) ; api . sendObjectMessage ( getSfsRoom ( ) , sfsSender , getMessage ( ) , getSFSRecipients ( ) ) ; return Boolean . TRUE ; |
public class ComputeKNNOutlierScores { /** * Write a single output line .
* @ param out Output stream
* @ param ids DBIDs
* @ param result Outlier result
* @ param scaling Scaling function
* @ param label Identification label */
void writeResult ( PrintStream out , DBIDs ids , OutlierResult result , ScalingFunction scaling , String label ) { } } | if ( scaling instanceof OutlierScaling ) { ( ( OutlierScaling ) scaling ) . prepare ( result ) ; } out . append ( label ) ; DoubleRelation scores = result . getScores ( ) ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { double value = scores . doubleValue ( iter ) ; value = scaling != null ? scaling . getScaled ( value ) : value ; out . append ( ' ' ) . append ( Double . toString ( value ) ) ; } out . append ( FormatUtil . NEWLINE ) ; |
public class NavigationHandler { /** * < p class = " changed _ added _ 2_2 " > Overloaded variant of { @ link # handleNavigation ( javax . faces . context . FacesContext , java . lang . String , java . lang . String ) }
* that allows the caller to provide the defining document id for a flow
* to be entered by this navigation . For backward compatibility with
* decorated { @ code NavigationHandler } implementations that conform to an
* earlier version of the specification , an implementation is provided that
* calls through to { @ link # handleNavigation ( javax . faces . context . FacesContext , java . lang . String , java . lang . String ) } ,
* ignoring the { @ code toFlowDocumentId } parameter . < / p >
* @ param context The { @ link FacesContext } for the current request
* @ param fromAction The action binding expression that was evaluated
* to retrieve the specified outcome , or < code > null < / code > if the
* outcome was acquired by some other means
* @ param outcome The logical outcome returned by a previous invoked
* application action ( which may be < code > null < / code > )
* @ param toFlowDocumentId The defining document id of the flow into which
* this navigation will cause entry .
* @ throws NullPointerException if < code > context < / code >
* is < code > null < / code > */
public void handleNavigation ( FacesContext context , String fromAction , String outcome , String toFlowDocumentId ) { } } | this . handleNavigation ( context , fromAction , outcome ) ; |
public class DescribeParametersRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeParametersRequest describeParametersRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeParametersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeParametersRequest . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( describeParametersRequest . getParameterFilters ( ) , PARAMETERFILTERS_BINDING ) ; protocolMarshaller . marshall ( describeParametersRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeParametersRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SocketCache { /** * Empty the cache , and close all sockets . */
public void clear ( ) { } } | List < Socket > socketsToClear = new LinkedList < Socket > ( ) ; synchronized ( multimap ) { for ( Socket sock : multimap . values ( ) ) { socketsToClear . add ( sock ) ; } multimap . clear ( ) ; } for ( Socket sock : socketsToClear ) { IOUtils . closeSocket ( sock ) ; } |
public class Client { /** * Enroll a user with a given authentication factor .
* @ param userId
* The id of the user .
* @ param factorId
* The identifier of the factor to enroll the user with .
* @ param displayName
* A name for the users device .
* @ param number
* The phone number of the user in E . 164 format .
* @ return OTPDevice The MFA device
* @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
* @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
* @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
* @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / multi - factor - authentication / enroll - factor " > Enroll an Authentication Factor documentation < / a > */
public OTPDevice enrollFactor ( long userId , long factorId , String displayName , String number ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } } | cleanError ( ) ; prepareToken ( ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . ENROLL_FACTOR_URL , userId ) ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; HashMap < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "factor_id" , factorId ) ; params . put ( "display_name" , displayName ) ; params . put ( "number" , number ) ; String body = JSONUtils . buildJSON ( params ) ; bearerRequest . setBody ( body ) ; OTPDevice otpDevice = null ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . POST , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) == 200 ) { JSONObject data = oAuthResponse . getData ( ) ; otpDevice = new OTPDevice ( data ) ; } else { error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; } return otpDevice ; |
public class RedisDLock { /** * { @ inheritDoc } */
@ Override public RedisDLock init ( ) { } } | /* * Parse custom property : redis - host - and - port */
String hostAndPort = getLockProperty ( LOCK_PROP_REDIS_HOST_AND_PORT ) ; if ( ! StringUtils . isBlank ( hostAndPort ) ) { this . redisHostAndPort = hostAndPort ; } super . init ( ) ; return this ; |
public class DraggableViewCallback { /** * Override method used to apply different scale and alpha effects while the view is being
* dragged .
* @ param left position .
* @ param top position .
* @ param dx change in X position from the last call .
* @ param dy change in Y position from the last call . */
@ Override public void onViewPositionChanged ( View changedView , int left , int top , int dx , int dy ) { } } | if ( draggableView . isDragViewAtBottom ( ) ) { draggableView . changeDragViewViewAlpha ( ) ; } else { draggableView . restoreAlpha ( ) ; draggableView . changeDragViewScale ( ) ; draggableView . changeDragViewPosition ( ) ; draggableView . changeSecondViewAlpha ( ) ; draggableView . changeSecondViewPosition ( ) ; draggableView . changeBackgroundAlpha ( ) ; } |
public class JDefaultBase { /** * Fetches a random Object from the dictionary based on a key
* @ param key of the object to find
* @ return the Object that represents the key */
protected static Object fetch ( String key ) { } } | List valuesArray = ( List ) fetchObject ( key ) ; return valuesArray . get ( RandomUtils . nextInt ( valuesArray . size ( ) ) ) ; |
public class vpnglobal_auditsyslogpolicy_binding { /** * Use this API to fetch filtered set of vpnglobal _ auditsyslogpolicy _ binding resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static vpnglobal_auditsyslogpolicy_binding [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | vpnglobal_auditsyslogpolicy_binding obj = new vpnglobal_auditsyslogpolicy_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpnglobal_auditsyslogpolicy_binding [ ] response = ( vpnglobal_auditsyslogpolicy_binding [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class WidgetFactory { /** * Create a { @ link Widget } of the specified { @ code widgetClass } to wrap the
* root { @ link GVRSceneObject } of the scene graph loaded from a file .
* @ param gvrContext
* The { @ link GVRContext } to load the model into .
* @ param modelFile
* The asset file to load the model from .
* @ param widgetClass
* The { @ linkplain Class } of the { @ code Widget } to wrap the root
* { @ code GVRSceneObject } with .
* @ return A new { @ code AbsoluteLayout } instance .
* @ throws InstantiationException
* If the { @ code Widget } can ' t be instantiated for any reason .
* @ throws IOException
* If the model file can ' t be read . */
@ SuppressWarnings ( "WeakerAccess" ) public static Widget createWidgetFromModel ( final GVRContext gvrContext , final String modelFile , Class < ? extends Widget > widgetClass ) throws InstantiationException , IOException { } } | GVRSceneObject rootNode = loadModel ( gvrContext , modelFile ) ; return createWidget ( rootNode , widgetClass ) ; |
public class SimpleSynchronousNotificationExecutor { /** * Fire notification of a new entry added to the registry .
* @ param putKey key identifying the entry in the registry .
* @ param putValue value of the entry in the registry . */
public void firePutNotification ( Iterator < RegistryListener < K , V > > listeners , K putKey , V putValue ) { } } | while ( listeners . hasNext ( ) ) { listeners . next ( ) . onPutEntry ( putKey , putValue ) ; } |
public class CmsDateBox { /** * Sets the value of the date box . < p > */
private void updateFromPicker ( ) { } } | checkTime ( ) ; Date date = m_picker . getValue ( ) ; if ( ! m_dateOnly ) { String timeAsString = getTimeText ( ) ; date = CmsDateConverter . getDateWithTime ( date , timeAsString ) ; } setValue ( date ) ; setErrorMessage ( null ) ; fireChange ( date , false ) ; |
public class LocalisationManager { /** * Method addXmitQueuePoint
* @ param meUuid
* @ param ptoPMessageItemStream */
public void addXmitQueuePoint ( SIBUuid8 meUuid , PtoPMessageItemStream ptoPMessageItemStream ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addXmitQueuePoint" , meUuid ) ; if ( _xmitQueuePoints != null ) { synchronized ( _xmitQueuePoints ) { _xmitQueuePoints . put ( meUuid , ptoPMessageItemStream ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addXmitQueuePoint" ) ; |
public class RunResultRecorder { /** * Adds the html reports actions to the left side menu .
* @ param build */
private void publishLrReports ( @ Nonnull Run < ? , ? > build ) throws IOException { } } | File reportDirectory = new File ( build . getRootDir ( ) , PERFORMANCE_REPORT_FOLDER ) ; if ( reportDirectory . exists ( ) ) { File htmlIndexFile = new File ( reportDirectory , INDEX_HTML_NAME ) ; if ( htmlIndexFile . exists ( ) ) { build . replaceAction ( new PerformanceReportAction ( build ) ) ; } } File summaryDirectory = new File ( build . getRootDir ( ) , TRANSACTION_SUMMARY_FOLDER ) ; if ( summaryDirectory . exists ( ) ) { File htmlIndexFile = new File ( summaryDirectory , INDEX_HTML_NAME ) ; if ( htmlIndexFile . exists ( ) ) { build . replaceAction ( new TransactionSummaryAction ( build ) ) ; } } |
public class ZooKeeperClient { /** * Creates a node , with initial values .
* Note : nodes are created recursively ( parent nodes are created if needed ) .
* @ param path
* @ param value
* @ return
* @ throws ZooKeeperException */
public boolean createNode ( String path , String value ) throws ZooKeeperException { } } | return _create ( path , value != null ? value . getBytes ( UTF8 ) : null , CreateMode . PERSISTENT ) ; |
public class MongoDBBasicOperations { /** * Return the object as defined by this primary key .
* @ param primaryID
* the primary key for record
* @ return the record if available , < code > null < / code > otherwise */
@ Override public T get ( X primaryID ) { } } | if ( primaryID == null ) { return null ; } T dbObject = this . mongoTemplate . findById ( primaryID , this . entityClass ) ; return dbObject ; |
public class PropertiesMapping { /** * getDeclaredFields ( ) 能访问类中所有的字段 , 与public , private , protect无关 , 不能访问从其它类继承来的方法
* @ param ps */
public final void loadAll ( Properties ps ) { } } | // 表示如果Field是static的 , 则obj即便给它传值 , JVM也会忽略的 。 还说明了 , 此入参在这种情况下可以为null
for ( Field f : getClass ( ) . getDeclaredFields ( ) ) { try { setFiled ( f , ps . getProperty ( f . getName ( ) ) ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } |
public class ObjectParameter { /** * Parse primitive serialized object .
* @ param objectType the type of the object parsed
* @ param serializedObject the serialized string to parse
* @ return a new fresh instance of the object */
private Object parsePrimitive ( Class < ? > objectType , final String serializedObject ) { } } | Object res = null ; if ( Boolean . class . isAssignableFrom ( objectType ) ) { res = Boolean . valueOf ( serializedObject ) ; } else if ( String . class . isAssignableFrom ( objectType ) ) { res = serializedObject ; } else if ( Character . class . isAssignableFrom ( objectType ) ) { res = Character . valueOf ( serializedObject . charAt ( 0 ) ) ; } else if ( Byte . class . isAssignableFrom ( objectType ) ) { res = Byte . parseByte ( serializedObject ) ; } else if ( Short . class . isAssignableFrom ( objectType ) ) { res = Short . parseShort ( serializedObject ) ; } else if ( Integer . class . isAssignableFrom ( objectType ) ) { res = Integer . parseInt ( serializedObject ) ; } else if ( Long . class . isAssignableFrom ( objectType ) ) { res = Long . parseLong ( serializedObject ) ; } else if ( Float . class . isAssignableFrom ( objectType ) ) { res = Float . parseFloat ( serializedObject ) ; } else if ( Double . class . isAssignableFrom ( objectType ) ) { res = Double . parseDouble ( serializedObject ) ; } return res ; |
public class TransferEncodingValues { /** * Find the enumerated object matching the input name . If this name has
* never been seen prior , then a new object is created by this call .
* @ param name
* @ param offset
* - starting point in that input name
* @ param length
* - length to use from that offset
* @ return TransferEncodingValues
* @ throws NullPointerException
* if input name is null */
public static TransferEncodingValues find ( byte [ ] name , int offset , int length ) { } } | TransferEncodingValues key = ( TransferEncodingValues ) myMatcher . match ( name , offset , length ) ; if ( null == key ) { synchronized ( TransferEncodingValues . class ) { // protect against 2 threads getting here on the new value by
// testing again inside a sync block
key = ( TransferEncodingValues ) myMatcher . match ( name , offset , length ) ; if ( null == key ) { key = new TransferEncodingValues ( new String ( name , offset , length ) ) ; key . undefined = true ; } } // end - sync
} return key ; |
public class MultipleAlignmentScorer { /** * Calculates the average TMScore of all the possible pairwise structure
* comparisons of the given alignment .
* Complexity : T ( n , l ) = O ( l * n ^ 2 ) , if n = number of structures and l = alignment
* length .
* @ param alignment
* @ return double Average TMscore
* @ throws StructureException */
public static double getAvgTMScore ( MultipleAlignment alignment ) throws StructureException { } } | List < Atom [ ] > trans = MultipleAlignmentTools . transformAtoms ( alignment ) ; List < Integer > lengths = new ArrayList < Integer > ( alignment . size ( ) ) ; for ( Atom [ ] atoms : alignment . getAtomArrays ( ) ) { lengths . add ( atoms . length ) ; } return getAvgTMScore ( trans , lengths ) ; |
public class XmlParser { /** * Read a name or ( when parsing an enumeration ) name token .
* < pre >
* [ 5 ] Name : : = ( Letter | ' _ ' | ' : ' ) ( NameChar ) *
* [ 7 ] Nmtoken : : = ( NameChar ) +
* < / pre > */
private String readNmtoken ( boolean isName ) throws SAXException , IOException { } } | char c ; nameBufferPos = 0 ; // Read the first character .
while ( true ) { c = readCh ( ) ; switch ( c ) { case '%' : case '<' : case '>' : case '&' : case ',' : case '|' : case '*' : case '+' : case '?' : case ')' : case '=' : case '\'' : case '"' : case '[' : case ' ' : case '\t' : case '\n' : case '\r' : case ';' : case '/' : unread ( c ) ; if ( nameBufferPos == 0 ) { fatal ( "name expected" ) ; } String s = intern ( nameBuffer , 0 , nameBufferPos ) ; nameBufferPos = 0 ; return s ; default : if ( isName && ( nameBufferPos == 0 ) && ( ! ( NCName . isNCNameStart ( c ) ) ) ) { fatal ( "Not a name start character, U+" + Integer . toHexString ( c ) ) ; } else if ( ! ( NCName . isNCNameTrail ( c ) || c == ':' ) ) { fatal ( "Not a name character, U+" + Integer . toHexString ( c ) ) ; } if ( nameBufferPos >= nameBuffer . length ) { nameBuffer = ( char [ ] ) extendArray ( nameBuffer , nameBuffer . length , nameBufferPos ) ; } nameBuffer [ nameBufferPos ++ ] = c ; } } |
public class MicroMetaDao { /** * 锟斤拷荼锟斤拷锟缴撅拷锟 � */
public int delObjByCondition ( String tableName , String condition , Object [ ] paramArray , int [ ] typeArray ) { } } | // JdbcTemplate jdbcTemplate = ( JdbcTemplate ) MicroDbHolder . getDbSource ( dbName ) ;
// String tableName = changeTableNameCase ( otableName ) ;
JdbcTemplate jdbcTemplate = getMicroJdbcTemplate ( ) ; String sql = "delete from " + tableName + " where " + condition ; logger . debug ( sql ) ; logger . debug ( Arrays . toString ( paramArray ) ) ; Integer retStatus = jdbcTemplate . update ( sql , paramArray , typeArray ) ; return retStatus ; |
public class DefaultExpander { /** * Expand LHS for a construction
* @ param lhs
* @ param lineOffset
* @ return */
private String expandLHS ( final String lhs , int lineOffset ) { } } | substitutions = new ArrayList < Map < String , String > > ( ) ; // logger . info ( " * * * LHS > " + lhs + " < " ) ;
final StringBuilder buf = new StringBuilder ( ) ; final String [ ] lines = lhs . split ( ( lhs . indexOf ( "\r\n" ) >= 0 ? "\r\n" : "\n" ) , - 1 ) ; // since we assembled the string , we know line breaks are \ n
final String [ ] expanded = new String [ lines . length ] ; // buffer for expanded lines
int lastExpanded = - 1 ; int lastPattern = - 1 ; for ( int i = 0 ; i < lines . length - 1 ; i ++ ) { final String trimmed = lines [ i ] . trim ( ) ; expanded [ ++ lastExpanded ] = lines [ i ] ; if ( trimmed . length ( ) == 0 || trimmed . startsWith ( "#" ) || trimmed . startsWith ( "//" ) ) { // comments - do nothing
} else if ( trimmed . startsWith ( ">" ) ) { // passthrough code - simply remove the passthrough mark character
expanded [ lastExpanded ] = lines [ i ] . replaceFirst ( ">" , " " ) ; lastPattern = lastExpanded ; } else { // regular expansion - expand the expression
expanded [ lastExpanded ] = substitute ( expanded [ lastExpanded ] , this . condition , i + lineOffset , useWhen , showSteps ) ; // do we need to report errors for that ?
if ( lines [ i ] . equals ( expanded [ lastExpanded ] ) ) { // report error
this . addError ( new ExpanderException ( "Unable to expand: " + lines [ i ] . replaceAll ( "[\n\r]" , "" ) . trim ( ) , i + lineOffset ) ) ; } // but if the original starts with a " - " , it means we need to add it
// as a constraint to the previous pattern
if ( trimmed . startsWith ( "-" ) && ( ! lines [ i ] . equals ( expanded [ lastExpanded ] ) ) ) { if ( lastPattern >= 0 ) { ConstraintInformation c = ConstraintInformation . findConstraintInformationInPattern ( expanded [ lastPattern ] ) ; if ( c . start > - 1 ) { // rebuilding previous pattern structure
expanded [ lastPattern ] = expanded [ lastPattern ] . substring ( 0 , c . start ) + c . constraints + ( ( c . constraints . trim ( ) . length ( ) == 0 ) ? "" : ", " ) + expanded [ lastExpanded ] . trim ( ) + expanded [ lastPattern ] . substring ( c . end ) ; } else { // error , pattern not found to add constraint to
this . addError ( new ExpanderException ( "No pattern was found to add the constraint to: " + lines [ i ] . trim ( ) , i + lineOffset ) ) ; } } lastExpanded -- ; } else { lastPattern = lastExpanded ; } } } for ( int i = 0 ; i <= lastExpanded ; i ++ ) { buf . append ( expanded [ i ] ) ; buf . append ( nl ) ; } return buf . toString ( ) ; |
public class RowIndexSearcher { /** * Returns the { @ link Search } contained in the specified list of { @ link IndexExpression } s .
* @ param clause A list of { @ link IndexExpression } s .
* @ return The { @ link Search } contained in the specified list of { @ link IndexExpression } s . */
private Search search ( List < IndexExpression > clause ) { } } | IndexExpression indexedExpression = indexedExpression ( clause ) ; String json = UTF8Type . instance . compose ( indexedExpression . value ) ; return Search . fromJson ( json ) ; |
public class CloudSnippets { /** * Example of running a query with named query parameters . */
public void runQueryWithNamedParameters ( ) throws InterruptedException { } } | // [ START bigquery _ query _ params _ named ]
// BigQuery bigquery = BigQueryOptions . getDefaultInstance ( ) . getService ( ) ;
String corpus = "romeoandjuliet" ; long minWordCount = 250 ; String query = "SELECT word, word_count\n" + "FROM `bigquery-public-data.samples.shakespeare`\n" + "WHERE corpus = @corpus\n" + "AND word_count >= @min_word_count\n" + "ORDER BY word_count DESC" ; // Note : Standard SQL is required to use query parameters .
QueryJobConfiguration queryConfig = QueryJobConfiguration . newBuilder ( query ) . addNamedParameter ( "corpus" , QueryParameterValue . string ( corpus ) ) . addNamedParameter ( "min_word_count" , QueryParameterValue . int64 ( minWordCount ) ) . build ( ) ; // Print the results .
for ( FieldValueList row : bigquery . query ( queryConfig ) . iterateAll ( ) ) { for ( FieldValue val : row ) { System . out . printf ( "%s," , val . toString ( ) ) ; } System . out . printf ( "\n" ) ; } // [ END bigquery _ query _ params _ named ] |
public class SQLDroidPreparedStatement { /** * Set the parameter from the contents of a binary stream .
* @ param parameterIndex the index of the parameter to set
* @ param inputStream the input stream from which a byte array will be read and set as the value . If inputStream is null
* this method will throw a SQLException
* @ param length a positive non - zero length values
* @ exception SQLException thrown if the length is & lt ; = 0 , the inputStream is null ,
* there is an IOException reading the inputStream or if " setBytes " throws a SQLException */
@ Override public void setBinaryStream ( int parameterIndex , InputStream inputStream , int length ) throws SQLException { } } | if ( length <= 0 ) { throw new SQLException ( "Invalid length " + length ) ; } if ( inputStream == null ) { throw new SQLException ( "Input Stream cannot be null" ) ; } final int bufferSize = 8192 ; byte [ ] buffer = new byte [ bufferSize ] ; ByteArrayOutputStream outputStream = null ; try { outputStream = new ByteArrayOutputStream ( ) ; int bytesRemaining = length ; int bytesRead ; int maxReadSize ; while ( bytesRemaining > 0 ) { maxReadSize = ( bytesRemaining > bufferSize ) ? bufferSize : bytesRemaining ; bytesRead = inputStream . read ( buffer , 0 , maxReadSize ) ; if ( bytesRead == - 1 ) { // inputStream exhausted
break ; } outputStream . write ( buffer , 0 , bytesRead ) ; bytesRemaining = bytesRemaining - bytesRead ; } setBytes ( parameterIndex , outputStream . toByteArray ( ) ) ; outputStream . close ( ) ; } catch ( IOException e ) { throw new SQLException ( e . getMessage ( ) ) ; } |
public class CmsImportVersion7 { /** * Imports a resource from the current xml data . < p >
* @ see # addResourceAttributesRules ( Digester , String )
* @ see # addResourcePropertyRules ( Digester , String ) */
public void importResource ( ) { } } | boolean resourceIdWasNull = false ; try { if ( m_throwable != null ) { getReport ( ) . println ( m_throwable ) ; getReport ( ) . addError ( m_throwable ) ; CmsMessageContainer message = Messages . get ( ) . container ( Messages . ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0 ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( message . key ( ) , m_throwable ) ; } m_throwable = null ; m_importACEs = false ; m_resource = null ; return ; } // apply name translation and import path
String translatedName = getCms ( ) . getRequestContext ( ) . addSiteRoot ( m_parameters . getDestinationPath ( ) + m_destination ) ; boolean resourceImmutable = checkImmutable ( translatedName ) ; translatedName = getCms ( ) . getRequestContext ( ) . removeSiteRoot ( translatedName ) ; // if the resource is not immutable and not on the exclude list , import it
if ( ! resourceImmutable ) { // print out the information to the report
getReport ( ) . print ( Messages . get ( ) . container ( Messages . RPT_IMPORTING_0 ) , I_CmsReport . FORMAT_NOTE ) ; getReport ( ) . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; getReport ( ) . print ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_DOTS_0 ) ) ; boolean exists = getCms ( ) . existsResource ( translatedName , CmsResourceFilter . ALL ) ; byte [ ] content = null ; // get the file content
if ( m_source != null ) { content = m_helper . getFileBytes ( m_source ) ; } int size = 0 ; if ( content != null ) { size = content . length ; } // get UUID for the structure
if ( m_structureId == null ) { // if null generate a new structure id
m_structureId = new CmsUUID ( ) ; } // get UUIDs for the resource
if ( ( m_resourceId == null ) || ( m_type . isFolder ( ) ) ) { // folders get always a new resource UUID
m_resourceId = new CmsUUID ( ) ; resourceIdWasNull = true ; } // create a new CmsResource
CmsResource resource = new CmsResource ( m_structureId , m_resourceId , translatedName , m_type . getTypeId ( ) , m_type . isFolder ( ) , m_flags , getCms ( ) . getRequestContext ( ) . getCurrentProject ( ) . getUuid ( ) , CmsResource . STATE_NEW , m_dateCreated , m_userCreated , m_dateLastModified , m_userLastModified , m_dateReleased , m_dateExpired , 1 , size , System . currentTimeMillis ( ) , 0 ) ; if ( m_properties == null ) { m_properties = new HashMap < String , CmsProperty > ( ) ; } if ( m_type . isFolder ( ) || resourceIdWasNull || hasContentInVfsOrImport ( resource ) ) { // import this resource in the VFS
m_resource = getCms ( ) . importResource ( translatedName , resource , content , new ArrayList < CmsProperty > ( m_properties . values ( ) ) ) ; } // only set permissions if the resource did not exists or if the keep permissions flag is not set
m_importACEs = ( m_resource != null ) && ( ! exists || ! m_parameters . isKeepPermissions ( ) ) ; if ( m_resource != null ) { getReport ( ) . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_OK_0 ) , I_CmsReport . FORMAT_OK ) ; if ( OpenCms . getResourceManager ( ) . getResourceType ( m_resource . getTypeId ( ) ) instanceof I_CmsLinkParseable ) { // store for later use
m_parseables . add ( m_resource ) ; } if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTING_4 , new Object [ ] { String . valueOf ( m_fileCounter ) , String . valueOf ( m_totalFiles ) , translatedName , m_destination } ) ) ; } } else { // resource import failed , since no CmsResource was created
getReport ( ) . print ( Messages . get ( ) . container ( Messages . RPT_SKIPPING_0 ) , I_CmsReport . FORMAT_NOTE ) ; getReport ( ) . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SKIPPING_3 , String . valueOf ( m_fileCounter ) , String . valueOf ( m_totalFiles ) , translatedName ) ) ; } } } else { m_resource = null ; // skip the file import , just print out the information to the report
getReport ( ) . print ( Messages . get ( ) . container ( Messages . RPT_SKIPPING_0 ) , I_CmsReport . FORMAT_NOTE ) ; getReport ( ) . println ( org . opencms . report . Messages . get ( ) . container ( org . opencms . report . Messages . RPT_ARGUMENT_1 , translatedName ) ) ; if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SKIPPING_3 , String . valueOf ( m_fileCounter ) , String . valueOf ( m_totalFiles ) , translatedName ) ) ; } // do not import ACEs
m_importACEs = false ; } } catch ( Exception e ) { m_resource = null ; m_importACEs = false ; getReport ( ) . println ( e ) ; getReport ( ) . addError ( e ) ; CmsMessageContainer message = Messages . get ( ) . container ( Messages . ERR_IMPORTEXPORT_ERROR_IMPORTING_RESOURCES_0 ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( message . key ( ) , e ) ; } return ; } finally { m_structureId = null ; m_resourceId = null ; m_destination = null ; m_source = null ; m_type = null ; m_flags = 0 ; m_dateCreated = 0 ; m_dateLastModified = 0 ; m_dateReleased = CmsResource . DATE_RELEASED_DEFAULT ; m_dateExpired = CmsResource . DATE_EXPIRED_DEFAULT ; m_properties = null ; m_throwable = null ; m_aces = null ; m_properties = null ; } |
public class ViewSet { /** * Creates a deployment view .
* @ param key the key for the deployment view ( must be unique )
* @ param description a description of the view
* @ return a DeploymentView object
* @ throws IllegalArgumentException if the key is not unique */
public DeploymentView createDeploymentView ( String key , String description ) { } } | assertThatTheViewKeyIsSpecifiedAndUnique ( key ) ; DeploymentView view = new DeploymentView ( model , key , description ) ; view . setViewSet ( this ) ; deploymentViews . add ( view ) ; return view ; |
public class JmsMessageImpl { /** * If the message properties are read - only , throw a MessageNotWriteableException . */
protected void checkPropertiesWriteable ( String callingMethodName ) throws JMSException { } } | if ( propertiesReadOnly ) { throw ( javax . jms . MessageNotWriteableException ) JmsErrorUtils . newThrowable ( javax . jms . MessageNotWriteableException . class , "READ_ONLY_MESSAGE_PROPERTY_CWSIA0108" , new Object [ ] { callingMethodName } , tc ) ; } |
public class HFactory { /** * Use createKeyspaceDefinition to add a new Keyspace to cluster . Example :
* String testKeyspace = " testKeyspace " ; KeyspaceDefinition newKeyspace =
* HFactory . createKeyspaceDefinition ( testKeyspace ) ;
* cluster . addKeyspace ( newKeyspace ) ;
* @ param keyspaceName
* @ param strategyClass
* - example :
* org . apache . cassandra . locator . SimpleStrategy . class . getName ( )
* @ param replicationFactor
* - http : / / wiki . apache . org / cassandra / Operations */
public static KeyspaceDefinition createKeyspaceDefinition ( String keyspaceName , String strategyClass , int replicationFactor , List < ColumnFamilyDefinition > cfDefs ) { } } | return new ThriftKsDef ( keyspaceName , strategyClass , replicationFactor , cfDefs ) ; |
public class OldDataMonitor { /** * Inform monitor that some data in a deprecated format has been loaded , during
* XStream unmarshalling when the Saveable containing this object is not available .
* @ param context XStream unmarshalling context
* @ param version Hudson release when the data structure changed . */
public static void report ( UnmarshallingContext context , String version ) { } } | RobustReflectionConverter . addErrorInContext ( context , new ReportException ( version ) ) ; |
public class DataJdbcSource { /** * 直接本地执行SQL语句进行查询 , 远程模式不可用 < br >
* 通常用于复杂的关联查询 < br >
* @ param < V > 泛型
* @ param sql SQL语句
* @ param handler 回调函数
* @ return 结果 */
@ Local @ Override public < V > V directQuery ( String sql , Function < ResultSet , V > handler ) { } } | final Connection conn = readPool . poll ( ) ; try { if ( logger . isLoggable ( Level . FINEST ) ) logger . finest ( "direct query sql=" + sql ) ; conn . setReadOnly ( true ) ; final Statement statement = conn . createStatement ( ) ; // final PreparedStatement statement = conn . prepareStatement ( sql , ResultSet . TYPE _ SCROLL _ INSENSITIVE , ResultSet . CONCUR _ READ _ ONLY ) ;
final ResultSet set = statement . executeQuery ( sql ) ; // ps . executeQuery ( ) ;
V rs = handler . apply ( set ) ; set . close ( ) ; statement . close ( ) ; return rs ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } finally { if ( conn != null ) readPool . offerConnection ( conn ) ; } |
public class Matrix { /** * Creates a new Matrix that stores the result of < i > A - c < / i >
* @ param c the scalar constant to subtract from < i > this < / i >
* @ param threadPool the source of threads to do computation in parallel
* @ return a new matrix equal to < i > A - B < / i > */
public Matrix subtract ( double c , ExecutorService threadPool ) { } } | Matrix toReturn = getThisSideMatrix ( null ) ; toReturn . mutableSubtract ( c , threadPool ) ; return toReturn ; |
public class MiscService { /** * Returns the Docker version information
* @ return a { @ link DockerVersionInfo } instance describing this docker installation . */
public DockerVersionInfo getVersionInfo ( ) { } } | String json = getServiceEndPoint ( ) . path ( "/version" ) . request ( MediaType . APPLICATION_JSON_TYPE ) . get ( String . class ) ; return toObject ( json , DockerVersionInfo . class ) ; |
public class BaseField { /** * This is a utility method to simplify setting a single field to the field ' s property .
* @ return The error code on set . */
public int setSFieldToProperty ( ) { } } | int iErrorCode = DBConstants . NORMAL_RETURN ; m_bJustChanged = false ; for ( int iComponent = 0 ; ; iComponent ++ ) { ScreenComponent sField = this . getComponent ( iComponent ) ; if ( sField == null ) break ; iErrorCode = sField . setSFieldToProperty ( null , DBConstants . DISPLAY , DBConstants . READ_MOVE ) ; } if ( iErrorCode == DBConstants . NORMAL_RETURN ) if ( ! this . isJustModified ( ) ) if ( this . getComponent ( 0 ) != null ) { ScreenComponent sField = this . getComponent ( 0 ) ; ComponentParent parentScreen = sField . getParentScreen ( ) ; String strParam = this . getFieldName ( false , true ) ; String strParamValue = parentScreen . getProperty ( strParam ) ; if ( strParamValue != null ) this . setString ( strParamValue , DBConstants . DISPLAY , DBConstants . READ_MOVE ) ; } return iErrorCode ; |
public class AlertPolicyChannelService { /** * Deletes the given alert channel from the alert policy with the given id .
* @ param policyId The id of the alert policy from which to delete the channel
* @ param channelId The id of the alert channel to delete
* @ return This object */
public AlertPolicyChannelService delete ( long policyId , long channelId ) { } } | QueryParameterList queryParams = new QueryParameterList ( ) ; queryParams . add ( "policy_id" , policyId ) ; queryParams . add ( "channel_id" , channelId ) ; HTTP . DELETE ( "/v2/alerts_policy_channels.json" , null , queryParams ) ; return this ; |
public class ErrorMessage { /** * < p > parseErrors . < / p >
* @ param exception a { @ link java . lang . Throwable } object .
* @ param status a int .
* @ return a { @ link java . util . List } object . */
public static List < Result . Error > parseErrors ( Throwable exception , int status ) { } } | List < Result . Error > errors = Lists . newArrayList ( ) ; if ( status == 500 || status == 400 ) { Throwable cause = exception ; while ( cause != null ) { StackTraceElement [ ] stackTraceElements = cause . getStackTrace ( ) ; if ( stackTraceElements != null && stackTraceElements . length > 0 ) { Result . Error error = new Result . Error ( Hashing . murmur3_32 ( ) . hashUnencodedChars ( exception . getClass ( ) . getName ( ) ) . toString ( ) , cause . getMessage ( ) ) ; if ( status == 500 ) { StringBuilder descBuilder = new StringBuilder ( ) ; for ( StackTraceElement element : stackTraceElements ) { descBuilder . append ( element . toString ( ) ) . append ( "\n" ) ; } error . setDescription ( descBuilder . toString ( ) ) ; } StackTraceElement stackTraceElement = stackTraceElements [ 0 ] ; String source = stackTraceElement . toString ( ) ; error . setSource ( source ) ; errors . add ( error ) ; } cause = cause . getCause ( ) ; } } return errors ; |
public class BellaDatiServiceImpl { /** * Appends a locale language parameter to the URI builder . Won ' t do anything
* if the locale is < tt > null < / tt > .
* @ param builder the builder to append to
* @ param locale the locale to append
* @ return the same builder , for chaining */
public URIBuilder appendLocale ( URIBuilder builder , Locale locale ) { } } | if ( locale != null ) { builder . addParameter ( "lang" , locale . getLanguage ( ) ) ; } return builder ; |
public class BellaDatiServiceImpl { /** * Appends a filter parameter from the given filters to the URI builder .
* Won ' t do anything if the filter collection is empty .
* @ param builder the builder to append to
* @ param filters filters to append
* @ return the same builder , for chaining */
public URIBuilder appendFilter ( URIBuilder builder , Collection < Filter < ? > > filters ) { } } | if ( filters . size ( ) > 0 ) { ObjectNode filterNode = new ObjectMapper ( ) . createObjectNode ( ) ; for ( Filter < ? > filter : filters ) { filterNode . setAll ( filter . toJson ( ) ) ; } ObjectNode drilldownNode = new ObjectMapper ( ) . createObjectNode ( ) ; drilldownNode . put ( "drilldown" , filterNode ) ; builder . addParameter ( "filter" , drilldownNode . toString ( ) ) ; } return builder ; |
public class FlowScopeBeanHolder { /** * See description on ViewScopeBeanHolder for details about how this works */
@ PreDestroy public void destroyBeansOnPreDestroy ( ) { } } | Map < String , ContextualStorage > oldWindowContextStorages = forceNewStorage ( ) ; if ( ! oldWindowContextStorages . isEmpty ( ) ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; ServletContext servletContext = null ; if ( facesContext == null ) { try { servletContext = applicationContextBean . getServletContext ( ) ; } catch ( Throwable e ) { Logger . getLogger ( FlowScopeBeanHolder . class . getName ( ) ) . log ( Level . WARNING , "Cannot locate servletContext to create FacesContext on @PreDestroy flow scope beans. " + "The beans will be destroyed without active FacesContext instance." ) ; servletContext = null ; } } if ( facesContext == null && servletContext != null ) { try { ExternalContext externalContext = new StartupServletExternalContextImpl ( servletContext , false ) ; ExceptionHandler exceptionHandler = new ExceptionHandlerImpl ( ) ; facesContext = new StartupFacesContextImpl ( externalContext , ( ReleaseableExternalContext ) externalContext , exceptionHandler , false ) ; for ( ContextualStorage contextualStorage : oldWindowContextStorages . values ( ) ) { FlowScopedContextImpl . destroyAllActive ( contextualStorage ) ; } } finally { facesContext . release ( ) ; } } else { for ( ContextualStorage contextualStorage : oldWindowContextStorages . values ( ) ) { FlowScopedContextImpl . destroyAllActive ( contextualStorage ) ; } } } |
public class KamComparison { /** * Returns the average KAM node degree .
* Zero is returned if the average is undefined ( in case
* the number of KAM nodes is zero ) . */
public double getAverageKamNodeDegree ( String kamName ) { } } | final int nodes = getKamNodeCount ( kamName ) ; return ( nodes != 0 ? ( ( double ) 2 * getKamEdgeCount ( kamName ) ) / nodes : 0.0 ) ; |
public class SnapshotDaemon { /** * Invoked when this snapshot daemon has been elected as leader */
private void electedTruncationLeader ( ) throws Exception { } } | loggingLog . info ( "This node was selected as the leader for snapshot truncation" ) ; m_truncationSnapshotScanTask = m_es . scheduleWithFixedDelay ( new Runnable ( ) { @ Override public void run ( ) { try { scanTruncationSnapshots ( ) ; } catch ( Exception e ) { loggingLog . error ( "Error during scan and group of truncation snapshots" ) ; } } } , 0 , 1 , TimeUnit . HOURS ) ; try { // TRAIL [ TruncSnap : 1 ] elected as leader
truncationRequestExistenceCheck ( ) ; userSnapshotRequestExistenceCheck ( false ) ; } catch ( Exception e ) { VoltDB . crashLocalVoltDB ( "Error while accepting snapshot daemon leadership" , true , e ) ; } |
public class WeakFastHashMap { /** * Return < code > true < / code > if this map contains one or more keys mapping
* to the specified value .
* @ param value the value to be searched for
* @ return true if the map contains the value */
@ Override public boolean containsValue ( Object value ) { } } | if ( fast ) { return ( map . containsValue ( value ) ) ; } else { synchronized ( map ) { return ( map . containsValue ( value ) ) ; } } |
public class StylesheetHandler { /** * Push a base identifier onto the base URI stack .
* @ param baseID The current base identifier for this position in the
* stylesheet , which may be a fragment identifier , or which may be null .
* @ see < a href = " http : / / www . w3 . org / TR / xslt # base - uri " >
* Section 3.2 Base URI of XSLT specification . < / a > */
void pushBaseIndentifier ( String baseID ) { } } | if ( null != baseID ) { int posOfHash = baseID . indexOf ( '#' ) ; if ( posOfHash > - 1 ) { m_fragmentIDString = baseID . substring ( posOfHash + 1 ) ; m_shouldProcess = false ; } else m_shouldProcess = true ; } else m_shouldProcess = true ; m_baseIdentifiers . push ( baseID ) ; |
public class InternalSARLParser { /** * $ ANTLR start synpred22 _ InternalSARL */
public final void synpred22_InternalSARL_fragment ( ) throws RecognitionException { } } | // InternalSARL . g : 10289:6 : ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) )
// InternalSARL . g : 10289:7 : ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) )
{ // InternalSARL . g : 10289:7 : ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) )
// InternalSARL . g : 10290:7 : ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) )
{ // InternalSARL . g : 10290:7 : ( )
// InternalSARL . g : 10291:7:
{ } // InternalSARL . g : 10292:7 : ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ?
int alt392 = 2 ; int LA392_0 = input . LA ( 1 ) ; if ( ( LA392_0 == RULE_ID || ( LA392_0 >= 44 && LA392_0 <= 45 ) || ( LA392_0 >= 92 && LA392_0 <= 95 ) ) ) { alt392 = 1 ; } switch ( alt392 ) { case 1 : // InternalSARL . g : 10293:8 : ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) *
{ // InternalSARL . g : 10293:8 : ( ( ruleJvmFormalParameter ) )
// InternalSARL . g : 10294:9 : ( ruleJvmFormalParameter )
{ // InternalSARL . g : 10294:9 : ( ruleJvmFormalParameter )
// InternalSARL . g : 10295:10 : ruleJvmFormalParameter
{ pushFollow ( FOLLOW_134 ) ; ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return ; } } // InternalSARL . g : 10298:8 : ( ' , ' ( ( ruleJvmFormalParameter ) ) ) *
loop391 : do { int alt391 = 2 ; int LA391_0 = input . LA ( 1 ) ; if ( ( LA391_0 == 32 ) ) { alt391 = 1 ; } switch ( alt391 ) { case 1 : // InternalSARL . g : 10299:9 : ' , ' ( ( ruleJvmFormalParameter ) )
{ match ( input , 32 , FOLLOW_75 ) ; if ( state . failed ) return ; // InternalSARL . g : 10300:9 : ( ( ruleJvmFormalParameter ) )
// InternalSARL . g : 10301:10 : ( ruleJvmFormalParameter )
{ // InternalSARL . g : 10301:10 : ( ruleJvmFormalParameter )
// InternalSARL . g : 10302:11 : ruleJvmFormalParameter
{ pushFollow ( FOLLOW_134 ) ; ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return ; } } } break ; default : break loop391 ; } } while ( true ) ; } break ; } // InternalSARL . g : 10307:7 : ( ( ' | ' ) )
// InternalSARL . g : 10308:8 : ( ' | ' )
{ // InternalSARL . g : 10308:8 : ( ' | ' )
// InternalSARL . g : 10309:9 : ' | '
{ match ( input , 97 , FOLLOW_2 ) ; if ( state . failed ) return ; } } } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.