signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Search { /** * Get the runtime of the < i > current < / i > ( or last ) run , in milliseconds . The precise return value * depends on the status of the search : * < ul > * < li > * If the search is either RUNNING or TERMINATING , this method returns the time elapsed since * the current run was started . * < / li > * < li > * If the search is IDLE or DISPOSED , the total runtime of the last run is returned , if any . Before * the first run , { @ link JamesConstants # INVALID _ TIME _ SPAN } is returned . * < / li > * < li > * While INITIALIZING the current run , { @ link JamesConstants # INVALID _ TIME _ SPAN } is returned . * < / li > * < / ul > * The return value is always positive , except in those cases when * { @ link JamesConstants # INVALID _ TIME _ SPAN } is returned . * @ return runtime of the current ( or last ) run , in milliseconds */ public long getRuntime ( ) { } }
// depends on status : synchronize with status updates synchronized ( statusLock ) { if ( status == SearchStatus . INITIALIZING ) { // initializing return JamesConstants . INVALID_TIME_SPAN ; } else if ( status == SearchStatus . IDLE || status == SearchStatus . DISPOSED ) { // idle or disposed : check if ran before if ( stopTime == JamesConstants . INVALID_TIMESTAMP ) { // did not run before return JamesConstants . INVALID_TIME_SPAN ; } else { // return total runtime of last run return stopTime - startTime ; } } else { // running or terminating return System . currentTimeMillis ( ) - startTime ; } }
public class StoreImpl { /** * / * ( non - Javadoc ) * @ see com . att . env . Store # slot ( java . lang . String ) */ public synchronized Slot slot ( String name ) { } }
name = name == null ? "" : name . trim ( ) ; Slot slot = localMap . get ( name ) ; if ( slot == null ) { slot = new Slot ( local ++ , name ) ; localMap . put ( name , slot ) ; } return slot ;
public class Base64 { /** * Decodes a BASE64 encoded char array that is known to be reasonably well formatted . The preconditions are : < br > * + The array must have a line length of 76 chars OR no line separators at all ( one line ) . < br > * + Line separator must be " \ r \ n " , as specified in RFC 2045 * + The array must not contain illegal characters within the encoded string < br > * + The array CAN have illegal characters at the beginning and end , those will be dealt with appropriately . < br > * @ param sArr The source array . Length 0 will return an empty array . < code > null < / code > will throw an exception . * @ return The decoded array of bytes . May be of length 0. * @ throws DecodingException on illegal input */ final byte [ ] decodeFast ( char [ ] sArr ) throws DecodingException { } }
// Check special case int sLen = sArr != null ? sArr . length : 0 ; if ( sLen == 0 ) { return new byte [ 0 ] ; } int sIx = 0 , eIx = sLen - 1 ; // Start and end index after trimming . // Trim illegal chars from start while ( sIx < eIx && IALPHABET [ sArr [ sIx ] ] < 0 ) { sIx ++ ; } // Trim illegal chars from end while ( eIx > 0 && IALPHABET [ sArr [ eIx ] ] < 0 ) { eIx -- ; } // get the padding count ( = ) ( 0 , 1 or 2) int pad = sArr [ eIx ] == '=' ? ( sArr [ eIx - 1 ] == '=' ? 2 : 1 ) : 0 ; // Count ' = ' at end . int cCnt = eIx - sIx + 1 ; // Content count including possible separators int sepCnt = sLen > 76 ? ( sArr [ 76 ] == '\r' ? cCnt / 78 : 0 ) << 1 : 0 ; int len = ( ( cCnt - sepCnt ) * 6 >> 3 ) - pad ; // The number of decoded bytes byte [ ] dArr = new byte [ len ] ; // Preallocate byte [ ] of exact length // Decode all but the last 0 - 2 bytes . int d = 0 ; for ( int cc = 0 , eLen = ( len / 3 ) * 3 ; d < eLen ; ) { // Assemble three bytes into an int from four " valid " characters . int i = ctoi ( sArr [ sIx ++ ] ) << 18 | ctoi ( sArr [ sIx ++ ] ) << 12 | ctoi ( sArr [ sIx ++ ] ) << 6 | ctoi ( sArr [ sIx ++ ] ) ; // Add the bytes dArr [ d ++ ] = ( byte ) ( i >> 16 ) ; dArr [ d ++ ] = ( byte ) ( i >> 8 ) ; dArr [ d ++ ] = ( byte ) i ; // If line separator , jump over it . if ( sepCnt > 0 && ++ cc == 19 ) { sIx += 2 ; cc = 0 ; } } if ( d < len ) { // Decode last 1-3 bytes ( incl ' = ' ) into 1-3 bytes int i = 0 ; for ( int j = 0 ; sIx <= eIx - pad ; j ++ ) { i |= ctoi ( sArr [ sIx ++ ] ) << ( 18 - j * 6 ) ; } for ( int r = 16 ; d < len ; r -= 8 ) { dArr [ d ++ ] = ( byte ) ( i >> r ) ; } } return dArr ;
public class ConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . MPCoreConnection # systemReceiveNoWait ( com . ibm . wsspi . sib . core . SITransaction , com . ibm . websphere . sib . Reliability , * com . ibm . websphere . sib . SIDestinationAddress , com . ibm . wsspi . sib . core . DestinationFilter , java . lang . String , java . lang . String , com . ibm . websphere . sib . Reliability ) */ @ Override public SIBusMessage systemReceiveNoWait ( SITransaction tran , Reliability unrecoverableReliability , SIDestinationAddress destAddress , DestinationType destinationType , SelectionCriteria criteria , Reliability reliability ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException , SIDestinationLockedException , SINotPossibleInCurrentConfigurationException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "systemReceiveNoWait" , new Object [ ] { tran , unrecoverableReliability , destAddress , destinationType , criteria , reliability } ) ; if ( destAddress == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "systemReceiveNoWait" , "SIIncorrectCallException - null destAddr" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "RECEIVE_NO_WAIT_CWSIR0091" , null , null ) ) ; } if ( ! destAddress . getDestinationName ( ) . startsWith ( SIMPConstants . SYSTEM_DESTINATION_PREFIX ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "systemReceiveNoWait" , "SIIncorrectCallException" ) ; throw new SIIncorrectCallException ( nls . getFormattedMessage ( "SYSTEM_DESTINATION_USAGE_ERROR_CWSIP0024" , new Object [ ] { destAddress . getDestinationName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } SIBusMessage msg = null ; try { msg = internalReceiveNoWait ( tran , unrecoverableReliability , destAddress , destinationType , criteria , reliability , null , true ) ; } catch ( SITemporaryDestinationNotFoundException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.ConnectionImpl.systemReceiveNoWait" , "1:4687:1.347.1.25" , this ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.ConnectionImpl" , "1:4693:1.347.1.25" } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "systemReceiveNoWait" , "SIErrorException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "ConnectionImpl" , "1:4701:1.347.1.25" } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "systemReceiveNoWait" , msg ) ; return msg ;
public class MediaAPI { /** * 新增临时素材 * 媒体文件在后台保存时间为3天 , 即3天后media _ id失效 。 * @ param access _ token access _ token * @ param mediaType mediaType * @ param inputStream 多媒体文件有格式和大小限制 , 如下 : * 图片 ( image ) : 2M , 支持bmp / png / jpeg / jpg / gif格式 * 语音 ( voice ) : 2M , 播放长度不超过60s , 支持AMR \ MP3格式 * 视频 ( video ) : 10MB , 支持MP4格式 * 缩略图 ( thumb ) : 64KB , 支持JPG格式 * @ return Media */ public static Media mediaUpload ( String access_token , MediaType mediaType , InputStream inputStream ) { } }
HttpPost httpPost = new HttpPost ( BASE_URI + "/cgi-bin/media/upload" ) ; byte [ ] data = null ; try { data = StreamUtils . copyToByteArray ( inputStream ) ; } catch ( IOException e ) { logger . error ( "" , e ) ; } HttpEntity reqEntity = MultipartEntityBuilder . create ( ) . addBinaryBody ( "media" , data , ContentType . DEFAULT_BINARY , "temp." + mediaType . fileSuffix ( ) ) . addTextBody ( PARAM_ACCESS_TOKEN , API . accessToken ( access_token ) ) . addTextBody ( "type" , mediaType . uploadType ( ) ) . build ( ) ; httpPost . setEntity ( reqEntity ) ; return LocalHttpClient . executeJsonResult ( httpPost , Media . class ) ;
public class HostProcess { /** * Complete the current plugin and update statistics * @ param plugin the plugin that need to be marked as completed */ void pluginCompleted ( Plugin plugin ) { } }
PluginStats pluginStats = mapPluginStats . get ( plugin . getId ( ) ) ; if ( pluginStats == null ) { // Plugin was not processed return ; } StringBuilder sb = new StringBuilder ( ) ; if ( isStop ( ) ) { sb . append ( "stopped host/plugin " ) ; // ZAP : added skipping notifications } else if ( pluginStats . isSkipped ( ) ) { sb . append ( "skipped plugin " ) ; String reason = pluginStats . getSkippedReason ( ) ; if ( reason != null ) { sb . append ( '[' ) . append ( reason ) . append ( "] " ) ; } } else { sb . append ( "completed host/plugin " ) ; } sb . append ( hostAndPort ) . append ( " | " ) . append ( plugin . getCodeName ( ) ) ; long startTimeMillis = pluginStats . getStartTime ( ) ; long diffTimeMillis = System . currentTimeMillis ( ) - startTimeMillis ; String diffTimeString = decimalFormat . format ( diffTimeMillis / 1000.0 ) ; sb . append ( " in " ) . append ( diffTimeString ) . append ( 's' ) ; sb . append ( " with " ) . append ( pluginStats . getMessageCount ( ) ) . append ( " message(s) sent" ) ; sb . append ( " and " ) . append ( pluginStats . getAlertCount ( ) ) . append ( " alert(s) raised." ) ; // Probably too verbose evaluate 4 the future log . info ( sb . toString ( ) ) ; pluginFactory . setRunningPluginCompleted ( plugin ) ; notifyHostProgress ( null ) ; // ZAP : update progress as finished pluginStats . setProgress ( nodeInScopeCount ) ;
public class EmailTarget { /** * TODO implement me */ @ Override protected void publish ( LogEntry entry ) { } }
Email mail = this . mapper . apply ( entry ) ; CompletableFuture . runAsync ( ( ) -> { try { mail . send ( ) ; } catch ( EmailException e ) { throw new LogTargetException ( e ) ; } } ) ;
public class MethodConstructor { /** * ejb ' s method creating must at first get service ' s EJB Object ; * pojo ' s method creating can only need service ' s class . * @ param targetServiceFactory * @ param targetMetaRequest * @ param methodMetaArgs * @ return */ public Method createMethod ( TargetServiceFactory targetServiceFactory ) { } }
Method method = null ; Debug . logVerbose ( "[JdonFramework] enter create the Method " , module ) ; try { TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; if ( targetMetaRequest . getTargetMetaDef ( ) . isEJB ( ) ) { Object obj = methodInvokerUtil . createTargetObject ( targetServiceFactory ) ; method = createObjectMethod ( obj , targetMetaRequest . getMethodMetaArgs ( ) ) ; } else { method = createPojoMethod ( ) ; } } catch ( Exception ex ) { Debug . logError ( "[JdonFramework] createMethod error: " + ex , module ) ; } return method ;
public class SearchHelper { /** * Set up a standard filter attribute name and value pair . * < table border = " 1 " > < caption > Example Values < / caption > * < tr > < td > < b > Attribute < / b > < / td > < td > < b > Value < / b > < / td > < / tr > * < tr > < td > givenName < / td > < td > John < / td > < / tr > * < / table > * < p > < i > Result < / i > < / p > * < code > ( givenName = John ) < / code > * @ param attributeName A valid attribute name * @ param value A value that , if it exists , will cause the object to be included in result set . */ public void setFilter ( final String attributeName , final String value ) { } }
filter = new FilterSequence ( attributeName , value ) . toString ( ) ;
public class Lists { /** * Returns a reversed view of the specified list . For example , { @ code * Lists . reverse ( Arrays . asList ( 1 , 2 , 3 ) ) } returns a list containing { @ code 3, * 2 , 1 } . The returned list is backed by this list , so changes in the returned * list are reflected in this list , and vice - versa . The returned list supports * all of the optional list operations supported by this list . * < p > The returned list is random - access if the specified list is random * access . * @ since 7.0 */ public static < T > List < T > reverse ( List < T > list ) { } }
if ( list instanceof ImmutableList ) { return ( ( ImmutableList < T > ) list ) . reverse ( ) ; } else if ( list instanceof ReverseList ) { return ( ( ReverseList < T > ) list ) . getForwardList ( ) ; } else if ( list instanceof RandomAccess ) { return new RandomAccessReverseList < T > ( list ) ; } else { return new ReverseList < T > ( list ) ; }
public class CPInstancePersistenceImpl { /** * Removes the cp instance where companyId = & # 63 ; and externalReferenceCode = & # 63 ; from the database . * @ param companyId the company ID * @ param externalReferenceCode the external reference code * @ return the cp instance that was removed */ @ Override public CPInstance removeByC_ERC ( long companyId , String externalReferenceCode ) throws NoSuchCPInstanceException { } }
CPInstance cpInstance = findByC_ERC ( companyId , externalReferenceCode ) ; return remove ( cpInstance ) ;
public class ExceptionProxy { /** * Checks whether an exception has been set via { @ link # reportError ( Throwable ) } . * If yes , that exception if re - thrown by this method . * @ throws Exception This method re - throws the exception , if set . */ public void checkAndThrowException ( ) throws Exception { } }
Throwable t = exception . get ( ) ; if ( t != null ) { if ( t instanceof Exception ) { throw ( Exception ) t ; } else if ( t instanceof Error ) { throw ( Error ) t ; } else { throw new Exception ( t ) ; } }
public class OjbTagsHandler { /** * Processes the template for all class definitions . * @ param template The template * @ param attributes The attributes of the tag * @ exception XDocletException if an error occurs * @ doc . tag type = " block " */ public void forAllClassDefinitions ( String template , Properties attributes ) throws XDocletException { } }
for ( Iterator it = _model . getClasses ( ) ; it . hasNext ( ) ; ) { _curClassDef = ( ClassDescriptorDef ) it . next ( ) ; generate ( template ) ; } _curClassDef = null ; LogHelper . debug ( true , OjbTagsHandler . class , "forAllClassDefinitions" , "Processed " + _model . getNumClasses ( ) + " types" ) ;
public class AbstractRasMethodAdapter { /** * Visit a stack map frame . */ @ Override public void visitFrame ( int type , int numLocals , Object [ ] locals , int stackSize , Object [ ] stack ) { } }
if ( ! isVisitFrameRequired ( ) ) return ; super . visitFrame ( type , numLocals , locals , stackSize , stack ) ;
public class ModelsImpl { /** * Create an entity role for an entity in the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param cEntityId The composite entity extractor ID . * @ param createCompositeEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the UUID object */ public Observable < UUID > createCompositeEntityRoleAsync ( UUID appId , String versionId , UUID cEntityId , CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter ) { } }
return createCompositeEntityRoleWithServiceResponseAsync ( appId , versionId , cEntityId , createCompositeEntityRoleOptionalParameter ) . map ( new Func1 < ServiceResponse < UUID > , UUID > ( ) { @ Override public UUID call ( ServiceResponse < UUID > response ) { return response . body ( ) ; } } ) ;
public class CouchDatabaseBase { /** * Removes a document from the database . * < p > The object must have the correct < code > _ id < / code > and < code > _ rev < / code > values . * @ param object The document to remove as object . * @ return { @ link Response } * @ throws NoDocumentException If the document is not found in the database . */ public Response remove ( Object object ) { } }
assertNotEmpty ( object , "object" ) ; JsonObject jsonObject = getGson ( ) . toJsonTree ( object ) . getAsJsonObject ( ) ; final String id = getAsString ( jsonObject , "_id" ) ; final String rev = getAsString ( jsonObject , "_rev" ) ; return remove ( id , rev ) ;
public class ExtendedTypeBuilderImpl { /** * Internal helper that resolves all the invokers using the given resolvers . * @ param contextType * the type of context the invokers use * @ param resolvers * list of resolvers * @ param typeToExtend * interface or abstract class to extend */ private static < CT , I > Function < CT , I > resolveAndExtend ( Class < CT > contextType , List < MethodResolver < CT > > resolvers , Class < I > typeToExtend ) { } }
// Resolve generics ResolvedTypeWithMembers withMembers = Types . resolveMembers ( typeToExtend ) ; Map < Method , MethodInvocationHandler < CT > > handlers = new HashMap < > ( ) ; try { // Go through methods and create invokers for each of them for ( ResolvedMethod method : withMembers . getMemberMethods ( ) ) { // Only try to implement abstract methods if ( ! method . isAbstract ( ) ) continue ; // Create an encounter and let the first method resolver that matches handle the method boolean foundInvoker = false ; MethodEncounter encounter = new MethodEncounterImpl ( method ) ; for ( MethodResolver < CT > resolver : resolvers ) { Optional < MethodInvocationHandler < CT > > opt = resolver . create ( encounter ) ; if ( opt . isPresent ( ) ) { // This resolver created an invoker to use foundInvoker = true ; handlers . put ( method . getRawMember ( ) , opt . get ( ) ) ; break ; } } if ( ! foundInvoker ) { // No invoker was found , can not handle the method throw new ProxyException ( "The method " + method . getName ( ) + " could not be handled" ) ; } } } catch ( ProxyException e ) { throw new ProxyException ( typeToExtend . getName ( ) + ":\n" + e . getMessage ( ) ) ; } catch ( Exception e ) { throw new ProxyException ( typeToExtend . getName ( ) + ":\n" + e . getMessage ( ) , e ) ; } return createFunction ( contextType , typeToExtend , Collections . unmodifiableMap ( handlers ) ) ;
public class AbstractClientOptionsBuilder { /** * Sets the { @ link ContentPreviewerFactory } for a request and a response . */ public B contentPreviewerFactory ( ContentPreviewerFactory factory ) { } }
requireNonNull ( factory , "factory" ) ; requestContentPreviewerFactory ( factory ) ; responseContentPreviewerFactory ( factory ) ; return self ( ) ;
public class SwitchCase { /** * Visits this node , then the case expression if present , then * each statement ( if any are specified ) . */ @ Override public void visit ( NodeVisitor v ) { } }
if ( v . visit ( this ) ) { if ( expression != null ) { expression . visit ( v ) ; } if ( statements != null ) { for ( AstNode s : statements ) { s . visit ( v ) ; } } }
public class JCasUtil2 { /** * Sets the end value of the annotation , updating indexes appropriately * @ param annotation the annotation * @ param end the new end value */ public static void updateEnd ( final Annotation annotation , final int end ) { } }
annotation . removeFromIndexes ( ) ; annotation . setEnd ( end ) ; annotation . addToIndexes ( ) ;
public class CrystalCell { /** * Gets the maximum dimension of the unit cell . * @ return */ public double getMaxDimension ( ) { } }
if ( maxDimension != 0 ) { return maxDimension ; } Point3d vert0 = new Point3d ( 0 , 0 , 0 ) ; Point3d vert1 = new Point3d ( 1 , 0 , 0 ) ; transfToOrthonormal ( vert1 ) ; Point3d vert2 = new Point3d ( 0 , 1 , 0 ) ; transfToOrthonormal ( vert2 ) ; Point3d vert3 = new Point3d ( 0 , 0 , 1 ) ; transfToOrthonormal ( vert3 ) ; Point3d vert4 = new Point3d ( 1 , 1 , 0 ) ; transfToOrthonormal ( vert4 ) ; Point3d vert5 = new Point3d ( 1 , 0 , 1 ) ; transfToOrthonormal ( vert5 ) ; Point3d vert6 = new Point3d ( 0 , 1 , 1 ) ; transfToOrthonormal ( vert6 ) ; Point3d vert7 = new Point3d ( 1 , 1 , 1 ) ; transfToOrthonormal ( vert7 ) ; ArrayList < Double > vertDists = new ArrayList < Double > ( ) ; vertDists . add ( vert0 . distance ( vert7 ) ) ; vertDists . add ( vert3 . distance ( vert4 ) ) ; vertDists . add ( vert1 . distance ( vert6 ) ) ; vertDists . add ( vert2 . distance ( vert5 ) ) ; maxDimension = Collections . max ( vertDists ) ; return maxDimension ;
public class LazyReact { /** * Create a steam from provided Suppliers , e . g . Supplier will be executed asynchronously * < pre > * { @ code * LazyReact . parallelCommonBuilder ( ) * . ofAsync ( ( ) - > loadFromDb ( ) , ( ) - > loadFromService1 ( ) , * ( ) - > loadFromService2 ( ) ) * . map ( this : : convertToStandardFormat ) * . peek ( System . out : : println ) * . map ( this : : saveData ) * . block ( ) ; * < / pre > * @ param actions Supplier Actions * @ return * @ see com . oath . cyclops . react . stream . BaseSimpleReact # react ( java . util . function . Supplier [ ] ) */ @ SafeVarargs public final < U > FutureStream < U > ofAsync ( final Supplier < U > ... actions ) { } }
return reactI ( actions ) ;
public class LocalDateCLA { /** * { @ inheritDoc } */ @ Override public LocalDate convert ( final String valueStr , final boolean _caseSensitive , final Object target ) throws ParseException { } }
if ( dtf == null ) if ( getFormat ( ) != null ) try { dtf = DateTimeFormatter . ofPattern ( getFormat ( ) ) ; } catch ( final Exception e ) { throw new ParseException ( "date format: " + e . getMessage ( ) , 0 ) ; } try { if ( dtf == null ) return TemporalHelper . parseWithPredefinedParsers ( valueStr ) . toLocalDate ( ) ; return LocalDateTime . parse ( valueStr , dtf ) . toLocalDate ( ) ; } catch ( final Exception e ) { throw new ParseException ( toString ( ) + " " + getFormat ( ) + ": " + e . getMessage ( ) , 0 ) ; }
public class appfwpolicylabel_binding { /** * Use this API to fetch appfwpolicylabel _ binding resource of given name . */ public static appfwpolicylabel_binding get ( nitro_service service , String labelname ) throws Exception { } }
appfwpolicylabel_binding obj = new appfwpolicylabel_binding ( ) ; obj . set_labelname ( labelname ) ; appfwpolicylabel_binding response = ( appfwpolicylabel_binding ) obj . get_resource ( service ) ; return response ;
public class CommitLog { /** * Forces a disk flush on the commit log files that need it . Blocking . */ public void sync ( boolean syncAllSegments ) { } }
CommitLogSegment current = allocator . allocatingFrom ( ) ; for ( CommitLogSegment segment : allocator . getActiveSegments ( ) ) { if ( ! syncAllSegments && segment . id > current . id ) return ; segment . sync ( ) ; }
public class OIDMap { /** * Add a name to lookup table . * @ param name the name of the attr * @ param oid the string representation of the object identifier for * the class . * @ param clazz the Class object associated with this attribute * @ exception CertificateException on errors . */ public static void addAttribute ( String name , String oid , Class < ? > clazz ) throws CertificateException { } }
ObjectIdentifier objId ; try { objId = new ObjectIdentifier ( oid ) ; } catch ( IOException ioe ) { throw new CertificateException ( "Invalid Object identifier: " + oid ) ; } OIDInfo info = new OIDInfo ( name , objId , clazz ) ; if ( oidMap . put ( objId , info ) != null ) { throw new CertificateException ( "Object identifier already exists: " + oid ) ; } if ( nameMap . put ( name , info ) != null ) { throw new CertificateException ( "Name already exists: " + name ) ; }
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getComment ( ) { } }
if ( commentEClass == null ) { commentEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 351 ) ; } return commentEClass ;
public class HudsonPrivateSecurityRealm { /** * Show the sign up page with the data from the identity . */ @ Override public HttpResponse commenceSignup ( final FederatedIdentity identity ) { } }
// store the identity in the session so that we can use this later Stapler . getCurrentRequest ( ) . getSession ( ) . setAttribute ( FEDERATED_IDENTITY_SESSION_KEY , identity ) ; return new ForwardToView ( this , "signupWithFederatedIdentity.jelly" ) { @ Override public void generateResponse ( StaplerRequest req , StaplerResponse rsp , Object node ) throws IOException , ServletException { SignupInfo si = new SignupInfo ( identity ) ; si . errorMessage = Messages . HudsonPrivateSecurityRealm_WouldYouLikeToSignUp ( identity . getPronoun ( ) , identity . getIdentifier ( ) ) ; req . setAttribute ( "data" , si ) ; super . generateResponse ( req , rsp , node ) ; } } ;
public class AbsQuery { /** * Convenient method for chaining several select queries together . * This method makes it easier to select multiple properties from one method call . It calls * select for all of its arguments . * @ param selections field names to be requested . * @ return the calling query for chaining . * @ throws NullPointerException if a field is null . * @ throws IllegalArgumentException if a field is of zero length , aka empty . * @ throws IllegalStateException if no contentType was queried for before . * @ throws IllegalArgumentException if tried to request deeper then the name of a field . * @ throws IllegalArgumentException if no selections were requested . * @ see # select ( String ) */ @ SuppressWarnings ( "unchecked" ) public Query select ( String ... selections ) { } }
checkNotNull ( selections , "Selections cannot be null. Please specify at least one." ) ; if ( selections . length == 0 ) { throw new IllegalArgumentException ( "Please provide a selection to be selected." ) ; } for ( int i = 0 ; i < selections . length ; i ++ ) { try { select ( selections [ i ] ) ; } catch ( IllegalStateException stateException ) { throw new IllegalStateException ( stateException ) ; } catch ( IllegalArgumentException argumentException ) { throw new IllegalArgumentException ( format ( "Could not select %d. field (\"%s\")." , i , selections [ i ] ) , argumentException ) ; } } return ( Query ) this ;
public class ConsumerSecurityVoter { /** * Votes on giving access to the specified authentication based on the security attributes . * @ param authentication The authentication . * @ param object The object . * @ param configAttributes the ConfigAttributes . * @ return The vote . */ public int vote ( Authentication authentication , Object object , Collection < ConfigAttribute > configAttributes ) { } }
int result = ACCESS_ABSTAIN ; if ( authentication . getDetails ( ) instanceof OAuthAuthenticationDetails ) { OAuthAuthenticationDetails details = ( OAuthAuthenticationDetails ) authentication . getDetails ( ) ; for ( Object configAttribute : configAttributes ) { ConfigAttribute attribute = ( ConfigAttribute ) configAttribute ; if ( ConsumerSecurityConfig . PERMIT_ALL_ATTRIBUTE . equals ( attribute ) ) { return ACCESS_GRANTED ; } else if ( ConsumerSecurityConfig . DENY_ALL_ATTRIBUTE . equals ( attribute ) ) { return ACCESS_DENIED ; } else if ( supports ( attribute ) ) { ConsumerSecurityConfig config = ( ConsumerSecurityConfig ) attribute ; if ( ( config . getSecurityType ( ) == ConsumerSecurityConfig . ConsumerSecurityType . CONSUMER_KEY ) && ( config . getAttribute ( ) . equals ( details . getConsumerDetails ( ) . getConsumerKey ( ) ) ) ) { return ACCESS_GRANTED ; } else if ( config . getSecurityType ( ) == ConsumerSecurityConfig . ConsumerSecurityType . CONSUMER_ROLE ) { List < GrantedAuthority > authorities = details . getConsumerDetails ( ) . getAuthorities ( ) ; if ( authorities != null ) { for ( GrantedAuthority authority : authorities ) { if ( authority . getAuthority ( ) . equals ( config . getAttribute ( ) ) ) { return ACCESS_GRANTED ; } } } } } } } return result ;
public class Grid { /** * Method declaration * @ param head */ public void setHead ( String [ ] head ) { } }
iColCount = head . length ; sColHead = new String [ iColCount ] ; iColWidth = new int [ iColCount ] ; for ( int i = 0 ; i < iColCount ; i ++ ) { sColHead [ i ] = head [ i ] ; iColWidth [ i ] = 100 ; } iRowCount = 0 ; iRowHeight = 0 ; vData = new Vector ( ) ;
public class ContentStoreServiceImpl { /** * Returns the content store item for the given url , returning null if not found . * < p > After acquiring the item from the { @ link ContentStoreAdapter } , the item ' s descriptor is merged ( according * to its { @ link org . craftercms . core . xml . mergers . DescriptorMergeStrategy } ) with related descriptors , and the * final item is then processed . < / p > */ @ Override protected Item doFindItem ( Context context , CachingOptions cachingOptions , String url , ItemProcessor processor ) throws InvalidContextException , XmlFileParseException , XmlMergeException , ItemProcessingException , StoreException { } }
// Add a leading slash if not present at the beginning of the url . This is done because although the store // adapter normally ignores a leading slash , the merge strategies don ' t , and they need it to return the // correct set of descriptor files to merge ( like all the impl of AbstractInheritFromHierarchyMergeStrategy ) . if ( ! url . startsWith ( "/" ) ) { url = "/" + url ; } Item item = context . getStoreAdapter ( ) . findItem ( context , cachingOptions , url , true ) ; if ( item != null ) { // Create a copy of the item , since it will be modified item = new Item ( item ) ; if ( item . getDescriptorDom ( ) != null ) { item = doMerging ( context , cachingOptions , item ) ; item = doProcessing ( context , cachingOptions , item , processor ) ; } else { item = doProcessing ( context , cachingOptions , item , processor ) ; } } return item ;
public class OkHttpStack { /** * / * package */ static void setConnectionParametersForRequest ( com . squareup . okhttp . Request . Builder builder , Request < ? > request ) throws IOException , AuthFailureError { } }
byte [ ] postBody = null ; if ( VolleyLog . DEBUG ) { VolleyLog . d ( "request.method = %1$s" , request . getMethod ( ) ) ; } switch ( request . getMethod ( ) ) { case Method . DEPRECATED_GET_OR_POST : // This is the deprecated way that needs to be handled for backwards compatibility . // If the request ' s post body is null , then the assumption is that the request is // GET . Otherwise , it is assumed that the request is a POST . postBody = request . getBody ( ) ; if ( postBody != null ) { // Prepare output . There is no need to set Content - Length explicitly , // since this is handled by HttpURLConnection using the size of the prepared // output stream . builder . post ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , postBody ) ) ; if ( VolleyLog . DEBUG ) { VolleyLog . d ( "RequestHeader: %1$s:%2$s" , OkRequest . HEADER_CONTENT_TYPE , request . getPostBodyContentType ( ) ) ; } } else { builder . get ( ) ; } break ; case Method . GET : // Not necessary to set the request method because connection defaults to GET but // being explicit here . builder . get ( ) ; break ; case Method . DELETE : builder . delete ( ) ; break ; case Method . POST : postBody = request . getBody ( ) ; if ( postBody == null ) { builder . post ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , "" ) ) ; } else { builder . post ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , postBody ) ) ; } if ( VolleyLog . DEBUG ) { VolleyLog . d ( "RequestHeader: %1$s:%2$s" , OkRequest . HEADER_CONTENT_TYPE , request . getBodyContentType ( ) ) ; } break ; case Method . PUT : postBody = request . getBody ( ) ; if ( postBody == null ) { builder . put ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , "" ) ) ; } else { builder . put ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , postBody ) ) ; } if ( VolleyLog . DEBUG ) { VolleyLog . d ( "RequestHeader: %1$s:%2$s" , OkRequest . HEADER_CONTENT_TYPE , request . getBodyContentType ( ) ) ; } break ; case Method . HEAD : builder . head ( ) ; break ; case Method . PATCH : postBody = request . getBody ( ) ; if ( postBody == null ) { builder . patch ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , "" ) ) ; } else { builder . patch ( RequestBody . create ( MediaType . parse ( request . getBodyContentType ( ) ) , postBody ) ) ; } if ( VolleyLog . DEBUG ) { VolleyLog . d ( "RequestHeader: %1$s:%2$s" , OkRequest . HEADER_CONTENT_TYPE , request . getBodyContentType ( ) ) ; } break ; default : throw new IllegalStateException ( "Unknown method type." ) ; }
public class AccountsApi { /** * Update Consumer Disclosure . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param langCode The simple type enumeration the language used in the response . The supported languages , with the language value shown in parenthesis , are : Arabic ( ar ) , Bulgarian ( bg ) , Czech ( cs ) , Chinese Simplified ( zh _ CN ) , Chinese Traditional ( zh _ TW ) , Croatian ( hr ) , Danish ( da ) , Dutch ( nl ) , English US ( en ) , English UK ( en _ GB ) , Estonian ( et ) , Farsi ( fa ) , Finnish ( fi ) , French ( fr ) , French Canada ( fr _ CA ) , German ( de ) , Greek ( el ) , Hebrew ( he ) , Hindi ( hi ) , Hungarian ( hu ) , Bahasa Indonesia ( id ) , Italian ( it ) , Japanese ( ja ) , Korean ( ko ) , Latvian ( lv ) , Lithuanian ( lt ) , Bahasa Melayu ( ms ) , Norwegian ( no ) , Polish ( pl ) , Portuguese ( pt ) , Portuguese Brazil ( pt _ BR ) , Romanian ( ro ) , Russian ( ru ) , Serbian ( sr ) , Slovak ( sk ) , Slovenian ( sl ) , Spanish ( es ) , Spanish Latin America ( es _ MX ) , Swedish ( sv ) , Thai ( th ) , Turkish ( tr ) , Ukrainian ( uk ) and Vietnamese ( vi ) . Additionally , the value can be set to à ̄ ¿ Â1 ⁄ 2browserà ̄ ¿ Â1 ⁄ 2 to automatically detect the browser language being used by the viewer and display the disclosure in that language . ( required ) * @ param consumerDisclosure ( optional ) * @ return ConsumerDisclosure */ public ConsumerDisclosure updateConsumerDisclosure ( String accountId , String langCode , ConsumerDisclosure consumerDisclosure ) throws ApiException { } }
return updateConsumerDisclosure ( accountId , langCode , consumerDisclosure , null ) ;
public class LogicalZipFile { /** * Key matches at position . * @ param manifest * the manifest * @ param key * the key * @ param pos * the position to try matching * @ return true if the key matches at this position */ private static boolean keyMatchesAtPosition ( final byte [ ] manifest , final byte [ ] key , final int pos ) { } }
if ( pos + key . length + 1 > manifest . length || manifest [ pos + key . length ] != ':' ) { return false ; } for ( int i = 0 ; i < key . length ; i ++ ) { // Manifest keys are case insensitive if ( toLowerCase [ manifest [ i + pos ] ] != key [ i ] ) { return false ; } } return true ;
public class PHPMethods { /** * It flips the key and values of a map . * @ param < K > * @ param < V > * @ param map * @ return */ public static < K , V > Map < V , K > array_flip ( Map < K , V > map ) { } }
Map < V , K > flipped = new HashMap < > ( ) ; for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { flipped . put ( entry . getValue ( ) , entry . getKey ( ) ) ; } return flipped ;
public class Text { /** * Determines if the < code > descendant < / code > path is hierarchical a descendant of * < code > path < / code > or equal to it . * @ param path * the path to check * @ param descendant * the potential descendant * @ return < code > true < / code > if the < code > descendant < / code > is a descendant or equal ; * < code > false < / code > otherwise . */ public static boolean isDescendantOrEqual ( String path , String descendant ) { } }
if ( path . equals ( descendant ) ) { return true ; } else { String pattern = path . endsWith ( "/" ) ? path : path + "/" ; return descendant . startsWith ( pattern ) ; }
public class HighlightGenerator { /** * Create the shape which will highlight the provided bond . * @ param bond the bond to highlight * @ param radius the specified radius * @ return the shape which will highlight the atom */ private static Shape createBondHighlight ( IBond bond , double radius ) { } }
double x1 = bond . getBegin ( ) . getPoint2d ( ) . x ; double x2 = bond . getEnd ( ) . getPoint2d ( ) . x ; double y1 = bond . getBegin ( ) . getPoint2d ( ) . y ; double y2 = bond . getEnd ( ) . getPoint2d ( ) . y ; double dx = x2 - x1 ; double dy = y2 - y1 ; double mag = Math . sqrt ( ( dx * dx ) + ( dy * dy ) ) ; dx /= mag ; dy /= mag ; double r2 = radius / 2 ; Shape s = new RoundRectangle2D . Double ( x1 - r2 , y1 - r2 , mag + radius , radius , radius , radius ) ; double theta = Math . atan2 ( dy , dx ) ; return AffineTransform . getRotateInstance ( theta , x1 , y1 ) . createTransformedShape ( s ) ;
public class DriverStatusManager { /** * Helper method to set the status . * This also checks whether the transition from the current status to the new one is legal . * @ param toStatus Driver status to transition to . */ private synchronized void setStatus ( final DriverStatus toStatus ) { } }
if ( this . driverStatus . isLegalTransition ( toStatus ) ) { this . driverStatus = toStatus ; } else { LOG . log ( Level . WARNING , "Illegal state transition: {0} -> {1}" , new Object [ ] { this . driverStatus , toStatus } ) ; }
public class ViewImpl { /** * Parses the date interval from the given date / time definition node . * @ param node the node to examine * @ return the node ' s date interval , or < tt > null < / tt > if none is defined or * it ' s invalid */ private static Interval < DateUnit > parseDateInterval ( JsonNode node ) { } }
try { if ( node . hasNonNull ( "dateInterval" ) && node . get ( "dateInterval" ) . hasNonNull ( "aggregationType" ) ) { JsonNode dateInterval = node . get ( "dateInterval" ) ; DateUnit unit = DateUnit . valueOf ( dateInterval . get ( "aggregationType" ) . asText ( ) . toUpperCase ( Locale . ENGLISH ) ) ; JsonNode interval = dateInterval . get ( "interval" ) ; String type = interval . get ( "type" ) . asText ( ) . toLowerCase ( Locale . ENGLISH ) ; if ( "relative" . equals ( type ) ) { // the server may send numbers inside strings // or numbers as decimals , e . g . 3.0 // regardless , we treat them all as int String from = interval . get ( "from" ) . asText ( ) ; String to = interval . get ( "to" ) . asText ( ) ; return new RelativeInterval < DateUnit > ( unit , ( int ) Float . parseFloat ( from ) , ( int ) Float . parseFloat ( to ) ) ; } else if ( "absolute" . equals ( type ) ) { // an absolute interval return new AbsoluteInterval < DateUnit > ( unit , unit . parseAbsolute ( interval . get ( "from" ) ) , unit . parseAbsolute ( interval . get ( "to" ) ) ) ; } else if ( "custom" . equals ( type ) ) { // a custom interval return new CustomInterval < DateUnit > ( unit , interval . get ( "from" ) . asText ( ) , interval . get ( "to" ) . asText ( ) ) ; } } } catch ( InvalidIntervalException e ) { // ignore the interval } catch ( NumberFormatException e ) { // ignore the interval } catch ( IllegalArgumentException e ) { // ignore the interval } return null ;
public class Guid { /** * Reverse of { @ link # toString } . Deserializes a { @ link Guid } from a previously serialized one . * @ param str Serialized { @ link Guid } . * @ return deserialized { @ link Guid } . * @ throws IOException */ public static Guid deserialize ( String str ) throws IOException { } }
if ( str . length ( ) != 2 * GUID_LENGTH ) { throw new IOException ( "String is not an encoded guid." ) ; } try { return new Guid ( Hex . decodeHex ( str . toCharArray ( ) ) , true ) ; } catch ( DecoderException de ) { throw new IOException ( de ) ; }
public class AbstractNode { /** * Attempts to retrieve the object stored in this node ' s object field ; the * result will be cast to the appropriate class , as per the user ' s input . * @ param object * the object owning the field represented by this node object . s * @ param field * the field containing the object represented by this node object . * @ param clazz * the class to which to cast the non - null result . * @ throws VisitorException * if an error occurs while evaluating the node ' s value . */ protected < T > T getFieldValue ( Object object , Field field , Class < T > clazz ) throws VisitorException { } }
boolean reprotect = false ; if ( object == null ) { return null ; } try { if ( ! field . isAccessible ( ) ) { field . setAccessible ( true ) ; reprotect = true ; } Object value = field . get ( object ) ; if ( value != null ) { logger . trace ( "field '{}' has value '{}'" , field . getName ( ) , value ) ; return clazz . cast ( value ) ; } } catch ( IllegalArgumentException e ) { logger . error ( "trying to access field '{}' on invalid object of class '{}'" , field . getName ( ) , object . getClass ( ) . getSimpleName ( ) ) ; throw new VisitorException ( "Trying to access field on invalid object" , e ) ; } catch ( IllegalAccessException e ) { logger . error ( "illegal access to class '{}'" , object . getClass ( ) . getSimpleName ( ) ) ; throw new VisitorException ( "Illegal access to class" , e ) ; } finally { if ( reprotect ) { field . setAccessible ( false ) ; } } return null ;
public class SymbolTable { /** * Make sure all the given scopes in { @ code otherSymbolTable } are in this symbol table . */ < S extends StaticScope > void addScopes ( Collection < S > scopes ) { } }
for ( S scope : scopes ) { createScopeFrom ( scope ) ; }
public class FileHelper { /** * Rename with retry . * @ param from * @ param to * @ return < tt > true < / tt > if the file was successfully renamed . */ public boolean rename ( final File from , final File to ) { } }
boolean renamed = false ; if ( this . isWriteable ( from ) ) { renamed = from . renameTo ( to ) ; } else { LogLog . debug ( from + " is not writeable for rename (retrying)" ) ; } if ( ! renamed ) { from . renameTo ( to ) ; renamed = ( ! from . exists ( ) ) ; } return renamed ;
public class EvidenceCollection { /** * Used to iterate over evidence of the specified type and confidence . * @ param type the evidence type to iterate over * @ param confidence the confidence level for the evidence to be iterated * over . * @ return Iterable & lt ; Evidence & gt ; an iterable collection of evidence */ public synchronized Iterable < Evidence > getIterator ( EvidenceType type , Confidence confidence ) { } }
if ( null != confidence && null != type ) { final Set < Evidence > list ; switch ( type ) { case VENDOR : list = Collections . unmodifiableSet ( new HashSet < > ( vendors ) ) ; break ; case PRODUCT : list = Collections . unmodifiableSet ( new HashSet < > ( products ) ) ; break ; case VERSION : list = Collections . unmodifiableSet ( new HashSet < > ( versions ) ) ; break ; default : return null ; } switch ( confidence ) { case HIGHEST : return EvidenceCollection . HIGHEST_CONFIDENCE . filter ( list ) ; case HIGH : return EvidenceCollection . HIGH_CONFIDENCE . filter ( list ) ; case MEDIUM : return EvidenceCollection . MEDIUM_CONFIDENCE . filter ( list ) ; default : return EvidenceCollection . LOW_CONFIDENCE . filter ( list ) ; } } return null ;
public class StringBufferWriter { /** * Write a portion of a string . * @ param text the text to be written * @ param offset offset from which to start writing characters * @ param length Number of characters to write */ public void write ( String text , int offset , int length ) { } }
buffer . append ( text , offset , offset + length ) ;
public class ICUHumanize { /** * Formats a date according to the given pattern . * @ param value * Date to be formatted * @ param pattern * The pattern . See { @ link dateFormatInstance ( String ) } * @ return a formatted date / time string */ public static String formatDate ( final Date value , final String pattern ) { } }
return new SimpleDateFormat ( pattern , context . get ( ) . getLocale ( ) ) . format ( value ) ;
public class Detector { /** * Finds a candidate center point of an Aztec code from an image * @ return the center point */ private Point getMatrixCenter ( ) { } }
ResultPoint pointA ; ResultPoint pointB ; ResultPoint pointC ; ResultPoint pointD ; // Get a white rectangle that can be the border of the matrix in center bull ' s eye or try { ResultPoint [ ] cornerPoints = new WhiteRectangleDetector ( image ) . detect ( ) ; pointA = cornerPoints [ 0 ] ; pointB = cornerPoints [ 1 ] ; pointC = cornerPoints [ 2 ] ; pointD = cornerPoints [ 3 ] ; } catch ( NotFoundException e ) { // This exception can be in case the initial rectangle is white // In that case , surely in the bull ' s eye , we try to expand the rectangle . int cx = image . getWidth ( ) / 2 ; int cy = image . getHeight ( ) / 2 ; pointA = getFirstDifferent ( new Point ( cx + 7 , cy - 7 ) , false , 1 , - 1 ) . toResultPoint ( ) ; pointB = getFirstDifferent ( new Point ( cx + 7 , cy + 7 ) , false , 1 , 1 ) . toResultPoint ( ) ; pointC = getFirstDifferent ( new Point ( cx - 7 , cy + 7 ) , false , - 1 , 1 ) . toResultPoint ( ) ; pointD = getFirstDifferent ( new Point ( cx - 7 , cy - 7 ) , false , - 1 , - 1 ) . toResultPoint ( ) ; } // Compute the center of the rectangle int cx = MathUtils . round ( ( pointA . getX ( ) + pointD . getX ( ) + pointB . getX ( ) + pointC . getX ( ) ) / 4.0f ) ; int cy = MathUtils . round ( ( pointA . getY ( ) + pointD . getY ( ) + pointB . getY ( ) + pointC . getY ( ) ) / 4.0f ) ; // Redetermine the white rectangle starting from previously computed center . // This will ensure that we end up with a white rectangle in center bull ' s eye // in order to compute a more accurate center . try { ResultPoint [ ] cornerPoints = new WhiteRectangleDetector ( image , 15 , cx , cy ) . detect ( ) ; pointA = cornerPoints [ 0 ] ; pointB = cornerPoints [ 1 ] ; pointC = cornerPoints [ 2 ] ; pointD = cornerPoints [ 3 ] ; } catch ( NotFoundException e ) { // This exception can be in case the initial rectangle is white // In that case we try to expand the rectangle . pointA = getFirstDifferent ( new Point ( cx + 7 , cy - 7 ) , false , 1 , - 1 ) . toResultPoint ( ) ; pointB = getFirstDifferent ( new Point ( cx + 7 , cy + 7 ) , false , 1 , 1 ) . toResultPoint ( ) ; pointC = getFirstDifferent ( new Point ( cx - 7 , cy + 7 ) , false , - 1 , 1 ) . toResultPoint ( ) ; pointD = getFirstDifferent ( new Point ( cx - 7 , cy - 7 ) , false , - 1 , - 1 ) . toResultPoint ( ) ; } // Recompute the center of the rectangle cx = MathUtils . round ( ( pointA . getX ( ) + pointD . getX ( ) + pointB . getX ( ) + pointC . getX ( ) ) / 4.0f ) ; cy = MathUtils . round ( ( pointA . getY ( ) + pointD . getY ( ) + pointB . getY ( ) + pointC . getY ( ) ) / 4.0f ) ; return new Point ( cx , cy ) ;
public class CodeAttr { /** * Indicate a local variable ' s use information be recorded in the * ClassFile as a debugging aid . If the LocalVariable doesn ' t provide * both a start and end location , then its information is not recorded . * This method should be called at most once per LocalVariable instance . */ public void localVariableUse ( LocalVariable localVar ) { } }
if ( mLocalVariableTable == null ) { addAttribute ( new LocalVariableTableAttr ( getConstantPool ( ) ) ) ; } mLocalVariableTable . addEntry ( localVar ) ;
public class ClassUtils { /** * Produces an array with all the instance fields of the specified class which match the supplied rules * @ param c The class specified * @ param excludePublic Exclude public fields if true * @ param excludeProtected Exclude protected fields if true * @ param excludePrivate Exclude private fields if true * @ return The array of matched Fields */ public static Field [ ] collectInstanceFields ( Class < ? > c , boolean excludePublic , boolean excludeProtected , boolean excludePrivate ) { } }
int inclusiveModifiers = 0 ; int exclusiveModifiers = Modifier . STATIC ; if ( excludePrivate ) { exclusiveModifiers += Modifier . PRIVATE ; } if ( excludePublic ) { exclusiveModifiers += Modifier . PUBLIC ; } if ( excludeProtected ) { exclusiveModifiers += Modifier . PROTECTED ; } return collectFields ( c , inclusiveModifiers , exclusiveModifiers ) ;
public class StreamProviderHDFS { /** * Returns an array of the file statuses of the files / directories in the given * path if it is a directory and an empty array otherwise . */ private FileStatus [ ] getFileStatusList ( final String pathString ) throws HadoopSecurityManagerException , IOException { } }
ensureHdfs ( ) ; final Path path = new Path ( pathString ) ; FileStatus pathStatus = null ; try { pathStatus = this . hdfs . getFileStatus ( path ) ; } catch ( final IOException e ) { cleanUp ( ) ; } if ( pathStatus != null && pathStatus . isDir ( ) ) { return this . hdfs . listStatus ( path ) ; } return new FileStatus [ 0 ] ;
public class MPJwtBadMPConfigAsSystemProperties { /** * The server will be started with all mp - config properties incorrectly configured in the jvm . options file . * The server . xml has a valid mp _ jwt config specified . * The config settings should come from server . xml . * The test should run successfully . * @ throws Exception */ @ Mode ( TestMode . LITE ) @ Test public void MPJwtBadMPConfigAsSystemProperties_GoodMpJwtConfigSpecifiedInServerXml ( ) throws Exception { } }
resourceServer . reconfigureServerUsingExpandedConfiguration ( _testName , "rs_server_AltConfigNotInApp_goodServerXmlConfig.xml" ) ; standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP ) ;
public class GlobToRegex { /** * Appends the regex form of the given normal character from the glob . */ private void appendNormal ( char c ) { } }
if ( REGEX_RESERVED . matches ( c ) ) { builder . append ( '\\' ) ; } builder . append ( c ) ;
public class ExternalScriptable { /** * Sets the value of the named property , creating it if need be . * @ param name the name of the property * @ param start the object whose property is being set * @ param value value to set the property to */ public void put ( String name , Scriptable start , Object value ) { } }
if ( start == this ) { synchronized ( this ) { if ( isEmpty ( name ) ) { indexedProps . put ( name , value ) ; } else { synchronized ( context ) { int scope = context . getAttributesScope ( name ) ; if ( scope == - 1 ) { scope = ScriptContext . ENGINE_SCOPE ; } context . setAttribute ( name , jsToJava ( value ) , scope ) ; } } } } else { start . put ( name , start , value ) ; }
public class CollapsedRequestSubject { /** * When set any client thread blocking on get ( ) will immediately be unblocked and receive the exception . * @ throws IllegalStateException * if called more than once or after setResponse . * @ param e received exception that gets set on the initial command */ @ Override public void setException ( Exception e ) { } }
if ( ! isTerminated ( ) ) { subject . onError ( e ) ; } else { throw new IllegalStateException ( "Response has already terminated so exception can not be set" , e ) ; }
public class PassCallPlan { /** * ( non - Javadoc ) * @ see jadex . bdi . runtime . Plan # body ( ) */ @ Override public void body ( ) { } }
IMessageEvent msg = ( IMessageEvent ) getReason ( ) ; String content = ( String ) msg . getParameter ( "content" ) . getValue ( ) ; if ( content . equalsIgnoreCase ( "UnknownLanguageCall" ) ) { this . getBeliefbase ( ) . getBelief ( "operatorTalking" ) . setFact ( true ) ; try { String type = ( String ) msg . getParameter ( "performative" ) . getValue ( ) ; String agent_name = ( String ) ( ( IComponentIdentifier ) msg . getParameter ( SFipa . SENDER ) . getValue ( ) ) . getLocalName ( ) ; String answer = ( String ) ( ( AgentBehaviour ) getBeliefbase ( ) . getBelief ( "agent_behaviour" ) . getFact ( ) ) . processMessage ( type , agent_name , content ) ; if ( answer == null ) answer = "Unknown required action" ; IMessageEvent msgResp = getEventbase ( ) . createReply ( msg , "send_inform" ) ; msgResp . getParameter ( SFipa . CONTENT ) . setValue ( answer ) ; sendMessage ( msgResp ) ; } catch ( Exception e ) { // Not important for tutorial purposes . } }
public class BuildContext { /** * Pull the value of an element from a configuration tree . This can either * be an absolute , relative , or external path . * @ param path * path to lookup * @ param errorIfNotFound * if true an EvaluationException will be thrown if the path * can ' t be found * @ return Element associated to the given path * @ throws EvaluationException * if the path can ' t be found and errorIfNotFound is set , or if * the path is relative and relativeRoot isn ' t set */ public Element getElement ( Path path , boolean errorIfNotFound ) throws EvaluationException { } }
// Set the initial node to use . Element node = null ; // The initial element to use depends on the type of path . Define the // correct root element . switch ( path . getType ( ) ) { case ABSOLUTE : // Typical , very easy case . All absolute paths refer to this object . node = root ; break ; case RELATIVE : // Check to see if we are within a structure template by checking if // relativeRoot is set . If set , then proceed with lookup , otherwise // fail . if ( relativeRoot != null ) { node = relativeRoot ; } else { throw new EvaluationException ( "relative path ('" + path + "') cannot be used to retrieve element in configuration" ) ; } break ; case EXTERNAL : // This is an external path . Check the authority . String myObject = objectTemplate . name ; String externalObject = path . getAuthority ( ) ; if ( myObject . equals ( externalObject ) ) { // Easy case , this references itself . Just set the initial node // to the root of this object . node = root ; } else { // FIXME : Review this code . Much can probably be deleted . // Harder case , we must lookup the other object template , // compiling and building it as necessary . // Try loading the template . This may throw an // EvaluationException if something goes wrong in the load . Template externalTemplate = localAndGlobalLoad ( externalObject , ! errorIfNotFound ) ; // Check to see if the template was found . if ( externalTemplate != null && ! errorIfNotFound ) { // If we asked for only a lookup of the template , then we // need to ensure that the referenced template is added to // the dependencies . dependencies . put ( externalObject , externalTemplate ) ; objectDependencies . add ( externalObject ) ; } else if ( externalTemplate == null ) { // Throw an error or return null as appropriate . if ( errorIfNotFound ) { throw new EvaluationException ( "object template " + externalObject + " could not be found" , null ) ; } else { return null ; } } // Verify that the retrieved template is actually an object // template . if ( externalTemplate . type != TemplateType . OBJECT ) { throw new EvaluationException ( externalObject + " does not refer to an object template" ) ; } // Retrieve the build cache . BuildCache bcache = compiler . getBuildCache ( ) ; // Only check the object dependencies if this object is // currently in the " build " phase . If this is being validated , // then circular dependencies will be handled without problems . // If dependencies are checked , check BEFORE waiting for the // external object , otherwise the compilation may deadlock . if ( checkObjectDependencies ) { bcache . setDependency ( myObject , externalObject ) ; } // Wait for the result and set the node to the external object ' s // root element . BuildResult result = ( BuildResult ) bcache . waitForResult ( externalObject ) ; node = result . getRoot ( ) ; } break ; } // Now that the root node is defined , recursively descend through the // given terms to retrieve the desired element . assert ( node != null ) ; try { node = node . rget ( path . getTerms ( ) , 0 , node . isProtected ( ) , ! errorIfNotFound ) ; } catch ( InvalidTermException ite ) { throw new EvaluationException ( ite . formatMessage ( path ) ) ; } if ( ! errorIfNotFound || node != null ) { return node ; } else { throw new EvaluationException ( MessageUtils . format ( MSG_NO_VALUE_FOR_PATH , path . toString ( ) ) ) ; }
public class MessageItem { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . store . Item # itemReferencesDroppedToZero ( ) */ @ Override public void itemReferencesDroppedToZero ( ) { } }
super . itemReferencesDroppedToZero ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "itemReferencesDroppedToZero" ) ; if ( failedInitInRestore ) { try { initialiseNonPersistent ( true ) ; } catch ( SevereMessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.items.MessageItem.itemReferencesDroppedToZero" , "1:1617:1.244.1.40" , this ) ; // There was a problem getting hold of the itemstream when trying to initilise // We wouldn ' t have registered any callbacks yet so we shouldn ' t carry on SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "itemReferencesDroppedToZero" , e ) ; throw new SIErrorException ( e ) ; } } if ( REFERENCES_DROPPED_TO_ZERO != null ) { try { REFERENCES_DROPPED_TO_ZERO . messageEventOccurred ( MessageEvents . REFERENCES_DROPPED_TO_ZERO , this , null ) ; } catch ( SIException e ) { // Exceptions after a commit are bad ! FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.items.MessageItem.itemReferencesDroppedToZero" , "1:1644:1.244.1.40" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "itemReferencesDroppedToZero" , e ) ; throw new SIErrorException ( e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "itemReferencesDroppedToZero" ) ;
public class Evaluation { /** * Returns the precision for a given label * @ param classLabel the label * @ param edgeCase What to output in case of 0/0 * @ return the precision for the label */ public double precision ( Integer classLabel , double edgeCase ) { } }
double tpCount = truePositives . getCount ( classLabel ) ; double fpCount = falsePositives . getCount ( classLabel ) ; return EvaluationUtils . precision ( ( long ) tpCount , ( long ) fpCount , edgeCase ) ;
public class StepExecution { /** * Strategies used when step fails , we support Continue and Abort . Abort will fail the automation when the step * fails . Continue will ignore the failure of current step and allow automation to run the next step . With * conditional branching , we add step : stepName to support the automation to go to another specific step . * @ return Strategies used when step fails , we support Continue and Abort . Abort will fail the automation when the * step fails . Continue will ignore the failure of current step and allow automation to run the next step . * With conditional branching , we add step : stepName to support the automation to go to another specific * step . */ public java . util . List < String > getValidNextSteps ( ) { } }
if ( validNextSteps == null ) { validNextSteps = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return validNextSteps ;
public class Serial { /** * < p > Sends one or more ASCII CharBuffers to the serial port / device identified by the given file descriptor . < / p > * @ param fd * The file descriptor of the serial port / device . * @ param data * One or more ASCII CharBuffers ( or an array ) of data to be transmitted . ( variable - length - argument ) */ public synchronized static void write ( int fd , CharBuffer ... data ) throws IllegalStateException , IOException { } }
write ( fd , StandardCharsets . US_ASCII , data ) ;
public class DescribeEnvironmentsResult { /** * Returns an < a > EnvironmentDescription < / a > list . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEnvironments ( java . util . Collection ) } or { @ link # withEnvironments ( java . util . Collection ) } if you want to * override the existing values . * @ param environments * Returns an < a > EnvironmentDescription < / a > list . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeEnvironmentsResult withEnvironments ( EnvironmentDescription ... environments ) { } }
if ( this . environments == null ) { setEnvironments ( new com . amazonaws . internal . SdkInternalList < EnvironmentDescription > ( environments . length ) ) ; } for ( EnvironmentDescription ele : environments ) { this . environments . add ( ele ) ; } return this ;
public class Formatter { /** * 将String转换成Double * @ param string 需要转换为字符串 * @ return 转换结果 , 如果数值非法 , 则返回 - 1 */ public static double stringToDouble ( String string ) { } }
string = string . trim ( ) ; if ( Checker . isDecimal ( string ) ) { return Double . parseDouble ( string ) ; } return - 1 ;
public class AbstractAuditDeleteBuilderImpl { /** * service methods */ protected JPAAuditLogService getJpaAuditLogService ( ) { } }
JPAAuditLogService jpaAuditLogService = this . jpaAuditService ; if ( jpaAuditLogService == null ) { jpaAuditLogService = this . executor . execute ( getJpaAuditLogServiceCommand ) ; } return jpaAuditLogService ;
public class IntHashMap { /** * Returns < tt > true < / tt > if this map maps one or more keys to the * specified value . * @ param value value whose presence in this map is to be tested . * @ return < tt > true < / tt > if this map maps one or more keys to the * specified value . */ public boolean containsValue ( Object value ) { } }
Entry tab [ ] = table ; if ( value == null ) { for ( int i = tab . length ; i -- > 0 ; ) { for ( Entry e = tab [ i ] ; e != null ; e = e . next ) { if ( e . value == null ) { return true ; } } } } else { for ( int i = tab . length ; i -- > 0 ; ) { for ( Entry e = tab [ i ] ; e != null ; e = e . next ) { if ( value . equals ( e . value ) ) { return true ; } } } } return false ;
public class policymap { /** * Use this API to delete policymap resources of given names . */ public static base_responses delete ( nitro_service client , String mappolicyname [ ] ) throws Exception { } }
base_responses result = null ; if ( mappolicyname != null && mappolicyname . length > 0 ) { policymap deleteresources [ ] = new policymap [ mappolicyname . length ] ; for ( int i = 0 ; i < mappolicyname . length ; i ++ ) { deleteresources [ i ] = new policymap ( ) ; deleteresources [ i ] . mappolicyname = mappolicyname [ i ] ; } result = delete_bulk_request ( client , deleteresources ) ; } return result ;
public class NioChildDatagramChannel { /** * Leave the specified multicast group at the specified interface using the specified source . */ public ChannelFuture leaveGroup ( InetAddress multicastAddress , NetworkInterface networkInterface , InetAddress source ) { } }
if ( DetectionUtil . javaVersion ( ) < 7 ) { throw new UnsupportedOperationException ( ) ; } else { if ( multicastAddress == null ) { throw new NullPointerException ( "multicastAddress" ) ; } if ( networkInterface == null ) { throw new NullPointerException ( "networkInterface" ) ; } synchronized ( this ) { if ( memberships != null ) { List < MembershipKey > keys = memberships . get ( multicastAddress ) ; if ( keys != null ) { Iterator < MembershipKey > keyIt = keys . iterator ( ) ; while ( keyIt . hasNext ( ) ) { MembershipKey key = keyIt . next ( ) ; if ( networkInterface . equals ( key . networkInterface ( ) ) ) { if ( source == null && key . sourceAddress ( ) == null || source != null && source . equals ( key . sourceAddress ( ) ) ) { key . drop ( ) ; keyIt . remove ( ) ; } } } if ( keys . isEmpty ( ) ) { memberships . remove ( multicastAddress ) ; } } } } return succeededFuture ( this ) ; }
public class AbstractJaxbMojo { /** * Prints out the system properties to the Maven Log at Debug level . */ protected void logSystemPropertiesAndBasedir ( ) { } }
if ( getLog ( ) . isDebugEnabled ( ) ) { final StringBuilder builder = new StringBuilder ( ) ; builder . append ( "\n+=================== [System properties]\n" ) ; builder . append ( "|\n" ) ; // Sort the system properties final SortedMap < String , Object > props = new TreeMap < String , Object > ( ) ; props . put ( "basedir" , FileSystemUtilities . getCanonicalPath ( getProject ( ) . getBasedir ( ) ) ) ; for ( Map . Entry < Object , Object > current : System . getProperties ( ) . entrySet ( ) ) { props . put ( "" + current . getKey ( ) , current . getValue ( ) ) ; } for ( Map . Entry < String , Object > current : props . entrySet ( ) ) { builder . append ( "| [" + current . getKey ( ) + "]: " + current . getValue ( ) + "\n" ) ; } builder . append ( "|\n" ) ; builder . append ( "+=================== [End System properties]\n" ) ; // All done . getLog ( ) . debug ( builder . toString ( ) . replace ( "\n" , NEWLINE ) ) ; }
public class Pays { /** * app支付 * @ param request 支付请求对象 * @ return AppPayResponse对象 , 或抛WepayException */ public AppPayResponse appPay ( PayRequest request ) { } }
checkPayParams ( request ) ; Map < String , Object > respData = doAppPay ( request , TradeType . APP ) ; return buildAppPayResp ( respData ) ;
public class AutoListPage { /** * Prints an unordered list of the available pages . */ public static void printPageList ( ChainWriter out , WebSiteRequest req , HttpServletResponse resp , WebPage parent , WebPageLayout layout ) throws IOException , SQLException { } }
printPageList ( out , req , resp , parent . getCachedPages ( req ) , layout ) ;
public class RallyCollectorTask { /** * Clean up unused rally collector items * @ param collector * the { @ link RallyCollector } */ @ SuppressWarnings ( "PMD.AvoidDeeplyNestedIfStmts" ) // agreed PMD , fixme private void clean ( RallyCollector collector , List < RallyProject > existingProjects ) { } }
Set < ObjectId > uniqueIDs = new HashSet < > ( ) ; for ( com . capitalone . dashboard . model . Component comp : dbComponentRepository . findAll ( ) ) { if ( comp . getCollectorItems ( ) != null && ! comp . getCollectorItems ( ) . isEmpty ( ) ) { List < CollectorItem > itemList = comp . getCollectorItems ( ) . get ( CollectorType . AgileTool ) ; if ( itemList != null ) { for ( CollectorItem ci : itemList ) { if ( ci != null && ci . getCollectorId ( ) . equals ( collector . getId ( ) ) ) { uniqueIDs . add ( ci . getId ( ) ) ; } } } } } List < RallyProject > stateChangeJobList = new ArrayList < > ( ) ; Set < ObjectId > udId = new HashSet < > ( ) ; udId . add ( collector . getId ( ) ) ; for ( RallyProject job : existingProjects ) { // collect the jobs that need to change state : enabled vs disabled . if ( ( job . isEnabled ( ) && ! uniqueIDs . contains ( job . getId ( ) ) ) || // if // it // was // enabled // but // not // on // dashboard ( ! job . isEnabled ( ) && uniqueIDs . contains ( job . getId ( ) ) ) ) { // OR // it // was // disabled // and // now // on // dashboard job . setEnabled ( uniqueIDs . contains ( job . getId ( ) ) ) ; stateChangeJobList . add ( job ) ; } } if ( ! CollectionUtils . isEmpty ( stateChangeJobList ) ) { rallyProjectRepository . save ( stateChangeJobList ) ; }
public class DetachSecurityProfileRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DetachSecurityProfileRequest detachSecurityProfileRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( detachSecurityProfileRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( detachSecurityProfileRequest . getSecurityProfileName ( ) , SECURITYPROFILENAME_BINDING ) ; protocolMarshaller . marshall ( detachSecurityProfileRequest . getSecurityProfileTargetArn ( ) , SECURITYPROFILETARGETARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GroupsApi { /** * Search for groups . 18 + groups will only be returned for authenticated calls where the authenticated user is over 18. * < br > * This method does not require authentication . * < br > * @ param text ( Required ) The text to search for . * @ param perPage ( Optional ) Number of groups to return per page . If this argument is less than 1 , it defaults to 100. * The maximum allowed value is 500. * @ param page ( Optional ) The page of results to return . If this argument is less than 1 , it defaults to 1. * @ return group search results . * @ throws JinxException if required parameters are missing , or if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . groups . search . html " > flickr . groups . search < / a > */ public GroupSearch search ( String text , int perPage , int page ) throws JinxException { } }
JinxUtils . validateParams ( text ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.groups.search" ) ; params . put ( "text" , text ) ; if ( perPage > 0 ) { params . put ( "per_page" , Integer . toString ( perPage ) ) ; } if ( page > 0 ) { params . put ( "page" , Integer . toString ( page ) ) ; } return jinx . flickrGet ( params , GroupSearch . class , false ) ;
public class RESTReflect { /** * Finds the path of a method . If the declaring class and the method are both * annotated with { @ literal @ } Path , the paths will be concatenated . * Leading or ending slashes in paths are not taken in account . The method * will always add a leading slash and strip the ending slash . * If JAX - RS regex are present in the path , they will be replaced by * UriTemplate expressions . * For example : * < pre > * { @ literal @ } Path ( " widgets / { widgetName : [ a - zA - Z ] [ a - zA - Z _ 0-9 ] } / " ) - - > / widgets / { widgetName } * < / pre > * @ param method the method to scan * @ return the resource ' s path */ static String findPath ( Method method ) { } }
Path pathFromClass = method . getDeclaringClass ( ) . getAnnotation ( Path . class ) ; Path pathFromMethod = method . getAnnotation ( Path . class ) ; String path = concatenatePathValues ( pathFromClass , pathFromMethod ) ; if ( path == null ) { return null ; } else { path = addLeadingSlash ( path ) ; return UriBuilder . stripJaxRsRegex ( path ) ; }
public class PoolDeleteOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time . * @ param ifUnmodifiedSince the ifUnmodifiedSince value to set * @ return the PoolDeleteOptions object itself . */ public PoolDeleteOptions withIfUnmodifiedSince ( DateTime ifUnmodifiedSince ) { } }
if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ;
public class Uris { /** * Perform am URI fragment identifier < strong > escape < / strong > operation * on a { @ code String } input . * This method simply calls the equivalent method in the { @ code UriEscape } class from the * < a href = " http : / / www . unbescape . org " > Unbescape < / a > library . * The following are the only allowed chars in an URI fragment identifier ( will not be escaped ) : * < ul > * < li > { @ code A - Z a - z 0-9 } < / li > * < li > { @ code - . _ ~ } < / li > * < li > { @ code ! $ & ' ( ) * + , ; = } < / li > * < li > { @ code : @ } < / li > * < li > { @ code / ? } < / li > * < / ul > * All other chars will be escaped by converting them to the sequence of bytes that * represents them in the specified < em > encoding < / em > and then representing each byte * in { @ code % HH } syntax , being { @ code HH } the hexadecimal representation of the byte . * This method is < strong > thread - safe < / strong > . * @ param text the { @ code String } to be escaped . * @ param encoding the encoding to be used for escaping . * @ return The escaped result { @ code String } . As a memory - performance improvement , will return the exact * same object as the { @ code text } input argument if no escaping modifications were required ( and * no additional { @ code String } objects will be created during processing ) . Will * return { @ code null } if { @ code text } is { @ code null } . */ public String escapeFragmentId ( final String text , final String encoding ) { } }
return UriEscape . escapeUriFragmentId ( text , encoding ) ;
public class AbstractResourceRegistration { /** * { @ inheritDoc } */ @ Override public final ManagementResourceRegistration getOverrideModel ( String name ) { } }
Assert . checkNotNullParam ( "name" , name ) ; if ( parent == null ) { throw ControllerLogger . ROOT_LOGGER . cannotOverrideRootRegistration ( ) ; } if ( ! PathElement . WILDCARD_VALUE . equals ( valueString ) ) { throw ControllerLogger . ROOT_LOGGER . cannotOverrideNonWildCardRegistration ( valueString ) ; } PathElement pe = PathElement . pathElement ( parent . getKeyName ( ) , name ) ; // TODO https : / / issues . jboss . org / browse / WFLY - 2883 // ManagementResourceRegistration candidate = parent . getParent ( ) . getSubModel ( PathAddress . pathAddress ( pe ) ) ; // / / We may have gotten back the wildcard reg ; detect this by checking for allowing override // return candidate . isAllowsOverride ( ) ? null : candidate ; return parent . getParent ( ) . getSubModel ( PathAddress . pathAddress ( pe ) ) ;
public class TokenStream { /** * Return the value of this token and move to the next token . * @ return the value of the current token * @ throws ParsingException if there is no such token to consume * @ throws IllegalStateException if this method was called before the stream was { @ link # start ( ) started } */ public String consume ( ) throws ParsingException , IllegalStateException { } }
if ( completed ) throwNoMoreContent ( ) ; // Get the value from the current token . . . String result = currentToken ( ) . value ( ) ; moveToNextToken ( ) ; return result ;
public class RemovingSEofNBMechanism { /** * Initiates the process for the given mechanism . The atoms to apply are mapped between * reactants and products . * @ param atomContainerSet * @ param atomList The list of atoms taking part in the mechanism . Only allowed one atom * @ param bondList The list of bonds taking part in the mechanism . Only allowed one Bond * @ return The Reaction mechanism */ @ Override public IReaction initiate ( IAtomContainerSet atomContainerSet , ArrayList < IAtom > atomList , ArrayList < IBond > bondList ) throws CDKException { } }
CDKAtomTypeMatcher atMatcher = CDKAtomTypeMatcher . getInstance ( atomContainerSet . getBuilder ( ) ) ; if ( atomContainerSet . getAtomContainerCount ( ) != 1 ) { throw new CDKException ( "RemovingSEofNBMechanism only expects one IAtomContainer" ) ; } if ( atomList . size ( ) != 1 ) { throw new CDKException ( "RemovingSEofNBMechanism only expects one atom in the ArrayList" ) ; } if ( bondList != null ) { throw new CDKException ( "RemovingSEofNBMechanism don't expect any bond in the ArrayList" ) ; } IAtomContainer molecule = atomContainerSet . getAtomContainer ( 0 ) ; IAtomContainer reactantCloned ; try { reactantCloned = ( IAtomContainer ) molecule . clone ( ) ; } catch ( CloneNotSupportedException e ) { throw new CDKException ( "Could not clone IAtomContainer!" , e ) ; } // remove one lone pair electron and substitute with one single electron and charge 1. int posAtom = molecule . indexOf ( atomList . get ( 0 ) ) ; List < ILonePair > lps = reactantCloned . getConnectedLonePairsList ( reactantCloned . getAtom ( posAtom ) ) ; reactantCloned . removeLonePair ( lps . get ( lps . size ( ) - 1 ) ) ; reactantCloned . addSingleElectron ( molecule . getBuilder ( ) . newInstance ( ISingleElectron . class , reactantCloned . getAtom ( posAtom ) ) ) ; int charge = reactantCloned . getAtom ( posAtom ) . getFormalCharge ( ) ; reactantCloned . getAtom ( posAtom ) . setFormalCharge ( charge + 1 ) ; // check if resulting atom type is reasonable reactantCloned . getAtom ( posAtom ) . setHybridization ( null ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( reactantCloned ) ; IAtomType type = atMatcher . findMatchingAtomType ( reactantCloned , reactantCloned . getAtom ( posAtom ) ) ; if ( type == null || type . getAtomTypeName ( ) . equals ( "X" ) ) return null ; IReaction reaction = molecule . getBuilder ( ) . newInstance ( IReaction . class ) ; reaction . addReactant ( molecule ) ; /* mapping */ for ( IAtom atom : molecule . atoms ( ) ) { IMapping mapping = molecule . getBuilder ( ) . newInstance ( IMapping . class , atom , reactantCloned . getAtom ( molecule . indexOf ( atom ) ) ) ; reaction . addMapping ( mapping ) ; } reaction . addProduct ( reactantCloned ) ; return reaction ;
public class RequiredRuleNameComputer { /** * Return the containing group if it contains exactly one element . * @ since 2.14 */ protected AbstractElement getEnclosingSingleElementGroup ( AbstractElement elementToParse ) { } }
EObject container = elementToParse . eContainer ( ) ; if ( container instanceof Group ) { if ( ( ( Group ) container ) . getElements ( ) . size ( ) == 1 ) { return ( AbstractElement ) container ; } } return null ;
public class GeographyValue { /** * Given a column of type GEOGRAPHY ( nbytes ) , return an upper bound on the * number of characters needed to represent any entity of this type in WKT . * @ param numBytes The size of the GEOGRAPHY value in bytes * @ return Upper bound of characters needed for WKT string */ public static int getValueDisplaySize ( int numBytes ) { } }
if ( numBytes < MIN_SERIALIZED_LENGTH ) { throw new IllegalArgumentException ( "Cannot compute max display size for a GEOGRAPHY value of size " + numBytes + " bytes, since minimum allowed size is " + MIN_SERIALIZED_LENGTH ) ; } // Vertices will dominate the WKT output , so compute the maximum // number of vertices given the number of bytes . This will be a polygon // with just one loop . int numBytesUsedForVertices = numBytes ; numBytesUsedForVertices -= polygonOverheadInBytes ( ) ; numBytesUsedForVertices -= loopOverheadInBytes ( ) ; int numVertices = numBytesUsedForVertices / 24 ; // display size will be // " POLYGON ( ( ) ) " [ 12 bytes ] // plus the number of bytes used by vertices : // " - 180.123456789012 - 90.123456789012 , " [ max of 36 bytes per vertex ] return 12 + 36 * numVertices ;
public class HThriftClient { /** * { @ inheritDoc } */ public HThriftClient close ( ) { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "Closing client {}" , this ) ; } if ( isOpen ( ) ) { try { transport . flush ( ) ; } catch ( Exception e ) { log . error ( "Could not flush transport (to be expected if the pool is shutting down) in close for client: " + toString ( ) , e ) ; } finally { try { transport . close ( ) ; } catch ( Exception e ) { log . error ( "Error on transport close for client: " + toString ( ) , e ) ; } } } return this ;
public class CopyFileExtensions { /** * Copies the given source file to the given destination file . * @ param source * The source file . * @ param destination * The destination file . * @ return ' s true if the file is copied , otherwise false . * @ throws IOException * Is thrown if an error occurs by reading or writing . * @ throws FileIsADirectoryException * Is thrown if the destination file is a directory . */ public static boolean copyFile ( final File source , final File destination ) throws IOException , FileIsADirectoryException { } }
return copyFile ( source , destination , true ) ;
public class TypedVisitor { /** * Get the actual type arguments a child class has used to extend a generic base class . * @ param baseClass the base class * @ param childClass the child class * @ return a list of the raw classes for the actual type arguments . */ static < T > List < Class > getTypeArguments ( Class < T > baseClass , Class < ? extends T > childClass ) { } }
Map < Type , Type > resolvedTypes = new LinkedHashMap < Type , Type > ( ) ; Type type = childClass ; // start walking up the inheritance hierarchy until we hit baseClass while ( ! getClass ( type ) . equals ( baseClass ) ) { if ( type instanceof Class ) { // there is no useful information for us in raw types , so just keep going . type = ( ( Class ) type ) . getGenericSuperclass ( ) ; } else { ParameterizedType parameterizedType = ( ParameterizedType ) type ; Class < ? > rawType = ( Class ) parameterizedType . getRawType ( ) ; Type [ ] actualTypeArguments = parameterizedType . getActualTypeArguments ( ) ; TypeVariable < ? > [ ] typeParameters = rawType . getTypeParameters ( ) ; for ( int i = 0 ; i < actualTypeArguments . length ; i ++ ) { resolvedTypes . put ( typeParameters [ i ] , actualTypeArguments [ i ] ) ; } if ( ! rawType . equals ( baseClass ) ) { type = rawType . getGenericSuperclass ( ) ; } } } // finally , for each actual type argument provided to baseClass , determine ( if possible ) // the raw class for that type argument . Type [ ] actualTypeArguments ; if ( type instanceof Class ) { actualTypeArguments = ( ( Class ) type ) . getTypeParameters ( ) ; } else { actualTypeArguments = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; } List < Class > typeArgumentsAsClasses = new ArrayList < Class > ( ) ; // resolve types by chasing down type variables . for ( Type baseType : actualTypeArguments ) { while ( resolvedTypes . containsKey ( baseType ) ) { baseType = resolvedTypes . get ( baseType ) ; } typeArgumentsAsClasses . add ( getClass ( baseType ) ) ; } return typeArgumentsAsClasses ;
public class ProjectEntityExtensionController { /** * Gets the list of actions for an entity */ @ RequestMapping ( value = "actions/{entityType}/{id}" , method = RequestMethod . GET ) public Resources < Action > getActions ( @ PathVariable ProjectEntityType entityType , @ PathVariable ID id ) { } }
return Resources . of ( extensionManager . getExtensions ( ProjectEntityActionExtension . class ) . stream ( ) . map ( x -> x . getAction ( getEntity ( entityType , id ) ) . map ( action -> resolveExtensionAction ( x , action ) ) ) . filter ( Optional :: isPresent ) . map ( Optional :: get ) . collect ( Collectors . toList ( ) ) , uri ( MvcUriComponentsBuilder . on ( getClass ( ) ) . getActions ( entityType , id ) ) ) ;
public class NetworkUtils { /** * Utility method for accessing public interfaces . * @ return The { @ link Collection } of public interfaces . * @ throws SocketException If there ' s a socket error accessing the * interfaces . */ public static Collection < InetAddress > getNetworkInterfaces ( ) throws SocketException { } }
final Collection < InetAddress > addresses = new ArrayList < InetAddress > ( ) ; final Enumeration < NetworkInterface > e = NetworkInterface . getNetworkInterfaces ( ) ; while ( e . hasMoreElements ( ) ) { final NetworkInterface ni = e . nextElement ( ) ; final Enumeration < InetAddress > niAddresses = ni . getInetAddresses ( ) ; while ( niAddresses . hasMoreElements ( ) ) { addresses . add ( niAddresses . nextElement ( ) ) ; } } return addresses ;
public class SequenceValueGenerator { /** * Reset the sequence . * @ param initialValue first value produced by sequence */ public void reset ( int initialValue ) throws FetchException , PersistException { } }
synchronized ( mStoredSequence ) { Transaction txn = mRepository . enterTopTransaction ( null ) ; txn . setForUpdate ( true ) ; try { boolean doUpdate = mStoredSequence . tryLoad ( ) ; mStoredSequence . setInitialValue ( initialValue ) ; // Start as small as possible to allow signed long comparisons to work . mStoredSequence . setNextValue ( Long . MIN_VALUE ) ; if ( doUpdate ) { mStoredSequence . update ( ) ; } else { mStoredSequence . insert ( ) ; } txn . commit ( ) ; mHasReservedValues = false ; } finally { txn . exit ( ) ; } }
public class LocalConnectionManager { /** * Opens the project specified by the file path or URI given in * the constructor . * @ return a Protege { @ link Project } . * @ see ConnectionManager # initProject ( ) */ @ SuppressWarnings ( "unchecked" ) @ Override protected Project initProject ( ) { } }
Collection errors = new ArrayList ( ) ; String projectFilePathOrURI = getProjectIdentifier ( ) ; return new Project ( projectFilePathOrURI , errors ) ;
public class RuleBasedCollator { /** * Sets the case first mode to the initial mode set during construction of the RuleBasedCollator . See * setUpperCaseFirst ( boolean ) and setLowerCaseFirst ( boolean ) for more details . * @ see # isLowerCaseFirst * @ see # isUpperCaseFirst * @ see # setLowerCaseFirst ( boolean ) * @ see # setUpperCaseFirst ( boolean ) */ public final void setCaseFirstDefault ( ) { } }
checkNotFrozen ( ) ; CollationSettings defaultSettings = getDefaultSettings ( ) ; if ( settings . readOnly ( ) == defaultSettings ) { return ; } CollationSettings ownedSettings = getOwnedSettings ( ) ; ownedSettings . setCaseFirstDefault ( defaultSettings . options ) ; setFastLatinOptions ( ownedSettings ) ;
public class AggregationState { /** * visibleForTest */ SortedMap < PrimaryKey , RangeTree < PrimaryKey , AggregationChunk > > groupByPartition ( int partitioningKeyLength ) { } }
SortedMap < PrimaryKey , RangeTree < PrimaryKey , AggregationChunk > > partitioningKeyToTree = new TreeMap < > ( ) ; Set < AggregationChunk > allChunks = prefixRanges [ 0 ] . getAll ( ) ; for ( AggregationChunk chunk : allChunks ) { PrimaryKey minKeyPrefix = chunk . getMinPrimaryKey ( ) . prefix ( partitioningKeyLength ) ; PrimaryKey maxKeyPrefix = chunk . getMaxPrimaryKey ( ) . prefix ( partitioningKeyLength ) ; if ( ! minKeyPrefix . equals ( maxKeyPrefix ) ) return null ; // not partitioned RangeTree < PrimaryKey , AggregationChunk > tree = partitioningKeyToTree . get ( minKeyPrefix ) ; if ( tree == null ) { tree = RangeTree . create ( ) ; partitioningKeyToTree . put ( minKeyPrefix , tree ) ; } tree . put ( chunk . getMinPrimaryKey ( ) , chunk . getMaxPrimaryKey ( ) , chunk ) ; } return partitioningKeyToTree ;
public class TransactionService { /** * This function returns a { @ link List } of PAYMILL { @ link Transaction } objects . In which order this list is returned depends on * the optional parameters . If < code > null < / code > is given , no filter or order will be applied , overriding the default count and * offset . * @ param filter * { @ link com . paymill . models . Transaction . Filter } or < code > null < / code > * @ param order * { @ link com . paymill . models . Transaction . Order } or < code > null < / code > * @ param count * Max { @ link Integer } of returned objects in the { @ link PaymillList } * @ param offset * { @ link Integer } to start from . * @ return { @ link PaymillList } which contains a { @ link List } of PAYMILL { @ link Transaction } s and their total count . */ public PaymillList < Transaction > list ( Transaction . Filter filter , Transaction . Order order , Integer count , Integer offset ) { } }
return RestfulUtils . list ( TransactionService . PATH , filter , order , count , offset , Transaction . class , super . httpClient ) ;
public class OrtcMessage { /** * CAUSE : Prefer throwing / catching meaningful exceptions instead of Exception */ public static OrtcMessage parseMessage ( String message ) throws IOException { } }
OrtcOperation operation = null ; String JSONMessage = null ; String parsedMessage = null ; String filteredByServer = null ; String seqId = null ; String messageChannel = null ; String messageId = null ; int messagePart = - 1 ; int messageTotalParts = - 1 ; Matcher matcher = operationPattern . matcher ( message ) ; if ( matcher != null && ! matcher . matches ( ) ) { // matcher = receivedPattern . matcher ( message . replace ( " \ \ \ " " , " \ " " ) ) ; matcher = JSONPattern . matcher ( message ) ; if ( ( matcher != null && matcher . matches ( ) ) ) { try { operation = OrtcOperation . Received ; JSONMessage = matcher . group ( 1 ) . replace ( "\\\\" , "\\" ) . replace ( "\\\"" , "\"" ) ; org . json . JSONObject json = new org . json . JSONObject ( JSONMessage ) ; parsedMessage = ( String ) json . get ( "m" ) ; messageChannel = ( String ) json . get ( "ch" ) ; if ( json . has ( "f" ) ) filteredByServer = ( String ) json . get ( "f" ) ; if ( json . has ( "s" ) ) seqId = ( String ) json . get ( "s" ) ; // parsedMessage = parsedMessage . replace ( " \ \ \ \ n " , " \ n " ) . replace ( " \ \ \ " " , " \ " " ) . replace ( " \ \ \ \ \ " , " \ \ " ) ; Matcher multiPartMatcher = parseMultiPartMessage ( parsedMessage ) ; if ( multiPartMatcher . matches ( ) ) { parsedMessage = multiPartMatcher . group ( 4 ) ; messageId = multiPartMatcher . group ( 1 ) ; messagePart = Strings . isNullOrEmpty ( multiPartMatcher . group ( 2 ) ) ? - 1 : Integer . parseInt ( multiPartMatcher . group ( 2 ) ) ; messageTotalParts = Strings . isNullOrEmpty ( multiPartMatcher . group ( 3 ) ) ? - 1 : Integer . parseInt ( multiPartMatcher . group ( 3 ) ) ; } } catch ( NumberFormatException parseException ) { // throw new NumberFormatException ( " Invalid message format : " + message + " - Error " + parseException . toString ( ) ) ; parsedMessage = matcher . group ( 1 ) ; messageId = null ; messagePart = - 1 ; messageTotalParts = - 1 ; } catch ( JSONException e ) { parsedMessage = matcher . group ( 1 ) ; messageId = null ; messagePart = - 1 ; messageTotalParts = - 1 ; } } else { matcher = closePattern . matcher ( message ) ; if ( matcher != null && matcher . matches ( ) ) { operation = OrtcOperation . Close ; } else { throw new IOException ( String . format ( "Invalid message format: %s" , message ) ) ; } } // CAUSE : Possible null pointer dereference } else { operation = operationIndex . get ( matcher . group ( 1 ) ) ; parsedMessage = matcher . group ( 2 ) ; } return new OrtcMessage ( operation , parsedMessage , messageChannel , messageId , messagePart , messageTotalParts , Boolean . valueOf ( filteredByServer ) , seqId ) ;
public class CmsImageScaler { /** * Initializes the crop area setting . < p > * Only if all 4 required parameters have been set , the crop area is set accordingly . * Moreover , it is not required to specify the target image width and height when using crop , * because these parameters can be calculated from the crop area . < p > * Scale type 6 and 7 are used for a ' crop around point ' operation , see { @ link # getType ( ) } for a description . < p > */ private void initCropArea ( ) { } }
if ( isCropping ( ) ) { // crop area is set up correctly // adjust target image height or width if required if ( m_width < 0 ) { m_width = m_cropWidth ; } if ( m_height < 0 ) { m_height = m_cropHeight ; } if ( ( getType ( ) != 6 ) && ( getType ( ) != 7 ) && ( getType ( ) != 8 ) ) { // cropping type can only be 6 or 7 ( point cropping ) // all other values with cropping coordinates are invalid setType ( 0 ) ; } }
public class UserAgentParser { /** * 解析引擎类型 * @ param userAgentString User - Agent字符串 * @ return 引擎类型 */ private static Engine parseEngine ( String userAgentString ) { } }
for ( Engine engine : Engine . engines ) { if ( engine . isMatch ( userAgentString ) ) { return engine ; } } return Engine . Unknown ;
public class OGNLShortcutExpression { /** * Translation from ' execInfo ' context variable ( $ { execInfo } ) to ' execInfo ' expression object ( $ { # execInfo } ) , needed * since 3.0.0. * Note this is expressed as a separate method in order to mark this as deprecated and make it easily locatable . * @ param propertyName the name of the property being accessed ( we are looking for ' execInfo ' ) . * @ param context the expression context , which should contain the expression objects . * @ deprecated created ( and deprecated ) in 3.0.0 in order to support automatic conversion of calls to the ' execInfo ' * context variable ( $ { execInfo } ) into the ' execInfo ' expression object ( $ { # execInfo } ) , which is its * new only valid form . This method , along with the infrastructure for execInfo conversion in * StandardExpressionUtils # mightNeedExpressionObjects ( . . . ) will be removed in 3.1. */ @ Deprecated private static Object checkExecInfo ( final String propertyName , final Map < String , Object > context ) { } }
if ( "execInfo" . equals ( propertyName ) ) { LOGGER . warn ( "[THYMELEAF][{}] Found Thymeleaf Standard Expression containing a call to the context variable " + "\"execInfo\" (e.g. \"${execInfo.templateName}\"), which has been deprecated. The " + "Execution Info should be now accessed as an expression object instead " + "(e.g. \"${#execInfo.templateName}\"). Deprecated use is still allowed, but will be removed " + "in future versions of Thymeleaf." , TemplateEngine . threadIndex ( ) ) ; return context . get ( "execInfo" ) ; } return null ;
public class AbstractRadial { /** * Returns the image with the given lcd color . * @ param BOUNDS * @ param LCD _ COLOR * @ param CUSTOM _ LCD _ BACKGROUND * @ param IMAGE * @ return buffered image containing the lcd with the selected lcd color */ protected BufferedImage createLcdImage ( final Rectangle2D BOUNDS , final LcdColor LCD_COLOR , final Paint CUSTOM_LCD_BACKGROUND , final BufferedImage IMAGE ) { } }
return LCD_FACTORY . create_LCD_Image ( BOUNDS , LCD_COLOR , CUSTOM_LCD_BACKGROUND , IMAGE ) ;
public class SasFileParser { /** * The function to read the pointer with the subheaderPointerIndex index from the list of { @ link SubheaderPointer } * located at the subheaderPointerOffset offset . * @ param subheaderPointerOffset the offset before the list of { @ link SubheaderPointer } . * @ param subheaderPointerIndex the index of the subheader pointer being read . * @ return the subheader pointer . * @ throws IOException if reading from the { @ link SasFileParser # sasFileStream } stream is impossible . */ private SubheaderPointer processSubheaderPointers ( long subheaderPointerOffset , int subheaderPointerIndex ) throws IOException { } }
int intOrLongLength = sasFileProperties . isU64 ( ) ? BYTES_IN_LONG : BYTES_IN_INT ; int subheaderPointerLength = sasFileProperties . isU64 ( ) ? SUBHEADER_POINTER_LENGTH_X64 : SUBHEADER_POINTER_LENGTH_X86 ; long totalOffset = subheaderPointerOffset + subheaderPointerLength * ( ( long ) subheaderPointerIndex ) ; Long [ ] offset = { totalOffset , totalOffset + intOrLongLength , totalOffset + 2L * intOrLongLength , totalOffset + 2L * intOrLongLength + 1 } ; Integer [ ] length = { intOrLongLength , intOrLongLength , 1 , 1 } ; List < byte [ ] > vars = getBytesFromFile ( offset , length ) ; long subheaderOffset = bytesToLong ( vars . get ( 0 ) ) ; long subheaderLength = bytesToLong ( vars . get ( 1 ) ) ; byte subheaderCompression = vars . get ( 2 ) [ 0 ] ; byte subheaderType = vars . get ( 3 ) [ 0 ] ; return new SubheaderPointer ( subheaderOffset , subheaderLength , subheaderCompression , subheaderType ) ;
public class SchemasInner { /** * Gets a list of integration account schemas . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; IntegrationAccountSchemaInner & gt ; object */ public Observable < Page < IntegrationAccountSchemaInner > > listByIntegrationAccountsNextAsync ( final String nextPageLink ) { } }
return listByIntegrationAccountsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < IntegrationAccountSchemaInner > > , Page < IntegrationAccountSchemaInner > > ( ) { @ Override public Page < IntegrationAccountSchemaInner > call ( ServiceResponse < Page < IntegrationAccountSchemaInner > > response ) { return response . body ( ) ; } } ) ;
public class AbstractItem { /** * If the receiver is currently ' in ' an { @ link ItemStream } then remove * it from the { @ link ItemStream } . The removal is performed under the * aegis of a transaction , and is subject to the item being removable . * An item is removable if either : * < ul > * < li > The item is unlocked , and not part of a transaction . < / li > * < li > The item is locked by the lock ID is * supplied as an argument to the remove . < / li > * < / ul > * If the item is not ' in ' an { @ link ItemStream } then no action is * taken . * < p > An Item is not removable if there are still { @ link ItemReference } s * to it . An exception will be thrown . * If the item is locked then the lockID must be provided in order to * unlock the item . * If the item is locked , and the lockID is provided , then the * item will be removed without becoming visible to any other getter . * @ param transaction under which the remove is to be performed . * @ param lockID lockID ( if any ) under which the item was locked . * @ throws MessageStoreException if the item could not be removed . For * example , if the item is part of another transaction . */ public final void remove ( final Transaction transaction , final long lockID ) throws MessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" ) ; Membership membership = _getMembership ( ) ; if ( null == membership ) { throw new NotInMessageStore ( ) ; } else { membership . cmdRemove ( lockID , transaction ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "remove" ) ;
public class ClassDocImpl { /** * Return true if this is a ordinary class , * not an enumeration , exception , an error , or an interface . */ @ Override public boolean isOrdinaryClass ( ) { } }
if ( isEnum ( ) || isInterface ( ) || isAnnotationType ( ) ) { return false ; } for ( Type t = type ; t . hasTag ( CLASS ) ; t = env . types . supertype ( t ) ) { if ( t . tsym == env . syms . errorType . tsym || t . tsym == env . syms . exceptionType . tsym ) { return false ; } } return true ;