signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ParosTableAlert { /** * / * ( non - Javadoc ) * @ see org . parosproxy . paros . db . paros . TableAlert # write ( int , int , java . lang . String , int , int , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java . lang . String , java ...
try { psInsert . setInt ( 1 , scanId ) ; psInsert . setInt ( 2 , pluginId ) ; psInsert . setString ( 3 , alert ) ; psInsert . setInt ( 4 , risk ) ; psInsert . setInt ( 5 , confidence ) ; psInsert . setString ( 6 , description ) ; psInsert . setString ( 7 , uri ) ; psInsert . setString ( 8 , param ) ; psInsert . setStri...
public class EnglishGrammaticalStructure { /** * Destructively modifies this < code > Collection & lt ; TypedDependency & gt ; < / code > * by collapsing several types of transitive pairs of dependencies , but * keeping the tree structure . * < dl > * < dt > prepositional object dependencies : pobj < / dt > *...
correctDependencies ( list ) ; if ( DEBUG ) { printListSorted ( "After correctDependencies:" , list ) ; } eraseMultiConj ( list ) ; if ( DEBUG ) { printListSorted ( "After collapse multi conj:" , list ) ; } collapse2WP ( list ) ; if ( DEBUG ) { printListSorted ( "After collapse2WP:" , list ) ; } collapseFlatMWP ( list ...
public class DCompiler { /** * Sql - > Json . * @ param query * @ return */ public static Program compileSql ( String query ) { } }
try { ANTLRStringStream in = new ANTLRStringStream ( query ) ; druidGLexer lexer = new druidGLexer ( in ) ; CommonTokenStream tokens = new CommonTokenStream ( lexer ) ; druidGParser parser = new druidGParser ( tokens ) ; Program pgm = parser . program ( ) ; return pgm ; } catch ( RecognitionException ex ) { System . ou...
public class Game { /** * Creates a new Game instance with the specified name . * < br > This will display as { @ code Listening name } in the official client * @ param name * The not - null name of the newly created game * @ throws IllegalArgumentException * if the specified name is null , empty or blank *...
Checks . notBlank ( name , "Name" ) ; return new Game ( name , null , GameType . LISTENING ) ;
public class AbstractSequenceClassifier { /** * Classify stdin by documents seperated by 3 blank line * @ param readerWriter * @ return boolean reached end of IO * @ throws IOException */ public boolean classifyDocumentStdin ( DocumentReaderAndWriter < IN > readerWriter ) throws IOException { } }
BufferedReader is = new BufferedReader ( new InputStreamReader ( System . in , flags . inputEncoding ) ) ; String line ; String text = "" ; String eol = "\n" ; String sentence = "<s>" ; int blankLines = 0 ; while ( ( line = is . readLine ( ) ) != null ) { if ( line . trim ( ) . equals ( "" ) ) { ++ blankLines ; if ( bl...
public class CPOptionCategoryLocalServiceWrapper { /** * Returns the cp option category matching the UUID and group . * @ param uuid the cp option category ' s UUID * @ param groupId the primary key of the group * @ return the matching cp option category , or < code > null < / code > if a matching cp option categ...
return _cpOptionCategoryLocalService . fetchCPOptionCategoryByUuidAndGroupId ( uuid , groupId ) ;
public class AppEngineCoordinator { /** * Puts the specified entity instance into the datastore newly within the * current transaction . * @ param entity The entity to be put into the datastore . */ @ Override public void put ( Object entity ) { } }
ResourceManager < Transaction > manager = new AppEngineResourceManager ( datastore , datastore . beginTransaction ( ) , transaction ) ; manager . put ( entity ) ; Log log = new Log ( transaction . logs ( ) . size ( ) + 1 , Log . Operation . PUT , entity ) ; log . state ( State . UNCOMMITTED ) ; transaction . logs ( ) ....
public class AlertsEngineCache { /** * Remove all DataEntry for a specified trigger . * @ param triggerId to remove */ public void remove ( String tenantId , String triggerId ) { } }
if ( tenantId == null ) { throw new IllegalArgumentException ( "tenantId must be not null" ) ; } if ( triggerId == null ) { throw new IllegalArgumentException ( "triggerId must be not null" ) ; } Set < DataEntry > dataEntriesToRemove = new HashSet < > ( ) ; activeDataEntries . stream ( ) . forEach ( e -> { if ( e . get...
public class service_stats { /** * Use this API to fetch the statistics of all service _ stats resources that are configured on netscaler . */ public static service_stats [ ] get ( nitro_service service ) throws Exception { } }
service_stats obj = new service_stats ( ) ; service_stats [ ] response = ( service_stats [ ] ) obj . stat_resources ( service ) ; return response ;
public class TelemetryService { /** * configure telemetry deployment based on connection url and info * Note : it is not thread - safe while connecting to different deployments * simultaneously . * @ param url * @ param account */ private void configureDeployment ( final String url , final String account , fina...
// default value TELEMETRY_SERVER_DEPLOYMENT deployment = TELEMETRY_SERVER_DEPLOYMENT . PROD ; if ( url != null ) { if ( url . contains ( "reg" ) || url . contains ( "local" ) ) { deployment = TELEMETRY_SERVER_DEPLOYMENT . REG ; if ( ( port != null && port . compareTo ( "8080" ) == 0 ) || url . contains ( "8080" ) ) { ...
public class Tensor { /** * Gets the max value in the tensor . */ public double getMax ( ) { } }
double max = s . minValue ( ) ; for ( int c = 0 ; c < this . values . length ; c ++ ) { if ( s . gte ( values [ c ] , max ) ) { max = values [ c ] ; } } return max ;
public class VarOptItemsUnion { /** * Gets the varopt sketch resulting from the union of any input sketches . * @ return A varopt sketch */ public VarOptItemsSketch < T > getResult ( ) { } }
// If no marked items in H , gadget is already valid mathematically . We can return what is // basically just a copy of the gadget . if ( gadget_ . getNumMarksInH ( ) == 0 ) { return simpleGadgetCoercer ( ) ; } else { // At this point , we know that marked items are present in H . So : // 1 . Result will necessarily be...
public class IncludeExcludeExtension { /** * in contrast to the three other handleXXX methods , this one includes nodes */ private void handleFeatureIncludes ( SpecInfo spec , IncludeExcludeCriteria criteria ) { } }
if ( criteria . isEmpty ( ) ) return ; for ( FeatureInfo feature : spec . getAllFeatures ( ) ) if ( hasAnyAnnotation ( feature . getFeatureMethod ( ) , criteria . annotations ) ) feature . setExcluded ( false ) ;
public class EvernoteClientFactory { /** * Returns an async wrapper providing several helper methods for business notebooks . With * { @ link EvernoteBusinessNotebookHelper # getClient ( ) } you can get access to the underlying { @ link EvernoteNoteStoreClient } , * which references the business note store URL . ...
if ( mBusinessNotebookHelper == null || isBusinessAuthExpired ( ) ) { mBusinessNotebookHelper = createBusinessNotebookHelper ( ) ; } return mBusinessNotebookHelper ;
public class ChannelAction { /** * Sets the { @ link net . dv8tion . jda . core . entities . Category Category } for the new Channel * @ param category * The parent for the new Channel * @ throws UnsupportedOperationException * If this ChannelAction is for a Category * @ throws IllegalArgumentException * If...
Checks . check ( category == null || category . getGuild ( ) . equals ( guild ) , "Category is not from same guild!" ) ; this . parent = category ; return this ;
public class JMStats { /** * Gets percentile value . * @ param targetPercentile the target percentile * @ param unorderedNumberList the unordered number list * @ return the percentile value */ public static Number getPercentileValue ( int targetPercentile , List < Number > unorderedNumberList ) { } }
return getPercentileValueWithSorted ( targetPercentile , sortedDoubleList ( unorderedNumberList ) ) ;
public class WebConfigParamUtils { /** * Gets the String init parameter value from the specified context . If the parameter is an * empty String or a String * containing only white space , this method returns < code > null < / code > * @ param context * the application ' s external context * @ param names *...
return getStringInitParameter ( context , names , null ) ;
public class ViewDragHelper { /** * Sets the sensitivity of the dragger . * @ param context The application context . * @ param sensitivity value between 0 and 1 , the final value for touchSlop = * ViewConfiguration . getScaledTouchSlop * ( 1 / s ) ; */ public void setSensitivity ( Context context , float sensiti...
float s = Math . max ( 0f , Math . min ( 1.0f , sensitivity ) ) ; ViewConfiguration viewConfiguration = ViewConfiguration . get ( context ) ; mTouchSlop = ( int ) ( viewConfiguration . getScaledTouchSlop ( ) * ( 1 / s ) ) ;
public class Objects { /** * Verifies input objects are equal . * @ param o1 the first argument to compare * @ param o2 the second argument to compare * @ return true , if the input arguments are equal , false otherwise . */ public static < O > boolean eq ( O o1 , O o2 ) { } }
return o1 != null ? o1 . equals ( o2 ) : o2 == null ;
public class ResponderTask { /** * Look for the detect pattern in the input , if seen return true . If the failure pattern is detected , return false . * If a max timeout or max number of lines to read is exceeded , throw threshhold error . */ static boolean detect ( final String detectPattern , final String failureP...
if ( null == detectPattern && null == failurePattern ) { throw new IllegalArgumentException ( "detectPattern or failurePattern required" ) ; } long start = System . currentTimeMillis ( ) ; int linecount = 0 ; final Pattern success ; if ( null != detectPattern ) { success = Pattern . compile ( detectPattern ) ; } else {...
public class LifecycleManager { /** * Add the objects to the container . Their assets will be loaded , post construct methods called , etc . * @ param objects objects to add * @ throws Exception errors */ @ Deprecated public void add ( Object ... objects ) throws Exception { } }
for ( Object obj : objects ) { add ( obj ) ; }
public class MArray { /** * Returns a reference to the MValue of the item at the given index . * If the index is out of range , returns an empty MValue . */ public MValue get ( long index ) { } }
if ( index < 0 || index >= values . size ( ) ) { return MValue . EMPTY ; } MValue value = values . get ( ( int ) index ) ; if ( value . isEmpty ( ) && ( baseArray != null ) ) { value = new MValue ( baseArray . get ( index ) ) ; values . set ( ( int ) index , value ) ; } return value ;
public class ChatResource { /** * Suspend the response without writing anything back to the client . * @ return a white space */ @ GET public String suspend ( ) { } }
AtmosphereResource r = ( AtmosphereResource ) req . getAttribute ( "org.atmosphere.cpr.AtmosphereResource" ) ; r . setBroadcaster ( r . getAtmosphereConfig ( ) . getBroadcasterFactory ( ) . lookup ( "/cxf-chat" , true ) ) . suspend ( ) ; return "" ;
public class RebindConfiguration { /** * Return a { @ link MapperInstance } instantiating the serializer for the given type * @ param type a { @ link com . google . gwt . core . ext . typeinfo . JType } object . * @ return a { @ link com . google . gwt . thirdparty . guava . common . base . Optional } object . */ p...
return Optional . fromNullable ( serializers . get ( type . getQualifiedSourceName ( ) ) ) ;
public class RuleBasedNumberFormat { /** * lazily initialize relevant items */ @ Override public void setContext ( DisplayContext context ) { } }
super . setContext ( context ) ; if ( ! capitalizationInfoIsSet && ( context == DisplayContext . CAPITALIZATION_FOR_UI_LIST_OR_MENU || context == DisplayContext . CAPITALIZATION_FOR_STANDALONE ) ) { initCapitalizationContextInfo ( locale ) ; capitalizationInfoIsSet = true ; } if ( capitalizationBrkIter == null && ( con...
public class ConcurrentLinkedHashMap { /** * Moves the tasks from the specified buffer into the output array . * @ param tasks the ordered array of the pending operations * @ param bufferIndex the buffer to drain into the tasks array * @ return the highest index location of a task that was added to the array */ i...
// While a buffer is being drained it may be concurrently appended to . // The // number of tasks removed are tracked so that the length can be // decremented // by the delta rather than set to zero . Queue < Task > buffer = buffers [ bufferIndex ] ; int removedFromBuffer = 0 ; Task task ; int maxIndex = - 1 ; while ( ...
public class ExpiryIndex { /** * Add an ExpirableReference to the expiry index . * @ param expirable an ExpirableReference . * @ return true if the object was added to the index successfully . */ public boolean put ( ExpirableReference expirable ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , "ObjId=" + expirable . getID ( ) + " ET=" + expirable . getExpiryTime ( ) ) ; boolean reply = tree . insert ( expirable ) ; if ( reply ) { size ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEn...
public class ReportingController { /** * Convert a query parameter to the correct object type based on the first letter of the name . * @ param name parameter name * @ param value parameter value * @ return parameter object as * @ throws ParseException value could not be parsed * @ throws NumberFormatExceptio...
Object result = null ; if ( name . length ( ) > 0 ) { switch ( name . charAt ( 0 ) ) { case 'i' : if ( null == value || value . length ( ) == 0 ) { value = "0" ; } result = new Integer ( value ) ; break ; case 'f' : if ( name . startsWith ( "form" ) ) { result = value ; } else { if ( null == value || value . length ( )...
public class LDblToByteFuncMemento { /** * < editor - fold desc = " object " > */ public static boolean argEquals ( LDblToByteFuncMemento the , Object that ) { } }
return Null . < LDblToByteFuncMemento > equals ( the , that , ( one , two ) -> { if ( one . getClass ( ) != two . getClass ( ) ) { return false ; } LDblToByteFuncMemento other = ( LDblToByteFuncMemento ) two ; return LObjBytePair . argEquals ( one . function , one . lastValue ( ) , other . function , other . lastValue ...
public class QueryResponse { /** * This method flats the two levels ( QueryResponse and QueryResult ) into a single list of T . * @ return a single list with all the results , or null if no response exists */ public List < T > allResults ( ) { } }
List < T > results = null ; if ( response != null && response . size ( ) > 0 ) { // We first calculate the total size needed int totalSize = allResultsSize ( ) ; // We init the list and copy data results = new ArrayList < > ( totalSize ) ; for ( QueryResult < T > queryResult : response ) { results . addAll ( queryResul...
public class CatalogUtil { /** * Given plan graphs and a SQL statement , compute a bidirectional usage map between * schema ( indexes , table & views ) and SQL / Procedures . * Use " annotation " objects to store this extra information in the catalog * during compilation and catalog report generation . */ public ...
Map < String , StmtTargetTableScan > tablesRead = new TreeMap < > ( ) ; Collection < String > indexes = new TreeSet < > ( ) ; if ( topPlan != null ) { topPlan . getTablesAndIndexes ( tablesRead , indexes ) ; } if ( bottomPlan != null ) { bottomPlan . getTablesAndIndexes ( tablesRead , indexes ) ; } String updated = "" ...
public class UcsApi { /** * Get the history of interactions for a contact * @ param id id of the Contact ( required ) * @ param contactHistoryData ( required ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public A...
ApiResponse < ApiSuccessResponse > resp = getContactHistoryWithHttpInfo ( id , contactHistoryData ) ; return resp . getData ( ) ;
public class FrameworkProjectConfig { /** * Create PropertyLookup for a project from the framework basedir * @ param filesystemFramework the filesystem */ private static PropertyLookup createProjectPropertyLookup ( IFilesystemFramework filesystemFramework , String projectName ) { } }
PropertyLookup lookup ; final Properties ownProps = new Properties ( ) ; ownProps . setProperty ( "project.name" , projectName ) ; File baseDir = filesystemFramework . getBaseDir ( ) ; File projectsBaseDir = filesystemFramework . getFrameworkProjectsBaseDir ( ) ; // generic framework properties for a project final File...
public class Crypto { /** * Encrypts a given plain text using the application secret property ( application . secret ) as key * Encryption is done by using AES and CBC Cipher and a key length of 256 bit * @ param plainText The plain text to encrypt * @ return The encrypted text or null if encryption fails */ publ...
Objects . requireNonNull ( plainText , Required . PLAIN_TEXT . toString ( ) ) ; return encrypt ( plainText , getSizedSecret ( this . config . getApplicationSecret ( ) ) ) ;
public class KeyVerifyParameters { /** * Set the signature value . * @ param signature the signature value to set * @ return the KeyVerifyParameters object itself . */ public KeyVerifyParameters withSignature ( byte [ ] signature ) { } }
if ( signature == null ) { this . signature = null ; } else { this . signature = Base64Url . encode ( signature ) ; } return this ;
public class ConnectionImpl { /** * Internal method for creating the consumer . * @ param destAddr * @ param alternateUser * @ param destinationType * @ param discriminator * @ param selector * @ param reliability * @ param enableReadAhead * @ param nolocal * @ param forwardScanning * @ param system...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalCreateConsumerSession" , new Object [ ] { destAddr , alternateUser , destinationType , criteria , reliability , Boolean . valueOf ( enableReadAhead ) , Boolean . valueOf ( nolocal ) , Boolean . valueOf ( forwardScan...
public class Kit { /** * Get listener at < i > index < / i > position in < i > bag < / i > or null if * < i > index < / i > equals to number of listeners in < i > bag < / i > . * For usage example , see { @ link # addListener ( Object bag , Object listener ) } . * @ param bag Current collection of listeners . *...
if ( index == 0 ) { if ( bag == null ) return null ; if ( ! ( bag instanceof Object [ ] ) ) return bag ; Object [ ] array = ( Object [ ] ) bag ; // bag has at least 2 elements if it is array if ( array . length < 2 ) throw new IllegalArgumentException ( ) ; return array [ 0 ] ; } else if ( index == 1 ) { if ( ! ( bag i...
public class ExpressionToken { /** * Get the value from < code > array < / code > at < code > index < / code > * @ param array the array * @ param index the index * @ return the value returned from < code > Array . get ( array , index ) < / code > */ protected final Object arrayLookup ( Object array , int index )...
LOGGER . trace ( "get value from array index " + index ) ; return Array . get ( array , index ) ;
public class ListPoliciesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListPoliciesRequest listPoliciesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listPoliciesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listPoliciesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listPoliciesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } cat...
public class ClassificationService { /** * Attach a { @ link ClassificationModel } with the given classificationText and description to the provided { @ link FileModel } . * If an existing Model exists with the provided classificationText , that one will be used instead . * The classification is looked up by name a...
Traversal < ? , ? > classificationTraversal = getQuery ( ) . traverse ( g -> g . has ( ClassificationModel . CLASSIFICATION , classificationTitle ) ) . getRawTraversal ( ) ; ClassificationModel classification = getUnique ( classificationTraversal ) ; if ( classification == null ) { classification = create ( ) ; classif...
public class CompositeArtifactStore { /** * { @ inheritDoc } */ public Metadata getMetadata ( String path ) throws IOException , MetadataNotFoundException { } }
boolean found = false ; Metadata result = new Metadata ( ) ; Set < String > pluginArtifactIds = new HashSet < String > ( ) ; Set < String > snapshotVersions = new HashSet < String > ( ) ; for ( int i = 0 ; i < stores . length ; i ++ ) { try { Metadata partial = stores [ i ] . getMetadata ( path ) ; if ( StringUtils . i...
public class InvalidationAuditDaemon { /** * This ensures the specified CacheEntrys have not been invalidated . * @ param cacheEntry The unfiltered CacheEntry . * @ return The filtered CacheEntry . */ public CacheEntry filterEntry ( String cacheName , CacheEntry cacheEntry ) { } }
InvalidationTableList invalidationTableList = getInvalidationTableList ( cacheName ) ; try { invalidationTableList . readWriteLock . readLock ( ) . lock ( ) ; return internalFilterEntry ( cacheName , invalidationTableList , cacheEntry ) ; } finally { invalidationTableList . readWriteLock . readLock ( ) . unlock ( ) ; }
public class AmazonConfigClient { /** * Indicates whether the specified AWS resources are compliant . If a resource is noncompliant , this action returns * the number of AWS Config rules that the resource does not comply with . * A resource is compliant if it complies with all the AWS Config rules that evaluate it ...
request = beforeClientExecution ( request ) ; return executeDescribeComplianceByResource ( request ) ;
public class SqlExecutor { /** * 执行查询语句并关闭PreparedStatement * @ param < T > 处理结果类型 * @ param ps PreparedStatement * @ param rsh 结果集处理对象 * @ param params 参数 * @ return 结果对象 * @ throws SQLException SQL执行异常 */ public static < T > T queryAndClosePs ( PreparedStatement ps , RsHandler < T > rsh , Object ... param...
try { return query ( ps , rsh , params ) ; } finally { DbUtil . close ( ps ) ; }
public class AbstractOpenTracingFilter { /** * Resolve the span name to use for the request . * @ param request The request * @ return The span name */ protected String resolveSpanName ( HttpRequest < ? > request ) { } }
Optional < String > route = request . getAttribute ( HttpAttributes . URI_TEMPLATE , String . class ) ; return route . map ( s -> request . getMethod ( ) + " " + s ) . orElse ( request . getMethod ( ) + " " + request . getPath ( ) ) ;
public class SocketTransport { /** * Connects to the mentioned host and port with SSL and checks the certificate against the pinned version . * @ param address host : port to connect to * @ param pinnedcert expected certificate of the server * @ return instance of this class * @ throws IOException if establishi...
SSLSocketFactory factory = get_ssl_socket_factory ( pinnedcert ) ; Socket s = factory . createSocket ( address . getHostString ( ) , address . getPort ( ) ) ; return new SocketTransport ( s ) ;
public class Optionals { /** * Adapter to create an Optional out of the first element of a List . If the list is empty , we get * an empty optional . Also , if the first element is null , return an empty optional . * @ param < T > the type of objects in the list * @ param list the list to look at * @ return the...
return list . isEmpty ( ) ? Optional . empty ( ) : Optional . ofNullable ( list . get ( 0 ) ) ;
public class FileSystemUtils { /** * Lists all files in the given directory accepted by the { @ link FileFilter } . This method uses recursion to list * all files in the given directory as well as any sub - directories of the given directory accepted by * the { @ link FileFilter } . * @ param directory the direct...
List < File > files = new ArrayList < > ( ) ; for ( File file : safeListFiles ( directory , fileFilter ) ) { files . addAll ( isDirectory ( file ) ? Arrays . asList ( listFiles ( file , fileFilter ) ) : Collections . singletonList ( file ) ) ; } return ( files . isEmpty ( ) ? NO_FILES : files . toArray ( new File [ fil...
public class CanonicalPlanner { /** * Attach DUP _ REMOVE node at top of tree . The DUP _ REMOVE may be pushed down to a source ( or sources ) if possible by the * optimizer . * @ param context the context in which the query is being planned * @ param plan the existing plan * @ return the updated plan */ protec...
PlanNode dupNode = new PlanNode ( Type . DUP_REMOVE ) ; plan . setParent ( dupNode ) ; return dupNode ;
public class TDHttpClient { /** * Submit an API request , and bind the returned JSON data into an object of the given result jackson JavaType . * For mapping it uses Jackson object mapper . * @ param apiRequest * @ param resultType * @ param < Result > * @ return * @ throws TDClientException */ @ SuppressWa...
try { byte [ ] content = submitRequest ( apiRequest , apiKeyCache , byteArrayContentHandler ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( "response:\n{}" , new String ( content , StandardCharsets . UTF_8 ) ) ; } if ( resultType . getRawClass ( ) == String . class ) { return ( Result ) new String ( content ,...
public class AbstractContextSelectToolbarStatusPanel { /** * Gets the Context select combo box . * @ return the context select combo box */ protected ContextSelectComboBox getContextSelectComboBox ( ) { } }
if ( contextSelectBox == null ) { contextSelectBox = new ContextSelectComboBox ( ) ; contextSelectBox . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { contextSelected ( ( Context ) contextSelectBox . getSelectedItem ( ) ) ; } } ) ; } return contextSelectBox ;
public class BELUtilities { /** * Check equality of two substrings . This method does not create * intermediate { @ link String } objects and is roughly equivalent to : * < pre > * < code > * String sub1 = s1 . substring ( fromIndex1 , toIndex1 ) ; * String sub2 = s2 . substring ( fromIndex2 , toIndex2 ) ; ...
if ( toIndex1 < fromIndex1 ) { throw new IndexOutOfBoundsException ( ) ; } if ( toIndex2 < fromIndex2 ) { throw new IndexOutOfBoundsException ( ) ; } final int len1 = toIndex1 - fromIndex1 ; final int len2 = toIndex2 - fromIndex2 ; if ( len1 != len2 ) { return false ; } for ( int i = 0 ; i < len1 ; ++ i ) { if ( s1 . c...
public class MetamodelImpl { /** * Returns entity attribute for given managed entity class . * @ param clazz * Entity class * @ param fieldName * field name * @ return entity attribute */ public Attribute getEntityAttribute ( Class clazz , String fieldName ) { } }
if ( entityTypes != null && entityTypes . containsKey ( clazz ) ) { EntityType entityType = entityTypes . get ( clazz ) ; return entityType . getAttribute ( fieldName ) ; } throw new IllegalArgumentException ( "No entity found: " + clazz ) ;
public class CmsToolBar { /** * Refreshes the user drop down . < p > */ public void refreshUserInfoDropDown ( ) { } }
Component oldVersion = m_userDropDown ; m_userDropDown = createUserInfoDropDown ( ) ; m_itemsRight . replaceComponent ( oldVersion , m_userDropDown ) ;
public class JSONHelper { /** * This method parses the skip token from a json formatted string . * @ param jsonData * The JSON Formatted String . * @ return The skipToken . * @ throws Exception */ public static String fetchNextSkiptoken ( JSONObject jsonObject ) throws Exception { } }
String skipToken = "" ; // Parse the skip token out of the string . skipToken = jsonObject . optJSONObject ( "responseMsg" ) . optString ( "odata.nextLink" ) ; if ( ! skipToken . equalsIgnoreCase ( "" ) ) { // Remove the unnecessary prefix from the skip token . int index = skipToken . indexOf ( "$skiptoken=" ) + ( new ...
public class BaseConfiguration { /** * { @ inheritDoc } * @ see jcifs . Configuration # isAllowCompound ( java . lang . String ) */ @ Override public boolean isAllowCompound ( String command ) { } }
if ( this . disallowCompound == null ) { return true ; } return ! this . disallowCompound . contains ( command ) ;
public class VdmRefreshAction { /** * ( non - Javadoc ) * @ see * org . eclipse . ui . navigator . CommonActionProvider # init ( org . eclipse . ui . navigator . ICommonActionExtensionSite ) */ @ Override public void init ( ICommonActionExtensionSite aSite ) { } }
super . init ( aSite ) ; shell = aSite . getViewSite ( ) . getShell ( ) ; makeActions ( ) ;
public class CATAsynchReadAheadReader { /** * This method is called by the core API when a message is available . * Here , we must send the message back to the client and keep track of * how many bytes we have sent . * Pacing works by the read ahead consumer on the server ( us ) sending * messages to the server...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "consumeMessages" , vEnum ) ; if ( mainConsumer . getConversation ( ) . getConnectionReference ( ) . isClosed ( ) ) { // stop consumer to avoid infinite loop if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDeb...
public class Graph { /** * Restores the node annotations on the top of stack and pops stack . */ private static void popAnnotations ( Deque < GraphAnnotationState > stack ) { } }
for ( AnnotationState as : stack . pop ( ) ) { as . first . setAnnotation ( as . second ) ; }
public class ChemModelManipulator { /** * Get the total number of atoms inside an IChemModel . * @ param chemModel The IChemModel object . * @ return The number of Atom object inside . */ public static int getAtomCount ( IChemModel chemModel ) { } }
int count = 0 ; ICrystal crystal = chemModel . getCrystal ( ) ; if ( crystal != null ) { count += crystal . getAtomCount ( ) ; } IAtomContainerSet moleculeSet = chemModel . getMoleculeSet ( ) ; if ( moleculeSet != null ) { count += MoleculeSetManipulator . getAtomCount ( moleculeSet ) ; } IReactionSet reactionSet = che...
public class QueryImpl { /** * Returns true , if associated entity holds relational references ( e . g . @ OneToMany * etc . ) else false . * @ param m * entity metadata * @ return true , if holds relation else false */ private boolean isRelational ( EntityMetadata m ) { } }
// if related via join table OR contains relations . return m . isRelationViaJoinTable ( ) || ( m . getRelationNames ( ) != null && ( ! m . getRelationNames ( ) . isEmpty ( ) ) ) ;
public class HiveAvroORCQueryGenerator { /** * Escape the Hive nested field names . * @ param type Primitive or nested Hive type . * @ return Escaped Hive nested field . */ public static String escapeHiveType ( String type ) { } }
TypeInfo typeInfo = TypeInfoUtils . getTypeInfoFromTypeString ( type ) ; // Primitve if ( ObjectInspector . Category . PRIMITIVE . equals ( typeInfo . getCategory ( ) ) ) { return type ; } // List else if ( ObjectInspector . Category . LIST . equals ( typeInfo . getCategory ( ) ) ) { ListTypeInfo listTypeInfo = ( ListT...
public class XmlDocumentReader { /** * Parses XML to a W3C Document object with deactivated validation . * Equivalent to { @ link # parse ( String , boolean ) } with validation on . * @ param xml in string format * @ return Document of XML object . * @ throws IOException if an IO error occurs * @ throws SAXEx...
return parse ( xml , true ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcTaskTimeRecurring ( ) { } }
if ( ifcTaskTimeRecurringEClass == null ) { ifcTaskTimeRecurringEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 702 ) ; } return ifcTaskTimeRecurringEClass ;
public class SecurityDomainManager { /** * Converts a well - formed URI containing a hostname and port into * string which allows for lookups in the Security Domain table * @ param uri URI to convert * @ return A string with " host : port " concatenated * @ throws URISyntaxException */ public String formatKey (...
if ( uri == null ) { throw new URISyntaxException ( "" , "URI specified is null" ) ; } return formatKey ( uri . getHost ( ) , uri . getPort ( ) ) ;
public class PartitionedStepControllerImpl { /** * Today we know the PartitionedStepControllerImpl always runs in the JVM of the top - level job , and so * will be notified on the top - level stop . * Doing xJVM split - flow would be more complicated , since not only do we lose the single JVM for * the top - leve...
BatchStatus jobBatchStatus = runtimeWorkUnitExecution . getBatchStatus ( ) ; if ( jobBatchStatus . equals ( BatchStatus . STOPPING ) || jobBatchStatus . equals ( BatchStatus . STOPPED ) || jobBatchStatus . equals ( BatchStatus . FAILED ) ) { return true ; } return false ;
public class DBUtils { /** * 查找所有符合查找条件的记录 , 并包装成相应对象返回 , 传入的T类的定义必须符合JavaBean规范 。 * @ param clazz 需要查找的对象的所属类的一个类 ( Class ) * @ param sql 只能是SELECT语句 , SQL语句中的字段别名必须与T类里的相应属性相同 * @ param arg SQL语句中的参数占位符参数 * @ return 将所有符合条件的记录包装成相应对象 , 并返回所有对象的集合 , 若没有记录将返回一个空数组 */ public static < T > List < T > getList ( Cla...
Connection connection = JDBCUtils . getConnection ( ) ; List < T > list = null ; // 存放返回的集合对象 // 存放所有获取的记录的Map对象 List < Map < String , Object > > listProperties = new ArrayList < Map < String , Object > > ( ) ; PreparedStatement ps = null ; ResultSet result = null ; // 填充占位符 try { ps = connection . prepareStatement ( s...
public class RunScriptProcess { /** * Run Method . */ public void run ( ) { } }
String strID = null ; String strCode = this . getProperty ( CODE ) ; if ( ( strCode == null ) || ( strCode . length ( ) == 0 ) ) { strID = this . getProperty ( DBParams . ID ) ; if ( ( strID == null ) || ( strID . length ( ) == 0 ) ) return ; } Script recScript = ( Script ) this . getMainRecord ( ) ; if ( ( strCode == ...
public class RedundentExprEliminator { /** * Count the number of ancestors that a ElemTemplateElement has . * @ param elem An representation of an element in an XSLT stylesheet . * @ return The number of ancestors of elem ( including the element itself ) . */ protected int countAncestors ( ElemTemplateElement elem ...
int count = 0 ; while ( null != elem ) { count ++ ; elem = elem . getParentElem ( ) ; } return count ;
public class Announce { /** * Returns the current tracker client used for announces . */ public TrackerClient getCurrentTrackerClient ( AnnounceableInformation torrent ) { } }
final URI uri = getURIForTorrent ( torrent ) ; if ( uri == null ) return null ; return this . clients . get ( uri . toString ( ) ) ;
public class AkkaRpcActor { /** * Stop the actor immediately . */ private void stop ( RpcEndpointTerminationResult rpcEndpointTerminationResult ) { } }
if ( rpcEndpointStopped . compareAndSet ( false , true ) ) { this . rpcEndpointTerminationResult = rpcEndpointTerminationResult ; getContext ( ) . stop ( getSelf ( ) ) ; }
public class AbstractBiclustering { /** * Convert a bitset into integer column ids . * @ param cols * @ return integer column ids */ protected int [ ] colsBitsetToIDs ( long [ ] cols ) { } }
int [ ] colIDs = new int [ BitsUtil . cardinality ( cols ) ] ; int colsIndex = 0 ; for ( int cpos = 0 , clpos = 0 ; clpos < cols . length ; ++ clpos ) { long clong = cols [ clpos ] ; if ( clong == 0L ) { cpos += Long . SIZE ; continue ; } for ( int j = 0 ; j < Long . SIZE ; ++ j , ++ cpos , clong >>>= 1 ) { if ( ( clon...
public class WebFragmentTypeImpl { /** * If not already created , a new < code > locale - encoding - mapping - list < / code > element will be created and returned . * Otherwise , the first existing < code > locale - encoding - mapping - list < / code > element will be returned . * @ return the instance defined for...
List < Node > nodeList = childNode . get ( "locale-encoding-mapping-list" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LocaleEncodingMappingListTypeImpl < WebFragmentType < T > > ( this , "locale-encoding-mapping-list" , childNode , nodeList . get ( 0 ) ) ; } return createLocaleEncodingMappingLis...
public class RadialCounter { /** * < editor - fold defaultstate = " collapsed " desc = " Image related " > */ private BufferedImage create_TICKMARKS_Image ( final int WIDTH ) { } }
if ( WIDTH <= 0 ) { return null ; } final BufferedImage IMAGE = UTIL . createImage ( WIDTH , WIDTH , Transparency . TRANSLUCENT ) ; final Graphics2D G2 = IMAGE . createGraphics ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; G2 . setRenderingHint ( RenderingHint...
public class ModelsImpl { /** * Gets all custom prebuilt models information of this application . * @ param appId The application ID . * @ param versionId The version ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ErrorResponseException thrown if the request is reje...
return listCustomPrebuiltModelsWithServiceResponseAsync ( appId , versionId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class WSJobOperatorImpl { /** * Trace job xml file . . */ protected void traceJobXML ( String jobXML ) { } }
if ( logger . isLoggable ( Level . FINE ) ) { int concatLen = jobXML . length ( ) > 200 ? 200 : jobXML . length ( ) ; logger . fine ( "Starting job: " + jobXML . substring ( 0 , concatLen ) + "... truncated ..." ) ; }
public class XmlProcessor { /** * Sets the original xml that should be sorted . Builds a dom document of the * xml . * @ param originalXml the new original xml * @ throws org . jdom . JDOMException the jDOM exception * @ throws java . io . IOException Signals that an I / O exception has occurred . */ public voi...
SAXBuilder parser = new SAXBuilder ( ) ; originalDocument = parser . build ( originalXml ) ;
public class WebPage { /** * Gets the < code > WebPage < / code > that follows this one in the parents * list of pages . * @ return the < code > WebPage < / code > or < code > null < / code > if not found */ final public WebPage getNextPage ( WebSiteRequest req ) throws IOException , SQLException { } }
WebPage parent = getParent ( ) ; if ( parent != null ) { WebPage [ ] myPages = parent . getCachedPages ( req ) ; int len = myPages . length ; for ( int c = 0 ; c < len ; c ++ ) { if ( myPages [ c ] . getClass ( ) == getClass ( ) ) { if ( c < ( len - 1 ) ) return myPages [ c + 1 ] ; return null ; } } } return null ;
public class RequestStatics { /** * Returns the name of the JSON property pretty printed . That is spaces * instead of underscores and capital first letter . * @ param name * @ return */ public static String JSON2HTML ( String name ) { } }
if ( name . length ( ) < 1 ) return name ; if ( name == "row" ) { return name . substring ( 0 , 1 ) . toUpperCase ( ) + name . replace ( "_" , " " ) . substring ( 1 ) ; } return name . substring ( 0 , 1 ) + name . replace ( "_" , " " ) . substring ( 1 ) ;
public class TrueTypeFont { /** * The information in the maps of the table ' cmap ' is coded in several formats . * Format 0 is the Apple standard character to glyph index mapping table . * @ return a < CODE > HashMap < / CODE > representing this map * @ throws IOException the font file could not be read */ HashM...
HashMap h = new HashMap ( ) ; rf . skipBytes ( 4 ) ; for ( int k = 0 ; k < 256 ; ++ k ) { int r [ ] = new int [ 2 ] ; r [ 0 ] = rf . readUnsignedByte ( ) ; r [ 1 ] = getGlyphWidth ( r [ 0 ] ) ; h . put ( Integer . valueOf ( k ) , r ) ; } return h ;
public class PeerEurekaNode { /** * Delete instance status override . * @ param appName * the application name of the instance . * @ param id * the unique identifier of the instance . * @ param info * the instance information of the instance . */ public void deleteStatusOverride ( final String appName , fin...
long expiryTime = System . currentTimeMillis ( ) + maxProcessingDelayMs ; batchingDispatcher . process ( taskId ( "deleteStatusOverride" , appName , id ) , new InstanceReplicationTask ( targetHost , Action . DeleteStatusOverride , info , null , false ) { @ Override public EurekaHttpResponse < Void > execute ( ) { retur...
public class FormatTag { /** * Method called at end of Tag * @ return EVAL _ PAGE */ @ Override public final int doEndTag ( ) throws JspException { } }
String date_formatted = default_text ; if ( output_date != null ) { // Get the pattern to use SimpleDateFormat sdf ; String pat = pattern ; if ( pat == null && patternid != null ) { Object attr = pageContext . findAttribute ( patternid ) ; if ( attr != null ) pat = attr . toString ( ) ; } if ( pat == null ) { sdf = new...
public class MongoCollectionRemover { /** * Convenience function */ public static void removeAnnotations ( String [ ] conn , String ... annotationsToDelete ) throws UIMAException , IOException { } }
CollectionReader cr = createReader ( MongoCollectionRemover . class , PARAM_DB_CONNECTION , conn , PARAM_DELETE_ANNOTATIONS , annotationsToDelete ) ; AnalysisEngine noAE = AnalysisEngineFactory . createEngine ( StatsAnnotatorPlus . class ) ; SimplePipeline . runPipeline ( cr , noAE ) ; LOG . debug ( "done removing anno...
public class BenchmarkMethod { /** * Checks if this method is executable via reflection for perfidix purposes . * That means that the method has no parameters ( except for , no * return - value , is non - static , is public and throws no exceptions . * @ param meth * method to be checked * @ param anno * an...
boolean returnVal = true ; // Check if DataProvider is valid if set . if ( anno . equals ( DataProvider . class ) && ! meth . getReturnType ( ) . isAssignableFrom ( Object [ ] [ ] . class ) ) { returnVal = false ; } // for all other methods , the return type must be void if ( ! anno . equals ( DataProvider . class ) &&...
public class ExecutionEngine { /** * Execute a large block task synchronously . Log errors if they occur . * Return true if successful and false otherwise . */ protected boolean executeLargeBlockTaskSynchronously ( LargeBlockTask task ) { } }
LargeBlockManager lbm = LargeBlockManager . getInstance ( ) ; assert ( lbm != null ) ; LargeBlockResponse response = null ; try { // The call to get ( ) will block until the task completes . response = lbm . submitTask ( task ) . get ( ) ; } catch ( RejectedExecutionException ree ) { LOG . error ( "Could not queue larg...
public class TransactionSnippets { /** * [ VARIABLE " my _ key _ name2 " ] */ public void multiplePutEntities ( String keyName1 , String keyName2 ) { } }
Datastore datastore = transaction . getDatastore ( ) ; // [ START multiplePutEntities ] Key key1 = datastore . newKeyFactory ( ) . setKind ( "MyKind" ) . newKey ( keyName1 ) ; Entity . Builder entityBuilder1 = Entity . newBuilder ( key1 ) ; entityBuilder1 . set ( "propertyName" , "value1" ) ; Entity entity1 = entityBui...
public class Command { /** * Creates a command line from the current configuration . * The command line is represented as a string list . * The options are filtered by the specified list . * @ param filterOptions * the options contained in the result if they are set . * @ return * the command line . */ publ...
List < String > list = new ArrayList < String > ( ) ; list . add ( getExecutable ( ) ) ; for ( String opt : filterOptions ) { if ( isOptionSet ( opt ) ) { list . add ( opt ) ; final String value = getOption ( opt ) ; if ( value != NO_OPTION_VALUE ) { list . add ( value ) ; } } } return list ;
public class ModuleXmlReader { /** * Parse the module . xml file . * @ param moduleXml The file to parse * @ return Module representation * @ throws Exception In case of parsing error */ protected static Module parse ( final File moduleXml ) throws Exception { } }
InputStream is = new FileInputStream ( moduleXml ) ; try { Document document = parseXml ( is ) ; Element root = document . getDocumentElement ( ) ; ModuleIdentifier main = getModuleIdentifier ( root ) ; Module module = new Module ( main ) ; Element dependencies = getChildElement ( root , "dependencies" ) ; if ( depende...
public class EmbeddedIntrospector { /** * Introspects the given embedded field and returns its metadata . * @ param field * the embedded field to introspect * @ param entityMetadata * metadata of the owning entity * @ return the metadata of the embedded field */ public static EmbeddedMetadata introspect ( Emb...
EmbeddedIntrospector introspector = new EmbeddedIntrospector ( field , entityMetadata ) ; introspector . process ( ) ; return introspector . metadata ;
public class EJBJavaColonNamingHelper { /** * can suppress warning - if cmd is null NamingException will be thrown by getComponentMetaData */ @ Override public boolean hasObjectWithPrefix ( JavaColonNamespace namespace , String name ) throws NamingException { } }
JavaColonNamespaceBindings < EJBBinding > bindings ; boolean result = false ; Lock readLock = null ; ComponentMetaData cmd = null ; try { // This helper only provides support for java : global , java : app , and java : module if ( namespace == JavaColonNamespace . GLOBAL ) { // Called to ensure that the java : global c...
public class Configuration { /** * Parse the given attribute as a set of integer ranges . * @ param name the attribute name * @ throws NullPointerException if the configuration property does not exist * @ return a new set of ranges from the configured value */ public IntegerRanges getRange ( String name ) { } }
String valueString = get ( name ) ; Preconditions . checkNotNull ( valueString ) ; return new IntegerRanges ( valueString ) ;
public class R2RMLManager { /** * This method return the list of mappings from the Model main method to be * called , assembles everything * @ param myModel - the Model structure containing mappings * @ return ArrayList < OBDAMappingAxiom > - list of mapping axioms read from the Model */ public ImmutableList < SQ...
List < SQLPPTriplesMap > mappings = new ArrayList < SQLPPTriplesMap > ( ) ; // retrieve the TriplesMap nodes Collection < TriplesMap > tripleMaps = r2rmlParser . getMappingNodes ( myModel ) ; for ( TriplesMap tm : tripleMaps ) { // for each node get a mapping SQLPPTriplesMap mapping ; try { mapping = getMapping ( tm ) ...
public class KeysAndAttributes { /** * The primary key attribute values that define the items and the attributes associated with the items . * @ param keys * The primary key attribute values that define the items and the attributes associated with the items . * @ return Returns a reference to this object so that ...
setKeys ( keys ) ; return this ;
public class LogHandle { /** * Private method to read the records stored in the active log file back into memory . This * method should only be called from the LogHandle . openLog method . Once loaded , these * records can be accessed through the LogHandle . recoveredRecords method . * @ return ArrayList An array...
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "readRecords" , this ) ; // Check that the file is actually open if ( _activeFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "readRecords" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } ArrayList < ReadableLogRecord > records = ...
public class NaaccrXmlUtils { /** * Returns a generic reader for the provided file , taking care of the optional GZ compression . * @ param file file to create the reader from , cannot be null * @ return a generic reader to the file , never null * @ throws NaaccrIOException if the reader cannot be created */ publ...
InputStream is = null ; try { is = new FileInputStream ( file ) ; if ( file . getName ( ) . endsWith ( ".gz" ) ) is = new GZIPInputStream ( is ) ; return new InputStreamReader ( is , StandardCharsets . UTF_8 ) ; } catch ( IOException e ) { if ( is != null ) { try { is . close ( ) ; } catch ( IOException e1 ) { // give ...
public class EntryViewBase { /** * The date control where the entry view is shown . * @ return the date control */ public final ReadOnlyObjectProperty < T > dateControlProperty ( ) { } }
if ( dateControl == null ) { dateControl = new ReadOnlyObjectWrapper < > ( this , "dateControl" , _dateControl ) ; // $ NON - NLS - 1 $ } return dateControl . getReadOnlyProperty ( ) ;
public class PixelMath { /** * Bounds image pixels to be between these two values * @ param img Image * @ param min minimum value . * @ param max maximum value . */ public static void boundImage ( GrayS64 img , long min , long max ) { } }
ImplPixelMath . boundImage ( img , min , max ) ;
public class dnsnsecrec { /** * Use this API to fetch dnsnsecrec resource of given name . */ public static dnsnsecrec get ( nitro_service service , String hostname ) throws Exception { } }
dnsnsecrec obj = new dnsnsecrec ( ) ; obj . set_hostname ( hostname ) ; dnsnsecrec response = ( dnsnsecrec ) obj . get_resource ( service ) ; return response ;
public class CopyState { /** * Asserts that there are no pending listeners . * < p > This can be useful in a test environment to ensure that the copy worked correctly . N . B . it * is possible for a copy to be ' correct ' and for not all listeners to fire , this is common when * copying small parts of the AST ( ...
for ( Map . Entry < Object , Object > entry : mappings . entrySet ( ) ) { if ( entry . getValue ( ) instanceof Listener ) { throw new IllegalStateException ( "Listener for " + entry . getKey ( ) + " never fired: " + entry . getValue ( ) ) ; } }
public class AbstractResultSetWrapper { /** * { @ inheritDoc } * @ see java . sql . ResultSet # getTime ( int , java . util . Calendar ) */ @ Override public Time getTime ( final int columnIndex , final Calendar cal ) throws SQLException { } }
return wrapped . getTime ( columnIndex , cal ) ;