signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DataExportUtility { /** * Process a single table .
* @ param pw output print writer
* @ param connection database connection
* @ param name table name
* @ throws Exception */
private void processTable ( PrintWriter pw , Connection connection , String name ) throws Exception { } } | System . out . println ( "Processing " + name ) ; // Prepare statement to retrieve all data
PreparedStatement ps = connection . prepareStatement ( "select * from " + name ) ; // Execute the query
ResultSet rs = ps . executeQuery ( ) ; // Retrieve column meta data
ResultSetMetaData rmd = ps . getMetaData ( ) ; int index ; int columnCount = rmd . getColumnCount ( ) ; String [ ] columnNames = new String [ columnCount ] ; int [ ] columnTypes = new int [ columnCount ] ; int [ ] columnPrecision = new int [ columnCount ] ; int [ ] columnScale = new int [ columnCount ] ; for ( index = 0 ; index < columnCount ; index ++ ) { columnNames [ index ] = rmd . getColumnName ( index + 1 ) ; columnTypes [ index ] = rmd . getColumnType ( index + 1 ) ; if ( columnTypes [ index ] == Types . NUMERIC ) { columnPrecision [ index ] = rmd . getPrecision ( index + 1 ) ; columnScale [ index ] = rmd . getScale ( index + 1 ) ; } } // Generate the output file
pw . println ( "<table name=\"" + name + "\">" ) ; StringBuilder buffer = new StringBuilder ( 255 ) ; DateFormat df = new SimpleDateFormat ( "dd/MM/yyyy hh:mm" , Locale . UK ) ; while ( rs . next ( ) == true ) { pw . println ( " <row>" ) ; for ( index = 0 ; index < columnCount ; index ++ ) { switch ( columnTypes [ index ] ) { case Types . BINARY : case Types . BLOB : case Types . LONGVARBINARY : case Types . VARBINARY : { pw . print ( " <column name=\"" + columnNames [ index ] + "\" type=\"" + columnTypes [ index ] + "\">" ) ; pw . println ( "[BINARY DATA]" ) ; pw . println ( "</column>" ) ; break ; } case Types . DATE : case Types . TIME : { Date data = rs . getDate ( index + 1 ) ; // if ( data ! = null )
{ pw . print ( " <column name=\"" + columnNames [ index ] + "\" type=\"" + columnTypes [ index ] + "\">" ) ; if ( data != null ) { pw . print ( df . format ( data ) ) ; } pw . println ( "</column>" ) ; } break ; } case Types . TIMESTAMP : { Timestamp data = rs . getTimestamp ( index + 1 ) ; // if ( data ! = null )
{ pw . print ( " <column name=\"" + columnNames [ index ] + "\" type=\"" + columnTypes [ index ] + "\">" ) ; if ( data != null ) { pw . print ( data . toString ( ) ) ; } pw . println ( "</column>" ) ; } break ; } case Types . NUMERIC : { // If we have a non - null value , map the value to a
// more specific type
String data = rs . getString ( index + 1 ) ; // if ( data ! = null )
{ int type = Types . NUMERIC ; int precision = columnPrecision [ index ] ; int scale = columnScale [ index ] ; if ( scale == 0 ) { if ( precision == 10 ) { type = Types . INTEGER ; } else { if ( precision == 5 ) { type = Types . SMALLINT ; } else { if ( precision == 1 ) { type = Types . BIT ; } } } } else { if ( precision > 125 ) { type = Types . DOUBLE ; } } pw . print ( " <column name=\"" + columnNames [ index ] + "\" type=\"" + type + "\">" ) ; if ( data != null ) { pw . print ( data ) ; } pw . println ( "</column>" ) ; } break ; } default : { String data = rs . getString ( index + 1 ) ; // if ( data ! = null )
{ pw . print ( " <column name=\"" + columnNames [ index ] + "\" type=\"" + columnTypes [ index ] + "\">" ) ; if ( data != null ) { pw . print ( escapeText ( buffer , data ) ) ; } pw . println ( "</column>" ) ; } break ; } } } pw . println ( " </row>" ) ; } pw . println ( "</table>" ) ; ps . close ( ) ; |
public class FSM { /** * Initiates a state transition with the named event .
* The call takes a variable number of arguments
* that will be passed to the callback , if defined .
* It if the state change is ok or one of these errors :
* - event X inappropriate because previous transition did not complete
* - event X inappropriate in current state Y
* - event X does not exist
* - internal error on state transition
* @ throws InTrasistionException
* @ throws InvalidEventException
* @ throws UnknownEventException
* @ throws NoTransitionException
* @ throws AsyncException
* @ throws CancelledException
* @ throws NotInTransitionException */
public void raiseEvent ( String eventName , Object ... args ) throws InTrasistionException , InvalidEventException , UnknownEventException , NoTransitionException , CancelledException , AsyncException , NotInTransitionException { } } | if ( transition != null ) throw new InTrasistionException ( eventName ) ; String dst = transitions . get ( new EventKey ( eventName , current ) ) ; if ( dst == null ) { for ( EventKey key : transitions . keySet ( ) ) { if ( key . event . equals ( eventName ) ) { throw new InvalidEventException ( eventName , current ) ; } } throw new UnknownEventException ( eventName ) ; } Event event = new Event ( this , eventName , current , dst , null , false , false , args ) ; callCallbacks ( event , CallbackType . BEFORE_EVENT ) ; if ( current . equals ( dst ) ) { callCallbacks ( event , CallbackType . AFTER_EVENT ) ; throw new NoTransitionException ( event . error ) ; } // Setup the transition , call it later .
transition = ( ) -> { current = dst ; try { callCallbacks ( event , CallbackType . ENTER_STATE ) ; callCallbacks ( event , CallbackType . AFTER_EVENT ) ; } catch ( Exception e ) { throw new InternalError ( e ) ; } } ; callCallbacks ( event , CallbackType . LEAVE_STATE ) ; // Perform the rest of the transition , if not asynchronous .
transition ( ) ; |
public class EditOnlineDataExample { /** * Finds properties of datatype string on test . wikidata . org . Since the test
* site changes all the time , we cannot hardcode a specific property here .
* Instead , we just look through all properties starting from P1 to find the
* first few properties of type string that have an English label . These
* properties are used for testing in this code .
* @ param connection
* @ throws MediaWikiApiErrorException
* @ throws IOException */
public static void findSomeStringProperties ( ApiConnection connection ) throws MediaWikiApiErrorException , IOException { } } | WikibaseDataFetcher wbdf = new WikibaseDataFetcher ( connection , siteIri ) ; wbdf . getFilter ( ) . excludeAllProperties ( ) ; wbdf . getFilter ( ) . setLanguageFilter ( Collections . singleton ( "en" ) ) ; ArrayList < PropertyIdValue > stringProperties = new ArrayList < > ( ) ; System . out . println ( "*** Trying to find string properties for the example ... " ) ; int propertyNumber = 1 ; while ( stringProperties . size ( ) < 5 ) { ArrayList < String > fetchProperties = new ArrayList < > ( ) ; for ( int i = propertyNumber ; i < propertyNumber + 10 ; i ++ ) { fetchProperties . add ( "P" + i ) ; } propertyNumber += 10 ; Map < String , EntityDocument > results = wbdf . getEntityDocuments ( fetchProperties ) ; for ( EntityDocument ed : results . values ( ) ) { PropertyDocument pd = ( PropertyDocument ) ed ; if ( DatatypeIdValue . DT_STRING . equals ( pd . getDatatype ( ) . getIri ( ) ) && pd . getLabels ( ) . containsKey ( "en" ) ) { stringProperties . add ( pd . getEntityId ( ) ) ; System . out . println ( "* Found string property " + pd . getEntityId ( ) . getId ( ) + " (" + pd . getLabels ( ) . get ( "en" ) + ")" ) ; } } } stringProperty1 = stringProperties . get ( 0 ) ; stringProperty2 = stringProperties . get ( 1 ) ; stringProperty3 = stringProperties . get ( 2 ) ; stringProperty4 = stringProperties . get ( 3 ) ; stringProperty5 = stringProperties . get ( 4 ) ; System . out . println ( "*** Done." ) ; |
public class A_CmsTreeTabDataPreloader { /** * Loads the ancestors of a resource . < p >
* @ param resource the resource for which to load the ancestors
* @ throws CmsException if something goes wrong */
private void loadAncestors ( CmsResource resource ) throws CmsException { } } | CmsResource currentResource = resource ; while ( ( currentResource != null ) && m_cms . existsResource ( currentResource . getStructureId ( ) , m_filter ) ) { if ( ! m_knownResources . add ( currentResource ) ) { break ; } if ( CmsStringUtil . comparePaths ( currentResource . getRootPath ( ) , m_commonRoot ) ) { break ; } CmsResource parent = m_cms . readParentFolder ( currentResource . getStructureId ( ) ) ; if ( parent != null ) { m_mustLoadChildren . add ( parent ) ; } currentResource = parent ; } |
public class KeyTransformationHandler { /** * Retrieves a { @ link org . infinispan . query . Transformer } instance for this key . If the key is not { @ link
* org . infinispan . query . Transformable } and no transformer has been registered for the key ' s class , null is returned .
* @ param keyClass key class to analyze
* @ return a Transformer for this key , or null if the key type is not properly annotated . */
private Transformer getTransformer ( Class < ? > keyClass ) { } } | Class < ? extends Transformer > transformerClass = getTransformerClass ( keyClass ) ; if ( transformerClass != null ) { try { return transformerClass . newInstance ( ) ; } catch ( Exception e ) { log . couldNotInstantiaterTransformerClass ( transformerClass , e ) ; } } return null ; |
public class StringUtil { /** * Generate a simple ( cryptographic insecure ) random string .
* @ param _ length length of random string
* @ return random string or empty string if _ length & lt ; = 0 */
public static String randomString ( int _length ) { } } | if ( _length <= 0 ) { return "" ; } Random random = new Random ( ) ; char [ ] buf = new char [ _length ] ; for ( int idx = 0 ; idx < buf . length ; ++ idx ) buf [ idx ] = SYMBOLS [ random . nextInt ( SYMBOLS . length ) ] ; return new String ( buf ) ; |
public class PathResolver { /** * todo : path criteria need to check if separator is in the path */
private static PathCriteria parsePath ( File path ) { } } | int starIndex = path . toString ( ) . indexOf ( STAR ) ; int wildcardIndex = path . toString ( ) . indexOf ( WILDCARD ) ; int index = ( starIndex < wildcardIndex || wildcardIndex < 0 ) ? starIndex : wildcardIndex ; if ( index == 0 && path . toString ( ) . length ( ) == 1 ) return new PathCriteria ( String . valueOf ( SEPARATOR ) , "" , path . toString ( ) ) ; else { int parentSeparatorIndex = index - 1 ; while ( path . toString ( ) . charAt ( parentSeparatorIndex ) != SEPARATOR && parentSeparatorIndex > - 1 ) parentSeparatorIndex -- ; int childSeparatorIndex = index + 1 ; if ( childSeparatorIndex < path . toString ( ) . length ( ) ) while ( path . toString ( ) . charAt ( childSeparatorIndex ) != SEPARATOR && parentSeparatorIndex < path . toString ( ) . length ( ) ) childSeparatorIndex ++ ; String parentPath = path . toString ( ) . substring ( 0 , parentSeparatorIndex ) ; String criteria = path . toString ( ) . substring ( parentSeparatorIndex + 1 , childSeparatorIndex ) ; String childPath = path . toString ( ) . substring ( childSeparatorIndex , path . toString ( ) . length ( ) ) ; return new PathCriteria ( parentPath , childPath , criteria ) ; } |
public class RedisClusterNode { /** * Create a new instance of { @ link RedisClusterNode } by passing the { @ code nodeId }
* @ param nodeId the nodeId
* @ return a new instance of { @ link RedisClusterNode } */
public static RedisClusterNode of ( String nodeId ) { } } | LettuceAssert . notNull ( nodeId , "NodeId must not be null" ) ; RedisClusterNode redisClusterNode = new RedisClusterNode ( ) ; redisClusterNode . setNodeId ( nodeId ) ; return redisClusterNode ; |
public class ReleatePositionDrawTextItem { /** * / * ( non - Javadoc )
* @ see com . alibaba . simpleimage . render . DrawTextItem # drawText ( java . awt . Graphics2D , int , int ) */
@ Override public void drawText ( Graphics2D graphics , int width , int height ) { } } | int textLength = ( int ) ( width * textWidthPercent ) ; // 计算水印字体大小
int fontsize = textLength / text . length ( ) ; if ( fontsize < minFontSize ) { return ; } graphics . setFont ( new Font ( defaultFont . getFontName ( ) , Font . PLAIN , fontsize ) ) ; graphics . setColor ( fontColor ) ; graphics . drawString ( text , ( int ) ( width * xFactor ) , ( int ) ( height * yFactor ) ) ; |
public class AhoCorasickDoubleArrayTrie { /** * 匹配母文本
* @ param text 一些文本
* @ return 一个pair列表 */
public List < Hit < V > > parseText ( String text ) { } } | int position = 1 ; int currentState = 0 ; List < Hit < V > > collectedEmits = new LinkedList < Hit < V > > ( ) ; for ( int i = 0 ; i < text . length ( ) ; ++ i ) { currentState = getState ( currentState , text . charAt ( i ) ) ; storeEmits ( position , currentState , collectedEmits ) ; ++ position ; } return collectedEmits ; |
public class LogManager { /** * Shutdown the logging system if the logging system supports it .
* This call is synchronous and will block until shut down is complete .
* This may include flushing pending log events over network connections .
* @ param context the LoggerContext .
* @ since 2.6 */
public static void shutdown ( final LoggerContext context ) { } } | if ( context != null && context instanceof Terminable ) { ( ( Terminable ) context ) . terminate ( ) ; } |
public class Iterables { /** * Gets the length of an iterable .
* @ param iterable the iterable
* @ return the length of the iterable */
@ SuppressWarnings ( "unchecked" ) public static int getLength ( Object iterable ) { } } | Assert . state ( isIterable ( iterable . getClass ( ) ) ) ; return iterable . getClass ( ) . isArray ( ) ? Array . getLength ( iterable ) : ( ( Collection < Object > ) iterable ) . size ( ) ; |
public class RouteClient { /** * Deletes the specified Route resource .
* < p > Sample code :
* < pre > < code >
* try ( RouteClient routeClient = RouteClient . create ( ) ) {
* ProjectGlobalRouteName route = ProjectGlobalRouteName . of ( " [ PROJECT ] " , " [ ROUTE ] " ) ;
* Operation response = routeClient . deleteRoute ( route ) ;
* < / code > < / pre >
* @ param route Name of the Route resource to delete .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation deleteRoute ( ProjectGlobalRouteName route ) { } } | DeleteRouteHttpRequest request = DeleteRouteHttpRequest . newBuilder ( ) . setRoute ( route == null ? null : route . toString ( ) ) . build ( ) ; return deleteRoute ( request ) ; |
public class AWSSimpleSystemsManagementClient { /** * Lists the commands requested by users of the AWS account .
* @ param listCommandsRequest
* @ return Result of the ListCommands operation returned by the service .
* @ throws InternalServerErrorException
* An error occurred on the server side .
* @ throws InvalidCommandIdException
* @ throws InvalidInstanceIdException
* The following problems can cause this exception : < / p >
* You do not have permission to access the instance .
* SSM Agent is not running . On managed instances and Linux instances , verify that the SSM Agent is running .
* On EC2 Windows instances , verify that the EC2Config service is running .
* SSM Agent or EC2Config service is not registered to the SSM endpoint . Try reinstalling SSM Agent or
* EC2Config service .
* The instance is not in valid state . Valid states are : Running , Pending , Stopped , Stopping . Invalid states
* are : Shutting - down and Terminated .
* @ throws InvalidFilterKeyException
* The specified key is not valid .
* @ throws InvalidNextTokenException
* The specified token is not valid .
* @ sample AWSSimpleSystemsManagement . ListCommands
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / ListCommands " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public ListCommandsResult listCommands ( ListCommandsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListCommands ( request ) ; |
public class MyActivity { /** * Color transition method . */
public Object evaluate ( float fraction , Object startValue , Object endValue ) { } } | int startInt = ( Integer ) startValue ; int startA = ( startInt >> 24 ) & 0xff ; int startR = ( startInt >> 16 ) & 0xff ; int startG = ( startInt >> 8 ) & 0xff ; int startB = startInt & 0xff ; int endInt = ( Integer ) endValue ; int endA = ( endInt >> 24 ) & 0xff ; int endR = ( endInt >> 16 ) & 0xff ; int endG = ( endInt >> 8 ) & 0xff ; int endB = endInt & 0xff ; return ( int ) ( ( startA + ( int ) ( fraction * ( endA - startA ) ) ) << 24 ) | ( int ) ( ( startR + ( int ) ( fraction * ( endR - startR ) ) ) << 16 ) | ( int ) ( ( startG + ( int ) ( fraction * ( endG - startG ) ) ) << 8 ) | ( int ) ( ( startB + ( int ) ( fraction * ( endB - startB ) ) ) ) ; |
public class XesXmlParser { /** * Parses a log from the given input stream , which is supposed to deliver an
* XES log in XML representation .
* @ param is
* Input stream , which is supposed to deliver an XES log in XML
* representation .
* @ return The parsed log . */
public List < XLog > parse ( InputStream is ) throws Exception { } } | BufferedInputStream bis = new BufferedInputStream ( is ) ; // set up a specialized SAX2 handler to fill the container
XesXmlHandler handler = new XesXmlHandler ( ) ; // set up SAX parser and parse provided log file into the container
SAXParserFactory parserFactory = SAXParserFactory . newInstance ( ) ; parserFactory . setNamespaceAware ( false ) ; SAXParser parser = parserFactory . newSAXParser ( ) ; parser . parse ( bis , handler ) ; bis . close ( ) ; ArrayList < XLog > wrapper = new ArrayList < XLog > ( ) ; wrapper . add ( handler . getLog ( ) ) ; return wrapper ; |
public class VirtualFile { /** * Get the { @ link CodeSigner } s for a the virtual file .
* @ return the { @ link CodeSigner } s for the virtual file , or { @ code null } if not signed */
public CodeSigner [ ] getCodeSigners ( ) { } } | final SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { sm . checkPermission ( new VirtualFilePermission ( getPathName ( ) , "read" ) ) ; } final VFS . Mount mount = VFS . getMount ( this ) ; return mount . getFileSystem ( ) . getCodeSigners ( mount . getMountPoint ( ) , this ) ; |
public class PropMaxDegVarTree { @ Override public void propagate ( int evtmask ) throws ContradictionException { } } | for ( int i = 0 ; i < n ; i ++ ) { dMax [ i ] = deg [ i ] . getUB ( ) ; } super . propagate ( evtmask ) ; |
public class AbstractResultSetWrapper { /** * { @ inheritDoc }
* @ see java . sql . ResultSet # updateFloat ( java . lang . String , float ) */
@ Override public void updateFloat ( final String columnLabel , final float x ) throws SQLException { } } | wrapped . updateFloat ( columnLabel , x ) ; |
public class SystemInputs { /** * Returns the IConditional instances defined by the given variable definition . */
private static Stream < IConditional > conditionals ( IVarDef var ) { } } | return Stream . concat ( Stream . of ( var ) , Stream . concat ( Optional . ofNullable ( var . getMembers ( ) ) . map ( members -> toStream ( members ) . flatMap ( member -> conditionals ( member ) ) ) . orElse ( Stream . empty ( ) ) , Optional . ofNullable ( var . getValues ( ) ) . map ( values -> toStream ( values ) . map ( value -> new VarBindingDef ( ( VarDef ) var , value ) ) ) . orElse ( Stream . empty ( ) ) ) ) ; |
public class InodeLockList { /** * Downgrades the last edge lock in the lock list from WRITE lock to READ lock . */
public void downgradeLastEdge ( ) { } } | Preconditions . checkNotNull ( ! endsInInode ( ) ) ; Preconditions . checkState ( ! mEntries . isEmpty ( ) ) ; Preconditions . checkState ( mLockMode == LockMode . WRITE ) ; downgradeEdge ( mEntries . size ( ) - 1 ) ; mLockMode = LockMode . READ ; |
public class EndpointService { /** * Discovers all resources , puts them in the { @ link # resourceManager } ,
* and triggers any listeners listening for new inventory .
* This will look for all root resources ( resources whose types are that of the root resource types
* as defined by { @ link ResourceTypeManager # getRootResourceTypes ( ) } and then obtain all their
* children ( recursively down to all descendents ) . Effectively , this discovers the full
* resource hierarchy .
* This method does not block - it runs the discovery in another thread . */
public void discoverAll ( ) { } } | status . assertRunning ( getClass ( ) , "discoverAll()" ) ; Runnable runnable = new Runnable ( ) { @ Override public void run ( ) { WriteLock lock = EndpointService . this . discoveryScanRWLock . writeLock ( ) ; lock . lock ( ) ; try { DiscoveryResults discoveryResults = new DiscoveryResults ( ) ; LOG . infoDiscoveryRequested ( getMonitoredEndpoint ( ) ) ; long duration = - 1 ; try ( S session = openSession ( ) ) { Set < ResourceType < L > > rootTypes = getResourceTypeManager ( ) . getRootResourceTypes ( ) ; Context timer = getDiagnostics ( ) . getFullDiscoveryScanTimer ( ) . time ( ) ; for ( ResourceType < L > rootType : rootTypes ) { discoverChildren ( null , rootType , session , discoveryResults ) ; } long nanos = timer . stop ( ) ; duration = TimeUnit . MILLISECONDS . convert ( nanos , TimeUnit . NANOSECONDS ) ; } catch ( Exception e ) { LOG . errorCouldNotAccess ( EndpointService . this , e ) ; discoveryResults . error ( e ) ; } getResourceManager ( ) . logTreeGraph ( "Discovered all resources for: " + getMonitoredEndpoint ( ) , duration ) ; discoveryResults . discoveryFinished ( ) ; } finally { lock . unlock ( ) ; } } } ; try { this . fullDiscoveryScanThreadPool . execute ( runnable ) ; } catch ( RejectedExecutionException ree ) { LOG . debugf ( "Redundant full discovery scan will be ignored for endpoint [%s]" , getMonitoredEndpoint ( ) ) ; } |
public class DataNode { /** * Instantiate a single datanode object . This must be run by invoking
* { @ link DataNode # runDatanodeDaemon ( DataNode ) } subsequently . */
public static DataNode instantiateDataNode ( String args [ ] , Configuration conf ) throws IOException { } } | if ( conf == null ) conf = new Configuration ( ) ; if ( ! parseArguments ( args , conf ) ) { printUsage ( ) ; return null ; } if ( conf . get ( "dfs.network.script" ) != null ) { LOG . error ( "This configuration for rack identification is not supported" + " anymore. RackID resolution is handled by the NameNode." ) ; System . exit ( - 1 ) ; } String [ ] dataDirs = getListOfDataDirs ( conf ) ; dnThreadName = "DataNode: [" + StringUtils . arrayToString ( dataDirs ) + "]" ; return makeInstance ( dataDirs , conf ) ; |
public class AbstractInjectionEngine { /** * F50309.4 */
InjectionTarget [ ] getInjectionTargets ( Map < Class < ? > , List < InjectionTarget > > declaredTargets , Class < ? > instanceClass , boolean checkAppConfig ) throws InjectionException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInjectionTargets: " + instanceClass + "/" + AccessController . doPrivileged ( new GetClassLoaderPrivileged ( instanceClass ) ) ) ; // d622258.1 - A field or method should only be injected once . If
// multiple annotations ( or injection - target ) are applied to the same
// member , then we will instantiate multiple objects and call setters
// multiple times . The last injection will " win " , but the order is
// undefined . To warn the user , we maintain a map of members to targets .
Map < Member , InjectionTarget > injectionTargets = null ; // Lazily initialized set of non - private , non - overridden methods in the
// class hierarchy . d719917
Set < Method > nonPrivateMethods = null ; // Create a list of classes in the hierarchy from Object to superclass
// to instanceClass . This ensures that we inject into superclass methods
// before subclass methods . d719917
List < Class < ? > > classHierarchy = new ArrayList < Class < ? > > ( ) ; for ( Class < ? > superclass = instanceClass ; superclass != null && superclass != Object . class ; // d721081
superclass = superclass . getSuperclass ( ) ) { classHierarchy . add ( superclass ) ; } Collections . reverse ( classHierarchy ) ; // Fields must be injected before methods , so we make two passes over
// the injection targets : first fields , then methods .
for ( int memberRound = 0 ; memberRound < 2 ; memberRound ++ ) { boolean wantFields = memberRound == 0 ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , wantFields ? "collecting fields" : "collecting methods" ) ; for ( Class < ? > superclass : classHierarchy ) { List < InjectionTarget > classTargets = declaredTargets . get ( superclass ) ; if ( classTargets == null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "no members for " + superclass + "/" + AccessController . doPrivileged ( new GetClassLoaderPrivileged ( superclass ) ) ) ; continue ; } for ( InjectionTarget injectionTarget : classTargets ) { Member member = injectionTarget . getMember ( ) ; boolean isField = member instanceof Field ; if ( wantFields != isField ) { continue ; } // Only consider fields and non - overridden methods . Private
// methods and methods on the class itself are trivially not
// overridden . d719917
if ( ! isField && ! Modifier . isPrivate ( member . getModifiers ( ) ) && member . getDeclaringClass ( ) != instanceClass ) { if ( nonPrivateMethods == null ) { // Compute the set of " overriding " non - private methods in
// the hierarchy .
nonPrivateMethods = new HashSet < Method > ( ) ; for ( MethodMap . MethodInfo methodInfo : MethodMap . getAllNonPrivateMethods ( instanceClass ) ) { nonPrivateMethods . add ( methodInfo . getMethod ( ) ) ; } } if ( ! nonPrivateMethods . contains ( member ) ) { // The method was overridden .
if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "skipping overridden " + member + " for " + Util . identity ( injectionTarget . getInjectionBinding ( ) ) + '[' + injectionTarget . getInjectionBinding ( ) . getDisplayName ( ) + ']' ) ; continue ; } } if ( injectionTargets == null ) { injectionTargets = new LinkedHashMap < Member , InjectionTarget > ( ) ; } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "adding " + member + " for " + Util . identity ( injectionTarget . getInjectionBinding ( ) ) + '[' + injectionTarget . getInjectionBinding ( ) . getDisplayName ( ) + ']' ) ; InjectionTarget previousTarget = injectionTargets . put ( member , injectionTarget ) ; if ( previousTarget != null ) { String memberName = member . getDeclaringClass ( ) . getName ( ) + "." + member . getName ( ) ; Tr . warning ( tc , "DUPLICATE_INJECTION_TARGETS_SPECIFIED_CWNEN0040W" , memberName ) ; // d447011
if ( isValidationFailable ( checkAppConfig ) ) // F50309.6
{ memberName += isField ? " field" : " method" ; String curRefName = injectionTarget . getInjectionBinding ( ) . getDisplayName ( ) ; String preRefName = previousTarget . getInjectionBinding ( ) . getDisplayName ( ) ; throw new InjectionConfigurationException ( "The " + memberName + " was configured to be injected multiple times." + " The same injection target is associated with both the " + curRefName + " and " + preRefName + " references. The object injected is undefined." ) ; } } } } } InjectionTarget [ ] result ; if ( injectionTargets == null ) { result = EMPTY_INJECTION_TARGETS ; } else { result = new InjectionTarget [ injectionTargets . size ( ) ] ; injectionTargets . values ( ) . toArray ( result ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInjectionTargets: " + result . length ) ; return result ; |
public class Translation { /** * Translates Acid House { @ code AppEngineTransaction } entity to Google App
* Engine Datastore entities with the specified { @ code Key } of parent .
* @ param transaction Acid House { @ code Lock } entity .
* @ param parent The { @ code Key } of parent .
* @ return Google App Engine Datastore entities translated from Acid House
* { @ code AppEngineTransaction } entity . */
public static List < Entity > toEntities ( AppEngineTransaction transaction , com . google . appengine . api . datastore . Key parent ) { } } | List < Entity > entities = new ArrayList < Entity > ( ) ; com . google . appengine . api . datastore . Key key = Keys . create ( parent , TRANSACTION_KIND , transaction . id ( ) ) ; entities . add ( new Entity ( key ) ) ; for ( Log log : transaction . logs ( ) ) { Entity entity = new Entity ( Keys . create ( key , LOG_KIND , log . sequence ( ) ) ) ; entity . setUnindexedProperty ( OPERATION_PROPERTY , log . operation ( ) . name ( ) ) ; entity . setUnindexedProperty ( CLASS_PROPERTY , log . entity ( ) . getClass ( ) . getName ( ) ) ; List < Blob > blobs = new ArrayList < Blob > ( ) ; entity . setUnindexedProperty ( PROTO_PROPERTY , blobs ) ; entities . add ( entity ) ; for ( Entity e : toEntities ( log . entity ( ) ) ) { EntityProto proto = EntityTranslator . convertToPb ( e ) ; byte [ ] bytes = proto . toByteArray ( ) ; blobs . add ( new Blob ( bytes ) ) ; } } return entities ; |
public class ApnsPayloadBuilder { /** * Returns a JSON representation of a
* < a href = " https : / / developer . apple . com / library / content / documentation / Miscellaneous / Reference / MobileDeviceManagementProtocolRef / 1 - Introduction / Introduction . html # / / apple _ ref / doc / uid / TP40017387 - CH1 - SW1 " > Mobile
* Device Management < / a > " wake up " payload .
* @ param pushMagicValue the " push magic " string that the device sends to the MDM server in a { @ code TokenUpdate }
* message
* @ return a JSON representation of an MDM " wake up " notification payload
* @ see < a href = " https : / / developer . apple . com / library / content / documentation / Miscellaneous / Reference / MobileDeviceManagementProtocolRef / 3 - MDM _ Protocol / MDM _ Protocol . html # / / apple _ ref / doc / uid / TP40017387 - CH3 - SW2 " > Mobile
* Device Management ( MDM ) Protocol < / a >
* @ since 0.12 */
public static String buildMdmPayload ( final String pushMagicValue ) { } } | return GSON . toJson ( java . util . Collections . singletonMap ( MDM_KEY , pushMagicValue ) ) ; |
public class DeviceImpl { /** * read an attribute history . IDL 4 version . The history is filled only be
* attribute polling
* @ param attributeName The attribute to retrieve
* @ param maxSize The history maximum size returned
* @ throws DevFailed */
@ Override public DevAttrHistory_4 read_attribute_history_4 ( final String attributeName , final int maxSize ) throws DevFailed { } } | MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; checkInitialization ( ) ; deviceMonitoring . startRequest ( "read_attribute_history_4" ) ; DevAttrHistory_4 result = null ; try { final AttributeImpl attr = AttributeGetterSetter . getAttribute ( attributeName , attributeList ) ; if ( ! attr . isPolled ( ) ) { throw DevFailedUtils . newDevFailed ( ExceptionMessages . ATTR_NOT_POLLED , attr . getName ( ) + " is not polled" ) ; } result = attr . getHistory ( ) . getAttrHistory4 ( maxSize ) ; } catch ( final Exception e ) { deviceMonitoring . addError ( ) ; if ( e instanceof DevFailed ) { throw ( DevFailed ) e ; } else { // with CORBA , the stack trace is not visible by the client if
// not inserted in DevFailed .
throw DevFailedUtils . newDevFailed ( e ) ; } } return result ; |
public class WebSocketScope { /** * Message received from client and passed on to the listeners .
* @ param message */
public void onMessage ( WSMessage message ) { } } | log . trace ( "Listeners: {}" , listeners . size ( ) ) ; for ( IWebSocketDataListener listener : listeners ) { try { listener . onWSMessage ( message ) ; } catch ( Exception e ) { log . warn ( "onMessage exception" , e ) ; } } |
public class CmsSitemapController { /** * Checks if the given path and position indicate a changed position for the entry . < p >
* @ param entry the sitemap entry to move
* @ param toPath the destination path
* @ param position the new position between its siblings
* @ return < code > true < / code > if this is a position change */
private boolean isChangedPosition ( CmsClientSitemapEntry entry , String toPath , int position ) { } } | return ( ! entry . getSitePath ( ) . equals ( toPath ) || ( entry . getPosition ( ) != position ) ) ; |
public class NlsBundleFactoryGenerator { /** * Generates the block that creates the { @ link NlsBundle } instance lazily via { @ link GWT # create ( Class ) } .
* @ param sourceWriter is the { @ link SourceWriter } .
* @ param logger is the { @ link TreeLogger } .
* @ param context is the { @ link GeneratorContext } . */
protected void generateBlockBundleCreation ( SourceWriter sourceWriter , TreeLogger logger , GeneratorContext context ) { } } | // find all subclasses of NlsBundle
TypeOracle typeOracle = context . getTypeOracle ( ) ; JClassType bundleClass = typeOracle . findType ( NlsBundle . class . getName ( ) ) ; JClassType bundleWithLookupClass = typeOracle . findType ( NlsBundleWithLookup . class . getName ( ) ) ; JClassType [ ] types = typeOracle . getTypes ( ) ; int bundleCount = 0 ; logger . log ( Type . INFO , "Checking " + types . length + " types..." ) ; for ( JClassType type : types ) { if ( ( type . isAssignableTo ( bundleClass ) ) && ( ! type . equals ( bundleClass ) && ( ! type . equals ( bundleWithLookupClass ) ) ) ) { logger . log ( Type . INFO , "Found NlsBundle interface: " + type ) ; sourceWriter . print ( "if (" ) ; sourceWriter . print ( type . getQualifiedSourceName ( ) ) ; sourceWriter . println ( ".class == bundleInterface) {" ) ; sourceWriter . indent ( ) ; sourceWriter . print ( "bundle = GWT.create(" ) ; sourceWriter . print ( type . getQualifiedSourceName ( ) ) ; sourceWriter . println ( ".class);" ) ; sourceWriter . println ( "register(bundleInterface, bundle);" ) ; sourceWriter . outdent ( ) ; sourceWriter . print ( "} else " ) ; bundleCount ++ ; } } sourceWriter . println ( "{" ) ; sourceWriter . indent ( ) ; sourceWriter . print ( "throw new " ) ; sourceWriter . print ( IllegalStateException . class . getSimpleName ( ) ) ; sourceWriter . println ( "(\"Undefined NlsBundle \" + bundleInterface.getName());" ) ; sourceWriter . outdent ( ) ; sourceWriter . println ( "}" ) ; logger . log ( Type . INFO , "Found " + bundleCount + " NlsBundle interface(s)." ) ; |
public class GroupService { /** * Update group
* @ param groupRef group reference
* @ param groupConfig group config
* @ return OperationFuture wrapper for Group */
public OperationFuture < Group > modify ( Group groupRef , GroupConfig groupConfig ) { } } | checkNotNull ( groupConfig , "GroupConfig must be not null" ) ; checkNotNull ( groupRef , "Group reference must be not null" ) ; updateGroup ( idByRef ( groupRef ) , groupConfig ) ; return new OperationFuture < > ( groupRef , new NoWaitingJobFuture ( ) ) ; |
public class Graph { /** * Runs a { @ link VertexCentricIteration } on the graph .
* No configuration options are provided .
* @ param computeFunction the vertex compute function
* @ param combiner an optional message combiner
* @ param maximumNumberOfIterations maximum number of iterations to perform
* @ return the updated Graph after the vertex - centric iteration has converged or
* after maximumNumberOfIterations . */
public < M > Graph < K , VV , EV > runVertexCentricIteration ( ComputeFunction < K , VV , EV , M > computeFunction , MessageCombiner < K , M > combiner , int maximumNumberOfIterations ) { } } | return this . runVertexCentricIteration ( computeFunction , combiner , maximumNumberOfIterations , null ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcFaceBasedSurfaceModel ( ) { } } | if ( ifcFaceBasedSurfaceModelEClass == null ) { ifcFaceBasedSurfaceModelEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 254 ) ; } return ifcFaceBasedSurfaceModelEClass ; |
public class AppDefinedResourceFactory { /** * Destroy this application - defined resource by removing its configuration
* and the configuration of all other services that were created for it .
* @ throws Exception if an error occurs . */
@ Override public void destroy ( ) throws Exception { } } | final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "destroy" , id ) ; tracker . close ( ) ; StringBuilder filter = new StringBuilder ( FilterUtils . createPropertyFilter ( AbstractConnectionFactoryService . ID , id ) ) ; filter . insert ( filter . length ( ) - 1 , '*' ) ; builder . removeExistingConfigurations ( filter . toString ( ) ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "destroy" ) ; |
public class AbstractSingleton { /** * Get all singleton objects registered in the respective sub - class of this
* class .
* @ param < T >
* The singleton type to be retrieved
* @ param aScope
* The scope to use . May be < code > null < / code > to avoid creating a new
* scope .
* @ param aDesiredClass
* The desired sub - class of this class . May not be < code > null < / code > .
* @ return A non - < code > null < / code > list with all instances of the passed class
* in the passed scope . */
@ Nonnull @ ReturnsMutableCopy public static final < T extends AbstractSingleton > ICommonsList < T > getAllSingletons ( @ Nullable final IScope aScope , @ Nonnull final Class < T > aDesiredClass ) { } } | ValueEnforcer . notNull ( aDesiredClass , "DesiredClass" ) ; final ICommonsList < T > ret = new CommonsArrayList < > ( ) ; if ( aScope != null ) for ( final Object aScopeValue : aScope . attrs ( ) . values ( ) ) if ( aScopeValue != null && aDesiredClass . isAssignableFrom ( aScopeValue . getClass ( ) ) ) ret . add ( aDesiredClass . cast ( aScopeValue ) ) ; return ret ; |
public class CollectionContainer { /** * TX methods */
public Long reserveAdd ( String transactionId , Data value ) { } } | if ( value != null && getCollection ( ) . contains ( new CollectionItem ( INVALID_ITEM_ID , value ) ) ) { return null ; } final long itemId = nextId ( ) ; txMap . put ( itemId , new TxCollectionItem ( itemId , null , transactionId , false ) ) ; return itemId ; |
public class DisasterRecoveryConfigurationsInner { /** * Gets a disaster recovery configuration .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param disasterRecoveryConfigurationName The name of the disaster recovery configuration .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the DisasterRecoveryConfigurationInner object */
public Observable < DisasterRecoveryConfigurationInner > getAsync ( String resourceGroupName , String serverName , String disasterRecoveryConfigurationName ) { } } | return getWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . map ( new Func1 < ServiceResponse < DisasterRecoveryConfigurationInner > , DisasterRecoveryConfigurationInner > ( ) { @ Override public DisasterRecoveryConfigurationInner call ( ServiceResponse < DisasterRecoveryConfigurationInner > response ) { return response . body ( ) ; } } ) ; |
public class XMLEventParser { /** * call a user defined function
* @ param udf
* @ param arguments */
private void call ( UDF udf , Object [ ] arguments ) { } } | try { udf . call ( pc , arguments , false ) ; } catch ( PageException pe ) { error ( pe ) ; } |
public class LocalDateTime { /** * Compares this partial with another returning an integer
* indicating the order .
* The fields are compared in order , from largest to smallest .
* The first field that is non - equal is used to determine the result .
* The specified object must be a partial instance whose field types
* match those of this partial .
* @ param partial an object to check against
* @ return negative if this is less , zero if equal , positive if greater
* @ throws ClassCastException if the partial is the wrong class
* or if it has field types that don ' t match
* @ throws NullPointerException if the partial is null */
public int compareTo ( ReadablePartial partial ) { } } | // override to perform faster
if ( this == partial ) { return 0 ; } if ( partial instanceof LocalDateTime ) { LocalDateTime other = ( LocalDateTime ) partial ; if ( iChronology . equals ( other . iChronology ) ) { return ( iLocalMillis < other . iLocalMillis ? - 1 : ( iLocalMillis == other . iLocalMillis ? 0 : 1 ) ) ; } } return super . compareTo ( partial ) ; |
public class SecurityContext { /** * - - - - - private methods - - - - - */
private boolean isVisibleInBackend ( AccessControllable node ) { } } | if ( isVisibleInFrontend ( node ) ) { return true ; } // no node , nothing to see here . .
if ( node == null ) { return false ; } // fetch user
final Principal user = getUser ( false ) ; // anonymous users may not see any nodes in backend
if ( user == null ) { return false ; } // SuperUser may always see the node
if ( user instanceof SuperUser ) { return true ; } return node . isGranted ( Permission . read , this ) ; |
public class NumberBindings { /** * An number binding of a division that won ' t throw an { @ link java . lang . ArithmeticException }
* when a division by zero happens . See { @ link # divideSafe ( javafx . beans . value . ObservableIntegerValue ,
* javafx . beans . value . ObservableIntegerValue ) }
* for more informations .
* @ param dividend the observable value used as dividend
* @ param divisor the observable value used as divisor
* @ return the resulting number binding */
public static NumberBinding divideSafe ( ObservableValue < Number > dividend , ObservableValue < Number > divisor ) { } } | return divideSafe ( dividend , divisor , new SimpleDoubleProperty ( 0 ) ) ; |
public class V1BinaryAnnotation { /** * Creates a tag annotation , which is the same as { @ link Span # tags ( ) } except duplicating the
* endpoint .
* < p > A special case is when the key is " lc " and value is empty : This substitutes for the { @ link
* Span # localEndpoint ( ) } . */
public static V1BinaryAnnotation createString ( String key , String value , Endpoint endpoint ) { } } | if ( value == null ) throw new NullPointerException ( "value == null" ) ; return new V1BinaryAnnotation ( key , value , endpoint ) ; |
public class MPdfWriter { /** * Ecrit le pdf .
* @ param table
* MBasicTable
* @ param out
* OutputStream
* @ throws IOException */
protected void writePdf ( final MBasicTable table , final OutputStream out ) throws IOException { } } | try { // step 1 : creation of a document - object
final Rectangle pageSize = landscape ? PageSize . A4 . rotate ( ) : PageSize . A4 ; final Document document = new Document ( pageSize , 50 , 50 , 50 , 50 ) ; // step 2 : we create a writer that listens to the document and directs a PDF - stream to out
createWriter ( table , document , out ) ; // we add some meta information to the document , and we open it
document . addAuthor ( System . getProperty ( "user.name" ) ) ; document . addCreator ( "JavaMelody" ) ; final String title = buildTitle ( table ) ; if ( title != null ) { document . addTitle ( title ) ; } document . open ( ) ; // ouvre la boîte de dialogue Imprimer de Adobe Reader
// if ( writer instanceof PdfWriter ) {
// ( ( PdfWriter ) writer ) . addJavaScript ( " this . print ( true ) ; " , false ) ;
// table
final Table datatable = new Table ( table . getColumnCount ( ) ) ; datatable . setCellsFitPage ( true ) ; datatable . setPadding ( 4 ) ; datatable . setSpacing ( 0 ) ; // headers
renderHeaders ( table , datatable ) ; // data rows
renderList ( table , datatable ) ; document . add ( datatable ) ; // we close the document
document . close ( ) ; } catch ( final DocumentException e ) { // on ne peut déclarer d ' exception autre que IOException en throws
throw new IOException ( e ) ; } |
public class DefaultOptionParser { /** * Search for a prefix that is the long name of an option ( - Xmx512m ) .
* @ param token the command line token to handle */
private String getLongPrefix ( String token ) { } } | String name = null ; for ( int i = token . length ( ) - 2 ; i > 1 ; i -- ) { String prefix = token . substring ( 0 , i ) ; if ( options . hasLongOption ( prefix ) ) { name = prefix ; break ; } } return name ; |
public class SharedPreferencesItem { /** * Instantiates new fragment .
* @ param bundle
* : Any extra data to be passed to fragment , pass null if you don ' t want to pass anything .
* @ return : Instance of current fragment . */
public static SharedPreferencesItem newInstance ( @ NonNull Bundle bundle ) { } } | SharedPreferencesItem sharedPreferencesItem = new SharedPreferencesItem ( ) ; sharedPreferencesItem . setArguments ( bundle ) ; return sharedPreferencesItem ; |
public class LabelCountersForWorkteamMarshaller { /** * Marshall the given parameter object . */
public void marshall ( LabelCountersForWorkteam labelCountersForWorkteam , ProtocolMarshaller protocolMarshaller ) { } } | if ( labelCountersForWorkteam == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelCountersForWorkteam . getHumanLabeled ( ) , HUMANLABELED_BINDING ) ; protocolMarshaller . marshall ( labelCountersForWorkteam . getPendingHuman ( ) , PENDINGHUMAN_BINDING ) ; protocolMarshaller . marshall ( labelCountersForWorkteam . getTotal ( ) , TOTAL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class TupleMRConfigBuilder { /** * Defines the fields used to group tuples by . Similar to the GROUP BY in SQL .
* Tuples whose group - by fields are the same will be grouped and received in
* the same { @ link TupleReducer # reduce } call . < p >
* When multiple schemas are set then the groupBy fields are used to perform
* co - grouping among tuples with different schemas . The groupBy fields
* specified in this method in a multi - source scenario must be present in
* every intermediate schema defined . < p >
* A field that ' s named differently among the intermediate schemas must be aliased in
* order to be used in the groupBy . For that purpose , use { @ link # setFieldAliases ( String , Aliases ) } . */
public void setGroupByFields ( String ... groupByFields ) throws TupleMRException { } } | failIfEmpty ( groupByFields , "GroupBy fields can't be null or empty" ) ; failIfEmpty ( schemas , "No schemas defined" ) ; failIfNotNull ( this . groupByFields , "GroupBy fields already set : " + Arrays . toString ( groupByFields ) ) ; for ( String field : groupByFields ) { if ( ! fieldPresentInAllSchemas ( field ) ) { throw new TupleMRException ( "Can't group by field '" + field + "' . Not present in all sources" ) ; } if ( ! fieldSameTypeInAllSources ( field ) ) { throw new TupleMRException ( "Can't group by field '" + field + "' since its type differs among sources" ) ; } } this . groupByFields = Arrays . asList ( groupByFields ) ; |
public class DatabaseInformationMain { /** * Retrieves a < code > Table < / code > object describing , in an extended
* fashion , all of the system or formal specification SQL types known to
* this database , including its level of support for them ( which may
* be no support at all ) in various capacities . < p >
* < pre class = " SqlCodeExample " >
* TYPE _ NAME VARCHAR the canonical name used in DDL statements .
* DATA _ TYPE SMALLINT data type code from Types
* PRECISION INTEGER max column size .
* number = > max . precision .
* character = > max characters .
* datetime = > max chars incl . frac . component .
* LITERAL _ PREFIX VARCHAR char ( s ) prefixing literal of this type .
* LITERAL _ SUFFIX VARCHAR char ( s ) terminating literal of this type .
* CREATE _ PARAMS VARCHAR Localized syntax - order list of domain
* create parameter keywords .
* - for human consumption only
* NULLABLE SMALLINT { No Nulls | Nullable | Unknown }
* CASE _ SENSITIVE BOOLEAN case - sensitive in collations / comparisons ?
* SEARCHABLE SMALLINT { None | Char ( Only WHERE . . LIKE ) |
* Basic ( Except WHERE . . LIKE ) |
* Searchable ( All forms ) }
* UNSIGNED _ ATTRIBUTE BOOLEAN { TRUE ( unsigned ) | FALSE ( signed ) |
* NULL ( non - numeric or not applicable ) }
* FIXED _ PREC _ SCALE BOOLEAN { TRUE ( fixed ) | FALSE ( variable ) |
* NULL ( non - numeric or not applicable ) }
* AUTO _ INCREMENT BOOLEAN automatic unique value generated for
* inserts and updates when no value or
* NULL specified ?
* LOCAL _ TYPE _ NAME VARCHAR Localized name of data type ;
* - NULL = > not supported ( no resource avail ) .
* - for human consumption only
* MINIMUM _ SCALE SMALLINT minimum scale supported .
* MAXIMUM _ SCALE SMALLINT maximum scale supported .
* SQL _ DATA _ TYPE INTEGER value expected in SQL CLI SQL _ DESC _ TYPE
* field of the SQLDA .
* SQL _ DATETIME _ SUB INTEGER SQL CLI datetime / interval subcode
* NUM _ PREC _ RADIX INTEGER numeric base w . r . t # of digits reported
* in PRECISION column ( typically 10)
* INTERVAL _ PRECISION INTEGER interval leading precision ( not implemented )
* AS _ TAB _ COL BOOLEAN type supported as table column ?
* AS _ PROC _ COL BOOLEAN type supported as procedure column ?
* MAX _ PREC _ ACT BIGINT like PRECISION unless value would be
* truncated using INTEGER
* MIN _ SCALE _ ACT INTEGER like MINIMUM _ SCALE unless value would be
* truncated using SMALLINT
* MAX _ SCALE _ ACT INTEGER like MAXIMUM _ SCALE unless value would be
* truncated using SMALLINT
* COL _ ST _ CLS _ NAME VARCHAR Java Class FQN of in - memory representation
* COL _ ST _ IS _ SUP BOOLEAN is COL _ ST _ CLS _ NAME supported under the
* hosting JVM and engine build option ?
* STD _ MAP _ CLS _ NAME VARCHAR Java class FQN of standard JDBC mapping
* STD _ MAP _ IS _ SUP BOOLEAN Is STD _ MAP _ CLS _ NAME supported under the
* hosting JVM ?
* CST _ MAP _ CLS _ NAME VARCHAR Java class FQN of HSQLDB - provided JDBC
* interface representation
* CST _ MAP _ IS _ SUP BOOLEAN is CST _ MAP _ CLS _ NAME supported under the
* hosting JVM and engine build option ?
* MCOL _ JDBC INTEGER maximum character octet length representable
* via JDBC interface
* MCOL _ ACT BIGINT like MCOL _ JDBC unless value would be
* truncated using INTEGER
* DEF _ OR _ FIXED _ SCALE INTEGER default or fixed scale for numeric types
* REMARKS VARCHAR localized comment on the data type
* TYPE _ SUB INTEGER From Types :
* { TYPE _ SUB _ DEFAULT | TYPE _ SUB _ IGNORECASE }
* deprecated : TYPE _ SUB _ IDENTITY
* < / pre > < p >
* @ return a < code > Table < / code > object describing all of the
* standard SQL types known to this database */
final Table SYSTEM_ALLTYPEINFO ( ) { } } | Table t = sysTables [ SYSTEM_ALLTYPEINFO ] ; if ( t == null ) { t = createBlankTable ( sysTableHsqlNames [ SYSTEM_ALLTYPEINFO ] ) ; // same as SYSTEM _ TYPEINFO :
addColumn ( t , "TYPE_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "DATA_TYPE" , Type . SQL_SMALLINT ) ; addColumn ( t , "PRECISION" , Type . SQL_INTEGER ) ; addColumn ( t , "LITERAL_PREFIX" , CHARACTER_DATA ) ; addColumn ( t , "LITERAL_SUFFIX" , CHARACTER_DATA ) ; addColumn ( t , "CREATE_PARAMS" , CHARACTER_DATA ) ; addColumn ( t , "NULLABLE" , Type . SQL_SMALLINT ) ; addColumn ( t , "CASE_SENSITIVE" , Type . SQL_BOOLEAN ) ; addColumn ( t , "SEARCHABLE" , Type . SQL_SMALLINT ) ; addColumn ( t , "UNSIGNED_ATTRIBUTE" , Type . SQL_BOOLEAN ) ; addColumn ( t , "FIXED_PREC_SCALE" , Type . SQL_BOOLEAN ) ; addColumn ( t , "AUTO_INCREMENT" , Type . SQL_BOOLEAN ) ; addColumn ( t , "LOCAL_TYPE_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "MINIMUM_SCALE" , Type . SQL_SMALLINT ) ; addColumn ( t , "MAXIMUM_SCALE" , Type . SQL_SMALLINT ) ; addColumn ( t , "SQL_DATA_TYPE" , Type . SQL_INTEGER ) ; addColumn ( t , "SQL_DATETIME_SUB" , Type . SQL_INTEGER ) ; addColumn ( t , "NUM_PREC_RADIX" , Type . SQL_INTEGER ) ; // SQL CLI / ODBC - not in JDBC spec
addColumn ( t , "INTERVAL_PRECISION" , Type . SQL_INTEGER ) ; // extended :
// level of support
addColumn ( t , "AS_TAB_COL" , Type . SQL_BOOLEAN ) ; // for instance , some executable methods take Connection
// or return non - serializable Object such as ResultSet , neither
// of which maps to a supported table column type but which
// we show as JAVA _ OBJECT in SYSTEM _ PROCEDURECOLUMNS .
// Also , triggers take Object [ ] row , which we show as ARRAY
// presently , although STRUCT would probably be better in the
// future , as the row can actually contain mixed data types .
addColumn ( t , "AS_PROC_COL" , Type . SQL_BOOLEAN ) ; // actual values for attributes that cannot be represented
// within the limitations of the SQL CLI / JDBC interface
addColumn ( t , "MAX_PREC_ACT" , Type . SQL_BIGINT ) ; addColumn ( t , "MIN_SCALE_ACT" , Type . SQL_INTEGER ) ; addColumn ( t , "MAX_SCALE_ACT" , Type . SQL_INTEGER ) ; // how do we store this internally as a column value ?
addColumn ( t , "COL_ST_CLS_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "COL_ST_IS_SUP" , Type . SQL_BOOLEAN ) ; // what is the standard Java mapping for the type ?
addColumn ( t , "STD_MAP_CLS_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "STD_MAP_IS_SUP" , Type . SQL_BOOLEAN ) ; // what , if any , custom mapping do we provide ?
// ( under the current build options and hosting VM )
addColumn ( t , "CST_MAP_CLS_NAME" , SQL_IDENTIFIER ) ; addColumn ( t , "CST_MAP_IS_SUP" , Type . SQL_BOOLEAN ) ; // what is the max representable and actual
// character octet length , if applicable ?
addColumn ( t , "MCOL_JDBC" , Type . SQL_INTEGER ) ; addColumn ( t , "MCOL_ACT" , Type . SQL_BIGINT ) ; // what is the default or fixed scale , if applicable ?
addColumn ( t , "DEF_OR_FIXED_SCALE" , Type . SQL_INTEGER ) ; // Any type - specific , localized remarks can go here
addColumn ( t , "REMARKS" , CHARACTER_DATA ) ; // required for JDBC sort contract :
addColumn ( t , "TYPE_SUB" , Type . SQL_INTEGER ) ; // order : DATA _ TYPE , TYPE _ SUB
// true primary key
HsqlName name = HsqlNameManager . newInfoSchemaObjectName ( sysTableHsqlNames [ SYSTEM_ALLTYPEINFO ] . name , false , SchemaObject . INDEX ) ; t . createPrimaryKey ( name , new int [ ] { 1 , 34 } , true ) ; return t ; } PersistentStore store = database . persistentStoreCollection . getStore ( t ) ; Object [ ] row ; int type ; DITypeInfo ti ; // Same as SYSTEM _ TYPEINFO
final int itype_name = 0 ; final int idata_type = 1 ; final int iprecision = 2 ; final int iliteral_prefix = 3 ; final int iliteral_suffix = 4 ; final int icreate_params = 5 ; final int inullable = 6 ; final int icase_sensitive = 7 ; final int isearchable = 8 ; final int iunsigned_attribute = 9 ; final int ifixed_prec_scale = 10 ; final int iauto_increment = 11 ; final int ilocal_type_name = 12 ; final int iminimum_scale = 13 ; final int imaximum_scale = 14 ; final int isql_data_type = 15 ; final int isql_datetime_sub = 16 ; final int inum_prec_radix = 17 ; // Extensions
// not in JDBC , but in SQL CLI SQLDA / ODBC
final int iinterval_precision = 18 ; // HSQLDB / Java - specific :
final int iis_sup_as_tcol = 19 ; final int iis_sup_as_pcol = 20 ; final int imax_prec_or_len_act = 21 ; final int imin_scale_actual = 22 ; final int imax_scale_actual = 23 ; final int ics_cls_name = 24 ; final int ics_cls_is_supported = 25 ; final int ism_cls_name = 26 ; final int ism_cls_is_supported = 27 ; final int icm_cls_name = 28 ; final int icm_cls_is_supported = 29 ; final int imax_char_oct_len_jdbc = 30 ; final int imax_char_oct_len_act = 31 ; final int idef_or_fixed_scale = 32 ; final int iremarks = 33 ; final int itype_sub = 34 ; ti = new DITypeInfo ( ) ; for ( int i = 0 ; i < Types . ALL_TYPES . length ; i ++ ) { ti . setTypeCode ( Types . ALL_TYPES [ i ] [ 0 ] ) ; ti . setTypeSub ( Types . ALL_TYPES [ i ] [ 1 ] ) ; row = t . getEmptyRowData ( ) ; row [ itype_name ] = ti . getTypeName ( ) ; row [ idata_type ] = ti . getDataType ( ) ; row [ iprecision ] = ti . getPrecision ( ) ; row [ iliteral_prefix ] = ti . getLiteralPrefix ( ) ; row [ iliteral_suffix ] = ti . getLiteralSuffix ( ) ; row [ icreate_params ] = ti . getCreateParams ( ) ; row [ inullable ] = ti . getNullability ( ) ; row [ icase_sensitive ] = ti . isCaseSensitive ( ) ; row [ isearchable ] = ti . getSearchability ( ) ; row [ iunsigned_attribute ] = ti . isUnsignedAttribute ( ) ; row [ ifixed_prec_scale ] = ti . isFixedPrecisionScale ( ) ; row [ iauto_increment ] = ti . isAutoIncrement ( ) ; row [ ilocal_type_name ] = ti . getLocalName ( ) ; row [ iminimum_scale ] = ti . getMinScale ( ) ; row [ imaximum_scale ] = ti . getMaxScale ( ) ; row [ isql_data_type ] = ti . getSqlDataType ( ) ; row [ isql_datetime_sub ] = ti . getSqlDateTimeSub ( ) ; row [ inum_prec_radix ] = ti . getNumPrecRadix ( ) ; row [ iinterval_precision ] = ti . getIntervalPrecision ( ) ; row [ iis_sup_as_tcol ] = ti . isSupportedAsTCol ( ) ; row [ iis_sup_as_pcol ] = ti . isSupportedAsPCol ( ) ; row [ imax_prec_or_len_act ] = ti . getPrecisionAct ( ) ; row [ imin_scale_actual ] = ti . getMinScaleAct ( ) ; row [ imax_scale_actual ] = ti . getMaxScaleAct ( ) ; row [ ics_cls_name ] = ti . getColStClsName ( ) ; row [ ics_cls_is_supported ] = ti . isColStClsSupported ( ) ; row [ ism_cls_name ] = ti . getStdMapClsName ( ) ; row [ ism_cls_is_supported ] = ti . isStdMapClsSupported ( ) ; row [ icm_cls_name ] = ti . getCstMapClsName ( ) ; try { if ( row [ icm_cls_name ] != null ) { ns . classForName ( ( String ) row [ icm_cls_name ] ) ; row [ icm_cls_is_supported ] = Boolean . TRUE ; } } catch ( Exception e ) { row [ icm_cls_is_supported ] = Boolean . FALSE ; } row [ imax_char_oct_len_jdbc ] = ti . getCharOctLen ( ) ; row [ imax_char_oct_len_act ] = ti . getCharOctLenAct ( ) ; row [ idef_or_fixed_scale ] = ti . getDefaultScale ( ) ; row [ iremarks ] = ti . getRemarks ( ) ; row [ itype_sub ] = ti . getDataTypeSub ( ) ; t . insertSys ( store , row ) ; } return t ; |
public class SinglePosition { /** * Merge this SinglePosition with another { @ link Positions } instance . If the given { @ link Positions } is :
* - a SinglePosition , it returns a { @ link LinearPositions } composed by this and the given positions , in order .
* - any other { @ link Positions } , it delegates to the given { @ link Positions } merge .
* @ param other Positions instance to merge with .
* @ return Positions instance result of merge . */
@ Override public Positions merge ( Positions other ) { } } | if ( other instanceof SinglePosition ) { SinglePosition that = ( SinglePosition ) other ; return LinearPositions . builder ( ) . addSinglePosition ( this ) . addSinglePosition ( that ) . build ( ) ; } else { return other . merge ( this ) ; } |
public class SpannableStringInternal { /** * / * package */
void setSpan ( Object what , int start , int end , int flags ) { } } | int nstart = start ; int nend = end ; checkRange ( "setSpan" , start , end ) ; if ( ( flags & Spannable . SPAN_PARAGRAPH ) == Spannable . SPAN_PARAGRAPH ) { if ( start != 0 && start != length ( ) ) { char c = charAt ( start - 1 ) ; if ( c != '\n' ) throw new RuntimeException ( "PARAGRAPH span must start at paragraph boundary" + " (" + start + " follows " + c + ")" ) ; } if ( end != 0 && end != length ( ) ) { char c = charAt ( end - 1 ) ; if ( c != '\n' ) throw new RuntimeException ( "PARAGRAPH span must end at paragraph boundary" + " (" + end + " follows " + c + ")" ) ; } } int count = mSpanCount ; Object [ ] spans = mSpans ; int [ ] data = mSpanData ; for ( int i = 0 ; i < count ; i ++ ) { if ( spans [ i ] == what ) { int ostart = data [ i * COLUMNS + START ] ; int oend = data [ i * COLUMNS + END ] ; data [ i * COLUMNS + START ] = start ; data [ i * COLUMNS + END ] = end ; data [ i * COLUMNS + FLAGS ] = flags ; sendSpanChanged ( what , ostart , oend , nstart , nend ) ; return ; } } if ( mSpanCount + 1 >= mSpans . length ) { int newsize = ArrayUtils . idealIntArraySize ( mSpanCount + 1 ) ; Object [ ] newtags = new Object [ newsize ] ; int [ ] newdata = new int [ newsize * 3 ] ; System . arraycopy ( mSpans , 0 , newtags , 0 , mSpanCount ) ; System . arraycopy ( mSpanData , 0 , newdata , 0 , mSpanCount * 3 ) ; mSpans = newtags ; mSpanData = newdata ; } mSpans [ mSpanCount ] = what ; mSpanData [ mSpanCount * COLUMNS + START ] = start ; mSpanData [ mSpanCount * COLUMNS + END ] = end ; mSpanData [ mSpanCount * COLUMNS + FLAGS ] = flags ; mSpanCount ++ ; if ( this instanceof Spannable ) sendSpanAdded ( what , nstart , nend ) ; |
public class SearchPortletController { /** * Create an actionUrl for the indicated portlet The resource URL is for the ajax typing search
* results response .
* @ param request render request
* @ param response render response */
private String calculateSearchLaunchUrl ( RenderRequest request , RenderResponse response ) { } } | final HttpServletRequest httpRequest = this . portalRequestUtils . getPortletHttpRequest ( request ) ; final IPortalUrlBuilder portalUrlBuilder = this . portalUrlProvider . getPortalUrlBuilderByPortletFName ( httpRequest , "search" , UrlType . ACTION ) ; return portalUrlBuilder . getUrlString ( ) ; |
public class CSSFactory { /** * Parses URL into StyleSheet
* @ param url
* URL of file to be parsed
* @ param network
* Network processor used for handling the URL connections
* @ param encoding
* Encoding of file
* @ return Parsed StyleSheet
* @ throws CSSException
* When exception during parse occurs
* @ throws IOException
* When file not found */
public static final StyleSheet parse ( URL url , NetworkProcessor network , String encoding ) throws CSSException , IOException { } } | return getCSSParserFactory ( ) . parse ( url , network , encoding , SourceType . URL , url ) ; |
public class LexCharacterToken { /** * Creates a map of all field names and their value
* @ param includeInheritedFields
* if true all inherited fields are included
* @ return a a map of names to values of all fields */
@ Override public Map < String , Object > getChildren ( Boolean includeInheritedFields ) { } } | Map < String , Object > fields = new HashMap < String , Object > ( ) ; if ( includeInheritedFields ) { fields . putAll ( super . getChildren ( includeInheritedFields ) ) ; } fields . put ( "unicode" , this . unicode ) ; return fields ; |
public class SQLExecutor { /** * Remember to close the returned < code > Stream < / code > list to close the underlying < code > ResultSet < / code > list .
* { @ code stream } operation won ' t be part of transaction or use the connection created by { @ code Transaction } even it ' s in transaction block / range .
* @ param sqls
* @ param statementSetter
* @ param jdbcSettings
* @ param parameters
* @ return */
@ SafeVarargs public final < T > Stream < T > streamAll ( final Class < T > targetClass , final List < String > sqls , final StatementSetter statementSetter , final JdbcSettings jdbcSettings , final Object ... parameters ) { } } | final JdbcUtil . BiRecordGetter < T , RuntimeException > biRecordGetter = BiRecordGetter . to ( targetClass ) ; return streamAll ( sqls , statementSetter , biRecordGetter , jdbcSettings , parameters ) ; |
public class Model { /** * Returns a mapping for given column according to given < code > modelDom < / code > .
* In this case , < code > modelDom < / code > is
* @ param colName name of column which is mapped , can be null .
* @ param modelDom
* @ param logNonExactMapping
* @ return */
public static int [ ] [ ] getDomainMapping ( String colName , String [ ] modelDom , String [ ] colDom , boolean logNonExactMapping ) { } } | int emap [ ] = new int [ modelDom . length ] ; boolean bmap [ ] = new boolean [ modelDom . length ] ; HashMap < String , Integer > md = new HashMap < String , Integer > ( ( int ) ( ( colDom . length / 0.75f ) + 1 ) ) ; for ( int i = 0 ; i < colDom . length ; i ++ ) md . put ( colDom [ i ] , i ) ; for ( int i = 0 ; i < modelDom . length ; i ++ ) { Integer I = md . get ( modelDom [ i ] ) ; if ( I == null && logNonExactMapping ) Log . warn ( Sys . SCORM , "Domain mapping: target domain contains the factor '" + modelDom [ i ] + "' which DOES NOT appear in input domain " + ( colName != null ? "(column: " + colName + ")" : "" ) ) ; if ( I != null ) { emap [ i ] = I ; bmap [ i ] = true ; } } if ( logNonExactMapping ) { // Inform about additional values in column domain which do not appear in model domain
for ( int i = 0 ; i < colDom . length ; i ++ ) { boolean found = false ; for ( int j = 0 ; j < emap . length ; j ++ ) if ( emap [ j ] == i ) { found = true ; break ; } if ( ! found ) Log . warn ( Sys . SCORM , "Domain mapping: target domain DOES NOT contain the factor '" + colDom [ i ] + "' which appears in input domain " + ( colName != null ? "(column: " + colName + ")" : "" ) ) ; } } // produce packed values
int [ ] [ ] res = Utils . pack ( emap , bmap ) ; // Sort values in numeric order to support binary search in TransfVec
Utils . sortWith ( res [ 0 ] , res [ 1 ] ) ; return res ; |
public class ServiceDependencyBuilder { /** * Returns a builder instance that is initialized using a prototype ServiceDependency .
* All values of the prototype are copied .
* @ param prototype the prototype dependency
* @ return ServiceDependencyBuilder */
public static ServiceDependencyBuilder copyOf ( final ServiceDependency prototype ) { } } | return new ServiceDependencyBuilder ( ) . withName ( prototype . getName ( ) ) . withDescription ( prototype . getDescription ( ) ) . withUrl ( prototype . getUrl ( ) ) . withType ( prototype . getType ( ) ) . withSubtype ( prototype . getSubtype ( ) ) . withMethods ( prototype . getMethods ( ) ) . withMediaTypes ( prototype . getMediaTypes ( ) ) . withAuthentication ( prototype . getAuthentication ( ) ) . withCriticality ( prototype . getCriticality ( ) ) . withExpectations ( prototype . getExpectations ( ) ) ; |
public class Icon { /** * Create an icon from a URL .
* @ param url a URL .
* @ return an icon as { @ link fr . jcgay . snp4j . Icon } . */
@ NonNull public static Icon url ( @ NonNull URL url ) { } } | return new Icon ( url . toString ( ) , false ) ; |
public class BlockingBackChannel { /** * Called by iteration head after it has sent all input for the current superstep through the data channel
* ( blocks iteration head ) . */
public DataInputView getReadEndAfterSuperstepEnded ( ) { } } | try { return queue . take ( ) . switchBuffers ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } |
public class Strings { /** * escape Strings as in Java String literals */
public static String escape ( String str ) { } } | int i , max ; StringBuilder result ; char c ; max = str . length ( ) ; for ( i = 0 ; i < max ; i ++ ) { if ( str . charAt ( i ) < 32 ) { break ; } } if ( i == max ) { return str ; } result = new StringBuilder ( max + 10 ) ; for ( i = 0 ; i < max ; i ++ ) { c = str . charAt ( i ) ; switch ( c ) { case '\n' : result . append ( "\\n" ) ; break ; case '\r' : result . append ( "\\r" ) ; break ; case '\t' : result . append ( "\\t" ) ; break ; case '\\' : result . append ( "\\\\" ) ; break ; default : if ( c < 32 ) { result . append ( "\\u" ) . append ( Strings . padLeft ( Integer . toHexString ( c ) , 4 , '0' ) ) ; } else { result . append ( c ) ; } } } return result . toString ( ) ; |
public class AbstractViewQuery { /** * Gets the tag of the view .
* @ return tag */
public Object getTag ( ) { } } | Object result = null ; if ( view != null ) { result = view . getTag ( ) ; } return result ; |
public class JsonConvert { /** * 返回非null的值是由String 、 ArrayList 、 HashMap任意组合的对象 */
public < V > V convertFrom ( final ByteBuffer ... buffers ) { } } | if ( buffers == null || buffers . length == 0 ) return null ; return ( V ) new AnyDecoder ( factory ) . convertFrom ( new JsonByteBufferReader ( ( ConvertMask ) null , buffers ) ) ; |
public class KeyValue { /** * Returns an empty { @ code KeyValue } instance with the { @ code key } set . No value is present for this instance .
* @ param key the key , must not be { @ literal null } .
* @ param < K >
* @ param < V >
* @ return the { @ link KeyValue } */
public static < K , V > KeyValue < K , V > empty ( K key ) { } } | return new KeyValue < K , V > ( key , null ) ; |
public class CxxVCppBuildLogParser { /** * Can be used to create a list of includes , defines and options for a single line If it follows the format of VC + +
* @ param line
* @ param projectPath
* @ param compilationFile */
public void parseVCppLine ( String line , String projectPath , String compilationFile ) { } } | this . parseVCppCompilerCLLine ( line , projectPath , compilationFile ) ; |
public class Client { /** * Returns a list of authentication factors that are available for user enrollment
* via API .
* @ param userId
* The id of the user .
* @ return Array AuthFactor list
* @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
* @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
* @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
* @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / multi - factor - authentication / available - factors " > Get Available Authentication Factors documentation < / a > */
public List < AuthFactor > getFactors ( long userId ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } } | cleanError ( ) ; prepareToken ( ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . GET_FACTORS_URL , userId ) ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; List < AuthFactor > authFactors = new ArrayList < AuthFactor > ( ) ; OneloginOAuthJSONResourceResponse oAuthResponse = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . GET , OneloginOAuthJSONResourceResponse . class ) ; if ( oAuthResponse . getResponseCode ( ) == 200 ) { JSONObject data = oAuthResponse . getData ( ) ; if ( data . has ( "auth_factors" ) ) { JSONArray dataArray = data . getJSONArray ( "auth_factors" ) ; if ( dataArray != null && dataArray . length ( ) > 0 ) { AuthFactor authFactor ; for ( int i = 0 ; i < dataArray . length ( ) ; i ++ ) { authFactor = new AuthFactor ( dataArray . getJSONObject ( i ) ) ; authFactors . add ( authFactor ) ; } } } } else { error = oAuthResponse . getError ( ) ; errorDescription = oAuthResponse . getErrorDescription ( ) ; } return authFactors ; |
public class ShrinkWrapPath { /** * { @ inheritDoc }
* @ see java . nio . file . Path # normalize ( ) */
@ Override public Path normalize ( ) { } } | final String normalizedString = normalize ( tokenize ( this ) , this . isAbsolute ( ) ) ; final Path normalized = new ShrinkWrapPath ( normalizedString , this . fileSystem ) ; return normalized ; |
public class CorcInputFormat { /** * Gets the StructTypeInfo that declares the total schema of the file from the configuration */
static StructTypeInfo getSchemaTypeInfo ( Configuration conf ) { } } | String schemaTypeInfo = conf . get ( SCHEMA_TYPE_INFO ) ; if ( schemaTypeInfo != null && ! schemaTypeInfo . isEmpty ( ) ) { LOG . debug ( "Got schema typeInfo from conf: {}" , schemaTypeInfo ) ; return ( StructTypeInfo ) TypeInfoUtils . getTypeInfoFromTypeString ( conf . get ( SCHEMA_TYPE_INFO ) ) ; } return null ; |
public class MapConstraints { /** * Returns a constrained view of the specified sorted - set multimap , using the
* specified constraint . Any operations that add new mappings will call the
* provided constraint . However , this method does not verify that existing
* mappings satisfy the constraint .
* < p > Note that the generated multimap ' s { @ link Multimap # removeAll } and
* { @ link Multimap # replaceValues } methods return collections that are not
* constrained .
* < p > The returned multimap is not serializable .
* @ param multimap the multimap to constrain
* @ param constraint the constraint that validates added entries
* @ return a constrained view of the specified multimap */
public static < K , V > SortedSetMultimap < K , V > constrainedSortedSetMultimap ( SortedSetMultimap < K , V > multimap , MapConstraint < ? super K , ? super V > constraint ) { } } | return new ConstrainedSortedSetMultimap < K , V > ( multimap , constraint ) ; |
public class TreeString { /** * Creates a { @ link TreeString } . Useful if you need to create one - off
* { @ link TreeString } without { @ link TreeStringBuilder } . Memory consumption
* is still about the same to { @ code new String ( s ) } .
* @ return null if the parameter is null */
public static TreeString of ( final String s ) { } } | if ( s == null ) { return null ; } return new TreeString ( null , s ) ; |
public class ResourceGroupsInner { /** * Captures the specified resource group as a template .
* @ param resourceGroupName The name of the resource group to export as a template .
* @ param parameters Parameters for exporting the template .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ResourceGroupExportResultInner object */
public Observable < ResourceGroupExportResultInner > exportTemplateAsync ( String resourceGroupName , ExportTemplateRequest parameters ) { } } | return exportTemplateWithServiceResponseAsync ( resourceGroupName , parameters ) . map ( new Func1 < ServiceResponse < ResourceGroupExportResultInner > , ResourceGroupExportResultInner > ( ) { @ Override public ResourceGroupExportResultInner call ( ServiceResponse < ResourceGroupExportResultInner > response ) { return response . body ( ) ; } } ) ; |
public class CmsHtmlImport { /** * Tests if a filename is an external name , that is this name does not point into the OpenCms VFS . < p >
* A filename is an external name if it contains the string " : / / " , e . g . " http : / / " or " ftp : / / " . < p >
* @ param filename the filename to test
* @ return true or false */
private boolean isExternal ( String filename ) { } } | boolean external = false ; if ( filename . indexOf ( "://" ) > 0 ) { external = true ; } return external ; |
public class TaskDefinition { /** * The launch type to use with your task . For more information , see < a
* href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / launch _ types . html " > Amazon ECS Launch Types < / a >
* in the < i > Amazon Elastic Container Service Developer Guide < / i > .
* @ param compatibilities
* The launch type to use with your task . For more information , see < a
* href = " https : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / launch _ types . html " > Amazon ECS Launch
* Types < / a > in the < i > Amazon Elastic Container Service Developer Guide < / i > .
* @ see Compatibility */
public void setCompatibilities ( java . util . Collection < String > compatibilities ) { } } | if ( compatibilities == null ) { this . compatibilities = null ; return ; } this . compatibilities = new com . amazonaws . internal . SdkInternalList < String > ( compatibilities ) ; |
public class ImgUtil { /** * 给图片添加图片水印 < br >
* 此方法并不关闭流
* @ param srcImage 源图像流
* @ param pressImg 水印图片 , 可以使用 { @ link ImageIO # read ( File ) } 方法读取文件
* @ param rectangle 矩形对象 , 表示矩形区域的x , y , width , height , x , y从背景图片中心计算
* @ param alpha 透明度 : alpha 必须是范围 [ 0.0 , 1.0 ] 之内 ( 包含边界值 ) 的一个浮点数字
* @ return 结果图片
* @ since 4.1.14 */
public static BufferedImage pressImage ( Image srcImage , Image pressImg , Rectangle rectangle , float alpha ) { } } | return Img . from ( srcImage ) . pressImage ( pressImg , rectangle , alpha ) . getImg ( ) ; |
public class CreateUserPoolRequest { /** * Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setUsernameAttributes ( java . util . Collection ) } or { @ link # withUsernameAttributes ( java . util . Collection ) } if
* you want to override the existing values .
* @ param usernameAttributes
* Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see UsernameAttributeType */
public CreateUserPoolRequest withUsernameAttributes ( String ... usernameAttributes ) { } } | if ( this . usernameAttributes == null ) { setUsernameAttributes ( new java . util . ArrayList < String > ( usernameAttributes . length ) ) ; } for ( String ele : usernameAttributes ) { this . usernameAttributes . add ( ele ) ; } return this ; |
public class PrimaryWorkitem { /** * Collection of Tasks and Tests that belong to this primary workitem .
* @ param filter How to filter the secondary workitems . To get only Tasks ,
* pass a TaskFilter . To get only Tests , pass a TestFilter .
* @ return Collection of Tasks and Tests that belong to this primary
* workitem . */
public Collection < SecondaryWorkitem > getSecondaryWorkitems ( SecondaryWorkitemFilter filter ) { } } | if ( filter == null ) { filter = new SecondaryWorkitemFilter ( ) ; } filter . parent . clear ( ) ; filter . parent . add ( this ) ; return getInstance ( ) . get ( ) . secondaryWorkitems ( filter ) ; |
public class Monetary { /** * Access multiple { @ link MonetaryRounding } instances using a possibly complex query
* @ param roundingQuery The { @ link javax . money . RoundingQuery } that may contains arbitrary parameters to be
* evaluated .
* @ return all { @ link javax . money . MonetaryRounding } instances matching the query , never { @ code null } . */
public static Collection < MonetaryRounding > getRoundings ( RoundingQuery roundingQuery ) { } } | return Optional . ofNullable ( monetaryRoundingsSingletonSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryRoundingsSpi loaded, query functionality is not available." ) ) . getRoundings ( roundingQuery ) ; |
public class MathMLConverter { /** * Converts from latex to full MathML that contains
* pMML and cMML semantics . < br / >
* This method relies on LaTeXMLo .
* @ param latexContent latex formula
* @ return well formatted mathml
* @ throws MathConverterException conversion failed , simple info text included */
String convertLatex ( String latexContent ) throws MathConverterException { } } | LaTeXMLConverter converter = new LaTeXMLConverter ( config . getLatexml ( ) ) ; try { NativeResponse rep = converter . parseAsService ( latexContent ) ; if ( rep . getStatusCode ( ) == 0 ) { return rep . getResult ( ) ; } else { logger . error ( String . format ( "LaTeXMLServiceResponse follows:\n" + "statusCode: %s\nlog: %s\nresult: %s" , rep . getStatusCode ( ) , rep . getMessage ( ) , rep . getResult ( ) ) ) ; throw new MathConverterException ( "latexml conversion had an error" ) ; } } catch ( Exception e ) { logger . error ( "latex conversion failed" , e ) ; throw new MathConverterException ( "latex conversion failed" ) ; } |
public class TypeEqualitySpecializationUtils { /** * Removes all instances of { @ link Class } and { @ link ParameterizedType } for which a subtype is present in ' bounds ' */
private static List < Type > removeRedundantBounds ( final Type [ ] bounds ) { } } | if ( bounds . length == 1 ) { return Collections . singletonList ( bounds [ 0 ] ) ; } // if TypeVariable S has a bound T that is a TypeVariable , than S cannot have any other bounds , i . e . bounds . lenght = = 1
List < Type > result = new LinkedList < Type > ( ) ; for ( int i = 0 ; i < bounds . length ; i ++ ) { boolean isRedundant = false ; for ( int j = 0 ; j < bounds . length && i != j ; j ++ ) { if ( Reflections . getRawType ( bounds [ i ] ) . isAssignableFrom ( Reflections . getRawType ( bounds [ j ] ) ) ) { isRedundant = true ; break ; } } if ( ! isRedundant ) { result . add ( bounds [ i ] ) ; } } return result ; |
public class UserProperty { /** * Returns all the registered { @ link UserPropertyDescriptor } s . */
public static DescriptorExtensionList < UserProperty , UserPropertyDescriptor > all ( ) { } } | return Jenkins . getInstance ( ) . < UserProperty , UserPropertyDescriptor > getDescriptorList ( UserProperty . class ) ; |
public class Serializer { /** * Writes Lists out as a data type
* @ param out
* Output write
* @ param listType
* List type
* @ return boolean true if object was successfully serialized , false otherwise */
protected static boolean writeListType ( Output out , Object listType ) { } } | log . trace ( "writeListType" ) ; if ( listType instanceof List < ? > ) { writeList ( out , ( List < ? > ) listType ) ; } else { return false ; } return true ; |
public class IsoRecurrence { /** * / * [ deutsch ]
* < p > Erzeugt eine Sequenz von wiederkehrenden r & uuml ; ckw & auml ; rts laufenden
* Moment - Intervallen mit der angegebenen Dauer . < / p >
* @ param count the count of repeating intervals ( { @ code > = 0 } )
* @ param duration represents the negative duration of every repeating interval
* @ param end denotes the end of first interval ( exclusive )
* @ param offset time zone offset in full minutes
* @ return sequence of recurrent half - open plain timestamp intervals
* @ throws IllegalArgumentException if the count is negative or the duration is not positive */
public static IsoRecurrence < MomentInterval > of ( int count , Duration < ? > duration , Moment end , ZonalOffset offset ) { } } | check ( count ) ; return new RecurrentMomentIntervals ( count , TYPE_DURATION_END , end . toZonalTimestamp ( offset ) , offset , duration ) ; |
public class ModifierAdjustment { /** * Adjusts a field ' s modifiers if it fulfills the supplied matcher .
* @ param matcher The matcher that determines if a field ' s modifiers should be adjusted .
* @ param modifierContributor The modifier contributors to enforce .
* @ return A new modifier adjustment that enforces the given modifier contributors and any previous adjustments . */
public ModifierAdjustment withFieldModifiers ( ElementMatcher < ? super FieldDescription . InDefinedShape > matcher , ModifierContributor . ForField ... modifierContributor ) { } } | return withFieldModifiers ( matcher , Arrays . asList ( modifierContributor ) ) ; |
public class SecretKeyFactory { /** * Generates a < code > SecretKey < / code > object from the provided key
* specification ( key material ) .
* @ param keySpec the specification ( key material ) of the secret key
* @ return the secret key
* @ exception InvalidKeySpecException if the given key specification
* is inappropriate for this secret - key factory to produce a secret key . */
public final SecretKey generateSecret ( KeySpec keySpec ) throws InvalidKeySpecException { } } | if ( serviceIterator == null ) { return spi . engineGenerateSecret ( keySpec ) ; } Exception failure = null ; SecretKeyFactorySpi mySpi = spi ; do { try { return mySpi . engineGenerateSecret ( keySpec ) ; } catch ( Exception e ) { if ( failure == null ) { failure = e ; } mySpi = nextSpi ( mySpi ) ; } } while ( mySpi != null ) ; if ( failure instanceof InvalidKeySpecException ) { throw ( InvalidKeySpecException ) failure ; } throw new InvalidKeySpecException ( "Could not generate secret key" , failure ) ; |
public class SimpleArrayGrid { /** * Returns SimpleArrayGrid view to the same data with possibly different offset
* and / or width
* @ param offset
* @ param width
* @ return */
public SimpleArrayGrid view ( int offset , int width ) { } } | return new SimpleArrayGrid ( array , width , height , this . offset + offset , length , boxed ) ; |
public class XmlUtils { /** * Escapes the characters in a < code > String < / code > . < / p >
* For example , if you have called addEntity ( & quot ; foo & quot ; , 0xA1 ) , escape ( & quot ; \ u00A1 & quot ; ) will return
* & quot ; & amp ; foo ; & quot ; < / p >
* @ param str The < code > String < / code > to escape .
* @ return A new escaped < code > String < / code > . */
public static String escape ( String str ) { } } | StringBuffer buf = new StringBuffer ( str . length ( ) * 2 ) ; int i ; for ( i = 0 ; i < str . length ( ) ; ++ i ) { char ch = str . charAt ( i ) ; String entityName = SPECIAL_CHARS_NAMES_ARRAY . get ( ( int ) ch ) ; if ( entityName == null ) { if ( ch > 0x7F ) { int intValue = ch ; buf . append ( "&#" ) ; buf . append ( intValue ) ; buf . append ( ';' ) ; } else { buf . append ( ch ) ; } } else { buf . append ( '&' ) ; buf . append ( entityName ) ; buf . append ( ';' ) ; } } return buf . toString ( ) ; |
public class MetadataFinder { /** * Get the metadata cache files that are currently configured to be automatically attached when matching media is
* mounted in a player on the network .
* @ return the current auto - attache cache files , sorted by name */
public List < File > getAutoAttachCacheFiles ( ) { } } | ArrayList < File > currentFiles = new ArrayList < File > ( autoAttachCacheFiles ) ; Collections . sort ( currentFiles , new Comparator < File > ( ) { @ Override public int compare ( File o1 , File o2 ) { return o1 . getName ( ) . compareTo ( o2 . getName ( ) ) ; } } ) ; return Collections . unmodifiableList ( currentFiles ) ; |
public class TransparentReplicaGetHelper { /** * Asynchronously fetch the document from the primary and if that operations fails try
* all the replicas and return the first document that comes back from them ( using the
* environments KV timeout for both primary and replica ) .
* @ param id the document ID to fetch .
* @ param bucket the bucket to use when fetching the doc .
* @ return an { @ link Single } with either 0 or 1 { @ link JsonDocument } . */
@ InterfaceStability . Experimental @ InterfaceAudience . Public public Single < JsonDocument > getFirstPrimaryOrReplica ( final String id , final Bucket bucket ) { } } | return getFirstPrimaryOrReplica ( id , bucket , bucket . environment ( ) . kvTimeout ( ) ) ; |
public class SpringApplication { /** * Set additional sources that will be used to create an ApplicationContext . A source
* can be : a class name , package name , or an XML resource location .
* Sources set here will be used in addition to any primary sources set in the
* constructor .
* @ param sources the application sources to set
* @ see # SpringApplication ( Class . . . )
* @ see # getAllSources ( ) */
public void setSources ( Set < String > sources ) { } } | Assert . notNull ( sources , "Sources must not be null" ) ; this . sources = new LinkedHashSet < > ( sources ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public PGPConstant createPGPConstantFromString ( EDataType eDataType , String initialValue ) { } } | PGPConstant result = PGPConstant . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class BackingStoreUtil { /** * Parses the String value as a primitive or a String , depending on its type .
* @ param clazz the destination type
* @ param value the value to parse
* @ return the parsed value
* @ throws Exception */
public static Object readPrimitive ( Class < ? > clazz , String value ) throws Exception { } } | if ( clazz == String . class ) { return value ; } else if ( clazz == Long . class ) { return Long . parseLong ( value ) ; } else if ( clazz == Integer . class ) { return Integer . parseInt ( value ) ; } else if ( clazz == Double . class ) { return Double . parseDouble ( value ) ; } else if ( clazz == Boolean . class ) { return Boolean . parseBoolean ( value ) ; } else if ( clazz == Byte . class ) { return Byte . parseByte ( value ) ; } else if ( clazz == Short . class ) { return Short . parseShort ( value ) ; } else if ( clazz == Float . class ) { return Float . parseFloat ( value ) ; } else { throw new Exception ( "Unsupported primitive: " + clazz ) ; // $ NON - NLS - 1 $
} |
public class BitConverter { /** * For binary fields , set the current state .
* Sets the target bit to the state .
* @ param state The state to set this field .
* @ param bDisplayOption Display changed fields if true .
* @ param iMoveMode The move mode .
* @ return The error code ( or NORMAL _ RETURN ) . */
public int setState ( boolean bState , boolean bDisplayOption , int iMoveMode ) { } } | int iFieldValue = ( int ) this . getValue ( ) ; if ( ! m_bTrueIfMatch ) bState = ! bState ; // Do opposite operation
if ( bState ) iFieldValue |= ( 1 << m_iBitNumber ) ; // Set the bit
else iFieldValue &= ~ ( 1 << m_iBitNumber ) ; // Clear the bit
return this . setValue ( iFieldValue , bDisplayOption , iMoveMode ) ; |
public class MainProcessor { /** * Returns the < code > . class < / code > files to delete . As well the root - parameter as the rename ones
* are taken in consideration , so that the concerned files are not listed in the result .
* @ return the paths of the files in the jar - archive , including the < code > . class < / code > suffix */
private Set < String > getExcludes ( ) { } } | Set < String > result = new HashSet < String > ( ) ; for ( String exclude : kp . getExcludes ( ) ) { String name = exclude + ".class" ; String renamed = renames . get ( name ) ; result . add ( ( renamed != null ) ? renamed : name ) ; } return result ; |
public class PreferenceFragment { /** * Returns , whether icons should be shown next to items , depending on the app ' s settings , or
* not .
* @ return True , if icons should be shown next to items , false otherwise */
private boolean shouldItemIconsBeShown ( ) { } } | SharedPreferences sharedPreferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; String key = getString ( R . string . show_item_icons_preference_key ) ; boolean defaultValue = getResources ( ) . getBoolean ( R . bool . show_item_icons_preference_default_value ) ; return sharedPreferences . getBoolean ( key , defaultValue ) ; |
public class SqlQueryStatement { /** * Append Join for non SQL92 Syntax */
private void appendJoin ( StringBuffer where , StringBuffer buf , Join join ) { } } | buf . append ( "," ) ; appendTableWithJoins ( join . right , where , buf ) ; if ( where . length ( ) > 0 ) { where . append ( " AND " ) ; } join . appendJoinEqualities ( where ) ; |
public class ShapeAppearanceModel { /** * Sets the corner treatment for the top - right corner .
* @ param cornerFamily the family to use to create the corner treatment
* @ param cornerSize the size to use to create the corner treatment */
public void setTopRightCorner ( @ CornerFamily int cornerFamily , @ Dimension int cornerSize ) { } } | setTopRightCorner ( MaterialShapeUtils . createCornerTreatment ( cornerFamily , cornerSize ) ) ; |
public class OtpLocalNode { /** * Create an Erlang { @ link OtpErlangPort port } . Erlang ports are based upon
* some node specific information ; this method creates a port using the
* information in this node . Each call to this method produces a unique
* port . It may not be meaningful to create a port in a non - Erlang
* environment , but this method is provided for completeness .
* @ return an Erlang port . */
public synchronized OtpErlangPort createPort ( ) { } } | final OtpErlangPort p = new OtpErlangPort ( node , portCount , creation ) ; portCount ++ ; if ( portCount > 0xfffffff ) { /* 28 bits */
portCount = 0 ; } return p ; |
public class MockKeyChain { /** * Build and configure an in - memory { @ link KeyChain } .
* @ param name the name of the default identity to create
* @ return an in - memory { @ link KeyChain } configured with the name as the
* default identity
* @ throws SecurityException if failed to create mock identity */
public static KeyChain configure ( final Name name ) throws SecurityException { } } | PrivateKeyStorage keyStorage = new MemoryPrivateKeyStorage ( ) ; IdentityStorage identityStorage = new MemoryIdentityStorage ( ) ; KeyChain keyChain = new KeyChain ( new IdentityManager ( identityStorage , keyStorage ) , new SelfVerifyPolicyManager ( identityStorage ) ) ; // create keys , certs if necessary
if ( ! identityStorage . doesIdentityExist ( name ) ) { keyChain . createIdentityAndCertificate ( name ) ; } // set default identity
keyChain . getIdentityManager ( ) . setDefaultIdentity ( name ) ; return keyChain ; |
public class HttpChannelConfig { /** * Take the user input size variable and make sure it is inside
* the given range of min and max . If it is outside the range ,
* then set the value to the closest limit .
* @ param size
* @ param min
* @ param max
* @ return int */
private int rangeLimit ( int size , int min , int max ) { } } | if ( size < min ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Config: " + size + " too small" ) ; } return min ; } else if ( size > max ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Config: " + size + " too large" ) ; } return max ; } return size ; |
public class HListLens { /** * Focus on the tail of an { @ link HList } .
* @ param < Head > the head element type
* @ param < Tail > the tail HList type
* @ return a lens that focuses on the tail of an HList */
public static < Head , Tail extends HList > Lens . Simple < HCons < Head , ? extends Tail > , Tail > tail ( ) { } } | return simpleLens ( HCons :: tail , ( hCons , newTail ) -> cons ( hCons . head ( ) , newTail ) ) ; |
public class ResetUserPasswordRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ResetUserPasswordRequest resetUserPasswordRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( resetUserPasswordRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resetUserPasswordRequest . getDirectoryId ( ) , DIRECTORYID_BINDING ) ; protocolMarshaller . marshall ( resetUserPasswordRequest . getUserName ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( resetUserPasswordRequest . getNewPassword ( ) , NEWPASSWORD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class FaxMediaReader { /** * Retrieve the previous page from the Twilio API .
* @ param page current page
* @ param client TwilioRestClient with which to make the request
* @ return Previous Page */
@ Override public Page < FaxMedia > previousPage ( final Page < FaxMedia > page , final TwilioRestClient client ) { } } | Request request = new Request ( HttpMethod . GET , page . getPreviousPageUrl ( Domains . FAX . toString ( ) , client . getRegion ( ) ) ) ; return pageForRequest ( client , request ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.