signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LocationRangeSet { /** * Reduces a set of LocationRange objects . */ public static SortedSet reduce ( SortedSet locations ) { } }
SortedSet newSet = new TreeSet ( ) ; Iterator it = locations . iterator ( ) ; while ( it . hasNext ( ) ) { LocationRange next = ( LocationRange ) it . next ( ) ; if ( newSet . size ( ) == 0 ) { newSet . add ( next ) ; continue ; } if ( next . getStartLocation ( ) . compareTo ( next . getEndLocation ( ) ) >= 0 ) { conti...
public class NodeObject { /** * Requests that the < code > cacheData < / code > field be set to the * specified value . The local value will be updated immediately and an * event will be propagated through the system to notify all listeners * that the attribute did change . Proxied copies of this object ( on * ...
"com.threerings.presents.tools.GenDObjectTask" } ) public void setCacheData ( NodeObject . CacheData value ) { NodeObject . CacheData ovalue = this . cacheData ; requestAttributeChange ( CACHE_DATA , value , ovalue ) ; this . cacheData = value ;
public class Engine { /** * Installs Feature while skipping dependency check * @ param installAsset InstallAsset to install * @ param filesInstalled List of files to be installed * @ param featuresToBeInstalled Collection of feature names to install * @ param existsAction Action to take if asset exists * @ pa...
ESAAdaptor . install ( product , ( ESAAsset ) installAsset , filesInstalled , featuresToBeInstalled , existsAction , executableFiles , extattrFiles , checksumsManager , true ) ;
public class SelectSubqueryExpression { /** * Resolve the subquery ' s correlated TVEs ( and , in one special case , aggregates ) * that became ParameterValueExpressions in the subquery statement ( or its children ) . * If they reference a column from the parent statement ( getOrigStmtId ( ) = = parentStmt . m _ st...
AbstractParsedStmt subqueryStmt = m_subquery . getSubqueryStmt ( ) ; AbstractParsedStmt parentStmt = subqueryStmt . m_parentStmt ; // we must have a parent - it ' s a subquery statement assert ( parentStmt != null ) ; // Preserve indexes of all parameters this subquery depends on . // It might include parameters from i...
public class MCDRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . MCDRG__RG_LENGTH : setRGLength ( ( Integer ) newValue ) ; return ; case AfplibPackage . MCDRG__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class nsip { /** * Use this API to enable nsip . */ public static base_response enable ( nitro_service client , nsip resource ) throws Exception { } }
nsip enableresource = new nsip ( ) ; enableresource . ipaddress = resource . ipaddress ; enableresource . td = resource . td ; return enableresource . perform_operation ( client , "enable" ) ;
public class CommonMatchers { /** * = = > ARRAY = = > */ public static Matcher < JsonElement > areItemsValid ( final Validator validator ) { } }
return new TypeSafeDiagnosingMatcher < JsonElement > ( ) { @ Override protected boolean matchesSafely ( JsonElement item , Description mismatchDescription ) { // we do not care for the properties if parent item is not JsonArray if ( ! item . isJsonArray ( ) ) return true ; for ( int i = 0 ; i < item . asJsonArray ( ) ....
public class SingleIndexWriter { /** * Generate single index file , for all Unicode characters . * @ param configuration the configuration for this doclet * @ param indexbuilder IndexBuilder built by { @ link IndexBuilder } * @ throws DocFileIOException if there is a problem generating the index */ public static ...
DocPath filename = DocPaths . INDEX_ALL ; SingleIndexWriter indexgen = new SingleIndexWriter ( configuration , filename , indexbuilder ) ; indexgen . generateIndexFile ( ) ;
public class AWSServiceCatalogClient { /** * Lists the specified requests or all performed requests . * @ param listRecordHistoryRequest * @ return Result of the ListRecordHistory operation returned by the service . * @ throws InvalidParametersException * One or more parameters provided to the operation are not...
request = beforeClientExecution ( request ) ; return executeListRecordHistory ( request ) ;
public class IOManagerAsync { /** * Close method . Shuts down the reader and writer threads immediately , not waiting for their * pending requests to be served . This method waits until the threads have actually ceased their * operation . */ @ Override public void shutdown ( ) { } }
// mark shut down and exit if it already was shut down if ( ! isShutdown . compareAndSet ( false , true ) ) { return ; } // Remove shutdown hook to prevent resource leaks ShutdownHookUtil . removeShutdownHook ( shutdownHook , getClass ( ) . getSimpleName ( ) , LOG ) ; try { if ( LOG . isDebugEnabled ( ) ) { LOG . debug...
public class JSONParserBase { /** * use to return Primitive Type , or String , Or JsonObject or JsonArray * generated by a ContainerFactory */ protected < T > T parse ( JsonReaderI < T > mapper ) throws ParseException { } }
this . pos = - 1 ; T result ; try { read ( ) ; result = readFirst ( mapper ) ; if ( checkTaillingData ) { if ( ! checkTaillingSpace ) skipSpace ( ) ; if ( c != EOI ) throw new ParseException ( pos - 1 , ERROR_UNEXPECTED_TOKEN , c ) ; } } catch ( IOException e ) { throw new ParseException ( pos , e ) ; } xs = null ; xo ...
public class FixedFatJarExportPage { /** * TODO : Replace " private " by " protected " within JDT */ protected IPath [ ] getClasspath ( ILaunchConfiguration configuration ) throws CoreException { } }
IRuntimeClasspathEntry [ ] entries = JavaRuntime . computeUnresolvedRuntimeClasspath ( configuration ) ; entries = JavaRuntime . resolveRuntimeClasspath ( entries , configuration ) ; boolean isModularConfig = JavaRuntime . isModularConfiguration ( configuration ) ; ArrayList < IPath > userEntries = new ArrayList < > ( ...
public class ManagedInstancesInner { /** * Creates or updates a managed instance . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param managedInstanceName The name of the managed instance . ...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , parameters ) . map ( new Func1 < ServiceResponse < ManagedInstanceInner > , ManagedInstanceInner > ( ) { @ Override public ManagedInstanceInner call ( ServiceResponse < ManagedInstanceInner > response ) { return response . bo...
public class CmsSearch { /** * Limits the search to a given list of resource types only . < p > * @ param resourceTypes the resource types to limit the search result to */ public void setResourceTypes ( String [ ] resourceTypes ) { } }
if ( resourceTypes != null ) { m_parameters . setResourceTypes ( Arrays . asList ( resourceTypes ) ) ; } else { m_parameters . setResourceTypes ( null ) ; } resetLastResult ( ) ;
public class Compiler { /** * Add an additional compilation unit into the loop * - > build compilation unit declarations , their bindings and record their results . */ @ Override public void accept ( ICompilationUnit sourceUnit , AccessRestriction accessRestriction ) { } }
// Switch the current policy and compilation result for this unit to the requested one . CompilationResult unitResult = new CompilationResult ( sourceUnit , this . totalUnits , this . totalUnits , this . options . maxProblemsPerUnit ) ; unitResult . checkSecondaryTypes = true ; try { if ( this . options . verbose ) { S...
public class AppServicePlansInner { /** * Get all apps associated with an App Service plan . * Get all apps associated with an App Service plan . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . * @ param skipToken Skip to a web...
return listWebAppsSinglePageAsync ( resourceGroupName , name , skipToken , filter , top ) . concatMap ( new Func1 < ServiceResponse < Page < SiteInner > > , Observable < ServiceResponse < Page < SiteInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SiteInner > > > call ( ServiceResponse < Page...
public class Serializer { /** * Writes an object to the given output stream . * The given object must have a { @ link Serializer # register ( Class ) registered } serializer or implement { @ link java . io . Serializable } . * If a serializable type ID was provided during registration , the type ID will be written ...
writeObject ( object , new OutputStreamBufferOutput ( outputStream ) ) ; return outputStream ;
public class DirFileEntryEnumIterator2 { /** * { @ inheritDoc } * @ see jcifs . smb . DirFileEntryEnumIteratorBase # getResults ( ) */ @ Override protected FileEntry [ ] getResults ( ) { } }
FileEntry [ ] results = this . response . getResults ( ) ; if ( results == null ) { return new FileEntry [ 0 ] ; } return results ;
public class ModeShapeEngine { /** * Get the deployed { @ link Repository } instance with the given the name . * @ param repositoryName the name of the deployed repository * @ return the named repository instance * @ throws IllegalArgumentException if the repository name is null , blank or invalid * @ throws No...
CheckArg . isNotEmpty ( repositoryName , "repositoryName" ) ; checkRunning ( ) ; final Lock lock = this . lock . readLock ( ) ; try { lock . lock ( ) ; JcrRepository repository = repositories . get ( repositoryName ) ; if ( repository == null ) { throw new NoSuchRepositoryException ( JcrI18n . repositoryDoesNotExist . ...
public class CSVPrinter { /** * Put a comment among the comma separated values . * Comments will always begin on a new line and occupy a * least one full line . The character specified to star * comments and a space will be inserted at the beginning of * each new line in the comment . * @ param comment the co...
if ( this . strategy . isCommentingDisabled ( ) ) { return ; } if ( ! newLine ) { out . println ( ) ; } out . print ( this . strategy . getCommentStart ( ) ) ; out . print ( ' ' ) ; for ( int i = 0 ; i < comment . length ( ) ; i ++ ) { char c = comment . charAt ( i ) ; switch ( c ) { case '\r' : if ( i + 1 < comment . ...
public class BigDecimal { /** * Tests if quotient has to be incremented according the roundingMode */ private static boolean needIncrement ( MutableBigInteger mdivisor , int roundingMode , int qsign , MutableBigInteger mq , MutableBigInteger mr ) { } }
assert ! mr . isZero ( ) ; int cmpFracHalf = mr . compareHalf ( mdivisor ) ; return commonNeedIncrement ( roundingMode , qsign , cmpFracHalf , mq . isOdd ( ) ) ;
public class EndpointUtil { /** * This method provides a decoding of a client based URI . * @ param clientUri The client URI * @ return The original URI */ public static String decodeClientURI ( String clientUri ) { } }
return clientUri . startsWith ( Constants . URI_CLIENT_PREFIX ) ? clientUri . substring ( Constants . URI_CLIENT_PREFIX . length ( ) ) : clientUri ;
public class AbstractCompact { /** * Return a copy of the provided array with updated memory layout . * @ param oldStorage * the current array * @ param defaultValue * default value for newly allocated array positions * @ param payload * the payload object * @ return a copy of the provided array with upda...
return payload . type . updateStorage ( oldStorage , payload , int [ ] :: new , ( arr , idx ) -> arr [ idx ] = defaultValue ) ;
public class ServletUtil { /** * 获取客户端IP * headerNames参数用于自定义检测的Header < br > * 需要注意的是 , 使用此方法获取的客户IP地址必须在Http服务器 ( 例如Nginx ) 中配置头信息 , 否则容易造成IP伪造 。 * @ param request 请求对象 { @ link HttpServletRequest } * @ param headerNames 自定义头 , 通常在Http服务器 ( 例如Nginx ) 中配置 * @ return IP地址 * @ since 4.4.1 */ public static St...
String ip ; for ( String header : headerNames ) { ip = request . getHeader ( header ) ; if ( false == isUnknow ( ip ) ) { return getMultistageReverseProxyIp ( ip ) ; } } ip = request . getRemoteAddr ( ) ; return getMultistageReverseProxyIp ( ip ) ;
public class xen_upgrade { /** * < pre > * Use this operation to get version of xenserver . * < / pre > */ public static xen_upgrade [ ] get ( nitro_service client ) throws Exception { } }
xen_upgrade resource = new xen_upgrade ( ) ; resource . validate ( "get" ) ; return ( xen_upgrade [ ] ) resource . get_resources ( client ) ;
public class ToUnknownStream { /** * Adds an attribute to the currenly open tag * @ param uri the URI of a namespace * @ param localName the attribute name , without prefix * @ param rawName the attribute name , with prefix ( if any ) * @ param type the type of the attribute , typically " CDATA " * @ param va...
if ( m_firstTagNotEmitted ) { flush ( ) ; } m_handler . addAttribute ( uri , localName , rawName , type , value , XSLAttribute ) ;
public class AmazonCloudFrontClient { /** * Lists invalidation batches . * @ param listInvalidationsRequest * The request to list invalidations . * @ return Result of the ListInvalidations operation returned by the service . * @ throws InvalidArgumentException * The argument is invalid . * @ throws NoSuchDi...
request = beforeClientExecution ( request ) ; return executeListInvalidations ( request ) ;
public class AutoMlClient { /** * Deploys a model . If a model is already deployed , deploying it with the same parameters has no * effect . Deploying with different parametrs ( as e . g . changing * < p > [ node _ number ] [ google . cloud . automl . v1beta1 . ImageObjectDetectionModelDeploymentMetadata . node _ n...
return deployModelOperationCallable ( ) . futureCall ( request ) ;
public class TriggerUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( callbackMethod != null ) { request . addPostParam ( "CallbackMethod" , callbackMethod . toString ( ) ) ; } if ( callbackUrl != null ) { request . addPostParam ( "CallbackUrl" , callbackUrl . toString ( ) ) ; } if ( friendlyName != null ) { request . addPostParam ( "FriendlyName" , friendlyName ) ; }
public class LLongSupplierBuilder { /** * One of ways of creating builder . In most cases ( considering all _ functional _ builders ) it requires to provide generic parameters ( in most cases redundantly ) */ @ Nonnull public final LLongSupplierBuilder withHandling ( @ Nonnull HandlingInstructions < RuntimeException , ...
Null . nonNullArg ( handling , "handling" ) ; if ( this . handling != null ) { throw new UnsupportedOperationException ( "Handling is already set for this builder." ) ; } this . handling = handling ; return self ( ) ;
public class RequestUtil { /** * Filter the specified message string for characters that are sensitive in HTML . This avoids potential attacks caused by * including JavaScript codes in the request URL that is often reported in error messages . * @ param message The message string to be filtered * @ return the fil...
if ( message == null ) { return ( null ) ; } char content [ ] = new char [ message . length ( ) ] ; message . getChars ( 0 , message . length ( ) , content , 0 ) ; StringBuilder result = new StringBuilder ( content . length + 50 ) ; for ( int i = 0 ; i < content . length ; i ++ ) { switch ( content [ i ] ) { case '<' :...
public class ParsedElement { /** * Just like makeDouble ( ) , but creates a double primitive value instead of a * Double object . Much more efficient if you don ' t need the object . * @ param obj Any double convertible object * @ return The double primitive value . */ public static double makeDoubleValue ( Objec...
if ( obj == null ) { return Double . NaN ; } return CommonServices . getCoercionManager ( ) . makePrimitiveDoubleFrom ( obj ) ;
public class LogView { /** * Removes a filter to the view . * @ param filter */ public void removeFilter ( AbstractLogFilter < E > filter ) { } }
Validate . notNull ( filter ) ; filters . remove ( filter ) ; uptodate = false ; filter . deleteObserver ( this ) ;
public class PathType { /** * Creates a URI for the path with the given root and names in the file system with the given URI . */ public final URI toUri ( URI fileSystemUri , String root , Iterable < String > names , boolean directory ) { } }
String path = toUriPath ( root , names , directory ) ; try { // it should not suck this much to create a new URI that ' s the same except with a path set = ( // need to do it this way for automatic path escaping return new URI ( fileSystemUri . getScheme ( ) , fileSystemUri . getUserInfo ( ) , fileSystemUri . getHost (...
public class DefaultRounding { /** * ( non - Javadoc ) * @ see javax . money . MonetaryFunction # apply ( java . lang . Object ) */ @ Override public MonetaryAmount apply ( MonetaryAmount amount ) { } }
return amount . getFactory ( ) . setCurrency ( amount . getCurrency ( ) ) . setNumber ( amount . getNumber ( ) . numberValue ( BigDecimal . class ) . setScale ( this . context . getInt ( SCALE_KEY ) , this . context . get ( RoundingMode . class ) ) ) . create ( ) ;
public class PolicyDescription { /** * The policy attributes . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicyAttributeDescriptions ( java . util . Collection ) } or * { @ link # withPolicyAttributeDescriptions ( java . util . Collection ) } if yo...
if ( this . policyAttributeDescriptions == null ) { setPolicyAttributeDescriptions ( new com . amazonaws . internal . SdkInternalList < PolicyAttributeDescription > ( policyAttributeDescriptions . length ) ) ; } for ( PolicyAttributeDescription ele : policyAttributeDescriptions ) { this . policyAttributeDescriptions . ...
public class ConvertUtil { /** * Converts value to Integer if it can . If value is an Integer , it is returned , if it is a Number , it is * promoted to Integer and then returned , in all other cases , it converts the value to String , * then tries to parse Integer from it . * @ param value value to be converted ...
if ( value == null ) { return null ; } else if ( value instanceof Number ) { return ( ( Number ) value ) . intValue ( ) ; } else { NumberFormat nf = new DecimalFormat ( ) ; try { return nf . parse ( value . toString ( ) ) . intValue ( ) ; } catch ( ParseException e ) { throw new ConversionException ( "failed to convert...
public class HttpUtils { /** * Build error message from connection in case of failure * @ param connection HttpURLConnection * @ return String by combining response code , message and error stream * @ throws IOException an IO exception */ public static String buildHttpErrorMessage ( final HttpURLConnection connec...
final StringBuilder messageBuilder = new StringBuilder ( "(" ) . append ( connection . getResponseCode ( ) ) . append ( ")" ) ; if ( connection . getResponseMessage ( ) != null ) { messageBuilder . append ( " " ) ; messageBuilder . append ( connection . getResponseMessage ( ) ) ; } try ( final InputStreamReader isr = n...
public class ScheduleManager { /** * only do this when using external runner */ private synchronized void updateLocal ( ) throws ScheduleManagerException { } }
final List < Schedule > updates = this . loader . loadUpdatedSchedules ( ) ; for ( final Schedule s : updates ) { if ( s . getStatus ( ) . equals ( TriggerStatus . EXPIRED . toString ( ) ) ) { onScheduleExpire ( s ) ; } else { internalSchedule ( s ) ; } }
public class HeaderLinksResponseEntity { /** * Wraps the given { @ link HttpEntity } into a { @ link HeaderLinksResponseEntity } . Will default the status code to * { @ link HttpStatus # OK } if the given value is not a { @ link ResponseEntity } . * @ param entity must not be { @ literal null } . * @ return */ pu...
Assert . notNull ( entity , "Given HttpEntity must not be null!" ) ; if ( entity instanceof ResponseEntity ) { return new HeaderLinksResponseEntity < > ( ( ResponseEntity < S > ) entity ) ; } else { return new HeaderLinksResponseEntity < > ( entity ) ; }
public class UpdateSketch { /** * Wrap takes the sketch image in Memory and refers to it directly . There is no data copying onto * the java heap . Only " Direct " Serialization Version 3 ( i . e , OpenSource ) sketches that have * been explicitly stored as direct objects can be wrapped . * An attempt to " wrap "...
final int preLongs = srcMem . getByte ( PREAMBLE_LONGS_BYTE ) & 0X3F ; final int serVer = srcMem . getByte ( SER_VER_BYTE ) & 0XFF ; final int familyID = srcMem . getByte ( FAMILY_BYTE ) & 0XFF ; final Family family = Family . idToFamily ( familyID ) ; if ( family != Family . QUICKSELECT ) { throw new SketchesArgumentE...
public class RESTServlet { /** * Split the given k = v ( or just k ) param into a Pair object . */ private Pair < String , String > extractParam ( String part ) { } }
int eqInx = part . indexOf ( '=' ) ; String paramName ; String paramValue ; if ( eqInx < 0 ) { paramName = part ; paramValue = null ; } else { paramName = part . substring ( 0 , eqInx ) ; paramValue = part . substring ( eqInx + 1 ) ; } return Pair . create ( paramName , paramValue ) ;
public class StringUtils { /** * Generates a random string of a given length * @ param length The length of the string * @ param min The min character in the string * @ param max The max character in the string * @ return A string of random characters */ public static String randomString ( int length , int min ...
return randomString ( length , min , max , CharMatcher . ANY ) ;
public class EntityREST { /** * Delete an entity identified by its type and unique attributes . * @ param typeName - entity type to be deleted * @ param servletRequest - request containing unique attributes / values * @ return EntityMutationResponse */ @ DELETE @ Consumes ( Servlets . JSON_MEDIA_TYPE ) @ Produces...
AtlasPerfTracer perf = null ; try { Map < String , Object > attributes = getAttributes ( servletRequest ) ; if ( AtlasPerfTracer . isPerfTraceEnabled ( PERF_LOG ) ) { perf = AtlasPerfTracer . getPerfTracer ( PERF_LOG , "EntityREST.deleteByUniqueAttribute(" + typeName + "," + attributes + ")" ) ; } AtlasEntityType entit...
public class FSNamesystem { /** * This is called from the RaidEncodingTaskEncodingMonitor to process * encoding tasks * Each call will poll ( raidEncodingTaskMultiplier * nodes ) stripes from * raidEncodingTasks . * Then for each stripe , it will compute necessary information to encode * the stripe and add en...
// Should not schedule raiding during safe mode if ( isInSafeMode ( ) ) { return ; } final int nodes = heartbeats . size ( ) ; List < RaidBlockInfo > tasksToProcess = new ArrayList < RaidBlockInfo > ( Math . min ( raidEncodingTasks . size ( ) , ReplicationConfigKeys . raidEncodingTaskMultiplier * nodes ) ) ; for ( int ...
public class SAXParser { /** * Parse the content of the given { @ link java . io . InputStream } * instance as XML using the specified * { @ link org . xml . sax . helpers . DefaultHandler } . * @ param is InputStream containing the content to be parsed . * @ param dh The SAX DefaultHandler to use . * @ param...
if ( is == null ) { throw new IllegalArgumentException ( "InputStream cannot be null" ) ; } InputSource input = new InputSource ( is ) ; input . setSystemId ( systemId ) ; this . parse ( input , dh ) ;
public class ExposeLinearLayoutManagerEx { /** * { @ inheritDoc } */ @ Override public int scrollVerticallyBy ( int dy , RecyclerView . Recycler recycler , RecyclerView . State state ) { } }
if ( getOrientation ( ) == HORIZONTAL ) { return 0 ; } return scrollInternalBy ( dy , recycler , state ) ;
public class PemObjectReader { /** * Gets the pem object . * @ param file * the file * @ return the pem object * @ throws IOException * Signals that an I / O exception has occurred . */ public static PemObject getPemObject ( final File file ) throws IOException { } }
PemObject pemObject ; try ( PemReader pemReader = new PemReader ( new InputStreamReader ( new FileInputStream ( file ) ) ) ) { pemObject = pemReader . readPemObject ( ) ; } return pemObject ;
public class VoiceClient { /** * Modify an ongoing call . * This method modifies an ongoing call , identified by " uuid " . Modifications to the call can be one of : * < ul > * < li > Terminate the call ( hangup ) * < li > Mute a call leg ( mute ) * < li > Unmute a call leg ( unmute ) * < li > Earmuff a cal...
return this . modifyCall ( new CallModifier ( uuid , action ) ) ;
public class TypeTransformationParser { /** * A raw type expression must be of the form rawTypeOf ( TTLExp ) */ private boolean validRawTypeOfTypeExpression ( Node expr ) { } }
// The expression must have two children . The rawTypeOf keyword and the // parameter if ( ! checkParameterCount ( expr , Keywords . RAWTYPEOF ) ) { return false ; } // The parameter must be a valid type expression if ( ! validTypeTransformationExpression ( getCallArgument ( expr , 0 ) ) ) { warnInvalidInside ( Keyword...
public class OtpErlangLong { /** * Get this number as a short . * @ return the value of this number , as a short . * @ exception OtpErlangRangeException * if the value is too large to be represented as a short . */ public short shortValue ( ) throws OtpErlangRangeException { } }
final long l = longValue ( ) ; final short i = ( short ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for short: " + val ) ; } return i ;
public class LogPrior { /** * why isn ' t this functionality in enum ? */ private static LogPriorType intToType ( int intPrior ) { } }
LogPriorType [ ] values = LogPriorType . values ( ) ; for ( LogPriorType val : values ) { if ( val . ordinal ( ) == intPrior ) { return val ; } } throw new IllegalArgumentException ( intPrior + " is not a legal LogPrior." ) ;
public class EarGenericBuilder { /** * Generates deployment for given application . * @ param type Module type to generate * @ param basename Base name of module to generate * @ param doFiltering should do basic filtering * @ return EnterpriseArchive containing given module and all dependencies */ public static...
String name = basename + "." + type . getExtension ( ) ; String testJarName = basename + "-tests.jar" ; // LOG . debug ( " Creating Arquillian deployment for [ " + name + " ] " ) ; try { EarDescriptorBuilder descriptorBuilder = new EarDescriptorBuilder ( basename ) ; MavenResolverSystem maven = Maven . resolver ( ) ; /...
public class Code { /** * Returns the local for the parameter at index { @ code index } and of type * { @ code type } . */ public < T > Local < T > getParameter ( int index , TypeId < T > type ) { } }
if ( thisLocal != null ) { index ++ ; // adjust for the hidden ' this ' parameter } return coerce ( parameters . get ( index ) , type ) ;
public class OWLObjectPropertyAssertionAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader ...
deserialize ( streamReader , instance ) ;
public class CachingJobCatalog { /** * { @ inheritDoc } */ @ Override public JobSpec getJobSpec ( URI uri ) throws JobSpecNotFoundException { } }
try { return _cache . getJobSpec ( uri ) ; } catch ( RuntimeException e ) { return _fallback . getJobSpec ( uri ) ; }
public class Ortc { /** * Saves the authentication token channels permissions in the ORTC server . * < pre > * HashMap & lt ; String , LinkedList & lt ; ChannelPermissions & gt ; & gt ; permissions = new HashMap & lt ; String , LinkedList & lt ; ChannelPermissions & gt ; & gt ; ( ) ; * LinkedList & lt ; ChannelPe...
String connectionUrl = url ; if ( isCluster ) { Balancer . getServerFromBalancerAsync ( url , applicationKey , new OnRestWebserviceResponse ( ) { @ Override public void run ( Exception error , String response ) { if ( error != null ) { onCompleted . run ( error , null ) ; } else { saveAuthenticationAsync ( response , a...
public class HttpUtils { /** * Deletes a cookie . * @ param name the name * @ param req HTTP request * @ param res HTTP response */ public static void removeStateParam ( String name , HttpServletRequest req , HttpServletResponse res ) { } }
setRawCookie ( name , "" , req , res , false , 0 ) ;
public class AgentManager { /** * On AgentsEvent create a new Agent . * @ param event generated by Asterisk server . */ void handleAgentsEvent ( AgentsEvent event ) { } }
AsteriskAgentImpl agent = new AsteriskAgentImpl ( server , event . getName ( ) , "Agent/" + event . getAgent ( ) , AgentState . valueOf ( event . getStatus ( ) ) ) ; logger . info ( "Adding agent " + agent . getName ( ) + "(" + agent . getAgentId ( ) + ")" ) ; addAgent ( agent ) ;
public class Address { public static RetrieveRequest retrieve ( ) throws IOException { } }
String uri = uri ( "addresses" ) ; return new RetrieveRequest ( Method . GET , uri ) ;
public class MissingDataHandler { /** * This function fills NA with given values . Default using a scalar value fillNA ( value , null , 0 , null , null , null , * false ) * @ param value a scalar value to fill all NAs * @ param method = ' ffill ' for forward fill or ' bfill ' for backward fill * @ param limit =...
DDF newddf = null ; if ( columns == null ) { columns = this . getDDF ( ) . getColumnNames ( ) ; } if ( method == null ) { String sqlCmd = fillNAWithValueSQL ( value , function , columnsToValues , columns ) ; mLog . info ( "FillNA sql command: " + sqlCmd ) ; newddf = this . getManager ( ) . sql2ddf ( String . format ( s...
public class ListLabelingJobsForWorkteamResult { /** * An array of < code > LabelingJobSummary < / code > objects , each describing a labeling job . * @ param labelingJobSummaryList * An array of < code > LabelingJobSummary < / code > objects , each describing a labeling job . */ public void setLabelingJobSummaryLi...
if ( labelingJobSummaryList == null ) { this . labelingJobSummaryList = null ; return ; } this . labelingJobSummaryList = new java . util . ArrayList < LabelingJobForWorkteamSummary > ( labelingJobSummaryList ) ;
public class Content { /** * Retrieve content map instance . Delegates { @ link # getValue ( Object , String ) } to obtain the requested value . If value * is null warn the event an return empty map . If value is map return it , otherwise throws context exception . * @ param scope scope object , * @ param propert...
Object map = getValue ( scope , propertyPath ) ; if ( map == null ) { warn ( scope . getClass ( ) , propertyPath ) ; return Collections . EMPTY_MAP ; } if ( ! Types . isMap ( map ) ) { throw new TemplateException ( "Invalid type. Expected map but got |%s|." , map . getClass ( ) ) ; } return ( Map < ? , ? > ) map ;
public class CmsLuceneDocument { /** * Adds a field to this document . < p > * @ param f the field to add */ private void add ( Field f ) { } }
m_fields . put ( f . name ( ) , f ) ; m_doc . add ( f ) ;
public class ParsingExpression { /** * parse a day number ( 0 = sunday ) and put it in the private _ day attribute * @ return boolean */ private boolean _readChar ( ) { } }
int endIndex = pos + 1 ; if ( endIndex <= len ) { _char = text . substring ( pos , endIndex ) ; pos ++ ; return true ; } pos = len ; return false ;
public class SubmissionUtils { /** * Re - creates the document submitted by the client from * the submission document . * @ param submissionDoc Submission document from the submission database * @ return Document submitted by user for update */ static public JSONObject getSubmittedDocumentFromSubmission ( JSONObj...
JSONObject submissionInfo = submissionDoc . getJSONObject ( "nunaliit_submission" ) ; JSONObject doc = submissionInfo . getJSONObject ( "submitted_doc" ) ; JSONObject reserved = submissionInfo . optJSONObject ( "submitted_reserved" ) ; return recreateDocumentFromDocAndReserved ( doc , reserved ) ;
public class LessLockingUniversalPgSQLQueueFactory { /** * { @ inheritDoc } */ @ Override protected LessLockingUniversalPgSQLQueue createQueueInstance ( final QueueSpec spec ) { } }
LessLockingUniversalPgSQLQueue queue = new LessLockingUniversalPgSQLQueue ( ) ; queue . setFifo ( defaultFifo ) ; Boolean fifo = spec . getField ( SPEC_FIELD_FIFO , Boolean . class ) ; if ( fifo != null ) { queue . setFifo ( fifo . booleanValue ( ) ) ; } return queue ;
public class Targeting { /** * Gets the technologyTargeting value for this Targeting . * @ return technologyTargeting * Specifies the browsing technologies that are targeted by the * { @ link LineItem } . This attribute is optional . */ public com . google . api . ads . admanager . axis . v201808 . TechnologyTarget...
return technologyTargeting ;
public class WhiteboxImpl { /** * Set the value of a field using reflection . This method will traverse the * super class hierarchy until the first field assignable to the * < tt > value < / tt > type is found . The < tt > value < / tt > ( or * < tt > additionaValues < / tt > if present ) will then be assigned to...
setField ( object , value , findFieldInHierarchy ( object , new AssignableFromFieldTypeMatcherStrategy ( getType ( value ) ) ) ) ; if ( additionalValues != null && additionalValues . length > 0 ) { for ( Object additionalValue : additionalValues ) { setField ( object , additionalValue , findFieldInHierarchy ( object , ...
public class FSM2MealyParserAlternating { /** * Creates the actual Mealy machine transitions . * @ throws FSMParseException * when the Mealy machine is partial . */ @ Override protected void checkTransitions ( StreamTokenizer streamTokenizer ) throws FSMParseException { } }
// Only if no states are defined we add all from the transitions we found . // This is necessary because states are not necessarily defined in FSMs . if ( getStates ( ) . isEmpty ( ) ) { getStates ( ) . addAll ( transitionsFSM . keySet ( ) ) ; } // copy the set of states final Set < Integer > newStates = new HashSet < ...
public class Ssh2Context { /** * Set the preferred mac for the Client - > Server stream . * @ param name * @ throws SshException */ public void setPreferredMacCS ( String name ) throws SshException { } }
if ( name == null ) return ; if ( macCS . contains ( name ) ) { prefMacCS = name ; setMacPreferredPositionCS ( name , 0 ) ; } else { throw new SshException ( name + " is not supported" , SshException . UNSUPPORTED_ALGORITHM ) ; }
public class DeepWaterModelV3 { /** * Version & Schema - specific filling into the impl */ @ Override public DeepWaterModel createImpl ( ) { } }
DeepWaterParameters parms = parameters . createImpl ( ) ; return new DeepWaterModel ( Key . < DeepWaterModel > make ( ) /* dest */ , parms , new DeepWaterModelOutput ( null ) , null , null , 0 ) ;
public class MutationState { /** * Add one or more { @ link DocumentFragment DocumentFragments } to this { @ link MutationState } . * @ param documentFragments the fragments where the tokens are extracted from . * @ return the modified { @ link MutationState } . */ public MutationState add ( DocumentFragment ... do...
if ( documentFragments == null || documentFragments . length == 0 ) { throw new IllegalArgumentException ( "At least one DocumentFragment must be provided." ) ; } for ( DocumentFragment d : documentFragments ) { addToken ( d . mutationToken ( ) ) ; } return this ;
public class CmsUpdateDBDropOldIndexes { /** * Gets the indexes for a table . < p > * @ param dbCon the db connection interface * @ param tablename the table to get the indexes from * @ return a list of indexes * @ throws SQLException if somehting goes wrong */ private List < String > getIndexes ( CmsSetupDb db...
List < String > indexes = new ArrayList < String > ( ) ; String tableIndex = readQuery ( QUERY_SHOW_INDEX ) ; Map < String , String > replacer = new HashMap < String , String > ( ) ; replacer . put ( REPLACEMENT_TABLENAME , tablename ) ; CmsSetupDBWrapper db = null ; try { db = dbCon . executeSqlStatement ( tableIndex ...
public class OjbTagsHandler { /** * Processes all classes ( flattens the hierarchy such that every class has declarations for all fields , * references , collections that it will have in the descriptor ) and applies modifications ( removes ignored * features , changes declarations ) . * @ return An empty string ...
String checkLevel = ( String ) getDocletContext ( ) . getConfigParam ( CONFIG_PARAM_CHECKS ) ; ArrayList queue = new ArrayList ( ) ; ClassDescriptorDef classDef , baseDef ; XClass original ; boolean isFinished ; // determine inheritance relationships for ( Iterator it = _model . getClasses ( ) ; it . hasNext ( ) ; ) { ...
public class image { /** * Get the screen height . * @ param context * @ return the screen height */ @ SuppressWarnings ( "deprecation" ) @ SuppressLint ( "NewApi" ) public static int getScreenHeight ( Activity context ) { } }
Display display = context . getWindowManager ( ) . getDefaultDisplay ( ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB_MR2 ) { Point size = new Point ( ) ; display . getSize ( size ) ; return size . y ; } return display . getHeight ( ) ;
public class Token { /** * Returns whether a specified character is the token symbol . * @ param c a character * @ return true , if a specified character is one of the token symbols */ public static boolean isTokenSymbol ( char c ) { } }
return ( c == BEAN_SYMBOL || c == TEMPLATE_SYMBOL || c == PARAMETER_SYMBOL || c == ATTRIBUTE_SYMBOL || c == PROPERTY_SYMBOL ) ;
public class ClassDescriptorDef { /** * Checks the constraints on this class . * @ param checkLevel The amount of checks to perform * @ exception ConstraintException If a constraint has been violated */ public void checkConstraints ( String checkLevel ) throws ConstraintException { } }
// now checking constraints FieldDescriptorConstraints fieldConstraints = new FieldDescriptorConstraints ( ) ; ReferenceDescriptorConstraints refConstraints = new ReferenceDescriptorConstraints ( ) ; CollectionDescriptorConstraints collConstraints = new CollectionDescriptorConstraints ( ) ; for ( Iterator it = getField...
public class CertificateChainUtil { /** * Take a chain and return a ( Read - only ) chain with the root certificate as the first entry * @ param chain * a chain with the certificates in order ( either leading away from root or leading towards root ) * @ return a read - only chain leading away from the root certif...
if ( chain == null || chain . isEmpty ( ) ) throw new IllegalArgumentException ( "Must provide a chain that is non-null and non-empty" ) ; final List < X509Certificate > out ; // Sort the list so the root certificate comes first if ( ! isSelfSigned ( chain . get ( 0 ) ) ) { // Copy the chain List so we can modify it ou...
public class DataIO { /** * Print a CSTable to a PrintWriter * @ param table the table to print * @ param out the writer to write to */ public static void print ( CSTable table , PrintWriter out ) { } }
out . println ( TABLE + "," + CSVParser . printLine ( table . getName ( ) ) ) ; for ( String key : table . getInfo ( ) . keySet ( ) ) { out . println ( CSVParser . printLine ( key , table . getInfo ( ) . get ( key ) ) ) ; } if ( table . getColumnCount ( ) < 1 ) { out . flush ( ) ; return ; } out . print ( HEADER ) ; fo...
public class DataStream { /** * Creates a new { @ link ConnectedStreams } by connecting * { @ link DataStream } outputs of ( possible ) different types with each other . * The DataStreams connected using this operator can be used with * CoFunctions to apply joint transformations . * @ param dataStream * The D...
return new ConnectedStreams < > ( environment , this , dataStream ) ;
public class UpdateDocumentationVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateDocumentationVersionRequest updateDocumentationVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateDocumentationVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDocumentationVersionRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( updateDocumentationVersionRequest . getDoc...
public class OffsetDateTime { /** * Returns a copy of this { @ code OffsetDateTime } with the specified number of nanoseconds subtracted . * This instance is immutable and unaffected by this method call . * @ param nanos the nanos to subtract , may be negative * @ return an { @ code OffsetDateTime } based on this...
return ( nanos == Long . MIN_VALUE ? plusNanos ( Long . MAX_VALUE ) . plusNanos ( 1 ) : plusNanos ( - nanos ) ) ;
public class BaseStatefulWindowedBolt { /** * { @ inheritDoc } */ @ Override public BaseStatefulWindowedBolt < T > withWindow ( Count windowLength , Count slidingInterval ) { } }
super . withWindow ( windowLength , slidingInterval ) ; return this ;
public class AbstractJaxRsWebEndpoint { /** * Configure common endpoint properties * @ param endpointInfo */ protected void configureEndpointInfoProperties ( EndpointInfo libertyEndpointInfo , org . apache . cxf . service . model . EndpointInfo cxfEndpointInfo ) { } }
// Disable jaxb validation event handler , as IBM FastPath does not support this , which will finally fallback to RI unmarshall cxfEndpointInfo . setProperty ( SET_JAXB_VALIDATION_EVENT_HANDLER , false ) ; // / / Set autoRewriteSoapAddressForAllServices with true by default , which will override all the services in the...
public class XDMClientChildSbb { /** * ( non - Javadoc ) * @ see * org . restcomm . slee . enabler . xdmc . XDMClientControl # putIfMatch ( java . net . URI , * java . lang . String , java . lang . String , byte [ ] , * Credentials ) */ public void putIfMatch ( URI uri , String eTag , String mimetype , byte [ ]...
putIfMatch ( uri , eTag , mimetype , content , null , credentials ) ;
public class InternalUtilities { /** * getJavaTargetVersionFromPom , Returns a string with the java " target " version , as it was * specified in the pom file at compile time . */ public static String getJavaTargetVersionFromPom ( ) { } }
try { Properties properties = new Properties ( ) ; ClassLoader classLoader = ClassLoader . getSystemClassLoader ( ) ; properties . load ( classLoader . getResourceAsStream ( "project.properties" ) ) ; return "" + properties . getProperty ( "targetJavaVersion" ) ; } catch ( Exception ex ) { return "" ; }
public class RectifyImageOps { /** * Creates a transform that applies rectification to unrectified distorted pixels and outputs * normalized pixel coordinates . * @ param param Intrinsic parameters . * @ param rectify Transform for rectifying the image . * @ param rectifyK Camera calibration matrix after rectif...
return ImplRectifyImageOps_F32 . transformPixelToRectNorm ( param , rectify , rectifyK ) ;
public class OutlookMessage { /** * Sets the name / value pair in the { @ link # properties } map . Some properties are put into special attributes ( e . g . , { @ link # toEmail } when the property name * is ' 0076 ' ) . */ public void setProperty ( final OutlookMessageProperty msgProp ) { } }
final String name = msgProp . getClazz ( ) ; final Object value = msgProp . getData ( ) ; if ( name == null || value == null ) { return ; } // Most fields expect a String representation of the value final String stringValue = convertValueToString ( value ) ; int mapiClass = - 1 ; try { mapiClass = Integer . parseInt ( ...
public class ConfigRESTHandler { /** * Validates configuration of a resource and returns the result as a JSON object . * @ param uid unique identifier . * @ param config configuration of a resource instance . * @ param processed configurations that have already been processed - - to prevent stack overflow from ci...
String configDisplayId = ( String ) config . get ( "config.displayId" ) ; boolean isFactoryPid ; String configElementName ; if ( isFactoryPid = configDisplayId . endsWith ( "]" ) ) { // factory pid int end = configDisplayId . lastIndexOf ( '[' ) ; int begin = configDisplayId . lastIndexOf ( '/' , end ) + 1 ; configElem...
public class ResultSetMetadataMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ResultSetMetadata resultSetMetadata , ProtocolMarshaller protocolMarshaller ) { } }
if ( resultSetMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resultSetMetadata . getColumnInfo ( ) , COLUMNINFO_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . ge...
public class P2sVpnServerConfigurationsInner { /** * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn ' t exist else updates the existing P2SVpnServerConfiguration . * @ param resourceGroupName The resource group name of the VirtualWan . * @ param virtualWanName The name of the Virtual...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( virtual...
public class HttpRequestExecutor { /** * Creates and returns a GET { @ link HttpRequest } instance * for the given < tt > path < / tt > over the internal hostname . * @ param path Path of the request to build . * @ return Built GET request . * @ throws IOException If any error occurs while creating the GET requ...
final GenericUrl url = getURL ( path ) ; return requestFactory . buildGetRequest ( url ) ;
public class BigRational { /** * Calculates the division ( / ) of this rational number and the specified argument . * < p > This is functionally identical to * < code > this . divide ( BigRational . valueOf ( value ) ) < / code > * but slightly faster . < / p > * < p > The result has no loss of precision . < / ...
if ( value . equals ( BigInteger . ONE ) ) { return this ; } return divide ( new BigDecimal ( value ) ) ;
public class VocabConstructor { /** * This method transfers existing WordVectors model into current one * @ param wordVectors * @ return */ @ SuppressWarnings ( "unchecked" ) // method is safe , since all calls inside are using generic SequenceElement methods public VocabCache < T > buildMergedVocabulary ( @ NonNul...
return buildMergedVocabulary ( ( VocabCache < T > ) wordVectors . vocab ( ) , fetchLabels ) ;
public class DTMDefaultBase { /** * Get the parent for the given node identity . * @ param identity The node identity . * @ return The parent identity , or DTM . NULL . */ protected int _parent ( int identity ) { } }
if ( identity < m_size ) return m_parent . elementAt ( identity ) ; // Check to see if the information requested has been processed , and , // if not , advance the iterator until we the information has been // processed . while ( true ) { boolean isMore = nextNode ( ) ; if ( identity >= m_size && ! isMore ) return NULL...
public class StackdriverExporter { /** * Registers the { @ code StackdriverExporter } . * @ param spanExporter the instance of the { @ code SpanExporter } where this service is registered . */ @ VisibleForTesting static void register ( SpanExporter spanExporter , Handler handler ) { } }
StackdriverTraceExporter . register ( spanExporter , handler ) ;
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setBPSimData ( BPSimDataType newBPSimData ) { } }
( ( FeatureMap . Internal ) getMixed ( ) ) . set ( BpsimPackage . Literals . DOCUMENT_ROOT__BP_SIM_DATA , newBPSimData ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcProjectOrderRecordTypeEnum ( ) { } }
if ( ifcProjectOrderRecordTypeEnumEEnum == null ) { ifcProjectOrderRecordTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 874 ) ; } return ifcProjectOrderRecordTypeEnumEEnum ;
public class MurmurHash3 { /** * Gets a long from the given byte array starting at the given byte array index and continuing for * remainder ( rem ) bytes . The bytes are extracted in little - endian order . There is no limit * checking . * @ param bArr The given input byte array . * @ param index Zero - based ...
long out = 0L ; for ( int i = rem ; i -- > 0 ; ) { // i = 7,6,5,4,3,2,1,0 final byte b = bArr [ index + i ] ; out ^= ( b & 0xFFL ) << ( i * 8 ) ; // equivalent to | = } return out ;