signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class DatatypeConverter { /** * Print a work group .
* @ param value WorkGroup instance
* @ return work group value */
public static final String printWorkGroup ( WorkGroup value ) { } }
|
return ( Integer . toString ( value == null ? WorkGroup . DEFAULT . getValue ( ) : value . getValue ( ) ) ) ;
|
public class LogNormalDistribution { /** * Inverse cumulative probability density function ( probit ) of a normal
* distribution .
* @ param x value to evaluate probit function at
* @ param mu Mean value
* @ param sigma Standard deviation .
* @ return The probit of the given normal distribution at x . */
public static double quantile ( double x , double mu , double sigma ) { } }
|
return FastMath . exp ( mu + sigma * NormalDistribution . standardNormalQuantile ( x ) ) ;
|
public class PropertyTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } }
|
switch ( featureID ) { case BpsimPackage . PROPERTY_TYPE__NAME : setName ( NAME_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
|
public class NtlmPasswordAuthentication { /** * { @ inheritDoc }
* @ see jcifs . smb . NtlmPasswordAuthenticator # getAnsiHash ( jcifs . CIFSContext , byte [ ] ) */
@ Override public byte [ ] getAnsiHash ( CIFSContext tc , byte [ ] chlng ) throws GeneralSecurityException { } }
|
if ( this . hashesExternal ) { return this . ansiHash ; } return super . getAnsiHash ( tc , chlng ) ;
|
public class NGAExtensions { /** * Get a Feature Style Extension used only for deletions
* @ param geoPackage
* GeoPackage
* @ return Feature Style Extension */
private static FeatureCoreStyleExtension getFeatureStyleExtension ( GeoPackageCore geoPackage ) { } }
|
RelatedTablesCoreExtension relatedTables = new RelatedTablesCoreExtension ( geoPackage ) { @ Override public String getPrimaryKeyColumnName ( String tableName ) { return null ; } } ; return new FeatureCoreStyleExtension ( geoPackage , relatedTables ) { } ;
|
public class JpaRolloutManagement { /** * Enforces the quota defining the maximum number of { @ link Target } s per
* { @ link RolloutGroup } .
* @ param group
* The rollout group
* @ param requested
* number of targets to check */
private void assertTargetsPerRolloutGroupQuota ( final long requested ) { } }
|
final int quota = quotaManagement . getMaxTargetsPerRolloutGroup ( ) ; QuotaHelper . assertAssignmentQuota ( requested , quota , Target . class , RolloutGroup . class ) ;
|
public class DefaultYamlNodeFactory { /** * Creates a new { @ link DefaultYamlNodeFactory } with the specified
* precision .
* @ param precision the precision
* @ return the factory */
public static DefaultYamlNodeFactory create ( DecimalPrecision precision ) { } }
|
Objects . requireNonNull ( precision ) ; DefaultYamlNodeFactory fac = FACTORIES . get ( precision ) ; if ( fac == null ) { FACTORIES . put ( precision , fac = new DefaultYamlNodeFactory ( precision ) ) ; } return fac ;
|
public class Maybes { /** * Construct a Maybe from Iterable by taking the first value from Iterable
* @ param t Iterable to populate Maybe from
* @ return Maybe containing first element from Iterable ( or empty Maybe ) */
public static < T > Maybe < T > fromIterable ( Iterable < T > t ) { } }
|
return narrow ( Single . fromPublisher ( Future . fromIterable ( t ) ) . toMaybe ( ) ) ;
|
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertBDDReserved2ToString ( EDataType eDataType , Object instanceValue ) { } }
|
return instanceValue == null ? null : instanceValue . toString ( ) ;
|
public class DockPaneTargetDragAdapter { /** * { @ inheritDoc } */
@ Override public void dragDropped ( final DragEvent dragEvent ) { } }
|
System . out . println ( "drag DROPPED => " + controller ( ) . model ( ) . key ( ) ) ; /* data dropped */
/* if there is a string data on dragboard , read it and use it */
final Dragboard db = dragEvent . getDragboard ( ) ; boolean success = false ; if ( db . hasContent ( CustomDataFormat . DOCKABLE ) ) { final Dockable serializedTab = ( Dockable ) db . getContent ( CustomDataFormat . DOCKABLE ) ; // final Button b =
// getController ( ) . getView ( ) . getButtonByTab ( serializedTab ) ;
final TabbedPaneModel model = controller ( ) . model ( ) . getModel ( TabbedPaneModel . class , TabbedPaneConfig . create ( ) . id ( "ddddd" ) . orientation ( TabbedPaneOrientation . top ) ) ; // getController ( ) . model ( ) . addPart ( model , null ) ;
success = true ; } /* * let the source know whether the string was successfully transferred
* and used */
dragEvent . setDropCompleted ( success ) ; dragEvent . consume ( ) ;
|
public class ResourceBuilder { /** * Creates ResourceBuilders .
* @ param classLoader classLoader
* @ param implementationModel implementationModel
* @ return ResourceBuilders */
public static List < ResourceBuilder > builders ( ClassLoader classLoader , KnowledgeComponentImplementationModel implementationModel ) { } }
|
List < ResourceBuilder > builders = new ArrayList < ResourceBuilder > ( ) ; if ( implementationModel != null ) { ManifestModel manifestModel = implementationModel . getManifest ( ) ; if ( manifestModel != null ) { ResourcesModel resourcesModel = manifestModel . getResources ( ) ; builders . addAll ( builders ( classLoader , resourcesModel ) ) ; } } return builders ;
|
public class RemoveUnusedCode { /** * Removes unreferenced arguments from a function declaration and when
* possible the function ' s callSites .
* @ param fparamScope The function parameter */
private void removeUnreferencedFunctionArgs ( Scope fparamScope ) { } }
|
// Notice that removing unreferenced function args breaks
// Function . prototype . length . In advanced mode , we don ' t really care
// about this : we consider " length " the equivalent of reflecting on
// the function ' s lexical source .
// Rather than create a new option for this , we assume that if the user
// is removing globals , then it ' s OK to remove unused function args .
// See http : / / blickly . github . io / closure - compiler - issues / # 253
if ( ! removeGlobals ) { return ; } Node function = fparamScope . getRootNode ( ) ; checkState ( function . isFunction ( ) ) ; if ( NodeUtil . isGetOrSetKey ( function . getParent ( ) ) ) { // The parameters object literal setters can not be removed .
return ; } Node argList = NodeUtil . getFunctionParameters ( function ) ; // Strip as many unreferenced args off the end of the function declaration as possible .
maybeRemoveUnusedTrailingParameters ( argList , fparamScope ) ; // Mark any remaining unused parameters are unused to OptimizeParameters can try to remove
// them .
markUnusedParameters ( argList , fparamScope ) ;
|
public class BroadcastTransmitter { /** * Transmit a message to { @ link BroadcastReceiver } s via the broadcast buffer .
* @ param msgTypeId type of the message to be transmitted .
* @ param srcBuffer containing the encoded message to be transmitted .
* @ param srcIndex srcIndex in the source buffer at which the encoded message begins .
* @ param length in bytes of the encoded message .
* @ throws IllegalArgumentException of the msgTypeId is not valid ,
* or if the message length is greater than { @ link # maxMsgLength ( ) } . */
public void transmit ( final int msgTypeId , final DirectBuffer srcBuffer , final int srcIndex , final int length ) { } }
|
checkTypeId ( msgTypeId ) ; checkMessageLength ( length ) ; final AtomicBuffer buffer = this . buffer ; long currentTail = buffer . getLong ( tailCounterIndex ) ; int recordOffset = ( int ) currentTail & ( capacity - 1 ) ; final int recordLength = HEADER_LENGTH + length ; final int recordLengthAligned = BitUtil . align ( recordLength , RECORD_ALIGNMENT ) ; final long newTail = currentTail + recordLengthAligned ; final int toEndOfBuffer = capacity - recordOffset ; if ( toEndOfBuffer < recordLengthAligned ) { signalTailIntent ( buffer , newTail + toEndOfBuffer ) ; insertPaddingRecord ( buffer , recordOffset , toEndOfBuffer ) ; currentTail += toEndOfBuffer ; recordOffset = 0 ; } else { signalTailIntent ( buffer , newTail ) ; } buffer . putInt ( lengthOffset ( recordOffset ) , recordLength ) ; buffer . putInt ( typeOffset ( recordOffset ) , msgTypeId ) ; buffer . putBytes ( msgOffset ( recordOffset ) , srcBuffer , srcIndex , length ) ; buffer . putLong ( latestCounterIndex , currentTail ) ; buffer . putLongOrdered ( tailCounterIndex , currentTail + recordLengthAligned ) ;
|
public class Table { /** * Inserts a Cell in a cell - array and reserves cells defined by row - / colspan .
* @ param someRows some rows
* @ param aCell the cell that has to be inserted
* @ param aPosition the position where the cell has to be placed */
private void placeCell ( ArrayList < Row > someRows , Cell aCell , Point aPosition ) { } }
|
int i ; Row row = null ; int rowCount = aPosition . x + aCell . getRowspan ( ) - someRows . size ( ) ; assumeTableDefaults ( aCell ) ; if ( ( aPosition . x + aCell . getRowspan ( ) ) > someRows . size ( ) ) { for ( i = 0 ; i < rowCount ; i ++ ) { row = new Row ( columns ) ; someRows . add ( row ) ; } } // reserve cell in rows below
for ( i = aPosition . x + 1 ; i < ( aPosition . x + aCell . getRowspan ( ) ) ; i ++ ) { if ( ! someRows . get ( i ) . reserve ( aPosition . y , aCell . getColspan ( ) ) ) { // should be impossible to come here : - )
throw new RuntimeException ( "addCell - error in reserve" ) ; } } row = someRows . get ( aPosition . x ) ; row . addElement ( aCell , aPosition . y ) ;
|
public class Cron4jTask { protected Method findHookMethod ( Object hook , String methodName ) { } }
|
final Method hookMethod = Stream . of ( hook . getClass ( ) . getMethods ( ) ) // always public method
. filter ( method -> method . getName ( ) . equals ( methodName ) ) . findFirst ( ) . orElseThrow ( ( ) -> { // no way
return new IllegalStateException ( "Not found the method in hook: " + methodName + ", " + hook ) ; } ) ; return hookMethod ;
|
public class DeviceTypesApi { /** * Get Device Types
* Retrieves Device Types
* @ param name Device Type name ( required )
* @ param offset Offset for pagination . ( optional )
* @ param count Desired count of items in the result set ( optional )
* @ param tags Elements tagged with the list of tags . ( comma separated ) ( optional )
* @ return DeviceTypesEnvelope
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public DeviceTypesEnvelope getDeviceTypes ( String name , Integer offset , Integer count , String tags ) throws ApiException { } }
|
ApiResponse < DeviceTypesEnvelope > resp = getDeviceTypesWithHttpInfo ( name , offset , count , tags ) ; return resp . getData ( ) ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ElementaryFunctionsType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "arccsc" ) public JAXBElement < ElementaryFunctionsType > createArccsc ( ElementaryFunctionsType value ) { } }
|
return new JAXBElement < ElementaryFunctionsType > ( _Arccsc_QNAME , ElementaryFunctionsType . class , null , value ) ;
|
public class AbstractElementTransformer { /** * TODO - sm Remove this method . */
public IRExpression callMethod ( Class cls , String strMethod , Class [ ] paramTypes , IRExpression root , List < IRExpression > args ) { } }
|
return callMethod ( IRMethodFactory . createIRMethod ( cls , strMethod , paramTypes ) , root , args ) ;
|
public class HttpRequestUtils { /** * Gets http servlet request user agent .
* @ param request the request
* @ return the http servlet request user agent */
public static String getHttpServletRequestUserAgent ( final HttpServletRequest request ) { } }
|
if ( request != null ) { return request . getHeader ( USER_AGENT_HEADER ) ; } return null ;
|
public class PeriodList { /** * Add a period to the list .
* @ param period
* the period to add
* @ return true
* @ see java . util . List # add ( java . lang . Object ) */
public final boolean add ( final Period period ) { } }
|
if ( isUtc ( ) ) { period . setUtc ( true ) ; } else { period . setTimeZone ( timezone ) ; } return periods . add ( period ) ;
|
public class EntityManagerProxyFactory { /** * Creates a proxy object that will write - replace with a wrapper around the { @ link EntityManager } .
* @ param factory a factory to generate EntityManagers .
* @ return the proxied instance . */
static EntityManager createProxy ( final HibernateEntityManagerFactory factory ) { } }
|
final EntityManagerInterceptor handler = new EntityManagerInterceptor ( factory ) ; final Enhancer e = new Enhancer ( ) ; // make sure we ' re Serializable and have a write replace method
e . setInterfaces ( new Class [ ] { EntityManager . class , Serializable . class , IWriteReplace . class } ) ; e . setSuperclass ( Object . class ) ; e . setCallback ( handler ) ; e . setNamingPolicy ( new DefaultNamingPolicy ( ) { @ Override public String getClassName ( final String prefix , final String source , final Object key , final Predicate names ) { return super . getClassName ( "CROQUET_ENTITY_MANAGER_PROXY_" + prefix , source , key , names ) ; } } ) ; LOG . trace ( "Created proxy for an EntityManager" ) ; return ( EntityManager ) e . create ( ) ;
|
public class Trajectory { /** * Get the list of positions in this { @ link Trajectory } ' s path .
* @ return The list of positions in this { @ link Trajectory } ' s path . */
public Coordinate [ ] getPositions ( ) { } }
|
ArrayList < Coordinate > ret = new ArrayList < Coordinate > ( ) ; for ( PoseSteering ps : psa ) { ret . add ( ps . getPose ( ) . getPosition ( ) ) ; } return ret . toArray ( new Coordinate [ ret . size ( ) ] ) ;
|
public class ConfigUtils { /** * Returns the sub - configuration tree whose root is the specified key . If the tree is missing a
* { @ link MissingConfigurationPropertyException } is thrown
* @ param config the configuration
* @ param key the key of the configuration tree
* @ return the sub - configuration tree , or null if not found
* @ throws MissingConfigurationPropertyException if the property is missing from the configuration
* @ throws DeployerConfigurationException if an error occurs */
@ SuppressWarnings ( "unchecked" ) public static List < HierarchicalConfiguration > getRequiredConfigurationsAt ( HierarchicalConfiguration config , String key ) throws DeployerConfigurationException { } }
|
List < HierarchicalConfiguration > configs = getConfigurationsAt ( config , key ) ; if ( CollectionUtils . isEmpty ( configs ) ) { throw new MissingConfigurationPropertyException ( key ) ; } else { return configs ; }
|
public class EmbeddedGobblin { /** * Override a Gobblin system configuration . */
public EmbeddedGobblin sysConfig ( String key , String value ) { } }
|
this . sysConfigOverrides . put ( key , value ) ; return this ;
|
public class DirectMetaBean { /** * Sets the value of the property .
* @ param bean the bean to update , not null
* @ param propertyName the property name , not null
* @ param value the value of the property , may be null
* @ param quiet true to take no action if unable to write
* @ throws NoSuchElementException if the property name is invalid */
protected void propertySet ( Bean bean , String propertyName , Object value , boolean quiet ) { } }
|
// used to enable 100 % test coverage in beans
if ( quiet ) { return ; } throw new NoSuchElementException ( "Unknown property: " + propertyName ) ;
|
public class MercatorProjection { /** * Converts a latitude coordinate ( in degrees ) to a tile Y number at a certain zoom level .
* @ param latitude the latitude coordinate that should be converted .
* @ param zoomLevel the zoom level at which the coordinate should be converted .
* @ return the tile Y number of the latitude value . */
public static int latitudeToTileY ( double latitude , byte zoomLevel ) { } }
|
return pixelYToTileY ( latitudeToPixelY ( latitude , zoomLevel , DUMMY_TILE_SIZE ) , zoomLevel , DUMMY_TILE_SIZE ) ;
|
public class RemoteConsumerTransmit { /** * The anycast protocol contains no guesses .
* @ see com . ibm . ws . sib . processor . runtime . SIMPDeliveryStreamSetTransmitControllable # containsGuesses ( ) */
public boolean containsGuesses ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "containsGuesses" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "containsGuesses" , Boolean . FALSE ) ; return false ;
|
public class Authenticator { /** * 支持json和form两种表单形式
* Please make this method asynchronous someday later */
public AccessToken blockingIssueAccessToken ( FullHttpRequest req ) throws OAuthException { } }
|
TokenRequest tokenRequest = TokenRequest . create ( req ) ; tokenRequest . validate ( ) ; // check valid client _ id , client _ secret and status of the client app should be active
if ( ! isActiveClient ( tokenRequest . getClientId ( ) , tokenRequest . getClientSecret ( ) ) . blockingGet ( ) ) { throw new OAuthException ( ResponseBuilder . INVALID_CLIENT_CREDENTIALS , HttpResponseStatus . BAD_REQUEST ) ; } AccessToken accessToken = null ; if ( TokenRequest . AUTHORIZATION_CODE . equals ( tokenRequest . getGrantType ( ) ) ) { AuthCode authCode = findAuthCode ( tokenRequest ) . blockingGet ( ) ; // TODO : REVISIT : Move client _ id check to db query
if ( authCode != null ) { if ( ! tokenRequest . getClientId ( ) . equals ( authCode . getClientId ( ) ) ) { throw new OAuthException ( ResponseBuilder . INVALID_CLIENT_ID , HttpResponseStatus . BAD_REQUEST ) ; } if ( authCode . getRedirectUri ( ) != null && ! tokenRequest . getRedirectUri ( ) . equals ( authCode . getRedirectUri ( ) ) ) { throw new OAuthException ( ResponseBuilder . INVALID_REDIRECT_URI , HttpResponseStatus . BAD_REQUEST ) ; } else { // invalidate the auth code
db . updateAuthCodeValidStatus ( authCode . getCode ( ) , false ) . blockingAwait ( ) ; accessToken = new AccessToken ( TOKEN_TYPE_BEARER , getExpiresIn ( TokenRequest . PASSWORD , authCode . getScope ( ) ) , authCode . getScope ( ) , getExpiresIn ( TokenRequest . REFRESH_TOKEN , authCode . getScope ( ) ) ) ; accessToken . setUserId ( authCode . getUserId ( ) ) ; accessToken . setClientId ( authCode . getClientId ( ) ) ; accessToken . setCodeId ( authCode . getId ( ) ) ; db . storeAccessToken ( accessToken ) . blockingAwait ( ) ; } } else { throw new OAuthException ( ResponseBuilder . INVALID_AUTH_CODE , HttpResponseStatus . BAD_REQUEST ) ; } } else if ( TokenRequest . REFRESH_TOKEN . equals ( tokenRequest . getGrantType ( ) ) ) { accessToken = db . findAccessTokenByRefreshToken ( tokenRequest . getRefreshToken ( ) , tokenRequest . getClientId ( ) ) . blockingGet ( ) ; if ( accessToken != null ) { if ( ! accessToken . refreshTokenExpired ( ) ) { String validScope ; if ( tokenRequest . getScope ( ) != null ) { if ( scopeService . scopeAllowed ( tokenRequest . getScope ( ) , accessToken . getScope ( ) ) ) { validScope = tokenRequest . getScope ( ) ; } else { throw new OAuthException ( ResponseBuilder . SCOPE_NOK_MESSAGE , HttpResponseStatus . BAD_REQUEST ) ; } } else { validScope = accessToken . getScope ( ) ; } db . updateAccessTokenValidStatus ( accessToken . getToken ( ) , false ) . blockingAwait ( ) ; AccessToken newAccessToken = new AccessToken ( TOKEN_TYPE_BEARER , getExpiresIn ( TokenRequest . PASSWORD , validScope ) , validScope , accessToken . getRefreshToken ( ) , accessToken . getRefreshExpiresIn ( ) ) ; newAccessToken . setUserId ( accessToken . getUserId ( ) ) ; newAccessToken . setDetails ( accessToken . getDetails ( ) ) ; newAccessToken . setClientId ( accessToken . getClientId ( ) ) ; db . storeAccessToken ( newAccessToken ) . blockingAwait ( ) ; db . removeAccessToken ( accessToken . getToken ( ) ) . blockingAwait ( ) ; return newAccessToken ; } else { db . removeAccessToken ( accessToken . getToken ( ) ) . blockingAwait ( ) ; throw new OAuthException ( ResponseBuilder . INVALID_REFRESH_TOKEN , HttpResponseStatus . BAD_REQUEST ) ; } } else { throw new OAuthException ( ResponseBuilder . INVALID_REFRESH_TOKEN , HttpResponseStatus . BAD_REQUEST ) ; } } else if ( TokenRequest . CLIENT_CREDENTIALS . equals ( tokenRequest . getGrantType ( ) ) ) { ClientCredentials clientCredentials = db . findClientCredentials ( tokenRequest . getClientId ( ) ) . blockingGet ( ) ; String scope = scopeService . getValidScopeByScope ( tokenRequest . getScope ( ) , clientCredentials . getScope ( ) ) ; if ( scope == null ) { throw new OAuthException ( ResponseBuilder . SCOPE_NOK_MESSAGE , HttpResponseStatus . BAD_REQUEST ) ; } accessToken = new AccessToken ( TOKEN_TYPE_BEARER , getExpiresIn ( TokenRequest . CLIENT_CREDENTIALS , scope ) , scope , false , null ) ; accessToken . setClientId ( tokenRequest . getClientId ( ) ) ; Map < String , String > applicationDetails = clientCredentials . getApplicationDetails ( ) ; if ( ( applicationDetails != null ) && ( applicationDetails . size ( ) > 0 ) ) { accessToken . setDetails ( applicationDetails ) ; // For backward compatibility
accessToken . setApplicationDetails ( applicationDetails ) ; } db . storeAccessToken ( accessToken ) . blockingAwait ( ) ; } else if ( TokenRequest . PASSWORD . equals ( tokenRequest . getGrantType ( ) ) ) { ClientCredentials clientCredentials = db . findClientCredentials ( tokenRequest . getClientId ( ) ) . blockingGet ( ) ; String scope = scopeService . getValidScopeByScope ( tokenRequest . getScope ( ) , clientCredentials . getScope ( ) ) ; if ( scope == null ) { throw new OAuthException ( ResponseBuilder . SCOPE_NOK_MESSAGE , HttpResponseStatus . BAD_REQUEST ) ; } try { UserDetails userDetails = authenticateUser ( tokenRequest . getUsername ( ) , tokenRequest . getPassword ( ) , req ) ; if ( userDetails != null && userDetails . getUserId ( ) != null ) { accessToken = new AccessToken ( TOKEN_TYPE_BEARER , getExpiresIn ( TokenRequest . PASSWORD , scope ) , scope , getExpiresIn ( TokenRequest . REFRESH_TOKEN , scope ) ) ; accessToken . setUserId ( userDetails . getUserId ( ) ) ; accessToken . setDetails ( userDetails . getDetails ( ) ) ; accessToken . setClientId ( tokenRequest . getClientId ( ) ) ; accessToken . setApplicationDetails ( clientCredentials . getApplicationDetails ( ) ) ; db . storeAccessToken ( accessToken ) . blockingAwait ( ) ; } else { throw new OAuthException ( ResponseBuilder . INVALID_USERNAME_PASSWORD , HttpResponseStatus . UNAUTHORIZED ) ; } } catch ( AuthenticationException e ) { // in case some custom response should be returned other than HTTP 401
// for instance , if the user authentication requires more user details as a subsequent step
if ( e . getResponse ( ) != null ) { String responseContent = ( ( FullHttpResponse ) ( e . getResponse ( ) ) ) . content ( ) . toString ( CharsetUtil . UTF_8 ) ; throw new OAuthException ( e , responseContent , e . getResponse ( ) . getStatus ( ) ) ; } else { LOG . error ( "Cannot authenticate user" , e ) ; throw new OAuthException ( e , ResponseBuilder . CANNOT_AUTHENTICATE_USER , HttpResponseStatus . UNAUTHORIZED ) ; // NOSONAR
} } } else if ( tokenRequest . getGrantType ( ) . equals ( OAuthConfig . getCustomGrantType ( ) ) ) { String scope = scopeService . getValidScope ( tokenRequest . getScope ( ) , tokenRequest . getClientId ( ) ) . blockingGet ( ) ; if ( scope == null ) { throw new OAuthException ( ResponseBuilder . SCOPE_NOK_MESSAGE , HttpResponseStatus . BAD_REQUEST ) ; } try { accessToken = new AccessToken ( TOKEN_TYPE_BEARER , getExpiresIn ( TokenRequest . PASSWORD , scope ) , scope , getExpiresIn ( TokenRequest . REFRESH_TOKEN , scope ) ) ; accessToken . setClientId ( tokenRequest . getClientId ( ) ) ; UserDetails userDetails = callCustomGrantTypeHandler ( req ) ; if ( userDetails != null && userDetails . getUserId ( ) != null ) { accessToken . setUserId ( userDetails . getUserId ( ) ) ; accessToken . setDetails ( userDetails . getDetails ( ) ) ; } db . storeAccessToken ( accessToken ) . blockingAwait ( ) ; } catch ( AuthenticationException e ) { LOG . error ( "Cannot authenticate user" , e ) ; throw new OAuthException ( e , ResponseBuilder . CANNOT_AUTHENTICATE_USER , HttpResponseStatus . UNAUTHORIZED ) ; } } return accessToken ;
|
public class VaultsInner { /** * Permanently deletes the specified vault . aka Purges the deleted Azure key vault .
* @ param vaultName The name of the soft - deleted vault .
* @ param location The location of the soft - deleted vault .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < Void > beginPurgeDeletedAsync ( String vaultName , String location ) { } }
|
return beginPurgeDeletedWithServiceResponseAsync ( vaultName , location ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
|
public class Graph { /** * 添加节点分类 , 使用分类名
* @ param values
* @ return */
public Graph categories ( Object ... values ) { } }
|
if ( values == null || values . length == 0 ) { return this ; } for ( Object value : values ) { if ( value instanceof String ) { this . categories ( ) . add ( new Category ( ( String ) value ) ) ; } else if ( value instanceof Category ) { this . categories ( ) . add ( ( Category ) value ) ; } // 其他忽略
} return this ;
|
public class SetupOptions { /** * Determine the test recording is on or off .
* @ param testName
* @ return
* @ throws javax . xml . parsers . ParserConfigurationException
* @ throws org . xml . sax . SAXException
* @ throws java . io . IOException */
public static boolean recordingInfo ( String testName ) throws ParserConfigurationException , SAXException , IOException { } }
|
TECore . rootTestName . clear ( ) ; String path = getBaseConfigDirectory ( ) + "/config.xml" ; if ( new File ( path ) . exists ( ) ) { // Fortify Mod : prevent external entity injection
DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setExpandEntityReferences ( false ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; // DocumentBuilder db = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ;
Document doc = db . parse ( path ) ; NodeList nodeListForStandardTag = doc . getElementsByTagName ( "standard" ) ; if ( null != nodeListForStandardTag && nodeListForStandardTag . getLength ( ) > 0 ) { for ( int i = 0 ; i < nodeListForStandardTag . getLength ( ) ; i ++ ) { Element elementStandard = ( Element ) nodeListForStandardTag . item ( i ) ; if ( testName . equals ( elementStandard . getElementsByTagName ( "local-name" ) . item ( 0 ) . getTextContent ( ) ) ) { if ( null != elementStandard . getElementsByTagName ( "record" ) . item ( 0 ) ) { System . setProperty ( "Record" , "True" ) ; NodeList rootTestNameArray = elementStandard . getElementsByTagName ( "test-name" ) ; if ( null != rootTestNameArray && rootTestNameArray . getLength ( ) > 0 ) { for ( int counter = 0 ; counter < rootTestNameArray . getLength ( ) ; counter ++ ) { Element rootTestName = ( Element ) rootTestNameArray . item ( counter ) ; TECore . rootTestName . add ( rootTestName . getTextContent ( ) ) ; } } return true ; } } } } } System . setProperty ( "Record" , "False" ) ; return false ;
|
public class PickerUtilities { /** * isLocalTimeInRange , This returns true if the specified value is inside of the specified
* range . This returns false if the specified value is outside of the specified range . If the
* specified value is null , then this will return false .
* If optionalMinimum is null , then it will be set to LocalTime . MIN . If optionalMaximum is null ,
* then it will be set to LocalTime . MAX .
* If inclusiveOfEndpoints is true , then values that equal the minimum or maximum will return
* true . Otherwise , values that equal the minimum or maximum will return false . */
public static boolean isLocalTimeInRange ( LocalTime value , LocalTime optionalMinimum , LocalTime optionalMaximum , boolean inclusiveOfEndpoints ) { } }
|
// If either bounding time does does not already exist , then set it to the maximum range .
LocalTime minimum = ( optionalMinimum == null ) ? LocalTime . MIN : optionalMinimum ; LocalTime maximum = ( optionalMaximum == null ) ? LocalTime . MAX : optionalMaximum ; // Null is never considered to be inside of a range .
if ( value == null ) { return false ; } // Return false if the range does not contain any times .
if ( maximum . isBefore ( minimum ) || maximum . equals ( minimum ) ) { return false ; } if ( inclusiveOfEndpoints ) { return ( ( value . isAfter ( minimum ) || value . equals ( minimum ) ) && ( value . isBefore ( maximum ) || value . equals ( maximum ) ) ) ; } else { return ( value . isAfter ( minimum ) && value . isBefore ( maximum ) ) ; }
|
public class GuestService { /** * Method used to connect to specified data center and customize the windows OS based virtual machine identified
* by the inputs provided .
* @ param httpInputs Object that has all the inputs necessary to made a connection to data center
* @ param vmInputs Object that has all the specific inputs necessary to identify the targeted virtual machine
* @ param guestInputs Object that has all specific inputs necessary to customize specified virtual machine
* @ return Map with String as key and value that contains returnCode of the operation , success message with task id
* of the execution or failure message and the exception if there is one
* @ throws Exception */
public Map < String , String > customizeVM ( HttpInputs httpInputs , VmInputs vmInputs , GuestInputs guestInputs , boolean isWin ) throws Exception { } }
|
ConnectionResources connectionResources = new ConnectionResources ( httpInputs , vmInputs ) ; try { ManagedObjectReference vmMor = new MorObjectHandler ( ) . getMor ( connectionResources , ManagedObjectType . VIRTUAL_MACHINE . getValue ( ) , vmInputs . getVirtualMachineName ( ) ) ; if ( vmMor != null ) { CustomizationSpec customizationSpec = isWin ? new GuestConfigSpecs ( ) . getWinCustomizationSpec ( guestInputs ) : new GuestConfigSpecs ( ) . getLinuxCustomizationSpec ( guestInputs ) ; connectionResources . getVimPortType ( ) . checkCustomizationSpec ( vmMor , customizationSpec ) ; ManagedObjectReference task = connectionResources . getVimPortType ( ) . customizeVMTask ( vmMor , customizationSpec ) ; return new ResponseHelper ( connectionResources , task ) . getResultsMap ( "Success: The [" + vmInputs . getVirtualMachineName ( ) + "] VM was successfully customized. The taskId is: " + task . getValue ( ) , "Failure: The [" + vmInputs . getVirtualMachineName ( ) + "] VM could not be customized." ) ; } else { return ResponseUtils . getVmNotFoundResultsMap ( vmInputs ) ; } } catch ( Exception ex ) { return ResponseUtils . getResultsMap ( ex . toString ( ) , Outputs . RETURN_CODE_FAILURE ) ; } finally { if ( httpInputs . isCloseSession ( ) ) { connectionResources . getConnection ( ) . disconnect ( ) ; clearConnectionFromContext ( httpInputs . getGlobalSessionObject ( ) ) ; } }
|
public class WebUtils { /** * Put registered service into flowscope .
* @ param context the context
* @ param registeredService the service */
public static void putRegisteredService ( final RequestContext context , final RegisteredService registeredService ) { } }
|
context . getFlowScope ( ) . put ( PARAMETER_REGISTERED_SERVICE , registeredService ) ;
|
public class MavenJDOMWriter { /** * Method write .
* @ param project
* @ param jdomFormat
* @ param writer
* @ param document */
public void write ( Model project , Document document , Writer writer , Format jdomFormat ) throws java . io . IOException { } }
|
updateModel ( project , "project" , new Counter ( 0 ) , document . getRootElement ( ) ) ; XMLOutputter outputter = new XMLOutputter ( ) ; outputter . setFormat ( jdomFormat ) ; outputter . output ( document , writer ) ;
|
public class Ec2MachineConfigurator { /** * Performs all steps necessary to create or reuse volume ( s ) , as specified in configuration .
* @ return true when volume ( s ) creation is done */
private boolean createOrReuseVolumes ( ) { } }
|
for ( String storageId : Ec2IaasHandler . findStorageIds ( this . targetProperties ) ) { String nameTemplate = Ec2IaasHandler . findStorageProperty ( this . targetProperties , storageId , VOLUME_NAME_PREFIX ) ; // Lookup volume , according to its snapshot ID or Name tag .
String idOrName = Ec2IaasHandler . expandVolumeName ( nameTemplate , this . applicationName , this . scopedInstance . getName ( ) ) ; String volumeSnapshotOrId = lookupVolume ( idOrName ) ; if ( volumeSnapshotOrId == null ) volumeSnapshotOrId = idOrName ; int size = DEFAULT_VOLUME_SIZE ; try { size = Integer . parseInt ( Ec2IaasHandler . findStorageProperty ( this . targetProperties , storageId , VOLUME_SIZE_GB_PREFIX ) ) ; } catch ( Exception nfe ) { size = DEFAULT_VOLUME_SIZE ; } if ( size <= 0 ) size = DEFAULT_VOLUME_SIZE ; String volumeId ; if ( volumeSnapshotOrId != null && volumeCreated ( volumeSnapshotOrId ) ) { volumeId = volumeSnapshotOrId ; } else { volumeId = createVolume ( storageId , volumeSnapshotOrId , size ) ; } this . logger . info ( "Volume " + volumeId + " was successfully created." ) ; this . storageIdToVolumeId . put ( storageId , volumeId ) ; } return true ;
|
public class State { /** * 添加一个匹配到的模式串 ( 这个状态对应着这个模式串 )
* @ param keyword */
public void addEmit ( String keyword ) { } }
|
if ( this . emits == null ) { this . emits = new TreeSet < String > ( ) ; } this . emits . add ( keyword ) ;
|
public class MapboxMatrix { /** * Build a new { @ link MapboxMatrix } object with the initial values set for { @ link # baseUrl ( ) } ,
* { @ link # profile ( ) } , and { @ link # user ( ) } .
* @ return a { @ link Builder } object for creating this object
* @ since 3.0.0 */
public static Builder builder ( ) { } }
|
return new AutoValue_MapboxMatrix . Builder ( ) . baseUrl ( Constants . BASE_API_URL ) . profile ( DirectionsCriteria . PROFILE_DRIVING ) . user ( DirectionsCriteria . PROFILE_DEFAULT_USER ) ;
|
public class AbstractTemplate { /** * Transforms a template into an expanded output using the given model .
* @ param model
* the model used to evaluate expressions inside the template
* @ return the expanded output */
public String transform ( Map < String , Object > model , Locale locale ) { } }
|
return transform ( model , locale , engine . getModelAdaptor ( ) , null ) ;
|
public class Utils { /** * Normalizes an empty or a null string into a space string .
* @ param str The string to normalize .
* @ return The normalized string . */
@ Trivial public static final String normalizeString ( String str ) { } }
|
return ( str == null || str . length ( ) == 0 ) ? " " : str ;
|
public class Request { /** * 获得url中的单个参数 , RestFull风格
* @ param index 获得第几个URL参数的
* @ return url中的参数 */
public static String getUrlParam ( int index ) { } }
|
String [ ] urlParams = getUrlParams ( ) ; if ( null != urlParams && urlParams . length > index ) { return urlParams [ index ] ; } return null ;
|
public class SpelExpression { /** * Return a parsed SpEL expression .
* @ return parsed SpEL expression */
protected synchronized Expression getParsedExpression ( ) { } }
|
if ( parsedExpression == null ) { try { parsedExpression = EXPRESSION_PARSER . parseExpression ( getExpression ( ) ) ; } catch ( ParseException e ) { throw new IllegalArgumentException ( "[" + getExpression ( ) + "] is not a valid SpEL expression" , e ) ; } } return parsedExpression ;
|
public class SFImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
|
switch ( featureID ) { case BasePackage . SF__CHILDREN : return ( ( InternalEList < ? > ) getChildren ( ) ) . basicRemove ( otherEnd , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
|
public class LogRecord { /** * 操作ログオブジェクトを作成します 。
* @ param logger
* ロガー
* @ param testStep
* テストステップ
* @ param messagePattern
* メッセージパターン
* @ param params
* メッセージパラメーター
* @ return 操作ログ */
public static LogRecord info ( SitLogger logger , TestStep testStep , MessagePattern messagePattern , Object ... params ) { } }
|
Object [ ] newParams = new Object [ ] { testStep . getItemName ( ) , testStep . getLocator ( ) } ; newParams = ArrayUtils . addAll ( newParams , params ) ; return info ( logger , testStep , messagePattern . getPattern ( ) , newParams ) ;
|
public class XMLConfigAdmin { /** * set if it ' s develop mode or not
* @ param developmode
* @ throws SecurityException */
public void updateMode ( Boolean developmode ) throws SecurityException { } }
|
checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_SETTING ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update scope setting" ) ; Element mode = _getRootElement ( "mode" ) ; mode . setAttribute ( "develop" , Caster . toString ( developmode , "" ) ) ;
|
public class DateUtils { /** * Get how many months between two date .
* @ param date1 date to be tested .
* @ param date2 date to be tested .
* @ return how many months between two date . */
public static long subMonths ( final Date date1 , final Date date2 ) { } }
|
Calendar calendar1 = buildCalendar ( date1 ) ; int monthOfDate1 = calendar1 . get ( Calendar . MONTH ) ; int yearOfDate1 = calendar1 . get ( Calendar . YEAR ) ; Calendar calendar2 = buildCalendar ( date2 ) ; int monthOfDate2 = calendar2 . get ( Calendar . MONTH ) ; int yearOfDate2 = calendar2 . get ( Calendar . YEAR ) ; int subMonth = Math . abs ( monthOfDate1 - monthOfDate2 ) ; int subYear = Math . abs ( yearOfDate1 - yearOfDate2 ) ; return subYear * 12 + subMonth ;
|
public class HttpRequestUtil { /** * Reads the " aerogear - sender " header to check if an AeroGear Sender client was used . If the header value is NULL
* the value of the standard " user - agent " header is returned
* @ param request to inspect
* @ return value of header */
public static String extractAeroGearSenderInformation ( final HttpServletRequest request ) { } }
|
String client = request . getHeader ( "aerogear-sender" ) ; if ( hasValue ( client ) ) { return client ; } // if there was no usage of our custom header , we simply return the user - agent value
return request . getHeader ( "user-agent" ) ;
|
public class LockStrategyFactory { /** * obtains a LockStrategy for Object obj . The Strategy to be used is
* selected by evaluating the ClassDescriptor of obj . getClass ( ) .
* @ return LockStrategy */
public static LockStrategy getStrategyFor ( Object obj ) { } }
|
int isolationLevel = getIsolationLevel ( obj ) ; switch ( isolationLevel ) { case IsolationLevels . IL_READ_UNCOMMITTED : return readUncommitedStrategy ; case IsolationLevels . IL_READ_COMMITTED : return readCommitedStrategy ; case IsolationLevels . IL_REPEATABLE_READ : return readRepeatableStrategy ; case IsolationLevels . IL_SERIALIZABLE : return serializableStrategy ; case IsolationLevels . IL_OPTIMISTIC : return noopStrategy ; case IsolationLevels . IL_NONE : return noopStrategy ; default : return readUncommitedStrategy ; }
|
public class WebDriverHelper { /** * Checks if the supplied { @ code element } contains another element
* identified by { @ code by } .
* @ param by
* the method of identifying the element
* @ param element
* the root element that will be searched
* @ return true if { @ code element } contains an element identified by
* { @ code by } or false otherwise */
public boolean isElementPresent ( final WebElement element , final By by ) { } }
|
try { element . findElement ( by ) ; } catch ( Exception e ) { return false ; } return true ;
|
public class JSLocalConsumerPoint { /** * If the caller prepared the add of an active message they must come back
* with either a commit or rollback of that prepare .
* This method commits the add of the active message , i . e a message was actually
* locked to the consumer
* NOTE : Callers to this method will still have the JSLocalConsumerPoint locked
* since the prepare */
private void commitAddActiveMessage ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commitAddActiveMessage" ) ; // If this consumer is in a set then commit the add to the set
_consumerKey . commitAddActiveMessage ( ) ; // Check the _ maxActiveMessage counter for this specific consumer .
// We ' re only interested if we ' re counting messages and we can only do that if
// we ' re bifurcatable
if ( _bifurcatable && ( _maxActiveMessages != 0 ) ) { // Lock down the active message counter ( removing an active message will
// only hold this lock , not the ' this ' lock )
synchronized ( _maxActiveMessageLock ) { // Add the message to the local consumer count
_currentActiveMessages ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "_currentActiveMessages: " + _currentActiveMessages ) ; // If we ' ve reached the maximum , suspend the consumer
if ( _currentActiveMessages == _maxActiveMessages ) { // Suspend the consumer for the next time round
suspendConsumer ( DispatchableConsumerPoint . SUSPEND_FLAG_ACTIVE_MSGS ) ; // ( F001731)
// If we ' re monitoring the maxActiveMessage limit then start an alarm that
// will ping when the allowable suspended time passes
if ( _activeMsgBlockInterval > - 1 ) { if ( _activeMsgBlockAlarm == null ) _activeMsgBlockAlarm = new ActiveMsgBlockAlarm ( ) ; _activeMsgBlockAlarm . startAlarm ( ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commitAddActiveMessage" ) ;
|
public class Utils { /** * Extract the bytes in the given ByteBuffer and return it as a byte [ ] without
* affecting the mark , position , or limit of the given buffer . This method should be
* used instead of { @ link # getBytes ( ByteBuffer ) } when the ByteBuffer might be re - read
* again .
* @ param bytes ByteBuffer .
* @ return Contents between ' position ' and ' limit ' ( aka ' remaining ' ) as a
* byte [ ] . Parameter object is unaffected . */
public static byte [ ] copyBytes ( ByteBuffer bytes ) { } }
|
ByteBuffer copy = bytes . duplicate ( ) ; byte [ ] result = new byte [ copy . remaining ( ) ] ; // bytes between position and limit
copy . get ( result ) ; return result ;
|
public class PSDUtil { /** * TODO : Probably also useful for PICT reader , move to some common util ? */
static String readUnicodeString ( final DataInput pInput ) throws IOException { } }
|
int length = pInput . readInt ( ) ; if ( length == 0 ) { return "" ; } byte [ ] bytes = new byte [ length * 2 ] ; pInput . readFully ( bytes ) ; return StringUtil . decode ( bytes , 0 , bytes . length , "UTF-16" ) ;
|
public class GeneratedModel { /** * Takes a HashMap mapping column names to doubles .
* Looks up the column names needed by the model , and places the doubles into the data array in
* the order needed by the model . Missing columns use NaN . */
public double [ ] map ( Map < String , Double > row , double data [ ] ) { } }
|
String [ ] colNames = getNames ( ) ; for ( int i = 0 ; i < colNames . length - 1 ; i ++ ) { Double d = row . get ( colNames [ i ] ) ; data [ i ] = d == null ? Double . NaN : d ; } return data ;
|
public class TransactionService { /** * This function updates the description of a { @ link Transaction } and refresh its data .
* @ param transaction
* A { @ link Transaction } to be updated . */
public void update ( Transaction transaction ) { } }
|
RestfulUtils . update ( TransactionService . PATH , transaction , Transaction . class , super . httpClient ) ;
|
public class ReceiveMessageAction { /** * Method receives a message via { @ link com . consol . citrus . endpoint . Endpoint } instance
* constructs a validation context and starts the message validation
* via { @ link MessageValidator } .
* @ throws CitrusRuntimeException */
@ Override public void doExecute ( TestContext context ) { } }
|
try { Message receivedMessage ; String selector = MessageSelectorBuilder . build ( messageSelector , messageSelectorMap , context ) ; // receive message either selected or plain with message receiver
if ( StringUtils . hasText ( selector ) ) { receivedMessage = receiveSelected ( context , selector ) ; } else { receivedMessage = receive ( context ) ; } if ( receivedMessage == null ) { throw new CitrusRuntimeException ( "Failed to receive message - message is not available" ) ; } // validate the message
validateMessage ( receivedMessage , context ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( e ) ; }
|
public class Faker { /** * Fill { @ link ToggleButton } on and off text
* @ param view
* @ param component */
public void fillOnAndOffWithText ( ToggleButton view , FakerTextComponent component ) { } }
|
validateNotNullableView ( view ) ; validateIfIsAToggleButton ( view ) ; validateNotNullableFakerComponent ( component ) ; String word = component . randomText ( ) ; view . setTextOff ( word ) ; view . setTextOn ( word ) ;
|
public class ByteMatchSetMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ByteMatchSet byteMatchSet , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( byteMatchSet == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( byteMatchSet . getByteMatchSetId ( ) , BYTEMATCHSETID_BINDING ) ; protocolMarshaller . marshall ( byteMatchSet . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( byteMatchSet . getByteMatchTuples ( ) , BYTEMATCHTUPLES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class WrappedByteBuffer { /** * Puts a buffer into the buffer at the current position .
* @ param v the WrappedByteBuffer
* @ return the buffer */
public WrappedByteBuffer putBuffer ( WrappedByteBuffer v ) { } }
|
_autoExpand ( v . remaining ( ) ) ; _buf . put ( v . _buf ) ; return this ;
|
public class Ec2InstanceAttributes { /** * Applies to clusters configured with the instance fleets option . Specifies the unique identifier of one or more
* Amazon EC2 subnets in which to launch EC2 cluster instances . Subnets must exist within the same VPC . Amazon EMR
* chooses the EC2 subnet with the best fit from among the list of < code > RequestedEc2SubnetIds < / code > , and then
* launches all cluster instances within that Subnet . If this value is not specified , and the account and region
* support EC2 - Classic networks , the cluster launches instances in the EC2 - Classic network and uses
* < code > RequestedEc2AvailabilityZones < / code > instead of this setting . If EC2 - Classic is not supported , and no
* Subnet is specified , Amazon EMR chooses the subnet for you . < code > RequestedEc2SubnetIDs < / code > and
* < code > RequestedEc2AvailabilityZones < / code > cannot be specified together .
* @ return Applies to clusters configured with the instance fleets option . Specifies the unique identifier of one or
* more Amazon EC2 subnets in which to launch EC2 cluster instances . Subnets must exist within the same VPC .
* Amazon EMR chooses the EC2 subnet with the best fit from among the list of
* < code > RequestedEc2SubnetIds < / code > , and then launches all cluster instances within that Subnet . If this
* value is not specified , and the account and region support EC2 - Classic networks , the cluster launches
* instances in the EC2 - Classic network and uses < code > RequestedEc2AvailabilityZones < / code > instead of this
* setting . If EC2 - Classic is not supported , and no Subnet is specified , Amazon EMR chooses the subnet for
* you . < code > RequestedEc2SubnetIDs < / code > and < code > RequestedEc2AvailabilityZones < / code > cannot be
* specified together . */
public java . util . List < String > getRequestedEc2SubnetIds ( ) { } }
|
if ( requestedEc2SubnetIds == null ) { requestedEc2SubnetIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return requestedEc2SubnetIds ;
|
public class StdIODialog { /** * Starts communicating .
* This method blocks until the dialog or the underlying ( transceiver ) process is closed . */
public void run ( ) { } }
|
byte [ ] buffer = new byte [ 80 ] ; byte [ ] message ; int count = 0 ; while ( ! closed && count >= 0 ) { try { // statement blocks
count = stdIn . read ( buffer ) ; } catch ( IOException ioe ) { close ( ) ; } if ( count > 0 ) { message = new byte [ count ] ; System . arraycopy ( buffer , 0 , message , 0 , count ) ; if ( ! closed ) { transceiver . transmit ( message ) ; } else { try { stdOut . write ( ( "dialog closed: unable to transmit '" + new String ( message ) . trim ( ) + "'..." ) . getBytes ( ) ) ; } catch ( IOException ioe ) { } } } }
|
public class BoxApiFile { /** * Commit an upload session after all parts have been uploaded , creating the new file or the version
* @ param uploadedParts the list of uploaded parts to be committed .
* @ param attributes the key value pairs of attributes from the file instance .
* @ param ifMatch ensures that your app only alters files / folders on Box if you have the current version .
* @ param ifNoneMatch ensure that it retrieve unnecessary data if the most current version of file is on - hand .
* @ param uploadSession the BoxUploadSession
* @ return the created file instance . */
public BoxRequestsFile . CommitUploadSession getCommitSessionRequest ( List < BoxUploadSessionPart > uploadedParts , Map < String , String > attributes , String ifMatch , String ifNoneMatch , BoxUploadSession uploadSession ) { } }
|
return new BoxRequestsFile . CommitUploadSession ( uploadedParts , attributes , ifMatch , ifNoneMatch , uploadSession , mSession ) ;
|
public class ParameterizedTypeImpl { /** * 追加 { @ code types } 到 @ { code buf } , 使用 { @ code sep } 分隔
* @ param buf 目标
* @ param sep 分隔符
* @ param types 加入的类型
* @ return { @ code buf } */
private static StringBuilder appendAllTo ( final StringBuilder buf , final String sep , final Type ... types ) { } }
|
if ( ArrayUtil . isNotEmpty ( types ) ) { boolean isFirst = true ; for ( Type type : types ) { if ( isFirst ) { isFirst = false ; } else { buf . append ( sep ) ; } String typeStr ; if ( type instanceof Class ) { typeStr = ( ( Class < ? > ) type ) . getName ( ) ; } else { typeStr = StrUtil . toString ( type ) ; } buf . append ( typeStr ) ; } } return buf ;
|
public class PartInputStream { /** * Fill up our buffer from the underlying input stream , and check for the
* boundary that signifies end - of - file . Users of this method must ensure
* that they leave exactly 2 characters in the buffer before calling this
* method ( except the first time ) , so that we may only use these characters
* if a boundary is not found in the first line read .
* @ exception IOException if an I / O error occurs . */
private void fill ( ) throws IOException { } }
|
if ( eof ) return ; // as long as we are not just starting up
if ( count > 0 ) { // if the caller left the requisite amount spare in the buffer
if ( count - pos == 2 ) { // copy it back to the start of the buffer
System . arraycopy ( buf , pos , buf , 0 , count - pos ) ; count -= pos ; pos = 0 ; } else { // should never happen , but just in case
throw new IllegalStateException ( "fill() detected illegal buffer state" ) ; } } // Try and fill the entire buffer , starting at count , line by line
// but never read so close to the end that we might split a boundary
// Thanks to Tony Chu , tony . chu @ brio . com , for the - 2 suggestion .
int read = 0 ; int boundaryLength = boundary . length ( ) ; int maxRead = buf . length - boundaryLength - 2 ; // -2 is for / r / n
while ( count < maxRead ) { // read a line
read = ( ( ServletInputStream ) in ) . readLine ( buf , count , buf . length - count ) ; // check for eof and boundary
if ( read == - 1 ) { throw new IOException ( "unexpected end of part" ) ; } else { if ( read >= boundaryLength ) { eof = true ; for ( int i = 0 ; i < boundaryLength ; i ++ ) { if ( boundary . charAt ( i ) != buf [ count + i ] ) { // Not the boundary !
eof = false ; break ; } } if ( eof ) { break ; } } } // success
count += read ; }
|
public class XMLDataWriter { /** * / * package */
static String makeXmlName ( String name ) { } }
|
if ( name . length ( ) == 0 ) name = "_" ; if ( ! XmlChars . isNameStart ( name . charAt ( 0 ) ) ) { if ( name . length ( ) > 1 && XmlChars . isNameStart ( name . charAt ( 1 ) ) ) name = name . substring ( 1 ) ; else name = '_' + name ; } int i = 1 ; while ( i < name . length ( ) ) { if ( XmlChars . isNameChar ( name . charAt ( i ) ) ) i ++ ; else name = name . substring ( 0 , i ) + name . substring ( i + 1 ) ; } return name ;
|
public class NumberUtil { /** * 提供精确的减法运算 < br >
* 如果传入多个值为null或者空 , 则返回0
* @ param values 多个被减值
* @ return 差
* @ since 4.0.0 */
public static BigDecimal sub ( Number ... values ) { } }
|
if ( ArrayUtil . isEmpty ( values ) ) { return BigDecimal . ZERO ; } Number value = values [ 0 ] ; BigDecimal result = new BigDecimal ( null == value ? "0" : value . toString ( ) ) ; for ( int i = 1 ; i < values . length ; i ++ ) { value = values [ i ] ; if ( null != value ) { result = result . subtract ( new BigDecimal ( value . toString ( ) ) ) ; } } return result ;
|
public class Error { /** * Thrown when the target field doesn ' t exist .
* @ param mappedFieldName name of the mapped field
* @ param mappedClassName name of the mapped field ' s class
* @ param targetFieldName name of the target field
* @ param targetClassName name of the target field ' s class */
public static void mapping ( String mappedFieldName , String mappedClassName , String targetFieldName , String targetClassName ) { } }
|
throw new MappingErrorException ( MSG . INSTANCE . message ( mappingErrorException4 , mappedFieldName , mappedClassName , targetFieldName , targetClassName ) ) ;
|
public class Ollie { /** * Finder methods */
static < D , S > TypeAdapter < D , S > getTypeAdapter ( Class < D > cls ) { } }
|
return ( TypeAdapter < D , S > ) sAdapterHolder . getTypeAdapter ( cls ) ;
|
public class MCFRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } }
|
switch ( featureID ) { case AfplibPackage . MCFRG__RG_LENGTH : return RG_LENGTH_EDEFAULT == null ? rgLength != null : ! RG_LENGTH_EDEFAULT . equals ( rgLength ) ; case AfplibPackage . MCFRG__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
|
public class XMLDataWriter { /** * Returns the name to be used as an element name
* by considering { @ link # isArray } */
private String adjustName ( ) { } }
|
String escaped = makeXmlName ( name ) ; if ( isArray . peek ( ) ) return toSingular ( escaped ) ; return escaped ;
|
public class DefaultInternalConfiguration { /** * { @ inheritDoc } */
@ Override public float getFloat ( final String key , final float defaultValue ) { } }
|
try { String value = get ( key ) ; if ( value == null ) { return defaultValue ; } return Float . parseFloat ( value ) ; } catch ( NumberFormatException ex ) { throw new ConversionException ( ex ) ; }
|
public class DatabaseAccountsInner { /** * Regenerates an access key for the specified Azure Cosmos DB database account .
* @ param resourceGroupName Name of an Azure resource group .
* @ param accountName Cosmos DB database account name .
* @ param keyKind The access key to regenerate . Possible values include : ' primary ' , ' secondary ' , ' primaryReadonly ' , ' secondaryReadonly '
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < ServiceResponse < Void > > beginRegenerateKeyWithServiceResponseAsync ( String resourceGroupName , String accountName , KeyKind keyKind ) { } }
|
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( keyKind == null ) { throw new IllegalArgumentException ( "Parameter keyKind is required and cannot be null." ) ; } DatabaseAccountRegenerateKeyParameters keyToRegenerate = new DatabaseAccountRegenerateKeyParameters ( ) ; keyToRegenerate . withKeyKind ( keyKind ) ; return service . beginRegenerateKey ( this . client . subscriptionId ( ) , resourceGroupName , accountName , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , keyToRegenerate , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = beginRegenerateKeyDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class CmsExplorerTypeSettings { /** * Gets the view order , optionally using a default value if the view order is not configured . < p >
* @ param useDefault true if a default should be returned in the case where the view order is not configured
* @ return the view order */
public Integer getViewOrder ( boolean useDefault ) { } }
|
Integer defaultViewOrder = getDefaultViewOrder ( m_name ) ; Integer result = null ; if ( m_viewOrder != null ) { result = m_viewOrder ; } else if ( useDefault ) { if ( defaultViewOrder != null ) { result = defaultViewOrder ; } else { result = new Integer ( 9999 ) ; } } return result ;
|
public class ParosTableStructure { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . paros . TableParam # read ( long ) */
@ Override public synchronized RecordStructure read ( long sessionId , long urlId ) throws DatabaseException { } }
|
try { psRead . setLong ( 1 , sessionId ) ; psRead . setLong ( 2 , urlId ) ; try ( ResultSet rs = psRead . executeQuery ( ) ) { RecordStructure result = build ( rs ) ; return result ; } } catch ( SQLException e ) { throw new DatabaseException ( e ) ; }
|
public class JsMessageImpl { /** * Get the approximate size of the message in memory .
* This will be a will be a quick and inexpensive ( but potentially very
* inaccurate ) calculation of the amount of space occupied in the heap by
* a message which is both fully - fluffy and flattened ( i . e . worst case ) .
* Being both fluffy and flattened is also a description of a badger when it
* meets a lorry . ( GW )
* Javadoc description supplied by JsMessage interface . */
public int getInMemorySize ( ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getInMemorySize" ) ; // The fluffed size needs to be calculated if it hasn ' t already been set .
if ( fluffedSize == - 1 ) { fluffedSize = guessFluffedSize ( ) ; } // Add together the values for the approximate encoded length & the fluffed size .
// Use getApproximateLength ( ) for the encoded length , so that we pick up any cached value .
int inMemorySize = getApproximateLength ( ) + fluffedSize ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getInMemorySize" , inMemorySize ) ; return inMemorySize ;
|
public class NumberUtil { /** * 提供 ( 相对 ) 精确的除法运算 , 当发生除不尽的情况时 , 由scale指定精确度 , 后面的四舍五入
* @ param v1 被除数
* @ param v2 除数
* @ param scale 精确度 , 如果为负值 , 取绝对值
* @ return 两个参数的商 */
public static BigDecimal div ( String v1 , String v2 , int scale ) { } }
|
return div ( v1 , v2 , scale , RoundingMode . HALF_UP ) ;
|
public class ViewUtils { /** * Convert the pixels to sips , based on density scale .
* @ param context the context .
* @ param pixels to be converted value .
* @ return converted value ( sip ) */
public static float pixelToSip ( Context context , float pixels ) { } }
|
DisplayMetrics metrics = new DisplayMetrics ( ) ; float scaledDensity = metrics . scaledDensity ; if ( pixels == 0 || scaledDensity == 0 ) { return 1 ; } return pixels / scaledDensity ;
|
public class WriteExcelUtils { /** * 向工作簿中写入beans , 所有bean写在一个Sheet中 , 默认以bean中的所有属性作为标题且写入第0行 , 0 - based 。 并输出到指定file中
* @ param file 指定Excel输出文件
* @ param excelType 输出Excel文件类型 { @ link # XLSX } 或者 { @ link # XLS } , 此类型必须与file文件名后缀匹配
* @ param beans 指定写入的Beans ( 或者泛型为Map )
* @ param dateFormat 日期格式
* @ throws WriteExcelException */
public static < T > void writeWorkBook ( File file , int excelType , List < T > beans , String dateFormat ) throws WriteExcelException { } }
|
if ( beans == null || beans . isEmpty ( ) ) { throw new WriteExcelException ( "beans参数不能为空" ) ; } Map < String , Object > map = null ; if ( beans . get ( 0 ) instanceof Map ) { map = ( Map < String , Object > ) beans . get ( 0 ) ; } else { map = CommonUtils . toMap ( beans . get ( 0 ) ) ; } if ( map == null ) { throw new WriteExcelException ( "获取bean属性失败" ) ; } List < String > properties = new ArrayList < String > ( ) ; properties . addAll ( map . keySet ( ) ) ; WriteExcelUtils . writeWorkBook ( file , excelType , beans , properties , properties , dateFormat ) ;
|
public class URLUtils { /** * Convert URI reference to system file path .
* @ param filename URI to convert to system file path , may be relative or absolute
* @ return file path , { @ code null } if input was { @ code null } */
public static File toFile ( final URI filename ) { } }
|
if ( filename == null ) { return null ; } final URI f = stripFragment ( filename ) ; if ( "file" . equals ( f . getScheme ( ) ) && f . getPath ( ) != null && f . isAbsolute ( ) ) { return new File ( f ) ; } else { return toFile ( f . toString ( ) ) ; }
|
public class GPX { /** * Read an GPX object from the given { @ code input } stream . This method is a
* shortcut for
* < pre > { @ code
* final GPX gpx = GPX . reader ( ) . read ( input ) ;
* } < / pre >
* @ param input the input stream from where the GPX date is read
* @ return the GPX object read from the input stream
* @ throws IOException if the GPX object can ' t be read
* @ throws NullPointerException if the given { @ code input } stream is
* { @ code null } */
public static GPX read ( final InputStream input ) throws IOException { } }
|
return reader ( Version . V11 , Mode . STRICT ) . read ( input ) ;
|
public class TypefaceUtils { /** * A helper loading custom spans so we don ' t have to keep creating hundreds of spans .
* @ param typeface not null typeface
* @ return will return null of typeface passed in is null . */
public static CalligraphyTypefaceSpan getSpan ( final Typeface typeface ) { } }
|
if ( typeface == null ) return null ; synchronized ( sCachedSpans ) { if ( ! sCachedSpans . containsKey ( typeface ) ) { final CalligraphyTypefaceSpan span = new CalligraphyTypefaceSpan ( typeface ) ; sCachedSpans . put ( typeface , span ) ; return span ; } return sCachedSpans . get ( typeface ) ; }
|
public class FessMessages { /** * Add the created action message for the key ' constraints . EAN . message ' with parameters .
* < pre >
* message : { item } is invalid { type } barcode .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ param type The parameter type for message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMessages addConstraintsEanMessage ( String property , String type ) { } }
|
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( CONSTRAINTS_EAN_MESSAGE , type ) ) ; return this ;
|
public class PlotCanvas { /** * Adds a poly line plot to this canvas .
* @ param data a n x 2 or n x 3 matrix that describes coordinates of points .
* @ param style the stroke style of line .
* @ param color the color of line . */
public LinePlot line ( double [ ] [ ] data , Line . Style style , Color color ) { } }
|
return line ( null , data , style , color ) ;
|
public class LayoutManager { /** * Prompts to save layout .
* @ param layout Layout to save .
* @ param layoutId Layout identifier
* @ param hideScope If true , hide shared / private scope selection .
* @ param callback Callback if layout successfully saved . */
public static void saveLayout ( Layout layout , LayoutIdentifier layoutId , boolean hideScope , IResponseCallback < LayoutIdentifier > callback ) { } }
|
LayoutPrompt . show ( layoutId , hideScope , true , CAP_LAYOUT_SAVE , MSG_LAYOUT_SAVE , ( event ) -> { LayoutIdentifier id = event . getTarget ( ) . getAttribute ( "layoutId" , LayoutIdentifier . class ) ; if ( id != null ) { layout . saveToProperty ( id ) ; if ( callback != null ) { callback . onComplete ( id ) ; } }
|
public class LazyElement { /** * Returns the number of fields on this object
* @ return the number of fields */
public int length ( ) { } }
|
if ( root . child == null ) { return 0 ; } if ( length > - 1 ) { return length ; } length = root . getChildCount ( ) ; return length ;
|
public class Jenkins { /** * Gets the markup formatter used in the system .
* @ return
* never null .
* @ since 1.391 */
public @ Nonnull MarkupFormatter getMarkupFormatter ( ) { } }
|
MarkupFormatter f = markupFormatter ; return f != null ? f : new EscapedMarkupFormatter ( ) ;
|
public class CoreOAuthConsumerSupport { /** * Open a connection to the given URL .
* @ param requestTokenURL The request token URL .
* @ return The HTTP URL connection . */
protected HttpURLConnection openConnection ( URL requestTokenURL ) { } }
|
try { HttpURLConnection connection = ( HttpURLConnection ) requestTokenURL . openConnection ( selectProxy ( requestTokenURL ) ) ; connection . setConnectTimeout ( getConnectionTimeout ( ) ) ; connection . setReadTimeout ( getReadTimeout ( ) ) ; return connection ; } catch ( IOException e ) { throw new OAuthRequestFailedException ( "Failed to open an OAuth connection." , e ) ; }
|
public class PatchedBigQueryTableRowIterator { /** * Delete the given table that is available in the given dataset . */
private void deleteTable ( String datasetId , String tableId ) throws IOException , InterruptedException { } }
|
executeWithBackOff ( client . tables ( ) . delete ( projectId , datasetId , tableId ) , String . format ( "Error when trying to delete the temporary table %s in dataset %s of project %s. " + "Manual deletion may be required." , tableId , datasetId , projectId ) ) ;
|
public class XMLMessageSource { /** * / * ( non - Javadoc )
* @ see org . springframework . context . support . AbstractMessageSource # resolveCode ( java . lang . String , java . util . Locale ) */
@ Override protected MessageFormat resolveCode ( String code , Locale locale ) { } }
|
String ret = null ; String country = locale . getCountry ( ) ; String language = locale . getLanguage ( ) ; String variant = locale . getVariant ( ) ; logger . debug ( "Code {} Initial locale {}" , code , locale . toString ( ) ) ; Locale thisLocale = null ; if ( ! StringUtils . isEmpty ( variant ) ) { thisLocale = new Locale ( language , country , variant ) ; Map < String , String > m = m_map . get ( thisLocale ) ; if ( m != null ) { ret = m . get ( code ) ; } logger . debug ( "tried locale {} result: {}" , thisLocale . toString ( ) , ret ) ; } if ( ret == null ) { if ( ! StringUtils . isEmpty ( country ) ) { thisLocale = new Locale ( language , country ) ; Map < String , String > m = m_map . get ( thisLocale ) ; if ( m != null ) { ret = m . get ( code ) ; } logger . debug ( "tried locale {} result: {}" , thisLocale . toString ( ) , ret ) ; } } if ( ret == null ) { if ( ! StringUtils . isEmpty ( language ) ) { thisLocale = new Locale ( language ) ; Map < String , String > m = m_map . get ( thisLocale ) ; if ( m != null ) { ret = m . get ( code ) ; } logger . debug ( "tried locale {} result: {}" , thisLocale . toString ( ) , ret ) ; } } if ( ret == null ) { thisLocale = Locale . getDefault ( ) ; Map < String , String > m = m_map . get ( thisLocale ) ; if ( m != null ) { ret = m . get ( code ) ; } logger . debug ( "tried locale {} result: {}" , thisLocale . toString ( ) , ret ) ; } if ( ret == null ) { return null ; } return new MessageFormat ( ret , locale ) ;
|
public class Utils4J { /** * Creates an URL based on a directory a relative path and a filename .
* @ param baseUrl
* Directory URL with or without slash ( " / " ) at the end of the string - Cannot be < code > null < / code > .
* @ param path
* Relative path inside the base URL ( with or without slash ( " / " ) at the end of the string ) - Can be < code > null < / code > or an
* empty string .
* @ param filename
* Filename without path - Cannot be < code > null < / code > .
* @ return URL . */
public static URL createUrl ( final URL baseUrl , final String path , final String filename ) { } }
|
checkNotNull ( "baseUrl" , baseUrl ) ; checkNotNull ( "filename" , filename ) ; try { String baseUrlStr = baseUrl . toString ( ) ; if ( ! baseUrlStr . endsWith ( SLASH ) ) { baseUrlStr = baseUrlStr + SLASH ; } final String pathStr ; if ( ( path == null ) || ( path . length ( ) == 0 ) ) { pathStr = "" ; } else { if ( path . endsWith ( SLASH ) ) { pathStr = path ; } else { pathStr = path + SLASH ; } } return new URL ( baseUrlStr + pathStr + filename ) ; } catch ( final IOException ex ) { throw new RuntimeException ( ex ) ; }
|
public class ReactiveTypes { /** * Returns { @ literal true } if the { @ link ReactiveLibrary } is available .
* @ param reactiveLibrary must not be { @ literal null } .
* @ return { @ literal true } if the { @ link ReactiveLibrary } is available . */
public static boolean isAvailable ( ReactiveLibrary reactiveLibrary ) { } }
|
LettuceAssert . notNull ( reactiveLibrary , "ReactiveLibrary must not be null!" ) ; switch ( reactiveLibrary ) { case PROJECT_REACTOR : return PROJECT_REACTOR_PRESENT ; case RXJAVA1 : return RXJAVA1_PRESENT ; case RXJAVA2 : return RXJAVA2_PRESENT ; } throw new IllegalArgumentException ( String . format ( "ReactiveLibrary %s not supported" , reactiveLibrary ) ) ;
|
public class HelpWriter { /** * Get the help label .
* @ return a content tree for the help label */
@ Override protected Content getNavLinkHelp ( ) { } }
|
Content li = HtmlTree . LI ( HtmlStyle . navBarCell1Rev , helpLabel ) ; return li ;
|
public class AbstractJointConverter { /** * Utility method to construct converter from 2 functions
* @ param < F > type to convert from
* @ param to function to convert to String
* @ param from function to convert from String
* @ return converter */
public static < F > AbstractJointConverter < F > of ( final SerializableFunction < ? super F , String > to , final SerializableFunction < String , ? extends F > from ) { } }
|
return new AbstractJointConverter < F > ( ) { @ Override public String convertToString ( F value , Locale locale ) { return to . apply ( value ) ; } @ Override public F convertToObject ( String value , Locale locale ) throws ConversionException { return from . apply ( value ) ; } } ;
|
public class SimpleDateFormat { /** * Translate a pattern , mapping each character in the from string to the
* corresponding character in the to string . */
private String translatePattern ( String pat , String from , String to ) { } }
|
StringBuilder result = new StringBuilder ( ) ; boolean inQuote = false ; for ( int i = 0 ; i < pat . length ( ) ; ++ i ) { char c = pat . charAt ( i ) ; if ( inQuote ) { if ( c == '\'' ) inQuote = false ; } else { if ( c == '\'' ) { inQuote = true ; } else if ( isSyntaxChar ( c ) ) { int ci = from . indexOf ( c ) ; if ( ci != - 1 ) { c = to . charAt ( ci ) ; } // do not worry on translatepattern if the character is not listed
// we do the validity check elsewhere
} } result . append ( c ) ; } if ( inQuote ) { throw new IllegalArgumentException ( "Unfinished quote in pattern" ) ; } return result . toString ( ) ;
|
public class Reservation { /** * Create a ReservationUpdater to execute update .
* @ param pathWorkspaceSid The workspace _ sid
* @ param pathWorkerSid The worker _ sid
* @ param pathSid The sid
* @ return ReservationUpdater capable of executing the update */
public static ReservationUpdater updater ( final String pathWorkspaceSid , final String pathWorkerSid , final String pathSid ) { } }
|
return new ReservationUpdater ( pathWorkspaceSid , pathWorkerSid , pathSid ) ;
|
public class OSGiServiceRegistryProxyTargetLocator { /** * < p > fetchReferences . < / p >
* @ return an array of { @ link org . osgi . framework . ServiceReference } objects . */
public ServiceReference < ? > [ ] fetchReferences ( ) { } }
|
try { LOGGER . debug ( "Try to locate a suitable service for objectClass = " + serviceInterface + " and filter = " + filterString ) ; return bundleContext . getAllServiceReferences ( serviceInterface , filterString ) ; } catch ( InvalidSyntaxException e ) { LOGGER . error ( "Creation of filter failed: {}" , e . getMessage ( ) , e ) ; throw new RuntimeException ( "Creation of filter failed" , e ) ; }
|
public class TransformQuery { /** * Retrieve the transformed entry from Contentful .
* @ param id the id of the entry of type Transformed .
* @ return the Transformed entry .
* @ throws CDAResourceNotFoundException if no such resource was found .
* @ throws IllegalStateException if the transformed class could not be created .
* @ throws IllegalStateException if the transformed class could not be accessed . */
public Flowable < Transformed > one ( String id ) { } }
|
try { return baseQuery ( ) . one ( id ) . filter ( new Predicate < CDAEntry > ( ) { @ Override public boolean test ( CDAEntry entry ) { return entry . contentType ( ) . id ( ) . equals ( contentTypeId ) ; } } ) . map ( new Function < CDAEntry , Transformed > ( ) { @ Override public Transformed apply ( CDAEntry entry ) throws Exception { return TransformQuery . this . transform ( entry ) ; } } ) ; } catch ( NullPointerException e ) { throw new CDAResourceNotFoundException ( CDAEntry . class , id ) ; }
|
public class CodeBook { /** * returns the number of bits and * modifies a * to the remainder value */
int encodevs ( float [ ] a , Buffer b , int step , int addmul ) { } }
|
int best = besterror ( a , step , addmul ) ; return ( encode ( best , b ) ) ;
|
public class LauncherDelegateImpl { /** * { @ inheritDoc } */
@ Override public boolean waitForReady ( ) throws InterruptedException { } }
|
managerLatch . await ( ) ; return manager == null ? false : manager . waitForReady ( ) ;
|
public class SimpleBeanBoundTableModel { /** * Return the top level bean for this row index .
* @ param row the row index
* @ return the root row bean ( ie top level ) for this index */
protected Object getTopRowBean ( final List < Integer > row ) { } }
|
// Get root level
List < ? > lvl = getBeanList ( ) ; if ( lvl == null || lvl . isEmpty ( ) ) { return null ; } // Get root row bean ( ie top level )
int rowIdx = row . get ( 0 ) ; Object rowData = lvl . get ( rowIdx ) ; return rowData ;
|
public class DescribeAvailabilityZonesRequest { /** * The IDs of the Availability Zones .
* @ param zoneIds
* The IDs of the Availability Zones . */
public void setZoneIds ( java . util . Collection < String > zoneIds ) { } }
|
if ( zoneIds == null ) { this . zoneIds = null ; return ; } this . zoneIds = new com . amazonaws . internal . SdkInternalList < String > ( zoneIds ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.