signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ServerSessionContext { /** * Checks and sets the current request sequence number . * @ param requestSequence The request sequence number to set . * @ return Indicates whether the given { @ code requestSequence } number is the next sequence number . */ boolean setRequestSequence ( long requestSequence )...
if ( requestSequence == this . requestSequence + 1 ) { this . requestSequence = requestSequence ; return true ; } else if ( requestSequence <= this . requestSequence ) { return true ; } return false ;
public class AnalyticFormulas { /** * Return the curvature of the implied normal volatility ( Bachelier volatility ) under a SABR model using the * approximation of Berestycki . The curvatures is the second derivative of the implied vol w . r . t . the strike , * evaluated at the money . * @ param alpha initial v...
double sigma = sabrBerestyckiNormalVolatilityApproximation ( alpha , beta , rho , nu , displacement , underlying , underlying , maturity ) ; // Apply displacement . Displaced model is just a shift on underlying and strike . underlying += displacement ; /* double d1xdz1 = 1.0; double d2xdz2 = rho ; double d3xdz3 = 3...
public class BlockJUnit4ClassRunner { /** * Returns a Statement that , when executed , either returns normally if * { @ code method } passes , or throws an exception if { @ code method } fails . * Here is an outline of the default implementation : * < ul > * < li > Invoke { @ code method } on the result of { @ ...
Object test ; try { test = new ReflectiveCallable ( ) { @ Override protected Object runReflectiveCall ( ) throws Throwable { return createTest ( method ) ; } } . run ( ) ; } catch ( Throwable e ) { return new Fail ( e ) ; } Statement statement = methodInvoker ( method , test ) ; statement = possiblyExpectingExceptions ...
public class PatternToken { /** * Checks if the token is a sentence start . * @ return True if the element starts the sentence and the element hasn ' t been set to have negated POS token . */ public boolean isSentenceStart ( ) { } }
return posToken != null && JLanguageTool . SENTENCE_START_TAGNAME . equals ( posToken . posTag ) && ! posToken . negation ;
public class Main { /** * Load configuration values specified from either a file or the classloader * @ return The properties */ private static Properties loadProperties ( ) { } }
Properties properties = new Properties ( ) ; boolean loaded = false ; String sysProperty = SecurityActions . getSystemProperty ( "ironjacamar.options" ) ; if ( sysProperty != null && ! sysProperty . equals ( "" ) ) { File file = new File ( sysProperty ) ; if ( file . exists ( ) ) { FileInputStream fis = null ; try { fi...
public class IosHttpURLConnection { /** * Returns the value of the named header field . * If called on a connection that sets the same header multiple times with * possibly different values , only the last value is returned . */ @ Override public String getHeaderField ( String key ) { } }
try { getResponse ( ) ; return getHeaderFieldDoNotForceResponse ( key ) ; } catch ( IOException e ) { return null ; }
public class FlowImpl { /** * If not already created , a new < code > flow < / code > element will be created and returned . * Otherwise , the first existing < code > flow < / code > element will be returned . * @ return the instance defined for the element < code > flow < / code > */ public Flow < Flow < T > > get...
List < Node > nodeList = childNode . get ( "flow" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FlowImpl < Flow < T > > ( this , "flow" , childNode , nodeList . get ( 0 ) ) ; } return createFlow ( ) ;
public class ModelBuilder3D { /** * Layout the molecule , starts with ring systems and than aliphatic chains . * @ param ringSetMolecule ringSystems of the molecule */ private void layoutMolecule ( List ringSetMolecule , IAtomContainer molecule , AtomPlacer3D ap3d , AtomTetrahedralLigandPlacer3D atlp3d , AtomPlacer a...
// logger . debug ( " * * * * * LAYOUT MOLECULE MAIN * * * * * " ) ; IAtomContainer ac = null ; int safetyCounter = 0 ; IAtom atom = null ; // Place rest Chains / Atoms do { safetyCounter ++ ; atom = ap3d . getNextPlacedHeavyAtomWithUnplacedRingNeighbour ( molecule ) ; if ( atom != null ) { // logger . debug ( " layout...
public class Bean { /** * General support for reporting bound property changes . Sends the given PropertyChangeEvent to * any registered PropertyChangeListener . < p > * Most bean setters will invoke the fireXXX methods that get a property name and the old and * new value . However some frameworks and setters may...
PropertyChangeSupport aChangeSupport = this . changeSupport ; if ( aChangeSupport == null ) { return ; } aChangeSupport . firePropertyChange ( event ) ;
public class CmsLinkProcessor { /** * Ensures that the given tag has the " alt " attribute set . < p > * if not set , it will be set from the title of the given resource . < p > * @ param tag the tag to set the alt attribute for * @ param internalUri the internal URI to get the title from */ protected void setAlt...
boolean hasAltAttrib = ( tag . getAttribute ( "alt" ) != null ) ; if ( ! hasAltAttrib ) { String value = null ; if ( ( internalUri != null ) && ( m_rootCms != null ) ) { // internal image : try to read the " alt " text from the " Title " property try { value = m_rootCms . readPropertyObject ( internalUri , CmsPropertyD...
public class CredentialReference { /** * Get an attribute builder for a credential - reference attribute with the specified characteristics . The * { @ code store } field in the attribute does not register any requirement for a credential store capability . * @ param name name of attribute * @ param xmlName name ...
return getAttributeBuilder ( name , xmlName , allowNull , false ) ;
public class JsonWriter { /** * Write the double as object key . * @ param key The double key . * @ return The JSON Writer . */ public JsonWriter key ( double key ) { } }
startKey ( ) ; writer . write ( '\"' ) ; final long i = ( long ) key ; if ( key == ( double ) i ) { writer . print ( i ) ; } else { writer . print ( key ) ; } writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ;
public class ManagementEnforcer { /** * removeFilteredNamedGroupingPolicy removes a role inheritance rule from the current named policy , field filters can be specified . * @ param ptype the policy type , can be " g " , " g2 " , " g3 " , . . * @ param fieldIndex the policy rule ' s start index to be matched . * @...
boolean ruleRemoved = removeFilteredPolicy ( "g" , ptype , fieldIndex , fieldValues ) ; if ( autoBuildRoleLinks ) { buildRoleLinks ( ) ; } return ruleRemoved ;
public class DefaultGroovyMethods { /** * Sorts the Collection . Assumes that the collection items are comparable * and uses their natural ordering to determine the resulting order . * If the Collection is a List , it is sorted in place and returned . * Otherwise , the elements are first placed into a new list wh...
return sort ( self , true ) ;
public class Invoice { /** * Stripe will automatically send invoices to customers according to your < a * href = " https : / / dashboard . stripe . com / account / billing / automatic " > subscriptions settings < / a > . * However , if you ’ d like to manually send an invoice to your customer out of the normal sche...
return sendInvoice ( ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class VectorizedRleValuesReader { /** * Reads ` total ` ints into ` c ` filling them in starting at ` c [ rowId ] ` . This reader * reads the definition levels and then will read from ` data ` for the non - null values . * If the value is null , c will be populated with ` nullValue ` . Note that ` nullValue ...
int left = total ; while ( left > 0 ) { if ( this . currentCount == 0 ) this . readNextGroup ( ) ; int n = Math . min ( left , this . currentCount ) ; switch ( mode ) { case RLE : if ( currentValue == level ) { data . readIntegers ( n , c , rowId ) ; } else { c . putNulls ( rowId , n ) ; } break ; case PACKED : for ( i...
public class GridUtils { /** * Create the affine transform that maps from the world ( map ) projection to the pixel on the printed map . * @ param mapContext the map context */ public static AffineTransform getWorldToScreenTransform ( final MapfishMapContext mapContext ) { } }
return RendererUtilities . worldToScreenTransform ( mapContext . toReferencedEnvelope ( ) , mapContext . getPaintArea ( ) ) ;
public class BatchRequest { /** * Queues the specified { @ link HttpRequest } for batched execution . Batched requests are executed * when { @ link # execute ( ) } is called . * @ param < T > destination class type * @ param < E > error class type * @ param httpRequest HTTP Request * @ param dataClass Data cl...
Preconditions . checkNotNull ( httpRequest ) ; // TODO ( rmistry ) : Add BatchUnparsedCallback with onResponse ( InputStream content , HttpHeaders ) . Preconditions . checkNotNull ( callback ) ; Preconditions . checkNotNull ( dataClass ) ; Preconditions . checkNotNull ( errorClass ) ; requestInfos . add ( new RequestIn...
public class Application { /** * This action only gets called if the user is logged in . * @ return */ @ SecuredAction public Result index ( ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "access granted to index" ) ; } DemoUser user = ( DemoUser ) ctx ( ) . args . get ( SecureSocial . USER_KEY ) ; return ok ( index . render ( user , SecureSocial . env ( ) ) ) ;
public class Worker { /** * TODO : in here it " should " be impossible fro a null return * @ param workerStatus * @ param feedPartitions * @ return a partition available for processing or null if none are available */ @ VisibleForTesting FeedPartition findPartitionToProcess ( List < WorkerStatus > workerStatus , ...
for ( int i = 0 ; i < feedPartitions . size ( ) ; i ++ ) { FeedPartition aPartition = feedPartitions . get ( i ) ; boolean partitionTaken = false ; for ( int j = 0 ; j < workerStatus . size ( ) ; j ++ ) { if ( workerStatus . get ( j ) . getFeedPartitionId ( ) . equals ( aPartition . getPartitionId ( ) ) ) { partitionTa...
public class Permission { /** * The private CA operations that can be performed by the designated AWS service . * @ param actions * The private CA operations that can be performed by the designated AWS service . * @ see ActionType */ public void setActions ( java . util . Collection < String > actions ) { } }
if ( actions == null ) { this . actions = null ; return ; } this . actions = new java . util . ArrayList < String > ( actions ) ;
public class DevicesInner { /** * Updates the security settings on a data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param deviceAdminPassword Device administrator password as an encrypted string ( encrypted using RSA PKCS # 1 ) is ...
return ServiceFuture . fromResponse ( createOrUpdateSecuritySettingsWithServiceResponseAsync ( deviceName , resourceGroupName , deviceAdminPassword ) , serviceCallback ) ;
public class SQLiteUpdateTaskHelper { /** * Drop all table with specific prefix . * @ param db * the db * @ param prefix * the prefix */ public static void dropTablesWithPrefix ( SQLiteDatabase db , String prefix ) { } }
Logger . info ( "MASSIVE TABLE DROP OPERATION%s" , StringUtils . ifNotEmptyAppend ( prefix , " WITH PREFIX " ) ) ; drop ( db , QueryType . TABLE , prefix ) ;
public class Table { /** * Create a new Table with a name and a row / column capacity * @ param positionUtil an util * @ param writeUtil an util * @ param xmlUtil an util * @ param name the name of the tables * @ param rowCapacity the row capacity * @ param columnCapacity the column capacity * @ param sty...
positionUtil . checkTableName ( name ) ; final TableBuilder builder = TableBuilder . create ( positionUtil , writeUtil , xmlUtil , stylesContainer , format , libreOfficeMode , name , rowCapacity , columnCapacity ) ; return new Table ( name , builder ) ;
public class NodeImpl { /** * Returns the sanitized input if it is a URI , or { @ code null } otherwise . */ private String sanitizeUri ( String uri ) { } }
if ( uri == null || uri . length ( ) == 0 ) { return null ; } try { return new URI ( uri ) . toString ( ) ; } catch ( URISyntaxException e ) { return null ; }
public class UpdatePremiumRates { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param premiumRateId the ID of the premium rate to update . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteExce...
// Get the PremiumRateService . PremiumRateServiceInterface premiumRateService = adManagerServices . get ( session , PremiumRateServiceInterface . class ) ; // Create a statement to get a single premium rate . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "id = :id" ) . orderBy ( "id ASC" ) . l...
public class ManifestUtils { /** * Retrieves a value for a specific manifest attribute . * Or null if not found * @ param attributeName to locate in the manifest * @ return String value for or null case not found */ public String getManifestAttribute ( String attributeName ) { } }
if ( attributeName != null ) { Map < Object , Object > mf = getManifestAttributes ( ) ; for ( Object att : mf . keySet ( ) ) { if ( attributeName . equals ( att . toString ( ) ) ) { return mf . get ( att ) . toString ( ) ; } } } // In case not found return null ; return null ;
public class FnJodaTimeUtils { /** * It converts the given { @ link String } into a { @ link LocalTime } using the given pattern and { @ link Locale } parameters . * The { @ link DateTime } is configured with the given { @ link DateTimeZone } * @ param pattern string with the format of the input String * @ param ...
return FnLocalTime . strToLocalTime ( pattern , locale , dateTimeZone ) ;
public class AWSSimpleSystemsManagementClient { /** * Describes the association for the specified target or instance . If you created the association by using the * < code > Targets < / code > parameter , then you must retrieve the association by using the association ID . If you * created the association by specif...
request = beforeClientExecution ( request ) ; return executeDescribeAssociation ( request ) ;
class ComputeCatalan { /** * Generates the nth Catalán number . A Catalán number is a number in a sequence defined * with a certain recurrence relation . They often show up in combinatory mathematics . * Args : * n : index number to generate the Catalán number for * Returns : * nth Catalán number * Exam...
if ( n <= 1 ) { return 1 ; } long result = 0 ; for ( int i = 0 ; i < n ; i ++ ) { result += computeCatalan ( i ) * computeCatalan ( n - i - 1 ) ; } return result ;
public class RandomVariableLazyEvaluation { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariable # getAverage ( net . finmath . stochastic . RandomVariable ) */ @ Override public double getAverage ( RandomVariable probabilities ) { } }
if ( isDeterministic ( ) ) { return valueIfNonStochastic ; } if ( size ( ) == 0 ) { return Double . NaN ; } return this . cache ( ) . mult ( probabilities ) . getRealizationsStream ( ) . sum ( ) ;
public class Meta { /** * Reads a JSON object from the given metadata URL and generates a new Meta object containing all types . * @ param url The API metadata URL . * @ return Meta */ public static Meta fromUrl ( URL url ) { } }
InputStream stream = null ; try { stream = url . openStream ( ) ; Gson gson = new GsonBuilder ( ) . registerTypeAdapter ( PropertyForm . class , new TypeAdapter < PropertyForm > ( ) { @ Override public void write ( JsonWriter out , PropertyForm value ) throws IOException { out . value ( value . name ( ) . toLowerCase (...
public class ProcessorTemplateElem { /** * Receive notification of the start of an element . * @ param handler non - null reference to current StylesheetHandler that is constructing the Templates . * @ param uri The Namespace URI , or an empty string . * @ param localName The local name ( without prefix ) , or em...
super . startElement ( handler , uri , localName , rawName , attributes ) ; try { // ElemTemplateElement parent = handler . getElemTemplateElement ( ) ; XSLTElementDef def = getElemDef ( ) ; Class classObject = def . getClassObject ( ) ; ElemTemplateElement elem = null ; try { elem = ( ElemTemplateElement ) classObject...
public class Which { /** * Locates the jar file that contains the given class . * Note that jar files are not always loaded from { @ link File } , * so for diagnostics purposes { @ link # jarURL ( Class ) } is preferrable . * @ throws IllegalArgumentException * if failed to determine . */ public static File jar...
return jarFile ( classFileUrl ( clazz ) , clazz . getName ( ) . replace ( '.' , '/' ) + ".class" ) ;
public class EvaluatorPool { /** * Die Methode run wird aufgerufen sobald , der CFML Transformer den uebersetzungsprozess * angeschlossen hat . Die metode run rauft darauf alle Evaluatoren auf die intern gespeicher wurden * und loescht den internen Speicher . * @ throws TemplateException */ public void run ( ) th...
{ // tags Iterator < TagData > it = tags . iterator ( ) ; while ( it . hasNext ( ) ) { TagData td = it . next ( ) ; SourceCode cfml = td . cfml ; cfml . setPos ( td . pos ) ; try { if ( td . libTag . getEvaluator ( ) != null ) td . libTag . getEvaluator ( ) . evaluate ( td . tag , td . libTag , td . flibs ) ; } catch (...
public class JbcSrcRuntime { /** * Wraps a given template with a collection of escapers to apply . * @ param delegate The delegate template to render * @ param directives The set of directives to apply */ public static CompiledTemplate applyEscapers ( CompiledTemplate delegate , ImmutableList < SoyJavaPrintDirectiv...
ContentKind kind = delegate . kind ( ) ; if ( canSkipEscaping ( directives , kind ) ) { return delegate ; } return new EscapedCompiledTemplate ( delegate , directives , kind ) ;
public class CommandHelper { /** * Convert the value according the type of DeviceData . * @ param deviceDataArgout * the DeviceData attribute to read * @ return Short , the result in Short format * @ throws DevFailed */ public static Short extractToShort ( final DeviceData deviceDataArgout ) throws DevFailed { ...
final Object value = CommandHelper . extract ( deviceDataArgout ) ; Short argout = null ; if ( value instanceof Short ) { argout = ( Short ) value ; } else if ( value instanceof String ) { try { argout = Short . valueOf ( ( String ) value ) ; } catch ( final Exception e ) { Except . throw_exception ( "TANGO_WRONG_DATA_...
public class Lines { /** * Returns the distance between the specified point and the specified line segment . */ public static float pointSegDist ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { } }
return FloatMath . sqrt ( pointSegDistSq ( px , py , x1 , y1 , x2 , y2 ) ) ;
public class NodeUtil { /** * Returns true if the shallow scope contains references to ' this ' keyword */ static boolean referencesThis ( Node n ) { } }
if ( n . isFunction ( ) ) { return referencesThis ( NodeUtil . getFunctionParameters ( n ) ) || referencesThis ( NodeUtil . getFunctionBody ( n ) ) ; } else { return has ( n , Node :: isThis , MATCH_ANYTHING_BUT_NON_ARROW_FUNCTION ) ; }
public class RuleCallImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < Expression > getArguments ( ) { } }
if ( arguments == null ) { arguments = new EObjectContainmentEList < Expression > ( Expression . class , this , SimpleAntlrPackage . RULE_CALL__ARGUMENTS ) ; } return arguments ;
public class CacheProviderWrapper { /** * ( non - Javadoc ) * @ see com . ibm . ws . cache . intf . DCache # getEntryDisk ( java . lang . Object ) */ @ Override public com . ibm . websphere . cache . CacheEntry getEntryDisk ( Object cacheId ) { } }
final String methodName = "getEntryDisk()" ; CacheEntry ce = null ; if ( this . swapToDisk ) { // TODO write code to support getEntryDisk function if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { if ( this . featureSupp...
public class CommerceWarehouseItemPersistenceImpl { /** * Returns all the commerce warehouse items . * @ return the commerce warehouse items */ @ Override public List < CommerceWarehouseItem > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class MasterSlaveSchema { /** * Renew master - slave rule . * @ param masterSlaveRuleChangedEvent master - slave rule changed event . */ @ Subscribe public synchronized void renew ( final MasterSlaveRuleChangedEvent masterSlaveRuleChangedEvent ) { } }
if ( getName ( ) . equals ( masterSlaveRuleChangedEvent . getShardingSchemaName ( ) ) ) { masterSlaveRule = new OrchestrationMasterSlaveRule ( masterSlaveRuleChangedEvent . getMasterSlaveRuleConfiguration ( ) ) ; }
public class Headers { /** * Returns an immutable list of the header values for { @ code name } . */ public List < String > values ( String name ) { } }
List < String > result = null ; for ( int i = 0 , size = size ( ) ; i < size ; i ++ ) { if ( name . equalsIgnoreCase ( name ( i ) ) ) { if ( result == null ) result = new ArrayList < > ( 2 ) ; result . add ( value ( i ) ) ; } } return result != null ? Collections . unmodifiableList ( result ) : Collections . < String >...
public class Database { /** * Create a new JSON index * Example usage creating an index that sorts ascending on name , then by year : * < pre > * { @ code * db . createIndex ( " Person _ name " , " Person _ name " , null , new IndexField [ ] { * new IndexField ( " Person _ name " , SortOrder . asc ) , * new...
if ( indexType == null || "json" . equalsIgnoreCase ( indexType ) ) { JsonIndex . Builder b = JsonIndex . builder ( ) . name ( indexName ) . designDocument ( designDocName ) ; for ( IndexField f : fields ) { switch ( f . getOrder ( ) ) { case desc : b . desc ( f . getName ( ) ) ; break ; case asc : default : b . asc ( ...
public class ReceiveListenerDataReceivedInvocation { /** * Resets the state of this invocation object - used by the pooling code . */ protected synchronized void reset ( Connection connection , ReceiveListener listener , WsByteBuffer data , int size , int segmentType , int requestNumber , int priority , boolean allocat...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" , new Object [ ] { connection , listener , data , "" + size , "" + segmentType , "" + requestNumber , "" + priority , "" + allocatedFromPool , "" + partOfExchange , conversation } ) ; this . connection = conne...
public class XFactory { /** * Create a new , never - before - seen , XMethod object and intern it . */ private static XMethod createXMethod ( @ DottedClassName String className , String methodName , String methodSig , int accessFlags ) { } }
return createXMethod ( className , methodName , methodSig , ( accessFlags & Const . ACC_STATIC ) != 0 ) ;
public class FNIRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setFNMCnt ( Integer newFNMCnt ) { } }
Integer oldFNMCnt = fnmCnt ; fnmCnt = newFNMCnt ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FNIRG__FNM_CNT , oldFNMCnt , fnmCnt ) ) ;
public class CertificateVersion { /** * Return an enumeration of names of attributes existing within this * attribute . */ public Enumeration < String > getElements ( ) { } }
AttributeNameEnumeration elements = new AttributeNameEnumeration ( ) ; elements . addElement ( VERSION ) ; return ( elements . elements ( ) ) ;
public class KinesisInitialPositions { /** * Returns instance of [ [ KinesisInitialPosition ] ] based on the passed * [ [ InitialPositionInStream ] ] . This method is used in KinesisUtils for translating the * InitialPositionInStream to InitialPosition . This function would be removed when we deprecate * the Kine...
if ( initialPositionInStream == InitialPositionInStream . LATEST ) { return new Latest ( ) ; } else if ( initialPositionInStream == InitialPositionInStream . TRIM_HORIZON ) { return new TrimHorizon ( ) ; } else { // InitialPositionInStream . AT _ TIMESTAMP is not supported . // Use InitialPosition . atTimestamp ( times...
public class MergeTopicParser { /** * Get new value for topic id attribute . */ private void handleID ( final AttributesImpl atts ) { } }
String idValue = atts . getValue ( ATTRIBUTE_NAME_ID ) ; if ( idValue != null ) { XMLUtils . addOrSetAttribute ( atts , ATTRIBUTE_NAME_OID , idValue ) ; final URI value = setFragment ( dirPath . toURI ( ) . resolve ( toURI ( filePath ) ) , idValue ) ; if ( util . findId ( value ) ) { idValue = util . getIdValue ( value...
public class Searcher { /** * Searches the given pattern starting from the given elements . * @ param eles elements to start from * @ param pattern pattern to search for * @ return map from starting element to the matching results */ public static Map < BioPAXElement , List < Match > > search ( final Collection <...
final Map < BioPAXElement , List < Match > > map = new ConcurrentHashMap < BioPAXElement , List < Match > > ( ) ; final ExecutorService exec = Executors . newFixedThreadPool ( 10 ) ; for ( final BioPAXElement ele : eles ) { if ( ! pattern . getStartingClass ( ) . isAssignableFrom ( ele . getModelInterface ( ) ) ) conti...
public class XMLUtil { /** * Read an enumeration value . * @ param document is the XML document to explore . * @ param caseSensitive indicates of the { @ code path } ' s components are case sensitive . * @ param path is the list of and ended by the attribute ' s name . * @ return the java class or < code > null...
assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeClassWithDefault ( document , caseSensitive , null , path ) ;
public class Range { /** * Reverse operation for { @ link # getRelativeRangeOf ( Range ) } . * A . getAbsoluteRangeFor ( A . getRelativeRangeOf ( B ) ) = = B * @ param relativeRange range defined relative to this range * @ return absolute range */ public Range getAbsoluteRangeFor ( Range relativeRange ) { } }
int from = convertBoundaryToAbsolutePosition ( relativeRange . getFrom ( ) ) , to = convertBoundaryToAbsolutePosition ( relativeRange . getTo ( ) ) ; return new Range ( from , to ) ;
public class GeometryTranslator { /** * Builds a point feature from a dwg attribute . */ public SimpleFeature convertDwgAttribute ( String typeName , String layerName , DwgAttrib attribute , int id ) { } }
Point2D pto = attribute . getInsertionPoint ( ) ; Coordinate coord = new Coordinate ( pto . getX ( ) , pto . getY ( ) , attribute . getElevation ( ) ) ; String textString = attribute . getText ( ) ; return createPointTextFeature ( typeName , layerName , id , coord , textString ) ;
public class ScanDeterminizer { /** * Only applies when stronger determinism is needed . */ public static void apply ( CompiledPlan plan , DeterminismMode detMode ) { } }
if ( detMode == DeterminismMode . FASTER ) { return ; } if ( plan . hasDeterministicStatement ( ) ) { return ; } AbstractPlanNode planGraph = plan . rootPlanGraph ; if ( planGraph . isOrderDeterministic ( ) ) { return ; } AbstractPlanNode root = plan . rootPlanGraph ; root = recursivelyApply ( root ) ; plan . rootPlanG...
public class CLI { /** * Loads RSA / DSA private key in a PEM format into { @ link KeyPair } . */ public static KeyPair loadKey ( String pemString , String passwd ) throws IOException , GeneralSecurityException { } }
return PrivateKeyProvider . loadKey ( pemString , passwd ) ;
public class JSONSerializer { /** * Serialize a JSON object , array , or value . * @ param jsonVal * the json val * @ param jsonReferenceToId * a map from json reference to id * @ param includeNullValuedFields * the include null valued fields * @ param depth * the depth * @ param indentWidth * the i...
if ( jsonVal == null ) { buf . append ( "null" ) ; } else if ( jsonVal instanceof JSONObject ) { // Serialize JSONObject to string ( ( JSONObject ) jsonVal ) . toJSONString ( jsonReferenceToId , includeNullValuedFields , depth , indentWidth , buf ) ; } else if ( jsonVal instanceof JSONArray ) { // Serialize JSONArray t...
public class MutableRoaringBitmap { /** * Deserialize the bitmap ( retrieve from the input stream ) . The current bitmap is overwritten . * See format specification at https : / / github . com / RoaringBitmap / RoaringFormatSpec * @ param in the DataInput stream * @ throws IOException Signals that an I / O except...
try { getMappeableRoaringArray ( ) . deserialize ( in ) ; } catch ( InvalidRoaringFormat cookie ) { throw cookie . toIOException ( ) ; // we convert it to an IOException }
public class CollectionUtils { /** * Checks whether a Collection contains a specified Object . Object equality * ( = = ) , rather than . equals ( ) , is used . */ public static < T > boolean containsObject ( Collection < T > c , T o ) { } }
for ( Object o1 : c ) { if ( o == o1 ) { return true ; } } return false ;
public class CircularByteBuffer { /** * Gets a single byte return or - 1 if no data is available . */ public synchronized int get ( ) { } }
if ( available == 0 ) { return - 1 ; } byte value = buffer [ idxGet ] ; idxGet = ( idxGet + 1 ) % capacity ; available -- ; return value ;
public class WorkbenchPreferencePageCsk { /** * DirectoryFieldEditor vicePathMac = null ; */ @ Override protected Control createContents ( Composite parent ) { } }
Composite top = new Composite ( parent , SWT . LEFT ) ; // Sets the layout data for the top composite ' s // place in its parent ' s layout . top . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; // Sets the layout for the top composite ' s // children to populate . top . setLayout ( new GridLayout ( ) ...
public class NumericShaper { /** * Returns the index of the high bit in value ( assuming le , actually * power of 2 > = value ) . value must be positive . */ private static int getHighBit ( int value ) { } }
if ( value <= 0 ) { return - 32 ; } int bit = 0 ; if ( value >= 1 << 16 ) { value >>= 16 ; bit += 16 ; } if ( value >= 1 << 8 ) { value >>= 8 ; bit += 8 ; } if ( value >= 1 << 4 ) { value >>= 4 ; bit += 4 ; } if ( value >= 1 << 2 ) { value >>= 2 ; bit += 2 ; } if ( value >= 1 << 1 ) { bit += 1 ; } return bit ;
public class DescribeReservedInstancesOfferingsRequest { /** * One or more Reserved Instances offering IDs . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setReservedInstancesOfferingIds ( java . util . Collection ) } or * { @ link # withReservedInstances...
if ( this . reservedInstancesOfferingIds == null ) { setReservedInstancesOfferingIds ( new com . amazonaws . internal . SdkInternalList < String > ( reservedInstancesOfferingIds . length ) ) ; } for ( String ele : reservedInstancesOfferingIds ) { this . reservedInstancesOfferingIds . add ( ele ) ; } return this ;
public class HetatomImpl { /** * { @ inheritDoc } */ @ Override public void setAtoms ( List < Atom > atoms ) { } }
// important we are resetting atoms to a new list , we need to reset the lookup too ! if ( atomNameLookup != null ) atomNameLookup . clear ( ) ; for ( Atom a : atoms ) { a . setGroup ( this ) ; if ( atomNameLookup != null ) atomNameLookup . put ( a . getName ( ) , a ) ; } this . atoms = atoms ; if ( ! atoms . isEmpty (...
public class Payload { /** * @ return " the " value of this Payload , stuffed into an Object . * This is used for evaluating the " validator " portion of a * PayloadSpecification against these Payloads . * We don ' t want the JsonSerializer to know about this , so * renamed to not begin with " get " . */ @ Null...
if ( doubleValue != null ) { return doubleValue ; } if ( doubleArray != null ) { return doubleArray ; } if ( longValue != null ) { return longValue ; } if ( longArray != null ) { return longArray ; } if ( stringValue != null ) { return stringValue ; } if ( stringArray != null ) { return stringArray ; } if ( map != null...
public class ComputeNodeOperations { /** * Upload Azure Batch service log files from the specified compute node to Azure Blob Storage . * This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support . The Azure Batch serv...
UploadBatchServiceLogsConfiguration configuration = new UploadBatchServiceLogsConfiguration ( ) ; configuration . withContainerUrl ( containerUrl ) ; configuration . withStartTime ( startTime ) ; configuration . withEndTime ( endTime ) ; ComputeNodeUploadBatchServiceLogsOptions options = new ComputeNodeUploadBatchServi...
public class AbstractExtractor { /** * Gets annotation type . * @ return the annotation type */ public AnnotationType [ ] getAnnotationTypes ( ) { } }
if ( annotationType . isEmpty ( ) ) { return new AnnotationType [ ] { Types . TOKEN } ; } return annotationType . toArray ( new AnnotationType [ annotationType . size ( ) ] ) ;
public class Symbol { /** * Is this symbol the same as or enclosed by the given class ? */ public boolean isEnclosedBy ( ClassSymbol clazz ) { } }
for ( Symbol sym = this ; sym . kind != PCK ; sym = sym . owner ) if ( sym == clazz ) return true ; return false ;
public class MsgDestEncodingUtilsImpl { /** * decodeOtherProperties * Decode the more interesting JmsDestination properties , which may or may not be included : * Queue / Topic name * TopicSpace * ReadAhead * Cluster properties * @ param newDest The Destination to apply the properties to * @ param msgForm...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "decodeOtherProperties" , new Object [ ] { newDest , msgForm , offset } ) ; PropertyInputStream stream = new PropertyInputStream ( msgForm , offset ) ; while ( stream . hasMore ( ) ) { String shortName = stream . readShortNa...
public class EnumTriangles { public static void main ( String [ ] args ) throws Exception { } }
// Checking input parameters final ParameterTool params = ParameterTool . fromArgs ( args ) ; // set up execution environment final ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; // make parameters available in the web interface env . getConfig ( ) . setGlobalJobParameters ( params ) ; ...
public class PaymentChannelClientState { /** * Returns true if the tx is a valid settlement transaction . */ public synchronized boolean isSettlementTransaction ( Transaction tx ) { } }
try { tx . verify ( ) ; tx . getInput ( 0 ) . verify ( getContractInternal ( ) . getOutput ( 0 ) ) ; return true ; } catch ( VerificationException e ) { return false ; }
public class MethodSimulator { /** * Simulates the invoke dynamic call . Pushes a method handle on the stack . * @ param instruction The instruction to simulate */ private void simulateMethodHandle ( final InvokeDynamicInstruction instruction ) { } }
final List < Element > arguments = IntStream . range ( 0 , instruction . getDynamicIdentifier ( ) . getParameters ( ) . size ( ) ) . mapToObj ( t -> runtimeStack . pop ( ) ) . collect ( Collectors . toList ( ) ) ; Collections . reverse ( arguments ) ; if ( ! instruction . getDynamicIdentifier ( ) . isStaticMethod ( ) )...
public class CollUtil { /** * 新建一个空List * @ param < T > 集合元素类型 * @ param isLinked 是否新建LinkedList * @ return List对象 * @ since 4.1.2 */ public static < T > List < T > list ( boolean isLinked ) { } }
return isLinked ? new LinkedList < T > ( ) : new ArrayList < T > ( ) ;
public class IndianCalendar { /** * { @ inheritDoc } */ protected int handleComputeMonthStart ( int year , int month , boolean useMonth ) { } }
// month is 0 based ; converting it to 1 - based int imonth ; // If the month is out of range , adjust it into range , and adjust the extended year accordingly if ( month < 0 || month > 11 ) { year += month / 12 ; month %= 12 ; } imonth = month + 1 ; double jd = IndianToJD ( year , imonth , 1 ) ; return ( int ) jd ;
public class arp { /** * Use this API to send arp . */ public static base_response send ( nitro_service client , arp resource ) throws Exception { } }
arp sendresource = new arp ( ) ; sendresource . ipaddress = resource . ipaddress ; sendresource . td = resource . td ; sendresource . all = resource . all ; return sendresource . perform_operation ( client , "send" ) ;
public class KamDialect { /** * { @ inheritDoc } */ @ Override public KamNode replaceNode ( KamNode kamNode , FunctionEnum function , String label ) { } }
return kam . replaceNode ( kamNode , function , label ) ;
public class Parser { /** * or : = and ( & lt ; OR & gt ; and ) * */ protected AstNode or ( boolean required ) throws ScanException , ParseException { } }
AstNode v = and ( required ) ; if ( v == null ) { return null ; } while ( true ) { switch ( token . getSymbol ( ) ) { case OR : consumeToken ( ) ; v = createAstBinary ( v , and ( true ) , AstBinary . OR ) ; break ; case EXTENSION : if ( getExtensionHandler ( token ) . getExtensionPoint ( ) == ExtensionPoint . OR ) { v ...
public class Fields { /** * < p > Filters the { @ link Field } s which are annotated with the given annotation and returns a new * instance of { @ link Fields } that wrap the filtered collection . < / p > * @ param annotation * the { @ link Field } s annotated with this type will be filtered * < br > < br > *...
assertNotNull ( annotation , Class . class ) ; return new Fields ( filter ( new Criterion ( ) { @ Override public boolean evaluate ( Field field ) { return field . isAnnotationPresent ( annotation ) ; } } ) ) ;
public class AWSSimpleSystemsManagementClient { /** * Disassociates the specified Systems Manager document from the specified instance . * When you disassociate a document from an instance , it does not change the configuration of the instance . To * change the configuration state of an instance after you disassoci...
request = beforeClientExecution ( request ) ; return executeDeleteAssociation ( request ) ;
public class PublishingScopeUrl { /** * Get Resource Url for PublishDrafts * @ return String Resource Url */ public static MozuUrl publishDraftsUrl ( ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/publishing/publishdrafts" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class Debug { /** * After processing all the PDF documents , this method helps us to get the statistic information of all the PDF documents * such as the total number of pages , tables , etc . * @ param outputDirPath * the directory path where the middle - stage results will go to * @ param pdfFile * t...
try { File classificationData = new File ( outputDirPath , "statInfo" ) ; if ( ! classificationData . exists ( ) ) { classificationData . mkdirs ( ) ; } File fileName = new File ( classificationData , "tableNumStatInfo.txt" ) ; BufferedWriter bw0 = new BufferedWriter ( new FileWriter ( fileName , true ) ) ; bw0 . appen...
public class ThreadUtils { /** * Null - safe operation to interrupt the specified Thread . * @ param thread the Thread to interrupt . * @ see java . lang . Thread # interrupt ( ) */ @ NullSafe public static void interrupt ( Thread thread ) { } }
Optional . ofNullable ( thread ) . ifPresent ( Thread :: interrupt ) ;
public class JcaServiceUtilities { /** * Restore current context class loader saved when the context class loader was set to the one * for the resource adapter . * @ param raClassLoader * @ param previousClassLoader */ public void endContextClassLoader ( ClassLoader raClassLoader , ClassLoader previousClassLoader...
if ( raClassLoader != null ) { AccessController . doPrivileged ( new GetAndSetContextClassLoader ( previousClassLoader ) ) ; }
public class OptionsParamView { /** * Sets whether or not the HTTP CONNECT requests received by the local proxy should be ( persisted and ) shown in the UI . * @ param showConnectRequests { @ code true } if the HTTP CONNECT requests should be shown , { @ code false } otherwise * @ since 2.5.0 * @ see # isShowLoca...
if ( showLocalConnectRequests != showConnectRequests ) { showLocalConnectRequests = showConnectRequests ; getConfig ( ) . setProperty ( SHOW_LOCAL_CONNECT_REQUESTS , showConnectRequests ) ; }
public class SparqlCall { /** * URL - encode a string as UTF - 8 , catching any thrown UnsupportedEncodingException . */ private static final String encode ( String s ) { } }
try { return URLEncoder . encode ( s , UTF_8 ) ; } catch ( UnsupportedEncodingException e ) { throw new Error ( "JVM unable to handle UTF-8" ) ; }
public class AmazonRedshiftClient { /** * Deletes the specified Amazon Redshift HSM configuration . * @ param deleteHsmConfigurationRequest * @ return Result of the DeleteHsmConfiguration operation returned by the service . * @ throws InvalidHsmConfigurationStateException * The specified HSM configuration is no...
request = beforeClientExecution ( request ) ; return executeDeleteHsmConfiguration ( request ) ;
public class RuntimeConfiguration { /** * Adds a ( or a set of ) new host to the black list ; the host can be specified directly or it can be a file ( prefixed by * < code > file : < / code > ) . * @ param spec the specification ( a host , or a file prefixed by < code > file < / code > ) . * @ throws Configuratio...
if ( spec . length ( ) == 0 ) return ; // Skip empty specs if ( spec . startsWith ( "file:" ) ) { final LineIterator lineIterator = new LineIterator ( new FastBufferedReader ( new InputStreamReader ( new FileInputStream ( spec . substring ( 5 ) ) , Charsets . ISO_8859_1 ) ) ) ; while ( lineIterator . hasNext ( ) ) { fi...
public class Label { /** * Resolves all forward references to this label . This method must be called * when this label is added to the bytecode of the method , i . e . when its * position becomes known . This method fills in the blanks that where left * in the bytecode by each forward reference previously added ...
boolean needUpdate = false ; this . status |= RESOLVED ; this . position = position ; int i = 0 ; while ( i < referenceCount ) { int source = srcAndRefPositions [ i ++ ] ; int reference = srcAndRefPositions [ i ++ ] ; int offset ; if ( source >= 0 ) { offset = position - source ; if ( offset < Short . MIN_VALUE || offs...
public class Jaguar { /** * Installs the specified component into Jaguar . * The component must be installed after Jaguar started . * @ param component The component class to be installed . */ public static synchronized void install ( Class < ? > component ) { } }
Preconditions . checkState ( container != null , "Cannot install component until Jaguar starts" ) ; if ( ! installed ( component ) ) { container . install ( component ) ; }
public class AccountsInner { /** * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account . * @ param accountName The name of the Data La...
return listSasTokensWithServiceResponseAsync ( resourceGroupName , accountName , storageAccountName , containerName ) . map ( new Func1 < ServiceResponse < Page < SasTokenInfoInner > > , Page < SasTokenInfoInner > > ( ) { @ Override public Page < SasTokenInfoInner > call ( ServiceResponse < Page < SasTokenInfoInner > >...
public class N { /** * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param fromIndex * @ param toIndex * @ param func * @ param max * @ param supplier ...
checkFromToIndex ( fromIndex , toIndex , len ( a ) ) ; N . checkArgNotNull ( func ) ; if ( N . isNullOrEmpty ( a ) ) { return supplier . apply ( 0 ) ; } final C result = supplier . apply ( toIndex - fromIndex ) ; for ( int i = fromIndex ; i < toIndex ; i ++ ) { result . add ( func . apply ( a [ i ] ) ) ; } return resul...
public class BoxesRunTime { /** * arg . toChar */ public static java . lang . Character toCharacter ( Object arg ) throws NoSuchMethodException { } }
if ( arg instanceof java . lang . Integer ) return boxToCharacter ( ( char ) unboxToInt ( arg ) ) ; if ( arg instanceof java . lang . Short ) return boxToCharacter ( ( char ) unboxToShort ( arg ) ) ; if ( arg instanceof java . lang . Character ) return ( java . lang . Character ) arg ; if ( arg instanceof java . lang ....
public class BehaviorTreeLibrary { /** * Creates the { @ link BehaviorTree } for the specified reference and blackboard object . * @ param treeReference the tree identifier , typically a path * @ param blackboard the blackboard object ( it can be { @ code null } ) . * @ return the tree cloned from the archetype ....
BehaviorTree < T > bt = ( BehaviorTree < T > ) retrieveArchetypeTree ( treeReference ) . cloneTask ( ) ; bt . setObject ( blackboard ) ; return bt ;
public class TranslationServiceClient { /** * Gets a glossary . Returns NOT _ FOUND , if the glossary doesn ' t exist . * < p > Sample code : * < pre > < code > * try ( TranslationServiceClient translationServiceClient = TranslationServiceClient . create ( ) ) { * String formattedName = TranslationServiceClient...
GLOSSARY_PATH_TEMPLATE . validate ( name , "getGlossary" ) ; GetGlossaryRequest request = GetGlossaryRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getGlossary ( request ) ;
public class HttpIgnoreBodyCallback { /** * @ see * com . ibm . wsspi . channelfw . InterChannelCallback # error ( com . ibm . wsspi . channelfw * . VirtualConnection , java . lang . Throwable ) */ public void error ( VirtualConnection vc , Throwable t ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error() called: " + vc ) ; } // can ' t do anything with a null VC if ( null == vc ) { return ; } Object o = vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPICL ) ; if ( null == o ) { if ( TraceComponent . isAnyTraci...
public class Style { /** * Default material pink transparent style for SuperToasts . * @ return A new Style */ public static Style pink ( ) { } }
final Style style = new Style ( ) ; style . color = PaletteUtils . getSolidColor ( PaletteUtils . MATERIAL_PINK ) ; return style ;
public class NodeStepDataResultImpl { /** * Add a data context to a source result * @ param result * @ param dataContext * @ return */ public static NodeStepResult with ( final NodeStepResult result , final WFSharedContext dataContext ) { } }
return new NodeStepDataResultImpl ( result , result . getException ( ) , result . getFailureReason ( ) , result . getFailureMessage ( ) , result . getFailureData ( ) , result . getNode ( ) , dataContext ) ;
public class TransactionGeomIndexUtil { public static TransactionGeomIndex getIndex ( String identifier ) { } }
if ( identifier == null ) { return new TransactionGeomIndex ( ) ; } TransactionGeomIndex index = new TransactionGeomIndex ( ) ; int position = identifier . indexOf ( "featureTransaction.feature" ) ; if ( position >= 0 ) { String temp = identifier . substring ( position + ( "featureTransaction.feature" . length ( ) ) ) ...
public class WhiteSpaceFilterPrintWriter { /** * Writes the given byte to the underlying output stream if it passes filtering . * @ param c the byte to write . */ @ Override public void write ( final int c ) { } }
WhiteSpaceFilterStateMachine . StateChange change = stateMachine . nextState ( ( char ) c ) ; if ( change . getOutputBytes ( ) != null ) { for ( int i = 0 ; i < change . getOutputBytes ( ) . length ; i ++ ) { super . write ( change . getOutputBytes ( ) [ i ] ) ; } } if ( ! change . isSuppressCurrentChar ( ) ) { super ....