signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PathImpl { /** * Looks up all the existing resources . ( Generally only useful * with MergePath . */ public ArrayList < PathImpl > getResources ( ) { } }
ArrayList < PathImpl > list = new ArrayList < PathImpl > ( ) ; // if ( exists ( ) ) list . add ( this ) ; return list ;
public class CmsAliasView { /** * The event handler for the button for adding new rewrite aliases . < p > * @ param e the click event */ @ UiHandler ( "m_newRewriteButton" ) void onClickNewRewrite ( ClickEvent e ) { } }
String rewriteRegex = m_newRewriteRegex . getText ( ) ; String rewriteReplacement = m_newRewriteReplacement . getText ( ) ; String mode = m_newRewriteMode . getFormValueAsString ( ) ; m_controller . editNewRewrite ( rewriteRegex , rewriteReplacement , CmsAliasMode . valueOf ( mode ) ) ;
public class CommerceAccountUtil { /** * Removes the commerce account with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceAccountId the primary key of the commerce account * @ return the commerce account that was removed * @ throws NoSuchAccountException if a...
return getPersistence ( ) . remove ( commerceAccountId ) ;
public class UrlCopy { /** * This method is an implementation of the { @ link Runnable } interface * and can be used to perform the copy in a separate thread . * This method will perform the transfer and signal completion and * errors through the { @ link UrlCopyListener # transferCompleted ( ) } and * { @ link...
try { copy ( ) ; } catch ( Exception e ) { if ( listeners != null ) { Iterator iter = listeners . iterator ( ) ; while ( iter . hasNext ( ) ) { ( ( UrlCopyListener ) iter . next ( ) ) . transferError ( e ) ; } } } finally { if ( listeners != null ) { Iterator iter = listeners . iterator ( ) ; while ( iter . hasNext ( )...
public class CmsContentService { /** * Returns the entity id to the given content value . < p > * @ param contentValue the content value * @ return the entity id */ public static String getEntityId ( I_CmsXmlContentValue contentValue ) { } }
String result = CmsContentDefinition . uuidToEntityId ( contentValue . getDocument ( ) . getFile ( ) . getStructureId ( ) , contentValue . getLocale ( ) . toString ( ) ) ; String valuePath = contentValue . getPath ( ) ; if ( valuePath . contains ( "/" ) ) { result += "/" + valuePath . substring ( 0 , valuePath . lastIn...
public class JsScriptExecutor { /** * Executes the given JavaScript , e . g . ' var product = 2 * 3 ; return product ; ' * @ param jsScript JavaScript * @ return value of which the type depends on the JavaScript type of the returned variable */ Object executeScript ( String jsScript ) { } }
String jsScriptWithFunction = "(function (){" + jsScript + "})();" ; try { return jsScriptEngine . eval ( jsScriptWithFunction ) ; } catch ( ScriptException e ) { throw new org . molgenis . script . core . ScriptException ( e ) ; }
public class PropertiesLoader { /** * Load { @ link Config } from ' file ' but do not resolve it . */ static Config loadOvercastConfigFromFile ( String file ) { } }
if ( file == null ) { return ConfigFactory . empty ( ) ; } File f = new File ( file ) ; if ( ! f . exists ( ) ) { logger . warn ( "File {} not found." , f . getAbsolutePath ( ) ) ; return ConfigFactory . empty ( ) ; } logger . info ( "Loading from file {}" , f . getAbsolutePath ( ) ) ; return ConfigFactory . parseFile ...
public class AppServicePlansInner { /** * Get the maximum number of Hybrid Connections allowed in an App Service plan . * Get the maximum number of Hybrid Connections allowed in an App Service plan . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the ...
return getHybridConnectionPlanLimitWithServiceResponseAsync ( resourceGroupName , name ) . map ( new Func1 < ServiceResponse < HybridConnectionLimitsInner > , HybridConnectionLimitsInner > ( ) { @ Override public HybridConnectionLimitsInner call ( ServiceResponse < HybridConnectionLimitsInner > response ) { return resp...
public class Membership { /** * Adds a new member to this membership . If the member already exist ( Address . equals ( Object ) * returns true then the member will not be added to the membership */ public Membership add ( Address new_member ) { } }
synchronized ( members ) { if ( new_member != null && ! members . contains ( new_member ) ) { members . add ( new_member ) ; } } return this ;
public class ArrayUtil { /** * 包装类数组转为原始类型数组 * @ param values 包装类型数组 * @ return 原始类型数组 */ public static short [ ] unWrap ( Short ... values ) { } }
if ( null == values ) { return null ; } final int length = values . length ; if ( 0 == length ) { return new short [ 0 ] ; } final short [ ] array = new short [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { array [ i ] = values [ i ] . shortValue ( ) ; } return array ;
public class View { /** * Enables the automatic layout for this view , with some default settings . * @ param enable a boolean */ public void setAutomaticLayout ( boolean enable ) { } }
if ( enable ) { this . setAutomaticLayout ( AutomaticLayout . RankDirection . TopBottom , 300 , 600 , 200 , false ) ; } else { this . automaticLayout = null ; }
public class AbstractLocation { /** * Iterates through all known sub - locations for this location but does * not descend */ @ Override public Iterator < Location > iterator ( ) { } }
List < Location > list ; if ( isComplex ( ) ) { list = getSubLocations ( ) ; } else { list = new ArrayList < Location > ( ) ; list . add ( this ) ; } return list . iterator ( ) ;
public class RBBIRuleScanner { void findSetFor ( String s , RBBINode node , UnicodeSet setToAdopt ) { } }
RBBISetTableEl el ; // First check whether we ' ve already cached a set for this string . // If so , just use the cached set in the new node . // delete any set provided by the caller , since we own it . el = fSetTable . get ( s ) ; if ( el != null ) { node . fLeftChild = el . val ; Assert . assrt ( node . fLeftChild ....
public class GISCoordinates { /** * This function convert WSG84 GPS coordinate to one of the NTF Lambda - Phi coordinate . * @ param lambda is the WSG94 coordinate in decimal degrees . * @ param phi is the WSG84 coordinate is decimal in degrees . * @ param n is the exponential of the Lambert projection . * @ pa...
"checkstyle:parametername" , "checkstyle:magicnumber" , "checkstyle:localfinalvariablename" , "checkstyle:localvariablename" } ) private static Point2d WSG84_NTFLamdaPhi ( double lambda , double phi ) { // 0 ) degree - > radian final double lambda_w = Math . toRadians ( lambda ) ; final double phi_w = Math . toRadians ...
public class JSONSerializer { /** * Creates a JSONObject , JSONArray or a JSONNull from object . < br > * Accepts JSON formatted strings , Maps , arrays , Collections , DynaBeans and * JavaBeans . * @ param object any java Object * @ param jsonConfig additional configuration * @ throws JSONException if the ob...
JSON json = null ; if ( object == null ) { json = JSONNull . getInstance ( ) ; } else if ( object instanceof JSONString ) { json = toJSON ( ( JSONString ) object , jsonConfig ) ; } else if ( object instanceof String ) { json = toJSON ( ( String ) object , jsonConfig ) ; } else if ( JSONUtils . isArray ( object ) ) { js...
public class BureauRegistry { /** * Check the credentials to make sure this is one of our bureaus . * @ return null if all ' s well , otherwise a string describing the authentication failure */ public String checkToken ( BureauCredentials creds ) { } }
Bureau bureau = _bureaus . get ( creds . clientId ) ; if ( bureau == null ) { return "Bureau " + creds . clientId + " not found" ; } if ( bureau . clientObj != null ) { return "Bureau " + creds . clientId + " already logged in" ; } if ( ! creds . areValid ( bureau . token ) ) { return "Bureau " + creds . clientId + " d...
public class XAResourceRecoveryImpl { /** * Open a managed connection * @ param s The subject * @ return The managed connection * @ exception ResourceException Thrown in case of an error */ @ SuppressWarnings ( "unchecked" ) private ManagedConnection open ( Subject s ) throws ResourceException { } }
log . debugf ( "Open managed connection (%s)" , s ) ; if ( recoverMC == null ) recoverMC = mcf . createManagedConnection ( s , null ) ; if ( plugin == null ) { try { ValidatingManagedConnectionFactory vmcf = ( ValidatingManagedConnectionFactory ) mcf ; Set connectionSet = new HashSet ( 1 ) ; connectionSet . add ( recov...
public class JenkinsHash { /** * gather an int from the specified index into the byte array */ private static final int gatherIntLE ( final byte [ ] data , final int index ) { } }
int i = data [ index ] & 0xFF ; i |= ( data [ index + 1 ] & 0xFF ) << 8 ; i |= ( data [ index + 2 ] & 0xFF ) << 16 ; i |= ( data [ index + 3 ] << 24 ) ; return i ;
public class TableSchema { /** * Creates a table schema from a { @ link TypeInformation } instance . If the type information is * a { @ link CompositeType } , the field names and types for the composite type are used to * construct the { @ link TableSchema } instance . Otherwise , a table schema with a single field...
if ( typeInfo instanceof CompositeType < ? > ) { final CompositeType < ? > compositeType = ( CompositeType < ? > ) typeInfo ; // get field names and types from composite type final String [ ] fieldNames = compositeType . getFieldNames ( ) ; final TypeInformation < ? > [ ] fieldTypes = new TypeInformation [ fieldNames ....
public class CmsVfsIndexer { /** * Updates a resource with the given index writer and the new document provided . < p > * @ param indexWriter the index writer to update the resource with * @ param rootPath the root path of the resource to update * @ param doc the new document for the resource */ protected void up...
try { indexWriter . updateDocument ( rootPath , doc ) ; } catch ( Exception e ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IO_INDEX_DOCUMENT_UPDATE_2 , rootPath , m_index . getName ( ) ) , e ) ; } }
public class AppEventsLogger { /** * Build an AppEventsLogger instance to log events through . * @ param context Used to access the attributionId for non - authenticated users . * @ param session Explicitly specified Session to log events against . If null , the activeSession * will be used if it ' s open , other...
return new AppEventsLogger ( context , null , session ) ;
public class CPDefinitionLinkUtil { /** * Returns all the cp definition links where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching cp definition links */ public static List < CPDefinitionLink > findByUuid_C ( String uuid , long company...
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class CodepointHelper { /** * Verifies a sequence of codepoints using the specified profile * @ param aIter * Codepoint iterator * @ param eProfile * profile to use */ public static void verifyNot ( final ICodepointIterator aIter , @ Nonnull final ECodepointProfile eProfile ) { } }
final CodepointIteratorRestricted rci = aIter . restrict ( eProfile . getFilter ( ) , false , true ) ; while ( rci . hasNext ( ) ) rci . next ( ) ;
public class ServerContext { /** * Handles a connection from another server . */ public void connectServer ( Connection connection ) { } }
threadContext . checkThread ( ) ; // Handlers for all request types are registered since requests can be proxied between servers . // Note we do not use method references here because the " state " variable changes over time . // We have to use lambdas to ensure the request handler points to the current state . connect...
public class LocalisationManager { /** * Method removeXmitQueuePoint * @ param meUuid * @ return */ public void removeXmitQueuePoint ( SIBUuid8 meUuid ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeXmitQueuePoint" , meUuid ) ; if ( _xmitQueuePoints != null ) { synchronized ( _xmitQueuePoints ) { _xmitQueuePoints . remove ( meUuid ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) ...
public class HierarchicalTable { /** * Do the physical Open on this table ( requery the table ) . * @ exception DBException File exception . */ public void open ( ) throws DBException { } }
super . open ( ) ; this . getRecord ( ) . setEditMode ( DBConstants . EDIT_NONE ) ; // Being careful Iterator < BaseTable > iterator = this . getTables ( ) ; while ( iterator . hasNext ( ) ) { BaseTable table = iterator . next ( ) ; if ( ( table != null ) && ( table != this . getNextTable ( ) ) ) { this . syncRecordToB...
public class CmsContainerpageDNDController { /** * Initializes the nested container infos . < p > */ private void initNestedContainers ( ) { } }
for ( CmsContainer container : m_controller . getContainers ( ) . values ( ) ) { if ( container . isSubContainer ( ) ) { CmsContainerPageContainer containerWidget = m_controller . m_targetContainers . get ( container . getName ( ) ) ; // check if the sub container is a valid drop targets if ( m_dragInfos . keySet ( ) ....
public class ContainerLifecycleEvents { /** * Fires a { @ link ProcessAnnotatedType } or { @ link ProcessSyntheticAnnotatedType } using the default event mechanism . */ private void fireProcessAnnotatedType ( ProcessAnnotatedTypeImpl < ? > event , BeanManagerImpl beanManager ) { } }
final Resolvable resolvable = ProcessAnnotatedTypeEventResolvable . of ( event , discovery ) ; try { beanManager . getGlobalLenientObserverNotifier ( ) . fireEvent ( event , resolvable ) ; } catch ( Exception e ) { throw new DefinitionException ( e ) ; }
public class SingleInputOperator { /** * Sets the input to the union of the given operators . * @ param input The operator ( s ) that form the input . * @ deprecated This method will be removed in future versions . Use the { @ link Union } operator instead . */ @ Deprecated public void setInput ( Operator < IN > .....
this . input = Operator . createUnionCascade ( null , input ) ;
public class ExecutionStage { /** * Checks which instance types and how many instances of these types are required to execute this stage * of the job graph . The required instance types and the number of instances are collected in the given map . Note * that this method does not clear the map before collecting the ...
final Set < AbstractInstance > collectedInstances = new HashSet < AbstractInstance > ( ) ; final ExecutionGroupVertexIterator groupIt = new ExecutionGroupVertexIterator ( this . getExecutionGraph ( ) , true , this . stageNum ) ; while ( groupIt . hasNext ( ) ) { final ExecutionGroupVertex groupVertex = groupIt . next (...
public class TelemetrySender { /** * Align the retry times with sdk */ private ResponseEntity < String > executeRequest ( final TelemetryEventData eventData ) { } }
final HttpHeaders headers = new HttpHeaders ( ) ; headers . add ( HttpHeaders . CONTENT_TYPE , APPLICATION_JSON . toString ( ) ) ; try { final RestTemplate restTemplate = new RestTemplate ( ) ; final HttpEntity < String > body = new HttpEntity < > ( MAPPER . writeValueAsString ( eventData ) , headers ) ; return restTem...
public class AjaxAddableTabbedPanel { /** * On new tab . * @ param target * the target * @ param tab * the tab */ public void onNewTab ( final AjaxRequestTarget target , final T tab ) { } }
getTabs ( ) . add ( tab ) ; setSelectedTab ( getTabs ( ) . size ( ) - 1 ) ; target . add ( this ) ;
public class ElemSort { /** * Set the " select " attribute . * xsl : sort has a select attribute whose value is an expression . * For each node to be processed , the expression is evaluated * with that node as the current node and with the complete * list of nodes being processed in unsorted order as the curren...
if ( v . getPatternString ( ) . indexOf ( "{" ) < 0 ) m_selectExpression = v ; else error ( XSLTErrorResources . ER_NO_CURLYBRACE , null ) ;
public class AWSOrganizationsClient { /** * Disables an organizational control policy type in a root . A policy of a certain type can be attached to entities * in a root only if that type is enabled in the root . After you perform this operation , you no longer can attach * policies of the specified type to that ro...
request = beforeClientExecution ( request ) ; return executeDisablePolicyType ( request ) ;
public class ConfigurationCheck { /** * Check that foreign keys have the same mapped type as the target . */ private void checkForeignKeyMapping ( List < String > errors , Config config ) { } }
for ( Entity entity : config . getProject ( ) . getEntities ( ) . getList ( ) ) { for ( Relation relation : entity . getRelations ( ) . getList ( ) ) { if ( relation . isInverse ( ) || relation . isIntermediate ( ) ) { continue ; } for ( AttributePair attributePair : relation . getAttributePairs ( ) ) { if ( attributeP...
public class Sha1Hasher { /** * Create a new SHA1 hash URI for the specified { @ link ByteBuffer } . * @ param buf The { @ link ByteBuffer } to create the SHA - 1 for . * @ return The SHA1 hash as a URI . * @ throws IOException If there is an error creating the hash or if the * specified algorithm cannot be fou...
final MessageDigest md = new Sha1 ( ) ; md . update ( buf ) ; final byte [ ] sha1 = md . digest ( ) ; try { // preferred casing : lowercase " urn : sha1 : " , uppercase encoded value // note that all URNs are case - insensitive for the " urn : < type > : " part , // but some MAY be case - sensitive thereafter ( SHA1 / ...
public class ObjectInputStream { /** * Reads a new class from the receiver . It is assumed the class has not been * read yet ( not a cyclic reference ) . Return the class read . * @ param unshared * read the object unshared * @ return The { @ code java . lang . Class } read from the stream . * @ throws IOExce...
ObjectStreamClass classDesc = readClassDesc ( ) ; if ( classDesc == null ) { throw missingClassDescriptor ( ) ; } Class < ? > localClass = classDesc . forClass ( ) ; if ( localClass != null ) { registerObjectRead ( localClass , nextHandle ( ) , unshared ) ; } return localClass ;
public class LocalDate { /** * Returns a copy of this date minus the specified number of weeks . * This LocalDate instance is immutable and unaffected by this method call . * The following three lines are identical in effect : * < pre > * LocalDate subtracted = dt . minusWeeks ( 6 ) ; * LocalDate subtracted =...
if ( weeks == 0 ) { return this ; } long instant = getChronology ( ) . weeks ( ) . subtract ( getLocalMillis ( ) , weeks ) ; return withLocalMillis ( instant ) ;
public class BouncyCastleUtil { /** * Retrieves the actual value of the X . 509 extension . * @ param certExtValue the DER - encoded OCTET string value of the extension . * @ return the decoded / actual value of the extension ( the octets ) . */ public static byte [ ] getExtensionValue ( byte [ ] certExtValue ) thr...
ByteArrayInputStream inStream = new ByteArrayInputStream ( certExtValue ) ; ASN1InputStream derInputStream = new ASN1InputStream ( inStream ) ; ASN1Primitive object = derInputStream . readObject ( ) ; if ( object instanceof ASN1OctetString ) { return ( ( ASN1OctetString ) object ) . getOctets ( ) ; } else { throw new I...
public class Tokenizer { /** * Consumes the current token , expecting it to be as < tt > SYMBOL < / tt > with the given content * @ param symbol the expected trigger of the current token */ public void consumeExpectedSymbol ( String symbol ) { } }
if ( current ( ) . matches ( Token . TokenType . SYMBOL , symbol ) ) { consume ( ) ; } else { addError ( current ( ) , "Unexpected token: '%s'. Expected: '%s'" , current ( ) . getSource ( ) , symbol ) ; }
public class SAXParser { /** * Parse the content described by the giving Uniform Resource * Identifier ( URI ) as XML using the specified * { @ link org . xml . sax . helpers . DefaultHandler } . * @ param uri The location of the content to be parsed . * @ param dh The SAX DefaultHandler to use . * @ throws I...
if ( uri == null ) { throw new IllegalArgumentException ( "uri cannot be null" ) ; } InputSource input = new InputSource ( uri ) ; this . parse ( input , dh ) ;
public class AbstractSMTPClientSession { /** * Implementation which just send each { @ link SMTPRequest } which is hold in the { @ link SMTPPipeliningRequest # getRequests ( ) } method via * { @ link # send ( SMTPRequest ) } method . */ @ Override public SMTPClientFuture < FutureResult < Collection < SMTPResponse > >...
SMTPClientFutureImpl < FutureResult < Collection < SMTPResponse > > > future = new SMTPClientFutureImpl < FutureResult < Collection < SMTPResponse > > > ( false ) ; future . setSMTPClientSession ( this ) ; AggregationListener listener = new AggregationListener ( future , request . getRequests ( ) . size ( ) ) ; for ( S...
public class SimpleLog { /** * Do the actual org . apache . commons . logging . * This method assembles the message and then calls < code > write ( ) < / code > * to cause it to be written . * @ param type One of the LOG _ LEVEL _ XXX constants defining the log level * @ param message The message itself ( typic...
// Use a string buffer for better performance final StringBuffer buf = new StringBuffer ( ) ; // Append date - time if so configured if ( showDateTime ) { final Date now = new Date ( ) ; String dateText ; synchronized ( dateFormatter ) { dateText = dateFormatter . format ( now ) ; } buf . append ( dateText ) ; buf . ap...
public class ProfileUtils { /** * Deletes prefs folders for Does nothing if prefs folders are default main user profile */ public boolean deleteProfile ( ) { } }
String [ ] profileDirs = { smallPrefsFolder , largePrefsFolder , cachePrefsFolder } ; // Assuming if any of those are main profile , skip the whole delete for ( String profileDir : profileDirs ) { if ( isMainProfile ( profileDir ) ) { logger . finer ( "Skipping profile deletion since '" + profileDir + "' is the main pr...
public class JavaParsingAtomicQueueGenerator { /** * Generates something like < code > return field < / code > * @ param fieldName * @ return */ protected BlockStmt returnField ( String fieldName ) { } }
BlockStmt body = new BlockStmt ( ) ; body . addStatement ( new ReturnStmt ( fieldName ) ) ; return body ;
public class AttributeDeduplicatorDaemon { /** * Starts a daemon which performs deduplication on incoming attributes in real - time . * The thread listens to the RocksDbQueue queue for incoming attributes and applies * the AttributeDeduplicator # deduplicate ( SessionStore , KeyspaceIndexPair ) algorithm . */ publi...
stopDaemon = false ; CompletableFuture < Void > daemon = CompletableFuture . supplyAsync ( ( ) -> { LOG . info ( "startDeduplicationDaemon() - attribute de-duplicator daemon started." ) ; while ( ! stopDaemon ) { try { List < Attribute > attributes = queue . read ( QUEUE_GET_BATCH_MAX ) ; LOG . trace ( "starting a new ...
public class ProcessControlHelper { /** * Check the server status * @ return */ public ReturnCode startStatus ( ) { } }
System . out . println ( MessageFormat . format ( BootstrapConstants . messages . getString ( "info.serverStarting" ) , serverName ) ) ; // Use initialized bootstrap configuration to find the server lock file . ServerLock serverLock = ServerLock . createTestLock ( bootProps ) ; ReturnCode rc = ReturnCode . OK ; String ...
public class DBQuery { /** * An element in the given array field matches the given query * @ param field the array field * @ param query The query to attempt to match against the elements of the array field * @ return the query */ public static Query elemMatch ( String field , Query query ) { } }
return new Query ( ) . elemMatch ( field , query ) ;
public class sslservice { /** * Use this API to fetch all the sslservice resources that are configured on netscaler . * This uses sslservice _ args which is a way to provide additional arguments while fetching the resources . */ public static sslservice [ ] get ( nitro_service service , sslservice_args args ) throws ...
sslservice obj = new sslservice ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; sslservice [ ] response = ( sslservice [ ] ) obj . get_resources ( service , option ) ; return response ;
public class GetDeclaredMethodLookup { /** * @ return true if m2 has a more specific return type than m1 */ private boolean isMoreSpecificReturnTypeThan ( Invoker m1 , Invoker m2 ) { } }
// This uses ' Class . isAssigableFrom ' . This is ok , assuming that inheritance hierarchy is not something that we are allowed // to change on reloads . Class < ? > cls1 = m1 . getReturnType ( ) ; Class < ? > cls2 = m2 . getReturnType ( ) ; return cls2 . isAssignableFrom ( cls1 ) ;
public class GoogleCloudStorageImpl { /** * Inverse function of { @ link # encodeMetadata ( Map ) } . */ @ VisibleForTesting static Map < String , byte [ ] > decodeMetadata ( Map < String , String > metadata ) { } }
return Maps . transformValues ( metadata , DECODE_METADATA_VALUES ) ;
public class Logger { /** * May return null */ private String getEffectiveResourceBundleName ( ) { } }
Logger target = this ; while ( target != null ) { String rbn = target . getResourceBundleName ( ) ; if ( rbn != null ) { return rbn ; } target = target . getParent ( ) ; } return null ;
public class GreatCircle { /** * Convert from " Lat , Long Lat , Long " String format * " Lat , Long , Lat , Long " Format * or all four entries " Lat Long Lat Long " * ( Convenience function ) * Since Distance is positive , a " - 1 " indicates an error in String formatting */ public static double calc ( String...
try { String [ ] array ; switch ( coords . length ) { case 1 : array = Split . split ( ',' , coords [ 0 ] ) ; if ( array . length != 4 ) return - 1 ; return calc ( Double . parseDouble ( array [ 0 ] ) , Double . parseDouble ( array [ 1 ] ) , Double . parseDouble ( array [ 2 ] ) , Double . parseDouble ( array [ 3 ] ) ) ...
public class RU { /** * / * NUMBER FORMAT FUNCTIONS */ public static String formatNumber ( Number value , String mask , double round ) { } }
double val = 0 ; if ( value != null ) { val = value . doubleValue ( ) ; } return formatNumber ( val , mask , round ) ;
public class TextStructureLayerStored { @ Override public TextSpan addSpan ( Token spanStart , Token spanEnd , String type ) { } }
return addSpan ( spanStart , spanEnd , type , null , null , null ) ;
public class FactoryImageBorder { /** * Creates an instance of the requested algorithms for handling borders pixels on { @ link ImageGray } . If type * { @ link BorderType # ZERO } is passed in then the value will be set to 0 . Alternatively you could * use { @ link # singleValue ( Class , double ) } instead . * ...
Class < ? > borderClass ; switch ( borderType ) { case SKIP : throw new IllegalArgumentException ( "Skip border can't be implemented here and has to be done " + "externally. Call this might be a bug. Instead pass in EXTENDED and manually skip over the " + "pixel in a loop some place." ) ; // borderClass = BorderIndex1...
public class DiscreteFactor { /** * Get the partition function = denominator = total sum probability of all * assignments . */ private double getPartitionFunction ( ) { } }
if ( partitionFunction != - 1.0 ) { return partitionFunction ; } partitionFunction = 0.0 ; Iterator < Outcome > outcomeIterator = outcomeIterator ( ) ; while ( outcomeIterator . hasNext ( ) ) { partitionFunction += outcomeIterator . next ( ) . getProbability ( ) ; } return partitionFunction ;
public class BookmarksApi { /** * List corporation bookmarks A list of your corporation & # 39 ; s bookmarks - - - * This route is cached for up to 3600 seconds SSO Scope : * esi - bookmarks . read _ corporation _ bookmarks . v1 * @ param corporationId * An EVE corporation ID ( required ) * @ param datasource...
ApiResponse < List < CorporationBookmarksResponse > > resp = getCorporationsCorporationIdBookmarksWithHttpInfo ( corporationId , datasource , ifNoneMatch , page , token ) ; return resp . getData ( ) ;
public class JobDescFactory { /** * Returns the cluster that a give job was run on by mapping the jobtracker hostname to an * identifier . * @ param jobConf * @ return */ public static String getCluster ( Configuration jobConf ) { } }
String jobtracker = jobConf . get ( RESOURCE_MANAGER_KEY ) ; if ( jobtracker == null ) { jobtracker = jobConf . get ( JOBTRACKER_KEY ) ; } String cluster = null ; if ( jobtracker != null ) { // strip any port number int portIdx = jobtracker . indexOf ( ':' ) ; if ( portIdx > - 1 ) { jobtracker = jobtracker . substring ...
public class JBasePanel { /** * Process this action . * Override this for functionality . * @ param strAction The action command or message . * @ param iOptions options * @ return true if handled . */ public boolean doAction ( String strAction , int iOptions ) { } }
if ( Constants . CLOSE . equalsIgnoreCase ( strAction ) ) { Frame frame = ScreenUtil . getFrame ( this ) ; if ( frame != null ) ( ( JBaseFrame ) frame ) . free ( ) ; return true ; } else if ( ThinMenuConstants . PRINT . equalsIgnoreCase ( strAction ) ) { return ScreenPrinter . onPrint ( this ) ; } else if ( ThinMenuCon...
public class GeoPackageValidate { /** * Validate the GeoPackage has the minimum required tables * @ param geoPackage * GeoPackage */ public static void validateMinimumTables ( GeoPackageCore geoPackage ) { } }
if ( ! hasMinimumTables ( geoPackage ) ) { throw new GeoPackageException ( "Invalid GeoPackage. Does not contain required tables: " + SpatialReferenceSystem . TABLE_NAME + " & " + Contents . TABLE_NAME + ", GeoPackage Name: " + geoPackage . getName ( ) ) ; }
public class YarnSubmissionHelper { /** * Sets environment variable map . * @ param map * @ return */ public YarnSubmissionHelper setJobSubmissionEnvMap ( final Map < String , String > map ) { } }
for ( final Map . Entry < String , String > entry : map . entrySet ( ) ) { environmentVariablesMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } return this ;
public class Util { /** * Returns length of the internal value . * @ param value a value . * @ param propType * @ return the length of the internal value or < code > - 1 < / code > if the length * cannot be determined . */ public static long getLength ( ValueData value , int propType ) { } }
if ( propType == PropertyType . BINARY ) { return value . getLength ( ) ; } else if ( propType == PropertyType . NAME || propType == PropertyType . PATH ) { return - 1 ; } else { return value . toString ( ) . length ( ) ; }
public class MediaManagementApi { /** * Complete a bulk of interactions * Complete a bulk of interactions * @ param mgtCancel ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ pub...
com . squareup . okhttp . Call call = mgtCompleteValidateBeforeCall ( mgtCancel , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class JarPluginProviderLoader { /** * Return true if the jar attributes declare it should load local dependency classes first . * @ param file plugin file * @ return true if plugin libs load first is set */ static boolean getLoadLocalLibsFirstForFile ( final File file ) { } }
Attributes attributes = loadMainAttributes ( file ) ; if ( null == attributes ) { return false ; } boolean loadFirstDefault = true ; String loadFirst = attributes . getValue ( RUNDECK_PLUGIN_LIBS_LOAD_FIRST ) ; if ( null != loadFirst ) { return Boolean . valueOf ( loadFirst ) ; } return loadFirstDefault ;
public class CProductPersistenceImpl { /** * Removes all the c products where uuid = & # 63 ; and companyId = & # 63 ; from the database . * @ param uuid the uuid * @ param companyId the company ID */ @ Override public void removeByUuid_C ( String uuid , long companyId ) { } }
for ( CProduct cProduct : findByUuid_C ( uuid , companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cProduct ) ; }
public class ServerClientDetection { /** * Handle callback from service call . */ public void resultReceived ( IPendingServiceCall call ) { } }
// if we aren ' t connection , skip any further testing if ( Call . STATUS_NOT_CONNECTED != call . getStatus ( ) ) { // receive time using nanos long now = System . nanoTime ( ) ; // increment received int received = packetsReceived . incrementAndGet ( ) ; log . debug ( "Call time stamps - write: {} read: {}" , call . ...
public class InfinispanFactory { /** * Create cache manager with custom idle time . * @ param idleTime idle time in seconds * @ return cache manager */ public static EmbeddedCacheManager create ( long idleTime ) { } }
Configuration configuration = new ConfigurationBuilder ( ) . expiration ( ) . maxIdle ( idleTime , TimeUnit . SECONDS ) . build ( ) ; return new DefaultCacheManager ( configuration ) ;
public class BackupEnginesInner { /** * Backup management servers registered to Recovery Services Vault . Returns a pageable list of servers . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ ...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < BackupEngineBaseResourceInner > > , Page < BackupEngineBaseResourceInner > > ( ) { @ Override public Page < BackupEngineBaseResourceInner > call ( ServiceResponse < Page < BackupEngineBaseResourceInner > > response ) {...
public class XMLStringBuffer { /** * append * @ param c */ public void append ( char c ) { } }
if ( this . length + 1 > this . ch . length ) { int newLength = this . ch . length * 2 ; if ( newLength < this . ch . length + DEFAULT_SIZE ) newLength = this . ch . length + DEFAULT_SIZE ; char [ ] newch = new char [ newLength ] ; System . arraycopy ( this . ch , 0 , newch , 0 , this . length ) ; this . ch = newch ; }...
public class PluginProxy { /** * Executes the proxied plugin passing the received arguments as parameters . * @ param argsAry The parameters to be passed to the plugin * @ return The return value of the plugin . * @ throws BadThresholdException if an error occurs parsing the threshold */ public ReturnValue execut...
// CommandLineParser clp = new PosixParser ( ) ; try { HelpFormatter hf = new HelpFormatter ( ) ; // configure a parser Parser cliParser = new Parser ( ) ; cliParser . setGroup ( mainOptionsGroup ) ; cliParser . setHelpFormatter ( hf ) ; CommandLine cl = cliParser . parse ( argsAry ) ; // Inject the context . . . Injec...
public class CcgParser { /** * Adds lexicon entry { @ code category } to { @ code chart } . This * method should be used by instances of { @ code CcgLexicon } * to initialize the lexicon entries of the parser . * @ param chart * @ param trigger * @ param category * @ param lexiconProb * @ param spanStart ...
for ( LexiconScorer lexiconScorer : lexiconScorers ) { lexiconProb *= lexiconScorer . getCategoryWeight ( triggerSpanStart , triggerSpanEnd , sentence , category ) ; } // Add all possible chart entries to the ccg chart . ChartEntry chartEntry = ccgCategoryToChartEntry ( trigger , category , spanStart , spanEnd , trigge...
public class Assert { /** * Asserts properties of a token . * @ param message the message to display on failure . * @ param expectedType the expected type of the token . * @ param expectedText the expected text of the token . * @ param token the token to assert . */ public static void assertToken ( String messa...
assertToken ( message , BaseRecognizer . DEFAULT_TOKEN_CHANNEL , expectedType , expectedText , token ) ;
public class GVRPointLight { /** * Set the ambient light intensity . * This designates the color of the ambient reflection . * It is multiplied by the material ambient color to derive * the hue of the ambient reflection for that material . * The built - in phong shader { @ link GVRPhongShader } uses a { @ code ...
setVec4 ( "ambient_intensity" , r , g , b , a ) ;
public class CmsResourceWrapperPropertyFile { /** * Reads the resource for the property file . < p > * @ param cms the initialized CmsObject * @ param resourcename the name of the property resource * @ param filter the filter to use * @ return the resource for the property file or null if not found * @ throws...
// the path without trailing slash String path = CmsResource . getParentFolder ( resourcename ) ; if ( path == null ) { return null ; } // the parent path String parent = CmsResource . getParentFolder ( path ) ; // the name of the resource String name = CmsResource . getName ( resourcename ) ; if ( name . endsWith ( "/...
public class ThreadPoolTaskScheduler { /** * { @ inheritDoc } * @ see org . audit4j . core . schedule . TaskScheduler # scheduleWithFixedDelay ( java . lang . Runnable , java . util . Date , long ) */ @ Override public ScheduledFuture < ? > scheduleWithFixedDelay ( Runnable task , Date startTime , long delay ) { } }
ScheduledExecutorService executor = getScheduledExecutor ( ) ; long initialDelay = startTime . getTime ( ) - System . currentTimeMillis ( ) ; try { return executor . scheduleWithFixedDelay ( errorHandlingTask ( task , true ) , initialDelay , delay , TimeUnit . MILLISECONDS ) ; } catch ( RejectedExecutionException ex ) ...
public class Math { /** * Returns the first floating - point argument with the sign of the * second floating - point argument . Note that unlike the { @ link * StrictMath # copySign ( double , double ) StrictMath . copySign } * method , this method does not require NaN { @ code sign } * arguments to be treated ...
return Double . longBitsToDouble ( ( Double . doubleToRawLongBits ( sign ) & ( DoubleConsts . SIGN_BIT_MASK ) ) | ( Double . doubleToRawLongBits ( magnitude ) & ( DoubleConsts . EXP_BIT_MASK | DoubleConsts . SIGNIF_BIT_MASK ) ) ) ;
public class HTMLEntities { /** * unescapes html character inside a string * @ param str html code to unescape * @ return unescaped html code */ public static String unescapeHTML ( String str ) { } }
StringBuilder rtn = new StringBuilder ( ) ; int posStart = - 1 ; int posFinish = - 1 ; while ( ( posStart = str . indexOf ( '&' , posStart ) ) != - 1 ) { int last = posFinish + 1 ; posFinish = str . indexOf ( ';' , posStart ) ; if ( posFinish == - 1 ) break ; rtn . append ( str . substring ( last , posStart ) ) ; if ( ...
public class TypeInfoCache { /** * Returns true if particular sqlType requires quoting . * This method is used internally by the driver , so it might disappear without notice . * @ param sqlType sql type as in java . sql . Types * @ return true if the type requires quoting * @ throws SQLException if something g...
switch ( sqlType ) { case Types . BIGINT : case Types . DOUBLE : case Types . FLOAT : case Types . INTEGER : case Types . REAL : case Types . SMALLINT : case Types . TINYINT : case Types . NUMERIC : case Types . DECIMAL : return false ; } return true ;
public class Vectors { /** * Returns true if the supplied vectors ' x and y components are equal to one another within * { @ link MathUtil # EPSILON } . */ public static boolean epsilonEquals ( IVector v1 , IVector v2 ) { } }
return epsilonEquals ( v1 , v2 , MathUtil . EPSILON ) ;
public class LocalConfig { /** * Get the configuration property value for configProperty . * @ param configProperty * The configuration property value to get * @ return The configuration property value or null if property does not exit . */ public synchronized String getConfigProperty ( Config . ConfigProperty co...
SeLionLogger . getLogger ( ) . entering ( configProperty ) ; checkArgument ( configProperty != null , "Config property cannot be null" ) ; // Search locally then query SeLionConfig if not found String propValue = null ; if ( baseConfig . containsKey ( configProperty . getName ( ) ) ) { propValue = baseConfig . getStrin...
public class AgentSession { /** * Returns the transcripts of a given user . The answer will contain the complete history of * conversations that a user had . * @ param userID the id of the user to get his conversations . * @ return the transcripts of a given user . * @ throws XMPPException if an error occurs wh...
return transcriptManager . getTranscripts ( workgroupJID , userID ) ;
public class GetCommand { /** * Generates the value of Cache - Control header according to the content type . * @ param contentType content type * @ return Cache - Control value */ private String generateCacheControl ( Map < MediaType , String > cacheControlMap , String contentType ) { } }
ArrayList < MediaType > mediaTypesList = new ArrayList < MediaType > ( cacheControlMap . keySet ( ) ) ; Collections . sort ( mediaTypesList , MediaTypeHelper . MEDIA_TYPE_COMPARATOR ) ; String cacheControlValue = "no-cache" ; if ( contentType == null || contentType . equals ( "" ) ) { return cacheControlValue ; } for (...
public class BaseSerializer { /** * Deserialize a Transform List serialized using { @ link # serializeTransformList ( List ) } , or * an array serialized using { @ link # serialize ( Transform [ ] ) } * @ param str String representation ( YAML / JSON ) of the Transform list * @ return { @ code List < Transform > ...
return load ( str , ListWrappers . TransformList . class ) . getList ( ) ;
public class DockerConfigReader { /** * Parse the contents of the config file and generate all possible * { @ link RegistryAuth } s , which are bundled into a { @ link RegistryConfigs } instance . * @ param configPath Path to config file . * @ return All registry auths that can be generated from the config file ...
checkNotNull ( configPath ) ; final DockerConfig config = MAPPER . readValue ( configPath . toFile ( ) , DockerConfig . class ) ; if ( config == null ) { return RegistryConfigs . empty ( ) ; } final RegistryConfigs . Builder registryConfigsBuilder = RegistryConfigs . builder ( ) ; final Map < String , String > credHelp...
public class OgnlExpression { /** * < p > onUnresolvedExpression . < / p > * @ param expression a { @ link java . lang . String } object . * @ param targets a { @ link java . lang . Object } object . * @ return a { @ link com . greenpepper . extensions . ognl . OgnlExpression } object . */ public static OgnlExpre...
OgnlResolution resolver = new OgnlResolution ( expression ) ; return new OgnlExpression ( resolver . expressionsListToResolve ( ) , targets ) ;
public class AmazonEC2Client { /** * Creates an internet gateway for use with a VPC . After creating the internet gateway , you attach it to a VPC using * < a > AttachInternetGateway < / a > . * For more information about your VPC and internet gateway , see the < a * href = " https : / / docs . aws . amazon . com...
request = beforeClientExecution ( request ) ; return executeCreateInternetGateway ( request ) ;
public class Utils4Swing { /** * Makes the glass pane visible and focused and stores the saves the current * state . * @ param source * Component to use when looking for the root pane container . * @ return State of the UI before the glasspane was visible . */ public static GlassPaneState showGlassPane ( final ...
final Component focusOwner = KeyboardFocusManager . getCurrentKeyboardFocusManager ( ) . getFocusOwner ( ) ; final RootPaneContainer rootPaneContainer = findRootPaneContainer ( source ) ; final Component glassPane = rootPaneContainer . getGlassPane ( ) ; final MouseListener mouseListener = new MouseAdapter ( ) { } ; fi...
public class GenerateEntityIdOnTheClient { /** * Attempts to get the document key from an instance * @ param entity Entity to get id from * @ param idHolder output parameter which holds document id * @ return true if id was read from entity */ public boolean tryGetIdFromInstance ( Object entity , Reference < Stri...
if ( entity == null ) { throw new IllegalArgumentException ( "Entity cannot be null" ) ; } try { Field identityProperty = getIdentityProperty ( entity . getClass ( ) ) ; if ( identityProperty != null ) { Object value = FieldUtils . readField ( identityProperty , entity , true ) ; if ( value instanceof String ) { idHold...
public class MappingServiceImpl { /** * Compares the attributes between the target repository and the mapping target . Applied Rules : - * The mapping target can not contain attributes which are not in the target repository - The * attributes of the mapping target with the same name as attributes in the target repo...
Map < String , Attribute > targetRepositoryAttributeMap = newHashMap ( ) ; targetRepositoryEntityType . getAtomicAttributes ( ) . forEach ( attribute -> targetRepositoryAttributeMap . put ( attribute . getName ( ) , attribute ) ) ; for ( Attribute mappingTargetAttribute : mappingTargetEntityType . getAtomicAttributes (...
public class TypicalFaihyApiFailureHook { @ Override public ApiResponse handleValidationError ( ApiFailureResource resource ) { } }
final FaihyUnifiedFailureType failureType = FaihyUnifiedFailureType . VALIDATION_ERROR ; final FaihyUnifiedFailureResult result = createFailureResult ( failureType , resource , null ) ; return asJson ( result ) . httpStatus ( prepareBusinessFailureStatus ( ) ) ;
public class ReflectionHelper { /** * Same as Arrays . asList ( . . . ) , but does automatically conversion of primitive arrays . * @ param array * @ return List of objects representing the given array contents */ public static List < Object > array2ObjectList ( final Object array ) { } }
final int length = Array . getLength ( array ) ; final List < Object > list = new ArrayList < Object > ( length ) ; for ( int i = 0 ; i < length ; ++ i ) { list . add ( Array . get ( array , i ) ) ; } return list ;
public class SuffixLocatorConnectionFactory { /** * { @ inheritDoc } */ @ Override public Transcoder < Object > getDefaultTranscoder ( ) { } }
final SerializingTranscoder transcoder = new SerializingTranscoder ( ) ; transcoder . setCompressionThreshold ( SerializingTranscoder . DEFAULT_COMPRESSION_THRESHOLD ) ; return new TranscoderWrapperStatisticsSupport ( _statistics , transcoder ) ;
public class Tracer { /** * Gets a string of spaces of the length specified . * @ param sb The string builder to append to . * @ param numSpaces The number of spaces in the string . */ @ VisibleForTesting static void appendSpaces ( StringBuilder sb , int numSpaces ) { } }
if ( numSpaces > 16 ) { logger . warning ( "Tracer.appendSpaces called with large numSpaces" ) ; // Avoid long loop in case some bug in the caller numSpaces = 16 ; } while ( numSpaces >= 5 ) { sb . append ( " " ) ; numSpaces -= 5 ; } // We know it ' s less than 5 now switch ( numSpaces ) { case 1 : sb . append ( " ...
public class SchemaConfiguration { /** * Add tableGenerator to table info . * @ param appMetadata * @ param persistenceUnit * @ param tableInfos * @ param entityMetadata * @ param isCompositeId */ private void addTableGenerator ( ApplicationMetadata appMetadata , String persistenceUnit , List < TableInfo > ta...
Metamodel metamodel = appMetadata . getMetamodel ( persistenceUnit ) ; IdDiscriptor keyValue = ( ( MetamodelImpl ) metamodel ) . getKeyValue ( entityMetadata . getEntityClazz ( ) . getName ( ) ) ; if ( keyValue != null && keyValue . getTableDiscriptor ( ) != null ) { TableInfo tableGeneratorDiscriptor = new TableInfo (...
public class ClientFactoryBuilder { /** * Sets the idle timeout of a socket connection . The connection is closed if there is no request in * progress for this amount of time . */ public ClientFactoryBuilder idleTimeout ( Duration idleTimeout ) { } }
requireNonNull ( idleTimeout , "idleTimeout" ) ; checkArgument ( ! idleTimeout . isNegative ( ) , "idleTimeout: %s (expected: >= 0)" , idleTimeout ) ; return idleTimeoutMillis ( idleTimeout . toMillis ( ) ) ;
public class MetaMainTask { /** * Get the task ' s display name consisting of the general task name , * indentation showing the tree structure depending on the subtask level * and optionally a name suffix given from a supertask . * @ return display name */ public String getDisplayName ( ) { } }
StringBuilder name = new StringBuilder ( ) ; // add indentation representing tree structure of tasks for ( int i = 0 ; i < this . getSubtaskLevel ( ) - 1 ; i ++ ) { if ( this . isLastSubtaskOnLevel [ i ] ) { name . append ( " " ) ; } else { name . append ( "│ " ) ; } } if ( this . getSubtaskLevel ( ) > 0 )...
public class CmsScrollBar { /** * Starts the mouse sliding . < p > * @ param event the mouse event */ private void startMouseSliding ( Event event ) { } }
if ( ! m_slidingMouse ) { m_slidingMouse = true ; DOM . setCapture ( getElement ( ) ) ; m_mouseSlidingStartY = event . getClientY ( ) ; m_mouseSlidingStartValue = m_currentValue ; CmsDebugLog . getInstance ( ) . printLine ( "Mouse sliding started with clientY: " + m_mouseSlidingStartY + " and start value: " + m_mouseSl...
public class DTBuilder { /** * produces a normalized date time , using zero for the time fields if none * were provided . * @ return not null */ public DateTimeValue toDateTime ( ) { } }
normalize ( ) ; return new DateTimeValueImpl ( year , month , day , hour , minute , second ) ;
public class AttributesBuilder { /** * Sets custom or unlisted attribute * @ param attributeName * @ param attributeValue * @ return this instance . */ public AttributesBuilder attribute ( String attributeName , Object attributeValue ) { } }
this . attributes . setAttribute ( attributeName , attributeValue ) ; return this ;