signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Algorithm { /** * Creates a new Algorithm instance using SHA512withECDSA . Tokens specify this as " ES512 " .
* @ param publicKey the key to use in the verify instance .
* @ param privateKey the key to use in the signing instance .
* @ return a valid ECDSA512 Algorithm .
* @ throws IllegalArgumentE... | return ECDSA512 ( ECDSAAlgorithm . providerForKeys ( publicKey , privateKey ) ) ; |
public class MainRepository { /** * Tests if the repository description properties file exists as defined by the
* location override system property or at the default location
* @ return true if the properties file exists , otherwise false */
public static boolean repositoryDescriptionFileExists ( RestRepositoryCon... | boolean exists = false ; try { URL propertiesFileURL = getPropertiesFileLocation ( ) ; // Are we accessing the properties file ( from DHE ) using a proxy ?
if ( proxy != null ) { if ( proxy . isHTTPorHTTPS ( ) ) { Proxy javaNetProxy = new Proxy ( Proxy . Type . HTTP , new InetSocketAddress ( proxy . getProxyURL ( ) . g... |
public class FogbugzManager { /** * Creates new Milestone in Fogbugz . Please leave id of milestone object empty .
* Only creates global milestones .
* @ param milestone to edit / create */
public boolean createMilestone ( FogbugzMilestone milestone ) { } } | try { HashMap < String , String > params = new HashMap < String , String > ( ) ; // If id = 0 , create new case .
if ( milestone . getId ( ) != 0 ) { throw new Exception ( "Editing existing milestones is not supported, please set the id to 0." ) ; } params . put ( "cmd" , "newFixFor" ) ; params . put ( "ixProject" , "-... |
public class FriendGroup { /** * Checks if a given Friend is part of this group .
* @ param friend
* The friend
* @ return True if this group contains the friend , false otherwise . */
public boolean contains ( Friend friend ) { } } | for ( final Friend f : getFriends ( ) ) { if ( StringUtils . parseName ( f . getUserId ( ) ) . equals ( StringUtils . parseName ( friend . getUserId ( ) ) ) ) { return true ; } } return false ; |
public class Tuple5 { /** * Split this tuple into two tuples of degree 5 and 0. */
public final Tuple2 < Tuple5 < T1 , T2 , T3 , T4 , T5 > , Tuple0 > split5 ( ) { } } | return new Tuple2 < > ( limit5 ( ) , skip5 ( ) ) ; |
public class AnnotationTypeWriterImpl { /** * Get summary links for navigation bar .
* @ return the content tree for the navigation summary links */
protected Content getNavSummaryLinks ( ) { } } | Content li = HtmlTree . LI ( contents . summaryLabel ) ; li . addContent ( Contents . SPACE ) ; Content ulNav = HtmlTree . UL ( HtmlStyle . subNavList , li ) ; MemberSummaryBuilder memberSummaryBuilder = ( MemberSummaryBuilder ) configuration . getBuilderFactory ( ) . getMemberSummaryBuilder ( this ) ; Content liNavFie... |
public class ExtensionLoader { /** * Run bootstrap all BootstrapHandler # runBeforeApplicationCreate classes provided in order . */
public void runBeforeApplicationCreateBootstrap ( Instrumentation instrumentation , String [ ] bootstrapClasses ) { } } | if ( ! isWithExtension ) { SelendroidLogger . error ( "Cannot run bootstrap. Must load an extension first." ) ; return ; } for ( String bootstrapClassName : bootstrapClasses ) { try { SelendroidLogger . info ( "Running beforeApplicationCreate bootstrap: " + bootstrapClassName ) ; loadBootstrap ( bootstrapClassName ) . ... |
public class SecretsManagerSecretResourceDataMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SecretsManagerSecretResourceData secretsManagerSecretResourceData , ProtocolMarshaller protocolMarshaller ) { } } | if ( secretsManagerSecretResourceData == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( secretsManagerSecretResourceData . getARN ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( secretsManagerSecretResourceData . getAdditionalStagingL... |
public class ComputeNodesImpl { /** * Updates the password and expiration time of a user account on the specified compute node .
* This operation replaces of all the updatable properties of the account . For example , if the expiryTime element is not specified , the current value is replaced with the default value , ... | updateUserWithServiceResponseAsync ( poolId , nodeId , userName , nodeUpdateUserParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class GeoPackageOverlay { /** * { @ inheritDoc } */
@ Override public boolean hasTileToRetrieve ( int x , int y , int zoom ) { } } | return retriever . hasTile ( x , y , zoom ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcStateEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class PartitionKeyGenerators { /** * Produces a partition key from the user ID contained in an incoming request .
* @ return partition key derived from user ID
* @ throws PersistenceException if user ID cannot be retrieved */
public static Function < RequestEnvelope , String > userId ( ) { } } | return r -> Optional . ofNullable ( r ) . map ( RequestEnvelope :: getContext ) . map ( Context :: getSystem ) . map ( SystemState :: getUser ) . map ( User :: getUserId ) . orElseThrow ( ( ) -> new PersistenceException ( "Could not retrieve user ID from request envelope to generate persistence ID" ) ) ; |
public class AsciiTable { /** * Adds a content row to the table .
* For the first content row added , the number of objects given here determines the number of columns in the table .
* For every subsequent content row , the array must have an entry for each column ,
* i . e . the size of the array must be the sam... | AT_Row ret = AT_Row . createContentRow ( columns , TableRowStyle . NORMAL ) ; if ( this . colNumber == 0 ) { this . colNumber = columns . length ; } else { if ( columns . length != this . colNumber ) { throw new AsciiTableException ( "wrong columns argument" , "wrong number of columns, expected " + this . colNumber + "... |
public class Response { /** * Get the { @ link Set } of { @ link XmlElementDescriptor } s of all properties in this response .
* @ return An unmodifiable { @ link Set } of { @ link XmlElementDescriptor } s , may be < code > null < / code > or empty if there are no properties in this response . */
public Set < Element... | if ( mPropStatByProperty == null ) { return null ; } return Collections . unmodifiableSet ( mPropStatByProperty . keySet ( ) ) ; |
public class AmazonMTurkClient { /** * The < code > GetQualificationScore < / code > operation returns the value of a Worker ' s Qualification for a given
* Qualification type .
* To get a Worker ' s Qualification , you must know the Worker ' s ID . The Worker ' s ID is included in the assignment
* data returned ... | request = beforeClientExecution ( request ) ; return executeGetQualificationScore ( request ) ; |
public class InternalErrorBuilder { /** * Set the duplicate elimination counter .
* @ param nDuplicateEliminiationCounter
* The value to set . Must be & ge ; 0 . Pass 0 to disable any duplicate
* elimination and send all errors by email .
* @ return this for chaining
* @ since 7.0.6 */
@ Nonnull public final ... | ValueEnforcer . isGE0 ( nDuplicateEliminiationCounter , "DuplicateEliminiationCounter" ) ; m_nDuplicateEliminiationCounter = nDuplicateEliminiationCounter ; return this ; |
public class InjectionTargetFactoryImpl { /** * Just a shortcut for calling validate , initialize and postProcess */
private BasicInjectionTarget < T > prepareInjectionTarget ( BasicInjectionTarget < T > injectionTarget ) { } } | try { postProcess ( initialize ( validate ( injectionTarget ) ) ) ; return injectionTarget ; } catch ( Throwable e ) { throw new IllegalArgumentException ( e ) ; } |
public class FastDateParser { private static StringBuilder escapeRegex ( final StringBuilder regex , final String value , final boolean unquote ) { } } | regex . append ( "\\Q" ) ; for ( int i = 0 ; i < value . length ( ) ; ++ i ) { char c = value . charAt ( i ) ; switch ( c ) { case '\'' : if ( unquote ) { if ( ++ i == value . length ( ) ) { return regex ; } c = value . charAt ( i ) ; } break ; case '\\' : if ( ++ i == value . length ( ) ) { break ; } regex . append ( ... |
public class StopThreadsCleanUp { /** * The bug detailed at https : / / issues . apache . org / ooo / show _ bug . cgi ? id = 122517 is quite tricky . This is a try to
* avoid the issues by force starting the threads and it ' s job queue . */
protected void forceStartOpenOfficeJurtCleanup ( ClassLoaderLeakPreventor p... | if ( stopThreads ) { if ( preventor . isLoadedByClassLoader ( preventor . findClass ( JURT_ASYNCHRONOUS_FINALIZER ) ) ) { /* The com . sun . star . lib . util . AsynchronousFinalizer class was found and loaded , which means that in case the
static block that starts the daemon thread had not been started yet , it has ... |
public class ArrayUtil { /** * 取最小值
* @ param numberArray 数字数组
* @ return 最小值
* @ since 3.0.9 */
public static long min ( long ... numberArray ) { } } | if ( isEmpty ( numberArray ) ) { throw new IllegalArgumentException ( "Number array must not empty !" ) ; } long min = numberArray [ 0 ] ; for ( int i = 0 ; i < numberArray . length ; i ++ ) { if ( min > numberArray [ i ] ) { min = numberArray [ i ] ; } } return min ; |
public class Execution { /** * < p > isSimilar . < / p >
* @ param execution a { @ link com . greenpepper . server . domain . Execution } object .
* @ return a boolean . */
public boolean isSimilar ( Execution execution ) { } } | return execution != null && errors == execution . getErrors ( ) && failures == execution . getFailures ( ) && success == execution . getSuccess ( ) && ignored == execution . getIgnored ( ) && StringUtil . isEquals ( executionErrorId , execution . getExecutionErrorId ( ) ) && StringUtil . isEquals ( results , execution ... |
public class ResourceAssignment { /** * { @ inheritDoc } */
@ Override public Object getCurrentValue ( FieldType field ) { } } | Object result = null ; if ( field != null ) { int fieldValue = field . getValue ( ) ; result = m_array [ fieldValue ] ; } return ( result ) ; |
public class ChaincodeCollectionConfiguration { /** * Loads a ChaincodeCollectionConfiguration object from a Json or Yaml file */
private static ChaincodeCollectionConfiguration fromFile ( File configFile , boolean isJson ) throws InvalidArgumentException , IOException , ChaincodeCollectionConfigurationException { } } | // Sanity check
if ( configFile == null ) { throw new InvalidArgumentException ( "configFile must be specified" ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( format ( "ChaincodeCollectionConfiguration.fromFile: %s isJson = %b" , configFile . getAbsolutePath ( ) , isJson ) ) ; } // Json file
try ( InputSt... |
public class LinearAlgebra { /** * Find a solution of the linear equation A x = b where
* < ul >
* < li > A is an n x m - matrix given as double [ n ] [ m ] < / li >
* < li > b is an m - vector given as double [ m ] , < / li >
* < li > x is an n - vector given as double [ n ] , < / li >
* < / ul >
* @ param... | if ( isSolverUseApacheCommonsMath ) { Array2DRowRealMatrix matrix = new Array2DRowRealMatrix ( matrixA ) ; DecompositionSolver solver ; if ( matrix . getColumnDimension ( ) == matrix . getRowDimension ( ) ) { solver = new LUDecomposition ( matrix ) . getSolver ( ) ; } else { solver = new QRDecomposition ( new Array2DRo... |
public class LongObjectHashMap { /** * Return all of the Objects currently stored in the map
* as an Object [ ] - the ordering of the Objects in the
* array is undetermined .
* Note that this method is not thread safe . Another thread
* making changes to the map while this method is being invoked
* will cause... | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "values" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Current load = " + _currentLoad ) ; Object [ ] values = new Object [ _currentLoad ] ; int objCount = 0 ; // Iterate through the map pulling out each
// live entry into the values array .
for ( int i = ... |
public class TypedIsomorphicGraphCounter { /** * Counts the isomorphic version of this graph , increasing its total count
* by the specified positive amount .
* @ param count a positive value for the number of times the object occurred
* @ throws IllegalArgumentException if { @ code count } is not a positive valu... | if ( count < 1 ) throw new IllegalArgumentException ( "Count must be positive" ) ; // We could potentially be comparing the graph to many , many other
// graphs , where each step requires that the graph be converted to a
// canonical , packed form . Therefore , do this once ahead of time so
// that we don ' t do it for... |
public class ClientNotificationArea { /** * Remove the given NotificationListener */
public void removeClientNotificationListener ( RESTRequest request , ObjectName name ) { } } | NotificationTargetInformation nti = toNotificationTargetInformation ( request , name . getCanonicalName ( ) ) ; // Remove locally
ClientNotificationListener listener = listeners . remove ( nti ) ; // Check whether the producer of the notification is local or remote .
if ( nti . getRoutingInformation ( ) == null ) { // ... |
public class JawrRequestHandler { /** * Returns the names of the dirty bundles
* @ return the names of the dirty bundles */
public List < String > getDirtyBundleNames ( ) { } } | List < String > bundleNames = new ArrayList < > ( ) ; if ( bundlesHandler != null ) { bundleNames = bundlesHandler . getDirtyBundleNames ( ) ; } return bundleNames ; |
public class AttrMaxPause { /** * Creates a new attribute instance from the provided String .
* @ param str string representation of the attribute
* @ return attribute instance or { @ code null } if provided string is
* { @ code null }
* @ throws BOSHException on parse or validation failure */
static AttrMaxPau... | if ( str == null ) { return null ; } else { return new AttrMaxPause ( str ) ; } |
public class Query { /** * This method was created in VisualAge .
* @ param args java . lang . String [ ] */
public static void main2 ( String args [ ] ) { } } | String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver" ; String url = "jdbc:db2:sample" ; String user = "batra" ; String pass = "varunbatra" ; String querystring = "Select * from batra.employee" ; String fn ; String ln ; String bd ; String sal ; try { ConnectionProperties cp = new ConnectionProperties ( dbDriver , url , us... |
public class GraphPanelChart { /** * compute minY and step value to have better readable charts */
private void computeChartSteps ( ) { } } | // if special type
if ( chartType == GraphPanelChart . CHART_PERCENTAGE ) { minYVal = 0 ; maxYVal = 100 ; return ; } // try to find the best range . . .
// first , avoid special cases where maxY equal or close to minY
if ( maxYVal - minYVal < 0.1 ) { maxYVal = minYVal + 1 ; } // real step
double step = ( maxYVal - minY... |
public class Flowable { /** * Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a
* specified delay . If { @ code delayError } is true , error notifications will also be delayed .
* < img width = " 640 " height = " 310 " src = " https : / / raw . github . com / wiki ... | ObjectHelper . requireNonNull ( unit , "unit is null" ) ; ObjectHelper . requireNonNull ( scheduler , "scheduler is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableDelay < T > ( this , Math . max ( 0L , delay ) , unit , scheduler , delayError ) ) ; |
public class Transporter { /** * - - - PING PACKET - - - */
public Tree createPingPacket ( String id ) { } } | FastBuildTree msg = new FastBuildTree ( 4 ) ; msg . putUnsafe ( "ver" , PROTOCOL_VERSION ) ; msg . putUnsafe ( "sender" , nodeID ) ; msg . putUnsafe ( "id" , id ) ; msg . putUnsafe ( "time" , System . currentTimeMillis ( ) ) ; return msg ; |
public class BufferFieldTable { /** * Move the output buffer to this field ( Override this to use non - standard buffers ) .
* Warning : Check to make sure the field . isSelected ( ) before moving data !
* @ param field The field to move the current data to .
* @ return The error code ( From field . setData ( ) )... | return ( ( BaseBuffer ) this . getDataSource ( ) ) . getNextField ( ( FieldInfo ) field , Constants . DISPLAY , Constants . READ_MOVE ) ; |
public class BasePanel { /** * Display the correct security warning ( access denied on the login screen ) .
* @ param iErrorCode */
public void displaySecurityWarning ( int iErrorCode ) { } } | String strDisplay = this . getTask ( ) . getApplication ( ) . getSecurityErrorText ( iErrorCode ) ; if ( iErrorCode == Constants . ACCESS_DENIED ) { m_iDisplayFieldDesc = ScreenConstants . SECURITY_MODE ; // Make sure this screen is not cached in TopScreen
this . getScreenFieldView ( ) . addScreenLayout ( ) ; // Set up... |
public class ProposalLineItem { /** * Gets the netCost value for this ProposalLineItem .
* @ return netCost * The cost of the { @ code ProposalLineItem } in proposal currency .
* It supports precision of 2
* decimal places in terms of the fundamental currency
* unit , so the
* { @ link Money # getAmountInMicr... | return netCost ; |
public class SqlLine { /** * Issue the specified error message
* @ param msg the message to issue
* @ return false always */
public boolean error ( String msg ) { } } | output ( getColorBuffer ( ) . red ( msg ) , true , errorStream ) ; return false ; |
public class ApiOvhEmailexchange { /** * Alter this object properties
* REST : PUT / email / exchange / { organizationName } / service / { exchangeService } / publicFolder / { path }
* @ param body [ required ] New object properties
* @ param organizationName [ required ] The internal name of your exchange organi... | String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}" ; StringBuilder sb = path ( qPath , organizationName , exchangeService , path ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class NFA { /** * Matches the
* @ param input the input
* @ param startIndex the start index
* @ return the int */
public Match matches ( HString input , int startIndex ) { } } | // The set of states that the NFA is in
Set < State > states = new HashSet < > ( ) ; // Add the start state
states . add ( new State ( startIndex , start ) ) ; // All the accept states that it enters
NavigableSet < State > accepts = new TreeSet < > ( ) ; List < Annotation > tokens = input . tokens ( ) ; while ( ! state... |
public class DraweeView { /** * Sets the controller . */
public void setController ( @ Nullable DraweeController draweeController ) { } } | mDraweeHolder . setController ( draweeController ) ; super . setImageDrawable ( mDraweeHolder . getTopLevelDrawable ( ) ) ; |
public class ScenarioImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case BpsimPackage . SCENARIO__SCENARIO_PARAMETERS : return basicSetScenarioParameters ( null , msgs ) ; case BpsimPackage . SCENARIO__ELEMENT_PARAMETERS : return ( ( InternalEList < ? > ) getElementParameters ( ) ) . basicRemove ( otherEnd , msgs ) ; case BpsimPackage . SCENARIO__CALENDAR : retur... |
public class JpaRepository { /** * Adds an entity to the repository , or updates it if it already exists .
* Note that both the { @ code add } and the { @ link # update ( PersistenceEntity )
* update } methods work the same . If the entity does not exist it will be
* added , but if it already exists then it will ... | checkNotNull ( entity , "Received a null pointer as the entity" ) ; if ( ( entity . getId ( ) == null ) || ( entity . getId ( ) < 0 ) ) { // No ID has been assigned
// It is a new entity
getEntityManager ( ) . persist ( entity ) ; } else { // ID already assigned
// It is an existing entity
getEntityManager ( ) . merge ... |
public class StrSubstitutor { /** * Internal method that substitutes the variables .
* Most users of this class do not need to call this method . This method will
* be called automatically by another ( public ) method .
* Writers of subclasses can override this method if they need access to
* the substitution p... | return substitute ( buf , offset , length , null ) > 0 ; |
public class InjectionProcessor { /** * F50309.5 */
protected final String getJavaBeansPropertyName ( Member fieldOrMethod ) { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getJavaBeansPropertyName : " + fieldOrMethod ) ; String propertyName ; if ( fieldOrMethod instanceof Field ) { Field field = ( Field ) fieldOrMethod ; propertyName = field . getName ( ) ; ... |
public class ResourceHandler { /** * Sends a Not Modified response to the client */
private void sendNotModified ( ChannelHandlerContext ctx ) { } } | HttpResponse response = new DefaultHttpResponse ( HttpVersion . HTTP_1_1 , HttpResponseStatus . NOT_MODIFIED ) ; setDateHeader ( response ) ; // Close the connection as soon as the error message is sent .
ctx . writeAndFlush ( response ) . addListener ( ChannelFutureListener . CLOSE ) ; |
public class EuclideanDistance { /** * Calculates Euclidean distance between two multi - dimensional time - series of equal length .
* @ param series1 The first series .
* @ param series2 The second series .
* @ return The eclidean distance .
* @ throws Exception if error occures . */
public double seriesDistan... | if ( series1 . length == series2 . length ) { Double res = 0D ; for ( int i = 0 ; i < series1 . length ; i ++ ) { res = res + distance2 ( series1 [ i ] , series2 [ i ] ) ; } return Math . sqrt ( res ) ; } else { throw new Exception ( "Exception in Euclidean distance: array lengths are not equal" ) ; } |
public class MD5Digest { /** * Static method to get an MD5Digest from a binary byte representation .
* @ param md5Bytes
* @ param offset in the byte array to start reading from
* @ return a filled out MD5Digest */
public static MD5Digest fromBytes ( byte [ ] md5Bytes , int offset ) { } } | byte [ ] md5BytesCopy = Arrays . copyOfRange ( md5Bytes , offset , offset + MD5_BYTES_LENGTH ) ; // TODO : Replace this with a version that encodes without needing a copy .
String md5String = Hex . encodeHexString ( md5BytesCopy ) ; return new MD5Digest ( md5String , md5BytesCopy ) ; |
public class GImageStatistics { /** * Computes the mean of the difference squared between the two images .
* @ param inputA Input image . Not modified .
* @ param inputB Input image . Not modified .
* @ return Mean difference squared */
public static < T extends ImageBase < T > > double meanDiffSq ( T inputA , T ... | if ( inputA instanceof ImageGray ) { if ( GrayU8 . class == inputA . getClass ( ) ) { return ImageStatistics . meanDiffSq ( ( GrayU8 ) inputA , ( GrayU8 ) inputB ) ; } else if ( GrayS8 . class == inputA . getClass ( ) ) { return ImageStatistics . meanDiffSq ( ( GrayS8 ) inputA , ( GrayS8 ) inputB ) ; } else if ( GrayU1... |
public class RPMBuilder { /** * Add directory to package .
* @ param target Target path like / opt / application / bin / foo
* @ return
* @ throws IOException */
@ Override public FileBuilder addDirectory ( Path target ) throws IOException { } } | checkTarget ( target ) ; FileBuilder fb = new FileBuilder ( ) ; fb . target = target ; fb . content = ByteBuffer . allocate ( 0 ) ; fb . size = fb . content . limit ( ) ; fb . mode = 040000 ; fb . compressFilename ( ) ; fileBuilders . add ( fb ) ; return fb ; |
public class Arguments { /** * the following helper methods assume that 0 < index < args . length */
private void putIntoActivation ( int index , Object value ) { } } | String argName = activation . function . getParamOrVarName ( index ) ; activation . put ( argName , activation , value ) ; |
public class DependencyContainer { /** * Returns true if the underlying dependencies have changed . */
public boolean isModified ( boolean isAsync ) { } } | long now = CurrentTime . currentTime ( ) ; if ( now < _checkExpiresTime ) return _isModified ; if ( _isChecking . getAndSet ( true ) ) return _isModified ; _checkExpiresTime = now + _checkInterval ; if ( isAsync ) { getWorker ( ) . wake ( ) ; } else { try { checkImpl ( ) ; } finally { _isChecking . set ( false ) ; } } ... |
public class DateFormat { /** * Returns the date / time formatter with the given date and time
* formatting styles for the default < code > FORMAT < / code > locale .
* @ param dateStyle the given date formatting style . For example ,
* SHORT for " M / d / yy " in the US locale . As currently implemented , relati... | return get ( dateStyle , timeStyle , ULocale . getDefault ( Category . FORMAT ) , null ) ; |
public class SimpleDataSource { /** * 初始化
* @ param url jdbc url
* @ param user 用户名
* @ param pass 密码 */
public void init ( String url , String user , String pass ) { } } | init ( url , user , pass , null ) ; |
public class ConstraintViolationImpl { /** * create hash code .
* @ see # equals ( Object ) on which fields are taken into account . */
private int createHashCode ( ) { } } | return Objects . hash ( this . interpolatedMessage , this . propertyPath , this . rootBean , this . leafBeanInstance , this . value , this . constraintDescriptor , this . messageTemplate , this . elementType ) ; |
public class UASparser { /** * loads the data file and creates all internal data structs
* @ param is
* @ throws IOException */
protected void loadDataFromFile ( InputStream is ) throws IOException { } } | PHPFileParser fp = new PHPFileParser ( is ) ; createInternalDataStructre ( fp . getSections ( ) ) ; |
public class DefaultErrorHandler { /** * Receive notification of a recoverable error .
* < p > This corresponds to the definition of " error " in section 1.2
* of the W3C XML 1.0 Recommendation . For example , a validating
* parser would use this callback to report the violation of a
* validity constraint . The... | // If the m _ throwExceptionOnError flag is true , rethrow the exception .
// Otherwise report the error to System . err .
if ( m_throwExceptionOnError ) throw exception ; else { PrintWriter pw = getErrorWriter ( ) ; printLocation ( pw , exception ) ; pw . println ( exception . getMessage ( ) ) ; } |
public class MapWithProtoValuesSubject { /** * Specifies that the ' has ' bit of these explicitly specified field descriptors should be ignored
* when comparing for equality . Sub - fields must be specified explicitly if they are to be ignored
* as well .
* < p > Use { @ link # ignoringFieldAbsenceForValues ( ) }... | return usingConfig ( config . ignoringFieldAbsenceOfFieldDescriptors ( asList ( firstFieldDescriptor , rest ) ) ) ; |
public class AmazonEC2Client { /** * Disables ClassicLink DNS support for a VPC . If disabled , DNS hostnames resolve to public IP addresses when
* addressed between a linked EC2 - Classic instance and instances in the VPC to which it ' s linked . For more
* information , see < a
* href = " https : / / docs . aws... | request = beforeClientExecution ( request ) ; return executeDisableVpcClassicLinkDnsSupport ( request ) ; |
public class JMXAgent { /** * Register the JMX agent
* @ throws java . lang . Exception */
public synchronized void register ( ) throws Exception { } } | if ( mbeanName != null ) { throw new Exception ( "Agent already registered" ) ; } mbeanName = new ObjectName ( getClass ( ) . getPackage ( ) . getName ( ) + ":type=" + getClass ( ) . getSimpleName ( ) ) ; logger . info ( "Registering JMX agent " + mbeanName ) ; ManagementFactory . getPlatformMBeanServer ( ) . registerM... |
public class HexString { /** * Converts a binary value held in a byte array into a hex string , in the
* given StringBuffer , using exactly two characters per byte of input .
* @ param bin The byte array containing the binary value .
* @ param start The offset into the byte array for conversion to start . .
* @... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "binToHex" , new Object [ ] { bin , Integer . valueOf ( start ) , Integer . valueOf ( length ) , hex } ) ; /* Constant for binary to Hex conversion */
final char BIN2HEX [ ] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' ... |
public class ServerTransportAcceptListener { /** * This method removes a conversation from the list of active conversations . This would be called
* if the connection is closed or if a failure is deteceted .
* @ param conv */
public void removeConversation ( Conversation conv ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeConversation" , conv ) ; synchronized ( activeConversations ) { Object connectionReference = conv . getConnectionReference ( ) ; ArrayList list = ( ArrayList ) activeConversations . get ( connectionReference ) ... |
public class ParamTag { public int doEndTag ( ) throws JspException { } } | /* 63 */
Tag t = findAncestorWithClass ( this , HumanizeMessageSupport . class ) ; /* 64 */
if ( t == null ) { /* 65 */
throw new JspTagException ( Resources . getMessage ( "PARAM_OUTSIDE_MESSAGE" ) ) ; } /* 68 */
HumanizeMessageSupport parent = ( HumanizeMessageSupport ) t ; /* 75 */
Object input = null ; /* 77 */
if ... |
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setParameterValue ( ParameterValue newParameterValue ) { } } | ( ( FeatureMap . Internal ) getMixed ( ) ) . set ( BpsimPackage . Literals . DOCUMENT_ROOT__PARAMETER_VALUE , newParameterValue ) ; |
public class ColumnPrefixDistributedRowLock { /** * Try to take the lock . The caller must call . release ( ) to properly clean up
* the lock columns from cassandra
* @ throws Exception */
@ Override public void acquire ( ) throws Exception { } } | Preconditions . checkArgument ( ttl == null || TimeUnit . SECONDS . convert ( timeout , timeoutUnits ) < ttl , "Timeout " + timeout + " must be less than TTL " + ttl ) ; RetryPolicy retry = backoffPolicy . duplicate ( ) ; retryCount = 0 ; while ( true ) { try { long curTimeMicros = getCurrentTimeMicros ( ) ; MutationBa... |
public class PlayRecordContext { /** * The initial announcement prompting the user to either enter DTMF digits or to speak .
* Consists of one or more audio segments . < br >
* If not specified ( the default ) , the event immediately begins digit collection or recording .
* @ return The array of audio prompts . A... | String value = Optional . fromNullable ( getParameter ( SignalParameters . INITIAL_PROMPT . symbol ( ) ) ) . or ( "" ) ; return value . isEmpty ( ) ? new String [ 0 ] : value . split ( "," ) ; |
public class AbstractAction { /** * The method gets all events for the given EventType and executes them in
* the given order . If no events are defined , nothing is done . The method
* return < i > true < / i > if a event was found , otherwise < i > false < / i > .
* @ param _ eventtype trigger events to execute... | final boolean ret ; final List < EventDefinition > triggers = this . instance . getType ( ) . getEvents ( _eventtype ) ; if ( triggers != null ) { final Parameter parameter = new Parameter ( ) ; parameter . put ( ParameterValues . INSTANCE , getInstance ( ) ) ; for ( final EventDefinition evenDef : triggers ) { evenDef... |
public class TrafficForecastAdjustmentSegment { /** * Gets the adjustmentTimeSeries value for this TrafficForecastAdjustmentSegment .
* @ return adjustmentTimeSeries * The traffic volume of the adjustment . This field should be
* set if { @ code basisType } is { @ link
* BasisType . ABSOLUTE } and null if { @ lin... | return adjustmentTimeSeries ; |
public class Locale { /** * Decode the specified array of bytes according to
* a charset selection . This function tries
* to decode a string from the given byte array
* with the following charsets ( in preferred order ) :
* < ul >
* < li > the current charset returned by { @ link Charset # defaultCharset ( )... | final Charset [ ] prior = getPriorizedDecodingCharsets ( ) ; final String refBuffer = new String ( bytes ) ; CharBuffer buffer = null ; for ( final Charset charset : prior ) { buffer = decodeString ( bytes , charset , refBuffer . length ( ) ) ; if ( buffer != null ) { break ; } } if ( buffer == null ) { // Decode until... |
public class FilesystemPath { /** * Normalizes a filesystemPath path .
* < ul >
* < li > foo / / bar - > foo / bar
* < li > foo / . / bar - > foo / bar
* < li > foo / . . / bar - > bar
* < li > / . . / bar - > / bar
* < / ul >
* @ param cb charBuffer holding the normalized result
* @ param oldPath the p... | cb . clear ( ) ; cb . append ( oldPath ) ; if ( cb . length ( ) == 0 || cb . lastChar ( ) != '/' ) cb . append ( '/' ) ; int length = newPath . length ( ) ; int i = offset ; while ( i < length ) { char ch = newPath . charAt ( i ) ; char ch2 ; switch ( ch ) { default : if ( ch != separatorChar ) { cb . append ( ch ) ; i... |
public class StructureDiagramGenerator { /** * Returns an AtomContainer with all unplaced atoms connected to a given
* atom
* @ param atom The Atom whose unplaced bonding partners are to be returned
* @ return an AtomContainer with all unplaced atoms connected to a
* given atom */
private IAtomContainer getUnpl... | IAtomContainer unplacedAtoms = atom . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; List bonds = molecule . getConnectedBondsList ( atom ) ; IAtom connectedAtom ; for ( int f = 0 ; f < bonds . size ( ) ; f ++ ) { connectedAtom = ( ( IBond ) bonds . get ( f ) ) . getOther ( atom ) ; if ( ! connectedAtom . ge... |
public class PhysicalDatabase { /** * Make a table for this database .
* @ param record The record to make a table for .
* @ return BaseTable The new table . */
public BaseTable doMakeTable ( Record record ) { } } | BaseTable table = null ; boolean bIsQueryRecord = record . isQueryRecord ( ) ; if ( m_pDatabase == null ) { try { this . open ( ) ; } catch ( DBException ex ) { return null ; // No database
} } if ( bIsQueryRecord ) { // Physical Tables cannot process SQL queries , so use QueryTable !
PassThruTable passThruTable = new ... |
public class VisOdomMonoPlaneInfinity { /** * Estimates the full ( x , y , yaw ) 2D motion estimate from ground points .
* @ return true if successful or false if not */
private boolean estimateClose ( ) { } } | // estimate 2D motion
if ( ! planeMotion . process ( planeSamples . toList ( ) ) ) return false ; // save solutions
closeMotionKeyToCurr = planeMotion . getModelParameters ( ) ; closeInlierCount = planeMotion . getMatchSet ( ) . size ( ) ; // mark inliers as used
for ( int i = 0 ; i < closeInlierCount ; i ++ ) { int in... |
public class ConcurrentLinkedDeque { /** * Guarantees that any node which was unlinked before a call to
* this method will be unreachable from head after it returns .
* Does not guarantee to eliminate slack , only that head will
* point to a node that was active while this method was running . */
private final vo... | // Either head already points to an active node , or we keep
// trying to cas it to the first node until it does .
Node < E > h , p , q ; restartFromHead : while ( ( h = head ) . item == null && ( p = h . prev ) != null ) { for ( ; ; ) { if ( ( q = p . prev ) == null || ( q = ( p = q ) . prev ) == null ) { // It is pos... |
public class Matrix4f { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4fc # scale ( float , org . joml . Matrix4f ) */
public Matrix4f scale ( float xyz , Matrix4f dest ) { } } | return scale ( xyz , xyz , xyz , dest ) ; |
public class CmsContentService { /** * Validates the given XML content . < p >
* @ param cms the cms context
* @ param structureId the structure id
* @ param content the XML content
* @ param fieldNames if not null , only validation errors in paths from this set will be added to the validation result
* @ retu... | CmsXmlContentErrorHandler errorHandler = content . validate ( cms ) ; Map < String , Map < String [ ] , String > > errorsByEntity = new HashMap < String , Map < String [ ] , String > > ( ) ; if ( errorHandler . hasErrors ( ) ) { boolean reallyHasErrors = false ; for ( Entry < Locale , Map < String , String > > localeEn... |
public class GetLifecyclePolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetLifecyclePolicyRequest getLifecyclePolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getLifecyclePolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getLifecyclePolicyRequest . getContainerName ( ) , CONTAINERNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall reque... |
public class ProtectedResourceClientFactory { /** * Constructs a RestTemplate that adds the OAuth1 Authorization header to each request before it is executed . */
public static RestTemplate create ( OAuth1Credentials credentials ) { } } | RestTemplate client = new RestTemplate ( ClientHttpRequestFactorySelector . getRequestFactory ( ) ) ; OAuth1RequestInterceptor interceptor = new OAuth1RequestInterceptor ( credentials ) ; List < ClientHttpRequestInterceptor > interceptors = new LinkedList < ClientHttpRequestInterceptor > ( ) ; interceptors . add ( inte... |
public class SqlRunner { /** * 创建SqlRunner
* @ param ds 数据源
* @ param driverClassName 数据库连接驱动类名
* @ return SqlRunner */
public static SqlRunner create ( DataSource ds , String driverClassName ) { } } | return new SqlRunner ( ds , DialectFactory . newDialect ( driverClassName ) ) ; |
public class ChannelHelper { /** * Writes bytes to channel
* @ param ch
* @ param bytes
* @ throws IOException */
public static final void write ( WritableByteChannel ch , byte [ ] bytes ) throws IOException { } } | write ( ch , bytes , 0 , bytes . length ) ; |
public class ServerControllerImpl { /** * Configuration using < code > undertow . xml < / code > conforming to Undertow / Wildfly XML Schemas
* @ param configuration
* @ param builder
* @ param rootHandler current root handler
* @ param undertowResource URI for XML configuration
* @ return */
private HttpHand... | try { if ( jaxb == null ) { // we don ' t want static references here
jaxb = JAXBContext . newInstance ( "org.ops4j.pax.web.service.undertow.internal.configuration.model" , UndertowConfiguration . class . getClassLoader ( ) ) ; } Unmarshaller unmarshaller = jaxb . createUnmarshaller ( ) ; UnmarshallerHandler unmarshall... |
public class CustomTagLibrary { /** * Obtains the script for the given tag name . Loads if necessary .
* Synchronizing this method would have a potential race condition
* if two threads try to load two tags that are referencing each other .
* So we synchronize { @ link # scripts } , even though this means
* we ... | Script script = scripts . get ( name ) ; if ( script != null && ! MetaClass . NO_CACHE ) return script ; script = null ; if ( MetaClassLoader . debugLoader != null ) script = load ( name , MetaClassLoader . debugLoader . loader ) ; if ( script == null ) script = load ( name , classLoader ) ; return script ; |
public class VirtualServiceSpecMarshaller { /** * Marshall the given parameter object . */
public void marshall ( VirtualServiceSpec virtualServiceSpec , ProtocolMarshaller protocolMarshaller ) { } } | if ( virtualServiceSpec == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( virtualServiceSpec . getProvider ( ) , PROVIDER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getM... |
public class TaskHolder { /** * Get the servlet ' s property .
* For Ajax proxies , the top level proxy is shared among sessions . since it is not unique , don ' t return property . */
public String getProperty ( String strKey , Map < String , Object > properties ) { } } | String strProperty = super . getProperty ( strKey , properties ) ; if ( strProperty == null ) if ( ! m_proxyTask . isShared ( ) ) strProperty = m_proxyTask . getProperty ( strKey ) ; return strProperty ; |
public class GammaCorrection { /** * Create the gamma correction lookup table */
private static int [ ] gammaLUT ( double gammaValue ) { } } | int [ ] gammaLUT = new int [ 256 ] ; for ( int i = 0 ; i < gammaLUT . length ; i ++ ) { gammaLUT [ i ] = ( int ) ( 255 * ( Math . pow ( ( double ) i / ( double ) 255 , gammaValue ) ) ) ; } return gammaLUT ; |
public class CreatePolicyVersionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreatePolicyVersionRequest createPolicyVersionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createPolicyVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createPolicyVersionRequest . getPolicyName ( ) , POLICYNAME_BINDING ) ; protocolMarshaller . marshall ( createPolicyVersionRequest . getPolicyDocument ( ) , P... |
public class JaxRsEJBModuleInfoBuilder { /** * getApplicationSubclasses
* @ param classes
* @ param ejb
* @ param appClassloader */
private void getEJBApplicationSubclasses ( Set < Class < ? > > classes , EJBEndpoint ejb , ClassLoader appClassloader ) { } } | final String methodName = "getEJBApplicationSubclasses" ; if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName ) ; } if ( classes == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , methodName , Collections . emptySet ( ) ) ; return ; } Class < Application > appClass = Application . class ; final Strin... |
public class RelativeTimeFormatter { /** * Return the relative time from the calendar datetime against the SMSC datetime .
* @ param calendar the date .
* @ param smscCalendar the SMSC date .
* @ return The relative time between the calendar date and the SMSC calendar date . */
public String format ( Calendar cal... | if ( calendar == null || smscCalendar == null ) { return null ; } long diffTimeInMillis = calendar . getTimeInMillis ( ) - smscCalendar . getTimeInMillis ( ) ; if ( diffTimeInMillis < 0 ) { throw new IllegalArgumentException ( "The requested relative time has already past." ) ; } // calculate period from epoch , this i... |
public class IfThenElse { /** * { @ inheritDoc } */
public Node replaceNode ( int index , Node newNode ) { } } | if ( index == 0 ) { return newNode ; } int conditionNodes = condition . countNodes ( ) ; if ( index <= conditionNodes ) { return new IfThenElse ( condition . replaceNode ( index - 1 , newNode ) , then , otherwise ) ; } else { int thenNodes = then . countNodes ( ) ; if ( index <= conditionNodes + thenNodes ) { return ne... |
public class DeactivateUserRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeactivateUserRequest deactivateUserRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deactivateUserRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deactivateUserRequest . getUserId ( ) , USERID_BINDING ) ; protocolMarshaller . marshall ( deactivateUserRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN... |
public class JsonReader { /** * Returns the next token , a { @ link com . google . gson . stream . JsonToken # NAME property name } , and
* consumes it .
* @ throws java . io . IOException if the next token in the stream is not a property
* name . */
public String nextName ( ) throws IOException { } } | int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } String result ; if ( p == PEEKED_UNQUOTED_NAME ) { result = nextUnquotedValue ( ) ; } else if ( p == PEEKED_SINGLE_QUOTED_NAME ) { result = nextQuotedValue ( '\'' ) ; } else if ( p == PEEKED_DOUBLE_QUOTED_NAME ) { result = nextQuotedValue ( '"' ) ; } else { ... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcZone ( ) { } } | if ( ifcZoneEClass == null ) { ifcZoneEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 776 ) ; } return ifcZoneEClass ; |
public class DigestUtil { /** * 计算SHA - 1摘要值 , 并转为16进制字符串
* @ param data 被摘要数据
* @ param charset 编码
* @ return SHA - 1摘要的16进制表示 */
public static String sha1Hex ( String data , String charset ) { } } | return new Digester ( DigestAlgorithm . SHA1 ) . digestHex ( data , charset ) ; |
public class Equivalencer { /** * Loads the { @ link ParameterEquivalencer } if it has not already been
* loaded .
* @ throws EquivalencerException Thrown if an error occurred loading the
* equivalencing engine . */
private void loadEquivalencingEngine ( ) throws EquivalencerException { } } | if ( paramEquivalencer == null ) { try { paramEquivalencer = DefaultParameterEquivalencer . getInstance ( ) ; } catch ( Exception e ) { throw new EquivalencerException ( "Unable to load equivalencing engine." , e ) ; } } |
public class AmazonAlexaForBusinessClient { /** * Retrieves a list of gateway summaries . Use GetGateway to retrieve details of a specific gateway . An optional
* gateway group ARN can be provided to only retrieve gateway summaries of gateways that are associated with that
* gateway group ARN .
* @ param listGate... | request = beforeClientExecution ( request ) ; return executeListGateways ( request ) ; |
public class RetryPolicy { /** * Sets the { @ code delay } between retries , exponentially backing off to the { @ code maxDelay } and multiplying
* successive delays by a factor of 2.
* @ throws NullPointerException if { @ code chronoUnit } is null
* @ throws IllegalArgumentException if { @ code delay } is < = 0 ... | return withBackoff ( delay , maxDelay , chronoUnit , 2 ) ; |
public class IonException { /** * Finds the first exception in the { @ link # getCause ( ) } chain that is
* an instance of the given type .
* @ return null if there ' s no cause of the given type . */
@ SuppressWarnings ( "unchecked" ) public < T extends Throwable > T causeOfType ( Class < T > type ) { } } | IdentityHashMap < Throwable , Throwable > seen = new IdentityHashMap < Throwable , Throwable > ( ) ; Throwable cause = getCause ( ) ; while ( cause != null && ! type . isInstance ( cause ) ) { if ( seen . put ( cause , cause ) != null ) // cycle check
{ return null ; } cause = cause . getCause ( ) ; } return ( T ) caus... |
public class Solo { /** * Types text in the specified WebElement .
* @ param webElement the WebElement to type text in
* @ param text the text to enter in the { @ link WebElement } field */
public void typeTextInWebElement ( WebElement webElement , String text ) { } } | if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "typeTextInWebElement(" + webElement + ", \"" + text + "\")" ) ; } clickOnWebElement ( webElement ) ; dialogUtils . hideSoftKeyboard ( null , true , true ) ; instrumentation . sendStringSync ( text ) ; |
public class DialogPreference { /** * Obtains the padding of the preference ' s dialog from a specific typed array .
* @ param typedArray
* The typed array , the padding should be obtained from , as an instance of the class
* { @ link TypedArray } . The typed array may not be null */
private void obtainDialogPadd... | int defaultLeftPadding = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . dialog_left_padding ) ; int defaultTopPadding = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . dialog_top_padding ) ; int defaultRightPadding = getContext ( ) . getResources ( ) . getDimensionPixelS... |
public class LinuxTaskController { /** * Sets up the permissions of the following directories :
* Job cache directory
* Archive directory
* Hadoop log directories */
@ Override void setup ( ) { } } | super . setup ( ) ; // set up job cache directory and associated permissions
String localDirs [ ] = this . mapredLocalDirs ; for ( String localDir : localDirs ) { // Cache root
File cacheDirectory = new File ( localDir , TaskTracker . getCacheSubdir ( ) ) ; File jobCacheDirectory = new File ( localDir , TaskTracker . g... |
public class WonderPushUriHelper { /** * Returns the non secure absolute url for the given resource
* @ param resource
* The resource path , which may or may not start with
* " / " + WonderPush . API _ VERSION */
protected static String getNonSecureAbsoluteUrl ( String resource ) { } } | if ( resource . startsWith ( "/" + WonderPush . API_VERSION ) ) { resource = resource . substring ( 1 + WonderPush . API_VERSION . length ( ) ) ; } return WonderPush . getNonSecureBaseURL ( ) + resource ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.