signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Math { /** * Minimize a function along a search direction by find a step which satisfies * a sufficient decrease condition and a curvature condition . * At each stage this function updates an interval of uncertainty with * endpoints < code > stx < / code > and < code > sty < / code > . The interval o...
if ( stpmax <= 0 ) { throw new IllegalArgumentException ( "Invalid upper bound of linear search step: " + stpmax ) ; } // Termination occurs when the relative width of the interval // of uncertainty is at most xtol . final double xtol = EPSILON ; // Tolerance for the sufficient decrease condition . final double ftol = ...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcDuctSegmentType ( ) { } }
if ( ifcDuctSegmentTypeEClass == null ) { ifcDuctSegmentTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 180 ) ; } return ifcDuctSegmentTypeEClass ;
public class PasswordAuthorizer { @ Override public String authUserInfo ( ) { } }
if ( this . username != null && this . password != null ) { return this . username + ':' + this . password ; } return null ;
public class TargetStreamManager { /** * Create a new StreamSet for a given streamID and sourceCellule . * @ param streamID * @ param sourceCellule * @ param remoteDestUuid This may not always be the same as the * Uuid of the local destination * @ param remoteBusUuid * @ return A new StreamSet * @ throws ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addNewStreamSet" , new Object [ ] { streamID , sourceMEUuid , remoteDestUuid , remoteBusUuid , linkTarget } ) ; StreamSet streamSet = null ; try { LocalTransaction tran = txManager . createLocalTransaction ( false ) ; Trans...
public class NodeSet { /** * Set the current position in the node set . * @ param i Must be a valid index . * @ throws RuntimeException thrown if this NodeSet is not of * a cached type , and thus doesn ' t permit indexed access . */ public void setCurrentPos ( int i ) { } }
if ( ! m_cacheNodes ) throw new RuntimeException ( XSLMessages . createXPATHMessage ( XPATHErrorResources . ER_NODESET_CANNOT_INDEX , null ) ) ; // " This NodeSet can not do indexing or counting functions ! " ) ; m_next = i ;
public class BindableASTTransformation { /** * Convenience method to see if an annotated node is { @ code @ Bindable } . * @ param node the node to check * @ return true if the node is bindable */ public static boolean hasBindableAnnotation ( AnnotatedNode node ) { } }
for ( AnnotationNode annotation : node . getAnnotations ( ) ) { if ( boundClassNode . equals ( annotation . getClassNode ( ) ) ) { return true ; } } return false ;
public class Hyaline { /** * It lets you create a new DTO from scratch . This means that any annotation * from JAXB , Jackson or whatever serialization framework you are using on * your entity T will be ignored . The only annotation - based configuration * that will be used is the one you are defining in this inv...
return dtoFromScratch ( entity , dtoTemplate , "Hyaline$Proxy$" + System . currentTimeMillis ( ) ) ;
public class ArticleConsumerLogMessages { /** * Logs the occurance of an ArticleReaderException . * @ param logger * reference to the logger * @ param e * reference to the exception */ public static void logTaskReaderException ( final Logger logger , final ArticleReaderException e ) { } }
logger . logException ( Level . ERROR , "TaskReaderException" , e ) ;
public class AbstractBaseJnlpMojo { /** * Log as info when verbose or info is enabled , as debug otherwise . * @ param msg the message to display */ protected void verboseLog ( String msg ) { } }
if ( isVerbose ( ) ) { getLog ( ) . info ( msg ) ; } else { getLog ( ) . debug ( msg ) ; }
public class RoleResource1 { /** * RESTful endpoint for creating a role . */ @ POST @ Path ( "{group}/{id}" ) @ Consumes ( MediaType . APPLICATION_JSON ) public Response createRole ( @ PathParam ( "group" ) String group , @ PathParam ( "id" ) String id , EmoRole role , final @ Authenticated Subject subject ) { } }
checkArgument ( role . getId ( ) . equals ( new EmoRoleKey ( group , id ) ) , "Body contains conflicting role identifier" ) ; return createRoleFromUpdateRequest ( group , id , new CreateEmoRoleRequest ( ) . setName ( role . getName ( ) ) . setDescription ( role . getDescription ( ) ) . setPermissions ( role . getPermis...
public class PromotionalCredit { public static AddRequest add ( ) throws IOException { } }
String uri = uri ( "promotional_credits" , "add" ) ; return new AddRequest ( Method . POST , uri ) ;
public class Main { /** * Runs the tool using the provided settings . * @ param editor the XML configuration file , parsed by the XmlEditor utility * @ param name the name of the RPM file to create * @ param version the version of the created RPM * @ param release the release version of the created RPM * @ pa...
Builder builder = new Builder ( ) ; builder . setPackage ( name , version , release ) ; RpmType type = RpmType . valueOf ( editor . getValue ( "rpm:type" , BINARY . toString ( ) ) ) ; builder . setType ( type ) ; Architecture arch = Architecture . valueOf ( editor . getValue ( "rpm:architecture" , NOARCH . toString ( )...
public class Attributes { /** * Associates the specified value with the specified attribute name , * specified as a String . The attributes name is case - insensitive . * If the Map previously contained a mapping for the attribute name , * the old value is replaced . * This method is defined as : * < pre > ...
return ( String ) put ( new Name ( name ) , value ) ;
public class SecurityManager { /** * Tries to authenticate an AuthenticationToken . * @ param authenticationToken * @ return an Account instance if authentication is successful , otherwise throws an AuthenticationException */ public Account check ( AuthenticationToken authenticationToken ) { } }
Account account = authenticate ( authenticationToken ) ; if ( account == null ) { throw new AuthenticationException ( "Invalid credentials" ) ; } return account ;
public class AdministratorImpl { /** * < p > Delete a subscription . < / p > * @ param name The destination name * @ param force The force deletion switch * @ return */ public void deleteSubscription ( String subId , boolean force ) throws SINotAuthorizedException , SIDurableSubscriptionNotFoundException , SIDest...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteSubscription" , new Object [ ] { subId , new Boolean ( force ) } ) ; checkStarted ( ) ; if ( subId == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteSubs...
public class XPathBuilder { /** * < p > < b > Used for finding element process ( to generate xpath address ) < / b > < / p > * @ param searchLabelTypes accepted values are : { @ link SearchType } * @ param < T > the element which calls this method * @ return this element */ @ SuppressWarnings ( "unchecked" ) priv...
this . searchLabelType = new ArrayList < > ( ) ; if ( searchLabelTypes != null ) { this . searchLabelType . addAll ( 0 , Arrays . asList ( searchLabelTypes ) ) ; } this . searchLabelType = cleanUpSearchType ( this . searchLabelType ) ; return ( T ) this ;
public class Resolve { /** * Resolve an unqualified method identifier . * @ param pos The position to use for error reporting . * @ param env The environment current at the method invocation . * @ param name The identifier ' s name . * @ param argtypes The types of the invocation ' s value arguments . * @ par...
return lookupMethod ( env , pos , env . enclClass . sym , resolveMethodCheck , new BasicLookupHelper ( name , env . enclClass . sym . type , argtypes , typeargtypes ) { @ Override Symbol doLookup ( Env < AttrContext > env , MethodResolutionPhase phase ) { return findFun ( env , name , argtypes , typeargtypes , phase . ...
public class BaseFileResourceModelSource { /** * Writes the data to a temp file , and attempts to parser it , then if successful it will * call { @ link # writeFileData ( InputStream ) } to invoke the sub class * @ param data data * @ return number of bytes written * @ throws IOException if an IO error occurs ...
if ( ! isDataWritable ( ) ) { throw new IllegalArgumentException ( "Cannot write to file, it is not configured to be writeable" ) ; } ResourceFormatParser resourceFormat = getResourceFormatParser ( ) ; // validate data File temp = Files . createTempFile ( "temp" , "." + resourceFormat . getPreferredFileExtension ( ) ) ...
public class PortablePositionNavigator { /** * Token without quantifier . It means it ' s just a simple field , not an array . */ private static PortablePosition navigateToPathTokenWithoutQuantifier ( PortableNavigatorContext ctx , PortablePathCursor path ) throws IOException { } }
if ( path . isLastToken ( ) ) { // if it ' s a token that ' s on the last position we calculate its direct access position and return it for // reading in the value reader . return createPositionForReadAccess ( ctx , path ) ; } else { // if it ' s not a token that ' s on the last position in the path we advance the pos...
public class ExpressionUtils { /** * If you register a CustomExpression with the name " customExpName " , then this will create the text needed * to invoke it in a JRDesignExpression * @ param customExpName * @ param usePreviousFieldValues * @ return */ public static String createCustomExpressionInvocationText ...
String stringExpression ; if ( customExpression instanceof DJSimpleExpression ) { DJSimpleExpression varexp = ( DJSimpleExpression ) customExpression ; String symbol ; switch ( varexp . getType ( ) ) { case DJSimpleExpression . TYPE_FIELD : symbol = "F" ; break ; case DJSimpleExpression . TYPE_VARIABLE : symbol = "V" ;...
public class ComponentBorder { /** * The insets need to be determined so they are included in the preferred * size of the component the Border is attached to . * The alignment of the component is determined here so it doesn ' t need * to be recalculated every time the Border is painted . */ private void determine...
borderInsets = new Insets ( 0 , 0 , 0 , 0 ) ; // The insets will only be updated for the edge the component will be // diplayed on . // The X , Y alignment of the component is controlled by both the edge // and alignment parameters if ( edge == Edge . TOP ) { borderInsets . top = component . getPreferredSize ( ) . heig...
public class AoInterfaceCodeGen { /** * Output class * @ param def definition * @ param out Writer * @ throws IOException ioException */ @ Override public void writeClassBody ( Definition def , Writer out ) throws IOException { } }
out . write ( "public interface " + getClassName ( def ) ) ; if ( def . isAdminObjectImplRaAssociation ( ) ) { out . write ( " extends Referenceable, Serializable" ) ; } writeLeftCurlyBracket ( out , 0 ) ; writeEol ( out ) ; int indent = 1 ; writeConfigProps ( def , out , indent ) ; writeRightCurlyBracket ( out , 0 ) ;
public class ColorChooserFrame { /** * GEN - LAST : event _ okButtonActionPerformed */ private void cancelButtonActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ cancelButtonActionPerformed feedback = UserFeedback . Cancel ; synchronized ( WAITER_LOCK ) { okButton . setEnabled ( false ) ; cancelButton . setEnabled ( false ) ; WAITER_LOCK . notifyAll ( ) ; }
public class Team { /** * List all oTask / Activity records within a team by specified code ( s ) * @ param company Company ID * @ paramteam Team ID * @ param code Specific code ( s ) * @ throwsJSONException If error occurred * @ return { @ link JSONObject } */ public JSONObject getSpecificList ( String compa...
return _getByType ( company , team , code ) ;
public class Maybe { /** * If the value is present , return it ; otherwise , throw the { @ link Throwable } supplied by * < code > throwableSupplier < / code > . * @ param throwableSupplier the supplier of the potentially thrown { @ link Throwable } * @ param < E > the Throwable type * @ return the value , if p...
return orElseGet ( ( CheckedSupplier < E , A > ) ( ) -> { throw throwableSupplier . get ( ) ; } ) ;
public class CheckJSDoc { /** * Checks that deprecated annotations such as @ expose are not present */ private void validateDeprecatedJsDoc ( Node n , JSDocInfo info ) { } }
if ( info != null && info . isExpose ( ) ) { report ( n , ANNOTATION_DEPRECATED , "@expose" , "Use @nocollapse or @export instead." ) ; }
public class DefaultItemDataCopyVisitor { /** * { @ inheritDoc } */ @ Override protected void entering ( PropertyData property , int level ) throws RepositoryException { } }
InternalQName qname = property . getQPath ( ) . getName ( ) ; List < ValueData > values ; if ( ntManager . isNodeType ( Constants . MIX_REFERENCEABLE , curParent ( ) . getPrimaryTypeName ( ) , curParent ( ) . getMixinTypeNames ( ) ) && qname . equals ( Constants . JCR_UUID ) ) { values = new ArrayList < ValueData > ( 1...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcEnergyMeasure ( ) { } }
if ( ifcEnergyMeasureEClass == null ) { ifcEnergyMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 805 ) ; } return ifcEnergyMeasureEClass ;
public class EJSContainer { /** * Tell the container that the given container transaction has * completed . < p > */ public void containerTxCompleted ( ContainerTx containerTx ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "containerTxCompleted (" + ContainerTx . uowIdToString ( containerTx . ivTxKey ) + ")" ) ; // Release any Option A locks not released as part of normal afterCompletion // proce...
public class RouterMiddleware { /** * Creates a { @ link Route } object and adds it to the routes list . It will respond to the POST HTTP method and the * specified < code > path < / code > invoking the { @ link RouteHandler } object . * @ param path the path to which this route will respond . * @ param handler t...
try { addRoute ( HttpMethod . POST , path , handler , "handle" ) ; } catch ( NoSuchMethodException e ) { // shouldn ' t happen unless we change the name of the method in RouteHandler throw new RuntimeException ( e ) ; }
public class P2sVpnGatewaysInner { /** * Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param gatewayName The name of the P2SVpnGateway . * @ throws IllegalArgumentException thrown if parameters fail the ...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( gatewayName == null ) { throw new IllegalArgumentException ( "Parameter gatewayName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ...
public class DssatXFileOutput { /** * To check if there is plot info data existed in the experiment * @ param expData experiment data holder * @ return the boolean value for if plot info exists */ private boolean isPlotInfoExist ( Map expData ) { } }
String [ ] plotIds = { "plta" , "pltr#" , "pltln" , "pldr" , "pltsp" , "pllay" , "pltha" , "plth#" , "plthl" , "plthm" } ; for ( String plotId : plotIds ) { if ( ! getValueOr ( expData , plotId , "" ) . equals ( "" ) ) { return true ; } } return false ;
public class MsgSettingController { /** * Download api all . * @ param req the req * @ param res the res */ @ GetMapping ( "/setting/download/api/excel/all" ) public void downloadApiAll ( HttpServletRequest req , HttpServletResponse res ) { } }
this . validationSessionComponent . sessionCheck ( req ) ; PoiWorkBook workBook = this . msgExcelService . getAllExcels ( ) ; workBook . writeFile ( "ValidationApis_" + System . currentTimeMillis ( ) , res ) ;
public class SwitchSliderTileSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
super . initGraphics ( ) ; mouseEventHandler = e -> { final EventType TYPE = e . getEventType ( ) ; final Object SRC = e . getSource ( ) ; if ( MouseEvent . MOUSE_PRESSED == TYPE ) { if ( SRC . equals ( thumb ) ) { dragStart = thumb . localToParent ( e . getX ( ) , e . getY ( ) ) ; formerThumbPos = ( tile . getCurrentV...
public class HttpHeaderOperation { /** * Parse { @ code value } as < em > byte - content - range - spec < / em > . * < em > byte - range - resp - spec < / em > is parsed with { @ link # parseRange ( String ) } . * If < em > byte - range - resp - spec < / em > is { @ code * } , both < em > first - byte - pos < / em ...
if ( ! value . startsWith ( "bytes " ) ) return null ; int s = "bytes " . length ( ) ; while ( s < value . length ( ) && value . charAt ( s ) == ' ' ) s ++ ; int pslash = value . indexOf ( '/' , s ) ; if ( pslash < 0 ) return null ; final String rangeSpec = value . substring ( s , pslash ) . trim ( ) ; long start , sto...
public class SqlTileWriter { /** * Count cache tiles * @ param pTileSourceName the tile source name ( possibly null ) * @ param pZoom the zoom level * @ param pInclude a collection of bounding boxes to include ( possibly null / empty ) * @ param pExclude a collection of bounding boxes to exclude ( possibly null...
return getRowCount ( getWhereClause ( pZoom , pInclude , pExclude ) + ( pTileSourceName != null ? " and " + COLUMN_PROVIDER + "=?" : "" ) , pTileSourceName != null ? new String [ ] { pTileSourceName } : null ) ;
public class StorageProviderBase { /** * { @ inheritDoc } */ public void deleteSpace ( String spaceId ) { } }
log . debug ( "deleteSpace(" + spaceId + ")" ) ; throwIfSpaceNotExist ( spaceId ) ; Map < String , String > allProps = getAllSpaceProperties ( spaceId ) ; allProps . put ( "is-delete" , "true" ) ; doSetSpaceProperties ( spaceId , allProps ) ; SpaceDeleteWorker deleteThread = getSpaceDeleteWorker ( spaceId ) ; new Threa...
public class DefaultDocWorkUnitHandler { /** * Recursive helper routine to getFieldDoc ( ) */ private FieldDoc getFieldDoc ( final ClassDoc classDoc , final String argumentFieldName ) { } }
for ( final FieldDoc fieldDoc : classDoc . fields ( false ) ) { if ( fieldDoc . name ( ) . equals ( argumentFieldName ) ) { return fieldDoc ; } // This can return null , specifically , we can encounter https : / / bugs . openjdk . java . net / browse / JDK - 8033735, // which is fixed in JDK9 http : / / hg . openjdk . ...
public class LambdaFactory { /** * Returns a LambdaFactory instance with the given configuration . * @ throws JavaCompilerNotFoundException if the library cannot find any java compiler and it ' s not provided * in the configuration */ public static LambdaFactory get ( LambdaFactoryConfiguration configuration ) { } ...
JavaCompiler compiler = Optional . ofNullable ( configuration . getJavaCompiler ( ) ) . orElseThrow ( JavaCompilerNotFoundException :: new ) ; return new LambdaFactory ( configuration . getDefaultHelperClassSourceProvider ( ) , configuration . getClassFactory ( ) , compiler , configuration . getImports ( ) , configurat...
public class Range { /** * Checks whether this range is after the specified element . * @ param element the element to check for , null returns false * @ return true if this range is entirely after the specified element */ public boolean isAfter ( T element ) { } }
if ( element == null ) { return false ; } return comparator . compare ( element , min ) < 0 ;
public class BasicAgigaSentence { /** * / * ( non - Javadoc ) * @ see edu . jhu . hltcoe . sp . data . depparse . AgigaSentence # writeTags ( java . io . Writer , boolean , boolean , boolean ) */ public void writeTags ( Writer writer , boolean useLemmas , boolean useNormNer , boolean useNerTags ) throws IOException {...
for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { AgigaToken tok = tokens . get ( i ) ; if ( useNormNer && tok . getNormNer ( ) != null ) { require ( prefs . readNormNer , "AgigaPrefs.readNormNer must be true if useNormNer=true for writeTags()" ) ; writer . write ( tok . getNormNer ( ) ) ; } else if ( useLemmas ) { re...
public class WebSocketFrame { /** * Parse the first two bytes of the payload as a close code . * If any payload is not set or the length of the payload is less than 2, * this method returns 1005 ( { @ link WebSocketCloseCode # NONE } ) . * The value returned from this method is meaningless if this frame * is no...
if ( mPayload == null || mPayload . length < 2 ) { return WebSocketCloseCode . NONE ; } // A close code is encoded in network byte order . int closeCode = ( ( ( mPayload [ 0 ] & 0xFF ) << 8 ) | ( mPayload [ 1 ] & 0xFF ) ) ; return closeCode ;
public class MessageHeader { /** * Prints the key - value pairs represented by this * header . Also prints the RFC required blank line * at the end . Omits pairs with a null key . */ public synchronized void print ( PrintStream p ) { } }
for ( int i = 0 ; i < nkeys ; i ++ ) if ( keys [ i ] != null ) { p . print ( keys [ i ] + ( values [ i ] != null ? ": " + values [ i ] : "" ) + "\r\n" ) ; } p . print ( "\r\n" ) ; p . flush ( ) ;
public class AWSMediaConnectClient { /** * Removes an output from an existing flow . This request can be made only on an output that does not have an * entitlement associated with it . If the output has an entitlement , you must revoke the entitlement instead . When * an entitlement is revoked from a flow , the ser...
request = beforeClientExecution ( request ) ; return executeRemoveFlowOutput ( request ) ;
public class JKObjectUtil { /** * Gets the all classes in package . * @ param packageName the package name * @ return the all classes in package */ public static List < String > getAllClassesInPackage ( String packageName ) { } }
List < String > classesNames = new Vector < > ( ) ; // create scanner and disable default filters ( that is the ' false ' argument ) final ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider ( false ) ; // add include filters which matches all the classes ( or use your...
public class AbstractQueryProtocol { /** * Reset connection state . * < ol > * < li > Transaction will be rollback < / li > * < li > transaction isolation will be reset < / li > * < li > user variables will be removed < / li > * < li > sessions variables will be reset to global values < / li > * < / ol > ...
cmdPrologue ( ) ; try { writer . startPacket ( 0 ) ; writer . write ( COM_RESET_CONNECTION ) ; writer . flush ( ) ; getResult ( new Results ( ) ) ; // clear prepare statement cache if ( options . cachePrepStmts && options . useServerPrepStmts ) { serverPrepareStatementCache . clear ( ) ; } } catch ( SQLException sqlExc...
public class ThymeleafCall { /** * Render the template to a String * @ return */ public String process ( ) { } }
Timer . Context timer = calls . time ( ) ; try { return engine . process ( name , context ) ; } catch ( Throwable e ) { failures . mark ( ) ; throw e ; } finally { timer . stop ( ) ; }
public class RtfFont { /** * Writes the font beginning * @ param result The < code > OutputStream < / code > to write to . * @ throws IOException On i / o errors . */ public void writeBegin ( final OutputStream result ) throws IOException { } }
if ( this . fontNumber != Font . UNDEFINED ) { result . write ( RtfFontList . FONT_NUMBER ) ; result . write ( intToByteArray ( fontNumber ) ) ; } if ( this . fontSize != Font . UNDEFINED ) { result . write ( FONT_SIZE ) ; result . write ( intToByteArray ( fontSize * 2 ) ) ; } if ( this . fontStyle != UNDEFINED ) { if ...
public class TaskTemplateCache { /** * Return the latest task id for the given logical ID */ public static TaskTemplate getTaskTemplate ( String logicalId ) { } }
for ( int i = 0 ; i < taskVoCache . size ( ) ; i ++ ) { TaskTemplate task = taskVoCache . get ( i ) ; if ( logicalId . equals ( task . getLogicalId ( ) ) ) { return task ; } } return null ;
public class DeepWalk { /** * Initialize the DeepWalk model with a given graph . */ public void initialize ( IGraph < V , E > graph ) { } }
int nVertices = graph . numVertices ( ) ; int [ ] degrees = new int [ nVertices ] ; for ( int i = 0 ; i < nVertices ; i ++ ) degrees [ i ] = graph . getVertexDegree ( i ) ; initialize ( degrees ) ;
public class ScriptPluginProviderLoader { /** * Return the version string metadata value for the plugin file , or null if it is not available or could not * loaded * @ param file file * @ return version string */ static String getVersionForFile ( final File file ) { } }
try { final PluginMeta pluginMeta = loadMeta ( file ) ; return pluginMeta . getVersion ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ;
public class ResourceModelFactory { /** * Factory method to create a new { @ link StringResourceModel } from the given resource key and * given component . * @ param resourceKey * the resource key * @ param component * the component * @ return a new { @ link StringResourceModel } as an { @ link IModel } */ ...
return newResourceModel ( resourceKey , component , null , "" ) ;
public class GroovyShell { /** * Evaluates some script against the current Binding and returns the result * @ param scriptText the text of the script * @ param fileName is the logical file name of the script ( which is used to create the class name of the script ) */ public Object evaluate ( String scriptText , Str...
return evaluate ( scriptText , fileName , DEFAULT_CODE_BASE ) ;
public class StringUtils { /** * < p > Strips any of a set of characters from the start and end of every * String in an array . < / p > * < p > Whitespace is defined by { @ link CharUtils # isWhitespace ( char ) } . < / p > * < p > A new array is returned each time , except for length zero . * A { @ code null }...
int strsLen ; if ( strs == null || ( strsLen = strs . length ) == 0 ) { return strs ; } final String [ ] newArr = new String [ strsLen ] ; for ( int i = 0 ; i < strsLen ; i ++ ) { newArr [ i ] = strip ( strs [ i ] , stripChars ) ; } return newArr ;
public class ComputeExample { /** * List addresses , Insert an address , and then delete the address . Use ResourceNames in the * request objects . */ public static void main ( String [ ] args ) throws IOException { } }
AddressClient client = createCredentialedClient ( ) ; System . out . println ( "Running with Gapic Client." ) ; AddressClient . ListAddressesPagedResponse listResponse = listAddresses ( client ) ; verifyListAddressWithGets ( client , listResponse ) ; System . out . println ( "Running with Gapic Client and Resource Name...
public class SpaceResource { /** * Provides a listing of all spaces for a customer . Open spaces are * always included in the list , closed spaces are included based * on user authorization . * @ param storeID * @ return XML listing of spaces */ public String getSpaces ( String storeID ) throws ResourceExceptio...
Element spacesElem = new Element ( "spaces" ) ; try { StorageProvider storage = storageProviderFactory . getStorageProvider ( storeID ) ; Iterator < String > spaces = storage . getSpaces ( ) ; while ( spaces . hasNext ( ) ) { String spaceID = spaces . next ( ) ; Element spaceElem = new Element ( "space" ) ; spaceElem ....
public class BasicCastUtils { /** * Check if objects have equals types , even if they are primitive */ public static boolean areEquals ( final Class < ? > firstClass , final Class < ? > secondClass ) { } }
final boolean isFirstShort = firstClass . isAssignableFrom ( Short . class ) ; final boolean isSecondShort = secondClass . isAssignableFrom ( Short . class ) ; if ( isFirstShort && isSecondShort || isFirstShort && secondClass . equals ( short . class ) || firstClass . equals ( short . class ) && isSecondShort ) return ...
public class JcrServiceFactory { /** * - - - - - < factories > - - - */ private Map < String , JcrRepository > loadRepositories ( ) { } }
Map < String , JcrRepository > list = new HashMap < > ( ) ; Set < String > names = RepositoryManager . getJcrRepositoryNames ( ) ; for ( String repositoryId : names ) { try { Repository repository = RepositoryManager . getRepository ( repositoryId ) ; list . put ( repositoryId , new JcrMsRepository ( repository , pathM...
public class CharacterApi { /** * Character affiliation Bulk lookup of character IDs to corporation , * alliance and faction - - - This route is cached for up to 3600 seconds * @ param requestBody * The character IDs to fetch affiliations for . All characters * must exist , or none will be returned ( required )...
ApiResponse < List < CharacterAffiliationResponse > > resp = postCharactersAffiliationWithHttpInfo ( requestBody , datasource ) ; return resp . getData ( ) ;
public class ServiceRegistry { /** * 获取服务注册对象 * @ return 服务注册信息保存者 */ @ SuppressWarnings ( "unchecked" ) public static < E > ServiceRegistry < E > getInstance ( ) { } }
if ( instance == null ) { synchronized ( ServiceRegistry . class ) { if ( instance == null ) { instance = new ServiceRegistry < E > ( ) ; } } } return instance ;
public class QDate { /** * Returns the week in the year . */ public int getWeek ( ) { } }
int dow4th = ( int ) ( ( _dayOfEpoch - _dayOfYear + 3 ) % 7 + 10 ) % 7 ; int ww1monday = 3 - dow4th ; if ( _dayOfYear < ww1monday ) return 53 ; int week = ( _dayOfYear - ww1monday ) / 7 + 1 ; if ( _dayOfYear >= 360 ) { int days = 365 + ( _isLeapYear ? 1 : 0 ) ; long nextNewYear = ( _dayOfEpoch - _dayOfYear + days ) ; i...
public class Matrix3d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix3dc # positiveX ( org . joml . Vector3d ) */ public Vector3d positiveX ( Vector3d dir ) { } }
dir . x = m11 * m22 - m12 * m21 ; dir . y = m02 * m21 - m01 * m22 ; dir . z = m01 * m12 - m02 * m11 ; return dir . normalize ( dir ) ;
public class HtmlRendererUtils { /** * Renders a html string type attribute . If the value retrieved from the component * property is " " , the attribute is rendered . * @ param writer * @ param component * @ param componentProperty * @ param htmlAttrName * @ return * @ throws IOException */ public static...
String value = ( String ) component . getAttributes ( ) . get ( componentProperty ) ; if ( ! isDefaultStringPreserveEmptyAttributeValue ( value ) ) { writer . writeAttribute ( htmlAttrName , value , componentProperty ) ; return true ; } return false ;
public class CreateUserPoolRequest { /** * Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up . * @ param usernameAttributes * Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up . * @ see UsernameAttributeType */...
if ( usernameAttributes == null ) { this . usernameAttributes = null ; return ; } this . usernameAttributes = new java . util . ArrayList < String > ( usernameAttributes ) ;
public class AWSOrganizationsClient { /** * Retrieves information about a previously requested handshake . The handshake ID comes from the response to the * original < a > InviteAccountToOrganization < / a > operation that generated the handshake . * You can access handshakes that are ACCEPTED , DECLINED , or CANCE...
request = beforeClientExecution ( request ) ; return executeDescribeHandshake ( request ) ;
public class AsyncConditions { /** * Waits until all evaluate blocks have completed or the specified timeout * ( in seconds ) expires . If one of the evaluate blocks throws an exception , it is rethrown * from this method . * @ param seconds the timeout ( in seconds ) * @ throws InterruptedException if the call...
latch . await ( ( long ) ( seconds * 1000 ) , TimeUnit . MILLISECONDS ) ; if ( ! exceptions . isEmpty ( ) ) throw exceptions . poll ( ) ; long pendingEvalBlocks = latch . getCount ( ) ; if ( pendingEvalBlocks > 0 ) { String msg = String . format ( "Async conditions timed out " + "after %1.2f seconds; %d out of %d evalu...
public class gslbvserver_binding { /** * Use this API to fetch gslbvserver _ binding resource of given name . */ public static gslbvserver_binding get ( nitro_service service , String name ) throws Exception { } }
gslbvserver_binding obj = new gslbvserver_binding ( ) ; obj . set_name ( name ) ; gslbvserver_binding response = ( gslbvserver_binding ) obj . get_resource ( service ) ; return response ;
public class EntityUrl { /** * Get Resource Url for DeleteEntity * @ param entityListFullName The full name of the EntityList including namespace in name @ nameSpace format * @ param id Unique identifier of the customer segment to retrieve . * @ return String Resource Url */ public static MozuUrl deleteEntityUrl ...
UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/entities/{id}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "id" , id ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class DisksInner { /** * Gets information about a disk . * @ param resourceGroupName The name of the resource group . * @ param diskName The name of the managed disk that is being created . The name can ' t be changed after the disk is created . Supported characters for the name are a - z , A - Z , 0-9 and _...
return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , diskName ) . map ( new Func1 < ServiceResponse < DiskInner > , DiskInner > ( ) { @ Override public DiskInner call ( ServiceResponse < DiskInner > response ) { return response . body ( ) ; } } ) ;
public class ReferenceBasedOutlierDetection { /** * Update the density estimates for each object . * @ param rbod _ score Density storage * @ param referenceDists Distances from current reference point */ protected void updateDensities ( WritableDoubleDataStore rbod_score , DoubleDBIDList referenceDists ) { } }
DoubleDBIDListIter it = referenceDists . iter ( ) ; for ( int l = 0 ; l < referenceDists . size ( ) ; l ++ ) { double density = computeDensity ( referenceDists , it , l ) ; // computeDensity modified the iterator , reset : it . seek ( l ) ; // NaN indicates the first run . if ( ! ( density > rbod_score . doubleValue ( ...
public class ListAvailableManagementCidrRangesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListAvailableManagementCidrRangesRequest listAvailableManagementCidrRangesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listAvailableManagementCidrRangesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAvailableManagementCidrRangesRequest . getManagementCidrRangeConstraint ( ) , MANAGEMENTCIDRRANGECONSTRAINT_BINDING ) ; protocolMarshaller ....
public class SpinWait { /** * / * ( non - Javadoc ) * @ see cyclops2 . async . wait . WaitStrategy # offer ( cyclops2 . async . wait . WaitStrategy . Offerable ) */ @ Override public boolean offer ( final WaitStrategy . Offerable o ) throws InterruptedException { } }
while ( ! o . offer ( ) ) { LockSupport . parkNanos ( 1l ) ; } return true ;
public class CmsSourceSearchFilesDialog { /** * Returns a list of list items from a list of resources . < p > * @ return a list of { @ link CmsListItem } objects */ @ Override protected List < CmsListItem > getListItems ( ) { } }
List < CmsListItem > ret = new ArrayList < CmsListItem > ( ) ; applyColumnVisibilities ( ) ; CmsHtmlList list = getList ( ) ; CmsListColumnDefinition colPermissions = list . getMetadata ( ) . getColumnDefinition ( A_CmsListExplorerDialog . LIST_COLUMN_PERMISSIONS ) ; boolean showPermissions = ( colPermissions . isVisib...
public class OmemoManager { /** * Distrust the fingerprint / OmemoDevice tuple . * The fingerprint must be the lowercase , hexadecimal fingerprint of the identityKey of the device and must * be of length 64. * @ param device device * @ param fingerprint fingerprint */ public void distrustOmemoIdentity ( OmemoDe...
if ( trustCallback == null ) { throw new IllegalStateException ( "No TrustCallback set." ) ; } trustCallback . setTrust ( device , fingerprint , TrustState . untrusted ) ;
public class EmailAddressValidator { /** * Set the global " check MX record " flag . * @ param bPerformMXRecordCheck * < code > true < / code > to enable , < code > false < / code > otherwise . */ public static void setPerformMXRecordCheck ( final boolean bPerformMXRecordCheck ) { } }
s_aPerformMXRecordCheck . set ( bPerformMXRecordCheck ) ; if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Email address record check is " + ( bPerformMXRecordCheck ? "enabled" : "disabled" ) ) ;
public class SectionLoader { /** * Fetches the { @ link SectionHeader } of the section the data directory entry * for the dataDirKey points into . * Returns absent if the data directory doesn ' t exist . * @ param dataDirKey * the data directory key * @ return the section table entry the data directory entry ...
Optional < DataDirEntry > dataDir = optHeader . maybeGetDataDirEntry ( dataDirKey ) ; if ( dataDir . isPresent ( ) ) { return dataDir . get ( ) . maybeGetSectionTableEntry ( table ) ; } logger . warn ( "data dir entry " + dataDirKey + " doesn't exist" ) ; return Optional . absent ( ) ;
public class Blob { /** * Returns an { @ link InputStream } for this blob content . */ public InputStream asInputStream ( ) { } }
final ByteBuffer byteBuffer = asReadOnlyByteBuffer ( ) ; return new InputStream ( ) { @ Override public int read ( ) { return ! byteBuffer . hasRemaining ( ) ? - 1 : byteBuffer . get ( ) & 0xFF ; } } ;
public class TransactionSnippets { /** * [ VARIABLE " my _ second _ key _ name " ] */ public List < Entity > getMultiple ( String firstKeyName , String secondKeyName ) { } }
Datastore datastore = transaction . getDatastore ( ) ; // TODO change so that it ' s not necessary to hold the entities in a list for integration testing // [ START getMultiple ] KeyFactory keyFactory = datastore . newKeyFactory ( ) . setKind ( "MyKind" ) ; Key firstKey = keyFactory . newKey ( firstKeyName ) ; Key seco...
public class DevicesManagementApi { /** * Returns the all the tasks for a device type . * Returns the all the tasks for a device type . * @ param dtid Device Type ID . ( required ) * @ param count Max results count . ( optional ) * @ param offset Result starting offset . ( optional ) * @ param status Status f...
com . squareup . okhttp . Call call = getTasksValidateBeforeCall ( dtid , count , offset , status , order , sort , null , null ) ; Type localVarReturnType = new TypeToken < TaskListEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class Reflections { /** * Tries to load a class using the specified ResourceLoader . Returns null if the class is not found . * @ param className * @ param resourceLoader * @ return the loaded class or null if the given class cannot be loaded */ public static < T > Class < T > loadClass ( String className ...
try { return cast ( resourceLoader . classForName ( className ) ) ; } catch ( ResourceLoadingException e ) { return null ; } catch ( SecurityException e ) { return null ; }
public class Alias { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPAliasControllable # getMaxReliability ( ) */ public Reliability getMaxReliability ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMaxReliability" ) ; Reliability maxRel = aliasDest . getMaxReliability ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMaxReliability" , maxRel ) ; return maxRel ;
public class DefaultHardwareClock { /** * / * ( non - Javadoc ) * @ see org . fishwife . jrugged . clocks . HardwareClock # getGranularity ( ) */ public long getGranularity ( ) { } }
long now = env . currentTimeMillis ( ) ; long curr = lastSampleTime . get ( ) ; if ( now - curr > periodMillis && lastSampleTime . compareAndSet ( curr , now ) ) { samples [ sampleIndex ] = sampleGranularity ( ) ; sampleIndex = ( sampleIndex + 1 ) % samples . length ; long max = 0L ; for ( long sample : samples ) { if ...
public class ProfileSummaryBuilder { /** * Build the summary for the enums in the package . * @ param node the XML element that specifies which components to document * @ param packageSummaryContentTree the tree to which the enum summary will * be added */ public void buildEnumSummary ( XMLNode node , Content pac...
String enumTableSummary = configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Enum_Summary" ) , configuration . getText ( "doclet.enums" ) ) ; String [ ] enumTableHeader = new String [ ] { configuration . getText ( "doclet.Enum" ) , configuration . getText ( "doclet.Description" ...
public class Module { /** * < p > This will add items to the Gosu classpath , but only under very specific circumstances . * < p > If both of the following conditions are met : * < ul > * < li > The JAR ' s manifest contains a Class - Path entry < / li > * < li > The Class - Path entry contains a space - delimi...
if ( classpath == null ) { return classpath ; } ArrayList < IDirectory > newClasspath = new ArrayList < > ( ) ; for ( IDirectory root : classpath ) { // add the root JAR itself first , preserving ordering if ( ! newClasspath . contains ( root ) ) { newClasspath . add ( root ) ; } if ( root instanceof JarFileDirectoryIm...
public class MongodbQueue { /** * { @ inheritDoc } */ @ Override public void finish ( IQueueMessage < ID , DATA > msg ) { } }
if ( ! isEphemeralDisabled ( ) ) { getCollection ( ) . deleteOne ( Filters . and ( Filters . ne ( COLLECTION_FIELD_EPHEMERAL_KEY , null ) , Filters . eq ( COLLECTION_FIELD_ID , msg . getId ( ) ) ) ) ; }
public class MyAuthHandler { /** * Checks whether the request has right permission to access the service . In this example , a { @ code Cookie } * header is used to hold the information . If a { @ code username } key exists in the { @ code Cookie } header , * the request is treated as authenticated . */ @ Override ...
final String cookie = data . headers ( ) . get ( HttpHeaderNames . COOKIE ) ; if ( cookie == null ) { return CompletableFuture . completedFuture ( false ) ; } final boolean authenticated = ServerCookieDecoder . LAX . decode ( cookie ) . stream ( ) . anyMatch ( c -> "username" . equals ( c . name ( ) ) && ! Strings . is...
public class ImportApi { /** * Validate the import file . * Performs pre - validation on the specified CSV / XLS file . * @ param csvfile The CSV / XLS file to import . ( optional ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the res...
ApiResponse < ApiSuccessResponse > resp = validateImportFileWithHttpInfo ( csvfile ) ; return resp . getData ( ) ;
public class StructrSchema { /** * Extend the current Structr schema by the elements contained in the given new schema . * @ param app * @ param newSchema the new schema to add to the current Structr schema * @ throws FrameworkException * @ throws URISyntaxException */ public static void extendDatabaseSchema ( ...
try ( final Tx tx = app . tx ( ) ) { newSchema . createDatabaseSchema ( app , JsonSchema . ImportMode . extend ) ; tx . success ( ) ; }
public class Compression { /** * Returns the registered { @ code Compression } format matching the extension in the file name * supplied , or the { @ code fallback } specified if none matches . * @ param fileName * the file name , not null * @ param fallback * the { @ code Compression } to return if none matc...
final int index = fileName . lastIndexOf ( '.' ) ; final String extension = ( index < 0 ? fileName : fileName . substring ( index + 1 ) ) . toLowerCase ( ) ; for ( final Compression compression : register ) { final List < String > extensions = compression . fileExtensions ; if ( ! extensions . isEmpty ( ) && extensions...
public class AtomicBiInteger { /** * Atomically adds the given delta to the current hi value , returning the updated hi value . * @ param delta the delta to apply * @ return the updated hi value */ public int addAndGetHi ( int delta ) { } }
while ( true ) { long encoded = get ( ) ; int hi = getHi ( encoded ) + delta ; long update = encodeHi ( encoded , hi ) ; if ( compareAndSet ( encoded , update ) ) return hi ; }
public class AddAttachmentsToSetRequest { /** * One or more attachments to add to the set . The limit is 3 attachments per set , and the size limit is 5 MB per * attachment . * @ return One or more attachments to add to the set . The limit is 3 attachments per set , and the size limit is 5 MB * per attachment . *...
if ( attachments == null ) { attachments = new com . amazonaws . internal . SdkInternalList < Attachment > ( ) ; } return attachments ;
public class TemplatedProcessor { /** * - - - - - @ Templated types */ @ Override protected boolean onProcess ( Set < ? extends TypeElement > annotations , RoundEnvironment roundEnv ) { } }
List < TypeElement > deferredTypes = deferredTypeNames . stream ( ) . map ( deferred -> processingEnv . getElementUtils ( ) . getTypeElement ( deferred ) ) . collect ( Collectors . toList ( ) ) ; if ( roundEnv . processingOver ( ) ) { // This means that the previous round didn ' t generate any new sources , so we can '...
public class Bits { /** * Measures the number of bytes required to encode a string , taking multibyte characters into account . Measures * strings written by { @ link DataOutput # writeUTF ( String ) } . * @ param str the string * @ return the number of bytes required for encoding str */ public static int sizeUTF...
int len = str != null ? str . length ( ) : 0 , utflen = 2 ; if ( len == 0 ) return utflen ; for ( int i = 0 ; i < len ; i ++ ) { int c = str . charAt ( i ) ; if ( ( c >= 0x0001 ) && ( c <= 0x007F ) ) utflen ++ ; else if ( c > 0x07FF ) utflen += 3 ; else utflen += 2 ; } return utflen ;
public class BootstrapTools { /** * Starts an Actor System at a specific port . * @ param configuration The Flink configuration . * @ param listeningAddress The address to listen at . * @ param listeningPort The port to listen at . * @ param logger the logger to output log information . * @ param actorSystemE...
return startActorSystem ( configuration , AkkaUtils . getFlinkActorSystemName ( ) , listeningAddress , listeningPort , logger , actorSystemExecutorConfiguration ) ;
public class AbstractJaxb { /** * set data - * attribute * < pre > * Div div = new Div ( ) ; * div . setData ( & quot ; foo & quot ; , & quot ; bar & quot ; ) ; * / / you get & lt ; div data - foo = & quot ; bar & quot ; & gt ; & lt ; / div & gt ; * < / pre > * @ param key * data - " key " */ public void ...
QName qn = new QName ( "data-" + key ) ; this . getOtherAttributes ( ) . put ( qn , value ) ;
public class RegionDiskClient { /** * Creates a snapshot of this regional disk . * < p > Sample code : * < pre > < code > * try ( RegionDiskClient regionDiskClient = RegionDiskClient . create ( ) ) { * ProjectRegionDiskName disk = ProjectRegionDiskName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ DISK ] " ) ; ...
CreateSnapshotRegionDiskHttpRequest request = CreateSnapshotRegionDiskHttpRequest . newBuilder ( ) . setDisk ( disk ) . setSnapshotResource ( snapshotResource ) . build ( ) ; return createSnapshotRegionDisk ( request ) ;
public class AbstractBatchTypeResolver { /** * / * @ NonNull */ @ Override public final IResolvedTypes resolveTypes ( final /* @ Nullable */ EObject object , CancelIndicator monitor ) { } }
if ( object == null || object . eIsProxy ( ) ) { return IResolvedTypes . NULL ; } Resource resource = object . eResource ( ) ; validateResourceState ( resource ) ; if ( resource instanceof JvmMemberInitializableResource ) { ( ( JvmMemberInitializableResource ) resource ) . ensureJvmMembersInitialized ( ) ; } return doR...
public class ClassHelper { /** * Creates an array of ClassNodes using an array of classes . * For each of the given classes a new ClassNode will be * created * @ param classes an array of classes used to create the ClassNodes * @ return an array of ClassNodes * @ see # make ( Class ) */ public static ClassNod...
ClassNode [ ] cns = new ClassNode [ classes . length ] ; for ( int i = 0 ; i < cns . length ; i ++ ) { cns [ i ] = make ( classes [ i ] ) ; } return cns ;
public class arp { /** * Use this API to fetch filtered set of arp resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static arp [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
arp obj = new arp ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; arp [ ] response = ( arp [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class JCuda { /** * < pre > * _ _ host _ _ cudaError _ t cudaMallocManaged ( * void * * devPtr , * size _ t size , * unsigned int flags = cudaMemAttachGlobal ) * < / pre > * < div > Allocates memory that will be automatically managed by the Unified * Memory system . < / div > < div > * < h6 > Des...
return checkResult ( cudaMallocManagedNative ( devPtr , size , flags ) ) ;