signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ListServicesResponse { /** * < pre > * The services belonging to the requested application . * < / pre > * < code > repeated . google . appengine . v1 . Service services = 1 ; < / code > */ public java . util . List < ? extends com . google . appengine . v1 . ServiceOrBuilder > getServicesOrBuilderLi...
return services_ ;
public class LocalFileResource { /** * Create a new local resource * @ param normalizedPath * Normalized file path for this resource ; can not be null . * @ param repositoryPath * An abstraction of the file location ; may be null . */ public static LocalFileResource newResource ( String normalizedPath , String ...
return new LocalFileResource ( normalizedPath , repositoryPath , null ) ;
public class Matchers { /** * Matches on the initializer of a VariableTree AST node . * @ param expressionTreeMatcher A matcher on the initializer of the variable . */ public static Matcher < VariableTree > variableInitializer ( final Matcher < ExpressionTree > expressionTreeMatcher ) { } }
return new Matcher < VariableTree > ( ) { @ Override public boolean matches ( VariableTree variableTree , VisitorState state ) { ExpressionTree initializer = variableTree . getInitializer ( ) ; return initializer == null ? false : expressionTreeMatcher . matches ( initializer , state ) ; } } ;
public class DescribeConfigurationAggregatorsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeConfigurationAggregatorsRequest describeConfigurationAggregatorsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeConfigurationAggregatorsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeConfigurationAggregatorsRequest . getConfigurationAggregatorNames ( ) , CONFIGURATIONAGGREGATORNAMES_BINDING ) ; protocolMarshaller . mar...
public class ApiUtils { /** * Returns the authority of the given { @ code site } ( i . e . host " : " port ) . * For example , the result of returning the authority from : * < blockquote > < pre > http : / / example . com : 8080 / some / path ? a = b # c < / pre > < / blockquote > is : * < blockquote > < pre > ex...
String authority = site ; boolean isSecure = false ; // Remove http ( s ) : / / if ( authority . toLowerCase ( Locale . ROOT ) . startsWith ( "http://" ) ) { authority = authority . substring ( 7 ) ; } else if ( authority . toLowerCase ( Locale . ROOT ) . startsWith ( "https://" ) ) { authority = authority . substring ...
public class Context { /** * Returns { @ code parent } if it is a { @ link CancellableContext } , otherwise returns the parent ' s * { @ link # cancellableAncestor } . */ static CancellableContext cancellableAncestor ( Context parent ) { } }
if ( parent == null ) { return null ; } if ( parent instanceof CancellableContext ) { return ( CancellableContext ) parent ; } // The parent simply cascades cancellations . // Bypass the parent and reference the ancestor directly ( may be null ) . return parent . cancellableAncestor ;
public class ConfigManager { /** * Gets a list of classes that the listenerClass is interesting in listening to . * @ param listenerClass * @ param log * @ return */ private static Class < ? > [ ] getListenerGenericTypes ( Class < ? > listenerClass , Logger log ) { } }
List < Class < ? > > configClasses = new ArrayList < Class < ? > > ( ) ; Type [ ] typeVars = listenerClass . getGenericInterfaces ( ) ; if ( typeVars != null ) { for ( Type interfaceClass : typeVars ) { if ( interfaceClass instanceof ParameterizedType ) { if ( ( ( ParameterizedType ) interfaceClass ) . getRawType ( ) i...
public class CookieUtil { /** * US - ASCII characters excluding CTLs , whitespace , DQUOTE , comma , semicolon , and backslash */ private static BitSet validCookieValueOctets ( ) { } }
BitSet bits = new BitSet ( 8 ) ; for ( int i = 35 ; i < 127 ; i ++ ) { // US - ASCII characters excluding CTLs ( % x00-1F / % x7F ) bits . set ( i ) ; } bits . set ( '"' , false ) ; // exclude DQUOTE = % x22 bits . set ( ',' , false ) ; // exclude comma = % x2C bits . set ( ';' , false ) ; // exclude semicolon = % x3B ...
public class TypeCheck { /** * Visits a NEW node . */ private void visitNew ( Node n ) { } }
Node constructor = n . getFirstChild ( ) ; JSType type = getJSType ( constructor ) . restrictByNotNullOrUndefined ( ) ; if ( ! couldBeAConstructor ( type ) || type . isEquivalentTo ( typeRegistry . getNativeType ( SYMBOL_OBJECT_FUNCTION_TYPE ) ) ) { report ( n , NOT_A_CONSTRUCTOR ) ; ensureTyped ( n ) ; return ; } Func...
public class EsManagedIndexBuilder { /** * Create a builder for the supplied index definition . * @ param client interface for elasticsearch cluster . * @ param context the execution context in which the index should operate ; * may not be null * @ param defn the index definition ; may not be null * @ param n...
SimpleProblems problems = new SimpleProblems ( ) ; validate ( defn , problems ) ; if ( problems . hasErrors ( ) ) { throw new LocalIndexException ( problems . toString ( ) ) ; } return new EsManagedIndexBuilder ( client , context , defn , nodeTypesSupplier , workspaceName , matcher ) ;
public class AbstractRasClassAdapter { /** * Get the effective trace options for this class . * @ return the effective trace options for this class */ public TraceOptionsData getTraceOptionsData ( ) { } }
if ( classInfo != null ) { return classInfo . getTraceOptionsData ( ) ; } if ( optionsAnnotationVisitor != null ) { return optionsAnnotationVisitor . getTraceOptionsData ( ) ; } return null ;
public class MultiException { /** * If this < code > MultiException < / code > is empty then no action is taken , * if it contains a single < code > Throwable < / code > that is thrown , * otherwise this < code > MultiException < / code > is thrown . */ public void throwIfNotEmpty ( ) { } }
synchronized ( nested ) { if ( nested . isEmpty ( ) ) { // Do nothing } else if ( nested . size ( ) == 1 ) { Throwable t = nested . get ( 0 ) ; TigerThrower . sneakyThrow ( t ) ; } else { throw this ; } }
public class BallController { /** * { @ inheritDoc } */ @ Override public void mouseClicked ( final MouseEvent mouseEvent ) { } }
if ( mouseEvent . getSource ( ) instanceof Node ) { // Send Event Selected Wave model ( ) . sendWave ( EditorWaves . DO_SELECT_EVENT , WBuilder . waveData ( PropertiesWaves . EVENT_OBJECT , model ( ) . getEventModel ( ) ) ) ; }
public class L2Cache { /** * Creates a new Entity cache * @ param repository the { @ link Repository } to load the entities from * @ return newly created LoadingCache */ private LoadingCache < Object , Optional < Map < String , Object > > > createEntityCache ( Repository < Entity > repository ) { } }
Caffeine < Object , Object > cacheBuilder = Caffeine . newBuilder ( ) . recordStats ( ) . expireAfterAccess ( 10 , MINUTES ) ; if ( ! MetaDataService . isMetaEntityType ( repository . getEntityType ( ) ) ) { cacheBuilder . maximumSize ( MAX_CACHE_SIZE_PER_ENTITY ) ; } LoadingCache < Object , Optional < Map < String , O...
public class FTPControlChannel { /** * Write the command to the control channel , * block until reply arrives and check if the command * completed successfully ( reply code 200 ) . * If so , return the reply , otherwise throw exception . * Before calling this method make sure that no old replies are * waiting...
Reply reply = exchange ( cmd ) ; // check for positive reply if ( ! Reply . isPositiveCompletion ( reply ) ) { throw new UnexpectedReplyCodeException ( reply ) ; } return reply ;
public class CmsImageCacheTable { /** * Fills table with entries from image cache helper . < p > */ private void loadTable ( ) { } }
m_nullResult . setVisible ( false ) ; m_intro . setVisible ( false ) ; setVisible ( true ) ; m_siteTableFilter . setVisible ( true ) ; m_container . removeAllItems ( ) ; setVisibleColumns ( PROP_NAME , PROP_VARIATIONS ) ; List < String > resources = HELPER . getAllCachedImages ( ) ; for ( String res : resources ) { Ite...
public class ClosableCharArrayWriter { /** * Performs an effecient ( zero - copy ) conversion of the character data * accumulated in this writer to a reader . < p > * To ensure the integrity of the resulting reader , { @ link # free ( ) * free } is invoked upon this writer as a side - effect . * @ return a read...
checkFreed ( ) ; CharArrayReader reader = new CharArrayReader ( buf , 0 , count ) ; // System . out . println ( " toCharArrayReader : : buf . length : " + buf . length ) ; free ( ) ; return reader ;
public class ClasspathUtils { /** * Returns an String array of all the names of the jars in the system classpath * @ return The names of jars from the system classpath */ public static String [ ] getJars ( ) { } }
final ArrayList < String > list = new ArrayList < > ( ) ; final FileExtFileFilter filter = new FileExtFileFilter ( JAR_EXT ) ; for ( final String part : System . getProperty ( CLASSPATH ) . split ( File . pathSeparator ) ) { final File file = new File ( part ) ; if ( filter . accept ( file . getParentFile ( ) , file . ...
public class Throwables { /** * Propagates { @ code throwable } exactly as - is , if and only if it is an instance of { @ link * RuntimeException } , { @ link Error } , or { @ code declaredType } . Example usage : * < pre > * try { * someMethodThatCouldThrowAnything ( ) ; * } catch ( IKnowWhatToDoWithThisExce...
com . google . common . base . Throwables . propagateIfPossible ( throwable , declaredType ) ;
public class Drawer { /** * Open the drawer */ public void openDrawer ( ) { } }
if ( mDrawerBuilder . mDrawerLayout != null && mDrawerBuilder . mSliderLayout != null ) { mDrawerBuilder . mDrawerLayout . openDrawer ( mDrawerBuilder . mDrawerGravity ) ; }
public class MvtReader { /** * Convenience method for loading MVT from file . * See { @ link # loadMvt ( InputStream , GeometryFactory , ITagConverter , RingClassifier ) } . * Uses { @ link # RING _ CLASSIFIER _ V2_1 } for forming Polygons and MultiPolygons . * @ param file path to the MVT * @ param geomFactory...
return loadMvt ( file , geomFactory , tagConverter , RING_CLASSIFIER_V2_1 ) ;
public class ProjectMappingService { /** * Sets the applicationId for a project * @ throws IntegrationException */ public void populateApplicationId ( ProjectView projectView , String applicationId ) throws IntegrationException { } }
List < ProjectMappingView > projectMappings = blackDuckService . getAllResponses ( projectView , ProjectView . PROJECT_MAPPINGS_LINK_RESPONSE ) ; boolean canCreate = projectMappings . isEmpty ( ) ; if ( canCreate ) { if ( ! projectView . hasLink ( ProjectView . PROJECT_MAPPINGS_LINK ) ) { throw new BlackDuckIntegration...
public class WaitPredicates { /** * Predicate to use with { @ link WaitWebElements # wait ( Predicate ) } methods which ensures that * evaluation will only be successful when this instance has a specific size . * @ param < T > the generic type * @ param size number of matched { @ link WebElement } instances * @...
return new Predicate < T > ( ) { @ Override public boolean apply ( T input ) { return input . as ( BasicElements . class ) . size ( ) == size ; } @ Override public String toString ( ) { return String . format ( "forSize(%d)" , size ) ; } } ;
public class DefaultConverterRegistry { @ SuppressWarnings ( "unchecked" ) private ConverterProvider findProvider ( Class < ? > valueType ) { } }
if ( valueType == null ) { return null ; } if ( unsupportedTypes . contains ( valueType ) ) { return null ; } ConverterProvider provider = providers . get ( valueType ) ; if ( provider != null ) { return provider ; } List < Class < ? > > supertypes = getSupertypes ( valueType ) ; for ( Class < ? > supertype : supertype...
public class DexParser { /** * read string identifiers list . */ private long [ ] readStringPool ( long stringIdsOff , int stringIdsSize ) { } }
Buffers . position ( buffer , stringIdsOff ) ; long offsets [ ] = new long [ stringIdsSize ] ; for ( int i = 0 ; i < stringIdsSize ; i ++ ) { offsets [ i ] = Buffers . readUInt ( buffer ) ; } return offsets ;
public class CategoryController { /** * Sets the view according to the current category in categoryProperty . * Must ensure that the category is already loaded , else it will fail . * @ param categoryProperty with category to be listened for */ public void addListener ( ReadOnlyObjectProperty < Category > categoryP...
categoryProperty . addListener ( ( observable , oldCategory , newCategory ) -> { setView ( newCategory ) ; } ) ;
public class VirtualMachineDeviceManager { /** * Check network adapter type if it ' s supported by the guest OS */ private static VirtualNetworkAdapterType validateNicType ( GuestOsDescriptor [ ] guestOsDescriptorList , String guestId , VirtualNetworkAdapterType adapterType ) throws DeviceNotSupported { } }
VirtualNetworkAdapterType result = adapterType ; GuestOsDescriptor guestOsInfo = null ; for ( GuestOsDescriptor desc : guestOsDescriptorList ) { if ( desc . getId ( ) . equalsIgnoreCase ( guestId ) ) { guestOsInfo = desc ; break ; } } if ( adapterType == VirtualNetworkAdapterType . Unknown ) { result = TryGetNetworkAda...
public class ChangeNamespacePrefixProcessor { /** * Discovers if the provided attribute is a type attribute using the oldPrefix namespace , on the form * < code > & lt ; xs : element type = " oldPrefix : anElementInTheOldPrefixNamespace " / & gt ; < / code > * @ param attribute the attribute to test . * @ return ...
return TYPE_ATTRIBUTE_NAME . equals ( attribute . getName ( ) ) && attribute . getValue ( ) . startsWith ( oldPrefix + ":" ) ;
public class ListT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # takeUntil ( java . util . function . Predicate ) */ @ Override public ListT < W , T > takeUntil ( final Predicate < ? super T > p ) { } }
return ( ListT < W , T > ) FoldableTransformerSeq . super . takeUntil ( p ) ;
public class EvaluatorManagerFactory { /** * Instantiates a new EvaluatorManager based on a resource allocation . * Fires the EvaluatorAllocatedEvent . * @ param resourceAllocationEvent * @ return an EvaluatorManager for the newly allocated Evaluator . */ public EvaluatorManager getNewEvaluatorManagerForNewEvalua...
final EvaluatorManager evaluatorManager = getNewEvaluatorManagerInstanceForResource ( resourceAllocationEvent ) ; evaluatorManager . fireEvaluatorAllocatedEvent ( ) ; return evaluatorManager ;
public class Threads { /** * Private methods */ private static void logException ( String tag , Throwable t ) { } }
Log . e ( tag , "%s in thread %d" , t , threadId ( ) ) ; t . printStackTrace ( ) ;
public class RuntimeManagerRunner { /** * Clean all states of a heron topology * 1 . Topology def and ExecutionState are required to exist to delete * 2 . TMasterLocation , SchedulerLocation and PhysicalPlan may not exist to delete */ protected void cleanState ( String topologyName , SchedulerStateManagerAdaptor st...
LOG . fine ( "Cleaning up topology state" ) ; Boolean result ; result = statemgr . deleteTMasterLocation ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear TMaster location. Check whether TMaster set it correctly." ) ; } result = statemgr . deleteMetri...
public class Marshaller { /** * Marshals the key . */ private void marshalKey ( ) { } }
Key parent = null ; ParentKeyMetadata parentKeyMetadata = entityMetadata . getParentKeyMetadata ( ) ; if ( parentKeyMetadata != null ) { DatastoreKey parentDatastoreKey = ( DatastoreKey ) getFieldValue ( parentKeyMetadata ) ; if ( parentDatastoreKey != null ) { parent = parentDatastoreKey . nativeKey ( ) ; } } Identifi...
public class FindbugsPlugin { /** * Store a new bug collection for a project . The collection is stored in the * session , and also in a file in the project . * @ param project * the project * @ param bugCollection * the bug collection * @ param monitor * progress monitor * @ throws IOException * @ th...
// Store the bug collection and findbugs project in the session project . setSessionProperty ( SESSION_PROPERTY_BUG_COLLECTION , bugCollection ) ; if ( bugCollection != null ) { writeBugCollection ( project , bugCollection , monitor ) ; }
public class PreparedStatement { /** * { @ inheritDoc } */ public void setBigDecimal ( final int parameterIndex , final BigDecimal x ) throws SQLException { } }
final ParameterDef def = ( x == null ) ? Numeric : Numeric ( x ) ; setParam ( parameterIndex , def , x ) ;
public class MvcGraph { /** * Clear { @ link Provider . DereferenceListener } s which will be called when the last cached * instance of an injected contract is freed . */ public void clearDereferencedListeners ( ) { } }
if ( uiThreadRunner . isOnUiThread ( ) ) { graph . clearDereferencedListeners ( ) ; } else { uiThreadRunner . post ( new Runnable ( ) { @ Override public void run ( ) { graph . clearDereferencedListeners ( ) ; } } ) ; }
public class PaymentKit { /** * 替换url中的参数 * @ param str * @ param regex * @ param args * @ return { String } */ public static String replace ( String str , String regex , String ... args ) { } }
int length = args . length ; for ( int i = 0 ; i < length ; i ++ ) { str = str . replaceFirst ( regex , args [ i ] ) ; } return str ;
public class Alias { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPAliasControllable # getDefaultPriority ( ) */ public int getDefaultPriority ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDefaultPriority" ) ; int priority = aliasDest . getDefaultPriority ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDefaultPriority" , new Integer ( priority ) ) ; ...
public class HttpRequest { /** * 获取翻页对象 https : / / redkale . org / pipes / records / list / offset : 0 / limit : 20 / sort : createtime % 20ASC < br > * https : / / redkale . org / pipes / records / list ? flipper = { ' offset ' : 0 , ' limit ' : 20 , ' sort ' : ' createtime ASC ' } < br > * 以上两种接口都可以获取到翻页对象 * @...
org . redkale . source . Flipper flipper = getJsonParameter ( org . redkale . source . Flipper . class , name ) ; if ( flipper == null ) { if ( maxLimit < 1 ) maxLimit = org . redkale . source . Flipper . DEFAULT_LIMIT ; int limit = getRequstURIPath ( "limit:" , 0 ) ; int offset = getRequstURIPath ( "offset:" , 0 ) ; S...
public class Evolution { /** * 设置detail值 * @ param link * @ param text * @ param img */ public Evolution detail ( String link , String text , String img ) { } }
this . detail = new Detail ( link , text , img ) ; return this ;
public class AWSServiceCatalogClient { /** * Enable portfolio sharing feature through AWS Organizations . This API will allow Service Catalog to receive * updates on your organization in order to sync your shares with the current structure . This API can only be called * by the master account in the organization . ...
request = beforeClientExecution ( request ) ; return executeEnableAWSOrganizationsAccess ( request ) ;
public class PackageDocImpl { /** * Get all classes ( including Exceptions and Errors ) * and interfaces . * @ since J2SE1.4. * @ return all classes and interfaces in this package , filtered to include * only the included classes if filter = = true . */ public ClassDoc [ ] allClasses ( boolean filter ) { } }
List < ClassDocImpl > classes = getClasses ( filter ) ; return classes . toArray ( new ClassDocImpl [ classes . length ( ) ] ) ;
public class ResponseExceptionHandler { /** * Method for handling exception of type HttpMessageNotReadableException * which is thrown in case the request body is not well formed and cannot be * deserialized . Called by the Spring - Framework for exception handling . * @ param request * the Http request * @ pa...
logRequest ( request , ex ) ; final ExceptionInfo response = createExceptionInfo ( new MessageNotReadableException ( ) ) ; return new ResponseEntity < > ( response , HttpStatus . BAD_REQUEST ) ;
public class SVGParser { /** * Parse a text decoration keyword */ private static TextDirection parseTextDirection ( String val ) { } }
switch ( val ) { case "ltr" : return Style . TextDirection . LTR ; case "rtl" : return Style . TextDirection . RTL ; default : return null ; }
public class YuiCompressorParser { /** * CHECKSTYLE : OFF */ private CategoryAndPriority getCategoryAndPriority ( final String message ) { } }
// NOPMD if ( message . startsWith ( "Found an undeclared symbol" ) ) { return CategoryAndPriority . UNDECLARED_SYMBOL ; } if ( message . startsWith ( "Try to use a single 'var' statement per scope" ) ) { return CategoryAndPriority . USE_SINGLE_VAR ; } if ( message . startsWith ( "Using JScript conditional comments is ...
public class WeldCollections { /** * Returns an immutable view of a given map . */ public static < K , V > Map < K , V > immutableMapView ( Map < K , V > map ) { } }
if ( map instanceof ImmutableMap < ? , ? > ) { return map ; } return Collections . unmodifiableMap ( map ) ;
public class AtlasTypeDefGraphStoreV1 { /** * update the given vertex property , if the new value is not - blank */ private void updateVertexProperty ( AtlasVertex vertex , String propertyName , String newValue ) { } }
if ( StringUtils . isNotBlank ( newValue ) ) { String currValue = vertex . getProperty ( propertyName , String . class ) ; if ( ! StringUtils . equals ( currValue , newValue ) ) { vertex . setProperty ( propertyName , newValue ) ; } }
public class FullTextExpression { /** * Creates a full - text expression with the given full - text index name . * @ param name The full - text index name . * @ return The full - text expression . */ @ NonNull public static FullTextExpression index ( @ NonNull String name ) { } }
if ( name == null ) { throw new IllegalArgumentException ( "name is null." ) ; } return new FullTextExpression ( name ) ;
public class FindUnrelatedTypesInGenericContainer { /** * Methods marked with the " Synthetic " attribute do not appear in the source * code */ private boolean isSynthetic ( Method m ) { } }
if ( ( m . getAccessFlags ( ) & Const . ACC_SYNTHETIC ) != 0 ) { return true ; } Attribute [ ] attrs = m . getAttributes ( ) ; for ( Attribute attr : attrs ) { if ( attr instanceof Synthetic ) { return true ; } } return false ;
public class SessionDataManager { /** * Return item data by parent NodeDada and relPathEntries If relpath is JCRPath . THIS _ RELPATH = ' . ' * it return itself * @ param parent * @ param relPathEntries * - array of QPathEntry which represents the relation path to the searched item * @ param itemType * - it...
ItemData item = parent ; for ( int i = 0 ; i < relPathEntries . length ; i ++ ) { if ( i == relPathEntries . length - 1 ) { item = getItemData ( parent , relPathEntries [ i ] , itemType ) ; } else { item = getItemData ( parent , relPathEntries [ i ] , ItemType . UNKNOWN ) ; } if ( item == null ) { break ; } if ( item ....
public class LcdClockSkin { /** * * * * * * Methods * * * * * */ protected void handleEvents ( final String EVENT_TYPE ) { } }
if ( "REDRAW" . equals ( EVENT_TYPE ) ) { pane . setEffect ( clock . getShadowsEnabled ( ) ? mainInnerShadow1 : null ) ; shadowGroup . setEffect ( clock . getShadowsEnabled ( ) ? FOREGROUND_SHADOW : null ) ; updateLcdDesign ( height ) ; redraw ( ) ; } else if ( "RESIZE" . equals ( EVENT_TYPE ) ) { resize ( ) ; redraw (...
public class WalletApi { /** * Returns a corporation & # 39 ; s wallet balance Get a corporation & # 39 ; s * wallets - - - This route is cached for up to 300 seconds - - - Requires one * of the following EVE corporation role ( s ) : Accountant , Junior _ Accountant * SSO Scope : esi - wallet . read _ corporation...
ApiResponse < List < CorporationWalletsResponse > > resp = getCorporationsCorporationIdWalletsWithHttpInfo ( corporationId , datasource , ifNoneMatch , token ) ; return resp . getData ( ) ;
public class MavenJDOMWriter { /** * Method updatePluginExecution . * @ param value * @ param element * @ param counter * @ param xmlTag */ protected void updatePluginExecution ( PluginExecution value , String xmlTag , Counter counter , Element element ) { } }
Element root = element ; Counter innerCount = new Counter ( counter . getDepth ( ) + 1 ) ; findAndReplaceSimpleElement ( innerCount , root , "id" , value . getId ( ) , "default" ) ; findAndReplaceSimpleElement ( innerCount , root , "phase" , value . getPhase ( ) , null ) ; findAndReplaceSimpleLists ( innerCount , root ...
public class RowOutputTextLog { /** * fredt @ users - patch 1108647 by nkowalcz @ users ( NataliaK ) fix for IS NULL */ protected void writeNull ( Type type ) { } }
if ( logMode == MODE_DELETE ) { write ( BYTES_IS ) ; } else if ( isWritten ) { write ( ',' ) ; } isWritten = true ; write ( BYTES_NULL ) ;
public class ClassLoaderResolver { /** * { @ inheritDoc } */ public void close ( ) throws IOException { } }
for ( ClassLoader classLoader : classLoaders . values ( ) ) { if ( classLoader instanceof Closeable ) { // URLClassLoaders are only closeable since Java 1.7. ( ( Closeable ) classLoader ) . close ( ) ; } }
public class GenericResponses { /** * Create a new { @ link GenericResponseBuilder } with a not - modified status . * @ param tag the entity tag of the unmodified entity * @ return a new builder */ public static < T > GenericResponseBuilder < T > notModified ( String tag ) { } }
return GenericResponses . < T > notModified ( ) . tag ( tag ) ;
public class CommonOps_DDRM { /** * Element - wise log operation < br > * c < sub > ij < / sub > = Math . log ( a < sub > ij < / sub > ) * @ param A input * @ param C output ( modified ) */ public static void elementLog ( DMatrixD1 A , DMatrixD1 C ) { } }
if ( A . numCols != C . numCols || A . numRows != C . numRows ) { throw new MatrixDimensionException ( "All matrices must be the same shape" ) ; } int size = A . getNumElements ( ) ; for ( int i = 0 ; i < size ; i ++ ) { C . data [ i ] = Math . log ( A . data [ i ] ) ; }
public class IconicsMenuInflaterUtil { /** * Uses the styleable tags to get the iconics data of menu items . Useful for set icons into * { @ code BottomNavigationView } * By default , menus don ' t show icons for sub menus , but this can be enabled via reflection * So use this function if you want that sub menu i...
parseXmlAndSetIconicsDrawables ( context , menuId , menu , false ) ;
public class AdBrokerBenchmark { /** * Main routine creates a benchmark instance and kicks off the run method . * @ param args Command line arguments . * @ throws Exception if anything goes wrong . * @ see { @ link AdBrokerConfig } */ public static void main ( String [ ] args ) throws Exception { } }
// create a configuration from the arguments AdBrokerConfig config = new AdBrokerConfig ( ) ; config . parse ( AdBrokerBenchmark . class . getName ( ) , args ) ; AdBrokerBenchmark benchmark = new AdBrokerBenchmark ( config ) ; benchmark . runBenchmark ( ) ;
public class BinaryJedis { /** * Remove the specified member from the sorted set value stored at key . If member was not a member * of the set no operation is performed . If key does not not hold a set value an error is * returned . * Time complexity O ( log ( N ) ) with N being the number of elements in the sort...
checkIsInMultiOrPipeline ( ) ; client . zrem ( key , members ) ; return client . getIntegerReply ( ) ;
public class RulePrunerFactory { /** * Computes the size of a normal , i . e . unpruned grammar . * @ param rules the grammar rules . * @ param paaSize the SAX transform word size . * @ return the grammar size , in BYTES . */ public static Integer computeGrammarSize ( GrammarRules rules , Integer paaSize ) { } }
// The final grammar ' s size in BYTES int res = 0 ; // The final size is the sum of the sizes of all rules for ( GrammarRuleRecord r : rules ) { String ruleStr = r . getRuleString ( ) ; String [ ] tokens = ruleStr . split ( "\\s+" ) ; int ruleSize = computeRuleSize ( paaSize , tokens ) ; res += ruleSize ; } return res...
public class CsvToSqlExtensions { /** * Gets the csv file as sql insert script . * @ param tableName * the table name * @ param csvBean * the csv bean * @ return the csv file as sql insert script */ public static String getCsvFileAsSqlInsertScript ( final String tableName , final CsvBean csvBean ) { } }
return getCsvFileAsSqlInsertScript ( tableName , csvBean , true , true ) ;
public class JsonPathLibrary { /** * Checks if the given JSON contents are equal . See ` Json Should Be Equal ` * for more details * ` from ` and ` to ` can be either URI or the actual JSON content . * You can add optional method ( ie GET , POST , PUT ) , data or content type as parameters . * Method defaults t...
return jsonShouldBeEqual ( from , to , false ) ;
public class GeometryColumnsDao { /** * { @ inheritDoc } * Update using the complex key */ @ Override public int update ( GeometryColumns geometryColumns ) throws SQLException { } }
UpdateBuilder < GeometryColumns , TableColumnKey > ub = updateBuilder ( ) ; ub . updateColumnValue ( GeometryColumns . COLUMN_GEOMETRY_TYPE_NAME , geometryColumns . getGeometryTypeName ( ) ) ; ub . updateColumnValue ( GeometryColumns . COLUMN_SRS_ID , geometryColumns . getSrsId ( ) ) ; ub . updateColumnValue ( Geometry...
public class HtmlDocletWriter { /** * Get link for previous file . * @ param prev File name for the prev link * @ return a content tree for the link */ public Content getNavLinkPrevious ( DocPath prev ) { } }
Content li ; if ( prev != null ) { li = HtmlTree . LI ( getHyperLink ( prev , contents . prevLabel , "" , "" ) ) ; } else li = HtmlTree . LI ( contents . prevLabel ) ; return li ;
public class JPAExEntityManager { /** * Helper method to convert the input puids to a String for tr . debug ( ) . */ private static final String toStringPuIds ( String desc , JPAPuId [ ] puids ) { } }
StringBuilder sbuf = new StringBuilder ( desc ) ; sbuf . append ( '\n' ) ; for ( JPAPuId puid : puids ) { sbuf . append ( " " ) . append ( puid ) . append ( '\n' ) ; } return sbuf . toString ( ) ;
public class QueryString { /** * Adds a query string element . * @ param name The name of the element . * @ param value The value of the element . */ public void add ( final String name , final String value ) { } }
ArrayList < String > values = super . get ( name ) ; if ( values == null ) { values = new ArrayList < String > ( 1 ) ; // Often there ' s only 1 value . super . put ( name , values ) ; } values . add ( value ) ;
public class Options { /** * Returns whether the named { @ link Option } is a member of this { @ link Options } . * @ param opt short name of the { @ link Option } * @ return true if the named { @ link Option } is a member of this { @ link Options } * @ since 1.3 */ public boolean hasShortOption ( String opt ) { ...
opt = Util . stripLeadingHyphens ( opt ) ; return shortOpts . containsKey ( opt ) ;
public class TextModerationsImpl { /** * Detect profanity and match against custom and shared blacklists . * Detects profanity in more than 100 languages and match against custom and shared blacklists . * @ param textContentType The content type . Possible values include : ' text / plain ' , ' text / html ' , ' tex...
return ServiceFuture . fromResponse ( screenTextWithServiceResponseAsync ( textContentType , textContent , screenTextOptionalParameter ) , serviceCallback ) ;
public class LdapConfigManager { /** * Refreshes the caches using the given configuration data object . * This method should be called when there are changes in configuration and schema . * @ param reposConfig the data object containing configuration information of the repository . * @ throws WIMException */ publ...
final String METHODNAME = "initialize(configProps)" ; iLdapType = ( String ) configProps . get ( ConfigConstants . CONFIG_PROP_LDAP_SERVER_TYPE ) ; if ( iLdapType == null ) { iLdapType = ConfigConstants . CONFIG_LDAP_IDS52 ; } else { iLdapType = iLdapType . toUpperCase ( ) ; } /* * Initialize certificate mapping . */ s...
public class EnumsConverter { /** * Create enumeration constant for given string and enumeration type . * @ throws IllegalArgumentException string argument is not a valid constant for given enumeration type . * @ throws NumberFormatException if string argument is not a valid numeric value and value type implements ...
if ( string . isEmpty ( ) ) { return null ; } // at this point value type is guaranteed to be enumeration if ( Types . isKindOf ( valueType , OrdinalEnum . class ) ) { return valueType . getEnumConstants ( ) [ Integer . parseInt ( string ) ] ; } return ( T ) Enum . valueOf ( ( Class ) valueType , string ) ;
public class Sql { /** * An extension point allowing derived classes to change the behavior of * connection creation . The default behavior is to either use the * supplied connection or obtain it from the supplied datasource . * @ return the connection associated with this Sql * @ throws java . sql . SQLExcepti...
if ( ( cacheStatements || cacheConnection ) && useConnection != null ) { return useConnection ; } if ( dataSource != null ) { // Use a doPrivileged here as many different properties need to be // read , and the policy shouldn ' t have to list them all . Connection con ; try { con = AccessController . doPrivileged ( new...
public class SAXSymbol { /** * Deals with a matching digram . * @ param theDigram the first matching digram . * @ param matchingDigram the second matching digram . */ public void match ( SAXSymbol theDigram , SAXSymbol matchingDigram ) { } }
SAXRule rule ; SAXSymbol first , second ; // System . out . println ( " [ sequitur debug ] * match * newDigram [ " + newDigram . value + " , " // + newDigram . n . value + " ] , old matching one [ " + matchingDigram . value + " , " // + matchingDigram . n . value + " ] " ) ; // if previous of matching digram is a guard...
public class RedisDS { /** * 从Redis中获取值 * @ param key 键 * @ return 值 */ public String getStr ( String key ) { } }
try ( Jedis jedis = getJedis ( ) ) { return jedis . get ( key ) ; }
public class BccClient { /** * Unbinding the instance from securitygroup . * @ param instanceId The id of the instance . * @ param securityGroupId The id of the securitygroup . */ public void unbindInstanceFromSecurityGroup ( String instanceId , String securityGroupId ) { } }
this . unbindInstanceFromSecurityGroup ( new UnbindSecurityGroupRequest ( ) . withInstanceId ( instanceId ) . withSecurityGroupId ( securityGroupId ) ) ;
public class HikariDataSource { /** * { @ inheritDoc } */ @ Override public void setHealthCheckRegistry ( Object healthCheckRegistry ) { } }
boolean isAlreadySet = getHealthCheckRegistry ( ) != null ; super . setHealthCheckRegistry ( healthCheckRegistry ) ; HikariPool p = pool ; if ( p != null ) { if ( isAlreadySet ) { throw new IllegalStateException ( "HealthCheckRegistry can only be set one time" ) ; } else { p . setHealthCheckRegistry ( super . getHealth...
public class KriptonDatabaseWrapper { /** * Compile . * @ param context the context * @ param sql the sql * @ return the SQ lite statement */ public static SQLiteStatement compile ( SQLContext context , String sql ) { } }
SQLiteStatement ps = context . database ( ) . compileStatement ( sql ) ; return ps ;
public class I2CDeviceImpl { /** * This helper method creates a string describing bus file name , device address ( in hex ) and local i2c address . * @ param address local address in i2c device * @ return string with all details */ protected String makeDescription ( int address ) { } }
return "I2CDevice on " + bus + " at address 0x" + Integer . toHexString ( deviceAddress ) + " to address 0x" + Integer . toHexString ( address ) ;
public class CmsXmlContentProperty { /** * Copies a property definition , but replaces the nice name attribute . < p > * @ param name the new nice name attribute * @ return the copied property definition */ public CmsXmlContentProperty withName ( String name ) { } }
return new CmsXmlContentProperty ( name , m_type , m_visibility , m_widget , m_widgetConfiguration , m_ruleRegex , m_ruleType , m_default , m_niceName , m_description , m_error , m_preferFolder ) ;
public class MedianOfWidestDimension { /** * Implements computation of the kth - smallest element according * to Manber ' s " Introduction to Algorithms " . * @ param attIdx The dimension / attribute of the instances in * which to find the kth - smallest element . * @ param indices The master index array contai...
if ( left == right ) { return left ; } else { int middle = partition ( attIdx , indices , left , right ) ; if ( ( middle - left + 1 ) >= k ) { return select ( attIdx , indices , left , middle , k ) ; } else { return select ( attIdx , indices , middle + 1 , right , k - ( middle - left + 1 ) ) ; } }
public class ObjectReader { /** * Reads all objects from the database , using the given mapping . * This is the most general form of readObjects ( ) . * @ param objClass The class of the objects to read * @ param mapping The hashtable containing the object mapping * @ param where An hashtable containing extra c...
return readObjects0 ( pObjClass , pMapping , pWhere ) ;
public class NDArrayMessage { /** * Returns if a message is valid or not based on a few simple conditions : * no null values * both index and the dimensions array must be - 1 and of length 1 with an element of - 1 in it * otherwise it is a valid message . * @ param message the message to validate * @ return 1...
if ( message . getDimensions ( ) == null || message . getArr ( ) == null ) return MessageValidity . NULL_VALUE ; if ( message . getIndex ( ) != - 1 && message . getDimensions ( ) . length == 1 && message . getDimensions ( ) [ 0 ] != - 1 ) return MessageValidity . INCONSISTENT_DIMENSIONS ; return MessageValidity . VALID...
public class JvmLongAnnotationValueImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case TypesPackage . JVM_LONG_ANNOTATION_VALUE__VALUES : getValues ( ) . clear ( ) ; getValues ( ) . addAll ( ( Collection < ? extends Long > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class DateUtil { /** * 智能转换日期 * @ param date * @ return */ public static String smartFormat ( Date date ) { } }
String dateStr = null ; if ( date == null ) { dateStr = "" ; } else { try { dateStr = formatDate ( date , Y_M_D_HMS ) ; // 时分秒 if ( dateStr . endsWith ( " 00:00:00" ) ) { dateStr = dateStr . substring ( 0 , 10 ) ; } // 时分 else if ( dateStr . endsWith ( "00:00" ) ) { dateStr = dateStr . substring ( 0 , 16 ) ; } else if ...
public class CommerceRegionPersistenceImpl { /** * Returns all the commerce regions . * @ return the commerce regions */ @ Override public List < CommerceRegion > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class ReflectionUtil { /** * Checks method for @ JsonRpcParam annotations and returns named parameters . * @ param method the method * @ param arguments the arguments * @ return named parameters or empty if no annotations found * @ throws IllegalArgumentException if some parameters are annotated and othe...
Map < String , Object > namedParams = new LinkedHashMap < > ( ) ; Annotation [ ] [ ] paramAnnotations = method . getParameterAnnotations ( ) ; for ( int i = 0 ; i < paramAnnotations . length ; i ++ ) { Annotation [ ] ann = paramAnnotations [ i ] ; for ( Annotation an : ann ) { if ( JsonRpcParam . class . isInstance ( a...
public class IPv6AddressSection { /** * This produces the mixed IPv6 / IPv4 string . It is the shortest such string ( ie fully compressed ) . */ public String toMixedString ( ) { } }
String result ; if ( hasNoStringCache ( ) || ( result = getStringCache ( ) . mixedString ) == null ) { getStringCache ( ) . mixedString = result = toNormalizedString ( IPv6StringCache . mixedParams ) ; } return result ;
public class PtrCLog { /** * Send a WARNING log message * @ param tag * @ param msg * @ param throwable */ public static void w ( String tag , String msg , Throwable throwable ) { } }
if ( sLevel > LEVEL_WARNING ) { return ; } Log . w ( tag , msg , throwable ) ;
public class ScriptVars { /** * Sets or removes a script variable . * The variable is removed when the { @ code value } is { @ code null } . * @ param context the context of the script . * @ param key the key of the variable . * @ param value the value of the variable . * @ throws IllegalArgumentException if ...
setScriptVarImpl ( getScriptName ( context ) , key , value ) ;
public class NamedArgumentImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setCalledByName ( boolean newCalledByName ) { } }
boolean oldCalledByName = calledByName ; calledByName = newCalledByName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XtextPackage . NAMED_ARGUMENT__CALLED_BY_NAME , oldCalledByName , calledByName ) ) ;
public class DependencyIdentifier { /** * TODO * @ param method * @ param qualifiers * @ return */ public static DependencyIdentifier getDependencyIdentifierForClass ( Method method , SortedSet < String > qualifiers ) { } }
List < Type > typeList = new ArrayList < Type > ( ) ; addTypeToList ( method . getGenericReturnType ( ) , typeList ) ; return new DependencyIdentifier ( typeList , qualifiers ) ;
public class ListGroupResourcesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListGroupResourcesRequest listGroupResourcesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listGroupResourcesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listGroupResourcesRequest . getGroupName ( ) , GROUPNAME_BINDING ) ; protocolMarshaller . marshall ( listGroupResourcesRequest . getFilters ( ) , FILTERS_BINDI...
public class Preconditions { /** * Enforces that the duration is a valid influxDB duration . * @ param duration the duration to test * @ param name variable name for reporting * @ throws IllegalArgumentException if the given duration is not valid . */ public static void checkDuration ( final String duration , fin...
if ( ! duration . matches ( "(\\d+[wdmhs])+|inf" ) ) { throw new IllegalArgumentException ( "Invalid InfluxDB duration: " + duration + " for " + name ) ; }
public class ReactiveMongoOperationsSessionRepository { /** * Creates a new { @ link MongoSession } that is capable of being persisted by this { @ link ReactiveSessionRepository } . * This allows optimizations and customizations in how the { @ link MongoSession } is persisted . For example , the * implementation re...
return Mono . justOrEmpty ( this . maxInactiveIntervalInSeconds ) . map ( MongoSession :: new ) . doOnNext ( mongoSession -> publishEvent ( new SessionCreatedEvent ( this , mongoSession ) ) ) . switchIfEmpty ( Mono . just ( new MongoSession ( ) ) ) ;
public class ValidatorContext { /** * 注入闭包 * @ param key 闭包名称 * @ param closure 闭包 */ public void setClosure ( String key , Closure closure ) { } }
if ( closures == null ) { closures = CollectionUtil . createHashMap ( Const . INITIAL_CAPACITY ) ; } closures . put ( key , closure ) ;
public class RESTAssert { /** * assert that object is not null * @ param object the object to check * @ param status the status code to throw * @ throws WebApplicationException with given status code */ public static void assertNotNull ( final Object object , final StatusType status ) { } }
RESTAssert . assertTrue ( object != null , status ) ;
public class RecursiveObjectWriter { /** * Recursively sets value of object and its subobjects property specified by its * name . * The object can be a user defined object , map or array . The property name * correspondently must be object property , map key or array index . * If the property does not exist or ...
if ( obj == null || name == null ) return ; String [ ] names = name . split ( "\\." ) ; if ( names == null || names . length == 0 ) return ; performSetProperty ( obj , names , 0 , value ) ;
public class MahoutRecommenderRunner { /** * Runs the recommender using the provided datamodels . * @ param opts see * { @ link net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS } * @ param trainingModel model to be used to train the recommender . * @ param testModel model to ...
if ( isAlreadyRecommended ( ) ) { return null ; } // transform from core ' s DataModels to Mahout ' s DataModels DataModel trainingModelMahout = new DataModelWrapper ( trainingModel ) ; DataModel testModelMahout = new DataModelWrapper ( testModel ) ; return runMahoutRecommender ( opts , trainingModelMahout , testModelM...
public class FacebookEndpoint { /** * Asynchronously requests the albums associated with the linked account . Requires an opened active { @ link Session } . * @ param id may be { @ link # ME } or a Page id . * @ param callback a { @ link Callback } when the request completes . * @ return true if the request is ma...
boolean isSuccessful = false ; Session session = Session . getActiveSession ( ) ; if ( session != null && session . isOpened ( ) ) { // Construct fields to request . Bundle params = new Bundle ( ) ; params . putString ( ALBUMS_LISTING_LIMIT_KEY , ALBUMS_LISTING_LIMIT_VALUE ) ; params . putString ( ALBUMS_LISTING_FEILDS...
public class ListPoliciesGrantingServiceAccessRequest { /** * The service namespace for the AWS services whose policies you want to list . * To learn the service namespace for a service , go to < a * href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / reference _ policies _ actions - resourc...
if ( this . serviceNamespaces == null ) { setServiceNamespaces ( new com . amazonaws . internal . SdkInternalList < String > ( serviceNamespaces . length ) ) ; } for ( String ele : serviceNamespaces ) { this . serviceNamespaces . add ( ele ) ; } return this ;