signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CmsCloneModuleThread { /** * Returns a list of all module names . < p > * @ return a list of all module names */ public List < String > getAllModuleNames ( ) { } }
List < String > sortedModuleNames = new ArrayList < String > ( OpenCms . getModuleManager ( ) . getModuleNames ( ) ) ; java . util . Collections . sort ( sortedModuleNames ) ; return sortedModuleNames ;
public class Ftp { /** * 初始化连接 * @ param host 域名或IP * @ param port 端口 * @ param user 用户名 * @ param password 密码 * @ return this */ public Ftp init ( String host , int port , String user , String password ) { } }
return this . init ( host , port , user , password , null ) ;
public class ServiceEndpointPoliciesInner { /** * Gets all service endpoint Policies in a resource group . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedLi...
return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ServiceEndpointPolicyInner > > , Page < ServiceEndpointPolicyInner > > ( ) { @ Override public Page < ServiceEndpointPolicyInner > call ( ServiceResponse < Page < ServiceEndpointPolicyInner > > response ...
public class ImageModerationsImpl { /** * Returns probabilities of the image containing racy or adult content . * @ param contentType The content type . * @ param imageUrl The image url . * @ param evaluateUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API ...
return evaluateUrlInputWithServiceResponseAsync ( contentType , imageUrl , evaluateUrlInputOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Frame { /** * Sets the value of the given local variable . * @ param i * a local variable index . * @ param value * the new value of this local variable . * @ throws IndexOutOfBoundsException * if the variable does not exist . */ public void setLocal ( final int i , final V value ) throws Index...
if ( i >= locals ) { throw new IndexOutOfBoundsException ( "Trying to access an inexistant local variable " + i ) ; } values [ i ] = value ;
public class BoxTransactionalAPIConnection { /** * Request a scoped transactional token . * @ param accessToken application access token . * @ param scope scope of transactional token . * @ return a BoxAPIConnection which can be used to perform transactional requests . */ public static BoxAPIConnection getTransac...
return BoxTransactionalAPIConnection . getTransactionConnection ( accessToken , scope , null ) ;
public class FtpServerBuilder { /** * Sets the ftp server . * @ param server * @ return */ public FtpServerBuilder server ( org . apache . ftpserver . FtpServer server ) { } }
endpoint . setFtpServer ( server ) ; return this ;
public class Mediawiki { /** * handle the given Throwable ( in commandline mode ) * @ param t */ public void handle ( Throwable t ) { } }
System . out . flush ( ) ; System . err . println ( t . getClass ( ) . getSimpleName ( ) + ":" + t . getMessage ( ) ) ; if ( debug ) t . printStackTrace ( ) ;
public class BoxApiFile { /** * Gets a request that moves a file to another folder * @ param id id of file to move * @ param parentId id of parent folder to move file into * @ return request to move a file */ public BoxRequestsFile . UpdateFile getMoveRequest ( String id , String parentId ) { } }
BoxRequestsFile . UpdateFile request = new BoxRequestsFile . UpdateFile ( id , getFileInfoUrl ( id ) , mSession ) ; request . setParentId ( parentId ) ; return request ;
public class PlatformSummary { /** * The tiers in which the platform runs . * @ param supportedTierList * The tiers in which the platform runs . */ public void setSupportedTierList ( java . util . Collection < String > supportedTierList ) { } }
if ( supportedTierList == null ) { this . supportedTierList = null ; return ; } this . supportedTierList = new com . amazonaws . internal . SdkInternalList < String > ( supportedTierList ) ;
public class GraphicsUtil { /** * 创建 { @ link Graphics2D } * @ param image { @ link BufferedImage } * @ param color { @ link Color } 背景颜色以及当前画笔颜色 * @ return { @ link Graphics2D } * @ since 4.5.2 */ public static Graphics2D createGraphics ( BufferedImage image , Color color ) { } }
final Graphics2D g = image . createGraphics ( ) ; // 填充背景 g . setColor ( color ) ; g . fillRect ( 0 , 0 , image . getWidth ( ) , image . getHeight ( ) ) ; return g ;
public class AbstractAdminObject { /** * Sets the link properties for this object . * @ param _ linkTypeUUID UUID of the type of the link property * @ param _ toId to id * @ param _ toTypeUUID UUDI of the to type * @ param _ toName to name * @ throws EFapsException on error */ protected void setLinkProperty (...
setDirty ( ) ;
public class ServerAddress { /** * Creates a new ServerAddress instance from a string matching the format * < code > host : port < / code > . * @ param string a string matching the format < code > host : port < / code > . * @ return A new ServerAddress instance based on the string representation . */ public stati...
String tokens [ ] = string . split ( ":" ) ; if ( tokens . length == 1 ) { return new ServerAddress ( tokens [ 0 ] , null ) ; } return new ServerAddress ( tokens [ 0 ] , Integer . valueOf ( tokens [ 1 ] ) ) ;
public class ErrorToFixMapper { /** * Creates a SuggestedFix for the given error . Note that some errors have multiple fixes * so getFixesForJsError should often be used instead of this . */ public static SuggestedFix getFixForJsError ( JSError error , AbstractCompiler compiler ) { } }
switch ( error . getType ( ) . key ) { case "JSC_REDECLARED_VARIABLE" : return getFixForRedeclaration ( error , compiler ) ; case "JSC_REFERENCE_BEFORE_DECLARE" : return getFixForEarlyReference ( error , compiler ) ; case "JSC_MISSING_SEMICOLON" : return getFixForMissingSemicolon ( error , compiler ) ; case "JSC_REQUIR...
public class CompositeUnicode2Unicode { /** * Convert a vietnamese string with composite unicode encoding to unicode encoding . * @ param text string in vietnamese with composite unicode encoding * @ return string with unicode encoding */ public String convert ( String text ) { } }
String ret = text ; if ( cpsUni2Uni == null ) return ret ; Iterator < String > it = cpsUni2Uni . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String cpsChar = it . next ( ) ; ret = ret . replaceAll ( cpsChar , cpsUni2Uni . get ( cpsChar ) ) ; } return ret ;
public class ReservoirItemsSketch { /** * Computes an estimated subset sum from the entire stream for objects matching a given * predicate . Provides a lower bound , estimate , and upper bound using a target of 2 standard * deviations . * < p > This is technically a heuristic method , and tries to err on the cons...
if ( itemsSeen_ == 0 ) { return new SampleSubsetSummary ( 0.0 , 0.0 , 0.0 , 0.0 ) ; } final long numSamples = getNumSamples ( ) ; final double samplingRate = numSamples / ( double ) itemsSeen_ ; assert samplingRate >= 0.0 ; assert samplingRate <= 1.0 ; int trueCount = 0 ; for ( int i = 0 ; i < numSamples ; ++ i ) { if ...
public class JsMainImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . runtime . component . WsComponent # stop ( ) */ public void stop ( ) { } }
String thisMethodName = CLASS_NAME + ".stop()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { // SibTr . entry ( tc , thisMethodName ) ; } // Get the MEs on this server Enumeration meEnum = _messagingEngines . elements ( ) ; // Stop each ME on this server . Any exceptions are caught and ...
public class OlmConnector { /** * / * ( non - Javadoc ) * @ see org . springframework . beans . factory . InitializingBean # afterPropertiesSet ( ) */ public void afterPropertiesSet ( ) { } }
connector = ConnectorFactory . create ( olmConnectorPropertyFile , connectorName ) ; connector . setResponseManager ( olmAckManger ) ; connector . setErrorManager ( errorManager ) ; connector . configure ( ) ;
public class DeepFetchNode { /** * mapper is not necessarily this . relatedFinder . mapper . chained mapper and linked mapper ' s callbacks . */ public Operation createMappedOperationForDeepFetch ( Mapper mapper ) { } }
Operation rootOperation = this . getRootOperation ( ) ; if ( rootOperation == null ) return null ; return mapper . createMappedOperationForDeepFetch ( rootOperation ) ;
public class TableFunctionsCellTable { /** * Create an anchor with the title and the pubMedId * In the config file use : * fieldName = " func ( PUBMED _ URL ( title , pubMedID ) ) " */ private String pubMedURL ( ) { } }
if ( params . length != 2 ) { throw new IllegalArgumentException ( "Wrong number of Parameters for limit string expression" ) ; } final String title = record . getValueByFieldName ( params [ 0 ] ) ; String pubMedId = record . getValueByFieldName ( params [ 1 ] ) ; if ( pubMedId . isEmpty ( ) ) { return title ; } String...
public class LoggingCharacterComponent { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . rendering . PipelineComponent # getEventReader ( javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) */ @ Override public PipelineEventReader < CharacterEventReader , Character...
final PipelineEventReader < CharacterEventReader , CharacterEvent > pipelineEventReader = this . wrappedComponent . getEventReader ( request , response ) ; final CharacterEventReader eventReader = pipelineEventReader . getEventReader ( ) ; final LoggingCharacterEventReader loggingEventReader = new LoggingCharacterEvent...
public class OptionUtil { /** * 导出到指定文件 * @ param option * @ param folderPath * @ param fileName * @ return 返回html路径 */ public static String exportToHtml ( Option option , String folderPath , String fileName ) { } }
if ( fileName == null || fileName . length ( ) == 0 ) { return exportToHtml ( option , folderPath ) ; } Writer writer = null ; List < String > lines = readLines ( option ) ; // 写入文件 File html = new File ( getFolderPath ( folderPath ) + "/" + fileName ) ; try { writer = new OutputStreamWriter ( new FileOutputStream ( ht...
public class JobmanagerInfoServlet { /** * Writes ManagementGraph as Json for all recent jobs * @ param wrt * @ param jobs */ private void writeJsonForJobs ( PrintWriter wrt , List < RecentJobEvent > jobs ) { } }
try { wrt . write ( "[" ) ; // Loop Jobs for ( int i = 0 ; i < jobs . size ( ) ; i ++ ) { RecentJobEvent jobEvent = jobs . get ( i ) ; writeJsonForJob ( wrt , jobEvent ) ; // Write seperator between json objects if ( i != jobs . size ( ) - 1 ) { wrt . write ( "," ) ; } } wrt . write ( "]" ) ; } catch ( EofException eof...
public class Governator { /** * Add a runtime profiles . Profiles are processed by the conditional binding { @ literal @ } ConditionalOnProfile and * are injectable as { @ literal @ } Profiles Set { @ literal < } String { @ literal > } . * @ param profiles Set of profiles * @ return this */ public Governator addP...
if ( profiles != null ) { this . profiles . addAll ( profiles ) ; } return this ;
public class RowSeq { /** * Extracts the value of a cell containing a data point . * @ param value The contents of a cell in HBase . * @ param value _ idx The offset inside { @ code values } at which the value * starts . * @ param flags The flags for this value . * @ return The value of the cell . * @ throw...
switch ( flags & Const . LENGTH_MASK ) { case 7 : return Double . longBitsToDouble ( Bytes . getLong ( values , value_idx ) ) ; case 3 : return Float . intBitsToFloat ( Bytes . getInt ( values , value_idx ) ) ; } throw new IllegalDataException ( "Floating point value @ " + value_idx + " not on 8 or 4 bytes in " + Array...
public class Controller { /** * Removes a child { @ link Router } from this Controller . When removed , all Controllers currently managed by * the { @ link Router } will be destroyed . * @ param childRouter The router to be removed */ public final void removeChildRouter ( @ NonNull Router childRouter ) { } }
if ( ( childRouter instanceof ControllerHostedRouter ) && childRouters . remove ( childRouter ) ) { childRouter . destroy ( true ) ; }
public class DevicesInner { /** * Gets the network settings of the specified data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the...
if ( deviceName == null ) { throw new IllegalArgumentException ( "Parameter deviceName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == ...
public class NotificationManager { /** * Init all static components of the notification . * @ param context context used to instantiate the builder . */ private void initNotificationBuilder ( Context context ) { } }
// inti builder . mNotificationBuilder = new NotificationCompat . Builder ( context ) ; mNotificationView = new RemoteViews ( context . getPackageName ( ) , R . layout . simple_sound_cloud_notification ) ; mNotificationExpandedView = new RemoteViews ( context . getPackageName ( ) , R . layout . simple_sound_cloud_notif...
public class AppOpticsMeterRegistry { /** * VisibleForTesting */ Optional < String > writeTimeGauge ( TimeGauge timeGauge ) { } }
double value = timeGauge . value ( getBaseTimeUnit ( ) ) ; if ( ! Double . isFinite ( value ) ) { return Optional . empty ( ) ; } return Optional . of ( write ( timeGauge . getId ( ) , "timeGauge" , Fields . Value . tag ( ) , decimal ( value ) ) ) ;
public class Slice { /** * Transfers data from the specified slice into this buffer starting at * the specified absolute { @ code index } . * @ param sourceIndex the first index of the source * @ param length the number of bytes to transfer * @ throws IndexOutOfBoundsException if the specified { @ code index } ...
checkIndexLength ( index , length ) ; checkPositionIndexes ( sourceIndex , sourceIndex + length , source . length ( ) ) ; copyMemory ( source . base , source . address + sourceIndex , base , address + index , length ) ;
public class AllureReportUtils { /** * Serialize specified object to directory with specified name . Given output stream will be closed . * @ param obj object to serialize * @ return number of bytes written to directory */ public static int serialize ( OutputStream stream , Object obj ) { } }
ObjectMapper mapper = createMapperWithJaxbAnnotationInspector ( ) ; try ( DataOutputStream data = new DataOutputStream ( stream ) ; OutputStreamWriter writer = new OutputStreamWriter ( data , StandardCharsets . UTF_8 ) ) { mapper . writerWithDefaultPrettyPrinter ( ) . writeValue ( writer , obj ) ; return data . size ( ...
public class YarnJobSubmissionHandler { /** * Extracts the queue name from the driverConfiguration or return default if none is set . * @ param driverConfiguration The drievr configuration * @ return the queue name from the driverConfiguration or return default if none is set . */ private String getQueue ( final Co...
try { return Tang . Factory . getTang ( ) . newInjector ( driverConfiguration ) . getNamedInstance ( JobQueue . class ) ; } catch ( final InjectionException e ) { return this . defaultQueueName ; }
public class BaseFont { /** * Gets the name without the modifiers Bold , Italic or BoldItalic . * @ param name the full name of the font * @ return the name without the modifiers Bold , Italic or BoldItalic */ protected static String getBaseName ( String name ) { } }
if ( name . endsWith ( ",Bold" ) ) return name . substring ( 0 , name . length ( ) - 5 ) ; else if ( name . endsWith ( ",Italic" ) ) return name . substring ( 0 , name . length ( ) - 7 ) ; else if ( name . endsWith ( ",BoldItalic" ) ) return name . substring ( 0 , name . length ( ) - 11 ) ; else return name ;
public class TemplateNodeBuilder { /** * Private helper for the constructor to clean the SoyDoc . ( 1 ) Changes all newlines to " \ n " . ( 2) * Escapes deprecated javadoc tags . ( 3 ) Strips the start / end tokens and spaces ( including newlines * if they occupy their own lines ) . ( 4 ) Removes common indent from...
// Change all newlines to " \ n " . soyDoc = NEWLINE . matcher ( soyDoc ) . replaceAll ( "\n" ) ; // Escape all @ deprecated javadoc tags . // TODO ( cushon ) : add this to the specification and then also generate @ Deprecated annotations soyDoc = soyDoc . replace ( "@deprecated" , "&#64;deprecated" ) ; // Strip start ...
public class BioVerb { /** * getter for canonical - gets * @ generated * @ return value of the feature */ public String getCanonical ( ) { } }
if ( BioVerb_Type . featOkTst && ( ( BioVerb_Type ) jcasType ) . casFeat_canonical == null ) jcasType . jcas . throwFeatMissing ( "canonical" , "ch.epfl.bbp.uima.types.BioVerb" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( BioVerb_Type ) jcasType ) . casFeatCode_canonical ) ;
public class XMLConfigAdmin { /** * insert or update a mapping on system * @ param virtual * @ param physical * @ param archive * @ param primary * @ param trusted * @ param toplevel * @ throws ExpressionException * @ throws SecurityException */ public void updateMapping ( String virtual , String physic...
checkWriteAccess ( ) ; _updateMapping ( virtual , physical , archive , primary , inspect , toplevel , listenerMode , listenerType , readOnly ) ;
public class Get { /** * Retrieves the full html source of the current page the application is on * @ return String - current application page source */ public String htmlSource ( ) { } }
try { return driver . getPageSource ( ) ; } catch ( Exception e ) { log . warn ( e ) ; return null ; }
public class Transformation2D { /** * Initialize transformation from two rectangles . */ void initializeFromRect ( Envelope2D src , Envelope2D dest ) { } }
if ( src . isEmpty ( ) || dest . isEmpty ( ) || 0 == src . getWidth ( ) || 0 == src . getHeight ( ) ) setZero ( ) ; else { xy = yx = 0 ; xx = dest . getWidth ( ) / src . getWidth ( ) ; yy = dest . getHeight ( ) / src . getHeight ( ) ; xd = dest . xmin - src . xmin * xx ; yd = dest . ymin - src . ymin * yy ; }
public class Const { /** * { @ inheritDoc } */ @ Override @ SuppressWarnings ( "unchecked" ) public < C > Const < A , C > flatMap ( Function < ? super B , ? extends Monad < C , Const < A , ? > > > f ) { } }
return ( Const < A , C > ) this ;
public class LabelingJobResourceConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LabelingJobResourceConfig labelingJobResourceConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( labelingJobResourceConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelingJobResourceConfig . getVolumeKmsKeyId ( ) , VOLUMEKMSKEYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall req...
public class StateHelper { /** * < p > Creates a Random node identifier as described in IEFT UUID URN * specification . < / p > * @ return a random node idenfifier based on MD5 of system information . */ public static byte [ ] randomNodeIdentifier ( ) { } }
// Holds the 16 byte MD5 value byte [ ] seed = new byte [ UUID_BYTE_LENGTH ] ; // Set the initial string buffer capacity // Time + Object . hashCode + HostName + Guess of all system properties int bufSize = ( LONG_CHAR_LEN * 2 ) + HOSTNAME_MAX_CHAR_LEN + ( 2 * BUF_PAGE_SZ ) ; StringBuffer randInfo = new StringBuffer ( ...
public class UpdateLoggerDefinitionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateLoggerDefinitionRequest updateLoggerDefinitionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateLoggerDefinitionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateLoggerDefinitionRequest . getLoggerDefinitionId ( ) , LOGGERDEFINITIONID_BINDING ) ; protocolMarshaller . marshall ( updateLoggerDefinitionRequest . ...
public class RelationMention { /** * indexed getter for arguments - gets an indexed value - * @ generated * @ param i index in the array to get * @ return value of the element at index i */ public ArgumentMention getArguments ( int i ) { } }
if ( RelationMention_Type . featOkTst && ( ( RelationMention_Type ) jcasType ) . casFeat_arguments == null ) jcasType . jcas . throwFeatMissing ( "arguments" , "de.julielab.jules.types.RelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( RelationMention_Type ) jcasTy...
public class ConsumerService { /** * Callback entry point for all registered consumers . */ @ Override public void onMessage ( String channel , Message message ) { } }
if ( MessageUtil . isMessageExcluded ( message , RecipientType . CONSUMER , nodeId ) ) { return ; } if ( updateDelivered ( message ) ) { LinkedHashSet < IMessageCallback > callbacks = getCallbacks ( channel , false , true ) ; if ( callbacks != null ) { dispatchMessages ( channel , message , callbacks ) ; } }
public class AbstractGwtMojo { /** * Add classpath elements to a classpath URL set * @ param elements the initial URL set * @ param urls the urls to add * @ param startPosition the position to insert URLS * @ return full classpath URL set * @ throws MojoExecutionException some error occured */ protected int a...
for ( Object object : elements ) { try { if ( object instanceof Artifact ) { urls [ startPosition ] = ( ( Artifact ) object ) . getFile ( ) . toURI ( ) . toURL ( ) ; } else if ( object instanceof Resource ) { urls [ startPosition ] = new File ( ( ( Resource ) object ) . getDirectory ( ) ) . toURI ( ) . toURL ( ) ; } el...
public class DeleteFolderRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteFolderRequest deleteFolderRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteFolderRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteFolderRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( deleteFolderRequest . getFolderId ( ) , FOLDERID_B...
public class CoreStitchAuth { /** * Internal method which performs the authenticated request by preparing the auth request with * the provided auth info and request . */ private synchronized Response doAuthenticatedRequest ( final StitchAuthRequest stitchReq , final AuthInfo authInfo ) { } }
try { return requestClient . doRequest ( prepareAuthRequest ( stitchReq , authInfo ) ) ; } catch ( final StitchServiceException ex ) { return handleAuthFailure ( ex , stitchReq ) ; }
public class DNSSEC { /** * Builds a DNSKEY record from a PublicKey */ static byte [ ] fromPublicKey ( PublicKey key , int alg ) throws DNSSECException { } }
switch ( alg ) { case Algorithm . RSAMD5 : case Algorithm . RSASHA1 : case Algorithm . RSA_NSEC3_SHA1 : case Algorithm . RSASHA256 : case Algorithm . RSASHA512 : if ( ! ( key instanceof RSAPublicKey ) ) throw new IncompatibleKeyException ( ) ; return fromRSAPublicKey ( ( RSAPublicKey ) key ) ; case Algorithm . DSA : ca...
public class Http2SettingsHandler { /** * Wait for this handler to be added after the upgrade to HTTP / 2 , and for initial preface * handshake to complete . * @ param timeout Time to wait * @ param unit { @ link java . util . concurrent . TimeUnit } for { @ code timeout } * @ throws Exception if timeout or oth...
if ( ! promise . awaitUninterruptibly ( timeout , unit ) ) { throw new IllegalStateException ( "Timed out waiting for settings" ) ; } if ( ! promise . isSuccess ( ) ) { throw new RuntimeException ( promise . cause ( ) ) ; }
public class CascadingClassLoadHelper { /** * Enable sharing of the " best " class - loader with 3rd party . * @ return the class - loader user be the helper . */ @ Override public ClassLoader getClassLoader ( ) { } }
return ( this . bestCandidate == null ) ? Thread . currentThread ( ) . getContextClassLoader ( ) : this . bestCandidate . getClassLoader ( ) ;
public class PrefixedProperties { /** * Creates the cascading prefix properties . * @ param configs * the configs * @ return the prefixed properties */ public static PrefixedProperties createCascadingPrefixProperties ( final List < PrefixConfig > configs ) { } }
PrefixedProperties properties = null ; for ( final PrefixConfig config : configs ) { if ( properties == null ) { properties = new PrefixedProperties ( ( config == null ) ? new DynamicPrefixConfig ( ) : config ) ; } else { properties = new PrefixedProperties ( properties , ( config == null ) ? new DynamicPrefixConfig ( ...
public class NumberUtil { /** * 无符号bytes转 { @ link BigInteger } * @ param buf 无符号bytes * @ param off 起始位置 * @ param length 长度 * @ return { @ link BigInteger } */ public static BigInteger fromUnsignedByteArray ( byte [ ] buf , int off , int length ) { } }
byte [ ] mag = buf ; if ( off != 0 || length != buf . length ) { mag = new byte [ length ] ; System . arraycopy ( buf , off , mag , 0 , length ) ; } return new BigInteger ( 1 , mag ) ;
public class KeyDecoder { /** * Decodes a double from exactly 8 bytes , as encoded for descending order . * @ param src source of encoded bytes * @ param srcOffset offset into source array * @ return double value */ public static double decodeDoubleDesc ( byte [ ] src , int srcOffset ) throws CorruptEncodingExcep...
long bits = DataDecoder . decodeDoubleBits ( src , srcOffset ) ; if ( bits >= 0 ) { bits ^= 0x7fffffffffffffffL ; } return Double . longBitsToDouble ( bits ) ;
public class ClassPath { public static boolean isPrimitive ( Class < ? > aClass ) { } }
if ( aClass == null ) return false ; String className = aClass . getName ( ) ; return className . matches ( "(float|char|short|double|int|long|byte|boolean|(java.lang.(Long|Integer|String|Float|Double|Short|Byte|Boolean)))" ) ;
public class _ArrayMap { /** * Removes the value for the key from the array , returning a * new array if necessary . */ static public Object [ ] remove ( Object [ ] array , Object key , boolean reallocate ) { } }
if ( array != null ) { int length = array . length ; for ( int i = 0 ; i < length ; i += 2 ) { Object curKey = array [ i ] ; if ( ( ( curKey != null ) && curKey . equals ( key ) ) || ( curKey == key ) ) { Object [ ] newArray = array ; if ( reallocate ) { newArray = new Object [ length - 2 ] ; System . arraycopy ( array...
public class AnsjAnalyzer { /** * 获得一个tokenizer * @ param reader * @ return */ public static Tokenizer getTokenizer ( Reader reader , Map < String , String > args ) { } }
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "to create tokenizer " + args ) ; } Analysis analysis = null ; String temp = null ; String type = args . get ( "type" ) ; if ( type == null ) { type = AnsjAnalyzer . TYPE . base_ansj . name ( ) ; } switch ( AnsjAnalyzer . TYPE . valueOf ( type ) ) { case base_ansj : analy...
public class PairIdGenerator { @ Override public Pair < T1 , T2 > generateId ( ) { } }
return new Pair < T1 , T2 > ( firstIdGenerator . generateId ( ) , secondIdGenerator . generateId ( ) ) ;
public class DirectoryServiceRestfulClient { /** * Deserialize a JSON String to a generic object . * This method is used when the target object is generic . * @ param body * the JSON String . * @ param typeRef * the generic type . * @ return * the deserialized object instance . * @ throws ServiceExcepti...
if ( body == null || body . isEmpty ( ) ) { throw new ServiceException ( ErrorCode . REMOTE_DIRECTORY_SERVER_ERROR , ErrorCode . REMOTE_DIRECTORY_SERVER_ERROR . getMessageTemplate ( ) , "the message body is empty" ) ; } try { return JsonSerializer . deserialize ( body . getBytes ( ) , typeRef ) ; } catch ( Exception e ...
public class SlackMessage { /** * Convert SlackMessage to JSON * @ return JsonObject */ public JsonObject prepare ( ) { } }
if ( channel != null ) { slackMessage . addProperty ( CHANNEL , channel ) ; } if ( username != null ) { slackMessage . addProperty ( USERNAME , username ) ; } if ( icon != null ) { if ( icon . contains ( HTTP ) ) { slackMessage . addProperty ( ICON_URL , icon ) ; } else { slackMessage . addProperty ( ICON_EMOJI , icon ...
public class CharsetMapping { /** * MySQL charset could map to several Java encodings . * So here we choose the one according to next rules : * if there is no static mapping for this charset then return javaEncoding value as is because this * could be a custom charset for example * if static mapping exists and ...
String res = javaEncoding ; MysqlCharset cs = CHARSET_NAME_TO_CHARSET . get ( mysqlCharsetName ) ; if ( cs != null ) { res = cs . getMatchingJavaEncoding ( javaEncoding ) ; } return res ;
public class IOState { /** * The local endpoint has reached a read failure . * This could be a normal result after a proper close handshake , or even a premature close due to a connection disconnect . * @ param t the read failure */ public void onReadFailure ( Throwable t ) { } }
ConnectionState event = null ; synchronized ( this ) { if ( this . state == ConnectionState . CLOSED ) { // already closed return ; } // Build out Close Reason String reason = "WebSocket Read Failure" ; if ( t instanceof EOFException ) { reason = "WebSocket Read EOF" ; Throwable cause = t . getCause ( ) ; if ( ( cause ...
public class DescribePrefixListsResult { /** * All available prefix lists . * @ param prefixLists * All available prefix lists . */ public void setPrefixLists ( java . util . Collection < PrefixList > prefixLists ) { } }
if ( prefixLists == null ) { this . prefixLists = null ; return ; } this . prefixLists = new com . amazonaws . internal . SdkInternalList < PrefixList > ( prefixLists ) ;
public class WebApplicationContext { public synchronized void addEventListener ( EventListener listener ) throws IllegalArgumentException { } }
if ( listener instanceof ServletContextListener ) { _contextListeners = LazyList . add ( _contextListeners , listener ) ; } super . addEventListener ( listener ) ;
public class FloatLabel { /** * Sets the EditText ' s text without animating the label * @ param text char [ ] text * @ param start int start of char array to use * @ param len int characters to use from the array */ public void setTextWithoutAnimation ( char [ ] text , int start , int len ) { } }
mSkipAnimation = true ; mEditText . setText ( text , start , len ) ;
public class AmazonAlexaForBusinessClient { /** * Gets details about a specific conference provider . * @ param getConferenceProviderRequest * @ return Result of the GetConferenceProvider operation returned by the service . * @ throws NotFoundException * The resource is not found . * @ sample AmazonAlexaForBu...
request = beforeClientExecution ( request ) ; return executeGetConferenceProvider ( request ) ;
public class DelegateExecutionContext { /** * Returns the current delegation execution or null if the * execution is not available . * @ return the current delegation execution or null if not available */ public static DelegateExecution getCurrentDelegationExecution ( ) { } }
BpmnExecutionContext bpmnExecutionContext = Context . getBpmnExecutionContext ( ) ; ExecutionEntity executionEntity = null ; if ( bpmnExecutionContext != null ) { executionEntity = bpmnExecutionContext . getExecution ( ) ; } return executionEntity ;
public class InstrumentationFieldCompleteParameters { /** * Returns a cloned parameters object with the new state * @ param instrumentationState the new state for this parameters object * @ return a new parameters object with the new state */ public InstrumentationFieldCompleteParameters withNewState ( Instrumentat...
return new InstrumentationFieldCompleteParameters ( this . executionContext , executionStrategyParameters , this . fieldDef , this . typeInfo , this . fetchedValue , instrumentationState ) ;
public class _ArrayMap { /** * Gets the object stored with the given key , using * only object identity . */ static public Object getByIdentity ( Object [ ] array , Object key ) { } }
if ( array != null ) { int length = array . length ; for ( int i = 0 ; i < length ; i += 2 ) { if ( array [ i ] == key ) { return array [ i + 1 ] ; } } } return null ;
public class ChronicleMapBuilder { /** * Inject your SPI around logic of all { @ code ChronicleMap } ' s operations with individual keys : * from { @ link ChronicleMap # containsKey } to { @ link ChronicleMap # acquireUsing } and * { @ link ChronicleMap # merge } . * < p > This affects behaviour of ordinary map c...
Objects . requireNonNull ( mapMethods ) ; this . methods = mapMethods ; return this ;
public class LostInstanceCheck { /** * Determine if the instance created with < code > new < / code > ist followed by a dot . If so , it is being used for * something , so its existence is not considered useless . * @ param pLiteralNew the current LITERAL _ NEW token found by the visitor * @ return < code > true ...
boolean result = false ; final DetailAST parent = pLiteralNew . getParent ( ) ; if ( parent . getType ( ) == TokenTypes . DOT && ( pLiteralNew . getNextSibling ( ) != null || parent . getParent ( ) . getType ( ) == TokenTypes . DOT ) ) { result = true ; } return result ;
public class FeatureManagerBuilder { /** * Adds an additional { @ link ActivationStrategy } to the current { @ link ActivationStrategyProvider } . This currently only * works if you are using the { @ link DefaultActivationStrategyProvider } . */ public FeatureManagerBuilder activationStrategy ( ActivationStrategy str...
if ( strategyProvider instanceof DefaultActivationStrategyProvider ) { ( ( DefaultActivationStrategyProvider ) strategyProvider ) . addActivationStrategy ( strategy ) ; return this ; } throw new IllegalStateException ( "Adding ActivationStrategies is only allowed when using " + DefaultActivationStrategyProvider . class...
public class HttpClient { /** * Http head request * @ param url url for the request * @ return request builder */ public RequestBuilder head ( final String url ) { } }
checkNotNull ( url , "url may not be null" ) ; final AsyncHttpClient . BoundRequestBuilder ningRequestBuilder = asyncHttpClient . prepareHead ( url ) ; return createNewRequestBuilder ( url , ningRequestBuilder ) ;
public class LolChat { /** * Get all your friends , both online and offline . * @ return A List of all your Friends */ public List < Friend > getFriends ( ) { } }
return getFriends ( new Filter < Friend > ( ) { public boolean accept ( Friend e ) { return true ; } } ) ;
public class DirectoryLoaderAdaptor { /** * Index segment files might be larger than 2GB ; so it ' s possible to have an autoChunksize * which is too low to contain all bytes in a single array ( overkill anyway ) . * In this case we ramp up and try splitting with larger chunkSize values . */ public static int figur...
if ( chunkSize < 0 ) { throw new IllegalStateException ( "Overflow in rescaling chunkSize. File way too large?" ) ; } final long numChunks = ( fileLength % chunkSize == 0 ) ? ( fileLength / chunkSize ) : ( fileLength / chunkSize ) + 1 ; if ( numChunks > Integer . MAX_VALUE ) { log . rescalingChunksize ( fileName , file...
public class AbstractInterceptor { /** * Returns name of the given method . * @ param method { @ link Method } * @ return the method name or custom name provided via { @ link StatName } annotation */ private String getMethodName ( Method method ) { } }
StatName statNameAnnotation = method . getAnnotation ( StatName . class ) ; return statNameAnnotation != null ? statNameAnnotation . value ( ) : method . getName ( ) ;
public class SimpleNaviRpcClient { /** * 通过反射出来的本地方法以及参数构造 < tt > RequestDTO < / tt > * @ param methodName * @ param args * @ param prarameterTypes * @ return RequestDTO */ private RequestDTO makeRequestDTO ( String methodName , Object [ ] args , Class < ? > [ ] prarameterTypes ) { } }
RequestDTO request = new RequestDTO ( ) ; request . setTraceId ( IdGenerator . genUUID ( ) ) ; request . setMethod ( methodName ) ; request . setParamterTypes ( MethodUtil . getArgsTypeNameArray ( prarameterTypes ) ) ; request . setParameters ( args ) ; return request ;
public class JettyBootstrap { /** * Shortcut to start Jetty when called within a JAR file containing the WEB - INF folder and needed libraries . * Basically uses { @ link # addSelf ( ) } and { @ link # startServer ( ) } * @ return a new instance of { @ link JettyBootstrap } * @ throws JettyBootstrapException * ...
final JettyBootstrap jettyBootstrap = new JettyBootstrap ( ) ; jettyBootstrap . addSelf ( ) ; return jettyBootstrap . startServer ( ) ;
public class IOUtils { /** * < p > readFileBufferedAsString . < / p > * @ param file a { @ link java . io . File } object . * @ param charset a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . * @ throws java . io . IOException if any . */ public static String readF...
return readInputStreamBufferedAsString ( new FileInputStream ( file ) , charset ) ;
public class ITFReader { /** * Skip all whitespace until we get to the first black line . * @ param row row of black / white values to search * @ return index of the first black line . * @ throws NotFoundException Throws exception if no black lines are found in the row */ private static int skipWhiteSpace ( BitAr...
int width = row . getSize ( ) ; int endStart = row . getNextSet ( 0 ) ; if ( endStart == width ) { throw NotFoundException . getNotFoundInstance ( ) ; } return endStart ;
public class PySrcMain { /** * Generates Python source files given a Soy parse tree , an options object , and information on * where to put the output files . * @ param soyTree The Soy parse tree to generate Python source code for . * @ param pySrcOptions The compilation options relevant to this backend . * @ p...
ImmutableList < SoyFileNode > srcsToCompile = ImmutableList . copyOf ( soyTree . getChildren ( ) ) ; // Determine the output paths . List < String > soyNamespaces = getSoyNamespaces ( soyTree ) ; Multimap < String , Integer > outputs = MainEntryPointUtils . mapOutputsToSrcs ( null , outputPathFormat , srcsToCompile ) ;...
public class DefaultVOMSACService { /** * Extracts an AC from a VOMS response * @ param request * the request * @ param response * the received response * @ return a possibly < code > null < / code > { @ link AttributeCertificate } object */ protected AttributeCertificate getACFromResponse ( VOMSACRequest req...
byte [ ] acBytes = response . getAC ( ) ; if ( acBytes == null ) return null ; ASN1InputStream asn1InputStream = new ASN1InputStream ( acBytes ) ; AttributeCertificate attributeCertificate = null ; try { attributeCertificate = AttributeCertificate . getInstance ( asn1InputStream . readObject ( ) ) ; asn1InputStream . c...
public class ReplaceStrings { /** * From a provide name extract the method name . */ private static String getMethodFromDeclarationName ( String fullDeclarationName ) { } }
String [ ] parts = fullDeclarationName . split ( "\\.prototype\\." ) ; checkState ( parts . length == 1 || parts . length == 2 ) ; if ( parts . length == 2 ) { return parts [ 1 ] ; } return null ;
public class Messenger { /** * Toggle muting of call * @ param callId Call Id */ @ ObjectiveCName ( "toggleCallMuteWithCallId:" ) public void toggleCallMute ( long callId ) { } }
if ( modules . getCallsModule ( ) . getCall ( callId ) . getIsAudioEnabled ( ) . get ( ) ) { modules . getCallsModule ( ) . muteCall ( callId ) ; } else { modules . getCallsModule ( ) . unmuteCall ( callId ) ; }
public class BaseDuration { /** * Converts this duration to a Period instance using the specified period type * and chronology . * Only precise fields in the period type will be used . * Exactly which fields are precise depends on the chronology . * Only the time fields are precise for ISO chronology with a tim...
return new Period ( getMillis ( ) , type , chrono ) ;
public class ParserBase { /** * Locate and process license agreement and information files within a jar * @ param esa * @ param resource * @ throws IOException */ protected void processLAandLI ( File archive , RepositoryResourceWritable resource , Manifest manifest ) throws RepositoryException , IOException { } }
Attributes attribs = manifest . getMainAttributes ( ) ; String LAHeader = attribs . getValue ( LA_HEADER_PRODUCT ) ; String LIHeader = attribs . getValue ( LI_HEADER_PRODUCT ) ; processLAandLI ( archive , resource , LAHeader , LIHeader ) ;
public class Parser { /** * Removes the option or its group from the list of expected elements . * @ param opt */ private void updateRequiredOptions ( Option opt ) throws ParseException { } }
// if the option is a required option remove the option from // the requiredOptions list if ( opt . isRequired ( ) ) { getRequiredOptions ( ) . remove ( opt . getKey ( ) ) ; } // if the option is in an OptionGroup make that option the selected // option of the group if ( getOptions ( ) . getOptionGroup ( opt ) != null ...
public class DBCluster { /** * Identifies all custom endpoints associated with the cluster . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCustomEndpoints ( java . util . Collection ) } or { @ link # withCustomEndpoints ( java . util . Collection ) } if ...
if ( this . customEndpoints == null ) { setCustomEndpoints ( new com . amazonaws . internal . SdkInternalList < String > ( customEndpoints . length ) ) ; } for ( String ele : customEndpoints ) { this . customEndpoints . add ( ele ) ; } return this ;
public class ManagedDatabasesInner { /** * Gets a managed database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param managedInstanceName The name of the managed instance . * @ param data...
return getWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName ) . map ( new Func1 < ServiceResponse < ManagedDatabaseInner > , ManagedDatabaseInner > ( ) { @ Override public ManagedDatabaseInner call ( ServiceResponse < ManagedDatabaseInner > response ) { return response . body ( ) ; } } )...
public class SessionProvider { /** * Gives a { @ link SessionProvider } for a given list of { @ link AccessControlEntry } . * @ param accessList list of { @ link AccessControlEntry } * @ return a { @ link SessionProvider } allowing to provide sessions with the * corresponding ACL . */ public static SessionProvide...
if ( accessList == null || accessList . isEmpty ( ) ) { return createAnonimProvider ( ) ; } else { HashSet < MembershipEntry > membershipEntries = new HashSet < MembershipEntry > ( ) ; for ( AccessControlEntry ace : accessList ) { membershipEntries . add ( ace . getMembershipEntry ( ) ) ; } return new SessionProvider (...
public class EditorGridPanel { /** * Use only after click / doubleClicked in that row or the editor is already opened * @ return active editor */ public TextField getActiveEditor ( ) { } }
TextField editor ; WebLocator container = new WebLocator ( "x-editor" , this ) ; WebLocator editableEl = new WebLocator ( container ) . setElPath ( "//*[contains(@class, '-focus')]" ) ; String stringClass = editableEl . getAttributeClass ( ) ; LOGGER . debug ( "active editor stringClass: " + stringClass ) ; if ( string...
public class MariaDbBlob { /** * Retrieves the byte position in the < code > BLOB < / code > value designated by this < code > Blob < / code > * object at which * < code > pattern < / code > begins . The search begins at position < code > start < / code > . * @ param pattern the < code > Blob < / code > object de...
return position ( pattern . getBytes ( 1 , ( int ) pattern . length ( ) ) , start ) ;
public class UpdatePresetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdatePresetRequest updatePresetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updatePresetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updatePresetRequest . getCategory ( ) , CATEGORY_BINDING ) ; protocolMarshaller . marshall ( updatePresetRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; proto...
public class CPDefinitionOptionValueRelLocalServiceUtil { /** * Deletes the cp definition option value rel with the primary key from the database . Also notifies the appropriate model listeners . * @ param CPDefinitionOptionValueRelId the primary key of the cp definition option value rel * @ return the cp definitio...
return getService ( ) . deleteCPDefinitionOptionValueRel ( CPDefinitionOptionValueRelId ) ;
public class OpenCmsCore { /** * Handles the user authentification for each request sent to OpenCms . < p > * User authentification is done in three steps : * < ol > * < li > Session authentification : OpenCms stores information of all authentificated * users in an internal storage based on the users session . ...
return initCmsObject ( req , res , true ) ;
public class WsLocationAdminImpl { /** * Construct the WsLocationAdminService singleton based on a set of initial * properties provided by bootstrap or other initialization code ( e . g . an * initializer in a test environment ) . * @ param initProps * @ return WsLocationAdmin */ public static WsLocationAdminIm...
if ( instance . get ( ) == null ) { SymbolRegistry . getRegistry ( ) . clear ( ) ; Callable < WsLocationAdminImpl > initializer = new Callable < WsLocationAdminImpl > ( ) { @ Override public WsLocationAdminImpl call ( ) throws Exception { return new WsLocationAdminImpl ( initProps ) ; } } ; instance = StaticValue . mut...
public class SPathParser { /** * Actual SPath grammar */ final public Path expression ( ) throws ParseException { } }
Path expr ; if ( jj_2_1 ( 2147483647 ) ) { expr = absolutePath ( ) ; jj_consume_token ( 0 ) ; } else { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case QNAME : case NSWILDCARD : case SLASH : case STAR : expr = relativePath ( ) ; jj_consume_token ( 0 ) ; break ; default : jj_la1 [ 0 ] = jj_gen ; jj_consume_toke...
public class N { /** * Gets the median of three values . * @ param a * @ param b * @ param c * @ return the median of the values * @ see # median ( int . . . ) */ public static < T extends Comparable < ? super T > > T median ( final T a , final T b , final T c ) { } }
return ( T ) median ( a , b , c , NATURAL_ORDER ) ;
public class TypeUtility { /** * Convert a TypeMirror in a typeName . * @ param typeMirror * the type mirror * @ return typeName */ public static TypeName typeName ( TypeMirror typeMirror ) { } }
LiteralType literalType = LiteralType . of ( typeMirror . toString ( ) ) ; if ( literalType . isArray ( ) ) { return ArrayTypeName . of ( typeName ( literalType . getRawType ( ) ) ) ; } else if ( literalType . isCollection ( ) ) { return ParameterizedTypeName . get ( TypeUtility . className ( literalType . getRawType (...
public class CassandraDataHandlerBase { /** * On discriminator column . * @ param tr * the tr * @ param timestamp * the timestamp * @ param entityType * the entity type */ private void onDiscriminatorColumn ( ThriftRow tr , long timestamp , EntityType entityType ) { } }
String discrColumn = ( ( AbstractManagedType ) entityType ) . getDiscriminatorColumn ( ) ; String discrValue = ( ( AbstractManagedType ) entityType ) . getDiscriminatorValue ( ) ; // No need to check for empty or blank , as considering it as valid name // for nosql ! if ( discrColumn != null && discrValue != null ) { C...
public class PayMchAPI { /** * 刷卡支付 授权码查询OPENID接口 * @ param authcodetoopenid authcodetoopenid * @ param key key * @ return AuthcodetoopenidResult */ public static AuthcodetoopenidResult toolsAuthcodetoopenid ( Authcodetoopenid authcodetoopenid , String key ) { } }
Map < String , String > map = MapUtil . objectToMap ( authcodetoopenid ) ; String sign = SignatureUtil . generateSign ( map , authcodetoopenid . getSign_type ( ) , key ) ; authcodetoopenid . setSign ( sign ) ; String shorturlXML = XMLConverUtil . convertToXML ( authcodetoopenid ) ; HttpUriRequest httpUriRequest = Reque...