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 > getServicesOrBuilderList ( ) { } }
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 repositoryPath ) { } }
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 . marshall ( describeConfigurationAggregatorsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( describeConfigurationAggregatorsRequest . getLimit ( ) , LIMIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 > example . com : 8080 < / pre > < / blockquote > * If the provided site does not have a port , it ' s added the default of the used scheme . * < strong > Note : < / strong > The implementation is optimised to handle only HTTP and HTTPS schemes , the behaviour is undefined * for other schemes . * @ param site the site whose authority will be extracted * @ return the authority of the site * @ since 2.5.0 */ public static String getAuthority ( String site ) { } }
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 ( 8 ) ; isSecure = true ; } // Remove trailing chrs int idx = authority . indexOf ( '/' ) ; if ( idx > 0 ) { authority = authority . substring ( 0 , idx ) ; } if ( ! authority . isEmpty ( ) && authority . indexOf ( ':' ) == - 1 ) { if ( isSecure ) { return authority + ":443" ; } return authority + ":80" ; } return authority ;
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 ( ) instanceof Class ) { if ( ConfigurationListener . class . isAssignableFrom ( ( Class < ? > ) ( ( ParameterizedType ) interfaceClass ) . getRawType ( ) ) ) { ParameterizedType pType = ( ParameterizedType ) interfaceClass ; Type [ ] typeArgs = pType . getActualTypeArguments ( ) ; if ( typeArgs != null && typeArgs . length == 1 && typeArgs [ 0 ] instanceof Class ) { Class < ? > type = ( Class < ? > ) typeArgs [ 0 ] ; if ( type . isAnnotationPresent ( CadmiumConfig . class ) ) { log . debug ( "Adding " + type + " to the configuration types interesting to " + listenerClass ) ; configClasses . add ( type ) ; } } } } } } } return configClasses . toArray ( new Class < ? > [ ] { } ) ;
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 bits . set ( '\\' , false ) ; // exclude backslash = % x5C return bits ;
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 ; } FunctionType fnType = type . toMaybeFunctionType ( ) ; if ( fnType != null && fnType . hasInstanceType ( ) ) { FunctionType ctorType = fnType . getInstanceType ( ) . getConstructor ( ) ; if ( ctorType != null && ctorType . isAbstract ( ) ) { report ( n , INSTANTIATE_ABSTRACT_CLASS ) ; } visitArgumentList ( n , fnType ) ; ensureTyped ( n , fnType . getInstanceType ( ) ) ; } else { ensureTyped ( n ) ; }
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 nodeTypesSupplier the supplier of the { @ link NodeTypes } instance ; * may not be null * @ param workspaceName the name of the workspace for which to build the * index ; may not be null * @ param matcher the node type matcher used to determine which nodes should * be included in the index ; may not be null * @ return the index builder ; never null */ public static EsManagedIndexBuilder create ( EsClient client , ExecutionContext context , IndexDefinition defn , NodeTypes . Supplier nodeTypesSupplier , String workspaceName , ChangeSetAdapter . NodeTypePredicate matcher ) { } }
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 , Object > > > cache = CaffeinatedGuava . build ( cacheBuilder , createCacheLoader ( repository ) ) ; GuavaCacheMetrics . monitor ( meterRegistry , cache , "l2." + repository . getEntityType ( ) . getId ( ) ) ; return cache ;
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 on the control channel . Otherwise the reply returned * may not be the reply to this command . * @ throws java . io . IOException on I / O error * @ throws FTPReplyParseException on bad reply format * @ throws UnexpectedReplyCodeException if reply is not a positive * completion reply ( code 200) * @ param cmd FTP command * @ return the first reply that waits in the control channel */ public Reply execute ( Command cmd ) throws ServerException , IOException , FTPReplyParseException , UnexpectedReplyCodeException { } }
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 ) { Item item = m_container . addItem ( res ) ; item . getItemProperty ( PROP_NAME ) . setValue ( res ) ; } if ( resources . size ( ) == 0 ) { m_nullResult . setVisible ( true ) ; setVisible ( false ) ; m_siteTableFilter . setVisible ( false ) ; }
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 reader representing this writer ' s accumulated * character data * @ throws java . io . IOException if an I / O error occurs . * In particular , an < tt > IOException < / tt > may be thrown * if this writer has been { @ link # free ( ) freed } . */ public synchronized CharArrayReader toCharArrayReader ( ) throws IOException { } }
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 . getName ( ) ) ) { list . add ( file . getAbsolutePath ( ) ) ; } } return list . toArray ( new String [ 0 ] ) ;
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 ( IKnowWhatToDoWithThisException e ) { * handle ( e ) ; * } catch ( Throwable t ) { * Throwables . propagateIfPossible ( t , OtherException . class ) ; * throw new RuntimeException ( " unexpected " , t ) ; * < / pre > * @ param throwable throwable ( may be { @ code null } ) * @ param declaredType the single checked exception type declared by the calling method */ public static < X extends Throwable > void propagateIfPossible ( Throwable throwable , Class < X > declaredType ) throws X { } }
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 allows for JTS geometry creation * @ param tagConverter converts MVT feature tags to JTS user data object * @ return JTS MVT with geometry in MVT coordinates * @ throws IOException failure reading MVT from path * @ see # loadMvt ( InputStream , GeometryFactory , ITagConverter , RingClassifier ) * @ see Geometry * @ see Geometry # getUserData ( ) * @ see RingClassifier */ public static JtsMvt loadMvt ( File file , GeometryFactory geomFactory , ITagConverter tagConverter ) throws IOException { } }
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 BlackDuckIntegrationException ( String . format ( "The supplied projectView does not have the link (%s) to create a project mapping." , ProjectView . PROJECT_MAPPINGS_LINK ) ) ; } String projectMappingsLink = projectView . getFirstLink ( ProjectView . PROJECT_MAPPINGS_LINK ) . get ( ) ; ProjectMappingView projectMappingView = new ProjectMappingView ( ) ; projectMappingView . setApplicationId ( applicationId ) ; blackDuckService . post ( projectMappingsLink , projectMappingView ) ; } else { // Currently there exists only one project - mapping which is the project ' s Application ID . // Eventually , this method would need to take in a namespace on which we will need to filter . ProjectMappingView projectMappingView = projectMappings . get ( 0 ) ; projectMappingView . setApplicationId ( applicationId ) ; blackDuckService . put ( projectMappingView ) ; }
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 predicate that returns true if it has the exact size */ public static < T extends Elements > Predicate < T > forSize ( final int size ) { } }
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 : supertypes ) { provider = findProvider ( supertype ) ; if ( provider != null ) { LOGGER . debug ( "Adding shortcut mapping {} -> {}" , valueType . getCanonicalName ( ) , provider . converterType ( ) . getCanonicalName ( ) ) ; providers . put ( valueType , provider ) ; return provider ; } } unsupportedTypes . add ( valueType ) ; return null ;
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 > categoryProperty ) { } }
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 = TryGetNetworkAdapterType ( guestOsInfo ) ; } else { if ( guestOsInfo . getSupportedEthernetCard ( ) != null ) { boolean supported = false ; List < String > supportedTypeList = new ArrayList < String > ( ) ; for ( String supportedAdapterName : guestOsInfo . getSupportedEthernetCard ( ) ) { VirtualNetworkAdapterType supportedAdapterType = GetNetworkAdapterTypeByApiType ( supportedAdapterName ) ; supportedTypeList . add ( supportedAdapterType . toString ( ) ) ; if ( supportedAdapterType == adapterType ) { supported = true ; break ; } } if ( ! supported ) { DeviceNotSupported dns = new DeviceNotSupported ( ) ; dns . setDevice ( "Virtual NIC" ) ; dns . setReason ( "The requested NIC is not supported in this OS." ) ; throw dns ; } } } return result ;
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 < code > true < / code > if the provided attribute is named " type " and starts with < code > [ oldPrefix ] : < / code > , in * which case it is a type in the oldPrefix namespace . */ private boolean isTypeAttributeWithPrefix ( final Attr attribute ) { } }
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 getNewEvaluatorManagerForNewEvaluator ( final ResourceAllocationEvent resourceAllocationEvent ) { } }
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 statemgr ) throws TopologyRuntimeManagementException { } }
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 . deleteMetricsCacheLocation ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear MetricsCache location. Check whether MetricsCache set it correctly." ) ; } result = statemgr . deletePackingPlan ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear packing plan. Check whether Launcher set it correctly." ) ; } result = statemgr . deletePhysicalPlan ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear physical plan. Check whether TMaster set it correctly." ) ; } result = statemgr . deleteSchedulerLocation ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear scheduler location. Check whether Scheduler set it correctly." ) ; } result = statemgr . deleteLocks ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to delete locks. It's possible that the topology never created any." ) ; } result = statemgr . deleteExecutionState ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear execution state" ) ; } // Set topology def at last since we determine whether a topology is running // by checking the existence of topology def result = statemgr . deleteTopology ( topologyName ) ; if ( result == null || ! result ) { throw new TopologyRuntimeManagementException ( "Failed to clear topology definition" ) ; } LOG . fine ( "Cleaned up topology state" ) ;
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 ( ) ; } } IdentifierMetadata identifierMetadata = entityMetadata . getIdentifierMetadata ( ) ; IdClassMetadata idClassMetadata = identifierMetadata . getIdClassMetadata ( ) ; DataType identifierType = identifierMetadata . getDataType ( ) ; Object idValue = getFieldValue ( identifierMetadata ) ; // If ID value is null , we don ' t have to worry about if it is a simple // type of a complex type . Otherwise , we need to see if the ID is a // complex type , and if it is , extract the real ID . if ( idValue != null && idClassMetadata != null ) { try { idValue = idClassMetadata . getReadMethod ( ) . invoke ( idValue ) ; } catch ( Throwable t ) { throw new EntityManagerException ( t ) ; } } boolean validId = isValidId ( idValue , identifierType ) ; boolean autoGenerateId = identifierMetadata . isAutoGenerated ( ) ; if ( validId ) { if ( identifierType == DataType . STRING ) { createCompleteKey ( parent , ( String ) idValue ) ; } else { createCompleteKey ( parent , ( long ) idValue ) ; } } else { if ( intent . isKeyRequired ( ) ) { throw new EntityManagerException ( String . format ( "Identifier is not set or valid for entity of type %s" , entity . getClass ( ) ) ) ; } if ( ! autoGenerateId ) { String pattern = "Identifier is not set or valid for entity of type %s. Auto generation " + "of ID is explicitly turned off. " ; throw new EntityManagerException ( String . format ( pattern , entity . getClass ( ) ) ) ; } else { if ( identifierType == DataType . STRING ) { createCompleteKey ( parent ) ; } else { createIncompleteKey ( parent ) ; } } }
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 * @ throws CoreException */ public static void storeBugCollection ( IProject project , final SortedBugCollection bugCollection , IProgressMonitor monitor ) throws IOException , CoreException { } }
// 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 ) ) ; return 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 > * 以上两种接口都可以获取到翻页对象 * @ param name Flipper对象的参数名 , 默认为 " flipper " * @ param needcreate 无参数时是否创建新Flipper对象 * @ param maxLimit 最大行数 , 小于1则值为Flipper . DEFAULT _ LIMIT * @ return Flipper翻页对象 */ public org . redkale . source . Flipper getFlipper ( String name , boolean needcreate , int maxLimit ) { } }
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 ) ; String sort = getRequstURIPath ( "sort:" , "" ) ; if ( limit > 0 ) { if ( limit > maxLimit ) limit = maxLimit ; flipper = new org . redkale . source . Flipper ( limit , offset , sort ) ; } } else if ( flipper . getLimit ( ) < 1 || ( maxLimit > 0 && flipper . getLimit ( ) > maxLimit ) ) { flipper . setLimit ( maxLimit ) ; } if ( flipper != null || ! needcreate ) return flipper ; if ( maxLimit < 1 ) maxLimit = org . redkale . source . Flipper . DEFAULT_LIMIT ; return new org . redkale . source . Flipper ( maxLimit ) ;
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 . * By calling this API Service Catalog will make a call to organizations : EnableAWSServiceAccess on your behalf so * that your shares can be in sync with any changes in your AWS Organizations structure . * @ param enableAWSOrganizationsAccessRequest * @ return Result of the EnableAWSOrganizationsAccess operation returned by the service . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws InvalidStateException * An attempt was made to modify a resource that is in a state that is not valid . Check your resources to * ensure that they are in valid states before retrying the operation . * @ throws OperationNotSupportedException * The operation is not supported . * @ sample AWSServiceCatalog . EnableAWSOrganizationsAccess * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / servicecatalog - 2015-12-10 / EnableAWSOrganizationsAccess " * target = " _ top " > AWS API Documentation < / a > */ @ Override public EnableAWSOrganizationsAccessResult enableAWSOrganizationsAccess ( EnableAWSOrganizationsAccessRequest request ) { } }
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 * @ param ex * the exception which occurred * @ return the entity to be responded containing the exception information * as entity . */ @ ExceptionHandler ( HttpMessageNotReadableException . class ) public ResponseEntity < ExceptionInfo > handleHttpMessageNotReadableException ( final HttpServletRequest request , final Exception ex ) { } }
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 not recommended" ) ) { return CategoryAndPriority . USE_JSCRIPT ; } if ( message . startsWith ( "Using 'eval' is not recommended" ) ) { return CategoryAndPriority . USE_EVAL ; } if ( message . startsWith ( "Using 'with' is not recommended" ) ) { return CategoryAndPriority . USE_WITH ; } if ( UNUSED_SYMBOL_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . UNUSED_SYMBOL ; } if ( UNUSED_VARIABLE_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . DUPLICATE_VAR ; } if ( UNUSED_FUNCTION_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . DUPLICATE_FUN ; } if ( INVALID_HINT_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . INVALID_HINT ; } if ( UNSUPPORTED_HINT_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . UNSUPPORTED_HINT ; } if ( UNKNOWN_HINT_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . UNKNOWN_HINT ; } if ( PRINT_SYMBOL_PATTERN . matcher ( message ) . matches ( ) ) { return CategoryAndPriority . PRINT_SYMBOL ; } return CategoryAndPriority . UNKNOWN ;
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 * - item type * @ return existed item data or null if not found * @ throws RepositoryException */ public ItemData getItemData ( NodeData parent , QPathEntry [ ] relPathEntries , ItemType itemType ) throws RepositoryException { } }
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 . isNode ( ) ) { parent = ( NodeData ) item ; } else if ( i < relPathEntries . length - 1 ) { throw new IllegalPathException ( "Path can not contains a property as the intermediate element" ) ; } } return 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 ( ) ; } else if ( "LCD" . equals ( EVENT_TYPE ) ) { updateLcdDesign ( height ) ; } else if ( "VISIBILITY" . equals ( EVENT_TYPE ) ) { boolean crystalEnable = clock . isLcdCrystalEnabled ( ) ; crystalOverlay . setManaged ( crystalEnable ) ; crystalOverlay . setVisible ( crystalEnable ) ; boolean secondsVisible = clock . isSecondsVisible ( ) ; backgroundSecondText . setManaged ( secondsVisible ) ; backgroundSecondText . setVisible ( secondsVisible ) ; secondText . setManaged ( secondsVisible ) ; secondText . setVisible ( secondsVisible ) ; boolean dateVisible = clock . isDateVisible ( ) ; dateText . setManaged ( dateVisible ) ; dateText . setVisible ( dateVisible ) ; dayOfWeekText . setManaged ( dateVisible ) ; dayOfWeekText . setVisible ( dateVisible ) ; boolean titleVisible = clock . isTitleVisible ( ) ; title . setManaged ( titleVisible ) ; title . setVisible ( titleVisible ) ; boolean alarmVisible = clock . getAlarms ( ) . size ( ) > 0 ; alarm . setManaged ( alarmVisible ) ; alarm . setVisible ( alarmVisible ) ; resize ( ) ; redraw ( ) ; } else if ( "RECALC" . equals ( EVENT_TYPE ) ) { adjustDateFormat ( ) ; 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 _ wallets . v1 * @ param corporationId * An EVE corporation ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param token * Access token to use if unable to set a header ( optional ) * @ return List & lt ; CorporationWalletsResponse & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public List < CorporationWalletsResponse > getCorporationsCorporationIdWallets ( Integer corporationId , String datasource , String ifNoneMatch , String token ) throws ApiException { } }
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 , value . getGoals ( ) , "goals" , "goal" ) ; findAndReplaceSimpleElement ( innerCount , root , "inherited" , value . getInherited ( ) , null ) ; findAndReplaceXpp3DOM ( innerCount , root , "configuration" , ( Xpp3Dom ) value . getConfiguration ( ) ) ;
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 icons are checked as well */ public static void parseXmlAndSetIconicsDrawables ( @ NonNull Context context , int menuId , @ NonNull Menu menu ) { } }
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 sorted set * @ param key * @ param members * @ return Integer reply , specifically : 1 if the new element was removed 0 if the new element was * not a member of the set */ @ Override public Long zrem ( final byte [ ] key , final byte [ ] ... members ) { } }
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 to GET . * Example : * | Json Should Be Equal | http : / / example . com / test . json | http : / / foobar . com / test . json | * | Json Should Be Equal | { element : { param : hello } } | { element : { param : hello } } | * | Json Should Be Equal | { element : { param : hello } } | { element : { param : hello } } | POST | { hello : world } | application / json | */ @ RobotKeyword public boolean jsonShouldBeEqual ( String from , String to ) throws Exception { } }
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 ( GeometryColumns . COLUMN_Z , geometryColumns . getZ ( ) ) ; ub . updateColumnValue ( GeometryColumns . COLUMN_M , geometryColumns . getM ( ) ) ; ub . where ( ) . eq ( GeometryColumns . COLUMN_TABLE_NAME , geometryColumns . getTableName ( ) ) . and ( ) . eq ( GeometryColumns . COLUMN_COLUMN_NAME , geometryColumns . getColumnName ( ) ) ; PreparedUpdate < GeometryColumns > update = ub . prepare ( ) ; int updated = update ( update ) ; return updated ;
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 ' , ' text / xml ' , ' text / markdown ' * @ param textContent Content to screen . * @ param screenTextOptionalParameter the object representing the optional parameters to be set before calling this API * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Screen > screenTextAsync ( String textContentType , byte [ ] textContent , ScreenTextOptionalParameter screenTextOptionalParameter , final ServiceCallback < Screen > serviceCallback ) { } }
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 */ public void initialize ( Map < String , Object > configProps ) throws WIMException { } }
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 . */ setCertificateMapMode ( ( String ) configProps . get ( ConfigConstants . CONFIG_PROP_CERTIFICATE_MAP_MODE ) ) ; if ( ConfigConstants . CONFIG_VALUE_FILTER_DESCRIPTOR_MODE . equalsIgnoreCase ( getCertificateMapMode ( ) ) ) { setCertificateFilter ( ( String ) configProps . get ( ConfigConstants . CONFIG_PROP_CERTIFICATE_FILTER ) ) ; } List < HashMap < String , String > > baseEntries = new ArrayList < HashMap < String , String > > ( ) ; // Add the default ( first base entry ) String baseDN = ( String ) configProps . get ( BASE_DN ) ; String name = ( String ) configProps . get ( BASE_ENTRY_NAME ) ; HashMap < String , String > baseEntryMap = new HashMap < String , String > ( ) ; if ( name != null ) baseEntryMap . put ( name , baseDN ) ; else baseEntryMap . put ( baseDN , baseDN ) ; baseEntries . add ( baseEntryMap ) ; Map < String , List < Map < String , Object > > > configMap = Nester . nest ( configProps , BASE_ENTRY , LDAP_ENTITY_TYPE , GROUP_PROPERTIES ) ; // Add any additional base entries configured . for ( Map < String , Object > entry : configMap . get ( BASE_ENTRY ) ) { baseDN = ( String ) entry . get ( BASE_DN ) ; name = ( String ) entry . get ( BASE_ENTRY_NAME ) ; if ( baseDN == null || baseDN . trim ( ) . length ( ) == 0 ) { // TODO correct error ? Tr . error ( tc , WIMMessageKey . INVALID_BASE_ENTRY_DEFINITION , name ) ; } else { baseEntryMap = new HashMap < String , String > ( ) ; if ( name != null ) { baseEntryMap . put ( name , baseDN ) ; } else { baseEntryMap . put ( baseDN , baseDN ) ; } baseEntries . add ( baseEntryMap ) ; } } // Set the timestampFormat if ( configProps . containsKey ( ConfigConstants . TIMESTAMP_FORMAT ) ) timestampFormat = ( String ) configProps . get ( ConfigConstants . TIMESTAMP_FORMAT ) ; else timestampFormat = null ; setNodes ( baseEntries ) ; setLDAPEntities ( configMap . get ( LDAP_ENTITY_TYPE ) , baseEntries ) ; List < Map < String , Object > > groupPropList = configMap . get ( GROUP_PROPERTIES ) ; Map < String , Object > groupProps = groupPropList . isEmpty ( ) ? Collections . < String , Object > emptyMap ( ) : groupPropList . get ( 0 ) ; // TODO : : This seems to have been taken out . // setUpdateGroupMembership ( configProps , configAdmin ) ; setMemberAttributes ( groupProps ) ; setMembershipAttribute ( groupProps ) ; setDynaMemberAttributes ( groupProps ) ; setGroupSearchScope ( configProps ) ; setAttributes ( configProps ) ; setExtIdAttributes ( configProps ) ; // setRDNProperties ( configProps ) ; setConfidentialAttributes ( ) ; // setGroupMemberFilter ( ) ; setLoginProperties ( ( String ) configProps . get ( ConfigConstants . CONFIG_PROP_LOGIN_PROPERTIES ) ) ; setFilters ( configProps ) ; setGroupMemberFilter ( ) ; // TODO : : This is also deleted ? // iNeedTranslateRDN = reposConfig . getBoolean ( ConfigConstants . CONFIG _ PROP _ TRANSLATE _ RDN ) ; // CUSTOM PROPERTY useEncodingInSearchExpression = AccessControllerHelper . getSystemProperty ( ConfigConstants . CONFIG_CUSTOM_PROP_USE_ENCODING_IN_SEARCH_EXPRESSION ) ; if ( useEncodingInSearchExpression != null ) { try { "string to test encoding" . getBytes ( useEncodingInSearchExpression ) ; } catch ( UnsupportedEncodingException e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " java.io.UnsupportedEncodingException: " + e . getMessage ( ) ) ; useEncodingInSearchExpression = "ISO8859_1" ; // Default } } entityTypeProps . add ( "parent" ) ; entityTypeProps . add ( "children" ) ; entityTypeProps . add ( "members" ) ; if ( tc . isDebugEnabled ( ) ) { StringBuffer strBuf = new StringBuffer ( ) ; strBuf . append ( "\n\nLDAPServerType: " ) . append ( iLdapType ) . append ( "\n" ) ; strBuf . append ( "Nodes: " ) . append ( WIMTraceHelper . printObjectArray ( iNodes ) ) . append ( "\n" ) ; strBuf . append ( "ReposNodes: " ) . append ( WIMTraceHelper . printObjectArray ( iLdapNodes ) ) . append ( "\n" ) ; strBuf . append ( "TopReposNodes: " ) . append ( WIMTraceHelper . printObjectArray ( iTopLdapNodes ) ) . append ( "\n" ) ; strBuf . append ( "NeedSwitchNode: " ) . append ( iNeedSwitchNode ) . append ( "\n" ) ; strBuf . append ( "LDAPEntities: " ) . append ( "\n" ) ; for ( int i = 0 ; i < iLdapEntities . size ( ) ; i ++ ) { strBuf . append ( " " + iLdapEntities . get ( i ) . toString ( ) ) . append ( "\n" ) ; } strBuf . append ( "GroupMemberAttrs: " ) . append ( iMbrAttrMap ) . append ( "\n" ) ; strBuf . append ( " memberAttrs: " ) . append ( WIMTraceHelper . printObjectArray ( iMbrAttrs ) ) . append ( "\n" ) ; strBuf . append ( " scopes: " ) . append ( WIMTraceHelper . printPrimitiveArray ( iMbrAttrScope ) ) . append ( "\n" ) ; strBuf . append ( "GroupMemberFilter: " ) . append ( iGrpMbrFilter ) . append ( "\n" ) ; strBuf . append ( "GroupDynaMemberAttrs: " ) . append ( iDynaMbrAttrMap ) . append ( "\n" ) ; strBuf . append ( "DynaGroupFilter: " ) . append ( iDynaGrpFilter ) . append ( "\n" ) ; strBuf . append ( "GroupMembershipAttrs: " ) . append ( iMembershipAttrName ) . append ( "\n" ) ; strBuf . append ( " scope: " ) . append ( iMembershipAttrScope ) . append ( "\n" ) ; strBuf . append ( "PropToAttrMap: " ) . append ( iPropToAttrMap ) . append ( "\n" ) ; strBuf . append ( "AttrToPropMap: " ) . append ( iAttrToPropMap ) . append ( "\n" ) ; strBuf . append ( "ExtIds: " ) . append ( iExtIds ) . append ( "\n" ) ; strBuf . append ( "AllAttrs: " ) . append ( iAttrs ) . append ( "\n" ) ; strBuf . append ( "LoginAttrs: " ) . append ( iLoginAttrs ) . append ( "\n" ) ; strBuf . append ( "iUserFilter: " ) . append ( iUserFilter ) . append ( "\n" ) ; strBuf . append ( "iGroupFilter: " ) . append ( iGroupFilter ) . append ( "\n" ) ; strBuf . append ( "iUserIdMap: " ) . append ( iUserIdMap ) . append ( "\n" ) ; strBuf . append ( "iGroupIdMap: " ) . append ( iGroupIdMap ) . append ( "\n" ) ; strBuf . append ( "iGroupMemberIdMap: " ) . append ( iGroupMemberIdMap ) . append ( "\n" ) ; Tr . debug ( tc , METHODNAME + strBuf . toString ( ) ) ; }
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 * { @ link OrdinalEnum } . * @ throws IndexOutOfBoundsException if value type implements { @ link OrdinalEnum } , string argument is a valid number * but is not in the range accepted by target enumeration . */ @ SuppressWarnings ( "rawtypes" ) @ Override public < T > T asObject ( String string , Class < T > valueType ) throws IllegalArgumentException { } }
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 . SQLException if a SQL error occurs */ protected Connection createConnection ( ) throws SQLException { } }
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 PrivilegedExceptionAction < Connection > ( ) { public Connection run ( ) throws SQLException { return dataSource . getConnection ( ) ; } } ) ; } catch ( PrivilegedActionException pae ) { Exception e = pae . getException ( ) ; if ( e instanceof SQLException ) { throw ( SQLException ) e ; } else { throw ( RuntimeException ) e ; } } if ( cacheStatements || cacheConnection ) { useConnection = con ; } return con ; } return useConnection ;
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 if ( matchingDigram . p . isGuard ( ) && matchingDigram . n . n . isGuard ( ) ) { // reuse an existing rule rule = ( ( SAXGuard ) matchingDigram . p ) . r ; theDigram . substitute ( rule ) ; } else { // well , here we create a new rule because there are two matching digrams rule = new SAXRule ( ) ; try { // tie the digram ' s links together within the new rule // this uses copies of objects , so they do not get cut out of S first = ( SAXSymbol ) theDigram . clone ( ) ; second = ( SAXSymbol ) theDigram . n . clone ( ) ; rule . theGuard . n = first ; first . p = rule . theGuard ; first . n = second ; second . p = first ; second . n = rule . theGuard ; rule . theGuard . p = second ; // System . out . println ( " [ sequitur debug ] * newRule . . . * \ n " + rule . getRules ( ) ) ; // put this digram into the hash // this effectively erases the OLD MATCHING digram with the new DIGRAM ( symbol is wrapped // into Guard ) theDigrams . put ( first , first ) ; // substitute the matching ( old ) digram with this rule in S // System . out . println ( " [ sequitur debug ] * newRule . . . * substitute OLD digram first . " ) ; matchingDigram . substitute ( rule ) ; // substitute the new digram with this rule in S // System . out . println ( " [ sequitur debug ] * newRule . . . * substitute NEW digram last . " ) ; theDigram . substitute ( rule ) ; // rule . assignLevel ( ) ; // System . out . println ( " * * * Digrams now : " + makeDigramsTable ( ) ) ; } catch ( CloneNotSupportedException c ) { c . printStackTrace ( ) ; } } // Check for an underused rule . if ( rule . first ( ) . isNonTerminal ( ) && ( ( ( SAXNonTerminal ) rule . first ( ) ) . r . count == 1 ) ) ( ( SAXNonTerminal ) rule . first ( ) ) . expand ( ) ; rule . assignLevel ( ) ;
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 . getHealthCheckRegistry ( ) ) ; } }
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 containing indices of * the instances . * @ param left The begining index of the portion of the master * index array in which to find the kth - smallest element . * @ param right The end index of the portion of the master index * array in which to find the kth - smallest element . * @ param k The value of k * @ return The index of the kth - smallest element */ public int select ( int attIdx , int [ ] indices , int left , int right , int k ) { } }
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 criteria for the read * @ return An array of Objects , or an zero - length array if none was found */ public Object [ ] readObjects ( Class pObjClass , Hashtable pMapping , Hashtable pWhere ) throws SQLException { } }
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 of : NULL _ VALUE , INCONSISTENT _ DIMENSIONS , VALID see { @ link MessageValidity } */ public static MessageValidity validMessage ( NDArrayMessage message ) { } }
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 ( dateStr . endsWith ( ":00" ) ) { dateStr = dateStr . substring ( 0 , 16 ) ; } } catch ( Exception ex ) { throw new IllegalArgumentException ( "转换日期失败: " + ex . getMessage ( ) , ex ) ; } } return dateStr ;
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 others not */ private static Map < String , Object > getNamedParameters ( Method method , Object [ ] arguments ) { } }
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 ( an ) ) { JsonRpcParam jAnn = ( JsonRpcParam ) an ; namedParams . put ( jAnn . value ( ) , arguments [ i ] ) ; break ; } } } if ( arguments != null && arguments . length > 0 && namedParams . size ( ) > 0 && namedParams . size ( ) != arguments . length ) { throw new IllegalArgumentException ( "JsonRpcParam annotations were not found for all parameters on method " + method . getName ( ) ) ; } return namedParams ;
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 one of the following conditions is met : * < ul > * < li > The { @ code context } is { @ code null } or it does not contain the name of the script ; < / li > * < li > The { @ code key } is { @ code null } or its length is higher than the maximum allowed * ( { @ value # MAX _ KEY _ SIZE } ) ; < / li > * < li > The { @ code value } ' s length is higher than the maximum allowed ( { @ value # MAX _ VALUE _ SIZE } ) ; < / li > * < li > The number of script variables is higher than the maximum allowed ( { @ value # MAX _ SCRIPT _ VARS } ) ; < / li > * < / ul > */ public static void setScriptVar ( ScriptContext context , String key , String value ) { } }
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_BINDING ) ; protocolMarshaller . marshall ( listGroupResourcesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listGroupResourcesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 , final String name ) throws IllegalArgumentException { } }
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 returned might keep track of the changes ensuring that only the delta needs to be persisted on a * save . * @ return a new { @ link MongoSession } that is capable of being persisted by this { @ link ReactiveSessionRepository } */ @ Override public Mono < MongoSession > createSession ( ) { } }
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 introspection fails this method doesn ' t do * anything and doesn ' t any throw errors . * @ param obj an object to write property to . * @ param name a name of the property to set . * @ param value a new value for the property to set . */ public static void setProperty ( Object obj , String name , Object value ) { } }
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 be used to test the recommender . * @ return see * { @ link # runMahoutRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , org . apache . mahout . cf . taste . model . TemporalDataModelIF , org . apache . mahout . cf . taste . model . TemporalDataModelIF ) } * @ throws RecommenderException see null { @ link # runMahoutRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , * org . apache . mahout . cf . taste . model . DataModel , org . apache . mahout . cf . taste . model . DataModel ) } * @ throws TasteException see null { @ link # runMahoutRecommender ( net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS , * org . apache . mahout . cf . taste . model . DataModel , org . apache . mahout . cf . taste . model . DataModel ) } */ @ Override public TemporalDataModelIF < Long , Long > run ( final RUN_OPTIONS opts , final net . recommenders . rival . core . TemporalDataModelIF < Long , Long > trainingModel , final net . recommenders . rival . core . TemporalDataModelIF < Long , Long > testModel ) throws RecommenderException , TasteException { } }
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 , testModelMahout ) ;
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 made ; false if no opened { @ link Session } is active . */ boolean requestAlbums ( String id , Callback callback ) { } }
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_KEY , ALBUMS_LISTING_FIELDS_VALUE ) ; // Construct and execute albums listing request . Request request = new Request ( session , id + TO_ALBUMS_LISTING_GRAPH_PATH , params , HttpMethod . GET , callback ) ; request . executeAsync ( ) ; isSuccessful = true ; } return isSuccessful ;
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 - resources - contextkeys . html " * > Actions , Resources , and Condition Keys for AWS Services < / a > in the < i > IAM User Guide < / i > . Choose the name of the * service to view details for that service . In the first paragraph , find the service prefix . For example , * < code > ( service prefix : a4b ) < / code > . For more information about service namespaces , see < a * href = " https : / / docs . aws . amazon . com / general / latest / gr / aws - arns - and - namespaces . html # genref - aws - service - namespaces " * > AWS Service Namespaces < / a > in the < i > AWS General Reference < / i > . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setServiceNamespaces ( java . util . Collection ) } or { @ link # withServiceNamespaces ( java . util . Collection ) } if * you want to override the existing values . * @ param serviceNamespaces * The service namespace for the AWS services whose policies you want to list . < / p > * To learn the service namespace for a service , go to < a href = * " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / reference _ policies _ actions - resources - contextkeys . html " * > Actions , Resources , and Condition Keys for AWS Services < / a > in the < i > IAM User Guide < / i > . Choose the name * of the service to view details for that service . In the first paragraph , find the service prefix . For * example , < code > ( service prefix : a4b ) < / code > . For more information about service namespaces , see < a * href = " https : / / docs . aws . amazon . com / general / latest / gr / aws - arns - and - namespaces . html # genref - aws - service - namespaces " * > AWS Service Namespaces < / a > in the < i > AWS General Reference < / i > . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListPoliciesGrantingServiceAccessRequest withServiceNamespaces ( String ... serviceNamespaces ) { } }
if ( this . serviceNamespaces == null ) { setServiceNamespaces ( new com . amazonaws . internal . SdkInternalList < String > ( serviceNamespaces . length ) ) ; } for ( String ele : serviceNamespaces ) { this . serviceNamespaces . add ( ele ) ; } return this ;