signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class StringArrayList { /** * TODO */ public List < String > toList ( ) { } }
List < String > result ; result = new ArrayList < String > ( ) ; for ( int i = 0 ; i < size ; i ++ ) { result . add ( data [ i ] ) ; } return result ;
public class ProcessTweaks { /** * Removes all CALL nodes in the given TweakInfos , replacing calls to getter * functions with the tweak ' s default value . */ private void stripAllCalls ( Map < String , TweakInfo > tweakInfos ) { } }
for ( TweakInfo tweakInfo : tweakInfos . values ( ) ) { boolean isRegistered = tweakInfo . isRegistered ( ) ; for ( TweakFunctionCall functionCall : tweakInfo . functionCalls ) { Node callNode = functionCall . callNode ; Node parent = callNode . getParent ( ) ; if ( functionCall . tweakFunc . isGetterFunction ( ) ) { N...
public class UserInfoGridScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; Record recUserInfo = this . getMainRecord ( ) ; recUserInfo . setKeyArea ( UserInfo . USER_NAME_KEY ) ; if ( m_recHeader != null ) ( ( ReferenceField ) this . getScreenRecord ( ) . getField ( UserScreenRecord . USER_GROUP_ID ) ) . setReference ( m_recHeader ) ; recUserInfo . addListener ( new...
public class UnderReplicatedBlocks { /** * / * remove a block from a under replication queue */ synchronized boolean remove ( BlockInfo blockInfo , int oldReplicas , int decommissionedReplicas , int oldExpectedReplicas ) { } }
int priLevel = getPriority ( blockInfo , oldReplicas , decommissionedReplicas , oldExpectedReplicas ) ; return remove ( blockInfo , priLevel ) ;
public class SerializerBase { /** * To fire off end document trace event */ protected void fireEndDoc ( ) throws org . xml . sax . SAXException { } }
if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_ENDDOCUMENT ) ; }
public class GradientEditor { /** * Simple test case for the gradient painter * @ param argv The arguments supplied at the command line */ public static void main ( String [ ] argv ) { } }
JFrame frame = new JFrame ( ) ; JPanel panel = new JPanel ( ) ; panel . setBorder ( BorderFactory . createTitledBorder ( "Gradient" ) ) ; panel . setLayout ( null ) ; frame . setContentPane ( panel ) ; GradientEditor editor = new GradientEditor ( ) ; editor . setBounds ( 10 , 15 , 270 , 100 ) ; panel . add ( editor ) ;...
public class JsonHash { /** * see { @ link Map # put ( Object , Object ) } . * this method is alternative of { @ link # put ( String , Object , Type ) } call with { @ link Type # LONG } . * @ param key * @ param value * @ return see { @ link Map # put ( Object , Object ) } * @ since 1.4.12 * @ author vvakam...
if ( value == null ) { stateMap . put ( key , Type . NULL ) ; } else { stateMap . put ( key , Type . ARRAY ) ; } return super . put ( key , value ) ;
public class Streams { /** * Returns an output stream corresponding to the given file . * @ param file * a non - null { @ code File } object . * @ return * a { @ code FileOutputStrea } to the given file , or { @ code null } if the file * is not valid . * @ throws FileNotFoundException */ public static Outpu...
if ( file != null ) { return new FileOutputStream ( file ) ; } return null ;
public class GenericEncodingStrategy { /** * Generates code to get a Lob locator value from RawSupport . RawSupport * instance and Lob instance must be on the stack . Result is a long locator * value on the stack . */ private void getLobLocator ( CodeAssembler a , StorablePropertyInfo info ) { } }
if ( ! info . isLob ( ) ) { throw new IllegalArgumentException ( ) ; } a . invokeInterface ( TypeDesc . forClass ( RawSupport . class ) , "getLocator" , TypeDesc . LONG , new TypeDesc [ ] { info . getStorageType ( ) } ) ;
public class SessionImpl { /** * { @ inheritDoc } */ public void exportWorkspaceSystemView ( OutputStream out , boolean skipBinary , boolean noRecurse ) throws IOException , PathNotFoundException , RepositoryException { } }
checkLive ( ) ; LocationFactory factory = new LocationFactory ( ( ( NamespaceRegistryImpl ) repository . getNamespaceRegistry ( ) ) ) ; WorkspaceEntry wsConfig = ( WorkspaceEntry ) container . getComponentInstanceOfType ( WorkspaceEntry . class ) ; ValueFactoryImpl valueFactoryImpl = new ValueFactoryImpl ( factory , ws...
public class GMLGenerator { /** * ( non - Javadoc ) * @ see com . rometools . rome . io . ModuleGenerator # generate ( com . rometools . rome . feed . module . Module , * org . jdom2 . Element ) */ @ Override public void generate ( final Module module , final Element element ) { } }
// this is not necessary , it is done to avoid the namespace definition // in every item . Element root = element ; while ( root . getParent ( ) != null && root . getParent ( ) instanceof Element ) { root = ( Element ) element . getParent ( ) ; } root . addNamespaceDeclaration ( GeoRSSModule . SIMPLE_NS ) ; root . addN...
public class IOUtil { /** * force the deletion of a file */ public void forceDelete ( File tempFile ) { } }
try { if ( tempFile != null && tempFile . exists ( ) ) { FileUtils . forceDelete ( tempFile ) ; } } catch ( Throwable t ) { t . printStackTrace ( ) ; }
public class CmsDriverManager { /** * Publishes the resources of a specified publish list . < p > * @ param cms the current request context * @ param dbc the current database context * @ param publishList a publish list * @ param report an instance of < code > { @ link I _ CmsReport } < / code > to print messag...
// check the parent folders checkParentFolders ( dbc , publishList ) ; ensureSubResourcesOfMovedFoldersPublished ( cms , dbc , publishList ) ; OpenCms . getPublishManager ( ) . getPublishListVerifier ( ) . checkPublishList ( publishList ) ; try { // fire an event that a project is to be published Map < String , Object ...
public class Latkes { /** * Gets the runtime cache . * @ return runtime cache */ public static RuntimeCache getRuntimeCache ( ) { } }
final String runtimeCache = getLocalProperty ( "runtimeCache" ) ; if ( null == runtimeCache ) { LOGGER . debug ( "Not found [runtimeCache] in local.properties, uses [LOCAL_LRU] as default" ) ; return RuntimeCache . LOCAL_LRU ; } return RuntimeCache . valueOf ( runtimeCache ) ;
public class Costs { /** * Subtracts the given costs from these costs . If the given costs are unknown , then these costs are remain unchanged . * @ param other The costs to subtract . */ public void subtractCosts ( Costs other ) { } }
if ( this . networkCost != UNKNOWN && other . networkCost != UNKNOWN ) { this . networkCost -= other . networkCost ; if ( this . networkCost < 0 ) { throw new IllegalArgumentException ( "Cannot subtract more cost then there is." ) ; } } if ( this . diskCost != UNKNOWN && other . diskCost != UNKNOWN ) { this . diskCost ...
public class BaseConvertToNative { /** * Move this standard payload properties from the message to the xml . * @ param message * @ param msg * @ param strKey */ public void setPayloadProperty ( BaseMessage message , Object msg , String strKey , Class < ? > classKey ) { } }
Object data = message . get ( strKey ) ; if ( data == null ) return ; this . setPayloadProperty ( data , msg , strKey , classKey ) ;
public class DynamicResourcePool { /** * Closes the pool and clears all the resources . The resource pool should not be used after this . */ @ Override public void close ( ) throws IOException { } }
try { mLock . lock ( ) ; if ( mAvailableResources . size ( ) != mResources . size ( ) ) { LOG . warn ( "{} resources are not released when closing the resource pool." , mResources . size ( ) - mAvailableResources . size ( ) ) ; } for ( ResourceInternal < T > resourceInternal : mAvailableResources ) { closeResource ( re...
public class BinaryString { /** * Concatenates input strings together into a single string . */ public static BinaryString concat ( Iterable < BinaryString > inputs ) { } }
// Compute the total length of the result . int totalLength = 0 ; for ( BinaryString input : inputs ) { if ( input != null ) { input . ensureMaterialized ( ) ; totalLength += input . getSizeInBytes ( ) ; } } // Allocate a new byte array , and copy the inputs one by one into it . final byte [ ] result = new byte [ total...
public class AccountsInner { /** * Gets the specified Azure Storage account linked to the given Data Lake Analytics account . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account . * @ param accountName The name of the Data Lake Analytics account from which ...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( storageAccountName == null ) { throw new Illega...
public class DefaultMonetaryRoundingsSingletonSpi { /** * Allows to access the identifiers of the current defined roundings . * @ param providers the providers and ordering to be used . By default providers and ordering as defined in * # getDefaultProviders is used , not null . * @ return the set of custom roundi...
Set < String > result = new HashSet < > ( ) ; String [ ] providerNames = providers ; if ( providerNames . length == 0 ) { providerNames = Monetary . getDefaultRoundingProviderChain ( ) . toArray ( new String [ Monetary . getDefaultRoundingProviderChain ( ) . size ( ) ] ) ; } for ( String providerName : providerNames ) ...
public class FSNamesystemDatanodeHelper { /** * Get status of the datanodes in the system . */ public static DatanodeStatus getDatanodeStats ( FSNamesystem ns , ArrayList < DatanodeDescriptor > live , ArrayList < DatanodeDescriptor > dead ) { } }
ns . DFSNodesStatus ( live , dead ) ; ArrayList < DatanodeDescriptor > decommissioning = ns . getDecommissioningNodesList ( live ) ; // live nodes int numLive = live . size ( ) ; int numLiveExcluded = 0 ; int numLiveDecommissioningInProgress = decommissioning . size ( ) ; int numLiveDecommissioned = 0 ; for ( DatanodeD...
public class Matrix4x3f { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4x3fc # invertOrtho ( org . joml . Matrix4x3f ) */ public Matrix4x3f invertOrtho ( Matrix4x3f dest ) { } }
float invM00 = 1.0f / m00 ; float invM11 = 1.0f / m11 ; float invM22 = 1.0f / m22 ; dest . set ( invM00 , 0 , 0 , 0 , invM11 , 0 , 0 , 0 , invM22 , - m30 * invM00 , - m31 * invM11 , - m32 * invM22 ) ; dest . properties = 0 ; return dest ;
public class CCApi2 { /** * Gets the bulk activities service . * @ return the bulk activities service */ public BulkActivitiesService getBulkActivitiesService ( ) { } }
if ( _bulkActivitiesService == null ) { synchronized ( CCApi2 . class ) { if ( _bulkActivitiesService == null ) { _bulkActivitiesService = _retrofit . create ( BulkActivitiesService . class ) ; } } } return _bulkActivitiesService ;
public class PPOImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < PPORG > getRG ( ) { } }
if ( rg == null ) { rg = new EObjectContainmentEList . Resolving < PPORG > ( PPORG . class , this , AfplibPackage . PPO__RG ) ; } return rg ;
public class MDBRuntimeImpl { /** * dynamic / optional / multiple . May be called at any time and in any order * @ param reference reference to EndpointActivationService service */ @ Reference ( name = REFERENCE_ENDPOINT_ACTIVATION_SERVICES , service = EndpointActivationService . class , policy = ReferencePolicy . DY...
String activationSvcId = ( String ) reference . getProperty ( ACT_SPEC_CFG_ID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "activationSvcId : " + activationSvcId ) ; } EndpointActivationServiceInfo easInfo = createEndpointActivationServiceInfo ( activationSvcId ) ; ...
public class BinaryMap { /** * { @ inheritDoc } * @ param fromKey * @ param inclusive * @ return */ @ Override public NavigableMap < K , V > tailMap ( K fromKey , boolean inclusive ) { } }
Entry < K , V > from = entry ( fromKey , null ) ; return new BinaryMap < > ( entrySet . tailSet ( from , inclusive ) , comparator ) ;
public class PropertyListSerialization { /** * Serialize a Boolean as a true or false element . * @ param val * boolean to serialize . * @ param handler * destination of serialization events . * @ throws SAXException * if exception during serialization . */ private static void serializeBoolean ( final Boole...
String tag = "false" ; if ( val . booleanValue ( ) ) { tag = "true" ; } final AttributesImpl attributes = new AttributesImpl ( ) ; handler . startElement ( null , tag , tag , attributes ) ; handler . endElement ( null , tag , tag ) ;
public class ToolProvider { /** * Determine if this is the desired tool instance . * @ param < T > the interface of the tool * @ param tool the instance of the tool * @ param moduleName the name of the module containing the desired implementation * @ return true if and only if the tool matches the specified cri...
PrivilegedAction < Boolean > pa = ( ) -> { // for now , use reflection to implement // return moduleName . equals ( tool . getClass ( ) . getModule ( ) . getName ( ) ) ; try { Method getModuleMethod = Class . class . getDeclaredMethod ( "getModule" ) ; Object toolModule = getModuleMethod . invoke ( tool . getClass ( ) ...
public class AmazonCloudWatchClient { /** * Temporarily sets the state of an alarm for testing purposes . When the updated state differs from the previous * value , the action configured for the appropriate state is invoked . For example , if your alarm is configured to * send an Amazon SNS message when an alarm is...
request = beforeClientExecution ( request ) ; return executeSetAlarmState ( request ) ;
public class Preconditions { /** * Precondition that clients are required to fulfill . * Violations are considered to be programming errors , on the clients part . * @ param < T > type of object to check * @ param reference the reference to check * @ param predicate the predicate that the given reference must s...
return require ( reference , predicate , "Expected to fulfill the requirement, got '%s'" , reference ) ;
public class SphinxLinks { /** * Our use case is * { @ code $ python - c " from docutils import nodes ; print ( ' term - ' + nodes . make _ id ( ' QR ' ) ) " } , which * returns { @ code term - qr } i . e . , identifiers conforming to the regular expression * [ a - z ] ( - ? [ a - z0-9 ] + ) * * But there is a ...
// id = string . lower ( ) String id = txt . toLowerCase ( ) ; // if not isinstance ( id , unicode ) : // id = id . decode ( ) // id = id . translate ( _ non _ id _ translate _ digraphs ) id = translate ( id , nonIdTranslateDigraphs ) ; // id = id . translate ( _ non _ id _ translate ) id = translate ( id , nonIdTransl...
public class AbstractApplication { /** * Return the application class name without the Application suffix . * @ return the application class short name */ private String computeShortClassName ( ) { } }
String name = this . getClass ( ) . getSimpleName ( ) ; if ( name . endsWith ( APP_SUFFIX_CLASSNAME ) ) { name = name . substring ( 0 , name . indexOf ( APP_SUFFIX_CLASSNAME ) ) ; } return name ;
public class WordSegmenting { /** * Display copyright . */ public static void displayCopyright ( ) { } }
System . out . println ( "Vietnamese Word Segmentation:" ) ; System . out . println ( "\tusing Conditional Random Fields" ) ; System . out . println ( "\ttesting our dataset of 8000 sentences with the highest F1-measure of 94%" ) ; System . out . println ( "Copyright (C) by Cam-Tu Nguyen {1,2} and Xuan-Hieu Phan {2}" )...
public class Ast { /** * get the actual data as Java objects . * @ param dictConverter object to convert dicts to actual instances for a class , * instead of leaving them as dictionaries . Requires the _ _ class _ _ key to be present * in the dict node . If it returns null , the normal processing is done . */ pub...
ObjectifyVisitor v = new ObjectifyVisitor ( dictConverter ) ; this . accept ( v ) ; return v . getObject ( ) ;
public class Quotes { /** * Convert strings with both quotes and ticks into a valid xpath component * For example , * { @ code foo } will be converted to { @ code " foo " } , * { @ code f " oo } will be converted to { @ code ' f " oo ' } , * { @ code foo ' " bar } will be converted to { @ code concat ( " foo ' ...
if ( toEscape . contains ( "\"" ) && toEscape . contains ( "'" ) ) { boolean quoteIsLast = false ; if ( toEscape . lastIndexOf ( "\"" ) == toEscape . length ( ) - 1 ) { quoteIsLast = true ; } String [ ] substringsWithoutQuotes = toEscape . split ( "\"" ) ; StringBuilder quoted = new StringBuilder ( "concat(" ) ; for ( ...
public class Assistant { /** * Create entity value . * Create a new value for an entity . * This operation is limited to 1000 requests per 30 minutes . For more information , see * * Rate limiting * * . * @ param createValueOptions the { @ link CreateValueOptions } containing the options for the call * @ return...
Validator . notNull ( createValueOptions , "createValueOptions cannot be null" ) ; String [ ] pathSegments = { "v1/workspaces" , "entities" , "values" } ; String [ ] pathParameters = { createValueOptions . workspaceId ( ) , createValueOptions . entity ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuil...
public class AbstractSegment3F { /** * Replies if two lines are intersecting . * @ param x1 is the first point of the first line . * @ param y1 is the first point of the first line . * @ param z1 is the first point of the first line . * @ param x2 is the second point of the first line . * @ param y2 is the se...
double s = computeLineLineIntersectionFactor ( x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 , x4 , y4 , z4 ) ; return ! Double . isNaN ( s ) ;
public class ImmutableNumberStatistics { /** * Create an immutable copy of another NumberStatistics * @ param statistics the original object * @ return the immutable copy */ public static < T extends Number > ImmutableNumberStatistics < T > copyOf ( NumberStatistics < ? extends T > statistics ) { } }
return new ImmutableNumberStatistics < T > ( statistics ) ;
public class IntermediateModelBuilder { /** * Create default shape processors . */ private List < IntermediateModelShapeProcessor > createShapeProcessors ( ) { } }
final List < IntermediateModelShapeProcessor > processors = new ArrayList < > ( ) ; processors . add ( new AddInputShapes ( this ) ) ; processors . add ( new AddOutputShapes ( this ) ) ; processors . add ( new AddExceptionShapes ( this ) ) ; processors . add ( new AddModelShapes ( this ) ) ; processors . add ( new AddE...
public class FmtNumber { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException * if value is null or not a Number , or if an invalid decimalFormat String was supplied */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; if ( ! ( value instanceof Number ) ) { throw new SuperCsvCellProcessorException ( Number . class , value , context , this ) ; } // create a new DecimalFormat if one is not supplied final DecimalFormat decimalFormatter ; try { decimalFormatter = formatter != null ? formatter : ...
public class ModifyVpcEndpointRequest { /** * ( Gateway endpoint ) One or more route tables IDs to associate with the endpoint . * @ return ( Gateway endpoint ) One or more route tables IDs to associate with the endpoint . */ public java . util . List < String > getAddRouteTableIds ( ) { } }
if ( addRouteTableIds == null ) { addRouteTableIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return addRouteTableIds ;
public class PropertyAccessors { /** * < p > isAnnotationPresentOnGetter < / p > * @ param annotation a { @ link java . lang . Class } object . * @ param < T > the type * @ return a boolean . */ public < T extends Annotation > boolean isAnnotationPresentOnGetter ( Class < T > annotation ) { } }
return CreatorUtils . isAnnotationPresent ( annotation , getters ) ;
public class Proposal { /** * Sets the secondarySalespeople value for this Proposal . * @ param secondarySalespeople * List of secondary salespeople who are responsible for the sales * of * the { @ code Proposal } besides primary salesperson . * This attribute is optional . A proposal could have * 8 secondary...
this . secondarySalespeople = secondarySalespeople ;
public class RepairingNsStreamWriter { /** * Method called after { @ link # findElemPrefix } has returned null , * to create and bind a namespace mapping for specified namespace . */ protected final String generateElemPrefix ( String suggPrefix , String nsURI , SimpleOutputElement elem ) throws XMLStreamException { }...
/* Ok . . . now , since we do not have an existing mapping , let ' s * see if we have a preferred prefix to use . */ /* Except if we need the empty namespace . . . that can only be * bound to the empty prefix : */ if ( nsURI == null || nsURI . length ( ) == 0 ) { return "" ; } /* Ok ; with elements this is easy : t...
public class ComponentFinder { /** * Gets the type repository used to analyse java classes . * @ return the type supplied type repository , or a default implementation */ public TypeRepository getTypeRepository ( ) { } }
if ( typeRepository == null ) { typeRepository = new DefaultTypeRepository ( getPackageNames ( ) , getExclusions ( ) , getUrlClassLoader ( ) ) ; } return typeRepository ;
public class MqttTopicPermission { /** * Checks if the topic implies a given MqttTopicPermissions topic * @ param topic the topic to check * @ return < code > true < / code > if the given MqttTopicPermissions topic is implied by the current one */ private boolean topicImplicity ( final String topic , final String [...
try { return topicMatcher . matches ( stripedTopic , this . splitTopic , nonWildCard , endsWithWildCard , rootWildCard , topic , splitTopic ) ; } catch ( InvalidTopicException e ) { return false ; }
public class HarborUtils { /** * Verifies that the given timeout is valid * @ param timeout */ public static void validateTimeout ( Duration timeout ) { } }
if ( timeout . equals ( Duration . ZERO ) ) { String message = "The timeout must be nonzero" ; throw new IllegalArgumentException ( message ) ; }
public class AbstractFreeMarkerRenderer { /** * Processes the specified FreeMarker template with the specified request , data model and response . * Puts the page response contents into cache with the key getting from request attribute specified by < i > page cache * key < / i > . * @ param html the specified HTM...
PrintWriter writer ; try { writer = response . getWriter ( ) ; } catch ( final Exception e ) { writer = new PrintWriter ( response . getOutputStream ( ) ) ; } try { if ( response . isCommitted ( ) ) { // response has been sent redirect writer . flush ( ) ; writer . close ( ) ; return ; } writer . write ( html ) ; write...
public class MPD9AbstractReader { /** * Retrieve the details of a single project from the database . * @ param result Map instance containing the results * @ param row result set row read from the database */ protected void processProjectListItem ( Map < Integer , String > result , Row row ) { } }
Integer id = row . getInteger ( "PROJ_ID" ) ; String name = row . getString ( "PROJ_NAME" ) ; result . put ( id , name ) ;
public class JvmWildcardTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case TypesPackage . JVM_WILDCARD_TYPE_REFERENCE__CONSTRAINTS : return constraints != null && ! constraints . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class Model { /** * Find model by composite id values and load specific columns only . * < pre > * Example : * User user = User . dao . findByIdLoadColumns ( new Object [ ] { 123 , 456 } , " name , age " ) ; * < / pre > * @ param idValues the composite id values of the model * @ param columns the spe...
Table table = _getTable ( ) ; if ( table . getPrimaryKey ( ) . length != idValues . length ) throw new IllegalArgumentException ( "id values error, need " + table . getPrimaryKey ( ) . length + " id value" ) ; Config config = _getConfig ( ) ; String sql = config . dialect . forModelFindById ( table , columns ) ; List <...
public class BoxRequestUpdateSharedItem { /** * Sets the date that this shared link will be deactivated . If this is set to null it will remove the * unshared at date that is set on this item . * Note : the date will be rounded to the day as the API does not support hours , minutes , or seconds * @ param unshared...
JsonObject jsonObject = getSharedLinkJsonObject ( ) ; if ( unsharedAt == null ) { jsonObject . add ( BoxSharedLink . FIELD_UNSHARED_AT , JsonValue . NULL ) ; } else { jsonObject . add ( BoxSharedLink . FIELD_UNSHARED_AT , BoxDateFormat . format ( unsharedAt ) ) ; } BoxSharedLink sharedLink = new BoxSharedLink ( jsonObj...
public class Proxy { /** * configures a proxy from properties ; if prefix is http or https you get standard system properties * https : / / docs . oracle . com / javase / 8 / docs / api / java / net / doc - files / net - properties . html * @ param prefix is usually the protocol - http or https */ public static Pro...
String host ; String port ; Proxy result ; host = System . getProperty ( prefix + ".proxyHost" ) ; if ( host == null ) { return null ; } port = System . getProperty ( prefix + ".proxyPort" ) ; if ( port == null ) { throw new IllegalStateException ( "missing proxy port for host " + host ) ; } result = new Proxy ( host ,...
public class ReflectionUtils { /** * Checks if field or corresponding read method is annotated with given annotationType . * @ param field Field to check * @ param annotationType Annotation you ' re looking for . * @ return true if field or read method it annotated with given annotationType or false . */ public s...
final Optional < Method > readMethod = getReadMethod ( field ) ; return field . isAnnotationPresent ( annotationType ) || readMethod . isPresent ( ) && readMethod . get ( ) . isAnnotationPresent ( annotationType ) ;
public class CliClient { /** * Opens the interactive CLI shell . */ public void open ( ) { } }
isRunning = true ; // print welcome terminal . writer ( ) . append ( CliStrings . MESSAGE_WELCOME ) ; // begin reading loop while ( isRunning ) { // make some space to previous command terminal . writer ( ) . append ( "\n" ) ; terminal . flush ( ) ; final String line ; try { line = lineReader . readLine ( prompt , null...
public class UserData { /** * Sets userData for user , data is set in cache and sent to user * @ param key Name of value * @ param value Data to be set */ public void set ( String key , String value ) { } }
cache . put ( key , value ) ; user . sendGlobal ( "JWWF-storageSet" , "{\"key\":" + Json . escapeString ( key ) + ",\"value\":" + Json . escapeString ( value ) + "}" ) ;
public class ZMatrixReader { /** * Private method that actually parses the input to read a ChemFile * object . * @ param file the file to read from * @ return A ChemFile containing the data parsed from input . */ private IChemFile readChemFile ( IChemFile file ) { } }
IChemSequence chemSequence = file . getBuilder ( ) . newInstance ( IChemSequence . class ) ; int number_of_atoms ; StringTokenizer tokenizer ; try { String line = input . readLine ( ) ; while ( line . startsWith ( "#" ) ) line = input . readLine ( ) ; /* * while ( input . ready ( ) & & line ! = null ) { */ // logger . ...
public class LongDoubleHashMap { /** * Compute the capacity needed for a given size . * @ param expectedSize expected size of the map * @ return capacity to use for the specified size */ private static int computeCapacity ( final int expectedSize ) { } }
if ( expectedSize == 0 ) { return 1 ; } final int capacity = ( int ) InternalFastMath . ceil ( expectedSize / LOAD_FACTOR ) ; final int powerOfTwo = Integer . highestOneBit ( capacity ) ; if ( powerOfTwo == capacity ) { return capacity ; } return nextPowerOfTwo ( capacity ) ;
public class AmbiguityLibrary { /** * 加载 * @ return */ private static synchronized Forest init ( String key , KV < String , Forest > kv , boolean reload ) { } }
Forest forest = kv . getV ( ) ; if ( forest != null ) { if ( reload ) { forest . clear ( ) ; } else { return forest ; } } else { forest = new Forest ( ) ; } try ( BufferedReader br = IOUtil . getReader ( PathToStream . stream ( kv . getK ( ) ) , "utf-8" ) ) { String temp ; LOG . debug ( "begin init ambiguity" ) ; long ...
public class ClientCallbackHandler { /** * This method is invoked by SASL for authentication challenges * @ param callbacks a collection of challenge callbacks */ public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { } }
for ( Callback c : callbacks ) { if ( c instanceof NameCallback ) { LOG . debug ( "name callback" ) ; } else if ( c instanceof PasswordCallback ) { LOG . debug ( "password callback" ) ; LOG . warn ( "Could not login: the client is being asked for a password, but the " + " client code does not currently support obtainin...
public class ValueEnforcer { /** * Check if * < code > nValue & gt ; nLowerBoundInclusive & amp ; & amp ; nValue & lt ; nUpperBoundInclusive < / code > * @ param aValue * Value * @ param aName * Name * @ param aLowerBoundExclusive * Lower bound * @ param aUpperBoundExclusive * Upper bound * @ return...
notNull ( aValue , aName ) ; notNull ( aLowerBoundExclusive , "LowerBoundInclusive" ) ; notNull ( aUpperBoundExclusive , "UpperBoundInclusive" ) ; if ( isEnabled ( ) ) if ( aValue . compareTo ( aLowerBoundExclusive ) <= 0 || aValue . compareTo ( aUpperBoundExclusive ) >= 0 ) throw new IllegalArgumentException ( "The va...
public class StaticTypeCheckingSupport { /** * Given a generics type representing SomeClass & lt ; T , V & gt ; and a resolved placeholder map , returns a new generics type * for which placeholders are resolved recursively . */ protected static GenericsType fullyResolve ( GenericsType gt , Map < GenericsTypeName , Ge...
GenericsType fromMap = placeholders . get ( new GenericsTypeName ( gt . getName ( ) ) ) ; if ( gt . isPlaceholder ( ) && fromMap != null ) { gt = fromMap ; } ClassNode type = fullyResolveType ( gt . getType ( ) , placeholders ) ; ClassNode lowerBound = gt . getLowerBound ( ) ; if ( lowerBound != null ) lowerBound = ful...
public class AmazonEC2Client { /** * Stops advertising an IPv4 address range that is provisioned as an address pool . * You can perform this operation at most once every 10 seconds , even if you specify different address ranges each * time . * It can take a few minutes before traffic to the specified addresses st...
request = beforeClientExecution ( request ) ; return executeWithdrawByoipCidr ( request ) ;
public class HistoryController { /** * Retrieve the history for a profile * @ param mode * @ param profileIdentifier * @ param clientUUID * @ param offset * @ param limit * @ param sourceURIFilters * @ param page * @ param rows * @ return * @ throws Exception */ @ RequestMapping ( value = "/api/hist...
Integer profileId = ControllerUtils . convertProfileIdentifier ( profileIdentifier ) ; HashMap < String , String [ ] > filters = new HashMap < String , String [ ] > ( ) ; if ( sourceURIFilters != null ) { filters . put ( Constants . HISTORY_FILTER_SOURCE_URI , sourceURIFilters ) ; } // rows exists because jqgrid uses i...
public class ThemeManager { /** * Only for system use */ @ SuppressLint ( "NewApi" ) public static void startActivity ( Context context , Intent intent , int requestCode , Bundle options ) { } }
final Activity activity = context instanceof Activity ? ( Activity ) context : null ; if ( activity != null && HoloEverywhere . ALWAYS_USE_PARENT_THEME ) { ThemeManager . cloneTheme ( activity . getIntent ( ) , intent , true ) ; } final int parentColorScheme = ThemeManager . getThemeType ( activity ) ; if ( parentColor...
public class ClientConfig { /** * Users can overload this method to define in which scenarios a request should result * in an ' intercepted ' page with proper windowId detection . This can e . g . contain * blacklisting some userAgents . * By default the following User - Agents will be served directly : * < ul ...
if ( ! isJavaScriptEnabled ( ) ) { return false ; } String userAgent = getUserAgent ( facesContext ) ; if ( userAgent != null && ( userAgent . indexOf ( "bot" ) >= 0 || // Googlebot , etc userAgent . indexOf ( "Bot" ) >= 0 || // BingBot , etc userAgent . indexOf ( "Slurp" ) >= 0 || // Yahoo Slurp userAgent . indexOf ( ...
public class HTODInvalidationBuffer { /** * Call this method to check whether a " full " condition is met to start LPBT . * @ return boolean - true means the condition " full " . */ @ Trivial public synchronized boolean isFull ( ) { } }
// final String methodName = " isFull ( ) " ; boolean isFull = false ; int size = this . explicitBuffer . size ( ) + this . scanBuffer . size ( ) + this . garbageCollectorBuffer . size ( ) ; if ( size > this . maxInvalidationBufferSize || ( System . currentTimeMillis ( ) - this . lastRemoveTime ) >= this . maxInvalidat...
public class PropertyDescription { /** * Returns the property ' s type */ public TypeDescription getType ( ) { } }
if ( mType == null ) { mType = getTeaToolsUtils ( ) . createTypeDescription ( getPropertyDescriptor ( ) . getPropertyType ( ) ) ; } return mType ;
public class DeviceiSCSIAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeviceiSCSIAttributes deviceiSCSIAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( deviceiSCSIAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceiSCSIAttributes . getTargetARN ( ) , TARGETARN_BINDING ) ; protocolMarshaller . marshall ( deviceiSCSIAttributes . getNetworkInterfaceId ( ) , NETWORKINTERFA...
public class HermesCommandLineApp { /** * Creates a corpus based on the command line parameters . * @ return the corpus */ public Corpus getCorpus ( ) { } }
return Corpus . builder ( ) . distributed ( distributed ) . source ( inputFormat , input ) . build ( ) ;
public class ClassLoaderResourceUtils { /** * Checks whether the class is present . * @ param classname * the name of class to be checked * @ return true if the class is present . */ public static boolean isClassPresent ( String classname ) { } }
try { Class . forName ( classname ) ; return true ; } catch ( ClassNotFoundException e ) { } return false ;
public class DescribeStacksResult { /** * Information about the stacks . * @ param stacks * Information about the stacks . */ public void setStacks ( java . util . Collection < Stack > stacks ) { } }
if ( stacks == null ) { this . stacks = null ; return ; } this . stacks = new java . util . ArrayList < Stack > ( stacks ) ;
public class Money { /** * Obtains an instance of { @ code Money } as the total value of an array . * The array must contain at least one monetary value . * Subsequent amounts are added as though using { @ link # plus ( Money ) } . * All amounts must be in the same currency . * @ param monies the monetary value...
MoneyUtils . checkNotNull ( monies , "Money array must not be null" ) ; if ( monies . length == 0 ) { throw new IllegalArgumentException ( "Money array must not be empty" ) ; } Money total = monies [ 0 ] ; MoneyUtils . checkNotNull ( total , "Money arary must not contain null entries" ) ; for ( int i = 1 ; i < monies ....
public class DruidCoordinatorRuntimeParams { /** * Creates a TreeSet sorted in { @ link DruidCoordinator # SEGMENT _ COMPARATOR _ RECENT _ FIRST } order and populates it with * the segments from the given iterable . The given iterable is iterated exactly once . No special action is taken if * duplicate segments are...
TreeSet < DataSegment > segmentsSet = new TreeSet < > ( DruidCoordinator . SEGMENT_COMPARATOR_RECENT_FIRST ) ; availableSegments . forEach ( segmentsSet :: add ) ; return segmentsSet ;
public class StandardBullhornData { /** * Makes the " search " api call with POST instead of GET * HTTP Method : POST * @ param type the BullhornEntity type * @ param query Lucene query string * @ param fieldSet the fields to return , if null or empty will default to " * " all * @ param params optional Search...
Map < String , String > uriVariables = restUriVariablesFactory . getUriVariablesForSearchWithPost ( BullhornEntityInfo . getTypesRestEntityName ( type ) , fieldSet , params ) ; String url = restUrlFactory . assembleSearchUrlWithPost ( params ) ; if ( Candidate . class == type ) { url = url + "&useV2=true" ; } JSONObjec...
public class JobTemplateSettings { /** * Use Inputs ( inputs ) to define the source file used in the transcode job . There can only be one input in a job * template . Using the API , you can include multiple inputs when referencing a job template . * < b > NOTE : < / b > This method appends the values to the existi...
if ( this . inputs == null ) { setInputs ( new java . util . ArrayList < InputTemplate > ( inputs . length ) ) ; } for ( InputTemplate ele : inputs ) { this . inputs . add ( ele ) ; } return this ;
public class ClassDocImpl { /** * Find constructor in this class . * @ param constrName the unqualified name to search for . * @ param paramTypes the array of Strings for constructor parameters . * @ return the first ConstructorDocImpl which matches , null if not found . */ public ConstructorDoc findConstructor (...
Names names = tsym . name . table . names ; for ( Symbol sym : tsym . members ( ) . getSymbolsByName ( names . fromString ( "<init>" ) ) ) { if ( sym . kind == MTH ) { if ( hasParameterTypes ( ( MethodSymbol ) sym , paramTypes ) ) { return env . getConstructorDoc ( ( MethodSymbol ) sym ) ; } } } // # # # ( gj ) As a te...
public class MemoryFileSystem { /** * { @ inheritDoc } */ public synchronized void remove ( Entry entry ) { } }
List < Entry > entries ; if ( entry == null ) { return ; } DirectoryEntry parent = entry . getParent ( ) ; if ( parent == null ) { return ; } else { entries = contents . get ( parent ) ; if ( entries == null ) { return ; } } for ( Iterator < Entry > i = entries . iterator ( ) ; i . hasNext ( ) ; ) { Entry e = ( Entry )...
public class Collectors { /** * Returns a { @ code Collector } that filters input elements . * @ param < T > the type of the input elements * @ param < A > the accumulation type * @ param < R > the type of the output elements * @ param predicate a predicate used to filter elements * @ param downstream the col...
final BiConsumer < A , ? super T > accumulator = downstream . accumulator ( ) ; return new CollectorsImpl < T , A , R > ( downstream . supplier ( ) , new BiConsumer < A , T > ( ) { @ Override public void accept ( A a , T t ) { if ( predicate . test ( t ) ) accumulator . accept ( a , t ) ; } } , downstream . finisher ( ...
public class GAEBlobServlet { /** * Encode header value for Content - Disposition */ private static String getEncodeFileName ( String userAgent , String fileName ) { } }
String encodedFileName = fileName ; try { if ( userAgent . contains ( "MSIE" ) || userAgent . contains ( "Opera" ) ) { encodedFileName = URLEncoder . encode ( fileName , "UTF-8" ) ; } else { encodedFileName = "=?UTF-8?B?" + new String ( BaseEncoding . base64 ( ) . encode ( fileName . getBytes ( "UTF-8" ) ) ) + "?=" ; }...
public class EhCacheProvider { /** * Load resource . * @ param configurationResourceName * the configuration resource name * @ return the uRL */ private URL loadResource ( String configurationResourceName ) { } }
ClassLoader standardClassloader = ClassLoaderUtil . getStandardClassLoader ( ) ; URL url = null ; if ( standardClassloader != null ) { url = standardClassloader . getResource ( configurationResourceName ) ; } if ( url == null ) { url = this . getClass ( ) . getResource ( configurationResourceName ) ; } log . info ( "Cr...
public class JNDIServiceBinder { /** * { @ inheritDoc } */ @ Override public void serviceChanged ( ServiceEvent event ) { } }
ServiceReference < ? > ref = event . getServiceReference ( ) ; switch ( event . getType ( ) ) { case ServiceEvent . REGISTERED : recordEntry ( ref ) ; break ; case ServiceEvent . MODIFIED : moveEntry ( ref ) ; break ; case ServiceEvent . MODIFIED_ENDMATCH : case ServiceEvent . UNREGISTERING : removeEntry ( ref ) ; brea...
public class Money { /** * < pre > * The 3 - letter currency code defined in ISO 4217. * < / pre > * < code > string currency _ code = 1 ; < / code > */ public java . lang . String getCurrencyCode ( ) { } }
java . lang . Object ref = currencyCode_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; currencyCode_ = s ; return s ; }
public class GwtFaceExampleStandalone { /** * CHECKSTYLE VISIBILITY MODIFIER : ON */ @ Override public void onModuleLoad ( ) { } }
SampleTree . setTreeTitle ( MESSAGES . treeTitle ( ) ) ; // layer samples SampleTreeNodeRegistry . addSampleTreeNode ( new SampleTreeNode ( MESSAGES . openCycleMapTitle ( ) , "[ISOMORPHIC]/geomajas/osgeo/layer-raster.png" , OpenCycleMapSample . TITLE , "Layers" , OpenCycleMapSample . FACTORY ) ) ; SampleTreeNodeRegistr...
public class ZookeeperRegistry { /** * 注册 服务信息 * @ param config * @ return * @ throws Exception */ protected void registerProviderUrls ( ProviderConfig config ) { } }
String appName = config . getAppName ( ) ; // 注册服务端节点 try { // 避免重复计算 List < String > urls ; if ( providerUrls . containsKey ( config ) ) { urls = providerUrls . get ( config ) ; } else { urls = ZookeeperRegistryHelper . convertProviderToUrls ( config ) ; providerUrls . put ( config , urls ) ; } if ( CommonUtils . isNo...
public class TargetEncoder { /** * Core method for applying pre - calculated encodings to the dataset . There are multiple overloaded methods that we will * probably be able to get rid off if we are not going to expose Java API for TE . * We can just stick to one signature that will suit internal representations of...
if ( noiseLevel < 0 ) throw new IllegalStateException ( "`_noiseLevel` must be non-negative" ) ; Frame dataWithAllEncodings = null ; try { dataWithAllEncodings = data . deepCopy ( Key . make ( ) . toString ( ) ) ; DKV . put ( dataWithAllEncodings ) ; ensureTargetColumnIsBinaryCategorical ( dataWithAllEncodings , target...
public class CalendarParserImpl { /** * Reads the next token from the tokeniser . * This method throws a ParseException when reading EOF . * @ param tokeniser * @ param in * @ param ignoreEOF * @ return int value of the ttype field of the tokeniser * @ throws ParseException When reading EOF . */ private int...
int token = tokeniser . nextToken ( ) ; if ( ! ignoreEOF && token == StreamTokenizer . TT_EOF ) { throw new ParserException ( "Unexpected end of file" , getLineNumber ( tokeniser , in ) ) ; } return token ;
public class FileBasedNamespaceMappings { /** * Returns a prefix for the namespace < code > uri < / code > . If a namespace * mapping exists , the already known prefix is returned ; otherwise a new * prefix is created and assigned to the namespace uri . * @ param uri the namespace uri . * @ return the prefix fo...
String prefix = uriToPrefix . get ( uri ) ; if ( prefix == null ) { // make sure prefix is not taken while ( prefixToURI . get ( String . valueOf ( prefixCount ) ) != null ) { prefixCount ++ ; } prefix = String . valueOf ( prefixCount ) ; prefixToURI . put ( prefix , uri ) ; uriToPrefix . put ( uri , prefix ) ; log . d...
public class OutputsInner { /** * Creates an output or replaces an already existing output under an existing streaming job . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param jobName The nam...
return createOrReplaceWithServiceResponseAsync ( resourceGroupName , jobName , outputName , output , ifMatch , ifNoneMatch ) . map ( new Func1 < ServiceResponseWithHeaders < OutputInner , OutputsCreateOrReplaceHeaders > , OutputInner > ( ) { @ Override public OutputInner call ( ServiceResponseWithHeaders < OutputInner ...
public class AnalyzeLocal { /** * Get a list of unique values from the specified columns of a sequence * @ param columnNames Name of the columns to get unique values from * @ param schema Data schema * @ param sequenceData Sequence data to get unique values from * @ return */ public static Map < String , Set < ...
Map < String , Set < Writable > > m = new HashMap < > ( ) ; for ( String s : columnNames ) { m . put ( s , new HashSet < > ( ) ) ; } while ( sequenceData . hasNext ( ) ) { List < List < Writable > > next = sequenceData . sequenceRecord ( ) ; for ( List < Writable > step : next ) { for ( String s : columnNames ) { int i...
public class StructureImpl { /** * { @ inheritDoc } */ @ Override public Group findGroup ( String chainName , String pdbResnum , int modelnr ) throws StructureException { } }
// if structure is xray there will be only one " model " . if ( modelnr > models . size ( ) ) throw new StructureException ( " no model nr " + modelnr + " in this structure. (contains " + models . size ( ) + ")" ) ; // first we need to gather all groups with the author id chainName : polymers , non - polymers and water...
public class HamcrestMatchers { /** * Creates a matcher for { @ linkplain Iterable } s that matches when a single pass over the examined * { @ linkplain Iterable } yields a series of items , that contains items logically equal to the corresponding item in * the specified items , in the same relative order For examp...
return IsIterableContainingInRelativeOrder . containsInRelativeOrder ( items ) ;
public class TiffReader { /** * Check tag type . * @ param tagid the tagid * @ param tagType the tag type * @ param n the n */ private boolean checkType ( int tagid , int tagType , int n ) { } }
if ( TiffTags . hasTag ( tagid ) && ! TiffTags . getTag ( tagid ) . getName ( ) . equals ( "IPTC" ) ) { boolean found = false ; String stagType = TiffTags . getTagTypeName ( tagType ) ; if ( stagType != null ) { if ( stagType . equals ( "SUBIFD" ) ) stagType = "IFD" ; if ( stagType . equals ( "UNDEFINED" ) ) stagType =...
public class HadoopDFSRule { /** * Copies the content of the given resource into Hadoop . * @ param filename File to be created * @ param resource Resource to copy * @ throws IOException Anything */ public void copyResource ( String filename , String resource ) throws IOException { } }
write ( filename , IOUtils . toByteArray ( getClass ( ) . getResource ( resource ) ) ) ;
public class BaseHybridHashTable { /** * The level parameter is needed so that we can have different hash functions when we * recursively apply the partitioning , so that the working set eventually fits into memory . */ public static int hash ( int hashCode , int level ) { } }
final int rotation = level * 11 ; int code = Integer . rotateLeft ( hashCode , rotation ) ; return code >= 0 ? code : - ( code + 1 ) ;
public class AbstractHibernateCriteriaBuilder { /** * Groovy moves the map to the first parameter if using the idiomatic form , e . g . * < code > eq ' firstName ' , ' Fred ' , ignoreCase : true < / code > . * @ param params optional map with customization parameters ; currently only ' ignoreCase ' is supported . ...
return eq ( propertyName , propertyValue , params ) ;
public class DaoService { /** * / * ( non - Javadoc ) * @ see org . esupportail . smsuapi . dao . DaoService # deleteSmsOlderThan ( java . util . Date ) */ public int deleteSmsOlderThan ( final Date date ) { } }
final String hql = "delete from Sms as sms where sms.Date < :date" ; final Query query = getCurrentSession ( ) . createQuery ( hql ) ; query . setTimestamp ( "date" , date ) ; final int nbSmsDeleted = query . executeUpdate ( ) ; return nbSmsDeleted ;
public class JCudnn { /** * < pre > * Derives a tensor descriptor from layer data descriptor for BatchNormalization * scale , invVariance , bnBias , bnScale tensors . Use this tensor desc for * bnScaleBiasMeanVarDesc and bnScaleBiasDiffDesc in Batch Normalization forward and backward functions . * < / pre > */ ...
return checkResult ( cudnnDeriveBNTensorDescriptorNative ( derivedBnDesc , xDesc , mode ) ) ;
public class RulesPlugin { /** * Figure out which classes extend the named class and return the current class and the extenders * @ param className * @ param engineMetadata * @ return list of class references */ private List < ClassReference > getClassReferences ( String className ) { } }
List < ClassReference > ret = new ArrayList < ClassReference > ( ) ; ClassReference cr = m_classReferenceMap . get ( className ) ; ret . addAll ( cr . getChildren ( ) ) ; return ret ;
public class JmsSyncProducer { /** * Retrieve the reply destination either by injected instance , destination name or * by creating a new temporary destination . * @ param session current JMS session * @ param message holding possible reply destination in header . * @ return the reply destination . * @ throws...
if ( message . getHeader ( org . springframework . messaging . MessageHeaders . REPLY_CHANNEL ) != null ) { if ( message . getHeader ( org . springframework . messaging . MessageHeaders . REPLY_CHANNEL ) instanceof Destination ) { return ( Destination ) message . getHeader ( org . springframework . messaging . MessageH...