signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PathsIteratorImpl { /** * ( non - Javadoc ) * @ see java . util . Iterator # hasNext ( ) */ @ Override public boolean hasNext ( ) { } }
boolean hasNext = bundlesIterator . hasNext ( ) ; if ( null != currentBundle && null != currentBundle . getExplorerConditionalExpression ( ) ) commentCallbackHandler . closeConditionalComment ( ) ; return hasNext ;
public class PemX509Certificate { /** * Appends the { @ link PemEncoded } value to the { @ link ByteBuf } ( last arg ) and returns it . * If the { @ link ByteBuf } didn ' t exist yet it ' ll create it using the { @ link ByteBufAllocator } . */ private static ByteBuf append ( ByteBufAllocator allocator , boolean useDirect , PemEncoded encoded , int count , ByteBuf pem ) { } }
ByteBuf content = encoded . content ( ) ; if ( pem == null ) { // see the other append ( ) method pem = newBuffer ( allocator , useDirect , content . readableBytes ( ) * count ) ; } pem . writeBytes ( content . slice ( ) ) ; return pem ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getListOfIfcParameterValue ( ) { } }
if ( listOfIfcParameterValueEClass == null ) { listOfIfcParameterValueEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1180 ) ; } return listOfIfcParameterValueEClass ;
public class FileUtils { /** * 获取文件名称 , 如果获取不到 , 使用自定义接口生成一个名字 * @ param response * @ param nameGenerator * @ return */ public static String getFileNameOr ( TaskResponse response , NameGenerator nameGenerator ) { } }
String name = getFileName ( response ) ; if ( null == name ) { name = nameGenerator . name ( ) ; } return name ;
public class ElementMatchers { /** * Matches a { @ link MethodDescription } by the number of its parameters . * @ param length The expected length . * @ param < T > The type of the matched object . * @ return A matcher that matches a method description by the number of its parameters . */ public static < T extends MethodDescription > ElementMatcher . Junction < T > takesArguments ( int length ) { } }
return new MethodParametersMatcher < T > ( new CollectionSizeMatcher < ParameterList < ? > > ( length ) ) ;
public class Directory { /** * Carry out a one level search * @ param base * @ param filter * @ return DirSearchResult * @ throws NamingException */ public boolean searchOne ( String base , String filter ) throws NamingException { } }
return search ( base , filter , scopeOne ) ;
public class StreamBuilderImpl { /** * filter ( ) async */ @ Override public StreamBuilderImpl < T , U > filter ( PredicateAsync < ? super T > test ) { } }
return new FilterAsync < T , U > ( this , test ) ;
public class LogFileWriter { /** * Read all static information at the start of the file * @ return * @ throws IOException */ public StaticInfo readStatic ( ) throws IOException { } }
List < Pair < UIStaticInfoRecord , Table > > out = new ArrayList < > ( ) ; boolean allStaticRead = false ; try ( RandomAccessFile f = new RandomAccessFile ( file , "r" ) ; FileChannel fc = f . getChannel ( ) ) { f . seek ( 0 ) ; while ( ! allStaticRead ) { // read 2 header ints int lengthHeader = f . readInt ( ) ; int lengthContent = f . readInt ( ) ; // Read header ByteBuffer bb = ByteBuffer . allocate ( lengthHeader ) ; f . getChannel ( ) . read ( bb ) ; bb . flip ( ) ; // Flip for reading UIStaticInfoRecord r = UIStaticInfoRecord . getRootAsUIStaticInfoRecord ( bb ) ; // Read content bb = ByteBuffer . allocate ( lengthContent ) ; f . getChannel ( ) . read ( bb ) ; bb . flip ( ) ; // Flip for reading byte infoType = r . infoType ( ) ; Table t ; switch ( infoType ) { case UIInfoType . GRAPH_STRUCTURE : t = UIGraphStructure . getRootAsUIGraphStructure ( bb ) ; break ; case UIInfoType . SYTEM_INFO : t = UISystemInfo . getRootAsUISystemInfo ( bb ) ; break ; case UIInfoType . START_EVENTS : t = null ; break ; default : throw new RuntimeException ( "Unknown UI static info type: " + r . infoType ( ) ) ; } // TODO do we need to close file here ? out . add ( new Pair < > ( r , t ) ) ; long pointer = f . getFilePointer ( ) ; long length = f . length ( ) ; { log . trace ( "File pointer = {}, file length = {}" , pointer , length ) ; if ( infoType == UIInfoType . START_EVENTS || pointer >= length ) { allStaticRead = true ; } } } StaticInfo s = new StaticInfo ( out , f . getFilePointer ( ) ) ; return s ; }
public class DefaultCrumbIssuer { /** * { @ inheritDoc } */ @ Override protected synchronized String issueCrumb ( ServletRequest request , String salt ) { } }
if ( request instanceof HttpServletRequest ) { if ( md != null ) { HttpServletRequest req = ( HttpServletRequest ) request ; StringBuilder buffer = new StringBuilder ( ) ; Authentication a = Jenkins . getAuthentication ( ) ; if ( a != null ) { buffer . append ( a . getName ( ) ) ; } buffer . append ( ';' ) ; if ( ! isExcludeClientIPFromCrumb ( ) ) { buffer . append ( getClientIP ( req ) ) ; } md . update ( buffer . toString ( ) . getBytes ( ) ) ; return Util . toHexString ( md . digest ( salt . getBytes ( ) ) ) ; } } return null ;
public class SegmentSlic { /** * prepares all data structures */ protected void initalize ( T input ) { } }
this . input = input ; pixels . resize ( input . width * input . height ) ; initialSegments . reshape ( input . width , input . height ) ; // number of usable pixels that cluster centers can be placed in int numberOfUsable = ( input . width - 2 * BORDER ) * ( input . height - 2 * BORDER ) ; gridInterval = ( int ) Math . sqrt ( numberOfUsable / ( double ) numberOfRegions ) ; if ( gridInterval <= 0 ) throw new IllegalArgumentException ( "Too many regions for an image of this size" ) ; // See equation ( 1) adjustSpacial = m / gridInterval ;
public class ProductPayApi { /** * Huawei Api Client 连接回调 * @ param rst 结果码 * @ param client HuaweiApiClient 实例 */ @ Override public void onConnect ( int rst , HuaweiApiClient client ) { } }
HMSAgentLog . d ( "onConnect:" + rst ) ; if ( client == null || ! ApiClientMgr . INST . isConnect ( client ) ) { HMSAgentLog . e ( "client not connted" ) ; onPMSPayEnd ( rst , null ) ; return ; } // 调用HMS - SDK pay 接口 PendingResult < PayResult > payResult = HuaweiPay . HuaweiPayApi . productPay ( client , payReq ) ; payResult . setResultCallback ( new ResultCallback < PayResult > ( ) { @ Override public void onResult ( PayResult result ) { if ( result == null ) { HMSAgentLog . e ( "result is null" ) ; onPMSPayEnd ( HMSAgent . AgentResultCode . RESULT_IS_NULL , null ) ; return ; } Status status = result . getStatus ( ) ; if ( status == null ) { HMSAgentLog . e ( "status is null" ) ; onPMSPayEnd ( HMSAgent . AgentResultCode . STATUS_IS_NULL , null ) ; return ; } int rstCode = status . getStatusCode ( ) ; HMSAgentLog . d ( "status=" + status ) ; // 需要重试的错误码 , 并且可以重试 if ( ( rstCode == CommonCode . ErrorCode . SESSION_INVALID || rstCode == CommonCode . ErrorCode . CLIENT_API_INVALID ) && retryTimes > 0 ) { retryTimes -- ; connect ( ) ; } else if ( rstCode == PayStatusCodes . PAY_STATE_SUCCESS ) { // 支付校验完成 , 取当前activity进行后续支付操作 Activity curActivity = ActivityMgr . INST . getLastActivity ( ) ; if ( curActivity == null ) { HMSAgentLog . e ( "activity is null" ) ; onPMSPayEnd ( HMSAgent . AgentResultCode . NO_ACTIVITY_FOR_USE , null ) ; return ; } if ( statusForPay != null ) { HMSAgentLog . e ( "has already a pay to dispose" ) ; onPMSPayEnd ( HMSAgent . AgentResultCode . REQUEST_REPEATED , null ) ; return ; } // 启动支付流程 try { statusForPay = status ; Intent intent = new Intent ( curActivity , HMSPMSPayAgentActivity . class ) ; intent . putExtra ( BaseAgentActivity . EXTRA_IS_FULLSCREEN , UIUtils . isActivityFullscreen ( curActivity ) ) ; curActivity . startActivity ( intent ) ; } catch ( Exception e ) { HMSAgentLog . e ( "start HMSPayAgentActivity error:" + e . getMessage ( ) ) ; onPMSPayEnd ( HMSAgent . AgentResultCode . START_ACTIVITY_ERROR , null ) ; } } else { onPMSPayEnd ( rstCode , null ) ; } } } ) ;
public class XMLUtil { /** * Replies an XML / HTML color . * @ param rgba the color components . * @ return the XML color encoding . * @ see # parseColor ( String ) */ @ Pure @ SuppressWarnings ( "checkstyle:magicnumber" ) public static String toColor ( int rgba ) { } }
final String code = ColorNames . getColorNameFromValue ( rgba ) ; if ( ! Strings . isNullOrEmpty ( code ) ) { return code ; } final StringBuilder s = new StringBuilder ( "#" ) ; // $ NON - NLS - 1 $ s . append ( Integer . toHexString ( rgba ) ) ; while ( s . length ( ) < 7 ) { s . insert ( 1 , '0' ) ; } return s . toString ( ) ;
public class HamtPMap { /** * Returns a new map with the given key removed . If the key was not present in the first place , * then this same map will be returned . */ @ Override public HamtPMap < K , V > minus ( K key ) { } }
return ! isEmpty ( ) ? minus ( key , hash ( key ) , null ) : this ;
public class BaseThickActivator { /** * Add this property if it exists in the OSGi config file . * @ param properties * @ param key * @ param defaultValue * @ return */ public Map < String , Object > addConfigProperty ( Map < String , Object > properties , String key , String defaultValue ) { } }
if ( this . getProperty ( key ) != null ) properties . put ( key , this . getProperty ( key ) ) ; else if ( defaultValue != null ) properties . put ( key , defaultValue ) ; return properties ;
public class NanoHTTPD { /** * Override this to customize the server . < p > * ( By default , this delegates to serveFile ( ) and allows directory listing . ) * @ param uriPercent - decoded URI without parameters , for example " / index . cgi " * @ param method " GET " , " POST " etc . * @ param parmsParsed , percent decoded parameters from URI and , in case of POST , data . * @ param headerHeader entries , percent decoded * @ return HTTP response , see class Response for details */ public Response serve ( String uri , String method , Properties header , Properties parms ) { } }
myOut . println ( method + " '" + uri + "' " ) ; Enumeration e = header . propertyNames ( ) ; while ( e . hasMoreElements ( ) ) { String value = ( String ) e . nextElement ( ) ; myOut . println ( " HDR: '" + value + "' = '" + header . getProperty ( value ) + "'" ) ; } e = parms . propertyNames ( ) ; while ( e . hasMoreElements ( ) ) { String value = ( String ) e . nextElement ( ) ; myOut . println ( " PRM: '" + value + "' = '" + parms . getProperty ( value ) + "'" ) ; } return serveFile ( uri , header , myRootDir , true ) ;
public class FlowControllerGenerator { /** * Gets all the public , protected , default ( package ) access , * and private fields , including inherited fields , that have * desired annotations . */ static boolean includeFieldAnnotations ( AnnotationToXML atx , TypeDeclaration typeDecl , String additionalAnnotation ) { } }
boolean hasFieldAnnotations = false ; if ( ! ( typeDecl instanceof ClassDeclaration ) ) { return hasFieldAnnotations ; } ClassDeclaration jclass = ( ClassDeclaration ) typeDecl ; FieldDeclaration [ ] fields = jclass . getFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { AnnotationInstance fieldAnnotation = CompilerUtils . getAnnotation ( fields [ i ] , JpfLanguageConstants . SHARED_FLOW_FIELD_TAG_NAME ) ; if ( fieldAnnotation == null ) { fieldAnnotation = CompilerUtils . getAnnotationFullyQualified ( fields [ i ] , CONTROL_ANNOTATION ) ; } if ( fieldAnnotation == null && additionalAnnotation != null ) { fieldAnnotation = CompilerUtils . getAnnotation ( fields [ i ] , additionalAnnotation ) ; } if ( fieldAnnotation != null ) { atx . include ( fields [ i ] , fieldAnnotation ) ; hasFieldAnnotations = true ; } } ClassType superclass = jclass . getSuperclass ( ) ; boolean superclassHasFieldAnns = false ; if ( superclass != null ) { superclassHasFieldAnns = includeFieldAnnotations ( atx , CompilerUtils . getDeclaration ( superclass ) , additionalAnnotation ) ; } return hasFieldAnnotations || superclassHasFieldAnns ;
public class inatparam { /** * Use this API to fetch all the inatparam resources that are configured on netscaler . */ public static inatparam get ( nitro_service service ) throws Exception { } }
inatparam obj = new inatparam ( ) ; inatparam [ ] response = ( inatparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class ContainerInfo { /** * < pre > * URI to the hosted container image in a Docker repository . The URI must be * fully qualified and include a tag or digest . * Examples : " gcr . io / my - project / image : tag " or " gcr . io / my - project / image & # 64 ; digest " * < / pre > * < code > string image = 1 ; < / code > */ public java . lang . String getImage ( ) { } }
java . lang . Object ref = image_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; image_ = s ; return s ; }
public class OptionalDouble { /** * Returns an { @ code OptionalDouble } with the specified value , or empty { @ code OptionalDouble } if value is null . * @ param value the value which can be null * @ return an { @ code OptionalDouble } * @ since 1.2.1 */ @ NotNull public static OptionalDouble ofNullable ( @ Nullable Double value ) { } }
return value == null ? EMPTY : new OptionalDouble ( value ) ;
public class EntityImpl { /** * If not already created , a new < code > id - class < / code > element with the given value will be created . * Otherwise , the existing < code > id - class < / code > element will be returned . * @ return a new or existing instance of < code > IdClass < Entity < T > > < / code > */ public IdClass < Entity < T > > getOrCreateIdClass ( ) { } }
Node node = childNode . getOrCreate ( "id-class" ) ; IdClass < Entity < T > > idClass = new IdClassImpl < Entity < T > > ( this , "id-class" , childNode , node ) ; return idClass ;
public class WebServerJettyImpl { /** * 创建用于正常运行调试的Jetty Server , 以src / main / webapp为Web应用目录 . */ @ Override public Server build ( int port , String webApp , String contextPath ) throws BindException { } }
port = this . getAutoPort ( port ) ; serverInitializer . run ( ) ; Server server = new Server ( port ) ; WebAppContext webContext = new WebAppContext ( webApp , contextPath ) ; // webContext . setDefaultsDescriptor ( " leopard - jetty / webdefault . xml " ) ; // 问题点 : http : / / stackoverflow . com / questions / 13222071 / spring - 3-1 - webapplicationinitializer - embedded - jetty - 8 - annotationconfiguration webContext . setConfigurations ( new Configuration [ ] { new EmbedWebInfConfiguration ( ) , new MetaInfConfiguration ( ) , new AnnotationConfiguration ( ) , new WebXmlConfiguration ( ) , new FragmentConfiguration ( ) // new TagLibConfiguration ( ) / / } ) ; // webContext . setConfigurations ( new Configuration [ ] { / / // new EmbedWebInfConfiguration ( ) / / // , new EmbedWebXmlConfiguration ( ) / / // , new EmbedMetaInfConfiguration ( ) / / // , new EmbedFragmentConfiguration ( ) / / // , new EmbedAnnotionConfiguration ( ) / / // / / , new PlusConfiguration ( ) , / / // / / new EnvConfiguration ( ) / / WebAppClassLoader classLoader = null ; try { // addTldLib ( webContext ) ; classLoader = new LeopardClassLoader ( webContext ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } // ClassLoader tldClassLoader = addTldLib ( classLoader ) ; webContext . setClassLoader ( classLoader ) ; webContext . setParentLoaderPriority ( true ) ; // logger . debug ( webContext . dump ( ) ) ; Handler rewriteHandler = ResourcesManager . getHandler ( ) ; if ( rewriteHandler == null ) { server . setHandler ( webContext ) ; } else { HandlerCollection handlers = new HandlerCollection ( ) ; handlers . addHandler ( rewriteHandler ) ; handlers . addHandler ( webContext ) ; server . setHandler ( handlers ) ; } server . setStopAtShutdown ( true ) ; return server ;
public class LiveEventsInner { /** * Create Live Event . * Creates a Live Event . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param liveEventName The name of the Live Event . * @ param parameters Live Event properties needed for creation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws ApiErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the LiveEventInner object if successful . */ public LiveEventInner create ( String resourceGroupName , String accountName , String liveEventName , LiveEventInner parameters ) { } }
return createWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class ServletHandlerMBean { protected void defineManagedResource ( ) { } }
super . defineManagedResource ( ) ; defineAttribute ( "usingCookies" ) ; defineAttribute ( "servlets" , READ_ONLY , ON_MBEAN ) ; defineAttribute ( "sessionManager" , READ_ONLY , ON_MBEAN ) ; _servletHandler = ( ServletHandler ) getManagedResource ( ) ;
public class Main { /** * A function that calculates the count of the n - digit positive integers where n is a positive integer , * which either start or end with 1. */ public static int countNumsStartEndOne ( int numDigits ) { } public static void main ( String [ ] args ) { System . out . println ( countNumsStartEndOne ( 2 ) ) ; } }
if ( numDigits == 1 ) return 1 ; else return 18 * ( int ) Math . pow ( 10 , ( numDigits - 2 ) ) ;
public class Config { /** * Sets the value of a configuration variable in the " session " scope . * < p > Setting the value of a configuration variable is performed as if * each scope had its own namespace , that is , the same configuration * variable name in one scope does not replace one stored in a different * scope . * @ param session Session object in which the configuration variable is to * be set * @ param name Configuration variable name * @ param value Configuration variable value */ public static void set ( HttpSession session , String name , Object value ) { } }
session . setAttribute ( name + SESSION_SCOPE_SUFFIX , value ) ;
public class UriComponents { /** * Replace all URI template variables with the values from a given array . * < p > The given array represents variable values . The order of variables is significant . * @ param uriVariableValues the URI variable values * @ return the expanded URI components */ public final UriComponents expand ( Object ... uriVariableValues ) { } }
Assert . notNull ( uriVariableValues , "'uriVariableValues' must not be null" ) ; return expandInternal ( new VarArgsTemplateVariables ( uriVariableValues ) ) ;
public class AbstractSessionBasedScope { /** * / * @ Nullable */ protected String tryGetAsPropertyName ( String name ) { } }
if ( name . length ( ) == 1 ) { // e . g . Point . getX ( ) if ( Character . isUpperCase ( name . charAt ( 0 ) ) ) { // X is not a valid sugar for getX ( ) return null ; } // x is a valid sugar for getX return name . toUpperCase ( Locale . ENGLISH ) ; } else if ( name . length ( ) > 1 ) { if ( Character . isUpperCase ( name . charAt ( 1 ) ) ) { // e . g . Resource . getURI // if second char is uppercase , the name itself is the sugar variant // URI is the property name for getURI if ( Character . isUpperCase ( name . charAt ( 0 ) ) ) { return name ; } // if the first character is not upper case , it ' s not a valid sugar variant // e . g . uRI is no sugar access for getURI return null ; } else if ( Character . isUpperCase ( name . charAt ( 0 ) ) ) { // the first character is upper case , it is not valid property sugar , e . g . // Class . CanonicalName does not map to Class . getCanonicalName return null ; } else { // code from java . beans . NameGenerator . capitalize ( ) return name . substring ( 0 , 1 ) . toUpperCase ( Locale . ENGLISH ) + name . substring ( 1 ) ; } } // length 0 is invalid return null ;
public class AbstractHtmlTableCell { /** * Base support for setting behavior values via the { @ link IBehaviorConsumer } interface . The * AbstractHtmlTableCell does not support any attributes by default . Attributes set via this * interface are used to configure internal functionality of the tags which is not exposed * via JSP tag attributes . * @ param name the name of the behavior * @ param value the value of the behavior * @ param facet the name of a facet of the tag to which the behavior will be applied . This is optional . * @ throws JspException */ public void setBehavior ( String name , Object value , String facet ) throws JspException { } }
String s = Bundle . getString ( "Tags_BehaviorFacetNotSupported" , new Object [ ] { facet } ) ; throw new JspException ( s ) ;
public class JournalOutputFile { /** * Create a < code > File < / code > object with the name of this Journal file . * Check to be sure that no such file already exists . */ private File createFilename ( String filenamePrefix , File journalDirectory ) throws JournalException { } }
String filename = JournalHelper . createTimestampedFilename ( filenamePrefix , new Date ( ) ) ; File theFile = new File ( journalDirectory , filename ) ; if ( theFile . exists ( ) ) { throw new JournalException ( "File '" + theFile . getPath ( ) + "' already exists." ) ; } return theFile ;
public class IfcBSplineSurfaceWithKnotsImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < Double > getVKnots ( ) { } }
return ( EList < Double > ) eGet ( Ifc4Package . Literals . IFC_BSPLINE_SURFACE_WITH_KNOTS__VKNOTS , true ) ;
public class DITypeInfo { /** * Retrieves the maximum Integer . MAX _ VALUE bounded scale supported for * the type . < p > * @ return the maximum Integer . MAX _ VALUE bounded scale supported * for the type */ Integer getMaxScaleAct ( ) { } }
switch ( type ) { case Types . SQL_DECIMAL : case Types . SQL_NUMERIC : return ValuePool . getInt ( Integer . MAX_VALUE ) ; default : return getMaxScale ( ) ; }
public class CanvasGameContainer { /** * Schedule an update on the EDT */ private void scheduleUpdate ( ) { } }
if ( ! isVisible ( ) ) { return ; } SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { try { container . gameLoop ( ) ; } catch ( SlickException e ) { e . printStackTrace ( ) ; } container . checkDimensions ( ) ; scheduleUpdate ( ) ; } } ) ;
public class MarkedSection { /** * Creates a < CODE > Section < / CODE > , adds it to this < CODE > Section < / CODE > and returns it . * @ paramindentationthe indentation of the new section * @ paramnumberDepththe numberDepth of the section * @ return a new Section object */ public MarkedSection addSection ( float indentation , int numberDepth ) { } }
MarkedSection section = ( ( Section ) element ) . addMarkedSection ( ) ; section . setIndentation ( indentation ) ; section . setNumberDepth ( numberDepth ) ; return section ;
public class LoggerRegistry { /** * Detects if a Logger with the specified name and MessageFactory exists . * @ param name The Logger name to search for . * @ param messageFactory The message factory to search for . * @ return true if the Logger exists , false otherwise . * @ since 2.5 */ public boolean hasLogger ( final String name , final MessageFactory messageFactory ) { } }
return getOrCreateInnerMap ( factoryKey ( messageFactory ) ) . containsKey ( name ) ;
public class CaptchaServlet { /** * Associates a token with an user . * Default implementation stores the token into user session . * @ param req HTTP request * @ param resp HTTP response * @ param token token to be associated with an user . */ protected void store ( HttpServletRequest req , HttpServletResponse resp , String token ) { } }
HttpSession session = req . getSession ( ) ; session . setAttribute ( ATR_SESSION_TOKEN , token ) ;
public class EJSHome { /** * f111627 */ @ Override public EJBLocalObject activateBean_Local ( Object primaryKey ) throws FinderException , RemoteException { } }
EJSWrapperCommon wrappers = null ; // d215317 // Single - object ejbSelect methods may result in a null value , // and since this code path also supports ejbSelect , null must // be tolerated and returned . d149627 if ( primaryKey == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "activateBean_Local : key = null, returning null" ) ; return null ; } // Make a " deep copy " of the primarykey object if the noPriaryKeyMutation // property is false . This property can be set to " true " by the customer // to increase performance , however they must guarentee that their code // will no mutate existing primary key objects . d138865.1 // The copy will actually be made in activateBean _ Common only if the // primary key is used to insert into the cache , but the determination // must be done here , as it is different for local and remote . d215317 // " Primary Key " should not be copied for a StatefulSession bean . d247634 boolean pkeyCopyRequired = false ; if ( ! noPrimaryKeyMutation && ! statefulSessionHome ) { pkeyCopyRequired = true ; } wrappers = ivEntityHelper . activateBean_Common ( this , primaryKey , pkeyCopyRequired ) ; return wrappers . getLocalObject ( ) ;
public class HierarchicalCompositeObservable { /** * private methods - - - - - */ private void updateDelegate ( ) { } }
T parentValue = parent . getValue ( ) ; Observable < U > child = childFactory . createObservable ( parentValue ) ; if ( child == null ) { child = Observables . nullObservable ( ) ; } setDelegate ( child ) ;
public class EnumIO { /** * Retrieves the enum key type from the EnumMap via reflection . This is used by { @ link ObjectSchema } . */ static Class < ? > getElementTypeFromEnumSet ( Object enumSet ) { } }
if ( __elementTypeFromEnumSet == null ) { throw new RuntimeException ( "Could not access (reflection) the private " + "field *elementType* (enumClass) from: class java.util.EnumSet" ) ; } try { return ( Class < ? > ) __elementTypeFromEnumSet . get ( enumSet ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class CookieApplication { /** * Initializes the application with the given configuration . The following * properties are supported : * < dl > * < dt > domain < / dt > * < dd > The static domain to use in setting and retrieving cookies < / dd > * < dt > path < / dt > * < dd > The static path to use in setting and retrieving cookies < / dd > * < dt > isSecure < / dt > * < dd > The boolean state of setting secure or insecure cookies < / dd > * < / dl > * @ param config an ApplicationConfig object containing config . info . */ public void init ( ApplicationConfig config ) throws ServletException { } }
PropertyMap properties = config . getProperties ( ) ; mDomain = properties . getString ( "domain" ) ; mPath = properties . getString ( "path" ) ; mIsSecure = properties . getBoolean ( "isSecure" , false ) ; /* String className = config . getProperties ( ) . getString ( " encoderClass " ) ; if ( className ! = null & & ! className . equals ( " " ) ) { try { Class clazz = Class . forName ( className ) ; mTranscoder = ( StringTranscoder ) clazz . newInstance ( ) ; } catch ( ClassNotFoundException e ) { throw new ServletException ( e ) ; } catch ( InstantiationException e ) { throw new ServletException ( e ) ; } catch ( IllegalAccessException e ) { throw new ServletException ( e ) ; } else { mTranscoder = new Base64StringTranscoder ( ) ; */
public class Properties { /** * Returns the class of the property * @ param clazz * @ param name * @ return */ public static Class < ? > getPropertyType ( Clazz < ? > clazz , String name ) { } }
return propertyValues . getPropertyType ( clazz , name ) ;
public class JmsJcaActivationSpecImpl { /** * ( non - Javadoc ) * @ see javax . resource . spi . ResourceAdapterAssociation # setResourceAdapter ( javax . resource . spi . ResourceAdapter ) */ @ Override public void setResourceAdapter ( final ResourceAdapter resourceAdapter ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setResourceAdapter" , resourceAdapter ) ; } _resourceAdapter = resourceAdapter ;
public class BugTreeModel { /** * This contract has been changed to return a HashList of Stringpair , our * own data structure in which finding the index of an object in the list is * very fast */ private @ Nonnull List < SortableValue > enumsThatExist ( BugAspects a ) { } }
List < Sortables > orderBeforeDivider = st . getOrderBeforeDivider ( ) ; if ( orderBeforeDivider . size ( ) == 0 ) { List < SortableValue > result = Collections . emptyList ( ) ; assert false ; return result ; } Sortables key ; if ( a . size ( ) == 0 ) { key = orderBeforeDivider . get ( 0 ) ; } else { Sortables lastKey = a . last ( ) . key ; int index = orderBeforeDivider . indexOf ( lastKey ) ; if ( index + 1 < orderBeforeDivider . size ( ) ) { key = orderBeforeDivider . get ( index + 1 ) ; } else { key = lastKey ; } } String [ ] all = key . getAll ( bugSet . query ( a ) ) ; ArrayList < SortableValue > result = new ArrayList < > ( all . length ) ; for ( String i : all ) { result . add ( new SortableValue ( key , i ) ) ; } return result ;
public class JCorsConfig { /** * Add a non - simple resource header exposed by the resource . A simple resource header is one of these : Cache - Control , Content - Language , * Content - Type , Expires , Last - Modified , Pragma * @ param header */ public void addExposedHeader ( String header ) { } }
Constraint . ensureNotEmpty ( header , String . format ( "Invalid header '%s'" , header ) ) ; exposedHeaders . add ( header ) ;
public class CreateSnapshotTaskParameters { /** * Parses properties from task parameter string * @ param taskParameters - JSON formatted set of parameters */ public static CreateSnapshotTaskParameters deserialize ( String taskParameters ) { } }
JaxbJsonSerializer < CreateSnapshotTaskParameters > serializer = new JaxbJsonSerializer < > ( CreateSnapshotTaskParameters . class ) ; try { CreateSnapshotTaskParameters params = serializer . deserialize ( taskParameters ) ; // Verify expected parameters if ( null == params . getSpaceId ( ) || params . getSpaceId ( ) . isEmpty ( ) || null == params . getUserEmail ( ) || params . getUserEmail ( ) . isEmpty ( ) ) { throw new SnapshotDataException ( "Task parameter values may not be empty" ) ; } return params ; } catch ( IOException e ) { throw new SnapshotDataException ( "Unable to parse task parameters due to: " + e . getMessage ( ) ) ; }
public class AbstractScoreBasedFeatureSelector { /** * Removes any feature with less occurrences than the threshold . * @ param featureCounts * @ param rareFeatureThreshold */ protected void removeRareFeatures ( Map < Object , Double > featureCounts , int rareFeatureThreshold ) { } }
logger . debug ( "removeRareFeatures()" ) ; Iterator < Map . Entry < Object , Double > > it = featureCounts . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < Object , Double > entry = it . next ( ) ; if ( entry . getValue ( ) < rareFeatureThreshold ) { it . remove ( ) ; } }
public class DateUtils { /** * Identify whether an event date and a year , month , and day are consistent , where consistent * means that either the eventDate is a single day and the year - month - day represent the same day * or that eventDate is a date range that defines the same date range as year - month ( where day is * null ) or the same date range as year ( where day and month are null ) . If all of eventDate , * year , month , and day are null or empty , then returns true . If eventDate specifies an interval * of more than one day and day is specified , then result is true if the day is the first day of the * interval . If eventDate is not null and year , month , and day are , then result is false ( data is * not consistent with no data ) . * Provides : EVENTDATE _ CONSISTENT _ WITH _ DAY _ MONTH _ YEAR * @ param eventDate dwc : eventDate * @ param year dwc : year * @ param month dwc : month * @ param day dwc : day * @ return true if eventDate is consistent with year - month - day . */ public static boolean isConsistent ( String eventDate , String year , String month , String day ) { } }
boolean result = false ; StringBuffer date = new StringBuffer ( ) ; if ( ! isEmpty ( eventDate ) ) { if ( ! isEmpty ( year ) && ! isEmpty ( month ) && ! isEmpty ( day ) ) { date . append ( year ) . append ( "-" ) . append ( month ) . append ( "-" ) . append ( day ) ; if ( ! isRange ( eventDate ) ) { DateMidnight eventDateDate = extractDate ( eventDate ) ; DateMidnight bitsDate = extractDate ( date . toString ( ) ) ; if ( eventDateDate != null && bitsDate != null ) { if ( eventDateDate . year ( ) . compareTo ( bitsDate ) == 0 && eventDateDate . monthOfYear ( ) . compareTo ( bitsDate ) == 0 && eventDateDate . dayOfMonth ( ) . compareTo ( bitsDate ) == 0 ) { result = true ; } } } else { Interval eventDateDate = extractDateInterval ( eventDate ) ; DateMidnight bitsDate = extractDate ( date . toString ( ) ) ; if ( eventDateDate != null && bitsDate != null ) { if ( eventDateDate . getStart ( ) . year ( ) . compareTo ( bitsDate ) == 0 && eventDateDate . getStart ( ) . monthOfYear ( ) . compareTo ( bitsDate ) == 0 && eventDateDate . getStart ( ) . dayOfMonth ( ) . compareTo ( bitsDate ) == 0 ) { result = true ; } } } } if ( ! isEmpty ( year ) && ! isEmpty ( month ) && isEmpty ( day ) ) { date . append ( year ) . append ( "-" ) . append ( month ) ; Interval eventDateInterval = extractDateInterval ( eventDate ) ; Interval bitsInterval = extractDateInterval ( date . toString ( ) ) ; if ( eventDateInterval . equals ( bitsInterval ) ) { result = true ; } } if ( ! isEmpty ( year ) && isEmpty ( month ) && isEmpty ( day ) ) { date . append ( year ) ; Interval eventDateInterval = extractDateInterval ( eventDate ) ; Interval bitsInterval = extractDateInterval ( date . toString ( ) ) ; if ( eventDateInterval . equals ( bitsInterval ) ) { result = true ; } } } else { if ( isEmpty ( year ) && isEmpty ( month ) && isEmpty ( day ) ) { // eventDate , year , month , and day are all empty , treat as consistent . result = true ; } } return result ;
public class PropertyLookup { /** * Reads map of input properties and returns a collection of those that are unique * to that input set . * @ param map Map of key / value pairs * @ return Properties unique to map */ protected Properties difference ( final Map map ) { } }
final Properties difference = new Properties ( ) ; for ( final Object o : map . entrySet ( ) ) { final Map . Entry entry = ( Map . Entry ) o ; final String key = ( String ) entry . getKey ( ) ; final String val = ( String ) entry . getValue ( ) ; if ( ! properties . containsKey ( key ) ) { difference . setProperty ( key , val ) ; } } return difference ;
public class SparseVector { /** * Calcualtes return a + b * @ param b * @ return */ public SparseVector plus ( SparseVector b ) { } }
SparseVector a = this ; if ( a . N != b . N ) throw new IllegalArgumentException ( "Vector lengths disagree : " + a . N + " != " + b . N ) ; SparseVector c = new SparseVector ( N ) ; for ( int i : a . symbolTable ) c . put ( i , a . get ( i ) ) ; // c = a for ( int i : b . symbolTable ) c . put ( i , b . get ( i ) + c . get ( i ) ) ; // c = c + b return c ;
public class CoverTree { /** * prerequisites : d ( p , x ) ≤ covdist ( p ) * @ param p * @ param x _ indx * @ return */ protected TreeNode simpleInsert_ ( TreeNode p , int x_indx ) { } }
// if ( nearest _ ancestor ) // double [ ] dist _ to _ x = new double [ p . numChildren ( ) ] ; // for ( int i = 0 ; i < dist _ to _ x . length ; i + + ) // dist _ to _ x [ i ] = p . getChild ( i ) . dist ( x _ indx ) ; // IndexTable it = new IndexTable ( dist _ to _ x ) ; // for ( int order = 0 ; order < p . numChildren ( ) ; order + + ) / / Line 1: // int q _ indx = it . index ( order ) ; // TreeNode q = p . getChild ( q _ indx ) ; // if ( q . dist ( x _ indx ) < = q . covdist ( ) ) / / line 2 : d ( q , x ) ≤ covdist ( q ) // / / 3 : q ' ← insert _ ( q , x ) // TreeNode q _ prime = simpleInsert _ ( q , x _ indx ) ; // / / 4 : p ' ← p with child q replaced with q ' // p . replaceChild ( q _ indx , q _ prime ) ; // / / 5 : return p ' // return p ; // / / 6 : return rebalance ( p , x ) // return rebalance ( p , x _ indx ) ; // else { for ( int q_indx = 0 ; q_indx < p . numChildren ( ) ; q_indx ++ ) // Line 1: { TreeNode q = p . getChild ( q_indx ) ; if ( q . dist ( x_indx ) <= q . covdist ( ) ) // line 2 : d ( q , x ) ≤ covdist ( q ) { // 3 : q ' ← insert _ ( q , x ) TreeNode q_prime = simpleInsert_ ( q , x_indx ) ; // 4 : p ' ← p with child q replaced with q ' p . replaceChild ( q_indx , q_prime ) ; // 5 : return p ' return p ; } } // 6 : return p with x added as a child p . addChild ( new TreeNode ( x_indx , p . level - 1 ) ) ; return p ; }
public class HtmlEscape { /** * Perform an HTML5 level 2 ( result is ASCII ) < strong > escape < / strong > operation on a < tt > String < / tt > input , * writing results to a < tt > Writer < / tt > . * < em > Level 2 < / em > means this method will escape : * < ul > * < li > The five markup - significant characters : < tt > & lt ; < / tt > , < tt > & gt ; < / tt > , < tt > & amp ; < / tt > , * < tt > & quot ; < / tt > and < tt > & # 39 ; < / tt > < / li > * < li > All non ASCII characters . < / li > * < / ul > * This escape will be performed by replacing those chars by the corresponding HTML5 Named Character References * ( e . g . < tt > ' & amp ; acute ; ' < / tt > ) when such NCR exists for the replaced character , and replacing by a decimal * character reference ( e . g . < tt > ' & amp ; # 8345 ; ' < / tt > ) when there there is no NCR for the replaced character . * This method calls { @ link # escapeHtml ( String , Writer , HtmlEscapeType , HtmlEscapeLevel ) } with the following * preconfigured values : * < ul > * < li > < tt > type < / tt > : * { @ link org . unbescape . html . HtmlEscapeType # HTML5 _ NAMED _ REFERENCES _ DEFAULT _ TO _ DECIMAL } < / li > * < li > < tt > level < / tt > : * { @ link org . unbescape . html . HtmlEscapeLevel # LEVEL _ 2 _ ALL _ NON _ ASCII _ PLUS _ MARKUP _ SIGNIFICANT } < / li > * < / ul > * This method is < strong > thread - safe < / strong > . * @ param text the < tt > String < / tt > to be escaped . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ throws IOException if an input / output exception occurs * @ since 1.1.2 */ public static void escapeHtml5 ( final String text , final Writer writer ) throws IOException { } }
escapeHtml ( text , writer , HtmlEscapeType . HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL , HtmlEscapeLevel . LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT ) ;
public class EventQueue { public synchronized EventData getNextEvent ( int event_type ) throws DevFailed { } }
EventData ev_data = null ; for ( EventData event : events ) if ( event . event_type == event_type ) ev_data = event ; if ( ev_data == null ) Except . throw_exception ( "BUFFER_EMPTY" , "No " + TangoConst . eventNames [ event_type ] + " in event queue." , "EventQueue.getNextEvent()" ) ; events . remove ( ev_data ) ; return ev_data ;
public class JobSubmission { /** * Returns the entity with the required fields for an insert set . * @ return */ public JobSubmission instantiateForInsert ( ) { } }
JobSubmission entity = new JobSubmission ( ) ; entity . setIsDeleted ( Boolean . FALSE ) ; entity . setStatus ( "Submitted" ) ; entity . setCandidate ( new Candidate ( 1 ) ) ; entity . setJobOrder ( new JobOrder ( 1 ) ) ; return entity ;
public class StructrFileAttributes { /** * - - - - - interface PosixFileAttributeView - - - - - */ @ Override public String name ( ) { } }
if ( file == null ) { return null ; } String name = null ; try ( Tx tx = StructrApp . getInstance ( securityContext ) . tx ( ) ) { name = file . getName ( ) ; tx . success ( ) ; } catch ( FrameworkException fex ) { logger . error ( "" , fex ) ; } return name ;
public class BDBCursor { /** * Returns a copy of the data array . */ protected static byte [ ] getDataCopy ( byte [ ] data , int size ) { } }
if ( data == null ) { return NO_DATA ; } byte [ ] newData = new byte [ size ] ; System . arraycopy ( data , 0 , newData , 0 , size ) ; return newData ;
public class CompositeType { /** * Check the composite for being a well formed group encodedLength encoding . This means * that there are the fields " blockLength " and " numInGroup " present . * @ param node of the XML for this composite */ public void checkForWellFormedGroupSizeEncoding ( final Node node ) { } }
final EncodedDataType blockLengthType = ( EncodedDataType ) containedTypeByNameMap . get ( "blockLength" ) ; final EncodedDataType numInGroupType = ( EncodedDataType ) containedTypeByNameMap . get ( "numInGroup" ) ; if ( blockLengthType == null ) { XmlSchemaParser . handleError ( node , "composite for group encodedLength encoding must have \"blockLength\"" ) ; } else if ( ! isUnsigned ( blockLengthType . primitiveType ( ) ) ) { XmlSchemaParser . handleError ( node , "\"blockLength\" must be unsigned type" ) ; } else { if ( blockLengthType . primitiveType ( ) != UINT8 && blockLengthType . primitiveType ( ) != UINT16 ) { XmlSchemaParser . handleWarning ( node , "\"blockLength\" should be UINT8 or UINT16" ) ; } final PrimitiveValue blockLengthTypeMaxValue = blockLengthType . maxValue ( ) ; validateGroupMaxValue ( node , blockLengthType . primitiveType ( ) , blockLengthTypeMaxValue ) ; } if ( numInGroupType == null ) { XmlSchemaParser . handleError ( node , "composite for group encodedLength encoding must have \"numInGroup\"" ) ; } else if ( ! isUnsigned ( numInGroupType . primitiveType ( ) ) ) { XmlSchemaParser . handleWarning ( node , "\"numInGroup\" should be unsigned type" ) ; final PrimitiveValue numInGroupMinValue = numInGroupType . minValue ( ) ; if ( null == numInGroupMinValue ) { XmlSchemaParser . handleError ( node , "\"numInGroup\" minValue must be set for signed types" ) ; } else if ( numInGroupMinValue . longValue ( ) < 0 ) { XmlSchemaParser . handleError ( node , String . format ( "\"numInGroup\" minValue=%s must be greater than zero " + "for signed \"numInGroup\" types" , numInGroupMinValue ) ) ; } } else { if ( numInGroupType . primitiveType ( ) != UINT8 && numInGroupType . primitiveType ( ) != UINT16 ) { XmlSchemaParser . handleWarning ( node , "\"numInGroup\" should be UINT8 or UINT16" ) ; } final PrimitiveValue numInGroupMaxValue = numInGroupType . maxValue ( ) ; validateGroupMaxValue ( node , numInGroupType . primitiveType ( ) , numInGroupMaxValue ) ; final PrimitiveValue numInGroupMinValue = numInGroupType . minValue ( ) ; if ( null != numInGroupMinValue ) { final long max = numInGroupMaxValue != null ? numInGroupMaxValue . longValue ( ) : numInGroupType . primitiveType ( ) . maxValue ( ) . longValue ( ) ; if ( numInGroupMinValue . longValue ( ) > max ) { XmlSchemaParser . handleError ( node , String . format ( "\"numInGroup\" minValue=%s greater than maxValue=%d" , numInGroupMinValue , max ) ) ; } } }
public class DynamicCacheAccessor { /** * This method will return a DistributedMap reference to the dynamic cache . * @ return Reference to the DistributedMap or null * if caching is disabled . * @ since v6.0 * @ ibm - api * @ deprecated baseCache is used for servlet caching . It should not be used * as a DistributedMap . */ public static DistributedMap getDistributedMap ( ) { } }
final String methodName = "getDistributedMap()" ; if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName ) ; } DistributedMap distributedMap = null ; Context context = null ; if ( isObjectCachingEnabled ( ) ) { try { context = new InitialContext ( ) ; distributedMap = ( DistributedObjectCache ) context . lookup ( DCacheBase . DEFAULT_BASE_JNDI_NAME ) ; } catch ( NamingException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.websphere.cache.DynamicCacheAccessor.getDistributedMap" , "99" , com . ibm . websphere . cache . DynamicCacheAccessor . class ) ; // No need to do anything else , since FFDC prints stack traces } finally { try { if ( context != null ) { context . close ( ) ; } } catch ( NamingException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.websphere.cache.DynamicCacheAccessor.getDistributedMap" , "110" , com . ibm . websphere . cache . DynamicCacheAccessor . class ) ; } } } else { // DYNA1060E = DYNA1060E : WebSphere Dynamic Cache instance named { 0 } cannot be used because of Dynamic Object cache service has not be started . Tr . error ( tc , "DYNA1060W" , new Object [ ] { DCacheBase . DEFAULT_BASE_JNDI_NAME } ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , distributedMap ) ; } return distributedMap ;
public class AgentInternalEventsDispatcher { /** * Execute every single Behaviors runnable , a dedicated thread will created by the executor local to this class and be used to * execute each runnable in parallel , and this method waits until its future has been completed before leaving . * < p > This function may fail if one of the called handlers has failed . Errors are logged by the executor service too . * @ param behaviorsMethodsToExecute the collection of Behaviors runnable that must be executed . * @ throws InterruptedException - something interrupt the waiting of the event handler terminations . * @ throws ExecutionException - when the event handlers cannot be called ; or when one of the event handler has failed during * its run . */ private void executeBehaviorMethodsInParalellWithSynchroAtTheEnd ( Collection < Runnable > behaviorsMethodsToExecute ) throws InterruptedException , ExecutionException { } }
final CountDownLatch doneSignal = new CountDownLatch ( behaviorsMethodsToExecute . size ( ) ) ; final OutputParameter < Throwable > runException = new OutputParameter < > ( ) ; for ( final Runnable runnable : behaviorsMethodsToExecute ) { this . executor . execute ( new JanusRunnable ( ) { @ Override public void run ( ) { try { runnable . run ( ) ; } catch ( EarlyExitException e ) { // Ignore this exception } catch ( RuntimeException e ) { // Catch exception for notifying the caller runException . set ( e ) ; // Do the standard behavior too - > logging throw e ; } catch ( Exception e ) { // Catch exception for notifying the caller runException . set ( e ) ; // Do the standard behavior too - > logging throw new RuntimeException ( e ) ; } finally { doneSignal . countDown ( ) ; } } } ) ; } // Wait for all Behaviors runnable to complete before continuing try { doneSignal . await ( ) ; } catch ( InterruptedException ex ) { // This exception occurs when one of the launched task kills the agent before all the // submitted tasks are finished . Keep in mind that killing an agent should kill the // launched tasks . // Example of code that is generating this issue : // on Initialize { // in ( 100 ) [ // killMe // In this example , the killMe is launched before the Initialize code is finished ; // and because the Initialize event is fired through the current function , it // causes the InterruptedException . } // Re - throw the run - time exception if ( runException . get ( ) != null ) { throw new ExecutionException ( runException . get ( ) ) ; }
public class CPDefinitionLocalServiceUtil { /** * Returns the cp definition matching the UUID and group . * @ param uuid the cp definition ' s UUID * @ param groupId the primary key of the group * @ return the matching cp definition , or < code > null < / code > if a matching cp definition could not be found */ public static com . liferay . commerce . product . model . CPDefinition fetchCPDefinitionByUuidAndGroupId ( String uuid , long groupId ) { } }
return getService ( ) . fetchCPDefinitionByUuidAndGroupId ( uuid , groupId ) ;
public class ResourceList { /** * Creates union of all resources . */ public static ResourceList union ( Collection < ResourceList > lists ) { } }
switch ( lists . size ( ) ) { case 0 : return EMPTY ; case 1 : return lists . iterator ( ) . next ( ) ; default : ResourceList r = new ResourceList ( ) ; for ( ResourceList l : lists ) { r . all . addAll ( l . all ) ; for ( Entry < Resource , Integer > e : l . write . entrySet ( ) ) r . write . put ( e . getKey ( ) , unbox ( r . write . get ( e . getKey ( ) ) ) + e . getValue ( ) ) ; } return r ; }
public class Session { /** * Returns the form parameter parser associated with the first context found that includes the URL , * or the default parser if it is not * in a context * @ param url * @ return */ public ParameterParser getFormParamParser ( String url ) { } }
List < Context > contexts = getContextsForUrl ( url ) ; if ( contexts . size ( ) > 0 ) { return contexts . get ( 0 ) . getPostParamParser ( ) ; } return this . defaultParamParser ;
public class Postconditions { /** * A { @ code long } specialized version of { @ link # checkPostcondition ( Object , * Predicate , Function ) } * @ param condition The predicate * @ param value The value * @ param describer The describer of the predicate * @ return value * @ throws PostconditionViolationException If the predicate is false */ public static long checkPostconditionL ( final long value , final boolean condition , final LongFunction < String > describer ) { } }
return innerCheckL ( value , condition , describer ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "axisDirection" ) public JAXBElement < CodeType > createAxisDirection ( CodeType value ) { } }
return new JAXBElement < CodeType > ( _AxisDirection_QNAME , CodeType . class , null , value ) ;
public class ListT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # scanLeft ( cyclops2 . function . Monoid ) */ @ Override public ListT < W , T > scanLeft ( final Monoid < T > monoid ) { } }
return ( ListT < W , T > ) FoldableTransformerSeq . super . scanLeft ( monoid ) ;
public class FileObjectReaderImpl { /** * Reads a sequence of bytes from file into the given buffer . * @ param dst * buffer * @ throws IOException * if any Exception is occurred */ private void readFully ( ByteBuffer dst ) throws IOException { } }
int r = channel . read ( dst ) ; if ( r < 0 ) throw new EOFException ( ) ; if ( r < dst . capacity ( ) && r > 0 ) throw new StreamCorruptedException ( "Unexpected EOF in middle of data block." ) ;
public class HttpHeaderTenantWriter { /** * Writes the token to the request . * @ param request The { @ link MutableHttpRequest } instance * @ param tenant Tenant Id */ @ Override public void writeTenant ( MutableHttpRequest < ? > request , Serializable tenant ) { } }
if ( tenant instanceof CharSequence ) { request . header ( getHeaderName ( ) , ( CharSequence ) tenant ) ; }
public class AbstractList { /** * Checks if the given range is within the contained array ' s bounds . * @ throws IndexOutOfBoundsException if < tt > to ! = from - 1 | | from & lt ; 0 | | from & gt ; to | | to & gt ; = size ( ) < / tt > . */ protected static void checkRangeFromTo ( int from , int to , int theSize ) { } }
if ( to == from - 1 ) return ; if ( from < 0 || from > to || to >= theSize ) throw new IndexOutOfBoundsException ( "from: " + from + ", to: " + to + ", size=" + theSize ) ;
public class InternalXbaseParser { /** * InternalXbase . g : 2688:1 : ruleXShortClosure returns [ EObject current = null ] : ( ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) ( ( lv _ expression _ 5_0 = ruleXExpression ) ) ) ; */ public final EObject ruleXShortClosure ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_2 = null ; Token lv_explicitSyntax_4_0 = null ; EObject lv_declaredFormalParameters_1_0 = null ; EObject lv_declaredFormalParameters_3_0 = null ; EObject lv_expression_5_0 = null ; enterRule ( ) ; try { // InternalXbase . g : 2694:2 : ( ( ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) ( ( lv _ expression _ 5_0 = ruleXExpression ) ) ) ) // InternalXbase . g : 2695:2 : ( ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) ( ( lv _ expression _ 5_0 = ruleXExpression ) ) ) { // InternalXbase . g : 2695:2 : ( ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) ( ( lv _ expression _ 5_0 = ruleXExpression ) ) ) // InternalXbase . g : 2696:3 : ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) ( ( lv _ expression _ 5_0 = ruleXExpression ) ) { // InternalXbase . g : 2696:3 : ( ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) ) // InternalXbase . g : 2697:4 : ( ( ( ) ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) { // InternalXbase . g : 2722:4 : ( ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) ) // InternalXbase . g : 2723:5 : ( ) ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) { // InternalXbase . g : 2723:5 : ( ) // InternalXbase . g : 2724:6: { if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getXShortClosureAccess ( ) . getXClosureAction_0_0_0 ( ) , current ) ; } } // InternalXbase . g : 2730:5 : ( ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * ) ? int alt46 = 2 ; int LA46_0 = input . LA ( 1 ) ; if ( ( LA46_0 == RULE_ID || LA46_0 == 32 || LA46_0 == 49 ) ) { alt46 = 1 ; } switch ( alt46 ) { case 1 : // InternalXbase . g : 2731:6 : ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * { // InternalXbase . g : 2731:6 : ( ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) ) // InternalXbase . g : 2732:7 : ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) { // InternalXbase . g : 2732:7 : ( lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter ) // InternalXbase . g : 2733:8 : lv _ declaredFormalParameters _ 1_0 = ruleJvmFormalParameter { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXShortClosureAccess ( ) . getDeclaredFormalParametersJvmFormalParameterParserRuleCall_0_0_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_39 ) ; lv_declaredFormalParameters_1_0 = ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXShortClosureRule ( ) ) ; } add ( current , "declaredFormalParameters" , lv_declaredFormalParameters_1_0 , "org.eclipse.xtext.xbase.Xbase.JvmFormalParameter" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalXbase . g : 2750:6 : ( otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) ) * loop45 : do { int alt45 = 2 ; int LA45_0 = input . LA ( 1 ) ; if ( ( LA45_0 == 48 ) ) { alt45 = 1 ; } switch ( alt45 ) { case 1 : // InternalXbase . g : 2751:7 : otherlv _ 2 = ' , ' ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) { otherlv_2 = ( Token ) match ( input , 48 , FOLLOW_13 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_2 , grammarAccess . getXShortClosureAccess ( ) . getCommaKeyword_0_0_1_1_0 ( ) ) ; } // InternalXbase . g : 2755:7 : ( ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) ) // InternalXbase . g : 2756:8 : ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) { // InternalXbase . g : 2756:8 : ( lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter ) // InternalXbase . g : 2757:9 : lv _ declaredFormalParameters _ 3_0 = ruleJvmFormalParameter { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXShortClosureAccess ( ) . getDeclaredFormalParametersJvmFormalParameterParserRuleCall_0_0_1_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_39 ) ; lv_declaredFormalParameters_3_0 = ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXShortClosureRule ( ) ) ; } add ( current , "declaredFormalParameters" , lv_declaredFormalParameters_3_0 , "org.eclipse.xtext.xbase.Xbase.JvmFormalParameter" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop45 ; } } while ( true ) ; } break ; } // InternalXbase . g : 2776:5 : ( ( lv _ explicitSyntax _ 4_0 = ' | ' ) ) // InternalXbase . g : 2777:6 : ( lv _ explicitSyntax _ 4_0 = ' | ' ) { // InternalXbase . g : 2777:6 : ( lv _ explicitSyntax _ 4_0 = ' | ' ) // InternalXbase . g : 2778:7 : lv _ explicitSyntax _ 4_0 = ' | ' { lv_explicitSyntax_4_0 = ( Token ) match ( input , 56 , FOLLOW_4 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( lv_explicitSyntax_4_0 , grammarAccess . getXShortClosureAccess ( ) . getExplicitSyntaxVerticalLineKeyword_0_0_2_0 ( ) ) ; } if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXShortClosureRule ( ) ) ; } setWithLastConsumed ( current , "explicitSyntax" , true , "|" ) ; } } } } } // InternalXbase . g : 2792:3 : ( ( lv _ expression _ 5_0 = ruleXExpression ) ) // InternalXbase . g : 2793:4 : ( lv _ expression _ 5_0 = ruleXExpression ) { // InternalXbase . g : 2793:4 : ( lv _ expression _ 5_0 = ruleXExpression ) // InternalXbase . g : 2794:5 : lv _ expression _ 5_0 = ruleXExpression { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXShortClosureAccess ( ) . getExpressionXExpressionParserRuleCall_1_0 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; lv_expression_5_0 = ruleXExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXShortClosureRule ( ) ) ; } set ( current , "expression" , lv_expression_5_0 , "org.eclipse.xtext.xbase.Xbase.XExpression" ) ; afterParserOrEnumRuleCall ( ) ; } } } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class JdbiFactory { /** * Build a fully configured { @ link Jdbi } instance managed by the DropWizard lifecycle * with the configured health check ; this method should not be overridden * ( instead , override { @ link # newInstance ( ManagedDataSource ) } and * { @ link # configure ( Jdbi ) } ) * @ param environment * @ param configuration * @ param dataSource * @ param name * @ return A fully configured { @ link Jdbi } object */ public Jdbi build ( Environment environment , PooledDataSourceFactory configuration , ManagedDataSource dataSource , String name ) { } }
// Create the instance final Jdbi jdbi = newInstance ( dataSource ) ; // Manage the data source that created this instance . environment . lifecycle ( ) . manage ( dataSource ) ; // Setup the required health checks . final Optional < String > validationQuery = configuration . getValidationQuery ( ) ; environment . healthChecks ( ) . register ( name , new JdbiHealthCheck ( environment . getHealthCheckExecutorService ( ) , configuration . getValidationQueryTimeout ( ) . orElseGet ( ( ) -> Duration . seconds ( 5 ) ) , jdbi , validationQuery ) ) ; // Setup the SQL logger jdbi . setSqlLogger ( buildSQLLogger ( environment . metrics ( ) , nameStrategy ) ) ; if ( configuration . isAutoCommentsEnabled ( ) ) { final TemplateEngine original = jdbi . getConfig ( SqlStatements . class ) . getTemplateEngine ( ) ; jdbi . setTemplateEngine ( new NamePrependingTemplateEngine ( original ) ) ; } configure ( jdbi ) ; return jdbi ;
public class BackgroundThreadFactory { /** * / * ( non - Javadoc ) * @ see java . util . concurrent . ThreadFactory # newThread ( java . lang . Runnable ) */ public Thread newThread ( Runnable r ) { } }
/* Use the inner ThreadFactory to create a new thread . */ Thread thread = this . inner . newThread ( r ) ; /* Make the thread a daemon thread that runs at the lowest possible * priority . */ thread . setDaemon ( true ) ; thread . setPriority ( Thread . MIN_PRIORITY ) ; return thread ;
public class TransactionScope { /** * Unregisters a previously registered cursor . Cursors should unregister * when closed . */ public < S extends Storable > void unregister ( Class < S > type , Cursor < S > cursor ) { } }
mLock . lock ( ) ; try { if ( mCursors != null ) { CursorList < TransactionImpl < Txn > > cursorList = mCursors . get ( type ) ; if ( cursorList != null ) { TransactionImpl < Txn > txnImpl = cursorList . unregister ( cursor ) ; if ( txnImpl != null ) { txnImpl . unregister ( cursor ) ; } } } } finally { mLock . unlock ( ) ; }
public class OGCGeometry { /** * it produces a single OGCGeometry . */ private OGCGeometry simplifyBunch_ ( GeometryCursor gc ) { } }
// Combines geometries into multipoint , polyline , and polygon types , // simplifying them and unioning them , // then produces OGCGeometry from the result . // Can produce OGCConcreteGoemetryCollection MultiPoint dstMultiPoint = null ; ArrayList < Geometry > dstPolylines = new ArrayList < Geometry > ( ) ; ArrayList < Geometry > dstPolygons = new ArrayList < Geometry > ( ) ; for ( com . esri . core . geometry . Geometry g = gc . next ( ) ; g != null ; g = gc . next ( ) ) { switch ( g . getType ( ) ) { case Point : if ( dstMultiPoint == null ) dstMultiPoint = new MultiPoint ( ) ; dstMultiPoint . add ( ( Point ) g ) ; break ; case MultiPoint : if ( dstMultiPoint == null ) dstMultiPoint = new MultiPoint ( ) ; dstMultiPoint . add ( ( MultiPoint ) g , 0 , - 1 ) ; break ; case Polyline : dstPolylines . add ( ( Polyline ) g . copy ( ) ) ; break ; case Polygon : dstPolygons . add ( ( Polygon ) g . copy ( ) ) ; break ; default : throw new UnsupportedOperationException ( ) ; } } ArrayList < Geometry > result = new ArrayList < Geometry > ( 3 ) ; if ( dstMultiPoint != null ) { Geometry resMP = OperatorSimplifyOGC . local ( ) . execute ( dstMultiPoint , esriSR , true , null ) ; result . add ( resMP ) ; } if ( dstPolylines . size ( ) > 0 ) { if ( dstPolylines . size ( ) == 1 ) { Geometry resMP = OperatorSimplifyOGC . local ( ) . execute ( dstPolylines . get ( 0 ) , esriSR , true , null ) ; result . add ( resMP ) ; } else { GeometryCursor res = OperatorUnion . local ( ) . execute ( new SimpleGeometryCursor ( dstPolylines ) , esriSR , null ) ; Geometry resPolyline = res . next ( ) ; Geometry resMP = OperatorSimplifyOGC . local ( ) . execute ( resPolyline , esriSR , true , null ) ; result . add ( resMP ) ; } } if ( dstPolygons . size ( ) > 0 ) { if ( dstPolygons . size ( ) == 1 ) { Geometry resMP = OperatorSimplifyOGC . local ( ) . execute ( dstPolygons . get ( 0 ) , esriSR , true , null ) ; result . add ( resMP ) ; } else { GeometryCursor res = OperatorUnion . local ( ) . execute ( new SimpleGeometryCursor ( dstPolygons ) , esriSR , null ) ; Geometry resPolygon = res . next ( ) ; Geometry resMP = OperatorSimplifyOGC . local ( ) . execute ( resPolygon , esriSR , true , null ) ; result . add ( resMP ) ; } } return OGCGeometry . createFromEsriCursor ( new SimpleGeometryCursor ( result ) , esriSR ) ;
public class IndexedDocument { /** * Add an edge to the graph . Update namedRelationMap , effectRelationMap and causeRelationMap , accordingly . * Edges with different attributes are considered distinct . */ public < T extends Relation > T add ( T statement , int num , Collection < T > anonRelationCollection , HashMap < QualifiedName , Collection < T > > namedRelationMap , HashMap < QualifiedName , Collection < T > > effectRelationMap , HashMap < QualifiedName , Collection < T > > causeRelationMap ) { } }
QualifiedName aid2 = u . getEffect ( statement ) ; // wib . getInformed ( ) ; QualifiedName aid1 = u . getCause ( statement ) ; // wib . getInformant ( ) ; statement = pFactory . newStatement ( statement ) ; // clone QualifiedName id ; if ( statement instanceof Identifiable ) { id = ( ( Identifiable ) statement ) . getId ( ) ; } else { id = null ; } if ( id == null ) { boolean found = false ; Collection < T > relationCollection = effectRelationMap . get ( aid2 ) ; if ( relationCollection == null ) { relationCollection = new LinkedList < T > ( ) ; relationCollection . add ( statement ) ; effectRelationMap . put ( aid2 , relationCollection ) ; } else { for ( T u : relationCollection ) { if ( u . equals ( statement ) ) { found = true ; statement = u ; break ; } } if ( ! found ) { relationCollection . add ( statement ) ; } } relationCollection = causeRelationMap . get ( aid1 ) ; if ( relationCollection == null ) { relationCollection = new LinkedList < T > ( ) ; relationCollection . add ( statement ) ; causeRelationMap . put ( aid1 , relationCollection ) ; } else { if ( ! found ) { // if we had not found it in the first table , then we // have to add it here too relationCollection . add ( statement ) ; } } if ( ! found ) { anonRelationCollection . add ( statement ) ; } } else { Collection < T > relationCollection = namedRelationMap . get ( id ) ; if ( relationCollection == null ) { relationCollection = new LinkedList < T > ( ) ; relationCollection . add ( statement ) ; namedRelationMap . put ( id , relationCollection ) ; } else { boolean found = false ; for ( T u1 : relationCollection ) { if ( sameEdge ( u1 , statement , num ) ) { found = true ; mergeAttributes ( u1 , statement ) ; break ; } } if ( ! found ) { relationCollection . add ( statement ) ; } } } return statement ;
public class LatchedObserver { /** * Create a LatchedObserver with the given indexed callback function ( s ) and a shared latch . */ public static < T > LatchedObserver < T > createIndexed ( Action2 < ? super T , ? super Integer > onNext , Action1 < ? super Throwable > onError , CountDownLatch latch ) { } }
return new LatchedObserverIndexedImpl < T > ( onNext , onError , Functionals . empty ( ) , latch ) ;
public class UnscaledDecimal128Arithmetic { /** * visible for testing */ static int [ ] shiftLeftMultiPrecision ( int [ ] number , int length , int shifts ) { } }
if ( shifts == 0 ) { return number ; } // wordShifts = shifts / 32 int wordShifts = shifts >>> 5 ; // we don ' t wan ' t to loose any leading bits for ( int i = 0 ; i < wordShifts ; i ++ ) { checkState ( number [ length - i - 1 ] == 0 ) ; } if ( wordShifts > 0 ) { arraycopy ( number , 0 , number , wordShifts , length - wordShifts ) ; fill ( number , 0 , wordShifts , 0 ) ; } // bitShifts = shifts % 32 int bitShifts = shifts & 0b11111 ; if ( bitShifts > 0 ) { // we don ' t wan ' t to loose any leading bits checkState ( number [ length - 1 ] >>> ( Integer . SIZE - bitShifts ) == 0 ) ; for ( int position = length - 1 ; position > 0 ; position -- ) { number [ position ] = ( number [ position ] << bitShifts ) | ( number [ position - 1 ] >>> ( Integer . SIZE - bitShifts ) ) ; } number [ 0 ] = number [ 0 ] << bitShifts ; } return number ;
public class ServiceDependencyBuilder { /** * Creates a generic ServiceDependencyBuilder with type = " service " and subtype = " OTHER " . * @ param url the url or uri - template of the accessed service . * @ return ServiceDependencyBuilder */ public static ServiceDependencyBuilder serviceDependency ( final String url ) { } }
return new ServiceDependencyBuilder ( ) . withUrl ( url ) . withType ( ServiceDependency . TYPE_SERVICE ) . withSubtype ( ServiceDependency . SUBTYPE_OTHER ) ;
public class AlertService { /** * Returns all notifications for the given alert ID . * @ param alertId The alert ID . * @ return The list of notifications for the alert . Will never be null , but may be empty . * @ throws IOException If the server cannot be reached . * @ throws TokenExpiredException If the token sent along with the request has expired */ public List < Notification > getNotifications ( BigInteger alertId ) throws IOException , TokenExpiredException { } }
String requestUrl = RESOURCE + "/" + alertId . toString ( ) + "/notifications" ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . GET , requestUrl , null ) ; assertValidResponse ( response , requestUrl ) ; return fromJson ( response . getResult ( ) , new TypeReference < List < Notification > > ( ) { } ) ;
public class VirtualMachinesInner { /** * Run command on the VM . * @ param resourceGroupName The name of the resource group . * @ param vmName The name of the virtual machine . * @ param parameters Parameters supplied to the Run command operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < ServiceResponse < RunCommandResultInner > > runCommandWithServiceResponseAsync ( String resourceGroupName , String vmName , RunCommandInput parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( vmName == null ) { throw new IllegalArgumentException ( "Parameter vmName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( parameters ) ; Observable < Response < ResponseBody > > observable = service . runCommand ( resourceGroupName , vmName , this . client . subscriptionId ( ) , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) ; return client . getAzureClient ( ) . getPostOrDeleteResultAsync ( observable , new TypeToken < RunCommandResultInner > ( ) { } . getType ( ) ) ;
public class AndroidEventBuilderHelper { /** * CHECKSTYLE . OFF : JavadocMethod */ protected Map < String , Map < String , Object > > getContexts ( ) { } }
Map < String , Map < String , Object > > contexts = new HashMap < > ( ) ; Map < String , Object > deviceMap = new HashMap < > ( ) ; Map < String , Object > osMap = new HashMap < > ( ) ; Map < String , Object > appMap = new HashMap < > ( ) ; contexts . put ( "os" , osMap ) ; contexts . put ( "device" , deviceMap ) ; contexts . put ( "app" , appMap ) ; // Device deviceMap . put ( "manufacturer" , Build . MANUFACTURER ) ; deviceMap . put ( "brand" , Build . BRAND ) ; deviceMap . put ( "model" , Build . MODEL ) ; deviceMap . put ( "family" , getFamily ( ) ) ; deviceMap . put ( "model_id" , Build . ID ) ; deviceMap . put ( "battery_level" , getBatteryLevel ( ctx ) ) ; deviceMap . put ( "orientation" , getOrientation ( ctx ) ) ; deviceMap . put ( "simulator" , IS_EMULATOR ) ; deviceMap . put ( "arch" , Build . CPU_ABI ) ; deviceMap . put ( "storage_size" , getTotalInternalStorage ( ) ) ; deviceMap . put ( "free_storage" , getUnusedInternalStorage ( ) ) ; deviceMap . put ( "external_storage_size" , getTotalExternalStorage ( ) ) ; deviceMap . put ( "external_free_storage" , getUnusedExternalStorage ( ) ) ; deviceMap . put ( "charging" , isCharging ( ctx ) ) ; deviceMap . put ( "online" , isConnected ( ctx ) ) ; DisplayMetrics displayMetrics = getDisplayMetrics ( ctx ) ; if ( displayMetrics != null ) { int largestSide = Math . max ( displayMetrics . widthPixels , displayMetrics . heightPixels ) ; int smallestSide = Math . min ( displayMetrics . widthPixels , displayMetrics . heightPixels ) ; String resolution = Integer . toString ( largestSide ) + "x" + Integer . toString ( smallestSide ) ; deviceMap . put ( "screen_resolution" , resolution ) ; deviceMap . put ( "screen_density" , displayMetrics . density ) ; deviceMap . put ( "screen_dpi" , displayMetrics . densityDpi ) ; } ActivityManager . MemoryInfo memInfo = getMemInfo ( ctx ) ; if ( memInfo != null ) { deviceMap . put ( "free_memory" , memInfo . availMem ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) { deviceMap . put ( "memory_size" , memInfo . totalMem ) ; } deviceMap . put ( "low_memory" , memInfo . lowMemory ) ; } // Operating System osMap . put ( "name" , "Android" ) ; osMap . put ( "version" , Build . VERSION . RELEASE ) ; osMap . put ( "build" , Build . DISPLAY ) ; osMap . put ( "kernel_version" , KERNEL_VERSION ) ; osMap . put ( "rooted" , isRooted ( ) ) ; // App PackageInfo packageInfo = getPackageInfo ( ctx ) ; if ( packageInfo != null ) { appMap . put ( "app_version" , packageInfo . versionName ) ; appMap . put ( "app_build" , packageInfo . versionCode ) ; appMap . put ( "app_identifier" , packageInfo . packageName ) ; } appMap . put ( "app_name" , getApplicationName ( ctx ) ) ; appMap . put ( "app_start_time" , stringifyDate ( new Date ( ) ) ) ; return contexts ;
public class BuildTasksInner { /** * Deletes a specified build task . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildTaskName The name of the container registry build task . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > beginDeleteAsync ( String resourceGroupName , String registryName , String buildTaskName , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginDeleteWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName ) , serviceCallback ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcArithmeticOperatorEnum ( ) { } }
if ( ifcArithmeticOperatorEnumEEnum == null ) { ifcArithmeticOperatorEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 915 ) ; } return ifcArithmeticOperatorEnumEEnum ;
public class SnapshotStore { /** * Creates a new snapshot . * @ param index The snapshot index . * @ return The snapshot . */ public Snapshot createSnapshot ( long index ) { } }
SnapshotDescriptor descriptor = SnapshotDescriptor . builder ( ) . withIndex ( index ) . withTimestamp ( System . currentTimeMillis ( ) ) . build ( ) ; return createSnapshot ( descriptor ) ;
public class TimeRestrictedAccessPolicy { /** * Returns true if the given time matches the day - of - week restrictions specified * by the included filter / rule . * @ param currentTime * @ param filter */ private boolean matchesDay ( DateTime currentTime , TimeRestrictedAccess filter ) { } }
Integer dayStart = filter . getDayStart ( ) ; Integer dayEnd = filter . getDayEnd ( ) ; int dayNow = currentTime . getDayOfWeek ( ) ; if ( dayStart >= dayEnd ) { return dayNow >= dayStart && dayNow <= dayEnd ; } else { return dayNow <= dayEnd && dayNow >= dayStart ; }
public class ChronoFormatter { /** * / * [ deutsch ] * < p > Konstruiert einen generischen Formatierer f & uuml ; r universelle Zeitstempel mit Hilfe * eines CLDR - Formatmusters und einer von der angegebenen Sprache abgeleiteten Kalenderchronologie . < / p > * < p > Wenn die angegebene { @ code locale } eine Unicode - ca - Erweiterung hat , dann wird Time4J versuchen , * eine geeignete Kalenderchronologie zu laden , falls vorhanden . Sonst wird ISO - 8601 verwendet . Zum * Formatieren ist es notwendig , die Zeitzone am fertiggestellten Formatierer zu setzen . < / p > * @ param pattern format pattern * @ param locale format locale * @ return new { @ code ChronoFormatter } - instance * @ throws IllegalArgumentException if resolving of pattern fails or a requested calendar cannot be found * @ see # ofPattern ( String , PatternType , Locale , Chronology ) * @ see # with ( Locale ) * @ see PatternType # CLDR * @ see Locale # forLanguageTag ( String ) * @ since 4.27 */ public static ChronoFormatter < Moment > ofGenericMomentPattern ( String pattern , Locale locale ) { } }
// Note : - - - - - // Style - based formatters with override are not possible // because there are no non - iso - generic format patterns including date AND time try { Chronology < CalendarDate > overrideCalendar = CalendarConverter . getChronology ( locale ) ; Builder < Moment > builder = new Builder < > ( Moment . axis ( ) , locale , overrideCalendar ) ; return builder . addPattern ( pattern , PatternType . CLDR ) . build ( ) ; } catch ( IllegalStateException ise ) { throw new IllegalArgumentException ( ise ) ; }
public class TrueTypeFont { /** * Gets the font parameter identified by < CODE > key < / CODE > . Valid values * for < CODE > key < / CODE > are < CODE > ASCENT < / CODE > , < CODE > CAPHEIGHT < / CODE > , < CODE > DESCENT < / CODE > * and < CODE > ITALICANGLE < / CODE > . * @ param key the parameter to be extracted * @ param fontSize the font size in points * @ return the parameter in points */ public float getFontDescriptor ( int key , float fontSize ) { } }
switch ( key ) { case ASCENT : return os_2 . sTypoAscender * fontSize / head . unitsPerEm ; case CAPHEIGHT : return os_2 . sCapHeight * fontSize / head . unitsPerEm ; case DESCENT : return os_2 . sTypoDescender * fontSize / head . unitsPerEm ; case ITALICANGLE : return ( float ) italicAngle ; case BBOXLLX : return fontSize * head . xMin / head . unitsPerEm ; case BBOXLLY : return fontSize * head . yMin / head . unitsPerEm ; case BBOXURX : return fontSize * head . xMax / head . unitsPerEm ; case BBOXURY : return fontSize * head . yMax / head . unitsPerEm ; case AWT_ASCENT : return fontSize * hhea . Ascender / head . unitsPerEm ; case AWT_DESCENT : return fontSize * hhea . Descender / head . unitsPerEm ; case AWT_LEADING : return fontSize * hhea . LineGap / head . unitsPerEm ; case AWT_MAXADVANCE : return fontSize * hhea . advanceWidthMax / head . unitsPerEm ; case UNDERLINE_POSITION : return ( underlinePosition - underlineThickness / 2 ) * fontSize / head . unitsPerEm ; case UNDERLINE_THICKNESS : return underlineThickness * fontSize / head . unitsPerEm ; case STRIKETHROUGH_POSITION : return os_2 . yStrikeoutPosition * fontSize / head . unitsPerEm ; case STRIKETHROUGH_THICKNESS : return os_2 . yStrikeoutSize * fontSize / head . unitsPerEm ; case SUBSCRIPT_SIZE : return os_2 . ySubscriptYSize * fontSize / head . unitsPerEm ; case SUBSCRIPT_OFFSET : return - os_2 . ySubscriptYOffset * fontSize / head . unitsPerEm ; case SUPERSCRIPT_SIZE : return os_2 . ySuperscriptYSize * fontSize / head . unitsPerEm ; case SUPERSCRIPT_OFFSET : return os_2 . ySuperscriptYOffset * fontSize / head . unitsPerEm ; } return 0 ;
public class BatchListAttachedIndicesResponseMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchListAttachedIndicesResponse batchListAttachedIndicesResponse , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchListAttachedIndicesResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchListAttachedIndicesResponse . getIndexAttachments ( ) , INDEXATTACHMENTS_BINDING ) ; protocolMarshaller . marshall ( batchListAttachedIndicesResponse . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class JsonWriter { /** * This method writes resource data to a JSON file . */ private void writeResources ( ) throws IOException { } }
writeAttributeTypes ( "resource_types" , ResourceField . values ( ) ) ; m_writer . writeStartList ( "resources" ) ; for ( Resource resource : m_projectFile . getResources ( ) ) { writeFields ( null , resource , ResourceField . values ( ) ) ; } m_writer . writeEndList ( ) ;
public class SizeTransform { /** * Calculates the transformation * @ param transformable the transformable * @ param comp the comp */ @ Override protected void doTransform ( Size < T > transformable , float comp ) { } }
int fromWidth = reversed ? this . toWidth : this . fromWidth ; int toWidth = reversed ? this . fromWidth : this . toWidth ; int fromHeight = reversed ? this . toHeight : this . fromHeight ; int toHeight = reversed ? this . fromHeight : this . toHeight ; transformable . setSize ( ( int ) ( fromWidth + ( toWidth - fromWidth ) * comp ) , ( int ) ( fromHeight + ( toHeight - fromHeight ) * comp ) ) ;
public class KunderaQuery { /** * Sets the parameter . * @ param position * the position * @ param value * the value */ public final void setParameter ( int position , Object value ) { } }
if ( isNative ( ) ) { bindParameters . add ( new BindParameter ( position , value ) ) ; } else { setParameterValue ( "?" + position , value ) ; } parametersMap . put ( "?" + position , value ) ;
public class BoxFileUploadSession { /** * Creates the file isntance from the JSON body of the response . */ private BoxFile . Info getFile ( BoxJSONResponse response ) { } }
JsonObject jsonObject = JsonObject . readFrom ( response . getJSON ( ) ) ; JsonArray array = ( JsonArray ) jsonObject . get ( "entries" ) ; JsonObject fileObj = ( JsonObject ) array . get ( 0 ) ; BoxFile file = new BoxFile ( this . getAPI ( ) , fileObj . get ( "id" ) . asString ( ) ) ; return file . new Info ( fileObj ) ;
public class QueryGenerator { /** * 将数字集合append为 ( ' n1 ' , ' n2 ' , ' n3 ' ) 这种格式的字符串 * @ param ns * @ return */ public static final String connectObjects ( Collection < ? > ns ) { } }
if ( ns == null || ns . size ( ) == 0 ) { return "()" ; } StringBuilder sb = new StringBuilder ( ns . size ( ) * 8 ) ; int size = ns . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { sb . append ( ",?" ) ; } sb . setCharAt ( 0 , '(' ) ; sb . append ( ')' ) ; return sb . toString ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcObjectiveEnum ( ) { } }
if ( ifcObjectiveEnumEEnum == null ) { ifcObjectiveEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 862 ) ; } return ifcObjectiveEnumEEnum ;
public class ConvolveImageMean { /** * Performs a horizontal 1D convolution which computes the mean value of elements * inside the kernel . * @ param input The original image . Not modified . * @ param output Where the resulting image is written to . Modified . * @ param radius Kernel size . */ public static void horizontal ( GrayU8 input , GrayU8 output , int radius ) { } }
boolean processed = BOverrideConvolveImageMean . invokeNativeHorizontal ( input , output , radius ) ; if ( ! processed ) { Kernel1D_S32 kernel = FactoryKernel . table1D_I32 ( radius ) ; if ( kernel . width > input . width ) { ConvolveImageNormalized . horizontal ( kernel , input , output ) ; } else { InputSanityCheck . checkSameShape ( input , output ) ; ConvolveNormalized_JustBorder_SB . horizontal ( kernel , input , output ) ; if ( BoofConcurrency . USE_CONCURRENT ) { ImplConvolveMean_MT . horizontal ( input , output , radius ) ; } else { ImplConvolveMean . horizontal ( input , output , radius ) ; } } }
public class PreloadFontManager { /** * Create and add a new embedding { @ link PreloadFont } if it is not yet * contained . * @ param aFontRes * The font resource to be added for embedding . May not be * < code > null < / code > . * @ return The created { @ link PreloadFont } . Never < code > null < / code > . */ @ Nonnull public PreloadFont getOrAddEmbeddingPreloadFont ( @ Nonnull final IFontResource aFontRes ) { } }
ValueEnforcer . notNull ( aFontRes , "FontRes" ) ; PreloadFont aPreloadFont = getPreloadFontOfID ( aFontRes ) ; if ( aPreloadFont == null ) { aPreloadFont = PreloadFont . createEmbedding ( aFontRes ) ; addPreloadFont ( aPreloadFont ) ; } return aPreloadFont ;
public class Hasher { /** * Returns the hash value of the section with the section number and the * messageDigest . * The section ' s size must be greater than 0 , otherwise the returned array * has zero length . * @ param sectionNumber * the section ' s number * @ param messageDigest * the message digest algorithm * @ return hash value of the section with the section number * @ throws IOException */ public byte [ ] sectionHash ( int sectionNumber , MessageDigest messageDigest ) throws IOException { } }
SectionTable table = data . getSectionTable ( ) ; SectionHeader header = table . getSectionHeader ( sectionNumber ) ; long start = header . getAlignedPointerToRaw ( ) ; long end = new SectionLoader ( data ) . getReadSize ( header ) + start ; if ( end <= start ) { logger . warn ( "The physical section size must be greater than zero!" ) ; return new byte [ 0 ] ; } return computeHash ( data . getFile ( ) , messageDigest , start , end ) ;
public class PagingTableModel { /** * Gets the object at the given row . * @ param rowIndex the index of the row * @ return { @ code null } if object is not in the current page */ protected T getRowObject ( int rowIndex ) { } }
int pageIndex = rowIndex - dataOffset ; if ( pageIndex >= 0 && pageIndex < data . size ( ) ) { return data . get ( pageIndex ) ; } return null ;
public class ResponseMessage { /** * @ see javax . servlet . ServletResponse # setContentType ( java . lang . String ) */ @ Override public void setContentType ( String value ) { } }
if ( isCommitted ( ) ) { return ; } if ( null == value ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setContentType: null, removing header" ) ; } this . response . removeHeader ( "Content-Type" ) ; return ; } boolean addEncoding = false ; String type = value ; // see if the input value contains a charset int charsetIndex = value . indexOf ( "charset=" ) ; if ( - 1 != charsetIndex ) { if ( null == this . outWriter ) { // can update both mime - set and charset addEncoding = true ; this . encoding = connection . getEncodingUtils ( ) . stripQuotes ( value . substring ( charsetIndex + 8 ) ) ; } else { // can only update the mimeset so strip the charset off type = value . substring ( 0 , charsetIndex ) . trim ( ) ; charsetIndex = - 1 ; } } if ( null != this . outWriter ) { // can still update the mime - type but not charset addEncoding = true ; } else { // TODO don ' t quite follow why webcontainer checks for text * if ( type . startsWith ( "text" ) ) { addEncoding = true ; } } if ( addEncoding ) { if ( - 1 != charsetIndex ) { type = type . substring ( 0 , charsetIndex - 1 ) ; } if ( this . encoding != null ) { type = type + ";charset=" + this . encoding ; } } this . contentType = type ; this . response . setHeader ( "Content-Type" , type ) ;
public class ProcessConsolePageParticipant { /** * ( non - Javadoc ) * @ see org . eclipse . debug . core . IDebugEventSetListener # handleDebugEvents ( org . eclipse . debug . core . DebugEvent [ ] ) */ public void handleDebugEvents ( DebugEvent [ ] events ) { } }
for ( int i = 0 ; i < events . length ; i ++ ) { DebugEvent event = events [ i ] ; if ( event . getSource ( ) . equals ( getProcess ( ) ) ) { Runnable r = new Runnable ( ) { public void run ( ) { if ( fTerminate != null ) { fTerminate . update ( ) ; } } } ; DebugUIPlugin . getStandardDisplay ( ) . asyncExec ( r ) ; } }
public class ClassServiceUtility { /** * Create this object given the class name . * @ param filepath * @ return */ public URL getResourceURL ( String filepath , URL urlCodeBase , String version , ClassLoader classLoader ) throws RuntimeException { } }
if ( filepath == null ) return null ; if ( File . separatorChar != '/' ) filepath = filepath . replace ( File . separatorChar , '/' ) ; // Just in case I get a window ' s path boolean isResource = true ; if ( urlCodeBase != null ) if ( "file" . equalsIgnoreCase ( urlCodeBase . getProtocol ( ) ) ) isResource = false ; URL url = null ; try { if ( isResource ) if ( classLoader != null ) { url = classLoader . getResource ( filepath ) ; if ( url == null ) if ( filepath . startsWith ( "/" ) ) url = classLoader . getResource ( filepath . substring ( 1 ) ) ; // Classpaths shouldn ' t start with root } } catch ( Exception e ) { // Keep trying } if ( url == null ) { if ( isResource ) if ( this . getClassFinder ( null ) != null ) url = this . getClassFinder ( null ) . findResourceURL ( filepath , version ) ; // Try to find this class in the obr repos } if ( url == null ) { try { if ( urlCodeBase != null ) url = new URL ( urlCodeBase , filepath ) ; } catch ( MalformedURLException ex ) { // Keep trying } catch ( Exception e ) { // Keep trying } } return url ;
public class Anima { /** * Delete model by id * @ param model model type class * @ param id model primary key * @ param < T > * @ return */ public static < T extends Model > int deleteById ( Class < T > model , Serializable id ) { } }
return new AnimaQuery < > ( model ) . deleteById ( id ) ;
public class AbstractMultipleOrderedOptionsBaseTableModel { /** * Moves the element at the given { @ code row } one position up , effectively switching position with the previous element . * The order of both elements is updated accordingly and all listeners notified . * @ param row the row of the element that should be moved one position up */ public void moveUp ( int row ) { } }
E entry = getElement ( row ) ; int firstRow = row - 1 ; getElements ( ) . add ( firstRow , entry ) ; getElements ( ) . remove ( row + 1 ) ; entry . setOrder ( row ) ; getElements ( ) . get ( row ) . setOrder ( row + 1 ) ; fireTableRowsUpdated ( firstRow , row ) ;