signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SecStrucCalc { /** * Generate a DSSP file format ouput String of this SS prediction .
* @ return String in DSSP output file format */
public String printDSSP ( ) { } } | StringBuffer buf = new StringBuffer ( ) ; String nl = System . getProperty ( "line.separator" ) ; // Header Line
buf . append ( "==== Secondary Structure Definition by BioJava" + " DSSP implementation, Version October 2015 ====" + nl ) ; // First line with column definition
buf . append ( " # RESIDUE AA STRUCTURE BP1 BP2 ACC " + "N-H-->O O-->H-N N-H-->O O-->H-N " + "TCO KAPPA ALPHA PHI PSI " + "X-CA Y-CA Z-CA " ) ; for ( int i = 0 ; i < groups . length ; i ++ ) { buf . append ( nl ) ; SecStrucState ss = getSecStrucState ( i ) ; buf . append ( ss . printDSSPline ( i ) ) ; } return buf . toString ( ) ; |
public class LinkerBinderManager { /** * Compute and apply all the modifications bring by the modification of the DeclarationBinderFilter .
* Find all the DeclarationBinder that are now matching the filter and all that are no more matching the filter .
* < ul >
* < li > Remove all the links of the ones which are no more matching the DeclarationBinderFilter . < / li >
* < li > Create the links of the ones which are now matching the DeclarationBinderFilter . < / li >
* < / ul >
* @ param binderServiceFilter */
public void applyFilterChanges ( Filter binderServiceFilter ) { } } | this . binderServiceFilter = binderServiceFilter ; Set < ServiceReference < S > > added = new HashSet < ServiceReference < S > > ( ) ; Set < ServiceReference < S > > removed = new HashSet < ServiceReference < S > > ( ) ; for ( Map . Entry < ServiceReference < S > , BinderDescriptor > e : declarationBinders . entrySet ( ) ) { boolean matchFilter = this . binderServiceFilter . matches ( e . getValue ( ) . properties ) ; if ( matchFilter != e . getValue ( ) . match && matchFilter ) { added . add ( e . getKey ( ) ) ; } else if ( matchFilter != e . getValue ( ) . match && ! matchFilter ) { removed . add ( e . getKey ( ) ) ; } e . getValue ( ) . match = matchFilter ; } for ( ServiceReference < S > binderReference : removed ) { removeLinks ( binderReference ) ; } for ( ServiceReference < S > binderReference : added ) { createLinks ( binderReference ) ; } |
public class JoinObservable { /** * Joins together the results from several patterns via their plans .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / and _ then _ when . png " alt = " " >
* @ param plans
* a series of plans created by use of the { @ link # then } Observer on patterns
* @ return an Observable that emits the results from matching several patterns
* @ throws NullPointerException
* if { @ code plans } is null
* @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Combining - Observables # wiki - and - then - and - when " > RxJava Wiki : when ( ) < / a >
* @ see < a href = " http : / / msdn . microsoft . com / en - us / library / hh229558 . aspx " > MSDN : Observable . When < / a > */
public final static < R > JoinObservable < R > when ( Iterable < ? extends Plan0 < R > > plans ) { } } | if ( plans == null ) { throw new NullPointerException ( "plans" ) ; } return from ( Observable . create ( OperatorJoinPatterns . when ( plans ) ) ) ; |
public class PathItemValidator { /** * Validate the path and extract path parameters */
private Set < String > validatePathAndRetrievePathParams ( ValidationHelper helper , Context context , String pathStr ) { } } | String pathToCheck = pathStr ; Set < String > pathParameters = new HashSet < String > ( ) ; while ( pathToCheck . contains ( "{" ) ) { if ( ! pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } int firstIndex = pathToCheck . indexOf ( "{" ) ; int lastIndex = pathToCheck . indexOf ( "}" ) ; if ( firstIndex > lastIndex ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } String parameter = pathToCheck . substring ( firstIndex + 1 , lastIndex ) ; if ( parameter . isEmpty ( ) || parameter . contains ( "{" ) || parameter . contains ( "/" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } pathParameters . add ( parameter ) ; pathToCheck = pathToCheck . substring ( lastIndex + 1 ) ; } if ( pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "pathItemInvalidFormat" , pathStr ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( ) , message ) ) ; return pathParameters ; } return pathParameters ; |
public class AAIndexFileParser { /** * parse an inputStream that points to an AAINDEX database file
* @ param inputStream
* @ throws IOException */
public void parse ( InputStream inputStream ) throws IOException { } } | currentMatrix = null ; currentRows = "" ; currentCols = "" ; max = Short . MIN_VALUE ; min = Short . MAX_VALUE ; inMatrix = false ; BufferedReader buf = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; String line = null ; line = buf . readLine ( ) ; while ( line != null ) { if ( line . startsWith ( "//" ) ) { finalizeMatrix ( ) ; inMatrix = false ; } else if ( line . startsWith ( "H " ) ) { // a new matric !
newMatrix ( line ) ; } else if ( line . startsWith ( "D " ) ) { currentMatrix . setDescription ( line . substring ( 2 ) ) ; } else if ( line . startsWith ( "M " ) ) { initMatrix ( line ) ; inMatrix = true ; } else if ( line . startsWith ( " " ) ) { if ( inMatrix ) processScores ( line ) ; } line = buf . readLine ( ) ; } |
public class PersistentExecutorImpl { /** * { @ inheritDoc } */
@ Override public Map < String , String > findProperties ( String pattern , Character escape ) throws Exception { } } | if ( pattern == null ) throw new NullPointerException ( "pattern" ) ; Map < String , String > map = null ; TransactionController tranController = new TransactionController ( ) ; try { tranController . preInvoke ( ) ; map = taskStore . getProperties ( Utils . normalizeString ( pattern ) , escape ) ; } catch ( Throwable x ) { tranController . setFailure ( x ) ; } finally { Exception x = tranController . postInvoke ( Exception . class ) ; if ( x != null ) throw x ; } return map ; |
public class AbstractMixinInitializer { /** * / * ( non - Javadoc )
* @ see io . platypus . MixinConfigurer # configure ( io . platypus . internal . ProxyInvocationHandler ) */
@ Override public final void initialize ( MixinImplementor mixinImplementor ) { } } | checkState ( this . mixinImplementor == null , "Re-entry is not allowed." ) ; this . mixinImplementor = checkNotNull ( mixinImplementor , "mixinImplementor" ) ; try { initialize ( ) ; } finally { this . mixinImplementor = null ; } |
public class ConversionWrapper { /** * Binds products . */
@ Override public void initDownstream ( ) { } } | if ( direction == RIGHT_TO_LEFT ) { for ( PhysicalEntity pe : conv . getLeft ( ) ) { addToDownstream ( pe , getGraph ( ) ) ; } } else { for ( PhysicalEntity pe : conv . getRight ( ) ) { addToDownstream ( pe , getGraph ( ) ) ; } } |
public class AmazonEC2Client { /** * Creates one or more flow logs to capture information about IP traffic for a specific network interface , subnet ,
* or VPC .
* Flow log data for a monitored network interface is recorded as flow log records , which are log events consisting
* of fields that describe the traffic flow . For more information , see < a
* href = " https : / / docs . aws . amazon . com / AmazonVPC / latest / UserGuide / flow - logs . html # flow - log - records " > Flow Log
* Records < / a > in the < i > Amazon Virtual Private Cloud User Guide < / i > .
* When publishing to CloudWatch Logs , flow log records are published to a log group , and each network interface has
* a unique log stream in the log group . When publishing to Amazon S3 , flow log records for all of the monitored
* network interfaces are published to a single log file object that is stored in the specified bucket .
* For more information , see < a href = " https : / / docs . aws . amazon . com / AmazonVPC / latest / UserGuide / flow - logs . html " > VPC
* Flow Logs < / a > in the < i > Amazon Virtual Private Cloud User Guide < / i > .
* @ param createFlowLogsRequest
* @ return Result of the CreateFlowLogs operation returned by the service .
* @ sample AmazonEC2 . CreateFlowLogs
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / CreateFlowLogs " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public CreateFlowLogsResult createFlowLogs ( CreateFlowLogsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeCreateFlowLogs ( request ) ; |
public class NoCacheFilter { /** * Add no - cache headers if Query String matches reqExoFilters */
@ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } } | if ( response instanceof HttpServletResponse ) { HttpServletResponse httpResponse = ( HttpServletResponse ) response ; String queryString = ( ( HttpServletRequest ) request ) . getQueryString ( ) ; if ( queryString == null ) { queryString = "" ; } if ( regExpFilters == null || regExpFilters . isEmpty ( ) ) { setHeaders ( httpResponse ) ; } else { if ( Pattern . matches ( regExpFilters , queryString ) ) { setHeaders ( httpResponse ) ; } } } chain . doFilter ( request , response ) ; |
public class JAXBContextCache { /** * Special overload with package and { @ link ClassLoader } . In this case the
* resulting value is NOT cached !
* @ param aPackage
* Package to load . May not be < code > null < / code > .
* @ param aClassLoader
* Class loader to use . May be < code > null < / code > in which case the
* default class loader is used .
* @ return < code > null < / code > if package is < code > null < / code > . */
@ Nullable public JAXBContext getFromCache ( @ Nonnull final Package aPackage , @ Nullable final ClassLoader aClassLoader ) { } } | return getFromCache ( new JAXBContextCacheKey ( aPackage , aClassLoader ) ) ; |
public class AddOn { /** * Tells whether or not the given file name matches the name of a ZAP add - on .
* The file name must have as file extension { @ link # FILE _ EXTENSION } .
* @ param fileName the name of the file to check
* @ return { @ code true } if the given file name is the name of an add - on , { @ code false } otherwise .
* @ since 2.6.0 */
public static boolean isAddOnFileName ( String fileName ) { } } | if ( fileName == null ) { return false ; } return fileName . toLowerCase ( Locale . ROOT ) . endsWith ( FILE_EXTENSION ) ; |
public class XBaseGridScreen { /** * Display the end grid in input format .
* @ return true if default params were found for this form .
* @ param out The http output stream .
* @ exception DBException File exception . */
public void printEndRecordGridData ( PrintWriter out , int iPrintOptions ) { } } | out . println ( Utility . endTag ( XMLTags . FILE ) ) ; out . println ( Utility . endTag ( XMLTags . DETAIL ) ) ; |
public class UTF8Reader { /** * Throws an exception for expected byte . */
private void expectedByte ( int position , int count ) throws UTFDataFormatException { } } | String msg = JspCoreException . getMsg ( "jsp.error.xml.expectedByte" , new Object [ ] { Integer . toString ( position ) , Integer . toString ( count ) } ) ; throw new UTFDataFormatException ( msg ) ; |
public class NamespacesInner { /** * Creates / Updates a service namespace . Once created , this namespace ' s resource manifest is immutable . This operation is idempotent .
* @ param resourceGroupName The name of the resource group .
* @ param namespaceName The namespace name .
* @ param parameters Parameters supplied to create a Namespace Resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the NamespaceResourceInner object if successful . */
public NamespaceResourceInner createOrUpdate ( String resourceGroupName , String namespaceName , NamespaceCreateOrUpdateParameters parameters ) { } } | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , namespaceName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class JSONConverter { /** * Encode an integer value as JSON . An array is used to wrap the value :
* [ Integer ]
* @ param out The stream to write JSON to
* @ param value The integer value to encode
* @ throws IOException If an I / O error occurs
* @ see # readInt ( InputStream ) */
public void writeInt ( OutputStream out , int value ) throws IOException { } } | writeStartArray ( out ) ; writeIntInternal ( out , value ) ; writeEndArray ( out ) ; |
public class GlobalizationPreferences { /** * Get a copy of the language / locale priority list
* @ return a copy of the language / locale priority list .
* @ hide draft / provisional / internal are hidden on Android */
public List < ULocale > getLocales ( ) { } } | List < ULocale > result ; if ( locales == null ) { result = guessLocales ( ) ; } else { result = new ArrayList < ULocale > ( ) ; result . addAll ( locales ) ; } return result ; |
public class JavaSourceUtils { /** * 合并注解声明 */
public static AnnotationDeclaration mergeType ( AnnotationDeclaration one , AnnotationDeclaration two ) { } } | if ( isAllNull ( one , two ) ) return null ; AnnotationDeclaration annotationDeclaration = null ; if ( isAllNotNull ( one , two ) ) { annotationDeclaration = new AnnotationDeclaration ( ) ; annotationDeclaration . setModifiers ( mergeModifiers ( one . getModifiers ( ) , two . getModifiers ( ) ) ) ; annotationDeclaration . setJavaDoc ( ( JavadocComment ) mergeSelective ( one . getJavaDoc ( ) , two . getJavaDoc ( ) ) ) ; annotationDeclaration . setComment ( mergeSelective ( one . getComment ( ) , two . getComment ( ) ) ) ; annotationDeclaration . setAnnotations ( mergeListNoDuplicate ( one . getAnnotations ( ) , two . getAnnotations ( ) ) ) ; // merge content body
annotationDeclaration . setMembers ( mergeBodies ( one . getMembers ( ) , two . getMembers ( ) ) ) ; LOG . info ( "merge AnnotationDeclaration --> {}" , annotationDeclaration . getName ( ) ) ; } else { annotationDeclaration = findFirstNotNull ( one , two ) ; LOG . info ( "add AnnotationDeclaration --> {}" , annotationDeclaration . getName ( ) ) ; } return annotationDeclaration ; |
public class TSAGeoMag { /** * Returns the vertical magnetic field intensity from the
* Department of Defense geomagnetic model and data
* in nano Tesla .
* @ paramdlat Latitude in decimal degrees .
* @ param dlongLongitude in decimal degrees .
* @ paramyearDate of the calculation in decimal years .
* @ paramaltitudeAltitude of the calculation in kilometers .
* @ return The vertical magnetic field strength in nano Tesla . */
public double getVerticalIntensity ( double dlat , double dlong , double year , double altitude ) { } } | calcGeoMag ( dlat , dlong , year , altitude ) ; return bz ; |
public class hqlLexer { /** * $ ANTLR start " NE " */
public final void mNE ( ) throws RecognitionException { } } | try { int _type = NE ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 738:3 : ( ' ! = ' | ' ^ = ' )
int alt1 = 2 ; int LA1_0 = input . LA ( 1 ) ; if ( ( LA1_0 == '!' ) ) { alt1 = 1 ; } else if ( ( LA1_0 == '^' ) ) { alt1 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 1 , 0 , input ) ; throw nvae ; } switch ( alt1 ) { case 1 : // hql . g : 738:5 : ' ! = '
{ match ( "!=" ) ; if ( state . failed ) return ; } break ; case 2 : // hql . g : 738:12 : ' ^ = '
{ match ( "^=" ) ; if ( state . failed ) return ; } break ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public FontDescriptorSpecificationFtUsFlags createFontDescriptorSpecificationFtUsFlagsFromString ( EDataType eDataType , String initialValue ) { } } | FontDescriptorSpecificationFtUsFlags result = FontDescriptorSpecificationFtUsFlags . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class JavaDocument { /** * This updates the colored text and prepares for undo event */
@ Override protected void fireInsertUpdate ( DocumentEvent evt ) { } } | super . fireInsertUpdate ( evt ) ; try { processChangedLines ( evt . getOffset ( ) , evt . getLength ( ) ) ; } catch ( Exception ex ) { System . out . println ( "" + ex ) ; } |
public class LibsvmParser { /** * Parse a libsvm sparse dataset from an input stream .
* @ param name the name of dataset .
* @ param stream the input stream of data .
* @ throws java . io . IOException */
public SparseDataset parse ( String name , InputStream stream ) throws IOException , ParseException { } } | BufferedReader reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; try { String line = reader . readLine ( ) ; if ( line == null ) { throw new IOException ( "Empty data source." ) ; } String [ ] tokens = line . trim ( ) . split ( "\\s+" ) ; boolean classification = true ; Attribute response = null ; try { Integer . valueOf ( tokens [ 0 ] ) ; response = new NominalAttribute ( "class" ) ; } catch ( NumberFormatException e ) { try { Double . valueOf ( tokens [ 0 ] ) ; response = new NominalAttribute ( "response" ) ; classification = false ; } catch ( NumberFormatException ex ) { logger . error ( "Failed to parse {}" , tokens [ 0 ] , ex ) ; throw new NumberFormatException ( "Unrecognized response variable value: " + tokens [ 0 ] ) ; } } SparseDataset sparse = new SparseDataset ( name , response ) ; for ( int i = 0 ; line != null ; i ++ ) { tokens = line . trim ( ) . split ( "\\s+" ) ; if ( classification ) { int y = Integer . parseInt ( tokens [ 0 ] ) ; sparse . set ( i , y ) ; } else { double y = Double . parseDouble ( tokens [ 0 ] ) ; sparse . set ( i , y ) ; } for ( int k = 1 ; k < tokens . length ; k ++ ) { String [ ] pair = tokens [ k ] . split ( ":" ) ; if ( pair . length != 2 ) { throw new NumberFormatException ( "Invalid data: " + tokens [ k ] ) ; } int j = Integer . parseInt ( pair [ 0 ] ) - 1 ; double x = Double . parseDouble ( pair [ 1 ] ) ; sparse . set ( i , j , x ) ; } line = reader . readLine ( ) ; } if ( classification ) { int n = sparse . size ( ) ; int [ ] y = sparse . toArray ( new int [ n ] ) ; int [ ] label = Math . unique ( y ) ; Arrays . sort ( label ) ; for ( int c : label ) { response . valueOf ( String . valueOf ( c ) ) ; } for ( int i = 0 ; i < n ; i ++ ) { sparse . get ( i ) . y = Arrays . binarySearch ( label , y [ i ] ) ; } } return sparse ; } finally { reader . close ( ) ; } |
public class FloatWindowApi { /** * HuaweiApiClient 连接结果回调
* @ param rst 结果码
* @ param client HuaweiApiClient 实例 */
@ Override public void onConnect ( int rst , HuaweiApiClient client ) { } } | if ( isCurFloatShow && client != null ) { showFinal ( true , null , client ) ; } |
public class BinTrie { /** * 插入一个词
* @ param key
* @ param value */
public void put ( String key , V value ) { } } | if ( key . length ( ) == 0 ) return ; // 安全起见
BaseNode branch = this ; char [ ] chars = key . toCharArray ( ) ; for ( int i = 0 ; i < chars . length - 1 ; ++ i ) { // 除了最后一个字外 , 都是继续
branch . addChild ( new Node ( chars [ i ] , Status . NOT_WORD_1 , null ) ) ; branch = branch . getChild ( chars [ i ] ) ; } // 最后一个字加入时属性为end
if ( branch . addChild ( new Node < V > ( chars [ chars . length - 1 ] , Status . WORD_END_3 , value ) ) ) { ++ size ; // 维护size
} |
public class DatamodelConverter { /** * Copies a { @ link PropertyDocument } .
* @ param object
* object to copy
* @ return copied object */
public PropertyDocument copy ( PropertyDocument object ) { } } | return dataObjectFactory . getPropertyDocument ( copy ( object . getEntityId ( ) ) , copyMonoLingualTextValues ( object . getLabels ( ) . values ( ) ) , copyMonoLingualTextValues ( object . getDescriptions ( ) . values ( ) ) , copyAliasMap ( object . getAliases ( ) ) , copyStatementGroups ( object . getStatementGroups ( ) ) , copy ( object . getDatatype ( ) ) , object . getRevisionId ( ) ) ; |
public class ReflectionUtils { /** * The same method as
* { @ link ReflectionUtils # getInterfaceImplementationsInPackage ( Class , String , boolean ) } ,
* but with the possibility to search in multiple packages . Since the result
* is returned as a { @ link LinkedHashSet } , there won ' t be any duplicates .
* @ param interfaze Interface class .
* @ param packageNames Set of package names .
* @ param recursive < code > true < / code > if subpackages should be considered ,
* too .
* @ return { @ link LinkedHashSet } of implementations of a given interface .
* @ throws ReflectionException */
public static LinkedHashSet < Class < ? > > getInterfaceImplementationsInPackages ( Class < ? > interfaze , Set < String > packageNames , boolean recursive ) throws ReflectionException { } } | Validate . notNull ( interfaze ) ; Validate . notNull ( packageNames ) ; if ( ! interfaze . isInterface ( ) ) { throw new ParameterException ( "Parameter is not an interface" ) ; } LinkedHashSet < Class < ? > > classes = new LinkedHashSet < > ( ) ; for ( String packageName : packageNames ) { classes . addAll ( getInterfaceImplementationsInPackage ( interfaze , packageName , recursive ) ) ; } return classes ; |
public class AMBImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . AMB__DSPLCMNT : setDSPLCMNT ( DSPLCMNT_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class TwitterImpl { /** * / * Suggested Users Resources */
@ Override public ResponseList < User > getUserSuggestions ( String categorySlug ) throws TwitterException { } } | HttpResponse res ; try { res = get ( conf . getRestBaseURL ( ) + "users/suggestions/" + URLEncoder . encode ( categorySlug , "UTF-8" ) + ".json" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } return factory . createUserListFromJSONArray_Users ( res ) ; |
public class BackupsInner { /** * Triggers backup for specified backed up item . This is an asynchronous operation . To know the status of the operation , call GetProtectedItemOperationResult API .
* @ param vaultName The name of the recovery services vault .
* @ param resourceGroupName The name of the resource group where the recovery services vault is present .
* @ param fabricName Fabric name associated with the backup item .
* @ param containerName Container name associated with the backup item .
* @ param protectedItemName Backup item for which backup needs to be triggered .
* @ param parameters resource backup request
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > triggerAsync ( String vaultName , String resourceGroupName , String fabricName , String containerName , String protectedItemName , BackupRequestResource parameters , final ServiceCallback < Void > serviceCallback ) { } } | return ServiceFuture . fromResponse ( triggerWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName , protectedItemName , parameters ) , serviceCallback ) ; |
public class AbstractSamlProfileHandlerController { /** * Decode soap 11 context .
* @ param request the request
* @ return the soap 11 context */
protected MessageContext decodeSoapRequest ( final HttpServletRequest request ) { } } | try { val decoder = new HTTPSOAP11Decoder ( ) ; decoder . setParserPool ( samlProfileHandlerConfigurationContext . getOpenSamlConfigBean ( ) . getParserPool ( ) ) ; decoder . setHttpServletRequest ( request ) ; val binding = new BindingDescriptor ( ) ; binding . setId ( getClass ( ) . getName ( ) ) ; binding . setShortName ( getClass ( ) . getName ( ) ) ; binding . setSignatureCapable ( true ) ; binding . setSynchronous ( true ) ; decoder . setBindingDescriptor ( binding ) ; decoder . initialize ( ) ; decoder . decode ( ) ; return decoder . getMessageContext ( ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } return null ; |
public class MetaClassImpl { /** * Create a CallSite */
public CallSite createConstructorSite ( CallSite site , Object [ ] args ) { } } | if ( ! ( this instanceof AdaptingMetaClass ) ) { Class [ ] params = MetaClassHelper . convertToTypeArray ( args ) ; CachedConstructor constructor = ( CachedConstructor ) chooseMethod ( "<init>" , constructors , params ) ; if ( constructor != null ) { return ConstructorSite . createConstructorSite ( site , this , constructor , params , args ) ; } else { if ( args . length == 1 && args [ 0 ] instanceof Map ) { constructor = ( CachedConstructor ) chooseMethod ( "<init>" , constructors , MetaClassHelper . EMPTY_TYPE_ARRAY ) ; if ( constructor != null ) { return new ConstructorSite . NoParamSite ( site , this , constructor , params ) ; } } else if ( args . length == 2 && theClass . getEnclosingClass ( ) != null && args [ 1 ] instanceof Map ) { Class enclosingClass = theClass . getEnclosingClass ( ) ; String enclosingInstanceParamType = args [ 0 ] != null ? args [ 0 ] . getClass ( ) . getName ( ) : "" ; if ( enclosingClass . getName ( ) . equals ( enclosingInstanceParamType ) ) { constructor = ( CachedConstructor ) chooseMethod ( "<init>" , constructors , new Class [ ] { enclosingClass } ) ; if ( constructor != null ) { return new ConstructorSite . NoParamSiteInnerClass ( site , this , constructor , params ) ; } } } } } return new MetaClassConstructorSite ( site , this ) ; |
public class JSONSAXHandler { /** * Internal method to start JSON generation . */
private void startJSON ( ) throws SAXException { } } | if ( logger . isLoggable ( Level . FINER ) ) logger . entering ( className , "startJSON()" ) ; this . head = new JSONObject ( "" , null ) ; this . current = head ; if ( logger . isLoggable ( Level . FINER ) ) logger . exiting ( className , "startJSON()" ) ; |
public class CmsGitCheckin { /** * Read all configuration files .
* @ return the list with all available configurations */
private List < CmsGitConfiguration > readConfigFiles ( ) { } } | List < CmsGitConfiguration > configurations = new LinkedList < CmsGitConfiguration > ( ) ; // Default configuration file for backwards compatibility
addConfigurationIfValid ( configurations , new File ( DEFAULT_CONFIG_FILE ) ) ; // All files in the config folder
File configFolder = new File ( DEFAULT_CONFIG_FOLDER ) ; if ( configFolder . isDirectory ( ) ) { for ( File configFile : configFolder . listFiles ( ) ) { addConfigurationIfValid ( configurations , configFile ) ; } } return configurations ; |
public class FedoraClient { /** * Get an HTTP resource with the response as an InputStream , given a
* resource locator that either begins with ' info : fedora / ' , ' http : / / ' , or
* ' / ' . Note that if the HTTP response has no body , the InputStream will be
* empty . The success of a request can be checked with getResponseCode ( ) .
* Usually you ' ll want to see a 200 . See
* http : / / www . w3 . org / Protocols / rfc2616 / rfc2616 - sec10 . html for other codes .
* @ param locator
* A URL , relative Fedora URL , or Fedora URI that we want to do an
* HTTP GET upon
* @ param failIfNotOK
* boolean value indicating if an exception should be thrown if we do
* NOT receive an HTTP 200 response ( OK )
* @ param followRedirects
* boolean value indicating whether HTTP redirects should be handled
* in this method , or be passed along so that they can be handled
* later .
* @ return HttpInputStream the HTTP response
* @ throws IOException */
public HttpInputStream get ( String locator , boolean failIfNotOK , boolean followRedirects ) throws IOException { } } | // Convert the locator to a proper Fedora URL and the do a get .
String url = getLocatorAsURL ( locator ) ; return get ( new URL ( url ) , failIfNotOK , followRedirects ) ; |
public class Component { /** * Returns { @ code true } if the current authentication can include this component in a bundle .
* @ return { @ code true } if the current authentication can include this component in a bundle . */
public boolean isEnabled ( ) { } } | ACL acl = Jenkins . getInstance ( ) . getAuthorizationStrategy ( ) . getRootACL ( ) ; if ( acl != null ) { Authentication authentication = Jenkins . getAuthentication ( ) ; assert authentication != null ; for ( Permission p : _getRequiredPermissions ( ) ) { if ( ! acl . hasPermission ( authentication , p ) ) { return false ; } } } return true ; |
public class Cache { /** * Remove the object associated with the specified key from the cache . < p >
* In order to remove an object from the cache , the object must either
* not be pinned or must be pinned exactly once , presumably by the
* caller . Note , however , that there is no way to verify that the caller
* actually owns the pinned reference . < p >
* This relaxation is needed in order to allow for situations where
* an object needs to be removed from the cache but remain in use . < p >
* Also note that if an object is removed while still pinned , the final
* call to unpin is unnecessary , and is also illegal . < p >
* @ param key the key for the object to remove from the cache .
* @ param dropRef if true , drop a reference on the object before
* removing from the cache .
* @ return the object which was removed from the cache .
* @ exception IllegalOperationException if the object associated with
* the key is currently pinned more than once . */
@ Override public Object remove ( Object key , boolean dropRef ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "remove" , new Object [ ] { key , new Boolean ( dropRef ) } ) ; Bucket bucket = getBucketForKey ( key ) ; Object object = null ; if ( bucket != null ) // d739870
{ synchronized ( bucket ) { Element element = bucket . removeByKey ( key , dropRef ) ; object = element != null ? element . object : null ; } if ( object != null ) { synchronized ( this ) { // ACK ! This is going to be a choke point
numObjects -- ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "remove" , object ) ; return object ; |
public class FilteredIndexIterator { /** * / * ( non - Javadoc )
* @ see java . util . Iterator # hasNext ( ) */
public synchronized boolean hasNext ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "hasNext" ) ; if ( next == null ) { synchronized ( index ) { next = ( Index . Entry ) cursor . next ( ) ; if ( filter != null ) { while ( next != null && ! filter . matches ( next . type ) ) { next = ( Index . Entry ) cursor . next ( ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hasNext" , new Boolean ( next != null ) ) ; return ( next != null ) ; |
public class PluginRepository { /** * Returns the implementation of the plugin identified by the given name .
* @ param name
* The plugin name
* @ return the plugin identified by the given name * @ throws UnknownPluginException
* if no plugin with the given name exists . * @ see it . jnrpe . plugins . IPluginRepository # getPlugin ( String ) */
public final IPluginInterface getPlugin ( final String name ) throws UnknownPluginException { } } | PluginDefinition pluginDef = pluginsDefinitionsMap . get ( name ) ; if ( pluginDef == null ) { throw new UnknownPluginException ( name ) ; } try { IPluginInterface pluginInterface = pluginDef . getPluginInterface ( ) ; if ( pluginInterface == null ) { pluginInterface = pluginDef . getPluginClass ( ) . newInstance ( ) ; } return new PluginProxy ( pluginInterface , pluginDef ) ; } catch ( Exception e ) { // FIXME : handle this exception
e . printStackTrace ( ) ; } return null ; |
public class AddOn { /** * Tells whether or not the given add - on version matches the one required by the dependency .
* This methods is required to also check the { @ code semVer } of the add - on , once removed it can match the version directly .
* @ param addOn the add - on to check
* @ param dependency the dependency
* @ return { @ code true } if the version matches , { @ code false } otherwise . */
private static boolean versionMatches ( AddOn addOn , AddOnDep dependency ) { } } | if ( addOn . version . matches ( dependency . getVersion ( ) ) ) { return true ; } if ( addOn . semVer != null && addOn . semVer . matches ( dependency . getVersion ( ) ) ) { return true ; } return false ; |
public class AbstractScheduledEventExecutor { /** * Cancel all scheduled tasks .
* This method MUST be called only when { @ link # inEventLoop ( ) } is { @ code true } . */
protected void cancelScheduledTasks ( ) { } } | assert inEventLoop ( ) ; PriorityQueue < ScheduledFutureTask < ? > > scheduledTaskQueue = this . scheduledTaskQueue ; if ( isNullOrEmpty ( scheduledTaskQueue ) ) { return ; } final ScheduledFutureTask < ? > [ ] scheduledTasks = scheduledTaskQueue . toArray ( new ScheduledFutureTask < ? > [ 0 ] ) ; for ( ScheduledFutureTask < ? > task : scheduledTasks ) { task . cancelWithoutRemove ( false ) ; } scheduledTaskQueue . clearIgnoringIndexes ( ) ; |
public class ASN1 { /** * Encode an EC Private key
* @ param oid - curve to use
* @ param keyBytes - bytes of the key
* @ param spki - optional SPKI
* @ return encoded private key
* @ throws CoseException - from lower level */
public static byte [ ] EncodeEcPrivateKey ( byte [ ] oid , byte [ ] keyBytes , byte [ ] spki ) throws CoseException { } } | // ECPrivateKey : : = SEQUENCE {
// version INTEGER { 1}
// privateKey OCTET STRING
// parameters [ 0 ] OBJECT IDENTIFIER = named curve
// public key [ 1 ] BIT STRING OPTIONAL
ArrayList < byte [ ] > xxx = new ArrayList < byte [ ] > ( ) ; xxx . add ( new byte [ ] { 2 , 1 , 1 } ) ; xxx . add ( OctetStringTag ) ; xxx . add ( ComputeLength ( keyBytes . length ) ) ; xxx . add ( keyBytes ) ; xxx . add ( new byte [ ] { ( byte ) 0xa0 } ) ; xxx . add ( ComputeLength ( oid . length ) ) ; xxx . add ( oid ) ; if ( spki != null ) { xxx . add ( new byte [ ] { ( byte ) 0xa1 } ) ; xxx . add ( ComputeLength ( spki . length + 1 ) ) ; xxx . add ( new byte [ ] { 0 } ) ; xxx . add ( spki ) ; } byte [ ] ecPrivateKey = Sequence ( xxx ) ; return ecPrivateKey ; |
public class FilenameMaskFilter { /** * This method implements the { @ code java . io . FilenameFilter } interface .
* @ param pDir the directory in which the file was found .
* @ param pName the name of the file .
* @ return { @ code true } if the file { @ code pName } should be included in the file
* list ; { @ code false } otherwise . */
public boolean accept ( File pDir , String pName ) { } } | WildcardStringParser parser ; // Check each filename string mask whether the file is to be accepted
if ( inclusion ) { // Inclusion
for ( String mask : filenameMasksForInclusion ) { parser = new WildcardStringParser ( mask ) ; if ( parser . parseString ( pName ) ) { // The filename was accepted by the filename masks provided
// - include it in filename list
return true ; } } // The filename not was accepted by any of the filename masks
// provided - NOT to be included in the filename list
return false ; } else { // Exclusion
for ( String mask : filenameMasksForExclusion ) { parser = new WildcardStringParser ( mask ) ; if ( parser . parseString ( pName ) ) { // The filename was accepted by the filename masks provided
// - NOT to be included in the filename list
return false ; } } // The filename was not accepted by any of the filename masks
// provided - include it in filename list
return true ; } |
public class CmsProperty { /** * Creates a clone of this property that already is of type < code > { @ link CmsProperty } < / code > . < p >
* The cloned property will not be frozen . < p >
* @ return a clone of this property that already is of type < code > { @ link CmsProperty } < / code > */
public CmsProperty cloneAsProperty ( ) { } } | if ( this == NULL_PROPERTY ) { // null property must never be cloned
return NULL_PROPERTY ; } CmsProperty clone = new CmsProperty ( ) ; clone . m_name = m_name ; clone . m_structureValue = m_structureValue ; clone . m_structureValueList = m_structureValueList ; clone . m_resourceValue = m_resourceValue ; clone . m_resourceValueList = m_resourceValueList ; clone . m_autoCreatePropertyDefinition = m_autoCreatePropertyDefinition ; clone . m_origin = m_origin ; // the value for m _ frozen does not need to be set as it is false by default
return clone ; |
public class GameOfLife { /** * Useful for debug , prints a matrix */
public static void printMatrix ( byte [ ] [ ] matrix , int maxX , int maxY , PrintStream stream ) { } } | for ( int i = 0 ; i < maxX ; i ++ ) { for ( int j = 0 ; j < maxY ; j ++ ) { stream . print ( matrix [ i ] [ j ] + " " ) ; } stream . print ( "\n" ) ; } stream . println ( ) ; |
public class FreeMarkerTag { /** * Gets an object from context - by name .
* @ param name name of object
* @ return object or null if not found . */
protected TemplateModel get ( Object name ) { } } | try { return FreeMarkerTL . getEnvironment ( ) . getVariable ( name . toString ( ) ) ; } catch ( Exception e ) { throw new ViewException ( e ) ; } |
public class Utils { /** * Obtains the data to store in file for a double number
* @ param doubleNum number to convert
* @ param charset charset to use ( ignored )
* @ param fieldLength field size
* @ param sizeDecimalPart sizeDecimalPart
* @ return byte [ ] to store in the file
* @ deprecated Use { @ link DBFUtils # doubleFormating ( Number , Charset , int , int ) } */
@ Deprecated public static byte [ ] doubleFormating ( Double doubleNum , Charset charset , int fieldLength , int sizeDecimalPart ) { } } | return DBFUtils . doubleFormating ( doubleNum , charset , fieldLength , sizeDecimalPart ) ; |
public class CoronaJTFallbackCaller { /** * Reconnects to new address obtained from secondary address via
* InterCoronaTrackerProtocol
* @ throws IOException */
private final void reconnectToNewJobTracker ( int connectNum ) throws IOException { } } | if ( connectNum >= CONNECT_MAX_NUMBER ) { LOG . error ( "reconnectToNewJobTracker has reached its max number." ) ; throw new IOException ( "reconnectToNewJobTracker has reached its max number." ) ; } InetSocketAddress secondaryTracker = getSecondaryTracker ( ) ; JobConf conf = getConf ( ) ; InetSocketAddress oldAddress = getCurrentClientAddress ( ) ; LOG . info ( "Falling back from " + oldAddress + " to secondary tracker at " + secondaryTracker + " with " + connectNum + " try" ) ; if ( secondaryTracker == null ) throw new IOException ( "Secondary address not provided." ) ; shutdown ( ) ; InterCoronaJobTrackerProtocol secondaryClient = RPC . waitForProxy ( InterCoronaJobTrackerProtocol . class , InterCoronaJobTrackerProtocol . versionID , secondaryTracker , conf , SECONDARY_TRACKER_CONNECT_TIMEOUT ) ; // Obtain new address
InetSocketAddressWritable oldAddrWritable = new InetSocketAddressWritable ( oldAddress ) ; InetSocketAddressWritable newAddress = null ; int retryNum = 0 ; do { newAddress = secondaryClient . getNewJobTrackerAddress ( oldAddrWritable ) ; try { waitRetry ( ) ; } catch ( InterruptedException e ) { LOG . error ( "Fallback interrupted, taking next retry." ) ; } ++ retryNum ; } while ( newAddress == null && predRetry ( retryNum ) ) ; if ( newAddress == null || newAddress . getAddress ( ) == null ) throw new IOException ( "Failed to obtain new job tracker address." ) ; RPC . stopProxy ( secondaryClient ) ; try { connect ( newAddress . getAddress ( ) ) ; LOG . info ( "Fallback process successful: " + newAddress . getAddress ( ) ) ; } catch ( IOException e ) { LOG . error ( "Fallback connect to " + newAddress . getAddress ( ) + " failed for " , e ) ; reconnectToNewJobTracker ( ++ connectNum ) ; } |
public class CleanUpScheduler { /** * return current date time by specified hour : minute
* @ param plan format : hh : mm */
public static Date getCurrentDateByPlan ( String plan , String pattern ) { } } | try { FastDateFormat format = FastDateFormat . getInstance ( pattern ) ; Date end = format . parse ( plan ) ; Calendar today = Calendar . getInstance ( ) ; end = DateUtils . setYears ( end , ( today . get ( Calendar . YEAR ) ) ) ; end = DateUtils . setMonths ( end , today . get ( Calendar . MONTH ) ) ; end = DateUtils . setDays ( end , today . get ( Calendar . DAY_OF_MONTH ) ) ; return end ; } catch ( Exception e ) { throw ExceptionUtil . unchecked ( e ) ; } |
public class KeyboardManager { /** * Sets whether the keyboard manager processes keyboard input . */
public void setEnabled ( boolean enabled ) { } } | // report incorrect usage
if ( enabled && _target == null ) { log . warning ( "Attempt to enable uninitialized keyboard manager!" , new Exception ( ) ) ; return ; } // ignore NOOPs
if ( enabled == _enabled ) { return ; } if ( ! enabled ) { if ( Keyboard . isAvailable ( ) ) { // restore the original key auto - repeat settings
Keyboard . setKeyRepeat ( _nativeRepeat ) ; } // clear out all of our key states
releaseAllKeys ( ) ; _keys . clear ( ) ; // cease listening to all of our business
if ( _window != null ) { _window . removeWindowFocusListener ( this ) ; _window = null ; } _target . removeAncestorListener ( this ) ; // note that we no longer have the focus
_focus = false ; } else { // listen to ancestor events so that we can cease our business
// if we lose the focus
_target . addAncestorListener ( this ) ; // if we ' re already showing , listen to window focus events ,
// else we have to wait until the target is added since it
// doesn ' t currently have a window
if ( _target . isShowing ( ) && _window == null ) { _window = SwingUtilities . getWindowAncestor ( _target ) ; if ( _window != null ) { _window . addWindowFocusListener ( this ) ; } } // assume the keyboard focus since we were just enabled
_focus = true ; if ( Keyboard . isAvailable ( ) ) { // note whether key auto - repeating was enabled
_nativeRepeat = Keyboard . isKeyRepeatEnabled ( ) ; // Disable native key auto - repeating so that we can definitively ascertain key
// pressed / released events .
// Or not , if we ' ve discovered we don ' t want to .
Keyboard . setKeyRepeat ( ! _shouldDisableNativeRepeat ) ; } } // save off our new enabled state
_enabled = enabled ; |
public class KuduDBClient { /** * Iterate and populate entity .
* @ param entity
* the entity
* @ param result
* the result
* @ param metaModel
* the meta model
* @ param iterator
* the iterator */
private void iterateAndPopulateEntity ( Object entity , RowResult result , MetamodelImpl metaModel , Iterator < Attribute > iterator ) { } } | while ( iterator . hasNext ( ) ) { Attribute attribute = iterator . next ( ) ; Field field = ( Field ) attribute . getJavaMember ( ) ; // handle for embeddables
if ( attribute . getJavaType ( ) . isAnnotationPresent ( Embeddable . class ) ) { EmbeddableType emb = metaModel . embeddable ( attribute . getJavaType ( ) ) ; Object embeddableObj = KunderaCoreUtils . createNewInstance ( attribute . getJavaType ( ) ) ; populateEmbeddedColumn ( embeddableObj , result , emb , metaModel ) ; PropertyAccessorHelper . set ( entity , field , embeddableObj ) ; } else { if ( KuduDBDataHandler . hasColumn ( result . getSchema ( ) , ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ) ) { PropertyAccessorHelper . set ( entity , field , KuduDBDataHandler . getColumnValue ( result , ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ) ) ; } } } |
public class DeliveryForecast { /** * Sets the lineItemDeliveryForecasts value for this DeliveryForecast .
* @ param lineItemDeliveryForecasts * The delivery forecasts of the forecasted line items . */
public void setLineItemDeliveryForecasts ( com . google . api . ads . admanager . axis . v201902 . LineItemDeliveryForecast [ ] lineItemDeliveryForecasts ) { } } | this . lineItemDeliveryForecasts = lineItemDeliveryForecasts ; |
public class ParameterUtil { /** * Init parameter values map with the static default values for all not - hidden parameters of a report
* @ param report report
* @ param parameterValues map of parameter values
* @ throws QueryException if could not get default parameter values */
public static void initStaticNotHiddenDefaultParameterValues ( Report report , Map < String , Object > parameterValues ) throws QueryException { } } | Map < String , QueryParameter > params = getUsedParametersMap ( report ) ; for ( QueryParameter qp : params . values ( ) ) { if ( ! qp . isHidden ( ) ) { initStaticDefaultParameterValues ( qp , parameterValues ) ; } } |
public class appfwprofile_xmlattachmenturl_binding { /** * Use this API to fetch appfwprofile _ xmlattachmenturl _ binding resources of given name . */
public static appfwprofile_xmlattachmenturl_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | appfwprofile_xmlattachmenturl_binding obj = new appfwprofile_xmlattachmenturl_binding ( ) ; obj . set_name ( name ) ; appfwprofile_xmlattachmenturl_binding response [ ] = ( appfwprofile_xmlattachmenturl_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class MavenJobWithDetails { /** * This method will give you back all builds which exists independent of the
* number . You should be aware that this can be much in some cases if you
* have more than 100 builds which is by default limited by Jenkins
* { @ link # getBuilds ( ) } . This method limits it to particular information
* which can be later used to get supplemental information about a
* particular build { @ link Build # details ( ) } to reduce the amount of data
* which needed to be transfered .
* @ return the list of { @ link Build } . In case of no builds have been
* executed yet return { @ link Collections # emptyList ( ) } .
* @ throws IOException
* In case of failure .
* @ see < a href = " https : / / issues . jenkins - ci . org / browse / JENKINS - 30238 " > Jenkins
* Issue < / a > */
public List < MavenBuild > getAllBuilds ( ) throws IOException { } } | String path = "/" ; try { List < MavenBuild > builds = client . get ( path + "job/" + EncodingUtils . encode ( this . getName ( ) ) + "?tree=allBuilds[number[*],url[*],queueId[*]]" , AllMavenBuilds . class ) . getAllBuilds ( ) ; if ( builds == null ) { return Collections . emptyList ( ) ; } else { return builds . stream ( ) . map ( SET_CLIENT ( this . client ) ) . collect ( toList ( ) ) ; } } catch ( HttpResponseException e ) { // TODO : Thinks about a better handling if the job does not exist ?
if ( e . getStatusCode ( ) == HttpStatus . SC_NOT_FOUND ) { // TODO : Check this if this is necessary or a good idea ?
return null ; } throw e ; } |
public class ConfigurationService { /** * Returns names for custom LDAP user attributes .
* @ return
* Custom LDAP user attributes as configured in guacamole . properties .
* @ throws GuacamoleException
* If guacamole . properties cannot be parsed . */
public List < String > getAttributes ( ) throws GuacamoleException { } } | return environment . getProperty ( LDAPGuacamoleProperties . LDAP_USER_ATTRIBUTES , Collections . < String > emptyList ( ) ) ; |
public class RemoterProcessor { /** * Only one annotation is supported at class level - @ { @ link Remoter } */
private Set < Class < ? extends Annotation > > getSupportedAnnotations ( ) { } } | Set < Class < ? extends Annotation > > annotations = new LinkedHashSet < > ( ) ; annotations . add ( Remoter . class ) ; return annotations ; |
public class CmsScrollPanel { /** * Executed on mouse move while dragging . < p >
* @ param event the event */
protected void setNewHeight ( Event event ) { } } | double newheight = m_oldheight + ( event . getClientY ( ) - m_clientY ) ; if ( m_defaultHeight != - 1 ) { if ( newheight < m_defaultHeight ) { newheight = m_defaultHeight ; } } ResizeEvent . fire ( this , getOffsetWidth ( ) , ( int ) newheight ) ; getElement ( ) . getStyle ( ) . setHeight ( newheight , Unit . PX ) ; |
public class ClientFile { /** * load new instance of the class
* @ param name
* @ param pc
* @ param log
* @ return */
public static Client getInstance ( String name , PageContext pc , Log log ) { } } | Resource res = _loadResource ( pc . getConfig ( ) , SCOPE_CLIENT , name , pc . getCFID ( ) ) ; Struct data = _loadData ( pc , res , log ) ; return new ClientFile ( pc , res , data ) ; |
public class CommandLineApplication { /** * Adds a command - line option . This is only useful before calling
* { @ link # start ( ) start } .
* @ param shortOpt Short , one character option ( e . g . , { @ code - t } )
* @ param longOpt Long , one or two word option ( e . g . , { @ code - - long - option } )
* @ param desc Option description ( e . g . , { @ code does something great } ) */
public final void addOption ( String shortOpt , String longOpt , String desc ) { } } | cliOptions . addOption ( new Option ( shortOpt , longOpt , false , desc ) ) ; |
public class MMAXAnnotation { /** * indexed getter for attributeList - gets an indexed value - List of attributes of the MMAX annotation .
* @ generated
* @ param i index in the array to get
* @ return value of the element at index i */
public MMAXAttribute getAttributeList ( int i ) { } } | if ( MMAXAnnotation_Type . featOkTst && ( ( MMAXAnnotation_Type ) jcasType ) . casFeat_attributeList == null ) jcasType . jcas . throwFeatMissing ( "attributeList" , "de.julielab.jules.types.mmax.MMAXAnnotation" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_attributeList ) , i ) ; return ( MMAXAttribute ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_attributeList ) , i ) ) ) ; |
public class LoggerPerTransactionStrategy { /** * Logger will be closed . If a dataRecorder has remaining transactional data
* an abnormal prgram flow is detected an the data of the logger is not
* destroy but kept to further recovery
* @ param event
* current connection */
@ Override public void connectionFreed ( IManagedConnectionEvent < C > event ) { } } | // physical connection is already set free
if ( ! event . getManagedConnection ( ) . hasCoreConnection ( ) ) { return ; } C con = event . getManagedConnection ( ) . getCoreConnection ( ) ; if ( con == null || ! ( con instanceof IXADataRecorderAware ) ) { return ; } IXADataRecorderAware messageAwareConnection = ( IXADataRecorderAware ) con ; // Transaction is closed and the xaDataRecorder is destroyed . . .
IXADataRecorder xaDataRecorder = messageAwareConnection . getXADataRecorder ( ) ; if ( xaDataRecorder == null ) { return ; } // if commit / rollback was performed , nothing happend . If no the logged
// data is closed but not destroy . So recovery can happen
if ( event . getManagedConnection ( ) . hasTransactionalData ( ) ) { xaRecorderRepository . close ( ) ; // close without removing the recover
// data
} else { xaDataRecorder . destroy ( ) ; } messageAwareConnection . setXADataRecorder ( null ) ; |
public class HttpMethodBase { /** * Generates default < tt > User - Agent < / tt > request header , as long as no
* < tt > User - Agent < / tt > request header already exists .
* @ param state the { @ link HttpState state } information associated with this method
* @ param conn the { @ link HttpConnection connection } used to execute
* this HTTP method
* @ throws IOException if an I / O ( transport ) error occurs . Some transport exceptions
* can be recovered from .
* @ throws HttpException if a protocol exception occurs . Usually protocol exceptions
* cannot be recovered from . */
protected void addUserAgentRequestHeader ( HttpState state , HttpConnection conn ) throws IOException , HttpException { } } | LOG . trace ( "enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, " + "HttpConnection)" ) ; if ( getRequestHeader ( "User-Agent" ) == null ) { String agent = ( String ) getParams ( ) . getParameter ( HttpMethodParams . USER_AGENT ) ; if ( agent == null ) { agent = "Jakarta Commons-HttpClient" ; } setRequestHeader ( "User-Agent" , agent ) ; } |
public class ObjectReader { /** * Sets the property value to an object using reflection
* @ param obj The object to get a property from
* @ param property The name of the property
* @ param value The property value */
private void setPropertyValue ( Object pObj , String pProperty , Object pValue ) { } } | Method m = null ; Class [ ] cl = { pValue . getClass ( ) } ; try { // Util . setPropertyValue ( pObj , pProperty , pValue ) ;
// Find method
m = pObj . getClass ( ) . getMethod ( "set" + StringUtil . capitalize ( pProperty ) , cl ) ; // Invoke it
Object [ ] args = { pValue } ; m . invoke ( pObj , args ) ; } catch ( NoSuchMethodException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException iae ) { iae . printStackTrace ( ) ; } catch ( InvocationTargetException ite ) { ite . printStackTrace ( ) ; } |
public class XmlPathParser { /** * Parse XML path query
* @ param xmlPathQuery XML path query
* @ return @ { code XmlPath } XML path */
public static XmlPath parse ( String xmlPathQuery ) { } } | // validations
if ( xmlPathQuery == null ) { throw new XmlPathException ( "The XML path query can not be a null value" ) ; } xmlPathQuery = xmlPathQuery . trim ( ) ; // simple patterns
if ( ! xmlPathQuery . contains ( "/" ) ) { if ( "*" . equals ( xmlPathQuery ) ) { return new XmlPath ( new XmlPathAnyElement ( ) ) ; } else if ( "@*" . equals ( xmlPathQuery ) ) { return new XmlPath ( new XmlPathAnyAttributeElement ( ) ) ; } else if ( "node()" . equals ( xmlPathQuery ) ) { return new XmlPath ( new XmlPathAnyNode ( ) ) ; } else if ( xmlPathQuery . matches ( XmlPathNodenameAttribute . REGEX_MATCH ) ) { return new XmlPath ( new XmlPathNodenameAttribute ( xmlPathQuery ) ) ; } else if ( xmlPathQuery . matches ( XmlPathNodename . REGEX_MATCH ) ) { return new XmlPath ( new XmlPathNodename ( xmlPathQuery ) ) ; } } // sub - tree patterns
Matcher m = rePath . matcher ( xmlPathQuery ) ; if ( ! m . matches ( ) ) { throw new XmlPathException ( "Invalid xml path query: " + xmlPathQuery ) ; } XmlPath . Builder builder = XmlPath . builder ( ) ; m = rePathPart . matcher ( xmlPathQuery ) ; while ( m . find ( ) ) { String part = m . group ( 1 ) ; if ( "*" . equals ( part ) ) { builder . add ( new XmlPathAnyElement ( ) ) ; } else if ( "@*" . equals ( part ) ) { builder . add ( new XmlPathAnyAttributeElement ( ) ) ; } else if ( "node()" . equals ( part ) ) { builder . add ( new XmlPathAnyNode ( ) ) ; } else if ( part . matches ( XmlPathNodenameAttribute . REGEX_MATCH ) ) { builder . add ( new XmlPathNodenameAttribute ( part ) ) ; } else if ( part . matches ( XmlPathNodename . REGEX_MATCH ) ) { builder . add ( new XmlPathNodename ( part ) ) ; } else { throw new XmlPathException ( "Invalid part(" + part + ") in xml path query: " + xmlPathQuery ) ; } } return builder . construct ( ) ; |
public class SiteProperties { /** * Returns true if SPA ( Single Page App ) mode is enabled . */
public static boolean isSpaEnabled ( ) { } } | Configuration config = ConfigUtils . getCurrentConfig ( ) ; if ( config != null ) { return config . getBoolean ( SPA_ENABLED_CONFIG_KEY , false ) ; } else { return false ; } |
public class DescribeDBClustersResult { /** * Contains a list of DB clusters for the user .
* @ return Contains a list of DB clusters for the user . */
public java . util . List < DBCluster > getDBClusters ( ) { } } | if ( dBClusters == null ) { dBClusters = new com . amazonaws . internal . SdkInternalList < DBCluster > ( ) ; } return dBClusters ; |
public class DriverTableModel { /** * / * default */
void addDriver ( String name , String path , int slot , int slotListIndex ) { } } | names . add ( name ) ; paths . add ( path ) ; slots . add ( slot ) ; slotListIndexes . add ( slotListIndex ) ; updateConfiguration ( ) ; |
public class ResourceIndexModule { /** * { @ inheritDoc } */
public int countTriples ( SubjectNode subject , PredicateNode predicate , ObjectNode object , int limit ) throws TrippiException { } } | return _ri . countTriples ( subject , predicate , object , limit ) ; |
public class ControlParametersImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case BpsimPackage . CONTROL_PARAMETERS__PROBABILITY : return probability != null ; case BpsimPackage . CONTROL_PARAMETERS__CONDITION : return condition != null ; case BpsimPackage . CONTROL_PARAMETERS__INTER_TRIGGER_TIMER : return interTriggerTimer != null ; case BpsimPackage . CONTROL_PARAMETERS__TRIGGER_COUNT : return triggerCount != null ; } return super . eIsSet ( featureID ) ; |
public class CmsGalleryService { /** * Stores the folder filters for the current site . < p >
* @ param folders the folder filters */
private void storeFolderFilter ( Set < String > folders ) { } } | JSONObject storedFilters = readUserFolderFilters ( ) ; try { storedFilters . put ( getCmsObject ( ) . getRequestContext ( ) . getSiteRoot ( ) , folders ) ; CmsUser user = getCmsObject ( ) . getRequestContext ( ) . getCurrentUser ( ) ; user . setAdditionalInfo ( FOLDER_FILTER_ADD_INFO_KEY , storedFilters . toString ( ) ) ; getCmsObject ( ) . writeUser ( user ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } |
public class SimpleDataArrayCompactor { /** * Note that this method is called only by SimpleDataArray . */
final void start ( ) { } } | _enabled = true ; _ignoredSegs . clear ( ) ; _executor = Executors . newSingleThreadExecutor ( new DaemonThreadFactory ( ) ) ; _executor . execute ( this ) ; |
public class CommerceDiscountRelPersistenceImpl { /** * Removes the commerce discount rel with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the commerce discount rel
* @ return the commerce discount rel that was removed
* @ throws NoSuchDiscountRelException if a commerce discount rel with the primary key could not be found */
@ Override public CommerceDiscountRel remove ( Serializable primaryKey ) throws NoSuchDiscountRelException { } } | Session session = null ; try { session = openSession ( ) ; CommerceDiscountRel commerceDiscountRel = ( CommerceDiscountRel ) session . get ( CommerceDiscountRelImpl . class , primaryKey ) ; if ( commerceDiscountRel == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchDiscountRelException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return remove ( commerceDiscountRel ) ; } catch ( NoSuchDiscountRelException nsee ) { throw nsee ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } |
public class ASegment { /** * get the next Latin word from the current position of the input stream
* @ param c
* @ param pos
* @ return IWord could be null and that mean we reached a stop word
* @ throws IOException */
protected IWord getNextLatinWord ( int c , int pos ) throws IOException { } } | /* * clear or just return the English punctuation as
* a single word with PUNCTUATION type and part of speech */
if ( StringUtil . isEnPunctuation ( c ) ) { String str = String . valueOf ( ( char ) c ) ; if ( config . CLEAR_STOPWORD && dic . match ( ILexicon . STOP_WORD , str ) ) { return null ; } IWord w = new Word ( str , IWord . T_PUNCTUATION ) ; w . setPosition ( pos ) ; w . setPartSpeech ( IWord . PUNCTUATION ) ; return w ; } IWord w = nextLatinWord ( c , pos ) ; w . setPosition ( pos ) ; /* @ added : 2013-12-16
* check and do the secondary segmentation work .
* This will split ' qq2013 ' to ' qq , 2013 ' . */
if ( config . EN_SECOND_SEG && ( ctrlMask & ISegment . START_SS_MASK ) != 0 ) { enSecondSeg ( w , false ) ; } if ( config . CLEAR_STOPWORD && dic . match ( ILexicon . STOP_WORD , w . getValue ( ) ) ) { w = null ; // Let gc do its work
return null ; } if ( config . APPEND_CJK_SYN ) { appendLatinSyn ( w ) ; } return w ; |
public class Scanner { /** * Returns true if the next token in this scanner ' s input can be
* interpreted as a < code > BigInteger < / code > in the specified radix using
* the { @ link # nextBigInteger } method . The scanner does not advance past
* any input .
* @ param radix the radix used to interpret the token as an integer
* @ return true if and only if this scanner ' s next token is a valid
* < code > BigInteger < / code >
* @ throws IllegalStateException if this scanner is closed */
public boolean hasNextBigInteger ( int radix ) { } } | setRadix ( radix ) ; boolean result = hasNext ( integerPattern ( ) ) ; if ( result ) { // Cache it
try { String s = ( matcher . group ( SIMPLE_GROUP_INDEX ) == null ) ? processIntegerToken ( hasNextResult ) : hasNextResult ; typeCache = new BigInteger ( s , radix ) ; } catch ( NumberFormatException nfe ) { result = false ; } } return result ; |
public class MG2Encoder { /** * Setup the 3D space subdivision grid .
* @ param vertices vertex data
* @ return calculated grid definition */
public Grid setupGrid ( float [ ] vertices ) { } } | int vc = vertices . length / 3 ; // CTM _ POSITION _ ELEMENT _ COUNT = = 3
// Calculate the mesh boundinggrid . box
float [ ] min = new float [ 3 ] ; float [ ] max = new float [ 3 ] ; int [ ] division = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; ++ i ) { min [ i ] = max [ i ] = vertices [ i ] ; } for ( int i = 1 ; i < vc ; ++ i ) { for ( int j = 0 ; j < 3 ; j ++ ) { min [ j ] = min ( min [ j ] , vertices [ i * 3 + j ] ) ; max [ j ] = max ( max [ j ] , vertices [ i * 3 + j ] ) ; } } // Determine optimal grid resolution , based on the number of vertices and
// the bounding box .
// NOTE : This algorithm is quite crude , and could very well be optimized for
// better compression levels in the future without affecting the file format
// or backward compatibility at all .
float [ ] factor = new float [ 3 ] ; for ( int i = 0 ; i < 3 ; ++ i ) { factor [ i ] = max [ i ] - min [ i ] ; } float sum = factor [ 0 ] + factor [ 1 ] + factor [ 2 ] ; if ( sum > 1e-30f ) { sum = 1.0f / sum ; for ( int i = 0 ; i < 3 ; ++ i ) { factor [ i ] *= sum ; } double wantedGrids = pow ( 100.0f * vc , 1.0f / 3.0f ) ; for ( int i = 0 ; i < 3 ; ++ i ) { division [ i ] = ( int ) ceil ( wantedGrids * factor [ i ] ) ; if ( division [ i ] < 1 ) { division [ i ] = 1 ; } } } else { division [ 0 ] = 4 ; division [ 1 ] = 4 ; division [ 2 ] = 4 ; } return new Grid ( Vec3f . from ( min ) , Vec3f . from ( max ) , Vec3i . from ( division ) ) ; |
public class ExtensionsTable { /** * Execute the element - available ( ) function .
* @ param ns the URI of namespace in which the function is needed
* @ param elemName name of element being tested
* @ return whether the given element is available or not .
* @ throws javax . xml . transform . TransformerException */
public boolean elementAvailable ( String ns , String elemName ) throws javax . xml . transform . TransformerException { } } | boolean isAvailable = false ; if ( null != ns ) { ExtensionHandler extNS = ( ExtensionHandler ) m_extensionFunctionNamespaces . get ( ns ) ; if ( extNS != null ) // defensive
isAvailable = extNS . isElementAvailable ( elemName ) ; } return isAvailable ; |
public class Generics { /** * Removes the generic types being tracked since the corresponding { @ link # pushGenericType ( GenericType ) } . This is safe to call
* even if { @ link # pushGenericType ( GenericType ) } was not called . */
public void popGenericType ( ) { } } | int size = genericTypesSize ; if ( size == 0 ) return ; size -- ; if ( depths [ size ] < kryo . getDepth ( ) ) return ; genericTypes [ size ] = null ; genericTypesSize = size ; |
public class QueryImpl { /** * { @ inheritDoc } */
public String getStoredQueryPath ( ) throws ItemNotFoundException , RepositoryException { } } | checkInitialized ( ) ; if ( node == null ) { throw new ItemNotFoundException ( "not a persistent query" ) ; } return node . getPath ( ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcUnitaryEquipmentType ( ) { } } | if ( ifcUnitaryEquipmentTypeEClass == null ) { ifcUnitaryEquipmentTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 630 ) ; } return ifcUnitaryEquipmentTypeEClass ; |
public class DescribeAvailabilityZonesRequest { /** * The names of the Availability Zones .
* @ return The names of the Availability Zones . */
public java . util . List < String > getZoneNames ( ) { } } | if ( zoneNames == null ) { zoneNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return zoneNames ; |
public class StackLineUtils { /** * return null if not found */
private static StackLine getStackLine ( TestMethodTable table , String classQualifiedName , String methodSimpleName , int line ) { } } | if ( line <= 0 ) { return null ; // 0 or negative line number never matches
} List < TestMethod > nameMethods = table . getByName ( classQualifiedName , methodSimpleName ) ; for ( TestMethod method : nameMethods ) { for ( int i = 0 ; i < method . getCodeBody ( ) . size ( ) ; i ++ ) { CodeLine codeLine = method . getCodeBody ( ) . get ( i ) ; if ( codeLine . getStartLine ( ) <= line && line <= codeLine . getEndLine ( ) ) { StackLine result = new StackLine ( ) ; result . setMethodKey ( method . getKey ( ) ) ; result . setMethod ( method ) ; result . setCodeBodyIndex ( i ) ; result . setLine ( line ) ; return result ; } } } return null ; |
public class InterfaceService { /** * Forces eager initiation of all views managed by registered controllers . Initiates dialogs that cache and reuse
* their dialog actor instance . */
public void initiateAllControllers ( ) { } } | for ( final ViewController controller : controllers . values ( ) ) { initiateView ( controller ) ; } for ( final ViewDialogController controller : dialogControllers . values ( ) ) { if ( controller instanceof AnnotatedViewDialogController ) { final AnnotatedViewDialogController dialogController = ( AnnotatedViewDialogController ) controller ; if ( ! dialogController . isInitiated ( ) && dialogController . isCachingInstance ( ) ) { dialogController . prepareDialogInstance ( ) ; } } } |
public class ComputerVisionImpl { /** * This operation generates a thumbnail image with the user - specified width and height . By default , the service analyzes the image , identifies the region of interest ( ROI ) , and generates smart cropping coordinates based on the ROI . Smart cropping helps when you specify an aspect ratio that differs from that of the input image . A successful response contains the thumbnail image binary . If the request failed , the response contains an error code and a message to help determine what went wrong .
* @ param width Width of the thumbnail . It must be between 1 and 1024 . Recommended minimum of 50.
* @ param height Height of the thumbnail . It must be between 1 and 1024 . Recommended minimum of 50.
* @ param image An image stream .
* @ param generateThumbnailInStreamOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the InputStream object */
public Observable < ServiceResponse < InputStream > > generateThumbnailInStreamWithServiceResponseAsync ( int width , int height , byte [ ] image , GenerateThumbnailInStreamOptionalParameter generateThumbnailInStreamOptionalParameter ) { } } | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( image == null ) { throw new IllegalArgumentException ( "Parameter image is required and cannot be null." ) ; } final Boolean smartCropping = generateThumbnailInStreamOptionalParameter != null ? generateThumbnailInStreamOptionalParameter . smartCropping ( ) : null ; return generateThumbnailInStreamWithServiceResponseAsync ( width , height , image , smartCropping ) ; |
public class Activator { /** * Track welcome files
* @ param bundleContext the BundleContext associated with this bundle */
private void trackWelcomeFiles ( final BundleContext bundleContext ) { } } | final ServiceTracker < WelcomeFileMapping , WelcomeFileWebElement > welcomeFileTracker = WelcomeFileMappingTracker . createTracker ( extenderContext , bundleContext ) ; welcomeFileTracker . open ( ) ; trackers . add ( 0 , welcomeFileTracker ) ; |
public class IOUtils { /** * Copy bytes from a large ( over 2GB ) < code > InputStream < / code > to an
* < code > OutputStream < / code > .
* This method buffers the input internally , so there is no need to use a
* < code > BufferedInputStream < / code > .
* The buffer size is given by { @ link # DEFAULT _ BUFFER _ SIZE } .
* @ param input the < code > InputStream < / code > to read from
* @ param output the < code > OutputStream < / code > to write to
* @ return the number of bytes copied
* @ throws NullPointerException if the input or output is null
* @ throws IOException if an I / O error occurs
* @ since 1.3 */
public static long copyLarge ( InputStream input , OutputStream output ) throws IOException { } } | return copyLarge ( input , output , new byte [ DEFAULT_BUFFER_SIZE ] ) ; |
public class EJBJavaColonNamingHelper { /** * Get the EJBBinding map from the application meta data . Initialize if it
* is null .
* @ param amd
* @ return Map for the lookup names and binding object . */
private JavaColonNamespaceBindings < EJBBinding > getAppBindingMap ( ApplicationMetaData amd ) { } } | @ SuppressWarnings ( "unchecked" ) JavaColonNamespaceBindings < EJBBinding > bindingMap = ( JavaColonNamespaceBindings < EJBBinding > ) amd . getMetaData ( amdSlot ) ; if ( bindingMap == null ) { bindingMap = new JavaColonNamespaceBindings < EJBBinding > ( NamingConstants . JavaColonNamespace . APP , this ) ; amd . setMetaData ( amdSlot , bindingMap ) ; } return bindingMap ; |
public class CmsModuleAddResourceTypeThread { /** * Copies the sample formatter JSP , creates the associated formatter and module configuration . < p >
* @ param moduleFolder the module folder name
* @ throws CmsIllegalArgumentException in case something goes wrong copying the resources
* @ throws CmsException in case something goes wrong copying the resources */
private void createSampleFormatter ( String moduleFolder ) throws CmsIllegalArgumentException , CmsException { } } | CmsObject cms = getCms ( ) ; String formatterFolder = CmsStringUtil . joinPaths ( moduleFolder , CmsModulesEditBase . PATH_FORMATTERS ) ; if ( ! cms . existsResource ( formatterFolder ) ) { cms . createResource ( formatterFolder , CmsResourceTypeFolder . getStaticTypeId ( ) ) ; } String formatterJSP = CmsStringUtil . joinPaths ( formatterFolder , m_resInfo . getName ( ) + "-formatter.jsp" ) ; if ( ! cms . existsResource ( formatterJSP ) ) { cms . copyResource ( SAMPLE_FORMATTER , formatterJSP , CmsResource . COPY_AS_NEW ) ; } String formatterConfig = CmsStringUtil . joinPaths ( formatterFolder , m_resInfo . getName ( ) + "-formatter-config.xml" ) ; if ( ! cms . existsResource ( formatterConfig ) ) { cms . createResource ( formatterConfig , OpenCms . getResourceManager ( ) . getResourceType ( CmsFormatterConfigurationCache . TYPE_FORMATTER_CONFIG ) . getTypeId ( ) ) ; CmsFile configFile = cms . readFile ( formatterConfig ) ; CmsXmlContent configContent = CmsXmlContentFactory . unmarshal ( cms , configFile ) ; if ( ! configContent . hasLocale ( CmsConfigurationReader . DEFAULT_LOCALE ) ) { configContent . addLocale ( cms , CmsConfigurationReader . DEFAULT_LOCALE ) ; } I_CmsXmlContentValue typeValue = configContent . getValue ( CmsFormatterBeanParser . N_TYPE , CmsConfigurationReader . DEFAULT_LOCALE ) ; typeValue . setStringValue ( cms , m_resInfo . getName ( ) ) ; I_CmsXmlContentValue formatterValue = configContent . getValue ( CmsFormatterBeanParser . N_JSP , CmsConfigurationReader . DEFAULT_LOCALE ) ; formatterValue . setStringValue ( cms , formatterJSP ) ; I_CmsXmlContentValue formatterNameValue = configContent . getValue ( CmsFormatterBeanParser . N_NICE_NAME , CmsConfigurationReader . DEFAULT_LOCALE ) ; formatterNameValue . setStringValue ( cms , "Sample formatter for " + ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( m_resInfo . getNiceName ( ) ) ? m_resInfo . getNiceName ( ) : m_resInfo . getName ( ) ) ) ; // set matching container width to ' - 1 ' to fit everywhere
configContent . addValue ( cms , CmsFormatterBeanParser . N_MATCH , CmsConfigurationReader . DEFAULT_LOCALE , 0 ) ; configContent . addValue ( cms , CmsFormatterBeanParser . N_MATCH + "/" + CmsFormatterBeanParser . N_WIDTH , CmsConfigurationReader . DEFAULT_LOCALE , 0 ) ; I_CmsXmlContentValue widthValue = configContent . getValue ( CmsFormatterBeanParser . N_MATCH + "/" + CmsFormatterBeanParser . N_WIDTH + "/" + CmsFormatterBeanParser . N_WIDTH , CmsConfigurationReader . DEFAULT_LOCALE ) ; widthValue . setStringValue ( cms , "-1" ) ; // enable the formatter
I_CmsXmlContentValue enabledValue = configContent . getValue ( CmsFormatterBeanParser . N_AUTO_ENABLED , CmsConfigurationReader . DEFAULT_LOCALE ) ; enabledValue . setStringValue ( cms , Boolean . TRUE . toString ( ) ) ; configFile . setContents ( configContent . marshal ( ) ) ; cms . writeFile ( configFile ) ; } String moduleConfig = CmsStringUtil . joinPaths ( moduleFolder , ".config" ) ; if ( ! cms . existsResource ( moduleConfig ) ) { cms . createResource ( moduleConfig , OpenCms . getResourceManager ( ) . getResourceType ( CmsADEManager . MODULE_CONFIG_TYPE ) . getTypeId ( ) ) ; } CmsFile moduleConfigFile = cms . readFile ( moduleConfig ) ; lockTemporary ( moduleConfigFile ) ; CmsXmlContent moduleConfigContent = CmsXmlContentFactory . unmarshal ( cms , moduleConfigFile ) ; I_CmsXmlContentValue resourceTypeValue = moduleConfigContent . addValue ( cms , CmsConfigurationReader . N_RESOURCE_TYPE , CmsConfigurationReader . DEFAULT_LOCALE , 0 ) ; I_CmsXmlContentValue typeValue = moduleConfigContent . getValue ( resourceTypeValue . getPath ( ) + "/" + CmsConfigurationReader . N_TYPE_NAME , CmsConfigurationReader . DEFAULT_LOCALE ) ; typeValue . setStringValue ( cms , m_resInfo . getName ( ) ) ; moduleConfigFile . setContents ( moduleConfigContent . marshal ( ) ) ; cms . writeFile ( moduleConfigFile ) ; |
public class AbstractRadial { /** * Creates a single alignment post image that could be placed on all the positions where it is needed
* @ param WIDTH
* @ param KNOB _ TYPE
* @ return a buffered image that contains a single alignment post of the given type */
private BufferedImage create_KNOB_Image ( final int WIDTH , final KnobType KNOB_TYPE , final KnobStyle KNOB_STYLE ) { } } | return KNOB_FACTORY . create_KNOB_Image ( WIDTH , KNOB_TYPE , KNOB_STYLE ) ; |
public class ResultConsolePrinter { /** * { @ inheritDoc } */
@ Override public void notifyResult ( T result ) { } } | System . out . println ( this . header + result . toString ( ) ) ; |
public class VLongStorage { /** * Writes an long in a variable - length format . Writes between one and nine bytes . Smaller values
* take fewer bytes . Negative numbers are not supported .
* The format is described further in Lucene its DataOutput # writeVInt ( int )
* See DataInput readVLong of Lucene */
public final void writeVLong ( long i ) { } } | assert i >= 0L ; while ( ( i & ~ 0x7FL ) != 0L ) { writeByte ( ( byte ) ( ( i & 0x7FL ) | 0x80L ) ) ; i >>>= 7 ; } writeByte ( ( byte ) i ) ; |
public class CmsXmlContainerPage { /** * Fills a { @ link CmsXmlVfsFileValue } with the resource identified by the given id . < p >
* @ param cms the current CMS context
* @ param element the XML element to fill
* @ param resourceId the ID identifying the resource to use
* @ return the resource
* @ throws CmsException if the resource can not be read */
protected CmsResource fillResource ( CmsObject cms , Element element , CmsUUID resourceId ) throws CmsException { } } | String xpath = element . getPath ( ) ; int pos = xpath . lastIndexOf ( "/" + XmlNode . Containers . name ( ) + "/" ) ; if ( pos > 0 ) { xpath = xpath . substring ( pos + 1 ) ; } CmsRelationType type = getHandler ( ) . getRelationType ( xpath ) ; CmsResource res = cms . readResource ( resourceId , CmsResourceFilter . IGNORE_EXPIRATION ) ; CmsXmlVfsFileValue . fillEntry ( element , res . getStructureId ( ) , res . getRootPath ( ) , type ) ; return res ; |
public class CreateLifecyclePolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateLifecyclePolicyRequest createLifecyclePolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createLifecyclePolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createLifecyclePolicyRequest . getExecutionRoleArn ( ) , EXECUTIONROLEARN_BINDING ) ; protocolMarshaller . marshall ( createLifecyclePolicyRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( createLifecyclePolicyRequest . getState ( ) , STATE_BINDING ) ; protocolMarshaller . marshall ( createLifecyclePolicyRequest . getPolicyDetails ( ) , POLICYDETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ContentUriChecker { /** * Extract place holders from URI .
* @ param < L > the generic type
* @ param uri the uri
* @ param result the result
* @ return the l */
private < L extends Collection < ContentUriPlaceHolder > > L extractPlaceHoldersFromURI ( String uri , final L result ) { } } | final One < Boolean > valid = new One < > ( ) ; valid . value0 = false ; analyzeInternal ( uri , new UriBaseListener ( ) { @ Override public void enterBind_parameter ( Bind_parameterContext ctx ) { result . add ( new ContentUriPlaceHolder ( pathSegmentIndex , ctx . bind_parameter_name ( ) . getText ( ) ) ) ; } @ Override public void enterPath_segment ( Path_segmentContext ctx ) { pathSegmentIndex ++ ; } } ) ; return result ; |
public class RequestController { /** * Removes the specified entry point
* @ param controlPoint The entry point */
public synchronized void removeControlPoint ( ControlPoint controlPoint ) { } } | if ( controlPoint . decreaseReferenceCount ( ) == 0 ) { ControlPointIdentifier id = new ControlPointIdentifier ( controlPoint . getDeployment ( ) , controlPoint . getEntryPoint ( ) ) ; entryPoints . remove ( id ) ; } |
public class BMPCLocalLauncher { /** * Unzip ZIP file ( as InputStream ) to a destination directory .
* @ param zipFileInputStream Zip File InputStream
* @ param destinationDir Destination Directory */
private synchronized static void unzip ( InputStream zipFileInputStream , String destinationDir ) throws IOException { } } | // Create output directory if it doesn ' t exist
File dir = new File ( destinationDir ) ; if ( ! dir . exists ( ) ) dir . mkdirs ( ) ; // Buffer for read and write data to file
byte [ ] buffer = new byte [ 1024 ] ; ZipInputStream zis = new ZipInputStream ( zipFileInputStream ) ; ZipEntry ze = zis . getNextEntry ( ) ; while ( ze != null ) { String fileName = ze . getName ( ) ; File newFile = new File ( destinationDir + File . separator + fileName ) ; // Check if it ' s a Directory entry
if ( ze . isDirectory ( ) ) { newFile . mkdirs ( ) ; } else { // Save file to disk
FileOutputStream fos = new FileOutputStream ( newFile ) ; int len ; while ( ( len = zis . read ( buffer ) ) > 0 ) { fos . write ( buffer , 0 , len ) ; } fos . close ( ) ; } // Close current entry and move to next entry
zis . closeEntry ( ) ; ze = zis . getNextEntry ( ) ; } // Close last entry
zis . closeEntry ( ) ; zis . close ( ) ; |
public class IndexRecoveryImpl { /** * { @ inheritDoc } */
public void onChange ( TopologyChangeEvent event ) { } } | try { if ( rpcService . isCoordinator ( ) && ! isOnline ) { new Thread ( ) { @ Override public synchronized void run ( ) { try { List < Object > results = rpcService . executeCommandOnAllNodes ( requestForResponsibleToSetIndexOnline , true ) ; for ( Object result : results ) { if ( result instanceof Boolean ) { if ( ( Boolean ) result ) { return ; } } else { log . error ( "Result is not an instance of Boolean" + result ) ; } } // node which was responsible for resuming leave the cluster , so resume component
log . error ( "Node responsible for setting index back online seems to leave the cluster. Setting back online." ) ; searchManager . setOnline ( true , false , false ) ; } catch ( SecurityException e1 ) { log . error ( "You haven't privileges to execute remote command" , e1 ) ; } catch ( RPCException e1 ) { log . error ( "Exception during command execution" , e1 ) ; } catch ( IOException e2 ) { log . error ( "Exception during setting index back online" , e2 ) ; } } } . start ( ) ; } } catch ( RPCException e ) { log . error ( "Can't check if node coordinator or not." ) ; } |
public class Journaler { /** * Delegate to the JournalWorker . */
public Date modifyDatastreamByReference ( Context context , String pid , String datastreamID , String [ ] altIDs , String dsLabel , String mimeType , String formatURI , String dsLocation , String checksumType , String checksum , String logMessage , Date lastModifiedDate ) throws ServerException { } } | return worker . modifyDatastreamByReference ( context , pid , datastreamID , altIDs , dsLabel , mimeType , formatURI , dsLocation , checksumType , checksum , logMessage , lastModifiedDate ) ; |
public class NatsConsumer { /** * Drain tells the consumer to process in flight , or cached messages , but stop receiving new ones . The library will
* flush the unsubscribe call ( s ) insuring that any publish calls made by this client are included . When all messages
* are processed the consumer effectively becomes unsubscribed .
* @ param timeout The time to wait for the drain to succeed , pass 0 to wait
* forever . Drain involves moving messages to and from the server
* so a very short timeout is not recommended .
* @ return A future that can be used to check if the drain has completed
* @ throws InterruptedException if the thread is interrupted */
public CompletableFuture < Boolean > drain ( Duration timeout ) throws InterruptedException { } } | if ( ! this . isActive ( ) || this . connection == null ) { throw new IllegalStateException ( "Consumer is closed" ) ; } if ( isDraining ( ) ) { return this . getDrainingFuture ( ) ; } Instant start = Instant . now ( ) ; final CompletableFuture < Boolean > tracker = new CompletableFuture < > ( ) ; this . markDraining ( tracker ) ; this . sendUnsubForDrain ( ) ; try { this . connection . flush ( timeout ) ; // Flush and wait up to the timeout
} catch ( TimeoutException e ) { this . connection . processException ( e ) ; } this . markUnsubedForDrain ( ) ; // Wait for the timeout or the pending count to go to 0 , skipped if conn is
// draining
connection . getExecutor ( ) . submit ( ( ) -> { try { Instant now = Instant . now ( ) ; while ( timeout == null || timeout . equals ( Duration . ZERO ) || Duration . between ( start , now ) . compareTo ( timeout ) < 0 ) { if ( this . isDrained ( ) ) { break ; } Thread . sleep ( 1 ) ; // Sleep 1 milli
now = Instant . now ( ) ; } this . cleanUpAfterDrain ( ) ; } catch ( InterruptedException e ) { this . connection . processException ( e ) ; } finally { tracker . complete ( this . isDrained ( ) ) ; } } ) ; return getDrainingFuture ( ) ; |
public class IoUtil { /** * 获得一个文件读取器
* @ param in 输入流
* @ param charsetName 字符集名称
* @ return BufferedReader对象 */
public static BufferedReader getReader ( InputStream in , String charsetName ) { } } | return getReader ( in , Charset . forName ( charsetName ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.