signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PropertyMetadata { /** * Initializes the secondary indexer for this property , if any . */ private void initializeSecondaryIndexer ( ) { } }
SecondaryIndex secondaryIndexAnnotation = field . getAnnotation ( SecondaryIndex . class ) ; if ( secondaryIndexAnnotation == null ) { return ; } String indexName = secondaryIndexAnnotation . name ( ) ; if ( indexName == null || indexName . trim ( ) . length ( ) == 0 ) { indexName = DEFAULT_SECONDARY_INDEX_PREFIX + map...
public class BackupManagerImpl { /** * { @ inheritDoc } */ public void restore ( BackupChainLog log , String repositoryName , WorkspaceEntry workspaceEntry , boolean asynchronous ) throws BackupOperationException , BackupConfigurationException , RepositoryException , RepositoryConfigurationException { } }
if ( workspaceEntry == null ) { if ( ! log . getBackupConfig ( ) . getRepository ( ) . equals ( repositoryName ) ) { throw new WorkspaceRestoreException ( "If workspaceEntry is null, so will be restored with original configuration. " + "The repositoryName (\"" + repositoryName + "\") should be equals original reposito...
public class FileTypeUtil { /** * 根据文件流的头部信息获得文件类型 * @ param fileStreamHexHead 文件流头部16进制字符串 * @ return 文件类型 , 未找到为 < code > null < / code > */ public static String getType ( String fileStreamHexHead ) { } }
for ( Entry < String , String > fileTypeEntry : fileTypeMap . entrySet ( ) ) { if ( StrUtil . startWithIgnoreCase ( fileStreamHexHead , fileTypeEntry . getKey ( ) ) ) { return fileTypeEntry . getValue ( ) ; } } return null ;
public class Path { /** * This method returns the Path as an unmodifiable list of the terms * comprising the Path . */ public List < String > toList ( ) { } }
List < String > list = new LinkedList < String > ( ) ; if ( authority != null ) { list . add ( authority ) ; } for ( Term t : terms ) { list . add ( t . toString ( ) ) ; } return list ;
public class RegisterQualityProfiles { /** * The Quality profiles created by users should be renamed when they have the same name * as the built - in profile to be persisted . * When upgrading from < 6.5 , all existing profiles are considered as " custom " ( created * by users ) because the concept of built - in ...
Collection < String > uuids = dbClient . qualityProfileDao ( ) . selectUuidsOfCustomRulesProfiles ( dbSession , profile . getLanguage ( ) , profile . getName ( ) ) ; if ( uuids . isEmpty ( ) ) { return ; } Profiler profiler = Profiler . createIfDebug ( Loggers . get ( getClass ( ) ) ) . start ( ) ; String newName = pro...
public class TemplateMatcher { /** * / * - - - - - [ File Copy ] - - - - - */ public void copyInto ( File source , File targetDir , final VariableResolver resolver ) throws IOException { } }
FileUtil . copyInto ( source , targetDir , new FileUtil . FileCreator ( ) { @ Override public void createFile ( File sourceFile , File targetFile ) throws IOException { replace ( new FileReader ( sourceFile ) , new FileWriter ( targetFile ) , resolver ) ; } @ Override public String translate ( String name ) { return re...
public class Change { /** * Creates a function , which handles binding between a ListProperty and an ObjectProperty . * < p > If this change isn ' t a list change , oldValue and newValue properties will have the single * element inside of the list , for easier usage . * @ param listProperty to be bound to the obj...
return ( ) -> { if ( ! isListChange ( ) && listProperty . get ( ) != null && listProperty . get ( ) . size ( ) != 0 ) { return listProperty . get ( ) . get ( 0 ) ; } return null ; } ;
public class LdapDao { /** * Inserts an entry into the DIT . Throws { @ link EntryAlreadyExistsException } if an entry with given Dn already * exists . Throws { @ link MissingParentException } if an ancestor of the entry is missing . */ public void store ( Entry entry ) throws EntryAlreadyExistsException , MissingPar...
AddRequest addRequest = new AddRequestImpl ( ) . setEntry ( entry ) ; LdapResult result ; try { result = connection . add ( addRequest ) . getLdapResult ( ) ; } catch ( LdapException e ) { throw new LdapDaoException ( e ) ; } if ( result . getResultCode ( ) == ResultCodeEnum . ENTRY_ALREADY_EXISTS ) { throw new EntryAl...
public class CmsSearchIndexSourceControlList { /** * Returns the available search indexes of this installation . * @ return the available search indexes of this installation */ private List < CmsSearchIndexSource > searchIndexSources ( ) { } }
CmsSearchManager manager = OpenCms . getSearchManager ( ) ; return new LinkedList < CmsSearchIndexSource > ( manager . getSearchIndexSources ( ) . values ( ) ) ;
public class MimeMessageParser { /** * Parses the MimePart to create a DataSource . * @ param part the current part to be processed * @ return the DataSource */ @ Nonnull private static DataSource createDataSource ( @ Nonnull final MimePart part ) { } }
final DataHandler dataHandler = retrieveDataHandler ( part ) ; final DataSource dataSource = dataHandler . getDataSource ( ) ; final String contentType = parseBaseMimeType ( dataSource . getContentType ( ) ) ; final byte [ ] content = readContent ( retrieveInputStream ( dataSource ) ) ; final ByteArrayDataSource result...
public class DetectorFactoryCollection { /** * Register a DetectorFactory . */ void registerDetector ( DetectorFactory factory ) { } }
if ( FindBugs . DEBUG ) { System . out . println ( "Registering detector: " + factory . getFullName ( ) ) ; } String detectorName = factory . getShortName ( ) ; if ( ! factoryList . contains ( factory ) ) { factoryList . add ( factory ) ; } else { LOGGER . log ( Level . WARNING , "Trying to add already registered facto...
public class ViterbiSearcher { /** * Find best path from input lattice . * @ param lattice the result of build method * @ return List of ViterbiNode which consist best path */ public List < ViterbiNode > search ( ViterbiLattice lattice ) { } }
ViterbiNode [ ] [ ] endIndexArr = calculatePathCosts ( lattice ) ; LinkedList < ViterbiNode > result = backtrackBestPath ( endIndexArr [ 0 ] [ 0 ] ) ; return result ;
public class MessagePacker { /** * Writes a byte array to the output . * This method is used with { @ link # packRawStringHeader ( int ) } or { @ link # packBinaryHeader ( int ) } methods . * @ param src the data to add * @ param off the start offset in the data * @ param len the number of bytes to add * @ re...
if ( buffer == null || buffer . size ( ) - position < len || len > bufferFlushThreshold ) { flush ( ) ; // call flush before write // Directly write payload to the output without using the buffer out . write ( src , off , len ) ; totalFlushBytes += len ; } else { buffer . putBytes ( position , src , off , len ) ; posit...
public class StunAttributeDecoder { /** * Decodes the specified binary array and returns the corresponding * attribute object . * @ param bytes * the binary array that should be decoded . * @ param offset * the index where the message starts . * @ param length * the number of bytes that the message is lon...
if ( bytes == null || bytes . length < StunAttribute . HEADER_LENGTH ) { throw new StunException ( StunException . ILLEGAL_ARGUMENT , "Could not decode the specified binary array." ) ; } // Discover attribute type char attributeType = ( char ) ( ( bytes [ offset ] << 8 ) | bytes [ offset + 1 ] ) ; int len1 = bytes [ of...
public class JavacFileManager { /** * Close the JavaFileManager , releasing resources . */ @ Override @ DefinedBy ( Api . COMPILER ) public void close ( ) throws IOException { } }
if ( deferredCloseTimeout > 0 ) { deferredClose ( ) ; return ; } locations . close ( ) ; for ( Container container : containers . values ( ) ) { container . close ( ) ; } containers . clear ( ) ; contentCache . clear ( ) ;
public class UTS46 { /** * returns the new dest . length ( ) */ private int mapDevChars ( StringBuilder dest , int labelStart , int mappingStart ) { } }
int length = dest . length ( ) ; boolean didMapDevChars = false ; for ( int i = mappingStart ; i < length ; ) { char c = dest . charAt ( i ) ; switch ( c ) { case 0xdf : // Map sharp s to ss . didMapDevChars = true ; dest . setCharAt ( i ++ , 's' ) ; dest . insert ( i ++ , 's' ) ; ++ length ; break ; case 0x3c2 : // Ma...
public class ClasspathElementZip { /** * Scan for path matches within jarfile , and record ZipEntry objects of matching files . * @ param log * the log */ @ Override void scanPaths ( final LogNode log ) { } }
if ( logicalZipFile == null ) { skipClasspathElement = true ; } if ( skipClasspathElement ) { return ; } if ( scanned . getAndSet ( true ) ) { // Should not happen throw new IllegalArgumentException ( "Already scanned classpath element " + getZipFilePath ( ) ) ; } final LogNode subLog = log == null ? null : log . log (...
public class DBaseFileWriter { /** * Replies the decimal size of the DBase field which must contains the * value of the given attribute value . * @ throws DBaseFileException if the Dbase file cannot be read . * @ throws AttributeException if an attribute is invalid . */ private static int computeDecimalSize ( Att...
final DBaseFieldType dbftype = DBaseFieldType . fromAttributeType ( value . getType ( ) ) ; return dbftype . getDecimalPointPosition ( value . getString ( ) ) ;
public class AbstractPathFinder { /** * { @ inheritDoc } */ @ Override public SimplePath [ ] scan ( KamNode [ ] sources ) { } }
if ( noItems ( sources ) ) { throw new InvalidArgument ( "sources" , sources ) ; } if ( nulls ( ( Object [ ] ) sources ) ) { throw new InvalidArgument ( "Source nodes contains null elements" ) ; } Kam [ ] kams = kams ( sources ) ; if ( ! sameKAMs ( kams ) ) { throw new InvalidArgument ( "Source KAMs are not equal" ) ; ...
public class PollArrayWrapper { /** * Prepare another pollfd struct for use . */ void addEntry ( SelChImpl sc ) { } }
putDescriptor ( totalChannels , IOUtil . fdVal ( sc . getFD ( ) ) ) ; putEventOps ( totalChannels , 0 ) ; putReventOps ( totalChannels , 0 ) ; totalChannels ++ ;
public class ApiOvhHostingprivateDatabase { /** * Get this object properties * REST : GET / hosting / privateDatabase / { serviceName } / database / { databaseName } / dump / { id } * @ param serviceName [ required ] The internal name of your private database * @ param databaseName [ required ] Database name * ...
String qPath = "/hosting/privateDatabase/{serviceName}/database/{databaseName}/dump/{id}" ; StringBuilder sb = path ( qPath , serviceName , databaseName , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDatabaseDump . class ) ;
public class AbstractVendorPolicy { /** * This function invokes the vendor policy . < br > * The policy may charge a customer for the service , or validate the user * has permissions to invoke the action and so on . < br > * In case the policy takes over the flow and the fax bridge should not * be invoked , thi...
if ( requestDataHolder == null ) { throw new FaxException ( "Request data holder not provided." ) ; } if ( faxJob == null ) { throw new FaxException ( "Fax job not provided." ) ; } // invoke policy boolean continueFlow = this . invokePolicyForResponseImpl ( requestDataHolder , faxJob ) ; return continueFlow ;
public class NatsTransporter { /** * - - - DISCONNECT - - - */ @ Override public void connectionEvent ( Connection conn , Events type ) { } }
switch ( type ) { case CONNECTED : // The connection is permanently closed , either by manual action or // failed reconnects if ( debug ) { logger . info ( "NATS connection opened." ) ; } break ; case CLOSED : // The connection lost its connection , but may try to reconnect if // configured to logger . info ( "NATS con...
public class SDBaseOps { /** * Sum array reduction operation , optionally along specified dimensions * @ param x Input variable * @ param dimensions Dimensions to reduce over . If dimensions are not specified , full array reduction is performed * @ return Output variable : reduced array of rank ( input rank - num...
return sum ( name , x , false , dimensions ) ;
public class JsonDBTemplate { /** * / * ( non - Javadoc ) * @ see io . jsondb . JsonDBOperations # collectionExists ( java . lang . String ) */ @ Override public boolean collectionExists ( String collectionName ) { } }
CollectionMetaData collectionMeta = cmdMap . get ( collectionName ) ; if ( null == collectionMeta ) { return false ; } collectionMeta . getCollectionLock ( ) . readLock ( ) . lock ( ) ; try { return collectionsRef . get ( ) . containsKey ( collectionName ) ; } finally { collectionMeta . getCollectionLock ( ) . readLock...
public class vpnglobal_vpnnexthopserver_binding { /** * Use this API to fetch filtered set of vpnglobal _ vpnnexthopserver _ binding resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static vpnglobal_vpnnexthopserver_binding [ ] get_filtered ( nitro_service ser...
vpnglobal_vpnnexthopserver_binding obj = new vpnglobal_vpnnexthopserver_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpnglobal_vpnnexthopserver_binding [ ] response = ( vpnglobal_vpnnexthopserver_binding [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class StopwatchImpl { /** * Protected method doing the stop work based on provided start nano - time . * @ param split Split object that has been stopped * @ param start start nano - time of the split @ return split time in ns * @ param nowNanos current nano time * @ param subSimon name of the sub - stop...
StopwatchSample sample = null ; synchronized ( this ) { active -- ; updateUsagesNanos ( nowNanos ) ; if ( subSimon == null ) { long splitNs = nowNanos - start ; addSplit ( splitNs ) ; if ( ! manager . callback ( ) . callbacks ( ) . isEmpty ( ) ) { sample = sample ( ) ; } updateIncrementalSimons ( splitNs , nowNanos ) ;...
public class MethodNode { /** * Returns the LabelNode corresponding to the given Label . Creates a new * LabelNode if necessary . The default implementation of this method uses * the { @ link Label # info } field to store associations between labels and * label nodes . * @ param l * a Label . * @ return the...
if ( ! ( l . info instanceof LabelNode ) ) { l . info = new LabelNode ( ) ; } return ( LabelNode ) l . info ;
public class RxLoader2 { /** * Saves the last value that the { @ link rx . Observable } returns in { @ link * rx . Observer # onNext ( Object ) } in the Activities ' ss ore Fragment ' s instanceState bundle . When * the { @ code Activity } or { @ code Fragment } is recreated , then the value will be redelivered . ...
super . save ( saveCallback ) ; return this ;
public class AtomPositionMap { /** * Calculates the number of residues of the specified chain in a given range , inclusive . * @ param positionA index of the first atom to count * @ param positionB index of the last atom to count * @ param startingChain Case - sensitive chain * @ return The number of atoms betw...
int positionStart , positionEnd ; if ( positionA <= positionB ) { positionStart = positionA ; positionEnd = positionB ; } else { positionStart = positionB ; positionEnd = positionA ; } int count = 0 ; // Inefficient search for ( Map . Entry < ResidueNumber , Integer > entry : treeMap . entrySet ( ) ) { if ( entry . get...
public class PeepholeReplaceKnownMethods { /** * Try to fold . charCodeAt ( ) calls on strings */ private Node tryFoldStringCharCodeAt ( Node n , Node stringNode , Node arg1 ) { } }
checkArgument ( n . isCall ( ) ) ; checkArgument ( stringNode . isString ( ) ) ; int index ; String stringAsString = stringNode . getString ( ) ; if ( arg1 != null && arg1 . isNumber ( ) && arg1 . getNext ( ) == null ) { index = ( int ) arg1 . getDouble ( ) ; } else { return n ; } if ( index < 0 || stringAsString . len...
public class CapturingClassTransformer { /** * Determines the existence of the server log directory , and attempts to create a capture * directory within the log directory . If this can be accomplished , the field captureEnabled * is set to true . Otherwise , it is left to its default value false if the capture dir...
if ( logDirectory == null ) { captureEnabled = false ; return ; } AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { @ Override public Void run ( ) { // Create a new or reuse an existing base capture directory String captureDirStr = "JPATransform" + "/" + ( ( aaplName != null ) ? aaplName : "unknowna...
public class FileMonitor { /** * Add file to listen for . File may be any java . io . File ( including a * directory ) and may well be a non - existing file in the case where the * creating of the file is to be trepped . * More than one file can be listened for . When the specified file is * created , modified ...
if ( ! files_ . containsKey ( file ) ) { long modifiedTime = file . exists ( ) ? file . lastModified ( ) : - 1 ; files_ . put ( file , new Long ( modifiedTime ) ) ; }
public class GVRPeriodicEngine { /** * Run a task once , after a delay . * @ param task * Task to run . * @ param delay * Unit is seconds . * @ return An interface that lets you query the status ; cancel ; or * reschedule the event . */ public PeriodicEvent runAfter ( Runnable task , float delay ) { } }
validateDelay ( delay ) ; return new Event ( task , delay ) ;
public class MSPDIWriter { /** * This method determines whether the cost rate table should be written . * A default cost rate table should not be written to the file . * @ param entry cost rate table entry * @ param from from date * @ return boolean flag */ private boolean costRateTableWriteRequired ( CostRateT...
boolean fromDate = ( DateHelper . compare ( from , DateHelper . FIRST_DATE ) > 0 ) ; boolean toDate = ( DateHelper . compare ( entry . getEndDate ( ) , DateHelper . LAST_DATE ) > 0 ) ; boolean costPerUse = ( NumberHelper . getDouble ( entry . getCostPerUse ( ) ) != 0 ) ; boolean overtimeRate = ( entry . getOvertimeRate...
public class PortletWorkerFactoryImpl { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . portlet . rendering . worker . IPortletWorkerFactory # createRenderHeaderWorker ( javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , org . apereo . portal . portlet . om . IPor...
final IPortletWindow portletWindow = this . portletWindowRegistry . getPortletWindow ( request , portletWindowId ) ; return new PortletRenderHeaderExecutionWorker ( portletThreadPool , executionInterceptors , portletRenderer , request , response , portletWindow ) ;
public class CmsADEManager { /** * Returns the show editor help flag . < p > * @ param cms the cms context * @ return the show editor help flag */ public boolean isShowEditorHelp ( CmsObject cms ) { } }
CmsUser user = cms . getRequestContext ( ) . getCurrentUser ( ) ; String showHelp = ( String ) user . getAdditionalInfo ( ADDINFO_ADE_SHOW_EDITOR_HELP ) ; return CmsStringUtil . isEmptyOrWhitespaceOnly ( showHelp ) || Boolean . parseBoolean ( showHelp ) ;
public class Container { /** * < p > create . < / p > * @ param application a { @ link ameba . core . Application } object . * @ return a { @ link ameba . container . Container } object . * @ throws java . lang . IllegalAccessException if any . * @ throws java . lang . InstantiationException if any . */ @ Suppr...
String provider = ( String ) application . getProperty ( "container.provider" ) ; logger . debug ( Messages . get ( "info.container.provider" , provider ) ) ; try { Class < Container > ContainerClass = ( Class < Container > ) ClassUtils . getClass ( provider ) ; Constructor < Container > constructor = ContainerClass . ...
public class InApplicationMonitorInterceptor { /** * { @ inheritDoc } */ public Object invoke ( MethodInvocation mi ) /* Honoring the interface earns you a punch in the face . . . CSOFF : IllegalThrows */ throws Throwable /* CSON : IllegalThrows */ { } }
String monitorName = getMonitorName ( mi ) ; final PerfMonitor monitor = PerfTimer . createMonitor ( ) ; try { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "enter [" + monitorName + "]" ) ; } return mi . proceed ( ) ; } finally { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "leave [" + monitorName + "]" ) ; } mon...
public class SerializerIntrinsics { /** * Dot Product of Packed DP - FP Values ( SSE4.1 ) . */ public final void dppd ( XMMRegister dst , XMMRegister src , Immediate imm8 ) { } }
emitX86 ( INST_DPPD , dst , src , imm8 ) ;
public class MarcFieldTransformer { /** * Interpolate variables . * @ param marcField MARC field * @ param value the input value * @ return the interpolated string */ private String interpolate ( MarcField marcField , String value ) { } }
if ( value == null ) { return null ; } Matcher m = REP . matcher ( value ) ; if ( m . find ( ) ) { return m . replaceAll ( Integer . toString ( repeatCounter ) ) ; } m = NREP . matcher ( value ) ; if ( m . find ( ) ) { if ( repeatCounter > 99 ) { repeatCounter = 99 ; logger . log ( Level . WARNING , "counter > 99, over...
public class Time { /** * Converts a string in JDBC time escape format to a < code > Time < / code > value . * @ param s time in format " hh : mm : ss " * @ return a corresponding < code > Time < / code > object */ public static Time valueOf ( String s ) { } }
int hour ; int minute ; int second ; int firstColon ; int secondColon ; if ( s == null ) throw new java . lang . IllegalArgumentException ( ) ; firstColon = s . indexOf ( ':' ) ; secondColon = s . indexOf ( ':' , firstColon + 1 ) ; if ( ( firstColon > 0 ) & ( secondColon > 0 ) & ( secondColon < s . length ( ) - 1 ) ) {...
public class CancelSpotFleetRequestsRequest { /** * The IDs of the Spot Fleet requests . * @ param spotFleetRequestIds * The IDs of the Spot Fleet requests . */ public void setSpotFleetRequestIds ( java . util . Collection < String > spotFleetRequestIds ) { } }
if ( spotFleetRequestIds == null ) { this . spotFleetRequestIds = null ; return ; } this . spotFleetRequestIds = new com . amazonaws . internal . SdkInternalList < String > ( spotFleetRequestIds ) ;
public class TagletManager { /** * Given an array of < code > Tag < / code > s , check for spelling mistakes . * @ param doc the Doc object that holds the tags . * @ param tags the list of < code > Tag < / code > s to check . * @ param areInlineTags true if the array of tags are inline and false otherwise . */ pu...
if ( tags == null ) { return ; } Taglet taglet ; for ( Tag tag : tags ) { String name = tag . name ( ) ; if ( name . length ( ) > 0 && name . charAt ( 0 ) == '@' ) { name = name . substring ( 1 , name . length ( ) ) ; } if ( ! ( standardTags . contains ( name ) || customTags . containsKey ( name ) ) ) { if ( standardTa...
public class EDGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . EDG__DEG_NAME : return getDEGName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class SerializationObjectPool { /** * Gets the next avaialable serialization object . * @ return ISerializationObject instance to do the conversation with . */ public SerializationObject getSerializationObject ( ) { } }
SerializationObject object ; synchronized ( ivListOfObjects ) { if ( ivListOfObjects . isEmpty ( ) ) { object = createNewObject ( ) ; } else { object = ivListOfObjects . remove ( ivListOfObjects . size ( ) - 1 ) ; } } return object ;
public class BatchGetApplicationsResult { /** * Information about the applications . * @ return Information about the applications . */ public java . util . List < ApplicationInfo > getApplicationsInfo ( ) { } }
if ( applicationsInfo == null ) { applicationsInfo = new com . amazonaws . internal . SdkInternalList < ApplicationInfo > ( ) ; } return applicationsInfo ;
public class HttpPanelSyntaxHighlightTextArea { /** * Highlight all found strings */ private void highlightEntryParser ( HighlightSearchEntry entry ) { } }
String text ; int lastPos = 0 ; text = this . getText ( ) ; Highlighter hilite = this . getHighlighter ( ) ; HighlightPainter painter = new DefaultHighlighter . DefaultHighlightPainter ( entry . getColor ( ) ) ; while ( ( lastPos = text . indexOf ( entry . getToken ( ) , lastPos ) ) > - 1 ) { try { hilite . addHighligh...
public class IconTable { /** * Create the style columns * @ return columns */ private static List < UserCustomColumn > createColumns ( ) { } }
List < UserCustomColumn > columns = new ArrayList < > ( ) ; columns . addAll ( createRequiredColumns ( ) ) ; int index = columns . size ( ) ; columns . add ( UserCustomColumn . createColumn ( index ++ , COLUMN_NAME , GeoPackageDataType . TEXT , false , null ) ) ; columns . add ( UserCustomColumn . createColumn ( index ...
public class DefaultArtifactUtil { /** * Tests if the given fully qualified name exists in the given artifact . * @ param artifact artifact to test * @ param mainClass the fully qualified name to find in artifact * @ return { @ code true } if given artifact contains the given fqn , { @ code false } otherwise * ...
boolean containsClass = true ; // JarArchiver . grabFilesAndDirs ( ) URL url ; try { url = artifact . getFile ( ) . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { throw new MojoExecutionException ( "Could not get artifact url: " + artifact . getFile ( ) , e ) ; } ClassLoader cl = new java . net . URLClas...
public class FunctionLibFactory { /** * does not involve the content to create an id , value returned is based on metadata of the file * ( lastmodified , size ) * @ param res * @ return * @ throws NoSuchAlgorithmException */ public static String id ( Resource res ) { } }
String str = ResourceUtil . getCanonicalPathEL ( res ) + "|" + res . length ( ) + "|" + res . lastModified ( ) ; try { return Hash . md5 ( str ) ; } catch ( NoSuchAlgorithmException e ) { return Caster . toString ( HashUtil . create64BitHash ( str ) ) ; }
public class Parameter { /** * Extract the name from an argument . * < ul > * < li > IdentifierTree - if the identifier is ' this ' then use the name of the enclosing class , * otherwise use the name of the identifier * < li > MemberSelectTree - the name of its identifier * < li > NewClassTree - the name of t...
switch ( expressionTree . getKind ( ) ) { case MEMBER_SELECT : return ( ( MemberSelectTree ) expressionTree ) . getIdentifier ( ) . toString ( ) ; case NULL_LITERAL : // null could match anything pretty well return NAME_NULL ; case IDENTIFIER : IdentifierTree idTree = ( IdentifierTree ) expressionTree ; if ( idTree . g...
public class CoverageDataCore { /** * Determine the y source pixel location * @ param y * y pixel * @ param destTop * destination top most pixel * @ param srcTop * source top most pixel * @ param heightRatio * source over destination height ratio * @ return y source pixel */ protected float getYSource...
float dest = getYEncodedLocation ( y , encoding ) ; float source = getSource ( dest , destTop , srcTop , heightRatio ) ; return source ;
public class ChildesParser { /** * Parses a single xml file . If { @ code utterancePerDoc } is true , each * utterance will be on a separate line , otherwise they will all be * concantanated , and separated by periods , and stored on a single line . */ public void parseFile ( File file , boolean utterancePerDoc ) {...
try { // Build an xml document . DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; Document doc = db . parse ( file ) ; // Extract all utterances . NodeList utterances = doc . getElementsByTagName ( "u" ) ; StringBuilder fileBuilder = new StringB...
public class Filters { /** * Gets a filter that always either returns the original object unchanged * or returns < code > null < / code > . * @ param value whether to accept or reject all items . * @ param < T > the type . * @ return the filter . */ public static < T > Filter < T > bool ( final boolean value ) ...
return new NonMutatingFilter < T > ( ) { @ Override public boolean accepts ( T item ) { return value ; } } ;
public class ExecutorServiceImpl { /** * { @ inheritDoc } */ @ Override public < T > Future < T > submit ( Runnable task , T result ) { } }
threadPoolController . resumeIfPaused ( ) ; return threadPool . submit ( createWrappedRunnable ( task ) , result ) ;
public class BidiFormatter { /** * Factory for creating an instance of BidiFormatter given the context directionality . { @ link * # spanWrap } avoids span wrapping unless there ' s a reason ( ' dir ' attribute should be appended ) . * @ param contextDir The context directionality . Must be RTL or LTR . */ public s...
switch ( contextDir ) { case LTR : return DEFAULT_LTR_INSTANCE ; case RTL : return DEFAULT_RTL_INSTANCE ; case NEUTRAL : throw new IllegalArgumentException ( "invalid context directionality: " + contextDir ) ; } throw new AssertionError ( contextDir ) ;
public class AbstractIntDoubleMap { /** * Applies a procedure to each ( key , value ) pair of the receiver , if any . * Iteration order is guaranteed to be < i > identical < / i > to the order used by method { @ link # forEachKey ( IntProcedure ) } . * @ param procedure the procedure to be applied . Stops iteration...
return forEachKey ( new IntProcedure ( ) { public boolean apply ( int key ) { return procedure . apply ( key , get ( key ) ) ; } } ) ;
public class X509Key { /** * Initialize an X509Key object from an input stream . The data on that * input stream must be encoded using DER , obeying the X . 509 * < code > SubjectPublicKeyInfo < / code > format . That is , the data is a * sequence consisting of an algorithm ID and a bit string which holds * the...
DerValue val ; try { val = new DerValue ( in ) ; if ( val . tag != DerValue . tag_Sequence ) throw new InvalidKeyException ( "invalid key format" ) ; algid = AlgorithmId . parse ( val . data . getDerValue ( ) ) ; setKey ( val . data . getUnalignedBitString ( ) ) ; parseKeyBits ( ) ; if ( val . data . available ( ) != 0...
public class SARLImages { /** * Replies the image descriptor for the given element . * @ param type the type of the SARL element , or < code > null < / code > if unknown . * @ param isInner indicates if the element is inner . * @ return the image descriptor . */ public ImageDescriptor getTypeImageDescriptor ( Sar...
return getTypeImageDescriptor ( type , isInner , false , 0 , USE_LIGHT_ICONS ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link PolygonType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link PolygonType } { @ code > } */ @ XmlE...
return new JAXBElement < PolygonType > ( _Polygon_QNAME , PolygonType . class , null , value ) ;
public class ColorPixel { /** * Applies the specified transformation matrix ( 3x3) * to this RGB vector . Alpha is preserved . < br > * { @ code this = m * this } * @ param m00 first row first col * @ param m01 first row second col * @ param m02 first row third col * @ param m10 second row first col * @ p...
return setRGB_fromDouble_preserveAlpha ( dot ( m00 , m01 , m02 ) , dot ( m10 , m11 , m12 ) , dot ( m20 , m21 , m22 ) ) ;
public class ParallelLayeredWordCloud { /** * constructs the wordcloud specified by layer using the given * wordfrequencies . < br > * This is a non - blocking call . * @ param layer * Wordcloud Layer * @ param wordFrequencies * the WordFrequencies to use as input */ @ Override public void build ( final int...
final Future < ? > completionFuture = executorservice . submit ( ( ) -> { LOGGER . info ( "Starting to build WordCloud Layer {} in new Thread" , layer ) ; super . build ( layer , wordFrequencies ) ; } ) ; executorFutures . add ( completionFuture ) ;
public class TextContentChecker { /** * Returns a < code > DatatypeStreamingValidator < / code > for the element if it * needs < code > textContent < / code > checking or < code > null < / code > if it does * not . * @ param uri * the namespace URI of the element * @ param localName * the local name of the ...
if ( "http://www.w3.org/1999/xhtml" . equals ( uri ) ) { if ( "time" . equals ( localName ) ) { if ( atts . getIndex ( "" , "datetime" ) < 0 ) { return TimeDatetime . THE_INSTANCE . createStreamingValidator ( null ) ; } } if ( "script" . equals ( localName ) ) { if ( atts . getIndex ( "" , "src" ) < 0 ) { return Script...
public class HomepageHighcharts { /** * Returns a Chart object from the current page parameters * @ param params the page parameters from the page URI * @ return a Chart */ private Chart getChartFromParams ( final PageParameters params ) { } }
String chartString ; String themeString ; Chart config ; // If the showcase is started without any parameters // set the parameters to lineBasic and give us a line Chart if ( params . getAllNamed ( ) . size ( ) < 2 ) { PageParameters temp = new PageParameters ( ) ; temp . add ( "theme" , "default" ) ; temp . add ( "cha...
public class CmsFrameset { /** * Returns a html select box filled with the current users accessible sites . < p > * @ param htmlAttributes attributes that will be inserted into the generated html * @ return a html select box filled with the current users accessible sites */ public String getSiteSelect ( String html...
List < String > options = new ArrayList < String > ( ) ; List < String > values = new ArrayList < String > ( ) ; int selectedIndex = 0 ; List < CmsSite > sites = OpenCms . getSiteManager ( ) . getAvailableSites ( getCms ( ) , true ) ; Iterator < CmsSite > i = sites . iterator ( ) ; int pos = 0 ; while ( i . hasNext ( )...
public class MatchSpaceImpl { /** * handled without ever calling this routine ) . */ private synchronized void pessimisticGet ( Object key , MatchSpaceKey msg , EvalCache cache , Object rootContext , SearchResults result ) throws MatchingException , BadMessageFormatMatchingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "pessimisticGet" , new Object [ ] { key , msg , cache , result } ) ; // Everything must execute under the MatchSpace lock // Obtain the cache entry and determine if its otherMatchers and results entries are // usable...
public class ConfigurationAction { /** * < p > getClasspaths . < / p > * @ return a { @ link java . util . Set } object . */ public Set < String > getClasspaths ( ) { } }
Set < String > classpaths = selectedRunner . getClasspaths ( ) ; return classpaths == null ? new HashSet < String > ( ) : classpaths ;
public class JobHistoryFileParserHadoop2 { /** * Returns the Task ID or Task Attempt ID , stripped of the leading job ID , appended to the job row * key . */ public byte [ ] getTaskKey ( String prefix , String jobNumber , String fullId ) { } }
String taskComponent = fullId ; if ( fullId == null ) { taskComponent = "" ; } else { String expectedPrefix = prefix + jobNumber + "_" ; if ( ( fullId . startsWith ( expectedPrefix ) ) && ( fullId . length ( ) > expectedPrefix . length ( ) ) ) { taskComponent = fullId . substring ( expectedPrefix . length ( ) ) ; } } r...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ParameterValueGroupType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link ParameterValueGroupType ...
return new JAXBElement < ParameterValueGroupType > ( _ParameterValueGroup_QNAME , ParameterValueGroupType . class , null , value ) ;
public class AbstractDb { /** * 查询单条单个字段记录 , 并将其转换为Number * @ param sql 查询语句 * @ param params 参数 * @ return 结果对象 * @ throws SQLException SQL执行异常 */ public Number queryNumber ( String sql , Object ... params ) throws SQLException { } }
return query ( sql , new NumberHandler ( ) , params ) ;
public class IfcTextStyleFontModelImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getFontFamily ( ) { } }
return ( EList < String > ) eGet ( Ifc4Package . Literals . IFC_TEXT_STYLE_FONT_MODEL__FONT_FAMILY , true ) ;
public class AuthenticationService { /** * Returns the AuthenticatedUser associated with the given session and * credentials , performing a fresh authentication and creating a new * AuthenticatedUser if necessary . * @ param existingSession * The current GuacamoleSession , or null if no session exists yet . *...
try { // Re - authenticate user if session exists if ( existingSession != null ) { AuthenticatedUser updatedUser = updateAuthenticatedUser ( existingSession . getAuthenticatedUser ( ) , credentials ) ; fireAuthenticationSuccessEvent ( updatedUser ) ; return updatedUser ; } // Otherwise , attempt authentication as a new...
public class AbstractRoxListener { /** * Retrieve a name from a test * @ param description The description of the test * @ param mAnnotation The method annotation * @ return The name retrieved */ private String getName ( Description description , RoxableTest mAnnotation ) { } }
if ( mAnnotation == null || mAnnotation . name ( ) == null || mAnnotation . name ( ) . isEmpty ( ) ) { return Inflector . getHumanName ( description . getMethodName ( ) ) ; } else { return mAnnotation . name ( ) ; }
public class Router { /** * Replaces this Router ' s top { @ link Controller } with a new { @ link Controller } * @ param transaction The transaction detailing what should be pushed , including the { @ link Controller } , * and its push and pop { @ link ControllerChangeHandler } , and its tag . */ @ SuppressWarning...
ThreadUtils . ensureMainThread ( ) ; RouterTransaction topTransaction = backstack . peek ( ) ; if ( ! backstack . isEmpty ( ) ) { trackDestroyingController ( backstack . pop ( ) ) ; } final ControllerChangeHandler handler = transaction . pushChangeHandler ( ) ; if ( topTransaction != null ) { // noinspection ConstantCo...
public class DefaultMonetaryCurrenciesSingletonSpi { /** * This default implementation simply returns all providers defined in arbitrary order . * @ return the default provider chain , never null . */ @ Override public List < String > getDefaultProviderChain ( ) { } }
List < String > provList = new ArrayList < > ( ) ; String defaultChain = MonetaryConfig . getConfig ( ) . get ( "currencies.default-chain" ) ; if ( defaultChain != null ) { String [ ] items = defaultChain . split ( "," ) ; for ( String item : items ) { if ( getProviderNames ( ) . contains ( item . trim ( ) ) ) { provLi...
public class ArrayUtils { /** * Copies in order { @ code sourceFirst } and { @ code sourceSecond } into { @ code dest } . * @ param sourceFirst * @ param sourceSecond * @ param dest * @ param < T > */ public static < T > void concat ( T [ ] sourceFirst , T [ ] sourceSecond , T [ ] dest ) { } }
System . arraycopy ( sourceFirst , 0 , dest , 0 , sourceFirst . length ) ; System . arraycopy ( sourceSecond , 0 , dest , sourceFirst . length , sourceSecond . length ) ;
public class ScreenUtil { /** * Create the font saved in this key ; null = Not found . * ( Utility method ) . * Font is saved in three properties ( font . fontname , font . size , font . style ) . * @ param returnDefaultIfNone TODO * @ return The registered font . */ public static FontUIResource getFont ( Prope...
String strFontName = ScreenUtil . getPropery ( ScreenUtil . FONT_NAME , propertyOwner , properties , null ) ; String strFontSize = ScreenUtil . getPropery ( ScreenUtil . FONT_SIZE , propertyOwner , properties , null ) ; String strFontStyle = ScreenUtil . getPropery ( ScreenUtil . FONT_STYLE , propertyOwner , properties...
public class ShakeAroundAPI { /** * 配置设备与页面的关联关系 * @ param accessToken accessToken * @ param deviceBindPage deviceBindPage * @ return result */ public static DeviceBindPageResult deviceBindPage ( String accessToken , DeviceBindPage deviceBindPage ) { } }
return deviceBindPage ( accessToken , JsonUtil . toJSONString ( deviceBindPage ) ) ;
public class MatcherThread { /** * If the comparator decides that the ( non - key ) attributes do no match , this method is called . * Default implementation is to call preprocessMatch , followed by executor . addForUpdate * @ param oldObject The existing version of the object ( typically from the database ) * @ ...
this . preprocessMatch ( oldObject , newObject ) ; executor . addForUpdate ( oldObject , newObject ) ;
public class DeltaTimeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeltaTime deltaTime , ProtocolMarshaller protocolMarshaller ) { } }
if ( deltaTime == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deltaTime . getOffsetSeconds ( ) , OFFSETSECONDS_BINDING ) ; protocolMarshaller . marshall ( deltaTime . getTimeExpression ( ) , TIMEEXPRESSION_BINDING ) ; } catch ( Exception...
public class FileInputFormat { /** * Enumerate all files in the directory and recursive if enumerateNestedFiles is true . * @ return the total length of accepted files . */ private long addFilesInDir ( Path path , List < FileStatus > files , boolean logExcludedFiles ) throws IOException { } }
final FileSystem fs = path . getFileSystem ( ) ; long length = 0 ; for ( FileStatus dir : fs . listStatus ( path ) ) { if ( dir . isDir ( ) ) { if ( acceptFile ( dir ) && enumerateNestedFiles ) { length += addFilesInDir ( dir . getPath ( ) , files , logExcludedFiles ) ; } else { if ( logExcludedFiles && LOG . isDebugEn...
public class ArrayMath { /** * Returns the smallest element of the matrix */ public static int min ( int [ ] [ ] matrix ) { } }
int min = Integer . MAX_VALUE ; for ( int [ ] row : matrix ) { for ( int elem : row ) { min = Math . min ( min , elem ) ; } } return min ;
public class WonderPushView { /** * Sets the resource for the web content displayed in this WonderPushView ' s WebView . */ public void setResource ( String resource , RequestParams params ) { } }
if ( null == resource ) { WonderPush . logError ( "null resource provided to WonderPushView" ) ; return ; } mInitialResource = resource ; mInitialRequestParams = params ; mIsPreloading = false ; if ( null == params ) params = new RequestParams ( ) ; WonderPushRequestParamsDecorator . decorate ( resource , params ) ; St...
public class Range { /** * Creates a new { @ link Range } with the specified inclusive start and the specified exclusive end . */ public R of ( @ Nonnull T startClosed , @ Nonnull T endOpen ) { } }
return startClosed ( startClosed ) . endOpen ( endOpen ) ;
public class QuartzScheduler { /** * Resume ( un - pause ) the < code > { @ link ITrigger } < / code > with the given name . * If the < code > Trigger < / code > missed one or more fire - times , then the * < code > Trigger < / code > ' s misfire instruction will be applied . */ public void resumeTrigger ( final Tr...
validateState ( ) ; m_aResources . getJobStore ( ) . resumeTrigger ( triggerKey ) ; notifySchedulerThread ( 0L ) ; notifySchedulerListenersResumedTrigger ( triggerKey ) ;
public class NodeAuthModuleContext { /** * Returns the current singleton instance of the Node Authentication Module Context from the * ThreadLocal cache . If the ThreadLocal cache has not been initialized or does not contain * this context , then create and initialize module context , register in the ThreadLocal ...
SecurityContext securityContext = SecurityContextFactory . getSecurityContext ( ) ; if ( ! securityContext . isInitialized ( ) ) { securityContext . initialize ( ) ; } AbstractModuleContext moduleContext = securityContext . getModuleContext ( CONTEXT_ID ) ; if ( ! ( moduleContext instanceof NodeAuthModuleContext ) ) { ...
public class MoonPosition { /** * / * [ deutsch ] * < p > Berechnet die Position des Mondes zum angegebenen Zeitpunkt und am angegebenen Beobachterstandpunkt . < / p > * @ param moment the time when the position of moon is to be determined * @ param location geographical location of observer * @ return moon pos...
double [ ] data = calculateMeeus ( JulianDay . ofEphemerisTime ( moment ) . getCenturyJ2000 ( ) ) ; double ra = Math . toRadians ( data [ 2 ] ) ; double decl = Math . toRadians ( data [ 3 ] ) ; double distance = data [ 4 ] ; double latRad = Math . toRadians ( location . getLatitude ( ) ) ; double lngRad = Math . toRadi...
public class ProvFactory { /** * A factory method to create an instance of a usage { @ link Used } * @ param id an optional identifier for a usage * @ param activity the identifier of the < a href = " http : / / www . w3 . org / TR / prov - dm / # usage . activity " > activity < / a > that used an entity * @ para...
Used res = newUsed ( id ) ; res . setActivity ( activity ) ; res . setEntity ( entity ) ; return res ;
public class KafkaLoader { /** * Create a Volt client from the supplied configuration and list of servers . */ private static Client getVoltClient ( ClientConfig config , List < String > hosts ) throws Exception { } }
config . setTopologyChangeAware ( true ) ; final Client client = ClientFactory . createClient ( config ) ; for ( String host : hosts ) { try { client . createConnection ( host ) ; } catch ( IOException e ) { // Only swallow exceptions caused by Java network or connection problem // Unresolved hostname exceptions will b...
public class CronPatternUtil { /** * 列举指定日期范围内所有匹配表达式的日期 * @ param pattern 表达式 * @ param start 起始时间 * @ param end 结束时间 * @ param count 列举数量 * @ param isMatchSecond 是否匹配秒 * @ return 日期列表 */ public static List < Date > matchedDates ( CronPattern pattern , long start , long end , int count , boolean isMatchSec...
Assert . isTrue ( start < end , "Start date is later than end !" ) ; final List < Date > result = new ArrayList < > ( count ) ; long step = isMatchSecond ? DateUnit . SECOND . getMillis ( ) : DateUnit . MINUTE . getMillis ( ) ; for ( long i = start ; i < end ; i += step ) { if ( pattern . match ( i , isMatchSecond ) ) ...
public class CharacterJsonSerializer { /** * { @ inheritDoc } */ @ Override public void doSerialize ( JsonWriter writer , Character value , JsonSerializationContext ctx , JsonSerializerParameters params ) { } }
writer . value ( value . toString ( ) ) ;
public class CommerceCountryPersistenceImpl { /** * Removes the commerce country where groupId = & # 63 ; and numericISOCode = & # 63 ; from the database . * @ param groupId the group ID * @ param numericISOCode the numeric iso code * @ return the commerce country that was removed */ @ Override public CommerceCou...
CommerceCountry commerceCountry = findByG_N ( groupId , numericISOCode ) ; return remove ( commerceCountry ) ;
public class DraggableView { /** * Animates the view to become show . * @ param diff * The distance the view has to be vertically moved by , as an { @ link Integer } value * @ param animationSpeed * The speed of the animation in pixels per milliseconds as a { @ link Float } value * @ param interpolator * Th...
animateView ( diff , animationSpeed , createAnimationListener ( true , false ) , interpolator ) ;
public class SquaresIntoClusters { /** * Reset and recycle data structures from the previous run */ protected void recycleData ( ) { } }
for ( int i = 0 ; i < nodes . size ( ) ; i ++ ) { SquareNode n = nodes . get ( i ) ; for ( int j = 0 ; j < n . edges . length ; j ++ ) { if ( n . edges [ j ] != null ) { graph . detachEdge ( n . edges [ j ] ) ; } } } for ( int i = 0 ; i < nodes . size ( ) ; i ++ ) { SquareNode n = nodes . get ( i ) ; for ( int j = 0 ; ...
public class ServiceDirectoryCache { /** * Get all Services with instances together . * @ return * the List of Service with its ServiceInstances . */ public List < V > getAllServicesWithInstance ( ) { } }
if ( cache == null || cache . size ( ) == 0 ) { return Collections . emptyList ( ) ; } return Lists . newArrayList ( cache . values ( ) ) ;
public class StoredPaymentChannelServerStates { /** * Gets the { @ link StoredServerChannel } with the given channel id ( ie contract transaction hash ) . */ public StoredServerChannel getChannel ( Sha256Hash id ) { } }
lock . lock ( ) ; try { return mapChannels . get ( id ) ; } finally { lock . unlock ( ) ; }
public class MDC { /** * Remove the the context identified by the < code > key < / code > * parameter . */ public static void remove ( String key ) { } }
if ( setContext ( ) ) { m_context . remove ( key ) ; } else { m_defaultContext . remove ( key ) ; }
public class MemoryManager { /** * Tries to release the memory for the specified segment . If the segment has already been released or * is null , the request is simply ignored . * < p > If the memory manager manages pre - allocated memory , the memory segment goes back to the memory pool . * Otherwise , the segm...
// check if segment is null or has already been freed if ( segment == null || segment . getOwner ( ) == null ) { return ; } final Object owner = segment . getOwner ( ) ; // - - - - - BEGIN CRITICAL SECTION - - - - - synchronized ( lock ) { // prevent double return to this memory manager if ( segment . isFreed ( ) ) { r...
public class CalendarIntervalTrigger { /** * Returns the final time at which the < code > DateIntervalTrigger < / code > will * fire , if there is no end time set , null will be returned . * Note that the return time may be in the past . */ @ Override public Date getFinalFireTime ( ) { } }
if ( m_bComplete || getEndTime ( ) == null ) { return null ; } // back up a second from end time Date fTime = new Date ( getEndTime ( ) . getTime ( ) - 1000L ) ; // find the next fire time after that fTime = getFireTimeAfter ( fTime , true ) ; // the the trigger fires at the end time , that ' s it ! if ( fTime . equals...