signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JWTUtils { /** * Username from a given JWT Token * @ param token JWT Token * @ return Username from JWT Token . */ public static String getUsername ( String token ) { } }
String accessTokenPayload = token . substring ( token . indexOf ( "." ) + 1 , token . lastIndexOf ( "." ) ) ; byte [ ] decoded = Base64 . getMimeDecoder ( ) . decode ( accessTokenPayload ) ; String output = new String ( decoded ) ; Map < String , Object > myMap = new HashMap < String , Object > ( ) ; String result = "unknown" ; ObjectMapper objectMapper = new ObjectMapper ( ) ; try { myMap = objectMapper . readValue ( output , HashMap . class ) ; if ( myMap . get ( "sub" ) instanceof String ) { result = ( String ) myMap . get ( "sub" ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return result ;
public class ModelsImpl { /** * Get the explicit list of the pattern . any entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The Pattern . Any entity Id . * @ param itemId The explicit list item Id . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < ExplicitListItem > getExplicitListItemAsync ( UUID appId , String versionId , UUID entityId , long itemId , final ServiceCallback < ExplicitListItem > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getExplicitListItemWithServiceResponseAsync ( appId , versionId , entityId , itemId ) , serviceCallback ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } * { @ link CmisExtensionType } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "extension" , scope = CheckOutResponse . class ) public JAXBElement < CmisExtensionType > createCheckOutResponseExtension ( CmisExtensionType value ) { } }
return new JAXBElement < CmisExtensionType > ( _GetPropertiesExtension_QNAME , CmisExtensionType . class , CheckOutResponse . class , value ) ;
public class EditText { /** * @ return whether or not the cursor is visible ( assuming this TextView is editable ) * @ see # setCursorVisible ( boolean ) * @ attr ref android . R . styleable # TextView _ cursorVisible */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public boolean isCursorVisible ( ) { } }
return Build . VERSION . SDK_INT < Build . VERSION_CODES . JELLY_BEAN || mInputView . isCursorVisible ( ) ;
public class UpdateEvaluationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateEvaluationRequest updateEvaluationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateEvaluationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateEvaluationRequest . getEvaluationId ( ) , EVALUATIONID_BINDING ) ; protocolMarshaller . marshall ( updateEvaluationRequest . getEvaluationName ( ) , EVALUATIONNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Statistics { /** * < p > tally . < / p > * @ param other a { @ link com . greenpepper . Statistics } object . */ public void tally ( Statistics other ) { } }
rightCount += other . rightCount ( ) ; wrongCount += other . wrongCount ( ) ; ignoredCount += other . ignoredCount ( ) ; exceptionCount += other . exceptionCount ( ) ;
public class YearMonth { /** * { @ inheritDoc } * @ throws DateTimeException { @ inheritDoc } * @ throws ArithmeticException { @ inheritDoc } */ @ Override public YearMonth plus ( long amountToAdd , TemporalUnit unit ) { } }
if ( unit instanceof ChronoUnit ) { switch ( ( ChronoUnit ) unit ) { case MONTHS : return plusMonths ( amountToAdd ) ; case YEARS : return plusYears ( amountToAdd ) ; case DECADES : return plusYears ( Jdk8Methods . safeMultiply ( amountToAdd , 10 ) ) ; case CENTURIES : return plusYears ( Jdk8Methods . safeMultiply ( amountToAdd , 100 ) ) ; case MILLENNIA : return plusYears ( Jdk8Methods . safeMultiply ( amountToAdd , 1000 ) ) ; case ERAS : return with ( ERA , Jdk8Methods . safeAdd ( getLong ( ERA ) , amountToAdd ) ) ; } throw new UnsupportedTemporalTypeException ( "Unsupported unit: " + unit ) ; } return unit . addTo ( this , amountToAdd ) ;
public class EventsApi { /** * Get a Stream of events for the authenticated user . * < pre > < code > GitLab Endpoint : GET / events < / code > < / pre > * @ param action include only events of a particular action type , optional * @ param targetType include only events of a particular target type , optional * @ param before include only events created before a particular date , optional * @ param after include only events created after a particular date , optional * @ param sortOrder sort events in ASC or DESC order by created _ at . Default is DESC , optional * @ return a Stream of events for the authenticated user and matching the supplied parameters * @ throws GitLabApiException if any exception occurs */ public Stream < Event > getAuthenticatedUserEventsStream ( ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { } }
return ( getAuthenticatedUserEvents ( action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . stream ( ) ) ;
public class CmsFavoriteTab { /** * Starts the editing . < p > * @ param event the click event */ @ UiHandler ( "m_editButton" ) void editAction ( ClickEvent event ) { } }
m_clipboard . enableFavoritesEdit ( ) ; m_buttonUsePanel . setVisible ( false ) ; m_buttonEditingPanel . setVisible ( true ) ;
public class GraphRunner { /** * Convert a json string written out * by { @ link com . github . os72 . protobuf351 . util . JsonFormat } * to a { @ link org . bytedeco . tensorflow . ConfigProto } * @ param json the json to read * @ return the config proto to use */ public static org . tensorflow . framework . ConfigProto fromJson ( String json ) { } }
org . tensorflow . framework . ConfigProto . Builder builder = org . tensorflow . framework . ConfigProto . newBuilder ( ) ; try { JsonFormat . parser ( ) . merge ( json , builder ) ; org . tensorflow . framework . ConfigProto build = builder . build ( ) ; ByteString serialized = build . toByteString ( ) ; byte [ ] binaryString = serialized . toByteArray ( ) ; org . tensorflow . framework . ConfigProto configProto = org . tensorflow . framework . ConfigProto . parseFrom ( binaryString ) ; return configProto ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ;
public class UserPoolClientType { /** * A list of allowed < code > OAuth < / code > scopes . Currently supported values are < code > " phone " < / code > , * < code > " email " < / code > , < code > " openid " < / code > , and < code > " Cognito " < / code > . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAllowedOAuthScopes ( java . util . Collection ) } or { @ link # withAllowedOAuthScopes ( java . util . Collection ) } if * you want to override the existing values . * @ param allowedOAuthScopes * A list of allowed < code > OAuth < / code > scopes . Currently supported values are < code > " phone " < / code > , * < code > " email " < / code > , < code > " openid " < / code > , and < code > " Cognito " < / code > . * @ return Returns a reference to this object so that method calls can be chained together . */ public UserPoolClientType withAllowedOAuthScopes ( String ... allowedOAuthScopes ) { } }
if ( this . allowedOAuthScopes == null ) { setAllowedOAuthScopes ( new java . util . ArrayList < String > ( allowedOAuthScopes . length ) ) ; } for ( String ele : allowedOAuthScopes ) { this . allowedOAuthScopes . add ( ele ) ; } return this ;
public class ClientTransportImpl { /** * Get realm by URL . * @ param sUrl URL string . * @ return realm name or null . * @ throws IOException transport exception . * @ throws ModuleException ModuleException . */ private String getRealm ( String sUrl ) throws IOException , ModuleException { } }
AuthorizationHandler ah = AuthorizationInfo . getAuthHandler ( ) ; try { URL url = new URL ( sUrl ) ; HTTPConnection connection = new HTTPConnection ( url ) ; connection . removeModule ( CookieModule . class ) ; AuthorizationInfo . setAuthHandler ( null ) ; HTTPResponse resp = connection . Get ( url . getFile ( ) ) ; String authHeader = resp . getHeader ( "WWW-Authenticate" ) ; if ( authHeader == null ) { return null ; } String realm = authHeader . split ( "=" ) [ 1 ] ; realm = realm . substring ( 1 , realm . length ( ) - 1 ) ; return realm ; } finally { AuthorizationInfo . setAuthHandler ( ah ) ; }
public class ConstrainedExecutorService { /** * Submit a task to be executed in the future . * @ param runnable The task to be executed . */ @ Override public void execute ( Runnable runnable ) { } }
if ( runnable == null ) { throw new NullPointerException ( "runnable parameter is null" ) ; } if ( ! mWorkQueue . offer ( runnable ) ) { throw new RejectedExecutionException ( mName + " queue is full, size=" + mWorkQueue . size ( ) ) ; } final int queueSize = mWorkQueue . size ( ) ; final int maxSize = mMaxQueueSize . get ( ) ; if ( ( queueSize > maxSize ) && mMaxQueueSize . compareAndSet ( maxSize , queueSize ) ) { FLog . v ( TAG , "%s: max pending work in queue = %d" , mName , queueSize ) ; } // else , there was a race and another thread updated and logged the max queue size startWorkerIfNeeded ( ) ;
public class Client { /** * Generates an access token for a user * @ param userId * Id of the user * @ param expiresIn * Set the duration of the token in seconds . ( default : 259200 seconds = 72h ) * 72 hours is the max value . * @ return Created MFAToken * @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection * @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled * @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor * @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / multi - factor - authentication / generate - mfa - token " > Generate MFA Token documentation < / a > */ public MFAToken generateMFAToken ( long userId , Integer expiresIn ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } }
return generateMFAToken ( userId , expiresIn , false ) ;
public class OptGroupDropDownChoice { /** * { @ inheritDoc } */ @ Override protected void appendOptionHtml ( final AppendingStringBuffer buffer , final T choice , final int index , final String selected ) { } }
final T currentOptGroup = choice ; if ( isNewGroup ( currentOptGroup ) ) { if ( ! isFirst ( index ) ) { buffer . append ( CLOSE_OPTGROUP_TAG ) ; } appendOptGroupLabel ( buffer , currentOptGroup ) ; } super . appendOptionHtml ( buffer , choice , index , selected ) ; if ( isLast ( index ) ) { buffer . append ( CLOSE_OPTGROUP_TAG ) ; } last = currentOptGroup ;
public class GrpSettings { /** * Sets the provider value for this GrpSettings . * @ param provider * Specifies the GRP provider of the { @ link LineItem } . */ public void setProvider ( com . google . api . ads . admanager . axis . v201811 . GrpProvider provider ) { } }
this . provider = provider ;
public class EmailUtils { /** * Send a job failure alert email . * @ param jobName job name * @ param message email message * @ param failures number of consecutive job failures * @ param jobState a { @ link State } object carrying job configuration properties * @ throws EmailException if there is anything wrong sending the email */ public static void sendJobFailureAlertEmail ( String jobName , String message , int failures , State jobState ) throws EmailException { } }
sendEmail ( jobState , String . format ( "Gobblin alert: job %s has failed %d %s consecutively in the past" , jobName , failures , failures > 1 ? "times" : "time" ) , message ) ;
public class ScanResult { /** * Determine whether the classpath contents have been modified since the last scan . Checks the timestamps of * files and jarfiles encountered during the previous scan to see if they have changed . Does not perform a full * scan , so cannot detect the addition of directories that newly match whitelist criteria - - you need to perform * a full scan to detect those changes . * @ return true if the classpath contents have been modified since the last scan . */ public boolean classpathContentsModifiedSinceScan ( ) { } }
if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } if ( fileToLastModified == null ) { return true ; } else { for ( final Entry < File , Long > ent : fileToLastModified . entrySet ( ) ) { if ( ent . getKey ( ) . lastModified ( ) != ent . getValue ( ) ) { return true ; } } return false ; }
public class PluginManager { /** * Gets the current instance of plugin manager * @ return PluginManager */ public static PluginManager getInstance ( ) { } }
if ( _instance == null ) { _instance = new PluginManager ( ) ; _instance . classInformation = new HashMap < String , ClassInformation > ( ) ; _instance . methodInformation = new HashMap < String , com . groupon . odo . proxylib . models . Method > ( ) ; _instance . jarInformation = new ArrayList < String > ( ) ; if ( _instance . proxyLibPath == null ) { // Get the System Classloader ClassLoader sysClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; // Get the URLs URL [ ] urls = ( ( URLClassLoader ) sysClassLoader ) . getURLs ( ) ; for ( int i = 0 ; i < urls . length ; i ++ ) { if ( urls [ i ] . getFile ( ) . contains ( "proxylib" ) ) { // store the path to the proxylib _instance . proxyLibPath = urls [ i ] . getFile ( ) ; break ; } } } _instance . initializePlugins ( ) ; } return _instance ;
public class AggressiveUrlCanonicalizer { /** * Run a regex against a StringBuilder , removing group 1 if it matches . * Assumes the regex has a form that wants to strip elements of the passed * string . Assumes that if a match , group 1 should be removed * @ param url Url to search in . * @ param matcher Matcher whose form yields a group to remove * @ return true if the StringBuilder was modified */ protected boolean doStripRegexMatch ( StringBuilder url , Matcher matcher ) { } }
if ( matcher != null && matcher . matches ( ) ) { url . delete ( matcher . start ( 1 ) , matcher . end ( 1 ) ) ; return true ; } return false ;
public class JDBCConnection { /** * # ifdef JAVA6 */ public Array createArrayOf ( String typeName , Object [ ] elements ) throws SQLException { } }
checkClosed ( ) ; throw Util . notSupported ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcReflectanceMethodEnum ( ) { } }
if ( ifcReflectanceMethodEnumEEnum == null ) { ifcReflectanceMethodEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1049 ) ; } return ifcReflectanceMethodEnumEEnum ;
public class ResultPartitionMetrics { /** * Iterates over all sub - partitions and collects the minimum number of queued buffers in a * sub - partition in a best - effort way . * @ return minimum number of queued buffers per sub - partition ( < tt > 0 < / tt > if sub - partitions exist ) */ int refreshAndGetMin ( ) { } }
int min = Integer . MAX_VALUE ; ResultSubpartition [ ] allPartitions = partition . getAllPartitions ( ) ; if ( allPartitions . length == 0 ) { // meaningful value when no channels exist : return 0 ; } for ( ResultSubpartition part : allPartitions ) { int size = part . unsynchronizedGetNumberOfQueuedBuffers ( ) ; min = Math . min ( min , size ) ; } return min ;
public class nstrafficdomain_vlan_binding { /** * Use this API to fetch nstrafficdomain _ vlan _ binding resources of given name . */ public static nstrafficdomain_vlan_binding [ ] get ( nitro_service service , Long td ) throws Exception { } }
nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding ( ) ; obj . set_td ( td ) ; nstrafficdomain_vlan_binding response [ ] = ( nstrafficdomain_vlan_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class RemoteFileUtil { /** * Copy a single file from local source to remote destination */ private static void copyToRemote ( Path src , URI dst ) throws IOException { } }
ResourceId dstId = FileSystems . matchNewResource ( dst . toString ( ) , false ) ; WritableByteChannel dstCh = FileSystems . create ( dstId , MimeTypes . BINARY ) ; FileChannel srcCh = FileChannel . open ( src , StandardOpenOption . READ ) ; long srcSize = srcCh . size ( ) ; long copied = 0 ; do { copied += srcCh . transferTo ( copied , srcSize - copied , dstCh ) ; } while ( copied < srcSize ) ; dstCh . close ( ) ; srcCh . close ( ) ; Preconditions . checkState ( copied == srcSize ) ;
public class CommerceShipmentItemPersistenceImpl { /** * Clears the cache for all commerce shipment items . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceShipmentItemImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class TextUtils { /** * Parses the following strings : key1 = value1 , value2 , value3 ; key2 = value4 , value5 * @ param data a string of the specified format * @ return a map with parsed keys and values */ public static Map < String , Set < String > > parseAssignment ( String data ) { } }
Map < String , Set < String > > ret = new HashMap < > ( ) ; if ( data != null ) { StringTokenizer stringTokenizer = new StringTokenizer ( data , String . format ( "%s%s%s" , EQUALITY , COMMA , SEMICOLON ) , true ) ; String key = null ; Set < String > value = new HashSet < > ( ) ; int counter = 0 ; while ( stringTokenizer . hasMoreTokens ( ) ) { String token = stringTokenizer . nextToken ( ) ; if ( isValueDelimiter ( token ) ) { continue ; } else if ( isKeyDelimiter ( token ) && key != null ) { ret . put ( key , value ) ; counter = 0 ; key = null ; value = new HashSet < > ( ) ; continue ; } else if ( counter == 0 ) { key = token . trim ( ) ; } else { String trimmedValue = token . trim ( ) ; if ( ! StringUtils . isEmpty ( trimmedValue ) ) { value . add ( trimmedValue ) ; } } counter ++ ; } if ( key != null ) { ret . put ( key , value ) ; } } return ret ;
public class ClockProPolicy { /** * Delete meta data data , update hands accordingly . */ private void delete ( Node node ) { } }
if ( handHot == node ) { handHot = node . next ; } if ( handCold == node ) { handCold = node . next ; } if ( handTest == node ) { handTest = node . next ; } node . remove ( ) ;
public class SipApplicationSessionImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipApplicationSession # setExpires ( int ) */ @ SuppressWarnings ( value = "unchecked" ) public int setExpires ( int deltaMinutes ) { } }
if ( ! isValid ( ) ) { throw new IllegalStateException ( "Impossible to change the sip application " + "session timeout when it has been invalidated !" ) ; } expired = false ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Postponing the expiratin of the sip application session " + key + " to expire in " + deltaMinutes + " minutes." ) ; } if ( deltaMinutes <= 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "The sip application session " + key + " won't expire anymore " ) ; } // If the session timeout value is 0 or less , then an application session timer // never starts for the SipApplicationSession object and the container // does not consider the object to ever have expired // this . expirationTime = - 1; if ( expirationTimerTask != null ) { cancelExpirationTimer ( ) ; // Fix for Issue 1678 : SipApplicationSession . setExpires ( ) doesn ' t work sometimes // the global sipApplicationSessionTimeout needs to be reset as well sipApplicationSessionTimeout = deltaMinutes ; } return Integer . MAX_VALUE ; } else { long deltaMilliseconds = 0 ; // if ( expirationTimerTask ! = null ) { // extending the app session life time // expirationTime = expirationTimerFuture . getDelay ( TimeUnit . MILLISECONDS ) + deltaMinutes * 1000 * 60; deltaMilliseconds = deltaMinutes * 1000L * 60 ; // } else { // the app session was scheduled to never expire and now an expiration time is set // deltaMilliseconds = deltaMinutes * 1000L * 60; // Fix for Issue 1678 : SipApplicationSession . setExpires ( ) doesn ' t work sometimes // the global sipApplicationSessionTimeout needs to be reset as well sipApplicationSessionTimeout = deltaMilliseconds ; expirationTime = System . currentTimeMillis ( ) + deltaMilliseconds ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Setting expirationTime to " + expirationTime + " on sip application session " + key ) ; logger . debug ( "Re-Scheduling sip application session " + key + " to expire in " + deltaMinutes + " minutes" ) ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTimeInMillis ( expirationTime ) ; logger . debug ( "sip application session " + key + " will expires at " + new SimpleDateFormat ( ) . format ( calendar . getTime ( ) ) ) ; } final long milisecondsToGive = deltaMilliseconds ; // Run the timer in different transaction new Thread ( ) { @ Override public void run ( ) { if ( expirationTimerTask != null ) { cancelExpirationTimer ( ) ; // expirationTimerFuture = null ; } expirationTimerTask = sipContext . getSipApplicationSessionTimerService ( ) . createSipApplicationSessionTimerTask ( SipApplicationSessionImpl . this ) ; expirationTimerTask = sipContext . getSipApplicationSessionTimerService ( ) . schedule ( expirationTimerTask , milisecondsToGive , TimeUnit . MILLISECONDS ) ; } } . start ( ) ; return deltaMinutes ; }
public class JumboEnumSet { /** * Recalculates the size of the set . Returns true if it ' s changed . */ private boolean recalculateSize ( ) { } }
int oldSize = size ; size = 0 ; for ( long elt : elements ) size += Long . bitCount ( elt ) ; return size != oldSize ;
public class responderparam { /** * Use this API to fetch all the responderparam resources that are configured on netscaler . */ public static responderparam get ( nitro_service service ) throws Exception { } }
responderparam obj = new responderparam ( ) ; responderparam [ ] response = ( responderparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class BasicBundleRenderer { /** * / * ( non - Javadoc ) * @ see net . jawr . web . resource . bundle . renderer . AbstractBundleLinkRenderer # renderLink ( java . lang . String ) */ protected String renderLink ( String fullPath ) { } }
renderedLinks . add ( new RenderedLink ( fullPath , bundler . getConfig ( ) . isDebugModeOn ( ) ) ) ; return fullPath ;
public class CodeGenerator { /** * generate < code > decode < / code > method source code * @ return */ private String getDecodeMethodCode ( ) { } }
StringBuilder code = new StringBuilder ( ) ; code . append ( "public " ) . append ( ClassHelper . getInternalName ( cls . getCanonicalName ( ) ) ) ; code . append ( " decode(byte[] bb) throws IOException {" ) . append ( LINE_BREAK ) ; code . append ( "CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length)" ) . append ( JAVA_LINE_BREAK ) ; getParseBytesMethodCode ( code ) ; return code . toString ( ) ;
public class CPDefinitionInventoryPersistenceImpl { /** * Returns the first cp definition inventory in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition inventory * @ throws NoSuchCPDefinitionInventoryException if a matching cp definition inventory could not be found */ @ Override public CPDefinitionInventory findByUuid_C_First ( String uuid , long companyId , OrderByComparator < CPDefinitionInventory > orderByComparator ) throws NoSuchCPDefinitionInventoryException { } }
CPDefinitionInventory cpDefinitionInventory = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( cpDefinitionInventory != null ) { return cpDefinitionInventory ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", companyId=" ) ; msg . append ( companyId ) ; msg . append ( "}" ) ; throw new NoSuchCPDefinitionInventoryException ( msg . toString ( ) ) ;
public class JSONs { /** * Read partitions of nodes . * @ param mo the associated model to browse * @ param o the object to parse * @ param id the key in the map that points to the partitions * @ return the parsed partition * @ throws JSONConverterException if the key does not point to partitions of nodes */ public static Set < Collection < Node > > requiredNodePart ( Model mo , JSONObject o , String id ) throws JSONConverterException { } }
Set < Collection < Node > > nodes = new HashSet < > ( ) ; Object x = o . get ( id ) ; if ( ! ( x instanceof JSONArray ) ) { throw new JSONConverterException ( "Set of identifiers sets expected at key '" + id + "'" ) ; } for ( Object obj : ( JSONArray ) x ) { nodes . add ( nodesFromJSON ( mo , ( JSONArray ) obj ) ) ; } return nodes ;
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write the start of an extension operation . < / p > * @ param attributes String name / value pairs for extension element attributes * @ throws IOException if an input / output error occurs * @ since 2.0 */ public void startExtension ( Map < String , String > attributes ) throws IOException { } }
startChangesIfNecessary ( ) ; ResponseWriter writer = getWrapped ( ) ; writer . startElement ( "extension" , null ) ; if ( attributes != null && ! attributes . isEmpty ( ) ) { for ( Map . Entry < String , String > entry : attributes . entrySet ( ) ) { writer . writeAttribute ( entry . getKey ( ) , entry . getValue ( ) , null ) ; } }
public class AbstractConsoleEditor { /** * Hides the editor screen and restore the { @ link Terminal } . */ public void hide ( ) { } }
console . out ( ) . print ( "\33[" + 1 + ";" + terminal . getHeight ( ) + ";r" ) ; // Erase screen doesn ' t behave well on windows . for ( int l = 1 ; l <= terminal . getHeight ( ) ; l ++ ) { console . out ( ) . print ( ansi ( ) . cursor ( l , 1 ) ) ; console . out ( ) . print ( ansi ( ) . eraseLine ( Erase . FORWARD ) ) ; } console . out ( ) . print ( ansi ( ) . cursor ( 1 , 1 ) ) ; flush ( ) ; try { terminal . restore ( ) ; } catch ( Exception e ) { // noop }
public class PoolStatisticsImpl { /** * Add delta to total blocking timeout * @ param delta The value */ public void deltaTotalBlockingTime ( long delta ) { } }
if ( enabled . get ( ) && delta > 0 ) { totalBlockingTime . addAndGet ( delta ) ; totalBlockingTimeInvocations . incrementAndGet ( ) ; if ( delta > maxWaitTime . get ( ) ) maxWaitTime . set ( delta ) ; }
public class CmsDialog { /** * Displays the throwable on the error page and logs the error . < p > * @ param wp the workplace class * @ param t the throwable to be displayed on the error page * @ throws JspException if the include of the error page jsp fails */ public void includeErrorpage ( CmsWorkplace wp , Throwable t ) throws JspException { } }
CmsLog . getLog ( wp ) . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_WORKPLACE_DIALOG_0 ) , t ) ; getJsp ( ) . getRequest ( ) . setAttribute ( SESSION_WORKPLACE_CLASS , wp ) ; getJsp ( ) . getRequest ( ) . setAttribute ( ATTRIBUTE_THROWABLE , t ) ; getJsp ( ) . include ( FILE_DIALOG_SCREEN_ERRORPAGE ) ;
public class Resolve { /** * Is class accessible in given evironment ? * @ param env The current environment . * @ param c The class whose accessibility is checked . */ public boolean isAccessible ( Env < AttrContext > env , TypeSymbol c ) { } }
return isAccessible ( env , c , false ) ;
public class AtomicStampedReference { /** * Atomically sets the value of both the reference and stamp * to the given update values if the * current reference is { @ code = = } to the expected reference * and the current stamp is equal to the expected stamp . * @ param expectedReference the expected value of the reference * @ param newReference the new value for the reference * @ param expectedStamp the expected value of the stamp * @ param newStamp the new value for the stamp * @ return { @ code true } if successful */ public boolean compareAndSet ( V expectedReference , V newReference , int expectedStamp , int newStamp ) { } }
Pair < V > current = pair ; return expectedReference == current . reference && expectedStamp == current . stamp && ( ( newReference == current . reference && newStamp == current . stamp ) || casPair ( current , Pair . of ( newReference , newStamp ) ) ) ;
public class AbstractJacksonBackedStringSerializer { /** * Configure mapper . * @ param mapper the mapper */ protected void configureObjectMapper ( final ObjectMapper mapper ) { } }
mapper . configure ( SerializationFeature . FAIL_ON_EMPTY_BEANS , false ) . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; mapper . setSerializationInclusion ( JsonInclude . Include . NON_EMPTY ) ; mapper . setVisibility ( PropertyAccessor . SETTER , JsonAutoDetect . Visibility . PROTECTED_AND_PUBLIC ) ; mapper . setVisibility ( PropertyAccessor . GETTER , JsonAutoDetect . Visibility . PROTECTED_AND_PUBLIC ) ; mapper . setVisibility ( PropertyAccessor . IS_GETTER , JsonAutoDetect . Visibility . PROTECTED_AND_PUBLIC ) ; if ( isDefaultTypingEnabled ( ) ) { mapper . enableDefaultTyping ( ObjectMapper . DefaultTyping . NON_FINAL , JsonTypeInfo . As . PROPERTY ) ; } mapper . findAndRegisterModules ( ) ;
public class TableSubject { /** * Fails if the table contains the given cell . */ public void doesNotContainCell ( @ NullableDecl Object rowKey , @ NullableDecl Object colKey , @ NullableDecl Object value ) { } }
doesNotContainCell ( Tables . < Object , Object , Object > immutableCell ( rowKey , colKey , value ) ) ;
public class Fragments { /** * Create a traversal that filters to only vertices */ static < T > GraphTraversal < T , Vertex > isVertex ( GraphTraversal < T , ? extends Element > traversal ) { } }
// This cast is safe because we filter only to vertices // noinspection unchecked return ( GraphTraversal < T , Vertex > ) traversal . filter ( e -> e . get ( ) instanceof Vertex ) ;
public class MDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . MDD__XM_BASE : setXmBase ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__YM_BASE : setYmBase ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__XM_UNITS : setXmUnits ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__YM_UNITS : setYmUnits ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__XM_SIZE : setXmSize ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__YM_SIZE : setYmSize ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__MDD_FLGS : setMDDFlgs ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class EnvironmentResourceDescription { /** * The < code > AutoScalingGroups < / code > used by this environment . * @ return The < code > AutoScalingGroups < / code > used by this environment . */ public java . util . List < AutoScalingGroup > getAutoScalingGroups ( ) { } }
if ( autoScalingGroups == null ) { autoScalingGroups = new com . amazonaws . internal . SdkInternalList < AutoScalingGroup > ( ) ; } return autoScalingGroups ;
public class ActionExecutionResultMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ActionExecutionResult actionExecutionResult , ProtocolMarshaller protocolMarshaller ) { } }
if ( actionExecutionResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( actionExecutionResult . getExternalExecutionId ( ) , EXTERNALEXECUTIONID_BINDING ) ; protocolMarshaller . marshall ( actionExecutionResult . getExternalExecutionSummary ( ) , EXTERNALEXECUTIONSUMMARY_BINDING ) ; protocolMarshaller . marshall ( actionExecutionResult . getExternalExecutionUrl ( ) , EXTERNALEXECUTIONURL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "factorial" ) public JAXBElement < ArithType > createFactorial ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Factorial_QNAME , ArithType . class , null , value ) ;
public class HelpWriter { /** * Add the help file contents from the resource file to the content tree . While adding the * help file contents it also keeps track of user options . If " - notree " * is used , then the " overview - tree . html " will not get added and hence * help information also will not get added . * @ param contentTree the content tree to which the help file contents will be added */ protected void addHelpFileContents ( Content contentTree ) { } }
Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , false , HtmlStyle . title , getResource ( "doclet.Help_line_1" ) ) ; Content div = HtmlTree . DIV ( HtmlStyle . header , heading ) ; Content line2 = HtmlTree . DIV ( HtmlStyle . subTitle , getResource ( "doclet.Help_line_2" ) ) ; div . addContent ( line2 ) ; if ( configuration . allowTag ( HtmlTag . MAIN ) ) { mainTree . addContent ( div ) ; } else { contentTree . addContent ( div ) ; } HtmlTree htmlTree ; HtmlTree ul = new HtmlTree ( HtmlTag . UL ) ; ul . addStyle ( HtmlStyle . blockList ) ; if ( configuration . createoverview ) { Content overviewHeading = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Overview" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( overviewHeading ) : HtmlTree . LI ( HtmlStyle . blockList , overviewHeading ) ; Content line3 = getResource ( "doclet.Help_line_3" , getHyperLink ( DocPaths . OVERVIEW_SUMMARY , configuration . getText ( "doclet.Overview" ) ) ) ; Content overviewPara = HtmlTree . P ( line3 ) ; htmlTree . addContent ( overviewPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } } Content packageHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Package" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( packageHead ) : HtmlTree . LI ( HtmlStyle . blockList , packageHead ) ; Content line4 = getResource ( "doclet.Help_line_4" ) ; Content packagePara = HtmlTree . P ( line4 ) ; htmlTree . addContent ( packagePara ) ; HtmlTree ulPackage = new HtmlTree ( HtmlTag . UL ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.Interfaces_Italic" ) ) ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.Classes" ) ) ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.Enums" ) ) ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.Exceptions" ) ) ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.Errors" ) ) ) ; ulPackage . addContent ( HtmlTree . LI ( getResource ( "doclet.AnnotationTypes" ) ) ) ; htmlTree . addContent ( ulPackage ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content classHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_5" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( classHead ) : HtmlTree . LI ( HtmlStyle . blockList , classHead ) ; Content line6 = getResource ( "doclet.Help_line_6" ) ; Content classPara = HtmlTree . P ( line6 ) ; htmlTree . addContent ( classPara ) ; HtmlTree ul1 = new HtmlTree ( HtmlTag . UL ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_7" ) ) ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_8" ) ) ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_9" ) ) ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_10" ) ) ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_11" ) ) ) ; ul1 . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_12" ) ) ) ; htmlTree . addContent ( ul1 ) ; HtmlTree ul2 = new HtmlTree ( HtmlTag . UL ) ; ul2 . addContent ( HtmlTree . LI ( getResource ( "doclet.Nested_Class_Summary" ) ) ) ; ul2 . addContent ( HtmlTree . LI ( getResource ( "doclet.Field_Summary" ) ) ) ; ul2 . addContent ( HtmlTree . LI ( getResource ( "doclet.Constructor_Summary" ) ) ) ; ul2 . addContent ( HtmlTree . LI ( getResource ( "doclet.Method_Summary" ) ) ) ; htmlTree . addContent ( ul2 ) ; HtmlTree ul3 = new HtmlTree ( HtmlTag . UL ) ; ul3 . addContent ( HtmlTree . LI ( getResource ( "doclet.Field_Detail" ) ) ) ; ul3 . addContent ( HtmlTree . LI ( getResource ( "doclet.Constructor_Detail" ) ) ) ; ul3 . addContent ( HtmlTree . LI ( getResource ( "doclet.Method_Detail" ) ) ) ; htmlTree . addContent ( ul3 ) ; Content line13 = getResource ( "doclet.Help_line_13" ) ; Content para = HtmlTree . P ( line13 ) ; htmlTree . addContent ( para ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } // Annotation Types Content aHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.AnnotationType" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( aHead ) : HtmlTree . LI ( HtmlStyle . blockList , aHead ) ; Content aline1 = getResource ( "doclet.Help_annotation_type_line_1" ) ; Content aPara = HtmlTree . P ( aline1 ) ; htmlTree . addContent ( aPara ) ; HtmlTree aul = new HtmlTree ( HtmlTag . UL ) ; aul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_annotation_type_line_2" ) ) ) ; aul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_annotation_type_line_3" ) ) ) ; aul . addContent ( HtmlTree . LI ( getResource ( "doclet.Annotation_Type_Required_Member_Summary" ) ) ) ; aul . addContent ( HtmlTree . LI ( getResource ( "doclet.Annotation_Type_Optional_Member_Summary" ) ) ) ; aul . addContent ( HtmlTree . LI ( getResource ( "doclet.Annotation_Type_Member_Detail" ) ) ) ; htmlTree . addContent ( aul ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } // Enums Content enumHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Enum" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( enumHead ) : HtmlTree . LI ( HtmlStyle . blockList , enumHead ) ; Content eline1 = getResource ( "doclet.Help_enum_line_1" ) ; Content enumPara = HtmlTree . P ( eline1 ) ; htmlTree . addContent ( enumPara ) ; HtmlTree eul = new HtmlTree ( HtmlTag . UL ) ; eul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_enum_line_2" ) ) ) ; eul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_enum_line_3" ) ) ) ; eul . addContent ( HtmlTree . LI ( getResource ( "doclet.Enum_Constant_Summary" ) ) ) ; eul . addContent ( HtmlTree . LI ( getResource ( "doclet.Enum_Constant_Detail" ) ) ) ; htmlTree . addContent ( eul ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } if ( configuration . classuse ) { Content useHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_14" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( useHead ) : HtmlTree . LI ( HtmlStyle . blockList , useHead ) ; Content line15 = getResource ( "doclet.Help_line_15" ) ; Content usePara = HtmlTree . P ( line15 ) ; htmlTree . addContent ( usePara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } } if ( configuration . createtree ) { Content treeHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_16" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( treeHead ) : HtmlTree . LI ( HtmlStyle . blockList , treeHead ) ; Content line17 = getResource ( "doclet.Help_line_17_with_tree_link" , getHyperLink ( DocPaths . OVERVIEW_TREE , configuration . getText ( "doclet.Class_Hierarchy" ) ) , HtmlTree . CODE ( new StringContent ( "java.lang.Object" ) ) ) ; Content treePara = HtmlTree . P ( line17 ) ; htmlTree . addContent ( treePara ) ; HtmlTree tul = new HtmlTree ( HtmlTag . UL ) ; tul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_18" ) ) ) ; tul . addContent ( HtmlTree . LI ( getResource ( "doclet.Help_line_19" ) ) ) ; htmlTree . addContent ( tul ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } } if ( ! ( configuration . nodeprecatedlist || configuration . nodeprecated ) ) { Content dHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Deprecated_API" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( dHead ) : HtmlTree . LI ( HtmlStyle . blockList , dHead ) ; Content line20 = getResource ( "doclet.Help_line_20_with_deprecated_api_link" , getHyperLink ( DocPaths . DEPRECATED_LIST , configuration . getText ( "doclet.Deprecated_API" ) ) ) ; Content dPara = HtmlTree . P ( line20 ) ; htmlTree . addContent ( dPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } } if ( configuration . createindex ) { Content indexlink ; if ( configuration . splitindex ) { indexlink = getHyperLink ( DocPaths . INDEX_FILES . resolve ( DocPaths . indexN ( 1 ) ) , configuration . getText ( "doclet.Index" ) ) ; } else { indexlink = getHyperLink ( DocPaths . INDEX_ALL , configuration . getText ( "doclet.Index" ) ) ; } Content indexHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_21" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( indexHead ) : HtmlTree . LI ( HtmlStyle . blockList , indexHead ) ; Content line22 = getResource ( "doclet.Help_line_22" , indexlink ) ; Content indexPara = HtmlTree . P ( line22 ) ; htmlTree . addContent ( indexPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } } Content prevHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_23" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( prevHead ) : HtmlTree . LI ( HtmlStyle . blockList , prevHead ) ; Content line24 = getResource ( "doclet.Help_line_24" ) ; Content prevPara = HtmlTree . P ( line24 ) ; htmlTree . addContent ( prevPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content frameHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Help_line_25" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( frameHead ) : HtmlTree . LI ( HtmlStyle . blockList , frameHead ) ; Content line26 = getResource ( "doclet.Help_line_26" ) ; Content framePara = HtmlTree . P ( line26 ) ; htmlTree . addContent ( framePara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content allclassesHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.All_Classes" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( allclassesHead ) : HtmlTree . LI ( HtmlStyle . blockList , allclassesHead ) ; Content line27 = getResource ( "doclet.Help_line_27" , getHyperLink ( DocPaths . ALLCLASSES_NOFRAME , configuration . getText ( "doclet.All_Classes" ) ) ) ; Content allclassesPara = HtmlTree . P ( line27 ) ; htmlTree . addContent ( allclassesPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content sHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Serialized_Form" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( sHead ) : HtmlTree . LI ( HtmlStyle . blockList , sHead ) ; Content line28 = getResource ( "doclet.Help_line_28" ) ; Content serialPara = HtmlTree . P ( line28 ) ; htmlTree . addContent ( serialPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content constHead = HtmlTree . HEADING ( HtmlConstants . CONTENT_HEADING , getResource ( "doclet.Constants_Summary" ) ) ; htmlTree = ( configuration . allowTag ( HtmlTag . SECTION ) ) ? HtmlTree . SECTION ( constHead ) : HtmlTree . LI ( HtmlStyle . blockList , constHead ) ; Content line29 = getResource ( "doclet.Help_line_29" , getHyperLink ( DocPaths . CONSTANT_VALUES , configuration . getText ( "doclet.Constants_Summary" ) ) ) ; Content constPara = HtmlTree . P ( line29 ) ; htmlTree . addContent ( constPara ) ; if ( configuration . allowTag ( HtmlTag . SECTION ) ) { ul . addContent ( HtmlTree . LI ( HtmlStyle . blockList , htmlTree ) ) ; } else { ul . addContent ( htmlTree ) ; } Content divContent = HtmlTree . DIV ( HtmlStyle . contentContainer , ul ) ; Content line30 = HtmlTree . SPAN ( HtmlStyle . emphasizedPhrase , getResource ( "doclet.Help_line_30" ) ) ; divContent . addContent ( line30 ) ; if ( configuration . allowTag ( HtmlTag . MAIN ) ) { mainTree . addContent ( divContent ) ; contentTree . addContent ( mainTree ) ; } else { contentTree . addContent ( divContent ) ; }
public class HamcrestMatchers { /** * Creates a matcher that matches when the examined { @ linkplain Date } has the given values < code > hour < / code > and * < code > ClockPeriod < / code > ( e . g . < em > AM < / em > ) . */ public static Matcher < Date > hasHour ( final int hour , final ClockPeriod clockPeriod ) { } }
return IsDateWithTime . hasHour ( hour , clockPeriod ) ;
public class Basic2DMatrix { /** * Parses { @ link Basic2DMatrix } from the given Matrix Market . * @ param is the input stream in Matrix Market format * @ return a parsed matrix * @ exception IOException if an I / O error occurs . */ public static Basic2DMatrix fromMatrixMarket ( InputStream is ) throws IOException { } }
return Matrix . fromMatrixMarket ( is ) . to ( Matrices . BASIC_2D ) ;
public class Tree { /** * Clears the sub - nodes on the specified path . If no matching node exists , * creates a new empty node . Sample code : < br > * < br > * Tree array = node . clear ( " a . b " ) . add ( 1 ) . add ( 2 ) ; * @ param path * path of the sub - node * @ return the empty sub - node at the specified position */ public Tree clear ( String path ) { } }
Tree child = getChild ( path , false ) ; if ( child == null ) { child = putMap ( path ) ; } else { child . clear ( ) ; } return child ;
public class AbstractDatabase { /** * Add the given DocumentChangeListener to the specified document with an executor on which * the changes will be posted to the listener . */ @ NonNull public ListenerToken addDocumentChangeListener ( @ NonNull String id , Executor executor , @ NonNull DocumentChangeListener listener ) { } }
if ( id == null ) { throw new IllegalArgumentException ( "id cannot be null." ) ; } if ( listener == null ) { throw new IllegalArgumentException ( "listener cannot be null." ) ; } synchronized ( lock ) { mustBeOpen ( ) ; return addDocumentChangeListener ( executor , listener , id ) ; }
public class DeleteFileExtensions { /** * Checks the File if it is a directory or if its exists or if it is empty . * @ param file * The File to check . * @ return Null if nothing is wrong otherwise an Exception . */ public static Exception checkFile ( final File file ) { } }
Exception ex = null ; String error = null ; // check if the file does not exists . . . if ( ! file . exists ( ) ) { error = "The " + file + " does not exists." ; ex = new FileDoesNotExistException ( error ) ; return ex ; } // check if the file is not a directory . . . if ( ! file . isDirectory ( ) ) { error = "The " + file + " is not a directory." ; ex = new FileIsNotADirectoryException ( error ) ; return ex ; } final File [ ] ff = file . listFiles ( ) ; // If the file is null if ( ff == null ) { // it is security restricted error = "The " + file + " could not list the content." ; ex = new DirectoryHasNoContentException ( error ) ; } return ex ;
public class DevUtils { /** * Send this JVM process a SIGQUIT ; giving a thread dump and possibly * a heap histogram ( if using - XX : + PrintClassHistogram ) . * Used to automatically dump info , for example when a serious error * is encountered . Would use ' jmap ' / ' jstack ' , but have seen JVM * lockups - - perhaps due to lost thread wake signals - - when using * those against Sun 1.5.0 + 03 64bit JVM . */ public static void sigquitSelf ( ) { } }
try { Process p = Runtime . getRuntime ( ) . exec ( new String [ ] { "perl" , "-e" , "print getppid(). \"\n\";" } ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( p . getInputStream ( ) ) ) ; String ppid = br . readLine ( ) ; Runtime . getRuntime ( ) . exec ( new String [ ] { "sh" , "-c" , "kill -3 " + ppid } ) . waitFor ( ) ; } catch ( IOException e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; } catch ( InterruptedException e ) { // TODO Auto - generated catch block e . printStackTrace ( ) ; }
public class JedisSortedSet { /** * When all the elements in a sorted set are inserted with the same score , in order to force lexicographical * ordering , this command returns all the elements in the sorted set with a value in the given range . * If the elements in the sorted set have different scores , the returned elements are unspecified . * @ param lexRange * @ return the range of elements */ public Set < String > rangeByLex ( final LexRange lexRange ) { } }
return doWithJedis ( new JedisCallable < Set < String > > ( ) { @ Override public Set < String > call ( Jedis jedis ) { if ( lexRange . hasLimit ( ) ) { return jedis . zrangeByLex ( getKey ( ) , lexRange . from ( ) , lexRange . to ( ) , lexRange . offset ( ) , lexRange . count ( ) ) ; } else { return jedis . zrangeByLex ( getKey ( ) , lexRange . from ( ) , lexRange . to ( ) ) ; } } } ) ;
public class ExtractRegular { /** * 初始化 : * 1 、 从配置管理web服务器获取完整的抽取规则的json表示 * 2 、 抽取json , 构造对应的java对象结构 * @ param serverUrl 配置管理WEB服务器的抽取规则下载地址 */ private synchronized void init ( String serverUrl ) { } }
LOGGER . info ( "开始下载URL抽取规则" ) ; LOGGER . info ( "serverUrl: " + serverUrl ) ; // 从配置管理web服务器获取完整的抽取规则 String json = downJson ( serverUrl ) ; LOGGER . info ( "完成下载URL抽取规则" ) ; // 抽取规则 LOGGER . info ( "开始解析URL抽取规则" ) ; List < UrlPattern > urlPatterns = parseJson ( json ) ; LOGGER . info ( "完成解析URL抽取规则" ) ; init ( urlPatterns ) ;
public class ProxyController { /** * Generate error view stuffing the code and description * of the error into the model . View name is set to { @ link # failureView } . * @ param code the code * @ param args the msg args * @ return the model and view */ private ModelAndView generateErrorView ( final String code , final Object [ ] args , final HttpServletRequest request ) { } }
val modelAndView = new ModelAndView ( this . failureView ) ; modelAndView . addObject ( "code" , StringEscapeUtils . escapeHtml4 ( code ) ) ; val desc = StringEscapeUtils . escapeHtml4 ( this . context . getMessage ( code , args , code , request . getLocale ( ) ) ) ; modelAndView . addObject ( "description" , desc ) ; return modelAndView ;
public class SibRaConnection { /** * Deletes a temporary destination . Checks that the connection is valid and * then delegates . * @ param destinationAddress * the destination to delete * @ throws SIErrorException * if the delegation fails * @ throws SIResourceException * if the delegation fails * @ throws SITemporaryDestinationNotFoundException * if the delegation fails * @ throws SINotAuthorizedException * if the delegation fails * @ throws SIConnectionLostException * if the delegation fails * @ throws SIConnectionUnavailableException * if the connection is not valid * @ throws SIConnectionDroppedException * if the delegation fails * @ throws SIIncorrectCallException * if the delegation fails */ @ Override public void deleteTemporaryDestination ( SIDestinationAddress destinationAddress ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SINotAuthorizedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIDestinationLockedException , SIIncorrectCallException { } }
checkValid ( ) ; _delegateConnection . deleteTemporaryDestination ( destinationAddress ) ;
public class HyperLogLogCollector { /** * Returns the number of registers that are no longer zero after the value was added * @ param position The position into the byte buffer , this position represents two " registers " * @ param offsetDiff The difference in offset between the byteToAdd and the current HyperLogLogCollector * @ param byteToAdd The byte to merge into the current HyperLogLogCollector */ private static short mergeAndStoreByteRegister ( final ByteBuffer storageBuffer , final int position , final int offsetDiff , final byte byteToAdd ) { } }
if ( byteToAdd == 0 ) { return 0 ; } final byte currVal = storageBuffer . get ( position ) ; final int upperNibble = currVal & 0xf0 ; final int lowerNibble = currVal & 0x0f ; // subtract the differences so that the nibbles align final int otherUpper = ( byteToAdd & 0xf0 ) - ( offsetDiff << bitsPerBucket ) ; final int otherLower = ( byteToAdd & 0x0f ) - offsetDiff ; final int newUpper = Math . max ( upperNibble , otherUpper ) ; final int newLower = Math . max ( lowerNibble , otherLower ) ; storageBuffer . put ( position , ( byte ) ( ( newUpper | newLower ) & 0xff ) ) ; short numNoLongerZero = 0 ; if ( upperNibble == 0 && newUpper > 0 ) { ++ numNoLongerZero ; } if ( lowerNibble == 0 && newLower > 0 ) { ++ numNoLongerZero ; } return numNoLongerZero ;
public class AmazonConfigClient { /** * Returns the details for the specified configuration recorders . If the configuration recorder is not specified , * this action returns the details for all configuration recorders associated with the account . * < note > * Currently , you can specify only one configuration recorder per region in your account . * < / note > * @ param describeConfigurationRecordersRequest * The input for the < a > DescribeConfigurationRecorders < / a > action . * @ return Result of the DescribeConfigurationRecorders operation returned by the service . * @ throws NoSuchConfigurationRecorderException * You have specified a configuration recorder that does not exist . * @ sample AmazonConfig . DescribeConfigurationRecorders * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / config - 2014-11-12 / DescribeConfigurationRecorders " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeConfigurationRecordersResult describeConfigurationRecorders ( DescribeConfigurationRecordersRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeConfigurationRecorders ( request ) ;
public class GVRAsynchronousResourceLoader { /** * An internal method , public only so that GVRContext can make cross - package * calls . * A synchronous ( blocking ) wrapper around * { @ link android . graphics . BitmapFactory # decodeStream ( InputStream ) * BitmapFactory . decodeStream } that uses an * { @ link android . graphics . BitmapFactory . Options } < code > inTempStorage < / code > * decode buffer . On low memory , returns half ( quarter , eighth , . . . ) size * images . * If { @ code stream } is a { @ link FileInputStream } and is at offset 0 ( zero ) , * uses * { @ link android . graphics . BitmapFactory # decodeFileDescriptor ( FileDescriptor ) * BitmapFactory . decodeFileDescriptor ( ) } instead of * { @ link android . graphics . BitmapFactory # decodeStream ( InputStream ) * BitmapFactory . decodeStream ( ) } . * @ param stream * Bitmap stream * @ param closeStream * If { @ code true } , closes { @ code stream } * @ return Bitmap , or null if cannot be decoded into a bitmap */ public static Bitmap decodeStream ( InputStream stream , boolean closeStream ) { } }
return AsyncBitmapTexture . decodeStream ( stream , AsyncBitmapTexture . glMaxTextureSize , AsyncBitmapTexture . glMaxTextureSize , true , null , closeStream ) ;
public class DataHandler { /** * Sends the FCM registration ID to CleverTap . * @ param fcmId The FCM registration ID * @ param register Boolean indicating whether to register * or not for receiving push messages from CleverTap . * Set this to true to receive push messages from CleverTap , * and false to not receive any messages from CleverTap . * @ deprecated use { @ link CleverTapAPI # pushFcmRegistrationId ( String gcmId , boolean register ) } */ @ Deprecated public void pushFcmRegistrationId ( String fcmId , boolean register ) { } }
CleverTapAPI cleverTapAPI = weakReference . get ( ) ; if ( cleverTapAPI == null ) { Logger . d ( "CleverTap Instance is null." ) ; } else { cleverTapAPI . pushFcmRegistrationId ( fcmId , register ) ; }
public class JMStream { /** * Build random number stream double stream . * @ param count the count * @ return the double stream */ public static DoubleStream buildRandomNumberStream ( int count ) { } }
return IntStream . range ( 0 , count ) . mapToDouble ( i -> Math . random ( ) ) ;
public class Schedule { /** * The tags to apply to policy - created resources . These user - defined tags are in addition to the AWS - added lifecycle * tags . * @ param tagsToAdd * The tags to apply to policy - created resources . These user - defined tags are in addition to the AWS - added * lifecycle tags . */ public void setTagsToAdd ( java . util . Collection < Tag > tagsToAdd ) { } }
if ( tagsToAdd == null ) { this . tagsToAdd = null ; return ; } this . tagsToAdd = new java . util . ArrayList < Tag > ( tagsToAdd ) ;
public class MapApi { /** * Walks by map ' s nodes and extracts optional value of type T . * @ param < T > value type * @ param clazz type of value * @ param map subject * @ param path nodes to walk in map * @ return optional value of type T */ public static < T > T getUnsafe ( final Map map , final Class < T > clazz , final Object ... path ) { } }
return get ( map , clazz , path ) . orElseThrow ( ( ) -> new IllegalAccessError ( "Map " + map + " does not have value of type " + clazz . getName ( ) + " by " + Arrays . stream ( path ) . map ( Object :: toString ) . collect ( Collectors . joining ( "." ) ) ) ) ;
public class BaselineContextGenerator { /** * Returns the context for making a pos tag decision at the specified token * index given the specified tokens and previous tags . * @ param index * The index of the token for which the context is provided . * @ param tokens * The tokens in the sentence . * @ param tags * The tags assigned to the previous words in the sentence . * @ return The context for making a pos tag decision at the specified token * index given the specified tokens and previous tags . */ public final String [ ] getContext ( final int index , final Object [ ] tokens , final String [ ] tags ) { } }
String next , nextnext , lex , prev , prevprev ; String tagprev , tagprevprev ; tagprev = tagprevprev = null ; next = nextnext = lex = prev = prevprev = null ; lex = tokens [ index ] . toString ( ) ; if ( tokens . length > index + 1 ) { next = tokens [ index + 1 ] . toString ( ) ; if ( tokens . length > index + 2 ) { nextnext = tokens [ index + 2 ] . toString ( ) ; } else { nextnext = this . SE ; // Sentence End } } else { next = this . SE ; // Sentence End } if ( index - 1 >= 0 ) { prev = tokens [ index - 1 ] . toString ( ) ; tagprev = tags [ index - 1 ] ; if ( index - 2 >= 0 ) { prevprev = tokens [ index - 2 ] . toString ( ) ; tagprevprev = tags [ index - 2 ] ; } else { prevprev = this . SB ; // Sentence Beginning } } else { prev = this . SB ; // Sentence Beginning } final String cacheKey = index + tagprev + tagprevprev ; if ( this . contextsCache != null ) { if ( this . wordsKey == tokens ) { final String [ ] cachedContexts = ( String [ ] ) this . contextsCache . get ( cacheKey ) ; if ( cachedContexts != null ) { return cachedContexts ; } } else { this . contextsCache . clear ( ) ; this . wordsKey = tokens ; } } final List < String > featureList = new ArrayList < String > ( ) ; featureList . add ( "default" ) ; // add the word itself featureList . add ( "w=" + lex ) ; this . dictGram [ 0 ] = lex ; if ( this . dict == null || ! this . dict . contains ( new StringList ( this . dictGram ) ) ) { // do some basic suffix analysis final String [ ] suffs = getSuffixes ( lex ) ; for ( final String suff : suffs ) { featureList . add ( "suf=" + suff ) ; } final String [ ] prefs = getPrefixes ( lex ) ; for ( final String pref : prefs ) { featureList . add ( "pre=" + pref ) ; } // see if the word has any special characters if ( lex . indexOf ( '-' ) != - 1 ) { featureList . add ( "h" ) ; } if ( hasCap . matcher ( lex ) . find ( ) ) { featureList . add ( "c" ) ; } if ( hasNum . matcher ( lex ) . find ( ) ) { featureList . add ( "d" ) ; } } // add the words and pos ' s of the surrounding context if ( prev != null ) { featureList . add ( "pw=" + prev ) ; // bigram w - 1 , w featureList . add ( "pw,w=" + prev + "," + lex ) ; if ( tagprev != null ) { featureList . add ( "pt=" + tagprev ) ; // bigram tag - 1 , w featureList . add ( "pt,w=" + tagprev + "," + lex ) ; } if ( prevprev != null ) { featureList . add ( "ppw=" + prevprev ) ; if ( tagprevprev != null ) { // bigram tag - 2 , tag - 1 featureList . add ( "pt2,pt1=" + tagprevprev + "," + tagprev ) ; } } } if ( next != null ) { featureList . add ( "nw=" + next ) ; if ( nextnext != null ) { featureList . add ( "nnw=" + nextnext ) ; } } final String [ ] contexts = featureList . toArray ( new String [ featureList . size ( ) ] ) ; if ( this . contextsCache != null ) { this . contextsCache . put ( cacheKey , contexts ) ; } return contexts ;
public class Zips { /** * 压缩 * @ param source * 源 ( 文件或目录 ) * @ param target * 目标 ( 只能是目录 ) * @ throws IOException */ public static void zip ( File [ ] sources , File target ) throws IOException { } }
zip ( sources , target , null ) ;
public class Commands { /** * Shellifies an option name using the provided style * @ param name * @ param style * @ return */ public static String shellifyOptionNameDashed ( String name ) { } }
String shellName = shellifyName ( name ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < shellName . length ( ) ; i ++ ) { char c = shellName . charAt ( i ) ; if ( Character . isUpperCase ( c ) ) { if ( i > 0 ) { char previousChar = shellName . charAt ( i - 1 ) ; char nextChar = ( i + 1 < shellName . length ( ) ) ? shellName . charAt ( i + 1 ) : '\0' ; if ( previousChar != '-' && ( ! Character . isUpperCase ( previousChar ) || Character . isLowerCase ( nextChar ) ) ) { sb . append ( '-' ) ; } } sb . append ( Character . toLowerCase ( c ) ) ; } else { sb . append ( c ) ; } } return sb . toString ( ) ;
public class JMResources { /** * Gets resource uri . * @ param classpath the classpath * @ return the resource uri */ public static URI getResourceURI ( String classpath ) { } }
try { return getResourceURL ( classpath ) . toURI ( ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getResourceURI" , classpath ) ; }
public class FileCopyUtils { /** * Copy the contents of the given input File to the given output File . * @ param in the file to copy from * @ param out the file to copy to * @ return the number of bytes copied * @ throws IOException in case of I / O errors */ public static int copy ( File in , File out ) throws IOException { } }
Assert . notNull ( in , "No input File specified" ) ; Assert . notNull ( out , "No output File specified" ) ; return copy ( new BufferedInputStream ( new FileInputStream ( in ) ) , new BufferedOutputStream ( new FileOutputStream ( out ) ) ) ;
public class PhoneField { /** * Get the HTML Hyperlink ( Change this when the W3C has a standard for dialing the phone ) . * @ return The html link ( null ) . */ public String getHyperlink ( ) { } }
String strMailTo = this . getString ( ) ; if ( strMailTo != null ) if ( strMailTo . length ( ) > 0 ) strMailTo = DBParams . PHONE + ":" + strMailTo ; return strMailTo ;
public class CmsUserSettingsBean { /** * Adds a user setting . < p > * @ param value the current value of the user setting * @ param config the configuration for the user setting * @ param basic true if this is a basic user setting */ public void addSetting ( String value , CmsXmlContentProperty config , boolean basic ) { } }
m_values . put ( config . getName ( ) , value ) ; m_settingConfiguration . put ( config . getName ( ) , config ) ; if ( basic ) { m_basicOptions . add ( config . getName ( ) ) ; }
public class WTable { /** * Sets the table sort mode . The data model controls which columns are sortable . * @ param sortMode The sort mode to set . */ public void setSortMode ( final SortMode sortMode ) { } }
getOrCreateComponentModel ( ) . sortMode = sortMode == null ? SortMode . NONE : sortMode ;
public class ViewMap { /** * sort views . * Higher @ Priority is a better match . * Closer type match is a better match . */ private int compareView ( ViewRef < ? > viewA , ViewRef < ? > viewB , Class < ? > type ) { } }
int cmp = viewB . priority ( ) - viewA . priority ( ) ; if ( cmp != 0 ) { return cmp ; } cmp = typeDepth ( viewA . type ( ) , type ) - typeDepth ( viewB . type ( ) , type ) ; if ( cmp != 0 ) { return cmp ; } // equivalent views are sorted by name to ensure consistency String nameA = viewA . resolver ( ) . getClass ( ) . getName ( ) ; String nameB = viewB . resolver ( ) . getClass ( ) . getName ( ) ; return nameA . compareTo ( nameB ) ;
public class Copyright { /** * Create a new { @ code Copyright } object with the given data . * @ param author copyright holder ( TopoSoft , Inc . ) * @ param year year of copyright . * @ param license link to external file containing license text . * @ return a new { @ code Copyright } object with the given data * @ throws NullPointerException if the { @ code author } is { @ code null } * @ throws IllegalArgumentException if the given { @ code license } is not a * valid { @ code URI } object */ public static Copyright of ( final String author , final int year , final String license ) { } }
return new Copyright ( author , Year . of ( year ) , parseURI ( license ) ) ;
public class TokenEndpointAuthenticationFilter { /** * If the incoming request contains user credentials in headers or parameters then extract them here into an * Authentication token that can be validated later . This implementation only recognises password grant requests and * extracts the username and password . * @ param request the incoming request , possibly with user credentials * @ return an authentication for validation ( or null if there is no further authentication ) */ protected Authentication extractCredentials ( HttpServletRequest request ) { } }
String grantType = request . getParameter ( "grant_type" ) ; if ( grantType != null && grantType . equals ( "password" ) ) { UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken ( request . getParameter ( "username" ) , request . getParameter ( "password" ) ) ; result . setDetails ( authenticationDetailsSource . buildDetails ( request ) ) ; return result ; } return null ;
public class SwitchPreference { /** * Obtains all attributes from a specific attribute set . * @ param attributeSet * The attribute set , the attributes should be obtained from , as an instance of the type * { @ link AttributeSet } or null , if no attributes should be obtained * @ param defaultStyle * The default style to apply to this preference . If 0 , no style will be applied ( beyond * what is included in the theme ) . This may either be an attribute resource , whose value * will be retrieved from the current theme , or an explicit style resource * @ param defaultStyleResource * A resource identifier of a style resource that supplies default values for the * preference , used only if the default style is 0 or can not be found in the theme . Can * be 0 to not look for defaults */ private void obtainStyledAttributes ( @ Nullable final AttributeSet attributeSet , @ AttrRes final int defaultStyle , @ StyleRes final int defaultStyleResource ) { } }
TypedArray typedArray = getContext ( ) . obtainStyledAttributes ( attributeSet , R . styleable . SwitchPreference , defaultStyle , defaultStyleResource ) ; try { obtainSwitchTextOn ( typedArray ) ; obtainSwitchTextOff ( typedArray ) ; } finally { typedArray . recycle ( ) ; }
public class BitmapAdapter { /** * This function should be called by subclasses once they have actually loaded the bitmap . * @ param position the position of the item * @ param bitmap the bitmap that has been loaded */ protected void onBitmapLoaded ( int position , Bitmap bitmap ) { } }
BitmapCache bc = cachedBitmaps . get ( position ) ; if ( bc != null ) { bc . status = bitmap == null ? SlideStatus . NOT_AVAILABLE : SlideStatus . READY ; bc . bitmap = new WeakReference < Bitmap > ( bitmap ) ; }
public class Reflect { /** * create a class supporter with given class name * @ param clsName full name of the class to be supported * @ return Class supporter * @ see ClassSup */ @ SuppressWarnings ( "unchecked" ) public static < T > ClassSup < T > cls ( String clsName ) { } }
try { return mapper . get ( clsName , ( ) -> ( ClassSup < T > ) cls ( Class . forName ( clsName ) ) ) ; } catch ( Exception e ) { throw $ ( e ) ; }
public class WsFrameEncodingSupport { /** * Encode a WebSocket opcode onto a byte that might have some high bits set . * @ param b * @ param message * @ return */ private static byte doEncodeOpcode ( byte b , WsMessage message ) { } }
switch ( message . getKind ( ) ) { case TEXT : { b |= Opcode . TEXT . getCode ( ) ; break ; } case BINARY : { b |= Opcode . BINARY . getCode ( ) ; break ; } case PING : { b |= Opcode . PING . getCode ( ) ; break ; } case PONG : { b |= Opcode . PONG . getCode ( ) ; break ; } case CLOSE : { b |= Opcode . CLOSE . getCode ( ) ; break ; } default : throw new IllegalArgumentException ( "Unrecognized frame type: " + message . getKind ( ) ) ; } return b ;
public class AmazonElastiCacheClient { /** * Modifies a replication group ' s shards ( node groups ) by allowing you to add shards , remove shards , or rebalance * the keyspaces among exisiting shards . * @ param modifyReplicationGroupShardConfigurationRequest * Represents the input for a < code > ModifyReplicationGroupShardConfiguration < / code > operation . * @ return Result of the ModifyReplicationGroupShardConfiguration operation returned by the service . * @ throws ReplicationGroupNotFoundException * The specified replication group does not exist . * @ throws InvalidReplicationGroupStateException * The requested replication group is not in the < code > available < / code > state . * @ throws InvalidCacheClusterStateException * The requested cluster is not in the < code > available < / code > state . * @ throws InvalidVPCNetworkStateException * The VPC network is in an invalid state . * @ throws InsufficientCacheClusterCapacityException * The requested cache node type is not available in the specified Availability Zone . * @ throws NodeGroupsPerReplicationGroupQuotaExceededException * The request cannot be processed because it would exceed the maximum allowed number of node groups * ( shards ) in a single replication group . The default maximum is 15 * @ throws NodeQuotaForCustomerExceededException * The request cannot be processed because it would exceed the allowed number of cache nodes per customer . * @ throws InvalidParameterValueException * The value for a parameter is invalid . * @ throws InvalidParameterCombinationException * Two or more incompatible parameters were specified . * @ sample AmazonElastiCache . ModifyReplicationGroupShardConfiguration * @ see < a * href = " http : / / docs . aws . amazon . com / goto / WebAPI / elasticache - 2015-02-02 / ModifyReplicationGroupShardConfiguration " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ReplicationGroup modifyReplicationGroupShardConfiguration ( ModifyReplicationGroupShardConfigurationRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeModifyReplicationGroupShardConfiguration ( request ) ;
public class AuthInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AuthInfo authInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( authInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( authInfo . getActionType ( ) , ACTIONTYPE_BINDING ) ; protocolMarshaller . marshall ( authInfo . getResources ( ) , RESOURCES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SIPBalancerForwarder { /** * need to verify that comes from external in case of single leg */ protected Boolean comesFromInternalNode ( Response externalResponse , InvocationContext ctx , String host , Integer port , String transport , Boolean isIpV6 ) { } }
boolean found = false ; if ( host != null && port != null ) { if ( ctx . sipNodeMap ( isIpV6 ) . containsKey ( new KeySip ( host , port , isIpV6 ) ) ) found = true ; // for ( Node node : ctx . nodes ) { // if ( node . getIp ( ) . equals ( host ) ) { // if ( port . equals ( node . getProperties ( ) . get ( transport + " Port " ) ) ) { // found = true ; // break ; } return found ;
public class XPathUtils { /** * Evaluates the expression . * @ param node the node . * @ param xPathExpression the expression . * @ param nsContext the context . * @ param returnType * @ return the result . */ public static Object evaluateExpression ( Node node , String xPathExpression , NamespaceContext nsContext , QName returnType ) { } }
try { return buildExpression ( xPathExpression , nsContext ) . evaluate ( node , returnType ) ; } catch ( XPathExpressionException e ) { throw new CitrusRuntimeException ( "Can not evaluate xpath expression '" + xPathExpression + "'" , e ) ; }
public class WEditableImageRenderer { /** * Paints the given { @ link WEditableImage } . * @ param component the WEditableImage to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WEditableImage editableImage = ( WEditableImage ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; // No image set if ( editableImage . getImage ( ) == null && editableImage . getImageUrl ( ) == null ) { return ; } WImageRenderer . renderTagOpen ( editableImage , xml ) ; WComponent uploader = editableImage . getEditUploader ( ) ; if ( uploader != null ) { xml . appendAttribute ( "data-wc-editor" , uploader . getId ( ) ) ; } xml . appendEnd ( ) ;
public class Matcher { /** * Resets the Matcher . A new input sequence and a new region can be * specified . Results of a previous find get lost . The next attempt to find * an occurrence of the Pattern in the string will start at the beginning of * the region . This is the internal version of reset ( ) to which the several * public versions delegate . * @ param input * the input sequence . * @ param start * the start of the region . * @ param end * the end of the region . * @ return the matcher itself . */ private Matcher reset ( String input , int start , int end ) { } }
if ( input == null ) { throw new IllegalArgumentException ( "input == null" ) ; } if ( start < 0 || end < 0 || start > input . length ( ) || end > input . length ( ) || start > end ) { throw new IndexOutOfBoundsException ( ) ; } this . input = input ; this . inputChars = input . toCharArray ( ) ; this . regionStart = start ; this . regionEnd = end ; resetForInput ( ) ; matchFound = false ; appendPos = 0 ; return this ;
public class RunnersApi { /** * Deletes a registered Runner . * < pre > < code > GitLab Endpoint : DELETE / runners / < / code > < / pre > * @ param token the runners authentication token * @ throws GitLabApiException if any exception occurs */ public void deleteRunner ( String token ) throws GitLabApiException { } }
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , true ) ; delete ( Response . Status . NO_CONTENT , formData . asMap ( ) , "runners" ) ;
public class Quaterniond { /** * / * ( non - Javadoc ) * @ see org . joml . Quaterniondc # invert ( org . joml . Quaterniond ) */ public Quaterniond invert ( Quaterniond dest ) { } }
double invNorm = 1.0 / ( x * x + y * y + z * z + w * w ) ; dest . x = - x * invNorm ; dest . y = - y * invNorm ; dest . z = - z * invNorm ; dest . w = w * invNorm ; return dest ;
public class SegmentAttributeBTreeIndex { /** * Executes the given Index Operation once , without performing retries . In case of failure with BadOffsetException * ( which indicates a conditional update failure ) , the BTreeIndex is reinitialized to the most up - to - date state . * @ param indexOperation A Function , that , when invoked , returns a CompletableFuture which indicates when the index * operation completes . * @ param timer Timer for the operation . * @ return A CompletableFuture that will indicate when the operation completes . */ private CompletableFuture < Long > executeConditionallyOnce ( Function < Duration , CompletableFuture < Long > > indexOperation , TimeoutTimer timer ) { } }
return Futures . exceptionallyCompose ( indexOperation . apply ( timer . getRemaining ( ) ) , ex -> { if ( Exceptions . unwrap ( ex ) instanceof BadOffsetException ) { BadOffsetException boe = ( BadOffsetException ) Exceptions . unwrap ( ex ) ; if ( boe . getExpectedOffset ( ) != this . index . getIndexLength ( ) ) { log . warn ( "{}: Conditional Index Update failed (expected {}, given {}). Reinitializing index." , this . traceObjectId , boe . getExpectedOffset ( ) , boe . getGivenOffset ( ) ) ; return this . index . initialize ( timer . getRemaining ( ) ) . thenCompose ( v -> Futures . failedFuture ( ex ) ) ; } } // Make sure the exception bubbles up . return Futures . failedFuture ( ex ) ; } ) ;
public class Shell { /** * < p > This code is adapted from java . lang . ProcessBuilder . start ( ) . < / p > * < p > The problem is that Android doesn ' t allow us to modify the map returned by ProcessBuilder . environment ( ) , even * though the JavaDoc indicates that it should . This is because it simply returns the SystemEnvironment object that * System . getenv ( ) gives us . The relevant portion in the source code is marked as " / / android changed " , so * presumably it ' s not the case in the original version of the Apache Harmony project . < / p > * @ param command * The name of the program to execute . E . g . " su " or " sh " . * @ param environment * Map of all environment variables * @ return new { @ link Process } instance . * @ throws IOException * if the requested program could not be executed . */ @ WorkerThread public static Process runWithEnv ( @ NonNull String command , Map < String , String > environment ) throws IOException { } }
String [ ] env ; if ( environment != null && environment . size ( ) != 0 ) { Map < String , String > newEnvironment = new HashMap < > ( ) ; newEnvironment . putAll ( System . getenv ( ) ) ; newEnvironment . putAll ( environment ) ; int i = 0 ; env = new String [ newEnvironment . size ( ) ] ; for ( Map . Entry < String , String > entry : newEnvironment . entrySet ( ) ) { env [ i ] = entry . getKey ( ) + "=" + entry . getValue ( ) ; i ++ ; } } else { env = null ; } return Runtime . getRuntime ( ) . exec ( command , env ) ;
public class SslContextFactory { /** * Create the SSLContext */ private void init ( ) throws Exception { } }
if ( sslContext == null ) { if ( keyStoreInputStream == null && sslConfig . getKeyStorePath ( ) == null && trustStoreInputStream == null && sslConfig . getTrustStorePath ( ) == null ) { TrustManager [ ] trust_managers = null ; if ( sslConfig . isTrustAll ( ) ) { logger . debug ( "No keystore or trust store configured. ACCEPTING UNTRUSTED CERTIFICATES!!!!!" ) ; // Create a trust manager that does not validate certificate chains TrustManager trustAllCerts = new X509TrustManager ( ) { public java . security . cert . X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } public void checkClientTrusted ( java . security . cert . X509Certificate [ ] certs , String authType ) { } public void checkServerTrusted ( java . security . cert . X509Certificate [ ] certs , String authType ) { } } ; trust_managers = new TrustManager [ ] { trustAllCerts } ; } SecureRandom secureRandom = ( sslConfig . getSecureRandomAlgorithm ( ) == null ) ? null : SecureRandom . getInstance ( sslConfig . getSecureRandomAlgorithm ( ) ) ; sslContext = SSLContext . getInstance ( sslConfig . getProtocol ( ) ) ; sslContext . init ( null , trust_managers , secureRandom ) ; } else { // verify that keystore and truststore // parameters are set up correctly checkKeyStore ( ) ; KeyStore keyStore = loadKeyStore ( ) ; KeyStore trustStore = loadTrustStore ( ) ; Collection < ? extends CRL > crls = loadCRL ( sslConfig . getCrlPath ( ) ) ; if ( sslConfig . isValidateCerts ( ) && keyStore != null ) { if ( sslConfig . getCertAlias ( ) == null ) { List < String > aliases = Collections . list ( keyStore . aliases ( ) ) ; sslConfig . setCertAlias ( aliases . size ( ) == 1 ? aliases . get ( 0 ) : null ) ; } Certificate cert = sslConfig . getCertAlias ( ) == null ? null : keyStore . getCertificate ( sslConfig . getCertAlias ( ) ) ; if ( cert == null ) { throw new Exception ( "No certificate found in the keystore" + ( sslConfig . getCertAlias ( ) == null ? "" : " for alias " + sslConfig . getCertAlias ( ) ) ) ; } CertificateValidator validator = new CertificateValidator ( trustStore , crls ) ; validator . setMaxCertPathLength ( sslConfig . getMaxCertPathLength ( ) ) ; validator . setEnableCRLDP ( sslConfig . isEnableCRLDP ( ) ) ; validator . setEnableOCSP ( sslConfig . isEnableOCSP ( ) ) ; validator . setOcspResponderURL ( sslConfig . getOcspResponderURL ( ) ) ; validator . validate ( keyStore , cert ) ; } KeyManager [ ] keyManagers = getKeyManagers ( keyStore ) ; TrustManager [ ] trustManagers = getTrustManagers ( trustStore , crls ) ; SecureRandom secureRandom = ( sslConfig . getSecureRandomAlgorithm ( ) == null ) ? null : SecureRandom . getInstance ( sslConfig . getSecureRandomAlgorithm ( ) ) ; sslContext = ( sslConfig . getProvider ( ) == null ) ? SSLContext . getInstance ( sslConfig . getProtocol ( ) ) : SSLContext . getInstance ( sslConfig . getProtocol ( ) , sslConfig . getProvider ( ) ) ; sslContext . init ( keyManagers , trustManagers , secureRandom ) ; SSLEngine engine = newSslEngine ( ) ; logger . info ( "Enabled Protocols {} of {}" , Arrays . asList ( engine . getEnabledProtocols ( ) ) , Arrays . asList ( engine . getSupportedProtocols ( ) ) ) ; logger . debug ( "Enabled Ciphers {} of {}" , Arrays . asList ( engine . getEnabledCipherSuites ( ) ) , Arrays . asList ( engine . getSupportedCipherSuites ( ) ) ) ; } }
public class VirtualMachineScaleSetExtensionsInner { /** * The operation to get the extension . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set containing the extension . * @ param vmssExtensionName The name of the VM scale set extension . * @ param expand The expand expression to apply on the operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the VirtualMachineScaleSetExtensionInner object */ public Observable < VirtualMachineScaleSetExtensionInner > getAsync ( String resourceGroupName , String vmScaleSetName , String vmssExtensionName , String expand ) { } }
return getWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , vmssExtensionName , expand ) . map ( new Func1 < ServiceResponse < VirtualMachineScaleSetExtensionInner > , VirtualMachineScaleSetExtensionInner > ( ) { @ Override public VirtualMachineScaleSetExtensionInner call ( ServiceResponse < VirtualMachineScaleSetExtensionInner > response ) { return response . body ( ) ; } } ) ;
public class BytecodeInterface8 { /** * get value from double [ ] using normalized index */ public static double dArrayGet ( double [ ] a , int i ) { } }
try { return a [ i ] ; } catch ( Throwable t ) { return a [ DefaultGroovyMethodsSupport . normaliseIndex ( i , a . length ) ] ; }
public class MessageProtocol { /** * Whether the protocol uses UTF - 8. * @ return true if the charset used by this protocol is UTF - 8 , false if it ' s some other encoding or if no charset is * defined . */ public boolean isUtf8 ( ) { } }
if ( charset . isPresent ( ) ) { return utf8Charset . equals ( Charset . forName ( charset . get ( ) ) ) ; } else { return false ; }
public class KafkaQueueFactory { /** * Setter for { @ link # defaultKafkaClient } . * @ param kafkaClient * @ param setMyOwnKafkaClient * @ return * @ since 0.7.1 */ protected KafkaQueueFactory < T , ID , DATA > setDefaultKafkaClient ( KafkaClient kafkaClient , boolean setMyOwnKafkaClient ) { } }
if ( this . defaultKafkaClient != null && myOwnKafkaClient ) { this . defaultKafkaClient . destroy ( ) ; } this . defaultKafkaClient = kafkaClient ; myOwnKafkaClient = setMyOwnKafkaClient ; return this ;
public class CommerceAccountModelImpl { /** * Converts the soap model instances into normal model instances . * @ param soapModels the soap model instances to convert * @ return the normal model instances */ public static List < CommerceAccount > toModels ( CommerceAccountSoap [ ] soapModels ) { } }
if ( soapModels == null ) { return null ; } List < CommerceAccount > models = new ArrayList < CommerceAccount > ( soapModels . length ) ; for ( CommerceAccountSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ;
public class LOG { /** * @ param e the e * @ param msg the msg * @ param args the args */ public static void d ( final Throwable e , final String msg , final Object ... args ) { } }
LOG . d ( msg + "\n " + LOG . toString ( e ) . replace ( "\n" , "\n " ) , args ) ;
public class ElementBuilder { /** * Adds an { @ code aria - } attribute to the element . * @ param name The name of the aria attribute w / o the { @ code aria - } prefix . However it won ' t be added if it ' s * already present . */ public B aria ( String name , String value ) { } }
String safeName = name . startsWith ( "aria-" ) ? name : "aria-" + name ; return attr ( safeName , value ) ;
public class Mapper { /** * Returns delegate map instance as a entry Gather * @ return */ public Gather < Entry < K , V > > entryGather ( ) { } }
return Gather . from ( delegate . get ( ) . entrySet ( ) ) ;