signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ServerMappingController { /** * Updates the dest URL in the server redirects
* @ param model
* @ param id
* @ param destUrl
* @ return
* @ throws Exception */
@ RequestMapping ( value = "api/edit/server/{id}/dest" , method = RequestMethod . POST ) public @ ResponseBody ServerRedirect updateDestRedirectUrl ( Model model , @ PathVariable int id , String destUrl ) throws Exception { } }
|
ServerRedirectService . getInstance ( ) . setDestinationUrl ( destUrl , id ) ; return ServerRedirectService . getInstance ( ) . getRedirect ( id ) ;
|
public class PersistentTimerTaskHandler { /** * Internal convenience method for serializing the user info object to a byte array . */
private static byte [ ] serializeObject ( Object obj ) { } }
|
if ( obj == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { ObjectOutputStream out = new ObjectOutputStream ( baos ) ; out . writeObject ( obj ) ; out . flush ( ) ; } catch ( IOException ioex ) { throw new EJBException ( "Timer info object failed to serialize." , ioex ) ; } return baos . toByteArray ( ) ;
|
public class HDualReportScreen { /** * display this screen in html input format .
* returns true if default params were found for this form .
* @ param bAddDescColumn true if form , otherwise grid format
* @ exception DBException File exception . */
public int getPrintOptions ( ) throws DBException { } }
|
int iHtmlOptions = super . getPrintOptions ( ) ; String strForms = this . getProperty ( HtmlConstants . FORMS ) ; if ( ( strForms == null ) || ( strForms . length ( ) == 0 ) ) { if ( ( ( DualReportScreen ) this . getScreenField ( ) ) . isPrintReport ( ) ) iHtmlOptions = iHtmlOptions & ( ~ HtmlConstants . DONT_PRINT_SCREEN ) ; else iHtmlOptions = iHtmlOptions | HtmlConstants . DONT_PRINT_SCREEN ; } return iHtmlOptions ;
|
public class SynchronizedPDUSender { /** * ( non - Javadoc )
* @ see org . jsmpp . PDUSender # sendSubmitSmResp ( java . io . OutputStream , int ,
* java . lang . String ) */
public byte [ ] sendSubmitSmResp ( OutputStream os , int sequenceNumber , String messageId ) throws PDUStringException , IOException { } }
|
return pduSender . sendSubmitSmResp ( os , sequenceNumber , messageId ) ;
|
public class ObjectUtil { /** * 序列化后拷贝流的方式克隆 < br >
* 对象必须实现Serializable接口
* @ param < T > 对象类型
* @ param obj 被克隆对象
* @ return 克隆后的对象
* @ throws UtilException IO异常和ClassNotFoundException封装 */
@ SuppressWarnings ( "unchecked" ) public static < T > T cloneByStream ( T obj ) { } }
|
if ( null == obj || false == ( obj instanceof Serializable ) ) { return null ; } final FastByteArrayOutputStream byteOut = new FastByteArrayOutputStream ( ) ; ObjectOutputStream out = null ; try { out = new ObjectOutputStream ( byteOut ) ; out . writeObject ( obj ) ; out . flush ( ) ; final ObjectInputStream in = new ObjectInputStream ( new ByteArrayInputStream ( byteOut . toByteArray ( ) ) ) ; return ( T ) in . readObject ( ) ; } catch ( Exception e ) { throw new UtilException ( e ) ; } finally { IoUtil . close ( out ) ; }
|
public class Properties { /** * Gets the property ' s value from an object
* @ param object
* The object
* @ param name
* Property name
* @ return */
public static < T > T getValue ( Object object , String name ) { } }
|
return propertyValues . getValue ( object , name ) ;
|
public class AbstractMedia { /** * Compares this media to the specified media by render order . */
public int renderCompareTo ( AbstractMedia other ) { } }
|
int result = Ints . compare ( _renderOrder , other . _renderOrder ) ; return ( result != 0 ) ? result : naturalCompareTo ( other ) ;
|
public class Quaternionf { /** * Set this quaternion to be a copy of q .
* @ param q
* the { @ link Quaternionf } to copy
* @ return this */
public Quaternionf set ( Quaternionfc q ) { } }
|
if ( q instanceof Quaternionf ) MemUtil . INSTANCE . copy ( ( Quaternionf ) q , this ) ; else { this . x = q . x ( ) ; this . y = q . y ( ) ; this . z = q . z ( ) ; this . w = q . w ( ) ; } return this ;
|
public class AbstractSessionHandler { /** * Unbind value if value implements { @ link SessionBindingListener }
* ( calls { @ link SessionBindingListener # valueUnbound ( Session , String , Object ) } )
* @ param session the basic session
* @ param name the name with which the object is bound or unbound
* @ param value the bound value */
private void unbindValue ( Session session , String name , Object value ) { } }
|
if ( value instanceof SessionBindingListener ) { ( ( SessionBindingListener ) value ) . valueUnbound ( session , name , value ) ; }
|
public class HylaFaxClientSpi { /** * This function will resume an existing fax job .
* @ param faxJob
* The fax job object containing the needed information */
@ Override protected void resumeFaxJobImpl ( FaxJob faxJob ) { } }
|
// get fax job
HylaFaxJob hylaFaxJob = ( HylaFaxJob ) faxJob ; // get client
HylaFAXClient client = this . getHylaFAXClient ( ) ; try { this . resumeFaxJob ( hylaFaxJob , client ) ; } catch ( FaxException exception ) { throw exception ; } catch ( Exception exception ) { throw new FaxException ( "General error." , exception ) ; }
|
public class SimpleDocumentValidator { /** * Checks an XHTML document or other XML document . */
public void checkXmlFile ( File file ) throws IOException , SAXException { } }
|
validator . reset ( ) ; InputSource is = new InputSource ( new FileInputStream ( file ) ) ; is . setSystemId ( file . toURI ( ) . toURL ( ) . toString ( ) ) ; checkAsXML ( is ) ;
|
public class PrintStream { /** * Prints an Object and then terminate the line . This method calls
* at first String . valueOf ( x ) to get the printed object ' s string value ,
* then behaves as
* though it invokes < code > { @ link # print ( String ) } < / code > and then
* < code > { @ link # println ( ) } < / code > .
* @ param x The < code > Object < / code > to be printed . */
public void println ( Object x ) { } }
|
String s = String . valueOf ( x ) ; synchronized ( this ) { print ( s ) ; newLine ( ) ; }
|
public class KieContainerResourceFilter { /** * Creates representation of this filter which can be used as part of the URL ( e . g . the " ? " query part ) .
* @ return string representation that can be directly used in URL ( as query params ) , without the leading ' ? ' */
public String toURLQueryString ( ) { } }
|
StringJoiner joiner = new StringJoiner ( "&" ) ; if ( releaseIdFilter . getGroupId ( ) != null ) { joiner . add ( "groupId=" + releaseIdFilter . getGroupId ( ) ) ; } if ( releaseIdFilter . getArtifactId ( ) != null ) { joiner . add ( "artifactId=" + releaseIdFilter . getArtifactId ( ) ) ; } if ( releaseIdFilter . getVersion ( ) != null ) { joiner . add ( "version=" + releaseIdFilter . getVersion ( ) ) ; } // don ' t send over the default status filter ( e . g . one that accepts all the states ) as it is not needed , it is
// the default
if ( ! statusFilter . equals ( KieContainerStatusFilter . ACCEPT_ALL ) ) { String status = statusFilter . getAcceptedStatuses ( ) . stream ( ) . map ( s -> s . toString ( ) ) . collect ( Collectors . joining ( "," ) ) ; joiner . add ( "status=" + status ) ; } return joiner . toString ( ) ;
|
public class NodeUtil { /** * Returns true if the given node is either an LHS node in a destructuring pattern or if one of
* its descendants contains an LHS node in a destructuring pattern . For example , in { @ code var { a :
* b = 3 } } } , this returns true given the NAME b or the DEFAULT _ VALUE node containing b . */
private static boolean isLhsByDestructuringHelper ( Node n ) { } }
|
Node parent = n . getParent ( ) ; Node grandparent = n . getGrandparent ( ) ; switch ( parent . getToken ( ) ) { case ARRAY_PATTERN : // ` b ` in ` var [ b ] = . . . `
case REST : // ` b ` in ` var [ . . . b ] = . . . `
return true ; case COMPUTED_PROP : if ( n . isFirstChildOf ( parent ) ) { return false ; } // Fall through .
case STRING_KEY : return grandparent . isObjectPattern ( ) ; // the " b " in " var { a : b } = . . . "
case DEFAULT_VALUE : if ( n . isFirstChildOf ( parent ) ) { // The first child of a DEFAULT _ VALUE is a NAME node and a potential LHS .
// The second child is the value , so never a LHS node .
return isLhsByDestructuringHelper ( parent ) ; } return false ; default : return false ; }
|
public class FileLocker { /** * Attempts to grab the lock for the given file , returning a FileLock if
* the lock has been created ; otherwise it returns null */
public static FileLocker getLock ( File lockFile ) { } }
|
lockFile . getParentFile ( ) . mkdirs ( ) ; if ( ! lockFile . exists ( ) ) { try { IOHelper . write ( lockFile , "I have the lock!" ) ; lockFile . deleteOnExit ( ) ; return new FileLocker ( lockFile ) ; } catch ( IOException e ) { // Ignore
} } return null ;
|
public class Branch { /** * Append the deep link debug params to the original params
* @ param originalParams A { @ link JSONObject } original referrer parameters
* @ return A new { @ link JSONObject } with debug params appended . */
private JSONObject appendDebugParams ( JSONObject originalParams ) { } }
|
try { if ( originalParams != null && deeplinkDebugParams_ != null ) { if ( deeplinkDebugParams_ . length ( ) > 0 ) { PrefHelper . Debug ( "You're currently in deep link debug mode. Please comment out 'setDeepLinkDebugMode' to receive the deep link parameters from a real Branch link" ) ; } Iterator < String > keys = deeplinkDebugParams_ . keys ( ) ; while ( keys . hasNext ( ) ) { String key = keys . next ( ) ; originalParams . put ( key , deeplinkDebugParams_ . get ( key ) ) ; } } } catch ( Exception ignore ) { } return originalParams ;
|
public class InsightMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Insight insight , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( insight == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( insight . getInsightArn ( ) , INSIGHTARN_BINDING ) ; protocolMarshaller . marshall ( insight . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( insight . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( insight . getGroupByAttribute ( ) , GROUPBYATTRIBUTE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class PtoPMessageItemStream { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . LocalizationPoint # getAvailableMessageCount ( ) */
public long getAvailableMessageCount ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getAvailableMessageCount" ) ; long returnValue = - 1 ; try { returnValue = getStatistics ( ) . getAvailableItemCount ( ) ; } catch ( MessageStoreException e ) { // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream.getAvailableMessageCount" , "1:863:1.93.1.14" , this ) ; SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getAvailableMessageCount" , new Long ( returnValue ) ) ; return returnValue ;
|
public class ReportDefinition { /** * A list of strings that indicate additional content that Amazon Web Services includes in the report , such as
* individual resource IDs .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAdditionalSchemaElements ( java . util . Collection ) } or
* { @ link # withAdditionalSchemaElements ( java . util . Collection ) } if you want to override the existing values .
* @ param additionalSchemaElements
* A list of strings that indicate additional content that Amazon Web Services includes in the report , such
* as individual resource IDs .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see SchemaElement */
public ReportDefinition withAdditionalSchemaElements ( String ... additionalSchemaElements ) { } }
|
if ( this . additionalSchemaElements == null ) { setAdditionalSchemaElements ( new java . util . ArrayList < String > ( additionalSchemaElements . length ) ) ; } for ( String ele : additionalSchemaElements ) { this . additionalSchemaElements . add ( ele ) ; } return this ;
|
public class ClientConnectionTimings { /** * Returns { @ link ClientConnectionTimings } from the specified { @ link RequestContext } if exists .
* @ see # setTo ( RequestContext ) */
@ Nullable public static ClientConnectionTimings get ( RequestContext ctx ) { } }
|
requireNonNull ( ctx , "ctx" ) ; if ( ctx . hasAttr ( TIMINGS ) ) { return ctx . attr ( TIMINGS ) . get ( ) ; } return null ;
|
public class DefaultRegisteredServiceUserInterfaceInfo { /** * Gets logo height .
* @ return the logo url */
public long getLogoWidth ( ) { } }
|
try { val items = getLogoUrls ( ) ; if ( ! items . isEmpty ( ) ) { return items . iterator ( ) . next ( ) . getWidth ( ) ; } } catch ( final Exception e ) { LOGGER . debug ( e . getMessage ( ) , e ) ; } return DEFAULT_IMAGE_SIZE ;
|
public class AssertionMatcher { /** * A variant of assertArg ( Consumer ) for lambdas declaring checked exceptions . */
@ Incubating public static < T > T assertArgThrowing ( ThrowingConsumer < T > throwingConsumer ) { } }
|
argThat ( throwingConsumer . uncheck ( ) ) ; return handyReturnValues . returnForConsumerLambdaChecked ( throwingConsumer ) ;
|
public class Validate { /** * Checks that the specified String is not null or empty and represents a readable file , throws exception if it is empty or
* null and does not represent a path to a file .
* @ param path The path to check
* @ param message The exception message
* @ throws IllegalArgumentException Thrown if path is empty , null or invalid */
public static void isReadable ( final File file , String message ) throws IllegalArgumentException { } }
|
notNull ( file , message ) ; if ( ! file . exists ( ) || ! file . isFile ( ) || ! file . canRead ( ) ) { throw new IllegalArgumentException ( message ) ; }
|
public class Routable { /** * Map the route for HTTP GET requests
* @ param path the path
* @ param route The route
* @ param transformer the response transformer */
public void get ( String path , Route route , ResponseTransformer transformer ) { } }
|
addRoute ( HttpMethod . get , ResponseTransformerRouteImpl . create ( path , route , transformer ) ) ;
|
public class TextUICommandLine { /** * Common handling code for - chooseVisitors and - choosePlugins options .
* @ param argument
* the list of visitors or plugins to be chosen
* @ param desc
* String describing what is being chosen
* @ param chooser
* callback object to selectively choose list members */
private void choose ( String argument , String desc , Chooser chooser ) { } }
|
StringTokenizer tok = new StringTokenizer ( argument , "," ) ; while ( tok . hasMoreTokens ( ) ) { String what = tok . nextToken ( ) . trim ( ) ; if ( ! what . startsWith ( "+" ) && ! what . startsWith ( "-" ) ) { throw new IllegalArgumentException ( desc + " must start with " + "\"+\" or \"-\" (saw " + what + ")" ) ; } boolean enabled = what . startsWith ( "+" ) ; chooser . choose ( enabled , what . substring ( 1 ) ) ; }
|
public class PravegaAuthManager { /** * Loads the custom implementations of the AuthHandler interface dynamically . Registers the interceptors with grpc .
* Stores the implementation in a local map for routing the REST auth request .
* @ param builder The grpc service builder to register the interceptors . */
public void registerInterceptors ( ServerBuilder < ? > builder ) { } }
|
try { if ( serverConfig . isAuthorizationEnabled ( ) ) { ServiceLoader < AuthHandler > loader = ServiceLoader . load ( AuthHandler . class ) ; for ( AuthHandler handler : loader ) { try { handler . initialize ( serverConfig ) ; synchronized ( this ) { if ( handlerMap . putIfAbsent ( handler . getHandlerName ( ) , handler ) != null ) { log . warn ( "Handler with name {} already exists. Not replacing it with the latest handler" ) ; continue ; } } builder . intercept ( new PravegaInterceptor ( handler ) ) ; } catch ( Exception e ) { log . warn ( "Exception while initializing auth handler {}" , handler , e ) ; } } } } catch ( Throwable e ) { log . warn ( "Exception while loading the auth handlers" , e ) ; }
|
public class ByteArrayMethods { /** * Returns the next number greater or equal num that is power of 2. */
public static long nextPowerOf2 ( long num ) { } }
|
final long highBit = Long . highestOneBit ( num ) ; return ( highBit == num ) ? num : highBit << 1 ;
|
public class KickflipApiClient { /** * Create a new Kickflip User .
* The User created as a result of this request is cached and managed by this KickflipApiClient
* throughout the life of the host Android application installation .
* The other methods of this client will be performed on behalf of the user created by this request ,
* unless noted otherwise .
* @ param username The desired username for this Kickflip User . Will be altered if not unique for this Kickflip app .
* @ param password The password for this Kickflip user .
* @ param email The email address for this Kickflip user .
* @ param displayName The display name for this Kickflip user .
* @ param extraInfo Map data to be associated with this Kickflip User .
* @ param cb This callback will receive a User in { @ link io . kickflip . sdk . api . KickflipCallback # onSuccess ( io . kickflip . sdk . api . json . Response ) }
* or an Exception { @ link io . kickflip . sdk . api . KickflipCallback # onError ( io . kickflip . sdk . exception . KickflipException ) } . */
public void createNewUser ( String username , String password , String email , String displayName , Map extraInfo , final KickflipCallback cb ) { } }
|
GenericData data = new GenericData ( ) ; if ( username != null ) { data . put ( "username" , username ) ; } final String finalPassword ; if ( password != null ) { finalPassword = password ; } else { finalPassword = generateRandomPassword ( ) ; } data . put ( "password" , finalPassword ) ; if ( displayName != null ) { data . put ( "display_name" , displayName ) ; } if ( email != null ) { data . put ( "email" , email ) ; } if ( extraInfo != null ) { data . put ( "extra_info" , new Gson ( ) . toJson ( extraInfo ) ) ; } post ( NEW_USER , new UrlEncodedContent ( data ) , User . class , new KickflipCallback ( ) { @ Override public void onSuccess ( final Response response ) { if ( VERBOSE ) Log . i ( TAG , "createNewUser response: " + response ) ; storeNewUserResponse ( ( User ) response , finalPassword ) ; postResponseToCallback ( cb , response ) ; } @ Override public void onError ( final KickflipException error ) { Log . w ( TAG , "createNewUser Error: " + error ) ; postExceptionToCallback ( cb , error ) ; } } ) ;
|
public class DefaultEngine { /** * Tests whether the resource denoted by this abstract pathname exists .
* @ param name - template name
* @ param locale - resource locale
* @ return exists
* @ see # getEngine ( ) */
public boolean hasResource ( String name , Locale locale ) { } }
|
name = UrlUtils . cleanName ( name ) ; locale = cleanLocale ( locale ) ; return stringLoader . exists ( name , locale ) || loader . exists ( name , locale ) ;
|
public class NodeImpl { /** * For internal use . Doesn ' t check the InvalidItemStateException and may return unpooled
* VersionHistory object .
* @ param pool
* boolean , true if result should be pooled in Session
* @ return VersionHistoryImpl
* @ throws UnsupportedRepositoryOperationException
* if versions is nopt supported
* @ throws RepositoryException
* if error occurs */
public VersionHistoryImpl versionHistory ( boolean pool ) throws UnsupportedRepositoryOperationException , RepositoryException { } }
|
if ( ! this . isNodeType ( Constants . MIX_VERSIONABLE ) ) { throw new UnsupportedRepositoryOperationException ( "Node is not mix:versionable " + getPath ( ) ) ; } PropertyData vhProp = ( PropertyData ) dataManager . getItemData ( nodeData ( ) , new QPathEntry ( Constants . JCR_VERSIONHISTORY , 1 ) , ItemType . PROPERTY ) ; if ( vhProp == null ) { throw new UnsupportedRepositoryOperationException ( "Node does not have jcr:versionHistory " + getPath ( ) ) ; } return ( VersionHistoryImpl ) dataManager . getItemByIdentifier ( ValueDataUtil . getString ( vhProp . getValues ( ) . get ( 0 ) ) , pool , false ) ;
|
public class ByteCountingDataInput { /** * Please note that this isn ' t going to accurately count line separators , which are discarded by
* the underlying DataInput object
* This call is deprecated because you cannot accurately account for the CR / LF count
* @ return
* @ throws IOException */
@ Override @ Deprecated public String readLine ( ) throws IOException { } }
|
String value = dataInput . readLine ( ) ; if ( value != null ) { count += value . getBytes ( ) . length ; } return value ;
|
public class MahoutRecommenderRunner { /** * Runs the recommender using models from file .
* @ param opts see
* { @ link net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS }
* @ return see
* { @ link # runMahoutRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , org . apache . mahout . cf . taste . model . DataModel , org . apache . mahout . cf . taste . model . DataModel ) }
* @ throws RecommenderException when the recommender is instantiated
* incorrectly .
* @ throws IOException when paths in property object are incorrect . .
* @ throws TasteException when the recommender is instantiated incorrectly
* or breaks otherwise . */
@ Override public TemporalDataModelIF < Long , Long > run ( final RUN_OPTIONS opts ) throws RecommenderException , TasteException , IOException { } }
|
if ( isAlreadyRecommended ( ) ) { return null ; } DataModel trainingModel = new FileDataModel ( new File ( getProperties ( ) . getProperty ( RecommendationRunner . TRAINING_SET ) ) ) ; DataModel testModel = new FileDataModel ( new File ( getProperties ( ) . getProperty ( RecommendationRunner . TEST_SET ) ) ) ; return runMahoutRecommender ( opts , trainingModel , testModel ) ;
|
public class JMPath { /** * Gets sub file path list .
* @ param startDirectoryPath the start directory path
* @ param maxDepth the max depth
* @ return the sub file path list */
public static List < Path > getSubFilePathList ( Path startDirectoryPath , int maxDepth ) { } }
|
return getSubPathList ( startDirectoryPath , maxDepth , RegularFileFilter ) ;
|
public class XmlUtils { /** * 将传入xml文本转换成Java对象
* @ Title : toBean
* @ Description : TODO
* @ param xmlStr
* @ param cls xml对应的class类
* @ return T xml对应的class类的实例对象
* 调用的方法实例 : PersonBean person = XmlUtil . toBean ( xmlStr , PersonBean . class ) ; */
public static < T > T toBean ( String xmlStr , Class < T > cls ) { } }
|
// 注意 : 不是new Xstream ( ) ; 否则报错 : java . lang . NoClassDefFoundError : org / xmlpull / v1 / XmlPullParserFactory
XStream xstream = new XStream ( new DomDriver ( ) ) ; xstream . processAnnotations ( cls ) ; T obj = ( T ) xstream . fromXML ( xmlStr ) ; return obj ;
|
public class ConnectorServiceImpl { /** * Declarative Services method for unsetting the non - deferrable scheduled executor service reference .
* @ param ref reference to the service */
protected void unsetNonDeferrableScheduledExecutor ( ServiceReference < ScheduledExecutorService > ref ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetNonDeferrableScheduledExecutor" , ref ) ; nonDeferrableSchedXSvcRef . unsetReference ( ref ) ;
|
public class LogLog { /** * This method is used to output log4j internal warnings . There is
* no way to disable warning statements . Output goes to
* < code > System . err < / code > . */
public static void warn ( String msg , Throwable t ) { } }
|
if ( quietMode ) return ; System . err . println ( WARN_PREFIX + msg ) ; if ( t != null ) { t . printStackTrace ( ) ; }
|
public class JacksonSingleton { /** * Converts a JsonNode to its string representation .
* This implementation use a ` pretty printer ` .
* @ param json the json node
* @ return the String representation of the given Json Object
* @ throws java . lang . RuntimeException if the String form cannot be created */
public String stringify ( JsonNode json ) { } }
|
try { return mapper ( ) . writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( json ) ; } catch ( JsonProcessingException e ) { throw new RuntimeException ( "Cannot stringify the input json node" , e ) ; }
|
public class AccentResources { /** * Add a drawable resource to which to apply the " tint transformation " technique . */
public void addTintTransformationResourceId ( int resId ) { } }
|
if ( mCustomTransformationDrawableIds == null ) mCustomTransformationDrawableIds = new ArrayList < Integer > ( ) ; mCustomTransformationDrawableIds . add ( resId ) ;
|
public class LazyList { /** * Simple utility method to test if List has at least 1 entry .
* @ param list a LazyList , { @ link List } or { @ link Object }
* @ return true if not - null and is not empty */
public static boolean hasEntry ( Object list ) { } }
|
if ( list == null ) return false ; if ( list instanceof List ) return ! ( ( List < ? > ) list ) . isEmpty ( ) ; return true ;
|
public class TelemetryUtil { /** * Create a simple TelemetryData instance for Job metrics using given parameters
* @ param queryId the id of the query
* @ param field the field to log ( represents the " type " field in telemetry )
* @ param value the value to log for the field
* @ return TelemetryData instance constructed from parameters */
public static TelemetryData buildJobData ( String queryId , TelemetryField field , long value ) { } }
|
ObjectNode obj = mapper . createObjectNode ( ) ; obj . put ( TYPE , field . toString ( ) ) ; obj . put ( QUERY_ID , queryId ) ; obj . put ( VALUE , value ) ; return new TelemetryData ( obj , System . currentTimeMillis ( ) ) ;
|
public class PhaseOneImpl { /** * { @ inheritDoc } */
@ Override public Stage1Output stage1XBELValidation ( final File file ) { } }
|
Stage1Output output = new Stage1Output ( ) ; output . addValidationErrors ( validator . validateWithErrors ( file ) ) ; if ( output . hasValidationErrors ( ) ) { return output ; } Document d = null ; try { d = converter . toCommon ( file ) ; output . setDocument ( d ) ; } catch ( JAXBException e ) { final String name = file . toString ( ) ; final String msg = e . getMessage ( ) ; final Throwable cause = e ; output . setConversionError ( new ConversionError ( name , msg , cause ) ) ; return output ; } catch ( IOException e ) { final String name = file . toString ( ) ; final String msg = e . getMessage ( ) ; final Throwable cause = e ; output . setConversionError ( new ConversionError ( name , msg , cause ) ) ; return output ; } List < AnnotationDefinition > definitions = d . getDefinitions ( ) ; if ( definitions == null ) { return output ; } verifyAnnotations ( output , d , definitions ) ; return output ;
|
public class BucketManager { /** * It may happen that the manager is not full ( since n is not always a power of 2 ) . In this case we extract the coreset
* from the manager by computing a coreset of all nonempty buckets
* Case 1 : the last bucket is full
* = > n is a power of 2 and we return the contents of the last bucket
* Case2 : the last bucket is not full
* = > we compute a coreset of all nonempty buckets
* this operation should only be called after the streaming process is finished */
Point [ ] getCoresetFromManager ( int d ) { } }
|
Point [ ] coreset = new Point [ d ] ; int i = 0 ; // if ( this . buckets [ this . numberOfBuckets - 1 ] . cursize = = this . maxBucketsize ) {
// coreset = this . buckets [ this . numberOfBuckets - 1 ] . points ;
// } else {
// find the first nonempty bucket
for ( i = 0 ; i < this . numberOfBuckets ; i ++ ) { if ( this . buckets [ i ] . cursize != 0 ) { coreset = this . buckets [ i ] . points ; break ; } } // as long as there is a nonempty bucket compute a coreset
int j ; for ( j = i + 1 ; j < this . numberOfBuckets ; j ++ ) { if ( this . buckets [ j ] . cursize != 0 ) { // output the coreset into the spillover of bucket j
this . treeCoreset . unionTreeCoreset ( this . maxBucketsize , this . maxBucketsize , this . maxBucketsize , d , this . buckets [ j ] . points , coreset , this . buckets [ j ] . spillover , this . clustererRandom ) ; coreset = this . buckets [ j ] . spillover ; } } return coreset ;
|
public class JDBCCallableStatement { /** * # ifdef JAVA6 */
public synchronized void setAsciiStream ( String parameterName , java . io . InputStream x ) throws SQLException { } }
|
super . setAsciiStream ( findParameterIndex ( parameterName ) , x ) ;
|
public class ScopedServletUtils { /** * Find all scoped objects ( { @ link ScopedRequest } , { @ link ScopedResponse } )
* which have a certain scope - key , replaces this scope - key with the new one , and re - caches the objects
* the new scope - key .
* @ param oldScopeKey
* @ param newScopeKey
* @ param request the real ( outer ) request , where the scoped objects are cached . */
public static void renameScope ( Object oldScopeKey , Object newScopeKey , HttpServletRequest request ) { } }
|
assert ! ( request instanceof ScopedRequest ) ; String requestAttr = getScopedName ( OVERRIDE_REQUEST_ATTR , oldScopeKey ) ; String responseAttr = getScopedName ( OVERRIDE_RESPONSE_ATTR , oldScopeKey ) ; ScopedRequest scopedRequest = ( ScopedRequest ) request . getAttribute ( requestAttr ) ; ScopedResponse scopedResponse = ( ScopedResponse ) request . getAttribute ( responseAttr ) ; if ( scopedRequest != null ) { scopedRequest . renameScope ( newScopeKey ) ; request . removeAttribute ( requestAttr ) ; requestAttr = getScopedName ( OVERRIDE_REQUEST_ATTR , newScopeKey ) ; request . setAttribute ( requestAttr , scopedRequest ) ; } else { ScopedRequestImpl . renameSessionScope ( oldScopeKey , newScopeKey , request ) ; } if ( scopedResponse != null ) { request . removeAttribute ( responseAttr ) ; responseAttr = getScopedName ( OVERRIDE_RESPONSE_ATTR , newScopeKey ) ; request . setAttribute ( responseAttr , scopedResponse ) ; }
|
public class AbstractOpenTracingFilter { /** * Sets the error tags to use on the span .
* @ param span The span
* @ param error The error */
protected void setErrorTags ( Span span , Throwable error ) { } }
|
if ( error != null ) { String message = error . getMessage ( ) ; if ( message == null ) { message = error . getClass ( ) . getSimpleName ( ) ; } span . setTag ( TAG_ERROR , message ) ; }
|
public class Environment { /** * Enriches an environment with new / modified properties or views and returns the new instance . */
public static Environment enrich ( Environment env , Map < String , String > properties , Map < String , ViewEntry > views ) { } }
|
final Environment enrichedEnv = new Environment ( ) ; // merge tables
enrichedEnv . tables = new LinkedHashMap < > ( env . getTables ( ) ) ; enrichedEnv . tables . putAll ( views ) ; // merge functions
enrichedEnv . functions = new HashMap < > ( env . getFunctions ( ) ) ; // enrich execution properties
enrichedEnv . execution = ExecutionEntry . enrich ( env . execution , properties ) ; // enrich deployment properties
enrichedEnv . deployment = DeploymentEntry . enrich ( env . deployment , properties ) ; return enrichedEnv ;
|
public class DataSiftClient { /** * Retrieve the DPU usage of a historics job
* @ param historicsId id of the historics job to get the DPU usage of
* @ return future containing DPU response */
public FutureData < Dpu > dpu ( String historicsId ) { } }
|
final FutureData < Dpu > future = new FutureData < Dpu > ( ) ; URI uri = newParams ( ) . put ( "historics_id" , historicsId ) . forURL ( config . newAPIEndpointURI ( DPU ) ) ; Request request = config . http ( ) . GET ( uri , new PageReader ( newRequestCallback ( future , new Dpu ( ) , config ) ) ) ; performRequest ( future , request ) ; return future ;
|
public class LocalEventManager { /** * Registers with the EventManager to fire an event .
* Note : the same Event can be fired from multiple sources .
* Method is thread - safe .
* @ param identification the Identification of the the instance
* @ return an Optional , empty if already registered
* @ throws IllegalIDException not yet implemented */
@ SuppressWarnings ( { } }
|
"SynchronizationOnLocalVariableOrMethodParameter" } ) public Optional < EventCallable > registerCaller ( Identification identification ) throws IllegalIDException { if ( identification == null || callers . containsKey ( identification ) ) return Optional . empty ( ) ; EventCaller eventCaller = new EventCaller ( events ) ; callers . put ( identification , eventCaller ) ; return Optional . of ( eventCaller ) ;
|
public class BuilderImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . security . jwt . internal . Builder # fetch ( java . lang . String ) */
@ Override public Builder fetch ( String name ) throws InvalidClaimException { } }
|
if ( JwtUtils . isNullEmpty ( name ) ) { String err = Tr . formatMessage ( tc , "JWT_INVALID_CLAIM_ERR" , new Object [ ] { name } ) ; throw new InvalidClaimException ( err ) ; } String sub = claims . getSubject ( ) ; if ( JwtUtils . isNullEmpty ( sub ) ) { // TODO
// Tr . warning
// We can not really get to registry without valid user name
} else { Object obj = null ; try { obj = JwtUtils . fetch ( name , sub ) ; } catch ( Exception e ) { // TODO Auto - generated catch block
// Tr . warning
// e . printStackTrace ( ) ;
} if ( obj != null ) { claims . put ( name , obj ) ; } } return this ;
|
public class LengthRule { /** * ( non - Javadoc )
* @ see javax . validation . ConstraintValidator # initialize ( java . lang . annotation . Annotation ) */
@ Override public void initialize ( Length annotation ) { } }
|
// On initialise les parametres
min = annotation . min ( ) ; max = annotation . max ( ) ; acceptNullObject = annotation . acceptNullObject ( ) ; trimString = annotation . trimString ( ) ;
|
public class XmlSchemaParser { /** * Take an { @ link InputSource } and parse it generating map of template ID to Message objects , types , and schema .
* @ param is source from which schema is read . Ideally it will have the systemId property set to resolve
* relative references .
* @ param options to be applied during parsing .
* @ return { @ link MessageSchema } encoding for the schema .
* @ throws Exception on parsing error . */
public static MessageSchema parse ( final InputSource is , final ParserOptions options ) throws Exception { } }
|
final DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; if ( options . xIncludeAware ( ) ) { factory . setNamespaceAware ( true ) ; factory . setXIncludeAware ( true ) ; factory . setFeature ( "http://apache.org/xml/features/xinclude/fixup-base-uris" , false ) ; } final Document document = factory . newDocumentBuilder ( ) . parse ( is ) ; final XPath xPath = XPathFactory . newInstance ( ) . newXPath ( ) ; final ErrorHandler errorHandler = new ErrorHandler ( options ) ; document . setUserData ( ERROR_HANDLER_KEY , errorHandler , null ) ; final Map < String , Type > typeByNameMap = findTypes ( document , xPath ) ; errorHandler . checkIfShouldExit ( ) ; final Map < Long , Message > messageByIdMap = findMessages ( document , xPath , typeByNameMap ) ; errorHandler . checkIfShouldExit ( ) ; final Node schemaNode = ( Node ) xPath . compile ( MESSAGE_SCHEMA_XPATH_EXPR ) . evaluate ( document , XPathConstants . NODE ) ; final MessageSchema messageSchema = new MessageSchema ( schemaNode , typeByNameMap , messageByIdMap ) ; errorHandler . checkIfShouldExit ( ) ; return messageSchema ;
|
public class JavacConfig { /** * Returns the environment configuration . */
public static JavacConfig getLocalConfig ( ) { } }
|
JavacConfig config ; config = _localJavac . get ( ) ; if ( config != null ) return config ; else return new JavacConfig ( ) ;
|
public class Toposort { /** * Gets a topological sort for the graph , where the depth - first search is cutoff by an input set .
* @ param inputSet The input set which is excluded from the graph .
* @ param root The root of the graph .
* @ param deps Functional description of the graph ' s dependencies .
* @ param isFullCut Whether the input set is a full cut of the graph .
* @ return The topological sort . */
public static < T > List < T > toposort ( final Set < T > inputSet , T root , final Deps < T > deps , boolean isFullCut ) { } }
|
// Check that inputs set is a valid set of leaves for the given output module .
checkAreDescendentsOf ( inputSet , root , deps ) ; if ( isFullCut ) { checkIsFullCut ( inputSet , root , deps ) ; } Deps < T > cutoffDeps = getCutoffDeps ( inputSet , deps ) ; return Toposort . toposort ( root , cutoffDeps ) ;
|
public class AmazonSageMakerClient { /** * Gets a list of work teams that you have defined in a region . The list may be empty if no work team satisfies the
* filter specified in the < code > NameContains < / code > parameter .
* @ param listWorkteamsRequest
* @ return Result of the ListWorkteams operation returned by the service .
* @ sample AmazonSageMaker . ListWorkteams
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sagemaker - 2017-07-24 / ListWorkteams " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public ListWorkteamsResult listWorkteams ( ListWorkteamsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeListWorkteams ( request ) ;
|
public class FastaFormat { /** * method to convert the sequence of a PolymerNotation into the natural
* analogue sequence
* @ param polymer
* PolymerNotation
* @ return PolymerNotation with the natural analogue sequence
* @ throws AnalogSequenceException
* if the natural analog sequence can not be produced */
private static PolymerNotation convertPeptideIntoAnalogSequence ( PolymerNotation polymer ) throws AnalogSequenceException { } }
|
for ( int i = 0 ; i < polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) ; i ++ ) { /* Change current MonomerNotation */
polymer . getPolymerElements ( ) . getListOfElements ( ) . set ( i , generateMonomerNotationPeptide ( polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( i ) ) ) ; } return polymer ;
|
public class RedundentExprEliminator { /** * Get the previous sibling or parent of the given template , stopping at
* xsl : for - each , xsl : template , or xsl : stylesheet .
* @ param elem Should be non - null template element .
* @ return previous sibling or parent , or null if previous is xsl : for - each ,
* xsl : template , or xsl : stylesheet . */
protected ElemTemplateElement getPrevElementWithinContext ( ElemTemplateElement elem ) { } }
|
ElemTemplateElement prev = elem . getPreviousSiblingElem ( ) ; if ( null == prev ) prev = elem . getParentElem ( ) ; if ( null != prev ) { int type = prev . getXSLToken ( ) ; if ( ( Constants . ELEMNAME_FOREACH == type ) || ( Constants . ELEMNAME_TEMPLATE == type ) || ( Constants . ELEMNAME_STYLESHEET == type ) ) { prev = null ; } } return prev ;
|
public class EqualsBuilder { /** * < p > This method uses reflection to determine if the two < code > Object < / code > s
* are equal . < / p >
* < p > It uses < code > AccessibleObject . setAccessible < / code > to gain access to private
* fields . This means that it will throw a security exception if run under
* a security manager , if the permissions are not set up correctly . It is also
* not as efficient as testing explicitly . Non - primitive fields are compared using
* < code > equals ( ) < / code > . < / p >
* < p > If the testTransients parameter is set to < code > true < / code > , transient
* members will be tested , otherwise they are ignored , as they are likely
* derived fields , and not part of the value of the < code > Object < / code > . < / p >
* < p > Static fields will not be included . Superclass fields will be appended
* up to and including the specified superclass . A null superclass is treated
* as java . lang . Object . < / p >
* @ param lhs < code > this < / code > object
* @ param rhs the other object
* @ param testTransients whether to include transient fields
* @ param reflectUpToClass the superclass to reflect up to ( inclusive ) ,
* may be < code > null < / code >
* @ param excludeFields array of field names to exclude from testing
* @ return < code > true < / code > if the two Objects have tested equals .
* @ see EqualsExclude
* @ since 2.0 */
@ GwtIncompatible ( "incompatible method" ) public static boolean reflectionEquals ( final Object lhs , final Object rhs , final boolean testTransients , final Class < ? > reflectUpToClass , final String ... excludeFields ) { } }
|
return reflectionEquals ( lhs , rhs , testTransients , reflectUpToClass , false , excludeFields ) ;
|
public class RandomUtil { /** * Picks a random object from the supplied array of values . Even weight is given to all
* elements of the array .
* @ return a randomly selected item or null if the array is null or of length zero . */
public static < T > T pickRandom ( T [ ] values ) { } }
|
return ( values == null || values . length == 0 ) ? null : values [ getInt ( values . length ) ] ;
|
public class DojoHttpTransport { /** * Handles
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ FIRST _ LAYER _ MODULE }
* and
* { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ SUBSEQUENT _ LAYER _ MODULE }
* layer listener events .
* @ param request
* the http request object
* @ param info
* the { @ link com . ibm . jaggr . core . transport . IHttpTransport . ModuleInfo } object for the module
* @ return the layer contribution */
protected String beforeLayerModule ( HttpServletRequest request , ModuleInfo info ) { } }
|
String result ; String mid = info . getModuleId ( ) ; int idx = mid . indexOf ( "!" ) ; // $ NON - NLS - 1 $
if ( info . isScript ( ) ) { result = "\"" + ( idx == - 1 ? mid : mid . substring ( idx + 1 ) ) + "\":function(){" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} else { result = "\"url:" + ( idx == - 1 ? mid : mid . substring ( idx + 1 ) ) + "\":" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} return result ;
|
public class OperatorCentroid2DLocal { /** * c [ y ] = ( Sigma ( y [ i ] + y [ i + 1 ] ) * ( x [ i ] * y [ i + 1 ] - x [ i + 1 ] * y [ i ] ) , for i = 0 to N - 1 ) / ( 6 * signedArea ) */
private static Point2D getPolygonSansHolesCentroid ( Polygon polygon ) { } }
|
int pointCount = polygon . getPointCount ( ) ; double xSum = 0 ; double ySum = 0 ; double signedArea = 0 ; Point2D current = new Point2D ( ) ; Point2D next = new Point2D ( ) ; for ( int i = 0 ; i < pointCount ; i ++ ) { polygon . getXY ( i , current ) ; polygon . getXY ( ( i + 1 ) % pointCount , next ) ; double ladder = current . x * next . y - next . x * current . y ; xSum += ( current . x + next . x ) * ladder ; ySum += ( current . y + next . y ) * ladder ; signedArea += ladder / 2 ; } return new Point2D ( xSum / ( signedArea * 6 ) , ySum / ( signedArea * 6 ) ) ;
|
public class AssetCreativeTemplateVariable { /** * Sets the mimeTypes value for this AssetCreativeTemplateVariable .
* @ param mimeTypes * A set of supported mime types . This set can be empty or null
* if there ' s no
* constraint , meaning files of any mime types are
* allowed . */
public void setMimeTypes ( com . google . api . ads . admanager . axis . v201902 . AssetCreativeTemplateVariableMimeType [ ] mimeTypes ) { } }
|
this . mimeTypes = mimeTypes ;
|
public class CmsRoleManager { /** * Checks if the user of this OpenCms context is a member of the given role
* for the given resource . < p >
* The user must have the given role in at least one organizational unit to which this resource belongs . < p >
* @ param cms the opencms context
* @ param role the role to check
* @ param resourceName the name of the resource to check the role for
* @ throws CmsRoleViolationException if the user does not have the required role permissions
* @ throws CmsException if something goes wrong , while reading the resource */
public void checkRoleForResource ( CmsObject cms , CmsRole role , String resourceName ) throws CmsException , CmsRoleViolationException { } }
|
CmsResource resource = cms . readResource ( resourceName , CmsResourceFilter . ALL ) ; m_securityManager . checkRoleForResource ( cms . getRequestContext ( ) , role , resource ) ;
|
public class EvaluationTools { /** * Given a { @ link EvaluationCalibration } instance , export the charts to a stand - alone HTML file
* @ param ec EvaluationCalibration instance to export HTML charts for
* @ param file File to export to */
public static void exportevaluationCalibrationToHtmlFile ( EvaluationCalibration ec , File file ) throws IOException { } }
|
String asHtml = evaluationCalibrationToHtml ( ec ) ; FileUtils . writeStringToFile ( file , asHtml ) ;
|
public class ResultBuilder { /** * This is a shortcut method for ResultBuilder . successful ( ) . data ( data ) . build ( ) */
public static < T > Result < T > successful ( T data ) { } }
|
return Result . < T > builder ( ) . success ( true ) . data ( data ) . build ( ) ;
|
public class CodeGenerator { /** * Gets the first non - empty child of the given node . */
private static Node getFirstNonEmptyChild ( Node n ) { } }
|
for ( Node c = n . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { if ( c . isBlock ( ) ) { Node result = getFirstNonEmptyChild ( c ) ; if ( result != null ) { return result ; } } else if ( ! c . isEmpty ( ) ) { return c ; } } return null ;
|
public class ScalingInstruction { /** * The structure that defines new target tracking configurations ( up to 10 ) . Each of these structures includes a
* specific scaling metric and a target value for the metric , along with various parameters to use with dynamic
* scaling .
* With predictive scaling and dynamic scaling , the resource scales based on the target tracking configuration that
* provides the largest capacity for both scale in and scale out .
* Condition : The scaling metric must be unique across target tracking configurations .
* @ param targetTrackingConfigurations
* The structure that defines new target tracking configurations ( up to 10 ) . Each of these structures
* includes a specific scaling metric and a target value for the metric , along with various parameters to use
* with dynamic scaling . < / p >
* With predictive scaling and dynamic scaling , the resource scales based on the target tracking
* configuration that provides the largest capacity for both scale in and scale out .
* Condition : The scaling metric must be unique across target tracking configurations . */
public void setTargetTrackingConfigurations ( java . util . Collection < TargetTrackingConfiguration > targetTrackingConfigurations ) { } }
|
if ( targetTrackingConfigurations == null ) { this . targetTrackingConfigurations = null ; return ; } this . targetTrackingConfigurations = new java . util . ArrayList < TargetTrackingConfiguration > ( targetTrackingConfigurations ) ;
|
public class Assets { /** * Loads binary data asynchronously . The returned state instance provides a means to listen for
* the arrival of the data .
* @ param path the path to the binary asset . */
public RFuture < ByteBuffer > getBytes ( final String path ) { } }
|
final RPromise < ByteBuffer > result = exec . deferredPromise ( ) ; exec . invokeAsync ( new Runnable ( ) { public void run ( ) { try { result . succeed ( getBytesSync ( path ) ) ; } catch ( Throwable t ) { result . fail ( t ) ; } } } ) ; return result ;
|
public class JTreePanel { /** * User selected item . */
public NodeData mySingleClick ( int selRow , TreePath selPath ) { } }
|
Object [ ] x = selPath . getPath ( ) ; DynamicTreeNode nodeCurrent = ( DynamicTreeNode ) x [ x . length - 1 ] ; // Last one in list
NodeData data = ( NodeData ) nodeCurrent . getUserObject ( ) ; String strDescription = data . toString ( ) ; String strID = data . getID ( ) ; String strRecord = data . getRecordName ( ) ; this . firePropertyChange ( m_strLocationRecordParam , null , strRecord ) ; this . firePropertyChange ( m_strLocationIDParam , null , strID ) ; this . firePropertyChange ( m_strLocationParam , null , strDescription ) ; return data ;
|
public class JTSGeometryExpressions { /** * Create a new JTSGeometryExpression
* @ param expr Expression of type Geometry
* @ return new JTSGeometryExpression */
public static < T extends Geometry > JTSGeometryExpression < T > asJTSGeometry ( Expression < T > expr ) { } }
|
Expression < T > underlyingMixin = ExpressionUtils . extract ( expr ) ; return new JTSGeometryExpression < T > ( underlyingMixin ) { private static final long serialVersionUID = - 6714044005570420009L ; @ Override public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context ) ; } } ;
|
public class ASMClass { /** * Returns an array containing { @ code Method } objects reflecting all the public < em > member < / em >
* methods of the class or interface represented by this { @ code Class } object , including those
* declared by the class or interface and those inherited from superclasses and superinterfaces .
* Array classes return all the ( public ) member methods inherited from the { @ code Object } class . The
* elements in the array returned are not sorted and are not in any particular order . This method
* returns an array of length 0 if this { @ code Class } object represents a class or interface that
* has no public member methods , or if this { @ code Class } object represents a primitive type or
* void .
* The class initialization method { @ code < clinit > } is not included in the returned array . If the
* class declares multiple public member methods with the same parameter types , they are all
* included in the returned array .
* See < em > The Java Language Specification < / em > , sections 8.2 and 8.4.
* @ return the array of { @ code Method } objects representing the public methods of this class
* @ exception SecurityException If a security manager , < i > s < / i > , is present and any of the following
* conditions is met :
* < ul >
* < li > invocation of { @ link SecurityManager # checkMemberAccess
* s . checkMemberAccess ( this , Member . PUBLIC ) } denies access to the methods within this
* class
* < li > the caller ' s class loader is not the same as or an ancestor of the class
* loader for the current class and invocation of
* { @ link SecurityManager # checkPackageAccess s . checkPackageAccess ( ) } denies access to
* the package of this class
* < / ul >
* @ since JDK1.1 */
public ASMMethod [ ] getMethods ( ) throws SecurityException { } }
|
_throw ( ) ; return methods . entrySet ( ) . toArray ( new ASMMethod [ methods . size ( ) ] ) ;
|
public class TrustEverythingSSLTrustManager { /** * Configures a single HttpsURLConnection to trust all SSL certificates .
* @ param connection an HttpsURLConnection which will be configured to trust all certs */
public static void trustAllSSLCertificates ( HttpsURLConnection connection ) { } }
|
getTrustingSSLSocketFactory ( ) ; connection . setSSLSocketFactory ( socketFactory ) ; connection . setHostnameVerifier ( new HostnameVerifier ( ) { public boolean verify ( String s , SSLSession sslSession ) { return true ; } } ) ;
|
public class CommerceVirtualOrderItemLocalServiceUtil { /** * Returns a range of all the commerce virtual order items .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link com . liferay . commerce . product . type . virtual . order . model . impl . CommerceVirtualOrderItemModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param start the lower bound of the range of commerce virtual order items
* @ param end the upper bound of the range of commerce virtual order items ( not inclusive )
* @ return the range of commerce virtual order items */
public static java . util . List < com . liferay . commerce . product . type . virtual . order . model . CommerceVirtualOrderItem > getCommerceVirtualOrderItems ( int start , int end ) { } }
|
return getService ( ) . getCommerceVirtualOrderItems ( start , end ) ;
|
public class MyStringUtils { /** * Returns content for the given URL
* @ param stringUrl URL
* @ return Response content */
public static String getContent ( String stringUrl ) { } }
|
if ( stringUrl . equalsIgnoreCase ( "clipboard" ) ) { try { return getFromClipboard ( ) ; } catch ( Exception e ) { // it ' s ok .
} } return getContent ( stringUrl , null ) ;
|
public class JxrTask { /** * Optional . Set the file encoding of the generated files . Defaults to the system file encoding .
* @ param outputEncoding The encoding to set . */
public void setOutputEncoding ( String outputEncoding ) { } }
|
this . log ( "Setting output encoding to " + outputEncoding , LogLevel . DEBUG . getLevel ( ) ) ; this . outputEncoding = outputEncoding ;
|
public class AssociationDescriptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AssociationDescription associationDescription , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( associationDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( associationDescription . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getAssociationVersion ( ) , ASSOCIATIONVERSION_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getDate ( ) , DATE_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getLastUpdateAssociationDate ( ) , LASTUPDATEASSOCIATIONDATE_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getOverview ( ) , OVERVIEW_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getDocumentVersion ( ) , DOCUMENTVERSION_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getAutomationTargetParameterName ( ) , AUTOMATIONTARGETPARAMETERNAME_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getParameters ( ) , PARAMETERS_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getAssociationId ( ) , ASSOCIATIONID_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getTargets ( ) , TARGETS_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getScheduleExpression ( ) , SCHEDULEEXPRESSION_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getOutputLocation ( ) , OUTPUTLOCATION_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getLastExecutionDate ( ) , LASTEXECUTIONDATE_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getLastSuccessfulExecutionDate ( ) , LASTSUCCESSFULEXECUTIONDATE_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getAssociationName ( ) , ASSOCIATIONNAME_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getMaxErrors ( ) , MAXERRORS_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getMaxConcurrency ( ) , MAXCONCURRENCY_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getComplianceSeverity ( ) , COMPLIANCESEVERITY_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FunctionType { /** * Returns all interfaces implemented by a class or its superclass and any superclasses for any of
* those interfaces . If this is called before all types are resolved , it may return an incomplete
* set . */
public final Iterable < ObjectType > getAllImplementedInterfaces ( ) { } }
|
// Store them in a linked hash set , so that the compile job is
// deterministic .
Set < ObjectType > interfaces = new LinkedHashSet < > ( ) ; for ( ObjectType type : getImplementedInterfaces ( ) ) { addRelatedInterfaces ( type , interfaces ) ; } return interfaces ;
|
public class hanode_fis_binding { /** * Use this API to fetch hanode _ fis _ binding resources of given name . */
public static hanode_fis_binding [ ] get ( nitro_service service , Long id ) throws Exception { } }
|
hanode_fis_binding obj = new hanode_fis_binding ( ) ; obj . set_id ( id ) ; hanode_fis_binding response [ ] = ( hanode_fis_binding [ ] ) obj . get_resources ( service ) ; return response ;
|
public class NGram { /** * 提取ngram
* @ param tokens
* @ param gramSizes2
* @ return */
private ArrayList < String > ngram ( List tokens , int [ ] gramSizes2 ) { } }
|
ArrayList < String > list = new ArrayList < String > ( ) ; StringBuffer buf = new StringBuffer ( ) ; for ( int j = 0 ; j < gramSizes . length ; j ++ ) { int len = gramSizes [ j ] ; if ( len <= 0 || len > tokens . size ( ) ) continue ; for ( int i = 0 ; i < tokens . size ( ) - len + 1 ; i ++ ) { buf . delete ( 0 , buf . length ( ) ) ; int k = 0 ; for ( ; k < len - 1 ; ++ k ) { buf . append ( tokens . get ( i + k ) ) ; buf . append ( ' ' ) ; } buf . append ( tokens . get ( i + k ) ) ; list . add ( buf . toString ( ) . intern ( ) ) ; } } return list ;
|
public class XmlChars { /** * guts of isNameChar / isNCNameChar */
private static boolean isLetter2 ( char c ) { } }
|
// [84 ] Letter : : = BaseChar | Ideographic
// [85 ] BaseChar : : = . . . too much to repeat
// [86 ] Ideographic : : = . . . too much to repeat
// [87 ] CombiningChar : : = . . . too much to repeat
// Optimize the typical case .
if ( c >= 'a' && c <= 'z' ) return true ; if ( c == '>' ) return false ; if ( c >= 'A' && c <= 'Z' ) return true ; // Since the tables are too ridiculous to use in code ,
// we ' re using the footnotes here to drive this test .
switch ( Character . getType ( c ) ) { // app . B footnote says these are ' name start '
// chars ' . . .
case Character . LOWERCASE_LETTER : // Ll
case Character . UPPERCASE_LETTER : // Lu
case Character . OTHER_LETTER : // Lo
case Character . TITLECASE_LETTER : // Lt
case Character . LETTER_NUMBER : // Nl
// . . . and these are name characters ' other
// than name start characters '
case Character . COMBINING_SPACING_MARK : // Mc
case Character . ENCLOSING_MARK : // Me
case Character . NON_SPACING_MARK : // Mn
case Character . MODIFIER_LETTER : // Lm
case Character . DECIMAL_DIGIT_NUMBER : // Nd
// OK , here we just have some exceptions to check . . .
return ! isCompatibilityChar ( c ) // per " 5.14 of Unicode " , rule out some combiners
&& ! ( c >= 0x20dd && c <= 0x20e0 ) ; default : // added a character . . .
return c == 0x0387 ; }
|
public class DefaultEntityManager { /** * Returns an IncompleteKey of the given entity .
* @ param entity
* the entity
* @ return the incomplete key */
private IncompleteKey getIncompleteKey ( Object entity ) { } }
|
EntityMetadata entityMetadata = EntityIntrospector . introspect ( entity . getClass ( ) ) ; String kind = entityMetadata . getKind ( ) ; ParentKeyMetadata parentKeyMetadata = entityMetadata . getParentKeyMetadata ( ) ; DatastoreKey parentKey = null ; IncompleteKey incompleteKey = null ; if ( parentKeyMetadata != null ) { parentKey = ( DatastoreKey ) IntrospectionUtils . getFieldValue ( parentKeyMetadata , entity ) ; } if ( parentKey != null ) { incompleteKey = IncompleteKey . newBuilder ( parentKey . nativeKey ( ) , kind ) . build ( ) ; } else { incompleteKey = IncompleteKey . newBuilder ( datastore . getOptions ( ) . getProjectId ( ) , kind ) . setNamespace ( getEffectiveNamespace ( ) ) . build ( ) ; } return incompleteKey ;
|
public class JunitNotifier { /** * ( non - Javadoc )
* @ see
* com . technophobia . substeps . runner . AbstractBaseNotifier # handleNotifyNodeStarted
* ( com . technophobia . substeps . execution . ExecutionNode ) */
public void onNodeStarted ( final IExecutionNode node ) { } }
|
final Description description = descriptionMap . get ( Long . valueOf ( node . getId ( ) ) ) ; final boolean b = description != null ; log . debug ( "notifyTestStarted nodeid: " + node . getId ( ) + " description: " + b ) ; notifyTestStarted ( description ) ;
|
public class Matchers { /** * Determines whether an expression has an annotation of the given class . This includes
* annotations inherited from superclasses due to @ Inherited .
* @ param inputClass The class of the annotation to look for ( e . g , Produces . class ) . */
public static < T extends Tree > Matcher < T > hasAnnotation ( final Class < ? extends Annotation > inputClass ) { } }
|
return new Matcher < T > ( ) { @ Override public boolean matches ( T tree , VisitorState state ) { return ASTHelpers . hasAnnotation ( ASTHelpers . getDeclaredSymbol ( tree ) , inputClass , state ) ; } } ;
|
public class TermStatementUpdate { /** * Adds an individual alias . It will be merged with the current
* list of aliases , or added as a label if there is no label for
* this item in this language yet .
* @ param alias
* the alias to add */
protected void addAlias ( MonolingualTextValue alias ) { } }
|
String lang = alias . getLanguageCode ( ) ; AliasesWithUpdate currentAliasesUpdate = newAliases . get ( lang ) ; NameWithUpdate currentLabel = newLabels . get ( lang ) ; // If there isn ' t any label for that language , put the alias there
if ( currentLabel == null ) { newLabels . put ( lang , new NameWithUpdate ( alias , true ) ) ; // If the new alias is equal to the current label , skip it
} else if ( ! currentLabel . value . equals ( alias ) ) { if ( currentAliasesUpdate == null ) { currentAliasesUpdate = new AliasesWithUpdate ( new ArrayList < MonolingualTextValue > ( ) , true ) ; } List < MonolingualTextValue > currentAliases = currentAliasesUpdate . aliases ; if ( ! currentAliases . contains ( alias ) ) { currentAliases . add ( alias ) ; currentAliasesUpdate . added . add ( alias ) ; currentAliasesUpdate . write = true ; } newAliases . put ( lang , currentAliasesUpdate ) ; }
|
public class Node { /** * Gets the set of all pages this node directly links to ; this does not
* include pages linked to by child elements . */
public Set < PageRef > getPageLinks ( ) { } }
|
synchronized ( lock ) { if ( pageLinks == null ) return Collections . emptySet ( ) ; if ( frozen ) return pageLinks ; return AoCollections . unmodifiableCopySet ( pageLinks ) ; }
|
public class BooleanArrayList { /** * Sorts the specified range of the receiver into ascending numerical order ( < tt > false & lt ; true < / tt > ) .
* The sorting algorithm is a count sort . This algorithm offers guaranteed
* O ( n ) performance without auxiliary memory .
* @ param from the index of the first element ( inclusive ) to be sorted .
* @ param to the index of the last element ( inclusive ) to be sorted . */
public void countSortFromTo ( int from , int to ) { } }
|
if ( size == 0 ) return ; checkRangeFromTo ( from , to , size ) ; boolean [ ] theElements = elements ; int trues = 0 ; for ( int i = from ; i <= to ; ) if ( theElements [ i ++ ] ) trues ++ ; int falses = to - from + 1 - trues ; if ( falses > 0 ) fillFromToWith ( from , from + falses - 1 , false ) ; if ( trues > 0 ) fillFromToWith ( from + falses , from + falses - 1 + trues , true ) ;
|
public class CallbackContextHelper { /** * Complete the UOW that was started by the begin method of this class
* and and resume any UOW that was suspended by the begin method .
* @ param commit must be true if and only if you want the unspecified TX
* started by begin method to be committed . Otherwise , the
* unspecified TX is rolled back .
* @ throws CSIException is thrown if any exception occurs when trying to
* complete the unspecified TX that was started by suspend method . */
void complete ( boolean commit ) throws CSIException { } }
|
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "complete called with commit argument set to: " + commit ) ; } if ( ivPopContexts != null ) { if ( ivPopContexts == Contexts . All ) { ivThreadData . popContexts ( ) ; } else { ivThreadData . popCallbackBeanO ( ) ; // d630940
} ivThreadData . ivLifecycleContextData = ivSavedLifecycleContextData ; // d644886
ivThreadData . ivLifecycleMethodContextIndex = ivSavedLifecycleMethodContextIndex ; // d644886
ivThreadData . ivLifecycleMethodBeginTx = ivSavedLifecycleMethodBeginTx ; ivThreadData = null ; } try { // This duplicates logic from TranStrategy .
// Complete the UOW started by the begin method .
if ( ivTransactionManager != null ) { if ( commit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Committing TX cntxt: " + ivTransactionManager . getTransaction ( ) ) ; // Was the transaction marked for rollback ?
int status = ivTransactionManager . getStatus ( ) ; if ( status == Status . STATUS_MARKED_ROLLBACK || status == Status . STATUS_ROLLING_BACK || status == Status . STATUS_ROLLEDBACK ) { // If the transaction was marked for rollback because it
// timed out , then rollback and rethrow the timeout .
try { ivTransactionManager . completeTxTimeout ( ) ; } catch ( TransactionRolledbackException e ) { ivTransactionManager . rollback ( ) ; throw e ; } // Otherwise , rollback silently .
ivTransactionManager . rollback ( ) ; } else { ivTransactionManager . commit ( ) ; } } else { if ( isTraceOn && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Rolling back TX cntxt due to bean exception: " + ivTransactionManager . getTransaction ( ) ) ; } ivTransactionManager . rollback ( ) ; } } else if ( ivLocalTransactionCurrent != null ) { int endMode = ( commit ) ? LocalTransactionCurrent . EndModeCommit : LocalTransactionCurrent . EndModeRollBack ; if ( isTraceOn && tc . isEventEnabled ( ) ) { LocalTransactionCoordinator lCoord = ivLocalTransactionCurrent . getLocalTranCoord ( ) ; if ( lCoord != null ) Tr . event ( tc , "Completing LTC cntxt: tid=" + Integer . toHexString ( lCoord . hashCode ( ) ) + "(LTC)" ) ; else Tr . event ( tc , "Completing LTC cntxt: " + "null Coordinator!" ) ; } ivLocalTransactionCurrent . complete ( endMode ) ; } } catch ( Throwable t ) { // FFDCFilter . processException ( t , CLASS _ NAME + " . complete " , " 168 " , this ) ;
if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unspecified UOW completion failure: " + t , t ) ; } throw new CSIException ( "unspecified UOW completion failure: " + t , t ) ; } finally { // Ensure suspended UOW is resumed .
if ( ivUowToken != null ) { if ( isTraceOn ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "complete is resuming UOW with UOWToken = " + ivUowToken ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Resuming TX/LTC cntxt: " + ivUowToken ) ; } UOWToken token = ivUowToken ; ivUowToken = null ; try { ivBeanO . container . ivUOWManager . resume ( token ) ; // d578360
} catch ( SystemException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".complete" , "216" , this ) ; throw new CSIException ( "Cannot complete due to failure in resume." , e ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "complete" ) ; }
|
public class WebGL10 { /** * < p > { @ code glBindRenderbuffer } binds the renderbuffer object with name renderbuffer to the renderbuffer target
* specified by target . target must be { @ code GL _ RENDERBUFFER } . { @ code renderbuffer } is the name of a renderbuffer
* object previously returned from a call to { @ link # glCreateRenderbuffer ( ) } , or zero to break the existing binding
* of a renderbuffer object to target . < / p >
* < p > { @ link # GL _ INVALID _ ENUM } is generated if target is not { @ code GL _ RENDERBUFFER } . < / p >
* < p > { @ link # GL _ INVALID _ OPERATION } is generated if renderbuffer is not zero or the name of a renderbuffer
* previously returned from a call to { @ link # glCreateRenderbuffer ( ) } . < / p >
* @ param target Specifies the renderbuffer target of the binding operation . target must be { @ code
* GL _ RENDERBUFFER } .
* @ param renderBuffer Specifies the name of the renderbuffer object to bind . */
public static void glBindRenderbuffer ( int target , int renderBuffer ) { } }
|
checkContextCompatibility ( ) ; nglBindRenderbuffer ( target , WebGLObjectMap . get ( ) . toRenderBuffer ( renderBuffer ) ) ;
|
public class SAReducerDecorator { /** * Perform initial condition convertion , for icnh4 and icno3 it ' s important to take into account the deep of the layer
* for computing the aggregated value .
* @ param key
* @ param fullCurrentSoil
* @ param previousSoil
* @ return */
public Float computeInitialConditions ( String key , Map < String , String > fullCurrentSoil , Map < String , String > previousSoil ) { } }
|
Float newValue = ( parseFloat ( fullCurrentSoil . get ( key ) ) * parseFloat ( fullCurrentSoil . get ( SLLB ) ) + parseFloat ( previousSoil . get ( key ) ) * parseFloat ( previousSoil . get ( SLLB ) ) ) ; newValue = newValue / ( parseFloat ( fullCurrentSoil . get ( SLLB ) ) + parseFloat ( previousSoil . get ( SLLB ) ) ) ; return newValue ;
|
public class GSCRImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } }
|
switch ( featureID ) { case AfplibPackage . GSCR__PREC : setPREC ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
|
public class ManageAddOnsDialog { /** * This method initializes this */
private void initialize ( ) { } }
|
this . setTitle ( Constant . messages . getString ( "cfu.manage.title" ) ) ; // this . setContentPane ( getJTabbed ( ) ) ;
this . setContentPane ( getTopPanel ( ) ) ; this . pack ( ) ; centerFrame ( ) ; state = State . IDLE ; // Handle escape key to close the dialog
KeyStroke escape = KeyStroke . getKeyStroke ( KeyEvent . VK_ESCAPE , 0 , false ) ; AbstractAction escapeAction = new AbstractAction ( ) { private static final long serialVersionUID = 3516424501887406165L ; @ Override public void actionPerformed ( ActionEvent e ) { dispatchEvent ( new WindowEvent ( ManageAddOnsDialog . this , WindowEvent . WINDOW_CLOSING ) ) ; } } ; getRootPane ( ) . getInputMap ( JComponent . WHEN_IN_FOCUSED_WINDOW ) . put ( escape , "ESCAPE" ) ; getRootPane ( ) . getActionMap ( ) . put ( "ESCAPE" , escapeAction ) ;
|
public class WithMavenStepExecution2 { /** * Executes a command and reads the result to a string . It uses the launcher to run the command to make sure the
* launcher decorator is used ie . docker . image step
* @ param args command arguments
* @ return output from the command or { @ code null } if the command returned a non zero code
* @ throws InterruptedException if interrupted */
@ Nullable private String readFromProcess ( String ... args ) throws InterruptedException { } }
|
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ) { ProcStarter ps = launcher . launch ( ) ; Proc p = launcher . launch ( ps . cmds ( args ) . stdout ( baos ) ) ; int exitCode = p . join ( ) ; if ( exitCode == 0 ) { return baos . toString ( getComputer ( ) . getDefaultCharset ( ) . name ( ) ) . replaceAll ( "[\t\r\n]+" , " " ) . trim ( ) ; } else { return null ; } } catch ( IOException e ) { e . printStackTrace ( console . format ( "Error executing command '%s' : %s%n" , Arrays . toString ( args ) , e . getMessage ( ) ) ) ; } return null ;
|
public class BeanRepositoryApplication { /** * Startup initialisation of the BeanRepository . After the BeanRepository was initialised with
* the given configurator classes , a { @ link ApplicationStartedEvent } is thrown . Use this event
* as starting point for the code of your application .
* @ param args the program arguments
* @ param configurators the configurator classes , which provides the beans to the repository . */
public static void run ( final String [ ] args , final BeanRepositoryConfigurator ... configurators ) { } }
|
validate ( args , configurators ) ; final BeanRepository beanRepository = buildAndConfigureBeanRepository ( args , configurators ) ; final ApplicationEventBus eventBus = beanRepository . getBean ( ApplicationEventBus . class ) ; eventBus . fireEvent ( new ApplicationStartedEvent ( ) ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> { eventBus . fireEvent ( new ApplicationShutdownEvent ( ) ) ; } ) ) ;
|
public class PropertiesManager { /** * Retrieve the default raw value of the given property . This functionality
* is local by design - nothing outside of the properties manager should be
* directly requesting the default value . Client code should not be
* concerned with what the default value is specifically , just what the
* value is and whether or not it is default ( see { @ link # isDefault ( Object ) }
* ) . < br >
* < br >
* Note that if { @ link # isAutoTrim ( ) auto trim } is enabled , this value will
* be trimmed of whitespace .
* @ param property
* the property whose default value is requested
* @ return the default raw value of the given property */
private String getRawDefaultProperty ( T property ) { } }
|
String propertyName = getTranslator ( ) . getPropertyName ( property ) ; String value = properties . getDefaultValue ( propertyName ) ; if ( value != null && isAutoTrim ( ) ) { value = value . trim ( ) ; } return value ;
|
public class ManagedChannelImpl { /** * Make the channel exit idle mode , if it ' s in it .
* < p > Must be called from syncContext */
@ VisibleForTesting void exitIdleMode ( ) { } }
|
syncContext . throwIfNotInThisSynchronizationContext ( ) ; if ( shutdown . get ( ) || panicMode ) { return ; } if ( inUseStateAggregator . isInUse ( ) ) { // Cancel the timer now , so that a racing due timer will not put Channel on idleness
// when the caller of exitIdleMode ( ) is about to use the returned loadBalancer .
cancelIdleTimer ( false ) ; } else { // exitIdleMode ( ) may be called outside of inUseStateAggregator . handleNotInUse ( ) while
// isInUse ( ) = = false , in which case we still need to schedule the timer .
rescheduleIdleTimer ( ) ; } if ( lbHelper != null ) { return ; } channelLogger . log ( ChannelLogLevel . INFO , "Exiting idle mode" ) ; LbHelperImpl lbHelper = new LbHelperImpl ( ) ; lbHelper . lb = loadBalancerFactory . newLoadBalancer ( lbHelper ) ; // Delay setting lbHelper until fully initialized , since loadBalancerFactory is user code and
// may throw . We don ' t want to confuse our state , even if we will enter panic mode .
this . lbHelper = lbHelper ; NameResolverObserver observer = new NameResolverObserver ( lbHelper , nameResolver ) ; nameResolver . start ( observer ) ; nameResolverStarted = true ;
|
public class SeqEval { /** * 从reader中提取实体 , 存到相应的队列中 , 并统计固定长度实体的个数 , 存到相应的map中
* 格式为 : 字 + 预测标签 + 正确标签
* 中BB
* 国ES
* 队SB
* 赢SE
* 了SS
* @ param filePath结果文件
* @ throws IOException */
public void read ( String filePath ) throws IOException { } }
|
String line ; ArrayList < String > words = new ArrayList < String > ( ) ; ArrayList < String > markP = new ArrayList < String > ( ) ; ArrayList < String > typeP = new ArrayList < String > ( ) ; ArrayList < String > markC = new ArrayList < String > ( ) ; ArrayList < String > typeC = new ArrayList < String > ( ) ; if ( filePath == null ) return ; File file = new File ( filePath ) ; BufferedReader reader = null ; entityType = new HashSet < String > ( ) ; // 按行读取文件内容 , 一次读一整行
reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) , "UTF-8" ) ) ; // 从文件中提取实体并存入队列中
while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . equals ( "" ) ) { newextract ( words , markP , typeP , markC , typeC ) ; } else { // 判断实体 , 实体开始的边界为B - * * * 或者S - * * * , 结束的边界为E - * * * 或N ( O ) 或空白字符或B - * * *
// predict
String [ ] toks = line . split ( "\\s+" ) ; int ci = 1 ; int cj = 2 ; if ( toks . length > 3 ) { // 如果列数大于三 , 默认取最后两列
ci = toks . length - 2 ; cj = toks . length - 1 ; } else if ( toks . length < 3 ) { System . out . println ( line ) ; return ; } String [ ] marktype = getMarkType ( toks [ ci ] ) ; words . add ( toks [ 0 ] ) ; markP . add ( marktype [ 0 ] ) ; typeP . add ( marktype [ 1 ] ) ; entityType . add ( marktype [ 1 ] ) ; // correct
marktype = getMarkType ( toks [ cj ] ) ; markC . add ( marktype [ 0 ] ) ; typeC . add ( marktype [ 1 ] ) ; entityType . add ( marktype [ 1 ] ) ; } } reader . close ( ) ; if ( words . size ( ) > 0 ) { newextract ( words , markP , typeP , markC , typeC ) ; } // 从entityPs和entityCs提取正确估计的实体 , 存到entityCinPs , 并更新mpc中的统计信息
extractCInPEntity ( ) ;
|
public class ResourceReaderImpl { /** * / * ( non - Javadoc )
* @ see net . crowmagnumb . util . ResourceReader # getDoubleValue ( java . lang . String , double ) */
@ Override public double getDoubleValue ( final String key , final double defaultValue ) { } }
|
return formatDoubleValue ( key , getFormattedPropValue ( key ) , defaultValue ) ;
|
public class InvoiceData { /** * Write members to a MwsWriter .
* @ param w
* The writer to write to . */
@ Override public void writeFragmentTo ( MwsWriter w ) { } }
|
w . write ( "InvoiceRequirement" , invoiceRequirement ) ; w . write ( "BuyerSelectedInvoiceCategory" , buyerSelectedInvoiceCategory ) ; w . write ( "InvoiceTitle" , invoiceTitle ) ; w . write ( "InvoiceInformation" , invoiceInformation ) ;
|
public class BS { /** * Returns a < code > DeleteAction < / code > for deleting the specified values
* from this binary set . */
public DeleteAction delete ( ByteBuffer ... values ) { } }
|
return new DeleteAction ( this , new LiteralOperand ( new LinkedHashSet < ByteBuffer > ( Arrays . asList ( values ) ) ) ) ;
|
public class HasNode { /** * Adds to < code > result < / code > the end point nodes ( nodes that specify a module name ) for this
* node and all of the child nodes .
* @ param result
* The collection that the end point nodes will be added to */
public void gatherEndpoints ( Collection < HasNode > result ) { } }
|
if ( nodeName != null && nodeName . length ( ) > 0 ) { result . add ( this ) ; } if ( trueNode != null ) { trueNode . gatherEndpoints ( result ) ; } if ( falseNode != null ) { falseNode . gatherEndpoints ( result ) ; }
|
public class SnomedExample { /** * Shows how to create the following axioms :
* < ol >
* < li > Primitive child with no roles < / li >
* < li > Fully defined child with one or more roles < / li >
* < li > Fully defined child with a concrete domain < / li >
* < / ol > */
public static void bottlesExample ( ) { } }
|
// Create all the concepts
Concept bottle = Factory . createNamedConcept ( "bottle" ) ; Concept plasticBottle = Factory . createNamedConcept ( "plasticBottle" ) ; Concept glassBottle = Factory . createNamedConcept ( "glassBottle" ) ; Concept purplePlasticBottle = Factory . createNamedConcept ( "purplePlasticBottle" ) ; Concept plastic = Factory . createNamedConcept ( "plastic" ) ; Concept tallBottle = Factory . createNamedConcept ( "tallBottle" ) ; Concept wideBottle = Factory . createNamedConcept ( "wideBottle" ) ; Concept wineBottle = Factory . createNamedConcept ( "wineBottle" ) ; // Create all the roles
Role isMadeOf = Factory . createNamedRole ( "isMadeOf" ) ; // Create all the features
Feature hasHeight = Factory . createNamedFeature ( "hasHeight" ) ; Feature hasWidth = Factory . createNamedFeature ( "hasWidth" ) ; Set < Axiom > axioms = new HashSet < Axiom > ( ) ; // This is an example of a primitive child with no roles .
Axiom a0 = new ConceptInclusion ( glassBottle , bottle ) ; axioms . add ( a0 ) ; // This is an example of a fully defined child with one role . In this
// case two axioms are needed because the API does not support
// equivalence directly .
Axiom a1 = new ConceptInclusion ( plasticBottle , Factory . createConjunction ( bottle , Factory . createExistential ( isMadeOf , plastic ) ) ) ; Axiom a1b = new ConceptInclusion ( Factory . createConjunction ( bottle , Factory . createExistential ( isMadeOf , plastic ) ) , plasticBottle ) ; axioms . add ( a1 ) ; axioms . add ( a1b ) ; // This is an example of a primitive child with no roles
Axiom a2 = new ConceptInclusion ( purplePlasticBottle , plasticBottle ) ; axioms . add ( a2 ) ; // This is an example of a fully defined child with a concrete domain
Axiom a3 = new ConceptInclusion ( tallBottle , Factory . createConjunction ( bottle , Factory . createDatatype ( hasHeight , Operator . GREATER_THAN , Factory . createIntegerLiteral ( 5 ) ) ) ) ; Axiom a3b = new ConceptInclusion ( Factory . createConjunction ( bottle , Factory . createDatatype ( hasHeight , Operator . GREATER_THAN , Factory . createIntegerLiteral ( 5 ) ) ) , tallBottle ) ; axioms . add ( a3 ) ; axioms . add ( a3b ) ; // This is another example of a fully defined child with a concrete
// domain
Axiom a4 = new ConceptInclusion ( wideBottle , Factory . createConjunction ( bottle , Factory . createDatatype ( hasWidth , Operator . GREATER_THAN , Factory . createIntegerLiteral ( 5 ) ) ) ) ; Axiom a4b = new ConceptInclusion ( Factory . createConjunction ( bottle , Factory . createDatatype ( hasWidth , Operator . GREATER_THAN , Factory . createIntegerLiteral ( 5 ) ) ) , wideBottle ) ; axioms . add ( a4 ) ; axioms . add ( a4b ) ; // Yet another example of a fully defined child with a concrete domain
Axiom a5 = new ConceptInclusion ( wineBottle , Factory . createConjunction ( glassBottle , Factory . createDatatype ( hasWidth , Operator . EQUALS , Factory . createIntegerLiteral ( 2 ) ) , Factory . createDatatype ( hasHeight , Operator . EQUALS , Factory . createIntegerLiteral ( 6 ) ) ) ) ; Axiom a5b = new ConceptInclusion ( Factory . createConjunction ( glassBottle , Factory . createDatatype ( hasWidth , Operator . EQUALS , Factory . createIntegerLiteral ( 2 ) ) , Factory . createDatatype ( hasHeight , Operator . EQUALS , Factory . createIntegerLiteral ( 6 ) ) ) , wineBottle ) ; axioms . add ( a5 ) ; axioms . add ( a5b ) ; // Create a classifier and classify the axioms
IReasoner r = new SnorocketReasoner ( ) ; r . loadAxioms ( axioms ) ; r = r . classify ( ) ; // Get only the taxonomy
Ontology res = r . getClassifiedOntology ( ) ; Utils . printTaxonomy ( res . getTopNode ( ) , res . getBottomNode ( ) ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.