signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MultiChoiceListPreference { /** * Persists a specific set in the shared preferences by using the preference ' s key . * @ param set * The set , which should be persisted , as an instance of the type { @ link Set } * @ return True , if the given set has been persisted , false otherwise */ private bool...
if ( set != null && shouldPersist ( ) ) { if ( set . equals ( getPersistedSet ( null ) ) ) { return true ; } Editor editor = getPreferenceManager ( ) . getSharedPreferences ( ) . edit ( ) ; editor . putStringSet ( getKey ( ) , set ) ; editor . apply ( ) ; return true ; } return false ;
public class WVideo { /** * When an video element is rendered to the client , the browser will make a second request to get the video content . * The handleRequest method has been overridden to detect whether the request is the " content fetch " request by * looking for the parameter that we encode in the content u...
super . handleRequest ( request ) ; String targ = request . getParameter ( Environment . TARGET_ID ) ; boolean contentReqested = ( targ != null && targ . equals ( getTargetId ( ) ) ) ; if ( contentReqested && request . getParameter ( POSTER_REQUEST_PARAM_KEY ) != null ) { handlePosterRequest ( ) ; } if ( isDisabled ( )...
public class CharSequenceWrapper { /** * transform given value to a javascript parameter value * @ param value The value to transform * @ return value as string */ public static CharSequence toParameterValue ( final JavaScriptInlineFunction value ) { } }
return value != null ? value . build ( ) : Attr . nullValue ( ) ;
public class CmsDateRestrictionParser { /** * Parses a date restriction of type ' FromToday ' . < p > * @ param dateRestriction the location of the date restriction * @ return the date restriction */ private I_CmsListDateRestriction parseFromToday ( CmsXmlContentValueLocation dateRestriction ) { } }
CmsXmlContentValueLocation location = dateRestriction . getSubValue ( N_FROM_TODAY ) ; if ( location == null ) { return null ; } CmsXmlContentValueLocation countLoc = location . getSubValue ( N_COUNT ) ; CmsXmlContentValueLocation unitLoc = location . getSubValue ( N_UNIT ) ; CmsXmlContentValueLocation directionLoc = l...
public class FileOutputCommitter { /** * Move all of the files from the work directory to the final output * @ param context the task context * @ param fs the output file system * @ param jobOutputDir the final output direcotry * @ param taskOutput the work path * @ throws IOException */ private void moveTask...
TaskAttemptID attemptId = context . getTaskAttemptID ( ) ; context . progress ( ) ; if ( fs . isFile ( taskOutput ) ) { Path finalOutputPath = getFinalPath ( jobOutputDir , taskOutput , workPath ) ; if ( ! fs . rename ( taskOutput , finalOutputPath ) ) { if ( ! fs . delete ( finalOutputPath , true ) ) { throw new IOExc...
public class DockPaneController { /** * { @ inheritDoc } */ @ Override protected void initEventHandlers ( ) throws CoreException { } }
node ( ) . addEventHandler ( DragEvent . DRAG_OVER , getHandler ( DragEvent . DRAG_OVER ) ) ; node ( ) . addEventHandler ( DragEvent . DRAG_ENTERED_TARGET , getHandler ( DragEvent . DRAG_ENTERED_TARGET ) ) ; node ( ) . addEventHandler ( DragEvent . DRAG_EXITED_TARGET , getHandler ( DragEvent . DRAG_EXITED_TARGET ) ) ; ...
public class HashAlgorithmOptions { /** * The set of accepted hash algorithms allowed in an AWS Signer job . * @ param allowedValues * The set of accepted hash algorithms allowed in an AWS Signer job . * @ return Returns a reference to this object so that method calls can be chained together . * @ see HashAlgor...
java . util . ArrayList < String > allowedValuesCopy = new java . util . ArrayList < String > ( allowedValues . length ) ; for ( HashAlgorithm value : allowedValues ) { allowedValuesCopy . add ( value . toString ( ) ) ; } if ( getAllowedValues ( ) == null ) { setAllowedValues ( allowedValuesCopy ) ; } else { getAllowed...
public class FrameworkEventAdapter { /** * Determine the appropriate topic to use for the Framework Event . * @ param frameworkEvent * the framework event that is being adapted * @ return the topic or null if the event is not supported */ private String getTopic ( FrameworkEvent frameworkEvent ) { } }
StringBuilder topic = new StringBuilder ( FRAMEWORK_EVENT_TOPIC_PREFIX ) ; switch ( frameworkEvent . getType ( ) ) { case FrameworkEvent . STARTED : topic . append ( "STARTED" ) ; break ; case FrameworkEvent . ERROR : topic . append ( "ERROR" ) ; break ; case FrameworkEvent . PACKAGES_REFRESHED : topic . append ( "PACK...
public class AWSGreengrassClient { /** * Deletes a resource definition . * @ param deleteResourceDefinitionRequest * @ return Result of the DeleteResourceDefinition operation returned by the service . * @ throws BadRequestException * invalid request * @ sample AWSGreengrass . DeleteResourceDefinition * @ se...
request = beforeClientExecution ( request ) ; return executeDeleteResourceDefinition ( request ) ;
public class HostMessenger { /** * Take the new connection ( member of the mesh ) and create a foreign host for it * and put it in the map of foreign hosts */ @ Override public void notifyOfJoin ( int hostId , SocketChannel socket , SSLEngine sslEngine , InetSocketAddress listeningAddress , JSONObject jo ) { } }
networkLog . info ( getHostId ( ) + " notified of " + hostId ) ; prepSocketChannel ( socket ) ; ForeignHost fhost = null ; try { fhost = new ForeignHost ( this , hostId , socket , m_config . deadHostTimeout , listeningAddress , createPicoNetwork ( sslEngine , socket , false ) ) ; putForeignHost ( hostId , fhost ) ; fho...
public class AbstractKeyedObjectPool { /** * Default Single Key to Single Object implementation . Advanced Pools extending this class can override this behavior . If the key does not exist then * an entry should be created and returned . If the key exists and is not borrowed then the entry should be returned . * If...
E entry = null ; if ( ! pool . containsKey ( key ) ) { entry = create ( key ) . initialize ( key , this ) ; pool . put ( key , entry ) ; borrowed . add ( entry ) ; return entry ; } entry = pool . get ( key ) ; if ( borrowed . add ( entry ) ) { factory . activate ( entry . get ( ) ) ; return entry ; } return entry . isC...
public class FormatDateSupport { /** * Private utility methods */ private DateFormat createFormatter ( Locale loc , String pattern ) throws JspException { } }
// Apply pattern , if present if ( pattern != null ) { return new SimpleDateFormat ( pattern , loc ) ; } if ( ( type == null ) || DATE . equalsIgnoreCase ( type ) ) { int style = Util . getStyle ( dateStyle , "FORMAT_DATE_INVALID_DATE_STYLE" ) ; return DateFormat . getDateInstance ( style , loc ) ; } else if ( TIME . e...
public class CORBA_Utils { /** * PM46698 */ private static boolean isCORBAObject ( Class < ? > valueClass , int rmicCompatible ) { } }
if ( JITDeploy . isRMICCompatibleValues ( rmicCompatible ) && org . omg . CORBA . Object . class . isAssignableFrom ( valueClass ) ) { return true ; } return false ;
public class InvalidFormulaInContextException { /** * Converts a Throwable to a InvalidFormulaInContextException . If the Throwable is a * InvalidFormulaInContextException , it will be passed through unmodified ; otherwise , it will be wrapped * in a new InvalidFormulaInContextException . * @ param cause the Thro...
return ( cause instanceof InvalidFormulaInContextException ) ? ( InvalidFormulaInContextException ) cause : new InvalidFormulaInContextException ( cause ) ;
public class VaadinMessageSource { /** * Tries to resolve the message based on the provided Local . Returns message * code if fitting message could not be found . * @ param local * to determinate the Language . * @ param code * the code to lookup up . * @ param args * Array of arguments that will be fille...
try { return source . getMessage ( code , args , local ) ; } catch ( final NoSuchMessageException ex ) { LOG . error ( "Failed to retrieve message!" , ex ) ; return code ; }
public class SteppingThreadGroupGui { /** * Initialise the gui field values */ private void initGui ( ) { } }
totalThreads . setText ( "100" ) ; initialDelay . setText ( "0" ) ; incUserCount . setText ( "10" ) ; incUserCountBurst . setText ( "0" ) ; incUserPeriod . setText ( "30" ) ; flightTime . setText ( "60" ) ; decUserCount . setText ( "5" ) ; decUserPeriod . setText ( "1" ) ; rampUp . setText ( "5" ) ;
public class BufferedMirage { /** * documentation inherited from interface */ public void paint ( Graphics2D gfx , int x , int y ) { } }
gfx . drawImage ( _image , x , y , null ) ;
public class ComparedFaceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ComparedFace comparedFace , ProtocolMarshaller protocolMarshaller ) { } }
if ( comparedFace == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( comparedFace . getBoundingBox ( ) , BOUNDINGBOX_BINDING ) ; protocolMarshaller . marshall ( comparedFace . getConfidence ( ) , CONFIDENCE_BINDING ) ; protocolMarshaller . m...
public class GrapesClient { /** * Send a get artifacts request * @ param hasLicense * @ return list of artifact * @ throws GrapesCommunicationException */ public List < Artifact > getArtifacts ( final Boolean hasLicense ) throws GrapesCommunicationException { } }
final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactsPath ( ) ) ; final ClientResponse response = resource . queryParam ( ServerAPI . HAS_LICENSE_PARAM , hasLicense . toString ( ) ) . accept ( MediaType . APPLICATION_JSON ) . get ( Client...
public class CPDefinitionLocalServiceBaseImpl { /** * Returns all the cp definitions matching the UUID and company . * @ param uuid the UUID of the cp definitions * @ param companyId the primary key of the company * @ return the matching cp definitions , or an empty list if no matches were found */ @ Override pub...
return cpDefinitionPersistence . findByUuid_C ( uuid , companyId ) ;
public class StructTypeID { /** * generic reader : reads the next TypeID object from stream and returns it */ private TypeID genericReadTypeID ( RecordInput rin , String tag ) throws IOException { } }
byte typeVal = rin . readByte ( tag ) ; switch ( typeVal ) { case TypeID . RIOType . BOOL : return TypeID . BoolTypeID ; case TypeID . RIOType . BUFFER : return TypeID . BufferTypeID ; case TypeID . RIOType . BYTE : return TypeID . ByteTypeID ; case TypeID . RIOType . DOUBLE : return TypeID . DoubleTypeID ; case TypeID...
public class PageParametersExtensions { /** * Gets a map with all parameters . Looks in the query , request and post parameters . * @ param request * the request * @ return a map with all parameters . */ public static Map < String , List < StringValue > > getPageParametersMap ( final Request request ) { } }
final Map < String , List < StringValue > > map = new HashMap < > ( ) ; addToParameters ( request . getRequestParameters ( ) , map ) ; addToParameters ( request . getQueryParameters ( ) , map ) ; addToParameters ( request . getPostParameters ( ) , map ) ; return map ;
public class sslcrl { /** * Use this API to add sslcrl . */ public static base_response add ( nitro_service client , sslcrl resource ) throws Exception { } }
sslcrl addresource = new sslcrl ( ) ; addresource . crlname = resource . crlname ; addresource . crlpath = resource . crlpath ; addresource . inform = resource . inform ; addresource . refresh = resource . refresh ; addresource . cacert = resource . cacert ; addresource . method = resource . method ; addresource . serv...
public class CmsXmlMessages { /** * Returns the localized resource String from the configuration file , if not found or set from the resource bundle . < p > * @ see org . opencms . i18n . CmsMessages # key ( java . lang . String , java . lang . Object [ ] ) */ @ Override public String key ( String key , Object [ ] ar...
if ( hasConfigValue ( key ) ) { return getConfigValue ( key , args ) ; } return m_messages . key ( key , args ) ;
public class CreateClusterRequest { /** * Configure optional application for the cluster . BMR provides applications such as Hive ใ€ Pig ใ€ HBase for the cluster . * @ param application An ApplicationConfig instance . * @ return CreateClusterRequest */ public CreateClusterRequest withApplication ( ApplicationConfig a...
if ( this . applications == null ) { this . applications = new ArrayList < ApplicationConfig > ( ) ; } this . applications . add ( application ) ; return this ;
public class SqlModifyBuilder { /** * generate sql log . * @ param method * the method * @ param methodBuilder * the method builder */ public static void generateLogForModifiers ( final SQLiteModelMethod method , MethodSpec . Builder methodBuilder ) { } }
JQLChecker jqlChecker = JQLChecker . getInstance ( ) ; final One < Boolean > usedInWhere = new One < Boolean > ( false ) ; methodBuilder . addCode ( "\n// display log\n" ) ; String sqlForLog = jqlChecker . replace ( method , method . jql , new JQLReplacerListenerImpl ( method ) { @ Override public String onColumnNameTo...
public class AbcParserAbstract { /** * Parse the { @ link Reader } and get the parsing tree by its root * { @ link AbcNode } . * @ param reader * @ see # getParseTree ( String ) the whole content of the reader is read as * String * @ throws IOException */ protected AbcNode getParseTree ( Reader reader ) throw...
StringWriter writer = new StringWriter ( ) ; char [ ] buffer = new char [ 32 * 1024 ] ; int n ; while ( ( n = reader . read ( buffer ) ) != - 1 ) { writer . write ( buffer , 0 , n ) ; } return getParseTree ( writer . toString ( ) ) ;
public class PortletDescriptorImpl { /** * Returns all < code > custom - window - state < / code > elements * @ return list of < code > custom - window - state < / code > */ public List < CustomWindowStateType < PortletDescriptor > > getAllCustomWindowState ( ) { } }
List < CustomWindowStateType < PortletDescriptor > > list = new ArrayList < CustomWindowStateType < PortletDescriptor > > ( ) ; List < Node > nodeList = model . get ( "custom-window-state" ) ; for ( Node node : nodeList ) { CustomWindowStateType < PortletDescriptor > type = new CustomWindowStateTypeImpl < PortletDescri...
public class ErrorCollector { /** * Adds an error to the message set , but does not cause a failure . The message is not required to have a source * line and column specified , but it is best practice to try and include that information . */ public void addErrorAndContinue ( Message message ) { } }
if ( this . errors == null ) { this . errors = new LinkedList ( ) ; } this . errors . add ( message ) ;
public class RequestContextExportingAppender { /** * Adds the specified { @ link AttributeKey } to the export list . * @ param alias the alias of the attribute to export * @ param attrKey the key of the attribute to export */ public void addAttribute ( String alias , AttributeKey < ? > attrKey ) { } }
ensureNotStarted ( ) ; builder . addAttribute ( alias , attrKey ) ;
public class CharsetToolkit { /** * Gets a < code > BufferedReader < / code > ( indeed a < code > LineNumberReader < / code > ) from the < code > File < / code > * specified in the constructor of < code > CharsetToolkit < / code > using the charset discovered or the default * charset if an 8 - bit < code > Charset ...
LineNumberReader reader = new LineNumberReader ( new InputStreamReader ( new FileInputStream ( file ) , getCharset ( ) ) ) ; if ( hasUTF8Bom ( ) || hasUTF16LEBom ( ) || hasUTF16BEBom ( ) ) { try { reader . read ( ) ; } catch ( IOException e ) { // should never happen , as a file with no content // but with a BOM has at...
public class DZcs_maxtrans { /** * find an augmenting path starting at column k and extend the match if found */ private static void cs_augment ( int k , DZcs A , int [ ] jmatch , int jmatch_offset , int [ ] cheap , int cheap_offset , int [ ] w , int w_offset , int [ ] js , int js_offset , int [ ] is , int is_offset , ...
int p , i = - 1 , Ap [ ] = A . p , Ai [ ] = A . i , head = 0 , j ; boolean found = false ; js [ js_offset + 0 ] = k ; /* start with just node k in jstack */ while ( head >= 0 ) { /* - - - Start ( or continue ) depth - first - search at node j - - - - - */ j = js [ js_offset + head ] ; /* get j from top of jstack */ if ...
public class ClassInfo { /** * ใƒ•ใ‚ฃใƒผใƒซใƒˆใ‚™ๅใ‚’ๆŒ‡ๅฎšใ—ใฆใƒ•ใ‚ฃใƒผใƒซใƒˆใ‚™ๆƒ…ๅ ฑใ‚’ๅ–ๅพ—ใ™ใ‚‹ ใ€‚ * @ param fieldName ใƒ•ใ‚ฃใƒผใƒซใƒˆใ‚™ๅ ใ€‚ * @ return ๆŒ‡ๅฎšใ—ใŸใƒ•ใ‚ฃใƒผใƒซใƒˆใ‚™ๅใ‹ใ‚™ๅญ˜ๅœจใ—ใชใ„ๅ ดๅˆใฏ ใ€ nullใ‚’่ฟ”ใ™ ใ€‚ */ public FieldInfo getFieldInfo ( final String fieldName ) { } }
for ( FieldInfo item : fieldInfos ) { if ( item . getFieldName ( ) . equals ( fieldName ) ) { return item ; } } return null ;
public class MultiUserChatManager { /** * Returns a List of the rooms where the requested user has joined . The Iterator will contain Strings where each * String represents a room ( e . g . room @ muc . jabber . org ) . * @ param user the user to check . A fully qualified xmpp ID , e . g . jdoe @ example . com . ...
// Send the disco packet to the user DiscoverItems result = serviceDiscoveryManager . discoverItems ( user , DISCO_NODE ) ; List < DiscoverItems . Item > items = result . getItems ( ) ; List < EntityBareJid > answer = new ArrayList < > ( items . size ( ) ) ; // Collect the entityID for each returned item for ( Discover...
public class ModelsImpl { /** * Update an entity role for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ param roleId The entity role ID . * @ param updateHierarchicalEntityRoleOptionalParameter the obje...
return updateHierarchicalEntityRoleWithServiceResponseAsync ( appId , versionId , hEntityId , roleId , updateHierarchicalEntityRoleOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Log { /** * Truncates the log up to the given index . * @ param index The index at which to truncate the log . * @ return The updated log . * @ throws IllegalStateException If the log is not open . * @ throws IndexOutOfBoundsException If the given index is not within the bounds of the log . */ publ...
assertIsOpen ( ) ; if ( index > 0 ) assertValidIndex ( index ) ; Assert . index ( index >= segments . commitIndex ( ) , "cannot truncate committed entries" ) ; if ( lastIndex ( ) == index ) return this ; for ( Segment segment : segments . reverseSegments ( ) ) { if ( segment . validIndex ( index ) ) { segment . truncat...
public class JobPreconditions { /** * Check the requested flags , throwing if any requested flags are outside * the allowed set . */ public static void checkFlagsArgument ( final int requestedFlags , final int allowedFlags ) { } }
if ( ( requestedFlags & allowedFlags ) != requestedFlags ) { throw new IllegalArgumentException ( "Requested flags 0x" + Integer . toHexString ( requestedFlags ) + ", but only 0x" + Integer . toHexString ( allowedFlags ) + " are allowed" ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcSegmentIndexSelect ( ) { } }
if ( ifcSegmentIndexSelectEClass == null ) { ifcSegmentIndexSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1156 ) ; } return ifcSegmentIndexSelectEClass ;
public class BufferBitSetUtil { /** * word */ private static MappeableArrayContainer arrayContainerOf ( final int from , final int to , final int cardinality , final long [ ] words ) { } }
// precondition : cardinality is max 4096 final short [ ] content = new short [ cardinality ] ; int index = 0 ; for ( int i = from , socket = 0 ; i < to ; ++ i , socket += Long . SIZE ) { long word = words [ i ] ; while ( word != 0 ) { content [ index ++ ] = ( short ) ( socket + numberOfTrailingZeros ( word ) ) ; word ...
public class NameSpace { /** * Import a class name . Subsequent imports override earlier ones * @ param name the name */ public void importClass ( final String name ) { } }
this . importedClasses . put ( Name . suffix ( name , 1 ) , name ) ; this . nameSpaceChanged ( ) ;
public class Subtypes2 { /** * Add an application class , and its transitive supertypes , to the * inheritance graph . * @ param appXClass * application XClass to add to the inheritance graph */ public void addApplicationClass ( XClass appXClass ) { } }
for ( XMethod m : appXClass . getXMethods ( ) ) { if ( m . isStub ( ) ) { return ; } } ClassVertex vertex = addClassAndGetClassVertex ( appXClass ) ; vertex . markAsApplicationClass ( ) ;
public class StorableGenerator { /** * Loads the property value of the current storable onto the stack . If the * property is derived the read method is used , otherwise it just loads the * value from the appropriate field . * entry stack : [ * exit stack : [ value * @ param b - { @ link CodeBuilder } to whic...
b . loadThis ( ) ; if ( property . isDerived ( ) ) { b . invoke ( property . getReadMethod ( ) ) ; } else { b . loadField ( property . getName ( ) , type ) ; }
public class EJBThreadData { /** * Sets the thread context class loader for the specified bean metadata , and * saves the current thread context class loader . */ public void pushClassLoader ( BeanMetaData bmd ) { } }
ClassLoader classLoader = bmd . ivContextClassLoader ; // F85059 Object origCL = svThreadContextAccessor . pushContextClassLoaderForUnprivileged ( classLoader ) ; ivClassLoaderStack . push ( origCL ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "pushClassLoader: " + ( o...
public class BaseDaoEnabled { /** * A call through to the { @ link Dao # delete ( Object ) } . */ public int delete ( ) throws SQLException { } }
checkForDao ( ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return dao . delete ( t ) ;
public class DatabaseException { /** * Return the error message . */ public String getMessage ( Task task ) { } }
String strError = null ; switch ( m_iErrorCode ) { case DBConstants . NORMAL_RETURN : strError = "Normal return" ; break ; // Never case DBConstants . END_OF_FILE : strError = "End of file" ; break ; case DBConstants . KEY_NOT_FOUND : strError = "Key not found" ; break ; case DBConstants . DUPLICATE_KEY : strError = "D...
public class LongPipeline { /** * Stateful intermediate ops from LongStream */ @ Override public final LongStream limit ( long maxSize ) { } }
if ( maxSize < 0 ) throw new IllegalArgumentException ( Long . toString ( maxSize ) ) ; return SliceOps . makeLong ( this , 0 , maxSize ) ;
public class SpringSecurityXmAuthenticationContext { /** * { @ inheritDoc } */ @ Override public boolean isAnonymous ( ) { } }
return getAuthentication ( ) . filter ( auth -> ANONYMOUS_AUTH_CLASS . isAssignableFrom ( auth . getClass ( ) ) ) . isPresent ( ) ;
public class ScriptRuntime { /** * Prepare for calling name ( . . . ) : return function corresponding to * name and make current top scope available * as ScriptRuntime . lastStoredScriptable ( ) for consumption as thisObj . * The caller must call ScriptRuntime . lastStoredScriptable ( ) immediately * after call...
Scriptable parent = scope . getParentScope ( ) ; if ( parent == null ) { Object result = topScopeName ( cx , scope , name ) ; if ( ! ( result instanceof Callable ) ) { if ( result == Scriptable . NOT_FOUND ) { throw notFoundError ( scope , name ) ; } throw notFunctionError ( result , name ) ; } // Top scope is not Nati...
public class CmsPublishRelationFinder { /** * Fetches the directly related resources for a given resource . < p > * @ param currentResource the resource for which to get the related resources * @ return the directly related resources */ private Set < CmsResource > getDirectlyRelatedResources ( CmsResource currentRe...
Set < CmsResource > directlyRelatedResources = Sets . newHashSet ( ) ; List < CmsRelation > relations = getRelationsFromResource ( currentResource ) ; for ( CmsRelation relation : relations ) { LOG . info ( "Trying to read resource for relation " + relation . getTargetPath ( ) ) ; CmsResource target = getResource ( rel...
public class CmsUploadHookDialog { /** * Opens a new upload property dialog . < p > * @ param title the title for the dialog popup * @ param hookUri the URI of the upload hook page * @ param uploadedFiles the uploaded files * @ param closeHandler the dialog close handler */ public static void openDialog ( Strin...
if ( hookUri . startsWith ( "#" ) ) { List < CmsUUID > resourceIds = new ArrayList < CmsUUID > ( ) ; if ( uploadedFiles != null ) { for ( String id : uploadedFiles ) { resourceIds . add ( new CmsUUID ( id ) ) ; } } CmsEmbeddedDialogHandler handler = new CmsEmbeddedDialogHandler ( new I_CmsActionHandler ( ) { public voi...
public class EntityDataModelUtil { /** * Checks if the specified OData type is a complex type and throws an exception if it is not . * @ param type The OData type . * @ return The OData type . * @ throws ODataSystemException If the OData type is not a complex type . */ public static ComplexType checkIsComplexType...
if ( ! isComplexType ( type ) ) { throw new ODataSystemException ( "A complex type is required, but '" + type . getFullyQualifiedName ( ) + "' is not a complex type: " + type . getMetaType ( ) ) ; } return ( ComplexType ) type ;
public class MenuExtensions { /** * Sets the accelerator for the given menuitem and the given key char and the given modifiers . * @ param jmi * The JMenuItem . * @ param keyChar * the key char * @ param modifiers * the modifiers */ public static void setAccelerator ( final JMenuItem jmi , final Character k...
jmi . setAccelerator ( KeyStroke . getKeyStroke ( keyChar , modifiers ) ) ;
public class LogManager { /** * readConfiguration , and other methods . */ Logger demandLogger ( String name , String resourceBundleName , Class < ? > caller ) { } }
Logger result = getLogger ( name ) ; if ( result == null ) { // only allocate the new logger once Logger newLogger = new Logger ( name , resourceBundleName , caller ) ; do { if ( addLogger ( newLogger ) ) { // We successfully added the new Logger that we // created above so return it without refetching . return newLogg...
public class A_CmsLoginField { /** * @ see com . vaadin . client . ui . VTextField # updateFieldContent ( java . lang . String ) * We have to override this method to prevent its value being overwritten by Vaadin and to make * sure that the real value is sent to the server . */ @ Override public void updateFieldCont...
if ( ! m_initialUpdateCalled ) { m_initialUpdateCalled = true ; if ( "" . equals ( text ) ) { valueChange ( false ) ; Scheduler . get ( ) . scheduleFixedDelay ( new RepeatingCommand ( ) { public boolean execute ( ) { if ( isAttached ( ) ) { valueChange ( false ) ; return true ; } else { return false ; } } } , 100 ) ; r...
public class LocaleFactoryProvider { /** * Create the resource using the Locale provided . If the locale is null , the locale is retrieved from the * LocaleProvider in LocaleProxy . * @ param cls localization interface class * @ param < T > localization interface class * @ param locale locale string * @ retur...
Locale l = null ; if ( locale != null ) { String [ ] parts = locale . split ( "_" , 3 ) ; l = new Locale ( parts [ 0 ] , parts . length > 1 ? parts [ 1 ] : "" , parts . length > 2 ? parts [ 2 ] : "" ) ; } return LocaleProxy . create ( cls , l ) ;
public class DataExpressionHandler { /** * { @ inheritDoc } */ @ Override public List < ConfigMessage > init ( Processor processor , ProcessorAction action , boolean predicate ) { } }
DataExpression expr = ( DataExpression ) getExpression ( ) ; source = expr . getSource ( ) ; key = expr . getKey ( ) ; if ( source == DataSource . Content ) { index = Integer . parseInt ( key ) ; } return new ArrayList < > ( ) ;
public class Reader { /** * Method to read our client ' s plain text * @ param file _ name * @ return the filereader to translate client ' s plain text into our files * @ throws BeastException * if any problem is found whit the file */ protected static BufferedReader createFileReader ( String file_name ) throws...
try { return new BufferedReader ( new FileReader ( file_name ) ) ; } catch ( FileNotFoundException e ) { Logger logger = Logger . getLogger ( MASReader . class . getName ( ) ) ; logger . severe ( "ERROR: " + e . toString ( ) ) ; throw new BeastException ( "ERROR: " + e . toString ( ) , e ) ; }
public class YarnSubmissionParametersFileGenerator { /** * Writes driver configuration to disk . * @ param yarnClusterSubmissionFromCS the information needed to submit encode YARN parameters and create the * YARN job for submission from the cluster . * @ throws IOException */ public void writeConfiguration ( fina...
final File yarnAppParametersFile = new File ( yarnClusterSubmissionFromCS . getDriverFolder ( ) , fileNames . getYarnBootstrapAppParamFilePath ( ) ) ; final File yarnJobParametersFile = new File ( yarnClusterSubmissionFromCS . getDriverFolder ( ) , fileNames . getYarnBootstrapJobParamFilePath ( ) ) ; try ( final FileOu...
public class MapperComplex { /** * Convert an item from a list into a class using the classes constructor . * REFACTOR : Can ' t this just be from collection ? * REFACTOR * @ param argList list if arguments * @ param clazz the type of the object we are creating * @ param < T > generics * @ return the new ob...
/* Size of the arguments . */ int size = argList . size ( ) ; /* Meta data holder of the class . */ ClassMeta < T > classMeta = ClassMeta . classMeta ( clazz ) ; /* The constructor to match . */ ConstructorAccess < T > constructorToMatch = null ; /* The final arguments . */ Object [ ] finalArgs = null ; boolean [ ] fla...
public class JCalRawWriter { /** * Writes a property to the current component . * @ param propertyName the property name ( e . g . " version " ) * @ param dataType the property ' s data type ( e . g . " text " ) * @ param value the property value * @ throws IllegalStateException if there are no open components ...
writeProperty ( propertyName , new ICalParameters ( ) , dataType , value ) ;
public class FaultManager { /** * Notify the fault manager of a new node . * @ param name The node name . * @ param resourceTypes The types of resource on this node . */ public void addNode ( String name , Set < ResourceType > resourceTypes ) { } }
List < FaultStatsForType > faultStats = new ArrayList < FaultStatsForType > ( resourceTypes . size ( ) ) ; for ( ResourceType type : resourceTypes ) { faultStats . add ( new FaultStatsForType ( type ) ) ; } nodeToFaultStats . put ( name , faultStats ) ;
class RepresentableAsPowers { /** * A function to verify if the supplied number can be expressed as the sum of non - zero powers of 2. * Examples : * RepresentableAsPowers . isRepresentableAsPowersOfTwo ( 10 ) - > true * RepresentableAsPowers . isRepresentableAsPowersOfTwo ( 7 ) - > false * RepresentableAsPower...
return num % 2 == 0 ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link QuantityExtentType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link QuantityExtentType } { @ code...
return new JAXBElement < QuantityExtentType > ( _QuantityExtent_QNAME , QuantityExtentType . class , null , value ) ;
public class LdapIdentityStoreDefinitionWrapper { /** * Evaluate and return the callerBaseDn . * @ param immediateOnly If true , only return a non - null value if the setting is either an * immediate EL expression or not set by an EL expression . If false , return the * value regardless of where it is evaluated ....
try { return elHelper . processString ( "callerBaseDn" , this . idStoreDefinition . callerBaseDn ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "call...
public class SchemaService { /** * Check that this tenant , its applications , and storage managers are available . */ private void checkTenantApps ( Tenant tenant ) { } }
m_logger . info ( " Tenant: {}" , tenant . getName ( ) ) ; try { Iterator < DRow > rowIter = DBService . instance ( tenant ) . getAllRows ( SchemaService . APPS_STORE_NAME ) . iterator ( ) ; if ( ! rowIter . hasNext ( ) ) { m_logger . info ( " <no applications>" ) ; } while ( rowIter . hasNext ( ) ) { DRow row =...
public class Where { /** * Add a IN clause which makes sure the column is in one of the columns returned from a sub - query inside of * parenthesis . The QueryBuilder must return 1 and only one column which can be set with the * { @ link QueryBuilder # selectColumns ( String . . . ) } method calls . That 1 argument...
return in ( true , columnName , subQueryBuilder ) ;
public class CommonExprTransformer { /** * < p > options . < / p > * @ param operator a { @ link java . lang . String } object . * @ param args an array of { @ link ameba . db . dsl . QueryExprMeta . Val } objects . * @ param parent a { @ link ameba . db . dsl . QueryExprMeta } object . * @ return a { @ link io...
if ( args . length < 1 ) { throw new QuerySyntaxException ( Messages . get ( "dsl.arguments.error2" , operator , 0 ) ) ; } if ( parent == null ) { throw new QuerySyntaxException ( Messages . get ( "dsl.arguments.error5" , operator ) ) ; } TextOptionsExpression op = new TextOptionsExpression ( ) ; for ( Val v : args ) {...
public class CommerceShippingMethodLocalServiceBaseImpl { /** * Adds the commerce shipping method to the database . Also notifies the appropriate model listeners . * @ param commerceShippingMethod the commerce shipping method * @ return the commerce shipping method that was added */ @ Indexable ( type = IndexableTy...
commerceShippingMethod . setNew ( true ) ; return commerceShippingMethodPersistence . update ( commerceShippingMethod ) ;
public class WebCrawler { /** * Classes that extends WebCrawler should overwrite this function to tell the * crawler whether the given url should be crawled or not . The following * default implementation indicates that all urls should be included in the crawl * except those with a nofollow flag . * @ param url...
if ( myController . getConfig ( ) . isRespectNoFollow ( ) ) { return ! ( ( referringPage != null && referringPage . getContentType ( ) != null && referringPage . getContentType ( ) . contains ( "html" ) && ( ( HtmlParseData ) referringPage . getParseData ( ) ) . getMetaTagValue ( "robots" ) . contains ( "nofollow" ) ) ...
public class CBCBlockCipher { /** * Encrypting data * @ param iv initialization vector * @ param data data for encryption * @ return encrypted data */ public byte [ ] encrypt ( byte [ ] iv , byte [ ] data ) throws IntegrityException { } }
if ( data . length % blockSize != 0 ) { throw new IntegrityException ( "Incorrect data size" ) ; } if ( iv . length != blockSize ) { throw new IntegrityException ( "Incorrect iv size" ) ; } byte [ ] res = new byte [ data . length ] ; encrypt ( iv , data , res ) ; return res ;
public class AbstractEventSource { /** * This method sends the given { @ code event } to all { @ link # addListener ( EventListener ) registered } listeners . * @ param event the event to set . */ protected void fireEvent ( E event ) { } }
for ( L listener : this . listeners ) { try { fireEvent ( event , listener ) ; } catch ( RuntimeException e ) { handleListenerError ( listener , event , e ) ; } }
public class Barrier { /** * Returns the entity group parent of a Barrier of the specified type . * According to our < a href = " http : / / goto / java - pipeline - model " > transactional * model < / a > : If B is the finalize barrier of a Job J , then the entity group * parent of B is J . Run barriers do not h...
switch ( type ) { case RUN : return null ; case FINALIZE : if ( null == jobKey ) { throw new IllegalArgumentException ( "jobKey is null" ) ; } break ; } return jobKey ;
public class ImplicitDenyMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ImplicitDeny implicitDeny , ProtocolMarshaller protocolMarshaller ) { } }
if ( implicitDeny == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( implicitDeny . getPolicies ( ) , POLICIES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) ,...
public class BsonConvert { /** * - - - - - convertFrom - - - - - */ public < T > T convertFrom ( final Type type , final byte [ ] bytes ) { } }
if ( bytes == null ) return null ; return convertFrom ( type , bytes , 0 , bytes . length ) ;
public class ImageUtils { /** * A convenience method for setting ARGB pixels in an image . This tries to avoid the performance * penalty of BufferedImage . setRGB unmanaging the image . * @ param image a BufferedImage object * @ param x the left edge of the pixel block * @ param y the right edge of the pixel bl...
int type = image . getType ( ) ; if ( type == BufferedImage . TYPE_INT_ARGB || type == BufferedImage . TYPE_INT_RGB ) image . getRaster ( ) . setDataElements ( x , y , width , height , pixels ) ; else image . setRGB ( x , y , width , height , pixels , 0 , width ) ;
public class Resolver { public File resolve ( Node classpathBase , Resource resource ) throws IOException { } }
Base base ; Node baseResolved ; Node normal ; String minimizedPath ; Node minimized ; base = resource . getBase ( ) ; if ( base == Base . CLASSPATH ) { baseResolved = classpathBase ; } else { baseResolved = bases . get ( base ) ; } if ( baseResolved == null ) { throw new IllegalStateException ( "unknown base: " + base ...
public class SynchronizableRegistryImpl { /** * { @ inheritDoc } */ @ Override public void notifySynchronization ( ) { } }
try { synchronisationObservable . notifyObservers ( System . currentTimeMillis ( ) ) ; } catch ( CouldNotPerformException ex ) { ExceptionPrinter . printHistory ( new CouldNotPerformException ( "Could not notify observer about synchronization" , ex ) , logger ) ; }
public class XMLSerializer { /** * simple utility method - - good for debugging . * @ param s the s * @ return the string */ protected static final String printable ( String s ) { } }
if ( s == null ) return "null" ; StringBuffer retval = new StringBuffer ( s . length ( ) + 16 ) ; retval . append ( "'" ) ; @ SuppressWarnings ( "unused" ) char ch ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { addPrintable ( retval , s . charAt ( i ) ) ; } retval . append ( "'" ) ; return retval . toString ( ) ;
public class LhsBuilder { /** * If the type of the column is either FieldType . SINGLE _ FIELD or FieldType . OPERATOR _ FIELD we have * added quotation - marks around the template parameter . Consequentially if a cell value included the * quotation - marks ( i . e . for an empty - string or white - space ) we need...
String _value = value ; final FieldType fieldType = this . fieldTypes . get ( column ) ; if ( fieldType == FieldType . NORMAL_FIELD || ! isMultipleConstraints ( ) || isForAll ( ) ) { return value ; } if ( isDelimitedString ( _value ) ) { _value = _value . substring ( 1 , _value . length ( ) - 1 ) ; } return _value ;
public class Lists { /** * Convenience method for building a list from an array * @ param array * @ param < T > list type * @ return a new list created from var args */ public static < T > List < T > arrayToList ( T [ ] array ) { } }
return new ArrayList < T > ( Arrays . asList ( array ) ) ;
public class FullDTDReader { /** * Internal methods , conditional blocks : */ private void checkInclusion ( ) throws XMLStreamException { } }
String keyword ; // INCLUDE / IGNORE not allowed in internal subset . . . /* 18 - Jul - 2004 , TSa : Except if it ' s in an expanded parsed external * entity . . . */ if ( ! mIsExternal && mInput == mRootInput ) { _reportWFCViolation ( "Internal DTD subset can not use (INCLUDE/IGNORE) directives (except via external ...
public class ExtendedProperties { /** * Returns a new { @ link java . util . Properties } instance representing the properties . * @ return The properties */ public Properties toProperties ( ) { } }
Properties props = new Properties ( ) ; // We need to iterate over the keys calling // getProperty in order to consider defaults . for ( String key : keySet ( ) ) { props . put ( key , get ( key ) ) ; } return props ;
public class EhcacheManager { /** * adjusts the config to reflect new classloader & serialization provider */ private < K , V > CacheConfiguration < K , V > adjustConfigurationWithCacheManagerDefaults ( String alias , CacheConfiguration < K , V > config ) { } }
ClassLoader cacheClassLoader = config . getClassLoader ( ) ; List < ServiceConfiguration < ? > > configurationList = new ArrayList < > ( ) ; configurationList . addAll ( config . getServiceConfigurations ( ) ) ; CacheLoaderWriterConfiguration loaderWriterConfiguration = findSingletonAmongst ( CacheLoaderWriterConfigura...
public class ListModelUpdateBehavior { /** * Factory method to create a new { @ link ListModelUpdateBehavior } object . * @ param < T > * the generic type of the model * @ param model * the list model * @ return the new { @ link ListModelUpdateBehavior } object */ public static < T extends Serializable > List...
return new ListModelUpdateBehavior < > ( model ) ;
public class RemoveAttributesFromFindingsRequest { /** * The ARNs that specify the findings that you want to remove attributes from . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setFindingArns ( java . util . Collection ) } or { @ link # withFindingArns (...
if ( this . findingArns == null ) { setFindingArns ( new java . util . ArrayList < String > ( findingArns . length ) ) ; } for ( String ele : findingArns ) { this . findingArns . add ( ele ) ; } return this ;
public class AWSApplicationDiscoveryClient { /** * Deletes one or more import tasks , each identified by their import ID . Each import task has a number of records * that can identify servers or applications . * AWS Application Discovery Service has built - in matching logic that will identify when discovered serve...
request = beforeClientExecution ( request ) ; return executeBatchDeleteImportData ( request ) ;
public class Expressive { /** * Wait until a polled sample of the feature is { @ code true } . * Uses a default ticker . */ public < S > void waitUntil ( S subject , Feature < ? super S , Boolean > feature ) { } }
waitUntil ( subject , feature , eventually ( ) , isQuietlyTrue ( ) ) ;
public class UTF16 { /** * Returns a new UTF16 format Unicode string resulting from replacing all occurrences of * oldChar32 in source with newChar32 . If the character oldChar32 does not occur in the UTF16 * format Unicode string source , then source will be returned . Otherwise , a new String object is * create...
if ( oldChar32 <= 0 || oldChar32 > CODEPOINT_MAX_VALUE ) { throw new IllegalArgumentException ( "Argument oldChar32 is not a valid codepoint" ) ; } if ( newChar32 <= 0 || newChar32 > CODEPOINT_MAX_VALUE ) { throw new IllegalArgumentException ( "Argument newChar32 is not a valid codepoint" ) ; } int index = indexOf ( so...
public class AbcGrammar { /** * xcom - vskip : : = " vskip " 1 * WSP xcom - number xcom - unit */ Rule XcomVskip ( ) { } }
return Sequence ( String ( "vskip" ) , OneOrMore ( WSP ( ) ) , XcomNumber ( ) , XcomUnit ( ) ) . label ( XcomVskip ) ;
public class EffectUtils { /** * < p > Blurs the source pixels into the destination pixels . The force of the * blur is specified by the radius which must be greater than 0 . < / p > * < p > The source and destination pixels arrays are expected to be in the * INT _ ARGB format . < / p > * < p > After this metho...
float a ; float r ; float g ; float b ; int ca ; int cr ; int cg ; int cb ; for ( int y = 0 ; y < height ; y ++ ) { int index = y ; int offset = y * width ; for ( int x = 0 ; x < width ; x ++ ) { a = r = g = b = 0.0f ; for ( int i = - radius ; i <= radius ; i ++ ) { int subOffset = x + i ; if ( subOffset < 0 || subOffs...
public class Counters { /** * Returns the product of c1 and c2. * @ return The product of c1 and c2. */ public static < E > double dotProduct ( Counter < E > c1 , Counter < E > c2 ) { } }
double dotProd = 0.0 ; if ( c1 . size ( ) > c2 . size ( ) ) { Counter < E > tmpCnt = c1 ; c1 = c2 ; c2 = tmpCnt ; } for ( E key : c1 . keySet ( ) ) { double count1 = c1 . getCount ( key ) ; if ( Double . isNaN ( count1 ) || Double . isInfinite ( count1 ) ) { throw new RuntimeException ( "Counters.dotProduct infinite or...
public class TimerTrace { /** * Create and start a performance profiling with the < code > name < / code > given . Deal with * profile hierarchy automatically , so caller don ' t have to be concern about it . * @ param name profile name */ public static void start ( String name ) { } }
if ( ! active ) return ; TimerNode root = new TimerNode ( name , System . currentTimeMillis ( ) ) ; TimerStack stack = ( TimerStack ) curStack . get ( ) ; if ( null == stack ) curStack . set ( new TimerStack ( root ) ) ; else stack . push ( root ) ;
public class FrenchRepublicanCalendar { /** * / * [ deutsch ] * < p > Erh & auml ; lt eine alternative Datumssicht spezifisch f & uuml ; r den angegebenen Algorithmus . < / p > * @ param algorithm calendar computation * @ return French republican date ( possibly modified ) * @ throws IllegalArgumentException in...
if ( algorithm == DEFAULT_ALGORITHM ) { return new Date ( this , DEFAULT_ALGORITHM ) ; } long utcDays = DEFAULT_ALGORITHM . transform ( this ) ; return new Date ( algorithm . transform ( utcDays ) , algorithm ) ;
public class IMatrix { /** * Multiplikation from two matrices */ public void mul ( IMatrix b , IMatrix result ) { } }
if ( ( b == null ) || ( columns != b . rows ) ) return ; if ( ( result . rows != rows ) || ( result . columns != b . columns ) ) result . reshape ( rows , b . columns ) ; int i , j , k ; double realsum , imagsum ; for ( i = 0 ; i < rows ; i ++ ) for ( k = 0 ; k < b . columns ; k ++ ) { realsum = 0 ; imagsum = 0 ; for (...
public class ChainImpl { /** * { @ inheritDoc } */ @ Override public Group getGroupByPDB ( ResidueNumber resNum ) throws StructureException { } }
String pdbresnum = resNum . toString ( ) ; if ( pdbResnumMap . containsKey ( pdbresnum ) ) { Integer pos = pdbResnumMap . get ( pdbresnum ) ; return groups . get ( pos ) ; } else { throw new StructureException ( "unknown PDB residue number " + pdbresnum + " in chain " + authId ) ; }
public class Converter { /** * / / / / Revision */ static Revision convert ( com . linecorp . centraldogma . common . Revision rev ) { } }
return RevisionConverter . TO_DATA . convert ( rev ) ;
public class UserRecordTeamAssociation { /** * Gets the defaultTeamAccessType value for this UserRecordTeamAssociation . * @ return defaultTeamAccessType * The default team access type { @ link Team # teamAccessType } . This * field is * read - only and is populated by Google . */ public com . google . api . ads ...
return defaultTeamAccessType ;
public class FileIoUtil { /** * Reads a file and returns it ' s content as string . * @ param _ file * @ return */ public static String readFileToString ( String _file ) { } }
List < String > localText = getTextfileFromUrl ( _file ) ; if ( localText == null ) { return null ; } return StringUtil . join ( guessLineTerminatorOfFile ( _file ) , localText ) ;
public class EncodingUtilsImpl { /** * Extract the locales from a passed in language list . * @ param allLangs * @ return List < Locale > */ private List < Locale > extractLocales ( List < List < String > > allLangs ) { } }
List < Locale > rc = new ArrayList < Locale > ( ) ; for ( List < String > langList : allLangs ) { for ( String language : langList ) { String country = "" ; String variant = "" ; int countryIndex = language . indexOf ( '-' ) ; if ( countryIndex > - 1 ) { int variantIndex = language . indexOf ( '-' , ( countryIndex + 1 ...
public class FileChooserAdaptor { /** * You must provide fileFilter , idFolderStart and title to invoke it ! */ @ Override public void showAndChoose ( IConsumer < File > consumer ) { } }
this . consumer = consumer ; initSrvNodeFile ( ) ; Intent activityTreeIntent = new Intent ( activity , ActivityTreeChooser . class ) ; activityTreeIntent . putExtra ( FragmentNodes . ARG_ID_NODE_SRVNODES , new String [ ] { idFolderStart , idSrvGetNodeFile , idCommand , title } ) ; activity . startActivityForResult ( ac...