signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class StringUtilities { /** * Checks that a string buffer ends up with a given string . * @ param buffer The buffer to perform the check on * @ param suffix The suffix * @ return < code > true < / code > if the character sequence represented by the * argument is a suffix of the character sequence represe...
if ( suffix . length ( ) > buffer . length ( ) ) return false ; int endIndex = suffix . length ( ) - 1 ; int bufferIndex = buffer . length ( ) - 1 ; while ( endIndex >= 0 ) { if ( buffer . charAt ( bufferIndex ) != suffix . charAt ( endIndex ) ) return false ; bufferIndex -- ; endIndex -- ; } return true ;
public class FlexBase64 { /** * Encodes a fixed and complete byte array into a Base64url String . * < p > This method is only useful for applications which require a String and have all data to be encoded up - front . * Note that byte arrays or buffers are almost always a better storage choice . They consume half t...
return Encoder . encodeString ( source , 0 , source . length , wrap , true ) ;
public class Encoder { /** * Encodes the given binary content as an Aztec symbol * @ param data input data string * @ param minECCPercent minimal percentage of error check words ( According to ISO / IEC 24778:2008, * a minimum of 23 % + 3 words is recommended ) * @ param userSpecifiedLayers if non - zero , a us...
// High - level encode BitArray bits = new HighLevelEncoder ( data ) . encode ( ) ; // stuff bits and choose symbol size int eccBits = bits . getSize ( ) * minECCPercent / 100 + 11 ; int totalSizeBits = bits . getSize ( ) + eccBits ; boolean compact ; int layers ; int totalBitsInLayer ; int wordSize ; BitArray stuffedB...
public class GrpcServiceBuilder { /** * Adds gRPC { @ link BindableService } s to this { @ link GrpcServiceBuilder } . Most gRPC service * implementations are { @ link BindableService } s . */ public GrpcServiceBuilder addServices ( Iterable < BindableService > bindableServices ) { } }
requireNonNull ( bindableServices , "bindableServices" ) ; bindableServices . forEach ( this :: addService ) ; return this ;
public class ApiOvhMe { /** * Remove this RAID * REST : DELETE / me / installationTemplate / { templateName } / partitionScheme / { schemeName } / hardwareRaid / { name } * @ param templateName [ required ] This template name * @ param schemeName [ required ] name of this partitioning scheme * @ param name [ re...
String qPath = "/me/installationTemplate/{templateName}/partitionScheme/{schemeName}/hardwareRaid/{name}" ; StringBuilder sb = path ( qPath , templateName , schemeName , name ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class TableRef { /** * Applies a filter to the table . When fetched , it will return the items that contains the filter property value . * < pre > * StorageRef storage = new StorageRef ( " your _ app _ key " , " your _ token " ) ; * TableRef tableRef = storage . table ( " your _ table " ) ; * / / Retriev...
filters . add ( new Filter ( StorageFilter . CONTAINS , attributeName , value , null ) ) ; return this ;
public class IonTextUtils { /** * Generates a surrogate pair as two four - digit hex escape sequences , * { @ code " \ } { @ code u } < i > { @ code HHHH } < / i > { @ code \ } { @ code u } < i > { @ code HHHH } < / i > { @ code " } , * using lower - case for alphabetics . * This for necessary for JSON when the c...
for ( final char unit : Character . toChars ( c ) ) { printCodePointAsFourHexDigits ( out , unit ) ; }
public class RsaSignature { /** * See https : / / tools . ietf . org / html / rfc3447 # section - 9.2 */ protected byte [ ] EMSA_PKCS1_V1_5_ENCODE_HASH ( byte [ ] h , int emLen , String algorithm ) throws NoSuchAlgorithmException { } }
// Check m if ( h == null || h . length == 0 ) { throw new IllegalArgumentException ( "m" ) ; } byte [ ] algorithmPrefix = null ; // Check algorithm if ( Strings . isNullOrWhiteSpace ( algorithm ) ) { throw new IllegalArgumentException ( "algorithm" ) ; } // Only supported algorithms if ( algorithm . equals ( "SHA-256"...
public class PeasyViewHolder { /** * Will bind onClick and setOnLongClickListener here * @ param binder { @ link PeasyViewHolder } itself * @ param viewType viewType ID */ < T > void bindWith ( final PeasyRecyclerView < T > binder , final int viewType ) { } }
this . itemView . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { int position = getLayoutPosition ( ) ; position = ( position <= binder . getLastItemIndex ( ) ) ? position : getAdapterPosition ( ) ; position = ( position <= binder . getLastItemIndex ( ) ) ? position : ...
public class AbstractAttributeDefinitionBuilder { /** * Records that this attribute ' s value represents a reference to an instance of a * { @ link org . jboss . as . controller . capability . RuntimeCapability # isDynamicallyNamed ( ) dynamic capability } . * This method is a convenience method equivalent to calli...
if ( dependentCapability . isDynamicallyNamed ( ) ) { return setCapabilityReference ( referencedCapability , dependentCapability . getName ( ) ) ; } else { // noinspection deprecation return setCapabilityReference ( referencedCapability , dependentCapability . getName ( ) , false ) ; }
public class GraphicUtils { /** * Draws a circle with the specified diameter using the given point as center * and fills it with the current color of the graphics context . * @ param g Graphics context * @ param center Circle center * @ param diameter Circle diameter */ public static void fillCircle ( Graphics ...
fillCircle ( g , ( int ) center . getX ( ) , ( int ) center . getY ( ) , diameter ) ;
public class IssueFieldsSetter { /** * Used to set the author when it was null */ public boolean setNewAuthor ( DefaultIssue issue , @ Nullable String newAuthorLogin , IssueChangeContext context ) { } }
if ( isNullOrEmpty ( newAuthorLogin ) ) { return false ; } checkState ( issue . authorLogin ( ) == null , "It's not possible to update the author with this method, please use setAuthorLogin()" ) ; issue . setFieldChange ( context , AUTHOR , null , newAuthorLogin ) ; issue . setAuthorLogin ( newAuthorLogin ) ; issue . s...
public class DeleteFeatureAction { /** * Prepare a FeatureTransaction for deletion of the selected feature , and ask if the user wants to continue . If * he / she does , the feature will be deselected and then the FeatureTransaction will be committed . */ public void onClick ( MenuItemClickEvent event ) { } }
if ( feature != null && feature . isSelected ( ) ) { SC . confirm ( I18nProvider . getGlobal ( ) . confirmDeleteFeature ( feature . getLabel ( ) , feature . getLayer ( ) . getLabel ( ) ) , new BooleanCallback ( ) { public void execute ( Boolean value ) { if ( value ) { feature . getLayer ( ) . deselectFeature ( feature...
public class AbstractTriangle3F { /** * Checks if the projection of a point on the triangle ' s plane is inside the triangle . * @ param x * @ param y * @ param z * @ return < code > true < / code > if the projection of the point is in the triangle , otherwise < code > false < / code > . */ @ Pure public boolea...
Point3f proj = ( Point3f ) getPlane ( ) . getProjection ( x , y , z ) ; if ( proj == null ) { return false ; } return contains ( proj ) ;
public class PercentileBuckets { /** * Compute a percentile based on the counts for the buckets . * @ param counts * Counts for each of the buckets . The size must be the same as { @ link # length ( ) } and the * positions must correspond to the positions of the bucket values . * @ param p * Percentile to com...
double [ ] pcts = new double [ ] { p } ; double [ ] results = new double [ 1 ] ; percentiles ( counts , pcts , results ) ; return results [ 0 ] ;
public class InsertRingAction { /** * Insert a new point in the geometry at a given index . The index is taken from the context menu event . This * function will add a new empty interior ring in the polygon in question . * @ param event * The { @ link MenuItemClickEvent } from clicking the action . */ public void...
final FeatureTransaction ft = mapWidget . getMapModel ( ) . getFeatureEditor ( ) . getFeatureTransaction ( ) ; if ( ft != null && index != null ) { List < Feature > features = new ArrayList < Feature > ( ) ; features . add ( ft . getNewFeatures ( ) [ index . getFeatureIndex ( ) ] ) ; LazyLoader . lazyLoad ( features , ...
public class Accessibles { /** * Sets the { @ code accessible } flag of the given { @ code AccessibleObject } to the given { @ code boolean } value , ignoring * any thrown exception . * @ param o the given { @ code AccessibleObject } . * @ param accessible the value to set the { @ code accessible } flag to . */ p...
try { setAccessible ( o , accessible ) ; } catch ( RuntimeException ignored ) { String format = "Failed to set 'accessible' flag of %s to %s" ; logger . log ( Level . SEVERE , String . format ( format , o . toString ( ) , String . valueOf ( accessible ) ) , ignored ) ; }
public class ThreadLocalContext { /** * 取出ThreadLocal的上下文信息 . */ @ SuppressWarnings ( "unchecked" ) public static < T > T get ( String key ) { } }
return ( T ) ( contextMap . get ( ) . get ( key ) ) ;
public class Vector { /** * Returns a view of the portion of this List between fromIndex , * inclusive , and toIndex , exclusive . ( If fromIndex and toIndex are * equal , the returned List is empty . ) The returned List is backed by this * List , so changes in the returned List are reflected in this List , and ...
return Collections . synchronizedList ( super . subList ( fromIndex , toIndex ) , this ) ;
public class ApplicationCache { /** * Adds the application list to the applications for the account . * @ param applications The applications to add */ public void add ( Collection < Application > applications ) { } }
for ( Application application : applications ) this . applications . put ( application . getId ( ) , application ) ;
public class RStarTreeUtil { /** * Get an RTree range query , using an optimized double implementation when * possible . * @ param < O > Object type * @ param tree Tree to query * @ param distanceQuery distance query * @ param hints Optimizer hints * @ return Query object */ @ SuppressWarnings ( { } }
"cast" , "unchecked" } ) public static < O extends SpatialComparable > RangeQuery < O > getRangeQuery ( AbstractRStarTree < ? , ? , ? > tree , SpatialDistanceQuery < O > distanceQuery , Object ... hints ) { // Can we support this distance function - spatial distances only ! SpatialPrimitiveDistanceFunction < ? super O ...
public class EnterClickAdapter { /** * from interface KeyDownHandler */ public void onKeyDown ( KeyDownEvent event ) { } }
if ( event . getNativeKeyCode ( ) == KeyCodes . KEY_ENTER ) { _onEnter . onClick ( null ) ; }
public class UpdateConfigAction { /** * You may use this field to directly , programmatically add your own Map of * key , value pairs that you would like to send for this command . Setting * your own map will reset the command index to the number of keys in the * Map * @ see org . asteriskjava . manager . actio...
this . actions = actions ; this . actionCounter = actions . keySet ( ) . size ( ) ;
public class ExcelBase { /** * 关闭工作簿 < br > * 如果用户设定了目标文件 , 先写出目标文件后给关闭工作簿 */ @ Override public void close ( ) { } }
IoUtil . close ( this . workbook ) ; this . sheet = null ; this . workbook = null ; this . isClosed = true ;
public class GoogleMapShape { /** * Expand the bounding box by the LatLngs * @ param boundingBox bounding box * @ param latLngs lat lngs */ private void expandBoundingBox ( BoundingBox boundingBox , List < LatLng > latLngs ) { } }
for ( LatLng latLng : latLngs ) { expandBoundingBox ( boundingBox , latLng ) ; }
public class HawkbitCommonUtil { /** * Get javascript to reflect new color selection for preview button . * @ param color * changed color * @ return javascript for the selected color . */ public static String getPreviewButtonColorScript ( final String color ) { } }
return new StringBuilder ( ) . append ( PREVIEW_BUTTON_COLOR_REMOVE_SCRIPT ) . append ( PREVIEW_BUTTON_COLOR_CREATE_SCRIPT ) . append ( "var tagColorPreviewStyle = \".v-app .tag-color-preview{ height: 15px !important; padding: 0 10px !important; border: 0px !important; margin-left:12px !important; margin-top: 4px !imp...
public class RestApiClient { /** * Creates the group . * @ param group * the group * @ return the response */ public Response createGroup ( GroupEntity group ) { } }
return restClient . post ( "groups" , group , new HashMap < String , String > ( ) ) ;
public class VortexRequestor { /** * Sends a { @ link MasterToWorkerRequest } synchronously to a { @ link org . apache . reef . vortex . evaluator . VortexWorker } . */ void send ( final RunningTask reefTask , final MasterToWorkerRequest masterToWorkerRequest ) { } }
reefTask . send ( kryoUtils . serialize ( masterToWorkerRequest ) ) ;
public class BPGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . BPG__PAGE_NAME : setPageName ( PAGE_NAME_EDEFAULT ) ; return ; case AfplibPackage . BPG__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class AbstractJdbcCacheStore { /** * Persist a single object into the data store . * @ param key entry key of the object that should be persisted * @ param value object to persist */ public void store ( Object key , Object value ) { } }
getJdbcTemplate ( ) . update ( getMergeSql ( ) , new BeanPropertySqlParameterSource ( value ) ) ;
public class RegistryUtils { /** * Remove a specific value from a registry . * @ param registryName the name of the registry . * @ param key the unique key corresponding to the value to remove ( typically an appid ) . */ public static void removeValue ( String registryName , String key ) { } }
Sysprop registryObject = readRegistryObject ( registryName ) ; if ( registryObject == null || StringUtils . isBlank ( key ) ) { return ; } if ( registryObject . hasProperty ( key ) ) { registryObject . removeProperty ( key ) ; CoreUtils . getInstance ( ) . getDao ( ) . update ( REGISTRY_APP_ID , registryObject ) ; }
public class PowerShell { /** * Execute the provided PowerShell script in PowerShell console and gets * result . * @ param srcReader the script as BufferedReader ( when loading File from jar ) * @ param params the parameters of the script * @ return response with the output of the command */ public PowerShellRe...
PowerShellResponse response ; if ( srcReader != null ) { File tmpFile = createWriteTempFile ( srcReader ) ; if ( tmpFile != null ) { this . scriptMode = true ; response = executeCommand ( tmpFile . getAbsolutePath ( ) + " " + params ) ; tmpFile . delete ( ) ; } else { response = new PowerShellResponse ( true , "Cannot ...
public class InternalSimpleAntlrParser { /** * InternalSimpleAntlr . g : 281:1 : entryRuleIdOrInt returns [ String current = null ] : iv _ ruleIdOrInt = ruleIdOrInt EOF ; */ public final String entryRuleIdOrInt ( ) throws RecognitionException { } }
String current = null ; AntlrDatatypeRuleToken iv_ruleIdOrInt = null ; try { // InternalSimpleAntlr . g : 282:2 : ( iv _ ruleIdOrInt = ruleIdOrInt EOF ) // InternalSimpleAntlr . g : 283:2 : iv _ ruleIdOrInt = ruleIdOrInt EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getIdOrIntRule ( ) ) ; ...
public class Validate { /** * < p > Validate that the argument condition is { @ code true } ; otherwise throwing an exception with the specified message . This method is useful when validating according to an arbitrary boolean * expression , such as validating a primitive number or using your own custom validation ex...
INSTANCE . isTrue ( expression , message , values ) ;
public class ObjectGraphDump { /** * Reads the contents of a field . * @ param field the field definition . * @ param obj the object to read the value from . * @ return the value of the field in the given object . */ private Object readField ( final Field field , final Object obj ) { } }
try { return field . get ( obj ) ; } catch ( IllegalAccessException e ) { // Should not happen as we ' ve called Field . setAccessible ( true ) . LOG . error ( "Failed to read " + field . getName ( ) + " of " + obj . getClass ( ) . getName ( ) , e ) ; } return null ;
public class SessionApi { /** * Login ( HTTP session only ) * Starts the OAuth 2 flow for the Authorization Code grant type and returns a redirect to the Authentication service . For more information , see the [ Authentication API ] ( / reference / authentication / ) . * @ param redirectUri The URI the Authenticati...
com . squareup . okhttp . Call call = getLoginValidateBeforeCall ( redirectUri , includeState , null , null ) ; return apiClient . execute ( call ) ;
public class Serializer { /** * Converts the lowest five bytes of an unsigned long to a byte array . * The byte order is big - endian . * @ param value the long value , must not be negative . * @ return an array with five bytes . */ public static byte [ ] getFiveBytes ( long value ) { } }
if ( value < 0 ) { throw new IllegalArgumentException ( "negative value not allowed: " + value ) ; } else if ( value > 1099511627775L ) { throw new IllegalArgumentException ( "value out of range: " + value ) ; } return new byte [ ] { ( byte ) ( value >> 32 ) , ( byte ) ( value >> 24 ) , ( byte ) ( value >> 16 ) , ( byt...
public class ListManagementImageListsImpl { /** * Creates an image list . * @ param contentType The content type . * @ param bodyParameter Schema of the body . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ImageList object */ public Observable < Im...
return createWithServiceResponseAsync ( contentType , bodyParameter ) . map ( new Func1 < ServiceResponse < ImageList > , ImageList > ( ) { @ Override public ImageList call ( ServiceResponse < ImageList > response ) { return response . body ( ) ; } } ) ;
public class Asserter { /** * Asserts that an expected { @ link Activity } is currently active one , with the possibility to * verify that the expected { @ code Activity } is a new instance of the { @ code Activity } . * @ param message the message that should be displayed if the assert fails * @ param name the n...
assertCurrentActivity ( message , name ) ; Activity activity = activityUtils . getCurrentActivity ( ) ; if ( activity != null ) { assertCurrentActivity ( message , activity . getClass ( ) , isNewInstance ) ; }
public class ConfigReadController { /** * 下载 * @ param configId * @ return */ @ RequestMapping ( value = "/download/{configId}" , method = RequestMethod . GET ) public HttpEntity < byte [ ] > downloadDspBill ( @ PathVariable long configId ) { } }
// 业务校验 configValidator . valideConfigExist ( configId ) ; ConfListVo config = configMgr . getConfVo ( configId ) ; HttpHeaders header = new HttpHeaders ( ) ; byte [ ] res = config . getValue ( ) . getBytes ( ) ; if ( res == null ) { throw new DocumentNotFoundException ( config . getKey ( ) ) ; } String name = null ; t...
public class BacklogEndPointSupport { /** * Returns the endpoint of shared file . * @ param projectIdOrKey the project identifier * @ param sharedFileId the shared file identifier * @ return the endpoint * @ throws BacklogException */ public String getSharedFileEndpoint ( Object projectIdOrKey , Object sharedFi...
return buildEndpoint ( "projects/" + projectIdOrKey + "/files/" + sharedFileId ) ;
public class EsaParser { /** * Adds the Require - Capability Strings from a bundle jar to the Map of * Require - Capabilities found * @ param zipSystem - the FileSystem mapping to the feature containing this bundle * @ param bundle - the bundle within a zipped up feature * @ param requiresMap - Map of Path to R...
Path extractedJar = null ; try { // Need to extract the bundles to read their manifest , can ' t find a way to do this in place . extractedJar = Files . createTempFile ( "unpackedBundle" , ".jar" ) ; extractedJar . toFile ( ) . deleteOnExit ( ) ; Files . copy ( bundle , extractedJar , StandardCopyOption . REPLACE_EXIST...
public class SocketNode13 { /** * Notifies all registered listeners regarding the opening of a Socket . * @ param remoteInfo remote info */ private void fireSocketOpened ( final String remoteInfo ) { } }
synchronized ( listenerList ) { for ( Iterator iter = listenerList . iterator ( ) ; iter . hasNext ( ) ; ) { SocketNodeEventListener snel = ( SocketNodeEventListener ) iter . next ( ) ; if ( snel != null ) { snel . socketOpened ( remoteInfo ) ; } } }
public class XMLFormatterUtils { /** * This will encode the given string as a valid XML name . The format will be * an initial underscore followed by the hexadecimal representation of the * string . * The method will throw an exception if the argument is null . * @ param s * String to encode as an XML name ...
StringBuilder sb = new StringBuilder ( "_" ) ; for ( byte b : s . getBytes ( Charset . forName ( "UTF-8" ) ) ) { sb . append ( Integer . toHexString ( ( b >>> 4 ) & 0xF ) ) ; sb . append ( Integer . toHexString ( b & 0xF ) ) ; } return sb . toString ( ) ;
public class HashUtils { /** * Hashes a string using the SHA - 384 algorithm . * @ since 1.1 * @ param data the string to hash * @ param charset the charset of the string * @ return the SHA - 384 hash of the string * @ throws NoSuchAlgorithmException the algorithm is not supported by existing providers */ pub...
return sha384Hash ( data . getBytes ( charset ) ) ;
public class ListDevelopmentSchemaArnsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListDevelopmentSchemaArnsRequest listDevelopmentSchemaArnsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listDevelopmentSchemaArnsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDevelopmentSchemaArnsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listDevelopmentSchemaArnsRequest . getMaxRes...
public class UnilateralSortMerger { /** * Shuts down all the threads initiated by this sort / merger . Also releases all previously allocated * memory , if it has not yet been released by the threads , and closes and deletes all channels ( removing * the temporary files ) . * The threads are set to exit directly ...
// check if the sorter has been closed before synchronized ( this ) { if ( this . closed ) { return ; } // mark as closed this . closed = true ; } // from here on , the code is in a try block , because even through errors might be thrown in this block , // we need to make sure that all the memory is released . try { //...
public class AreaSizesL { /** * < p > Determine if an area includes another area . < / p > * < p > Inclusion is reflexive : { @ code ∀ a . includes ( a , a ) } < / p > * < p > Inclusion is transitive : { @ code ∀ a b c . includes ( a , b ) ∧ includes ( b , c ) * → includes ( a , c ) } < / p > * @ param a The co...
Objects . requireNonNull ( a , "Area A" ) ; Objects . requireNonNull ( b , "Area B" ) ; return Long . compareUnsigned ( b . sizeX ( ) , a . sizeX ( ) ) <= 0 && Long . compareUnsigned ( b . sizeY ( ) , a . sizeY ( ) ) <= 0 ;
public class CmsVfsSitemapService { /** * Internal method for saving a sitemap . < p > * @ param entryPoint the URI of the sitemap to save * @ param change the change to save * @ return list of changed sitemap entries * @ throws CmsException if something goes wrong */ protected CmsSitemapChange saveInternal ( S...
ensureSession ( ) ; switch ( change . getChangeType ( ) ) { case clipboardOnly : // do nothing break ; case remove : change = removeEntryFromNavigation ( change ) ; break ; case undelete : change = undelete ( change ) ; break ; default : change = applyChange ( entryPoint , change ) ; } setClipboardData ( change . getCl...
public class EnumMultiset { /** * Creates a new { @ code EnumMultiset } containing the specified elements . * < p > This implementation is highly efficient when { @ code elements } is itself a { @ link * Multiset } . * @ param elements the elements that the multiset should contain * @ throws IllegalArgumentExce...
Iterator < E > iterator = elements . iterator ( ) ; checkArgument ( iterator . hasNext ( ) , "EnumMultiset constructor passed empty Iterable" ) ; EnumMultiset < E > multiset = new EnumMultiset < E > ( iterator . next ( ) . getDeclaringClass ( ) ) ; Iterables . addAll ( multiset , elements ) ; return multiset ;
public class AsynchronousRequest { /** * For more info on achievements groups API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / achievements / groups " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Ca...
isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getAchievementGroupInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ;
public class JScreen { /** * Read from this record ' s default key . * In order to get this to work , you need to add some code like this : * < pre > * boolean bFirstChange = false ; * if ( this . getFieldList ( ) ! = null ) * if ( this . getFieldList ( ) . getEditMode ( ) = = Constants . EDIT _ ADD ) * if ...
boolean bSuccess = false ; String strValue = field . getString ( ) ; FieldList fieldList = this . getFieldList ( ) ; FieldTable fieldTable = null ; if ( fieldList != null ) fieldTable = fieldList . getTable ( ) ; if ( strValue != null ) if ( strValue . length ( ) > 0 ) if ( fieldTable != null ) { try { if ( ! ( bSucces...
public class PageCode { /** * Returns the VPD page name associated with the PAGE CODE { @ link # value } . * @ return the VPD page name associated with the PAGE CODE { @ link # value } */ public final VitalProductDataPageName getVitalProductDataPageName ( ) { } }
if ( value == 0x00 ) return VitalProductDataPageName . SUPPORTED_VPD_PAGES ; // mandatory if ( 0x01 <= value && value <= 0x7f ) return VitalProductDataPageName . ASCII_INFORMATION ; if ( value == 0x80 ) return VitalProductDataPageName . UNIT_SERIAL_NUMBER ; if ( value == 0x81 || value == 0x82 ) return VitalProductDataP...
public class WRepeater { /** * Remember the list of beans that hold the data object for each row . * @ param beanList the list of data objects for each row . */ public void setBeanList ( final List beanList ) { } }
RepeaterModel model = getOrCreateComponentModel ( ) ; model . setData ( beanList ) ; // Clean up any stale data . HashSet rowIds = new HashSet ( beanList . size ( ) ) ; for ( Object bean : beanList ) { rowIds . add ( getRowId ( bean ) ) ; } cleanupStaleContexts ( rowIds ) ; // Clean up cached component IDs UIContext ui...
public class ModeUtil { /** * translate a octal mode value ( 73 ) to a string representation ( " 111 " ) * @ param strMode * @ return */ public static String toStringMode ( int octalMode ) { } }
String str = Integer . toString ( octalMode , 8 ) ; while ( str . length ( ) < 3 ) str = "0" + str ; return str ;
public class Utils { /** * Read all data from the given reader into a buffer and return it as a single String . * If an I / O error occurs while reading the reader , it is passed through to the caller . * The reader is closed when before returning . * @ param reader Open character reader . * @ return All charac...
assert reader != null ; StringWriter strWriter = new StringWriter ( ) ; char [ ] buffer = new char [ 65536 ] ; int charsRead = reader . read ( buffer ) ; while ( charsRead > 0 ) { strWriter . write ( buffer , 0 , charsRead ) ; charsRead = reader . read ( buffer ) ; } reader . close ( ) ; return strWriter . toString ( )...
public class ReplicationInternal { /** * Fire a trigger to the state machine */ protected void fireTrigger ( final ReplicationTrigger trigger ) { } }
Log . d ( Log . TAG_SYNC , "%s [fireTrigger()] => " + trigger , this ) ; // All state machine triggers need to happen on the replicator thread synchronized ( executor ) { if ( ! executor . isShutdown ( ) ) { executor . submit ( new Runnable ( ) { @ Override public void run ( ) { try { Log . d ( Log . TAG_SYNC , "firing...
public class Server { public static void main ( String [ ] arg ) { } }
String [ ] dftConfig = { "etc/jetty.xml" } ; if ( arg . length == 0 ) { log . info ( "Using default configuration: etc/jetty.xml" ) ; arg = dftConfig ; } final Server [ ] servers = new Server [ arg . length ] ; // create and start the servers . for ( int i = 0 ; i < arg . length ; i ++ ) { try { servers [ i ] = new Ser...
public class MethodAnnotation { /** * Factory method to create a MethodAnnotation from the method the given * visitor is currently visiting . * @ param visitor * the BetterVisitor currently visiting the method */ public static MethodAnnotation fromVisitedMethod ( PreorderVisitor visitor ) { } }
String className = visitor . getDottedClassName ( ) ; MethodAnnotation result = new MethodAnnotation ( className , visitor . getMethodName ( ) , visitor . getMethodSig ( ) , visitor . getMethod ( ) . isStatic ( ) ) ; // Try to find the source lines for the method SourceLineAnnotation srcLines = SourceLineAnnotation . f...
public class TableMapLogEvent { /** * Decode field metadata by column types . * @ see mysql - 5.1.60 / sql / rpl _ utility . h */ private final void decodeFields ( LogBuffer buffer , final int len ) { } }
final int limit = buffer . limit ( ) ; buffer . limit ( len + buffer . position ( ) ) ; for ( int i = 0 ; i < columnCnt ; i ++ ) { ColumnInfo info = columnInfo [ i ] ; switch ( info . type ) { case MYSQL_TYPE_TINY_BLOB : case MYSQL_TYPE_BLOB : case MYSQL_TYPE_MEDIUM_BLOB : case MYSQL_TYPE_LONG_BLOB : case MYSQL_TYPE_DO...
public class AliasStrings { /** * Looks up the { @ link StringInfo } object for a JavaScript string . Creates * it if necessary . */ private StringInfo getOrCreateStringInfo ( String string ) { } }
StringInfo info = stringInfoMap . get ( string ) ; if ( info == null ) { info = new StringInfo ( stringInfoMap . size ( ) ) ; stringInfoMap . put ( string , info ) ; } return info ;
public class BundlesHandlerFactory { /** * Initialize the resource bundles from the mapping file */ private void initResourceBundlesFromFullMapping ( List < JoinableResourceBundle > resourceBundles ) { } }
if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( "Building bundles from the full bundle mapping. Only modified bundles will be processed." ) ; } Properties mappingProperties = resourceBundleHandler . getJawrBundleMapping ( ) ; FullMappingPropertiesBasedBundlesHandlerFactory factory = new FullMappingPropertiesBasedBu...
public class HasManyModel { /** * Adds the object to the child ids list . * @ param child The child to be added . * @ throws com . mauriciogiordano . easydb . exception . NoContextFoundException in case of null context . */ public void addChild ( C child ) { } }
SharedPreferences prefs = loadSharedPreferences ( "children" ) ; List < String > objects = getChildrenList ( ) ; Model toPut = ( Model ) child ; if ( objects . indexOf ( toPut . getId ( ) ) != ArrayUtils . INDEX_NOT_FOUND ) { return ; } objects . add ( toPut . getId ( ) ) ; toPut . save ( ) ; prefs . edit ( ) . putStri...
public class LinkUtil { /** * Builds a mapped link to the path ( resource path ) with optional selectors and extension . * @ param request the request context for path mapping ( the result is always mapped ) * @ param url the URL to use ( complete ) or the path to an addressed resource ( without any extension ) *...
LinkMapper mapper = ( LinkMapper ) request . getAttribute ( LinkMapper . LINK_MAPPER_REQUEST_ATTRIBUTE ) ; return getUrl ( request , url , selectors , extension , mapper != null ? mapper : LinkMapper . RESOLVER ) ;
public class Code { /** * Assigns { @ code target } to a newly allocated array of length { @ code * length } . The array ' s type is the same as { @ code target } ' s type . */ public < T > void newArray ( Local < T > target , Local < Integer > length ) { } }
addInstruction ( new ThrowingCstInsn ( Rops . opNewArray ( target . type . ropType ) , sourcePosition , RegisterSpecList . make ( length . spec ( ) ) , catches , target . type . constant ) ) ; moveResult ( target , true ) ;
public class InstanceInformationFilterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceInformationFilter instanceInformationFilter , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceInformationFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceInformationFilter . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( instanceInformationFilter . getValueSet ( ) , VALUESET_BINDING ) ; } c...
public class CsvReader { /** * parse cvs * @ param cellConsumer the consumer that the parser will callback * @ param < CC > the cell consumer type * @ throws java . io . IOException if an io error occurs * @ return the cell consumer */ public < CC extends CellConsumer > CC parseAll ( CC cellConsumer ) throws IO...
_parseAll ( wrapConsumer ( cellConsumer ) , false ) ; return cellConsumer ;
public class ProxyReceiveListener { /** * This method will process a schema received from our peer ' s MFP compoennt . * At the moment this consists of contacting MFP here on the client and * giving it the schema . Schemas are received when the ME is about to send * us a message and realises that we don ' t have ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processSchema" , new Object [ ] { buffer , conversation } ) ; ClientConversationState convState = ( ClientConversationState ) conversation . getAttachment ( ) ; byte [ ] mfpDataAsBytes = buffer . getRemaining ( ) ; // Get h...
public class HalResource { /** * Adds links for the given relation * @ param relation Link relation * @ param links Links to add * @ return HAL resource */ public HalResource addLinks ( String relation , Iterable < Link > links ) { } }
return addLinks ( relation , Iterables . toArray ( links , Link . class ) ) ;
public class ObjectUtils { /** * < p > Null safe comparison of Comparables . < / p > * @ param < T > type of the values processed by this method * @ param values the set of comparable values , may be null * @ return * < ul > * < li > If any objects are non - null and unequal , the greater object . * < li > ...
T result = null ; if ( values != null ) { for ( final T value : values ) { if ( compare ( value , result , false ) > 0 ) { result = value ; } } } return result ;
public class FindClassCircularDependencies { /** * returns a set of dependent class names for a class , and if it doesn ' t exist create the set install it , and then return ; * @ param clsName * the class for which you are trying to get dependencies * @ return the active set of classes that are dependent on the ...
Set < String > dependencies = dependencyGraph . get ( clsName ) ; if ( dependencies == null ) { dependencies = new HashSet < > ( ) ; dependencyGraph . put ( clsName , dependencies ) ; } return dependencies ;
public class AbstractRuntimeOnlyHandler { /** * Simply adds a { @ link org . jboss . as . controller . OperationContext . Stage # RUNTIME } step that calls * { @ link # executeRuntimeStep ( OperationContext , ModelNode ) } . * { @ inheritDoc } */ @ Override public void execute ( OperationContext context , ModelNode...
if ( requiresRuntime ( context ) && ! isProfile ( context ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { // make sure the resource exists before executing a runtime operation . // if that ' s no...
public class EdgeLabel { /** * remove a vertex label from the in collection * @ param lbl the vertex label * @ param preserveData should we keep the sql data ? */ void removeInVertexLabel ( VertexLabel lbl , boolean preserveData ) { } }
this . uncommittedRemovedInVertexLabels . add ( lbl ) ; if ( ! preserveData ) { deleteColumn ( lbl . getFullName ( ) + Topology . IN_VERTEX_COLUMN_END ) ; }
public class ScriptfileUtils { /** * Set the executable flag on a file if supported by the OS * @ param scriptfile target file * @ throws IOException if an error occurs */ public static void setExecutePermissions ( final File scriptfile ) throws IOException { } }
if ( ! scriptfile . setExecutable ( true , true ) ) { System . err . println ( "Unable to set executable bit on temp script file, execution may fail: " + scriptfile . getAbsolutePath ( ) ) ; }
public class AnnotationPosition { /** * Tokenizes as little of the { @ code tree } as possible to ensure we grab all the annotations . */ private static ImmutableList < ErrorProneToken > annotationTokens ( Tree tree , VisitorState state , int annotationEnd ) { } }
int endPos ; if ( tree instanceof JCMethodDecl ) { JCMethodDecl methodTree = ( JCMethodDecl ) tree ; endPos = methodTree . getBody ( ) == null ? state . getEndPosition ( methodTree ) : methodTree . getBody ( ) . getStartPosition ( ) ; } else if ( tree instanceof JCVariableDecl ) { endPos = ( ( JCVariableDecl ) tree ) ....
public class StringUtilities { /** * Prints the character codes for the given string . * @ param s The string to be printed */ public static void printCharacters ( String s ) { } }
if ( s != null ) { logger . info ( "string length=" + s . length ( ) ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; logger . info ( "char[" + i + "]=" + c + " (" + ( int ) c + ")" ) ; } }
public class Stat { /** * See the class documentation . */ public static void main ( String [ ] args ) throws IOException { } }
if ( args . length == 0 || args [ 0 ] . equals ( "--help" ) ) { help ( ) ; return ; } if ( args [ 0 ] . equals ( "--list" ) ) { listFilesystems ( ) ; return ; } if ( args [ 0 ] . equals ( "--check" ) ) { checkGcs ( ) ; return ; } for ( String a : args ) { statFile ( a ) ; }
public class FluentValidator { /** * 如果验证器是一个 { @ link ValidatorHandler } 实例 , 那么可以通过 { @ link ValidatorHandler # compose ( FluentValidator , ValidatorContext , Object ) } * 方法增加一些验证逻辑 * @ param v 验证器 * @ param t 待验证对象 */ private < T > void composeIfPossible ( Validator < T > v , T t ) { } }
final FluentValidator self = this ; if ( v instanceof ValidatorHandler ) { ( ( ValidatorHandler ) v ) . compose ( self , context , t ) ; }
public class ListenerHelper { /** * You cannot invokeAsyncErrorHandling from more than one thread at a time * because we retrieve the error handling lock . Once that lock is retrieved * another thread cannot call complete or dispatch . Those calls will be ignored . * If complete or dispatch happens to get called ...
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) logger . entering ( CLASS_NAME , "_invokeAsyncErrorHandling" , new Object [ ] { asyncContext , reqState , th , asyncEnum } ) ; try { ServletRequest servletRequest = asyncContext . getRequest ( ) ; ServletRe...
public class KnowledgeBuilderImpl { /** * Load a rule package from XML source . * @ param reader * @ throws DroolsParserException * @ throws IOException */ public void addPackageFromXml ( final Reader reader ) throws DroolsParserException , IOException { } }
this . resource = new ReaderResource ( reader , ResourceType . XDRL ) ; final XmlPackageReader xmlReader = new XmlPackageReader ( this . configuration . getSemanticModules ( ) ) ; xmlReader . getParser ( ) . setClassLoader ( this . rootClassLoader ) ; try { xmlReader . read ( reader ) ; } catch ( final SAXException e )...
public class ScriptableObject { /** * Returns true if the named property is defined as a const on this object . * @ param name * @ return true if the named property is defined as a const , false * otherwise . */ @ Override public boolean isConst ( String name ) { } }
Slot slot = slotMap . query ( name , 0 ) ; if ( slot == null ) { return false ; } return ( slot . getAttributes ( ) & ( PERMANENT | READONLY ) ) == ( PERMANENT | READONLY ) ;
public class APMSpan { /** * This method initialises the span based on a ' child - of ' relationship . * @ param builder The span builder * @ param ref The ' child - of ' relationship */ protected void initChildOf ( APMSpanBuilder builder , Reference ref ) { } }
APMSpan parent = ( APMSpan ) ref . getReferredTo ( ) ; if ( parent . getNodeBuilder ( ) != null ) { nodeBuilder = new NodeBuilder ( parent . getNodeBuilder ( ) ) ; traceContext = parent . traceContext ; // As it is not possible to know if a tag has been set after span // creation , we use this situation to check if the...
public class DescribeStaleSecurityGroupsResult { /** * Information about the stale security groups . * @ param staleSecurityGroupSet * Information about the stale security groups . */ public void setStaleSecurityGroupSet ( java . util . Collection < StaleSecurityGroup > staleSecurityGroupSet ) { } }
if ( staleSecurityGroupSet == null ) { this . staleSecurityGroupSet = null ; return ; } this . staleSecurityGroupSet = new com . amazonaws . internal . SdkInternalList < StaleSecurityGroup > ( staleSecurityGroupSet ) ;
public class JavaMailBuilder { /** * Set charset to use for email body . * You can specify a direct value . For example : * < pre > * . charset ( " UTF - 8 " ) ; * < / pre > * You can also specify one or several property keys . For example : * < pre > * . charset ( " $ { custom . property . high - priorit...
for ( String c : charsets ) { if ( c != null ) { this . charsets . add ( c ) ; } } return this ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getBDAFlags ( ) { } }
if ( bdaFlagsEEnum == null ) { bdaFlagsEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 1 ) ; } return bdaFlagsEEnum ;
public class NotionalTokenizer { /** * 切分为句子形式 * @ param text * @ return */ public static List < List < Term > > seg2sentence ( String text ) { } }
List < List < Term > > sentenceList = SEGMENT . seg2sentence ( text ) ; for ( List < Term > sentence : sentenceList ) { ListIterator < Term > listIterator = sentence . listIterator ( ) ; while ( listIterator . hasNext ( ) ) { if ( ! CoreStopWordDictionary . shouldInclude ( listIterator . next ( ) ) ) { listIterator . r...
public class FloatBuffer { /** * Returns a duplicated buffer that shares its content with this buffer . * < p > The duplicated buffer ' s position , limit , capacity and mark are the same as this buffer . * The duplicated buffer ' s read - only property and byte order are same as this buffer too . < / p > * < p >...
FloatBuffer buf = new FloatBuffer ( byteBuffer . duplicate ( ) ) ; buf . limit = limit ; buf . position = position ; buf . mark = mark ; return buf ;
public class JsJmsStreamMessageImpl { /** * Write a float value into the payload Stream . * Javadoc description supplied by JsJmsMessage interface . */ public void writeFloat ( float value ) throws UnsupportedEncodingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeFloat" , new Float ( value ) ) ; getBodyList ( ) . add ( new Float ( value ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "writeFloat" ) ;
public class ZonedDateTimeIteratorFactory { /** * given a block of RRULE , EXRULE , RDATE , and EXDATE content lines , parse * them into a single date time iterator . * @ param rdata RRULE , EXRULE , RDATE , and EXDATE lines . * @ param start the first occurrence of the series . * @ param tzid the local timezon...
return new RecurrenceIteratorWrapper ( RecurrenceIteratorFactory . createRecurrenceIterator ( rdata , zonedDateTimeToDateValue ( start . withZoneSameInstant ( tzid ) ) , TimeZoneConverter . toTimeZone ( tzid ) , strict ) ) ;
public class AttributeCollector { /** * Internal method used to see if we can expand the buffer that * the array decoder has . Bit messy , but simpler than having * separately typed instances ; and called rarely so that performance * downside of instanceof is irrelevant . */ private final static boolean checkExpa...
if ( tad instanceof ValueDecoderFactory . BaseArrayDecoder ) { ( ( ValueDecoderFactory . BaseArrayDecoder ) tad ) . expand ( ) ; return true ; } return false ;
public class AdGroupBidModifier { /** * Gets the bidModifierSource value for this AdGroupBidModifier . * @ return bidModifierSource * Bid modifier source . * < span class = " constraint ReadOnly " > This field is read * only and will be ignored when sent to the API . < / span > */ public com . google . api . ads ...
return bidModifierSource ;
public class TargetPoolClient { /** * Removes health check URL from a target pool . * < p > Sample code : * < pre > < code > * try ( TargetPoolClient targetPoolClient = TargetPoolClient . create ( ) ) { * ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName . of ( " [ PROJECT ] " , " [ REGION ] ...
RemoveHealthCheckTargetPoolHttpRequest request = RemoveHealthCheckTargetPoolHttpRequest . newBuilder ( ) . setTargetPool ( targetPool ) . setTargetPoolsRemoveHealthCheckRequestResource ( targetPoolsRemoveHealthCheckRequestResource ) . build ( ) ; return removeHealthCheckTargetPool ( request ) ;
public class PerformanceUtils { /** * Get cpu core number * @ return int cpu core number */ public static int getNumCores ( ) { } }
class CpuFilter implements FileFilter { @ Override public boolean accept ( File pathname ) { return Pattern . matches ( "cpu[0-9]" , pathname . getName ( ) ) ; } } if ( sCoreNum == 0 ) { try { // Get directory containing CPU info File dir = new File ( "/sys/devices/system/cpu/" ) ; // Filter to only list the devices we...
public class IndexImage { /** * Converts the input image ( must be { @ code TYPE _ INT _ RGB } or * { @ code TYPE _ INT _ ARGB } ) to an indexed image . Generating an adaptive * palette with the given number of colors . * Dithering , transparency and color selection is controlled with the * { @ code pHints } pa...
return getIndexedImage ( pImage , pNumberOfColors , null , pHints ) ;
public class GraphHopper { /** * Sets the graphhopper folder . */ public GraphHopper setGraphHopperLocation ( String ghLocation ) { } }
ensureNotLoaded ( ) ; if ( ghLocation == null ) throw new IllegalArgumentException ( "graphhopper location cannot be null" ) ; this . ghLocation = ghLocation ; return this ;
public class ResourceSkusInner { /** * Gets the list of Microsoft . CognitiveServices SKUs available for your Subscription . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observa...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ResourceSkuInner > > , Page < ResourceSkuInner > > ( ) { @ Override public Page < ResourceSkuInner > call ( ServiceResponse < Page < ResourceSkuInner > > response ) { return response . body ( ) ; } } ) ;
public class ElementRule { /** * Validate the occurrence of this IMolecularFormula . * @ param formula Parameter is the IMolecularFormula * @ return An ArrayList containing 9 elements in the order described above */ @ Override public double validate ( IMolecularFormula formula ) throws CDKException { } }
logger . info ( "Start validation of " , formula ) ; ensureDefaultOccurElements ( formula . getBuilder ( ) ) ; double isValid = 1.0 ; Iterator < IElement > itElem = MolecularFormulaManipulator . elements ( formula ) . iterator ( ) ; while ( itElem . hasNext ( ) ) { IElement element = itElem . next ( ) ; int occur = Mol...
public class ClassVisitor { /** * Determine the types label to be applied to a class node . * @ param flags * The access flags . * @ return The types label . */ private Class < ? extends ClassFileDescriptor > getJavaType ( int flags ) { } }
if ( hasFlag ( flags , Opcodes . ACC_ANNOTATION ) ) { return AnnotationTypeDescriptor . class ; } else if ( hasFlag ( flags , Opcodes . ACC_ENUM ) ) { return EnumTypeDescriptor . class ; } else if ( hasFlag ( flags , Opcodes . ACC_INTERFACE ) ) { return InterfaceTypeDescriptor . class ; } return ClassTypeDescriptor . c...
public class DropboxClient { /** * Move file from specified source to specified target . * @ param from source * @ param to target * @ return metadata of target file * @ see Entry */ public Entry move ( String from , String to ) { } }
OAuthRequest request = new OAuthRequest ( Verb . GET , FILE_OPS_MOVE_URL ) ; request . addQuerystringParameter ( "root" , "dropbox" ) ; request . addQuerystringParameter ( "from_path" , encode ( from ) ) ; request . addQuerystringParameter ( "to_path" , encode ( to ) ) ; service . signRequest ( accessToken , request ) ...
public class KeyVaultClientBaseImpl { /** * Imports a certificate into a specified key vault . * Imports an existing valid certificate , containing a private key , into Azure Key Vault . The certificate to be imported can be in either PFX or PEM format . If the certificate is in PEM format the PEM file must contain t...
return ServiceFuture . fromResponse ( importCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName , base64EncodedCertificate , password , certificatePolicy , certificateAttributes , tags ) , serviceCallback ) ;