signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ContentKey { /** * Rebind content key with specified content key and X509 Certificate . * @ param contentKeyId * the content key id * @ param x509Certificate * the x509 certificate * @ return the entity action operation */ public static EntityTypeActionOperation < String > rebind ( String content...
return new RebindContentKeyActionOperation ( contentKeyId , x509Certificate ) ;
public class HiveJsonSerDeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HiveJsonSerDe hiveJsonSerDe , ProtocolMarshaller protocolMarshaller ) { } }
if ( hiveJsonSerDe == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hiveJsonSerDe . getTimestampFormats ( ) , TIMESTAMPFORMATS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e ...
public class MinioClient { /** * Executes DELETE method for given request parameters . * @ param bucketName Bucket name . * @ param objectName Object name in the bucket . * @ param queryParamMap Map of HTTP query parameters of the request . */ private HttpResponse executeDelete ( String bucketName , String object...
HttpResponse response = execute ( Method . DELETE , getRegion ( bucketName ) , bucketName , objectName , null , queryParamMap , null , 0 ) ; response . body ( ) . close ( ) ; return response ;
public class SearchParams { /** * Shorthand for creationGte ( start ) . creationLte ( end ) . */ public SearchParams between ( final Date start , final Date end ) { } }
return this . creationGte ( start ) . creationLte ( end ) ;
public class SimonConsolePluginManager { /** * Register a plugin * @ param pluginTypeName Plugin type */ public void addPlugin ( String pluginTypeName ) { } }
try { Class < ? > pluginType = Class . forName ( pluginTypeName ) ; if ( SimonConsolePlugin . class . isAssignableFrom ( pluginType ) ) { addPlugin ( ( Class < ? extends SimonConsolePlugin > ) pluginType ) ; } else { throw new IllegalArgumentException ( "Invalid plugin type " + pluginTypeName ) ; } } catch ( ClassNotFo...
public class AnnotationValue { /** * Subclasses can override to provide a custom convertible values instance . * @ param values The values * @ return The instance */ private ConvertibleValues < Object > newConvertibleValues ( Map < CharSequence , Object > values ) { } }
if ( CollectionUtils . isEmpty ( values ) ) { return ConvertibleValues . EMPTY ; } else { return ConvertibleValues . of ( values ) ; }
public class Database { /** * Removes a document from the database . * < p > The object must have the correct { @ code _ id } and { @ code _ rev } values . < / p > * < P > Example usage : < / P > * < pre > * { @ code * / / get a Bar object from the database * Bar bar = db . find ( Bar . class , " exampleId ...
Response couchDbResponse = db . remove ( object ) ; com . cloudant . client . api . model . Response response = new com . cloudant . client . api . model . Response ( couchDbResponse ) ; return response ;
public class Kmeans { /** * { @ inheritDoc } */ @ Override protected void _fit ( Dataframe trainingData ) { } }
ModelParameters modelParameters = knowledgeBase . getModelParameters ( ) ; Set < Object > goldStandardClasses = modelParameters . getGoldStandardClasses ( ) ; // check if there are any gold standard classes for ( Record r : trainingData ) { Object theClass = r . getY ( ) ; if ( theClass != null ) { goldStandardClasses ...
public class Dtd { /** * Creates DTD schema file containing all possible tags and their attributes . Any problems with the generation will * be logged . This is a relatively heavy operation and should be done only during development . * @ param parser contains parsing data . Used to create mock - up actors . The sk...
appendActorTags ( builder , parser ) ; appendActorAttributes ( parser , builder ) ; appendMacroTags ( builder , parser ) ; appendMacroAttributes ( parser , builder ) ;
public class DefaultDataGridConfig { /** * Create a { @ link DataGridStateCodec } for a grid with the given name for the given { @ link ServletRequest } . * @ param request the current request * @ param gridName a data grid ' s name * @ return the state encoder / decoder for a data grid ' s request state */ publi...
DefaultDataGridStateCodec codec = new DefaultDataGridStateCodec ( this ) ; codec . setServletRequest ( request ) ; codec . setGridName ( gridName ) ; return codec ;
public class IntegerBinding { /** * Serializes unsigned { @ code int } value to the compressed { @ linkplain ArrayByteIterable } entry . * @ param object non - negative value to serialize * @ return { @ linkplain ArrayByteIterable } entry * @ see # entryToInt ( ByteIterable ) * @ see # intToEntry ( int ) * @ ...
if ( object < 0 ) { throw new IllegalArgumentException ( ) ; } final LightOutputStream output = new LightOutputStream ( 5 ) ; writeCompressed ( output , object ) ; return output . asArrayByteIterable ( ) ;
public class GetCommentsForComparedCommitResult { /** * A list of comment objects on the compared commit . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCommentsForComparedCommitData ( java . util . Collection ) } or * { @ link # withCommentsForCompare...
if ( this . commentsForComparedCommitData == null ) { setCommentsForComparedCommitData ( new java . util . ArrayList < CommentsForComparedCommit > ( commentsForComparedCommitData . length ) ) ; } for ( CommentsForComparedCommit ele : commentsForComparedCommitData ) { this . commentsForComparedCommitData . add ( ele ) ;...
public class BasicHttpClient { /** * This is the usual http request builder most widely used using Apache Http Client . In case you want to build * or prepare the requests differently , you can override this method . * Please see the following request builder to handle file uploads . * - BasicHttpClient # createF...
RequestBuilder requestBuilder = RequestBuilder . create ( methodName ) . setUri ( httpUrl ) ; if ( reqBodyAsString != null ) { HttpEntity httpEntity = EntityBuilder . create ( ) . setContentType ( APPLICATION_JSON ) . setText ( reqBodyAsString ) . build ( ) ; requestBuilder . setEntity ( httpEntity ) ; } return request...
public class EJBLinkResolver { /** * Encapsulates the common code and exception handling for obtaining * a remote home reference ( Stub ) for the specified home interface , * for lookup or injection . < p > * @ param home the internal home object of the referenced ejb . * @ param interfaceName the remote home i...
Object retObj = null ; try { checkHomeSupported ( home , interfaceName ) ; EJBRuntime runtime = home . getContainer ( ) . getEJBRuntime ( ) ; runtime . checkRemoteSupported ( home , interfaceName ) ; EJSWrapper wrapper = home . getWrapper ( ) . getRemoteWrapper ( ) ; retObj = runtime . getRemoteReference ( wrapper ) ; ...
public class vpnclientlessaccesspolicy { /** * Use this API to update vpnclientlessaccesspolicy . */ public static base_response update ( nitro_service client , vpnclientlessaccesspolicy resource ) throws Exception { } }
vpnclientlessaccesspolicy updateresource = new vpnclientlessaccesspolicy ( ) ; updateresource . name = resource . name ; updateresource . rule = resource . rule ; updateresource . profilename = resource . profilename ; return updateresource . update_resource ( client ) ;
public class ProviderDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ProviderDescription providerDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( providerDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( providerDescription . getProviderName ( ) , PROVIDERNAME_BINDING ) ; protocolMarshaller . marshall ( providerDescription . getProviderType ( ) , PROVIDERTYPE_BINDING...
public class SolrManager { /** * Remove a core . * @ param coreName Core name * @ throws SolrException SolrException */ public void removeCore ( String coreName ) throws SolrException { } }
try { CoreAdminRequest . unloadCore ( coreName , true , true , solrClient ) ; } catch ( SolrServerException | IOException e ) { throw new SolrException ( SolrException . ErrorCode . SERVER_ERROR , e . getMessage ( ) , e ) ; }
public class SeleniumHelper { /** * Simulates ' select all ' ( e . g . Ctrl + A on Windows ) on the active element . * @ return whether an active element was found . */ public boolean selectAll ( ) { } }
boolean result = false ; WebElement element = getActiveElement ( ) ; if ( element != null ) { if ( connectedToMac ( ) ) { executeJavascript ( "arguments[0].select()" , element ) ; } else { element . sendKeys ( Keys . CONTROL , "a" ) ; } result = true ; } return result ;
public class MapboxNavigation { /** * Critical to place inside your navigation activity so that when your application gets destroyed * the navigation service unbinds and gets destroyed , preventing any memory leaks . Calling this * also removes all listeners that have been attached . */ public void onDestroy ( ) { ...
stopNavigation ( ) ; removeOffRouteListener ( null ) ; removeProgressChangeListener ( null ) ; removeMilestoneEventListener ( null ) ; removeNavigationEventListener ( null ) ; removeFasterRouteListener ( null ) ; removeRawLocationListener ( null ) ;
public class KryoSerializer { /** * Deserializes { @ code byte [ ] } to SynchronizeFX { @ link Command } s . * This method is thread save . * @ param commands The serialized form of SynchronizeFX { @ link Command } s that was created by * { @ link KryoSerializer # serialize ( List ) } . * @ return The original ...
return kryo . get ( ) . readObject ( new Input ( commands ) , LinkedList . class ) ;
public class BDAImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setYoffset ( Integer newYoffset ) { } }
Integer oldYoffset = yoffset ; yoffset = newYoffset ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . BDA__YOFFSET , oldYoffset , yoffset ) ) ;
public class AgentSession { /** * Allows the removal of data from the agent ' s meta data , if the key represents existing data , * the revised meta data will be rebroadcast in an agent ' s presence broadcast . * @ param key the meta data key . * @ throws XMPPException if an exception occurs . * @ throws SmackE...
synchronized ( this . metaData ) { List < String > oldVal = metaData . remove ( key ) ; if ( oldVal != null ) { setStatus ( presenceMode , maxChats ) ; } }
public class SheetDiscussionResourcesImpl { /** * Create a discussion with attachments on a sheet . * It mirrors to the following Smartsheet REST API method : POST / sheets / { sheetId } / discussions * @ param sheetId the sheet id * @ param discussion the discussion object * @ param file the file to attach *...
Util . throwIfNull ( discussion , file , contentType ) ; String path = "sheets/" + sheetId + "/discussions" ; return this . createDiscussionWithAttachment ( path , discussion , new FileInputStream ( file ) , contentType , file . getName ( ) ) ;
public class DEBBuilder { /** * Add debian / control Depends field . * @ param name * @ param version * @ param dependency * @ return */ @ Override public DEBBuilder addRequire ( String name , String version , Condition ... dependency ) { } }
control . addDepends ( release , version , dependency ) ; return this ;
public class Hyperion { /** * Set the sensitivity threshold of shake detection in G ' s . Default is 3 * @ param sensitivity Sensitivity of shake detection in G ' s . Lower is easier to activate . */ public static void setShakeGestureSensitivity ( float sensitivity ) { } }
requireApplication ( ) ; AppComponent . Holder . getInstance ( application ) . getPublicControl ( ) . setShakeGestureSensitivity ( sensitivity ) ;
public class MicroProfileJwtConfigImpl { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( MpJwtProcessingException . class ) public String getTrustStoreRef ( ) { } }
if ( this . sslRefInfo == null ) { MicroProfileJwtService service = mpJwtServiceRef . getService ( ) ; if ( service == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "MP JWT service is not available" ) ; } return null ; } sslRefInfo = new SslRefInfoImpl ( service . getSslSupport ( ) , service . getKeyStore...
public class EXXAdapters { /** * Adapts a to a OrderBook Object * @ param currencyPair ( e . g . BTC / USD ) * @ param timeScale polled order books provide a timestamp in seconds , stream in ms * @ return The XChange OrderBook */ public static OrderBook adaptOrderBook ( EXXOrderbook exxOrderbook , CurrencyPair cu...
List < LimitOrder > asks = new ArrayList < LimitOrder > ( ) ; List < LimitOrder > bids = new ArrayList < LimitOrder > ( ) ; for ( BigDecimal [ ] exxAsk : exxOrderbook . getAsks ( ) ) { asks . add ( new LimitOrder ( OrderType . ASK , exxAsk [ 1 ] , currencyPair , null , null , exxAsk [ 0 ] ) ) ; } for ( BigDecimal [ ] e...
public class ASTPrinter { /** * Prints a single comment pretty much unmolested */ public static String print ( final String indent , JavaComment comment ) { } }
return comment . match ( new JavaComment . MatchBlock < String > ( ) { @ Override public String _case ( JavaDocComment x ) { final StringBuilder builder = new StringBuilder ( indent ) ; builder . append ( x . start ) ; for ( JDToken token : x . generalSection ) { builder . append ( print ( indent , token ) ) ; } for ( ...
public class RqMtBase { /** * Make a request . * Scans the origin request until the boundary reached . Caches * the content into a temporary file and returns it as a new request . * @ param boundary Boundary * @ param body Origin request body * @ return Request * @ throws IOException If fails */ private Req...
final File file = File . createTempFile ( RqMultipart . class . getName ( ) , ".tmp" ) ; try ( WritableByteChannel channel = Files . newByteChannel ( file . toPath ( ) , StandardOpenOption . READ , StandardOpenOption . WRITE ) ) { channel . write ( ByteBuffer . wrap ( this . head ( ) . iterator ( ) . next ( ) . getByte...
public class AmazonIdentityManagementAsyncClient { /** * Simplified method form for invoking the GetAccountSummary operation with an AsyncHandler . * @ see # getAccountSummaryAsync ( GetAccountSummaryRequest , com . amazonaws . handlers . AsyncHandler ) */ @ Override public java . util . concurrent . Future < GetAcco...
return getAccountSummaryAsync ( new GetAccountSummaryRequest ( ) , asyncHandler ) ;
public class AbstractGeneratorMojo { /** * Updates the StatusFile ( defined via { @ link # statusFile } ) . This file * indicates the last successful execution of the code generator and is used * to check the state of the source files . * @ param createdFiles * list of files created by the code generator */ pro...
boolean success ; final Properties statusProperties = new Properties ( ) ; try { for ( File createdFile : createdFiles ) { try { statusProperties . setProperty ( getProjectRelativePath ( createdFile ) , calculateChecksum ( createdFile ) ) ; } catch ( IOException e ) { getLog ( ) . warn ( "Checksum calculation failed: "...
public class FileExecutor { /** * 批量重命名文件 * @ param folder 文件夹 * @ param prefix 文件前缀 * @ param suffix 文件后缀 * @ param start 开始位置 */ public static void renameFiles ( String folder , String prefix , String suffix , int start ) { } }
renameFiles ( scanFolderAsArray ( folder ) , prefix , suffix , start ) ;
public class EmbeddedChannel { /** * Register this { @ code Channel } on its { @ link EventLoop } . */ public void register ( ) throws Exception { } }
ChannelFuture future = loop . register ( this ) ; assert future . isDone ( ) ; Throwable cause = future . cause ( ) ; if ( cause != null ) { PlatformDependent . throwException ( cause ) ; }
public class CmsSolrQuery { /** * Sets the textSearchFields . < p > * @ param textSearchFields the textSearchFields to set */ public void setTextSearchFields ( List < String > textSearchFields ) { } }
m_textSearchFields = textSearchFields ; if ( m_text != null ) { setText ( m_text ) ; }
public class IntrospectionUtils { /** * Creates and returns a new instance of a persistence class for the given metadata . The returned * object will be an instance of the primary persistence class or its Builder . * @ param metadata * the metadata of the class * @ return a new instance of the of the Class to w...
try { return metadata . getConstructorMetadata ( ) . getConstructorMethodHandle ( ) . invoke ( ) ; } catch ( Throwable t ) { throw new EntityManagerException ( t ) ; }
public class HelpFormatter { /** * Print the help for < code > options < / code > with the specified command line * syntax . This method prints help information to System . out . * @ param sCmdLineSyntax * the syntax for this application * @ param sHeader * the banner to display at the beginning of the help ...
printHelp ( getWidth ( ) , sCmdLineSyntax , sHeader , aOptions , sFooter , bAutoUsage ) ;
public class AbstractType { /** * An alternative comparison function used by CollectionsType in conjunction with CompositeType . * This comparator is only called to compare components of a CompositeType . It gets the value of the * previous component as argument ( or null if it ' s the first component of the compos...
return compare ( v1 , v2 ) ;
public class ScatterChartPanel { /** * Returns the Y - coordinate for a given value of the second dimension ( Y ) , * considering the actual operation - mode { @ link # zeroBased } . < br > * This implementation simply returns a value that reflects the position of the given value with respect to the coordinate axis...
double offset = zeroBased ? 0.0 : getTickInfo ( ValueDimension . Y ) . getFirstTick ( ) ; return getPaintingRegion ( ) . getBottomLeft ( ) . y - ( int ) Math . round ( ( value . doubleValue ( ) - offset ) * getPaintingRegion ( ) . getUnit ( ValueDimension . Y ) ) ;
public class AWSCodePipelineClient { /** * Provides the response to a manual approval request to AWS CodePipeline . Valid responses include Approved and * Rejected . * @ param putApprovalResultRequest * Represents the input of a PutApprovalResult action . * @ return Result of the PutApprovalResult operation ret...
request = beforeClientExecution ( request ) ; return executePutApprovalResult ( request ) ;
public class StoreDefinitionUtils { /** * If provided with an AVRO schema , validates it and checks if there are * backwards compatible . * TODO should probably place some similar checks for other serializer types * as well ? * @ param serializerDef */ private static void validateIfAvroSchema ( SerializerDefini...
if ( serializerDef . getName ( ) . equals ( AVRO_GENERIC_VERSIONED_TYPE_NAME ) || serializerDef . getName ( ) . equals ( AVRO_GENERIC_TYPE_NAME ) ) { SchemaEvolutionValidator . validateAllAvroSchemas ( serializerDef ) ; // check backwards compatibility if needed if ( serializerDef . getName ( ) . equals ( AVRO_GENERIC_...
public class StringDuplicationDetector { /** * Checks if a string ' s beginning and end are equal . * @ param input The input string * @ param beginTo The beginning string ends at this point . * @ param endFrom The ending string starts from this point . * @ return * True if the two parts are equals , otherwis...
String begin = input . substring ( 0 , beginTo ) ; String end = input . substring ( endFrom ) ; return begin . equals ( end ) ;
public class ReadOnlyStyledDocumentBuilder { /** * Adds to the list a paragraph that has only one segment that has the same given style throughout . */ public ReadOnlyStyledDocumentBuilder < PS , SEG , S > addParagraph ( SEG segment , S style ) { } }
return addParagraph ( segment , style , null ) ;
public class AnnotationExtensions { /** * Search for the given annotationClass in the given componentClass and return it if search was * successful . * @ param < T > * the generic type * @ param componentClass * the component class * @ param annotationClass * the annotation class * @ return the annotati...
T annotation = componentClass . getAnnotation ( annotationClass ) ; if ( annotation != null ) { return annotation ; } for ( final Class < ? > ifc : componentClass . getInterfaces ( ) ) { annotation = getAnnotation ( ifc , annotationClass ) ; if ( annotation != null ) { return annotation ; } } if ( ! Annotation . class ...
public class ApplicationMetadata { /** * Returns true , if query is named native or native , else false * @ param name * mapped name . * @ return boolean value */ public boolean isNative ( String name ) { } }
QueryWrapper wrapper = namedNativeQueries != null && name != null ? namedNativeQueries . get ( name ) : null ; return wrapper != null ? wrapper . isNativeQuery ( ) : false ;
public class AwsSecurityFindingFilters { /** * The canonical user ID of the owner of the S3 bucket . * @ param resourceAwsS3BucketOwnerId * The canonical user ID of the owner of the S3 bucket . */ public void setResourceAwsS3BucketOwnerId ( java . util . Collection < StringFilter > resourceAwsS3BucketOwnerId ) { } ...
if ( resourceAwsS3BucketOwnerId == null ) { this . resourceAwsS3BucketOwnerId = null ; return ; } this . resourceAwsS3BucketOwnerId = new java . util . ArrayList < StringFilter > ( resourceAwsS3BucketOwnerId ) ;
public class HijrahDate { /** * Returns month days from the beginning of year . * @ param month month ( 0 - based ) * @ parma year year * @ return month days from the beginning of year */ private static int getMonthDays ( int month , int year ) { } }
Integer [ ] newMonths = getAdjustedMonthDays ( year ) ; return newMonths [ month ] . intValue ( ) ;
public class SarlSkillBuilderImpl { /** * Change the super type . * @ param superType the qualified name of the super type , * or < code > null < / code > if the default type . */ public void setExtends ( String superType ) { } }
if ( ! Strings . isEmpty ( superType ) && ! Skill . class . getName ( ) . equals ( superType ) ) { JvmParameterizedTypeReference superTypeRef = newTypeRef ( this . sarlSkill , superType ) ; JvmTypeReference baseTypeRef = findType ( this . sarlSkill , Skill . class . getCanonicalName ( ) ) ; if ( isSubTypeOf ( this . sa...
public class JmxUtil { /** * Register the given dynamic JMX MBean . * @ param mbean Dynamic MBean to register * @ param objectName { @ link ObjectName } under which to register the MBean . * @ param mBeanServer { @ link MBeanServer } where to store the MBean . * @ throws Exception If registration could not be c...
if ( ! mBeanServer . isRegistered ( objectName ) ) { try { SecurityActions . registerMBean ( mbean , objectName , mBeanServer ) ; log . tracef ( "Registered %s under %s" , mbean , objectName ) ; } catch ( InstanceAlreadyExistsException e ) { // this might happen if multiple instances are trying to concurrently register...
public class ConverterServerBuilder { /** * Configures a worker pool for the converter . * @ param corePoolSize The core pool size of the worker pool . * @ param maximumPoolSize The maximum pool size of the worker pool . * @ param keepAliveTime The keep alive time of the worker pool . * @ param unit The time un...
assertNumericArgument ( corePoolSize , true ) ; assertNumericArgument ( maximumPoolSize , true ) ; assertNumericArgument ( corePoolSize + maximumPoolSize , false ) ; assertNumericArgument ( keepAliveTime , true ) ; this . corePoolSize = corePoolSize ; this . maximumPoolSize = maximumPoolSize ; this . keepAliveTime = un...
public class Surface { /** * Create a plot canvas with the 3D surface plot of given data . * @ param x the x - axis values of surface . * @ param y the y - axis values of surface . * @ param z the z - axis values of surface . */ public static PlotCanvas plot ( double [ ] x , double [ ] y , double [ ] [ ] z ) { } ...
double [ ] lowerBound = { Math . min ( x ) , Math . min ( y ) , Math . min ( z ) } ; double [ ] upperBound = { Math . max ( x ) , Math . max ( y ) , Math . max ( z ) } ; PlotCanvas canvas = new PlotCanvas ( lowerBound , upperBound ) ; Surface surface = new Surface ( x , y , z ) ; canvas . add ( surface ) ; return canva...
public class ObjectReaderImpl { /** * { @ inheritDoc } */ public long skip ( long n ) throws IOException { } }
if ( n <= 0 ) return 0 ; long remaining = n ; int nr ; byte [ ] skipBuffer = new byte [ SerializationConstants . INTERNAL_BUFFER_SIZE ] ; while ( remaining > 0 ) { nr = in . read ( skipBuffer , 0 , ( int ) Math . min ( SerializationConstants . INTERNAL_BUFFER_SIZE , remaining ) ) ; if ( nr < 0 ) { break ; } remaining -...
public class PageImpl { /** * Utility method to construct the options map for the next page request . * @ param < T > the value type that the page holds . Instances of { @ code T } should be { @ code * Serializable } * @ param pageTokenOption the key for the next page cursor option in the options map * @ param ...
ImmutableMap . Builder < T , Object > builder = ImmutableMap . builder ( ) ; if ( cursor != null ) { builder . put ( pageTokenOption , cursor ) ; } for ( Map . Entry < T , ? > option : optionMap . entrySet ( ) ) { if ( ! Objects . equals ( option . getKey ( ) , pageTokenOption ) ) { builder . put ( option . getKey ( ) ...
public class ScriptModuleUtils { /** * Create module path from module moduleIdentifier . * @ param moduleIdentifier module identifier to create path for * @ return path to module for given moduleIdentifier */ public static Path createModulePath ( ModuleIdentifier moduleIdentifier ) { } }
return Paths . get ( moduleIdentifier . getName ( ) + "-" + moduleIdentifier . getSlot ( ) ) ;
public class WebUtilities { /** * Double encode open or closed brackets in the input String . * @ param input the String to double encode open or closed brackets * @ return the String with double encoded open or closed brackets */ public static String doubleEncodeBrackets ( final String input ) { } }
if ( input == null || input . length ( ) == 0 ) { // For performance reasons don ' t use Util . empty return input ; } return DOUBLE_ENCODE_BRACKETS . translate ( input ) ;
public class GroundyCodeGen { /** * Makes sure method is public , returns void and all its parameters are annotated too . */ private static List < NameAndType > getParamNames ( Element callbackMethod ) { } }
Element parentClass = callbackMethod . getEnclosingElement ( ) ; String methodFullInfo = parentClass + "#" + callbackMethod ; ExecutableElement method = ( ExecutableElement ) callbackMethod ; if ( ! method . getModifiers ( ) . contains ( Modifier . PUBLIC ) ) { LOGGER . info ( methodFullInfo + " must be public." ) ; Sy...
public class IDCard { /** * 获取用户年龄 * @ param idCard 用户身份证号 * @ return 用户年龄 */ public static int getAge ( String idCard ) { } }
int age ; // 计算用户年龄 int year = Integer . parseInt ( idCard . substring ( 6 , 10 ) ) ; int monthDay = Integer . parseInt ( idCard . substring ( 10 , 14 ) ) ; Calendar calendar = Calendar . getInstance ( ) ; int nowYear = calendar . get ( Calendar . YEAR ) ; int nowMonthDay = calendar . get ( Calendar . MONTH ) * 100 + c...
public class ChannelReaderInputView { /** * Gets the next segment from the asynchronous block reader . If more requests are to be issued , the method * first sends a new request with the current memory segment . If no more requests are pending , the method * adds the segment to the readers return queue , which ther...
// check if we are at our end if ( this . inLastBlock ) { throw new EOFException ( ) ; } // send a request first . if we have only a single segment , this same segment will be the one obtained in // the next lines if ( current != null ) { sendReadRequest ( current ) ; } // get the next segment final MemorySegment seg =...
public class RepositoryResourceImpl { /** * Creates an object which can be used to compare with another resource ' s to determine if * they represent the same asset . * @ return */ public RepositoryResourceMatchingData createMatchingData ( ) { } }
RepositoryResourceMatchingData matchingData = new RepositoryResourceMatchingData ( ) ; matchingData . setName ( getName ( ) ) ; matchingData . setProviderName ( getProviderName ( ) ) ; matchingData . setType ( getType ( ) ) ; return matchingData ;
public class WindowedStream { /** * Applies the given window function to each window . The window function is called for each * evaluation of the window for each key individually . The output of the window function is * interpreted as a regular non - windowed stream . * < p > Arriving data is incrementally aggreg...
if ( foldFunction instanceof RichFunction ) { throw new UnsupportedOperationException ( "FoldFunction can not be a RichFunction." ) ; } if ( windowAssigner instanceof MergingWindowAssigner ) { throw new UnsupportedOperationException ( "Fold cannot be used with a merging WindowAssigner." ) ; } // clean the closures wind...
public class Check { /** * Ensures that a readable sequence of { @ code char } values is numeric . Numeric arguments consist only of the * characters 0-9 and may start with 0 ( compared to number arguments , which must be valid numbers - think of a bank * account number ) . * @ param value * a readable sequence...
IllegalNullArgumentException . class , IllegalNumericArgumentException . class } ) public static < T extends CharSequence > T isNumeric ( @ Nonnull final T value , @ Nullable final String name ) { Check . notNull ( value , "value" ) ; if ( ! matches ( NumericRegularExpressionHolder . getPattern ( ) , value ) ) { throw ...
public class ServletStartedListener { /** * Sets the given security metadata on the deployed module ' s web module metadata for retrieval later . * @ param deployedModule the deployed module to get the web module metadata * @ param securityMetadataFromDD the security metadata processed from the deployment descripto...
try { WebModuleMetaData wmmd = moduleContainer . adapt ( WebModuleMetaData . class ) ; wmmd . setSecurityMetaData ( securityMetadataFromDD ) ; } catch ( UnableToAdaptException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "There was a problem setting the security m...
public class CommerceAccountOrganizationRelUtil { /** * Returns the commerce account organization rels before and after the current commerce account organization rel in the ordered set where commerceAccountId = & # 63 ; . * @ param commerceAccountOrganizationRelPK the primary key of the current commerce account organ...
return getPersistence ( ) . findByCommerceAccountId_PrevAndNext ( commerceAccountOrganizationRelPK , commerceAccountId , orderByComparator ) ;
public class FileOutputFormat { /** * Get the { @ link Path } to the output directory for the map - reduce job . * @ return the { @ link Path } to the output directory for the map - reduce job . * @ see FileOutputFormat # getWorkOutputPath ( TaskInputOutputContext ) */ public static Path getOutputPath ( JobContext ...
String name = job . getConfiguration ( ) . get ( "mapred.output.dir" ) ; return name == null ? null : new Path ( name ) ;
public class Expressions { /** * Create a new Template expression * @ deprecated Use { @ link # booleanTemplate ( String , List ) } instead . * @ param template template * @ param args template parameters * @ return template expression */ @ Deprecated public static BooleanTemplate booleanTemplate ( String templ...
return booleanTemplate ( createTemplate ( template ) , args ) ;
public class Pointer { /** * Returns a ByteBuffer that corresponds to the memory that this * pointer points to . < br > * < br > * The returned byte buffer will have the byte order that is implied * by < code > ByteOrder # nativeOrder ( ) < / code > . It will be a slice of the * buffer that is stored internal...
if ( buffer == null ) { return null ; } if ( ! ( buffer instanceof ByteBuffer ) ) { return null ; } ByteBuffer internalByteBuffer = ( ByteBuffer ) buffer ; ByteBuffer byteBuffer = internalByteBuffer . slice ( ) ; return byteBuffer . order ( ByteOrder . nativeOrder ( ) ) ;
public class Filelistener { /** * Add a new filelistener to the system . * @ param pResourcename * @ param pListenerPath * @ return return true if there has been a success . * @ throws FileNotFoundException * @ throws IOException * @ throws ClassNotFoundException */ public static boolean addFilelistener ( S...
mFilelistenerToPaths = new HashMap < String , String > ( ) ; File listenerFilePaths = new File ( StorageManager . ROOT_PATH + File . separator + "mapping.data" ) ; getFileListenersFromSystem ( listenerFilePaths ) ; mFilelistenerToPaths . put ( pResourcename , pListenerPath ) ; ByteArrayDataOutput output = ByteStreams ....
public class LabelParameterVersionRequest { /** * One or more labels to attach to the specified parameter version . * @ param labels * One or more labels to attach to the specified parameter version . */ public void setLabels ( java . util . Collection < String > labels ) { } }
if ( labels == null ) { this . labels = null ; return ; } this . labels = new com . amazonaws . internal . SdkInternalList < String > ( labels ) ;
public class ServiceUtil { /** * Returns java method name for corresponding rpc method . */ public static String getMethodName ( ServiceMethod serviceMethod ) { } }
String name = serviceMethod . getName ( ) ; String formattedName = Formatter . toCamelCase ( name ) ; if ( isReservedKeyword ( formattedName ) ) { return formattedName + '_' ; } return formattedName ;
public class HttpRequest { /** * Adds one query string parameter to match which can specified using plain strings or regular expressions * ( for more details of the supported regex syntax see http : / / docs . oracle . com / javase / 6 / docs / api / java / util / regex / Pattern . html ) * @ param name the paramet...
this . queryStringParameters . withEntry ( name , values ) ; return this ;
public class StringParser { /** * Parse the given { @ link String } as double . * @ param sStr * The string to parse . May be < code > null < / code > . * @ param dDefault * The default value to be returned if the passed object could not be * converted to a valid value . * @ return The default value if the ...
// parseDouble throws a NPE if parameter is null if ( sStr != null && sStr . length ( ) > 0 ) try { // Single point where we replace " , " with " . " for parsing ! return Double . parseDouble ( _getUnifiedDecimal ( sStr ) ) ; } catch ( final NumberFormatException ex ) { // Fall through } return dDefault ;
public class ClustersInner { /** * Gets the gateway settings for the specified cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Gate...
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 ( cluster...
public class DBEngineVersion { /** * The types of logs that the database engine has available for export to CloudWatch Logs . * @ param exportableLogTypes * The types of logs that the database engine has available for export to CloudWatch Logs . */ public void setExportableLogTypes ( java . util . Collection < Stri...
if ( exportableLogTypes == null ) { this . exportableLogTypes = null ; return ; } this . exportableLogTypes = new java . util . ArrayList < String > ( exportableLogTypes ) ;
public class WriteTimeoutHandler { /** * Is called when a write timeout was detected */ protected void writeTimedOut ( ChannelHandlerContext ctx ) throws Exception { } }
if ( ! closed ) { ctx . fireExceptionCaught ( WriteTimeoutException . INSTANCE ) ; ctx . close ( ) ; closed = true ; }
public class PBDRegularSegment { /** * Set or clear segment as ' final ' , i . e . whether segment is complete and logically immutable . * NOTES : * This is a best - effort feature : On any kind of I / O failure , the exception is swallowed and the operation is a * no - op : this will be the case on filesystems t...
if ( isFinal != m_isFinal ) { if ( PBDSegment . setFinal ( m_file , isFinal ) ) { if ( ! isFinal ) { // It is dangerous to leave final on a segment so make sure the metadata is flushed m_fc . force ( true ) ; } } else if ( PBDSegment . isFinal ( m_file ) && ! isFinal ) { throw new IOException ( "Could not remove the fi...
public class AndRange { /** * ( non - Javadoc ) * @ see net . ossindex . version . impl . AbstractCommonRange # invert ( ) */ @ Override public IVersionRange invert ( ) { } }
IVersionRange irange1 = range1 . invert ( ) ; IVersionRange irange2 = range2 . invert ( ) ; return new OrRange ( irange1 , irange2 ) ;
public class QuotedPrintable { /** * Encode the given input . */ public static ByteBuffer encode ( byte [ ] input ) { } }
int pos = input . length + input . length / 3 ; if ( pos < 64 ) pos = 64 ; byte [ ] out = new byte [ pos ] ; pos = 0 ; int lineCount = 0 ; for ( int i = 0 ; i < input . length ; ++ i ) { byte b = input [ i ] ; if ( ( b >= 33 && b <= 60 ) || ( b >= 62 && b <= 126 ) || ( ( b == 9 || b == 32 ) && lineCount < 73 && i < inp...
public class XsDateTimeConversionJava7 { /** * Returns a DateFormat for each calling thread , using { @ link ThreadLocal } . * @ return a DateFormat that is safe to use in multi - threaded environments */ private static DateFormat getDateFormat ( ) { } }
if ( IS_JAVA7 ) { SoftReference < DateFormat > softReference = THREAD_LOCAL_DF . get ( ) ; if ( softReference != null ) { DateFormat dateFormat = softReference . get ( ) ; if ( dateFormat != null ) { return dateFormat ; } } DateFormat result = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" , Locale . US ) ; soft...
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns the commerce notification templates before and after the current commerce notification template in the ordered set where uuid = & # 63 ; . * @ param commerceNotificationTemplateId the primary key of the current commerce notification template *...
CommerceNotificationTemplate commerceNotificationTemplate = findByPrimaryKey ( commerceNotificationTemplateId ) ; Session session = null ; try { session = openSession ( ) ; CommerceNotificationTemplate [ ] array = new CommerceNotificationTemplateImpl [ 3 ] ; array [ 0 ] = getByUuid_PrevAndNext ( session , commerceNotif...
public class OrmLiteCursorAdapter { /** * This is here to make sure that the user really wants to override it . */ protected void doBindView ( View itemView , Context context , Cursor cursor ) { } }
try { @ SuppressWarnings ( "unchecked" ) ViewType itemViewType = ( ViewType ) itemView ; bindView ( itemViewType , context , cursorToObject ( cursor ) ) ; } catch ( SQLException e ) { throw new RuntimeException ( e ) ; }
public class ConnectionImpl { /** * Determines whether a destination prefix for a System destination is valid or not . * < p > If the destination prefix has more than 24 * characters , then it is invalid . * < p > The destination prefix is invalid if it contains any characters not in the following * list : * ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isDestinationPrefixValid" , destinationPrefix ) ; boolean isValid = true ; // Assume the prefix is valid until we know otherwise . // null indicates that no destination prefix is being used . if ( null != destinationPrefix ...
public class RuleHelper { /** * This method returns an instrumented proxy output stream , to wrap * the supplied output stream , which will record the written data . * @ param os The original output stream * @ return The instrumented output stream */ public OutputStream createInOutputStream ( OutputStream os ) { ...
return new InstrumentedOutputStream ( collector ( ) , Direction . In , os , null ) ;
public class DOType { /** * Answer the field - ( attribute ) definitions declared by this type and all it ' s super types . * @ return a list of DOField */ public List < DOField > getFields ( ) { } }
List < DOField > ret = new ArrayList < DOField > ( ) ; DOType typ = this ; while ( typ != null ) { ret . addAll ( typ . getDeclaredFields ( ) ) ; typ = typ . getSuperType ( ) ; } return ret ;
public class CommerceNotificationAttachmentLocalServiceBaseImpl { /** * Adds the commerce notification attachment to the database . Also notifies the appropriate model listeners . * @ param commerceNotificationAttachment the commerce notification attachment * @ return the commerce notification attachment that was a...
commerceNotificationAttachment . setNew ( true ) ; return commerceNotificationAttachmentPersistence . update ( commerceNotificationAttachment ) ;
public class NoxView { /** * Checks the X and Y scroll offset to update that values into the Shape configured previously . */ private void updateShapeOffset ( ) { } }
int offsetX = scroller . getOffsetX ( ) ; int offsetY = scroller . getOffsetY ( ) ; shape . setOffset ( offsetX , offsetY ) ;
public class ControlBrowseEndImpl { /** * Get summary trace line for this message * Javadoc description supplied by ControlMessage interface . */ public void getTraceSummaryLine ( StringBuilder buff ) { } }
// Get the common fields for control messages super . getTraceSummaryLine ( buff ) ; buff . append ( ",browseID=" ) ; buff . append ( getBrowseID ( ) ) ; buff . append ( ",exceptionCode=" ) ; buff . append ( getExceptionCode ( ) ) ;
public class Container { /** * Indicates the specified component installed or not in the container . * @ param component The component class to be examined . * @ return < code > true < / code > if the specified component installed in the * container . */ public boolean installed ( Class < ? > component ) { } }
Preconditions . checkArgument ( component != null , "Parameter 'component' must not be [" + component + "]" ) ; return installed . contains ( component ) ;
public class EcodInstallation { /** * Parses the domains from the local file * @ throws IOException */ private void parseDomains ( ) throws IOException { } }
domainsFileLock . writeLock ( ) . lock ( ) ; logger . trace ( "LOCK writelock" ) ; try { EcodParser parser = new EcodParser ( getDomainFile ( ) ) ; allDomains = parser . getDomains ( ) ; parsedVersion = parser . getVersion ( ) ; } finally { logger . trace ( "UNLOCK writelock" ) ; domainsFileLock . writeLock ( ) . unloc...
public class TCPInputPoller { /** * / * ( non - Javadoc ) * @ see java . lang . Thread # run ( ) * Start waiting for TCP messages . */ public void run ( ) { } }
this . serverSocket = null ; try { Log ( Level . INFO , "Attempting to create SocketServer..." ) ; // If requrestedPortNumber is 0 and we have a range of ports specified , then attempt to allocate a port dynamically from that range . if ( this . requestedPortNumber == 0 && this . portRangeMax != - 1 && this . portRange...
public class WebDirectoryResourceListSource { /** * { @ inheritDoc } */ protected List getDirectories ( ) { } }
List dirs = new ArrayList ( 1 ) ; dirs . add ( path + File . separator + "classes" ) ; return dirs ;
public class EntryStream { /** * Returns a stream consisting of the entries of this stream , additionally * performing the provided action on each entry key - value pair as entries * are consumed from the resulting stream . * This is an < a href = " package - summary . html # StreamOps " > intermediate < / a > ...
return peek ( toConsumer ( action ) ) ;
public class BaseConfigFileService { /** * Validate the config with the supplied { @ link ValidationService } , calls { @ link # withoutDefaultLogin ( Config ) } * and { @ link # withHashedPasswords ( Config ) } before setting the config , and calls { @ link # postUpdate } * before writing the config to a file . ...
final ValidationResults validationResults = validationService . validateEnabledConfig ( config ) ; if ( ! validationResults . isValid ( ) ) { throw new ConfigValidationException ( validationResults ) ; } final T initialConfig = getConfig ( ) ; setConfig ( config ) ; safePostUpdate ( config , initialConfig ) ; try { wri...
public class HtmlUnitRegExpProxy { /** * { @ inheritDoc } */ @ Override public Object compileRegExp ( final Context cx , final String source , final String flags ) { } }
try { return wrapped_ . compileRegExp ( cx , source , flags ) ; } catch ( final Exception e ) { // LOG . warn ( " compileRegExp ( ) threw for > " + source + " < , flags : > " // + flags + " < . " // + " Replacing with a ' # # # # shouldNotFindAnything # # # ' " ) ; return wrapped_ . compileRegExp ( cx , "####shouldNotF...
public class IdpMetadataGenerator { /** * List of bindings to be included in the generated metadata for Web Single Sign - On Holder of Key . Ordering of * bindings affects inclusion in the generated metadata . * " post " ( or * " urn : oasis : names : tc : SAML : 2.0 : bindings : HTTP - POST " ) . * By default ...
if ( bindingsHoKSSO == null ) { this . bindingsHoKSSO = Collections . emptyList ( ) ; } else { this . bindingsHoKSSO = bindingsHoKSSO ; }
public class DexMaker { /** * parent class types . */ private String generateFileName ( ) { } }
int checksum = 1 ; Set < TypeId < ? > > typesKeySet = types . keySet ( ) ; Iterator < TypeId < ? > > it = typesKeySet . iterator ( ) ; int [ ] checksums = new int [ typesKeySet . size ( ) ] ; int i = 0 ; while ( it . hasNext ( ) ) { TypeId < ? > typeId = it . next ( ) ; TypeDeclaration decl = getTypeDeclaration ( typeI...
public class Abbreviations { /** * Count number of upper case chars . */ private int countUpper ( String str ) { } }
if ( str == null ) return 0 ; int num = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) if ( Character . isUpperCase ( str . charAt ( i ) ) ) num ++ ; return num ;
public class BibliographyCommand { /** * Performs CSL conversion and generates a bibliography * @ param style the CSL style * @ param locale the CSL locale * @ param format the output format * @ param citationIds the citation ids given on the command line * @ param provider a provider containing all citation ...
if ( ! checkStyle ( style ) ) { return 1 ; } // initialize citation processor try ( CSL citeproc = new CSL ( provider , style , locale ) ) { // set output format citeproc . setOutputFormat ( format ) ; // register citation items String [ ] citationIdsArr = new String [ citationIds . size ( ) ] ; citationIdsArr = citati...
public class SystemOutputInterceptor { /** * Stops intercepting System . out / System . err , sending output to wherever it was * going when this interceptor was created . */ public void stop ( ) { } }
if ( output ) { System . setOut ( ( PrintStream ) out ) ; } else { System . setErr ( ( PrintStream ) out ) ; }
public class AbstractDatabase { /** * Adds a new check key to given SQL table . * @ param _ con SQL connection * @ param _ tableName name of the SQL table for which the check key must be * created * @ param _ checkKeyName name of check key to create * @ param _ condition condition of the check key * @ throw...
final StringBuilder cmd = new StringBuilder ( ) . append ( "alter table " ) . append ( _tableName ) . append ( " " ) . append ( "add constraint " ) . append ( _checkKeyName ) . append ( " " ) . append ( "check(" ) . append ( _condition ) . append ( ")" ) ; AbstractDatabase . LOG . debug ( " ..SQL> " + cmd . toString...
public class U { /** * Documented , # last */ public static < E > E last ( final List < E > list ) { } }
return list . get ( list . size ( ) - 1 ) ;
public class MLEDependencyGrammar { /** * Score a tag binned dependency . */ public double scoreTB ( IntDependency dependency ) { } }
return op . testOptions . depWeight * Math . log ( probTB ( dependency ) ) ;