signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JSONConverter { /** * serialize a Struct * @ param struct Struct to serialize * @ param sb * @ param serializeQueryByColumns * @ param addUDFs * @ param done * @ throws ConverterException */ public void _serializeStruct ( PageContext pc , Set test , Struct struct , StringBuilder sb , boolean serializeQueryByColumns , boolean addUDFs , Set < Object > done ) throws ConverterException { } }
ApplicationContextSupport acs = ( ApplicationContextSupport ) pc . getApplicationContext ( ) ; boolean preserveCase = acs . getSerializationSettings ( ) . getPreserveCaseForStructKey ( ) ; // preserve case by default for Struct // Component if ( struct instanceof Component ) { String res = castToJson ( pc , ( Component ) struct , NULL_STRING ) ; if ( res != NULL_STRING ) { sb . append ( res ) ; return ; } } sb . append ( goIn ( ) ) ; sb . append ( "{" ) ; Iterator < Entry < Key , Object > > it = struct . entryIterator ( ) ; Entry < Key , Object > e ; String k ; Object value ; boolean doIt = false ; while ( it . hasNext ( ) ) { e = it . next ( ) ; k = e . getKey ( ) . getString ( ) ; if ( ! preserveCase ) k = k . toUpperCase ( ) ; value = e . getValue ( ) ; if ( ! addUDFs && ( value instanceof UDF || value == null ) ) continue ; if ( doIt ) sb . append ( ',' ) ; doIt = true ; sb . append ( StringUtil . escapeJS ( k , '"' , charsetEncoder ) ) ; sb . append ( ':' ) ; _serialize ( pc , test , value , sb , serializeQueryByColumns , done ) ; } if ( struct instanceof Component ) { Boolean remotingFetch ; Component comp = ( Component ) struct ; boolean isPeristent = false ; isPeristent = comp . isPersistent ( ) ; Property [ ] props = comp . getProperties ( false , true , false , false ) ; ComponentScope scope = comp . getComponentScope ( ) ; for ( int i = 0 ; i < props . length ; i ++ ) { if ( ! ignoreRemotingFetch ) { remotingFetch = Caster . toBoolean ( props [ i ] . getDynamicAttributes ( ) . get ( REMOTING_FETCH , null ) , null ) ; if ( remotingFetch == null ) { if ( isPeristent && ORMUtil . isRelated ( props [ i ] ) ) continue ; } else if ( ! remotingFetch . booleanValue ( ) ) continue ; } Key key = KeyImpl . getInstance ( props [ i ] . getName ( ) ) ; value = scope . get ( key , null ) ; if ( ! addUDFs && ( value instanceof UDF || value == null ) ) continue ; if ( doIt ) sb . append ( ',' ) ; doIt = true ; sb . append ( StringUtil . escapeJS ( key . getString ( ) , '"' , charsetEncoder ) ) ; sb . append ( ':' ) ; _serialize ( pc , test , value , sb , serializeQueryByColumns , done ) ; } } sb . append ( '}' ) ;
public class MediaClient { /** * Creates a water mark and return water mark ID . * @ param bucket The bucket name of Bos object which you want to read . * @ param key The key name of Bos object which your want to read . * @ param horizontalOffsetInPixel The horizontal offset in pixels . * @ param verticalOffsetInPixel The vertical offset in pixels . * @ return watermarkId the unique ID of the new water mark . */ @ Deprecated public CreateWaterMarkResponse createWaterMark ( String bucket , String key , int horizontalOffsetInPixel , int verticalOffsetInPixel ) { } }
CreateWaterMarkRequest request = new CreateWaterMarkRequest ( ) . withBucket ( bucket ) . withKey ( key ) . withHorizontalOffsetInPixel ( horizontalOffsetInPixel ) . withVerticalOffsetInPixel ( verticalOffsetInPixel ) ; return createWaterMark ( request ) ;
public class Dashboard { /** * Returns dashboards ordered by owner and dashboard name . * @ param em The entity manager to use . Cannot be null . * @ param limit The maximum number of dashboards to retrieve . If null , all records will be returned , otherwise must be a positive non - zero number . * @ param version The version of the dashboard to retrieve . It is either null or not empty * @ return The list of dashboards . Will never be null but may be empty . */ public static List < Dashboard > findDashboards ( EntityManager em , Integer limit , String version ) { } }
requireArgument ( em != null , "Entity manager can not be null." ) ; TypedQuery < Dashboard > query ; if ( version == null ) { query = em . createNamedQuery ( "Dashboard.getDashboards" , Dashboard . class ) ; } else { query = em . createNamedQuery ( "Dashboard.getDashboardsByVersion" , Dashboard . class ) ; query . setParameter ( "version" , version ) ; } try { if ( limit != null ) { query . setMaxResults ( limit ) ; } return query . getResultList ( ) ; } catch ( NoResultException ex ) { return new ArrayList < > ( 0 ) ; }
public class ProfilePackageFrameWriter { /** * Add class listing for all the classes in this package . Divide class * listing as per the class kind and generate separate listing for * Classes , Interfaces , Exceptions and Errors . * @ param contentTree the content tree to which the listing will be added * @ param profileValue the value of the profile being documented */ protected void addClassListing ( Content contentTree , int profileValue ) { } }
if ( packageDoc . isIncluded ( ) ) { addClassKindListing ( packageDoc . interfaces ( ) , getResource ( "doclet.Interfaces" ) , contentTree , profileValue ) ; addClassKindListing ( packageDoc . ordinaryClasses ( ) , getResource ( "doclet.Classes" ) , contentTree , profileValue ) ; addClassKindListing ( packageDoc . enums ( ) , getResource ( "doclet.Enums" ) , contentTree , profileValue ) ; addClassKindListing ( packageDoc . exceptions ( ) , getResource ( "doclet.Exceptions" ) , contentTree , profileValue ) ; addClassKindListing ( packageDoc . errors ( ) , getResource ( "doclet.Errors" ) , contentTree , profileValue ) ; addClassKindListing ( packageDoc . annotationTypes ( ) , getResource ( "doclet.AnnotationTypes" ) , contentTree , profileValue ) ; }
public class ValidationPlanResult { /** * Counts validation messages by its severity and message key . * @ param messageKey a message key of the messages which should be counted * @ param severity a severity of the messages which should be counted * @ return a number of validation messages with provided severity and * message key */ public int count ( String messageKey , Severity severity ) { } }
int count = 0 ; if ( severity == null || messageKey == null ) { return count ; } for ( ValidationResult result : results ) { for ( ValidationMessage < Origin > message : result . getMessages ( ) ) { if ( messageKey . equals ( message . getMessageKey ( ) ) && severity . equals ( message . getSeverity ( ) ) ) { count ++ ; } } } return count ;
public class Math { /** * Returns the largest ( closest to positive infinity ) * { @ code int } value that is less than or equal to the algebraic quotient . * There is one special case , if the dividend is the * { @ linkplain Integer # MIN _ VALUE Integer . MIN _ VALUE } and the divisor is { @ code - 1 } , * then integer overflow occurs and * the result is equal to the { @ code Integer . MIN _ VALUE } . * Normal integer division operates under the round to zero rounding mode * ( truncation ) . This operation instead acts under the round toward * negative infinity ( floor ) rounding mode . * The floor rounding mode gives different results than truncation * when the exact result is negative . * < ul > * < li > If the signs of the arguments are the same , the results of * { @ code floorDiv } and the { @ code / } operator are the same . < br > * For example , { @ code floorDiv ( 4 , 3 ) = = 1 } and { @ code ( 4 / 3 ) = = 1 } . < / li > * < li > If the signs of the arguments are different , the quotient is negative and * { @ code floorDiv } returns the integer less than or equal to the quotient * and the { @ code / } operator returns the integer closest to zero . < br > * For example , { @ code floorDiv ( - 4 , 3 ) = = - 2 } , * whereas { @ code ( - 4 / 3 ) = = - 1 } . * < / li > * < / ul > * @ param x the dividend * @ param y the divisor * @ return the largest ( closest to positive infinity ) * { @ code int } value that is less than or equal to the algebraic quotient . * @ throws ArithmeticException if the divisor { @ code y } is zero * @ see # floorMod ( int , int ) * @ see # floor ( double ) * @ since 1.8 */ public static int floorDiv ( int x , int y ) { } }
int r = x / y ; // if the signs are different and modulo not zero , round down if ( ( x ^ y ) < 0 && ( r * y != x ) ) { r -- ; } return r ;
public class ReUtil { /** * 取得内容中匹配的所有结果 * @ param < T > 集合类型 * @ param regex 正则 * @ param content 被查找的内容 * @ param group 正则的分组 * @ param collection 返回的集合类型 * @ return 结果集 */ public static < T extends Collection < String > > T findAll ( String regex , CharSequence content , int group , T collection ) { } }
if ( null == regex ) { return collection ; } return findAll ( Pattern . compile ( regex , Pattern . DOTALL ) , content , group , collection ) ;
public class CSTNode { /** * Adds all children of the specified node to this one . Not all * nodes support this operation ! */ public void addChildrenOf ( CSTNode of ) { } }
for ( int i = 1 ; i < of . size ( ) ; i ++ ) { add ( of . get ( i ) ) ; }
public class HibernateQueryModelDAO { /** * TODO : Add projection , maxResults , firstResult support */ private Query createAccessControlledQuery ( QueryModel queryModel ) { } }
Criteria criteria = getCurrentSession ( ) . createCriteria ( persistentClass ) ; for ( String associationPath : queryModel . getAssociationConditions ( ) . keySet ( ) ) { criteria . createCriteria ( associationPath ) ; } CriteriaQueryTranslator criteriaQueryTranslator = new CriteriaQueryTranslator ( ( SessionFactoryImplementor ) sessionFactory , ( CriteriaImpl ) criteria , persistentClass . getName ( ) , CriteriaQueryTranslator . ROOT_SQL_ALIAS ) ; StringBuilder queryStringBuilder = new StringBuilder ( ) ; buildSelectClause ( queryStringBuilder , criteriaQueryTranslator , queryModel . getAssociationConditions ( ) . keySet ( ) ) ; List < TypedValue > parameters = buildWhereClause ( queryStringBuilder , queryModel , criteria , criteriaQueryTranslator ) ; if ( ( queryModel . getAssociationConditions ( ) == null || queryModel . getAssociationConditions ( ) . isEmpty ( ) ) && ( queryModel . getSorts ( ) == null || queryModel . getSorts ( ) . isEmpty ( ) ) ) { buildDefaultOrderClause ( queryStringBuilder ) ; } else { // can ' t use the default ordering by " ace . id " because of " select distinct . . . " syntax buildOrderClause ( queryStringBuilder , queryModel , criteria , criteriaQueryTranslator ) ; } Query query = getCurrentSession ( ) . createQuery ( queryStringBuilder . toString ( ) ) ; setParameters ( parameters , query , queryModel . getAccessControlContext ( ) ) ; return query ;
public class DescribeInstancePatchStatesForPatchGroupResult { /** * The high - level patch state for the requested instances . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInstancePatchStates ( java . util . Collection ) } or { @ link # withInstancePatchStates ( java . util . Collection ) } * if you want to override the existing values . * @ param instancePatchStates * The high - level patch state for the requested instances . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeInstancePatchStatesForPatchGroupResult withInstancePatchStates ( InstancePatchState ... instancePatchStates ) { } }
if ( this . instancePatchStates == null ) { setInstancePatchStates ( new com . amazonaws . internal . SdkInternalList < InstancePatchState > ( instancePatchStates . length ) ) ; } for ( InstancePatchState ele : instancePatchStates ) { this . instancePatchStates . add ( ele ) ; } return this ;
public class Searcher { /** * Removes a facet refinement for the next queries . * < b > This method resets the current page to 0 . < / b > * @ param attribute the attribute to refine on . * @ param value the facet ' s value to refine with . * @ return this { @ link Searcher } for chaining . */ @ NonNull @ SuppressWarnings ( { } }
"WeakerAccess" , "unused" } ) // For library users public Searcher removeFacetRefinement ( @ NonNull String attribute , @ NonNull String value ) { List < String > attributeRefinements = getOrCreateRefinements ( attribute ) ; attributeRefinements . remove ( value ) ; rebuildQueryFacetFilters ( ) ; EventBus . getDefault ( ) . post ( new FacetRefinementEvent ( this , REMOVE , attribute , value , disjunctiveFacets . contains ( attribute ) ) ) ; return this ;
public class RoadPath { /** * Replies the direction of this path * on the road segment at the given * index . * @ param index is the index of the road segment . * @ return the direction of the segment at the given index * for this path . * @ since 4.0 */ @ Pure public Direction1D getSegmentDirectionAt ( int index ) { } }
final RoadSegment sgmt = get ( index ) ; assert sgmt != null ; final RoadConnection conn = getStartingPointFor ( index ) ; assert conn != null ; if ( conn . equals ( sgmt . getBeginPoint ( ) ) ) { return Direction1D . SEGMENT_DIRECTION ; } assert conn . equals ( sgmt . getEndPoint ( ) ) ; return Direction1D . REVERTED_DIRECTION ;
public class OtpLocalNode { /** * Create an Erlang { @ link OtpErlangRef reference } . Erlang references are * based upon some node specific information ; this method creates a * reference using the information in this node . Each call to this method * produces a unique reference . * @ return an Erlang reference . */ public synchronized OtpErlangRef createRef ( ) { } }
final OtpErlangRef r = new OtpErlangRef ( node , refId , creation ) ; // increment ref ids ( 3 ints : 18 + 32 + 32 bits ) refId [ 0 ] ++ ; if ( refId [ 0 ] > 0x3ffff ) { refId [ 0 ] = 0 ; refId [ 1 ] ++ ; if ( refId [ 1 ] == 0 ) { refId [ 2 ] ++ ; } } return r ;
public class ServerLogReaderPreTransactional { /** * Tries to switch from the previous transaction file to the new one . * It ensures that no notifications are missed . If there is a possibility * that the current transaction log file has more notifications to be read , * then it will keep the current stream intact . * @ throws IOException if a fatal error occurred . */ private void trySwitchingEditLog ( ) throws IOException { } }
if ( shouldSwitchEditLog ( ) ) { curStreamFinished = true ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Should switch edit log. rollImageCount=" + rollImageCount + ". curStreamConsumed=" + curStreamConsumed ) ; } if ( curStreamConsumed ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Reloading edit log ..." ) ; } openEditLog ( ) ; rollImageCount . decrementAndGet ( ) ; } }
public class BaseHapiFhirResourceDao { /** * May be overridden by subclasses to validate resources prior to storage * @ param theResource The resource that is about to be stored */ protected void preProcessResourceForStorage ( T theResource ) { } }
String type = getContext ( ) . getResourceDefinition ( theResource ) . getName ( ) ; if ( ! getResourceName ( ) . equals ( type ) ) { throw new InvalidRequestException ( getContext ( ) . getLocalizer ( ) . getMessage ( BaseHapiFhirResourceDao . class , "incorrectResourceType" , type , getResourceName ( ) ) ) ; } if ( theResource . getIdElement ( ) . hasIdPart ( ) ) { if ( ! theResource . getIdElement ( ) . isIdPartValid ( ) ) { throw new InvalidRequestException ( getContext ( ) . getLocalizer ( ) . getMessage ( BaseHapiFhirResourceDao . class , "failedToCreateWithInvalidId" , theResource . getIdElement ( ) . getIdPart ( ) ) ) ; } } /* * Replace absolute references with relative ones if configured to do so */ if ( getConfig ( ) . getTreatBaseUrlsAsLocal ( ) . isEmpty ( ) == false ) { FhirTerser t = getContext ( ) . newTerser ( ) ; List < ResourceReferenceInfo > refs = t . getAllResourceReferences ( theResource ) ; for ( ResourceReferenceInfo nextRef : refs ) { IIdType refId = nextRef . getResourceReference ( ) . getReferenceElement ( ) ; if ( refId != null && refId . hasBaseUrl ( ) ) { if ( getConfig ( ) . getTreatBaseUrlsAsLocal ( ) . contains ( refId . getBaseUrl ( ) ) ) { IIdType newRefId = refId . toUnqualified ( ) ; nextRef . getResourceReference ( ) . setReference ( newRefId . getValue ( ) ) ; } } } }
public class DefaultDistributionSetTypeLayout { /** * Method that is called when combobox event is performed . */ private void selectDistributionSetValue ( ) { } }
selectedDefaultDisSetType = ( Long ) combobox . getValue ( ) ; if ( ! selectedDefaultDisSetType . equals ( currentDefaultDisSetType ) ) { changeIcon . setVisible ( true ) ; notifyConfigurationChanged ( ) ; } else { changeIcon . setVisible ( false ) ; }
public class ServiceCall { /** * Issues request to service which returns stream of service messages back . * @ param request request with given headers . * @ param responseType type of responses . * @ return flux publisher of service responses . */ public Flux < ServiceMessage > requestMany ( ServiceMessage request , Class < ? > responseType ) { } }
return Flux . defer ( ( ) -> { String qualifier = request . qualifier ( ) ; if ( methodRegistry . containsInvoker ( qualifier ) ) { // local service . return methodRegistry . getInvoker ( request . qualifier ( ) ) . invokeMany ( request , ServiceMessageCodec :: decodeData ) . map ( this :: throwIfError ) ; } else { return addressLookup ( request ) . flatMapMany ( address -> requestMany ( request , responseType , address ) ) ; // remote service } } ) ;
public class MemberMap { /** * Creates a new { @ code MemberMap } including given members . * @ param version version * @ param members members * @ return a new { @ code MemberMap } */ static MemberMap createNew ( int version , MemberImpl ... members ) { } }
Map < Address , MemberImpl > addressMap = createLinkedHashMap ( members . length ) ; Map < String , MemberImpl > uuidMap = createLinkedHashMap ( members . length ) ; for ( MemberImpl member : members ) { putMember ( addressMap , uuidMap , member ) ; } return new MemberMap ( version , addressMap , uuidMap ) ;
public class XCatchClauseImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case XbasePackage . XCATCH_CLAUSE__EXPRESSION : setExpression ( ( XExpression ) newValue ) ; return ; case XbasePackage . XCATCH_CLAUSE__DECLARED_PARAM : setDeclaredParam ( ( JvmFormalParameter ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc ) * @ see javax . servlet . http . HttpServletRequest # getPathTranslated ( ) */ @ Override public String getPathTranslated ( ) { } }
try { collaborator . preInvoke ( componentMetaData ) ; return request . getPathTranslated ( ) ; } finally { collaborator . postInvoke ( ) ; }
public class CanonicalIterator { /** * we have a segment , in NFD . Find all the strings that are canonically equivalent to it . */ private String [ ] getEquivalents ( String segment ) { } }
Set < String > result = new HashSet < String > ( ) ; Set < String > basic = getEquivalents2 ( segment ) ; Set < String > permutations = new HashSet < String > ( ) ; // now get all the permutations // add only the ones that are canonically equivalent // TODO : optimize by not permuting any class zero . Iterator < String > it = basic . iterator ( ) ; while ( it . hasNext ( ) ) { String item = it . next ( ) ; permutations . clear ( ) ; permute ( item , SKIP_ZEROS , permutations ) ; Iterator < String > it2 = permutations . iterator ( ) ; while ( it2 . hasNext ( ) ) { String possible = it2 . next ( ) ; /* String attempt = Normalizer . normalize ( possible , Normalizer . DECOMP , 0 ) ; if ( attempt . equals ( segment ) ) { */ if ( Normalizer . compare ( possible , segment , 0 ) == 0 ) { if ( PROGRESS ) System . out . println ( "Adding Permutation: " + Utility . hex ( possible ) ) ; result . add ( possible ) ; } else { if ( PROGRESS ) System . out . println ( "-Skipping Permutation: " + Utility . hex ( possible ) ) ; } } } // convert into a String [ ] to clean up storage String [ ] finalResult = new String [ result . size ( ) ] ; result . toArray ( finalResult ) ; return finalResult ;
public class CryptUtils { /** * 返回在文件中指定位置的对象 * @ param file * 指定的文件 * @ param i * 从1开始 * @ return */ public static Object getObjFromFile ( String file , int i ) { } }
ObjectInputStream ois = null ; Object obj = null ; try { FileInputStream fis = new FileInputStream ( file ) ; ois = new ObjectInputStream ( fis ) ; for ( int j = 0 ; j < i ; j ++ ) { obj = ois . readObject ( ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { try { ois . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return obj ;
public class DialogView { @ Override protected boolean verifyDrawable ( Drawable who ) { } }
if ( who == draweeHolder . getTopLevelDrawable ( ) ) { return true ; } return super . verifyDrawable ( who ) ;
public class ImageInfos { /** * Reads image info from a stream . * @ param in the input stream containing image data * @ return the image info object , with { @ link ImageInfo # check ( ) } * already invoked * @ throws IOException if { @ link ImageInfo # check ( ) } fails or any other * I / O exception is thrown */ public static ImageInfo read ( InputStream in ) throws IOException { } }
ImageInfo imageInfo = new ImageInfo ( ) ; imageInfo . setInput ( in ) ; if ( ! imageInfo . check ( ) ) { throw new IOException ( "ImageInfo.check() failed; data stream is " + "broken or does not contain data in a supported image format" ) ; } return imageInfo ;
public class MSTSplit { /** * Length of edge i . * @ param matrix Distance matrix * @ param edges Edge list * @ param i Edge number * @ return Edge length */ private static double edgelength ( double [ ] [ ] matrix , int [ ] edges , int i ) { } }
i <<= 1 ; return matrix [ edges [ i ] ] [ edges [ i + 1 ] ] ;
public class HandlerFactory { /** * get a filter replace and format String key press handler . * @ return FilterReplaceAndFormatKeyPressHandler & lt ; String & gt ; */ public static final KeyPressHandler getFilterReplAndFormatStrKeyPressHandler ( ) { } }
// NOPMD if ( HandlerFactory . filReplFormStrKeyPrH == null ) { synchronized ( DecimalKeyPressHandler . class ) { if ( HandlerFactory . filReplFormStrKeyPrH == null ) { HandlerFactory . filReplFormStrKeyPrH = new FilterReplaceAndFormatKeyPressHandler < > ( ) ; } } } return HandlerFactory . filReplFormStrKeyPrH ;
public class InternalContext { /** * Unmark loops , at the end of functions . * @ return the returned */ public Object resetReturnLoop ( ) { } }
Object result = this . loopType == LoopInfo . RETURN ? this . returned : VOID ; resetLoop ( ) ; return result ;
public class Streams { /** * Split at supplied location * < pre > * { @ code * ReactiveSeq . of ( 1,2,3 ) . splitAt ( 1) * / / Stream [ 1 ] , Stream [ 2,3] * < / pre > */ public final static < T > Tuple2 < Stream < T > , Stream < T > > splitAt ( final Stream < T > stream , final int where ) { } }
final Tuple2 < Stream < T > , Stream < T > > Tuple2 = duplicate ( stream ) ; return Tuple . tuple ( Tuple2 . _1 ( ) . limit ( where ) , Tuple2 . _2 ( ) . skip ( where ) ) ;
public class DatabaseAutomaticTuningsInner { /** * Gets a database ' s automatic tuning . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The name of the database . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the DatabaseAutomaticTuningInner object */ public Observable < DatabaseAutomaticTuningInner > getAsync ( String resourceGroupName , String serverName , String databaseName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < DatabaseAutomaticTuningInner > , DatabaseAutomaticTuningInner > ( ) { @ Override public DatabaseAutomaticTuningInner call ( ServiceResponse < DatabaseAutomaticTuningInner > response ) { return response . body ( ) ; } } ) ;
public class PrefixedChecksummedBytes { /** * Java serialization */ private void writeObject ( ObjectOutputStream out ) throws IOException { } }
out . defaultWriteObject ( ) ; out . writeUTF ( params . getId ( ) ) ;
public class FileServletWrapper { /** * PM92967 */ private boolean setResponseHeaders ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "setResponseHeaders" ) ; } // Add date header as per RFC 2616 sec 14.18 resp . setDateHeader ( "Date" , System . currentTimeMillis ( ) ) ; // begin pq65763 String matchString = req . getRequestURI ( ) ; // String type = // getServletContext ( ) . getMimeType ( file . getAbsolutePath ( ) ) ; String type = context . getMimeType ( matchString ) ; // end pq65763 EncodingUtils . setContentTypeByCustomProperty ( type , matchString , resp ) ; String esiControl = parentProcessor . getEsiControl ( ) ; // Add ESI control header , if // (1 ) ESI not disabled & // (2 ) capability header is in request & // (3 ) this is not a forward & // (4 ) control header wasn ' t already added ( by dynacache ) // (5 ) request is not authenticated if ( ( esiControl != null ) && ( req . getHeader ( "Surrogate-Capability" ) != null ) && ( req . getAttribute ( WebAppRequestDispatcher . DISPATCH_NESTED_ATTR ) == null ) && ( ! resp . containsHeader ( "Surrogate-Control" ) ) && ( req . getAuthType ( ) == null ) ) { resp . addHeader ( "Surrogate-Control" , esiControl ) ; } /* * A code change is being made for defect PQ42792 . A 304 Response is * being sent back whenever the " If - Modified - Since " header matches the * Last Modified Date of the file . Else the file is read and returned to * the browser . */ long ModifiedSince = - 1 ; try { ModifiedSince = req . getDateHeader ( "If-Modified-Since" ) ; } catch ( IllegalArgumentException iae ) { ModifiedSince = - 1 ; } long FileModified = getLastModified ( ) ; // PK65384 start if ( FileModified == 0 && ! isAvailable ( ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "setResponseHeaders" , "isAvailable false, setting 404 status" ) ; } resp . sendError ( HttpServletResponse . SC_NOT_FOUND , MessageFormat . format ( nls . getString ( "File.not.found" , "File not found: {0}" ) , new Object [ ] { servletAndFileName } ) ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setResponseHeaders" , "file not found" ) ; } return false ; } // PK65384 end // set the last modified date resp . setDateHeader ( "last-modified" , FileModified ) ; // PK65384 check to ensure ModifiedSince is not - 1 before comparing . long systemTime = System . currentTimeMillis ( ) ; if ( ModifiedSince != - 1 ) { if ( ModifiedSince / 1000 == FileModified / 1000 ) { resp . setStatus ( HttpServletResponse . SC_NOT_MODIFIED ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setResponseHeaders" , "file not modified" ) ; } return false ; } else if ( WCCustomProperties . IFMODIFIEDSINCE_NEWER_THAN_FILEMODIFIED_TIMESTAMP && ( systemTime >= ModifiedSince ) && ( ModifiedSince > FileModified ) ) { // RFC2616 : : The requested variant has not been modified // since the time specified in this field , an entity will not be // returned from the server ; instead , a 304 ( not modified ) response will // be returned without any message - body . resp . setStatus ( HttpServletResponse . SC_NOT_MODIFIED ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setResponseHeaders" , "The requested variant has not been modified. " ) ; } return false ; } else if ( systemTime < ModifiedSince ) { // RFC2616 : : A date which is later than the server ' s current time is invalid . // Ignore this conditional and send 200 in response if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setResponseHeaders" , "The IfModifiedSince date is later than the server's current time so it is invalid, ignore. " ) ; } } // PM36341 End else { ServletResponse wasres = ServletUtil . unwrapResponse ( resp ) ; // 709533 if ( ! ( wasres instanceof IExtendedResponse ) || ( ! ( ( IExtendedResponse ) wasres ) . isOutputWritten ( ) ) ) { // 709533 if ( this . getFileSize ( true ) <= Integer . MAX_VALUE ) { // PM92967 resp . setContentLength ( getContentLength ( ) ) ; } } } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "setResponseHeaders" ) ; } return true ;
public class Alias { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPAliasControllable # isProducerQOSOverrideEnabled ( ) */ public boolean isProducerQOSOverrideEnabled ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isProducerQOSOverrideEnabled" ) ; boolean allowed = aliasDest . isOverrideOfQOSByProducerAllowed ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isProducerQOSOverrideEnabled" , new Boolean ( allowed ) ) ; return allowed ;
public class ThreadUtil { /** * 获取当前线程的线程组 * @ return 线程组 * @ since 3.1.2 */ public static ThreadGroup currentThreadGroup ( ) { } }
final SecurityManager s = System . getSecurityManager ( ) ; return ( null != s ) ? s . getThreadGroup ( ) : Thread . currentThread ( ) . getThreadGroup ( ) ;
public class ExecutorInstrumentationBenchmark { /** * This benchmark attempts to measure the performance with manual context propagation . * @ param blackhole a { @ link Blackhole } object supplied by JMH */ @ Benchmark @ BenchmarkMode ( Mode . AverageTime ) @ OutputTimeUnit ( TimeUnit . NANOSECONDS ) @ Fork public void manual ( final Blackhole blackhole ) { } }
MoreExecutors . directExecutor ( ) . execute ( Context . current ( ) . wrap ( new MyRunnable ( blackhole ) ) ) ;
public class JQMListItem { /** * Remove the url from this list item changing the item into a read only * item . */ public JQMListItem removeHref ( ) { } }
if ( anchor == null ) return this ; if ( anchorPanel != null ) { List < Widget > lst = new ArrayList < Widget > ( ) ; for ( int i = anchorPanel . getWidgetCount ( ) - 1 ; i >= 0 ; i -- ) { Widget w = anchorPanel . getWidget ( i ) ; anchorPanel . remove ( i ) ; lst . add ( 0 , w ) ; } remove ( anchorPanel ) ; cleanUpLI ( ) ; for ( Widget w : lst ) this . add ( w ) ; } else { moveAnchorChildrenToThis ( ) ; getElement ( ) . removeChild ( anchor ) ; } anchor = null ; anchorPanel = null ; setSplitHref ( null ) ; return this ;
public class DebugDrawer { /** * close the drawer */ public void closeDrawer ( ) { } }
if ( drawerLayout != null ) { if ( drawerGravity != 0 ) { drawerLayout . closeDrawer ( drawerGravity ) ; } else { drawerLayout . closeDrawer ( sliderLayout ) ; } }
public class GraphicsWidget { /** * Is the size stable ( browser resize causes many resize events ) ? * @ return true if the size has been established ( 2 times same size in succession ) */ private boolean hasStableSize ( ) { } }
try { Integer . parseInt ( getWidthAsString ( ) ) ; int width = getWidth ( ) ; int height = getHeight ( ) ; // compare with previous size and return true if same if ( previousWidth != width || previousHeight != height ) { // force small size ( workaround for smartgwt problem where size can otherwise not shrink below the // previous size ) vectorContext . setSize ( EventWidget . INITIAL_SIZE , EventWidget . INITIAL_SIZE ) ; eventWidget . setInitialSize ( ) ; previousWidth = width ; previousHeight = height ; return false ; } else { return true ; } } catch ( NumberFormatException e ) { return false ; }
public class DataDecoder { /** * Decodes a Character object from exactly 1 or 3 bytes . If null is * returned , then 1 byte was read . * @ param src source of encoded bytes * @ param srcOffset offset into source array * @ return Character object or null */ public static Character decodeCharacterObj ( byte [ ] src , int srcOffset ) throws CorruptEncodingException { } }
try { int b = src [ srcOffset ] ; if ( b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW ) { return null ; } return decodeChar ( src , srcOffset + 1 ) ; } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; }
public class ReverseBinaryEncoder { /** * Grows the current buffer and returns the updated offset . * @ param offset the original offset * @ return the updated offset */ private int growBuffer ( int offset ) { } }
assert offset < 0 ; byte [ ] oldBuf = myBuffer ; int oldLen = oldBuf . length ; byte [ ] newBuf = new byte [ ( - offset + oldLen ) << 1 ] ; // Double the buffer int oldBegin = newBuf . length - oldLen ; System . arraycopy ( oldBuf , 0 , newBuf , oldBegin , oldLen ) ; myBuffer = newBuf ; myOffset += oldBegin ; return offset + oldBegin ;
public class IfcExtendedMaterialPropertiesImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcProperty > getExtendedProperties ( ) { } }
return ( EList < IfcProperty > ) eGet ( Ifc2x3tc1Package . Literals . IFC_EXTENDED_MATERIAL_PROPERTIES__EXTENDED_PROPERTIES , true ) ;
public class Annotate { /** * / * Process repeated annotations . This method returns the * synthesized container annotation or null IFF all repeating * annotation are invalid . This method reports errors / warnings . */ private < T extends Attribute . Compound > T processRepeatedAnnotations ( List < T > annotations , AnnotateRepeatedContext < T > ctx , Symbol on ) { } }
T firstOccurrence = annotations . head ; List < Attribute > repeated = List . nil ( ) ; Type origAnnoType = null ; Type arrayOfOrigAnnoType = null ; Type targetContainerType = null ; MethodSymbol containerValueSymbol = null ; Assert . check ( ! annotations . isEmpty ( ) && ! annotations . tail . isEmpty ( ) ) ; // i . e . size ( ) > 1 int count = 0 ; for ( List < T > al = annotations ; ! al . isEmpty ( ) ; al = al . tail ) { count ++ ; // There must be more than a single anno in the annotation list Assert . check ( count > 1 || ! al . tail . isEmpty ( ) ) ; T currentAnno = al . head ; origAnnoType = currentAnno . type ; if ( arrayOfOrigAnnoType == null ) { arrayOfOrigAnnoType = types . makeArrayType ( origAnnoType ) ; } // Only report errors if this isn ' t the first occurrence I . E . count > 1 boolean reportError = count > 1 ; Type currentContainerType = getContainingType ( currentAnno , ctx . pos . get ( currentAnno ) , reportError ) ; if ( currentContainerType == null ) { continue ; } // Assert that the target Container is = = for all repeated // annos of the same annotation type , the types should // come from the same Symbol , i . e . be ' = = ' Assert . check ( targetContainerType == null || currentContainerType == targetContainerType ) ; targetContainerType = currentContainerType ; containerValueSymbol = validateContainer ( targetContainerType , origAnnoType , ctx . pos . get ( currentAnno ) ) ; if ( containerValueSymbol == null ) { // Check of CA type failed // errors are already reported continue ; } repeated = repeated . prepend ( currentAnno ) ; } if ( ! repeated . isEmpty ( ) ) { repeated = repeated . reverse ( ) ; TreeMaker m = make . at ( ctx . pos . get ( firstOccurrence ) ) ; Pair < MethodSymbol , Attribute > p = new Pair < MethodSymbol , Attribute > ( containerValueSymbol , new Attribute . Array ( arrayOfOrigAnnoType , repeated ) ) ; if ( ctx . isTypeCompound ) { /* TODO : the following code would be cleaner : Attribute . TypeCompound at = new Attribute . TypeCompound ( targetContainerType , List . of ( p ) , ( ( Attribute . TypeCompound ) annotations . head ) . position ) ; JCTypeAnnotation annoTree = m . TypeAnnotation ( at ) ; at = enterTypeAnnotation ( annoTree , targetContainerType , ctx . env ) ; */ // However , we directly construct the TypeCompound to keep the // direct relation to the contained TypeCompounds . Attribute . TypeCompound at = new Attribute . TypeCompound ( targetContainerType , List . of ( p ) , ( ( Attribute . TypeCompound ) annotations . head ) . position ) ; // TODO : annotation applicability checks from below ? at . setSynthesized ( true ) ; @ SuppressWarnings ( "unchecked" ) T x = ( T ) at ; return x ; } else { Attribute . Compound c = new Attribute . Compound ( targetContainerType , List . of ( p ) ) ; JCAnnotation annoTree = m . Annotation ( c ) ; if ( ! chk . annotationApplicable ( annoTree , on ) ) log . error ( annoTree . pos ( ) , "invalid.repeatable.annotation.incompatible.target" , targetContainerType , origAnnoType ) ; if ( ! chk . validateAnnotationDeferErrors ( annoTree ) ) log . error ( annoTree . pos ( ) , "duplicate.annotation.invalid.repeated" , origAnnoType ) ; c = enterAnnotation ( annoTree , targetContainerType , ctx . env ) ; c . setSynthesized ( true ) ; @ SuppressWarnings ( "unchecked" ) T x = ( T ) c ; return x ; } } else { return null ; // errors should have been reported elsewhere }
public class HttpMessage { /** * Get a request attribute . * @ param name Attribute name * @ return Attribute value */ public Object getAttribute ( String name ) { } }
if ( _attributes == null ) return null ; return _attributes . get ( name ) ;
public class JaxbConvertToMessage { /** * Create the root element for this message . * You must override this . * @ return The root element . */ public Object unmarshalRootElement ( Reader inStream , BaseXmlTrxMessageIn soapTrxMessage ) throws Exception { } }
try { // create a JAXBContext capable of handling classes generated into // the primer . po package String strSOAPPackage = ( String ) ( ( TrxMessageHeader ) soapTrxMessage . getMessage ( ) . getMessageHeader ( ) ) . get ( SOAPMessageTransport . SOAP_PACKAGE ) ; if ( strSOAPPackage != null ) { Object obj = null ; Unmarshaller u = JaxbContexts . getJAXBContexts ( ) . getUnmarshaller ( strSOAPPackage ) ; if ( u == null ) return null ; synchronized ( u ) { // Since the marshaller is shared ( may want to tweek this for multi - cpu implementations ) obj = u . unmarshal ( inStream ) ; } return obj ; } // + } catch ( XMLStreamException ex ) { // + ex . printStackTrace ( ) ; } catch ( JAXBException ex ) { ex . printStackTrace ( ) ; } return null ;
public class AWSSimpleSystemsManagementClient { /** * Retrieves the Maintenance Windows in an AWS account . * @ param describeMaintenanceWindowsRequest * @ return Result of the DescribeMaintenanceWindows operation returned by the service . * @ throws InternalServerErrorException * An error occurred on the server side . * @ sample AWSSimpleSystemsManagement . DescribeMaintenanceWindows * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / DescribeMaintenanceWindows " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DescribeMaintenanceWindowsResult describeMaintenanceWindows ( DescribeMaintenanceWindowsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeMaintenanceWindows ( request ) ;
public class AbstractCassandraStorage { /** * get CFMetaData of a column family */ protected CFMetaData getCFMetaData ( String ks , String cf , Cassandra . Client client ) throws NotFoundException , InvalidRequestException , TException , org . apache . cassandra . exceptions . InvalidRequestException , ConfigurationException { } }
KsDef ksDef = client . describe_keyspace ( ks ) ; for ( CfDef cfDef : ksDef . cf_defs ) { if ( cfDef . name . equalsIgnoreCase ( cf ) ) return CFMetaData . fromThrift ( cfDef ) ; } return null ;
public class CreateInteractions { /** * Both categorical integers are combined into a long = ( int , int ) , and the unsortedMap keeps the occurrence count for each pair - wise interaction */ public String [ ] makeDomain ( Map < IcedLong , IcedLong > unsortedMap , String [ ] dA , String [ ] dB ) { } }
String [ ] _domain ; // Log . info ( " Collected hash table " ) ; // Log . info ( java . util . Arrays . deepToString ( unsortedMap . entrySet ( ) . toArray ( ) ) ) ; // Log . info ( " Interaction between " + dA . length + " and " + dB . length + " factor levels = > " + // ( ( long ) dA . length * dB . length ) + " possible factors . " ) ; _sortedMap = mySort ( unsortedMap ) ; // create domain of the most frequent unique factors long factorCount = 0 ; // Log . info ( " Found " + _ sortedMap . size ( ) + " unique interaction factors ( out of " + ( ( long ) dA . length * ( long ) dB . length ) + " ) . " ) ; _domain = new String [ _sortedMap . size ( ) ] ; // TODO : use ArrayList here , then convert to array Iterator it2 = _sortedMap . entrySet ( ) . iterator ( ) ; int d = 0 ; while ( it2 . hasNext ( ) ) { Map . Entry kv = ( Map . Entry ) it2 . next ( ) ; final long ab = ( Long ) kv . getKey ( ) ; final long count = ( Long ) kv . getValue ( ) ; if ( factorCount < _ci . _max_factors && count >= _ci . _min_occurrence ) { factorCount ++ ; // extract the two original factor categoricals String feature = "" ; if ( dA != dB ) { int a = ( int ) ( ab >> 32 ) ; final String fA = a != _missing ? dA [ a ] : "NA" ; feature = fA + "_" ; } int b = ( int ) ab ; String fB = b != _missing ? dB [ b ] : "NA" ; feature += fB ; // Log . info ( " Adding interaction feature " + feature + " , occurrence count : " + count ) ; // Log . info ( " Total number of interaction factors so far : " + factorCount ) ; _domain [ d ++ ] = feature ; } else break ; } if ( d < _sortedMap . size ( ) ) { // Log . info ( " Truncated map to " + _ sortedMap . size ( ) + " elements . " ) ; String [ ] copy = new String [ d + 1 ] ; System . arraycopy ( _domain , 0 , copy , 0 , d ) ; copy [ d ] = _other ; _domain = copy ; Map tm = new LinkedHashMap < > ( ) ; it2 = _sortedMap . entrySet ( ) . iterator ( ) ; while ( -- d >= 0 ) { Map . Entry kv = ( Map . Entry ) it2 . next ( ) ; tm . put ( kv . getKey ( ) , kv . getValue ( ) ) ; } _sortedMap = tm ; } // Log . info ( " Created domain : " + Arrays . deepToString ( _ domain ) ) ; return _domain ;
public class DataNode { /** * Recover a block * @ param keepLength if true , will only recover replicas that have the same length * as the block passed in . Otherwise , will calculate the minimum length of the * replicas and truncate the rest to that length . */ private LocatedBlock recoverBlock ( int namespaceId , Block block , boolean keepLength , DatanodeID [ ] datanodeids , boolean closeFile , long deadline ) throws IOException { } }
InjectionHandler . processEvent ( InjectionEvent . DATANODE_BEFORE_RECOVERBLOCK , this ) ; // If the block is already being recovered , then skip recovering it . // This can happen if the namenode and client start recovering the same // file at the same time . synchronized ( ongoingRecovery ) { Block tmp = new Block ( ) ; tmp . set ( block . getBlockId ( ) , block . getNumBytes ( ) , GenerationStamp . WILDCARD_STAMP ) ; if ( ongoingRecovery . get ( tmp ) != null ) { String msg = "Block " + block + " is already being recovered, " + " ignoring this request to recover it." ; LOG . info ( msg ) ; throw new IOException ( msg ) ; } ongoingRecovery . put ( block , block ) ; } try { BlockRecoveryCoordinator brc = new BlockRecoveryCoordinator ( LOG , getConf ( ) , socketTimeout , this , namespaceManager . get ( namespaceId ) , getDNRegistrationForNS ( namespaceId ) ) ; return brc . recoverBlock ( namespaceId , block , keepLength , datanodeids , closeFile , deadline ) ; } finally { synchronized ( ongoingRecovery ) { ongoingRecovery . remove ( block ) ; } }
public class Numbers { /** * Checks whether the < code > String < / code > contains only digit characters . * < code > Null < / code > and empty String will return < code > false < / code > . * @ param str the < code > String < / code > to check * @ return < code > true < / code > if str contains only Unicode numeric */ public static boolean isDigits ( String str ) { } }
if ( Strings . isEmpty ( str ) ) return false ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( ! Character . isDigit ( str . charAt ( i ) ) ) return false ; } return true ;
public class AWSDeviceFarmClient { /** * Deletes a device pool given the pool ARN . Does not allow deletion of curated pools owned by the system . * @ param deleteDevicePoolRequest * Represents a request to the delete device pool operation . * @ return Result of the DeleteDevicePool operation returned by the service . * @ throws ArgumentException * An invalid argument was specified . * @ throws NotFoundException * The specified entity was not found . * @ throws LimitExceededException * A limit was exceeded . * @ throws ServiceAccountException * There was a problem with the service account . * @ sample AWSDeviceFarm . DeleteDevicePool * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / devicefarm - 2015-06-23 / DeleteDevicePool " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DeleteDevicePoolResult deleteDevicePool ( DeleteDevicePoolRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteDevicePool ( request ) ;
public class EsMarshalling { /** * Unmarshals the given map source into a bean . * @ param source the source * @ return the role */ public static RoleBean unmarshallRole ( Map < String , Object > source ) { } }
if ( source == null ) { return null ; } RoleBean bean = new RoleBean ( ) ; bean . setId ( asString ( source . get ( "id" ) ) ) ; bean . setName ( asString ( source . get ( "name" ) ) ) ; bean . setDescription ( asString ( source . get ( "description" ) ) ) ; bean . setCreatedBy ( asString ( source . get ( "createdBy" ) ) ) ; bean . setCreatedOn ( asDate ( source . get ( "createdOn" ) ) ) ; bean . setAutoGrant ( asBoolean ( source . get ( "autoGrant" ) ) ) ; @ SuppressWarnings ( "unchecked" ) List < Object > permissions = ( List < Object > ) source . get ( "permissions" ) ; if ( permissions != null && ! permissions . isEmpty ( ) ) { bean . setPermissions ( new HashSet < > ( ) ) ; for ( Object permission : permissions ) { bean . getPermissions ( ) . add ( asEnum ( permission , PermissionType . class ) ) ; } } postMarshall ( bean ) ; return bean ;
public class JcNumber { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the remainder of dividing one number by another , return a < b > JcNumber < / b > < / i > < / div > * < br / > */ public JcNumber mod ( Number val ) { } }
JcNumber ret = new JcNumber ( val , this , OPERATOR . Number . MOD ) ; QueryRecorder . recordInvocationConditional ( this , "mod" , ret , QueryRecorder . literal ( val ) ) ; return ret ;
public class CRFClassifier { /** * Loads a CRF classifier from a filepath , and returns it . * @ param file * File to load classifier from * @ return The CRF classifier * @ throws IOException * If there are problems accessing the input stream * @ throws ClassCastException * If there are problems interpreting the serialized data * @ throws ClassNotFoundException * If there are problems interpreting the serialized data */ public static < IN extends CoreMap > CRFClassifier < IN > getClassifier ( File file ) throws IOException , ClassCastException , ClassNotFoundException { } }
CRFClassifier < IN > crf = new CRFClassifier < IN > ( ) ; crf . loadClassifier ( file ) ; return crf ;
public class WaveHandlerBase { /** * Perform the handle independently of thread used . * @ param wave the wave to manage * @ param method the handler method to call , could be null * @ throws WaveException if an error occurred while processing the wave */ private void performHandle ( final Wave wave , final Method method ) throws WaveException { } }
// Build parameter list of the searched method final List < Object > parameterValues = new ArrayList < > ( ) ; // Don ' t add WaveType parameters if we us the default processWave method if ( ! AbstractComponent . PROCESS_WAVE_METHOD_NAME . equals ( method . getName ( ) ) ) { for ( final WaveData < ? > wd : wave . waveDatas ( ) ) { // Add only wave items defined as parameter if ( wd . key ( ) . isParameter ( ) ) { parameterValues . add ( wd . value ( ) ) ; } } } // Add the current wave to process parameterValues . add ( wave ) ; try { ClassUtility . callMethod ( method , getWaveReady ( ) , parameterValues . toArray ( ) ) ; } catch ( final CoreException e ) { LOGGER . error ( WAVE_DISPATCH_ERROR , e ) ; // Propagate the wave exception throw new WaveException ( wave , e ) ; }
public class AsynchronousRequest { /** * For more info on continents API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / continents " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for custom interactions * @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) } * @ throws NullPointerException if given { @ link Callback } is empty * @ see Continent continents info */ public void getAllContinentID ( Callback < List < Integer > > callback ) throws NullPointerException { } }
gw2API . getAllContinentIDs ( ) . enqueue ( callback ) ;
public class RecurringPolicy { /** * Sets the { @ code interval } to pause for between attempts , exponentially backing of to the * { @ code maxInterval } multiplying successive intervals by the { @ code intervalMultiplier } . * @ throws NullPointerException if { @ code interval } or { @ code maxInterval } are null * @ throws IllegalArgumentException if { @ code interval } is < = 0 , { @ code interval } is > = * { @ code maxInterval } or the { @ code intervalMultiplier } is < = 1 */ @ SuppressWarnings ( "unchecked" ) public T withBackoff ( Duration interval , Duration maxInterval , int intervalMultiplier ) { } }
Assert . notNull ( interval , "interval" ) ; Assert . notNull ( maxInterval , "maxInterval" ) ; Assert . isTrue ( interval . length > 0 , "The interval must be greater than 0" ) ; Assert . isTrue ( interval . toNanoseconds ( ) < maxInterval . toNanoseconds ( ) , "The interval must be less than the maxInterval" ) ; Assert . isTrue ( intervalMultiplier > 1 , "The intervalMultiplier must be greater than 1" ) ; this . interval = interval ; this . maxInterval = maxInterval ; this . intervalMultiplier = intervalMultiplier ; return ( T ) this ;
public class CmsPreferences { /** * Sets the " copy folder default " setting . < p > * @ param value the " copy folder default " setting */ public void setParamTabDiCopyFolderMode ( String value ) { } }
try { m_userSettings . setDialogCopyFolderMode ( CmsResourceCopyMode . valueOf ( Integer . parseInt ( value ) ) ) ; } catch ( Throwable t ) { // should usually never happen }
public class UserInterfaceApi { /** * Set Autopilot Waypoint Set a solar system as autopilot waypoint - - - SSO * Scope : esi - ui . write _ waypoint . v1 * @ param addToBeginning * Whether this solar system should be added to the beginning of * all waypoints ( required ) * @ param clearOtherWaypoints * Whether clean other waypoints beforing adding this one * ( required ) * @ param destinationId * The destination to travel to , can be solar system , station or * structure & # 39 ; s id ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param token * Access token to use if unable to set a header ( optional ) * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public void postUiAutopilotWaypoint ( Boolean addToBeginning , Boolean clearOtherWaypoints , Long destinationId , String datasource , String token ) throws ApiException { } }
postUiAutopilotWaypointWithHttpInfo ( addToBeginning , clearOtherWaypoints , destinationId , datasource , token ) ;
public class URLClassPathRepository { /** * ( non - Javadoc ) * @ see * org . apache . bcel . util . Repository # storeClass ( org . apache . bcel . classfile . * JavaClass ) */ @ Override public void storeClass ( JavaClass javaClass ) { } }
if ( DEBUG ) { System . out . println ( "Storing class " + javaClass . getClassName ( ) + " in repository" ) ; } JavaClass previous = nameToClassMap . put ( javaClass . getClassName ( ) , javaClass ) ; if ( DEBUG && previous != null ) { System . out . println ( "\t==> A previous class was evicted!" ) ; dumpStack ( ) ; } Repository tmp = org . apache . bcel . Repository . getRepository ( ) ; if ( tmp != null && tmp != this ) { throw new IllegalStateException ( "Wrong/multiple BCEL repository" ) ; } if ( tmp == null ) { org . apache . bcel . Repository . setRepository ( this ) ; }
public class ExecutionGraph { /** * Checks whether the job represented by the execution graph has the status < code > SCHEDULED < / code > . * @ return < code > true < / code > if the job has the status < code > SCHEDULED < / code > , < code > false < / code > otherwise */ private boolean jobHasScheduledStatus ( ) { } }
final Iterator < ExecutionVertex > it = new ExecutionGraphIterator ( this , true ) ; while ( it . hasNext ( ) ) { final ExecutionState s = it . next ( ) . getExecutionState ( ) ; if ( s != ExecutionState . CREATED && s != ExecutionState . SCHEDULED && s != ExecutionState . READY ) { return false ; } } return true ;
public class MaxiCode { /** * Returns the primary message codewords for mode 2. * @ param postcode the postal code * @ param country the country code * @ param service the service code * @ return the primary message , as codewords */ private static int [ ] getMode2PrimaryCodewords ( String postcode , int country , int service ) { } }
for ( int i = 0 ; i < postcode . length ( ) ; i ++ ) { if ( postcode . charAt ( i ) < '0' || postcode . charAt ( i ) > '9' ) { postcode = postcode . substring ( 0 , i ) ; break ; } } int postcodeNum = Integer . parseInt ( postcode ) ; int [ ] primary = new int [ 10 ] ; primary [ 0 ] = ( ( postcodeNum & 0x03 ) << 4 ) | 2 ; primary [ 1 ] = ( ( postcodeNum & 0xfc ) >> 2 ) ; primary [ 2 ] = ( ( postcodeNum & 0x3f00 ) >> 8 ) ; primary [ 3 ] = ( ( postcodeNum & 0xfc000 ) >> 14 ) ; primary [ 4 ] = ( ( postcodeNum & 0x3f00000 ) >> 20 ) ; primary [ 5 ] = ( ( postcodeNum & 0x3c000000 ) >> 26 ) | ( ( postcode . length ( ) & 0x3 ) << 4 ) ; primary [ 6 ] = ( ( postcode . length ( ) & 0x3c ) >> 2 ) | ( ( country & 0x3 ) << 4 ) ; primary [ 7 ] = ( country & 0xfc ) >> 2 ; primary [ 8 ] = ( ( country & 0x300 ) >> 8 ) | ( ( service & 0xf ) << 2 ) ; primary [ 9 ] = ( ( service & 0x3f0 ) >> 4 ) ; return primary ;
public class GVRScriptBundle { /** * Loads a { @ link GVRScriptBundle } from a file . * @ param gvrContext * The GVRContext to use for loading . * @ param filePath * The file name of the script bundle in JSON format . * @ param volume * The { @ link GVRResourceVolume } from which to load script bundle . * @ return * The { @ link GVRScriptBundle } object with contents from the JSON file . * @ throws IOException if the bundle cannot be loaded . */ public static GVRScriptBundle loadFromFile ( GVRContext gvrContext , String filePath , GVRResourceVolume volume ) throws IOException { } }
GVRAndroidResource fileRes = volume . openResource ( filePath ) ; String fileText = TextFile . readTextFile ( fileRes . getStream ( ) ) ; fileRes . closeStream ( ) ; GVRScriptBundle bundle = new GVRScriptBundle ( ) ; Gson gson = new Gson ( ) ; try { bundle . gvrContext = gvrContext ; bundle . file = gson . fromJson ( fileText , GVRScriptBundleFile . class ) ; bundle . volume = volume ; return bundle ; } catch ( Exception e ) { throw new IOException ( "Cannot load the script bundle" , e ) ; }
public class CollationRootElements { /** * Returns the tertiary weight after [ p , s , t ] where index = findPrimary ( p ) * except use index = 0 for p = 0. * < p > Must return a weight for every root [ p , s , t ] as well as for every weight * returned by getTertiaryBefore ( ) . If s ! = 0 then t can be BEFORE _ WEIGHT16. * < p > Exception : [ 0 , 0 , 0 ] is handled by the CollationBuilder : * Both its lower and upper boundaries are special . */ int getTertiaryAfter ( int index , int s , int t ) { } }
long secTer ; int terLimit ; if ( index == 0 ) { // primary = 0 if ( s == 0 ) { assert ( t != 0 ) ; index = ( int ) elements [ IX_FIRST_TERTIARY_INDEX ] ; // Gap at the end of the tertiary CE range . terLimit = 0x4000 ; } else { index = ( int ) elements [ IX_FIRST_SECONDARY_INDEX ] ; // Gap for tertiaries of primary / secondary CEs . terLimit = getTertiaryBoundary ( ) ; } secTer = elements [ index ] & ~ SEC_TER_DELTA_FLAG ; } else { assert ( index >= ( int ) elements [ IX_FIRST_PRIMARY_INDEX ] ) ; secTer = getFirstSecTerForPrimary ( index + 1 ) ; // If this is an explicit sec / ter unit , then it will be read once more . terLimit = getTertiaryBoundary ( ) ; } long st = ( ( ( long ) s & 0xffffffffL ) << 16 ) | t ; for ( ; ; ) { if ( secTer > st ) { assert ( ( secTer >> 16 ) == s ) ; return ( int ) secTer & 0xffff ; } secTer = elements [ ++ index ] ; // No tertiary greater than t for this primary + secondary . if ( ( secTer & SEC_TER_DELTA_FLAG ) == 0 || ( secTer >> 16 ) > s ) { return terLimit ; } secTer &= ~ SEC_TER_DELTA_FLAG ; }
public class FormulaFactory { /** * Creates a new cardinality constraint . * @ param variables the variables of the constraint * @ param comparator the comparator of the constraint * @ param rhs the right - hand side of the constraint * @ return the cardinality constraint * @ throws IllegalArgumentException if there are negative variables */ public PBConstraint cc ( final CType comparator , final int rhs , final Collection < Variable > variables ) { } }
final int [ ] coefficients = new int [ variables . size ( ) ] ; Arrays . fill ( coefficients , 1 ) ; final Variable [ ] vars = new Variable [ variables . size ( ) ] ; int count = 0 ; for ( final Variable var : variables ) vars [ count ++ ] = var ; return this . constructPBC ( comparator , rhs , vars , coefficients ) ;
public class XAbstractWhileExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
switch ( featureID ) { case XbasePackage . XABSTRACT_WHILE_EXPRESSION__PREDICATE : return basicSetPredicate ( null , msgs ) ; case XbasePackage . XABSTRACT_WHILE_EXPRESSION__BODY : return basicSetBody ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
public class FilteredCursor { /** * Returns a Cursor that is filtered by the given filter expression and values . * @ param cursor cursor to wrap * @ param type type of storable * @ param filter filter to apply * @ param filterValues values for filter * @ return wrapped cursor which filters results * @ throws IllegalStateException if any values are not specified * @ throws IllegalArgumentException if any argument is null * @ since 1.2 */ public static < S extends Storable > Cursor < S > applyFilter ( Cursor < S > cursor , Class < S > type , String filter , Object ... filterValues ) { } }
Filter < S > f = Filter . filterFor ( type , filter ) . bind ( ) ; FilterValues < S > fv = f . initialFilterValues ( ) . withValues ( filterValues ) ; return applyFilter ( f , fv , cursor ) ;
public class RippleAccountService { /** * A wallet ' s currency will be prefixed with the issuing counterparty address for all currencies * other than XRP . */ @ Override public AccountInfo getAccountInfo ( ) throws IOException { } }
final RippleAccountBalances account = getRippleAccountBalances ( ) ; final String username = exchange . getExchangeSpecification ( ) . getApiKey ( ) ; return RippleAdapters . adaptAccountInfo ( account , username ) ;
public class FileUtil { /** * 将String写入文件 , 覆盖模式 * @ param content 写入的内容 * @ param file 文件 * @ param charset 字符集 * @ return 被写入的文件 * @ throws IORuntimeException IO异常 */ public static File writeString ( String content , File file , String charset ) throws IORuntimeException { } }
return FileWriter . create ( file , CharsetUtil . charset ( charset ) ) . write ( content ) ;
public class BTreeIndex { /** * Returns an { @ link AsyncIterator } that will iterate through all the keys within the specified bounds . All iterated keys will * be returned in lexicographic order ( smallest to largest ) . See { @ link ByteArrayComparator } for ordering details . * @ param firstKey A ByteArraySegment representing the lower bound of the iteration . * @ param firstKeyInclusive If true , firstKey will be included in the iteration ( if it exists in the index ) , otherwise * it will not . * @ param lastKey A ByteArraySegment representing the upper bound of the iteration . * @ param lastKeyInclusive If true , lastKey will be included in the iteration ( if it exists in the index ) , otherwise * it will not . * @ param fetchTimeout Timeout for each invocation of AsyncIterator . getNext ( ) . * @ return A new AsyncIterator instance . */ public AsyncIterator < List < PageEntry > > iterator ( @ NonNull ByteArraySegment firstKey , boolean firstKeyInclusive , @ NonNull ByteArraySegment lastKey , boolean lastKeyInclusive , Duration fetchTimeout ) { } }
ensureInitialized ( ) ; return new EntryIterator ( firstKey , firstKeyInclusive , lastKey , lastKeyInclusive , this :: locatePage , this . state . get ( ) . length , fetchTimeout ) ;
public class ClassificationService { /** * Attach the given link to the classification , while checking for duplicates . */ public ClassificationModel attachLink ( ClassificationModel classificationModel , LinkModel linkModel ) { } }
for ( LinkModel existing : classificationModel . getLinks ( ) ) { if ( StringUtils . equals ( existing . getLink ( ) , linkModel . getLink ( ) ) ) { return classificationModel ; } } classificationModel . addLink ( linkModel ) ; return classificationModel ;
public class SeSellerUserTomcatRepl { /** * Fill given field of given entity according value represented as * string . * @ param pAddParam additional params * @ param pEntity Entity . * @ param pFieldName Field Name * @ param pFieldStrValue Field value * @ throws Exception - an exception */ @ Override public final void fill ( final Map < String , Object > pAddParam , final Object pEntity , final String pFieldName , final String pFieldStrValue ) throws Exception { } }
if ( SeSeller . class != pEntity . getClass ( ) ) { throw new ExceptionWithCode ( ExceptionWithCode . CONFIGURATION_MISTAKE , "It's wrong service to fill that field: " + pEntity + "/" + pFieldName + "/" + pFieldStrValue ) ; } SeSeller seSeller = ( SeSeller ) pEntity ; if ( "NULL" . equals ( pFieldStrValue ) ) { seSeller . setUserAuth ( null ) ; return ; } try { UserTomcat ownedEntity = new UserTomcat ( ) ; ownedEntity . setItsUser ( pFieldStrValue ) ; seSeller . setUserAuth ( ownedEntity ) ; } catch ( Exception ex ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "Can not fill field: " + pEntity + "/" + pFieldName + "/" + pFieldStrValue + ", " + ex . getMessage ( ) , ex ) ; }
public class HBeanTable { /** * Delete a set of rows . * @ param rows to be deleted . */ public void delete ( Set < HBeanRow > rows ) { } }
final List < Row > delete = new ArrayList < > ( ) ; try { for ( HBeanRow row : rows ) { delete . add ( new Delete ( row . getRowKey ( ) ) ) ; } table . batch ( delete ) ; table . flushCommits ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class ModelsImpl { /** * Gets the utterances for the given model in the given app version . * @ param appId The application ID . * @ param versionId The version ID . * @ param modelId The ID ( GUID ) of the model . * @ param examplesMethodOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the List & lt ; LabelTextObject & gt ; object if successful . */ public List < LabelTextObject > examplesMethod ( UUID appId , String versionId , String modelId , ExamplesMethodOptionalParameter examplesMethodOptionalParameter ) { } }
return examplesMethodWithServiceResponseAsync ( appId , versionId , modelId , examplesMethodOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Executor { /** * Stops the current build . * @ since 1.489 */ @ RequirePOST public HttpResponse doStop ( ) { } }
lock . writeLock ( ) . lock ( ) ; // need write lock as interrupt will change the field try { if ( executable != null ) { getParentOf ( executable ) . getOwnerTask ( ) . checkAbortPermission ( ) ; interrupt ( ) ; } } finally { lock . writeLock ( ) . unlock ( ) ; } return HttpResponses . forwardToPreviousPage ( ) ;
public class EigenDecompositor { /** * Returns the result of Eigen ( EVD ) decomposition of given matrix * See < a href = " http : / / mathworld . wolfram . com / EigenDecomposition . html " > * http : / / mathworld . wolfram . com / EigenDecomposition . html < / a > for more * details . * @ return { V , D } */ @ Override public Matrix [ ] decompose ( ) { } }
if ( matrix . is ( Matrices . SYMMETRIC_MATRIX ) ) { return decomposeSymmetricMatrix ( matrix ) ; } else if ( matrix . rows ( ) == matrix . columns ( ) ) { return decomposeNonSymmetricMatrix ( matrix ) ; } else { throw new IllegalArgumentException ( "Can't decompose rectangle matrix" ) ; }
public class IssuesApi { /** * Get all issues the authenticated user has access to . * By default it returns only issues created by the current user . * < pre > < code > GitLab Endpoint : GET / issues < / code > < / pre > * @ param filter { @ link IssueFilter } a IssueFilter instance with the filter settings . * @ param itemsPerPage the number of Project instances that will be fetched per page . * @ return the list of issues in the specified range . * @ throws GitLabApiException if any exception occurs */ public Pager < Issue > getIssues ( IssueFilter filter , int itemsPerPage ) throws GitLabApiException { } }
GitLabApiForm formData = filter . getQueryParams ( ) ; return ( new Pager < Issue > ( this , Issue . class , itemsPerPage , formData . asMap ( ) , "issues" ) ) ;
public class PossiblyRedundantMethodCalls { /** * implements the visitor to create and clear the stack , method call maps , and * branch targets * @ param classContext the context object of the currently visited class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { stack = new OpcodeStack ( ) ; localMethodCalls = new HashMap < > ( ) ; fieldMethodCalls = new HashMap < > ( ) ; staticMethodCalls = new HashMap < > ( ) ; branchTargets = new BitSet ( ) ; super . visitClassContext ( classContext ) ; } finally { stack = null ; localMethodCalls = null ; fieldMethodCalls = null ; staticMethodCalls = null ; branchTargets = null ; }
public class MultiPartRequest { public String [ ] getFilenames ( String name ) { } }
List parts = ( List ) _partMap . getValues ( name ) ; if ( parts == null ) return null ; String [ ] filenames = new String [ parts . size ( ) ] ; for ( int i = 0 ; i < filenames . length ; i ++ ) { filenames [ i ] = ( ( Part ) parts . get ( i ) ) . _filename ; } return filenames ;
public class StringUtil { /** * Decode a 2 - digit hex byte from within a string . */ public static byte decodeHexByte ( CharSequence s , int pos ) { } }
int hi = decodeHexNibble ( s . charAt ( pos ) ) ; int lo = decodeHexNibble ( s . charAt ( pos + 1 ) ) ; if ( hi == - 1 || lo == - 1 ) { throw new IllegalArgumentException ( String . format ( "invalid hex byte '%s' at index %d of '%s'" , s . subSequence ( pos , pos + 2 ) , pos , s ) ) ; } return ( byte ) ( ( hi << 4 ) + lo ) ;
public class WrappedJedisPubSub { /** * { @ inheritDoc } */ @ Override public void onMessage ( byte [ ] topic , byte [ ] message ) { } }
String strTopic = SafeEncoder . encode ( topic ) ; messageListener . onMessage ( strTopic , message ) ;
public class AntiAffinityService { /** * Update Anti - affinity policies * @ param policyRefs policy references * @ param modifyConfig update policy config * @ return OperationFuture wrapper for list of AntiAffinityPolicy */ public OperationFuture < List < AntiAffinityPolicy > > modify ( List < AntiAffinityPolicy > policyRefs , AntiAffinityPolicyConfig modifyConfig ) { } }
policyRefs . forEach ( ref -> modify ( ref , modifyConfig ) ) ; return new OperationFuture < > ( policyRefs , new NoWaitingJobFuture ( ) ) ;
public class ParamUtils { /** * Adds an array of parameters to the given < code > ParamsAttribute < / code > parent tag . * If value is null , no parameters are added . * If any element is null , the parameter is not added for the element . * @ param paramsAttribute the parent tag that will receive the parameters * @ param name the name of the parameter ( required ) */ public static void addArrayParams ( ParamsAttribute paramsAttribute , String name , Object values ) throws JspTagException { } }
NullArgumentException . checkNotNull ( name , "name" ) ; if ( values != null ) { int len = Array . getLength ( values ) ; for ( int c = 0 ; c < len ; c ++ ) { Object elem = Array . get ( values , c ) ; if ( elem != null ) { addParam ( paramsAttribute , name , Coercion . toString ( elem ) ) ; } } }
public class SrvAccSettings { /** * < p > Retrieve / get Accounting settings . < / p > * @ param pAddParam additional param * @ return Accounting settings * @ throws Exception - an exception */ @ Override public final synchronized AccSettings lazyGetAccSettings ( final Map < String , Object > pAddParam ) throws Exception { } }
if ( this . accSettings == null ) { retrieveAccSettings ( pAddParam ) ; } return this . accSettings ;
public class JFapInboundConnLink { /** * begin F196678.10 */ private int determineHeartbeatTimeout ( Map properties ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "determineHeartbeatTimeout" , properties ) ; // How often should we heartbeat ? int heartbeatTimeout = JFapChannelConstants . DEFAULT_HEARTBEAT_TIMEOUT ; try { // 669424 : using RuntimeInfo . getPropertyWithMsg as this would log a message // when the property is different to the default value passed . heartbeatTimeout = Integer . parseInt ( RuntimeInfo . getPropertyWithMsg ( JFapChannelConstants . RUNTIMEINFO_KEY_HEARTBEAT_TIMEOUT , "" + heartbeatTimeout ) ) ; } catch ( NumberFormatException nfe ) { // No FFDC code needed } if ( properties != null ) { String timeoutStr = ( String ) properties . get ( JFapChannelConstants . CHANNEL_CONFIG_HEARTBEAT_TIMEOUT_PROPERTY ) ; if ( timeoutStr != null ) { try { heartbeatTimeout = Integer . parseInt ( timeoutStr ) ; } catch ( NumberFormatException nfe ) { // No FFDC code needed } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "determineHeartbeatTimeout" , heartbeatTimeout ) ; return heartbeatTimeout ;
public class CUevent_flags { /** * Returns the String identifying the given CUevent _ flags * @ param n The CUevent _ flags * @ return The String identifying the given CUevent _ flags */ public static String stringFor ( int n ) { } }
if ( n == 0 ) { return "CU_EVENT_DEFAULT" ; } String result = "" ; if ( ( n & CU_EVENT_BLOCKING_SYNC ) != 0 ) result += "CU_EVENT_BLOCKING_SYNC " ; if ( ( n & CU_EVENT_DISABLE_TIMING ) != 0 ) result += "CU_EVENT_DISABLE_TIMING " ; if ( ( n & CU_EVENT_INTERPROCESS ) != 0 ) result += "CU_EVENT_INTERPROCESS " ; return result ;
public class CommerceNotificationQueueEntryUtil { /** * Returns the last commerce notification queue entry in the ordered set where sentDate & lt ; & # 63 ; . * @ param sentDate the sent date * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce notification queue entry , or < code > null < / code > if a matching commerce notification queue entry could not be found */ public static CommerceNotificationQueueEntry fetchByLtS_Last ( Date sentDate , OrderByComparator < CommerceNotificationQueueEntry > orderByComparator ) { } }
return getPersistence ( ) . fetchByLtS_Last ( sentDate , orderByComparator ) ;
public class PropertiesManager { /** * Returns the value of a property for a given name as a < code > short < / code > * @ param name the name of the requested property * @ return value the property ' s value as a < code > short < / code > * @ throws MissingPropertyException - if the property is not set * @ throws BadPropertyException - if the property cannot be parsed as a short or is not set . */ public static short getPropertyAsShort ( String name ) throws MissingPropertyException , BadPropertyException { } }
if ( PropertiesManager . props == null ) loadProps ( ) ; try { return Short . parseShort ( getProperty ( name ) ) ; } catch ( NumberFormatException nfe ) { throw new BadPropertyException ( name , getProperty ( name ) , "short" ) ; }
public class SMARTSAtom { /** * Access the atom invariants for this atom . If the invariants have not been * set an exception is thrown . * @ param atom the atom to obtain the invariants of * @ return the atom invariants for the atom * @ throws NullPointerException thrown if the invariants were not set */ final SMARTSAtomInvariants invariants ( final IAtom atom ) { } }
final SMARTSAtomInvariants inv = atom . getProperty ( SMARTSAtomInvariants . KEY ) ; if ( inv == null ) throw new NullPointerException ( "Missing SMARTSAtomInvariants - please compute these values before matching." ) ; return inv ;
public class MFSResource { /** * Create lemma span for search of multiwords in MFS dictionary . * @ param lemmas * the lemmas of the sentence * @ param from * the starting index * @ param to * the end index * @ return the string representing a perhaps multi word entry */ private String createSpan ( final List < String > lemmas , final int from , final int to ) { } }
String lemmaSpan = "" ; for ( int i = from ; i < to ; i ++ ) { lemmaSpan += lemmas . get ( i ) + "_" ; } lemmaSpan += lemmas . get ( to ) ; return lemmaSpan ;
public class IntegerArrayIterator { /** * Creates an iterator over all assignments to the final * { @ code dimensionSizes . length - keyPrefix . length } dimensions in * { @ code dimensionSizes } . * @ param dimensionSizes * @ param keyPrefix * @ return */ public static IntegerArrayIterator createFromKeyPrefix ( int [ ] dimensionSizes , int [ ] keyPrefix ) { } }
int [ ] sizesForIteration = new int [ dimensionSizes . length - keyPrefix . length ] ; for ( int i = keyPrefix . length ; i < dimensionSizes . length ; i ++ ) { sizesForIteration [ i - keyPrefix . length ] = dimensionSizes [ i ] ; } return new IntegerArrayIterator ( sizesForIteration , keyPrefix ) ;
public class XMLUnit { /** * Sets the XSLT version to set on stylesheets used internally . * < p > Defaults to " 1.0 " . < / p > * @ throws ConfigurationException if the argument cannot be parsed * as a positive number . */ public static void setXSLTVersion ( String s ) { } }
try { Number n = NumberFormat . getInstance ( Locale . US ) . parse ( s ) ; if ( n . doubleValue ( ) < 0 ) { throw new ConfigurationException ( s + " doesn't reperesent a" + " positive number." ) ; } } catch ( ParseException e ) { throw new ConfigurationException ( e ) ; } xsltVersion = s ;
public class CommerceOrderItemUtil { /** * Removes the commerce order item with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceOrderItemId the primary key of the commerce order item * @ return the commerce order item that was removed * @ throws NoSuchOrderItemException if a commerce order item with the primary key could not be found */ public static CommerceOrderItem remove ( long commerceOrderItemId ) throws com . liferay . commerce . exception . NoSuchOrderItemException { } }
return getPersistence ( ) . remove ( commerceOrderItemId ) ;
public class Section { /** * This method will write append an attribute value to a InternalStringBuilder . * The method assumes that the attr is not < code > null < / code > . If the * value is < code > null < / code > the attribute will not be appended to the * < code > InternalStringBuilder < / code > . */ private void renderAttribute ( InternalStringBuilder buf , String name , String value ) { } }
assert ( name != null ) ; if ( value == null ) return ; buf . append ( " " ) ; buf . append ( name ) ; buf . append ( "=\"" ) ; buf . append ( value ) ; buf . append ( "\"" ) ;
public class Expression { /** * Returns true if all referenced expressions are { @ linkplain # isCheap ( ) cheap } . */ public static boolean areAllCheap ( Iterable < ? extends Expression > args ) { } }
for ( Expression arg : args ) { if ( ! arg . isCheap ( ) ) { return false ; } } return true ;
public class POJOHelper { /** * Sets common structure to JSON objects * " Representation " : " string " , * " Description " : " For a leaf ( primitive , BigInteger / Decimal , Date , etc . ) " * @ param OrderedJSONObject objects to be added here * @ param representation Value of representation element * @ param description Value of description * @ return OrderedJSONObject */ private static OrderedJSONObject setCommonJSONElements ( OrderedJSONObject obj , Object representation , String description ) { } }
obj . put ( "Representation" , representation ) ; obj . put ( "Description" , description ) ; return obj ;
public class IVector { /** * Subtraction from two vectors */ public IVector sub ( IVector b ) { } }
IVector result = new IVector ( size ) ; sub ( b , result ) ; return result ;
public class JCGLTextureUpdates { /** * Create a new update that will replace the given { @ code area } of { @ code t } . * { @ code area } must be included within the area of { @ code t } . * @ param t The texture * @ param update _ area The area that will be updated * @ return A new update * @ throws RangeCheckException Iff { @ code area } is not included within { @ code */ public static JCGLTexture2DUpdateType newUpdateReplacingArea2D ( final JCGLTexture2DUsableType t , final AreaL update_area ) { } }
NullCheck . notNull ( t , "Texture" ) ; NullCheck . notNull ( update_area , "Area" ) ; final AreaL texture_area = AreaSizesL . area ( t . size ( ) ) ; if ( ! AreasL . contains ( texture_area , update_area ) ) { final StringBuilder sb = new StringBuilder ( 128 ) ; sb . append ( "Target area is not contained within the texture's area." ) ; sb . append ( System . lineSeparator ( ) ) ; sb . append ( " Texture area: " ) ; sb . append ( t . size ( ) ) ; sb . append ( System . lineSeparator ( ) ) ; sb . append ( " Target area: " ) ; sb . append ( update_area ) ; sb . append ( System . lineSeparator ( ) ) ; throw new RangeCheckException ( sb . toString ( ) ) ; } final long width = update_area . width ( ) ; final long height = update_area . height ( ) ; final int bpp = t . format ( ) . getBytesPerPixel ( ) ; final long size = width * height * ( long ) bpp ; final ByteBuffer data = ByteBuffer . allocateDirect ( Math . toIntExact ( size ) ) ; data . order ( ByteOrder . nativeOrder ( ) ) ; return new Update2D ( t , update_area , data ) ;
public class GotoOperation { /** * protected OperationLog opelog ; */ @ Override public OperationResult operate ( TestStep testStep ) { } }
String value = testStep . getValue ( ) ; LogRecord record = LogRecord . info ( log , testStep , "test.step.execute" , value ) ; TestScript testScript = current . getTestScript ( ) ; int nextIndex = testScript . getIndexByScriptNo ( value ) - 1 ; current . setCurrentIndex ( nextIndex ) ; return new OperationResult ( record ) ;
public class ConfigImpl { /** * / * ( non - Javadoc ) * @ see com . ibm . jaggr . core . config . IConfig # getProperty ( java . lang . String , java . lang . Class ) */ @ Override public Object getProperty ( String propname , Class < ? > hint ) { } }
final String sourceMethod = "getProperty" ; // $ NON - NLS - 1 $ boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( ConfigImpl . class . getName ( ) , sourceMethod , new Object [ ] { propname , hint } ) ; } Object result = rawConfig . get ( propname , rawConfig ) ; if ( result != null && result instanceof Scriptable && hint != null ) { Context . enter ( ) ; try { result = Context . jsToJava ( result , hint ) ; } catch ( EvaluatorException e ) { throw new IllegalArgumentException ( e ) ; } finally { Context . exit ( ) ; } } if ( result == org . mozilla . javascript . Scriptable . NOT_FOUND ) { result = com . ibm . jaggr . core . config . IConfig . NOT_FOUND ; } else if ( result == Undefined . instance ) { result = null ; } if ( isTraceLogging ) { log . exiting ( ConfigImpl . class . getName ( ) , sourceMethod , result ) ; } return result ;
public class SuggestedFixes { /** * Modifies { @ code fixBuilder } to either create a new { @ code @ SuppressWarnings } element on the * closest suppressible node , or add { @ code warningToSuppress } to that node if there ' s already a * { @ code SuppressWarnings } annotation there . * @ see # addSuppressWarnings ( VisitorState , String , String ) */ public static void addSuppressWarnings ( Builder fixBuilder , VisitorState state , String warningToSuppress ) { } }
addSuppressWarnings ( fixBuilder , state , warningToSuppress , null ) ;
public class OptionalKind { /** * Convert the HigherKindedType definition for a Optional into * @ param Optional Type Constructor to convert back into narrowed type * @ return Optional from Higher Kinded Type */ public static < T > Optional < T > narrowK ( final Higher < optional , T > Optional ) { } }
// has to be an OptionalKind as only OptionalKind can implement Higher < optional , T > return ( ( OptionalKind < T > ) Optional ) . boxed ;