signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HttpCookie { /** * Reports whether this http cookie has expired or not . * @ return < tt > true < / tt > to indicate this http cookie has expired ; * otherwise , < tt > false < / tt > */ public boolean hasExpired ( ) { } }
if ( maxAge == 0 ) return true ; // if not specify max - age , this cookie should be // discarded when user agent is to be closed , but // it is not expired . if ( maxAge == MAX_AGE_UNSPECIFIED ) return false ; long deltaSecond = ( System . currentTimeMillis ( ) - whenCreated ) / 1000 ; if ( deltaSecond > maxAge ) retu...
public class Resolve { /** * where */ private Symbol findMethod ( Env < AttrContext > env , Type site , Name name , List < Type > argtypes , List < Type > typeargtypes , Type intype , Symbol bestSoFar , boolean allowBoxing , boolean useVarargs , boolean operator ) { } }
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) List < Type > [ ] itypes = ( List < Type > [ ] ) new List [ ] { List . < Type > nil ( ) , List . < Type > nil ( ) } ; InterfaceLookupPhase iphase = InterfaceLookupPhase . ABSTRACT_OK ; for ( TypeSymbol s : superclasses ( intype ) ) { bestSoFar = findMethodInScope ( en...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcIndexedPolygonalFace ( ) { } }
if ( ifcIndexedPolygonalFaceEClass == null ) { ifcIndexedPolygonalFaceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 320 ) ; } return ifcIndexedPolygonalFaceEClass ;
public class SimplePasswordAuthenticator { /** * { @ inheritDoc } */ public boolean authenticate ( String pUser , String pPassword , ServerSession pSession ) { } }
return pUser != null && pUser . equals ( user ) && password . equals ( pPassword ) ;
public class RegionInstanceGroupClient { /** * Retrieves the list of instance group resources contained within the specified region . * < p > Sample code : * < pre > < code > * try ( RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient . create ( ) ) { * ProjectRegionName region = Pro...
ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest . newBuilder ( ) . setRegion ( region == null ? null : region . toString ( ) ) . build ( ) ; return listRegionInstanceGroups ( request ) ;
public class ST_ProjectPoint { /** * Project a point on a linestring or multilinestring * @ param point * @ param geometry * @ return */ public static Point projectPoint ( Geometry point , Geometry geometry ) { } }
if ( point == null || geometry == null ) { return null ; } if ( point . getDimension ( ) == 0 && geometry . getDimension ( ) == 1 ) { LengthIndexedLine ll = new LengthIndexedLine ( geometry ) ; double index = ll . project ( point . getCoordinate ( ) ) ; return geometry . getFactory ( ) . createPoint ( ll . extractPoint...
public class WorkerDao { /** * Gets the status of each worker . The status contains the partitionId being consumed . This information * helps the next worker bind to an unconsumed partition * @ param plan * @ param otherWorkers * @ return * @ throws WorkerDaoException */ public List < WorkerStatus > findAllWo...
List < WorkerStatus > results = new ArrayList < WorkerStatus > ( ) ; try { Stat preCheck = framework . getCuratorFramework ( ) . checkExists ( ) . forPath ( PLAN_WORKERS_ZK + "/" + plan . getName ( ) ) ; if ( preCheck == null ) { return results ; } } catch ( Exception e1 ) { LOGGER . warn ( e1 ) ; throw new WorkerDaoEx...
public class ConfigurationTree { /** * Search value by unique type declaration . * < pre > { @ code class Config extends Configuration { * SubOne sub1 = . . . * SubTwo sub2 = . . . * SubTwoExt sub3 = . . . / / SubTwoExt extends SubTwo * } } < / pre > * { @ code valueByUniqueDeclaredType ( SubOne . class ) =...
return ( K ) uniqueTypePaths . stream ( ) . filter ( it -> type . equals ( it . getDeclaredType ( ) ) ) . findFirst ( ) . map ( ConfigPath :: getValue ) . orElse ( null ) ;
public class UniverseApi { /** * Get item category information ( asynchronously ) Get information of an item * category - - - This route expires daily at 11:05 * @ param categoryId * An Eve item category ID ( required ) * @ param acceptLanguage * Language to use in the response ( optional , default to en - us...
com . squareup . okhttp . Call call = getUniverseCategoriesCategoryIdValidateBeforeCall ( categoryId , acceptLanguage , datasource , ifNoneMatch , language , callback ) ; Type localVarReturnType = new TypeToken < CategoryResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ...
public class Assistant { /** * Update workspace . * Update an existing workspace with new or modified data . You must provide component objects defining the content of * the updated workspace . * This operation is limited to 30 request per 30 minutes . For more information , see * * Rate limiting * * . * @ para...
Validator . notNull ( updateWorkspaceOptions , "updateWorkspaceOptions cannot be null" ) ; String [ ] pathSegments = { "v1/workspaces" } ; String [ ] pathParameters = { updateWorkspaceOptions . workspaceId ( ) } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pat...
public class RebindSafeMBeanServer { /** * Delegates to the wrapped mbean server , but if a mbean is already registered * with the specified name , the existing instance is returned . */ @ Override public ObjectInstance registerMBean ( Object object , ObjectName name ) throws MBeanRegistrationException , NotCompliant...
while ( true ) { try { // try to register the mbean return mbeanServer . registerMBean ( object , name ) ; } catch ( InstanceAlreadyExistsException ignored ) { } try { // a mbean is already installed , try to return the already registered instance ObjectInstance objectInstance = mbeanServer . getObjectInstance ( name )...
public class JSONArray { /** * Append an object value . This increases the array ' s length by one . * @ param value * An object value . The value should be a Boolean , Double , * Integer , JSONArray , JSONObject , Long , or String , or the * JSONObject . NULL object . * @ return this . * @ throws JSONExcep...
JSONObject . testValidity ( value ) ; this . myArrayList . add ( value ) ; return this ;
public class Parser { /** * Jump over leading spaces * Custom match methods normally call this before trying to match anything * @ param textProvider */ public void clearLeadingSpaces ( TextProvider textProvider ) { } }
while ( true ) { mark ( textProvider ) ; char c ; try { c = getNextChar ( textProvider ) ; } catch ( ExceededBufferSizeException e ) { return ; } catch ( ParserException e ) { // ignore problems at this point return ; } if ( c == 0 ) { if ( m_textProviderStack . size ( ) > 0 ) { textProvider . close ( ) ; textProvider ...
public class ListenerCollection { /** * Removes the listener as a listener of the specified type . * @ param < T > the type of the listener to be removed * @ param type the type of the listener to be removed * @ param listener the listener to be removed */ public synchronized < T extends EventListener > void remo...
assert listener != null ; // Is l on the list ? int index = - 1 ; for ( int i = this . listeners . length - 2 ; i >= 0 ; i -= 2 ) { if ( ( this . listeners [ i ] == type ) && ( this . listeners [ i + 1 ] . equals ( listener ) ) ) { index = i ; break ; } } // If so , remove it if ( index != - 1 ) { final Object [ ] tmp ...
public class RESTReflect { /** * Finds path parameters based on { @ link javax . ws . rs . PathParam } annotation . * @ param baseParam the base parameter URI * @ param method the method to scan * @ return the map of parameter URI by parameter name */ static Map < String , String > findPathParams ( String basePar...
Map < String , String > hrefVars = new HashMap < > ( ) ; for ( Annotation [ ] paramAnnotations : method . getParameterAnnotations ( ) ) { for ( Annotation paramAnnotation : paramAnnotations ) { if ( paramAnnotation . annotationType ( ) . equals ( PathParam . class ) ) { String varName = ( ( PathParam ) paramAnnotation ...
public class AbstractCacheConfig { /** * Remove a configuration for a { @ link javax . cache . event . CacheEntryListener } . * @ param cacheEntryListenerConfiguration the { @ link CacheEntryListenerConfiguration } to remove * @ return the { @ link CacheConfig } */ @ Override public CacheConfiguration < K , V > rem...
checkNotNull ( cacheEntryListenerConfiguration , "CacheEntryListenerConfiguration can't be null" ) ; DeferredValue < CacheEntryListenerConfiguration < K , V > > lazyConfig = DeferredValue . withValue ( cacheEntryListenerConfiguration ) ; listenerConfigurations . remove ( lazyConfig ) ; return this ;
public class Disposables { /** * Performs null checks and disposes of assets . Ignores exceptions . * @ param disposables its values will be disposed of ( if they exist ) . Can be null . */ public static void gracefullyDisposeOf ( final Map < ? , ? extends Disposable > disposables ) { } }
if ( disposables != null ) { for ( final Disposable disposable : disposables . values ( ) ) { gracefullyDisposeOf ( disposable ) ; } }
public class AlertApi { /** * Delete Alert Attachment * Delete alert attachment for the given identifier * @ param params . identifier Identifier of alert which could be alert id , tiny id or alert alias ( required ) * @ param params . attachmentId Identifier of alert attachment ( required ) * @ param params . ...
String identifier = params . getIdentifier ( ) ; Long attachmentId = params . getAttachmentId ( ) ; String alertIdentifierType = params . getAlertIdentifierType ( ) . getValue ( ) ; String user = params . getUser ( ) ; Object localVarPostBody = null ; // verify the required parameter ' identifier ' is set if ( identifi...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ValuePropertyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link ValuePropertyType } { @ code >...
return new JAXBElement < ValuePropertyType > ( _ValueComponent_QNAME , ValuePropertyType . class , null , value ) ;
public class SecretsManager { /** * Obtain a secret ' s metadata . This requires the permission < code > secretsmanager : DescribeSecret < / code > * @ param secretId the ARN of the secret * @ return the secret ' s metadata */ public DescribeSecretResult describeSecret ( final String secretId ) { } }
final DescribeSecretRequest describeSecretRequest = new DescribeSecretRequest ( ) ; describeSecretRequest . setSecretId ( secretId ) ; return getDelegate ( ) . describeSecret ( describeSecretRequest ) ;
public class ConnectorServiceImpl { /** * Declarative Services method for unsetting the executor service reference . * @ param ref reference to the service */ protected void unsetExecutor ( ServiceReference < ExecutorService > ref ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetExecutor" , ref ) ; execSvcRef . unsetReference ( ref ) ;
public class ManagementLocksInner { /** * Creates or updates a management lock at the subscription level . * When you apply a lock at a parent scope , all child resources inherit the same lock . To create management locks , you must have access to Microsoft . Authorization / * or Microsoft . Authorization / locks / *...
return ServiceFuture . fromResponse ( createOrUpdateAtSubscriptionLevelWithServiceResponseAsync ( lockName , parameters ) , serviceCallback ) ;
public class EJSLocalWrapper { /** * Get the primary key associated with this wrapper . < p > * This method is part of the EJBLocalObject interface . * @ return an < code > Object < / code > containing primary key of * this wrapper . */ public Object getPrimaryKey ( ) throws javax . ejb . EJBException { } }
HomeInternal hi = beanId . getHome ( ) ; if ( hi . isStatelessSessionHome ( ) || hi . isStatefulSessionHome ( ) ) { throw new IllegalSessionMethodLocalException ( ) ; } // PK26539 : copy the primary key ( see WASInternal _ copyPrimaryKey for explanation ) return ( ( EJSHome ) hi ) . WASInternal_copyPrimaryKey ( beanId ...
public class Selection { /** * Move the selection edge to offset < code > index < / code > . */ public static final void extendSelection ( Spannable text , int index ) { } }
if ( text . getSpanStart ( SELECTION_END ) != index ) text . setSpan ( SELECTION_END , index , index , Spanned . SPAN_POINT_POINT ) ;
public class SimulatorTaskTracker { /** * Called once at the start of the simulation . * @ param when Time when the task tracker starts . * @ return the initial HeartbeatEvent for ourselves . */ public List < SimulatorEvent > init ( long when ) { } }
LOG . debug ( "TaskTracker starting up, current simulation time=" + when ) ; return Collections . < SimulatorEvent > singletonList ( new HeartbeatEvent ( this , when ) ) ;
public class LongFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < R > LongFunctionBuilder < R > longFunction ( Consumer < LongFunction < R > > consumer...
return new LongFunctionBuilder ( consumer ) ;
public class CorsRuleMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CorsRule corsRule , ProtocolMarshaller protocolMarshaller ) { } }
if ( corsRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( corsRule . getAllowedOrigins ( ) , ALLOWEDORIGINS_BINDING ) ; protocolMarshaller . marshall ( corsRule . getAllowedMethods ( ) , ALLOWEDMETHODS_BINDING ) ; protocolMarshaller ....
public class Mockito { /** * Same as { @ link # doReturn ( Object ) } but sets consecutive values to be returned . Remember to use * < code > doReturn ( ) < / code > in those rare occasions when you cannot use { @ link Mockito # when ( Object ) } . * < b > Beware that { @ link Mockito # when ( Object ) } is always ...
"unchecked" , "varargs" } ) @ CheckReturnValue public static Stubber doReturn ( Object toBeReturned , Object ... toBeReturnedNext ) { return MOCKITO_CORE . stubber ( ) . doReturn ( toBeReturned , toBeReturnedNext ) ;
public class ImageRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public ByteArrayInputStream getImage ( String jsonModels ) throws JsonProcessingException , ApiException { } }
return getImage ( null , null , jsonModels ) ;
public class Util { /** * Checks that two bytes are the same , while generating * a formatted error message if they are not . The error * message will indicate the hex value of the bytes if * they do not match . * @ param expected the expected value * @ param actual the actual value * @ throws IOException i...
if ( expected != actual ) throw new IOException ( "check expected " + Integer . toHexString ( 0xff & expected ) + ", found " + Integer . toHexString ( 0xff & actual ) ) ;
public class SubnetUtils { /** * Convert a packed integer address into a 4 - element array */ private int [ ] toArray ( int val ) { } }
int [ ] ret = new int [ 4 ] ; for ( int j = 3 ; j >= 0 ; -- j ) { ret [ j ] |= ( ( val >>> 8 * ( 3 - j ) ) & ( 0xff ) ) ; } return ret ;
import java . util . ArrayList ; import java . util . Collections ; class CheckAscending { /** * This function checks if a list of numbers is sorted in ascending order or not . * > > > is _ ascending ( [ 1 , 2 , 3 , 4 ] ) * True * > > > is _ ascending ( [ 4 , 3 , 2 , 1 ] ) * False * > > > is _ ascending ( [ 0...
ArrayList < Integer > sortedSequence = new ArrayList < > ( sequence ) ; Collections . sort ( sortedSequence ) ; return sequence . equals ( sortedSequence ) ;
public class BioPAXIOHandlerAdapter { /** * Similar to { @ link BioPAXIOHandler # convertToOWL ( org . biopax . paxtools . model . Model , * java . io . OutputStream ) } ( org . biopax . paxtools . model . Model , Object ) } , but * extracts a sub - model , converts it into BioPAX ( OWL ) format , * and writes it...
if ( ids . length == 0 ) { convertToOWL ( model , outputStream ) ; } else { Model m = model . getLevel ( ) . getDefaultFactory ( ) . createModel ( ) ; m . setXmlBase ( model . getXmlBase ( ) ) ; Fetcher fetcher = new Fetcher ( SimpleEditorMap . get ( model . getLevel ( ) ) ) ; // no Filters anymore for ( String uri : i...
public class Parser { /** * full parser to deal with . */ private static boolean hasUnsafeChars ( String s ) { } }
for ( int i = 0 ; i < s . length ( ) ; ++ i ) { char c = s . charAt ( i ) ; if ( Character . isLetter ( c ) || c == '.' ) continue ; else return true ; } return false ;
public class SyncMapItem { /** * Create a SyncMapItemCreator to execute create . * @ param pathServiceSid The service _ sid * @ param pathMapSid The map _ sid * @ param key The unique user - defined key of this Map Item . * @ param data Contains arbitrary user - defined , schema - less data that this Map * It...
return new SyncMapItemCreator ( pathServiceSid , pathMapSid , key , data ) ;
public class CassandraSchemaManager { /** * On set key validation . * @ param cfDef * the cf def * @ param cfProperties * the cf properties * @ param builder * the builder */ private void onSetKeyValidation ( CfDef cfDef , Properties cfProperties , StringBuilder builder ) { } }
String keyValidationClass = cfProperties . getProperty ( CassandraConstants . KEY_VALIDATION_CLASS ) ; if ( keyValidationClass != null ) { if ( builder != null ) { // nothing available . } else { cfDef . setKey_validation_class ( keyValidationClass ) ; } }
public class LollipopDrawablesCompat { /** * Create a drawable from an inputstream , using the given resources and value to determine * density information . */ public static Drawable createFromResourceStream ( Resources res , TypedValue value , InputStream is , String srcName , BitmapFactory . Options opts ) { } }
return Drawable . createFromResourceStream ( res , value , is , srcName , opts ) ;
public class MapTilePathModel { /** * MapTilePath */ @ Override public void loadPathfinding ( Media pathfindingConfig ) { } }
final Collection < PathCategory > config = PathfindingConfig . imports ( pathfindingConfig ) ; categories . clear ( ) ; for ( final PathCategory category : config ) { categories . put ( category . getName ( ) , category ) ; } for ( int ty = 0 ; ty < map . getInTileHeight ( ) ; ty ++ ) { for ( int tx = 0 ; tx < map . ge...
public class UsersWriter { /** * Append roles to the builder . * @ param builder the builder * @ param user the user whose roles are appended */ private void appendRoles ( final StringBuilder builder , final User user ) { } }
for ( final UserRoleName role : user . getRoles ( ) ) { append ( builder , "," , role . name ( ) ) ; }
public class ImplementationImpl { /** * Create a new < code > DList < / code > object . * @ return The new < code > DList < / code > object . * @ see DList */ public DList newDList ( ) { } }
if ( ( getCurrentDatabase ( ) == null ) ) { throw new DatabaseClosedException ( "Database is NULL, cannot create a DList with a null database." ) ; } return ( DList ) DListFactory . singleton . createCollectionOrMap ( getCurrentPBKey ( ) ) ;
public class Row { /** * move to be the last item of parent */ public void moveLastChild ( Row newParent ) { } }
if ( this == newParent ) return ; // remove from its current position Row parentItem = m_parent ; if ( parentItem == null ) parentItem = this . treeTable . m_rootItem ; parentItem . getChilds ( ) . remove ( this ) ; // DOM . removeChild ( m _ body , m _ tr ) ; if ( newParent == null ) newParent = this . treeTable . m_r...
public class NamedArgumentDefinition { /** * populated with the actual value and tags and attributes provided by the user for that argument . */ private Object getValuePopulatedWithTags ( final String originalTag , final String stringValue ) { } }
// See if the value is a surrogate key in the tag parser ' s map that was placed there during preprocessing , // and if so , unpack the values retrieved via the key and use those to populate the field final Object value = constructFromString ( stringValue , getLongName ( ) ) ; if ( TaggedArgument . class . isAssignable...
public class InternalRoles { /** * Remove a role from a user . * @ param username * The username of the user . * @ param oldrole * The role to remove from the user . * @ throws RolesException * if there was an error during removal . */ @ Override public void removeRole ( String username , String oldrole ) t...
List < String > users_with_role = new ArrayList < String > ( ) ; if ( user_list . containsKey ( username ) ) { List < String > roles_of_user = user_list . get ( username ) ; if ( roles_of_user . contains ( oldrole ) ) { // Update our user list roles_of_user . remove ( oldrole ) ; user_list . put ( username , roles_of_u...
public class JHtmlEditor { /** * Create the hyperlink listener . * @ return The hyperlink listener . */ public HyperlinkListener createHyperLinkListener ( ) { } }
return new HyperlinkListener ( ) { public void hyperlinkUpdate ( HyperlinkEvent e ) { if ( e . getEventType ( ) == HyperlinkEvent . EventType . ACTIVATED ) { if ( e instanceof HTMLFrameHyperlinkEvent ) { ( ( HTMLDocument ) getDocument ( ) ) . processHTMLFrameHyperlinkEvent ( ( HTMLFrameHyperlinkEvent ) e ) ; } else { U...
public class AppConfig { /** * Merge application configurator settings . Note application configurator * settings has lower priority as it ' s hardcoded thus only when configuration file * does not provided the settings , the app configurator will take effect * @ param conf * the application configurator */ pub...
app . emit ( SysEventId . CONFIG_PREMERGE ) ; if ( mergeTracker . contains ( conf ) ) { return ; } mergeTracker . add ( conf ) ; for ( Method method : AppConfig . class . getDeclaredMethods ( ) ) { boolean isPrivate = Modifier . isPrivate ( method . getModifiers ( ) ) ; if ( isPrivate && method . getName ( ) . startsWi...
public class SparseUndirectedEdgeSet { /** * { @ inheritDoc } */ public boolean contains ( Object o ) { } }
if ( o instanceof Edge ) { Edge e = ( Edge ) o ; int toFind = 0 ; if ( e . to ( ) == rootVertex ) toFind = e . from ( ) ; else if ( e . from ( ) == rootVertex ) toFind = e . to ( ) ; else return false ; boolean b = edges . contains ( toFind ) ; return b ; } return false ;
public class AxesChartSeriesNumericalNoErrorBars { /** * Finds the min and max of a dataset accounting for error bars * @ param data * @ param errorBars * @ return */ private double [ ] findMinMaxWithErrorBars ( double [ ] data , double [ ] errorBars ) { } }
double min = Double . MAX_VALUE ; double max = - Double . MAX_VALUE ; for ( int i = 0 ; i < data . length ; i ++ ) { double d = data [ i ] ; double eb = errorBars [ i ] ; if ( d - eb < min ) { min = d - eb ; } if ( d + eb > max ) { max = d + eb ; } } return new double [ ] { min , max } ;
public class CfgParser { /** * Compute the marginal distribution over all grammar entries conditioned on * the given sequence of terminals . */ public CfgParseChart parseMarginal ( List < ? > terminals , Object root , boolean useSumProduct ) { } }
CfgParseChart chart = createParseChart ( terminals , useSumProduct ) ; Factor rootFactor = TableFactor . pointDistribution ( parentVar , parentVar . outcomeArrayToAssignment ( root ) ) ; return marginal ( chart , terminals , rootFactor ) ;
public class MLNumericArray { /** * / * ( non - Javadoc ) * @ see ca . mjdsystems . jmatio . types . MLArray # contentToString ( ) */ public String contentToString ( ) { } }
StringBuffer sb = new StringBuffer ( ) ; sb . append ( name + " = \n" ) ; if ( getSize ( ) > 1000 ) { sb . append ( "Cannot display variables with more than 1000 elements." ) ; return sb . toString ( ) ; } for ( int m = 0 ; m < getM ( ) ; m ++ ) { sb . append ( "\t" ) ; for ( int n = 0 ; n < getN ( ) ; n ++ ) { sb . ap...
public class InventoryActionMessage { /** * Sends GUI action to the server { @ link MalisisInventoryContainer } . * @ param action the action * @ param inventoryId the inventory id * @ param slotNumber the slot number * @ param code the code */ @ SideOnly ( Side . CLIENT ) public static void sendAction ( Action...
int windowId = Utils . getClientPlayer ( ) . openContainer . windowId ; Packet packet = new Packet ( action , inventoryId , slotNumber , code , windowId ) ; MalisisCore . network . sendToServer ( packet ) ;
public class BigtableTableAdminClient { /** * Constructs an instance of BigtableTableAdminClient with the given instanceName . * @ deprecated Please { @ link # create ( String , String ) } . */ @ Deprecated public static BigtableTableAdminClient create ( @ Nonnull com . google . bigtable . admin . v2 . InstanceName i...
return create ( instanceName . getProject ( ) , instanceName . getInstance ( ) ) ;
public class ConfigImpl { /** * sets the Schedule Directory * @ param scheduleDirectory sets the schedule Directory * @ param logger * @ throws PageException */ protected void setScheduler ( CFMLEngine engine , Resource scheduleDirectory ) throws PageException { } }
if ( scheduleDirectory == null ) { if ( this . scheduler == null ) this . scheduler = new SchedulerImpl ( engine , "<?xml version=\"1.0\"?>\n<schedule></schedule>" , this ) ; return ; } if ( ! isDirectory ( scheduleDirectory ) ) throw new ExpressionException ( "schedule task directory " + scheduleDirectory + " doesn't ...
public class Policy { /** * Specifies the AWS account IDs to include in the policy . If < code > IncludeMap < / code > is null , all accounts in the * organization in AWS Organizations are included in the policy . If < code > IncludeMap < / code > is not null , only values * listed in < code > IncludeMap < / code >...
setIncludeMap ( includeMap ) ; return this ;
public class AbstractMaterialDialogBuilder { /** * Sets the margin of the dialog , which is created by the builder . * @ param left * The left margin , which should be set , in pixels as an { @ link Integer } value . The left * margin must be at least 0 * @ param top * The top margin , which should be set , i...
getProduct ( ) . setMargin ( left , top , right , bottom ) ; return self ( ) ;
public class RemoteFacadeCircuitBreaker { /** * 这里会判断当前调用服务的状态 , 分析判断是否需要进入降级状态 * 如果服务在指定的时间区间内累积的错误 , 达到了配置的次数 , 则进入服务降级 * 如果满足上面条件 , 并且满足重试机制 , 则也不会进入降级流程 , 而是触发远程服务调用 * @ param invoker * @ param invocation * @ return */ private boolean checkNeedCircuitBreak ( Invoker < ? > invoker , Invocation invocation )...
String interfaceName = invoker . getUrl ( ) . getParameter ( Constants . INTERFACE_KEY ) ; String method = invocation . getMethodName ( ) ; String methodKey = Config . getMethodPropertyName ( invoker , invocation ) . toString ( ) ; int limit = Config . getBreakLimit ( invoker , invocation ) ; BreakCounter breakCounter ...
public class UpdateBuilder { /** * Deletes the document referred to by this DocumentReference . * @ param documentReference The DocumentReference to delete . * @ return The instance for chaining . */ @ Nonnull public T delete ( @ Nonnull DocumentReference documentReference ) { } }
return performDelete ( documentReference , Precondition . NONE ) ;
public class MaxiCode { /** * Guesses the best set to use at the specified index by looking at the surrounding sets . In general , characters in * lower - numbered sets are more common , so we choose them if we can . If no good surrounding sets can be found , the default * value returned is the first value from the...
int option1 = set [ index - 1 ] ; if ( index + 1 < length ) { // we have two options to check int option2 = set [ index + 1 ] ; if ( contains ( valid , option1 ) && contains ( valid , option2 ) ) { return Math . min ( option1 , option2 ) ; } else if ( contains ( valid , option1 ) ) { return option1 ; } else if ( contai...
public class HttpHeaders { /** * Write all Headers and a trailing CRLF , CRLF * @ param out * @ throws IOException */ public void write ( OutputStream out ) throws IOException { } }
for ( HttpHeader header : this ) { header . write ( out ) ; } out . write ( CR ) ; out . write ( LF ) ;
public class CmsSearchManager { /** * Updates the indexes from as a scheduled job . < p > * @ param cms the OpenCms user context to use when reading resources from the VFS * @ param parameters the parameters for the scheduled job * @ throws Exception if something goes wrong * @ return the String to write in the...
CmsSearchManager manager = OpenCms . getSearchManager ( ) ; I_CmsReport report = null ; boolean writeLog = Boolean . valueOf ( parameters . get ( JOB_PARAM_WRITELOG ) ) . booleanValue ( ) ; if ( writeLog ) { report = new CmsLogReport ( cms . getRequestContext ( ) . getLocale ( ) , CmsSearchManager . class ) ; } List < ...
public class AbcGrammar { /** * comment : : = " % " ( [ non - comment - char * ( VCHAR / WSP ) ] ) eol */ Rule Comment ( ) { } }
return Sequence ( String ( "%" ) , Optional ( Sequence ( NonCommentChar ( ) , ZeroOrMore ( FirstOf ( VCHAR ( ) , WSP ( ) ) ) ) ) . label ( CommentText ) . suppressSubnodes ( ) , FirstOfS ( Eol ( ) , EOI ) ) . label ( Comment ) ;
public class I18nPopulator { /** * Populate data store with default languages */ public void populateLanguages ( ) { } }
dataService . add ( LANGUAGE , languageFactory . create ( LanguageService . DEFAULT_LANGUAGE_CODE , LanguageService . DEFAULT_LANGUAGE_NAME , true ) ) ; dataService . add ( LANGUAGE , languageFactory . create ( "nl" , new Locale ( "nl" ) . getDisplayName ( new Locale ( "nl" ) ) , false ) ) ; dataService . add ( LANGUAG...
public class TerminalRuleImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setFragment ( boolean newFragment ) { } }
boolean oldFragment = fragment ; fragment = newFragment ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XtextPackage . TERMINAL_RULE__FRAGMENT , oldFragment , fragment ) ) ;
public class TNiftyClientTransport { /** * yeah , mimicking sync with async is just horrible */ private int read ( byte [ ] bytes , int offset , int length , Duration receiveTimeout ) throws InterruptedException , TTransportException { } }
long timeRemaining = receiveTimeout . roundTo ( TimeUnit . NANOSECONDS ) ; lock . lock ( ) ; try { while ( ! closed ) { int bytesAvailable = readBuffer . readableBytes ( ) ; if ( bytesAvailable > 0 ) { int begin = readBuffer . readerIndex ( ) ; readBuffer . readBytes ( bytes , offset , Math . min ( bytesAvailable , len...
public class DescribeMatchmakingRuleSetsResult { /** * Collection of requested matchmaking rule set objects . * @ param ruleSets * Collection of requested matchmaking rule set objects . */ public void setRuleSets ( java . util . Collection < MatchmakingRuleSet > ruleSets ) { } }
if ( ruleSets == null ) { this . ruleSets = null ; return ; } this . ruleSets = new java . util . ArrayList < MatchmakingRuleSet > ( ruleSets ) ;
public class ElmBaseVisitor { /** * Visit a FunctionDef . This method will be called for * every node in the tree that is a FunctionDef . * @ param elm the ELM tree * @ param context the context passed to the visitor * @ return the visitor result */ public T visitFunctionDef ( FunctionDef elm , C context ) { } ...
for ( OperandDef element : elm . getOperand ( ) ) { visitElement ( element , context ) ; } visitElement ( elm . getExpression ( ) , context ) ; return null ;
public class WASCDIAnnotationInjectionProvider { /** * { @ inheritDoc } */ @ Override public Object inject ( Object instance , boolean doPostConstruct ) throws InjectionProviderException { } }
return inject ( instance , doPostConstruct , null ) ;
public class RoundRobinSelectionStrategy { /** * Selects an { @ link Endpoint } for the given { @ link CouchbaseRequest } . * < p > < / p > * If null is returned , it means that no endpoint could be selected and it is up to the calling party * to decide what to do next . * @ param request the input request . ...
int endpointSize = endpoints . size ( ) ; // increments skip and prevents it to overflow to a negative value skip = Math . max ( 0 , skip + 1 ) ; int offset = skip % endpointSize ; // attempt to find a CONNECTED endpoint at the offset , or try following ones for ( int i = offset ; i < endpointSize ; i ++ ) { Endpoint e...
public class VersionHistoryImpl { /** * { @ inheritDoc } */ public Version getVersionByLabel ( String label ) throws RepositoryException { } }
checkValid ( ) ; NodeData versionData = getVersionDataByLabel ( label ) ; if ( versionData == null ) { throw new RepositoryException ( "There are no label '" + label + "' in the version history " + getPath ( ) ) ; } VersionImpl version = ( VersionImpl ) dataManager . getItemByIdentifier ( versionData . getIdentifier ( ...
public class Yaml { /** * Dumps { @ code data } into a { @ code OutputStream } using a { @ code UTF - 8} * encoding . * @ param data the data * @ param output the output stream */ public void dumpAll ( Iterator < ? extends YamlNode > data , OutputStream output ) { } }
getDelegate ( ) . dumpAll ( data , new OutputStreamWriter ( output , Charset . forName ( "UTF-8" ) ) ) ;
public class WARClassLoader { /** * { @ inheritDoc } */ @ Override public Class < ? > loadClass ( String name ) throws ClassNotFoundException { } }
for ( Deployment deployment : kernel . getDeployments ( ) ) { if ( ! ( deployment instanceof WARDeployment ) ) { try { return deployment . getClassLoader ( ) . loadClass ( name ) ; } catch ( Throwable t ) { // Next } } } return super . loadClass ( name ) ;
public class CoronaReleaseManager { /** * Get the release directory ' s latest timestamp */ private long getLastTimeStamp ( Path pathToCheck ) { } }
long lastTimeStamp = - 1 ; long tmpTimeStamp = - 1 ; try { for ( FileStatus fileStat : fs . listStatus ( pathToCheck ) ) { Path srcPath = fileStat . getPath ( ) ; if ( ! fileStat . isDir ( ) ) { boolean checkFlag = true ; if ( release_pattern != null ) { // just need to check the files that match the pattern Matcher m ...
public class FirewallSupport { /** * The Dasein abstraction assumes that a firewall rule has only one source target , one destination target , one protocol and one distinct port range * However , the GCE abstraction defines groups of these against one single firewall rule . * Therefore , Dasein splits these groups ...
ArrayList < FirewallRule > firewallRules = new ArrayList < FirewallRule > ( ) ; for ( com . google . api . services . compute . model . Firewall googleRule : rules ) { List < RuleTarget > sources = new ArrayList < RuleTarget > ( ) ; if ( googleRule . getSourceRanges ( ) != null ) for ( String source : googleRule . getS...
public class ImagingKitUtils { /** * Throws an { @ link IllegalArgumentException } when the specified area * is not within the bounds of the specified image , or if the area * is not positive . * This is used for parameter evaluation . * @ param xStart left boundary of the area * @ param yStart top boundary o...
if ( width <= 0 || height <= 0 || xStart < 0 || yStart < 0 || xStart + width > img . getWidth ( ) || yStart + height > img . getHeight ( ) ) { throw new IllegalArgumentException ( String . format ( "provided area [%d,%d][%d,%d] is not within bounds of the image [%d,%d]" , xStart , yStart , width , height , img . getWid...
public class UserInterfaceApi { /** * Open Contract Window Open the contract window inside the client - - - SSO * Scope : esi - ui . open _ window . v1 * @ param contractId * The contract to open ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquili...
com . squareup . okhttp . Call call = postUiOpenwindowContractValidateBeforeCall ( contractId , datasource , token , null ) ; return apiClient . execute ( call ) ;
public class SubscriptionMessageType { /** * Returns the corresponding SubscriptionMessageType for a given integer . * This method should NOT be called by any code outside the MFP component . * It is only public so that it can be accessed by sub - packages . * @ param aValue The integer for which an SubscriptionM...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue ] ;
public class SchemaBuilder { /** * Shortcut for { @ link # createAggregate ( CqlIdentifier ) * CreateAggregateStart ( CqlIdentifier . fromCql ( keyspaceName ) , CqlIdentifier . fromCql ( aggregateName ) } */ @ NonNull public static CreateAggregateStart createAggregate ( @ NonNull String aggregateName ) { } }
return new DefaultCreateAggregate ( CqlIdentifier . fromCql ( aggregateName ) ) ;
public class JGeometryConverter { /** * FIXME */ private static GeometryCollection convertCollection ( JGeometry geometry ) { } }
JGeometry [ ] elements = geometry . getElements ( ) ; if ( elements == null || elements . length == 0 ) { return GeometryCollection . createEmpty ( ) ; } Geometry [ ] geometries = new Geometry [ elements . length ] ; for ( int i = 0 ; i < elements . length ; i ++ ) { geometries [ i ] = convert ( elements [ i ] ) ; } re...
public class BaseDateTimeType { /** * Returns a human readable version of this date / time using the system local format . * < b > Note on time zones : < / b > This method renders the value using the time zone that is contained within the value . * For example , if this date object contains the value " 2012-01-05T1...
TimeZone tz = getTimeZone ( ) ; Calendar value = tz != null ? Calendar . getInstance ( tz ) : Calendar . getInstance ( ) ; value . setTime ( getValue ( ) ) ; switch ( getPrecision ( ) ) { case YEAR : case MONTH : case DAY : return ourHumanDateFormat . format ( value ) ; case MILLI : case SECOND : default : return ourHu...
public class JCollapsiblePane { /** * Sets the content pane of this JCollapsiblePane . Components must be added * to this content pane , not to the JCollapsiblePane . * @ param contentPanel * @ throws IllegalArgumentException if contentPanel is null */ public void setContentPane ( Container contentPanel ) { } }
if ( contentPanel == null ) { throw new IllegalArgumentException ( "Content pane can't be null" ) ; } if ( wrapper != null ) { super . remove ( wrapper ) ; } wrapper = new WrapperContainer ( contentPanel ) ; super . addImpl ( wrapper , BorderLayout . CENTER , - 1 ) ;
public class BreadCrumbView { /** * { @ inheritDoc } */ @ Override public void layoutParts ( ) { } }
HBox . setHgrow ( breadCrumbBar , Priority . ALWAYS ) ; // align undo / redo buttons on the right if there are no breadcrumbs if ( model . isOneCategoryLayout ( ) ) { setAlignment ( Pos . CENTER_RIGHT ) ; }
public class JFeatureSpec { /** * Java wrapper for { @ link FeatureSpec # extractWithSettings ( String , FeatureBuilder , ClassTag ) . */ public JRecordExtractor < T , Example > extractWithSettingsExample ( String settings ) { } }
return new JRecordExtractor < > ( JavaOps . extractWithSettingsExample ( self , settings ) ) ;
public class DefaultXWikiGeneratorListener { /** * { @ inheritDoc } * Called when WikiModel finds an reference ( link or image ) such as a URI located directly in the text * ( free - standing URI ) , as opposed to a link / image inside wiki link / image syntax delimiters . * @ see org . xwiki . rendering . wikimo...
onReference ( reference , null , true , Listener . EMPTY_PARAMETERS ) ;
public class ApproximateHistogram { /** * Constructs an ApproximateHistogram object from the given dense byte - buffer representation * @ param buf ByteBuffer to construct an ApproximateHistogram from * @ return ApproximateHistogram constructed from the given ByteBuffer */ public static ApproximateHistogram fromByt...
int size = buf . getInt ( ) ; int binCount = buf . getInt ( ) ; float [ ] positions = new float [ size ] ; long [ ] bins = new long [ size ] ; buf . asFloatBuffer ( ) . get ( positions ) ; buf . position ( buf . position ( ) + Float . BYTES * positions . length ) ; buf . asLongBuffer ( ) . get ( bins ) ; buf . position...
public class GUIUtil { /** * Setup logging of uncaught exceptions . * @ param logger logger */ public static void logUncaughtExceptions ( Logging logger ) { } }
try { Thread . setDefaultUncaughtExceptionHandler ( ( t , e ) -> logger . exception ( e ) ) ; } catch ( SecurityException e ) { logger . warning ( "Could not set the Default Uncaught Exception Handler" , e ) ; }
public class FXMLUtils { /** * Load a FXML component . * The fxml path could be : * < ul > * < li > Relative : fxml file will be loaded with the classloader of the given model class < / li > * < li > Absolute : fxml file will be loaded with default thread class loader , packages must be separated by / character...
final FXMLLoader fxmlLoader = new FXMLLoader ( ) ; final Callback < Class < ? > , Object > fxmlControllerFactory = ( Callback < Class < ? > , Object > ) ParameterUtility . buildCustomizableClass ( ExtensionParameters . FXML_CONTROLLER_FACTORY , DefaultFXMLControllerFactory . class , FXMLControllerFactory . class ) ; if...
public class BeanManager { /** * Start discovering nearby Beans . If a discovery is in progress , it will be canceled . A * discovery will run for a limited time after which * { @ link BeanDiscoveryListener # onDiscoveryComplete ( ) } will be called . * @ param listener the listener for reporting progress * @ r...
if ( mScanning ) { Log . e ( TAG , "Already discovering" ) ; return true ; } mListener = listener ; return scan ( ) ;
public class FragmentManager { /** * This method sets the builder for this thread of execution . * @ param builder The fragment builder */ public void setFragmentBuilder ( FragmentBuilder builder ) { } }
FragmentBuilder currentBuilder = builders . get ( ) ; if ( currentBuilder == null && builder != null ) { int currentCount = threadCounter . incrementAndGet ( ) ; int builderCount = builder . incrementThreadCount ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Associate Thread with FragmentBuilder(2):...
public class BasicSupport { /** * exist or variable is not in server . env */ private String getWlpOutputDir ( ) throws IOException { } }
Properties envvars = new Properties ( ) ; File serverEnvFile = new File ( installDirectory , "etc/server.env" ) ; if ( serverEnvFile . exists ( ) ) { envvars . load ( new FileInputStream ( serverEnvFile ) ) ; } serverEnvFile = new File ( configDirectory , "server.env" ) ; if ( configDirectory != null && serverEnvFile ....
public class HtmlEscape { /** * Perform an HTML5 level 1 ( XML - style ) < strong > escape < / strong > operation on a < tt > String < / tt > input . * < em > Level 1 < / em > means this method will only escape the five markup - significant characters : * < tt > & lt ; < / tt > , < tt > & gt ; < / tt > , < tt > & a...
return escapeHtml ( text , HtmlEscapeType . HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL , HtmlEscapeLevel . LEVEL_1_ONLY_MARKUP_SIGNIFICANT ) ;
public class EpisodicUtil { /** * Unmarshalls the input stream into an object from org . yestech . episodic . objectmodel . * @ param response the response * @ return The unmarshalled object . * @ throws javax . xml . bind . JAXBException Thrown if there are issues with the xml stream passed in . */ public static...
String xml = EntityUtils . toString ( response . getEntity ( ) ) ; Unmarshaller unmarshaller = ctx . createUnmarshaller ( ) ; return unmarshaller . unmarshal ( new StringReader ( xml ) ) ;
public class CmsJlanDiskInterface { /** * Helper method to get a network file object given a path . < p > * @ param cms the CMS context wrapper * @ param session the current session * @ param connection the current connection * @ param path the file path * @ return the network file object for the given path ...
try { String cmsPath = getCmsPath ( path ) ; CmsResource resource = cms . readResource ( cmsPath , STANDARD_FILTER ) ; CmsJlanNetworkFile result = new CmsJlanNetworkFile ( cms , resource , path ) ; return result ; } catch ( CmsVfsResourceNotFoundException e ) { return null ; }
public class AsyncCaseInstanceAuditEventReceiver { /** * Helper methods */ protected void updateCaseFileItems ( AuditCaseInstanceData auditCaseInstanceData , EntityManager em ) { } }
if ( auditCaseInstanceData . getCaseFileData ( ) == null || auditCaseInstanceData . getCaseFileData ( ) . isEmpty ( ) ) { return ; } List < String > currentCaseData = currentCaseData ( auditCaseInstanceData . getCaseId ( ) , em ) ; auditCaseInstanceData . getCaseFileData ( ) . forEach ( ( item ) -> { CaseFileDataLog ca...
public class Document { /** * Sets c4doc and updates my root dictionary */ private void setC4Document ( C4Document c4doc ) { } }
synchronized ( lock ) { replaceC4Document ( c4doc ) ; data = null ; if ( c4doc != null && ! c4doc . deleted ( ) ) { data = c4doc . getSelectedBody2 ( ) ; } updateDictionary ( ) ; }
public class DiscordApiImpl { /** * Purges all cached entities . * This method is only meant to be called after receiving a READY packet . */ public void purgeCache ( ) { } }
synchronized ( users ) { users . values ( ) . stream ( ) . map ( Reference :: get ) . filter ( Objects :: nonNull ) . map ( Cleanupable . class :: cast ) . forEach ( Cleanupable :: cleanup ) ; users . clear ( ) ; } userIdByRef . clear ( ) ; servers . values ( ) . stream ( ) . map ( Cleanupable . class :: cast ) . forEa...
public class SourceStreamManager { /** * Put a message back into the appropriate source stream . This will create a stream * if one does not exist but will not change any fields in the message * @ param msgItem The message to be restored * @ param commit Boolean indicating whether message to be restored is in com...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "restoreMessage" , new Object [ ] { msgItem } ) ; int priority = msgItem . getPriority ( ) ; Reliability reliability = msgItem . getReliability ( ) ; SIBUuid12 streamID = msgItem . getGuaranteedStreamUuid ( ) ; StreamSet str...
public class FactoryImageBorder { /** * Given an image type return the appropriate { @ link ImageBorder } class type . * @ param imageType Type of image which is being processed . * @ return The ImageBorder for processing the image type . */ public static Class < ImageBorder > lookupBorderClassType ( Class < ImageG...
if ( ( Class ) imageType == GrayF32 . class ) return ( Class ) ImageBorder1D_F32 . class ; if ( ( Class ) imageType == GrayF64 . class ) return ( Class ) ImageBorder1D_F64 . class ; else if ( GrayI . class . isAssignableFrom ( imageType ) ) return ( Class ) ImageBorder1D_S32 . class ; else if ( ( Class ) imageType == G...
public class CrossPlatformCommand { /** * Main method that should be executed . This will return the proper result depending on your platform . * @ return the result */ public T execute ( ) { } }
if ( isWindows ( ) ) { return onWindows ( ) ; } else if ( isMac ( ) ) { return onMac ( ) ; } else if ( isUnix ( ) ) { return onUnix ( ) ; } else if ( isSolaris ( ) ) { return onSolaris ( ) ; } else { throw new IllegalStateException ( "Invalid operating system " + os ) ; }
public class GetProductsResult { /** * The list of products that match your filters . The list contains both the product metadata and the price * information . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPriceList ( java . util . Collection ) } or { ...
if ( this . priceList == null ) { setPriceList ( new java . util . ArrayList < String > ( priceList . length ) ) ; } for ( String ele : priceList ) { this . priceList . add ( ele ) ; } return this ;
public class DBConn { /** * Attempt to connect to the given Cassandra host name or IP address . If a connection * cannot be made , a { @ link DBNotAvailableException } is thrown that wraps the * Cassandra exception . If a connection is made and a keyspace was configured , the * session is set to the configured ke...
assert ! m_bDBOpen ; int bufferSize = m_thrift_buffer_size_mb * 1024 * 1024 ; // Attempt to open the requested dbhost . try { TSocket socket = null ; if ( m_dbtls ) { m_logger . debug ( "Connecting to Cassandra node {}:{} using TLS" , dbhost , m_dbport ) ; socket = createTLSSocket ( dbhost ) ; } else { m_logger . debug...
public class PortletDefinitionRegistryImpl { /** * Get the portletApplicationId and portletName for the specified channel definition id . The * portletApplicationId will be { @ link Tuple # first } and the portletName will be { @ link * Tuple # second } */ @ Override public Tuple < String , String > getPortletDescr...
final String portletApplicationId ; if ( portletDefinition . getPortletDescriptorKey ( ) . isFrameworkPortlet ( ) ) { portletApplicationId = this . servletContext . getContextPath ( ) ; } else { portletApplicationId = portletDefinition . getPortletDescriptorKey ( ) . getWebAppName ( ) ; } final String portletName = por...