signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DOMHelper { /** * Add a child element to a parent element * @ param doc * @ param parentElement * @ param elementName * @ param elementValue */ public static void appendChild ( Document doc , Element parentElement , String elementName , String elementValue ) { } }
Element child = doc . createElement ( elementName ) ; Text text = doc . createTextNode ( elementValue ) ; child . appendChild ( text ) ; parentElement . appendChild ( child ) ;
public class HttpEndpointImpl { /** * Schedule an activity to run off the SCR action thread , * if the ExecutorService is available * @ param action Runnable action to execute * @ param addToQueue Set to false if the action should be scheduled independently of the actionQueue */ @ Trivial private void performActi...
ExecutorService exec = executorService . getService ( ) ; if ( exec == null ) { // If we can ' t find the executor service , we have to run it in place . action . run ( ) ; } else { // If we can find the executor service , we ' ll add the action to the queue . // If the actionFuture is null ( no pending actions ) and t...
public class ContractsApi { /** * Get corporation contract items Lists items of a particular contract - - - * This route is cached for up to 3600 seconds SSO Scope : * esi - contracts . read _ corporation _ contracts . v1 SSO Scope : * esi - contracts . read _ character _ contracts . v1 * @ param contractId *...
com . squareup . okhttp . Call call = getCorporationsCorporationIdContractsContractIdItemsValidateBeforeCall ( contractId , corporationId , datasource , ifNoneMatch , token , null ) ; Type localVarReturnType = new TypeToken < List < CorporationContractsItemsResponse > > ( ) { } . getType ( ) ; return apiClient . execut...
public class HttpJsonSerializer { /** * Parses one or more data points for storage * @ return an array of data points to process for storage * @ throws JSONException if parsing failed * @ throws BadRequestException if the content was missing or parsing failed * @ since 2.4 */ @ Override public < T extends Incom...
if ( ! query . hasContent ( ) ) { throw new BadRequestException ( "Missing request content" ) ; } // convert to a string so we can handle character encoding properly final String content = query . getContent ( ) . trim ( ) ; final int firstbyte = content . charAt ( 0 ) ; try { if ( firstbyte == '{' ) { final T dp = JSO...
public class FmtDuration { /** * { @ inheritDoc } * @ throws SuperCsvCellProcessorException * if value is null or not a Duration */ public Object execute ( final Object value , final CsvContext context ) { } }
validateInputNotNull ( value , context ) ; if ( ! ( value instanceof Duration ) ) { throw new SuperCsvCellProcessorException ( Duration . class , value , context , this ) ; } final Duration duration = ( Duration ) value ; final String result = duration . toString ( ) ; return next . execute ( result , context ) ;
public class Args { /** * Produces the flag form of a string value . * @ return { @ code [ - - name , value ] } or { @ code [ ] } if value is null . */ static List < String > string ( String name , @ Nullable String value ) { } }
if ( ! Strings . isNullOrEmpty ( value ) ) { return Arrays . asList ( "--" + name , value ) ; } return Collections . emptyList ( ) ;
public class CmsDefaultUserSettings { /** * Sets the default copy mode when copying a folder of the user . < p > * @ param mode the default copy mode when copying a folder of the user */ public void setDialogCopyFolderMode ( String mode ) { } }
CmsResourceCopyMode copyMode = CmsResource . COPY_AS_NEW ; if ( mode . equalsIgnoreCase ( COPYMODE_SIBLING ) ) { copyMode = CmsResource . COPY_AS_SIBLING ; } else if ( mode . equalsIgnoreCase ( COPYMODE_PRESERVE ) ) { copyMode = CmsResource . COPY_PRESERVE_SIBLING ; } setDialogCopyFolderMode ( copyMode ) ;
public class U { /** * Documented , # slice */ public static < T > List < T > slice ( final Iterable < T > iterable , final int start ) { } }
final List < T > result ; if ( start >= 0 ) { result = newArrayList ( iterable ) . subList ( start , size ( iterable ) ) ; } else { result = newArrayList ( iterable ) . subList ( size ( iterable ) + start , size ( iterable ) ) ; } return result ;
public class MathExpressions { /** * Create a { @ code ln ( num ) } expression * < p > Returns the natural logarithm of num . < / p > * @ param num numeric expression * @ return ln ( num ) */ public static < A extends Number & Comparable < ? > > NumberExpression < Double > ln ( Expression < A > num ) { } }
return Expressions . numberOperation ( Double . class , Ops . MathOps . LN , num ) ;
public class MultiPageWidget { /** * Recalculate view port for the multi page widget based on new adapter . * Data adapter has to have universal view size , see { @ link Adapter # hasUniformViewSize ( ) } * @ param adapter */ protected void recalculateViewPort ( final Adapter adapter ) { } }
Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "recalculateViewPort mMaxVisiblePageCount = %d mAdapter =%s " + "mAdapter.hasUniformViewSize() = %b" , mMaxVisiblePageCount , adapter , ( adapter != null ? adapter . hasUniformViewSize ( ) : false ) ) ; if ( mMaxVisiblePageCount < Integer . MAX_VALUE && adapter != null && adap...
public class StatefulSessionActivationStrategy { /** * When stateful beans are uninstalled we destroy the beans . The beans * are removed from the cache or passivation directory and removed from * the Stateful Bean Reaper . < p > * If the module is reinstalled and the same reference is reused , then an * Except...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "atUninstall (" + beanId + ")" ) ; // The ' bean ' parameter may be null ( i . e . when calling to uninstall // a passivated bean ) , so don ' t count on it . LI3408 MasterKey key = new Mas...
public class Numbers { /** * Canonicalizes the given { @ link Number } value for the purpose of a * hash - based lookup . * The method accepts a { @ link Comparable } instance and returns one because * query engine acts on comparable values , but { @ link Number } is not * comparable . * Special numeric canon...
Class clazz = value . getClass ( ) ; assert value instanceof Number ; Number number = ( Number ) value ; if ( isDoubleRepresentable ( clazz ) ) { double doubleValue = number . doubleValue ( ) ; long longValue = number . longValue ( ) ; if ( equalDoubles ( doubleValue , ( double ) longValue ) ) { return longValue ; } el...
public class Main { /** * Prepare a command line for execution from a Windows batch script . * The method quotes all arguments so that spaces are handled as expected . Quotes within arguments * are " double quoted " ( which is batch for escaping a quote ) . This page has more details about * quoting and other bat...
StringBuilder cmdline = new StringBuilder ( ) ; for ( Map . Entry < String , String > e : childEnv . entrySet ( ) ) { cmdline . append ( String . format ( "set %s=%s" , e . getKey ( ) , e . getValue ( ) ) ) ; cmdline . append ( " && " ) ; } for ( String arg : cmd ) { cmdline . append ( quoteForBatchScript ( arg ) ) ; c...
public class DistortImageOps { /** * Finds an axis - aligned bounding box which would contain a image after it has been transformed . * The returned bounding box can be larger then the original image . * @ param srcWidth Width of the source image * @ param srcHeight Height of the source image * @ param transfor...
int x0 , y0 , x1 , y1 ; transform . compute ( 0 , 0 , work ) ; x0 = x1 = ( int ) work . x ; y0 = y1 = ( int ) work . y ; for ( int i = 1 ; i < 4 ; i ++ ) { if ( i == 1 ) transform . compute ( srcWidth , 0 , work ) ; else if ( i == 2 ) transform . compute ( 0 , srcHeight , work ) ; else if ( i == 3 ) transform . compute...
public class JacksonJson { /** * Unmarshal the JSON data on the specified Reader instance and populate a List of instances of the provided returnType class . * @ param < T > the generics type for the List * @ param returnType an instance of this type class will be contained in the returned List * @ param reader t...
ObjectMapper objectMapper = getContext ( null ) ; CollectionType javaType = objectMapper . getTypeFactory ( ) . constructCollectionType ( List . class , returnType ) ; return ( objectMapper . readValue ( reader , javaType ) ) ;
public class ProductSearchClient { /** * Adds a Product to the specified ProductSet . If the Product is already present , no change is * made . * < p > One Product can be added to at most 100 ProductSets . * < p > Possible errors : * < p > & # 42 ; Returns NOT _ FOUND if the Product or the ProductSet doesn ' t ...
AddProductToProductSetRequest request = AddProductToProductSetRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . setProduct ( product == null ? null : product . toString ( ) ) . build ( ) ; addProductToProductSet ( request ) ;
public class ChatDirector { /** * Dispatches the provided message to our chat displays . */ public void dispatchMessage ( ChatMessage message , String localType ) { } }
setClientInfo ( message , localType ) ; dispatchPreparedMessage ( message ) ;
public class KubernetesScheduler { /** * Add containers for a scale - up event from an update command * @ param containersToAdd the list of containers that need to be added * NOTE : Due to the mechanics of Kubernetes pod creation , each container must be created on * a one - by - one basis . If one container out ...
controller . addContainers ( containersToAdd ) ; return containersToAdd ;
public class JDBCBlob { /** * Returns an < code > InputStream < / code > object that contains a partial < code > Blob < / code > value , * starting with the byte specified by pos , which is length bytes in length . * @ param pos the offset to the first byte of the partial value to be retrieved . * The first byte ...
final byte [ ] ldata = data ; checkValid ( ldata ) ; final int dlen = ldata . length ; if ( pos < MIN_POS || pos > dlen ) { throw Util . outOfRangeArgument ( "pos: " + pos ) ; } pos -- ; if ( length < 0 || length > dlen - pos ) { throw Util . outOfRangeArgument ( "length: " + length ) ; } if ( pos == 0 && length == dle...
public class Validate { /** * Method without varargs to increase performance */ public static < T extends Collection < ? > > T validIndex ( final T collection , final int index , final String message ) { } }
return INSTANCE . validIndex ( collection , index , message ) ;
public class Utils { /** * Load all the byte data from an input stream . * @ param stream the input stream from which to read * @ return a byte array containing all the data from the stream */ public static byte [ ] loadBytesFromStream ( InputStream stream ) { } }
try { BufferedInputStream bis = new BufferedInputStream ( stream ) ; byte [ ] theData = new byte [ 10000000 ] ; int dataReadSoFar = 0 ; byte [ ] buffer = new byte [ 1024 ] ; int read = 0 ; while ( ( read = bis . read ( buffer ) ) != - 1 ) { System . arraycopy ( buffer , 0 , theData , dataReadSoFar , read ) ; dataReadSo...
public class TaskResult { /** * Inserts a Bundle value into the mapping of this Bundle , replacing any existing value for the * given key . Either key or value may be null . * @ param key a String , or null * @ param value a Bundle object , or null * @ return itself */ public TaskResult add ( String key , Bundl...
mBundle . putBundle ( key , value ) ; return this ;
public class AboutJenkins { /** * A pre - check to see if a string is a build timestamp formatted date . * @ param s the string . * @ return { @ code true } if it is likely that the string will parse as a build timestamp formatted date . */ static boolean mayBeDate ( String s ) { } }
if ( s == null || s . length ( ) != "yyyy-MM-dd_HH-mm-ss" . length ( ) ) { return false ; } for ( int i = 0 ; i < s . length ( ) ; i ++ ) { switch ( s . charAt ( i ) ) { case '-' : switch ( i ) { case 4 : case 7 : case 13 : case 16 : break ; default : return false ; } break ; case '_' : if ( i != 10 ) { return false ; ...
public class ToSparseArray { /** * Returns a method that can be used with { @ link solid . stream . Stream # collect ( Func1 ) } * to convert a stream into a { @ link SparseArray } . * Use this method instead of { @ link # toSparseArray ( Func1 ) } } for better performance on * streams that can have more than 10 ...
return new Func1 < Iterable < T > , SparseArray < T > > ( ) { @ Override public SparseArray < T > call ( Iterable < T > iterable ) { SparseArray < T > array = new SparseArray < > ( initialCapacity ) ; for ( T value : iterable ) array . put ( itemToKey . call ( value ) , value ) ; return array ; } } ;
public class JsonArrayDeserializer { /** * { @ inheritDoc } */ @ Override public JsonArray deserialize ( JsonParser p , DeserializationContext ctxt ) throws IOException , JsonProcessingException { } }
List list = p . readValueAs ( List . class ) ; return new JsonArray ( list ) ;
public class CalendarControl { /** * UpdateCalendar Method . */ public void updateCalendar ( Calendar calStart , Calendar calEnd ) { } }
Anniversary recAnniversary = new Anniversary ( this . getRecordOwner ( ) ) ; AnnivMaster recAnnivMaster = new AnnivMaster ( this . getRecordOwner ( ) ) ; recAnniversary . setKeyArea ( Anniversary . START_DATE_TIME_KEY ) ; try { while ( recAnniversary . hasNext ( ) ) { recAnniversary . next ( ) ; if ( recAnniversary . g...
public class PropertyChangeSupportUtils { /** * Removes a named property change listener to the given JavaBean . The bean * must provide the optional support for listening on named properties * as described in section 7.4.5 of the * < a href = " http : / / java . sun . com / products / javabeans / docs / spec . h...
Assert . notNull ( propertyName , "The property name must not be null." ) ; Assert . notNull ( listener , "The listener must not be null." ) ; if ( bean instanceof PropertyChangePublisher ) { ( ( PropertyChangePublisher ) bean ) . removePropertyChangeListener ( propertyName , listener ) ; } else { Class beanClass = bea...
public class nstrafficdomain_stats { /** * Use this API to fetch statistics of nstrafficdomain _ stats resource of given name . */ public static nstrafficdomain_stats get ( nitro_service service , Long td ) throws Exception { } }
nstrafficdomain_stats obj = new nstrafficdomain_stats ( ) ; obj . set_td ( td ) ; nstrafficdomain_stats response = ( nstrafficdomain_stats ) obj . stat_resource ( service ) ; return response ;
public class ConfigurationAdminImpl { /** * @ see * org . osgi . service . cm . ConfigurationAdmin # createFactoryConfiguration ( java . * lang . String ) * When a Configuration object is created by either getConfiguration or * createFactoryConfiguration , it becomes bound to the location of the calling * bun...
ExtendedConfiguration config = caFactory . getConfigurationStore ( ) . createFactoryConfiguration ( factoryPid , bundle . getLocation ( ) ) ; return config ;
public class DecoratingDynamicTypeBuilder { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) public DynamicType . Builder < T > ignoreAlso ( LatentMatcher < ? super MethodDescription > ignoredMethods ) { } }
return new DecoratingDynamicTypeBuilder < T > ( instrumentedType , typeAttributeAppender , asmVisitorWrapper , classFileVersion , auxiliaryTypeNamingStrategy , annotationValueFilterFactory , annotationRetention , implementationContextFactory , methodGraphCompiler , typeValidation , classWriterStrategy , new LatentMatch...
public class MavenImportUtils { /** * Restore the original pom file . * @ param projectDir the folder in which the pom file is located . * @ param monitor the progress monitor . * @ throws IOException if the pom file cannot be changed . */ static void restorePom ( File projectDir , IProgressMonitor monitor ) thro...
final File pomFile = new File ( projectDir , POM_FILE ) ; final File savedPomFile = new File ( projectDir , POM_BACKUP_FILE ) ; if ( savedPomFile . exists ( ) ) { if ( pomFile . exists ( ) ) { pomFile . delete ( ) ; } Files . copy ( savedPomFile , pomFile ) ; savedPomFile . delete ( ) ; } monitor . worked ( 1 ) ;
public class Isotope { /** * Compares an isotope with this isotope . * @ param object Object of type Isotope * @ return true if the isotopes are equal */ @ Override public boolean compare ( Object object ) { } }
if ( ! ( object instanceof Isotope ) ) { return false ; } if ( ! super . compare ( object ) ) { return false ; } Isotope isotope = ( Isotope ) object ; if ( isotope . getMassNumber ( ) != null && massNumber != null && isotope . getMassNumber ( ) . intValue ( ) != this . getMassNumber ( ) . intValue ( ) ) return false ;...
public class MapScaleBar { /** * Determines if a redraw is necessary or not * @ return true if redraw is necessary , false otherwise */ protected boolean isRedrawNecessary ( ) { } }
if ( this . redrawNeeded || this . prevMapPosition == null ) { return true ; } MapPosition currentMapPosition = this . mapViewPosition . getMapPosition ( ) ; if ( currentMapPosition . zoomLevel != this . prevMapPosition . zoomLevel ) { return true ; } double latitudeDiff = Math . abs ( currentMapPosition . latLong . la...
public class ReferenceEntityLockService { /** * Answers if the entity represented by the entityType and entityKey already has a lock of some * type . * @ param entityType * @ param entityKey * @ exception org . apereo . portal . concurrency . LockingException */ private boolean isLocked ( Class entityType , Str...
return isLocked ( entityType , entityKey , null ) ;
public class ReferenceCountedOpenSslEngine { /** * Read plaintext data from the OpenSSL internal BIO */ private int readPlaintextData ( final ByteBuffer dst ) { } }
final int sslRead ; final int pos = dst . position ( ) ; if ( dst . isDirect ( ) ) { sslRead = SSL . readFromSSL ( ssl , bufferAddress ( dst ) + pos , dst . limit ( ) - pos ) ; if ( sslRead > 0 ) { dst . position ( pos + sslRead ) ; } } else { final int limit = dst . limit ( ) ; final int len = min ( maxEncryptedPacket...
public class LdapAuthFilter { /** * Handles an authentication request . * @ param request HTTP request * @ param response HTTP response * @ return an authentication object that contains the principal object if successful . * @ throws IOException ex */ @ Override public Authentication attemptAuthentication ( Htt...
final String requestURI = request . getRequestURI ( ) ; UserAuthentication userAuth = null ; String username = request . getParameter ( USERNAME ) ; String password = request . getParameter ( PASSWORD ) ; String appid = SecurityUtils . getAppidFromAuthRequest ( request ) ; if ( requestURI . endsWith ( LDAP_ACTION ) && ...
public class ConnectionDecorator { /** * { @ inheritDoc } */ @ Override public void setNetworkTimeout ( Executor executor , int milliseconds ) throws SQLException { } }
getTarget ( ) . setNetworkTimeout ( executor , milliseconds ) ;
public class ProgressListener { /** * Protected so that a subclass can override how a consumer is invoked , particularly how an exception is handled . * @ param consumer * @ param progressUpdate */ protected void invokeConsumer ( Consumer < ProgressUpdate > consumer , ProgressUpdate progressUpdate ) { } }
try { consumer . accept ( progressUpdate ) ; } catch ( Throwable t ) { logger . error ( "Exception thrown by a Consumer<ProgressUpdate> consumer: " + consumer + "; progressUpdate: " + progressUpdate , t ) ; }
public class GreenPepperServerServiceImpl { /** * { @ inheritDoc } */ public boolean doesRequirementHasReferences ( Requirement requirement ) throws GreenPepperServerException { } }
try { sessionService . startSession ( ) ; boolean hasReferences = ! documentDao . getAllReferences ( requirement ) . isEmpty ( ) ; log . debug ( "Does Requirement " + requirement . getName ( ) + " Document Has References: " + hasReferences ) ; return hasReferences ; } catch ( Exception ex ) { throw handleException ( ER...
public class CmsScrollBar { /** * @ param reziseable true if the panel is resizeable */ public void isResizeable ( boolean reziseable ) { } }
if ( reziseable ) { getElement ( ) . getStyle ( ) . setMarginBottom ( 7 , Unit . PX ) ; } else { getElement ( ) . getStyle ( ) . setMarginBottom ( 0 , Unit . PX ) ; }
public class IBEA { /** * Execute ( ) method */ @ Override public void run ( ) { } }
int evaluations ; List < S > solutionSet , offSpringSolutionSet ; // Initialize the variables solutionSet = new ArrayList < > ( populationSize ) ; archive = new ArrayList < > ( archiveSize ) ; evaluations = 0 ; // - > Create the initial solutionSet S newSolution ; for ( int i = 0 ; i < populationSize ; i ++ ) { newSolu...
public class LoggingConfiguration { /** * / * ( non - Javadoc ) * @ see org . apache . ojb . broker . util . configuration . impl . ConfigurationAbstractImpl # load ( ) */ protected void load ( ) { } }
Logger bootLogger = LoggerFactory . getBootLogger ( ) ; // first we check whether the system property // org . apache . ojb . broker . util . logging . Logger // is set ( or its alias LoggerClass which is deprecated ) ClassLoader contextLoader = ClassHelper . getClassLoader ( ) ; String loggerClassName ; _loggerClass =...
public class SpringIOUtils { /** * Copy the contents of the given input File to the given output File . * @ param in the file to copy from * @ param out the file to copy to * @ return the number of bytes copied * @ throws java . io . IOException in case of I / O errors */ public static int copy ( File in , File...
assert in != null : "No input File specified" ; assert out != null : "No output File specified" ; return copy ( new BufferedInputStream ( Files . newInputStream ( in . toPath ( ) ) ) , new BufferedOutputStream ( Files . newOutputStream ( out . toPath ( ) ) ) ) ;
public class DurationEvaluators { /** * Register a new { @ link ActionDurationEvaluator } . * @ param a the action class * @ param e the evaluator to register for the given action * @ return { @ code false } if this action delete a previous evaluator for that action */ public boolean register ( Class < ? extends ...
return durations . put ( a , e ) == null ;
public class CPDefinitionVirtualSettingLocalServiceBaseImpl { /** * Returns the cp definition virtual setting matching the UUID and group . * @ param uuid the cp definition virtual setting ' s UUID * @ param groupId the primary key of the group * @ return the matching cp definition virtual setting * @ throws Po...
return cpDefinitionVirtualSettingPersistence . findByUUID_G ( uuid , groupId ) ;
public class IOUtils { /** * Locates this file either using the given URL , or in the CLASSPATH , or in the file system * The CLASSPATH takes priority over the file system ! * This stream is buffered and gzipped ( if necessary ) * @ param textFileOrUrl * @ return An InputStream for loading a resource * @ thro...
InputStream in ; if ( textFileOrUrl . matches ( "https?://.*" ) ) { URL u = new URL ( textFileOrUrl ) ; URLConnection uc = u . openConnection ( ) ; in = uc . getInputStream ( ) ; } else { try { in = findStreamInClasspathOrFileSystem ( textFileOrUrl ) ; } catch ( FileNotFoundException e ) { try { // Maybe this happens t...
public class WebFacelettaglibraryDescriptorImpl { /** * If not already created , a new < code > tag < / code > element will be created and returned . * Otherwise , the first existing < code > tag < / code > element will be returned . * @ return the instance defined for the element < code > tag < / code > */ public ...
List < Node > nodeList = model . get ( "tag" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FaceletTaglibTagTypeImpl < WebFacelettaglibraryDescriptor > ( this , "tag" , model , nodeList . get ( 0 ) ) ; } return createTag ( ) ;
public class ModuleSpaces { /** * Delete a Space . * @ param spaceId Space ID * @ return Integer representing the result ( 204 , or an error code ) * @ throws IllegalArgumentException if space ' s id is null . */ public Integer delete ( String spaceId ) { } }
assertNotNull ( spaceId , "spaceId" ) ; return service . delete ( spaceId ) . blockingFirst ( ) . code ( ) ;
public class Sql { /** * Performs the closure ( containing batch operations ) within a batch using a given batch size . * After every < code > batchSize < / code > < code > addBatch ( sqlBatchOperation ) < / code > * operations , automatically calls an < code > executeBatch ( ) < / code > operation to " chunk " up ...
Connection connection = createConnection ( ) ; BatchingStatementWrapper statement = null ; boolean savedWithinBatch = withinBatch ; try { withinBatch = true ; statement = new BatchingStatementWrapper ( createStatement ( connection ) , batchSize , LOG ) ; closure . call ( statement ) ; return statement . executeBatch ( ...
public class FieldObjectAccess { /** * a field is sending a new value ( out ) * @ throws java . lang . Exception */ @ Override public void out ( ) throws Exception { } }
Object val = fa . getFieldValue ( ) ; // Object val = access ; if ( ens . shouldFire ( ) ) { DataflowEvent e = new DataflowEvent ( ens . getController ( ) , this , val ) ; // / / DataflowEvent e = new DataflowEvent ( ens . getController ( ) , this , access . toObject ( ) ) ; ens . fireOut ( e ) ; // / / the value might...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AdviceType } { @ code > } } */ @ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" , name = "Advice" ) public JAXBElement < AdviceType > createAdvice ( AdviceType value ) { } }
return new JAXBElement < AdviceType > ( _Advice_QNAME , AdviceType . class , null , value ) ;
public class MemcachedClient { /** * Asynchronous CAS operation . * @ param < T > * @ param key the key * @ param casId the CAS identifier ( from a gets operation ) * @ param value the new value * @ param tc the transcoder to serialize and unserialize the value * @ return a future that will indicate the sta...
return asyncCAS ( key , casId , 0 , value , tc ) ;
public class SecureDfuImpl { /** * Sends the Calculate Checksum request . As a response a notification will be sent with current * offset and CRC32 of the current object . * @ return requested object info . * @ throws DeviceDisconnectedException * @ throws DfuException * @ throws UploadAbortedException * @ ...
if ( ! mConnected ) throw new DeviceDisconnectedException ( "Unable to read Checksum: device disconnected" ) ; writeOpCode ( mControlPointCharacteristic , OP_CODE_CALCULATE_CHECKSUM ) ; final byte [ ] response = readNotificationResponse ( ) ; final int status = getStatusCode ( response , OP_CODE_CALCULATE_CHECKSUM_KEY ...
public class ITFReader { /** * Identify where the start of the middle / payload section starts . * @ param row row of black / white values to search * @ return Array , containing index of start of ' start block ' and end of * ' start block ' */ private int [ ] decodeStart ( BitArray row ) throws NotFoundException...
int endStart = skipWhiteSpace ( row ) ; int [ ] startPattern = findGuardPattern ( row , endStart , START_PATTERN ) ; // Determine the width of a narrow line in pixels . We can do this by // getting the width of the start pattern and dividing by 4 because its // made up of 4 narrow lines . this . narrowLineWidth = ( sta...
public class PluginMessageDescription { /** * Create a description for an ExternalCondition object . * @ param condition the condition * @ return a description to be used on email templates */ public String external ( ExternalCondition condition ) { } }
String description = "AlerterId: " + condition . getAlerterId ( ) ; description += " DataId: " + condition . getDataId ( ) ; description += " Expression: " + condition . getExpression ( ) ; return description ;
public class CacheProviderWrapper { /** * Returns the current dependency IDs size for the disk cache . * @ return The current dependency ids size for the disk cache . */ @ Override public int getDepIdsSizeDisk ( ) { } }
final String methodName = "getDepIdsSizeDisk()" ; if ( this . swapToDisk ) { // TODO write code to support getDepIdsSizeDisk function if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it is not implemented yet" ) ; } } else { if ( this . featureSupport . isDiskC...
public class ReplaceDescendantsUtil { /** * タグとclass指定で子孫要素を置換する なお 、 replaceのディープコピーで置換されます 。 * @ param < T > * tag type . ( i . e . Div . class , Span . class . . . ) * @ param target * object for scan * @ param tagType * tag class * @ param clazz * class property of tag * @ param replace * ...
execute ( target , tagType , clazz , replace ) ;
public class OdsFactory { /** * Create a new ODS file writer from a document . Be careful : this method opens immediatly a * stream . * @ param filename the name of the destination file * @ return the ods writer * @ throws FileNotFoundException if the file can ' t be found */ public NamedOdsFileWriter createWri...
final NamedOdsDocument document = this . createNamedDocument ( ) ; final NamedOdsFileWriter writer = OdsFileDirectWriter . builder ( this . logger , document ) . openResult ( this . openFile ( filename ) ) . build ( ) ; document . addObserver ( writer ) ; document . prepareFlush ( ) ; return writer ;
public class Parser { /** * Test if the dollar character ( < tt > $ < / tt > ) at the given offset starts a dollar - quoted string and * return the offset of the ending dollar character . * @ param query query * @ param offset start offset * @ return offset of the ending dollar character */ public static int pa...
if ( offset + 1 < query . length && ( offset == 0 || ! isIdentifierContChar ( query [ offset - 1 ] ) ) ) { int endIdx = - 1 ; if ( query [ offset + 1 ] == '$' ) { endIdx = offset + 1 ; } else if ( isDollarQuoteStartChar ( query [ offset + 1 ] ) ) { for ( int d = offset + 2 ; d < query . length ; ++ d ) { if ( query [ d...
public class PaxPropertySetter { /** * Set the properites for the object that match the * < code > prefix < / code > passed as parameter . */ public void setProperties ( Properties properties , String prefix ) { } }
int len = prefix . length ( ) ; for ( Enumeration e = properties . propertyNames ( ) ; e . hasMoreElements ( ) ; ) { String key = ( String ) e . nextElement ( ) ; // handle only properties that start with the desired frefix . if ( key . startsWith ( prefix ) ) { // ignore key if it contains dots after the prefix if ( k...
public class TableKeysAndAttributes { /** * Adds a primary key to be included in the batch get - item operation . A * primary key could consist of either a hash - key or both a * hash - key and a range - key depending on the schema of the table . */ public TableKeysAndAttributes addPrimaryKey ( PrimaryKey primaryKe...
if ( primaryKey != null ) { if ( primaryKeys == null ) primaryKeys = new ArrayList < PrimaryKey > ( ) ; checkConsistency ( primaryKey ) ; this . primaryKeys . add ( primaryKey ) ; } return this ;
public class BreadCrumbPresenter { /** * Searches in all categories for the category that matches a breadcrumb . * @ param breadcrumb the breadcrumb , which the matching category should have * @ return a matching category or null if nothing is found */ private Category searchCategory ( String breadcrumb ) { } }
return model . getFlatCategoriesLst ( ) . stream ( ) . filter ( cat -> cat . getBreadcrumb ( ) . equals ( breadcrumb ) ) . findAny ( ) . orElse ( null ) ;
public class JSONObject { /** * Serialize this JSONObject to a string . * @ param jsonReferenceToId * a map from json reference to id * @ param includeNullValuedFields * if true , include null valued fields * @ param depth * the nesting depth * @ param indentWidth * the indent width * @ param buf * ...
final boolean prettyPrint = indentWidth > 0 ; final int n = items . size ( ) ; int numDisplayedFields ; if ( includeNullValuedFields ) { numDisplayedFields = n ; } else { numDisplayedFields = 0 ; for ( final Entry < String , Object > item : items ) { if ( item . getValue ( ) != null ) { numDisplayedFields ++ ; } } } if...
public class CmsFileBuffer { /** * Changes the size of this buffer . < p > * @ param size the new size */ public void truncate ( int size ) { } }
m_buffer . truncate ( size ) ; m_position = Math . min ( size , m_position ) ;
public class ObjectFactory2 { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link DerivedByInsertionFrom } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/ns/prov#" , name = "derivedByInsertionFrom" ) public JAXBElement < DerivedByInsertionFrom > createDerivedByInsertionFrom ( D...
return new JAXBElement < DerivedByInsertionFrom > ( _DerivedByInsertionFrom_QNAME , DerivedByInsertionFrom . class , null , value ) ;
public class KubernetesDockerRunner { /** * Deletes stale workflow instance execution pods . */ @ VisibleForTesting void tryCleanupPods ( ) { } }
var pods = client . pods ( ) . list ( ) . getItems ( ) ; pods . stream ( ) . map ( pod -> runAsync ( guard ( ( ) -> tryCleanupPod ( pod ) ) , executor ) ) . collect ( toList ( ) ) . forEach ( CompletableFuture :: join ) ; tracer . getCurrentSpan ( ) . addAnnotation ( "processed" , Map . of ( "pods" , AttributeValue . l...
public class GlassfishDetector { /** * { @ inheritDoc } * @ param pMBeanServerExecutor */ public ServerHandle detect ( MBeanServerExecutor pMBeanServerExecutor ) { } }
String version = detectVersion ( pMBeanServerExecutor ) ; if ( version != null ) { return new GlassfishServerHandle ( version , new HashMap < String , String > ( ) ) ; } else { return null ; }
public class Objects2 { /** * 如果对象值是 null 返回替代对象 , 否则返回对象本身 。 * @ param value * 对象 * @ param replacement * 替代对象 * @ param < T > * 对象类型 * @ return 结果 */ public static < T > T isNull ( final T value , final T replacement ) { } }
if ( value == null ) { return replacement ; } return value ;
public class LocalWeightedHistogramRotRect { /** * create the list of points in square coordinates that it will sample . values will range * from - 0.5 to 0.5 along each axis . */ protected void createSamplePoints ( int numSamples ) { } }
for ( int y = 0 ; y < numSamples ; y ++ ) { float regionY = ( y / ( numSamples - 1.0f ) - 0.5f ) ; for ( int x = 0 ; x < numSamples ; x ++ ) { float regionX = ( x / ( numSamples - 1.0f ) - 0.5f ) ; samplePts . add ( new Point2D_F32 ( regionX , regionY ) ) ; } }
public class CmsDialog { /** * Builds a button row with an " ok " and a " cancel " button . < p > * @ param okAttributes additional attributes for the " ok " button * @ param cancelAttributes additional attributes for the " cancel " button * @ return the button row */ public String dialogButtonsOkCancel ( String ...
return dialogButtons ( new int [ ] { BUTTON_OK , BUTTON_CANCEL } , new String [ ] { okAttributes , cancelAttributes } ) ;
public class Cluster { /** * get the current assignment for the topology . */ public SchedulerAssignment getAssignmentById ( String topologyId ) { } }
if ( this . assignments . containsKey ( topologyId ) ) { return this . assignments . get ( topologyId ) ; } return null ;
public class BaseDestinationHandler { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . impl . interfaces . MessageEventListener # registerForEvents ( com . ibm . ws . sib . processor . impl . interfaces . SIMPMessage ) */ @ Override public void registerForEvents ( SIMPMessage msg ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerForEvents" , msg ) ; msg . registerMessageEventListener ( MessageEvents . EXPIRY_NOTIFICATION , this ) ; msg . registerMessageEventListener ( MessageEvents . REFERENCES_DROPPED_TO_ZERO , this ) ; if ( TraceComponent...
public class CheckAccessControls { /** * If the superclass is final , this method returns an instance of the superclass . */ @ Nullable private static ObjectType getSuperClassInstanceIfFinal ( @ Nullable JSType type ) { } }
if ( type == null ) { return null ; } ObjectType obj = type . toObjectType ( ) ; FunctionType ctor = ( obj == null ) ? null : obj . getSuperClassConstructor ( ) ; JSDocInfo doc = ( ctor == null ) ? null : ctor . getJSDocInfo ( ) ; if ( doc != null && doc . isFinal ( ) ) { return ctor . getInstanceType ( ) ; } return nu...
public class TemplatesApi { /** * Gets a list of templates for a specified account . * Retrieves the definition of the specified template . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param templateId The ID of the template being accessed . ( required ) * @ retu...
return get ( accountId , templateId , null ) ;
public class MessageReceiverFilterList { /** * Constructor . * @ param baseMessageQueue My parent message queue . */ public void init ( BaseMessageReceiver receiver ) { } }
m_receiver = receiver ; m_mapFilters = new ConcurrentHashMap < Integer , BaseMessageFilter > ( ) ; m_intNext = new Integer ( 1 ) ;
public class AnnotationUtils { /** * Return a pair of Field [ ] whose left element is * the array of keys fields . * The right element contains the array of all other non - key fields . * @ param clazz the Class object * @ return a pair object whose first element contains key fields , and whose second element c...
Field [ ] filtered = filterDeepFields ( clazz ) ; List < Field > keys = new ArrayList < > ( ) ; List < Field > others = new ArrayList < > ( ) ; for ( Field field : filtered ) { if ( isKey ( field . getAnnotation ( DeepField . class ) ) ) { keys . add ( field ) ; } else { others . add ( field ) ; } } return Pair . creat...
public class CmsErrorWidget { /** * Creates the a new error label . < p > * @ return a label with the appropriate style for an error label */ private static Label createErrorLabel ( ) { } }
Label label = new Label ( ) ; label . addStyleName ( I_CmsLayoutBundle . INSTANCE . generalCss ( ) . cornerAll ( ) ) ; label . addStyleName ( I_CmsInputLayoutBundle . INSTANCE . inputCss ( ) . error ( ) ) ; return label ;
public class CommerceSubscriptionEntryPersistenceImpl { /** * Creates a new commerce subscription entry with the primary key . Does not add the commerce subscription entry to the database . * @ param commerceSubscriptionEntryId the primary key for the new commerce subscription entry * @ return the new commerce subs...
CommerceSubscriptionEntry commerceSubscriptionEntry = new CommerceSubscriptionEntryImpl ( ) ; commerceSubscriptionEntry . setNew ( true ) ; commerceSubscriptionEntry . setPrimaryKey ( commerceSubscriptionEntryId ) ; String uuid = PortalUUIDUtil . generate ( ) ; commerceSubscriptionEntry . setUuid ( uuid ) ; commerceSub...
public class ListSelectDialog { /** * Shortcut for quickly creating a new dialog * @ param textGUI Text GUI to add the dialog to * @ param title Title of the dialog * @ param description Description of the dialog * @ param listBoxHeight Maximum height of the list box , scrollbars will be used if there are more ...
int width = 0 ; for ( T item : items ) { width = Math . max ( width , TerminalTextUtils . getColumnWidth ( item . toString ( ) ) ) ; } width += 2 ; return showDialog ( textGUI , title , description , new TerminalSize ( width , listBoxHeight ) , items ) ;
public class CheckDatabase { /** * delete a particular segment in the shard . */ public static void deleteSegment ( Olap olap , ApplicationDefinition appDef , String shard , String segment ) { } }
VDirectory appDir = olap . getRoot ( appDef ) ; VDirectory shardDir = appDir . getDirectory ( shard ) ; VDirectory segmentDir = shardDir . getDirectory ( segment ) ; segmentDir . delete ( ) ;
public class AmazonWorkLinkClient { /** * Retrieves a list of fleets for the current account and Region . * @ param listFleetsRequest * @ return Result of the ListFleets operation returned by the service . * @ throws UnauthorizedException * You are not authorized to perform this action . * @ throws InternalSe...
request = beforeClientExecution ( request ) ; return executeListFleets ( request ) ;
public class HealthCheckClient { /** * Deletes the specified HealthCheck resource . * < p > Sample code : * < pre > < code > * try ( HealthCheckClient healthCheckClient = HealthCheckClient . create ( ) ) { * ProjectGlobalHealthCheckName healthCheck = ProjectGlobalHealthCheckName . of ( " [ PROJECT ] " , " [ HEA...
DeleteHealthCheckHttpRequest request = DeleteHealthCheckHttpRequest . newBuilder ( ) . setHealthCheck ( healthCheck ) . build ( ) ; return deleteHealthCheck ( request ) ;
public class Member { /** * Create a MemberUpdater to execute update . * @ param pathAccountSid The SID of the Account that created the resource ( s ) to * update * @ param pathQueueSid The SID of the Queue in which to find the members * @ param pathCallSid The Call SID of the resource ( s ) to update * @ par...
return new MemberUpdater ( pathAccountSid , pathQueueSid , pathCallSid , url , method ) ;
public class Tuple6 { /** * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument . */ public final < U1 > Tuple6 < U1 , T2 , T3 , T4 , T5 , T6 > map1 ( Function < ? super T1 , ? extends U1 > function ) { } }
return Tuple . tuple ( function . apply ( v1 ) , v2 , v3 , v4 , v5 , v6 ) ;
public class ThreadClockImpl { /** * Threads run method that increments the clock and resets the generated * nano seconds counter . */ public void run ( ) { } }
try { while ( -- expires >= 0 ) { sleep ( sysInterval ) ; synchronized ( ThreadClockImpl . class ) { currentTimeMillis += sysInterval ; } } } catch ( InterruptedException e ) { System . out . println ( "Clock thread interrupted" ) ; }
public class InjectionUtil { /** * Calls a method with the provided arguments as parameters . * @ param retClass the method return value * @ param targetClass the instance class * @ param target the instance containing the method * @ param method the method name * @ param argClasses types of the method argume...
try { Method classMethod = targetClass . getDeclaredMethod ( method , argClasses ) ; return AccessController . doPrivileged ( new SetMethodPrivilegedAction < T > ( classMethod , target , args ) ) ; } catch ( NoSuchMethodException e ) { throw new TransfuseInjectionException ( "Exception during method injection: NoSuchFi...
public class HtmlBaseTag { /** * Attribute implementation . * @ param name * @ param value * @ param tsh * @ throws JspException */ protected void setStateAttribute ( String name , String value , AbstractHtmlState tsh ) throws JspException { } }
boolean error = false ; // validate the name attribute , in the case of an error simply return . if ( name == null || name . length ( ) <= 0 ) { String s = Bundle . getString ( "Tags_AttributeNameNotSet" ) ; registerTagError ( s , null ) ; error = true ; } // it ' s not legal to set the id or name attributes this way i...
public class FastSet { /** * { @ inheritDoc } */ @ Override public boolean containsAll ( IntSet c ) { } }
if ( c == null || c . isEmpty ( ) || c == this ) { return true ; } if ( isEmpty ( ) ) { return false ; } final FastSet other = convert ( c ) ; if ( other . firstEmptyWord > firstEmptyWord ) { return false ; } final int [ ] localWords = words ; // faster final int [ ] localOtherWords = other . words ; // faster for ( in...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ConeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link ConeType } { @ code > } */ @ XmlElement...
return new JAXBElement < ConeType > ( _Cone_QNAME , ConeType . class , null , value ) ;
public class SearchBuilderLegacy { /** * Returns the { @ link SearchBuilder } represented by the specified JSON { @ code String } . * @ param json the JSON { @ code String } representing a { @ link SearchBuilder } * @ return the { @ link SearchBuilder } represented by the specified JSON { @ code String } */ static ...
try { return JsonSerializer . fromString ( json , SearchBuilderLegacy . class ) . builder ; } catch ( IOException e ) { throw new IndexException ( e , "Unparseable JSON search: {}" , json ) ; }
public class MavenResolverSystemBaseImpl { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . resolver . api . maven . PomlessResolveStageBase # loadPomFromClassLoaderResource ( java . lang . String ) */ @ Override public EQUIPPEDRESOLVESTAGETYPE loadPomFromClassLoaderResource ( String pathToPomResource ) thro...
return delegate . loadPomFromClassLoaderResource ( pathToPomResource ) ;
public class RenderingPipelineConfiguration { /** * Beans below this point are elements of the " standard " uPortal Rendering Pipeline - - where the * uPortal webapp renders all elements of the UI and handles all requests . */ @ Bean ( name = "standardRenderingPipeline" ) public IPortalRenderingPipeline getStandardRe...
final DynamicRenderingPipeline rslt = new DynamicRenderingPipeline ( ) ; rslt . setPipeline ( getAnalyticsIncorporationComponent ( ) ) ; return rslt ;
public class WebApplicationContext { /** * Stop the web application . * Handlers for resource , servlet , filter and security are removed * as they are recreated and configured by any subsequent call to start ( ) . * @ exception InterruptedException */ protected void doStop ( ) throws Exception { } }
MultiException mex = new MultiException ( ) ; Thread thread = Thread . currentThread ( ) ; ClassLoader lastContextLoader = thread . getContextClassLoader ( ) ; try { // Context listeners if ( _contextListeners != null ) { if ( _webAppHandler != null ) { ServletContextEvent event = new ServletContextEvent ( getServletCo...
public class Animation { /** * Animates this { @ link Animation } . < br > * Sets the { @ link # started } and { @ link # finished } status . * @ param timer the timer * @ return the s */ public S animate ( Timer timer ) { } }
long elapsed = timer . elapsedTime ( ) - Timer . tickToTime ( delay ) ; started = elapsed > transform . getDelay ( ) ; finished = elapsed > transform . totalDuration ( ) && transform . getLoops ( ) != - 1 ; if ( ! started && ! renderBefore ) return null ; if ( finished && ! renderAfter ) return null ; transform . trans...
public class SamlIdPObjectSigner { /** * Prepare endpoint url scheme security handler . * @ param < T > the type parameter * @ param outboundContext the outbound context * @ throws Exception the exception */ protected < T extends SAMLObject > void prepareEndpointURLSchemeSecurityHandler ( final MessageContext < T...
val handlerEnd = new EndpointURLSchemeSecurityHandler ( ) ; handlerEnd . initialize ( ) ; handlerEnd . invoke ( outboundContext ) ;
public class MarkLogicClient { /** * commits a transaction * @ throws MarkLogicTransactionException */ public void commitTransaction ( ) throws MarkLogicTransactionException { } }
if ( isActiveTransaction ( ) ) { try { sync ( ) ; this . tx . commit ( ) ; this . tx = null ; } catch ( MarkLogicSesameException e ) { logger . error ( e . getLocalizedMessage ( ) ) ; throw new MarkLogicTransactionException ( e ) ; } } else { throw new MarkLogicTransactionException ( "No active transaction to commit." ...
public class UntilElementImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case SimpleAntlrPackage . UNTIL_ELEMENT__LEFT : setLeft ( ( RuleElement ) null ) ; return ; case SimpleAntlrPackage . UNTIL_ELEMENT__RIGHT : setRight ( ( RuleElement ) null ) ; return ; } super . eUnset ( featureID ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcUnitaryControlElementTypeEnum ( ) { } }
if ( ifcUnitaryControlElementTypeEnumEEnum == null ) { ifcUnitaryControlElementTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1095 ) ; } return ifcUnitaryControlElementTypeEnumEEnum ;
public class Field { /** * Same as { @ link Field # getNeighbours ( ) } but filtered with { @ link Field # isVisible ( ) } . */ public Set < VisibleField > getVisibleNeighbours ( ) { } }
return getNeighbours ( ) . stream ( ) . filter ( Field :: isVisible ) . map ( Field :: asVisibleField ) . collect ( Collectors . toSet ( ) ) ;
public class IgnoreClassHelper { /** * Try to exclude JDK classes and known JDBC Drivers and Libraries . * We want to do this for performance reasons - that is skip checking for * enhancement on classes that we know are not part of the application code * and should not be enhanced . * @ param className the clas...
if ( className == null ) { return true ; } className = className . replace ( '.' , '/' ) ; if ( processPackages . length > 0 ) { // use specific positive matching return specificMatching ( className ) ; } // we don ' t have specific packages to process so instead // we will ignore packages that we know we don ' t want ...