signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class task_device_log { /** * < pre > * Converts API response of bulk operation into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
task_device_log_responses result = ( task_device_log_responses ) service . get_payload_formatter ( ) . string_to_resource ( task_device_log_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result ....
public class ToolInstaller { /** * Checks whether this installer can be applied to a given node . * ( By default , just checks the label . ) */ public boolean appliesTo ( Node node ) { } }
Label l = Jenkins . getInstance ( ) . getLabel ( label ) ; return l == null || l . contains ( node ) ;
public class TagFilterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TagFilter tagFilter , ProtocolMarshaller protocolMarshaller ) { } }
if ( tagFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tagFilter . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( tagFilter . getValues ( ) , VALUES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientExceptio...
public class RegistriesInner { /** * Regenerates the administrator login credentials for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ throws IllegalArgumentExc...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( registr...
public class SocialRenderer { /** * { @ inheritDoc } */ @ Override public void encodeEnd ( final FacesContext context , final UIComponent component ) throws IOException { } }
final Social social = ( Social ) component ; encodeMarkup ( context , social ) ; encodeScript ( context , social ) ;
public class AbstractSegment3F { /** * Compute and replies the distance between two segments . * @ param ax1 * is the X coord of the first point of the first segment * @ param ay1 * is the Y coord of the first point of the first segment * @ param az1 * is the Z coord of the first point of the first segment ...
return Math . sqrt ( distanceSquaredSegmentSegment ( ax1 , ay1 , az1 , ax2 , ay2 , az2 , bx1 , by1 , bz1 , bx2 , by2 , bz2 ) ) ;
public class WebLocatorAbstractBuilder { /** * For customize template please see here : See http : / / docs . oracle . com / javase / 7 / docs / api / java / util / Formatter . html # dpos * @ param key name template * @ param value template * @ param < T > the element which calls this method * @ return this el...
pathBuilder . setTemplate ( key , value ) ; return ( T ) this ;
public class TokenManagerImpl { /** * { @ inheritDoc } */ public Token recreateTokenFromBytes ( String tokenType , byte [ ] tokenBytes ) throws InvalidTokenException , TokenExpiredException { } }
try { TokenService tokenService = getTokenServiceForType ( tokenType ) ; return tokenService . recreateTokenFromBytes ( tokenBytes ) ; } catch ( IllegalArgumentException e ) { Tr . info ( tc , "TOKEN_SERVICE_INVALID_TOKEN_INFO" ) ; String translatedMessage = TraceNLS . getStringFromBundle ( this . getClass ( ) , TraceC...
public class Relation { /** * Returns all the NumericColumns in the relation */ public List < NumericColumn < ? > > numericColumns ( String ... columnNames ) { } }
List < NumericColumn < ? > > cols = new ArrayList < > ( ) ; for ( String name : columnNames ) { cols . add ( numberColumn ( name ) ) ; } return cols ;
public class JMTimeUtil { /** * Change timestamp to new format string . * @ param isoTimestamp the iso timestamp * @ param zoneID the zone id * @ param newFormat the new format * @ return the string */ public static String changeTimestampToNewFormat ( String isoTimestamp , ZoneId zoneID , DateTimeFormatter newF...
return ZonedDateTime . parse ( isoTimestamp ) . withZoneSameInstant ( zoneID ) . format ( newFormat ) ;
public class MessageLog { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; // if ( iFieldSeq = = 0) // field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 1) // field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; /...
public class BlockBrowser { /** * Builds the logical tree the chosen provider and parametres . */ private void buildLogicalTree ( ) { } }
if ( logicalCombo . getSelectedIndex ( ) != - 1 ) { LogicalTreeProvider provider = logicalCombo . getItemAt ( logicalCombo . getSelectedIndex ( ) ) ; proc . buildLogicalTree ( provider , null ) ; // the parametres should have been set through the GUI setLogicalTree ( proc . getLogicalAreaTree ( ) ) ; }
public class ZipImporterImpl { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . importer . StreamImporter # importFrom ( java . io . InputStream ) */ @ Override public ZipImporter importFrom ( final InputStream stream ) throws ArchiveImportException { } }
return importFrom ( stream , Filters . includeAll ( ) ) ;
public class RDFUnitDemoSession { /** * Init session variables . * @ param clientHost a { @ link java . lang . String } object . */ public static void init ( String clientHost ) { } }
VaadinSession . getCurrent ( ) . setAttribute ( "client" , clientHost ) ; String baseDir = _getBaseDir ( ) ; VaadinSession . getCurrent ( ) . setAttribute ( String . class , baseDir ) ; TestGeneratorExecutor testGeneratorExecutor = new TestGeneratorExecutor ( ) ; VaadinSession . getCurrent ( ) . setAttribute ( TestGene...
public class CacheValue { /** * Returns a CacheValue instance that holds the value . * It holds it directly if the value is null or if the current " strength " is { @ code STRONG } . * Otherwise , it holds it via a { @ link Reference } . */ @ SuppressWarnings ( "unchecked" ) public static < V > CacheValue < V > get...
if ( value == null ) { return NULL_VALUE ; } return strength == Strength . STRONG ? new StrongValue < V > ( value ) : new SoftValue < V > ( value ) ;
public class TagsInterface { /** * Search for tag - clusters . * This method does not require authentication . * @ since 1.2 * @ param searchTag * @ return a list of clusters */ public ClusterList getClusters ( String searchTag ) throws FlickrException { } }
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_CLUSTERS ) ; parameters . put ( "tag" , searchTag ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new...
public class Ecore2FXMojo { /** * { @ inheritDoc } */ @ Override public void execute ( ) throws MojoExecutionException { } }
final Ecore2FXGenerator g = new Ecore2FXGenerator ( ) ; g . generate ( this . outputDirectory , this . ecoreFile ) ;
public class DistributionPointFetcher { /** * Fetch CRLs from certStores . * @ throws CertStoreException if there is an error retrieving the CRLs from * one of the CertStores and no other CRLs are retrieved from * the other CertStores . If more than one CertStore throws an * exception then the one from the last...
if ( debug != null ) { debug . println ( "Trying to fetch CRL from DP " + name ) ; } X509CRLSelector xcs = new X509CRLSelector ( ) ; xcs . addIssuer ( name . asX500Principal ( ) ) ; xcs . addIssuer ( certIssuer ) ; Collection < X509CRL > crls = new ArrayList < > ( ) ; CertStoreException savedCSE = null ; for ( CertStor...
public class AmazonWorkMailClient { /** * Mark a user , group , or resource as no longer used in Amazon WorkMail . This action disassociates the mailbox and * schedules it for clean - up . WorkMail keeps mailboxes for 30 days before they are permanently removed . The * functionality in the console is < i > Disable ...
request = beforeClientExecution ( request ) ; return executeDeregisterFromWorkMail ( request ) ;
public class GridUtils { /** * CSON : ParameterNumber */ private static double [ ] transformToLabelProjection ( final MathTransform toLabelProjection , final Coordinate borderIntersection ) { } }
try { double [ ] labelProj = new double [ 2 ] ; toLabelProjection . transform ( new double [ ] { borderIntersection . x , borderIntersection . y } , 0 , labelProj , 0 , 1 ) ; return labelProj ; } catch ( TransformException e ) { throw new RuntimeException ( e ) ; }
public class Beagle { /** * { @ inheritDoc } */ public void processDocument ( BufferedReader document ) throws IOException { } }
Queue < String > prevWords = new ArrayDeque < String > ( ) ; Queue < String > nextWords = new ArrayDeque < String > ( ) ; Iterator < String > it = IteratorFactory . tokenizeOrdered ( document ) ; Map < String , DoubleVector > documentVectors = new HashMap < String , DoubleVector > ( ) ; // Fill up the words after the c...
public class MetricRegistryInstance { /** * Handles collecting the future arguments , correctly firing the timeout . * This function also updates the failed _ collections _ member variable . * @ param futures The futures of MetricGroups to dereference . * @ param t0 _ nsec The starting time of the scrape . * @ ...
long tDeadline1 = t0_nsec + TimeUnit . MILLISECONDS . toNanos ( MAX_COLLECTOR_WAIT_MSEC ) ; long tDeadline2 = t0_nsec + TimeUnit . MILLISECONDS . toNanos ( COLLECTOR_POST_TIMEOUT_MSEC ) ; final List < MetricGroup > result = new ArrayList < > ( ) ; final BlockingQueue < Any2 < Collection < ? extends MetricGroup > , Thro...
public class DINameSpace { /** * Retrieves the < code > Class < / code > object specified by the * < code > name < / code > argument , using , if possible , the * classLoader attribute of the database . < p > * @ param name the fully qualified name of the < code > Class < / code > * object to retrieve . * @ t...
if ( name == null ) { return Class . forName ( name ) ; } return Class . forName ( name ) ;
public class EastAsianMonth { /** * / * [ deutsch ] * < p > Liefert den traditionellen japanischen Monatsnamen . < / p > * < p > Hinweis : Diese Methode ignoriert den Umstand , ob dieser Monat ein Schaltmonat ist . < / p > * @ param locale language setting * @ return descriptive text ( never { @ code null } ) *...
Map < String , String > textForms = CalendarText . getInstance ( "japanese" , locale ) . getTextForms ( ) ; return textForms . get ( "t" + this . getNumber ( ) ) ;
public class ZipUtil { /** * Copies an existing ZIP file and replaces the given entries in it . * @ param zip * an existing ZIP file ( only read ) . * @ param entries * new ZIP entries to be replaced with . * @ param destZip * new ZIP file created . * @ return < code > true < / code > if at least one entr...
if ( log . isDebugEnabled ( ) ) { log . debug ( "Copying '" + zip + "' to '" + destZip + "' and replacing entries " + Arrays . asList ( entries ) + "." ) ; } final Map < String , ZipEntrySource > entryByPath = entriesByPath ( entries ) ; final int entryCount = entryByPath . size ( ) ; try { final ZipOutputStream out = ...
public class Approval { /** * Verify the value that was passed in . * @ param value the value object to be approved * @ param filePath the path where the value will be kept for further approval */ public void verify ( @ Nullable T value , Path filePath ) { } }
Pre . notNull ( filePath , "filePath" ) ; File file = mapFilePath ( value , filePath ) ; File parentPathDirectory = file . getParentFile ( ) ; if ( parentPathDirectory != null && ! parentPathDirectory . exists ( ) ) { try { fileSystemReadWriter . createDirectories ( parentPathDirectory ) ; } catch ( IOException e ) { t...
public class JAXBMarshallerHelper { /** * Set the standard property for formatting the output or not . * @ param aMarshaller * The marshaller to set the property . May not be < code > null < / code > . * @ param bFormattedOutput * the value to be set */ public static void setFormattedOutput ( @ Nonnull final Ma...
_setProperty ( aMarshaller , Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . valueOf ( bFormattedOutput ) ) ;
public class XmlUtil { /** * 将XML文档写出 * @ param node { @ link Node } XML文档节点或文档本身 * @ param writer 写出的Writer , Writer决定了输出XML的编码 * @ param charset 编码 * @ param indent 格式化输出中缩进量 , 小于1表示不格式化输出 * @ since 3.0.9 */ public static void write ( Node node , Writer writer , String charset , int indent ) { } }
transform ( new DOMSource ( node ) , new StreamResult ( writer ) , charset , indent ) ;
public class ServiceLoaderHelper { /** * Uses the { @ link ServiceLoader } to load all SPI implementations of the * passed class * @ param < T > * The implementation type to be loaded * @ param aSPIClass * The SPI interface class . May not be < code > null < / code > . * @ return A list of all currently ava...
return getAllSPIImplementations ( aSPIClass , ClassLoaderHelper . getDefaultClassLoader ( ) , null ) ;
public class Tailer { /** * Creates and starts a Tailer for the given file , starting at the beginning * of the file with the default delay of 1.0s * @ param file * the file to follow . * @ param listener * the TailerListener to use . * @ return The new tailer */ public static Tailer create ( final File fil...
return Tailer . create ( file , listener , Tailer . DEFAULT_DELAY_MILLIS , false ) ;
public class JapaneseDate { /** * Obtains a { @ code JapaneseDate } representing a date in the Japanese calendar * system from the era , year - of - era and day - of - year fields . * This returns a { @ code JapaneseDate } with the specified fields . * The day must be valid for the year , otherwise an exception w...
Jdk8Methods . requireNonNull ( era , "era" ) ; if ( yearOfEra < 1 ) { throw new DateTimeException ( "Invalid YearOfEra: " + yearOfEra ) ; } LocalDate eraStartDate = era . startDate ( ) ; LocalDate eraEndDate = era . endDate ( ) ; if ( yearOfEra == 1 ) { dayOfYear += eraStartDate . getDayOfYear ( ) - 1 ; if ( dayOfYear ...
public class DataPublisher { /** * Starts the { @ code DataPublisher } . * The method { @ link DataAccumulator # publish } will be called approximately * every { @ code delayMillis } milliseconds . * If the publisher has already been started , does nothing . * @ see # stop */ public synchronized void start ( ) ...
if ( future == null ) { Runnable task = new Runnable ( ) { public void run ( ) { try { accumulator . publish ( ) ; } catch ( Exception e ) { handleException ( e ) ; } } } ; future = getExecutor ( ) . scheduleWithFixedDelay ( task , delayMillis , delayMillis , TimeUnit . MILLISECONDS ) ; }
public class ExtractHandler { /** * Append an open tag with the given specification to the result buffer . * @ param qName Tag ' s qualified name . * @ param atts Tag ' s attributes . */ private void openTag ( String qName , Attributes atts ) { } }
this . result . append ( '<' ) . append ( qName ) ; for ( int i = 0 ; i < atts . getLength ( ) ; i ++ ) { this . result . append ( ' ' ) . append ( atts . getQName ( i ) ) . append ( "=\"" ) . append ( atts . getValue ( i ) ) . append ( '\"' ) ; } this . result . append ( '>' ) ;
public class Task { /** * Cancel this task . */ public final void cancel ( CancelException reason ) { } }
if ( cancelling != null ) return ; if ( reason == null ) reason = new CancelException ( "No reason given" ) ; cancelling = reason ; if ( TaskScheduler . cancel ( this ) ) { status = Task . STATUS_DONE ; result . cancelled ( reason ) ; return ; } if ( manager . remove ( this ) ) { status = Task . STATUS_DONE ; result . ...
public class BroxWarpingSpacial { /** * Resize images for the current layer being processed */ protected void resizeForLayer ( int width , int height ) { } }
deriv1X . reshape ( width , height ) ; deriv1Y . reshape ( width , height ) ; deriv2X . reshape ( width , height ) ; deriv2Y . reshape ( width , height ) ; deriv2XX . reshape ( width , height ) ; deriv2YY . reshape ( width , height ) ; deriv2XY . reshape ( width , height ) ; warpImage2 . reshape ( width , height ) ; wa...
public class UnionQueryAnalyzer { /** * Splits the filter into sub - results and possibly merges them . */ private List < IndexedQueryAnalyzer < S > . Result > splitIntoSubResults ( Filter < S > filter , OrderingList < S > ordering , QueryHints hints ) throws SupportException , RepositoryException { } }
// Required for split to work . Filter < S > dnfFilter = filter . disjunctiveNormalForm ( ) ; Splitter splitter = new Splitter ( ordering , hints ) ; RepositoryException e = dnfFilter . accept ( splitter , null ) ; if ( e != null ) { throw e ; } List < IndexedQueryAnalyzer < S > . Result > subResults = splitter . mSubR...
public class SimpleTree { /** * Sets the children of this < code > Tree < / code > . If given * < code > null < / code > , this method sets the Tree ' s children to a * unique zero - length Tree [ ] array . * @ param children An array of child trees */ @ Override public void setChildren ( Tree [ ] children ) { } ...
if ( children == null ) { System . err . println ( "Warning -- you tried to set the children of a SimpleTree to null.\nYou should be really using a zero-length array instead." ) ; daughterTrees = EMPTY_TREE_ARRAY ; } else { daughterTrees = children ; }
public class ConnectionReadCompletedCallback { /** * Part of the read completed callback interface . Notified when an error * occurres during a read operation . */ public void error ( NetworkConnection vc , IOReadRequestContext rrc , IOException t ) // F176003 , F184828 , D194678 { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "error" , new Object [ ] { vc , rrc , t } ) ; // F184828 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) && ( t != null ) ) SibTr . exception ( this , tc , t ) ; if ( thisConnection . isLoggin...
public class FileDownloadList { /** * This method generally used for enqueuing the task which will be assembled by a queue . * @ see BaseDownloadTask . InQueueTask # enqueue ( ) */ void addQueueTask ( final DownloadTaskAdapter task ) { } }
if ( task . isMarkedAdded2List ( ) ) { Util . w ( TAG , "queue task: " + task + " has been marked" ) ; return ; } synchronized ( list ) { task . markAdded2List ( ) ; task . assembleDownloadTask ( ) ; list . add ( task ) ; Util . d ( TAG , "add list in all " + task + " " + list . size ( ) ) ; }
public class ChunkModule { /** * Test whether there are changes that require topic rewriting . */ private boolean hasChanges ( final Map < URI , URI > changeTable ) { } }
if ( changeTable . isEmpty ( ) ) { return false ; } for ( Map . Entry < URI , URI > e : changeTable . entrySet ( ) ) { if ( ! e . getKey ( ) . equals ( e . getValue ( ) ) ) { return true ; } } return false ;
public class SAXReader { /** * Read an XML document via a SAX handler . The streams are closed after * reading . * @ param aIS * The input source to read from . Automatically closed upon success or * error . May not be < code > null < / code > . * { @ link com . helger . xml . sax . InputSourceFactory } may b...
ValueEnforcer . notNull ( aIS , "InputStream" ) ; ValueEnforcer . notNull ( aSettings , "Settings" ) ; try { boolean bFromPool = false ; org . xml . sax . XMLReader aParser ; if ( aSettings . requiresNewXMLParser ( ) ) { aParser = SAXReaderFactory . createXMLReader ( ) ; } else { // use parser from pool aParser = s_aSA...
public class WebsocketClientTransport { /** * Creates a new instance * @ param client the { @ link HttpClient } to use * @ param path the path to request * @ return a new instance * @ throws NullPointerException if { @ code client } or { @ code path } is { @ code null } */ public static WebsocketClientTransport...
Objects . requireNonNull ( client , "client must not be null" ) ; Objects . requireNonNull ( path , "path must not be null" ) ; path = path . startsWith ( DEFAULT_PATH ) ? path : ( DEFAULT_PATH + path ) ; return new WebsocketClientTransport ( client , path ) ;
public class PreambleUtil { /** * TODO convert these to set / clear / any bits */ static void setEmpty ( final WritableMemory wmem ) { } }
int flags = wmem . getByte ( FLAGS_BYTE ) & 0XFF ; flags |= EMPTY_FLAG_MASK ; wmem . putByte ( FLAGS_BYTE , ( byte ) flags ) ;
public class OutlierAlgoPanel { /** * / * We need to fetch the right item from editComponents list , index needs to match GUI order */ public void setStreamValueAsCLIString ( String s ) { } }
streamOption . setValueViaCLIString ( s ) ; editComponents . get ( 0 ) . setEditState ( streamOption . getValueAsCLIString ( ) ) ;
public class ApplicationUserRepository { /** * region > newDelegateUser ( action ) */ @ Programmatic public ApplicationUser newDelegateUser ( final String username , final ApplicationRole initialRole , final Boolean enabled ) { } }
final ApplicationUser user = getApplicationUserFactory ( ) . newApplicationUser ( ) ; user . setUsername ( username ) ; user . setStatus ( ApplicationUserStatus . parse ( enabled ) ) ; user . setAccountType ( AccountType . DELEGATED ) ; if ( initialRole != null ) { user . addRole ( initialRole ) ; } container . persist...
public class Iconics { /** * Creates a new SpannableStringBuilder and will iterate over the textSpanned once and copy over * all characters , it will also directly replace icon font placeholders with the correct mapping . * Afterwards it will apply the styles */ @ NonNull public static Spanned style ( @ NonNull Con...
return style ( ctx , null , textSpanned , null , null ) ;
public class CmsFileBuffer { /** * Transfers data from this buffer to a byte array . < p > * @ param dest the target byte array * @ param length the number of bytes to transfer * @ param bufferOffset the start index for the target buffer * @ param fileOffset the start index for this instance * @ return the nu...
if ( fileOffset >= m_buffer . size ( ) ) { return - 1 ; } int readEnd = fileOffset + length ; if ( readEnd > m_buffer . size ( ) ) { length = length - ( readEnd - m_buffer . size ( ) ) ; } m_buffer . readBytes ( dest , fileOffset , bufferOffset , length ) ; return length ;
public class ViewRep { /** * Check if the view could apply to the provided table unchanged . */ public boolean compatibleWithTable ( VoltTable table ) { } }
String candidateName = getTableName ( table ) ; // table can ' t have the same name as the view if ( candidateName . equals ( viewName ) ) { return false ; } // view is for a different table if ( candidateName . equals ( srcTableName ) == false ) { return false ; } try { // ignore ret value here - just looking to not t...
public class MAPServiceMobilityImpl { /** * - - Location management services */ private void updateLocationRequest ( Parameter parameter , MAPDialogMobilityImpl mapDialogImpl , Long invokeId ) throws MAPParsingComponentException { } }
long version = mapDialogImpl . getApplicationContext ( ) . getApplicationContextVersion ( ) . getVersion ( ) ; if ( parameter == null ) throw new MAPParsingComponentException ( "Error while decoding updateLocationRequest: Parameter is mandatory but not found" , MAPParsingComponentExceptionReason . MistypedParameter ) ;...
public class ForkJoinTask { /** * Possibly executes tasks until the pool hosting the current task * { @ linkplain ForkJoinPool # isQuiescent is quiescent } . This method may be of use in designs in * which many tasks are forked , but none are explicitly joined , instead executing them until all * are processed . ...
Thread t ; if ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) { ForkJoinWorkerThread wt = ( ForkJoinWorkerThread ) t ; wt . pool . helpQuiescePool ( wt . workQueue ) ; } else ForkJoinPool . quiesceCommonPool ( ) ;
public class TypesafeConfigUtils { /** * Get a configuration as list of durations ( parses special strings like " 10s " ) . Return * { @ code null } if missing , wrong type or bad value . * @ param config * @ param path * @ param timeUnit * @ return */ public static Optional < List < Long > > getDurationListO...
return Optional . ofNullable ( getDurationList ( config , path , timeUnit ) ) ;
public class FacebookAuthorizer { public static boolean registerToken ( String token , String email , URL site ) { } }
List < String > key = new ArrayList < String > ( ) ; key . add ( email ) ; key . add ( site . toExternalForm ( ) . toLowerCase ( ) ) ; sRegisteredTokens . put ( key , token ) ; return true ;
public class DiagnosticsInner { /** * List Site Detector Responses . * List Site Detector Responses . * ServiceResponse < PageImpl < DetectorResponseInner > > * @ param resourceGroupName Name of the resource group to which the resource belongs . * ServiceResponse < PageImpl < DetectorResponseInner > > * @ param s...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( siteName == null ) { throw new IllegalArgumentException ( "Parameter siteName is required and cannot be null." ) ; } if ( slot == null ) { throw new IllegalArgumentException (...
public class CmsAliasEditorLockTable { /** * Tries to update or create an entry for the given user / site root combination . < p > * If this method succeeds , it will return null , but if another user has created an entry for the site root , * it will return that user . < p > * @ param cms the current CMS context...
CmsUser originalUser = m_map . getIfPresent ( siteRoot ) ; if ( ( originalUser == null ) || originalUser . equals ( cms . getRequestContext ( ) . getCurrentUser ( ) ) ) { m_map . put ( siteRoot , cms . getRequestContext ( ) . getCurrentUser ( ) ) ; return null ; } return originalUser ;
public class CFMappingDef { /** * Setup mapping with defaults for the given class . Does not parse all * annotations . * @ param realClass */ @ SuppressWarnings ( "unchecked" ) public void setDefaults ( Class < T > realClass ) { } }
this . realClass = realClass ; this . keyDef = new KeyDefinition ( ) ; // find the " effective " class - skipping up the hierarchy over inner classes effectiveClass = realClass ; boolean entityFound ; while ( ! ( entityFound = ( null != effectiveClass . getAnnotation ( Entity . class ) ) ) ) { // TODO : BTB this might ...
public class RecognizeCelebritiesResult { /** * Details about each unrecognized face in the image . * @ param unrecognizedFaces * Details about each unrecognized face in the image . */ public void setUnrecognizedFaces ( java . util . Collection < ComparedFace > unrecognizedFaces ) { } }
if ( unrecognizedFaces == null ) { this . unrecognizedFaces = null ; return ; } this . unrecognizedFaces = new java . util . ArrayList < ComparedFace > ( unrecognizedFaces ) ;
public class LastSplitsCallback { /** * Create log template for given stopwatch . * This method can be overridden to tune logging strategy . * By default , when { @ link # isLogEnabled ( ) } is set , last splits are logged at each buffer revolution . * @ param stopwatch Stopwatch * @ return Log template */ @ Su...
LogTemplate < Split > logTemplate ; if ( logEnabled ) { logTemplate = everyNSplits ( enabledStopwatchLogTemplate , capacity ) ; } else { logTemplate = disabled ( ) ; } return logTemplate ;
public class CmsGalleryService { /** * Reads the folder filters for the current site . < p > * @ return the folder filters */ private Set < String > readFolderFilters ( ) { } }
JSONObject storedFilters = readUserFolderFilters ( ) ; Set < String > result = null ; if ( storedFilters . has ( getCmsObject ( ) . getRequestContext ( ) . getSiteRoot ( ) ) ) { try { org . opencms . json . JSONArray folders = storedFilters . getJSONArray ( getCmsObject ( ) . getRequestContext ( ) . getSiteRoot ( ) ) ;...
public class WaehrungenSingletonSpi { /** * Access all currencies matching the given query . * @ param query The currency query , not null . * @ return a set of all currencies found , never null . */ @ Override public Set < CurrencyUnit > getCurrencies ( CurrencyQuery query ) { } }
Set < CurrencyUnit > result = new HashSet < > ( ) ; for ( Locale locale : query . getCountries ( ) ) { try { result . add ( Waehrung . of ( Currency . getInstance ( locale ) ) ) ; } catch ( IllegalArgumentException ex ) { LOG . log ( Level . WARNING , "Cannot get currency for locale '" + locale + "':" , ex ) ; } } for ...
public class InternalTransaction { /** * Print a dump of the state . * @ param printWriter to be written to . */ public void print ( java . io . PrintWriter printWriter ) { } }
printWriter . println ( "State Dump for:" + getClass ( ) . getName ( ) + " state=" + state + "(int) " + stateNames [ state ] + "(String)" + " transactionLock=" + transactionLock + "(TransactionLock)" ) ; if ( logicalUnitOfWork == null ) printWriter . println ( "logicalUnitOfWork=null" ) ; else { printWriter . print ( "...
public class MapElementConstants { /** * Replies the default radius for map elements . * @ return the default radius for map elements . */ @ Pure public static double getPreferredRadius ( ) { } }
final Preferences prefs = Preferences . userNodeForPackage ( MapElementConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "RADIUS" , DEFAULT_RADIUS ) ; // $ NON - NLS - 1 $ } return DEFAULT_RADIUS ;
public class CommerceNotificationQueueEntryLocalServiceBaseImpl { /** * Returns a range of all the commerce notification queue entries . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they...
return commerceNotificationQueueEntryPersistence . findAll ( start , end ) ;
public class WaitingDataQueueSynchronizationPoint { /** * Signal that no more data will be queued , so any waiting thread can be unblocked . */ public void endOfData ( ) { } }
ArrayList < Runnable > list = null ; synchronized ( this ) { end = true ; if ( waitingData . isEmpty ( ) ) { list = listeners ; listeners = null ; } } if ( list != null ) { for ( Runnable listener : list ) listener . run ( ) ; } // notify after listeners synchronized ( this ) { this . notifyAll ( ) ; }
public class SourceTableFeatureDetails { /** * Represents the LSI properties for the table when the backup was created . It includes the IndexName , KeySchema and * Projection for the LSIs on the table at the time of backup . * @ param localSecondaryIndexes * Represents the LSI properties for the table when the b...
if ( localSecondaryIndexes == null ) { this . localSecondaryIndexes = null ; return ; } this . localSecondaryIndexes = new java . util . ArrayList < LocalSecondaryIndexInfo > ( localSecondaryIndexes ) ;
public class VarRef { /** * Produces a RSL representation of this variable reference . * @ param buf buffer to add the RSL representation to . * @ param explicitConcat if true explicit concatination will * be used in RSL strings . */ public void toRSL ( StringBuffer buf , boolean explicitConcat ) { } }
buf . append ( "$(" ) ; buf . append ( value ) ; if ( defValue != null ) { buf . append ( " " ) ; defValue . toRSL ( buf , explicitConcat ) ; } buf . append ( ")" ) ; if ( concatValue == null ) return ; if ( explicitConcat ) buf . append ( " # " ) ; concatValue . toRSL ( buf , explicitConcat ) ;
public class SipServletMessageImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipServletMessage # getAttribute ( java . lang . String ) */ public Object getAttribute ( String name ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getAttribute - name=" + sessionKey ) ; } if ( name == null ) throw new NullPointerException ( "Attribute name can not be null." ) ; return this . getAttributeMap ( ) . get ( name ) ;
public class DomUtilImpl { /** * This method gets the singleton instance of this { @ link DomUtilImpl } . < br > * < b > ATTENTION : < / b > < br > * Please prefer dependency - injection instead of using this method . * @ return the singleton instance . */ public static DomUtil getInstance ( ) { } }
if ( instance == null ) { synchronized ( DomUtilImpl . class ) { if ( instance == null ) { DomUtilImpl util = new DomUtilImpl ( ) ; util . initialize ( ) ; instance = util ; } } } return instance ;
public class DateSpinner { /** * Sets the maximum allowed date . * Spinner items and dates in the date picker after the given date will get disabled . * @ param maxDate The maximum date , or null to clear the previous max date . */ public void setMaxDate ( @ Nullable Calendar maxDate ) { } }
this . maxDate = maxDate ; // update the date picker ( even if it is not used right now ) if ( maxDate == null ) datePickerDialog . setMaxDate ( null ) ; else if ( minDate != null && compareCalendarDates ( minDate , maxDate ) > 0 ) throw new IllegalArgumentException ( "Maximum date must be after minimum date!" ) ; else...
public class CmsNewDialog { /** * Gets the initial value for the ' default location ' option . < p > * @ param folderResource the current folder * @ return the initial value for the option */ private Boolean getInitialValueForUseDefaultLocationOption ( CmsResource folderResource ) { } }
String rootPath = folderResource . getRootPath ( ) ; return Boolean . valueOf ( OpenCms . getSiteManager ( ) . getSiteForRootPath ( rootPath ) != null ) ;
public class IOManager { /** * Creates a new { @ link FileIOChannel . ID } in one of the temp directories . Multiple * invocations of this method spread the channels evenly across the different directories . * @ return A channel to a temporary directory . */ public FileIOChannel . ID createChannel ( ) { } }
final int num = getNextPathNum ( ) ; return new FileIOChannel . ID ( this . paths [ num ] , num , this . random ) ;
public class CassandraVersioner { /** * Update current database version to the migration version . This is executed after migration success . * @ param migration Migration that updated the database version * @ return Success of version update */ public boolean updateVersion ( final Migration migration ) { } }
final Statement insert = QueryBuilder . insertInto ( SCHEMA_VERSION_CF ) . value ( TYPE , migration . getType ( ) . name ( ) ) . value ( VERSION , migration . getVersion ( ) ) . value ( TIMESTAMP , System . currentTimeMillis ( ) ) . value ( DESCRIPTION , migration . getDescription ( ) ) . setConsistencyLevel ( Consiste...
public class WorkbookCreationHelper { /** * Write the current workbook to an output stream . * @ param aOS * The output stream to write to . May not be < code > null < / code > . Is * automatically closed independent of the success state . * @ return { @ link ESuccess } */ @ Nonnull public ESuccess writeTo ( @ ...
try { ValueEnforcer . notNull ( aOS , "OutputStream" ) ; if ( m_nCreatedCellStyles > 0 && LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Writing Excel workbook with " + m_nCreatedCellStyles + " different cell styles" ) ; m_aWB . write ( aOS ) ; return ESuccess . SUCCESS ; } catch ( final IOException ex ) { if ( ! Stre...
public class SeleniumHelper { /** * Sets how long to wait before deciding an element does not exists . * @ param implicitWait time in milliseconds to wait . */ public void setImplicitlyWait ( int implicitWait ) { } }
try { driver ( ) . manage ( ) . timeouts ( ) . implicitlyWait ( implicitWait , TimeUnit . MILLISECONDS ) ; } catch ( Exception e ) { // https : / / code . google . com / p / selenium / issues / detail ? id = 6015 System . err . println ( "Unable to set implicit timeout (known issue for Safari): " + e . getMessage ( ) )...
public class AppListenerUtil { /** * translate string definition of script protect to int definition * @ param strScriptProtect * @ return */ public static int translateScriptProtect ( String strScriptProtect ) { } }
strScriptProtect = strScriptProtect . toLowerCase ( ) . trim ( ) ; if ( "none" . equals ( strScriptProtect ) ) return ApplicationContext . SCRIPT_PROTECT_NONE ; if ( "no" . equals ( strScriptProtect ) ) return ApplicationContext . SCRIPT_PROTECT_NONE ; if ( "false" . equals ( strScriptProtect ) ) return ApplicationCont...
public class ChannelFrameworkImpl { /** * Extract a list of runtime chain data objects ( including exclusively * child channel data lists ) that are using the input parent channel . * @ param parent * The parent channel data object * @ return an arraylist of the runtime chains that include the channel */ public...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getRunningChains" ) ; } ChannelContainer channelContainer = null ; List < ChainData > chainDataList = new ArrayList < ChainData > ( ) ; // Iterate the children - they are in the runtime . Iterator < ChildChannelDataImpl > ch...
public class ObjectUtil { /** * 获取对象的某个方法 , 如果无此方法 , 则仅仅返回null * @ param c 对象 * @ param methodName 方法名 * @ param paras 参数列表 * @ return */ public static Method getGetMethod ( Class c , String methodName , Class ... paras ) { } }
// 需要优化 try { Method m = c . getMethod ( methodName , paras ) ; m . setAccessible ( true ) ; return m ; } catch ( SecurityException e ) { return null ; } catch ( NoSuchMethodException e ) { return null ; }
public class SingularValueDecomposition { /** * Return the diagonal matrix of singular values * @ return S */ public double [ ] [ ] getS ( ) { } }
double [ ] [ ] S = new double [ n ] [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { S [ i ] [ i ] = this . s [ i ] ; } return S ;
public class DigitalOceanClient { @ Override public Images getAvailableImages ( Integer pageNo , Integer perPage ) throws DigitalOceanException , RequestUnsuccessfulException { } }
validatePageNo ( pageNo ) ; return ( Images ) perform ( new ApiRequest ( ApiAction . AVAILABLE_IMAGES , pageNo , perPage ) ) . getData ( ) ;
public class AbstractJobVertex { /** * Performs task specific checks if the * respective task has been configured properly . * @ param invokable * an instance of the task this vertex represents * @ throws IllegalConfigurationException * thrown if the respective tasks is not configured properly */ public void ...
if ( invokable == null ) { throw new IllegalArgumentException ( "Argument invokable is null" ) ; } // see if the task itself has a valid configuration // because this is user code running on the master , we embed it in a catch - all block try { invokable . checkConfiguration ( ) ; } catch ( IllegalConfigurationExceptio...
public class Control { /** * This method retrieves the current long value of this control . * Some controls may be write - only and getting * their value does not make sense . Invoking this method on this kind of * controls will trigger a ControlException . * @ return the current value of this control * @ thr...
long v ; if ( type != V4L4JConstants . CTRL_TYPE_LONG ) throw new UnsupportedMethod ( "This control is not a long control" ) ; state . get ( ) ; try { v = doGetLongValue ( v4l4jObject , id ) ; } finally { state . put ( ) ; } return v ;
public class Task { /** * Retrieve a baseline value . * @ param baselineNumber baseline index ( 1-10) * @ return baseline value */ public Duration getBaselineEstimatedDuration ( int baselineNumber ) { } }
Object result = getCachedValue ( selectField ( TaskFieldLists . BASELINE_ESTIMATED_DURATIONS , baselineNumber ) ) ; if ( ! ( result instanceof Duration ) ) { result = null ; } return ( Duration ) result ;
public class FileInfo { /** * Handy factory method for constructing a FileInfo from a GoogleCloudStorageItemInfo while * potentially returning a singleton instead of really constructing an object for cases like ROOT . */ public static FileInfo fromItemInfo ( PathCodec pathCodec , GoogleCloudStorageItemInfo itemInfo )...
if ( itemInfo . isRoot ( ) ) { return ROOT_INFO ; } URI path = pathCodec . getPath ( itemInfo . getBucketName ( ) , itemInfo . getObjectName ( ) , true ) ; return new FileInfo ( path , itemInfo ) ;
public class WildcardQuery { /** * { @ inheritDoc } */ @ Override public void extractTerms ( Set < Term > terms ) { } }
if ( multiTermQuery != null ) { multiTermQuery . extractTerms ( terms ) ; }
public class RocksDBStateBackend { /** * Creates a copy of this state backend that uses the values defined in the configuration * for fields where that were not yet specified in this state backend . * @ param config The configuration . * @ param classLoader The class loader . * @ return The re - configured vari...
return new RocksDBStateBackend ( this , config , classLoader ) ;
public class AmazonIdentityManagementClient { /** * Gets a list of all of the context keys referenced in all the IAM policies that are attached to the specified IAM * entity . The entity can be an IAM user , group , or role . If you specify a user , then the request also includes all * of the policies attached to g...
request = beforeClientExecution ( request ) ; return executeGetContextKeysForPrincipalPolicy ( request ) ;
public class Query { /** * Set the raw response received from the HTTP call . Contents are passed on to sub - classes for mapping to DTOs . * @ param httpResponseCode The HTTP response code received * @ param httpResponseStatusString The text associated with the HTTP response code * @ param freesoundResponse The ...
final Response < R > response = new Response < > ( httpResponseCode , httpResponseStatusString ) ; if ( response . isErrorResponse ( ) ) { response . setErrorDetails ( extractErrorMessage ( freesoundResponse ) ) ; } else { response . setResults ( resultsMapper . map ( freesoundResponse ) ) ; } return response ;
public class OptimizerNode { /** * Adds a new outgoing connection to this node . * @ param connection * The connection to add . */ public void addOutgoingConnection ( DagConnection connection ) { } }
if ( this . outgoingConnections == null ) { this . outgoingConnections = new ArrayList < DagConnection > ( ) ; } else { if ( this . outgoingConnections . size ( ) == 64 ) { throw new CompilerException ( "Cannot currently handle nodes with more than 64 outputs." ) ; } } this . outgoingConnections . add ( connection ) ;
public class Tile { /** * Sets the sections to the given list of TimeSection objects . The * sections will be used to colorize areas with a special * meaning . Sections in the Medusa library usually are less eye - catching * than Areas . * @ param SECTIONS */ public void setTimeSections ( final List < TimeSecti...
getTimeSections ( ) . setAll ( SECTIONS ) ; getTimeSections ( ) . sort ( new TimeSectionComparator ( ) ) ; fireTileEvent ( SECTION_EVENT ) ;
public class SimonConsolePlugin { /** * Add a resource to this plugin . * @ param path Resource path * @ param type Resource type */ public final void addResource ( String path , HtmlResourceType type ) { } }
resources . add ( new HtmlResource ( path , type ) ) ;
public class SamplesBaseActivity { /** * Sets the scale bar from preferences . */ protected void setMapScaleBar ( ) { } }
String value = this . sharedPreferences . getString ( SETTING_SCALEBAR , SETTING_SCALEBAR_BOTH ) ; if ( SETTING_SCALEBAR_NONE . equals ( value ) ) { AndroidUtil . setMapScaleBar ( this . mapView , null , null ) ; } else { if ( SETTING_SCALEBAR_BOTH . equals ( value ) ) { AndroidUtil . setMapScaleBar ( this . mapView , ...
public class ConcurrentMultiCache { /** * Provides the values for all of the unique identifiers managed by the cache . * @ param item the item whose key values are being sought * @ return a mapping of key names to item values */ public HashMap < String , Object > getKeys ( T item ) { } }
HashMap < String , Object > keys = new HashMap < String , Object > ( ) ; for ( String key : caches . keySet ( ) ) { keys . put ( key , getValue ( key , item ) ) ; } return keys ;
public class GinFactoryModuleBuilder { /** * See the factory configuration examples at { @ link GinFactoryModuleBuilder } . */ public < T > GinFactoryModuleBuilder implement ( Key < T > source , TypeLiteral < ? extends T > target ) { } }
bindings . addBinding ( source , target ) ; return this ;
public class StreamingMergeSortedGrouper { /** * Wait for { @ link # nextReadIndex } to be moved if necessary and move { @ link # curWriteIndex } . */ private void increaseWriteIndex ( ) { } }
final long startAtNs = System . nanoTime ( ) ; final long queryTimeoutAtNs = getQueryTimeoutAtNs ( startAtNs ) ; final long spinTimeoutAtNs = startAtNs + SPIN_FOR_TIMEOUT_THRESHOLD_NS ; long timeoutNs = queryTimeoutAtNs - startAtNs ; long spinTimeoutNs = SPIN_FOR_TIMEOUT_THRESHOLD_NS ; // In the below , we check that t...
public class Distance { /** * Gets the Cosine distance between two points . * @ param p A point in space . * @ param q A point in space . * @ return The Cosine distance between x and y . */ public static double Cosine ( double [ ] p , double [ ] q ) { } }
double sumProduct = 0 ; double sumP = 0 , sumQ = 0 ; for ( int i = 0 ; i < p . length ; i ++ ) { sumProduct += p [ i ] * q [ i ] ; sumP += Math . pow ( Math . abs ( p [ i ] ) , 2 ) ; sumQ += Math . pow ( Math . abs ( q [ i ] ) , 2 ) ; } sumP = Math . sqrt ( sumP ) ; sumQ = Math . sqrt ( sumQ ) ; double result = 1 - ( s...
public class CalibratedCurves { /** * Add a calibration product to the set of calibration instruments . * @ param calibrationSpec The spec of the calibration product . * @ throws CloneNotSupportedException Thrown if a curve could not be cloned / created . */ private String add ( CalibrationSpec calibrationSpec ) th...
calibrationSpecs . add ( calibrationSpec ) ; /* * Add one point to the calibration curve and one new objective function */ // Create calibration product ( will also create the curve if necessary ) calibrationProducts . add ( getCalibrationProductForSpec ( calibrationSpec ) ) ; calibrationProductsSymbols . add ( calibra...
public class CmsUsersCsvDownloadDialog { /** * Returns the export options data . < p > * @ return the export options data */ protected Map < String , List < String > > getData ( ) { } }
return ( Map < String , List < String > > ) ( ( Map < String , Object > ) getSettings ( ) . getDialogObject ( ) ) . get ( CmsUserDataExportDialog . class . getName ( ) ) ;
public class CastedExpressionTypeComputationState { /** * Replies if the linking to the cast operator functions is enabled . * @ param cast the cast operator . * @ return { @ code true } if the linking is enabled . */ public boolean isCastOperatorLinkingEnabled ( SarlCastedExpression cast ) { } }
final LightweightTypeReference sourceType = getStackedResolvedTypes ( ) . getReturnType ( cast . getTarget ( ) ) ; final LightweightTypeReference destinationType = getReferenceOwner ( ) . toLightweightTypeReference ( cast . getType ( ) ) ; if ( sourceType . isPrimitiveVoid ( ) || destinationType . isPrimitiveVoid ( ) )...
public class FastMath { /** * Compute the hyperbolic cosine of a number . * @ param x number on which evaluation is done * @ return hyperbolic cosine of x */ public static double cosh ( double x ) { } }
if ( x != x ) { return x ; } // cosh [ z ] = ( exp ( z ) + exp ( - z ) ) / 2 // for numbers with magnitude 20 or so , // exp ( - z ) can be ignored in comparison with exp ( z ) if ( x > 20 ) { if ( x >= LOG_MAX_VALUE ) { // Avoid overflow ( MATH - 905 ) . final double t = exp ( 0.5 * x ) ; return ( 0.5 * t ) * t ; } el...
public class Zendesk { /** * This API will be removed in a future release . The API endpoint does not exist . * Instead , the { @ link # createGroup ( Group ) createGroup } method should be called for each Group * @ see < a href = " https : / / github . com / cloudbees / zendesk - java - client / issues / 111 " > Z...
return createGroups ( Arrays . asList ( groups ) ) ;
public class ReconfigurableClient { /** * Changes the internal messaging client . * @ param factoryName the factory name ( see { @ link MessagingConstants } ) */ public void switchMessagingType ( String factoryName ) { } }
// Create a new client this . logger . fine ( "The messaging is requested to switch its type to " + factoryName + "." ) ; JmxWrapperForMessagingClient newMessagingClient = null ; try { IMessagingClient rawClient = createMessagingClient ( factoryName ) ; if ( rawClient != null ) { newMessagingClient = new JmxWrapperForM...