signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RelationalBinding { /** * Creates a ' NOT _ EQUAL ' binding . * @ param property * the property . * @ param value * the value to which the property should be related . * @ return * a ' NOT _ EQUAL ' binding . */ public static RelationalBinding notEqualBinding ( final String property , final Obj...
return ( new RelationalBinding ( property , Relation . NOT_EQUAL , value ) ) ;
public class FeatureUtilities { /** * Find the name of an attribute , case insensitive . * @ param featureType the feature type to check . * @ param field the case insensitive field name . * @ return the real name of the field , or < code > null < / code > , if none found . */ public static String findAttributeNa...
List < AttributeDescriptor > attributeDescriptors = featureType . getAttributeDescriptors ( ) ; for ( AttributeDescriptor attributeDescriptor : attributeDescriptors ) { String name = attributeDescriptor . getLocalName ( ) ; if ( name . toLowerCase ( ) . equals ( field . toLowerCase ( ) ) ) { return name ; } } return nu...
public class PathNormalizer { /** * This method can calculate the relative path between two pathes on a file * system . < br / > * < pre > * PathUtils . getRelativeFilePath ( null , null ) = " " * PathUtils . getRelativeFilePath ( null , " / usr / local / java / bin " ) = " " * PathUtils . getRelativeFilePath...
if ( StringUtils . isEmpty ( oldPath ) || StringUtils . isEmpty ( newPath ) ) { return "" ; } // normalise the path delimiters String fromPath = new File ( oldPath ) . getPath ( ) ; String toPath = new File ( newPath ) . getPath ( ) ; // strip any leading slashes if its a windows path if ( toPath . matches ( "^\\[a-zA-...
public class RowIndexSearcher { /** * { @ inheritDoc } */ @ Override public void validate ( IndexExpression indexExpression ) throws InvalidRequestException { } }
try { String json = UTF8Type . instance . compose ( indexExpression . value ) ; Search . fromJson ( json ) . validate ( schema ) ; } catch ( Exception e ) { throw new InvalidRequestException ( e . getMessage ( ) ) ; }
public class syslog_sslvpn { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSLong exporter_id_validator = new MPSLong ( ) ; exporter_id_validator . validate ( operationType , exporter_id , "\"exporter_id\"" ) ; MPSLong priority_validator = new MPSLong ( ) ; priority_validator . validate ( operationType , priority , "\"priority\"" ) ; MPSLong timestamp_val...
public class PropertyUtil { /** * This method returns the named property , first checking the system properties * and if not found , checking the environment . * @ param name The name * @ return The property , or null if not found */ public static String getProperty ( String name ) { } }
return System . getProperty ( name , System . getenv ( name ) ) ;
public class TitlePaneMaximizeButtonPainter { /** * Paint the foreground maximized button enabled state . * @ param g the Graphics2D context to paint with . * @ param c the component . * @ param width the width of the component . * @ param height the height of the component . */ private void paintMaximizeEnable...
maximizePainter . paintEnabled ( g , c , width , height ) ;
public class BaseHashMap { /** * generic method for adding or removing keys */ protected Object addOrRemove ( long longKey , long longValue , Object objectKey , Object objectValue , boolean remove ) { } }
int hash = ( int ) longKey ; if ( isObjectKey ) { if ( objectKey == null ) { return null ; } hash = objectKey . hashCode ( ) ; } int index = hashIndex . getHashIndex ( hash ) ; int lookup = hashIndex . hashTable [ index ] ; int lastLookup = - 1 ; Object returnValue = null ; for ( ; lookup >= 0 ; lastLookup = lookup , l...
public class SubmitContainerStateChangeRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SubmitContainerStateChangeRequest submitContainerStateChangeRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( submitContainerStateChangeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( submitContainerStateChangeRequest . getCluster ( ) , CLUSTER_BINDING ) ; protocolMarshaller . marshall ( submitContainerStateChangeRequest . getTask ( ...
public class ClassUtils { /** * Expanded version of { @ link # isJavaLangType ( Class ) } that includes common Java types like { @ link URI } . * @ param name The name of the type * @ return True if is a Java basic type */ public static boolean isJavaBasicType ( @ Nullable String name ) { } }
if ( StringUtils . isEmpty ( name ) ) { return false ; } return isJavaLangType ( name ) || BASIC_TYPE_MAP . containsKey ( name ) ;
public class UserCoreDao { /** * Query for rows * @ param where * where clause * @ param whereArgs * where arguments * @ return result */ public TResult query ( String where , String [ ] whereArgs ) { } }
TResult result = userDb . query ( getTableName ( ) , table . getColumnNames ( ) , where , whereArgs , null , null , null ) ; prepareResult ( result ) ; return result ;
public class ContainerBase { /** * ( non - Javadoc ) * @ see org . jboss . shrinkwrap . api . container . LibraryContainer # addLibraries ( java . lang . String [ ] ) */ @ Override public T addAsLibraries ( String ... resourceNames ) throws IllegalArgumentException { } }
Validate . notNull ( resourceNames , "ResourceNames must be specified" ) ; for ( String resourceName : resourceNames ) { addAsLibrary ( resourceName ) ; } return covarientReturn ( ) ;
public class EnvironmentInformation { /** * Gets the version of the JVM in the form " VM _ Name - Vendor - Spec / Version " . * @ return The JVM version . */ public static String getJvmVersion ( ) { } }
try { final RuntimeMXBean bean = ManagementFactory . getRuntimeMXBean ( ) ; return bean . getVmName ( ) + " - " + bean . getVmVendor ( ) + " - " + bean . getSpecVersion ( ) + '/' + bean . getVmVersion ( ) ; } catch ( Throwable t ) { return UNKNOWN ; }
public class ModelsImpl { /** * Gets information about the application version models . * @ param appId The application ID . * @ param versionId The version ID . * @ param listModelsOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentExce...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgu...
public class Crossing { /** * Returns how many times rectangle stripe cross shape or the are intersect */ public static int intersectShape ( IShape s , float x , float y , float w , float h ) { } }
if ( ! s . bounds ( ) . intersects ( x , y , w , h ) ) { return 0 ; } return intersectPath ( s . pathIterator ( null ) , x , y , w , h ) ;
public class SimpleSessionManager { /** * Initialize this component . < br > * This is basically called by DI setting file . */ @ PostConstruct public synchronized void initialize ( ) { } }
final FwWebDirection direction = assistWebDirection ( ) ; final SessionResourceProvider provider = direction . assistSessionResourceProvider ( ) ; sessionSharedStorage = prepareSessionSharedStorage ( provider ) ; httpSessionArranger = prepareHttpSessionArranger ( provider ) ; showBootLogging ( ) ;
public class JsonWriter { /** * Write a string field to the JSON file . * @ param fieldName field name * @ param value field value */ private void writeStringField ( String fieldName , Object value ) throws IOException { } }
String val = value . toString ( ) ; if ( ! val . isEmpty ( ) ) { m_writer . writeNameValuePair ( fieldName , val ) ; }
public class PortInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PortInfo portInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( portInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( portInfo . getFromPort ( ) , FROMPORT_BINDING ) ; protocolMarshaller . marshall ( portInfo . getToPort ( ) , TOPORT_BINDING ) ; protocolMarshaller . marshall ( portInfo . getPr...
public class MultiVertexGeometryImpl { /** * Checked vs . Jan 11 , 2011 */ @ Override public void setXY ( int index , Point2D pt ) { } }
if ( index < 0 || index >= m_pointCount ) // TODO exception throw new IndexOutOfBoundsException ( ) ; _verifyAllStreams ( ) ; // AttributeStreamOfDbl v = ( AttributeStreamOfDbl ) // m _ vertexAttributes [ 0 ] ; AttributeStreamOfDbl v = ( AttributeStreamOfDbl ) m_vertexAttributes [ 0 ] ; v . write ( index * 2 , pt ) ; n...
public class Graphs { /** * Returns the subgraph of { @ code graph } induced by { @ code nodes } . This subgraph is a new graph * that contains all of the nodes in { @ code nodes } , and all of the { @ link Graph # edges ( ) edges } * ( and associated edge values ) from { @ code graph } for which both nodes are con...
MutableValueGraph < N , V > subgraph = ValueGraphBuilder . from ( graph ) . build ( ) ; for ( N node : nodes ) { subgraph . addNode ( node ) ; } for ( N node : subgraph . nodes ( ) ) { for ( N successorNode : graph . successors ( node ) ) { if ( subgraph . nodes ( ) . contains ( successorNode ) ) { subgraph . putEdgeVa...
public class Metrics { /** * Measures the distribution of samples . * @ param name The base metric name * @ param tags Sequence of dimensions for breaking down the name . * @ return A new or existing distribution summary . */ public static DistributionSummary summary ( String name , Iterable < Tag > tags ) { } }
return globalRegistry . summary ( name , tags ) ;
public class CfgParseChart { /** * Get the inside unnormalized probabilities over productions at a particular * span in the tree . */ public Factor getInsideEntries ( int spanStart , int spanEnd ) { } }
Tensor entries = new DenseTensor ( parentVar . getVariableNumsArray ( ) , parentVar . getVariableSizes ( ) , insideChart [ spanStart ] [ spanEnd ] ) ; return new TableFactor ( parentVar , entries ) ;
public class ConfigurationImpl { /** * Retrieves the values as a array of String , the format is : key = [ myval1 , myval2 ] . * @ return an array containing the values of that key or empty if not found . */ @ Override public String [ ] getStringArray ( final String key ) { } }
List < String > list = getList ( key ) ; return list . toArray ( new String [ list . size ( ) ] ) ;
public class CypherProcedures { /** * store in graph properties , load at startup * allow to register proper params as procedure - params * allow to register proper return columns * allow to register mode */ @ Procedure ( value = "apoc.custom.asProcedure" , mode = Mode . WRITE ) @ Description ( "apoc.custom.asPro...
debug ( name , "before" , ktx ) ; CustomStatementRegistry registry = new CustomStatementRegistry ( api , log ) ; if ( ! registry . registerProcedure ( name , statement , mode , outputs , inputs , description ) ) { throw new IllegalStateException ( "Error registering procedure " + name + ", see log." ) ; } CustomProcedu...
public class DOMUtils { /** * Serialise the provided source to the provided destination , pretty - printing with the default indent settings * @ param input the source * @ param output the destination */ public static void pretty ( final Source input , final StreamResult output ) { } }
try { // Configure transformer Transformer transformer = TransformerFactory . newInstance ( ) . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . ENCODING , "utf-8" ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "no" ) ; transformer . setOutputProperty ( OutputKeys . INDENT ...
public class HalResource { /** * Get link . * @ param rel Relation name * @ return Link */ public Optional < Link > getLinkByRel ( final String rel ) { } }
return Optional . ofNullable ( representation . getLinkByRel ( rel ) ) ;
public class AuthGUI { /** * Derive API Error Class from AAF Response ( future ) */ public Error getError ( AuthzTrans trans , Future < ? > fp ) { } }
// try { String text = fp . body ( ) ; Error err = new Error ( ) ; err . setMessageId ( Integer . toString ( fp . code ( ) ) ) ; if ( text == null || text . length ( ) == 0 ) { err . setText ( "**No Message**" ) ; } else { err . setText ( fp . body ( ) ) ; } return err ; // } catch ( APIException e ) { // Error err = n...
public class DialogResponse { /** * Returns list of response objects created from a string of vertical bar delimited captions . * @ param < T > The type of response object . * @ param responses Response list . * @ param exclusions Exclusion list ( may be null ) . * @ param dflt Default response ( may be null ) ...
List < DialogResponse < T > > list = new ArrayList < > ( ) ; boolean forceDefault = dflt == null && responses . length == 1 ; for ( T response : responses ) { DialogResponse < T > rsp = new DialogResponse < > ( response , response . toString ( ) , exclusions != null && ArrayUtils . contains ( exclusions , response ) , ...
public class UnifiedPromoteBuildAction { /** * Load the related repositories , plugins and a promotion config associated to the buildId . * Called from the UI . * @ param buildId - The unique build id . * @ return LoadBuildsResponse e . g . list of repositories , plugins and a promotion config . */ @ JavaScriptMe...
"UnusedDeclaration" } ) public LoadBuildsResponse loadBuild ( String buildId ) { LoadBuildsResponse response = new LoadBuildsResponse ( ) ; // When we load a new build we need also to reset the promotion plugin . // The null plugin is related to ' None ' plugin . setPromotionPlugin ( null ) ; try { this . currentPromot...
public class AccessibilityNodeInfoUtils { /** * Determines if the generating class of an * { @ link AccessibilityNodeInfoCompat } matches any of the given * { @ link Class } es by type . * @ param node A sealed { @ link AccessibilityNodeInfoCompat } dispatched by * the accessibility framework . * @ return { @...
for ( Class < ? > referenceClass : referenceClasses ) { if ( nodeMatchesClassByType ( context , node , referenceClass ) ) { return true ; } } return false ;
public class ICUHumanize { /** * Smartly formats the given number as a monetary amount . * For en _ GB : * < table border = " 0 " cellspacing = " 0 " cellpadding = " 3 " width = " 100 % " > * < tr > * < th class = " colFirst " > Input < / th > * < th class = " colLast " > Output < / th > * < / tr > * < tr...
DecimalFormat decf = context . get ( ) . getCurrencyFormat ( ) ; return stripZeros ( decf , decf . format ( value ) ) ;
public class Messages { /** * Gets the requested localized message . * The current Request and Response are used to help determine the messages * resource to use . * < ol > * < li > Exact locale match , return the registered locale message * < li > Language match , but not a locale match , return the register...
String language = languages . getLanguageOrDefault ( routeContext ) ; return get ( key , language , args ) ;
public class DbSqlSession { /** * select / / / / / */ public List < ? > selectList ( String statement , Object parameter ) { } }
statement = dbSqlSessionFactory . mapStatement ( statement ) ; List < Object > resultList = sqlSession . selectList ( statement , parameter ) ; for ( Object object : resultList ) { fireEntityLoaded ( object ) ; } return resultList ;
public class HijriAdjustment { /** * also called by Hijri calendar systems */ static HijriAdjustment from ( String variant ) { } }
int index = variant . indexOf ( ':' ) ; if ( index == - 1 ) { return new HijriAdjustment ( variant , 0 ) ; } else { try { int adjustment = Integer . parseInt ( variant . substring ( index + 1 ) ) ; return new HijriAdjustment ( variant . substring ( 0 , index ) , adjustment ) ; } catch ( NumberFormatException nfe ) { th...
public class GoogleMapShapeConverter { /** * Convert a list of { @ link PolygonOptions } to a { @ link MultiPolygon } * @ param multiPolygonOptions multi polygon options * @ param hasZ has z flag * @ param hasM has m flag * @ return multi polygon */ public MultiPolygon toMultiPolygonFromOptions ( MultiPolygonOp...
MultiPolygon multiPolygon = new MultiPolygon ( hasZ , hasM ) ; for ( PolygonOptions mapPolygon : multiPolygonOptions . getPolygonOptions ( ) ) { Polygon polygon = toPolygon ( mapPolygon ) ; multiPolygon . addPolygon ( polygon ) ; } return multiPolygon ;
public class ParetoFront { /** * Return a pareto - front collector . The natural order of the elements is * used as pareto - dominance order . * @ param < C > the element type * @ return a new pareto - front collector */ public static < C extends Comparable < ? super C > > Collector < C , ? , ParetoFront < C > > ...
return toParetoFront ( Comparator . naturalOrder ( ) ) ;
public class Team { /** * Create an oTask / Activity record within a team * @ param company Company ID * @ paramteam Team ID * @ param params Parameters * @ throwsJSONException If error occurred * @ return { @ link JSONObject } */ public JSONObject addActivity ( String company , String team , HashMap < String...
return oClient . post ( "/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks" , params ) ;
public class DescribeInstanceInformationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeInstanceInformationRequest describeInstanceInformationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeInstanceInformationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeInstanceInformationRequest . getInstanceInformationFilterList ( ) , INSTANCEINFORMATIONFILTERLIST_BINDING ) ; protocolMarshaller . marshall ( ...
public class Blade { /** * Add a post route to routes * @ param path your route path * @ param handler route implement * @ return return blade instance * @ see # post ( String , RouteHandler ) */ @ Deprecated public Blade post ( @ NonNull String path , @ NonNull RouteHandler0 handler ) { } }
this . routeMatcher . addRoute ( path , handler , HttpMethod . POST ) ; return this ;
public class QuickLauncher { /** * Stops a node ( which is running in a different VM ) by setting its status to * { @ link Status # SHUTDOWN _ PENDING } . Waits for the node to actually shut down * and returns the exit status ( 0 is for success else failure ) . */ private int stop ( final String [ ] args ) throws I...
setWorkingDir ( args ) ; final Path statusFile = getStatusPath ( ) ; int exitStatus = 1 ; // determine the current state of the node readStatus ( false , statusFile ) ; if ( this . status != null ) { // upon reading the status file , request the Cache Server to shutdown // if it has not already . . . if ( this . status...
public class ClusteredRedisDLockFactory { /** * { @ inheritDoc } */ @ Override protected ClusteredRedisDLock createLockInternal ( String name , Properties lockProps ) { } }
ClusteredRedisDLock lock = new ClusteredRedisDLock ( name ) ; lock . setLockProperties ( lockProps ) ; lock . setRedisHostsAndPorts ( getRedisHostsAndPorts ( ) ) . setRedisPassword ( getRedisPassword ( ) ) ; lock . setJedisConnector ( getJedisConnector ( ) ) ; return lock ;
public class Link { /** * Create a new styled link to a given url * @ param text the text content * @ param ts the style * @ param url the file * @ return the link */ public static Link create ( final String text , final TextStyle ts , final URL url ) { } }
return new Link ( text , ts , url . toString ( ) ) ;
public class GrailsHibernateTemplate { /** * Apply the flush mode that ' s been specified for this accessor to the given Session . * @ param session the current Hibernate Session * @ param existingTransaction if executing within an existing transaction * @ return the previous flush mode to restore after the opera...
if ( isApplyFlushModeOnlyToNonExistingTransactions ( ) && existingTransaction ) { return null ; } if ( getFlushMode ( ) == FLUSH_NEVER ) { if ( existingTransaction ) { FlushMode previousFlushMode = session . getHibernateFlushMode ( ) ; if ( ! previousFlushMode . lessThan ( FlushMode . COMMIT ) ) { session . setHibernat...
public class ChatLogic { /** * Adjust the chat type based on the mode of the chat message . */ public int adjustTypeByMode ( int mode , int type ) { } }
switch ( mode ) { case ChatCodes . DEFAULT_MODE : return type | SPEAK ; case ChatCodes . EMOTE_MODE : return type | EMOTE ; case ChatCodes . THINK_MODE : return type | THINK ; case ChatCodes . SHOUT_MODE : return type | SHOUT ; case ChatCodes . BROADCAST_MODE : return BROADCAST ; // broadcast always looks like broadcas...
public class GuildManager { /** * Resets the fields specified by the provided bit - flag pattern . * You can specify a combination by using a bitwise OR concat of the flag constants . * < br > Example : { @ code manager . reset ( GuildManager . NAME | GuildManager . ICON ) ; } * < p > < b > Flag Constants : < / b...
super . reset ( fields ) ; if ( ( fields & NAME ) == NAME ) this . name = null ; if ( ( fields & REGION ) == REGION ) this . region = null ; if ( ( fields & ICON ) == ICON ) this . icon = null ; if ( ( fields & SPLASH ) == SPLASH ) this . splash = null ; if ( ( fields & AFK_CHANNEL ) == AFK_CHANNEL ) this . afkChannel ...
public class CollectionUtils { /** * Writes the string value of the specified items to appendable , * wrapping an eventual IOException into a RuntimeException * @ param appendable to append values to * @ param items items to dump */ public static void dump ( Appendable appendable , Iterable < ? > items ) { } }
try { for ( Object item : items ) { appendable . append ( String . valueOf ( item ) ) ; appendable . append ( "\n" ) ; } } catch ( IOException e ) { throw new RuntimeException ( "An error occured while appending" , e ) ; }
public class BotmReflectionUtil { /** * Get the accessible method that means as follows : * < pre > * o target class ' s methods = all * o superclass ' s methods = public or protected * < / pre > * @ param clazz The type of class that defines the method . ( NotNull ) * @ param methodName The name of method ...
assertObjectNotNull ( "clazz" , clazz ) ; assertStringNotNullAndNotTrimmedEmpty ( "methodName" , methodName ) ; return findMethod ( clazz , methodName , argTypes , VisibilityType . ACCESSIBLE , false ) ;
public class LabAccountsInner { /** * Create a lab in a lab account . * @ param resourceGroupName The name of the resource group . * @ param labAccountName The name of the lab Account . * @ param createLabProperties Properties for creating a managed lab and a default environment setting * @ throws IllegalArgume...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( labAcco...
public class Blob { /** * { @ inheritDoc } * @ see # setBytes ( long , bytes [ ] , offset , int ) */ public int setBytes ( final long pos , byte [ ] bytes ) throws SQLException { } }
if ( bytes == null ) { throw new IllegalArgumentException ( "No byte to be set" ) ; } // end of if return setBytes ( pos , bytes , 0 , bytes . length ) ;
public class OverlyConcreteParameter { /** * implements the visitor to look to see if this method is constrained by a * superclass or interface . * @ param obj the currently parsed method */ @ Override public void visitMethod ( Method obj ) { } }
methodSignatureIsConstrained = false ; String methodName = obj . getName ( ) ; if ( ! Values . CONSTRUCTOR . equals ( methodName ) && ! Values . STATIC_INITIALIZER . equals ( methodName ) ) { String methodSig = obj . getSignature ( ) ; methodSignatureIsConstrained = methodIsSpecial ( methodName , methodSig ) || methodH...
public class KeyVaultClientBaseImpl { /** * Deletes the specified certificate issuer . * The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault . This operation requires the certificates / manageissuers / deleteissuers permission . * @ param vaultBaseUrl The vault ...
return deleteCertificateIssuerWithServiceResponseAsync ( vaultBaseUrl , issuerName ) . map ( new Func1 < ServiceResponse < IssuerBundle > , IssuerBundle > ( ) { @ Override public IssuerBundle call ( ServiceResponse < IssuerBundle > response ) { return response . body ( ) ; } } ) ;
public class NomadScheduler { /** * Get the command that will be used to retrieve the topology JAR */ static String getFetchCommand ( Config localConfig , Config clusterConfig , Config runtime ) { } }
return String . format ( "%s -u %s -f . -m local -p %s -d %s" , Context . downloaderBinary ( clusterConfig ) , Runtime . topologyPackageUri ( runtime ) . toString ( ) , Context . heronConf ( localConfig ) , Context . heronHome ( clusterConfig ) ) ;
public class MaterialDatePicker { /** * Set the maximum date limit . */ public void setDateMax ( Date dateMax ) { } }
this . dateMax = dateMax ; if ( isAttached ( ) && dateMax != null ) { getPicker ( ) . set ( "max" , JsDate . create ( ( double ) dateMax . getTime ( ) ) ) ; }
public class Dispatcher { /** * Gets the original page path corresponding to the original request before any forward / include . * Assumes all forward / include done with ao taglib . * If no original page available , uses the servlet path from the provided request . * @ see # getOriginalPage ( javax . servlet . S...
String original = getOriginalPage ( request ) ; return ( original != null ) ? original : request . getServletPath ( ) ;
public class N { /** * Returns a set backed by the specified map . * @ param map the backing map * @ return the set backed by the map * @ see Collections # newSetFromMap ( Map ) */ public static < E > Set < E > newSetFromMap ( final Map < E , Boolean > map ) { } }
return Collections . newSetFromMap ( map ) ;
public class Agent { /** * Entry point for the agent . */ public static void premain ( String arg , Instrumentation instrumentation ) throws Exception { } }
// Setup logging Config config = loadConfig ( arg ) ; LOGGER . debug ( "loaded configuration: {}" , config . root ( ) . render ( ) ) ; createDependencyProperties ( config ) ; // Setup Registry AtlasRegistry registry = new AtlasRegistry ( Clock . SYSTEM , new AgentAtlasConfig ( config ) ) ; // Add to global registry for...
public class CPDefinitionUtil { /** * Returns the last cp definition in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp definition , or < code > null < / code > if...
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class TrConfigurator { /** * Package protected : retrieve the delegate ( possibly creating first . . ) . * < ul > * < li > If Tr has not yet been configured , the disabled delegate will be * returned * < li > If a delegate has been set , that instance will be returned . * < li > Otherwise , the default...
TrService result = delegate . get ( ) ; if ( result != null ) { return result ; } LogProviderConfig config = loggingConfig . get ( ) . get ( ) ; if ( config != null ) { final TrService tr = config . getTrDelegate ( ) ; if ( tr != null ) { Callable < TrService > initializer = new Callable < TrService > ( ) { @ Override ...
public class ExecutablePredicates { /** * Checks if a candidate executable is equivalent to the specified reference executable . * @ param reference the executable to check equivalency against . * @ return the predicate . */ public static < T extends Executable > Predicate < T > executableIsEquivalentTo ( T referen...
Predicate < T > predicate = candidate -> candidate != null && candidate . getName ( ) . equals ( reference . getName ( ) ) && executableHasSameParameterTypesAs ( reference ) . test ( candidate ) ; if ( reference instanceof Method ) { predicate . and ( candidate -> candidate instanceof Method && ( ( Method ) candidate )...
public class DataSiftAccount { /** * Fetch a token using it ' s service ID and it ' s Identity ' s ID * @ param identity the ID of the identity to query * @ param service the service of the token to fetch * @ return The identity for the ID provided */ public FutureData < Token > getToken ( String identity , Strin...
FutureData < Token > future = new FutureData < > ( ) ; URI uri = newParams ( ) . put ( "id" , identity ) . forURL ( config . newAPIEndpointURI ( IDENTITY + "/" + identity + "/token/" + service ) ) ; Request request = config . http ( ) . GET ( uri , new PageReader ( newRequestCallback ( future , new Token ( ) , config )...
public class TrieBuilder { /** * Finds the same index block as the otherBlock * @ param index array * @ param indexLength size of index * @ param otherBlock * @ return same index block */ protected static final int findSameIndexBlock ( int index [ ] , int indexLength , int otherBlock ) { } }
for ( int block = BMP_INDEX_LENGTH_ ; block < indexLength ; block += SURROGATE_BLOCK_COUNT_ ) { if ( equal_int ( index , block , otherBlock , SURROGATE_BLOCK_COUNT_ ) ) { return block ; } } return indexLength ;
public class BitmapUtil { /** * Returns the width and height of a specific image resource . * @ param context * The context , which should be used , as an instance of the class { @ link Context } . The * context may not be null * @ param resourceId * The resource id of the image resource , whose width and hei...
Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; BitmapFactory . Options options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = true ; BitmapFactory . decodeResource ( context . getResources ( ) , resourceId , options ) ; int width = options . outWidth ; int height ...
public class AbstractVirtualHostBuilder { /** * Configures SSL or TLS of this { @ link VirtualHost } with the specified { @ link SslContext } . */ public B tls ( SslContext sslContext ) { } }
this . sslContext = VirtualHost . validateSslContext ( requireNonNull ( sslContext , "sslContext" ) ) ; return self ( ) ;
public class SectionHeader { /** * Returns a list of all characteristics of that section . * @ return list of all characteristics */ public List < SectionCharacteristic > getCharacteristics ( ) { } }
long value = get ( SectionHeaderKey . CHARACTERISTICS ) ; List < SectionCharacteristic > list = SectionCharacteristic . getAllFor ( value ) ; assert list != null ; return list ;
public class DatastoreUtils { /** * Increments the version property of the given entity by one . * @ param nativeEntity * the target entity * @ param versionMetadata * the metadata of the version property * @ return a new entity ( copy of the given ) , but with the incremented version . */ static Entity incre...
String versionPropertyName = versionMetadata . getMappedName ( ) ; long version = nativeEntity . getLong ( versionPropertyName ) ; return Entity . newBuilder ( nativeEntity ) . set ( versionPropertyName , ++ version ) . build ( ) ;
public class JsiiEngine { /** * Dequeues and processes pending jsii callbacks until there are no more callbacks to process . */ public void processAllPendingCallbacks ( ) { } }
while ( true ) { List < Callback > callbacks = this . getClient ( ) . pendingCallbacks ( ) ; if ( callbacks . size ( ) == 0 ) { break ; } callbacks . forEach ( this :: processCallback ) ; }
public class ThreadContext { /** * Access the inbound connection info object for this context . * @ return Map < String , Object > - null if not set */ public Map < String , Object > getInboundConnectionInfo ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getInboundConnectionInfo" ) ; return this . inboundConnectionInfo ;
public class AudioLanguageSelectionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AudioLanguageSelection audioLanguageSelection , ProtocolMarshaller protocolMarshaller ) { } }
if ( audioLanguageSelection == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( audioLanguageSelection . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; protocolMarshaller . marshall ( audioLanguageSelection . getLanguageSelectionPolicy ( ) , ...
public class Evaluator { /** * Attribute . * @ param _ alias the alias * @ return the attribute * @ throws EFapsException the e faps exception */ public Attribute attribute ( final String _alias ) throws EFapsException { } }
initialize ( true ) ; Attribute ret = null ; final Optional < Select > selectOpt = this . selection . getSelects ( ) . stream ( ) . filter ( select -> _alias . equals ( select . getAlias ( ) ) ) . findFirst ( ) ; if ( selectOpt . isPresent ( ) ) { ret = attribute ( selectOpt . get ( ) ) ; } return ret ;
public class ImmutableFSJobCatalog { /** * Fetch all the job files under the jobConfDirPath * @ return A collection of JobSpec */ @ Override public synchronized List < JobSpec > getJobs ( ) { } }
return Lists . transform ( Lists . newArrayList ( loader . loadPullFilesRecursively ( loader . getRootDirectory ( ) , this . sysConfig , shouldLoadGlobalConf ( ) ) ) , this . converter ) ;
public class PropertyMap { /** * Returns the default value if the given key isn ' t in this PropertyMap or * it isn ' t a valid integer . * @ param key Key of property to read * @ param def Default value */ public Integer getInteger ( String key , Integer def ) { } }
String value = getString ( key ) ; if ( value == null ) { return def ; } else { try { return Integer . valueOf ( value ) ; } catch ( NumberFormatException e ) { } return def ; }
public class CmsEditModuleForm { /** * Adds a new module resource row . < p > * @ param moduleResource the initial value for the module resource */ void addModuleResource ( String moduleResource ) { } }
CmsModuleResourceSelectField resField = createModuleResourceField ( moduleResource ) ; if ( resField != null ) { m_moduleResourcesGroup . addRow ( resField ) ; }
public class ExceptionTableSensitiveMethodVisitor { /** * Visits a field instruction . * @ param opcode The visited opcode . * @ param owner The field ' s owner . * @ param name The field ' s name . * @ param descriptor The field ' s descriptor . */ protected void onVisitFieldInsn ( int opcode , String owner , ...
super . visitFieldInsn ( opcode , owner , name , descriptor ) ;
public class MapReadResult { /** * Adds other MapReadResult by combining pois and ways . Optionally , deduplication can * be requested ( much more expensive ) . * @ param other the MapReadResult to add to this . * @ param deduplicate true if check for duplicates is required . */ public void add ( MapReadResult ot...
if ( deduplicate ) { for ( PointOfInterest poi : other . pointOfInterests ) { if ( ! this . pointOfInterests . contains ( poi ) ) { this . pointOfInterests . add ( poi ) ; } } for ( Way way : other . ways ) { if ( ! this . ways . contains ( way ) ) { this . ways . add ( way ) ; } } } else { this . pointOfInterests . ad...
public class ScriptableObject { /** * This is a version of putProperty for Symbol keys . */ public static void putProperty ( Scriptable obj , Symbol key , Object value ) { } }
Scriptable base = getBase ( obj , key ) ; if ( base == null ) base = obj ; ensureSymbolScriptable ( base ) . put ( key , obj , value ) ;
public class JsonEscape { /** * Perform a ( configurable ) JSON < strong > escape < / strong > operation on a < tt > char [ ] < / tt > input . * This method will perform an escape operation according to the specified * { @ link JsonEscapeType } and * { @ link JsonEscapeLevel } argument values . * All other < tt...
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } final int te...
public class SystemPropertyChangeEnvironmentFacet { /** * { @ inheritDoc } */ @ Override public void setup ( ) { } }
if ( type == ChangeType . REMOVE ) { System . clearProperty ( key ) ; } else { System . setProperty ( key , newValue ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Setup " + toString ( ) ) ; }
public class ClassDescSupport { /** * インポート名を追加します 。 * @ param classDesc クラス記述 * @ param importedClassName インポートされるクラスの名前 */ public void addImportName ( ClassDesc classDesc , String importedClassName ) { } }
String packageName = ClassUtil . getPackageName ( importedClassName ) ; if ( isImportTargetPackage ( classDesc , packageName ) ) { classDesc . addImportName ( importedClassName ) ; }
public class PojoDescriptorBuilderImpl { /** * Introspects the { @ link Field } s of the given { @ link Class } and adds them to the given { @ link PojoDescriptorImpl } . * @ param < P > is the generic type of { @ code pojoClass } . * @ param pojoClass is the { @ link Class } for the { @ link PojoDescriptorImpl # g...
if ( getFieldIntrospector ( ) != null ) { Iterator < Field > fieldIterator = getFieldIntrospector ( ) . findFields ( pojoClass ) ; while ( fieldIterator . hasNext ( ) ) { Field field = fieldIterator . next ( ) ; boolean fieldUsed = false ; for ( PojoPropertyAccessorBuilder < ? > builder : getAccessorBuilders ( ) ) { Po...
public class DataIO { /** * Create a r / o data tablemodel * @ param src * @ return a table model to the CSTable */ public static TableModel createTableModel ( final CSTable src ) { } }
final List < String [ ] > rows = new ArrayList < String [ ] > ( ) ; for ( String [ ] row : src . rows ( ) ) { rows . add ( row ) ; } return new TableModel ( ) { @ Override public int getColumnCount ( ) { return src . getColumnCount ( ) ; } @ Override public String getColumnName ( int column ) { return src . getColumnNa...
public class ColVals { /** * < p > Get column with Float val . < / p > * @ param pNm column name * @ return Float column val * @ throws ExceptionWithCode if field not found */ public final Float getFloat ( final String pNm ) throws ExceptionWithCode { } }
if ( this . floats != null && this . floats . keySet ( ) . contains ( pNm ) ) { return this . floats . get ( pNm ) ; } throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "There is no field - " + pNm ) ;
public class JScoreComponent { /** * Writes the currently set tune score to a PNG file . * @ param file The PNG output file . * @ throws IOException Thrown if the given file cannot be accessed . */ public void writeScoreTo ( File file ) throws IOException { } }
FileOutputStream fos = new FileOutputStream ( file ) ; try { writeScoreTo ( fos ) ; } finally { fos . close ( ) ; }
public class IconicsDrawable { /** * Set rounded corner from res * @ return The current IconicsDrawable for chaining . */ @ NonNull public IconicsDrawable roundedCornersRxRes ( @ DimenRes int sizeResId ) { } }
return roundedCornersRxPx ( mContext . getResources ( ) . getDimensionPixelSize ( sizeResId ) ) ;
public class ScriptContext { /** * Registers a reporter . * @ param reporter * the reporter */ @ Cmd public Reporter registerReporter ( final Reporter reporter ) { } }
injector . injectMembers ( reporter ) ; reporters . add ( reporter ) ; return reporter ;
public class RestRequest { /** * Executes the request blocking . * @ return The result of the request . * @ throws Exception If something went wrong while executing the request . */ public RestRequestResult executeBlocking ( ) throws Exception { } }
Request . Builder requestBuilder = new Request . Builder ( ) ; HttpUrl . Builder httpUrlBuilder = endpoint . getOkHttpUrl ( urlParameters ) . newBuilder ( ) ; queryParameters . forEach ( httpUrlBuilder :: addQueryParameter ) ; requestBuilder . url ( httpUrlBuilder . build ( ) ) ; RequestBody requestBody ; if ( multipar...
public class CollectionUtils { /** * < p > Attempts to convert a collection to the given iterabable type < / p > . * @ param iterableType The iterable type * @ param collection The collection * @ param < T > The collection generic type * @ return An { @ link Optional } of the converted type */ public static < T...
if ( iterableType . isInstance ( collection ) ) { return Optional . of ( collection ) ; } if ( iterableType . equals ( Set . class ) ) { return Optional . of ( new HashSet < > ( collection ) ) ; } if ( iterableType . equals ( Queue . class ) ) { return Optional . of ( new LinkedList < > ( collection ) ) ; } if ( iterab...
public class Arc { /** * Draws this arc . * @ param context the { @ link Context2D } used to draw this arc . */ @ Override protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { } }
final double r = attr . getRadius ( ) ; if ( r > 0 ) { context . beginPath ( ) ; context . arc ( 0 , 0 , r , attr . getStartAngle ( ) , attr . getEndAngle ( ) , attr . isCounterClockwise ( ) ) ; return true ; } return false ;
public class TableInfo { /** * Adds the to indexed column list . * @ param indexInfo * the index info */ public void addToIndexedColumnList ( IndexInfo indexInfo ) { } }
ColumnInfo columnInfo = new ColumnInfo ( ) ; columnInfo . setColumnName ( indexInfo . getColumnName ( ) ) ; if ( getEmbeddedColumnMetadatas ( ) . isEmpty ( ) || ! getEmbeddedColumnMetadatas ( ) . get ( 0 ) . getColumns ( ) . contains ( columnInfo ) ) { if ( ! columnToBeIndexed . contains ( indexInfo ) ) { columnToBeInd...
public class ExpectedValueCheckingTransaction { /** * Check all locks attempted by earlier * { @ link KeyColumnValueStore # acquireLock ( StaticBuffer , StaticBuffer , StaticBuffer , StoreTransaction ) } * calls using this transaction . * @ throws com . thinkaurelius . titan . diskstorage . BackendException */ vo...
StoreTransaction lt = getConsistentTx ( ) ; for ( ExpectedValueCheckingStore store : expectedValuesByStore . keySet ( ) ) { Locker locker = store . getLocker ( ) ; // Ignore locks on stores without a locker if ( null == locker ) continue ; locker . checkLocks ( lt ) ; }
public class JodaConvertStringBinding { /** * / * @ Override */ public S convertFromString ( Class < ? extends S > boundClass , String inputString ) { } }
return converter . convertFromString ( boundClass , inputString ) ;
public class MethodNodeUtils { /** * For a method node potentially representing a property , returns the name of the property . * @ param mNode a MethodNode * @ return the property name without the get / set / is prefix if a property or null */ public static String getPropertyName ( MethodNode mNode ) { } }
String name = mNode . getName ( ) ; if ( name . startsWith ( "set" ) || name . startsWith ( "get" ) || name . startsWith ( "is" ) ) { String pname = decapitalize ( name . substring ( name . startsWith ( "is" ) ? 2 : 3 ) ) ; if ( ! pname . isEmpty ( ) ) { if ( name . startsWith ( "set" ) ) { if ( mNode . getParameters (...
public class IfcMoveImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < String > getPunchList ( ) { } }
return ( EList < String > ) eGet ( Ifc2x3tc1Package . Literals . IFC_MOVE__PUNCH_LIST , true ) ;
public class SequentialEvent { /** * Gets the listener classes to which dispatching should be prevented while * this event is being dispatched . * @ return The listener classes marked to prevent . * @ see # preventCascade ( Class ) */ public Set < Class < ? > > getPrevented ( ) { } }
if ( this . prevent == null ) { return Collections . emptySet ( ) ; } return Collections . unmodifiableSet ( this . prevent ) ;
public class AbsFilesScanner { /** * / * map */ public Map < String , T > map ( File [ ] files , int start , int count ) { } }
final Map < String , T > results = new LinkedHashMap < > ( ) ; scan ( files , start , count , new Function < File , Void > ( ) { @ Override public Void apply ( File file ) { Tuple2 < String , T > mapping = file2map ( file ) ; results . put ( mapping . get0 ( ) , mapping . get1 ( ) ) ; return null ; } } ) ; return resul...
public class CorcInputFormat { /** * Sets which fields are to be read from the ORC file */ static void setReadColumns ( Configuration conf , StructTypeInfo actualStructTypeInfo ) { } }
StructTypeInfo readStructTypeInfo = getTypeInfo ( conf ) ; LOG . info ( "Read StructTypeInfo: {}" , readStructTypeInfo ) ; List < Integer > ids = new ArrayList < > ( ) ; List < String > names = new ArrayList < > ( ) ; List < String > readNames = readStructTypeInfo . getAllStructFieldNames ( ) ; List < String > actualNa...
public class HandoffResultsListener { /** * If I am the node which accepted this handoff , finish the job . * If I ' m the node that requested to hand off this work unit to * another node , shut it down after < config > seconds . */ private void apply ( String workUnit ) { } }
if ( ! cluster . isInitialized ( ) ) { return ; } if ( iRequestedHandoff ( workUnit ) ) { String str = cluster . getHandoffResult ( workUnit ) ; LOG . info ( "Handoff of {} to {} completed. Shutting down {} in {} seconds." , workUnit , ( str == null ) ? "(None)" : str , workUnit , clusterConfig . handoffShutdownDelay )...
public class RequireOS { /** * ( non - Javadoc ) * @ see org . apache . maven . enforcer . rule . api . EnforcerRule # getCacheId ( ) */ public String getCacheId ( ) { } }
// return the hashcodes of all the parameters StringBuffer b = new StringBuffer ( ) ; if ( StringUtils . isNotEmpty ( version ) ) { b . append ( version . hashCode ( ) ) ; } if ( StringUtils . isNotEmpty ( name ) ) { b . append ( name . hashCode ( ) ) ; } if ( StringUtils . isNotEmpty ( arch ) ) { b . append ( arch . h...
public class JobRecord { /** * Constructs and returns a Data Store Entity that represents this model * object */ @ Override public Entity toEntity ( ) { } }
Entity entity = toProtoEntity ( ) ; entity . setProperty ( JOB_INSTANCE_PROPERTY , jobInstanceKey ) ; entity . setProperty ( FINALIZE_BARRIER_PROPERTY , finalizeBarrierKey ) ; entity . setProperty ( RUN_BARRIER_PROPERTY , runBarrierKey ) ; entity . setProperty ( OUTPUT_SLOT_PROPERTY , outputSlotKey ) ; entity . setProp...
public class Sig { /** * sigtail - segment mit werten aus den lokalen variablen füllen */ private void fillSigTail ( SEG sighead , SEG sigtail ) { } }
String sigtailName = sigtail . getPath ( ) ; sigtail . propagateValue ( sigtailName + ".seccheckref" , sighead . getValueOfDE ( sighead . getPath ( ) + ".seccheckref" ) , SyntaxElement . DONT_TRY_TO_CREATE , SyntaxElement . DONT_ALLOW_OVERWRITE ) ;
public class EasyXls { /** * 导出list对象到excel * @ param config 配置 * @ param list 导出的list * @ param filePath 保存xls路径 * @ param fileName 保存xls文件名 * @ return 处理结果 , true成功 , false失败 * @ throws Exception */ public static boolean list2Xls ( ExcelConfig config , List < ? > list , String filePath , String fileName )...
return XlsUtil . list2Xls ( config , list , filePath , fileName ) ;