signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class OMVRBTree { /** * Returns the successor of the specified Entry , or null if no such . */
public static < K , V > OMVRBTreeEntry < K , V > successor ( final OMVRBTreeEntry < K , V > t ) { } }
|
if ( t == null ) return null ; OMVRBTreeEntry < K , V > p = null ; if ( t . getRight ( ) != null ) { p = t . getRight ( ) ; while ( p . getLeft ( ) != null ) p = p . getLeft ( ) ; } else { p = t . getParent ( ) ; OMVRBTreeEntry < K , V > ch = t ; while ( p != null && ch == p . getRight ( ) ) { ch = p ; p = p . getParent ( ) ; } } return p ;
|
class CountSubstrings { /** * Function to calculate the number of non - empty substrings in a given string .
* Args :
* s ( str ) : Input string
* Returns :
* int : Count of non - empty substrings
* Examples :
* > > > count _ substrings ( ' abc ' )
* > > > count _ substrings ( ' abcd ' )
* 10
* > > > count _ substrings ( ' abcde ' )
* 15 */
public static int countSubstrings ( String s ) { } }
|
int stringLength = s . length ( ) ; return ( stringLength * ( stringLength + 1 ) ) / 2 ;
|
public class CUstreamWaitValue_flags { /** * Returns the String identifying the given CUstreamWaitValue _ flags
* @ param n The CUstreamWaitValue _ flags
* @ return The String identifying the given CUstreamWaitValue _ flags */
public static String stringFor ( int n ) { } }
|
if ( n == 0 ) { return "CU_STREAM_WAIT_VALUE_GEQ" ; } String result = "" ; if ( ( n & CU_STREAM_WAIT_VALUE_EQ ) != 0 ) result += "CU_STREAM_WAIT_VALUE_EQ " ; if ( ( n & CU_STREAM_WAIT_VALUE_AND ) != 0 ) result += "CU_STREAM_WAIT_VALUE_AND " ; if ( ( n & CU_STREAM_WAIT_VALUE_NOR ) != 0 ) result += "CU_STREAM_WAIT_VALUE_NOR " ; if ( ( n & CU_STREAM_WAIT_VALUE_FLUSH ) != 0 ) result += "CU_STREAM_WAIT_VALUE_FLUSH " ; return result ;
|
public class MacroParametersUtils { /** * < p > extractParameter . < / p >
* @ param name a { @ link java . lang . String } object .
* @ param parameters a { @ link java . util . Map } object .
* @ return a { @ link java . lang . String } object . */
public static String extractParameter ( String name , Map parameters ) { } }
|
Object value = parameters . get ( name ) ; return ( value != null ) ? xssEscape ( value . toString ( ) ) : "" ;
|
public class ModelUtils { /** * Gets the value of a property .
* @ param holder a property holder ( not null )
* @ param propertyName a property name ( not null )
* @ return the property value , which can be null , or null if the property was not found */
public static String getPropertyValue ( AbstractBlockHolder holder , String propertyName ) { } }
|
BlockProperty p = holder . findPropertyBlockByName ( propertyName ) ; return p == null ? null : p . getValue ( ) ;
|
public class AWSGreengrassClient { /** * Lists the versions of a logger definition .
* @ param listLoggerDefinitionVersionsRequest
* @ return Result of the ListLoggerDefinitionVersions operation returned by the service .
* @ throws BadRequestException
* invalid request
* @ sample AWSGreengrass . ListLoggerDefinitionVersions
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / greengrass - 2017-06-07 / ListLoggerDefinitionVersions "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListLoggerDefinitionVersionsResult listLoggerDefinitionVersions ( ListLoggerDefinitionVersionsRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeListLoggerDefinitionVersions ( request ) ;
|
public class DefaultQueryLogEntryCreator { /** * Write elapsed time .
* < p > default : Time : 123,
* The unit of time is determined by underlying { @ link net . ttddyy . dsproxy . proxy . Stopwatch } implementation .
* ( milli vs nano seconds )
* @ param sb StringBuilder to write
* @ param execInfo execution info
* @ param queryInfoList query info list
* @ since 1.3.3 */
protected void writeTimeEntry ( StringBuilder sb , ExecutionInfo execInfo , List < QueryInfo > queryInfoList ) { } }
|
sb . append ( "Time:" ) ; sb . append ( execInfo . getElapsedTime ( ) ) ; sb . append ( ", " ) ;
|
public class ReflectionUtils { /** * Returns the field objects that are declared in the given class or any of
* it ' s super types that have any of the given modifiers . The type hierarchy
* is traversed upwards and all declared fields that match the given
* modifiers are added to the result array . The elements in the array are
* sorted by their names and declaring classes .
* @ param clazz The class within to look for the fields with the given
* modifiers
* @ param modifiers The OR - ed together modifiers that a field must match to be
* included into the result
* @ return The array of fields that match the modifiers and are within the
* type hierarchy of the given class */
public static Field [ ] getMatchingFields ( Class < ? > clazz , final int modifiers ) { } }
|
final Set < Field > fields = new TreeSet < Field > ( FIELD_NAME_AND_DECLARING_CLASS_COMPARATOR ) ; traverseHierarchy ( clazz , new TraverseTask < Field > ( ) { @ Override public Field run ( Class < ? > clazz ) { Field [ ] fieldArray = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fieldArray . length ; i ++ ) { if ( ( modifiers & fieldArray [ i ] . getModifiers ( ) ) != 0 ) { fields . add ( fieldArray [ i ] ) ; } } return null ; } } ) ; return fields . toArray ( new Field [ fields . size ( ) ] ) ;
|
public class LinkGenerator { /** * Writes int array into stream .
* @ param bytes int array
* @ param outStream stream
* @ throws IOException { @ link IOException } */
private void writeInts ( int [ ] bytes , OutputStream outStream ) throws IOException { } }
|
for ( int i = 0 ; i < bytes . length ; i ++ ) { byte curByte = ( byte ) bytes [ i ] ; outStream . write ( curByte ) ; }
|
public class HashPartition { /** * Gets the number of memory segments used by this partition , which includes build side
* memory buffers and overflow memory segments .
* @ return The number of occupied memory segments . */
public int getNumOccupiedMemorySegments ( ) { } }
|
// either the number of memory segments , or one for spilling
final int numPartitionBuffers = this . partitionBuffers != null ? this . partitionBuffers . length : this . buildSideWriteBuffer . getNumOccupiedMemorySegments ( ) ; return numPartitionBuffers + numOverflowSegments ;
|
public class CachingOnlineUpdateUASparser { /** * This implementation uses a local properties file to keep the lastUpdate time and the local data file version */
@ Override protected synchronized void checkDataMaps ( ) throws IOException { } }
|
if ( lastUpdateCheck == 0 || lastUpdateCheck < System . currentTimeMillis ( ) - updateInterval ) { String versionOnServer = getVersionFromServer ( ) ; if ( currentVersion == null || versionOnServer . compareTo ( currentVersion ) > 0 ) { loadDataFromInternetAndSave ( ) ; loadDataFromFile ( getCacheFile ( ) ) ; currentVersion = versionOnServer ; prop . setProperty ( "currentVersion" , currentVersion ) ; } lastUpdateCheck = System . currentTimeMillis ( ) ; prop . setProperty ( "lastUpdateCheck" , Long . toString ( lastUpdateCheck ) ) ; saveProperties ( prop ) ; }
|
public class FaceListsImpl { /** * Retrieve a face list ' s information .
* @ param faceListId Id referencing a particular face list .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < FaceList > getAsync ( String faceListId , final ServiceCallback < FaceList > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( faceListId ) , serviceCallback ) ;
|
public class ApiClient { /** * Helper method to configure the OAuth accessCode / implicit flow parameters
* @ param clientId OAuth2 client ID
* @ param clientSecret OAuth2 client secret
* @ param redirectURI OAuth2 redirect uri */
public void configureAuthorizationFlow ( String clientId , String clientSecret , String redirectURI ) { } }
|
for ( Authentication auth : authentications . values ( ) ) { if ( auth instanceof OAuth ) { OAuth oauth = ( OAuth ) auth ; oauth . getTokenRequestBuilder ( ) . setClientId ( clientId ) . setClientSecret ( clientSecret ) . setRedirectURI ( redirectURI ) ; oauth . getAuthenticationRequestBuilder ( ) . setClientId ( clientId ) . setRedirectURI ( redirectURI ) ; return ; } }
|
public class TenantedAuthorizationFacetDefault { /** * Per { @ link # findApplicationUserNoCache ( String ) } , cached for the request using the { @ link QueryResultsCache } . */
protected ApplicationUser findApplicationUser ( final String userName ) { } }
|
return queryResultsCache . execute ( new Callable < ApplicationUser > ( ) { @ Override public ApplicationUser call ( ) throws Exception { return findApplicationUserNoCache ( userName ) ; } } , TenantedAuthorizationFacetDefault . class , "findApplicationUser" , userName ) ;
|
public class DataDecoder { /** * Decodes an encoded string from the given byte array .
* @ param src source of encoded data
* @ param srcOffset offset into encoded data
* @ param valueRef decoded string is stored in element 0 , which may be null
* @ return amount of bytes read from source
* @ throws CorruptEncodingException if source data is corrupt */
public static int decodeString ( byte [ ] src , int srcOffset , String [ ] valueRef ) throws CorruptEncodingException { } }
|
try { final int originalOffset = srcOffset ; int b = src [ srcOffset ++ ] & 0xff ; if ( b >= 0xf8 ) { valueRef [ 0 ] = null ; return 1 ; } int valueLength ; if ( b <= 0x7f ) { valueLength = b ; } else if ( b <= 0xbf ) { valueLength = ( ( b & 0x3f ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; } else if ( b <= 0xdf ) { valueLength = ( ( b & 0x1f ) << 16 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; } else if ( b <= 0xef ) { valueLength = ( ( b & 0x0f ) << 24 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 16 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; } else { valueLength = ( ( src [ srcOffset ++ ] & 0xff ) << 24 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 16 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; } if ( valueLength == 0 ) { valueRef [ 0 ] = "" ; return srcOffset - originalOffset ; } char [ ] value ; try { value = new char [ valueLength ] ; } catch ( NegativeArraySizeException e ) { throw new CorruptEncodingException ( "Corrupt encoded string length (negative size): " + valueLength ) ; } catch ( OutOfMemoryError e ) { throw new CorruptEncodingException ( "Corrupt encoded string length (too large): " + valueLength , e ) ; } int valueOffset = 0 ; while ( valueOffset < valueLength ) { int c = src [ srcOffset ++ ] & 0xff ; switch ( c >> 5 ) { case 0 : case 1 : case 2 : case 3 : // 0xxxxx
value [ valueOffset ++ ] = ( char ) c ; break ; case 4 : case 5 : // 10xxxxx xxxxx
value [ valueOffset ++ ] = ( char ) ( ( ( c & 0x3f ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ) ; break ; case 6 : // 110xxxxx xxxxx xxxxx
c = ( ( c & 0x1f ) << 16 ) | ( ( src [ srcOffset ++ ] & 0xff ) << 8 ) | ( src [ srcOffset ++ ] & 0xff ) ; if ( c >= 0x10000 ) { // Split into surrogate pair .
c -= 0x10000 ; value [ valueOffset ++ ] = ( char ) ( 0xd800 | ( ( c >> 10 ) & 0x3ff ) ) ; value [ valueOffset ++ ] = ( char ) ( 0xdc00 | ( c & 0x3ff ) ) ; } else { value [ valueOffset ++ ] = ( char ) c ; } break ; default : // 111xxxxx
// Illegal .
throw new CorruptEncodingException ( "Corrupt encoded string data (source offset = " + ( srcOffset - 1 ) + ')' ) ; } } valueRef [ 0 ] = new String ( value ) ; return srcOffset - originalOffset ; } catch ( IndexOutOfBoundsException e ) { throw new CorruptEncodingException ( null , e ) ; }
|
public class ProposalLineItemServiceLocator { /** * For the given interface , get the stub implementation .
* If this service has no port for the given interface ,
* then ServiceException is thrown . */
public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
|
try { if ( com . google . api . ads . admanager . axis . v201808 . ProposalLineItemServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201808 . ProposalLineItemServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201808 . ProposalLineItemServiceSoapBindingStub ( new java . net . URL ( ProposalLineItemServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getProposalLineItemServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
|
public class ST_ClosestCoordinate { /** * Computes the closest coordinate ( s ) contained in the given geometry starting
* from the given point , using the 2D distance .
* @ param point Point
* @ param geom Geometry
* @ return The closest coordinate ( s ) contained in the given geometry starting from
* the given point , using the 2D distance */
public static Geometry getFurthestCoordinate ( Point point , Geometry geom ) { } }
|
if ( point == null || geom == null ) { return null ; } double minDistance = Double . POSITIVE_INFINITY ; Coordinate pointCoordinate = point . getCoordinate ( ) ; Set < Coordinate > closestCoordinates = new HashSet < Coordinate > ( ) ; for ( Coordinate c : geom . getCoordinates ( ) ) { double distance = c . distance ( pointCoordinate ) ; if ( Double . compare ( distance , minDistance ) == 0 ) { closestCoordinates . add ( c ) ; } if ( Double . compare ( distance , minDistance ) < 0 ) { minDistance = distance ; closestCoordinates . clear ( ) ; closestCoordinates . add ( c ) ; } } if ( closestCoordinates . size ( ) == 1 ) { return GEOMETRY_FACTORY . createPoint ( closestCoordinates . iterator ( ) . next ( ) ) ; } return GEOMETRY_FACTORY . createMultiPoint ( closestCoordinates . toArray ( new Coordinate [ 0 ] ) ) ;
|
public class PyGenerator { /** * Generate the given object .
* @ param clazz the class .
* @ param it the target for the generated content .
* @ param context the context . */
protected void _generate ( SarlClass clazz , PyAppendable it , IExtraLanguageGeneratorContext context ) { } }
|
generateTypeDeclaration ( this . qualifiedNameProvider . getFullyQualifiedName ( clazz ) . toString ( ) , clazz . getName ( ) , clazz . isAbstract ( ) , getSuperTypes ( clazz . getExtends ( ) , clazz . getImplements ( ) ) , getTypeBuilder ( ) . getDocumentation ( clazz ) , true , clazz . getMembers ( ) , it , context , null ) ;
|
public class CBLVersion { /** * This is information about this library build . */
public static String getVersionInfo ( ) { } }
|
String info = versionInfo . get ( ) ; if ( info == null ) { info = String . format ( Locale . ENGLISH , VERSION_INFO , BuildConfig . VERSION_NAME , getLibInfo ( ) , BuildConfig . BUILD_TIME , BuildConfig . BUILD_HOST , getSysInfo ( ) ) ; versionInfo . compareAndSet ( null , info ) ; } return info ;
|
public class WebcamHelper { /** * Consume the java . awt . BufferedImage from the webcam , all params required .
* @ param image The image to process .
* @ param processor Processor that handles the exchange .
* @ param endpoint WebcamEndpoint receiving the exchange . */
public static void consumeBufferedImage ( BufferedImage image , Processor processor , WebcamEndpoint endpoint , ExceptionHandler exceptionHandler ) { } }
|
Validate . notNull ( image ) ; Validate . notNull ( processor ) ; Validate . notNull ( endpoint ) ; try { Exchange exchange = createOutOnlyExchangeWithBodyAndHeaders ( endpoint , image ) ; processor . process ( exchange ) ; } catch ( Exception e ) { exceptionHandler . handleException ( e ) ; }
|
public class ValidationSessionHolderImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . validationengine . ValidationSessionHolder # bind ( java . lang . Object ) */
@ Override public void bind ( Object context ) { } }
|
if ( m_validationEngine != null && context instanceof ValidationObject ) { m_validationSession = m_validationEngine . createSession ( ) ; m_validationSession . bind ( ( ValidationObject ) context ) ; }
|
public class AppServicePlansInner { /** * Get all apps that use a Hybrid Connection in an App Service Plan .
* Get all apps that use a Hybrid Connection in an App Service Plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param namespaceName Name of the Hybrid Connection namespace .
* @ param relayName Name of the Hybrid Connection relay .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the PagedList & lt ; String & gt ; object if successful . */
public PagedList < String > listWebAppsByHybridConnection ( final String resourceGroupName , final String name , final String namespaceName , final String relayName ) { } }
|
ServiceResponse < Page < String > > response = listWebAppsByHybridConnectionSinglePageAsync ( resourceGroupName , name , namespaceName , relayName ) . toBlocking ( ) . single ( ) ; return new PagedList < String > ( response . body ( ) ) { @ Override public Page < String > nextPage ( String nextPageLink ) { return listWebAppsByHybridConnectionNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
|
public class MappeableArrayContainer { /** * for use in inot range known to be nonempty */
private void negateRange ( final ShortBuffer buffer , final int startIndex , final int lastIndex , final int startRange , final int lastRange ) { } }
|
// compute the negation into buffer
int outPos = 0 ; int inPos = startIndex ; // value here always > = valInRange ,
// until it is exhausted
// n . b . , we can start initially exhausted .
int valInRange = startRange ; for ( ; valInRange < lastRange && inPos <= lastIndex ; ++ valInRange ) { if ( ( short ) valInRange != content . get ( inPos ) ) { buffer . put ( outPos ++ , ( short ) valInRange ) ; } else { ++ inPos ; } } // if there are extra items ( greater than the biggest
// pre - existing one in range ) , buffer them
for ( ; valInRange < lastRange ; ++ valInRange ) { buffer . put ( outPos ++ , ( short ) valInRange ) ; } if ( outPos != buffer . limit ( ) ) { throw new RuntimeException ( "negateRange: outPos " + outPos + " whereas buffer.length=" + buffer . limit ( ) ) ; } assert outPos == buffer . limit ( ) ; // copy back from buffer . . . caller must ensure there is room
int i = startIndex ; int len = buffer . limit ( ) ; for ( int k = 0 ; k < len ; ++ k ) { final short item = buffer . get ( k ) ; content . put ( i ++ , item ) ; }
|
public class VariableAssigner { /** * { @ inheritDoc } */
@ Override public void assign ( final ICmdLineArg < ? > arg , final Object target ) throws ParseException { } }
|
if ( arg == null ) return ; if ( target == null ) return ; final String errMsg = "expected: " + arg . getValue ( ) . getClass ( ) . getName ( ) + " " + arg . getVariable ( ) + " on " + target . getClass ( ) . getName ( ) ; final Field field = findFieldInAnyParentOrMyself ( arg , target . getClass ( ) , errMsg ) ; assign ( field , arg , target ) ;
|
public class InstanceEntryMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InstanceEntry instanceEntry , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( instanceEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceEntry . getSourceName ( ) , SOURCENAME_BINDING ) ; protocolMarshaller . marshall ( instanceEntry . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMarshaller . marshall ( instanceEntry . getPortInfoSource ( ) , PORTINFOSOURCE_BINDING ) ; protocolMarshaller . marshall ( instanceEntry . getUserData ( ) , USERDATA_BINDING ) ; protocolMarshaller . marshall ( instanceEntry . getAvailabilityZone ( ) , AVAILABILITYZONE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class StorageAccountCredentialsInner { /** * Creates or updates the storage account credential .
* @ param deviceName The device name .
* @ param name The storage account credential name .
* @ param resourceGroupName The resource group name .
* @ param storageAccountCredential The storage account credential .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < StorageAccountCredentialInner > createOrUpdateAsync ( String deviceName , String name , String resourceGroupName , StorageAccountCredentialInner storageAccountCredential ) { } }
|
return createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , storageAccountCredential ) . map ( new Func1 < ServiceResponse < StorageAccountCredentialInner > , StorageAccountCredentialInner > ( ) { @ Override public StorageAccountCredentialInner call ( ServiceResponse < StorageAccountCredentialInner > response ) { return response . body ( ) ; } } ) ;
|
public class TwoDropDownChoicesPanel { /** * Factory method for creating the new child { @ link DropDownChoice } . This
* method is invoked in the constructor from the derived classes and can be
* overridden so users can provide their own version of a new child
* { @ link DropDownChoice } .
* @ param id
* the id
* @ param model
* the model
* @ param choices
* the choices
* @ param renderer
* the renderer
* @ return the new child { @ link DropDownChoice } . */
protected DropDownChoice < T > newChildChoice ( final String id , final IModel < T > model , final IModel < ? extends List < ? extends T > > choices , final IChoiceRenderer < ? super T > renderer ) { } }
|
final DropDownChoice < T > cc = new LocalisedDropDownChoice < > ( id , model , choices , renderer ) ; cc . setOutputMarkupId ( true ) ; return cc ;
|
public class Provider { /** * Returns an unmodifiable Set view of the property entries contained
* in this Provider .
* @ see java . util . Map . Entry
* @ since 1.2 */
public synchronized Set < Map . Entry < Object , Object > > entrySet ( ) { } }
|
checkInitialized ( ) ; if ( entrySet == null ) { if ( entrySetCallCount ++ == 0 ) // Initial call
entrySet = Collections . unmodifiableMap ( this ) . entrySet ( ) ; else return super . entrySet ( ) ; // Recursive call
} // This exception will be thrown if the implementation of
// Collections . unmodifiableMap . entrySet ( ) is changed such that it
// no longer calls entrySet ( ) on the backing Map . ( Provider ' s
// entrySet implementation depends on this " implementation detail " ,
// which is unlikely to change .
if ( entrySetCallCount != 2 ) throw new RuntimeException ( "Internal error." ) ; return entrySet ;
|
public class PrintWriter { /** * Closes the stream and releases any system resources associated
* with it . Closing a previously closed stream has no effect .
* @ see # checkError ( ) */
public void close ( ) { } }
|
try { synchronized ( lock ) { if ( out == null ) return ; out . close ( ) ; out = null ; } } catch ( IOException x ) { trouble = true ; }
|
public class NetworkServiceDescriptorAgent { /** * Update a specific VirtualNetworkFunctionDescriptor that is contained in a particular
* NetworkServiceDescriptor .
* @ param idNSD the ID of the NetworkServiceRecord containing the VirtualNetworkFunctionDescriptor
* @ param idVfn the ID of the VNF Descriptor that shall be updated
* @ param virtualNetworkFunctionDescriptor the updated version of the
* VirtualNetworkFunctionDescriptor
* @ return the updated VirtualNetworkFunctionDescriptor
* @ throws SDKException if the request fails */
@ Help ( help = "Update the VirtualNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id" ) @ Deprecated public VirtualNetworkFunctionDescriptor updateVNFD ( final String idNSD , final String idVfn , final VirtualNetworkFunctionDescriptor virtualNetworkFunctionDescriptor ) throws SDKException { } }
|
String url = idNSD + "/vnfdescriptors" + "/" + idVfn ; return ( VirtualNetworkFunctionDescriptor ) requestPut ( url , virtualNetworkFunctionDescriptor ) ;
|
public class HtmlDocletWriter { /** * Get the link for the given member .
* @ param context the id of the context where the link will be added
* @ param element the member being linked to
* @ param label the label for the link
* @ return a content tree for the element link */
public Content getDocLink ( LinkInfoImpl . Kind context , Element element , CharSequence label ) { } }
|
return getDocLink ( context , utils . getEnclosingTypeElement ( element ) , element , new StringContent ( label ) ) ;
|
public class PeriodFormatterBuilder { /** * Append a separator , which is output if fields are printed both before
* and after the separator .
* This method changes the separator depending on whether it is the last separator
* to be output .
* For example , < code > builder . appendDays ( ) . appendSeparator ( " , " , " & " ) . appendHours ( ) . appendSeparator ( " , " , " & " ) . appendMinutes ( ) < / code >
* will output ' 1,2&3 ' if all three fields are output , ' 1&2 ' if two fields are output
* and ' 1 ' if just one field is output .
* The text will be parsed case - insensitively .
* Note : appending a separator discontinues any further work on the latest
* appended field .
* @ param text the text to use as a separator
* @ param finalText the text used used if this is the final separator to be printed
* @ return this PeriodFormatterBuilder
* @ throws IllegalStateException if this separator follows a previous one */
public PeriodFormatterBuilder appendSeparator ( String text , String finalText ) { } }
|
return appendSeparator ( text , finalText , null , true , true ) ;
|
public class InsightResultsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InsightResults insightResults , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( insightResults == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( insightResults . getInsightArn ( ) , INSIGHTARN_BINDING ) ; protocolMarshaller . marshall ( insightResults . getGroupByAttribute ( ) , GROUPBYATTRIBUTE_BINDING ) ; protocolMarshaller . marshall ( insightResults . getResultValues ( ) , RESULTVALUES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class JedisRedisClient { /** * { @ inheritDoc } */
@ Override public Set < String > setMembers ( String setName ) { } }
|
Set < String > result = redisClient . smembers ( setName ) ; return result != null ? result : new HashSet < String > ( ) ;
|
public class ByteUtil { /** * Converts from ByteSequence to Bytes . If the ByteSequence has a backing array , that array ( and
* the buffer ' s offset and limit ) are used . Otherwise , a new backing array is created .
* @ param bs ByteSequence
* @ return Bytes object */
public static Bytes toBytes ( ByteSequence bs ) { } }
|
if ( bs . length ( ) == 0 ) { return Bytes . EMPTY ; } if ( bs . isBackedByArray ( ) ) { return Bytes . of ( bs . getBackingArray ( ) , bs . offset ( ) , bs . length ( ) ) ; } else { return Bytes . of ( bs . toArray ( ) , 0 , bs . length ( ) ) ; }
|
public class BundleAdjustmentProjectiveResidualFunction { /** * projection from 3D coordinates */
private void project3 ( double [ ] output ) { } }
|
int observationIndex = 0 ; for ( int viewIndex = 0 ; viewIndex < structure . views . length ; viewIndex ++ ) { SceneStructureProjective . View view = structure . views [ viewIndex ] ; SceneObservations . View obsView = observations . views [ viewIndex ] ; for ( int i = 0 ; i < obsView . size ( ) ; i ++ ) { obsView . get ( i , observedPixel ) ; SceneStructureMetric . Point worldPt = structure . points [ observedPixel . index ] ; worldPt . get ( p3 ) ; PerspectiveOps . renderPixel ( view . worldToView , p3 , predictedPixel ) ; int outputIndex = observationIndex * 2 ; output [ outputIndex ] = predictedPixel . x - observedPixel . x ; output [ outputIndex + 1 ] = predictedPixel . y - observedPixel . y ; observationIndex ++ ; } }
|
public class ModelSqlUtils { /** * 获取属性的getter方法
* @ param clazz
* @ param f
* @ return */
private static < T > Method getGetter ( Class < T > clazz , Field f ) { } }
|
String getterName = "get" + StringUtils . capitalize ( f . getName ( ) ) ; Method getter = null ; try { getter = clazz . getMethod ( getterName ) ; } catch ( Exception e ) { logger . debug ( getterName + " doesn't exist!" , e ) ; } return getter ;
|
public class MpJwtAppSetupUtils { public void deployMicroProfileApp ( LibertyServer server ) throws Exception { } }
|
List < String > classList = createAppClassList ( "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.ApplicationScoped.Instance.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.NotScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.RequestScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjection.SessionScoped.Instance.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjectionAllTypesMicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.ClaimInjectionInstanceMicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.CommonMicroProfileMarker" , "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.ApplicationScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.NotScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.RequestScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.Injection.SessionScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.JsonWebTokenInjectionMicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.ApplicationScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.NotScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.RequestScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContext.SessionScoped.MicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.SecurityContextMicroProfileApp" , "com.ibm.ws.jaxrs.fat.microProfileApp.Utils" ) ; ShrinkHelper . exportAppToServer ( server , genericCreateArchiveWithJsps ( MpJwtFatConstants . MICROPROFILE_SERVLET , classList ) ) ; server . addInstalledAppForValidation ( MpJwtFatConstants . MICROPROFILE_SERVLET ) ;
|
public class ActionSyncTask { /** * Run to doing something */
@ Override public void run ( ) { } }
|
if ( ! mDone ) { synchronized ( this ) { if ( ! mDone ) { call ( ) ; mDone = true ; try { this . notifyAll ( ) ; } catch ( Exception ignored ) { } } } }
|
public class CmdMethod { /** * Returns a single line description of the command */
@ Override public String getUsage ( ) { } }
|
String commandName = name ; Class < ? > declaringClass = method . getDeclaringClass ( ) ; Map < String , Cmd > commands = Commands . get ( declaringClass ) ; if ( commands . size ( ) == 1 && commands . values ( ) . iterator ( ) . next ( ) instanceof CmdGroup ) { final CmdGroup cmdGroup = ( CmdGroup ) commands . values ( ) . iterator ( ) . next ( ) ; commandName = cmdGroup . getName ( ) + " " + name ; } final String usage = usage ( ) ; if ( usage != null ) { if ( ! usage . startsWith ( commandName ) ) { return commandName + " " + usage ; } else { return usage ; } } final List < Object > args = new ArrayList < > ( ) ; for ( final Param parameter : spec . arguments ) { boolean skip = Environment . class . isAssignableFrom ( parameter . getType ( ) ) ; for ( final Annotation a : parameter . getAnnotations ( ) ) { final CrestAnnotation crestAnnotation = a . annotationType ( ) . getAnnotation ( CrestAnnotation . class ) ; if ( crestAnnotation != null ) { skip = crestAnnotation . skipUsage ( ) ; break ; } } if ( ! skip ) { skip = parameter . getAnnotation ( NotAService . class ) == null && Environment . ENVIRONMENT_THREAD_LOCAL . get ( ) . findService ( parameter . getType ( ) ) != null ; } if ( skip ) { continue ; } args . add ( parameter . getDisplayType ( ) . replace ( "[]" , "..." ) ) ; } return String . format ( "%s %s %s" , commandName , args . size ( ) == method . getParameterTypes ( ) . length ? "" : "[options]" , Join . join ( " " , args ) ) . trim ( ) ;
|
public class BitmapContainer { /** * Find the index of the next set bit greater or equal to i , returns - 1 if none found .
* @ param i starting index
* @ return index of the next set bit */
public int nextSetBit ( final int i ) { } }
|
int x = i >> 6 ; long w = bitmap [ x ] ; w >>>= i ; if ( w != 0 ) { return i + numberOfTrailingZeros ( w ) ; } for ( ++ x ; x < bitmap . length ; ++ x ) { if ( bitmap [ x ] != 0 ) { return x * 64 + numberOfTrailingZeros ( bitmap [ x ] ) ; } } return - 1 ;
|
public class ApplicationSecurityGroupsInner { /** * Gets information about the specified application security group .
* @ param resourceGroupName The name of the resource group .
* @ param applicationSecurityGroupName The name of the application security group .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < ApplicationSecurityGroupInner > getByResourceGroupAsync ( String resourceGroupName , String applicationSecurityGroupName , final ServiceCallback < ApplicationSecurityGroupInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , applicationSecurityGroupName ) , serviceCallback ) ;
|
public class RegistrationRequest { /** * Create an object from a registration request formatted as a json string . */
public static RegistrationRequest fromJson ( Map < String , Object > raw ) throws JsonException { } }
|
// If we could , we ' d just get Json to coerce this for us , but that would lead to endless
// recursion as the first thing it would do would be to call this very method . * sigh *
Json json = new Json ( ) ; RegistrationRequest request = new RegistrationRequest ( ) ; if ( raw . get ( "name" ) instanceof String ) { request . name = ( String ) raw . get ( "name" ) ; } if ( raw . get ( "description" ) instanceof String ) { request . description = ( String ) raw . get ( "description" ) ; } if ( raw . get ( "configuration" ) instanceof Map ) { // This is nasty . Look away now !
String converted = json . toJson ( raw . get ( "configuration" ) ) ; request . configuration = GridConfiguredJson . toType ( converted , GridNodeConfiguration . class ) ; } if ( raw . get ( "configuration" ) instanceof GridNodeConfiguration ) { request . configuration = ( GridNodeConfiguration ) raw . get ( "configuration" ) ; } return request ;
|
public class DocletInvoker { /** * Return the language version supported by this doclet .
* If the method does not exist in the doclet , assume version 1.1. */
public LanguageVersion languageVersion ( ) { } }
|
try { Object retVal ; String methodName = "languageVersion" ; Class < ? > [ ] paramTypes = new Class < ? > [ 0 ] ; Object [ ] params = new Object [ 0 ] ; try { retVal = invoke ( methodName , JAVA_1_1 , paramTypes , params ) ; } catch ( DocletInvokeException exc ) { return JAVA_1_1 ; } if ( retVal instanceof LanguageVersion ) { return ( LanguageVersion ) retVal ; } else { messager . error ( Messager . NOPOS , "main.must_return_languageversion" , docletClassName , methodName ) ; return JAVA_1_1 ; } } catch ( NoClassDefFoundError ex ) { // for boostrapping , no Enum class .
return null ; }
|
public class HttpBasicAuthCredentials { /** * Gets the encoded representation of the basic authentication credentials
* for use in an HTTP Authorization header .
* @ return String */
public String getHeader ( ) { } }
|
String authPair = username + ':' + apiKey ; return "Basic " + Base64 . getEncoder ( ) . encodeToString ( authPair . getBytes ( ) ) ;
|
public class AmazonIdentityManagementClient { /** * Sets the status of a service - specific credential to < code > Active < / code > or < code > Inactive < / code > .
* Service - specific credentials that are inactive cannot be used for authentication to the service . This operation
* can be used to disable a user ' s service - specific credential as part of a credential rotation work flow .
* @ param updateServiceSpecificCredentialRequest
* @ return Result of the UpdateServiceSpecificCredential operation returned by the service .
* @ throws NoSuchEntityException
* The request was rejected because it referenced a resource entity that does not exist . The error message
* describes the resource .
* @ sample AmazonIdentityManagement . UpdateServiceSpecificCredential
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / UpdateServiceSpecificCredential "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public UpdateServiceSpecificCredentialResult updateServiceSpecificCredential ( UpdateServiceSpecificCredentialRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateServiceSpecificCredential ( request ) ;
|
public class Ray2 { /** * Returns the parameter of the ray when it intersects the supplied point , or
* { @ link Float # MAX _ VALUE } if there is no such intersection . */
protected double getIntersection ( IVector pt ) { } }
|
if ( Math . abs ( direction . x ) > Math . abs ( direction . y ) ) { double t = ( pt . x ( ) - origin . x ) / direction . x ; return ( t >= 0f && origin . y + t * direction . y == pt . y ( ) ) ? t : Float . MAX_VALUE ; } else { double t = ( pt . y ( ) - origin . y ) / direction . y ; return ( t >= 0f && origin . x + t * direction . x == pt . x ( ) ) ? t : Float . MAX_VALUE ; }
|
public class Train { /** * save the embedded training set */
private File saveExampleSet ( ExampleSet outputSet , ZipModel model ) throws IOException { } }
|
logger . info ( "save the embedded training set" ) ; File tmp = File . createTempFile ( "train" , null ) ; tmp . deleteOnExit ( ) ; // File tmp = new File ( " examples / train " ) ;
BufferedWriter out = new BufferedWriter ( new FileWriter ( tmp ) ) ; outputSet . write ( out ) ; out . close ( ) ; // add the example set to the model
model . add ( tmp , "train" ) ; return tmp ;
|
public class ExecutionEnvironment { /** * - - - - - File Input Format - - - - - */
public < X > DataSource < X > readFile ( FileInputFormat < X > inputFormat , String filePath ) { } }
|
if ( inputFormat == null ) { throw new IllegalArgumentException ( "InputFormat must not be null." ) ; } if ( filePath == null ) { throw new IllegalArgumentException ( "The file path must not be null." ) ; } inputFormat . setFilePath ( new Path ( filePath ) ) ; try { return createInput ( inputFormat , TypeExtractor . getInputFormatTypes ( inputFormat ) ) ; } catch ( Exception e ) { throw new InvalidProgramException ( "The type returned by the input format could not be automatically determined. " + "Please specify the TypeInformation of the produced type explicitly by using the " + "'createInput(InputFormat, TypeInformation)' method instead." ) ; }
|
public class BaseProfile { /** * generate code
* @ param def Definition */
@ Override public void generate ( Definition def ) { } }
|
generatePackageInfo ( def , "main" , null ) ; generateRaCode ( def ) ; generateOutboundCode ( def ) ; generateInboundCode ( def ) ; generateTestCode ( def ) ; switch ( def . getBuild ( ) ) { case "ivy" : generateAntIvyXml ( def , def . getOutputDir ( ) ) ; break ; case "maven" : generateMavenXml ( def , def . getOutputDir ( ) ) ; break ; case "gradle" : generateGradle ( def , def . getOutputDir ( ) ) ; break ; default : generateAntXml ( def , def . getOutputDir ( ) ) ; break ; } generateRaXml ( def , def . getOutputDir ( ) ) ; if ( def . isSupportOutbound ( ) ) generateIronjacamarXml ( def , def . getOutputDir ( ) ) ; if ( def . isGenMbean ( ) && def . isSupportOutbound ( ) && ! def . getMcfDefs ( ) . get ( 0 ) . isUseCciConnection ( ) ) { generateMBeanCode ( def ) ; generateMbeanXml ( def , def . getOutputDir ( ) ) ; } if ( def . isSupportEis ( ) && def . isSupportOutbound ( ) && ! def . getMcfDefs ( ) . get ( 0 ) . isUseCciConnection ( ) ) { generateEisCode ( def ) ; }
|
public class PrintView { /** * Creates an application - modal dialog and shows it after adding the print
* view to it .
* @ param owner
* the owner window of the dialog */
public void show ( Window owner ) { } }
|
InvalidationListener viewTypeListener = obs -> loadDropDownValues ( getDate ( ) ) ; if ( dialog != null ) { dialog . show ( ) ; } else { TimeRangeView timeRange = getSettingsView ( ) . getTimeRangeView ( ) ; Scene scene = new Scene ( this ) ; dialog = new Stage ( ) ; dialog . initOwner ( owner ) ; dialog . setScene ( scene ) ; dialog . sizeToScene ( ) ; dialog . centerOnScreen ( ) ; dialog . setTitle ( Messages . getString ( "PrintView.TITLE_LABEL" ) ) ; dialog . initModality ( Modality . APPLICATION_MODAL ) ; if ( getPrintIcon ( ) != null ) dialog . getIcons ( ) . add ( getPrintIcon ( ) ) ; dialog . setOnHidden ( obs -> { timeRange . cleanOldValues ( ) ; timeRange . viewTypeProperty ( ) . removeListener ( viewTypeListener ) ; } ) ; dialog . setOnShown ( obs -> timeRange . viewTypeProperty ( ) . addListener ( viewTypeListener ) ) ; dialog . show ( ) ; }
|
public class Vector { /** * Gets the angle between this vector and another in radians .
* @ param other The other vector
* @ return angle in radians */
public float angle ( Vector other ) { } }
|
double dot = dot ( other ) / ( length ( ) * other . length ( ) ) ; return ( float ) Math . acos ( dot ) ;
|
public class MetricInfo { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } }
|
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case METRICS : return is_set_metrics ( ) ; } throw new IllegalStateException ( ) ;
|
public class KeyValueAuthHandler { /** * Handles an incoming SASL list mechanisms response and dispatches the next SASL AUTH step .
* @ param ctx the handler context .
* @ param msg the incoming message to investigate .
* @ throws Exception if something goes wrong during negotiation . */
private void handleListMechsResponse ( ChannelHandlerContext ctx , FullBinaryMemcacheResponse msg ) throws Exception { } }
|
String remote = ctx . channel ( ) . remoteAddress ( ) . toString ( ) ; String [ ] supportedMechanisms = msg . content ( ) . toString ( CharsetUtil . UTF_8 ) . split ( " " ) ; if ( supportedMechanisms . length == 0 ) { throw new AuthenticationException ( "Received empty SASL mechanisms list from server: " + remote ) ; } if ( forceSaslPlain ) { LOGGER . trace ( "Got SASL Mechs {} but forcing PLAIN due to config setting." , Arrays . asList ( supportedMechanisms ) ) ; supportedMechanisms = new String [ ] { "PLAIN" } ; } saslClient = Sasl . createSaslClient ( supportedMechanisms , null , "couchbase" , remote , null , this ) ; selectedMechanism = saslClient . getMechanismName ( ) ; int mechanismLength = selectedMechanism . length ( ) ; byte [ ] bytePayload = saslClient . hasInitialResponse ( ) ? saslClient . evaluateChallenge ( new byte [ ] { } ) : null ; ByteBuf payload = bytePayload != null ? ctx . alloc ( ) . buffer ( ) . writeBytes ( bytePayload ) : Unpooled . EMPTY_BUFFER ; FullBinaryMemcacheRequest initialRequest = new DefaultFullBinaryMemcacheRequest ( selectedMechanism . getBytes ( CharsetUtil . UTF_8 ) , Unpooled . EMPTY_BUFFER , payload ) ; initialRequest . setOpcode ( SASL_AUTH_OPCODE ) . setKeyLength ( ( short ) mechanismLength ) . setTotalBodyLength ( mechanismLength + payload . readableBytes ( ) ) ; ChannelFuture future = ctx . writeAndFlush ( initialRequest ) ; future . addListener ( new GenericFutureListener < Future < Void > > ( ) { @ Override public void operationComplete ( Future < Void > future ) throws Exception { if ( ! future . isSuccess ( ) ) { LOGGER . warn ( "Error during SASL Auth negotiation phase." , future ) ; } } } ) ;
|
public class ElemLiteralResult { /** * Get a literal result attribute by name .
* @ param namespaceURI Namespace URI of attribute node to get
* @ param localName Local part of qualified name of attribute node to get
* @ return literal result attribute ( AVT ) */
public AVT getLiteralResultAttributeNS ( String namespaceURI , String localName ) { } }
|
if ( null != m_avts ) { int nAttrs = m_avts . size ( ) ; for ( int i = ( nAttrs - 1 ) ; i >= 0 ; i -- ) { AVT avt = ( AVT ) m_avts . get ( i ) ; if ( avt . getName ( ) . equals ( localName ) && avt . getURI ( ) . equals ( namespaceURI ) ) { return avt ; } } // end for
} return null ;
|
public class StringMan { /** * Returns the specified string value if input is null , otherwise returns the original input
* string untouched .
* @ param input
* String to be evaluated
* @ param value
* String to substitute if input is null */
public static String getNullAsValue ( String input , String value ) { } }
|
return ( input == null ) ? value : input ;
|
public class ApiConnectionImpl { /** * Create a new API connection to the give device on the supplied port
* @ param fact The socket factory used to construct the connection socket .
* @ param host The host to which to connect .
* @ param port The TCP port to use .
* @ param timeOut The connection timeout
* @ return The ApiConnection
* @ throws me . legrange . mikrotik . ApiConnectionException Thrown if there is a
* problem connecting */
public static ApiConnection connect ( SocketFactory fact , String host , int port , int timeOut ) throws ApiConnectionException { } }
|
ApiConnectionImpl con = new ApiConnectionImpl ( ) ; con . open ( host , port , fact , timeOut ) ; return con ;
|
public class Point3dfx { /** * Convert the given tuple to a real Point3dfx .
* < p > If the given tuple is already a Point3dfx , it is replied .
* @ param tuple the tuple .
* @ return the Point3dfx .
* @ since 14.0 */
public static Point3dfx convert ( Tuple3D < ? > tuple ) { } }
|
if ( tuple instanceof Point3dfx ) { return ( Point3dfx ) tuple ; } return new Point3dfx ( tuple . getX ( ) , tuple . getY ( ) , tuple . getZ ( ) ) ;
|
public class Streams { /** * Create a CompletableFuture containing a List materialized from a Stream
* @ param stream To convert into an Optional
* @ return CompletableFuture with a List of values */
public final static < T > CompletableFuture < List < T > > streamToCompletableFuture ( final Stream < T > stream ) { } }
|
return CompletableFuture . completedFuture ( stream . collect ( Collectors . toList ( ) ) ) ;
|
public class ValidationUtils { /** * Returns all validation constraints that are defined by Java annotation in the core classes .
* @ return a map of all core types to all core annotated constraints . See JSR - 303. */
public static Map < String , Map < String , Map < String , Map < String , ? > > > > getCoreValidationConstraints ( ) { } }
|
if ( CORE_CONSTRAINTS . isEmpty ( ) ) { for ( Map . Entry < String , Class < ? extends ParaObject > > e : ParaObjectUtils . getCoreClassesMap ( ) . entrySet ( ) ) { String type = e . getKey ( ) ; List < Field > fieldlist = Utils . getAllDeclaredFields ( e . getValue ( ) ) ; for ( Field field : fieldlist ) { Annotation [ ] annos = field . getAnnotations ( ) ; if ( annos . length > 1 ) { Map < String , Map < String , ? > > constrMap = new HashMap < > ( ) ; for ( Annotation anno : annos ) { if ( isValidConstraintType ( anno . annotationType ( ) ) ) { Constraint c = fromAnnotation ( anno ) ; if ( c != null ) { constrMap . put ( c . getName ( ) , c . getPayload ( ) ) ; } } } if ( ! constrMap . isEmpty ( ) ) { if ( ! CORE_CONSTRAINTS . containsKey ( type ) ) { CORE_CONSTRAINTS . put ( type , new HashMap < > ( ) ) ; } CORE_CONSTRAINTS . get ( type ) . put ( field . getName ( ) , constrMap ) ; } } } } } return Collections . unmodifiableMap ( CORE_CONSTRAINTS ) ;
|
public class Utils { /** * Calculate the scaled residual
* < br > | | Ax - b | | _ oo / ( | | A | | _ oo . | | x | | _ oo + | | b | | _ oo ) , with
* < br > | | x | | _ oo = max ( | | x [ i ] | | ) */
public static double calculateScaledResidual ( DoubleMatrix2D A , DoubleMatrix1D x , DoubleMatrix1D b ) { } }
|
double residual = - Double . MAX_VALUE ; double nix = Algebra . DEFAULT . normInfinity ( x ) ; double nib = Algebra . DEFAULT . normInfinity ( b ) ; if ( Double . compare ( nix , 0. ) == 0 && Double . compare ( nib , 0. ) == 0 ) { return 0 ; } else { double num = Algebra . DEFAULT . normInfinity ( ColtUtils . zMult ( A , x , b , - 1 ) ) ; double den = Algebra . DEFAULT . normInfinity ( A ) * nix + nib ; residual = num / den ; // log . debug ( " scaled residual : " + residual ) ;
return residual ; }
|
public class CallOptions { /** * Returns a new { @ code CallOptions } with a { @ code ClientStreamTracerFactory } in addition to
* the existing factories .
* < p > This method doesn ' t replace existing factories , or try to de - duplicate factories . */
@ ExperimentalApi ( "https://github.com/grpc/grpc-java/issues/2861" ) public CallOptions withStreamTracerFactory ( ClientStreamTracer . Factory factory ) { } }
|
CallOptions newOptions = new CallOptions ( this ) ; ArrayList < ClientStreamTracer . Factory > newList = new ArrayList < > ( streamTracerFactories . size ( ) + 1 ) ; newList . addAll ( streamTracerFactories ) ; newList . add ( factory ) ; newOptions . streamTracerFactories = Collections . unmodifiableList ( newList ) ; return newOptions ;
|
public class nstimeout { /** * Use this API to unset the properties of nstimeout resource .
* Properties that need to be unset are specified in args array . */
public static base_response unset ( nitro_service client , nstimeout resource , String [ ] args ) throws Exception { } }
|
nstimeout unsetresource = new nstimeout ( ) ; return unsetresource . unset_resource ( client , args ) ;
|
public class AbstractHazelcastCachingProvider { /** * from which Config objects can be initialized */
protected boolean isConfigLocation ( URI location ) { } }
|
String scheme = location . getScheme ( ) ; if ( scheme == null ) { // interpret as place holder
try { String resolvedPlaceholder = getProperty ( location . getRawSchemeSpecificPart ( ) ) ; if ( resolvedPlaceholder == null ) { return false ; } location = new URI ( resolvedPlaceholder ) ; scheme = location . getScheme ( ) ; } catch ( URISyntaxException e ) { return false ; } } return ( scheme != null && SUPPORTED_SCHEMES . contains ( scheme . toLowerCase ( StringUtil . LOCALE_INTERNAL ) ) ) ;
|
public class HtmlBuilder { /** * Add attribute .
* @ param name Attribute name
* @ param value Attribute value */
public T attr ( String name , String value ) throws IOException { } }
|
if ( value != null ) { writer . write ( ' ' ) ; writer . write ( name ) ; writer . write ( "=\"" ) ; writer . write ( value ) ; writer . write ( '\"' ) ; } return ( T ) this ;
|
public class EditText { /** * Gives the text a shadow of the specified blur radius and color , the specified distance from
* its drawn position . < p > The text shadow produced does not interact with the properties on
* view that are responsible for real time shadows , { @ link View # getElevation ( ) elevation } and
* { @ link View # getTranslationZ ( ) translationZ } .
* @ see Paint # setShadowLayer ( float , float , float , int ) */
public final void setShadowLayer ( final float radius , final float dx , final float dy , final int color ) { } }
|
getView ( ) . setShadowLayer ( radius , dx , dy , color ) ;
|
public class NioGroovyMethods { /** * Deletes a directory with all contained files and subdirectories .
* < p > The method returns
* < ul >
* < li > true , when deletion was successful < / li >
* < li > true , when it is called for a non existing directory < / li >
* < li > false , when it is called for a file which isn ' t a directory < / li >
* < li > false , when directory couldn ' t be deleted < / li >
* < / ul >
* @ param self a Path
* @ return true if the file doesn ' t exist or deletion was successful
* @ since 2.3.0 */
public static boolean deleteDir ( final Path self ) { } }
|
if ( ! Files . exists ( self ) ) return true ; if ( ! Files . isDirectory ( self ) ) return false ; // delete contained files
try ( DirectoryStream < Path > stream = Files . newDirectoryStream ( self ) ) { for ( Path path : stream ) { if ( Files . isDirectory ( path ) ) { if ( ! deleteDir ( path ) ) { return false ; } } else { Files . delete ( path ) ; } } // now delete directory itself
Files . delete ( self ) ; return true ; } catch ( IOException e ) { return false ; }
|
public class ProtoUtils { /** * Produce a metadata marshaller for a protobuf type .
* @ since 1.13.0 */
@ ExperimentalApi ( "https://github.com/grpc/grpc-java/issues/4477" ) public static < T extends Message > Metadata . BinaryMarshaller < T > metadataMarshaller ( T instance ) { } }
|
return ProtoLiteUtils . metadataMarshaller ( instance ) ;
|
public class SpiderService { /** * Return the column name used to store the given value for the given link . The column
* name uses the format :
* < pre >
* ~ { link name } / { object ID }
* < / pre >
* This method should be used for unsharded links or link values to that refer to an
* object whose shard number is 0.
* @ param linkDef { @ link FieldDefinition } of a link .
* @ param objID ID of an object referenced by the link .
* @ return Column name that is used to store a value for the given link and
* object ID .
* @ see # shardedLinkTermRowKey ( FieldDefinition , String , int ) */
public static String linkColumnName ( FieldDefinition linkDef , String objID ) { } }
|
assert linkDef . isLinkField ( ) ; StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( "~" ) ; buffer . append ( linkDef . getName ( ) ) ; buffer . append ( "/" ) ; buffer . append ( objID ) ; return buffer . toString ( ) ;
|
public class CmsSitemapView { /** * Opens all sitemap tree items on a path , except the last one . < p >
* @ param path the path for which all intermediate sitemap items should be opened */
private void openItemsOnPath ( String path ) { } }
|
List < CmsSitemapTreeItem > itemsOnPath = getItemsOnPath ( path ) ; for ( CmsSitemapTreeItem item : itemsOnPath ) { item . setOpen ( true ) ; }
|
public class StringUtils { /** * 将目标字符串重复count次返回
* @ param str 目标字符串
* @ param count 次数
* @ return 目标字符串重复count次结果 , 例如目标字符串是test , count是2 , 则返回testtest , 如果count是3则返回testtesttest */
public static String copy ( String str , int count ) { } }
|
if ( str == null ) { throw new NullPointerException ( "原始字符串不能为null" ) ; } if ( count <= 0 ) { throw new IllegalArgumentException ( "次数必须大于0" ) ; } if ( count == 1 ) { return str ; } if ( count == 2 ) { return str + str ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < count ; i ++ ) { sb . append ( str ) ; } return sb . toString ( ) ;
|
public class ExtendedProperties { /** * Loads properties from the specified stream . The caller of this method is responsible for
* closing the stream .
* @ param is
* The input stream
* @ param encoding
* The encoding */
public void load ( final InputStream is , final String encoding ) throws IOException { } }
|
load ( new InputStreamReader ( is , encoding ) ) ;
|
public class V8ScriptRunner { /** * Recursively convert a V8 array to a list and release it
* @ param arr the array to convert
* @ return the list */
private List < Object > convertArray ( V8Array arr ) { } }
|
List < Object > l = new ArrayList < > ( ) ; for ( int i = 0 ; i < arr . length ( ) ; ++ i ) { Object o = arr . get ( i ) ; if ( o instanceof V8Array ) { o = convert ( ( V8Array ) o , List . class ) ; } else if ( o instanceof V8Object ) { o = convert ( ( V8Object ) o , Map . class ) ; } l . add ( o ) ; } return l ;
|
public class SegmentKeyCache { /** * Updates the tail cache for with the contents of the given { @ link TableKeyBatch } .
* Each { @ link TableKeyBatch . Item } is updated only if no previous entry exists with its { @ link TableKeyBatch . Item # getHash ( ) }
* or if its { @ link TableKeyBatch . Item # getOffset ( ) } is greater than the existing entry ' s offset .
* This method should be used for processing new updates to the Index ( as opposed from bulk - loading already indexed keys ) .
* @ param batch An { @ link TableKeyBatch } containing items to accept into the Cache .
* @ param batchOffset Offset in the Segment where the first item in the { @ link TableKeyBatch } has been written to .
* @ param generation The current Cache Generation ( from the Cache Manager ) .
* @ return A List of offsets for each item in the { @ link TableKeyBatch } ( in the same order ) of where the latest value
* for that item ' s Key exists now . */
List < Long > includeUpdateBatch ( TableKeyBatch batch , long batchOffset , int generation ) { } }
|
val result = new ArrayList < Long > ( batch . getItems ( ) . size ( ) ) ; synchronized ( this ) { for ( TableKeyBatch . Item item : batch . getItems ( ) ) { long itemOffset = batchOffset + item . getOffset ( ) ; CacheBucketOffset existingOffset = get ( item . getHash ( ) , generation ) ; if ( existingOffset == null || itemOffset > existingOffset . getSegmentOffset ( ) ) { // We have no previous entry , or we do and the current offset is higher , so it prevails .
this . tailOffsets . put ( item . getHash ( ) , new CacheBucketOffset ( itemOffset , batch . isRemoval ( ) ) ) ; result . add ( itemOffset ) ; } else { // Current offset is lower .
result . add ( existingOffset . getSegmentOffset ( ) ) ; } if ( existingOffset != null ) { // Only record a backpointer if we have a previous location to point to .
this . backpointers . put ( itemOffset , existingOffset . getSegmentOffset ( ) ) ; } } } return result ;
|
public class IonWriterSystemBinary { /** * Empty our buffers , assuming it is safe to do so .
* This is called by { @ link # flush ( ) } and { @ link # finish ( ) } . */
private void writeAllBufferedData ( ) throws IOException { } }
|
writeBytes ( _user_output_stream ) ; clearFieldName ( ) ; clearAnnotations ( ) ; _in_struct = false ; _patch_count = 0 ; _patch_symbol_table_count = 0 ; _top = 0 ; try { _writer . setPosition ( 0 ) ; _writer . truncate ( ) ; } catch ( IOException e ) { throw new IonException ( e ) ; }
|
public class InMemoryCacheEntry { /** * / * ( non - Javadoc )
* @ see com . gistlabs . mechanize . cache . InMemoryCacheEntry # isCacheable ( ) */
@ Override public boolean isCacheable ( ) { } }
|
boolean supportsConditionals = has ( "Last-Modified" , this . response ) || has ( "ETag" , this . response ) ; boolean isCacheable = has ( "Cache-Control" , "s-maxage" , this . response ) || has ( "Cache-Control" , "max-age" , this . response ) || has ( "Expires" , this . response ) ; return supportsConditionals || isCacheable ;
|
public class BasePostprocessor { /** * Clients should override this method if the post - processing cannot be done in place . If the
* post - processing can be done in place , clients should override the { @ link # process ( Bitmap ) }
* method .
* < p > The provided destination bitmap is of the same size as the source bitmap . There are no
* guarantees on the initial content of the destination bitmap , so the implementation has to make
* sure that it properly populates it .
* < p > The source bitmap must not be modified as it may be shared by the other clients .
* The implementation must use the provided destination bitmap as its output .
* @ param destBitmap the destination bitmap to be used as output
* @ param sourceBitmap the source bitmap to be used as input */
public void process ( Bitmap destBitmap , Bitmap sourceBitmap ) { } }
|
internalCopyBitmap ( destBitmap , sourceBitmap ) ; process ( destBitmap ) ;
|
public class PlayerPlaylist { /** * Add all tracks at the end of the playlist .
* @ param tracks tracks to add . */
public void addAll ( List < SoundCloudTrack > tracks ) { } }
|
for ( SoundCloudTrack track : tracks ) { add ( mSoundCloudPlaylist . getTracks ( ) . size ( ) , track ) ; }
|
public class Member { /** * Issue a deploy request on behalf of this member
* @ param deployRequest { @ link DeployRequest }
* @ return { @ link ChainCodeResponse } response to chain code deploy transaction
* @ throws ChainCodeException if the deployment fails . */
public ChainCodeResponse deploy ( DeployRequest deployRequest ) throws ChainCodeException , NoAvailableTCertException , CryptoException , IOException { } }
|
logger . debug ( "Member.deploy" ) ; if ( getChain ( ) . getPeers ( ) . isEmpty ( ) ) { throw new NoValidPeerException ( String . format ( "chain %s has no peers" , getChain ( ) . getName ( ) ) ) ; } TransactionContext tcxt = this . newTransactionContext ( null ) ; return tcxt . deploy ( deployRequest ) ;
|
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public FinishingOperationFOpType createFinishingOperationFOpTypeFromString ( EDataType eDataType , String initialValue ) { } }
|
FinishingOperationFOpType result = FinishingOperationFOpType . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
|
public class XmpReader { /** * Determine if there is an extended XMP section based on the standard XMP part .
* The xmpNote : HasExtendedXMP attribute contains the GUID of the Extended XMP chunks . */
@ Nullable private static String getExtendedXMPGUID ( @ NotNull Metadata metadata ) { } }
|
final Collection < XmpDirectory > xmpDirectories = metadata . getDirectoriesOfType ( XmpDirectory . class ) ; for ( XmpDirectory directory : xmpDirectories ) { final XMPMeta xmpMeta = directory . getXMPMeta ( ) ; try { final XMPIterator itr = xmpMeta . iterator ( SCHEMA_XMP_NOTES , null , null ) ; if ( itr == null ) continue ; while ( itr . hasNext ( ) ) { final XMPPropertyInfo pi = ( XMPPropertyInfo ) itr . next ( ) ; if ( ATTRIBUTE_EXTENDED_XMP . equals ( pi . getPath ( ) ) ) { return pi . getValue ( ) ; } } } catch ( XMPException e ) { // Fail silently here : we had a reading issue , not a decoding issue .
} } return null ;
|
public class ODatabaseFactory { /** * Closes all open databases . */
public synchronized void shutdown ( ) { } }
|
if ( instances . size ( ) > 0 ) { OLogManager . instance ( ) . debug ( null , "Found %d databases opened during OrientDB shutdown. Assure to always close database instances after usage" , instances . size ( ) ) ; for ( ODatabaseComplex < ? > db : new HashSet < ODatabaseComplex < ? > > ( instances . keySet ( ) ) ) { if ( db != null && ! db . isClosed ( ) ) { db . close ( ) ; } } }
|
public class QueryBuilder { /** * Perform an inner join between the already defined source with the " _ _ ALL _ NODES " table using the supplied alias .
* @ param alias the alias for the " _ _ ALL _ NODES " table ; may not be null
* @ return the component that must be used to complete the join specification ; never null */
public JoinClause innerJoinAllNodesAs ( String alias ) { } }
|
// Expect there to be a source already . . .
return new JoinClause ( namedSelector ( AllNodes . ALL_NODES_NAME + " AS " + alias ) , JoinType . INNER ) ;
|
public class AbstractFixture { /** * < p > invoke . < / p >
* @ param method a { @ link java . lang . reflect . Method } object .
* @ return a { @ link java . lang . Object } object . */
protected Object invoke ( Method method ) { } }
|
try { return method . invoke ( target ) ; } catch ( Exception e ) { return null ; }
|
public class BuildState { /** * Lookup a module from a name . Create the module if it does
* not exist yet . */
public Module lookupModule ( String mod ) { } }
|
Module m = modules . get ( mod ) ; if ( m == null ) { m = new Module ( mod , "???" ) ; modules . put ( mod , m ) ; } return m ;
|
public class ImageBuilder { /** * Build a web image with its url parameters .
* @ param jrImage the web image params
* @ return the JavaFX image object */
private Image buildWebImage ( final WebImage jrImage ) { } }
|
final String url = jrImage . getUrl ( ) ; Image image = null ; if ( url == null || url . isEmpty ( ) ) { LOGGER . error ( "Image : {} not found !" , url ) ; } else { image = new Image ( url ) ; } return image ;
|
public class PrimaveraPMFileWriter { /** * Map the currency separator character to a symbol name .
* @ param c currency separator character
* @ return symbol name */
private String getSymbolName ( char c ) { } }
|
String result = null ; switch ( c ) { case ',' : { result = "Comma" ; break ; } case '.' : { result = "Period" ; break ; } } return result ;
|
public class DateFormat { /** * Formats a Date into a date / time string .
* @ param date a Date to be formatted into a date / time string .
* @ param toAppendTo the string buffer for the returning date / time string .
* @ param fieldPosition keeps track of the position of the field
* within the returned string .
* On input : an alignment field ,
* if desired . On output : the offsets of the alignment field . For
* example , given a time text " 1996.07.10 AD at 15:08:56 PDT " ,
* if the given fieldPosition is DateFormat . YEAR _ FIELD , the
* begin index and end index of fieldPosition will be set to
* 0 and 4 , respectively .
* Notice that if the same time field appears
* more than once in a pattern , the fieldPosition will be set for the first
* occurrence of that time field . For instance , formatting a Date to
* the time string " 1 PM PDT ( Pacific Daylight Time ) " using the pattern
* " h a z ( zzzz ) " and the alignment field DateFormat . TIMEZONE _ FIELD ,
* the begin index and end index of fieldPosition will be set to
* 5 and 8 , respectively , for the first occurrence of the timezone
* pattern character ' z ' .
* @ return the formatted date / time string . */
public StringBuffer format ( Date date , StringBuffer toAppendTo , FieldPosition fieldPosition ) { } }
|
// Use our Calendar object
calendar . setTime ( date ) ; return format ( calendar , toAppendTo , fieldPosition ) ;
|
public class SimpleDateTimeTextProvider { private Object findStore ( TemporalField field , Locale locale ) { } }
|
Entry < TemporalField , Locale > key = createEntry ( field , locale ) ; Object store = cache . get ( key ) ; if ( store == null ) { store = createStore ( field , locale ) ; cache . putIfAbsent ( key , store ) ; store = cache . get ( key ) ; } return store ;
|
public class SQLErrorCodesFactory { /** * 获取数据库名称
* @ param dataSource
* @ return
* @ throws MetaDataAccessException */
private String fetchDatabaseProductName ( DataSource dataSource ) throws MetaDataAccessException { } }
|
Connection conn = null ; try { conn = DataSourceUtils . getConnection ( dataSource ) ; DatabaseMetaData metaData = conn . getMetaData ( ) ; return metaData . getDatabaseProductName ( ) ; } catch ( CannotGetJdbcConnectionException ex ) { throw new MetaDataAccessException ( "Could not get Connection for extracting meta data" , ex ) ; } catch ( SQLException ex ) { throw new MetaDataAccessException ( "Error while extracting DatabaseMetaData" , ex ) ; } finally { DataSourceUtils . releaseConnection ( conn , dataSource ) ; }
|
public class Emitter { /** * Checks if there is a valid markdown link definition .
* @ param aOut
* The StringBuilder containing the generated output .
* @ param sIn
* Input String .
* @ param nStart
* Starting position .
* @ param eToken
* Either LINK or IMAGE .
* @ return The new position or - 1 if there is no valid markdown link . */
private int _checkInlineLink ( final MarkdownHCStack aOut , final String sIn , final int nStart , final EMarkToken eToken ) { } }
|
boolean bIsAbbrev = false ; int nPos = nStart + ( eToken == EMarkToken . LINK ? 1 : 2 ) ; final StringBuilder aTmp = new StringBuilder ( ) ; aTmp . setLength ( 0 ) ; nPos = MarkdownHelper . readMdLinkId ( aTmp , sIn , nPos ) ; if ( nPos < nStart ) return - 1 ; final String sName = aTmp . toString ( ) ; String sLink = null ; String sComment = null ; final int nOldPos = nPos ++ ; nPos = MarkdownHelper . skipSpaces ( sIn , nPos ) ; if ( nPos < nStart ) { final LinkRef aLR = m_aLinkRefs . get ( sName . toLowerCase ( Locale . US ) ) ; if ( aLR == null ) return - 1 ; bIsAbbrev = aLR . isAbbrev ( ) ; sLink = aLR . getLink ( ) ; sComment = aLR . getTitle ( ) ; nPos = nOldPos ; } else if ( sIn . charAt ( nPos ) == '(' ) { nPos ++ ; nPos = MarkdownHelper . skipSpaces ( sIn , nPos ) ; if ( nPos < nStart ) return - 1 ; aTmp . setLength ( 0 ) ; final boolean bUseLt = sIn . charAt ( nPos ) == '<' ; nPos = bUseLt ? MarkdownHelper . readUntil ( aTmp , sIn , nPos + 1 , '>' ) : MarkdownHelper . readMdLink ( aTmp , sIn , nPos ) ; if ( nPos < nStart ) return - 1 ; if ( bUseLt ) nPos ++ ; sLink = aTmp . toString ( ) ; if ( sIn . charAt ( nPos ) == ' ' ) { nPos = MarkdownHelper . skipSpaces ( sIn , nPos ) ; if ( nPos > nStart && sIn . charAt ( nPos ) == '"' ) { nPos ++ ; aTmp . setLength ( 0 ) ; nPos = MarkdownHelper . readUntil ( aTmp , sIn , nPos , '"' ) ; if ( nPos < nStart ) return - 1 ; sComment = aTmp . toString ( ) ; nPos ++ ; nPos = MarkdownHelper . skipSpaces ( sIn , nPos ) ; if ( nPos == - 1 ) return - 1 ; } } if ( sIn . charAt ( nPos ) != ')' ) return - 1 ; } else if ( sIn . charAt ( nPos ) == '[' ) { nPos ++ ; aTmp . setLength ( 0 ) ; nPos = MarkdownHelper . readRawUntil ( aTmp , sIn , nPos , ']' ) ; if ( nPos < nStart ) return - 1 ; final String sID = aTmp . length ( ) > 0 ? aTmp . toString ( ) : sName ; final LinkRef aLR = m_aLinkRefs . get ( sID . toLowerCase ( Locale . US ) ) ; if ( aLR != null ) { sLink = aLR . getLink ( ) ; sComment = aLR . getTitle ( ) ; } } else { final LinkRef aLR = m_aLinkRefs . get ( sName . toLowerCase ( Locale . US ) ) ; if ( aLR == null ) return - 1 ; bIsAbbrev = aLR . isAbbrev ( ) ; sLink = aLR . getLink ( ) ; sComment = aLR . getTitle ( ) ; nPos = nOldPos ; } if ( sLink == null ) return - 1 ; if ( eToken == EMarkToken . LINK ) { if ( bIsAbbrev && sComment != null ) { if ( ! m_bUseExtensions ) return - 1 ; aOut . push ( new HCAbbr ( ) . setTitle ( sComment ) ) ; _recursiveEmitLine ( aOut , sName , 0 , EMarkToken . NONE ) ; aOut . pop ( ) ; } else { final HCA aLink = m_aConfig . getDecorator ( ) . openLink ( aOut ) ; aLink . setHref ( new SimpleURL ( sLink ) ) ; if ( sComment != null ) aLink . setTitle ( sComment ) ; _recursiveEmitLine ( aOut , sName , 0 , EMarkToken . NONE ) ; m_aConfig . getDecorator ( ) . closeLink ( aOut ) ; } } else { final HCImg aImg = m_aConfig . getDecorator ( ) . appendImage ( aOut ) ; aImg . setSrc ( new SimpleURL ( sLink ) ) ; aImg . setAlt ( sName ) ; if ( sComment != null ) aImg . setTitle ( sComment ) ; } return nPos ;
|
public class SDBaseOps { /** * Matrix multiply a batch of matrices . matricesA and matricesB have to be arrays of same
* length and each pair taken from these sets has to have dimensions ( M , N ) and ( N , K ) ,
* respectively . If transposeA is true , matrices from matricesA will have shape ( N , M ) instead .
* Likewise , if transposeB is true , matrices from matricesB will have shape ( K , N ) .
* The result of this operation will be a batch of multiplied matrices . The
* result has the same length as both input batches and each output matrix is of shape ( M , K ) .
* @ param matricesA First array of input matrices , all of shape ( M , N ) or ( N , M )
* @ param matricesB Second array of input matrices , all of shape ( N , K ) or ( K , N )
* @ param transposeA whether first batch of matrices is transposed .
* @ param transposeB whether second batch of matrices is transposed .
* @ param names names for all provided SDVariables
* @ return Array of multiplied SDVariables of shape ( M , K ) */
public SDVariable [ ] batchMmul ( String [ ] names , SDVariable [ ] matricesA , SDVariable [ ] matricesB , boolean transposeA , boolean transposeB ) { } }
|
validateSameType ( "batchMmul" , true , matricesA ) ; validateSameType ( "batchMmul" , true , matricesB ) ; SDVariable [ ] result = f ( ) . batchMmul ( matricesA , matricesB , transposeA , transposeB ) ; return updateVariableNamesAndReferences ( result , names ) ;
|
public class SavedAuthenticationImpl { /** * Set the { @ link org . geomajas . security . Authorization } s which apply for this authentication .
* They are included here in serialized form .
* @ param authorizations array of authentications */
public void setAuthorizations ( BaseAuthorization [ ] authorizations ) { } }
|
BaseAuthorization ba = null ; try { this . authorizations = new byte [ authorizations . length ] [ ] ; for ( int i = 0 ; i < authorizations . length ; i ++ ) { ba = authorizations [ i ] ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( 256 ) ; JBossObjectOutputStream serialize = new JBossObjectOutputStream ( baos ) ; serialize . writeObject ( ba ) ; serialize . flush ( ) ; serialize . close ( ) ; this . authorizations [ i ] = baos . toByteArray ( ) ; } } catch ( IOException ioe ) { Logger log = LoggerFactory . getLogger ( SavedAuthenticationImpl . class ) ; log . error ( "Could not serialize " + ba + ", may cause rights to be lost." , ioe ) ; }
|
public class CoderResult { /** * Gets a < code > CoderResult < / code > object indicating an unmappable
* character error .
* @ param length
* the length of the input unit sequence denoting the unmappable
* character .
* @ return a < code > CoderResult < / code > object indicating an unmappable
* character error .
* @ throws IllegalArgumentException
* if < code > length < / code > is non - positive . */
public static synchronized CoderResult unmappableForLength ( int length ) throws IllegalArgumentException { } }
|
if ( length > 0 ) { Integer key = Integer . valueOf ( length ) ; synchronized ( _unmappableErrors ) { CoderResult r = _unmappableErrors . get ( key ) ; if ( r == null ) { r = new CoderResult ( TYPE_UNMAPPABLE_CHAR , length ) ; _unmappableErrors . put ( key , r ) ; } return r ; } } throw new IllegalArgumentException ( "length <= 0: " + length ) ;
|
public class RemoveAttributesActivity { /** * A list of 1-50 attributes to remove from the message .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAttributes ( java . util . Collection ) } or { @ link # withAttributes ( java . util . Collection ) } if you want to
* override the existing values .
* @ param attributes
* A list of 1-50 attributes to remove from the message .
* @ return Returns a reference to this object so that method calls can be chained together . */
public RemoveAttributesActivity withAttributes ( String ... attributes ) { } }
|
if ( this . attributes == null ) { setAttributes ( new java . util . ArrayList < String > ( attributes . length ) ) ; } for ( String ele : attributes ) { this . attributes . add ( ele ) ; } return this ;
|
public class KeyWrapper { /** * Convenience method to unwrap a public - private key pain in a single call .
* @ param wrappedPrivateKey The wrapped key , base - 64 encoded , as returned by
* { @ link # wrapPrivateKey ( PrivateKey ) } .
* @ param encodedPublicKey The public key , base - 64 encoded , as returned by
* { @ link # encodePublicKey ( PublicKey ) } .
* @ return A { @ link KeyPair } containing the unwrapped { @ link PrivateKey } and the decoded { @ link PublicKey } . */
public KeyPair unwrapKeyPair ( String wrappedPrivateKey , String encodedPublicKey ) { } }
|
PrivateKey privateKey = unwrapPrivateKey ( wrappedPrivateKey ) ; PublicKey publicKey = decodePublicKey ( encodedPublicKey ) ; return new KeyPair ( publicKey , privateKey ) ;
|
public class FieldTypeHelper { /** * In some circumstances MS Project refers to the text version of a field ( e . g . Start Text rather than Star ) when we
* actually need to process the non - text version of the field . This method performs that mapping .
* @ param field field to mapped
* @ return mapped field */
public static FieldType mapTextFields ( FieldType field ) { } }
|
if ( field != null && field . getFieldTypeClass ( ) == FieldTypeClass . TASK ) { TaskField taskField = ( TaskField ) field ; switch ( taskField ) { case START_TEXT : { field = TaskField . START ; break ; } case FINISH_TEXT : { field = TaskField . FINISH ; break ; } case DURATION_TEXT : { field = TaskField . DURATION ; break ; } default : { break ; } } } return field ;
|
public class ResourceRepositoryBase { /** * Forwards to { @ link # findAll ( QuerySpec ) }
* @ param id
* of the resource
* @ param querySpec
* for field and relation inclusion
* @ return resource */
@ Override public T findOne ( I id , QuerySpec querySpec ) { } }
|
RegistryEntry entry = resourceRegistry . findEntry ( resourceClass ) ; String idName = entry . getResourceInformation ( ) . getIdField ( ) . getUnderlyingName ( ) ; QuerySpec idQuerySpec = querySpec . duplicate ( ) ; idQuerySpec . addFilter ( new FilterSpec ( Arrays . asList ( idName ) , FilterOperator . EQ , id ) ) ; Iterable < T > iterable = findAll ( idQuerySpec ) ; Iterator < T > iterator = iterable . iterator ( ) ; if ( iterator . hasNext ( ) ) { T resource = iterator . next ( ) ; PreconditionUtil . assertFalse ( "expected unique result" , iterator . hasNext ( ) ) ; return resource ; } else { throw new ResourceNotFoundException ( "resource not found" ) ; }
|
public class ContentSpecParser { /** * Process the contents of a content specification and parse it into a ContentSpec object .
* @ param parserData
* @ param processProcesses If processes should be processed to populate the relationships .
* @ return True if the contents were processed successfully otherwise false . */
protected ParserResults processSpecContents ( ParserData parserData , final boolean processProcesses ) { } }
|
parserData . setCurrentLevel ( parserData . getContentSpec ( ) . getBaseLevel ( ) ) ; boolean error = false ; while ( parserData . getLines ( ) . peek ( ) != null ) { parserData . setLineCount ( parserData . getLineCount ( ) + 1 ) ; // Process the content specification and print an error message if an error occurs
try { if ( ! parseLine ( parserData , parserData . getLines ( ) . poll ( ) , parserData . getLineCount ( ) ) ) { error = true ; } } catch ( IndentationException e ) { log . error ( e . getMessage ( ) ) ; return new ParserResults ( false , null ) ; } } // Before validating the content specification , processes should be loaded first so that the
// relationships and targets are created
if ( processProcesses ) { for ( final Process process : parserData . getProcesses ( ) ) { process . processTopics ( parserData . getSpecTopics ( ) , parserData . getTargetTopics ( ) , topicProvider , serverSettingsProvider ) ; } } // Setup the relationships
processRelationships ( parserData ) ; return new ParserResults ( ! error , parserData . getContentSpec ( ) ) ;
|
public class RegistriesInner { /** * Regenerates one of the login credentials for the specified container registry .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param name Specifies name of the password which should be regenerated - - password or password2 . Possible values include : ' password ' , ' password2'
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the RegistryListCredentialsResultInner object */
public Observable < RegistryListCredentialsResultInner > regenerateCredentialAsync ( String resourceGroupName , String registryName , PasswordName name ) { } }
|
return regenerateCredentialWithServiceResponseAsync ( resourceGroupName , registryName , name ) . map ( new Func1 < ServiceResponse < RegistryListCredentialsResultInner > , RegistryListCredentialsResultInner > ( ) { @ Override public RegistryListCredentialsResultInner call ( ServiceResponse < RegistryListCredentialsResultInner > response ) { return response . body ( ) ; } } ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.