signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LetterSegmenter { /** * / * ( non - Javadoc ) * @ see org . wltea . analyzer . core . ISegmenter # analyze ( org . wltea . analyzer . core . AnalyzeContext ) */ public void analyze ( AnalyzeContext context ) { } }
boolean bufferLockFlag = false ; // 处理英文字母 bufferLockFlag = this . processEnglishLetter ( context ) || bufferLockFlag ; // 处理阿拉伯字母 bufferLockFlag = this . processArabicLetter ( context ) || bufferLockFlag ; // 处理混合字母 bufferLockFlag = this . processMixLetter ( context ) || bufferLockFlag ; // 判断是否锁定缓冲区 if ( bufferLockFlag ) { context . lockBuffer ( SEGMENTER_NAME ) ; } else { // 对缓冲区解锁 context . unlockBuffer ( SEGMENTER_NAME ) ; }
public class DateUtils { /** * Returns a Java representation of a Facebook " short " { @ code date } string . * @ param date * Facebook { @ code date } string . * @ return Java date representation of the given Facebook " short " { @ code date } string or { @ code null } if { @ code date } * is { @ code null } or invalid . */ public static Date toDateFromShortFormat ( String date ) { } }
if ( date == null ) { return null ; } Date parsedDate = toDateWithFormatString ( date , FACEBOOK_SHORT_DATE_FORMAT ) ; // Fall back to variant if initial parse fails if ( parsedDate == null ) { parsedDate = toDateWithFormatString ( date , FACEBOOK_ALTERNATE_SHORT_DATE_FORMAT ) ; } return parsedDate ;
public class CPSpecificationOptionUtil { /** * Returns the first cp specification option in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp specification option , or < code > null < / code > if a matching cp specification option could not be found */ public static CPSpecificationOption fetchByUuid_C_First ( String uuid , long companyId , OrderByComparator < CPSpecificationOption > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ;
public class WorkspaceCache { /** * Signal that changes have been made to the persisted data . Related information in the cache is cleared , and this workspace ' s * listener is notified of the changes . * @ param changes the changes to be made ; may not be null */ public void changed ( ChangeSet changes ) { } }
checkNotClosed ( ) ; if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( "Cache for workspace '{0}' received {1} changes from local sessions: {2}" , workspaceName , changes . size ( ) , changes ) ; } // Clear this workspace ' s cached nodes ( iteratively is okay since it ' s a ConcurrentMap ) . . . for ( NodeKey key : changes . changedNodes ( ) ) { if ( closed ) break ; nodesByKey . remove ( key ) ; } // Send the changes to the change bus so that others can see them . . . if ( changeBus != null ) changeBus . notify ( changes ) ;
public class LocalBufferPool { private void returnMemorySegment ( MemorySegment segment ) { } }
assert Thread . holdsLock ( availableMemorySegments ) ; numberOfRequestedMemorySegments -- ; networkBufferPool . recycle ( segment ) ;
public class CmsFlexCacheClearDialog { /** * Returns a list with the possible modes for the clean action . < p > * @ return a list with the possible modes for the clean action */ private List getModes ( ) { } }
ArrayList ret = new ArrayList ( ) ; ret . add ( new CmsSelectWidgetOption ( MODE_VARIATIONS , getMode ( ) . equals ( MODE_VARIATIONS ) , key ( Messages . GUI_FLEXCACHE_CLEAN_MODE_VARIATIONS_0 ) ) ) ; ret . add ( new CmsSelectWidgetOption ( MODE_ALL , getMode ( ) . equals ( MODE_ALL ) , key ( Messages . GUI_FLEXCACHE_CLEAN_MODE_ALL_0 ) ) ) ; return ret ;
public class Table { /** * Select records from database table using < I > obj < / I > object as template . * @ param obj example object for search : selected objects should match all * non - null fields . */ public final Cursor < T > queryByExample ( Connection conn , T obj ) { } }
return new Cursor < T > ( this , conn , obj , null , false ) ;
public class LoadProperties { /** * Copy the loaded properties into a map . */ public void into ( Map < String , String > map ) { } }
for ( String name : properties . stringPropertyNames ( ) ) { map . put ( name , properties . getProperty ( name ) ) ; }
public class DirRecord { /** * Add the attribute value to the table . If an attribute already exists * add it to the end of its values . * @ param attr String attribute name * @ param val Object value * @ throws NamingException */ public void addAttr ( String attr , Object val ) throws NamingException { } }
// System . out . println ( " addAttr " + attr ) ; Attribute a = findAttr ( attr ) ; if ( a == null ) { setAttr ( attr , val ) ; } else { a . add ( val ) ; }
public class GetReconciliationReportForLastBillingPeriod { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session ) throws RemoteException { } }
ReconciliationReportServiceInterface reconciliationReportService = adManagerServices . get ( session , ReconciliationReportServiceInterface . class ) ; // Get the NetworkService . NetworkServiceInterface networkService = adManagerServices . get ( session , NetworkServiceInterface . class ) ; // Get the first day of last month in your network ' s time zone . Network network = networkService . getCurrentNetwork ( ) ; DateTime lastMonth = new DateTime ( DateTimeZone . forID ( network . getTimeZone ( ) ) ) . minusMonths ( 1 ) . dayOfMonth ( ) . withMinimumValue ( ) ; // Create a statement to select reconciliation reports . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "startDate = :startDate" ) . orderBy ( "id ASC" ) . limit ( 1 ) . withBindVariableValue ( "startDate" , lastMonth . toString ( "YYYY-MM-dd" ) ) ; // Get the reconciliation report . ReconciliationReportPage page = reconciliationReportService . getReconciliationReportsByStatement ( statementBuilder . toStatement ( ) ) ; int totalResultSetSize = 0 ; if ( page . getResults ( ) != null ) { // Print out some information for each reconciliation report . totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( ReconciliationReport reconciliationReport : page . getResults ( ) ) { System . out . printf ( "%d) Reconciliation report with ID %d and start date '%s' was found.%n" , i ++ , reconciliationReport . getId ( ) , reconciliationReport . getStartDate ( ) ) ; } } System . out . printf ( "Number of results found: %d%n" , totalResultSetSize ) ;
public class Descriptors { /** * Creates a new named { @ link Descriptor } instance . If the name specified is null , the default name for this type * will be assigned . * @ param < T > * @ param type * @ param descriptorName * the descriptor name * @ return * @ throws IllegalArgumentException * If the type is not specified */ public static < T extends Descriptor > T create ( final Class < T > type , final String descriptorName ) throws IllegalArgumentException { } }
// Precondition checks if ( type == null ) { throw new IllegalArgumentException ( "type must be specified" ) ; } // Create return DescriptorInstantiator . createFromUserView ( type , descriptorName ) ;
public class DeleteRunRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteRunRequest deleteRunRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteRunRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteRunRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class TagletManager { /** * Check the taglet to see if it is a legacy taglet . Also * check its name for errors . */ private void checkTaglet ( Object taglet ) { } }
if ( taglet instanceof Taglet ) { checkTagName ( ( ( Taglet ) taglet ) . getName ( ) ) ; } else if ( taglet instanceof com . sun . tools . doclets . Taglet ) { com . sun . tools . doclets . Taglet legacyTaglet = ( com . sun . tools . doclets . Taglet ) taglet ; customTags . remove ( legacyTaglet . getName ( ) ) ; customTags . put ( legacyTaglet . getName ( ) , new LegacyTaglet ( legacyTaglet ) ) ; checkTagName ( legacyTaglet . getName ( ) ) ; } else { throw new IllegalArgumentException ( "Given object is not a taglet." ) ; }
public class BaseDriftDetector { /** * Returns a new list containing up to { @ link # getMaxHistory ( ) } objects in * the history that drifted away from the prior state of the model . < br > * The 0 index in the list will be the most recently added item , and the * largest index will be the oldest item . * @ return the list of objects that make up the effected history */ public List < V > getDriftedHistory ( ) { } }
int historyToGram = Math . min ( time - driftStart , history . size ( ) ) ; ArrayList < V > histList = new ArrayList < V > ( historyToGram ) ; Iterator < V > histIter = history . descendingIterator ( ) ; while ( histIter . hasNext ( ) && historyToGram > 0 ) { historyToGram -- ; histList . add ( histIter . next ( ) ) ; } return histList ;
public class HandlerEntityRequest { /** * < p > Handle request . * actions that change database use read _ commited TI * this usually required only for complex transactions like loading * or withdrawal warehouse ( receipt or issue ) . * WHandlerAndJsp requires handle NULL request , so if parameter * " nmEnt " is null then do nothing . * @ param pRqVs Request scoped variables * @ param pRqDt Request Data * @ throws Exception - an exception */ @ Override public final void handle ( final Map < String , Object > pRqVs , final IRequestData pRqDt ) throws Exception { } }
String nmEnt = pRqDt . getParameter ( "nmEnt" ) ; if ( nmEnt == null ) { // WHandlerAndJsp requires handle NULL request : return ; } Class < ? > entityClass = this . entitiesMap . get ( nmEnt ) ; if ( entityClass == null ) { this . secureLogger . error ( null , HandlerEntityRequest . class , "Trying to work with forbidden entity/host/addr/port/user: " + nmEnt + "/" + pRqDt . getRemoteHost ( ) + "/" + pRqDt . getRemoteAddr ( ) + "/" + pRqDt . getRemotePort ( ) + "/" + pRqDt . getUserName ( ) ) ; throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Forbidden!" ) ; } if ( this . delegateSt != null ) { this . delegateSt . makeWith ( pRqVs , pRqDt ) ; } boolean isDbgSh = this . logger . getDbgSh ( this . getClass ( ) ) && this . logger . getDbgFl ( ) < 5003 && this . logger . getDbgCl ( ) > 5006 ; String [ ] actionsArr = pRqDt . getParameter ( "nmsAct" ) . split ( "," ) ; for ( String actionNm : actionsArr ) { if ( isDbgSh ) { this . logger . debug ( pRqVs , HandlerEntityRequest . class , "Action: " + actionNm ) ; } } if ( this . wrReSpTr && ( "entityFolSave" . equals ( actionsArr [ 0 ] ) || "entitySave" . equals ( actionsArr [ 0 ] ) || "entityDelete" . equals ( actionsArr [ 0 ] ) || "entityFolDelete" . equals ( actionsArr [ 0 ] ) ) ) { IHasId < ? > entity = null ; try { this . srvDatabase . setIsAutocommit ( false ) ; this . srvDatabase . setTransactionIsolation ( this . writeTi ) ; this . srvDatabase . beginTransaction ( ) ; @ SuppressWarnings ( "unchecked" ) IFactorySimple < IHasId < ? > > entFac = ( IFactorySimple < IHasId < ? > > ) this . entitiesFactoriesFatory . lazyGet ( pRqVs , entityClass ) ; entity = entFac . create ( pRqVs ) ; this . fillEntityFromReq . fill ( pRqVs , entity , pRqDt ) ; String entProcNm = this . entitiesProcessorsNamesHolder . getFor ( entityClass , actionsArr [ 0 ] ) ; if ( entProcNm == null ) { this . secureLogger . error ( null , HandlerEntityRequest . class , "Trying to work with forbidden entity/action/user: " + nmEnt + "/" + actionsArr [ 0 ] + "/" + pRqDt . getUserName ( ) ) ; throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Forbidden!" ) ; } @ SuppressWarnings ( "unchecked" ) IEntityProcessor < IHasId < ? > , ? > ep = ( IEntityProcessor < IHasId < ? > , ? > ) this . entitiesProcessorsFactory . lazyGet ( pRqVs , entProcNm ) ; if ( isDbgSh ) { this . logger . debug ( pRqVs , HandlerEntityRequest . class , "CHANGING transaction use entProcNm/IEntityProcessor: " + entProcNm + "/" + ep . getClass ( ) ) ; } entity = ep . process ( pRqVs , entity , pRqDt ) ; this . srvDatabase . commitTransaction ( ) ; } catch ( Exception ex ) { this . srvDatabase . rollBackTransaction ( ) ; throw ex ; } finally { this . srvDatabase . releaseResources ( ) ; } if ( actionsArr . length > 1 ) { // reading phase : try { this . srvDatabase . setIsAutocommit ( false ) ; this . srvDatabase . setTransactionIsolation ( this . readTi ) ; this . srvDatabase . beginTransaction ( ) ; for ( int i = 1 ; i < actionsArr . length ; i ++ ) { String actionNm = actionsArr [ i ] ; if ( actionNm . startsWith ( "entity" ) ) { if ( entity == null ) { // it ' s may be change entity to owner : entity = ( IHasId < ? > ) pRqVs . get ( "nextEntity" ) ; if ( entity == null ) { throw new ExceptionWithCode ( ExceptionWithCode . WRONG_PARAMETER , "wrong_request_entity_not_filled" ) ; } entityClass = entity . getClass ( ) ; } String entProcNm = this . entitiesProcessorsNamesHolder . getFor ( entityClass , actionNm ) ; if ( entProcNm == null ) { this . secureLogger . error ( null , HandlerEntityRequest . class , "Trying to work with forbidden entity/action/user: " + nmEnt + "/" + actionNm + "/" + pRqDt . getUserName ( ) ) ; throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Forbidden!" ) ; } @ SuppressWarnings ( "unchecked" ) IEntityProcessor < IHasId < ? > , ? > ep = ( IEntityProcessor < IHasId < ? > , ? > ) this . entitiesProcessorsFactory . lazyGet ( pRqVs , entProcNm ) ; if ( isDbgSh ) { this . logger . debug ( pRqVs , HandlerEntityRequest . class , "It's used entProcNm/IEntityProcessor: " + entProcNm + "/" + ep . getClass ( ) ) ; } entity = ep . process ( pRqVs , entity , pRqDt ) ; } else { // else actions like " list " ( page ) String procNm = this . processorsNamesHolder . getFor ( entityClass , actionNm ) ; if ( procNm == null ) { this . secureLogger . error ( null , HandlerEntityRequest . class , "Trying to work with forbidden entity/action/user: " + nmEnt + "/" + actionNm + "/" + pRqDt . getUserName ( ) ) ; throw new ExceptionWithCode ( ExceptionWithCode . FORBIDDEN , "Forbidden!" ) ; } IProcessor proc = this . processorsFactory . lazyGet ( pRqVs , procNm ) ; if ( isDbgSh ) { this . logger . debug ( pRqVs , HandlerEntityRequest . class , "It's used procNm/IProcessor: " + procNm + "/" + proc . getClass ( ) ) ; } proc . process ( pRqVs , pRqDt ) ; } } this . srvDatabase . commitTransaction ( ) ; } catch ( Exception ex ) { this . srvDatabase . rollBackTransaction ( ) ; throw ex ; } finally { this . srvDatabase . releaseResources ( ) ; } } } else { handleNoChangeIsolation ( pRqVs , pRqDt , entityClass , actionsArr , isDbgSh , nmEnt ) ; }
public class FlipView { /** * draw top / left half shadow * @ param canvas */ private void drawPreviousShadow ( Canvas canvas ) { } }
final float degreesFlipped = getDegreesFlipped ( ) ; if ( degreesFlipped > 90 ) { final int alpha = ( int ) ( ( ( degreesFlipped - 90 ) / 90f ) * MAX_SHADOW_ALPHA ) ; mShadowPaint . setAlpha ( alpha ) ; canvas . drawPaint ( mShadowPaint ) ; }
public class ORMapping { /** * 獲取某字段對應的get方法 * @ param column */ public Method getSetter ( String column ) { } }
MappingItem methods = getMethodPair ( column ) ; return methods == null ? null : methods . getSetter ( ) ;
public class techsupport { /** * Use this API to fetch filtered set of techsupport resources . * set the filter parameter values in filtervalue object . */ public static techsupport [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } }
techsupport obj = new techsupport ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; techsupport [ ] response = ( techsupport [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class UpdateBuilder { /** * Removes all values in ' fields ' that are not specified in ' fieldMask ' . */ private Map < FieldPath , Object > applyFieldMask ( Map < String , Object > fields , List < FieldPath > fieldMask ) { } }
List < FieldPath > remainingFields = new ArrayList < > ( fieldMask ) ; Map < FieldPath , Object > filteredData = applyFieldMask ( fields , remainingFields , FieldPath . empty ( ) ) ; if ( ! remainingFields . isEmpty ( ) ) { throw new IllegalArgumentException ( String . format ( "Field masks contains invalid path. No data exist at field '%s'." , remainingFields . get ( 0 ) ) ) ; } return filteredData ;
public class WSContextFactory { /** * called by DS to activate this component */ protected void activate ( ComponentContext cc ) { } }
Bundle usingBundle = cc . getUsingBundle ( ) ; userContext = usingBundle . getBundleContext ( ) ;
public class PagingHelper { /** * Return a single page of the list with the given paging parameters . * @ param list * @ param pageSize * @ param page * @ return subList */ public static < T > List < T > subList ( final List < T > list , int pageSize , int page ) { } }
if ( pageSize <= 0 || page == 0 ) { return Collections . EMPTY_LIST ; } int size = list . size ( ) ; int fromIndex = page > 0 ? ( page - 1 ) * pageSize : size + ( page * pageSize ) ; int toIndex = fromIndex + pageSize ; int finalFromIndex = Math . max ( 0 , fromIndex ) ; int finalToIndex = Math . min ( size , Math . max ( 0 , toIndex ) ) ; // prevent fromIndex to be greater than toIndex if ( finalFromIndex > finalToIndex ) { finalFromIndex = finalToIndex ; } try { return list . subList ( finalFromIndex , finalToIndex ) ; } catch ( Throwable t ) { logger . warn ( "Invalid range for sublist in paging, pageSize {}, page {}: {}" , new Object [ ] { pageSize , page , t . getMessage ( ) } ) ; } return Collections . EMPTY_LIST ;
public class Converter { /** * Convert a common namespace to a WS namespace . WS namespace will not have * its ID populated as it is not a { @ link KamStoreObject } * @ param ns * @ return */ public static Namespace convert ( final org . openbel . framework . common . model . Namespace ns ) { } }
Namespace ws = OBJECT_FACTORY . createNamespace ( ) ; ws . setPrefix ( ns . getPrefix ( ) ) ; ws . setResourceLocation ( ns . getResourceLocation ( ) ) ; return ws ;
public class XMLUtil { /** * Replies the long value that corresponds to the specified attribute ' s path . * < p > The path is an ordered list of tag ' s names and ended by the name of * the attribute . * Be careful about the fact that the names are case sensitives . * @ param document is the XML document to explore . * @ param defaultValue is the default value to reply . * @ param path is the list of and ended by the attribute ' s name . * @ return the long value of the specified attribute or < code > 0 < / code > . */ @ Pure public static Long getAttributeLongWithDefault ( Node document , Long defaultValue , String ... path ) { } }
assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeLongWithDefault ( document , true , defaultValue , path ) ;
public class GrpcStatus { /** * Maps GRPC status codes to http status , as defined in upstream grpc - gateway * < a href = " https : / / github . com / grpc - ecosystem / grpc - gateway / blob / master / third _ party / googleapis / google / rpc / code . proto " > code . proto < / a > . */ public static HttpStatus grpcCodeToHttpStatus ( Status . Code grpcStatusCode ) { } }
switch ( grpcStatusCode ) { case OK : return HttpStatus . OK ; case CANCELLED : return HttpStatus . CLIENT_CLOSED_REQUEST ; case UNKNOWN : case INTERNAL : case DATA_LOSS : return HttpStatus . INTERNAL_SERVER_ERROR ; case INVALID_ARGUMENT : case FAILED_PRECONDITION : case OUT_OF_RANGE : return HttpStatus . BAD_REQUEST ; case DEADLINE_EXCEEDED : return HttpStatus . GATEWAY_TIMEOUT ; case NOT_FOUND : return HttpStatus . NOT_FOUND ; case ALREADY_EXISTS : case ABORTED : return HttpStatus . CONFLICT ; case PERMISSION_DENIED : return HttpStatus . FORBIDDEN ; case UNAUTHENTICATED : return HttpStatus . UNAUTHORIZED ; case RESOURCE_EXHAUSTED : return HttpStatus . TOO_MANY_REQUESTS ; case UNIMPLEMENTED : return HttpStatus . NOT_IMPLEMENTED ; case UNAVAILABLE : return HttpStatus . SERVICE_UNAVAILABLE ; default : return HttpStatus . UNKNOWN ; }
public class CPDisplayLayoutLocalServiceWrapper { /** * Adds the cp display layout to the database . Also notifies the appropriate model listeners . * @ param cpDisplayLayout the cp display layout * @ return the cp display layout that was added */ @ Override public com . liferay . commerce . product . model . CPDisplayLayout addCPDisplayLayout ( com . liferay . commerce . product . model . CPDisplayLayout cpDisplayLayout ) { } }
return _cpDisplayLayoutLocalService . addCPDisplayLayout ( cpDisplayLayout ) ;
public class AbstractDataServlet { /** * - - - - - protected methods - - - - - */ protected void commitResponse ( final SecurityContext securityContext , final HttpServletRequest request , final HttpServletResponse response , final RestMethodResult result , final boolean wrapSingleResultInArray ) { } }
final String outputDepthSrc = request . getParameter ( REQUEST_PARAMTER_OUTPUT_DEPTH ) ; final int outputDepth = Services . parseInt ( outputDepthSrc , config . getOutputNestingDepth ( ) ) ; final String baseUrl = request . getRequestURI ( ) ; final Map < String , String > headers = result . getHeaders ( ) ; // set headers for ( final Entry < String , String > header : headers . entrySet ( ) ) { response . setHeader ( header . getKey ( ) , header . getValue ( ) ) ; } // set response code response . setStatus ( result . getResponseCode ( ) ) ; try { final List < Object > content = result . getContent ( ) ; if ( content != null ) { writeJson ( securityContext , response , new PagingIterable ( content ) , baseUrl , outputDepth , wrapSingleResultInArray ) ; } else { final String message = result . getMessage ( ) ; if ( message != null ) { writeStatus ( response , result . getResponseCode ( ) , message ) ; } else { final Object nonGraphObjectResult = result . getNonGraphObjectResult ( ) ; writeJson ( securityContext , response , new PagingIterable ( Arrays . asList ( nonGraphObjectResult ) ) , baseUrl , outputDepth , wrapSingleResultInArray ) ; } } } catch ( JsonIOException | IOException t ) { logger . warn ( "Unable to commit HttpServletResponse" , t ) ; }
public class FileUtils { /** * Just like { @ link Files # asCharSource ( java . io . File , java . nio . charset . Charset ) } , but decompresses * the incoming data using GZIP . */ public static CharSource asCompressedCharSource ( File f , Charset charSet ) throws IOException { } }
return asCompressedByteSource ( f ) . asCharSource ( charSet ) ;
public class StatsInstanceImpl { /** * Create instance under group ( same type ) */ public static StatsInstanceImpl createGroupInstance ( String name , StatsGroup igroup , ObjectName userProvidedMBeanObjectName , boolean bCreateDefaultMBean , StatisticActions actionLsnr ) throws StatsFactoryException { } }
StatsGroupImpl group = ( StatsGroupImpl ) igroup ; // construct path String [ ] parentPath = group . getPath ( ) ; String [ ] path = new String [ parentPath . length + 1 ] ; for ( int i = 0 ; i < parentPath . length ; i ++ ) { path [ i ] = parentPath [ i ] ; } path [ parentPath . length ] = name ; StatsInstanceImpl instance = new StatsInstanceImpl ( name , group . getModuleConfig ( ) , path , actionLsnr ) ; // instance . _ scListener = scl ; instance . _register ( userProvidedMBeanObjectName , bCreateDefaultMBean ) ; return instance ;
public class JKAbstractContext { /** * Sets the session map . * @ param sessionMap the session map */ public void setSessionMap ( final Map < String , Object > sessionMap ) { } }
JKThreadLocal . setValue ( JKContextConstants . HTTP_SESSION_MAP , sessionMap ) ;
public class CalendarPeriod { /** * false if not */ public boolean IsInside ( String pDate ) { } }
if ( periods == null ) { if ( days == null ) // security added to avoid null exception return false ; if ( days . getDay ( CalendarFunctions . date_get_day ( pDate ) ) . get ( ) > 0 ) return true ; return false ; } for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { Period period = periods . get ( i ) ; if ( period . getFrom ( ) . compareTo ( pDate ) > 0 ) return false ; if ( ( period . getFrom ( ) . compareTo ( pDate ) <= 0 ) && ( period . getTo ( ) . compareTo ( pDate ) >= 0 ) ) return true ; } return false ;
public class Batch { /** * create _ and _ buy */ public static Batch create_and_buy ( Map < String , Object > params ) throws EasyPostException { } }
return create_and_buy ( params , null ) ;
public class ExpandableRecyclerAdapter { /** * Calls through to the ParentViewHolder to expand views for each * RecyclerView the specified parent is a child of . * These calls to the ParentViewHolder are made so that animations can be * triggered at the ViewHolder level . * @ param flatParentPosition The index of the parent to expand */ @ SuppressWarnings ( "unchecked" ) @ UiThread private void expandViews ( @ NonNull ExpandableWrapper < P , C > parentWrapper , int flatParentPosition ) { } }
PVH viewHolder ; for ( RecyclerView recyclerView : mAttachedRecyclerViewPool ) { viewHolder = ( PVH ) recyclerView . findViewHolderForAdapterPosition ( flatParentPosition ) ; if ( viewHolder != null && ! viewHolder . isExpanded ( ) ) { viewHolder . setExpanded ( true ) ; viewHolder . onExpansionToggled ( false ) ; } } updateExpandedParent ( parentWrapper , flatParentPosition , false ) ;
public class CustomTopicXMLValidator { /** * Check to see if a Topic is a normal topic , instead of a Revision History or Legal Notice * @ param topic The topic to be checked . * @ return True if the topic is a normal topic , otherwise false . */ public static boolean isTopicANormalTopic ( final BaseTopicWrapper < ? > topic , final ServerSettingsWrapper serverSettings ) { } }
return ! ( topic . hasTag ( serverSettings . getEntities ( ) . getRevisionHistoryTagId ( ) ) || topic . hasTag ( serverSettings . getEntities ( ) . getLegalNoticeTagId ( ) ) || topic . hasTag ( serverSettings . getEntities ( ) . getAuthorGroupTagId ( ) ) || topic . hasTag ( serverSettings . getEntities ( ) . getInfoTagId ( ) ) || topic . hasTag ( serverSettings . getEntities ( ) . getAbstractTagId ( ) ) ) ;
public class AbstractCountBasedFeatureSelector { /** * { @ inheritDoc } */ @ Override protected Set < TypeInference . DataType > getSupportedYDataTypes ( ) { } }
return new HashSet < > ( Arrays . asList ( TypeInference . DataType . BOOLEAN , TypeInference . DataType . CATEGORICAL , TypeInference . DataType . ORDINAL ) ) ;
public class Analyzer { private void merge ( final int insn , final Frame < V > frame , final Subroutine subroutine ) throws AnalyzerException { } }
Frame < V > oldFrame = frames [ insn ] ; Subroutine oldSubroutine = subroutines [ insn ] ; boolean changes ; if ( oldFrame == null ) { frames [ insn ] = newFrame ( frame ) ; changes = true ; } else { changes = oldFrame . merge ( frame , interpreter ) ; } if ( oldSubroutine == null ) { if ( subroutine != null ) { subroutines [ insn ] = subroutine . copy ( ) ; changes = true ; } } else { if ( subroutine != null ) { changes |= oldSubroutine . merge ( subroutine ) ; } } if ( changes && ! queued [ insn ] ) { queued [ insn ] = true ; queue [ top ++ ] = insn ; }
public class EventBus { /** * Emit a event object with parameters and force all listeners to be called asynchronously . * @ param event * the target event * @ param args * the arguments passed in * @ see # emit ( EventObject , Object . . . ) */ public EventBus emitAsync ( EventObject event , Object ... args ) { } }
return _emitWithOnceBus ( eventContextAsync ( event , args ) ) ;
public class JDBMLookup { /** * Opens the index , for subsequent lookups . * @ throws IOException Thrown if an I / O related exception occurs while * creating or opening the record manager */ public synchronized void open ( ) throws IOException { } }
if ( tmap != null ) { return ; } final RecordManager rm = createRecordManager ( indexPath ) ; if ( valueSerializer == null ) { tmap = rm . treeMap ( IndexerConstants . INDEX_TREE_KEY ) ; } else { tmap = rm . treeMap ( IndexerConstants . INDEX_TREE_KEY , valueSerializer ) ; } if ( tmap . isEmpty ( ) ) { rm . close ( ) ; throw new IOException ( "tree map is empty" ) ; } invTmap = tmap . inverseHashView ( IndexerConstants . INVERSE_KEY ) ;
public class Job { /** * Returns the oldest build in the record . * @ see LazyBuildMixIn # getFirstBuild */ @ Exported @ QuickSilver public RunT getFirstBuild ( ) { } }
SortedMap < Integer , ? extends RunT > runs = _getRuns ( ) ; if ( runs . isEmpty ( ) ) return null ; return runs . get ( runs . lastKey ( ) ) ;
public class YearMonthDay { /** * Returns a copy of this date with the day of month field updated . * YearMonthDay is immutable , so there are no set methods . * Instead , this method returns a new instance with the value of * day of month changed . * @ param dayOfMonth the day of month to set * @ return a copy of this object with the field set * @ throws IllegalArgumentException if the value is invalid * @ since 1.3 */ public YearMonthDay withDayOfMonth ( int dayOfMonth ) { } }
int [ ] newValues = getValues ( ) ; newValues = getChronology ( ) . dayOfMonth ( ) . set ( this , DAY_OF_MONTH , newValues , dayOfMonth ) ; return new YearMonthDay ( this , newValues ) ;
public class ScaleSelect { /** * Make sure that the scale in the scale select is applied on the map , when the user presses the ' Enter ' key . * @ see com . smartgwt . client . widgets . form . fields . events . KeyPressHandler # onKeyPress * ( com . smartgwt . client . widgets . form . fields . events . KeyPressEvent ) */ public void onKeyPress ( KeyPressEvent event ) { } }
String name = event . getKeyName ( ) ; if ( KeyNames . ENTER . equals ( name ) ) { reorderValues ( ) ; }
public class Node { /** * Gets the ancestor node relative to this . * @ param level 0 = this , 1 = the parent , etc . */ @ Nullable public final Node getAncestor ( int level ) { } }
checkArgument ( level >= 0 ) ; Node node = this ; while ( node != null && level -- > 0 ) { node = node . getParent ( ) ; } return node ;
public class FessMessages { /** * Add the created action message for the key ' errors . could _ not _ open _ on _ system ' with parameters . * < pre > * message : Could not open { 0 } . & lt ; br / & gt ; Please check if the file is associated with an application . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ param arg0 The parameter arg0 for message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsCouldNotOpenOnSystem ( String property , String arg0 ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_could_not_open_on_system , arg0 ) ) ; return this ;
public class RelatedTablesCoreExtension { /** * Determine if has one or more relations matching the non null provided * values * @ param baseTable * base table name * @ param baseColumn * base primary column name * @ param relatedTable * related table name * @ param relatedColumn * related primary column name * @ param relation * relation name * @ param mappingTable * mapping table name * @ return true if has relations * @ throws SQLException * upon failure * @ since 3.2.0 */ public boolean hasRelations ( String baseTable , String baseColumn , String relatedTable , String relatedColumn , String relation , String mappingTable ) throws SQLException { } }
return ! getRelations ( baseTable , baseColumn , relatedTable , relatedColumn , relation , mappingTable ) . isEmpty ( ) ;
public class SendRedirect { public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } }
response . setContentType ( "text/html" ) ; response . setHeader ( "Pragma" , "no-cache" ) ; response . setHeader ( "Cache-Control" , "no-cache,no-store" ) ; String url = request . getParameter ( "URL" ) ; if ( url != null && url . length ( ) > 0 ) { response . sendRedirect ( url ) ; } else { PrintWriter pout = response . getWriter ( ) ; Page page = null ; try { page = new Page ( ) ; page . title ( "SendRedirect Servlet" ) ; page . add ( new Heading ( 1 , "SendRedirect Servlet" ) ) ; page . add ( new Heading ( 1 , "Form to generate Dump content" ) ) ; TableForm tf = new TableForm ( response . encodeURL ( URI . addPaths ( request . getContextPath ( ) , request . getServletPath ( ) ) + "/action" ) ) ; tf . method ( "GET" ) ; tf . addTextField ( "URL" , "URL" , 40 , request . getContextPath ( ) + "/dump" ) ; tf . addButton ( "Redirect" , "Redirect" ) ; page . add ( tf ) ; page . write ( pout ) ; pout . close ( ) ; } catch ( Exception e ) { log . warn ( LogSupport . EXCEPTION , e ) ; } }
public class LocaleIDs { /** * Returns a three - letter abbreviation for the language . If language is * empty , returns the empty string . Otherwise , returns * a lowercase ISO 639-2 / T language code . * The ISO 639-2 language codes can be found on - line at * < a href = " ftp : / / dkuug . dk / i18n / iso - 639-2 . txt " > < code > ftp : / / dkuug . dk / i18n / iso - 639-2 . txt < / code > < / a > * @ exception MissingResourceException Throws MissingResourceException if the * three - letter language abbreviation is not available for this locale . */ public static String getISO3Language ( String language ) { } }
int offset = findIndex ( _languages , language ) ; if ( offset >= 0 ) { return _languages3 [ offset ] ; } else { offset = findIndex ( _obsoleteLanguages , language ) ; if ( offset >= 0 ) { return _obsoleteLanguages3 [ offset ] ; } } return "" ;
public class MapMessage { /** * Removes the element with the specified name . * @ param key The name of the element . * @ return The previous value of the element . */ public String remove ( final String key ) { } }
final String result = data . getValue ( key ) ; data . remove ( key ) ; return result ;
public class Quaternion { /** * Sets the value of this quaternion to the normalized value * of quaternion q1. * @ param q1 the quaternion to be normalized . */ public final void normalize ( Quaternion q1 ) { } }
double norm ; norm = ( q1 . x * q1 . x + q1 . y * q1 . y + q1 . z * q1 . z + q1 . w * q1 . w ) ; if ( norm > 0f ) { norm = 1f / Math . sqrt ( norm ) ; this . x = norm * q1 . x ; this . y = norm * q1 . y ; this . z = norm * q1 . z ; this . w = norm * q1 . w ; } else { this . x = 0f ; this . y = 0f ; this . z = 0f ; this . w = 0f ; }
public class JBBPBitInputStream { /** * Read a long value from the stream . * @ param byteOrder the order of bytes to be used to decode the read value * @ return the long value from stream * @ throws IOException it will be thrown for any transport problem during the * operation * @ throws EOFException if the end of the stream has been reached * @ see JBBPByteOrder # BIG _ ENDIAN * @ see JBBPByteOrder # LITTLE _ ENDIAN */ public long readLong ( final JBBPByteOrder byteOrder ) throws IOException { } }
if ( byteOrder == JBBPByteOrder . BIG_ENDIAN ) { return ( ( ( long ) readInt ( byteOrder ) & 0xFFFFFFFFL ) << 32 ) | ( ( long ) readInt ( byteOrder ) & 0xFFFFFFFFL ) ; } else { return ( ( long ) readInt ( byteOrder ) & 0xFFFFFFFFL ) | ( ( ( long ) readInt ( byteOrder ) & 0xFFFFFFFFL ) << 32 ) ; }
public class DynamoDBMapperTableModel { /** * Gets the hash key field model for the specified type . * @ param < H > The hash key type . * @ return The hash key field model . * @ throws DynamoDBMappingException If the hash key is not present . */ @ SuppressWarnings ( "unchecked" ) public < H > DynamoDBMapperFieldModel < T , H > hashKey ( ) { } }
final DynamoDBMapperFieldModel < T , H > field = ( DynamoDBMapperFieldModel < T , H > ) keys . get ( HASH ) ; if ( field == null ) { throw new DynamoDBMappingException ( targetType . getSimpleName ( ) + "; no mapping for HASH key" ) ; } return field ;
public class JsonWriter { /** * Enters a new scope by appending any necessary whitespace and the given * bracket . */ private JsonWriter open ( JsonScope empty , String openBracket ) throws IOException { } }
beforeValue ( true ) ; stack . add ( empty ) ; out . write ( openBracket ) ; return this ;
public class ResourceAssignment { /** * Set a baseline value . * @ param baselineNumber baseline index ( 1-10) * @ param value baseline value */ public void setBaselineBudgetWork ( int baselineNumber , Duration value ) { } }
set ( selectField ( AssignmentFieldLists . BASELINE_BUDGET_WORKS , baselineNumber ) , value ) ;
public class DataRequirement { /** * @ param value { @ link # mustSupport } ( Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation . This does not mean that a value is required for this element , only that the consuming system must understand the element and be able to provide values for it if they are available . * The value of mustSupport SHALL be a FHIRPath resolveable on the type of the DataRequirement . The path SHALL consist only of identifiers , constant indexers , and . resolve ( ) ( see the [ Simple FHIRPath Profile ] ( fhirpath . html # simple ) for full details ) . ) */ public DataRequirement addMustSupport ( String value ) { } }
StringType t = new StringType ( ) ; t . setValue ( value ) ; if ( this . mustSupport == null ) this . mustSupport = new ArrayList < StringType > ( ) ; this . mustSupport . add ( t ) ; return this ;
public class CmsContentEditor { /** * Registers a deep copy of the source entity with the given target entity id . < p > * @ param sourceEntityId the source entity id * @ param targetEntityId the target entity id */ public void registerClonedEntity ( String sourceEntityId , String targetEntityId ) { } }
CmsEntityBackend . getInstance ( ) . getEntity ( sourceEntityId ) . createDeepCopy ( targetEntityId ) ;
public class PerspectiveOps { /** * Renders a point in world coordinates into the image plane in pixels or normalized image * coordinates . * @ param worldToCamera Transform from world to camera frame * @ param K Optional . Intrinsic camera calibration matrix . If null then normalized image coordinates are returned . * @ param X 3D Point in world reference frame . . * @ return 2D Render point on image plane or null if it ' s behind the camera */ public static Point2D_F64 renderPixel ( Se3_F64 worldToCamera , DMatrixRMaj K , Point3D_F64 X ) { } }
return ImplPerspectiveOps_F64 . renderPixel ( worldToCamera , K , X ) ; // if ( K = = null ) // return renderPixel ( worldToCamera , X ) ; // return ImplPerspectiveOps _ F64 . renderPixel ( worldToCamera , // K . data [ 0 ] , K . data [ 1 ] , K . data [ 2 ] , K . data [ 4 ] , K . data [ 5 ] , X ) ;
public class IllegalInstantException { /** * Checks if the exception is , or has a cause , of { @ code IllegalInstantException } . * @ param ex the exception to check * @ return true if an { @ code IllegalInstantException } */ public static boolean isIllegalInstant ( Throwable ex ) { } }
if ( ex instanceof IllegalInstantException ) { return true ; } while ( ex . getCause ( ) != null && ex . getCause ( ) != ex ) { return isIllegalInstant ( ex . getCause ( ) ) ; } return false ;
public class TraceConsumer { /** * Reads the results from the retrieval phase from the DOCUMENT and the DOCUEMNT _ GS views of the * JCAs , and generates and evaluates them using the evaluate method from the FMeasureConsumer * class . */ @ Override public void process ( CAS aCAS ) throws AnalysisEngineProcessException { } }
try { JCas jcas = aCAS . getJCas ( ) ; ExperimentUUID experiment = ProcessingStepUtils . getCurrentExperiment ( jcas ) ; AnnotationIndex < Annotation > steps = jcas . getAnnotationIndex ( ProcessingStep . type ) ; String uuid = experiment . getUuid ( ) ; Trace trace = ProcessingStepUtils . getTrace ( steps ) ; Key key = new Key ( uuid , trace , experiment . getStageId ( ) ) ; experiments . add ( new ExperimentKey ( key . getExperiment ( ) , key . getStage ( ) ) ) ; for ( TraceListener listener : listeners ) { listener . process ( key , jcas ) ; } } catch ( Exception e ) { throw new AnalysisEngineProcessException ( e ) ; }
public class SettablePromise { /** * Sets the result of this { @ code SettablePromise } and * completes it . { @ code AssertionError } is thrown when you * try to set result for an already completed { @ code Promise } . */ @ Override public void set ( T result ) { } }
assert ! isComplete ( ) ; this . result = result ; this . exception = null ; complete ( result ) ;
public class CmsObject { /** * Returns the access control list ( summarized access control entries ) of a given resource . < p > * If < code > inheritedOnly < / code > is set , only inherited access control entries are returned . < p > * @ param resourceName the name of the resource * @ param inheritedOnly if set , the non - inherited entries are skipped * @ return the access control list of the resource * @ throws CmsException if something goes wrong */ public CmsAccessControlList getAccessControlList ( String resourceName , boolean inheritedOnly ) throws CmsException { } }
CmsResource res = readResource ( resourceName , CmsResourceFilter . ALL ) ; return m_securityManager . getAccessControlList ( m_context , res , inheritedOnly ) ;
public class FieldEditor { /** * documentation inherited from interface */ public void actionPerformed ( ActionEvent event ) { } }
Object value = null ; try { value = getDisplayValue ( ) ; } catch ( Exception e ) { updateBorder ( true ) ; return ; } // submit an attribute changed event with the new value if ( ! valueMatches ( value ) ) { _accessor . set ( _field , value ) ; }
public class Utils { /** * This method check network state for opening Google Play Store If network * is not avaible AppRate will not try to show up . * This method return true if application doesn ' t has " ACCESS _ NETWORK _ STATE " permission . */ public static boolean isOnline ( Context context ) { } }
int res = context . checkCallingOrSelfPermission ( Manifest . permission . ACCESS_NETWORK_STATE ) ; if ( res == PackageManager . PERMISSION_GRANTED ) { ConnectivityManager cm = ( ConnectivityManager ) context . getSystemService ( Context . CONNECTIVITY_SERVICE ) ; NetworkInfo netInfo = cm . getActiveNetworkInfo ( ) ; if ( netInfo != null && netInfo . isConnectedOrConnecting ( ) ) { return true ; } return false ; } return true ;
public class EJSHome { /** * d112604.5 */ @ Override public void setCustomFinderAccessIntentThreadState ( boolean cfwithupdateaccess , boolean readonly , String methodname ) { } }
container . setCustomFinderAccessIntentThreadState ( cfwithupdateaccess , readonly , methodname ) ;
public class ArrayFunctions { /** * Returned expression results in new array with the concatenation of the input arrays . */ public static Expression arrayConcat ( JsonArray array1 , JsonArray array2 ) { } }
return arrayConcat ( x ( array1 ) , x ( array2 ) ) ;
public class XalanUtil { /** * Return the XPathContext to be used for evaluating expressions . * If the child is nested withing a forEach tag its iteration context is used . * Otherwise , a new context is created based on an empty Document . * @ param child the tag whose context should be returned * @ param pageContext the current page context * @ return the XPath evaluation context */ public static XPathContext getContext ( Tag child , PageContext pageContext ) { } }
// if within a forEach tag , use its context ForEachTag forEachTag = ( ForEachTag ) TagSupport . findAncestorWithClass ( child , ForEachTag . class ) ; if ( forEachTag != null ) { return forEachTag . getContext ( ) ; } // otherwise , create a new context referring to an empty document XPathContext context = new XPathContext ( false ) ; VariableStack variableStack = new JSTLVariableStack ( pageContext ) ; context . setVarStack ( variableStack ) ; int dtm = context . getDTMHandleFromNode ( XmlUtil . newEmptyDocument ( ) ) ; context . pushCurrentNodeAndExpression ( dtm , dtm ) ; return context ;
public class TurfMeasurement { /** * Takes a set of features , calculates the bbox of all input features , and returns a bounding box . * @ param polygon a { @ link Polygon } object * @ return a double array defining the bounding box in this order { @ code [ minX , minY , maxX , maxY ] } * @ since 2.0.0 */ public static double [ ] bbox ( @ NonNull Polygon polygon ) { } }
List < Point > resultCoords = TurfMeta . coordAll ( polygon , false ) ; return bboxCalculator ( resultCoords ) ;
public class SoffitConnectorController { /** * Implementation */ private ResponseWrapper fetchContentFromCacheIfAvailable ( final RenderRequest req , final String serviceUrl ) { } }
ResponseWrapper rslt = null ; // default final List < CacheTuple > cacheKeysToTry = new ArrayList < > ( ) ; // Don ' t use private - scope caching for anonymous users if ( req . getRemoteUser ( ) != null ) { cacheKeysToTry . add ( // Private - scope cache key new CacheTuple ( serviceUrl , req . getPortletMode ( ) . toString ( ) , req . getWindowState ( ) . toString ( ) , req . getRemoteUser ( ) ) ) ; } cacheKeysToTry . add ( // Public - scope cache key new CacheTuple ( serviceUrl , req . getPortletMode ( ) . toString ( ) , req . getWindowState ( ) . toString ( ) ) ) ; for ( CacheTuple key : cacheKeysToTry ) { final Element cacheElement = this . responseCache . get ( key ) ; if ( cacheElement != null ) { rslt = ( ResponseWrapper ) cacheElement . getObjectValue ( ) ; break ; } } return rslt ;
public class Database { /** * Adds an account to a parent . This will first check to see if the account * already has a parent and if so remove it from that parent before adding it * to the new parent . * @ param parent The parent to add the child under . * @ param child The child to add . * @ throws Exception On error . */ public void addAccount ( Account parent , Account child ) throws Exception { } }
// Check to see if the account physically already exists - there is something funny with // some Firefox RDF exports where an RDF : li node gets duplicated multiple times . for ( Account dup : parent . getChildren ( ) ) { if ( dup == child ) { logger . warning ( "Duplicate RDF:li=" + child . getId ( ) + " detected. Dropping duplicate" ) ; return ; } } int iterationCount = 0 ; final int maxIteration = 0x100000 ; // if we can ' t find a hash in 1 million iterations , something is wrong while ( findAccountById ( child . getId ( ) ) != null && ( iterationCount ++ < maxIteration ) ) { logger . warning ( "ID collision detected on '" + child . getId ( ) + "', attempting to regenerate ID. iteration=" + iterationCount ) ; child . setId ( Account . createId ( child ) ) ; } if ( iterationCount >= maxIteration ) { throw new Exception ( "Could not genererate a unique ID in " + iterationCount + " iterations, this is really rare. I know it's lame, but change the description and try again." ) ; } // add to new parent parent . getChildren ( ) . add ( child ) ; sendAccountAdded ( parent , child ) ; setDirty ( true ) ;
public class MultiIndex { /** * Performs indexing while re - indexing is in progress * @ param remove * @ param add * @ throws IOException */ private void doUpdateOffline ( final Collection < String > remove , final Collection < Document > add ) throws IOException { } }
SecurityHelper . doPrivilegedIOExceptionAction ( new PrivilegedExceptionAction < Object > ( ) { public Object run ( ) throws Exception { for ( Iterator < String > it = remove . iterator ( ) ; it . hasNext ( ) ; ) { Term idTerm = new Term ( FieldNames . UUID , it . next ( ) ) ; offlineIndex . removeDocument ( idTerm ) ; } for ( Iterator < Document > it = add . iterator ( ) ; it . hasNext ( ) ; ) { Document doc = it . next ( ) ; if ( doc != null ) { offlineIndex . addDocuments ( new Document [ ] { doc } ) ; // reset volatile index if needed if ( offlineIndex . getRamSizeInBytes ( ) >= handler . getMaxVolatileIndexSize ( ) ) { offlineIndex . commit ( ) ; } } } return null ; } } ) ;
public class ClassTree { /** * Generate mapping for the sub - classes for every class in this run . * Return the sub - class set for java . lang . Object which will be having * sub - class listing for itself and also for each sub - class itself will * have their own sub - class lists . * @ param classes all the classes in this run . * @ param configuration the current configuration of the doclet . */ private void buildTree ( Iterable < TypeElement > classes ) { } }
for ( TypeElement aClass : classes ) { // In the tree page ( e . g overview - tree . html ) do not include // information of classes which are deprecated or are a part of a // deprecated package . if ( configuration . nodeprecated && ( utils . isDeprecated ( aClass ) || utils . isDeprecated ( utils . containingPackage ( aClass ) ) ) ) { continue ; } if ( utils . isHidden ( aClass ) ) { continue ; } if ( utils . isEnum ( aClass ) ) { processType ( aClass , configuration , baseEnums , subEnums ) ; } else if ( utils . isClass ( aClass ) ) { processType ( aClass , configuration , baseClasses , subClasses ) ; } else if ( utils . isInterface ( aClass ) ) { processInterface ( aClass ) ; } else if ( utils . isAnnotationType ( aClass ) ) { processType ( aClass , configuration , baseAnnotationTypes , subAnnotationTypes ) ; } }
public class OrientModelGraph { /** * Recursive path search function . It performs a depth first search with integrated loop check to find a path from * the start model to the end model . If the id list is not empty , then the function only returns a path as valid if * all transformations defined with the id list are in the path . It also takes care of models which aren ' t * available . Returns null if there is no path found . */ private List < ODocument > recursivePathSearch ( String start , String end , List < String > ids , ODocument ... steps ) { } }
List < ODocument > neighbors = getNeighborsOfModel ( start ) ; for ( ODocument neighbor : neighbors ) { if ( alreadyVisited ( neighbor , steps ) || ! OrientModelGraphUtils . getActiveFieldValue ( neighbor ) ) { continue ; } ODocument nextStep = getEdgeWithPossibleId ( start , OrientModelGraphUtils . getIdFieldValue ( neighbor ) , ids ) ; if ( nextStep == null ) { continue ; } if ( OrientModelGraphUtils . getIdFieldValue ( neighbor ) . equals ( end ) ) { List < ODocument > result = new ArrayList < ODocument > ( ) ; List < String > copyIds = new ArrayList < String > ( ids ) ; for ( ODocument step : steps ) { String id = OrientModelGraphUtils . getIdFieldValue ( step ) ; if ( id != null && copyIds . contains ( id ) ) { copyIds . remove ( id ) ; } result . add ( step ) ; } String id = OrientModelGraphUtils . getIdFieldValue ( nextStep ) ; if ( id != null && copyIds . contains ( id ) ) { copyIds . remove ( id ) ; } result . add ( nextStep ) ; if ( copyIds . isEmpty ( ) ) { return result ; } } ODocument [ ] path = Arrays . copyOf ( steps , steps . length + 1 ) ; path [ path . length - 1 ] = nextStep ; List < ODocument > check = recursivePathSearch ( OrientModelGraphUtils . getIdFieldValue ( neighbor ) , end , ids , path ) ; if ( check != null ) { return check ; } } return null ;
public class LocalCacheStream { /** * Method to inject a cache into a consumer . Note we only support this for the consumer at this * time . * @ param cacheAware the instance that may be a { @ link CacheAware } */ private void injectCache ( Consumer < ? super R > cacheAware ) { } }
if ( cacheAware instanceof CacheAware ) { ( ( CacheAware ) cacheAware ) . injectCache ( registry . getComponent ( Cache . class ) ) ; }
public class Splash { /** * Invokes the main method of the provided class name . * @ param args the command line arguments */ public static void invokeMain ( String className , String [ ] args ) { } }
try { Class < ? > clazz = null ; if ( ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) != null ) clazz = ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) . findClass ( className , null ) ; if ( clazz == null ) clazz = Class . forName ( className ) ; Method method = clazz . getMethod ( "main" , PARAMS ) ; Object [ ] objArgs = new Object [ ] { args } ; method . invoke ( null , objArgs ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; }
public class AbstractToggleButton { /** * Specifies that this button acts as a toggle , for instance for a parent { @ link org . gwtbootstrap3 . client . ui . DropDown } * or { @ link org . gwtbootstrap3 . client . ui . ButtonGroup } * Adds a { @ link Caret } as a child widget . * @ param toggle Kind of toggle */ @ Override public void setDataToggle ( final Toggle toggle ) { } }
toggleMixin . setDataToggle ( toggle ) ; // We defer to make sure the elements are available to manipulate their position Scheduler . get ( ) . scheduleDeferred ( new Scheduler . ScheduledCommand ( ) { @ Override public void execute ( ) { separator . removeFromParent ( ) ; caret . removeFromParent ( ) ; if ( toggle == Toggle . DROPDOWN ) { addStyleName ( Styles . DROPDOWN_TOGGLE ) ; add ( separator , ( Element ) getElement ( ) ) ; add ( caret , ( Element ) getElement ( ) ) ; } } } ) ;
public class Maven { /** * - - load poms */ public MavenProject loadPom ( Artifact artifact ) throws RepositoryException , ProjectBuildingException { } }
return loadPom ( resolve ( new DefaultArtifact ( artifact . getGroupId ( ) , artifact . getArtifactId ( ) , "pom" , artifact . getVersion ( ) ) ) , false ) ;
public class AutoCompleteTextFieldComponent { /** * Clears the textfield and resets the validation icon . */ public void clear ( ) { } }
queryTextField . clear ( ) ; validationIcon . setValue ( FontAwesome . CHECK_CIRCLE . getHtml ( ) ) ; validationIcon . setStyleName ( "hide-status-label" ) ;
public class CSVLoader { /** * Load all files in the given folder whose name matches a known table . */ private void loadFolder ( File folder ) { } }
m_logger . info ( "Scanning for files in folder: {}" , folder . getAbsolutePath ( ) ) ; File [ ] files = folder . listFiles ( ) ; if ( files == null || files . length == 0 ) { m_logger . error ( "No files found in folder: {}" , folder . getAbsolutePath ( ) ) ; return ; } for ( File file : files ) { String fileName = file . getName ( ) . toLowerCase ( ) ; if ( ! fileName . endsWith ( ".csv" ) && ! fileName . endsWith ( ".zip" ) ) { continue ; } TableDefinition tableDef = determineTableFromFileName ( file . getName ( ) ) ; if ( tableDef == null ) { m_logger . error ( "Ignoring file; unknown corresponding table: {}" , file . getName ( ) ) ; continue ; } try { if ( fileName . endsWith ( ".csv" ) ) { loadCSVFile ( tableDef , file ) ; } else { loadZIPFile ( tableDef , file ) ; } } catch ( IOException ex ) { m_logger . error ( "I/O error scanning file '{}': {}" , file . getName ( ) , ex ) ; } }
public class CreateAdditionalAssignmentsForHITRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateAdditionalAssignmentsForHITRequest createAdditionalAssignmentsForHITRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createAdditionalAssignmentsForHITRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createAdditionalAssignmentsForHITRequest . getHITId ( ) , HITID_BINDING ) ; protocolMarshaller . marshall ( createAdditionalAssignmentsForHITRequest . getNumberOfAdditionalAssignments ( ) , NUMBEROFADDITIONALASSIGNMENTS_BINDING ) ; protocolMarshaller . marshall ( createAdditionalAssignmentsForHITRequest . getUniqueRequestToken ( ) , UNIQUEREQUESTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GroovyMain { /** * Get a new GroovyCodeSource for a script which may be given as a location * ( isScript is true ) or as text ( isScript is false ) . * @ param isScriptFile indicates whether the script parameter is a location or content * @ param script the location or context of the script * @ return a new GroovyCodeSource for the given script * @ throws IOException * @ throws URISyntaxException * @ since 2.3.0 */ protected GroovyCodeSource getScriptSource ( boolean isScriptFile , String script ) throws IOException , URISyntaxException { } }
// check the script is currently valid before starting a server against the script if ( isScriptFile ) { // search for the file and if it exists don ' t try to use URIs . . . File scriptFile = huntForTheScriptFile ( script ) ; if ( ! scriptFile . exists ( ) && URI_PATTERN . matcher ( script ) . matches ( ) ) { return new GroovyCodeSource ( new URI ( script ) ) ; } return new GroovyCodeSource ( scriptFile ) ; } return new GroovyCodeSource ( script , "script_from_command_line" , GroovyShell . DEFAULT_CODE_BASE ) ;
public class Channel { /** * Add a peer to the channel * @ param peer The Peer to add . * @ param peerOptions see { @ link PeerRole } * @ return Channel The current channel added . * @ throws InvalidArgumentException */ public Channel addPeer ( Peer peer , PeerOptions peerOptions ) throws InvalidArgumentException { } }
if ( shutdown ) { throw new InvalidArgumentException ( format ( "Channel %s has been shutdown." , name ) ) ; } if ( null == peer ) { throw new InvalidArgumentException ( "Peer is invalid can not be null." ) ; } if ( peer . getChannel ( ) != null && peer . getChannel ( ) != this ) { throw new InvalidArgumentException ( format ( "Peer already connected to channel %s" , peer . getChannel ( ) . getName ( ) ) ) ; } if ( null == peerOptions ) { throw new InvalidArgumentException ( "peerOptions is invalid can not be null." ) ; } logger . debug ( format ( "%s adding peer: %s, peerOptions: %s" , toString ( ) , peer , "" + peerOptions ) ) ; peer . setChannel ( this ) ; peers . add ( peer ) ; peerOptionsMap . put ( peer , peerOptions . clone ( ) ) ; peerEndpointMap . put ( peer . getEndpoint ( ) , peer ) ; if ( peerOptions . getPeerRoles ( ) . contains ( PeerRole . SERVICE_DISCOVERY ) ) { final Properties properties = peer . getProperties ( ) ; if ( ( properties == null ) || properties . isEmpty ( ) || ( isNullOrEmpty ( properties . getProperty ( "clientCertFile" ) ) && ! properties . containsKey ( "clientCertBytes" ) ) ) { TLSCertificateBuilder tlsCertificateBuilder = new TLSCertificateBuilder ( ) ; TLSCertificateKeyPair tlsCertificateKeyPair = tlsCertificateBuilder . clientCert ( ) ; peer . setTLSCertificateKeyPair ( tlsCertificateKeyPair ) ; } discoveryEndpoints . add ( peer . getEndpoint ( ) ) ; } for ( Map . Entry < PeerRole , Set < Peer > > peerRole : peerRoleSetMap . entrySet ( ) ) { if ( peerOptions . getPeerRoles ( ) . contains ( peerRole . getKey ( ) ) ) { peerRole . getValue ( ) . add ( peer ) ; } } if ( isInitialized ( ) && peerOptions . getPeerRoles ( ) . contains ( PeerRole . EVENT_SOURCE ) ) { try { peer . initiateEventing ( getTransactionContext ( ) , getPeersOptions ( peer ) ) ; } catch ( TransactionException e ) { logger . error ( format ( "Error channel %s enabling eventing on peer %s" , toString ( ) , peer ) ) ; } } return this ;
public class HttpClient { /** * Setup a callback called when { @ link HttpClientResponse } has not been fully * received . * @ param doOnResponse a consumer observing response failures * @ return a new { @ link HttpClient } */ public final HttpClient doOnResponseError ( BiConsumer < ? super HttpClientResponse , ? super Throwable > doOnResponse ) { } }
Objects . requireNonNull ( doOnResponse , "doOnResponse" ) ; return new HttpClientDoOnError ( this , null , doOnResponse ) ;
public class GosuStringUtil { /** * < p > Reverses a String as per { @ link StringBuffer # reverse ( ) } . < / p > * < p > A < code > null < / code > String returns < code > null < / code > . < / p > * < pre > * GosuStringUtil . reverse ( null ) = null * GosuStringUtil . reverse ( " " ) = " " * GosuStringUtil . reverse ( " bat " ) = " tab " * < / pre > * @ param str the String to reverse , may be null * @ return the reversed String , < code > null < / code > if null String input */ public static String reverse ( String str ) { } }
if ( str == null ) { return null ; } return new StringBuffer ( str ) . reverse ( ) . toString ( ) ;
public class GrammarKeywordAccessFragment2 { /** * Replies the keywords in the given grammar . * @ param grammar the grammar . * @ return the keywords . */ protected static Iterable < Keyword > getAllKeywords ( Grammar grammar ) { } }
final Map < String , Keyword > keywords = new HashMap < > ( ) ; final List < ParserRule > rules = GrammarUtil . allParserRules ( grammar ) ; for ( final ParserRule parserRule : rules ) { final List < Keyword > list = typeSelect ( eAllContentsAsList ( parserRule ) , Keyword . class ) ; for ( final Keyword keyword : list ) { keywords . put ( keyword . getValue ( ) , keyword ) ; } } final List < EnumRule > enumRules = GrammarUtil . allEnumRules ( grammar ) ; for ( final EnumRule enumRule : enumRules ) { final List < Keyword > list = typeSelect ( eAllContentsAsList ( enumRule ) , Keyword . class ) ; for ( final Keyword keyword : list ) { keywords . put ( keyword . getValue ( ) , keyword ) ; } } return keywords . values ( ) ;
public class WalkerState { /** * Seeks to the given season within the given year * @ param seasonString * @ param yearString */ public void seekToSeasonYear ( String seasonString , String yearString ) { } }
Season season = Season . valueOf ( seasonString ) ; assert ( season != null ) ; seekToIcsEventYear ( SEASON_ICS_FILE , yearString , season . getSummary ( ) ) ;
public class KTypeVTypeHashMap { /** * { @ inheritDoc } */ @ Override public VType indexReplace ( int index , VType newValue ) { } }
assert index >= 0 : "The index must point at an existing key." ; assert index <= mask || ( index == mask + 1 && hasEmptyKey ) ; VType previousValue = Intrinsics . < VType > cast ( values [ index ] ) ; values [ index ] = newValue ; return previousValue ;
public class transformpolicylabel { /** * Use this API to fetch filtered set of transformpolicylabel resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static transformpolicylabel [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
transformpolicylabel obj = new transformpolicylabel ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; transformpolicylabel [ ] response = ( transformpolicylabel [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class SpringSecurityWebAuditMetaData { /** * { @ inheritDoc } * @ see org . audit4j . core . MetaData # getActor ( ) */ @ Override public String getActor ( ) { } }
Authentication authentication = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( authentication != null && authentication . getPrincipal ( ) instanceof UserDetails ) { return ( ( UserDetails ) authentication . getPrincipal ( ) ) . getUsername ( ) ; } else if ( authentication != null && authentication . getPrincipal ( ) instanceof String ) { return ( String ) authentication . getPrincipal ( ) ; } return undefienedActorName ;
public class JDBCDatabaseMetaData { /** * Retrieves a description of the given table ' s primary key columns . They * are ordered by COLUMN _ NAME . * < P > Each primary key column description has the following columns : * < OL > * < LI > < B > TABLE _ CAT < / B > String = > table catalog ( may be < code > null < / code > ) * < LI > < B > TABLE _ SCHEM < / B > String = > table schema ( may be < code > null < / code > ) * < LI > < B > TABLE _ NAME < / B > String = > table name * < LI > < B > COLUMN _ NAME < / B > String = > column name * < LI > < B > KEY _ SEQ < / B > short = > ( JDBC4 Clarification : ) sequence number within primary key ( a value * of 1 represents the first column of the primary key , a value of 2 would * represent the second column within the primary key ) . * < LI > < B > PK _ NAME < / B > String = > primary key name ( may be < code > null < / code > ) * < / OL > * < ! - - start release - specific documentation - - > * < div class = " ReleaseSpecificDocumentation " > * < h3 > HSQLDB - Specific Information : < / h3 > < p > * HSQLDB supports the SQL Standard . It treats unquoted identifiers as * case insensitive in SQL and stores * them in upper case ; it treats quoted identifiers as case sensitive and * stores them verbatim . All JDBCDatabaseMetaData methods perform * case - sensitive comparison between name ( pattern ) arguments and the * corresponding identifier values as they are stored in the database . * Therefore , care must be taken to specify name arguments precisely * ( including case ) as they are stored in the database . < p > * Since 1.7.2 , this feature is supported by default . If the jar is * compiled without org . hsqldb _ voltpatches . DatabaseInformationFull or * org . hsqldb _ voltpatches . DatabaseInformationMain , the feature is * not supported . The default implementation is * { @ link org . hsqldb _ voltpatches . dbinfo . DatabaseInformationFull } . * < / div > * < ! - - end release - specific documentation - - > * @ param catalog a catalog name ; must match the catalog name as it * is stored in the database ; " " retrieves those without a catalog ; * < code > null < / code > means that the catalog name should not be used to narrow * the search * @ param schema a schema name ; must match the schema name * as it is stored in the database ; " " retrieves those without a schema ; * < code > null < / code > means that the schema name should not be used to narrow * the search * @ param table a table name ; must match the table name as it is stored * in the database * @ return < code > ResultSet < / code > - each row is a primary key column description * @ exception SQLException if a database access error occurs * @ see # supportsMixedCaseQuotedIdentifiers * @ see # storesUpperCaseIdentifiers */ public ResultSet getPrimaryKeys ( String catalog , String schema , String table ) throws SQLException { } }
if ( table == null ) { throw Util . nullArgument ( "table" ) ; } schema = translateSchema ( schema ) ; StringBuffer select = toQueryPrefix ( "SYSTEM_PRIMARYKEYS" ) . append ( and ( "TABLE_CAT" , "=" , catalog ) ) . append ( and ( "TABLE_SCHEM" , "=" , schema ) ) . append ( and ( "TABLE_NAME" , "=" , table ) ) ; // By default , query already returns result in contract order return execute ( select . toString ( ) ) ;
public class StringExpression { /** * Create a { @ code this . containsIgnoreCase ( str ) } expression * < p > Returns true if the given String is contained , compare case insensitively < / p > * @ param str string * @ return this . containsIgnoreCase ( str ) expression */ public BooleanExpression containsIgnoreCase ( Expression < String > str ) { } }
return Expressions . booleanOperation ( Ops . STRING_CONTAINS_IC , mixin , str ) ;
public class ReflectionUtils { /** * Invokes the specified constructor without throwing any checked exceptions . * This is only valid for constructors that are not declared to throw any checked * exceptions . Any unchecked exceptions thrown by the specified constructor will be * re - thrown ( in their original form , not wrapped in an InvocationTargetException * as would be the case for a normal reflective invocation ) . * @ param constructor The constructor to invoke . Both the constructor and its * class must have been declared public , and the class must not be abstract , * otherwise they will be inaccessible . * @ param arguments The method arguments . * @ param < T > The return type of the method . The compiler can usually infer the * correct type . * @ return The object created by invoking the specified constructor with the specified * arguments . */ public static < T > T invokeUnchecked ( Constructor < T > constructor , Object ... arguments ) { } }
try { return constructor . newInstance ( arguments ) ; } catch ( IllegalAccessException ex ) { // This cannot happen if the constructor is public . throw new IllegalArgumentException ( "Constructor is not publicly accessible." , ex ) ; } catch ( InstantiationException ex ) { // This can only happen if the constructor belongs to an // abstract class . throw new IllegalArgumentException ( "Constructor is part of an abstract class." , ex ) ; } catch ( InvocationTargetException ex ) { // If the method is not declared to throw any checked exceptions , // the worst that can happen is a RuntimeException or an Error ( we can , // and should , re - throw both ) . if ( ex . getCause ( ) instanceof Error ) { throw ( Error ) ex . getCause ( ) ; } else { throw ( RuntimeException ) ex . getCause ( ) ; } }
public class ChunkListener { /** * Checks if the listener { @ link BlockPos } has a { @ link IBlockListener . Pre } component and if the modified { @ code BlockPos } is in range . * @ param chunk the chunk * @ param listener the listener * @ param modified the modified * @ param oldState the old state * @ param newState the new state * @ return true , if is valid post listener */ public boolean isValidPostListener ( Chunk chunk , BlockPos listener , BlockPos modified , IBlockState oldState , IBlockState newState ) { } }
if ( listener . equals ( modified ) ) return false ; IBlockListener . Post bl = IComponent . getComponent ( IBlockListener . Post . class , chunk . getWorld ( ) . getBlockState ( listener ) . getBlock ( ) ) ; if ( bl != null && bl . isInRange ( listener , modified ) ) return true ; return false ;
public class DTask { /** * Capture the first exception in _ ex . Later setException attempts are ignored . */ public synchronized void setException ( Throwable ex ) { } }
if ( _ex == null ) { _ex = AutoBuffer . javaSerializeWritePojo ( ( ( ex instanceof DistributedException ) ? ( DistributedException ) ex : new DistributedException ( ex , false /* don ' t want this setException ( ex ) call in the stacktrace */ ) ) ) ; }
public class ItemStorageManager { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . cache . CacheStatistics # getCurrentCount ( ) */ public final long getCurrentCount ( ) { } }
long result = 0 ; result = result + _storedItemManager . getCurrentCount ( ) ; result = result + _unstoredItemManager . getCurrentCount ( ) ; return result ;
public class DescribeScalingPlansRequest { /** * The sources for the applications ( up to 10 ) . If you specify scaling plan names , you cannot specify application * sources . * @ param applicationSources * The sources for the applications ( up to 10 ) . If you specify scaling plan names , you cannot specify * application sources . */ public void setApplicationSources ( java . util . Collection < ApplicationSource > applicationSources ) { } }
if ( applicationSources == null ) { this . applicationSources = null ; return ; } this . applicationSources = new java . util . ArrayList < ApplicationSource > ( applicationSources ) ;
public class BTree { /** * 循环搜索路径上存储的k - v * @ param currentNode * @ param layout * @ param number 逆向出来的数值key */ protected final void forEach ( Node < V > currentNode , int layout , int number , BitConsumer < V > consumer ) { } }
if ( layout == 0 ) { consumer . accept ( number , currentNode . getData ( ) ) ; return ; } Node < V > [ ] sub = currentNode . getSub ( ) ; for ( int i = 0 ; i < sub . length ; i ++ ) { Node < V > node = sub [ i ] ; if ( node != null ) { layout -- ; int num = number + i & getConfig ( ) . mask << layout ; forEach ( node , layout , num , consumer ) ; layout ++ ; } }
public class LogicManagementClientImpl { /** * Lists all of the available Logic REST API operations . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; OperationInner & gt ; object */ public Observable < Page < OperationInner > > listOperationsNextAsync ( final String nextPageLink ) { } }
return listOperationsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < OperationInner > > , Page < OperationInner > > ( ) { @ Override public Page < OperationInner > call ( ServiceResponse < Page < OperationInner > > response ) { return response . body ( ) ; } } ) ;
public class ValidationRelation { /** * Applies only to ManyToOne or OneToOne . * When x to one has an inverse relation , we never mark it as @ NotNull * as it would break navigation ( indeed , the mandatory value is set transparently once the entity is added to the collection ) * However , in test ( XxxGenerator ) , we must take mandatory into account . . . */ public String getNotNullAnnotation ( ) { } }
if ( ! relation . isManyToOne ( ) && ! relation . isOneToOne ( ) ) { return "" ; } if ( relation . isMandatory ( ) && ! relation . hasInverse ( ) ) { if ( relation . getFromEntity ( ) . getName ( ) . equals ( relation . getToEntity ( ) . getName ( ) ) ) { // TODO ? : mandatory relation on self is complicated to handled // in tests ( model generator ) . . . so we just ignore it . return "" ; } if ( relation . getFromAttribute ( ) . isInPk ( ) ) { // TODO : not sure why , but integration tests fail if we don ' t skip this case . return "" ; } ImportsContext . addImport ( "javax.validation.constraints.NotNull" ) ; return "@NotNull" ; } else { return "" ; }
public class JDBCDatabaseMetaData { /** * Retrieves a description of a table ' s optimal set of columns that * uniquely identifies a row . They are ordered by SCOPE . * < P > Each column description has the following columns : * < OL > * < LI > < B > SCOPE < / B > short = > actual scope of result * < UL > * < LI > bestRowTemporary - very temporary , while using row * < LI > bestRowTransaction - valid for remainder of current transaction * < LI > bestRowSession - valid for remainder of current session * < / UL > * < LI > < B > COLUMN _ NAME < / B > String = > column name * < LI > < B > DATA _ TYPE < / B > int = > SQL data type from java . sql . Types * < LI > < B > TYPE _ NAME < / B > String = > Data source dependent type name , * for a UDT the type name is fully qualified * < LI > < B > COLUMN _ SIZE < / B > int = > precision * < LI > < B > BUFFER _ LENGTH < / B > int = > not used * < LI > < B > DECIMAL _ DIGITS < / B > short = > scale - Null is returned for data types where * DECIMAL _ DIGITS is not applicable . * < LI > < B > PSEUDO _ COLUMN < / B > short = > is this a pseudo column * like an Oracle ROWID * < UL > * < LI > bestRowUnknown - may or may not be pseudo column * < LI > bestRowNotPseudo - is NOT a pseudo column * < LI > bestRowPseudo - is a pseudo column * < / UL > * < / OL > * < p > ( JDBC4 clarification : ) < p > * The COLUMN _ SIZE column represents the specified column size for the given column . * For numeric data , this is the maximum precision . For character data , this is the [ declared or implicit maximum ] length in characters . * For datetime datatypes , this is the [ maximum ] length in characters of the String representation ( assuming the * maximum allowed precision of the fractional seconds component ) . For binary data , this is the [ maximum ] length in bytes . For the ROWID datatype , * this is the length in bytes [ , as returned by the implementation - specific java . sql . RowId . getBytes ( ) method ] . 0 is returned for data types where the * column size is not applicable . < p > * < ! - - start release - specific documentation - - > * < div class = " ReleaseSpecificDocumentation " > * < h3 > HSQLDB - Specific Information : < / h3 > < p > * HSQLDB supports the SQL Standard . It treats unquoted identifiers as * case insensitive in SQL and stores * them in upper case ; it treats quoted identifiers as case sensitive and * stores them verbatim . All JDBCDatabaseMetaData methods perform * case - sensitive comparison between name ( pattern ) arguments and the * corresponding identifier values as they are stored in the database . * Therefore , care must be taken to specify name arguments precisely * ( including case ) as they are stored in the database . < p > * If the name of a column is defined in the database without double * quotes , an all - uppercase name must be specified when calling this * method . Otherwise , the name must be specified in the exact case of * the column definition in the database . < p > * Since 1.7.2 , this feature is supported by default . If the jar is * compiled without org . hsqldb _ voltpatches . DatabaseInformationFull or * org . hsqldb _ voltpatches . DatabaseInformationMain , the feature is * not supported . The default implementation is * { @ link org . hsqldb _ voltpatches . dbinfo . DatabaseInformationFull } . * < / div > * < ! - - end release - specific documentation - - > * @ param catalog a catalog name ; must match the catalog name as it * is stored in the database ; " " retrieves those without a catalog ; * < code > null < / code > means that the catalog name should not be used to narrow * the search * @ param schema a schema name ; must match the schema name * as it is stored in the database ; " " retrieves those without a schema ; * < code > null < / code > means that the schema name should not be used to narrow * the search * @ param table a table name ; must match the table name as it is stored * in the database * @ param scope the scope of interest ; use same values as SCOPE * @ param nullable include columns that are nullable . * @ return < code > ResultSet < / code > - each row is a column description * @ exception SQLException if a database access error occurs */ public ResultSet getBestRowIdentifier ( String catalog , String schema , String table , int scope , boolean nullable ) throws SQLException { } }
if ( table == null ) { throw Util . nullArgument ( "table" ) ; } String scopeIn ; switch ( scope ) { case bestRowTemporary : scopeIn = BRI_TEMPORARY_SCOPE_IN_LIST ; break ; case bestRowTransaction : scopeIn = BRI_TRANSACTION_SCOPE_IN_LIST ; break ; case bestRowSession : scopeIn = BRI_SESSION_SCOPE_IN_LIST ; break ; default : throw Util . invalidArgument ( "scope" ) ; } schema = translateSchema ( schema ) ; Integer Nullable = ( nullable ) ? null : INT_COLUMNS_NO_NULLS ; StringBuffer select = toQueryPrefix ( "SYSTEM_BESTROWIDENTIFIER" ) . append ( and ( "TABLE_CAT" , "=" , catalog ) ) . append ( and ( "TABLE_SCHEM" , "=" , schema ) ) . append ( and ( "TABLE_NAME" , "=" , table ) ) . append ( and ( "NULLABLE" , "=" , Nullable ) ) . append ( " AND SCOPE IN " + scopeIn ) ; // By default , query already returns rows in contract order . // However , the way things are set up , there should never be // a result where there is > 1 distinct scope value : most requests // will want only one table and the system table producer ( for // now ) guarantees that a maximum of one BRI scope column set is // produced for each table return execute ( select . toString ( ) ) ;
public class RESTAppListener { /** * { @ inheritDoc } */ @ Override public void contextRootRemoved ( String contextRoot , VirtualHost virtualHost ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Removed contextRoot {0} from virtual host {1}" , contextRoot , virtualHost . getName ( ) ) ; } if ( contextRoot != null && contextRoot . contains ( APIConstants . JMX_CONNECTOR_API_ROOT_PATH ) ) { registeredContextRoot = null ; }
public class Distribution { /** * Maps a counter representing the linear weights of a multiclass * logistic regression model to the probabilities of each class . */ public static < E > Distribution < E > distributionFromLogisticCounter ( Counter < E > cntr ) { } }
double expSum = 0.0 ; int numKeys = 0 ; for ( E key : cntr . keySet ( ) ) { expSum += Math . exp ( cntr . getCount ( key ) ) ; numKeys ++ ; } Distribution < E > probs = new Distribution < E > ( ) ; probs . counter = new ClassicCounter < E > ( ) ; probs . reservedMass = 0.0 ; probs . numberOfKeys = numKeys ; for ( E key : cntr . keySet ( ) ) { probs . counter . setCount ( key , Math . exp ( cntr . getCount ( key ) ) / expSum ) ; } return probs ;
public class DebugStructureInterceptor { /** * Writes debugging information for the given component . * @ param component the component to write debugging information for . * @ param xml the writer to send the debug output to . */ protected void writeDebugInfo ( final WComponent component , final XmlStringBuilder xml ) { } }
if ( component != null && ( component . isVisible ( ) || component instanceof WInvisibleContainer ) ) { xml . appendTagOpen ( "ui:debugInfo" ) ; xml . appendAttribute ( "for" , component . getId ( ) ) ; xml . appendAttribute ( "class" , component . getClass ( ) . getName ( ) ) ; xml . appendOptionalAttribute ( "type" , getType ( component ) ) ; xml . appendClose ( ) ; xml . appendTagOpen ( "ui:debugDetail" ) ; xml . appendAttribute ( "key" , "defaultState" ) ; xml . appendAttribute ( "value" , component . isDefaultState ( ) ) ; xml . appendEnd ( ) ; xml . appendEndTag ( "ui:debugInfo" ) ; if ( component instanceof WRepeater ) { // special case for WRepeaters - we must paint the info for each row . WRepeater repeater = ( WRepeater ) component ; List < UIContext > contexts = repeater . getRowContexts ( ) ; for ( int i = 0 ; i < contexts . size ( ) ; i ++ ) { UIContextHolder . pushContext ( contexts . get ( i ) ) ; try { writeDebugInfo ( repeater . getRepeatedComponent ( i ) , xml ) ; } finally { UIContextHolder . popContext ( ) ; } } } else if ( component instanceof WCardManager ) { writeDebugInfo ( ( ( WCardManager ) component ) . getVisible ( ) , xml ) ; } else if ( component instanceof Container ) { final int size = ( ( Container ) component ) . getChildCount ( ) ; for ( int i = 0 ; i < size ; i ++ ) { writeDebugInfo ( ( ( Container ) component ) . getChildAt ( i ) , xml ) ; } } }
public class DAOValidatorHelper { /** * Methode permettant de resoudre les variables d ' environnement dans une chemin * @ param expressionExpression du chemin * @ returnExpression resolue */ public static String resolveEnvironmentsParameters ( String expression ) { } }
// Si l ' expression est vide if ( expression == null || expression . trim ( ) . length ( ) == 0 ) { // On retourne null return null ; } // Tant que la chaene traitee contient des ENVs while ( isExpressionContainPattern ( expression , ENV_CHAIN_PATTERN ) ) { // Obtention de la liste des ENVs String [ ] envs = extractToken ( expression , ENV_CHAIN_PATTERN ) ; // Parcours for ( String env : envs ) { String cleanEnv = env . replace ( "${" , "" ) ; cleanEnv = cleanEnv . replace ( "}" , "" ) ; // On remplace l ' occurence courante par le nom de la variable expression = expression . replace ( env , System . getProperty ( cleanEnv ) ) ; } } // On retourne l ' expression return expression ;