signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CoNLLSentence { /** * 找出所有子节点 * @ param word * @ return */ public List < CoNLLWord > findChildren ( CoNLLWord word ) { } }
List < CoNLLWord > result = new LinkedList < CoNLLWord > ( ) ; for ( CoNLLWord other : this ) { if ( other . HEAD == word ) result . add ( other ) ; } return result ;
public class Logger { /** * Log an info message . */ public void info ( String format , Object ... extra ) { } }
if ( shouldLog ( INFO ) ) { Log . i ( tag , String . format ( format , extra ) ) ; }
public class LambdaDslObject { /** * Attribute that must match the given timestamp format * @ param name attribute name * @ param format timestamp format */ public LambdaDslObject timestamp ( String name , String format ) { } }
object . timestamp ( name , format ) ; return this ;
public class HELM1Utils { /** * method to transform the fourth section into HELM1 - Format * @ param annotations List of AnnotationNotation * @ return the fourth section of an Standard HELM */ private static String setStandardHELMFourthSection ( List < AnnotationNotation > annotations ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( AnnotationNotation annotation : annotations ) { sb . append ( annotation . toHELM2 ( ) + "|" ) ; } if ( sb . length ( ) > 1 ) { sb . setLength ( sb . length ( ) - 1 ) ; } return sb . toString ( ) ;
public class Interval { /** * Find the gap between two intervals . * @ param that interval * @ return the interval between this and that or { @ link Interval # NULL } if * none exists * @ see # ahead ( ) * @ see # behind ( ) * @ see # intersect ( org . nmdp . ngs . fca . Interval ) * @ see < a href = " ht...
if ( this . before ( that ) ) { return this . ahead ( ) . intersect ( that . behind ( ) ) ; } if ( this . after ( that ) ) { return this . behind ( ) . intersect ( that . ahead ( ) ) ; } return NULL ;
public class JFIFHeaderReader { /** * ( non - Javadoc ) * @ see * com . alibaba . simpleimage . jpeg . ExtendImageHeaderReader # readProperties ( com . alibaba . simpleimage . jpeg . ImageInputStream * , com . alibaba . simpleimage . jpeg . ExtendImageHeader ) */ public void readProperties ( ImageInputStream in ,...
int numToRead = 0 ; // get the interesting part of the marker data if ( len >= 14 ) { numToRead = 14 ; } else if ( len > 0 ) { numToRead = len ; } else { numToRead = 0 ; } byte [ ] datas = new byte [ numToRead ] ; in . read ( datas ) ; len -= numToRead ; if ( numToRead >= 14 && datas [ 0 ] == 0x4A && datas [ 1 ] == 0x4...
public class Validate { /** * < p > Validate that the stateful condition is { @ code true } ; otherwise * throwing an exception with the specified message . This method is useful when * validating according to an arbitrary boolean expression , such as validating a * primitive number or using your own custom valid...
if ( ! expression ) { throw new IllegalStateException ( StringUtils . simpleFormat ( message , values ) ) ; }
public class CoalesceVariableNames { /** * Because the code has already been normalized by the time this pass runs , we can safely * redeclare any let and const coalesced variables as vars */ private static void makeDeclarationVar ( Var coalescedName ) { } }
if ( coalescedName . isLet ( ) || coalescedName . isConst ( ) ) { Node declNode = NodeUtil . getEnclosingNode ( coalescedName . getParentNode ( ) , NodeUtil :: isNameDeclaration ) ; declNode . setToken ( Token . VAR ) ; }
public class CircuitGroupUnblockingAckMessageImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageImpl # decodeMandatoryParameters ( byte [ ] , int ) */ protected int decodeMandatoryParameters ( ISUPParameterFactory parameterFactory , byte [ ] b , int index ) throws ParameterExc...
int localIndex = index ; index += super . decodeMandatoryParameters ( parameterFactory , b , index ) ; if ( b . length - index > 1 ) { CircuitGroupSuperVisionMessageType cgsvmt = parameterFactory . createCircuitGroupSuperVisionMessageType ( ) ; ( ( AbstractISUPParameter ) cgsvmt ) . decode ( new byte [ ] { b [ index ] ...
public class CoreOptions { /** * Creates a composite option of { @ link ProvisionOption } s . This is handy when bundles are built * on the fly via TinyBundles . * @ param streams * provision sources * @ return composite option of provision options * @ throws IllegalArgumentException * - If a problem occure...
validateNotNull ( streams , "streams" ) ; final UrlProvisionOption [ ] options = new UrlProvisionOption [ streams . length ] ; int i = 0 ; for ( InputStream stream : streams ) { options [ i ++ ] = streamBundle ( stream ) ; } return provision ( options ) ;
public class AmazonRedshiftClient { /** * Creates a new cluster from a snapshot . By default , Amazon Redshift creates the resulting cluster with the same * configuration as the original cluster from which the snapshot was created , except that the new cluster is created * with the default cluster security and para...
request = beforeClientExecution ( request ) ; return executeRestoreFromClusterSnapshot ( request ) ;
public class GeocodeResultBuilder { /** * Create a GeocodingResult from a GeoServiceGeocodingResult . * @ param gsResult the GeoServiceGeocodingResult * @ return the GeocodingResult */ public GeocodingResult toGeocodingResult ( final GeoServiceGeocodingResult gsResult ) { } }
if ( gsResult == null ) { return null ; } final GeocodingResult result = new GeocodingResult ( ) ; final AddressComponent [ ] addressComponents = gsResult . getAddressComponents ( ) ; if ( addressComponents == null ) { result . addressComponents = null ; } else { result . addressComponents = new AddressComponent [ addr...
public class DateTime { /** * Parses an RFC3339 date / time value . * < p > Upgrade warning : in prior version 1.17 , this method required milliseconds to be exactly 3 * digits ( if included ) , and did not throw an exception for all types of invalid input values , but * starting in version 1.18 , the parsing don...
Matcher matcher = RFC3339_PATTERN . matcher ( str ) ; if ( ! matcher . matches ( ) ) { throw new NumberFormatException ( "Invalid date/time format: " + str ) ; } int year = Integer . parseInt ( matcher . group ( 1 ) ) ; // yyyy int month = Integer . parseInt ( matcher . group ( 2 ) ) - 1 ; // MM int day = Integer . par...
public class AccountsInner { /** * Deletes the specified firewall rule from the specified Data Lake Store account . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account . * @ param accountName The name of the Data Lake Store account from which to delete the fire...
return deleteFirewallRuleWithServiceResponseAsync ( resourceGroupName , accountName , firewallRuleName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class WikisApi { /** * Get a single page of project wiki . * < pre > < code > GitLab Endpoint : GET / projects / : id / wikis / : slug < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param slug the slug of the project '...
Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "wikis" , slug ) ; return ( response . readEntity ( WikiPage . class ) ) ;
public class ApiOvhIp { /** * IDs of rules configured for this IP * REST : GET / ip / { ip } / game / { ipOnGame } / rule * @ param ip [ required ] * @ param ipOnGame [ required ] */ public ArrayList < Long > ip_game_ipOnGame_rule_GET ( String ip , String ipOnGame ) throws IOException { } }
String qPath = "/ip/{ip}/game/{ipOnGame}/rule" ; StringBuilder sb = path ( qPath , ip , ipOnGame ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ;
public class MockFactory { /** * Creates and fills a List object . * If defined as interface , creates an { @ link java . util . ArrayList } . * @ param type Type of List . * @ return List object */ @ SuppressWarnings ( "unchecked" ) // types must agree private static List createListObject ( ParameterizedType typ...
Class rawType = ( Class ) type . getRawType ( ) ; Type [ ] genericTypes = type . getActualTypeArguments ( ) ; List listObject ; if ( rawType . isInterface ( ) ) { listObject = new ArrayList ( MOCK_LIST_COUNT ) ; } else { listObject = ( List ) instantiateObject ( rawType ) ; } for ( int i = 0 ; i < MOCK_LIST_COUNT ; i +...
public class UriEditPanel { /** * This method is called from within the constructor to initialize the form . * WARNING : Do NOT modify this code . The content of this method is always * regenerated by the Form Editor . */ @ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collapsed " desc = " Ge...
java . awt . GridBagConstraints gridBagConstraints ; labelBrowseCurrentLink = new javax . swing . JLabel ( ) ; textFieldURI = new javax . swing . JTextField ( ) ; labelValidator = new javax . swing . JLabel ( ) ; butonReset = new javax . swing . JButton ( ) ; setBorder ( javax . swing . BorderFactory . createEmptyBorde...
public class BitMaskUtil { /** * Check if the bit is set to ' 1' * @ param value integer to check bit * @ param number of bit to check ( right first bit starting at 1) */ public static boolean isBitOn ( int value , int bitNumber ) { } }
ensureBitRange ( bitNumber ) ; return ( ( value & MASKS [ bitNumber - 1 ] ) == MASKS [ bitNumber - 1 ] ) ;
public class KeyStoreServiceImpl { /** * { @ inheritDoc } */ @ Override public Certificate getCertificateFromKeyStore ( String keyStoreName , String alias ) throws KeyStoreException , CertificateException { } }
try { KeyStore ks = ksMgr . getJavaKeyStore ( keyStoreName ) ; if ( ks == null ) { throw new KeyStoreException ( "The keystore [" + keyStoreName + "] is not present in the configuration" ) ; } else { if ( ! ks . isCertificateEntry ( alias ) && ! ks . isKeyEntry ( alias ) ) { throw new CertificateException ( "The alias ...
public class QueryLexer { /** * $ ANTLR start " INT " */ public final void mINT ( ) throws RecognitionException { } }
try { int _type = INT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / riemann / Query . g : 88:5 : ( ( ' - ' ) ? ( ' 0 ' . . ' 9 ' ) + ) // src / riemann / Query . g : 88:7 : ( ' - ' ) ? ( ' 0 ' . . ' 9 ' ) + { // src / riemann / Query . g : 88:7 : ( ' - ' ) ? int alt2 = 2 ; int LA2_0 = input . LA ( 1 ) ; if ( ( LA2_...
public class Date { /** * setter for year - sets full year ( e . g . 2006 and NOT 06 ) , C * @ generated * @ param v value to set into the feature */ public void setYear ( int v ) { } }
if ( Date_Type . featOkTst && ( ( Date_Type ) jcasType ) . casFeat_year == null ) jcasType . jcas . throwFeatMissing ( "year" , "de.julielab.jules.types.Date" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( Date_Type ) jcasType ) . casFeatCode_year , v ) ;
public class TransformerImpl { /** * Subroutine of simplifyTree to handle NE nodes */ private static Selector simplifyNE ( Selector sel0 , Selector sel1 ) { } }
if ( sel0 . getType ( ) == Selector . BOOLEAN ) return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyNOT ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyTree ( sel1 ) ) ) ; else if ( sel0 . getType ( ) == Selector . STRING || sel0 . getType ( ) == Selector . UNKNOWN ) return new OperatorImpl ( Selector . NE ...
public class WebLocatorAbstractBuilder { /** * < p > < b > Used for finding element process ( to generate xpath address ) < / b > < / p > * @ param root If the path starts with / / then all elements in the document which fulfill following criteria are selected . eg . / / or / * @ param < T > the element which calls...
pathBuilder . setRoot ( root ) ; return ( T ) this ;
public class Dao { /** * Update rows * @ param table The table to update * @ param values The values to update * @ param whereClause The where clause * @ param whereArgs The where clause arguments * @ return An < b > deferred < / b > observable containing the number of rows that have been changed by this upda...
return Observable . defer ( new Func0 < Observable < Integer > > ( ) { @ Override public Observable < Integer > call ( ) { return Observable . just ( db . update ( table , values , whereClause , whereArgs ) ) ; } } ) ;
public class CoreAsync { /** * Perform collection for stream collector . * @ param stages stages to apply to collector * @ param consumer consumer to apply * @ param supplier supplier to provide result * @ param < T > source type * @ param < U > target type */ < T , U > Stage < U > doStreamCollect ( final Col...
final Completable < U > target = completable ( ) ; final StreamCollectHelper < ? super T , ? extends U > done = new StreamCollectHelper < > ( caller , stages . size ( ) , consumer , supplier , target ) ; for ( final Stage < ? extends T > q : stages ) { q . handle ( done ) ; } bindSignals ( target , stages ) ; return ta...
public class SegmentManager { /** * Loads all segments from disk . * @ return A collection of segments for the log . */ protected Collection < Segment > loadSegments ( ) { } }
// Ensure log directories are created . storage . directory ( ) . mkdirs ( ) ; TreeMap < Long , Segment > segments = new TreeMap < > ( ) ; // Iterate through all files in the log directory . for ( File file : storage . directory ( ) . listFiles ( File :: isFile ) ) { // If the file looks like a segment file , attempt t...
public class SimpleNameListItemRenderer { /** * { @ inheritDoc } */ @ Override public final StringBuilder renderAsListItem ( final StringBuilder builder , final boolean newLine , final int pad ) { } }
if ( pad > 0 ) { return builder ; } GedRenderer . renderNewLine ( builder , newLine ) ; builder . append ( simpleNameRenderer . renderAsPhrase ( ) ) ; return builder ;
public class CmsGalleryService { /** * Creates the sitemap entry bean for a resource . < p > * @ param cms the current CMS context * @ param resource the resource for which the sitemap entry bean should be created * @ return the created sitemap entry bean * @ throws CmsException if something goes wrong */ CmsSi...
cms = OpenCms . initCmsObject ( cms ) ; cms . getRequestContext ( ) . setSiteRoot ( "" ) ; CmsJspNavBuilder navBuilder = new CmsJspNavBuilder ( cms ) ; CmsJspNavElement entry = navBuilder . getNavigationForResource ( resource . getRootPath ( ) ) ; if ( entry == null ) { // may be null for expired resources return null ...
public class ConcurrentSparqlGraphStoreManager { /** * Add statements to a named model * @ param graphUri * @ param data */ @ Override public void addModelToGraph ( URI graphUri , Model data ) { } }
if ( graphUri == null || data == null ) return ; // Use HTTP protocol if possible if ( this . sparqlServiceEndpoint != null ) { datasetAccessor . add ( graphUri . toASCIIString ( ) , data ) ; } else { this . addModelToGraphSparqlQuery ( graphUri , data ) ; }
public class DataSetBuilder { /** * Set { @ link Date } sequence filler for column * with a specified step in days . * A call to this method is shorthand for * < code > sequence ( column , initial , d - & gt ; new Date ( x . getTime ( ) + step * MILLIS _ PER _ DAY ) ) < / code > . * @ param column Column day . ...
ensureArgNotNull ( initial ) ; return sequence ( column , initial , d -> new Date ( d . getTime ( ) + step * MILLIS_PER_DAY ) ) ;
public class FdfsResponse { /** * 解析反馈内容 * @ param in * @ param charset * @ return * @ throws IOException */ public T decodeContent ( InputStream in , Charset charset ) throws IOException { } }
// 如果有内容 if ( getContentLength ( ) > 0 ) { byte [ ] bytes = new byte [ ( int ) getContentLength ( ) ] ; int contentSize = in . read ( bytes ) ; // 获取数据 if ( contentSize != getContentLength ( ) ) { throw new IOException ( "读取到的数据长度与协议长度不符" ) ; } return FdfsParamMapper . map ( bytes , genericType , charset ) ; } return n...
public class LRUCache { /** * remove a element from list * @ param key */ public synchronized void remove ( E key ) { } }
Entry < E , T > entry = map . get ( key ) ; this . tail . prev = entry . prev ; entry . prev . next = this . tail ; map . remove ( entry . key ) ; this . length -- ;
public class OpenCLDevice { /** * List OpenCLDevices of a given TYPE , or all OpenCLDevices if type = = null . */ public static List < OpenCLDevice > listDevices ( TYPE type ) { } }
final OpenCLPlatform platform = new OpenCLPlatform ( 0 , null , null , null ) ; final ArrayList < OpenCLDevice > results = new ArrayList < > ( ) ; for ( final OpenCLPlatform p : platform . getOpenCLPlatforms ( ) ) { for ( final OpenCLDevice device : p . getOpenCLDevices ( ) ) { if ( type == null || device . getType ( )...
public class CasConfigurationJasyptCipherExecutor { /** * Decrypt value string . * @ param value the value * @ return the string */ public String decryptValue ( final String value ) { } }
try { return decryptValuePropagateExceptions ( value ) ; } catch ( final Exception e ) { LOGGER . error ( "Could not decrypt value [{}]" , value , e ) ; } return null ;
public class VEvent { /** * Sets the date that the event ends . This must NOT be set if a * { @ link DurationProperty } is defined . * @ param dateEnd the end date or null to remove * @ param hasTime true if the date has a time component , false if it is * strictly a date ( if false , the given Date object shou...
DateEnd prop = ( dateEnd == null ) ? null : new DateEnd ( dateEnd , hasTime ) ; setDateEnd ( prop ) ; return prop ;
public class Normalization { /** * Returns the standard deviation * and mean of the given columns * The list returned is a list of size 2 where each row * represents the standard deviation of each column and the mean of each column * @ param data the data to get the standard deviation and mean for * @ param c...
return aggregate ( data , columns , new String [ ] { "stddev" , "mean" } ) ;
public class Client { /** * Logs this client on in standalone mode with the faked bootstrap data and shared local * distributed object manager . */ public void standaloneLogon ( BootstrapData data , DObjectManager omgr ) { } }
if ( ! _standalone ) { throw new IllegalStateException ( "Must call prepareStandaloneLogon() first." ) ; } gotBootstrap ( data , omgr ) ;
public class DebugDrawBox2D { /** * Sets the fill color from a Color3f * @ param color color where ( r , g , b ) = ( x , y , z ) */ private void setFillColor ( Color3f color ) { } }
if ( cacheFillR == color . x && cacheFillG == color . y && cacheFillB == color . z ) { // no need to re - set the fill color , just use the cached values } else { cacheFillR = color . x ; cacheFillG = color . y ; cacheFillB = color . z ; setFillColorFromCache ( ) ; }
public class BatchKernelImpl { /** * There are some assumptions that all partition subjobs have associated DB entries */ @ Override public List < BatchPartitionWorkUnit > buildOnRestartParallelPartitions ( PartitionsBuilderConfig config ) throws JobRestartException , JobExecutionAlreadyCompleteException , JobExecutionN...
List < JSLJob > jobModels = config . getJobModels ( ) ; Properties [ ] partitionProperties = config . getPartitionProperties ( ) ; List < BatchPartitionWorkUnit > batchWorkUnits = new ArrayList < BatchPartitionWorkUnit > ( jobModels . size ( ) ) ; // for now let always use a Properties array . We can add some more conv...
public class UnixUserGroupInformation { /** * Create an immutable { @ link UnixUserGroupInformation } object . */ public static UnixUserGroupInformation createImmutable ( String [ ] ugi ) { } }
return new UnixUserGroupInformation ( ugi ) { public void readFields ( DataInput in ) throws IOException { throw new UnsupportedOperationException ( ) ; } } ;
public class HtmlTool { /** * Extracts elements from the HTML content . * @ param content * @ param selector * @ param amount * @ return the remainder and a list of extracted elements . The main body ( remainder after * extraction ) is always returned as the first element of the list . */ private List < Eleme...
Element body = parseContent ( content ) ; List < Element > elements = body . select ( selector ) ; if ( elements . size ( ) > 0 ) { elements = filterParents ( elements ) ; if ( amount >= 0 ) { // limit to the indicated amount elements = elements . subList ( 0 , Math . min ( amount , elements . size ( ) ) ) ; } // remov...
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public SecurityRequirement visitSecurityRequirement ( Context context , SecurityRequirement sr ) { } }
visitor . visitSecurityRequirement ( context , sr ) ; return sr ;
public class FeatureValidationCheck { /** * Creates a validation message for the feature and adds it to * the validation result . * @ param severity message severity * @ param origin the origin * @ param messageKey a message key * @ param params message parameters */ protected ValidationMessage < Origin > rep...
ValidationMessage < Origin > message = EntryValidations . createMessage ( origin , severity , messageKey , params ) ; message . getMessage ( ) ; // System . out . println ( " message = " + message . getMessage ( ) ) ; result . append ( message ) ; return message ;
public class JaegerConfiguration { /** * Sets the sampler configuration . * @ param samplerConfiguration The sampler configuration */ @ Inject public void setSamplerConfiguration ( @ Nullable Configuration . SamplerConfiguration samplerConfiguration ) { } }
if ( samplerConfiguration != null ) { configuration . withSampler ( samplerConfiguration ) ; }
public class PippoSettings { /** * Returns a list of floats from the specified name using the specified delimiter . * @ param name * @ param delimiter * @ return list of floats */ public List < Float > getFloats ( String name , String delimiter ) { } }
List < String > strings = getStrings ( name , delimiter ) ; List < Float > floats = new ArrayList < > ( strings . size ( ) ) ; for ( String value : strings ) { try { float i = Float . parseFloat ( value ) ; floats . add ( i ) ; } catch ( NumberFormatException e ) { } } return Collections . unmodifiableList ( floats ) ;
public class XmlReader { /** * Find position in input stream that matches XML path query * @ param xmlPathQuery XML path query * @ return { @ code boolean } true if found */ public boolean find ( String xmlPathQuery ) { } }
XmlPath xmlPath = XmlPathParser . parse ( xmlPathQuery ) ; XmlNode node ; while ( ( node = pullXmlNode ( ) ) != null ) { if ( node instanceof XmlStartElement ) { XmlStartElement startElement = ( XmlStartElement ) node ; Element element = new Element ( startElement . getLocalName ( ) ) ; element . addAttributes ( startE...
public class SimpleFibonacciHeap { /** * { @ inheritDoc } */ @ Override @ SuppressWarnings ( "unchecked" ) @ ConstantTime ( amortized = true ) public void meld ( MergeableAddressableHeap < K , V > other ) { } }
SimpleFibonacciHeap < K , V > h = ( SimpleFibonacciHeap < K , V > ) other ; // check same comparator if ( comparator != null ) { if ( h . comparator == null || ! h . comparator . equals ( comparator ) ) { throw new IllegalArgumentException ( "Cannot meld heaps using different comparators!" ) ; } } else if ( h . compara...
public class AppServiceEnvironmentsInner { /** * Get available SKUs for scaling a worker pool . * Get available SKUs for scaling a worker pool . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param workerPoolName Na...
return listWorkerPoolSkusSinglePageAsync ( resourceGroupName , name , workerPoolName ) . concatMap ( new Func1 < ServiceResponse < Page < SkuInfoInner > > , Observable < ServiceResponse < Page < SkuInfoInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SkuInfoInner > > > call ( ServiceResponse ...
public class UResourceBundle { /** * Returns a resource in a given resource that has a given key , or null if the * resource is not found . * @ param aKey the key associated with the wanted resource * @ return the resource , or null * @ see # get ( String ) * @ deprecated This API is ICU internal only . * @...
// NOTE : this only works for top - level resources . For resources at lower // levels , it fails when you fall back to the parent , since you ' re now // looking at root resources , not at the corresponding nested resource . for ( UResourceBundle res = this ; res != null ; res = res . getParent ( ) ) { UResourceBundle...
public class ICUHumanize { /** * Same as { @ link # smartDateFormat ( Date ) smartDateFormat } for the specified * locale . * @ param value * The date to be formatted * @ param skeleton * A pattern containing only the variable fields . For example , * " MMMdd " and " mmhh " are skeletons . * @ param local...
return withinLocale ( new Callable < String > ( ) { public String call ( ) throws Exception { return smartDateFormat ( value , skeleton ) ; } } , locale ) ;
public class Quarters { /** * / * [ deutsch ] * < p > Interpretiert das kanonische Format & quot ; PnQ & quot ; mit optionalem vorangehenden Minus - Zeichen . < / p > * @ param period the formatted string to be parsed * @ return parsed instance * @ throws ParseException if given argument cannot be parsed */ pub...
int amount = SingleUnitTimeSpan . parsePeriod ( period , 'Q' ) ; return Quarters . of ( amount ) ;
public class ClasspathElementModule { /** * Scan for package matches within module . * @ param log * the log */ @ Override void scanPaths ( final LogNode log ) { } }
if ( skipClasspathElement ) { return ; } if ( scanned . getAndSet ( true ) ) { // Should not happen throw new IllegalArgumentException ( "Already scanned classpath element " + toString ( ) ) ; } final String moduleLocationStr = moduleRef . getLocationStr ( ) ; final LogNode subLog = log == null ? null : log . log ( mod...
public class ConsoleMenu { /** * Gets a String from the System . in * @ param msg * for the command line * @ return String as entered by the user of the console app */ public static String getString ( final String msg , final String defaultVal ) { } }
String s = getString ( msg + "(default:" + defaultVal + "):" ) ; if ( StringUtils . isBlank ( s ) ) { s = defaultVal ; } return s ;
public class TemplateEngine { /** * Sets a single template resolver for this template engine . * Calling this method is equivalent to calling { @ link # setTemplateResolvers ( Set ) } * passing a Set with only one template resolver . * @ param templateResolver the template resolver to be set . */ public void setT...
Validate . notNull ( templateResolver , "Template Resolver cannot be null" ) ; checkNotInitialized ( ) ; this . templateResolvers . clear ( ) ; this . templateResolvers . add ( templateResolver ) ;
public class FrustumIntersection { /** * Update the stored frustum planes of < code > this < / code > { @ link FrustumIntersection } with the given { @ link Matrix4fc matrix } and * allow to optimize the frustum plane extraction in the case when no intersection test is needed for spheres . * Reference : < a href = ...
float invl ; nxX = m . m03 ( ) + m . m00 ( ) ; nxY = m . m13 ( ) + m . m10 ( ) ; nxZ = m . m23 ( ) + m . m20 ( ) ; nxW = m . m33 ( ) + m . m30 ( ) ; if ( allowTestSpheres ) { invl = ( float ) ( 1.0 / Math . sqrt ( nxX * nxX + nxY * nxY + nxZ * nxZ ) ) ; nxX *= invl ; nxY *= invl ; nxZ *= invl ; nxW *= invl ; } planes [...
public class Constraint { /** * Creates a new map representing a { @ link Min } validation constraint . * @ param min the minimum value * @ return a map */ static Map < String , Object > minPayload ( final Object min ) { } }
if ( min == null ) { return null ; } Map < String , Object > payload = new LinkedHashMap < > ( ) ; payload . put ( "value" , min ) ; payload . put ( "message" , MSG_PREFIX + VALIDATORS . get ( Min . class ) ) ; return payload ;
public class JspContextWrapper { /** * LIDB4147-9 Begin - modified for JSP 2.1 */ public Object resolveVariable ( String pName ) throws ELException { } }
ELContext ctx = this . getELContext ( ) ; return ctx . getELResolver ( ) . getValue ( ctx , null , pName ) ;
public class PubSubInputHandler { /** * The local put method is driven when the producer is attached locally * attached to this PubSub Input handler */ private void localPut ( MessageItem msg , TransactionCommon transaction ) throws SIIncorrectCallException , SIResourceException , SINotPossibleInCurrentConfigurationE...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "localPut" , new Object [ ] { msg , transaction } ) ; boolean stored = false ; /* * If a non - empty frp exists at this point then send the message to the exception * destination */ if ( ! msg . getMessage ( ) . isForwardR...
public class InvokerHelper { /** * Appends an object to an Appendable using Groovy ' s default representation for the object . */ public static void append ( Appendable out , Object object ) throws IOException { } }
if ( object instanceof String ) { out . append ( ( String ) object ) ; } else if ( object instanceof Object [ ] ) { out . append ( toArrayString ( ( Object [ ] ) object ) ) ; } else if ( object instanceof Map ) { out . append ( toMapString ( ( Map ) object ) ) ; } else if ( object instanceof Collection ) { out . append...
public class ImageRectangleF { /** * Round the floating point rectangle to an integer rectangle * @ return image rectangle */ public ImageRectangle round ( ) { } }
return new ImageRectangle ( Math . round ( left ) , Math . round ( top ) , Math . round ( right ) , Math . round ( bottom ) ) ;
public class Lookup { /** * Sets the search path that will be used as the default by future Lookups . * @ param domains The default search path . * @ throws TextParseException A name in the array is not a valid DNS name . */ public static synchronized void setDefaultSearchPath ( String [ ] domains ) throws TextPars...
if ( domains == null ) { defaultSearchPath = null ; return ; } Name [ ] newdomains = new Name [ domains . length ] ; for ( int i = 0 ; i < domains . length ; i ++ ) newdomains [ i ] = Name . fromString ( domains [ i ] , Name . root ) ; defaultSearchPath = newdomains ;
public class InfoPanelService { /** * Finds the " nearest " info panel . * @ param element The UI element from which to begin the search . * @ param activeOnly If true , only active info panels are considered . * @ return The nearest active info panel , or null if none found . */ public static IInfoPanel findInfo...
ElementBase parent = element ; ElementBase previousParent ; IInfoPanel infoPanel = searchChildren ( element , null , activeOnly ) ; while ( ( infoPanel == null ) && ( parent != null ) ) { previousParent = parent ; parent = parent . getParent ( ) ; infoPanel = searchChildren ( parent , previousParent , activeOnly ) ; } ...
public class JmsConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . api . jms . JmsConnection # reportException ( javax . jms . JMSException ) * This method directly invokes any registered exception listener . * No locks are taken by this method , so it is the caller ' s responsibility to * ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "callExceptionListener" ) ; // Get the latest version of the ExceptionListener ( after this point we ' re // going to call that one regardless of whether it changes ExceptionListener elLocal = elRef . get ( ) ; if ( e...
public class ProjectSummaryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ProjectSummary projectSummary , ProtocolMarshaller protocolMarshaller ) { } }
if ( projectSummary == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( projectSummary . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( projectSummary . getProjectId ( ) , PROJECTID_BINDING ) ; } catch ( Exception e ) { throw ...
public class AiMesh { /** * Returns the number of vertex indices for a single face . * @ param face the face * @ return the number of indices */ public int getFaceNumIndices ( int face ) { } }
if ( null == m_faceOffsets ) { if ( face >= m_numFaces || face < 0 ) { throw new IndexOutOfBoundsException ( "Index: " + face + ", Size: " + m_numFaces ) ; } return 3 ; } else { /* * no need to perform bound checks here as the array access will * throw IndexOutOfBoundsExceptions if the index is invalid */ if ( face =...
public class ExportInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ExportInfo exportInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( exportInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( exportInfo . getExportId ( ) , EXPORTID_BINDING ) ; protocolMarshaller . marshall ( exportInfo . getExportStatus ( ) , EXPORTSTATUS_BINDING ) ; protocolMarshaller . marshall ...
public class JsonObject { /** * Retrieves the decrypted value from the field name and casts it to { @ link String } . * Note : Use of the Field Level Encryption functionality provided in the * com . couchbase . client . encryption namespace provided by Couchbase is * subject to the Couchbase Inc . Enterprise Subs...
return ( String ) getAndDecrypt ( name , providerName ) ;
public class IfcPersonAndOrganizationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcActorRole > getRoles ( ) { } }
return ( EList < IfcActorRole > ) eGet ( Ifc4Package . Literals . IFC_PERSON_AND_ORGANIZATION__ROLES , true ) ;
public class ASMDatumWriterFactory { /** * Creates a { @ link DatumWriter } that is able to encode given data type with the given { @ link Schema } . * The instance created is thread safe and reusable . * @ param type Type information of the data type to be encoded . * @ param schema Schema of the data type . *...
try { Class < DatumWriter < ? > > writerClass = datumWriterClasses . getUnchecked ( new CacheKey ( schema , type ) ) ; return ( DatumWriter < T > ) writerClass . getConstructor ( Schema . class , FieldAccessorFactory . class ) . newInstance ( schema , fieldAccessorFactory ) ; } catch ( Exception e ) { throw Throwables ...
public class QueryPlanner { /** * Check that " MIGRATE FROM tbl WHERE . . . " statement is valid . * @ param sql SQL statement * @ param xmlSQL HSQL parsed tree * @ param db database catalog */ private static void validateMigrateStmt ( String sql , VoltXMLElement xmlSQL , Database db ) { } }
final Map < String , String > attributes = xmlSQL . attributes ; assert attributes . size ( ) == 1 ; final Table targetTable = db . getTables ( ) . get ( attributes . get ( "table" ) ) ; assert targetTable != null ; final CatalogMap < TimeToLive > ttls = targetTable . getTimetolive ( ) ; if ( ttls . isEmpty ( ) ) { thr...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcColourOrFactor ( ) { } }
if ( ifcColourOrFactorEClass == null ) { ifcColourOrFactorEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1123 ) ; } return ifcColourOrFactorEClass ;
public class StencilOperands { /** * Is Object a whole number . * @ param o * Object to be analyzed . * @ return true if Integer , Long , Byte , Short or Character . */ protected boolean isNumberable ( final Object o ) { } }
return o instanceof Integer || o instanceof Long || o instanceof Byte || o instanceof Short || o instanceof Character ;
public class MirrorTable { /** * Reposition to this record Using this bookmark . * @ exception DBException File exception . */ public FieldList setHandle ( Object bookmark , int iHandleType ) throws DBException { } }
FieldList record = super . setHandle ( bookmark , iHandleType ) ; Iterator < BaseTable > iterator = this . getTables ( ) ; while ( iterator . hasNext ( ) ) { BaseTable table = iterator . next ( ) ; if ( ( table != null ) && ( table != this . getNextTable ( ) ) ) this . syncTables ( table , this . getRecord ( ) ) ; } re...
public class ActionFormMapper { protected void mappingListJsonBody ( ActionRuntime runtime , VirtualForm virtualForm , String json ) { } }
try { final ActionFormMeta formMeta = virtualForm . getFormMeta ( ) ; final ParameterizedType pt = formMeta . getListFormParameterParameterizedType ( ) . get ( ) ; // already checked final List < Object > fromJsonList = getJsonManager ( ) . fromJsonParameteried ( json , pt ) ; acceptJsonRealForm ( virtualForm , fromJso...
public class PreprocessorContext { /** * Set a global variable value * @ param name the variable name , it must not be null and will be normalized to the supported format * @ param value the variable value , it must not be null * @ return this preprocessor context */ @ Nonnull public PreprocessorContext setGlobal...
assertNotNull ( "Variable name is null" , name ) ; final String normalizedName = assertNotNull ( PreprocessorUtils . normalizeVariableName ( name ) ) ; if ( normalizedName . isEmpty ( ) ) { throw makeException ( "Name is empty" , null ) ; } assertNotNull ( "Value is null" , value ) ; if ( mapVariableNameToSpecialVarPro...
public class TcpClient { /** * Creates a new TCP client instance with the passed address of the target server . * @ param host Hostname for the target server . * @ param port Port for the target server . * @ return A new { @ code TcpClient } instance . */ public static TcpClient < ByteBuf , ByteBuf > newClient ( ...
return newClient ( new InetSocketAddress ( host , port ) ) ;
public class FDBigInteger { /** * @ requires this . value ( ) * UNSIGNED ( iv ) + UNSIGNED ( addend ) < ( ( \ bigint ) 1 ) < < ( ( this . data . length + this . offset ) * 32 ) ; * @ assignable this . data [ * ] ; * @ ensures this . value ( ) = = \ old ( this . value ( ) * UNSIGNED ( iv ) + UNSIGNED ( addend ) ) ; ...
long v = iv & LONG_MASK ; // unroll 0th iteration , doing addition . long p = v * ( data [ 0 ] & LONG_MASK ) + ( addend & LONG_MASK ) ; data [ 0 ] = ( int ) p ; p >>>= 32 ; for ( int i = 1 ; i < nWords ; i ++ ) { p += v * ( data [ i ] & LONG_MASK ) ; data [ i ] = ( int ) p ; p >>>= 32 ; } if ( p != 0L ) { data [ nWords...
public class OutFactoryH3Impl { /** * Adds a predefined schema */ @ Override public void schema ( Class < ? > type ) { } }
Objects . requireNonNull ( type ) ; _context . schema ( type ) ;
public class OpDef { /** * < pre > * Optional deprecation based on GraphDef versions . * < / pre > * < code > optional . tensorflow . OpDeprecation deprecation = 8 ; < / code > */ public org . tensorflow . framework . OpDeprecation getDeprecation ( ) { } }
return deprecation_ == null ? org . tensorflow . framework . OpDeprecation . getDefaultInstance ( ) : deprecation_ ;
public class BaseLockFactory { /** * { @ inheritDoc } */ @ Override public BaseLuceneLock obtainLock ( Directory dir , String lockName ) throws IOException { } }
if ( ! ( dir instanceof DirectoryLucene ) ) { throw new UnsupportedOperationException ( "BaseLuceneLock can only be used with DirectoryLucene, got: " + dir ) ; } DirectoryLucene infinispanDirectory = ( DirectoryLucene ) dir ; int affinitySegmentId = infinispanDirectory . getAffinitySegmentId ( ) ; Cache distLockCache =...
public class ClassIncludes { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( CLASS_INCLUDES_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class DefaultGroovyMethods { /** * A helper method to allow lists to work with subscript operators . * < pre class = " groovyTestCase " > def list = [ 2 , 3] * list [ 0 ] = 1 * assert list = = [ 1 , 3 ] < / pre > * @ param self a List * @ param idx an index * @ param value the value to put at the giv...
int size = self . size ( ) ; idx = normaliseIndex ( idx , size ) ; if ( idx < size ) { self . set ( idx , value ) ; } else { while ( size < idx ) { self . add ( size ++ , null ) ; } self . add ( idx , value ) ; }
public class LssClient { /** * Create a domain stream in the live stream service . * @ param request The request object containing all options for creating domain stream * @ return the response */ public CreateStreamResponse createStream ( CreateStreamRequest request ) { } }
checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getPlayDomain ( ) , "playDomain should NOT be empty." ) ; checkStringNotEmpty ( request . getApp ( ) , "app should NOT be empty." ) ; checkNotNull ( request . getPublish ( ) , "publish should NOT be null." ) ; check...
public class ManagerConnectionImpl { /** * Determine version by the ' core show version ' command . This needs * ' command ' permissions . * @ return * @ throws Exception */ protected AsteriskVersion determineVersionByCoreShowVersion ( ) throws Exception { } }
final ManagerResponse coreShowVersionResponse = sendAction ( new CommandAction ( CMD_SHOW_VERSION ) ) ; if ( coreShowVersionResponse == null || ! ( coreShowVersionResponse instanceof CommandResponse ) ) { // this needs ' command ' permissions logger . info ( "Could not get response for 'core show version'" ) ; return n...
public class SchemaBuilder { /** * Creates the schema object builder for the identifier . * The actual definitions are retrieved via { @ link SchemaBuilder # getDefinitions } after all types have been declared . * @ param identifier The identifier * @ return The schema JSON object builder with the needed properti...
final SwaggerType type = toSwaggerType ( identifier . getType ( ) ) ; switch ( type ) { case BOOLEAN : case INTEGER : case NUMBER : case NULL : case STRING : final JsonObjectBuilder builder = Json . createObjectBuilder ( ) ; addPrimitive ( builder , type ) ; return builder ; } final JsonObjectBuilder builder = Json . c...
public class Planner { /** * Fetches the list offerings from the Discoverer * @ return the String containing a unique Tosca representation of all available offerings */ private String fetchOfferings ( ) { } }
DiscovererFetchallResult allOfferings = null ; try { String discovererOutput = discovererClient . getRequest ( "fetch_all" , Collections . EMPTY_LIST ) ; ObjectMapper mapper = new ObjectMapper ( ) ; allOfferings = mapper . readValue ( discovererOutput , DiscovererFetchallResult . class ) ; } catch ( IOException e ) { e...
public class RePairRule { /** * Return the prefixed with R rule . * @ return rule string . */ public String toRuleString ( ) { } }
if ( 0 == this . ruleNumber ) { return this . grammar . r0String ; } return this . first . toString ( ) + SPACE + this . second . toString ( ) + SPACE ;
public class LoggerCreator { /** * Convert a logging level to its numerical equivalent . * @ param level * - the logging level . * @ return the numerical index that corresponds to the given level . */ @ SuppressWarnings ( { } }
"checkstyle:magicnumber" , "checkstyle:returncount" , "checkstyle:npathcomplexity" } ) public static int toInt ( Level level ) { if ( level == Level . OFF ) { return 0 ; } if ( level == Level . SEVERE ) { return 1 ; } if ( level == Level . WARNING ) { return 2 ; } if ( level == Level . INFO ) { return 3 ; } if ( level ...
public class WebApp { /** * Add a filter . * @ param filter to add * @ throws NullArgumentException if filter , filter name or filter class is null */ public void addFilter ( final WebAppFilter filter ) { } }
NullArgumentException . validateNotNull ( filter , "Filter" ) ; NullArgumentException . validateNotNull ( filter . getFilterName ( ) , "Filter name" ) ; NullArgumentException . validateNotNull ( filter . getFilterClass ( ) , "Filter class" ) ; filters . put ( filter . getFilterName ( ) , filter ) ; // add url patterns ...
public class ServletUtil { /** * Gets the URL for the provided possibly - relative path or < code > null < / code > if no resource * is mapped to the path . * @ deprecated Use regular methods directly * @ see # getAbsoluteURL ( javax . servlet . http . HttpServletRequest , java . lang . String ) * @ see Servlet...
return servletContext . getResource ( getAbsolutePath ( request , relativeUrlPath ) ) ;
public class Tracer { /** * Return the sec . ms part of time ( if time = " 20:06:11.566 " , " 11.566 " ) */ private static String formatTime ( long time ) { } }
int sec = ( int ) ( ( time / 1000 ) % 60 ) ; int ms = ( int ) ( time % 1000 ) ; return String . format ( "%02d.%03d" , sec , ms ) ;
public class MvpPresenter { /** * Check if view is in restore state or not * @ param view view for check * @ return true if view state restore state to incoming view . false otherwise . */ @ SuppressWarnings ( "unused" ) public boolean isInRestoreState ( View view ) { } }
// noinspection SimplifiableIfStatement if ( mViewState != null ) { return mViewState . isInRestoreState ( view ) ; } return false ;
public class GrailsHibernateTemplate { /** * Execute the action specified by the given action object within a Session . * @ param action callback object that specifies the Hibernate action * @ param enforceNativeSession whether to enforce exposure of the native Hibernate Session to callback code * @ return a resu...
Assert . notNull ( action , "Callback object must not be null" ) ; Session session = getSession ( ) ; boolean existingTransaction = isSessionTransactional ( session ) ; if ( existingTransaction ) { LOG . debug ( "Found thread-bound Session for HibernateTemplate" ) ; } FlushMode previousFlushMode = null ; try { previous...
public class ApiOvhOrder { /** * Create order * REST : POST / order / cdn / dedicated / { serviceName } / quota / { duration } * @ param quota [ required ] quota number in TB that will be added to the CDN service * @ param serviceName [ required ] The internal name of your CDN offer * @ param duration [ require...
String qPath = "/order/cdn/dedicated/{serviceName}/quota/{duration}" ; StringBuilder sb = path ( qPath , serviceName , duration ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "quota" , quota ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( r...
public class MTree { /** * Removes a data object from the M - Tree . * @ param data The data object to be removed . * @ return { @ code true } if and only if the object was found . */ public boolean remove ( DATA data ) { } }
if ( root == null ) { return false ; } double distanceToRoot = distanceFunction . calculate ( data , root . data ) ; try { root . removeData ( data , distanceToRoot ) ; } catch ( RootNodeReplacement e ) { @ SuppressWarnings ( "unchecked" ) Node newRoot = ( Node ) e . newRoot ; root = newRoot ; } catch ( DataNotFound e ...
public class FxObservableTransformers { /** * Performs an action on FX thread on onError with the provided emission count * @ param onError * @ param < T > */ public static < T > ObservableTransformer < T , T > doOnErrorCountFx ( Consumer < Integer > onError ) { } }
return obs -> obs . compose ( doOnErrorCount ( i -> runOnFx ( i , onError ) ) ) ;
public class SubmitEclipseLogWizard { /** * Replies the associated wieard dialog . * @ return the dialog . */ WizardDialog getWizardDialog ( ) { } }
final WeakReference < WizardDialog > ref = this . wizardDialog ; return ( ref == null ) ? null : ref . get ( ) ;
public class JQLChecker { /** * Analyze internal . * @ param < L > * the generic type * @ param jqlContext * the jql context * @ param jql * the jql * @ param listener * the listener */ protected < L extends JqlBaseListener > void analyzeInternal ( JQLContext jqlContext , final String jql , L listener )...
walker . walk ( listener , prepareParser ( jqlContext , jql ) . value0 ) ;
public class DiagnosticsInner { /** * Get site detector response . * Get site detector response . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param detectorName Detector Resource Name * @ throws IllegalArgumentException thrown if para...
return getSiteDetectorResponseWithServiceResponseAsync ( resourceGroupName , siteName , detectorName ) . toBlocking ( ) . single ( ) . body ( ) ;