signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ResourceProcessor { /** * d543514 */ static AuthenticationType convertAuthToEnum ( int resAuthType ) { } }
AuthenticationType authType = AuthenticationType . CONTAINER ; if ( resAuthType == ResourceRef . AUTH_APPLICATION ) { authType = AuthenticationType . APPLICATION ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "convertAuthToEnum : " + resAuthType + " -> " + authType ) ; ...
public class CloseCallbacks { /** * Returns a { @ link CloseCallback } that shows a confirmation dialog that * asks the given question * @ param question The question * @ return The { @ link CloseCallback } */ public static CloseCallback confirming ( String question ) { } }
return new CloseCallback ( ) { @ Override public boolean mayClose ( Component componentInTab ) { int option = JOptionPane . showConfirmDialog ( componentInTab , question , "Confirm" , JOptionPane . YES_NO_OPTION ) ; return option == JOptionPane . YES_OPTION ; } } ;
public class CmsLogFileApp { /** * Button to refresh the file view . < p > */ private void addRefreshButton ( ) { } }
Button button = CmsToolBar . createButton ( FontOpenCms . RESET , CmsVaadinUtils . getMessageText ( Messages . GUI_LOGFILE_REFRESH_FILEVIEW_0 ) ) ; button . addClickListener ( new ClickListener ( ) { private static final long serialVersionUID = 1L ; public void buttonClick ( ClickEvent event ) { m_fileView . updateView...
public class JavacHandlerUtil { /** * Creates an expression that reads the field . Will either be { @ code this . field } or { @ code this . getField ( ) } depending on whether or not there ' s a getter . */ static JCExpression createFieldAccessor ( JavacTreeMaker maker , JavacNode field , FieldAccess fieldAccess ) { }...
return createFieldAccessor ( maker , field , fieldAccess , null ) ;
public class RuntimeConfiguration { /** * Converts a string specifying an IPv4 address into an integer . The string can be either a single integer ( representing * the address ) or a dot - separated 4 - tuple of bytes . * @ param s the string to be converted . * @ return the integer representing the IP address sp...
try { if ( ! RuntimeConfiguration . DOTTED_ADDRESS . matcher ( s ) . matches ( ) ) throw new ConfigurationException ( "Malformed IPv4 " + s + " for blacklisting" ) ; // Note that since we ' re sure this is a dotted - notation address , we pass directly through InetAddress . final byte [ ] address = InetAddress . getByN...
public class TTextProtocol { /** * Helper to write out the beginning of a Thrift type ( either struct or map ) , * both of which are written as JsonObjects . */ private void writeJsonObjectBegin ( BaseContext context ) throws TException { } }
getCurrentContext ( ) . write ( ) ; if ( getCurrentContext ( ) . isMapKey ( ) ) { pushWriter ( new ByteArrayOutputStream ( ) ) ; } pushContext ( context ) ; try { getCurrentWriter ( ) . writeStartObject ( ) ; } catch ( IOException ex ) { throw new TException ( ex ) ; }
public class Strings { /** * A more human - friendly version of Arrays # toString ( byte [ ] ) that uses hex representation . */ private static String byteArrayToString ( byte [ ] bytes ) { } }
StringBuilder builder = new StringBuilder ( "[" ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { if ( i > 0 ) { builder . append ( ", " ) ; } builder . append ( byteToString ( bytes [ i ] ) ) ; } return builder . append ( ']' ) . toString ( ) ;
public class HashIntMap { /** * documentation inherited */ public V get ( int key ) { } }
Record < V > rec = getImpl ( key ) ; return ( rec == null ) ? null : rec . value ;
public class WhileyFileParser { /** * Parse a switch statement , which has the form : * < pre > * SwitchStmt : : = " switch " Expr ' : ' NewLine CaseStmt + * CaseStmt : : = " case " UnitExpr ( ' , ' UnitExpr ) * ' : ' NewLine Block * < / pre > * @ see wyc . lang . Stmt . Switch * @ param scope * The enclo...
int start = index ; match ( Switch ) ; // NOTE : expression terminated by ' : ' Expr condition = parseExpression ( scope , true ) ; match ( Colon ) ; int end = index ; matchEndLine ( ) ; // Match case block Tuple < Stmt . Case > cases = parseCaseBlock ( scope ) ; // Done return annotateSourceLocation ( new Stmt . Switc...
public class ConfigUtils { /** * Returns the specified Boolean property from the configuration * @ param config the configuration * @ param key the key of the property * @ return the Boolean value of the property , or null if not found * @ throws DeployerConfigurationException if an error occurred */ public sta...
return getBooleanProperty ( config , key , null ) ;
public class ReflectUtil { /** * Gets the new instance . * @ param clazz the clazz * @ return the new instance */ public I getNewInstance ( Class < I > clazz ) { } }
Constructor < I > ctor ; try { ctor = clazz . getConstructor ( ) ; return ctor . newInstance ( ) ; } catch ( NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { throw new InitializationException ( "Given class not found...
public class DateTimePatternGenerator { /** * Used by CLDR tooling ; not in ICU4C . * Note , this will not work correctly with normal skeletons , since fields * that should be related in the two skeletons being compared - like EEE and * ccc , or y and U - will not be sorted in the same relative place as each * ...
if ( id . equals ( skeleton ) ) { return true ; // fast path } // must clone array , make sure items are in same order . TreeSet < String > parser1 = getSet ( id ) ; TreeSet < String > parser2 = getSet ( skeleton ) ; if ( parser1 . size ( ) != parser2 . size ( ) ) { return false ; } Iterator < String > it2 = parser2 . ...
public class ThreadGroup { /** * Tests if this thread group is either the thread group * argument or one of its ancestor thread groups . * @ param g a thread group . * @ return < code > true < / code > if this thread group is the thread group * argument or one of its ancestor thread groups ; * < code > false ...
for ( ; g != null ; g = g . parent ) { if ( g == this ) { return true ; } } return false ;
public class HashOrderIndependent { /** * ( non - Javadoc ) * @ see * com . netflix . videometadata . serializer . blob . HashAlgorithm # write ( java . lang * . String ) */ @ Override public void write ( String b ) throws IOException { } }
long code = 0 ; for ( int i = 0 ; i < b . length ( ) ; i ++ ) { code = 31 * code + b . charAt ( i ) ; } hashCode += hash ( code ) ;
public class PropertyUtils { /** * Get an integer property from the properties . * @ param properties the provided properties * @ return the integer property */ public static Integer getIntegerProperty ( Properties properties , String key ) { } }
String property = getStringProperty ( properties , key ) ; if ( property == null ) { return null ; } Integer value ; try { value = Integer . parseInt ( property ) ; } catch ( RuntimeException e ) { throw new ODataClientRuntimeException ( "Unable to parse property. " + property , e ) ; } return value ;
public class JTSPolygonExpression { /** * Returns the N th interior ring for this Polygon as a LineString . * @ param idx one based index * @ return interior ring at index */ public JTSLineStringExpression < LineString > interiorRingN ( int idx ) { } }
return JTSGeometryExpressions . lineStringOperation ( SpatialOps . INTERIOR_RINGN , mixin , ConstantImpl . create ( idx ) ) ;
public class EmailMessageTransport { /** * Send the message and ( optionally ) get the reply . * @ param nodeMessage The XML tree to send . * @ param strDest The destination URL string . * @ return The reply message ( or null if none ) . */ public BaseMessage sendMessageRequest ( BaseMessage messageOut ) { } }
// create some properties and get the default Session TrxMessageHeader trxMessageHeader = ( TrxMessageHeader ) messageOut . getMessageHeader ( ) ; String strFrom = ( String ) trxMessageHeader . get ( TrxMessageHeader . REPLY_TO_PARAM ) ; if ( strFrom == null ) strFrom = this . getProperty ( ( TrxMessageHeader ) message...
public class JsonArray { /** * Convenience method to prevent casting JsonElement to Long when iterating in the common case that you have * an array of longs . * @ return iterable that iterates over Longs instead of JsonElements . */ public @ Nonnull Iterable < Long > longs ( ) { } }
final JsonArray parent = this ; return ( ) -> { final Iterator < JsonElement > iterator = parent . iterator ( ) ; return new Iterator < Long > ( ) { @ Override public boolean hasNext ( ) { return iterator . hasNext ( ) ; } @ Override public Long next ( ) { return iterator . next ( ) . asLong ( ) ; } @ Override public v...
public class DocumentSubscriptions { /** * Creates a data subscription in a database . The subscription will expose all documents that match the specified subscription options for a given type . * @ param options Subscription options * @ param clazz Document class * @ param < T > Document class * @ param databa...
options = ObjectUtils . firstNonNull ( options , new SubscriptionCreationOptions ( ) ) ; return create ( ensureCriteria ( options , clazz , true ) , database ) ;
public class UnicodeEncoding { /** * onigenc _ unicode _ apply _ all _ case _ fold */ @ Override public void applyAllCaseFold ( int flag , ApplyAllCaseFoldFunction fun , Object arg ) { } }
/* if ( CaseFoldInited = = 0 ) init _ case _ fold _ table ( ) ; */ int [ ] code = new int [ ] { 0 } ; for ( int i = 0 ; i < CaseUnfold11 . From . length ; i ++ ) { int from = CaseUnfold11 . From [ i ] ; CodeList to = CaseUnfold11 . To [ i ] ; for ( int j = 0 ; j < to . codes . length ; j ++ ) { code [ 0 ] = from ; fun ...
public class ChemModelManipulator { /** * Sets the AtomProperties of all Atoms inside an IChemModel . * @ param chemModel The IChemModel object . * @ param propKey The key of the property . * @ param propVal The value of the property . */ public static void setAtomProperties ( IChemModel chemModel , Object propKe...
if ( chemModel . getMoleculeSet ( ) != null ) { MoleculeSetManipulator . setAtomProperties ( chemModel . getMoleculeSet ( ) , propKey , propVal ) ; } if ( chemModel . getReactionSet ( ) != null ) { ReactionSetManipulator . setAtomProperties ( chemModel . getReactionSet ( ) , propKey , propVal ) ; } if ( chemModel . get...
public class BitmapUtil { /** * Compresses a specific bitmap and returns it as a byte array . * @ param bitmap * The bitmap , which should be compressed , as an instance of the class { @ link Bitmap } . * The bitmap may not be null * @ param format * The format , which should be used to compress the bitmap , ...
Condition . INSTANCE . ensureNotNull ( bitmap , "The bitmap may not be null" ) ; Condition . INSTANCE . ensureNotNull ( format , "The format may not be null" ) ; Condition . INSTANCE . ensureAtLeast ( quality , 0 , "The quality must be at least 0" ) ; Condition . INSTANCE . ensureAtMaximum ( quality , 100 , "The qualit...
public class AmazonElastiCacheWaiters { /** * Builds a CacheClusterAvailable waiter by using custom parameters waiterParameters and other parameters defined in * the waiters specification , and then polls until it determines whether the resource entered the desired state or * not , where polling criteria is bound b...
return new WaiterBuilder < DescribeCacheClustersRequest , DescribeCacheClustersResult > ( ) . withSdkFunction ( new DescribeCacheClustersFunction ( client ) ) . withAcceptors ( new CacheClusterAvailable . IsAvailableMatcher ( ) , new CacheClusterAvailable . IsDeletedMatcher ( ) , new CacheClusterAvailable . IsDeletingM...
public class PdfPatternPainter { /** * Gets a duplicate of this < CODE > PdfPatternPainter < / CODE > . All * the members are copied by reference but the buffer stays different . * @ return a copy of this < CODE > PdfPatternPainter < / CODE > */ public PdfContentByte getDuplicate ( ) { } }
PdfPatternPainter tpl = new PdfPatternPainter ( ) ; tpl . writer = writer ; tpl . pdf = pdf ; tpl . thisReference = thisReference ; tpl . pageResources = pageResources ; tpl . bBox = new Rectangle ( bBox ) ; tpl . xstep = xstep ; tpl . ystep = ystep ; tpl . matrix = matrix ; tpl . stencil = stencil ; tpl . defaultColor...
public class Files { /** * return a reference to a temp file that contains the written + flushed + fsynced + closed data */ @ Nonnull private static File writeDataToTempFileOrDie ( @ Nonnull final OutputStreamCallback callback , @ Nonnull final File targetFile , @ Nonnull final Logger log ) throws IOException { } }
Preconditions . checkNotNull ( callback , "callback argument is required!" ) ; Preconditions . checkNotNull ( log , "log argument is required!" ) ; Preconditions . checkNotNull ( targetFile , "targetFile argument is required!" ) ; FileOutputStream fileOut = null ; FileChannel fileChannel = null ; try { final String tar...
public class EnvVars { /** * Obtains the environment variables of a remote peer . * @ param channel * Can be null , in which case the map indicating " N / A " will be returned . * @ return * A fresh copy that can be owned and modified by the caller . */ public static EnvVars getRemote ( VirtualChannel channel )...
if ( channel == null ) return new EnvVars ( "N/A" , "N/A" ) ; return channel . call ( new GetEnvVars ( ) ) ;
public class StatementExecutor { /** * Create and return a SelectIterator for the class using the default mapped query for all statement . */ public SelectIterator < T , ID > buildIterator ( BaseDaoImpl < T , ID > classDao , ConnectionSource connectionSource , int resultFlags , ObjectCache objectCache ) throws SQLExcep...
prepareQueryForAll ( ) ; return buildIterator ( classDao , connectionSource , preparedQueryForAll , objectCache , resultFlags ) ;
public class ContextXmlReader { /** * Read the context no - op flag from XML . */ private boolean readContextNoOp ( XMLEventReader reader ) throws XMLStreamException , JournalException { } }
readStartTag ( reader , QNAME_TAG_NOOP ) ; String value = readCharactersUntilEndTag ( reader , QNAME_TAG_NOOP ) ; return Boolean . valueOf ( value ) . booleanValue ( ) ;
public class Matrix4f { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4fc # arcball ( float , float , float , float , float , float , org . joml . Matrix4f ) */ public Matrix4f arcball ( float radius , float centerX , float centerY , float centerZ , float angleX , float angleY , Matrix4f dest ) { } }
float m30 = m20 * - radius + this . m30 ; float m31 = m21 * - radius + this . m31 ; float m32 = m22 * - radius + this . m32 ; float m33 = m23 * - radius + this . m33 ; float sin = ( float ) Math . sin ( angleX ) ; float cos = ( float ) Math . cosFromSin ( sin , angleX ) ; float nm10 = m10 * cos + m20 * sin ; float nm11...
public class BootstrapConfig { /** * Allocate a file in the user output directory , e . g . * WLP _ OUTPUT _ DIR / relativePath * @ param relativePath * relative path of file to create in the WLP _ OUTPUT _ DIR directory * @ return File object for relative path , or for the WLP _ OUTPUT _ DIR directory itself ...
if ( relativePath == null ) return outputRoot ; else return new File ( outputRoot , relativePath ) ;
public class ClientFactory { /** * 添加用户事件 * @ param pUserName * @ param pClient */ protected void onAddClient ( String pUserName , WebSocketSession pClient ) { } }
if ( null != mClientFactoryListener ) { mClientFactoryListener . addClient ( this , new AddClientEvent ( pUserName , pClient ) ) ; }
public class FileUtil { /** * 获得相对子路径 , 忽略大小写 * 栗子 : * < pre > * dirPath : d : / aaa / bbb filePath : d : / aaa / bbb / ccc = 》 ccc * dirPath : d : / Aaa / bbb filePath : d : / aaa / bbb / ccc . txt = 》 ccc . txt * dirPath : d : / Aaa / bbb filePath : d : / aaa / bbb / = 》 " " * < / pre > * @ param dirPat...
if ( StrUtil . isNotEmpty ( dirPath ) && StrUtil . isNotEmpty ( filePath ) ) { dirPath = StrUtil . removeSuffix ( normalize ( dirPath ) , "/" ) ; filePath = normalize ( filePath ) ; final String result = StrUtil . removePrefixIgnoreCase ( filePath , dirPath ) ; return StrUtil . removePrefix ( result , "/" ) ; } return ...
public class Binder { /** * Cast the incoming arguments to the given MethodType . The casts * applied are equivalent to those in MethodHandle . explicitCastArguments ( MethodType ) . * @ param returnType the target return type * @ param argTypes the target argument types * @ return a new Binder */ public Binder...
return new Binder ( this , new Cast ( type ( ) ) , MethodType . methodType ( returnType , argTypes ) ) ;
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 710:1 : instanceof _ key : { . . . } ? = > id = ID ; */ public final DRL5Expressions . instanceof_key_return instanceof_key ( ) throws RecognitionException { } }
DRL5Expressions . instanceof_key_return retval = new DRL5Expressions . instanceof_key_return ( ) ; retval . start = input . LT ( 1 ) ; Token id = null ; try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 711:5 : ( { . . . } ? = > id = ID ) // src / main / resources / org / drools /...
public class CmsEntityAttribute { /** * Returns the list of complex values . < p > * @ return the list of complex values */ public List < CmsEntity > getComplexValues ( ) { } }
List < CmsEntity > result = new ArrayList < CmsEntity > ( ) ; result . addAll ( m_entityValues ) ; return Collections . unmodifiableList ( result ) ;
public class SequentialReader { /** * Returns a signed 32 - bit integer from four bytes of data . * @ return the signed 32 bit int value , between 0x00000 and 0xFFFFF * @ throws IOException the buffer does not contain enough bytes to service the request */ public int getInt32 ( ) throws IOException { } }
if ( _isMotorolaByteOrder ) { // Motorola - MSB first ( big endian ) return ( getByte ( ) << 24 & 0xFF000000 ) | ( getByte ( ) << 16 & 0xFF0000 ) | ( getByte ( ) << 8 & 0xFF00 ) | ( getByte ( ) & 0xFF ) ; } else { // Intel ordering - LSB first ( little endian ) return ( getByte ( ) & 0xFF ) | ( getByte ( ) << 8 & 0xFF0...
public class Element { /** * Blurs ( focuses and then unfocuses ) the element , but only if the element * is present , displayed , enabled , and an input . If those conditions are not * met , the blur action will be logged , but skipped and the test will * continue . */ public void blur ( ) { } }
String cantFocus = "Unable to focus on " ; String action = "Focusing, then unfocusing (blurring) on " + prettyOutput ( ) ; String expected = prettyOutputStart ( ) + " is present, displayed, and enabled to be blurred" ; try { if ( isNotPresentDisplayedEnabledInput ( action , expected , cantFocus ) ) { return ; } WebElem...
public class CEMIDevMgmt { /** * Returns a descriptive error message for the supplied error code parameter . * If the error code is not known , the string " unknown error code " is returned . * @ param errorCode error code to get message for , < code > 0 & le ; errorCode < / code > * @ return error status message...
if ( errorCode < 0 ) throw new KNXIllegalArgumentException ( "error code has to be >= 0" ) ; if ( errorCode > errors . length - 1 ) return "unknown error code" ; return errors [ errorCode ] ;
public class OracleNoSQLValidationClassMapper { /** * Gets the valid Id type . * @ param type * the type * @ return the valid Id type */ public static String getValidIdType ( String type ) { } }
if ( validationClassMapperforId . get ( type ) == null ) { throw new KunderaException ( "ID of type: " + type + " is not supported for Kundera Oracle NOSQL." ) ; } return validationClassMapperforId . get ( type ) ;
public class ActionResourceImpl { /** * De - registers an client that is currently registered with the gateway . * @ param action */ private void unregisterClient ( ActionBean action ) throws ActionException { } }
if ( ! securityContext . hasPermission ( PermissionType . clientAdmin , action . getOrganizationId ( ) ) ) throw ExceptionFactory . notAuthorizedException ( ) ; ClientVersionBean versionBean ; List < ContractSummaryBean > contractBeans ; try { versionBean = orgs . getClientVersion ( action . getOrganizationId ( ) , act...
public class FileExtensions { /** * Gets the current absolut path without the dot and slash . * @ return ' s the current absolut path without the dot and slash . */ public static String getCurrentAbsolutPathWithoutDotAndSlash ( ) { } }
final File currentAbsolutPath = new File ( "." ) ; return currentAbsolutPath . getAbsolutePath ( ) . substring ( 0 , currentAbsolutPath . getAbsolutePath ( ) . length ( ) - 2 ) ;
public class ChannelSpecification { /** * The allowed compression types , if data compression is used . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSupportedCompressionTypes ( java . util . Collection ) } or * { @ link # withSupportedCompressionTypes...
if ( this . supportedCompressionTypes == null ) { setSupportedCompressionTypes ( new java . util . ArrayList < String > ( supportedCompressionTypes . length ) ) ; } for ( String ele : supportedCompressionTypes ) { this . supportedCompressionTypes . add ( ele ) ; } return this ;
public class TypeChecker { /** * Checks and casts an object to the specified type . If casting fails , a default value is returned . * @ param object The object to be checked * @ param defaultValue The default value to be returned if casting fails * @ return The same object , cast to the specified class , or the ...
try { return check ( object ) ; } catch ( ClassCastException e ) { return defaultValue ; }
public class FastDtoa { /** * Precondition : ( 1 < < number _ bits ) < = number < ( 1 < < ( number _ bits + 1 ) ) . */ static long biggestPowerTen ( int number , int number_bits ) { } }
int power , exponent ; switch ( number_bits ) { case 32 : case 31 : case 30 : if ( kTen9 <= number ) { power = kTen9 ; exponent = 9 ; break ; } // else fallthrough case 29 : case 28 : case 27 : if ( kTen8 <= number ) { power = kTen8 ; exponent = 8 ; break ; } // else fallthrough case 26 : case 25 : case 24 : if ( kTen7...
public class SimpleHttpClientFactoryBean { /** * Build a HTTP client based on the current properties . * @ return the built HTTP client */ @ SneakyThrows private CloseableHttpClient buildHttpClient ( ) { } }
val plainSocketFactory = PlainConnectionSocketFactory . getSocketFactory ( ) ; val registry = RegistryBuilder . < ConnectionSocketFactory > create ( ) . register ( "http" , plainSocketFactory ) . register ( "https" , this . sslSocketFactory ) . build ( ) ; val connectionManager = new PoolingHttpClientConnectionManager ...
public class InternalXbaseParser { /** * InternalXbase . g : 4823:1 : entryRuleXTypeLiteral returns [ EObject current = null ] : iv _ ruleXTypeLiteral = ruleXTypeLiteral EOF ; */ public final EObject entryRuleXTypeLiteral ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleXTypeLiteral = null ; try { // InternalXbase . g : 4823:53 : ( iv _ ruleXTypeLiteral = ruleXTypeLiteral EOF ) // InternalXbase . g : 4824:2 : iv _ ruleXTypeLiteral = ruleXTypeLiteral EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXTypeLiteralRule (...
public class HTCashbillServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . HTCashbillService # requestJob ( java . lang . String , com . popbill . api . hometaxcashbill . QueryType , java . lang . String , java . lang . String ) */ @ Override public String requestJob ( String CorpNum , QueryType queryT...
return requestJob ( CorpNum , queryType , SDate , EDate , null ) ;
public class SimonConnectionConfiguration { /** * Loads { @ code driver . properties } file . */ private static Properties initProperties ( ) { } }
InputStream stream = null ; try { // TODO : limited to known drivers , better find driver later based on JDBC connection URL without " simon " word Properties properties = new Properties ( ) ; stream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "org/javasimon/jdbc4/drivers.properties...
public class KTypeArrayDeque { /** * { @ inheritDoc } */ @ Override public < T extends KTypeProcedure < ? super KType > > T forEach ( T procedure ) { } }
forEach ( procedure , head , tail ) ; return procedure ;
public class Matchers { /** * Matches an AST node if its type is a primitive type . */ public static < T extends Tree > Matcher < T > isPrimitiveType ( ) { } }
return new Matcher < T > ( ) { @ Override public boolean matches ( Tree t , VisitorState state ) { Type type = getType ( t ) ; return type != null && type . isPrimitive ( ) ; } } ;
public class SAMkNN { /** * Makes sure that the STM and LTM combined doe not surpass the maximum size . */ private void memorySizeCheck ( ) { } }
if ( this . stm . numInstances ( ) + this . ltm . numInstances ( ) > this . maxSTMSize + this . maxLTMSize ) { if ( this . ltm . numInstances ( ) > this . maxLTMSize ) { this . clusterDown ( ) ; } else { // shift values from STM directly to LTM since STM is full int numShifts = this . maxLTMSize - this . ltm . numInsta...
public class GDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GDD__GOC_ADES : return GOC_ADES_EDEFAULT == null ? gocAdes != null : ! GOC_ADES_EDEFAULT . equals ( gocAdes ) ; case AfplibPackage . GDD__COMMANDS : return commands != null && ! commands . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class IsProtonInConjugatedPiSystemDescriptor { /** * The method is a proton descriptor that evaluates if a proton is joined to a conjugated system . * @ param atom The IAtom for which the DescriptorValue is requested * @ param atomContainer AtomContainer * @ return true if the proton is bonded to a conjuga...
IAtomContainer clonedAtomContainer ; try { clonedAtomContainer = ( IAtomContainer ) atomContainer . clone ( ) ; } catch ( CloneNotSupportedException e ) { return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new BooleanResult ( false ) , NAMES , e ) ; } IAtom clonedAtom = clon...
public class SetLabelsForNumbersBot { /** * Fetches the current online data for the given item , and adds numerical * labels if necessary . * @ param itemIdValue * the id of the document to inspect */ protected void addLabelForNumbers ( ItemIdValue itemIdValue ) { } }
String qid = itemIdValue . getId ( ) ; try { // Fetch the online version of the item to make sure we edit the // current version : ItemDocument currentItemDocument = ( ItemDocument ) dataFetcher . getEntityDocument ( qid ) ; if ( currentItemDocument == null ) { System . out . println ( "*** " + qid + " could not be fet...
public class ExceptAxis { /** * { @ inheritDoc } */ @ Override public boolean hasNext ( ) { } }
// first all items of the second operand are stored in the set . while ( mOp2 . hasNext ( ) ) { if ( getNode ( ) . getDataKey ( ) < 0 ) { // only nodes are // allowed throw new XPathError ( ErrorType . XPTY0004 ) ; } mDupSet . add ( getNode ( ) . getDataKey ( ) ) ; } while ( mOp1 . hasNext ( ) ) { if ( getNode ( ) . ge...
public class FlexiBean { /** * Puts the properties in the specified map into this bean . * This creates properties if they do not exist . * @ param map the map of properties to add , not null */ public void putAll ( Map < String , ? extends Object > map ) { } }
if ( map . size ( ) > 0 ) { for ( String key : map . keySet ( ) ) { if ( VALID_KEY . matcher ( key ) . matches ( ) == false ) { throw new IllegalArgumentException ( "Invalid key for FlexiBean: " + key ) ; } } if ( data == Collections . EMPTY_MAP ) { data = new LinkedHashMap < > ( map ) ; } else { data . putAll ( map ) ...
public class RowReaderDefaultImpl { /** * @ see RowReader # readPkValuesFrom ( ResultSet , ClassDescriptor , Map ) * @ throws PersistenceBrokerException if there is an error accessing the access layer */ public void readPkValuesFrom ( ResultSetAndStatement rs_stmt , Map row ) { } }
String ojbClass = SqlHelper . getOjbClassName ( rs_stmt . m_rs ) ; ClassDescriptor cld ; if ( ojbClass != null ) { cld = m_cld . getRepository ( ) . getDescriptorFor ( ojbClass ) ; } else { cld = m_cld ; } FieldDescriptor [ ] pkFields = cld . getPkFields ( ) ; readValuesFrom ( rs_stmt , row , pkFields ) ;
public class appfwxmlerrorpage { /** * Use this API to fetch appfwxmlerrorpage resource of given name . */ public static appfwxmlerrorpage get ( nitro_service service , String name ) throws Exception { } }
appfwxmlerrorpage obj = new appfwxmlerrorpage ( ) ; obj . set_name ( name ) ; appfwxmlerrorpage response = ( appfwxmlerrorpage ) obj . get_resource ( service ) ; return response ;
public class ReloadablePropertiesFactoryBean { /** * 定义资源文件 * @ param fileNames */ public void setLocation ( final String fileNames ) { } }
List < String > list = new ArrayList < String > ( ) ; list . add ( fileNames ) ; setLocations ( list ) ;
public class Session { /** * This method invokes the same called method of the current < code > IPhase < / code > instance . * @ param src Write the remaining bytes to the device . * @ param logicalBlockAddress The logical block address of the device to begin the write operation . * @ param transferLength The num...
return executeTask ( new WriteTask ( this , src , logicalBlockAddress , transferLength ) ) ;
public class OffsetGroup { /** * Returns whether , for all offsets present in both groups , this { @ code OffsetGroup } ' s * offset { @ link Offset # precedes ( Offset ) } ( Offset ) } the other ' s . */ public boolean precedesForAllOffsetTypesInBoth ( final OffsetGroup other ) { } }
return charOffset ( ) . precedes ( other . charOffset ( ) ) && edtOffset ( ) . precedes ( other . edtOffset ( ) ) && ( ! byteOffset ( ) . isPresent ( ) || ! other . byteOffset ( ) . isPresent ( ) || byteOffset ( ) . get ( ) . precedes ( other . byteOffset ( ) . get ( ) ) ) && ( ! asrTime ( ) . isPresent ( ) || ! other ...
public class AbstractConnection { /** * Close the connection to the remote node . */ public void close ( ) { } }
done = true ; connected = false ; synchronized ( this ) { try { if ( socket != null ) { if ( traceLevel >= ctrlThreshold ) { System . out . println ( "-> CLOSE" ) ; } socket . close ( ) ; } } catch ( final IOException e ) { /* ignore socket close errors */ } finally { socket = null ; } }
public class TreeNode { /** * Returns the TreeNode ( or null if not found ) for the given key * starting at given root . */ final TreeNode < K , V > findTreeNode ( int h , Object k , Class < ? > kc ) { } }
if ( k != null ) { TreeNode < K , V > p = this ; do { int ph , dir ; K pk ; TreeNode < K , V > q ; TreeNode < K , V > pl = p . left , pr = p . right ; if ( ( ph = p . hash ) > h ) p = pl ; else if ( ph < h ) p = pr ; else if ( ( pk = p . key ) == k || ( pk != null && k . equals ( pk ) ) ) return p ; else if ( pl == nul...
public class HttpRequestHandler { /** * Execute a single { @ link JmxRequest } . If a checked exception occurs , * this gets translated into the appropriate JSON object which will get returned . * Note , that these exceptions gets * not * translated into an HTTP error , since they are * supposed < em > Jolokia < ...
// Call handler and retrieve return value try { return backendManager . handleRequest ( pJmxReq ) ; } catch ( ReflectionException e ) { return getErrorJSON ( 404 , e , pJmxReq ) ; } catch ( InstanceNotFoundException e ) { return getErrorJSON ( 404 , e , pJmxReq ) ; } catch ( MBeanException e ) { return getErrorJSON ( 5...
public class Humanize { /** * Converts a list of items to a human readable string with an optional * limit . * @ param items * The items array * @ param limit * The number of items to print . - 1 for unbounded . * @ param limitStr * The string to be appended after extra items . Null or " " for * default...
if ( items == null || items . length == 0 ) { return "" ; } int itemsNum = items . length ; if ( itemsNum == 1 ) { return items [ 0 ] . toString ( ) ; } ResourceBundle bundle = context . get ( ) . getBundle ( ) ; if ( itemsNum == 2 ) { return format ( bundle . getString ( "oxford.pair" ) , items [ 0 ] , items [ 1 ] ) ;...
public class CmsDialogCopyLanguage { /** * Copies the contents from a source locale to a number of destination locales by overwriting them . < p > * @ param content the xml content * @ param sourceLocale the source locale * @ param destLocales a list of destination locales * @ throws CmsException if something g...
for ( Iterator < Locale > i = destLocales . iterator ( ) ; i . hasNext ( ) ; ) { Locale to = i . next ( ) ; if ( content . hasLocale ( to ) ) { content . removeLocale ( to ) ; } content . copyLocale ( sourceLocale , to ) ; }
public class JwtSsoBuilderComponent { /** * { @ inheritDoc } */ @ Override public long getValidTime ( ) { } }
long result = 0 ; if ( isDefaultBuilder ) { result = 2 * 3600 ; } else { boolean haveNull = jwtServiceMapRef . getReference ( jwtBuilderRef ) == null || jwtServiceMapRef . getReference ( jwtBuilderRef ) . getProperty ( JwtUtils . CFG_KEY_VALID ) == null ; result = ( haveNull ) ? 0 : ( ( Long ) jwtServiceMapRef . getRef...
public class ListStreamsResult { /** * The names of the streams that are associated with the AWS account making the < code > ListStreams < / code > request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setStreamNames ( java . util . Collection ) } or { @ ...
if ( this . streamNames == null ) { setStreamNames ( new com . amazonaws . internal . SdkInternalList < String > ( streamNames . length ) ) ; } for ( String ele : streamNames ) { this . streamNames . add ( ele ) ; } return this ;
public class UnmodifiableHttpParameters { /** * Wraps the given parameters to ensure they are unmodifiable . * @ return { @ code null } when wrapped is { @ code null } , otherwise unmodifiable parameters */ public static HttpParameters wrap ( HttpParameters wrapped ) { } }
// null remains null if ( wrapped == null ) return null ; // Empty are unmodifiable if ( wrapped == EmptyParameters . getInstance ( ) ) return wrapped ; // ServletRequest parameters are unmodifiable already if ( wrapped instanceof ServletRequestParameters ) return wrapped ; // Already wrapped if ( wrapped instanceof Un...
public class CPDefinitionLinkUtil { /** * Returns the cp definition links before and after the current cp definition link in the ordered set where CPDefinitionId = & # 63 ; . * @ param CPDefinitionLinkId the primary key of the current cp definition link * @ param CPDefinitionId the cp definition ID * @ param orde...
return getPersistence ( ) . findByCPDefinitionId_PrevAndNext ( CPDefinitionLinkId , CPDefinitionId , orderByComparator ) ;
public class Matrix3 { /** * Sets the matrix element at the specified row and column . */ public void setElement ( int row , int col , float value ) { } }
switch ( col ) { case 0 : switch ( row ) { case 0 : m00 = value ; return ; case 1 : m01 = value ; return ; case 2 : m02 = value ; return ; } break ; case 1 : switch ( row ) { case 0 : m10 = value ; return ; case 1 : m11 = value ; return ; case 2 : m12 = value ; return ; } break ; case 2 : switch ( row ) { case 0 : m20 ...
public class H2ONode { /** * same answer back . */ void record_task_answer ( RPC . RPCCall rpcall ) { } }
// assert rpcall . _ started = = 0 | | rpcall . _ dt . hasException ( ) ; rpcall . _started = System . currentTimeMillis ( ) ; rpcall . _retry = RPC . RETRY_MS ; // Start the timer on when to resend // AckAckTimeOutThread . PENDING . add ( rpcall ) ;
public class SourceStream { /** * This method uses a Value message to write Silence into the stream , * because a message has been rolled back * @ param m The value message * @ exception GDException Can be thrown from the writeCompletedRange method * @ return boolean true if the message can be sent downstream ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeSilence" , new Object [ ] { m } ) ; boolean sendMessage = true ; JsMessage jsMsg = m . getMessage ( ) ; // There may be Completed ticks after the Value , if so then // write these into the stream too long stamp ...
public class ManagementClientAsync { /** * Retrieves information related to the namespace . * Works with any claim ( Send / Listen / Manage ) . * @ return - { @ link NamespaceInfo } containing namespace information . */ public CompletableFuture < NamespaceInfo > getNamespaceInfoAsync ( ) { } }
CompletableFuture < String > contentFuture = getEntityAsync ( "$namespaceinfo" , null , false ) ; CompletableFuture < NamespaceInfo > nsInfoFuture = new CompletableFuture < > ( ) ; contentFuture . handleAsync ( ( content , ex ) -> { if ( ex != null ) { nsInfoFuture . completeExceptionally ( ex ) ; } else { try { nsInfo...
public class ThriftClient { /** * Loads super columns from database . * @ param keyspace * the keyspace * @ param columnFamily * the column family * @ param rowId * the row id * @ param superColumnNames * the super column names * @ return the list */ @ Override protected final List < SuperColumn > loa...
// TODO : : : super column abstract entity and discriminator column if ( ! isOpen ( ) ) throw new PersistenceException ( "ThriftClient is closed." ) ; byte [ ] rowKey = rowId . getBytes ( ) ; SlicePredicate predicate = new SlicePredicate ( ) ; List < ByteBuffer > columnNames = new ArrayList < ByteBuffer > ( ) ; for ( S...
public class Script { /** * Invoke a method ( or closure in the binding ) defined . * @ param name method to call * @ param args arguments to pass to the method * @ return value */ public Object invokeMethod ( String name , Object args ) { } }
try { return super . invokeMethod ( name , args ) ; } // if the method was not found in the current scope ( the script ' s methods ) // let ' s try to see if there ' s a method closure with the same name in the binding catch ( MissingMethodException mme ) { try { if ( name . equals ( mme . getMethod ( ) ) ) { Object bo...
public class GenericTypeResolver { /** * Determine the target type for the generic return type of the given method , * where formal type variables are declared on the given class . * @ param method the method to introspect * @ param clazz the class to resolve type variables against * @ return the corresponding ...
Assert . notNull ( method , "Method must not be null" ) ; Type genericType = method . getGenericReturnType ( ) ; Assert . notNull ( clazz , "Class must not be null" ) ; Map < TypeVariable , Type > typeVariableMap = getTypeVariableMap ( clazz ) ; Type rawType = getRawType ( genericType , typeVariableMap ) ; return ( raw...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertGSLTLINETYPEToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class Geomajas { /** * Returns a list of locales that can be used in this version of Geomajas . The default is english , and ' native ' * means that your browsers locale should be used ( if supported - default otherwise ) . * @ return supported locales */ public static Map < String , String > getSupportedLoc...
Map < String , String > locales = new HashMap < String , String > ( ) ; for ( String localeName : LocaleInfo . getAvailableLocaleNames ( ) ) { String displayName = LocaleInfo . getLocaleNativeDisplayName ( localeName ) ; locales . put ( localeName , displayName ) ; } return locales ;
public class DialectFactory { /** * 根据驱动名创建方言 < br > * 驱动名是不分区大小写完全匹配的 * @ param driverName JDBC驱动类名 * @ return 方言 */ public static Dialect newDialect ( String driverName ) { } }
final Dialect dialect = internalNewDialect ( driverName ) ; StaticLog . debug ( "Use Dialect: [{}]." , dialect . getClass ( ) . getSimpleName ( ) ) ; return dialect ;
public class ReadMatrixCsv { /** * Reads in a { @ link CMatrixRMaj } from the IO stream where the user specifies the matrix dimensions . * @ param numRows Number of rows in the matrix * @ param numCols Number of columns in the matrix * @ return CMatrixRMaj * @ throws IOException */ public CMatrixRMaj readCDRM (...
CMatrixRMaj A = new CMatrixRMaj ( numRows , numCols ) ; int wordsCol = numCols * 2 ; for ( int i = 0 ; i < numRows ; i ++ ) { List < String > words = extractWords ( ) ; if ( words == null ) throw new IOException ( "Too few rows found. expected " + numRows + " actual " + i ) ; if ( words . size ( ) != wordsCol ) throw n...
public class DisplayUtils { /** * This method is use to determine if the current Android device is a tablet * or phone . * @ param context * @ return */ public boolean isTablet ( Context context ) { } }
boolean xlarge = ( ( context . getResources ( ) . getConfiguration ( ) . screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK ) == 4 ) ; boolean large = ( ( context . getResources ( ) . getConfiguration ( ) . screenLayout & Configuration . SCREENLAYOUT_SIZE_MASK ) == Configuration . SCREENLAYOUT_SIZE_LARGE ) ; return ...
public class ExpandoMetaClass { /** * / * ( non - Javadoc ) * @ see groovy . lang . MetaClassImpl # invokeConstructor ( java . lang . Object [ ] ) */ public Object invokeConstructor ( Object [ ] arguments ) { } }
// TODO This is the only area where this MetaClass needs to do some interception because Groovy ' s current // MetaClass uses hard coded references to the java . lang . reflect . Constructor class so you can ' t simply // inject Constructor like you can do properties , methods and fields . When Groovy ' s MetaClassImpl...
public class CoNLLDependencyExtractor { /** * Extracts a dependency parse tree from the provided reader . The tree is * assumed to be in the CoNLL format . * The CoNNLL features that are of interest are ID , LEMMA or FORM , POSTAG , * HEAD , and DEPREL which are the id of the node , the string for the word at *...
List < SimpleDependencyTreeNode > nodes = new ArrayList < SimpleDependencyTreeNode > ( ) ; // When building the tree , keep track of all the relations seen between // the nodes . The nodes need to be linked by DependencyRelations , which // need DependencyTreeNode instances . However , during parsing , we may // encoun...
public class Facebook { /** * Allows the user to set a Session for the Facebook class to use . * If a Session is set here , then one should not use the authorize , logout , * or extendAccessToken methods which alter the Session object since that may * result in undefined behavior . Using those methods after setti...
if ( session == null ) { throw new IllegalArgumentException ( "session cannot be null" ) ; } synchronized ( this . lock ) { this . userSetSession = session ; }
public class RelatedTablesExtension { /** * Determine if the base id and related id mapping exists * @ param tableName * mapping table name * @ param baseId * base id * @ param relatedId * related id * @ return true if mapping exists * @ since 3.2.0 */ public boolean hasMapping ( String tableName , long...
UserMappingDao userMappingDao = getMappingDao ( tableName ) ; return userMappingDao . countByIds ( baseId , relatedId ) > 0 ;
public class RestService { /** * @ param method the method to check * @ return the Produces annotation found or null if the method does not have one */ private String [ ] getProduces ( Produces baseProduces , ExecutableElement method ) { } }
Produces localProduces = method . getAnnotation ( Produces . class ) ; return localProduces != null ? localProduces . value ( ) : baseProduces != null ? baseProduces . value ( ) : null ;
public class JsonWriterUtil { /** * Write the given primitive value to the JSON stream by using the given JSON generator . * @ param primitiveValue The given primitive value to write . * @ param jsonGenerator The given JSON generator . * @ throws IOException If unable to write to the json output stream */ public ...
Class < ? > primitiveClass = PrimitiveUtil . wrap ( primitiveValue . getClass ( ) ) ; if ( String . class . isAssignableFrom ( primitiveClass ) ) { jsonGenerator . writeString ( String . valueOf ( primitiveValue ) ) ; } else if ( Byte . class . isAssignableFrom ( primitiveClass ) ) { jsonGenerator . writeObject ( primi...
public class FeaturesInner { /** * Gets the preview feature with the specified name . * @ param resourceProviderNamespace The resource provider namespace for the feature . * @ param featureName The name of the feature to get . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ thro...
return getWithServiceResponseAsync ( resourceProviderNamespace , featureName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Schema { /** * Returns the record { @ link Field } of the given name . * @ param name Name of the field * @ return A { @ link Field } or { @ code null } if there is no such field in this record * or this is not a { @ link Type # RECORD RECORD } schema . */ public Field getField ( String name ) { } }
if ( fieldMap == null ) { return null ; } return fieldMap . get ( name ) ;
public class EbeanQueryChannelService { /** * Return an object relational query for finding a List , Set , Map or single entity bean . * @ return the Query . */ public static < T > Query < T > query ( Class < T > entityType ) { } }
Assert . notNull ( entityType , "entityType must not null" ) ; return Ebean . find ( entityType ) ;
public class RemoteQueuePointIterator { /** * / * ( non - Javadoc ) * @ see java . util . Iterator # remove ( ) */ public void remove ( ) { } }
InvalidOperationException finalE = new InvalidOperationException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0005" , new Object [ ] { "RemoteQueuePointIterator.remove" , "1:152:1.14" , this } , null ) ) ; SibTr . exception ( tc , finalE ) ; throw finalE ;
public class LoggingFraction { /** * Add a CustomFormatter to this logger * @ param name the name of the formatter * @ param module the module that the logging handler depends on * @ param className the logging handler class to be used * @ return This fraction . */ public LoggingFraction customFormatter ( Strin...
return customFormatter ( name , module , className , null ) ;
public class RottenTomatoesApi { /** * Retrieves current release DVDs * @ param country Provides localized data for the selected country * @ return * @ throws RottenTomatoesException */ public List < RTMovie > getUpcomingDvds ( String country ) throws RottenTomatoesException { } }
return getUpcomingDvds ( country , DEFAULT_PAGE , DEFAULT_PAGE_LIMIT ) ;
public class Vector3d { /** * Returns the dot product of this vector and v1. * @ param v1 * right - hand vector * @ return dot product */ public double dot ( Vector3d v1 ) { } }
return x * v1 . x + y * v1 . y + z * v1 . z ;
public class ParserDQL { /** * Retrieves a SELECT or other query expression Statement from this parse context . */ StatementDMQL compileCursorSpecification ( ) { } }
QueryExpression queryExpression = XreadQueryExpression ( ) ; queryExpression . setAsTopLevel ( ) ; queryExpression . resolve ( session ) ; if ( token . tokenType == Tokens . FOR ) { read ( ) ; if ( token . tokenType == Tokens . READ ) { read ( ) ; readThis ( Tokens . ONLY ) ; } else { readThis ( Tokens . UPDATE ) ; if ...
public class PersistablePropertiesRealm { /** * Dump properties file backed with this Realms Users and roles . * @ return */ public Properties getProperties ( ) { } }
Properties props = new Properties ( ) ; for ( String name : this . users . keySet ( ) ) { SimpleAccount acct = this . users . get ( name ) ; props . setProperty ( USERNAME_PREFIX + name , acct . getCredentials ( ) . toString ( ) ) ; } return props ;
public class Utils { /** * Determines if the primitive type is boxed as the boxed type * @ param primitive the primitive type to check if boxed is the boxed type * @ param boxed the possible boxed type of the primitive * @ return true if boxed is the boxed type of primitive , false otherwise . */ public static bo...
return ( primitive . equals ( boolean . class ) && boxed . equals ( Boolean . class ) ) || ( primitive . equals ( byte . class ) && boxed . equals ( Byte . class ) ) || ( primitive . equals ( char . class ) && boxed . equals ( Character . class ) ) || ( primitive . equals ( double . class ) && boxed . equals ( Double ....
public class Property { /** * < pre > * The type of this property . * < / pre > * < code > . google . api . Property . PropertyType type = 2 ; < / code > */ public com . google . api . Property . PropertyType getType ( ) { } }
@ SuppressWarnings ( "deprecation" ) com . google . api . Property . PropertyType result = com . google . api . Property . PropertyType . valueOf ( type_ ) ; return result == null ? com . google . api . Property . PropertyType . UNRECOGNIZED : result ;
public class GerritJsonEventFactory { /** * Returns the value of a JSON property as a String if it exists otherwise returns null . * Same as calling { @ link # getString ( net . sf . json . JSONObject , java . lang . String , java . lang . String ) } * with null as defaultValue . * @ param json the JSONObject to ...
return getString ( json , key , null ) ;