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 useDi...
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 extend...
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 ...
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 ( ! isE...
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 ...
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 ) ; pa...
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 . toSt...
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 , p...
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 . hasMor...
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 = ...
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 im...
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 ( @ Nul...
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 > */ p...
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 / 132220...
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 Ev...
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 ( countNumsStartEnd...
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 ...
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 UriComp...
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 (...
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 expo...
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 ( flo...
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 hasLogg...
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...
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...
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 i...
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 & &...
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...
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 ( ) ....
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 ( wher...
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 eventD...
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 ( ke...
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 ...
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 . numChildr...
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 char...
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 ) ; ret...
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 encodedLeng...
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 D...
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 ...
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 f...
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 ( ...
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 */ p...
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 ( ) , u...
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 PostconditionViolationEx...
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 > } */ @ XmlElement...
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 ) ) ( ot...
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 ) )...
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...
// 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 . heal...
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 <...
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 , HashMa...
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 ) . get...
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 -...
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 ...
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 toke...
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...
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 ...
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 ...
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 ) ; con...
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...
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 Uni...
// 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 . a...
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 extrac...
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 font...
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 ( batchListAttachedIndicesRespon...
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 - fromWi...
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 vo...
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 ....
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 >...
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...
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 great...
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 ; // se...
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 ; U...
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 shou...
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 ) ;