signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HttpProxyService { /** * Helper method to build an { @ link URL } from a baseUri and request parameters
* @ param url Base { @ link URL }
* @ param params request parameters
* @ return URI */
private URL buildUriWithParameters ( URL url , Map < String , String > params ) throws URISyntaxException , M... | if ( params == null || params . isEmpty ( ) ) { return url ; } URIBuilder uriBuilder = new URIBuilder ( url . toURI ( ) ) ; for ( String paramName : params . keySet ( ) ) { uriBuilder . addParameter ( paramName , params . get ( paramName ) ) ; } return uriBuilder . build ( ) . toURL ( ) ; |
public class CodedInput { /** * Reads and discards a single field , given its tag value .
* @ return { @ code false } if the tag is an endgroup tag , in which case nothing is skipped . Otherwise , returns
* { @ code true } . */
public boolean skipField ( final int tag ) throws IOException { } } | switch ( WireFormat . getTagWireType ( tag ) ) { case WireFormat . WIRETYPE_VARINT : readInt32 ( ) ; return true ; case WireFormat . WIRETYPE_FIXED64 : readRawLittleEndian64 ( ) ; return true ; case WireFormat . WIRETYPE_LENGTH_DELIMITED : skipRawBytes ( readRawVarint32 ( ) ) ; return true ; case WireFormat . WIRETYPE_... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcElectricFlowStorageDeviceTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class LayoutRefiner { /** * Stretch all bonds in the shortest path between a pair of atoms in an
* attempt to resolve the overlap . The stretch that produces the minimum
* congestion is stored in the provided stack and coords with the congestion
* score returned .
* @ param pair congested atom pair
* @... | stackBackup . clear ( ) ; final double score = congestion . score ( ) ; double min = score ; for ( IBond bond : pair . bndAt ) { // don ' t stretch ring bonds
if ( bond . isInRing ( ) ) continue ; if ( bfix . contains ( bond ) ) continue ; // has this bond already been tested as part of another pair
AtomPair first = fi... |
public class ClaimBean { /** * { @ inheritDoc } */
@ Override public boolean isAlternative ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "isAlternative" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "isAlternative" , false ) ; } return false ; |
public class Utils { /** * Find all direct children with defined name .
* @ param element parent element
* @ param childElementname child element name
* @ return list of found elements
* @ since 1.4.0 */
@ Nonnull @ MustNotContainNull public static List < Element > findDirectChildrenForName ( @ Nonnull final El... | final List < Element > resultList = new ArrayList < Element > ( ) ; final NodeList list = element . getChildNodes ( ) ; for ( int i = 0 ; i < list . getLength ( ) ; i ++ ) { final Node node = list . item ( i ) ; if ( element . equals ( node . getParentNode ( ) ) && node instanceof Element && childElementname . equals (... |
public class TimedMetadataInsertion { /** * Id3Insertions contains the array of Id3Insertion instances .
* @ param id3Insertions
* Id3Insertions contains the array of Id3Insertion instances . */
public void setId3Insertions ( java . util . Collection < Id3Insertion > id3Insertions ) { } } | if ( id3Insertions == null ) { this . id3Insertions = null ; return ; } this . id3Insertions = new java . util . ArrayList < Id3Insertion > ( id3Insertions ) ; |
public class CommandGroupFactoryBean { /** * Iterates over the collection of encoded members and adds them to the
* given command group .
* @ param group The group that is to contain the commands from the encoded
* members list . Must not be null .
* @ throws InvalidGroupMemberEncodingException if a member pref... | for ( int i = 0 ; i < members . length ; i ++ ) { Object o = members [ i ] ; if ( o instanceof AbstractCommand ) { group . addInternal ( ( AbstractCommand ) o ) ; configureIfNecessary ( ( AbstractCommand ) o ) ; } else if ( o instanceof Component ) { group . addComponentInternal ( ( Component ) o ) ; } else if ( o inst... |
public class ResourceHealthMetadatasInner { /** * Gets the category of ResourceHealthMetadata to use for the given site as a collection .
* Gets the category of ResourceHealthMetadata to use for the given site as a collection .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
... | ServiceResponse < Page < ResourceHealthMetadataInner > > response = listBySiteSinglePageAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) ; return new PagedList < ResourceHealthMetadataInner > ( response . body ( ) ) { @ Override public Page < ResourceHealthMetadataInner > nextPage ( String nextPageLink ... |
public class AbstractPostgreSQLQuery { /** * With NOWAIT , the statement reports an error , rather than waiting , if a selected row cannot
* be locked immediately .
* @ return the current object */
@ WithBridgeMethods ( value = PostgreSQLQuery . class , castRequired = true ) public C noWait ( ) { } } | QueryFlag noWaitFlag = configuration . getTemplates ( ) . getNoWaitFlag ( ) ; return addFlag ( noWaitFlag ) ; |
public class CPDAvailabilityEstimatePersistenceImpl { /** * Removes all the cpd availability estimates where commerceAvailabilityEstimateId = & # 63 ; from the database .
* @ param commerceAvailabilityEstimateId the commerce availability estimate ID */
@ Override public void removeByCommerceAvailabilityEstimateId ( l... | for ( CPDAvailabilityEstimate cpdAvailabilityEstimate : findByCommerceAvailabilityEstimateId ( commerceAvailabilityEstimateId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpdAvailabilityEstimate ) ; } |
public class ClassModel { /** * Determine if this is the superclass of some other named class .
* @ param otherClassName The name of the class to compare against
* @ return true if ' this ' a superclass of another named class */
public boolean isSuperClass ( String otherClassName ) { } } | if ( getClassWeAreModelling ( ) . getName ( ) . equals ( otherClassName ) ) { return true ; } else if ( superClazz != null ) { return superClazz . isSuperClass ( otherClassName ) ; } else { return false ; } |
public class BigDecimal { /** * Returns a { @ code BigDecimal } whose value is { @ code ( this /
* divisor ) } , and whose scale is as specified . If rounding must
* be performed to generate a result with the specified scale , the
* specified rounding mode is applied .
* @ param divisor value by which this { @ ... | return divide ( divisor , scale , roundingMode . oldMode ) ; |
public class MultiProcessCluster { /** * Updates master configuration for all masters . This will take effect on a master the next time
* the master is started .
* @ param key the key to update
* @ param value the value to set , or null to unset the key */
public synchronized void updateMasterConf ( PropertyKey k... | mMasters . forEach ( master -> master . updateConf ( key , value ) ) ; |
public class User { /** * Sets the human readable name of the user .
* If the input parameter is empty , the user ' s ID will be set . */
public void setFullName ( String name ) { } } | if ( Util . fixEmptyAndTrim ( name ) == null ) name = id ; this . fullName = name ; |
public class RetryUtils { /** * Retry an operation using fuzzy exponentially increasing backoff . The wait time after the nth failed attempt is
* min ( 60000ms , 1000ms * pow ( 2 , n - 1 ) ) , fuzzed by a number drawn from a Gaussian distribution with mean 0 and
* standard deviation 0.2.
* If maxTries is exhauste... | Preconditions . checkArgument ( maxTries > 0 , "maxTries > 0" ) ; Preconditions . checkArgument ( quietTries >= 0 , "quietTries >= 0" ) ; int nTry = 0 ; final int maxRetries = maxTries - 1 ; while ( true ) { try { nTry ++ ; return f . perform ( ) ; } catch ( Throwable e ) { if ( cleanupAfterFailure != null ) { cleanupA... |
public class TranslatorTypes { /** * Returns all main types of a specific data type size , based on the currently available main types as provided by
* { @ link TranslatorTypes # getAllMainTypes ( ) } .
* For example , when specifying a size of < code > 2 < / code > bits , the returned list will contain the main ty... | if ( size < 5 ) { final MainType mainType = map . get ( size == 1 ? TYPE_BOOLEAN : size == 2 ? TYPE_1BIT_CONTROLLED : size == 4 ? TYPE_3BIT_CONTROLLED : 0 ) ; return Optional . ofNullable ( mainType ) . map ( Collections :: singletonList ) . orElse ( emptyList ( ) ) ; } final List < MainType > l = new ArrayList < > ( )... |
public class ElementMatchers { /** * Matches any Java bean setter method which takes an argument the given type .
* @ param type The required setter type .
* @ param < T > The type of the matched object .
* @ return A matcher that matches a setter method with the specified argument type . */
public static < T ext... | return isSetter ( is ( type ) ) ; |
public class DuplicateBranches { /** * Like bb . getFirstInstruction ( ) except that if null is returned it will
* follow the FALL _ THROUGH _ EDGE ( if any ) */
private static InstructionHandle getDeepFirstInstruction ( CFG cfg , BasicBlock bb ) { } } | InstructionHandle ih = bb . getFirstInstruction ( ) ; if ( ih != null ) { return ih ; } Iterator < Edge > iei = cfg . outgoingEdgeIterator ( bb ) ; while ( iei . hasNext ( ) ) { Edge e = iei . next ( ) ; if ( EdgeTypes . FALL_THROUGH_EDGE == e . getType ( ) ) { return getDeepFirstInstruction ( cfg , e . getTarget ( ) )... |
public class NumberUtil { /** * 提供精确的乘法运算 < br >
* 如果传入多个值为null或者空 , 则返回0
* @ param v1 被乘数
* @ param v2 乘数
* @ return 积 */
public static double mul ( Double v1 , Double v2 ) { } } | return mul ( ( Number ) v1 , ( Number ) v2 ) . doubleValue ( ) ; |
public class SharedResourcesBrokerFactory { /** * Get all broker configurations from the given { @ code srcConfig } . Configurations from
* { @ value BrokerConstants # GOBBLIN _ BROKER _ CONFIG _ PREFIX } is always loaded first , then in - order from namespaces ,
* which is encoded as a comma separated string keyed... | Config allSrcConfig = srcConfig . withFallback ( BROKER_NAMESPACES_FALLBACK ) ; String namespaces = allSrcConfig . getString ( BrokerConstants . GOBBLIN_BROKER_CONFIG_NAMESPACES ) ; Config brokerConfig = ConfigUtils . getConfigOrEmpty ( allSrcConfig , BrokerConstants . GOBBLIN_BROKER_CONFIG_PREFIX ) ; for ( String name... |
public class DefaultListableProviderFactory { /** * / * ( non - Javadoc )
* @ see com . yiqiniu . easytrans . register . ServiceRegister # getServiceMap ( java . lang . Class , java . lang . Class ) */
@ Override public List < Object > getServices ( Class < ? > root , Class < ? > transactionType ) { } } | Map < Class < ? > , List < Object > > map = mapBusinessProvider . get ( root ) ; if ( map != null ) { List < Object > list = map . get ( transactionType ) ; if ( list != null ) { return Collections . unmodifiableList ( list ) ; } } return null ; |
public class PowerPackerFile { /** * Will unpack powerpacker 2.0 packed contend while reading from the packed Stream
* and unpacking into memory
* @ since 06.01.2010
* @ param source
* @ param buffer
* @ throws IOException */
private void pp20DoUnpack ( RandomAccessInputStream source , byte [ ] buffer ) throw... | BitBuffer bitBuffer = new BitBuffer ( source , ( int ) source . getLength ( ) - 4 ) ; source . seek ( source . getLength ( ) - 1 ) ; int skip = source . read ( ) ; bitBuffer . getBits ( skip ) ; int nBytesLeft = buffer . length ; while ( nBytesLeft > 0 ) { if ( bitBuffer . getBits ( 1 ) == 0 ) { int n = 1 ; while ( n <... |
public class ListPolicyPrincipalsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListPolicyPrincipalsRequest listPolicyPrincipalsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listPolicyPrincipalsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listPolicyPrincipalsRequest . getPolicyName ( ) , POLICYNAME_BINDING ) ; protocolMarshaller . marshall ( listPolicyPrincipalsRequest . getMarker ( ) , MARKER... |
public class DirectoryScanner { /** * Set the list of include patterns to use . All ' / ' and ' \ ' characters
* are replaced by < code > File . separatorChar < / code > , so the separator used
* need not match < code > File . separatorChar < / code > .
* When a pattern ends with a ' / ' or ' \ ' , " * * " is app... | if ( includes == null ) { this . includes = null ; } else { this . includes = new String [ includes . length ] ; for ( int i = 0 ; i < includes . length ; i ++ ) { this . includes [ i ] = normalizePattern ( includes [ i ] ) ; } } return this ; |
public class AmazonCloudFrontClient { /** * Get the field - level encryption profile information .
* @ param getFieldLevelEncryptionProfileRequest
* @ return Result of the GetFieldLevelEncryptionProfile operation returned by the service .
* @ throws AccessDeniedException
* Access denied .
* @ throws NoSuchFie... | request = beforeClientExecution ( request ) ; return executeGetFieldLevelEncryptionProfile ( request ) ; |
public class Binary { /** * Convenience method to copy a part of a byte array into a byte sequence .
* @ param bytes Bytes to wrap .
* @ param off Offset in source bytes to start reading from .
* @ param len Number of bytes to copy .
* @ return The wrapped byte sequence . */
public static Binary copy ( byte [ ]... | byte [ ] cpy = new byte [ len ] ; System . arraycopy ( bytes , off , cpy , 0 , len ) ; return wrap ( cpy ) ; |
public class JavacParser { /** * ClassDeclaration = CLASS Ident TypeParametersOpt [ EXTENDS Type ]
* [ IMPLEMENTS TypeList ] ClassBody
* @ param mods The modifiers starting the class declaration
* @ param dc The documentation comment for the class , or null . */
protected JCClassDecl classDeclaration ( JCModifier... | int pos = token . pos ; accept ( CLASS ) ; Name name = ident ( ) ; List < JCTypeParameter > typarams = typeParametersOpt ( ) ; JCExpression extending = null ; if ( token . kind == EXTENDS ) { nextToken ( ) ; extending = parseType ( ) ; } List < JCExpression > implementing = List . nil ( ) ; if ( token . kind == IMPLEME... |
public class AbstractCluster { /** * 指定地址不可用
* @ param serviceKey 服务关键字
* @ return 服务端 */
protected SofaRouteException unavailableProviderException ( String serviceKey , String providerInfo ) { } } | return new SofaRouteException ( LogCodes . getLog ( LogCodes . ERROR_TARGET_URL_INVALID , serviceKey , providerInfo ) ) ; |
public class VoltDB { /** * Exit the process with an error message , optionally with a stack trace .
* Also notify all connected peers that the node is going down . */
public static void crashGlobalVoltDB ( String errMsg , boolean stackTrace , Throwable t ) { } } | // for test code
wasCrashCalled = true ; crashMessage = errMsg ; if ( ignoreCrash ) { throw new AssertionError ( "Faux crash of VoltDB successful." ) ; } // end test code
// send a snmp trap crash notification
sendCrashSNMPTrap ( errMsg ) ; try { // turn off client interface as fast as possible
// we don ' t expect thi... |
public class DistributedCache { /** * Set the configuration with the given set of archives
* @ param archives The list of archives that need to be localized
* @ param conf Configuration which will be changed */
public static void setCacheArchives ( URI [ ] archives , Configuration conf ) { } } | String sarchives = StringUtils . uriToString ( archives ) ; conf . set ( "mapred.cache.archives" , sarchives ) ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcGeographicElementTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class ReactiveScalar { /** * Converts this Scalar computation to a single { @ link io . reactivex . Single } .
* @ return { @ link io . reactivex . Single } for the result of this query . */
@ CheckReturnValue public io . reactivex . Single < E > single ( ) { } } | return io . reactivex . Single . fromCallable ( this ) ; |
public class Trie { /** * Compresses the memory of the individual trie nodes .
* @ return this trie */
public Trie < V > trimToSize ( ) { } } | Queue < TrieNode < V > > queue = new LinkedList < > ( ) ; queue . add ( root ) ; while ( ! queue . isEmpty ( ) ) { TrieNode < V > node = queue . remove ( ) ; node . children . trimToSize ( ) ; queue . addAll ( node . children ) ; } return this ; |
public class LimesurveyRC { /** * Gets all participants from a survey .
* @ param surveyId the survey id of the survey you want the participants
* @ return the all participants
* @ throws LimesurveyRCException the limesurvey rc exception */
public Stream < LsParticipant > getAllParticipants ( int surveyId ) throw... | LsApiBody . LsApiParams params = getParamsWithKey ( surveyId ) ; params . setStart ( 0 ) ; params . setLimit ( - 1 ) ; List < LsParticipant > participants = gson . fromJson ( callRC ( new LsApiBody ( "list_participants" , params ) ) , new TypeToken < List < LsParticipant > > ( ) { } . getType ( ) ) ; return participant... |
public class SSD1306MessageFactory { /** * Setup column start and end address . < br >
* This command is only for horizontal or vertical addressing mode .
* @ param startAddress Column start address , range : 0-127
* @ param endAddress Column end address , range : 0-127
* @ return command sequence */
public sta... | if ( startAddress < 0 || endAddress < 0 ) { throw new IllegalArgumentException ( "Start and end address must be positive." ) ; } return new byte [ ] { COMMAND_CONTROL_BYTE , SET_COLUMN_ADDR , COMMAND_CONTROL_BYTE , startAddress , COMMAND_CONTROL_BYTE , endAddress } ; |
public class FidelityOptions { /** * Creates fidelity options using the maximum XML compatibility mode , e . g .
* preserving comments , unsignificant whitespaces et cetera .
* Note : Per default SelfContained Element support is not set to TRUE . It
* cannot work together with ( Pre - ) Compression !
* @ return... | FidelityOptions fo = new FidelityOptions ( ) ; fo . options . add ( FEATURE_COMMENT ) ; fo . isComment = true ; fo . options . add ( FEATURE_PI ) ; fo . isPI = true ; fo . options . add ( FEATURE_DTD ) ; fo . isDTD = true ; fo . options . add ( FEATURE_PREFIX ) ; fo . isPrefix = true ; fo . options . add ( FEATURE_LEXI... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcControllerTypeEnum createIfcControllerTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcControllerTypeEnum result = IfcControllerTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class AmazonPinpointClient { /** * Deletes endpoints that are associated with a User ID .
* @ param deleteUserEndpointsRequest
* @ return Result of the DeleteUserEndpoints operation returned by the service .
* @ throws BadRequestException
* 400 response
* @ throws InternalServerErrorException
* 500 r... | request = beforeClientExecution ( request ) ; return executeDeleteUserEndpoints ( request ) ; |
public class WiredCache { /** * Nothing done here . Will notify the storage about eviction in some future version . */
@ Override public void onEvictionFromHeap ( final Entry < K , V > e ) { } } | CacheEntry < K , V > _currentEntry = heapCache . returnCacheEntry ( e ) ; if ( syncEntryEvictedListeners != null ) { for ( CacheEntryEvictedListener < K , V > l : syncEntryEvictedListeners ) { l . onEntryEvicted ( this , _currentEntry ) ; } } |
public class CmsUserEditDialog { /** * Validates the password fields . < p >
* @ return true if password is valid ( and confirm field matches password field ) . < p > */
protected boolean isPasswordValid ( ) { } } | if ( ( m_pw . getPassword1 ( ) == null ) | ( m_pw . getPassword2 ( ) == null ) ) { return false ; } try { CmsPasswordInfo pwdInfo = new CmsPasswordInfo ( ) ; pwdInfo . setNewPwd ( m_pw . getPassword1 ( ) ) ; pwdInfo . setConfirmation ( m_pw . getPassword2 ( ) ) ; pwdInfo . validate ( ) ; return true ; } catch ( CmsIlle... |
public class ProcessEngines { /** * Initializes all process engines that can be found on the classpath for resources < code > activiti . cfg . xml < / code > ( plain Activiti style configuration ) and for resources
* < code > activiti - context . xml < / code > ( Spring style configuration ) . */
public synchronized ... | if ( ! isInitialized ( ) ) { if ( processEngines == null ) { // Create new map to store process - engines if current map is
// null
processEngines = new HashMap < String , ProcessEngine > ( ) ; } ClassLoader classLoader = ReflectUtil . getClassLoader ( ) ; Enumeration < URL > resources = null ; try { resources = classL... |
public class JdtRecorder { /** * < pre >
* SingleVariableDeclaration :
* { ExtendedModifier } Type [ . . . ] Identifier { [ ] } [ = Expression ]
* < / pre >
* @ param variable the { @ link SingleVariableDeclaration variable } being recorded ( cannot be < code > null < / code > )
* @ param parentNode the paren... | final String name = variable . getName ( ) . getFullyQualifiedName ( ) ; final Node paramNode = parentNode . addNode ( name , ClassFileSequencerLexicon . PARAMETER ) ; paramNode . setProperty ( ClassFileSequencerLexicon . NAME , name ) ; paramNode . setProperty ( ClassFileSequencerLexicon . FINAL , ( variable . getModi... |
public class SessionAffinityManager { /** * called from ConvergedHttpSession . encodeURL path */
public String encodeURL ( HttpSession session , String url ) { } } | return encodeURL ( session , null , url , null ) ; |
public class MemcmpEncoder { /** * A double is written as 8 bytes . It is encoded as a 64 bit long using the
* long encoding defined in this class . If it is a negative number , the
* complement of the 63 bits ( every bit except the sign bit ) is taken . This is
* to ensure proper ordering of negative numbers .
... | long n = Double . doubleToLongBits ( d ) ; if ( ( n >>> 63 ) > 0 ) { n ^= 0x7fffffffffffffffL ; } writeLong ( n ) ; |
public class EnvLoader { /** * Returns the classpath for the environment level . */
public static String getLocalClassPath ( ClassLoader loader ) { } } | for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) { return ( ( EnvironmentClassLoader ) loader ) . getLocalClassPath ( ) ; } } return DynamicClassLoader . getSystemClassPath ( ) ; |
public class JdbcSqlAdapter { /** * The method returns parameter values to use in the query .
* The default implementation returns the value of the defined parameters variable ,
* which can be one of the following types :
* < ul >
* < li > java . lang . String < / li >
* < li > java . lang . Integer < / li > ... | try { String paramVar = getAttributeValueSmart ( PARAM_VAR ) ; if ( paramVar == null ) return null ; return this . getVariableValue ( paramVar ) ; } catch ( Exception ex ) { throw new ActivityException ( ex . getMessage ( ) , ex ) ; } |
public class JspRuntimeLibrary { /** * _ _ begin lookupReadMethodMethod */
public static Object handleGetProperty ( Object o , String prop ) throws JspCoreException { } } | if ( o == null ) { throw new JspCoreException ( "jsp.error.beans.nullbean" ) ; } Object value = null ; try { Method method = getReadMethod ( o . getClass ( ) , prop ) ; value = method . invoke ( o , null ) ; } catch ( Exception ex ) { throw new JspCoreException ( ex ) ; } return value ; |
public class Dynamic { /** * Binds the supplied bootstrap constructor for the resolution of a dynamic constant .
* @ param name The name of the bootstrap constant that is provided to the bootstrap method or constructor .
* @ param constructor The bootstrap constructor to invoke .
* @ param rawArgument The argumen... | return bootstrap ( name , constructor , Arrays . asList ( rawArgument ) ) ; |
public class FSNamesystem { /** * / * Resolve a node ' s network location */
void resolveNetworkLocation ( DatanodeInfo node ) { } } | List < String > names = new ArrayList < String > ( 1 ) ; if ( dnsToSwitchMapping instanceof CachedDNSToSwitchMapping ) { // get the node ' s IP address
names . add ( node . getHost ( ) ) ; } else if ( dnsToSwitchMapping instanceof StaticMapping ) { names . add ( toHostPort ( node ) ) ; } else { // get the node ' s host... |
public class CmsContainerConfigurationParser { /** * Parses a group of named configurations from a given XML content location . < p >
* @ param location the location from which to read the configuration group */
protected void parseConfigurationGroup ( I_CmsXmlContentLocation location ) { } } | List < I_CmsXmlContentValueLocation > locations = location . getSubValues ( N_CONFIGURATION ) ; m_currentConfigurationGroup = new HashMap < String , CmsContainerConfiguration > ( ) ; m_results . put ( m_currentLocale , m_currentConfigurationGroup ) ; for ( I_CmsXmlContentValueLocation configLocation : locations ) { par... |
public class AbstractDictionaryEventSource { /** * ( non - Javadoc )
* @ see com . sematext . ag . source . FiniteEventSource # init ( com . sematext . ag . PlayerConfig ) */
@ Override public synchronized void init ( PlayerConfig config ) { } } | super . init ( config ) ; String dictFileName = config . get ( DICTIONARY_FILE_NAME_KEY ) ; if ( dictFileName == null || "" . equals ( dictFileName . trim ( ) ) ) { throw new IllegalArgumentException ( this . getClass ( ) . getName ( ) + " expects configuration property " + DICTIONARY_FILE_NAME_KEY ) ; } File f = new F... |
public class GEMFFile { /** * Get an InputStream for the tile data specified by the Z / X / Y coordinates .
* @ return InputStream of tile data , or null if not found . */
public InputStream getInputStream ( final int pX , final int pY , final int pZ ) { } } | GEMFRange range = null ; for ( final GEMFRange rs : mRangeData ) { if ( ( pZ == rs . zoom ) && ( pX >= rs . xMin ) && ( pX <= rs . xMax ) && ( pY >= rs . yMin ) && ( pY <= rs . yMax ) && ( ( ! mSourceLimited ) || ( rs . sourceIndex == mCurrentSource ) ) ) { range = rs ; break ; } } if ( range == null ) { return null ; ... |
public class Spies { /** * Proxies a ternary function spying for second parameter
* @ param < R > the function result type
* @ param < T1 > the function first parameter type
* @ param < T2 > the function second parameter type
* @ param < T3 > the function third parameter type
* @ param function the function t... | return spy ( function , Box . < R > empty ( ) , Box . < T1 > empty ( ) , param2 , Box . < T3 > empty ( ) ) ; |
public class ResourceRecordSets { /** * creates aaaa set of { @ link denominator . model . rdata . AAAAData AAAA } records for the specified
* name .
* @ param name ex . { @ code www . denominator . io . }
* @ param addresses address values ex . { @ code [ 1234 : ab00 : ff00 : : 6b14 : abcd ,
* 5678 : ab00 : ff... | return new AAAABuilder ( ) . name ( name ) . addAll ( addresses ) . build ( ) ; |
public class PropUtils { /** * Loads properties from a file .
* @ since 1.0
* @ param file the file to read properties from
* @ return the properties
* @ throws IOException an error occurred while reading the file */
public static Properties loadFile ( File file ) throws IOException { } } | InputStream input = new FileInputStream ( file ) ; Properties prop = null ; try { prop = load ( input ) ; } finally { IOUtils . close ( input ) ; } return prop ; |
public class ConcurrentLinkedQueue { /** * Returns a new node holding item . Uses relaxed write because item
* can only be seen after piggy - backing publication via casNext . */
static < E > Node < E > newNode ( E item ) { } } | Node < E > node = new Node < E > ( ) ; U . putObject ( node , ITEM , item ) ; return node ; |
public class FactorTable { /** * Computes the probability of the tag OF being at the end of the table given
* that the previous tag sequence in table is GIVEN . given is at the beginning ,
* of is at the end .
* @ return the probability of the tag OF being at the end of the table */
public double conditionalLogPr... | if ( given . length != windowSize - 1 ) { throw new IllegalArgumentException ( "conditionalLogProbGivenPrevious requires given one less than clique size (" + windowSize + ") but was " + Arrays . toString ( given ) ) ; } // Note : other similar methods could be optimized like this one , but this is the one the CRF uses ... |
public class IpAddressRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( IpAddressRequest ipAddressRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( ipAddressRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( ipAddressRequest . getSubnetId ( ) , SUBNETID_BINDING ) ; protocolMarshaller . marshall ( ipAddressRequest . getIp ( ) , IP_BINDING ) ; } catch ( Exception e ) { throw ... |
public class AbstractDatatype { /** * Implements strict string equality semantics by performing a standard
* < code > equals < / code > check on the arguments .
* @ param value1 an object returned by < code > createValue < / code >
* @ param value2 another object returned by < code > createValue < / code >
* @ ... | if ( value1 == null ) { return ( value2 == null ) ; } return value1 . equals ( value2 ) ; |
public class JarFileIterator { /** * Sets the next . */
private void setNext ( ) { } } | initial = true ; try { if ( next != null ) { jar . closeEntry ( ) ; } next = null ; do { next = jar . getNextJarEntry ( ) ; } while ( next != null && ( next . isDirectory ( ) || ( filter == null || ! filter . accepts ( next . getName ( ) ) ) ) ) ; if ( next == null ) { close ( ) ; } } catch ( IOException e ) { throw ne... |
public class FailoverLoader { /** * Obtains a module adapter for { @ code module } from the first responding resolver . */
@ SuppressWarnings ( "unchecked" ) // cache ensures types match
@ Override public < T > ModuleAdapter < T > getModuleAdapter ( Class < T > type ) { } } | return ( ModuleAdapter < T > ) loadedAdapters . get ( type ) ; |
public class ClassHelper { /** * Convert a package name to a relative directory name .
* @ param aPackage
* The package to be converted . May be < code > null < / code > .
* @ return The directory name using forward slashes ( / ) instead of the dots . */
@ Nullable public static String getDirectoryFromPackage ( @... | // No differentiation
return aPackage == null ? null : getPathFromClass ( aPackage . getName ( ) ) ; |
public class AmazonDirectConnectClient { /** * Describes all your link aggregation groups ( LAG ) or the specified LAG .
* @ param describeLagsRequest
* @ return Result of the DescribeLags operation returned by the service .
* @ throws DirectConnectServerException
* A server - side error occurred .
* @ throws... | request = beforeClientExecution ( request ) ; return executeDescribeLags ( request ) ; |
public class ClassDescriptorDef { /** * Returns the feature ( field , reference , collection ) of the given name .
* @ param name The name
* @ return The feature or < code > null < / code > if there is no such feature in the current class */
public DefBase getFeature ( String name ) { } } | DefBase result = getField ( name ) ; if ( result == null ) { result = getReference ( name ) ; } if ( result == null ) { result = getCollection ( name ) ; } return result ; |
public class CollectionUtils { /** * As string array .
* @ param input the input
* @ return the string [ ] */
public static String [ ] asStringArray ( List < String > input ) { } } | String [ ] result = new String [ input . size ( ) ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = input . get ( i ) ; } return result ; |
public class AnnotationTargetsImpl_Targets { /** * Do not trigger a scan : This is used by the recording steps . */
protected UtilImpl_BidirectionalMap doGetAnnotationsMap ( ScanPolicy policy , AnnotationCategory category ) { } } | return doGetPolicyData ( policy ) . getTargetData ( category ) ; |
public class AlignmentUtils { /** * Calculates score of alignment
* @ param seq1 target sequence
* @ param seq1Range aligned range
* @ param mutations mutations ( alignment )
* @ param scoring scoring
* @ param < S > sequence type
* @ return score */
public static < S extends Sequence < S > > int calculateS... | if ( scoring instanceof LinearGapAlignmentScoring ) return calculateScore ( seq1 , seq1Range , mutations , ( LinearGapAlignmentScoring < S > ) scoring ) ; else if ( scoring instanceof AffineGapAlignmentScoring ) return calculateScore ( seq1 , seq1Range , mutations , ( AffineGapAlignmentScoring < S > ) scoring ) ; else ... |
public class MemcachedConnection { /** * Places the response into the current connection ' s output buffer .
* Note that the actual I / O is not performed in this method
* @ param response the response to enqueue */
public synchronized void sendResponse ( BinaryResponse response ) { } } | if ( pending == null ) { pending = new LinkedList < ByteBuffer > ( ) ; } pending . add ( response . getBuffer ( ) ) ; |
public class SignatureUtil { /** * Scans the given string for an identifier starting at the given
* index and returns the index of the last character .
* Stop characters are : " ; " , " : " , " & lt ; " , " & gt ; " , " / " , " . " .
* @ param string the signature string
* @ param start the 0 - based character ... | // need a minimum 1 char
if ( start >= string . length ( ) ) { throw new IllegalArgumentException ( ) ; } int p = start ; while ( true ) { char c = string . charAt ( p ) ; if ( c == '<' || c == '>' || c == ':' || c == ';' || c == '.' || c == '/' ) { return p - 1 ; } p ++ ; if ( p == string . length ( ) ) { return p - 1... |
public class ExtractorMajorPartQuery { /** * Gets the amount in major units as a { @ code long } .
* This returns the monetary amount in terms of the major units of the
* currency , truncating the amount if necessary . For example , ' EUR 2.35'
* will return 2 , and ' BHD - 1.345 ' will return - 1.
* This metho... | Objects . requireNonNull ( amount , "Amount required." ) ; return amount . with ( downRounding ) . getNumber ( ) . longValueExact ( ) ; |
public class CATSyncAsynchReader { /** * Sets whether we have set a response or not .
* @ param completed */
public synchronized void setComplete ( boolean completed ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setComplete" , completed ) ; this . completed = completed ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setComplete" ) ; |
public class GenericsUtils { /** * Resolve type generics . Returned type will contain actual types instead of generic names . Most likely , returned
* type will be different than provided : for example , original type may be { @ link TypeVariable } and returned
* will be simple { @ link Class } ( resolved generic v... | return resolveTypeVariables ( type , generics , false ) ; |
public class Classes { /** * Get default implementation for requested list type .
* @ param listType raw list type .
* @ param < T > list type .
* @ return default implementation for requested list . */
@ SuppressWarnings ( "unchecked" ) public static < T extends List < ? > > Class < T > getListDefaultImplementat... | return ( Class < T > ) getImplementation ( LISTS , listType ) ; |
public class GSPCOLImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setRES1 ( Integer newRES1 ) { } } | Integer oldRES1 = res1 ; res1 = newRES1 ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . GSPCOL__RES1 , oldRES1 , res1 ) ) ; |
public class Node { /** * Removes this node from the DOM , and moves its children up into the node ' s parent . This has the effect of dropping
* the node but keeping its children .
* For example , with the input html :
* < p > { @ code < div > One < span > Two < b > Three < / b > < / span > < / div > } < / p >
... | Validate . notNull ( parentNode ) ; final List < Node > childNodes = ensureChildNodes ( ) ; Node firstChild = childNodes . size ( ) > 0 ? childNodes . get ( 0 ) : null ; parentNode . addChildren ( siblingIndex , this . childNodesAsArray ( ) ) ; this . remove ( ) ; return firstChild ; |
public class DNSSECVerifier { /** * Attempts to verify an RRset . This does not modify the set .
* @ param set The RRset to verify
* @ param cache The Cache where obtained secure keys are found ( may be null )
* @ return The new security status of the set
* @ see RRset */
public int verify ( RRset set , Cache c... | Iterator sigs = set . sigs ( ) ; if ( Options . check ( "verbosesec" ) ) System . out . print ( "Verifying " + set . getName ( ) + "/" + Type . string ( set . getType ( ) ) + ": " ) ; if ( ! sigs . hasNext ( ) ) { if ( Options . check ( "verbosesec" ) ) System . out . println ( "Insecure" ) ; return DNSSEC . Insecure ;... |
public class AwsSecurityFindingFilters { /** * The workflow state of a finding .
* @ param workflowState
* The workflow state of a finding . */
public void setWorkflowState ( java . util . Collection < StringFilter > workflowState ) { } } | if ( workflowState == null ) { this . workflowState = null ; return ; } this . workflowState = new java . util . ArrayList < StringFilter > ( workflowState ) ; |
public class JmolSymmetryScriptGeneratorPointGroup { /** * / * ( non - Javadoc )
* @ see org . biojava . nbio . structure . quaternary . jmolScript . JMolSymmetryScriptInterface # getDefaultOrientation ( ) */
@ Override public String getDefaultOrientation ( ) { } } | StringBuilder s = new StringBuilder ( ) ; s . append ( setCentroid ( ) ) ; // calculate orientation
Quat4d q = new Quat4d ( ) ; q . set ( polyhedron . getViewMatrix ( 0 ) ) ; q . normalize ( ) ; Quat4d r = new Quat4d ( ) ; r . set ( rotationAxisAligner . getRotationMatrix ( ) ) ; r . normalize ( ) ; q . mul ( r ) ; q .... |
public class DirectoryScanner { /** * Test whether or not a given path matches a given pattern .
* @ param pattern The pattern to match against . Must not be
* < code > null < / code > .
* @ param str The path to match , as a String . Must not be
* < code > null < / code > .
* @ param isCaseSensitive Whether ... | return SelectorUtils . matchPath ( pattern , str , isCaseSensitive ) ; |
public class StringUtil { /** * Tests if a string contains another string .
* @ param pContainer The string to test
* @ param pLookFor The string to look for
* @ return { @ code true } if the container string is contains the string , and
* both parameters are non - { @ code null } , otherwise { @ code false } .... | return ( ( pContainer != null ) && ( pLookFor != null ) && ( pContainer . indexOf ( pLookFor ) >= 0 ) ) ; |
public class TransformerException { /** * Get the error message with location information
* appended .
* @ return A < code > String < / code > representing the error message with
* location information appended . */
public String getMessageAndLocation ( ) { } } | StringBuilder sbuffer = new StringBuilder ( ) ; String message = super . getMessage ( ) ; if ( null != message ) { sbuffer . append ( message ) ; } if ( null != locator ) { String systemID = locator . getSystemId ( ) ; int line = locator . getLineNumber ( ) ; int column = locator . getColumnNumber ( ) ; if ( null != sy... |
public class Tuple12 { /** * Skip 5 degrees from this tuple . */
public final Tuple7 < T6 , T7 , T8 , T9 , T10 , T11 , T12 > skip5 ( ) { } } | return new Tuple7 < > ( v6 , v7 , v8 , v9 , v10 , v11 , v12 ) ; |
public class DistributionsViewClientCriterion { /** * Configures the elements of the composite accept criterion for the
* Distributions View .
* @ return accept criterion elements */
static ServerViewComponentClientCriterion [ ] createViewComponentClientCriteria ( ) { } } | final ServerViewComponentClientCriterion [ ] criteria = new ServerViewComponentClientCriterion [ 1 ] ; // Upload software module table acceptable components .
criteria [ 0 ] = ServerViewComponentClientCriterion . createBuilder ( ) . dragSourceIdPrefix ( UIComponentIdProvider . UPLOAD_SOFTWARE_MODULE_TABLE ) . dropTarge... |
public class PackagesApi { /** * Get a single project package .
* < pre > < code > GitLab Endpoint : GET / projects / : id / packages / : package _ id < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param packageId the ID of t... | Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" , packageId ) ; return ( response . readEntity ( Package . class ) ) ; |
public class CmsADEManager { /** * Saves the favorite list , user based . < p >
* @ param cms the cms context
* @ param recentList the element list
* @ throws CmsException if something goes wrong */
public void saveRecentList ( CmsObject cms , List < CmsContainerElementBean > recentList ) throws CmsException { } ... | saveElementList ( cms , recentList , ADDINFO_ADE_RECENT_LIST ) ; |
public class U { /** * Documented , # findWhere */
public static < T , E > Optional < E > findWhere ( final Iterable < E > iterable , final List < Tuple < String , T > > properties ) { } } | return find ( iterable , new WherePredicate < E , T > ( properties ) ) ; |
public class SettingsPack { /** * Indicates whether or not the UPnP implementation should ignore any
* broadcast response from a device whose address is not the configured
* router for this machine . i . e . it ' s a way to not talk to other people ' s
* routers by mistake .
* @ param value the new value
* @ ... | sp . set_bool ( settings_pack . bool_types . upnp_ignore_nonrouters . swigValue ( ) , value ) ; return this ; |
public class AbstractCollection { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . Collection # containsAll ( com . ibm . ws . objectManager . Collection , com . ibm . ws . objectManager . Transaction ) */
public boolean containsAll ( Collection otherCollection , Transaction transaction ) throws Objec... | try { for ( Iterator iterator = otherCollection . iterator ( ) ; contains ( ( Token ) iterator . next ( transaction ) , transaction ) ; ) ; return false ; } catch ( java . util . NoSuchElementException exception ) { // No FFDC code needed .
return true ; } // try . |
public class FormParamProcessor { /** * < p > Accepts the { @ link InvocationContext } with an { @ link HttpEntityEnclosingRequestBase } and
* creates a list of < a href = " http : / / en . wikipedia . org / wiki / POST _ ( HTTP ) # Use _ for _ submitting _ web _ forms " >
* form - urlencoded < / a > name - value p... | try { if ( request instanceof HttpEntityEnclosingRequestBase ) { List < NameValuePair > nameValuePairs = new LinkedList < NameValuePair > ( ) ; // add static name and value pairs
List < Param > constantFormParams = RequestUtils . findStaticFormParams ( context ) ; for ( Param param : constantFormParams ) { nameValuePai... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getGCBIMGFORMAT ( ) { } } | if ( gcbimgformatEEnum == null ) { gcbimgformatEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 136 ) ; } return gcbimgformatEEnum ; |
public class BatchUpdateDaemon { /** * This implements the method in RealTimeDaemon . It copies the eventVector ,
* processes it to remove multiple sets on the same entry and sets followed
* by invalidations on the same entry , and applies the filtered vector to
* all caches ( first in remote CacheUnits , then in... | try { BatchUpdateList currentUpdates [ ] ; synchronized ( this ) { int sz = updates . size ( ) ; if ( sz > 0 ) { currentUpdates = new BatchUpdateList [ sz ] ; updates . values ( ) . toArray ( currentUpdates ) ; updates . clear ( ) ; } else { // no events to process , out of here .
return ; } } ArrayList pushCacheEntryL... |
public class AWSApplicationAutoScalingClient { /** * Gets information about the scalable targets in the specified namespace .
* You can filter the results using the < code > ResourceIds < / code > and < code > ScalableDimension < / code > parameters .
* To create a scalable target or update an existing one , see < ... | request = beforeClientExecution ( request ) ; return executeDescribeScalableTargets ( request ) ; |
public class Util { /** * Creates Ant { @ link FileSet } with the base dir and include pattern .
* The difference with this and using { @ link FileSet # setIncludes ( String ) }
* is that this method doesn ' t treat whitespace as a pattern separator ,
* which makes it impossible to use space in the file path .
... | FileSet fs = new FileSet ( ) ; fs . setDir ( baseDir ) ; fs . setProject ( new Project ( ) ) ; StringTokenizer tokens ; tokens = new StringTokenizer ( includes , "," ) ; while ( tokens . hasMoreTokens ( ) ) { String token = tokens . nextToken ( ) . trim ( ) ; fs . createInclude ( ) . setName ( token ) ; } if ( excludes... |
public class GetProfileRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetProfileRequest getProfileRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getProfileRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getProfileRequest . getProfileArn ( ) , PROFILEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . ge... |
public class screen { /** * Current device resolution
* @ return the resolution */
public static String deviceResolution ( ) { } } | DisplayMetrics metrics = QuickUtils . getContext ( ) . getResources ( ) . getDisplayMetrics ( ) ; return String . valueOf ( metrics . widthPixels ) + "x" + metrics . heightPixels ; |
public class FailureMetadata { /** * TODO ( cpovirk ) : Consider returning multiple facts in some cases . For example , for
* assertThat ( multimap ) . valuesForKey ( key ) . hasSize ( size ) , it might be useful for us to display the
* valuesForKey collection as well as the multimap it ' s part of . Probably displ... | Step rootSubject = null ; boolean seenDerivation = false ; for ( Step step : steps ) { if ( step . isCheckCall ( ) ) { /* * If we don ' t have a description update , don ' t trigger display of a root object . ( If we
* did , we ' d change the messages of a bunch of existing subjects , and we don ' t want to bite
* ... |
public class ClassPathUtils { /** * Returns the fully qualified name for the resource with name { @ code resourceName } relative to the given context .
* < p > Note that this method does not check whether the resource actually exists .
* It only constructs the name .
* Null inputs are not allowed . < / p >
* < ... | Validate . notNull ( context , "Parameter '%s' must not be null!" , "context" ) ; Validate . notNull ( resourceName , "Parameter '%s' must not be null!" , "resourceName" ) ; return context . getName ( ) + "." + resourceName ; |
public class DeletedWebAppsInner { /** * Get all deleted apps for a subscription .
* Get all deleted apps for a subscription .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; DeletedSiteInner & gt ; object */
public Observable < Page <... | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < DeletedSiteInner > > , Page < DeletedSiteInner > > ( ) { @ Override public Page < DeletedSiteInner > call ( ServiceResponse < Page < DeletedSiteInner > > response ) { return response . body ( ) ; } } ) ; |
public class FirestoreClient { /** * Lists all the collection IDs underneath a document .
* < p > Sample code :
* < pre > < code >
* try ( FirestoreClient firestoreClient = FirestoreClient . create ( ) ) {
* String formattedParent = AnyPathName . format ( " [ PROJECT ] " , " [ DATABASE ] " , " [ DOCUMENT ] " , ... | ListCollectionIdsRequest request = ListCollectionIdsRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return listCollectionIds ( request ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.