signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class UnicodeFont { /** * Utility to create a Java font for a TTF file reference
* @ param ttfFileRef The file system or classpath location of the TrueTypeFont file .
* @ return The font created
* @ throws SlickException Indicates a failure to locate or load the font into Java ' s font
* system . */
priv... | try { return Font . createFont ( Font . TRUETYPE_FONT , ResourceLoader . getResourceAsStream ( ttfFileRef ) ) ; } catch ( FontFormatException ex ) { throw new SlickException ( "Invalid font: " + ttfFileRef , ex ) ; } catch ( IOException ex ) { throw new SlickException ( "Error reading font: " + ttfFileRef , ex ) ; } |
public class DefaultSelendroidDriver { /** * ( non - Javadoc )
* @ see org . openqa . selenium . android . server . AndroidDriver # getSessionCapabilities ( java . lang . String ) */
@ Override public JSONObject getSessionCapabilities ( String sessionId ) { } } | SelendroidLogger . info ( "session: " + sessionId ) ; JSONObject copy ; try { JSONObject capabilities = session . getCapabilities ( ) ; if ( capabilities != null ) { copy = new JSONObject ( capabilities . toString ( ) ) ; } else { copy = new JSONObject ( ) ; } copy . put ( TAKES_SCREENSHOT , true ) ; copy . put ( BROWS... |
public class CmsXmlUtils { /** * Splits a content value path into its components , ignoring leading or trailing slashes . < p >
* Note : this does not work for XPaths in general , only for the paths used to identify values in OpenCms contents . < p >
* @ param xpath the xpath
* @ return the path components */
pub... | return Arrays . stream ( xpath . split ( "/" ) ) . filter ( s -> ! s . isEmpty ( ) ) . collect ( Collectors . toList ( ) ) ; |
public class ZonedDateTime { /** * Obtains an instance of { @ code ZonedDateTime } from a local date - time .
* This creates a zoned date - time matching the input local date - time as closely as possible .
* Time - zone rules , such as daylight savings , mean that not every local date - time
* is valid for the s... | return ofLocal ( localDateTime , zone , null ) ; |
public class Base64EncodedSignerWithChoosersByAliasImpl { /** * Signs a message .
* @ param keyStoreChooser the keystore chooser
* @ param privateKeyChooserByAlias the private key chooser
* @ param message the message to sign
* @ return the base64 encoded signature */
public String sign ( KeyStoreChooser keySto... | Base64EncodedSigner signer = cache . get ( cacheKey ( keyStoreChooser , privateKeyChooserByAlias ) ) ; if ( signer != null ) { return signer . sign ( message ) ; } Base64EncodedSignerImpl signerImpl = new Base64EncodedSignerImpl ( ) ; signerImpl . setAlgorithm ( algorithm ) ; signerImpl . setCharsetName ( charsetName )... |
public class SegmentedJournal { /** * Loads all segments from disk .
* @ return A collection of segments for the log . */
protected Collection < JournalSegment < E > > loadSegments ( ) { } } | // Ensure log directories are created .
directory . mkdirs ( ) ; TreeMap < Long , JournalSegment < E > > segments = new TreeMap < > ( ) ; // Iterate through all files in the log directory .
for ( File file : directory . listFiles ( File :: isFile ) ) { // If the file looks like a segment file , attempt to load the segm... |
public class ParserDML { /** * Retrieves an INSERT Statement from this parse context . */
StatementDMQL compileInsertStatement ( RangeVariable [ ] outerRanges ) { } } | read ( ) ; readThis ( Tokens . INTO ) ; boolean [ ] columnCheckList ; int [ ] columnMap ; int colCount ; Table table = readTableName ( ) ; boolean overridingUser = false ; boolean overridingSystem = false ; int enforcedDefaultIndex = table . getIdentityColumnIndex ( ) ; boolean assignsToIdentity = false ; columnCheckLi... |
public class AbstractSshAuthConfigurator { /** * Iterates through the known hosts ( host key repository ) .
* If one of the know hosts matches the current host we ' re trying to connect too ,
* it configures the session to use that key ' s algorithm
* ( thus avoiding conflicts between JSch wanting RSA and the key... | HostKey [ ] hostKeys = session . getHostKeyRepository ( ) . getHostKey ( ) ; for ( HostKey hostKey : hostKeys ) { if ( hostKey . getHost ( ) . contains ( host . getHostName ( ) ) ) { session . setConfig ( KEY_TYPE_CONFIG , hostKey . getType ( ) ) ; } } |
public class LongDoubleUnsortedVector { /** * NOTE : this is much less efficient than calls to add ( ) . */
public double set ( long index , double value ) { } } | compact ( ) ; int i = findIndexMatching ( index ) ; if ( i < 0 ) { add ( index , value ) ; compacted = false ; return 0 ; } else { double old = vals [ i ] ; vals [ i ] = value ; return old ; } |
public class BaseBundleActivator { /** * Get the properties .
* @ return the properties . */
public String getProperty ( String key ) { } } | String servicePid = this . getServicePid ( ) ; String value = null ; if ( ! key . contains ( "." ) ) { value = context . getProperty ( servicePid + '.' + key ) ; if ( ( value == null ) && ( properties != null ) ) value = properties . get ( servicePid + '.' + key ) ; } if ( value == null ) value = context . getProperty ... |
public class AmazonMTurkClient { /** * The < code > GetFileUploadURL < / code > operation generates and returns a temporary URL . You use the temporary URL to
* retrieve a file uploaded by a Worker as an answer to a FileUploadAnswer question for a HIT . The temporary URL is
* generated the instant the GetFileUpload... | request = beforeClientExecution ( request ) ; return executeGetFileUploadURL ( request ) ; |
public class HtmlDocletWriter { /** * Add the inline deprecated comment .
* @ param e the Element for which the inline deprecated comment will be added
* @ param tag the inline tag to be added
* @ param htmltree the content tree to which the comment will be added */
public void addInlineDeprecatedComment ( Elemen... | CommentHelper ch = utils . getCommentHelper ( e ) ; addCommentTags ( e , ch . getBody ( configuration , tag ) , true , false , htmltree ) ; |
public class RGraph { /** * Projects a RGraph bitset on the source graph G2.
* @ param set RGraph BitSet to project
* @ return The associate BitSet in G2 */
public BitSet projectG2 ( BitSet set ) { } } | BitSet projection = new BitSet ( secondGraphSize ) ; RNode xNode = null ; for ( int x = set . nextSetBit ( 0 ) ; x >= 0 ; x = set . nextSetBit ( x + 1 ) ) { xNode = ( RNode ) graph . get ( x ) ; projection . set ( xNode . rMap . id2 ) ; } return projection ; |
public class Element { /** * Check that the element has no text content . */
void assertNoText ( ) throws InvalidInputException { } } | for ( Element child : this . getChildren ( ) ) if ( child instanceof TextNode && StringUtils . isNotBlank ( ( ( TextNode ) child ) . getText ( ) ) ) { throw new InvalidInputException ( "Element \"" + this . getMessageMLTag ( ) + "\" may not have text content" ) ; } |
public class ServletRedirectTask { /** * { @ inheritDoc } */
public Formula getFormula ( ) { } } | Reagent [ ] reagents = new Reagent [ ] { RESOURCE , SOURCE } ; final Formula rslt = new SimpleFormula ( ServletRedirectTask . class , reagents ) ; return rslt ; |
public class LdapSpnegoKnownClientSystemsFilterAction { /** * Create and open a connection to ldap
* via the given config and provider .
* @ return the connection
* @ throws LdapException the ldap exception */
protected Connection createConnection ( ) throws LdapException { } } | LOGGER . debug ( "Establishing a connection..." ) ; val connection = this . connectionFactory . getConnection ( ) ; connection . open ( ) ; return connection ; |
public class OptimizerNode { @ Override public Iterator < OptimizerNode > getPredecessors ( ) { } } | List < OptimizerNode > allPredecessors = new ArrayList < OptimizerNode > ( ) ; for ( Iterator < PactConnection > inputs = getIncomingConnections ( ) . iterator ( ) ; inputs . hasNext ( ) ; ) { allPredecessors . add ( inputs . next ( ) . getSource ( ) ) ; } for ( PactConnection conn : getBroadcastConnections ( ) ) { all... |
public class PageFlowActionServlet { /** * Last chance to handle an unhandled action URI .
* @ return < code > true < / code > if this method handled it ( by forwarding somewhere or writing to the response ) . */
protected boolean processUnhandledAction ( HttpServletRequest request , HttpServletResponse response , St... | // First check to see if we ' re already in a forwarded fallback request . If so , just bail .
PageFlowRequestWrapper rw = PageFlowRequestWrapper . get ( request ) ; if ( rw . getOriginalServletPath ( ) != null ) return false ; SharedFlowController sharedFlowToTry = null ; String uriBaseName = ServletUtils . getBaseNam... |
public class Exceptions { /** * Returns a consumer which will unwrap and rethrow any throwables caught in { @ code consumer } .
* @ param consumer the consumer
* @ param < T > the input type
* @ param < E > the exception type
* @ return a consumer */
public static < T , E extends Throwable > @ NonNull Consumer ... | return input -> { try { consumer . throwingAccept ( input ) ; } catch ( final Throwable t ) { throw rethrow ( unwrap ( t ) ) ; } } ; |
public class TableProxy { /** * Update the current record .
* @ param The data to update .
* @ exception Exception File exception . */
public void set ( Object data , int iOpenMode ) throws DBException , RemoteException { } } | BaseTransport transport = this . createProxyTransport ( SET ) ; transport . addParam ( DATA , data ) ; transport . addParam ( OPEN_MODE , iOpenMode ) ; Object strReturn = transport . sendMessageAndGetReply ( ) ; Object objReturn = transport . convertReturnObject ( strReturn ) ; this . checkDBException ( objReturn ) ; |
public class CaseArgumentAnalyser { /** * Returns a list with argument words that are not equal in all cases */
List < List < Word > > getDifferentArguments ( List < List < Word > > argumentWords ) { } } | List < List < Word > > result = Lists . newArrayList ( ) ; for ( int i = 0 ; i < argumentWords . size ( ) ; i ++ ) { result . add ( Lists . < Word > newArrayList ( ) ) ; } int nWords = argumentWords . get ( 0 ) . size ( ) ; for ( int iWord = 0 ; iWord < nWords ; iWord ++ ) { Word wordOfFirstCase = argumentWords . get (... |
public class IfcBSplineCurveWithKnotsImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < Double > getKnots ( ) { } } | return ( EList < Double > ) eGet ( Ifc4Package . Literals . IFC_BSPLINE_CURVE_WITH_KNOTS__KNOTS , true ) ; |
public class ReloadableType { /** * TODO [ perf ] performance sucks as we walk multiple times ! */
public FieldReaderWriter locateField ( String name ) { } } | if ( hasFieldChangedInHierarchy ( name ) ) { return walk ( name , getLatestTypeDescriptor ( ) ) ; } else { return getFieldInHierarchy ( name ) ; } |
public class DefaultTokenManager { /** * Submits a token refresh task
* @ return void */
protected void submitRefreshTask ( ) { } } | TokenRefreshTask tokenRefreshTask = new TokenRefreshTask ( iamEndpoint , this ) ; executor . execute ( tokenRefreshTask ) ; log . debug ( "Submitted token refresh task" ) ; |
public class DOMDifferenceEngine { /** * Dispatches to the node type specific comparison if one is
* defined for the given combination of nodes . */
private ComparisonState nodeTypeSpecificComparison ( Node control , XPathContext controlContext , Node test , XPathContext testContext ) { } } | switch ( control . getNodeType ( ) ) { case Node . CDATA_SECTION_NODE : case Node . COMMENT_NODE : case Node . TEXT_NODE : if ( test instanceof CharacterData ) { return compareCharacterData ( ( CharacterData ) control , controlContext , ( CharacterData ) test , testContext ) ; } break ; case Node . DOCUMENT_NODE : if (... |
public class TextBox { /** * Updates the text content of the { @ code TextBox } to the supplied string .
* @ param text New text to assign to the { @ code TextBox }
* @ return Itself */
public synchronized TextBox setText ( String text ) { } } | String [ ] split = text . split ( "\n" ) ; if ( split . length == 0 ) { split = new String [ ] { "" } ; } lines . clear ( ) ; longestRow = 1 ; for ( String line : split ) { addLine ( line ) ; } if ( caretPosition . getRow ( ) > lines . size ( ) - 1 ) { caretPosition = caretPosition . withRow ( lines . size ( ) - 1 ) ; ... |
public class JsonMappingOption { public JsonMappingOption acceptAnother ( JsonMappingControlMeta another ) { } } | localDateFormatter = another . getLocalDateFormatter ( ) ; localDateFormattingTrigger = another . getLocalDateFormattingTrigger ( ) ; localDateTimeFormatter = another . getLocalDateTimeFormatter ( ) ; localDateTimeFormattingTrigger = another . getLocalDateTimeFormattingTrigger ( ) ; localTimeFormatter = another . getLo... |
public class Message { /** * post parse */
void resolveReferences ( Message root ) { } } | final Proto proto = getProto ( ) ; final String fullName = getFullName ( ) ; for ( Field < ? > f : fields . values ( ) ) { f . owner = this ; if ( f . isRepeated ( ) ) { repeatedFieldCount ++ ; root . repeatedFieldPresent = true ; } else { singularFieldCount ++ ; if ( f . isRequired ( ) ) { requiredFieldCount ++ ; root... |
public class Classfile { /** * Read the class ' interfaces .
* @ throws IOException
* if an I / O exception occurs . */
private void readInterfaces ( ) throws IOException { } } | // Interfaces
final int interfaceCount = inputStreamOrByteBuffer . readUnsignedShort ( ) ; for ( int i = 0 ; i < interfaceCount ; i ++ ) { final String interfaceName = getConstantPoolClassName ( inputStreamOrByteBuffer . readUnsignedShort ( ) ) ; if ( implementedInterfaces == null ) { implementedInterfaces = new ArrayL... |
public class Serializers { /** * Returns the serializer given the index .
* @ param index serializer index
* @ return serializer */
Serializer getSerializer ( int index ) { } } | if ( index >= serializersArray . length ) { throw new IllegalArgumentException ( String . format ( "The serializer can't be found at index %d" , index ) ) ; } return serializersArray [ index ] ; |
public class Discover { /** * Filter the air dates to years that are greater than or equal to this year
* @ param year
* @ return */
public Discover firstAirDateYearGte ( int year ) { } } | if ( checkYear ( year ) ) { params . add ( Param . FIRST_AIR_DATE_GTE , year ) ; } return this ; |
public class DSClientFactory { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . loader . GenericClientFactory # initialize ( java . util . Map ) */
@ Override public void initialize ( Map < String , Object > externalProperty ) { } } | reader = new CassandraEntityReader ( kunderaMetadata ) ; initializePropertyReader ( ) ; setExternalProperties ( externalProperty ) ; configuration = new CassandraHostConfiguration ( externalProperties , CassandraPropertyReader . csmd , getPersistenceUnit ( ) , kunderaMetadata ) ; // initialize timestamp generator .
ini... |
public class PartialResponseChangesTypeImpl { /** * If not already created , a new < code > insert < / code > element will be created and returned .
* Otherwise , the first existing < code > insert < / code > element will be returned .
* @ return the instance defined for the element < code > insert < / code > */
pu... | List < Node > nodeList = childNode . get ( "insert" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new PartialResponseInsertTypeImpl < PartialResponseChangesType < T > > ( this , "insert" , childNode , nodeList . get ( 0 ) ) ; } return createInsert ( ) ; |
public class JoinTypeUtil { /** * Converts { @ link FlinkJoinType } to { @ link JoinRelType } . */
public static JoinRelType toJoinRelType ( FlinkJoinType joinType ) { } } | switch ( joinType ) { case INNER : return JoinRelType . INNER ; case LEFT : return JoinRelType . LEFT ; case RIGHT : return JoinRelType . RIGHT ; case FULL : return JoinRelType . FULL ; default : throw new IllegalArgumentException ( "invalid: " + joinType ) ; } |
public class FeatureSourceRetriever { /** * Set the attributes of a feature .
* @ param feature the feature
* @ param attributes the attributes
* @ throws LayerException oops */
public void setAttributes ( Object feature , Map < String , Attribute > attributes ) throws LayerException { } } | for ( Map . Entry < String , Attribute > entry : attributes . entrySet ( ) ) { String name = entry . getKey ( ) ; if ( ! name . equals ( getGeometryAttributeName ( ) ) ) { asFeature ( feature ) . setAttribute ( name , entry . getValue ( ) ) ; } } |
public class AWSStepFunctionsClient { /** * Describes the state machine associated with a specific execution .
* < note >
* This operation is eventually consistent . The results are best effort and may not reflect very recent updates and
* changes .
* < / note >
* @ param describeStateMachineForExecutionReque... | request = beforeClientExecution ( request ) ; return executeDescribeStateMachineForExecution ( request ) ; |
public class ResourceGroovyMethods { /** * Creates a buffered writer for this file , optionally appending to the
* existing file content .
* @ param file a File
* @ param append true if data should be appended to the file
* @ return a BufferedWriter
* @ throws IOException if an IOException occurs .
* @ sinc... | return new BufferedWriter ( new FileWriter ( file , append ) ) ; |
public class RoundRectangle { /** * Sets the frame and corner dimensions of this rectangle to be equal to those of the supplied
* rectangle . */
public void setRoundRect ( IRoundRectangle rr ) { } } | setRoundRect ( rr . x ( ) , rr . y ( ) , rr . width ( ) , rr . height ( ) , rr . arcWidth ( ) , rr . arcHeight ( ) ) ; |
public class ConcurrentEvictingQueue { /** * Inserts the specified element at the tail of this queue if it is
* possible to do so immediately or if capacity limit is exited
* the oldest element ( the head ) will be evicted , and then the new element added at the tail .
* This method is generally preferable to met... | requireNonNull ( e , ILLEGAL_ELEMENT ) ; Supplier < Boolean > offerElement = ( ) -> { if ( size == 0 ) { ringBuffer [ tailIndex ] = e ; modificationsCount ++ ; size ++ ; } else if ( size == maxSize ) { headIndex = nextIndex ( headIndex ) ; tailIndex = nextIndex ( tailIndex ) ; ringBuffer [ tailIndex ] = e ; modificatio... |
public class AtomDODeserializer { /** * Note : AUDIT datastreams always return false , otherwise defaults to true .
* @ param entry
* @ return */
private boolean getDSVersionable ( DigitalObject obj , Entry entry ) { } } | if ( getDatastreamId ( obj , entry ) . equals ( "AUDIT" ) ) { return false ; } List < Category > versionable = entry . getCategories ( MODEL . VERSIONABLE . uri ) ; if ( versionable . isEmpty ( ) || versionable . size ( ) > 1 ) { return true ; } else { return Boolean . valueOf ( versionable . get ( 0 ) . getTerm ( ) ) ... |
public class KCVSUtil { /** * Retrieves the value for the specified column and key under the given transaction
* from the store if such exists , otherwise returns NULL
* @ param store Store
* @ param key Key
* @ param column Column
* @ param txh Transaction
* @ return Value for key and column or NULL if suc... | KeySliceQuery query = new KeySliceQuery ( key , column , BufferUtil . nextBiggerBuffer ( column ) ) . setLimit ( 2 ) ; List < Entry > result = store . getSlice ( query , txh ) ; if ( result . size ( ) > 1 ) log . warn ( "GET query returned more than 1 result: store {} | key {} | column {}" , new Object [ ] { store . ge... |
public class PriorityQueue { /** * Inserts item x at position k , maintaining heap invariant by promoting x up the tree until it is greater than or equal to its
* parent , or is the root .
* @ param k the position to fill
* @ param x the item to insert */
@ SuppressWarnings ( "unchecked" ) private void siftUp ( i... | while ( k > 0 ) { int parent = ( k - 1 ) >>> 1 ; E e = ( E ) queue [ parent ] ; if ( x . compareTo ( e ) >= 0 ) break ; queue [ k ] = e ; k = parent ; } queue [ k ] = x ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractDatumType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractDatumType } { @ code >... | return new JAXBElement < AbstractDatumType > ( __Datum_QNAME , AbstractDatumType . class , null , value ) ; |
public class JsonResponseWriter { /** * TODO : add custom mapper . . . to override vertx . mapper if desired */
@ Override public void write ( T result , HttpServerRequest request , HttpServerResponse response ) { } } | if ( result != null ) { response . end ( JsonUtils . toJson ( result , io . vertx . core . json . Json . mapper ) ) ; } else { response . end ( ) ; } |
public class Retry { /** * Wrap an { @ link Observable } so that it will retry on all errors . The retry will occur for a maximum number of
* attempts and with a provided { @ link Delay } between each attempt .
* @ param source the { @ link Observable } to wrap .
* @ param maxAttempts the maximum number of times ... | return wrapForRetry ( source , new RetryWithDelayHandler ( maxAttempts , retryDelay ) ) ; |
public class JSONUtils { /** * Converts the object to a JSON string using the mapper */
public static String toJSON ( Object value , ObjectMapper mapper ) { } } | try { return mapper . writeValueAsString ( value ) ; } catch ( IOException ex ) { throw new FacebookException ( ex ) ; } |
public class NuAbstractCharsetHandler { /** * Override this to receive decoded Unicode Java string data read from
* stderr .
* Make sure to set the { @ link CharBuffer # position ( ) position } of
* { @ code buffer } to indicate how much data you have read before returning .
* @ param buffer The { @ link CharBu... | // Consume the entire buffer by default .
buffer . position ( buffer . limit ( ) ) ; |
public class FullTextMapperV2 { /** * Map newly associated / defined classifications for the entity with given GUID
* @ param guid Entity guid
* @ param classifications new classifications added to the entity
* @ return Full text string ONLY for the added classifications
* @ throws AtlasBaseException */
public ... | String ret = null ; AtlasEntityWithExtInfo entityWithExtInfo = getAndCacheEntity ( guid ) ; if ( entityWithExtInfo != null ) { StringBuilder sb = new StringBuilder ( ) ; if ( CollectionUtils . isNotEmpty ( classifications ) ) { for ( AtlasClassification classification : classifications ) { sb . append ( classification ... |
public class Parser { /** * Recursively finds in - clauses and reformats them for the parser */
private String alignINClause ( String in ) { } } | String paramIn = in ; final int indexLowerIn = paramIn . indexOf ( IN_LOWER ) ; final int indexLowerInWithParentheses = paramIn . indexOf ( IN_LOWER_P ) ; final int indexUpperIn = paramIn . indexOf ( IN_UPPER ) ; final int indexUpperInWithParentheses = paramIn . indexOf ( IN_UPPER_P ) ; // find first occurrence of in c... |
public class NumberInRange { /** * Test if a number is in an arbitrary range .
* @ param number
* a number
* @ param min
* lower boundary of the range
* @ param max
* upper boundary of the range
* @ return true if the given number is within the range */
@ ArgumentsChecked @ Throws ( IllegalNullArgumentExc... | Check . notNull ( number , "number" ) ; Check . notNull ( min , "min" ) ; Check . notNull ( max , "max" ) ; BigDecimal bigDecimal = null ; if ( number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long ) { bigDecimal = new BigDecimal ( number . longValue ( ) ) ; } else if ... |
public class MurmurHash3Adaptor { /** * Returns a deterministic uniform random integer between zero ( inclusive ) and
* n ( exclusive ) given the input datum .
* @ param datum the given String .
* @ param n The upper exclusive bound of the integers produced . Must be & gt ; 1.
* @ return deterministic uniform r... | if ( ( datum == null ) || datum . isEmpty ( ) ) { throw new SketchesArgumentException ( "Input is null or empty." ) ; } final byte [ ] data = datum . getBytes ( UTF_8 ) ; return asInteger ( toLongArray ( data ) , n ) ; // data is byte [ ] |
public class Util { /** * This returns well known empty values for well - known java types . This returns null for types not
* in the following list .
* < ul >
* < li > { @ code [ Bb ] oolean } < / li >
* < li > { @ code byte [ ] } < / li >
* < li > { @ code Collection } < / li >
* < li > { @ code Iterator ... | return EMPTIES . getOrDefault ( Types . getRawType ( type ) , ( ) -> null ) . get ( ) ; |
public class ReplacingAttributeAdder { /** * / * ( non - Javadoc )
* @ see org . jasig . services . persondir . support . merger . BaseAdditiveAttributeMerger # mergePersonAttributes ( java . util . Map , java . util . Map ) */
@ Override protected Map < String , List < Object > > mergePersonAttributes ( final Map < ... | Validate . notNull ( toModify , "toModify cannot be null" ) ; Validate . notNull ( toConsider , "toConsider cannot be null" ) ; toModify . putAll ( toConsider ) ; return toModify ; |
public class ModelGenerator { /** * Instrospects the provided class , creates a model object ( JS code ) and writes it
* into the response . Creates compressed JS code . Method ignores any validation
* annotations .
* @ param request the http servlet request
* @ param response the http servlet response
* @ pa... | writeModel ( request , response , clazz , format , IncludeValidation . NONE , false ) ; |
public class CSSMediaRuleImpl { /** * { @ inheritDoc } */
@ Override public void setCssText ( final String cssText ) throws DOMException { } } | try { final CSSOMParser parser = new CSSOMParser ( ) ; final AbstractCSSRuleImpl r = parser . parseRule ( cssText ) ; // The rule must be a media rule
if ( r instanceof CSSMediaRuleImpl ) { mediaList_ = ( ( CSSMediaRuleImpl ) r ) . mediaList_ ; cssRules_ = ( ( CSSMediaRuleImpl ) r ) . cssRules_ ; } else { throw new DOM... |
public class AtomicDouble { /** * Add { @ code amount } to the value and return the new value . */
public double addAndGet ( double amount ) { } } | long v ; double d ; double n ; long next ; do { v = value . get ( ) ; d = Double . longBitsToDouble ( v ) ; n = d + amount ; next = Double . doubleToLongBits ( n ) ; } while ( ! value . compareAndSet ( v , next ) ) ; return n ; |
public class AsyncAtlasInfo { /** * This method is a sync parse to the JSON stream of atlas information .
* @ return List of atlas information . */
public static List < GVRAtlasInformation > loadAtlasInformation ( InputStream ins ) { } } | try { int size = ins . available ( ) ; byte [ ] buffer = new byte [ size ] ; ins . read ( buffer ) ; return loadAtlasInformation ( new JSONArray ( new String ( buffer , "UTF-8" ) ) ) ; } catch ( JSONException je ) { je . printStackTrace ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } return null ; |
public class FindingReplacing { /** * Sets the substring in given left index and right index as the delegate string
* < p > < b > The look result same as { @ link StrMatcher # finder ( ) } ' s behavior < / b >
* @ see StrMatcher # finder ( )
* @ param leftIndex
* @ param rightIndex
* @ return */
public Negate... | return new NegateMultiPos < S , Integer , Integer > ( leftIndex , rightIndex ) { @ Override protected S result ( ) { return delegateQueue ( 'I' , left , right , pos , position , null , plusminus , filltgt ) ; } } ; |
public class Classification { /** * Getter method for the instance variable { @ link # multipleSelect } .
* @ return value of instance variable { @ link # multipleSelect }
* @ throws CacheReloadException on error */
public boolean isMultipleSelect ( ) throws CacheReloadException { } } | final boolean ret ; if ( isRoot ( ) ) { ret = this . multipleSelect ; } else { ret = getParentClassification ( ) . isMultipleSelect ( ) ; } return ret ; |
public class MulitServiceThriftConnecion { /** * 创建原始连接的方法
* @ throws ThriftConnectionPoolException
* 创建连接出现问题时抛出该异常 */
@ SuppressWarnings ( "unchecked" ) private void createConnection ( ) throws ThriftConnectionPoolException { } } | try { transport = new TSocket ( host , port , connectionTimeOut ) ; transport . open ( ) ; TProtocol protocol = createTProtocol ( transport ) ; Iterator < Entry < String , Class < ? extends TServiceClient > > > iterator = thriftClientClasses . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Entry < Str... |
public class YCbCr2RGBColorConvertor { /** * ( non - Javadoc )
* @ see com . alibaba . simpleimage . codec . util . ColorConvertor # convert ( int [ ] , int ) */
@ Override public long convert ( int [ ] input , int inPos ) { } } | int Y = input [ inPos ++ ] & 0xFF ; int Cb = input [ inPos ++ ] & 0xFF ; int Cr = input [ inPos ] & 0xFF ; byte r = ( byte ) sampleRangeLimitTable [ sampleRangeLimitOffset + Y + Cr2R [ Cr ] ] ; byte g = ( byte ) sampleRangeLimitTable [ sampleRangeLimitOffset + Y + ( ( Cb2G [ Cb ] + Cr2G [ Cr ] ) >> 16 ) ] ; byte b = ( ... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcDoorPanelProperties ( ) { } } | if ( ifcDoorPanelPropertiesEClass == null ) { ifcDoorPanelPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 194 ) ; } return ifcDoorPanelPropertiesEClass ; |
public class GenerationalDistance { /** * Returns the generational distance value for a given front
* @ param front The front
* @ param referenceFront The reference pareto front */
public double generationalDistance ( Front front , Front referenceFront ) { } } | double sum = 0.0 ; for ( int i = 0 ; i < front . getNumberOfPoints ( ) ; i ++ ) { sum += Math . pow ( FrontUtils . distanceToClosestPoint ( front . getPoint ( i ) , referenceFront ) , pow ) ; } sum = Math . pow ( sum , 1.0 / pow ) ; return sum / front . getNumberOfPoints ( ) ; |
public class HeapCache { /** * Execute job while making sure that no other operations are going on .
* In case the eviction is connected via a queue we need to stop the queue processing .
* On the other hand we needs to make sure that the queue is drained because this
* method is used to access the recent statist... | synchronized ( lock ) { if ( _checkClosed ) { checkClosed ( ) ; } eviction . stop ( ) ; try { T _result = hash . runTotalLocked ( new Job < T > ( ) { @ Override public T call ( ) { if ( _checkClosed ) { checkClosed ( ) ; } boolean f = eviction . drain ( ) ; if ( f ) { return ( T ) RESTART_AFTER_EVICTION ; } return evic... |
public class Annotations { /** * Attach @ Activation
* @ param annotation The activation annotation
* @ param classLoader The class loader
* @ param configProperties The config properties
* @ param plainConfigProperties The plain config properties
* @ return The updated metadata
* @ exception Exception Thro... | ArrayList < ConfigProperty > validProperties = new ArrayList < ConfigProperty > ( ) ; ArrayList < RequiredConfigProperty > requiredConfigProperties = null ; if ( configProperties != null ) { for ( ConfigProperty configProperty : configProperties ) { if ( annotation . getClassName ( ) . equals ( ( ( ConfigPropertyImpl )... |
public class PortletAdministrationHelper { /** * Add to the form SUBSCRIBE , BROWSE , and CONFIGURE activity permissions , along with their principals ,
* assigned to the portlet . */
private void addPrincipalPermissionsToForm ( IPortletDefinition def , PortletDefinitionForm form ) { } } | final String portletTargetId = PermissionHelper . permissionTargetIdForPortletDefinition ( def ) ; final Set < JsonEntityBean > principalBeans = new HashSet < > ( ) ; Map < String , IPermissionManager > permManagers = new HashMap < > ( ) ; for ( PortletPermissionsOnForm perm : PortletPermissionsOnForm . values ( ) ) { ... |
public class BlockingThreadPoolExecutorService { /** * A thread pool that that blocks clients submitting additional tasks if
* there are already { @ code activeTasks } running threads and { @ code
* waitingTasks } tasks waiting in its queue .
* @ param activeTasks maximum number of active tasks
* @ param waitin... | /* Although we generally only expect up to waitingTasks tasks in the
queue , we need to be able to buffer all tasks in case dequeueing is
slower than enqueueing . */
final BlockingQueue < Runnable > workQueue = new LinkedBlockingQueue < > ( waitingTasks + activeTasks ) ; ThreadPoolExecutor eventProcessingExecutor =... |
public class Hierarchy { /** * Determine if method whose name and signature is specified is a monitor
* wait operation .
* @ param methodName
* name of the method
* @ param methodSig
* signature of the method
* @ return true if the method is a monitor wait , false if not */
public static boolean isMonitorWa... | return "wait" . equals ( methodName ) && ( "()V" . equals ( methodSig ) || "(J)V" . equals ( methodSig ) || "(JI)V" . equals ( methodSig ) ) ; |
public class OsLoginServiceClient { /** * Retrieves an SSH public key .
* < p > Sample code :
* < pre > < code >
* try ( OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient . create ( ) ) {
* FingerprintName name = FingerprintName . of ( " [ USER ] " , " [ FINGERPRINT ] " ) ;
* SshPublicKey respo... | GetSshPublicKeyRequest request = GetSshPublicKeyRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getSshPublicKey ( request ) ; |
public class IdentityHashMapJsonDeserializer { /** * < p > newInstance < / p >
* @ param keyDeserializer { @ link KeyDeserializer } used to deserialize the keys .
* @ param valueDeserializer { @ link JsonDeserializer } used to deserialize the values .
* @ param < K > Type of the keys inside the { @ link IdentityH... | return new IdentityHashMapJsonDeserializer < K , V > ( keyDeserializer , valueDeserializer ) ; |
public class PathFinderImpl { /** * Update the open and closed list to find the path .
* @ param mover The entity that will be moving along the path .
* @ param stx The x coordinate of the start location .
* @ param sty The y coordinate of the start location .
* @ param dtx The x coordinate of the destination l... | int depth = maxDepth ; final Tile tile = map . getTile ( current . getX ( ) , current . getY ( ) ) ; final TilePath tilePath = tile . getFeature ( TilePath . class ) ; for ( int y = - 1 ; y < 2 ; y ++ ) { for ( int x = - 1 ; x < 2 ; x ++ ) { if ( ! ( x == 0 && y == 0 ) ) { depth = check ( tilePath , depth , x , y , mov... |
public class WebbUtils { /** * Read an < code > InputStream < / code > into < code > byte [ ] < / code > until EOF .
* < br >
* Does not close the InputStream !
* @ param is the stream to read the bytes from
* @ return all read bytes as an array
* @ throws IOException when read or write operation fails */
pub... | if ( is == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; copyStream ( is , baos ) ; return baos . toByteArray ( ) ; |
public class TextToSpeechWebSocketListener { /** * ( non - Javadoc )
* @ see okhttp3 . WebSocketListener # onOpen ( okhttp3 . WebSocket , okhttp3 . Response ) */
@ Override public void onOpen ( final WebSocket webSocket , Response response ) { } } | callback . onConnected ( ) ; this . socket = webSocket ; if ( ! this . socket . send ( buildStartMessage ( this . options ) ) ) { callback . onError ( new IOException ( "WebSocket unavailable" ) ) ; } else { new Thread ( TEXT_TO_WEB_SOCKET ) { @ Override public void run ( ) { sendText ( ) ; if ( socketOpen && ! socket ... |
public class TextRetinaApiImpl { /** * { @ inheritDoc } */
@ Override public List < String > getTokens ( String text , PosTag [ ] posTags ) throws ApiException { } } | if ( isEmpty ( text ) ) { throw new IllegalArgumentException ( NULL_TEXT_MSG ) ; } LOG . debug ( "Retrieve tokens for the text: " + text ) ; return this . api . getTokensForText ( text , cluePosTags ( posTags ) , retinaName ) ; |
public class BrokerSession { /** * Request authentication from the server .
* @ param username User name .
* @ param password Password .
* @ param division Login division ( may be null ) .
* @ return Result of authentication . */
public AuthResult authenticate ( String username , String password , String divisi... | ensureConnection ( ) ; if ( isAuthenticated ( ) ) { return new AuthResult ( "0" ) ; } String av = username + ";" + password ; List < String > results = callRPCList ( "RGNETBRP AUTH:" + Constants . VERSION , null , connectionParams . getAppid ( ) , getLocalName ( ) , "" , // This is the pre - authentication token
";" . ... |
public class SessionDataManager { /** * Merges incoming property data with changes stored in this log i . e : 1 . incoming data still not modified
* if there are no corresponding changes 2 . incoming data is refreshed with corresponding changes
* if any 3 . new datas is added from changes 4 . if chaged data is mark... | // 1 get all transient descendants
Collection < ItemState > transientDescendants = changesLog . getLastChildrenStates ( rootData , false ) ; if ( ! transientDescendants . isEmpty ( ) ) { // 2 get ALL persisted descendants
Map < String , ItemData > descendants = new LinkedHashMap < String , ItemData > ( ) ; traverseStor... |
public class ResourceIndexImpl { /** * { @ inheritDoc } */
public int countTriples ( String queryLang , String tupleQuery , String tripleTemplate , int limit , boolean distinct ) throws TrippiException { } } | return _writer . countTriples ( queryLang , tupleQuery , tripleTemplate , limit , distinct ) ; |
public class FullDemo { /** * getConstraints , This returns a grid bag constraints object that can be used for placing a
* component appropriately into a grid bag layout . */
private static GridBagConstraints getConstraints ( int gridx , int gridy , int gridwidth ) { } } | GridBagConstraints gc = new GridBagConstraints ( ) ; gc . fill = GridBagConstraints . NONE ; gc . anchor = GridBagConstraints . WEST ; gc . gridx = gridx ; gc . gridy = gridy ; gc . gridwidth = gridwidth ; return gc ; |
public class CPDefinitionOptionValueRelPersistenceImpl { /** * Removes all the cp definition option value rels where uuid = & # 63 ; from the database .
* @ param uuid the uuid */
@ Override public void removeByUuid ( String uuid ) { } } | for ( CPDefinitionOptionValueRel cpDefinitionOptionValueRel : findByUuid ( uuid , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinitionOptionValueRel ) ; } |
public class TorqueDBHandling { /** * Creates the db - creation sql script ( but does not perform it ) .
* @ throws PlatformException If some error occurred */
public void createCreationScript ( ) throws PlatformException { } } | Project project = new Project ( ) ; TorqueDataModelTask modelTask = new TorqueDataModelTask ( ) ; File tmpDir = null ; File scriptFile = null ; _creationScript = null ; try { tmpDir = new File ( getWorkDir ( ) , "schemas" ) ; tmpDir . mkdir ( ) ; String includes = writeSchemata ( tmpDir ) ; scriptFile = new File ( tmpD... |
public class BillingStateCalculator { /** * Package scope for testing */
Invoice earliest ( final SortedSet < Invoice > unpaidInvoices ) { } } | try { return unpaidInvoices . first ( ) ; } catch ( NoSuchElementException e ) { return null ; } |
public class ScrollSpy { /** * Attaches ScrollSpy to specified object with specified target element .
* @ param spyOn Spy on this object
* @ param target Target element having an ID
* @ return ScrollSpy */
public static ScrollSpy scrollSpy ( final UIObject spyOn , final HasId target ) { } } | return new ScrollSpy ( spyOn . getElement ( ) , target ) ; |
public class CmsDefaultPageEditor { /** * Performs the preview page action in a new browser window . < p >
* @ throws IOException if redirect fails
* @ throws JspException if inclusion of error page fails */
public void actionPreview ( ) throws IOException , JspException { } } | try { // save content of the editor to the temporary file
performSaveContent ( getParamElementname ( ) , getElementLocale ( ) ) ; } catch ( CmsException e ) { // show error page
showErrorPage ( this , e ) ; } // redirect to the temporary file with current active element language
String param = "?" + org . opencms . i18... |
public class StoreUtils { /** * Implements get by delegating to getAll . */
public static < K , V , T > List < Versioned < V > > get ( Store < K , V , T > storageEngine , K key , T transform ) { } } | Map < K , List < Versioned < V > > > result = storageEngine . getAll ( Collections . singleton ( key ) , Collections . singletonMap ( key , transform ) ) ; if ( result . size ( ) > 0 ) return result . get ( key ) ; else return Collections . emptyList ( ) ; |
public class ErrorReporterImpl { /** * { @ inheritDoc } */
@ Override public String putCustomData ( @ NonNull String key , @ Nullable String value ) { } } | return customData . put ( key , value ) ; |
public class ListAuditTasksRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListAuditTasksRequest listAuditTasksRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listAuditTasksRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listAuditTasksRequest . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( listAuditTasksRequest . getEndTime ( ) , ENDTIME_BINDING ) ; proto... |
public class OptimizeParameters { /** * Adjust the provided Parameter objects value created by # findFixedArguments for " rest " value
* and side - effects which might prevent the motion of the parameters from the call sites to the
* function body .
* @ param parameters A list of Parameter objects summarizing all... | JSDocInfo info = NodeUtil . getBestJSDocInfo ( fn ) ; if ( info != null && info . isNoInline ( ) ) { return false ; } Node paramList = NodeUtil . getFunctionParameters ( fn ) ; Node lastFormal = paramList . getLastChild ( ) ; int restIndex = Integer . MAX_VALUE ; int lastNonRestFormal = paramList . getChildCount ( ) - ... |
public class SnapshotCommand { /** * { @ inheritDoc } */
@ Override protected void perform ( Wave wave ) throws CommandException { } } | final SnapshotWaveBean wb = waveBean ( wave ) ; WritableImage image = wb . image ( ) ; if ( wb . node ( ) == null ) { final Scene scene = localFacade ( ) . globalFacade ( ) . application ( ) . scene ( ) ; image = scene . snapshot ( image ) ; } else { image = wb . node ( ) . snapshot ( wb . parameters ( ) , image ) ; } ... |
public class PubSubRealization { /** * Attaches to a created DurableSubscription
* Checks that there are no active subscriptions ( unless it supports cloning )
* Checks that the durable subscription exists :
* @ param consumerPoint */
public ConsumableKey attachToDurableSubscription ( LocalConsumerPoint consumerP... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachToDurableSubscription" , new Object [ ] { consumerPoint , subState } ) ; // Extract the UUID for the durable home and see whether this is a local
// or remote attach
ConsumableKey result = null ; SIBUuid8 durableHomeI... |
public class CreateApplicationVersionResult { /** * A list of values that you must specify before you can deploy certain applications . Some applications might
* include resources that can affect permissions in your AWS account , for example , by creating new AWS Identity and
* Access Management ( IAM ) users . For... | if ( requiredCapabilities == null ) { this . requiredCapabilities = null ; return ; } this . requiredCapabilities = new java . util . ArrayList < String > ( requiredCapabilities ) ; |
public class AppendDataPoints { /** * Parses a column from storage , orders and drops newer duplicate data points .
* The parsing will return both a Cell collection for debugging and add
* the cells to concatenated qualifier and value arrays in the compacted data
* point format so that the results can be merged w... | if ( kv . qualifier ( ) . length != 3 || kv . qualifier ( ) [ 0 ] != APPEND_COLUMN_PREFIX ) { // it ' s really not an issue if the offset is not 0 , maybe in the future
// we ' ll support appends at different offsets .
throw new IllegalArgumentException ( "Can not parse cell, it is not " + " an appended cell. It has a ... |
public class DockerRule { /** * Stop and wait till given string will show in container output .
* @ param logSearchString String to wait for in container output .
* @ param waitTime Wait time .
* @ throws TimeoutException On wait timeout . */
public void waitForLogMessage ( final String logSearchString , int wait... | WaitForContainer . waitForCondition ( new LogChecker ( this , logSearchString ) , waitTime , describe ( ) ) ; |
public class SpiderParam { /** * Sets the maximum depth the spider can crawl .
* Value { @ value # UNLIMITED _ DEPTH } for unlimited depth .
* @ param maxDepth the new maximum depth .
* @ see # getMaxDepth ( ) */
public void setMaxDepth ( int maxDepth ) { } } | this . maxDepth = maxDepth > UNLIMITED_DEPTH ? maxDepth : UNLIMITED_DEPTH ; getConfig ( ) . setProperty ( SPIDER_MAX_DEPTH , Integer . toString ( this . maxDepth ) ) ; |
public class CrLfDecodingState { /** * { @ inheritDoc } */
public DecodingState decode ( IoBuffer in , ProtocolDecoderOutput out ) throws Exception { } } | boolean found = false ; boolean finished = false ; while ( in . hasRemaining ( ) ) { byte b = in . get ( ) ; if ( ! hasCR ) { if ( b == CR ) { hasCR = true ; } else { if ( b == LF ) { found = true ; } else { in . position ( in . position ( ) - 1 ) ; found = false ; } finished = true ; break ; } } else { if ( b == LF ) ... |
public class ViewPositionAnimator { /** * Updates initial view in case it was changed . You should not call this method if view stays
* the same since animator should automatically detect view position changes .
* @ param from New ' from ' view */
public void update ( @ NonNull View from ) { } } | if ( GestureDebug . isDebugAnimator ( ) ) { Log . d ( TAG , "Updating view" ) ; } updateInternal ( from ) ; |
public class SimpleHTTPClient { /** * Create a RequestBuilder with HTTP method and URL .
* @ param method HTTP method .
* @ param url The request URL .
* @ return A new RequestBuilder that helps you to build an HTTP request . */
public RequestBuilder request ( HttpMethod method , String url ) { } } | return request ( method . asString ( ) , url ) ; |
public class CPMeasurementUnitLocalServiceBaseImpl { /** * Returns the cp measurement unit matching the UUID and group .
* @ param uuid the cp measurement unit ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp measurement unit , or < code > null < / code > if a matching cp measure... | return cpMeasurementUnitPersistence . fetchByUUID_G ( uuid , groupId ) ; |
public class ExceptionSoftener { /** * Soften a CheckedIntFunction that can throw Checked Exceptions to a standard IntFunction that can also throw Checked Exceptions ( without declaring them )
* e . g .
* < pre >
* { @ code
* int loaded = ExceptionSoftener . softenFunction ( this : : load ) . applyHKT ( id ) ; ... | return t -> { try { return fn . apply ( t ) ; } catch ( final Throwable e ) { throw throwSoftenedException ( e ) ; } } ; |
public class SimpleMatrix { /** * Creates a new SimpleMatrix with the specified DMatrixRMaj used as its internal matrix . This means
* that the reference is saved and calls made to the returned SimpleMatrix will modify the passed in DMatrixRMaj .
* @ param internalMat The internal DMatrixRMaj of the returned Simple... | SimpleMatrix ret = new SimpleMatrix ( ) ; ret . setMatrix ( internalMat ) ; return ret ; |
public class ContentExtractor { /** * / * 输入Jsoup的Document , 获取正文所在Element */
public static Element getContentElementByDoc ( Document doc ) throws Exception { } } | ContentExtractor ce = new ContentExtractor ( doc ) ; return ce . getContentElement ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.