signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JSONAssetConverter { /** * Read a single assets from an input stream
* @ param inputStream
* The stream to read from
* @ return The list of assets
* @ throws IOException
* @ throws BadVersionException */
public static Asset readValue ( InputStream inputStream ) throws IOException , BadVersionExce... | return DataModelSerializer . deserializeObject ( inputStream , Asset . class ) ; |
public class JmxWebServer { /** * Start the internal Jetty web server and configure the { @ link JmxWebHandler } to handle the requests . */
public void start ( ) throws Exception { } } | server = new Server ( ) ; ServerConnector connector = new ServerConnector ( server ) ; if ( serverAddress != null ) { connector . setHost ( serverAddress . getHostAddress ( ) ) ; } connector . setPort ( serverPort ) ; server . addConnector ( connector ) ; server . setHandler ( new JmxWebHandler ( ) ) ; server . start (... |
public class ResourceTracker { /** * Find what new requests need to be sent by finding out resources needed
* by tasks but not sent to Cluster Manager .
* @ return */
public List < ResourceRequest > getWantedResources ( ) { } } | List < ResourceRequest > wanted = new ArrayList < ResourceRequest > ( ) ; synchronized ( lockObject ) { for ( Integer requestId : setDifference ( requestMap . keySet ( ) , requestedResources . keySet ( ) ) ) { ResourceRequest req = requestMap . get ( requestId ) ; LOG . info ( "Filing request for resource " + requestId... |
public class ArrayOutputStream { /** * Expand the underlying byte array to fit size bytes . */
private void expandIfNecessary ( int size ) { } } | if ( bytes . length >= size ) { // no need to expand
return ; } // either double , or expand to fit size
int newlength = Math . max ( 2 * bytes . length , size ) ; bytes = Arrays . copyOf ( bytes , newlength ) ; |
public class CssSkinGenerator { /** * ( non - Javadoc )
* @ see
* net . jawr . web . resource . handler . reader . ResourceBrowser # isDirectory ( java
* . lang . String ) */
@ Override public boolean isDirectory ( String path ) { } } | String resourcePath = getResolver ( ) . getResourcePath ( path ) ; return rsBrowser . isDirectory ( resourcePath ) ; |
public class SessionDataManager { /** * Returns saved only references ( allowed by specs ) .
* @ param identifier
* String
* @ return List of PropertyImpl
* @ throws RepositoryException
* if error
* @ see javax . jcr . Node # getReferences */
public List < PropertyImpl > getReferences ( String identifier ) ... | List < PropertyData > refDatas = transactionableManager . getReferencesData ( identifier , true ) ; List < PropertyImpl > refs = new ArrayList < PropertyImpl > ( refDatas . size ( ) ) ; for ( int i = 0 , length = refDatas . size ( ) ; i < length ; i ++ ) { PropertyData data = refDatas . get ( i ) ; ItemState state = ch... |
public class DynamoDBMapperTableModel { /** * Gets the range key field model for the specified type .
* @ param < R > The range key type .
* @ return The range key field model , or null if not present . */
@ SuppressWarnings ( "unchecked" ) public < R > DynamoDBMapperFieldModel < T , R > rangeKeyIfExists ( ) { } } | return ( DynamoDBMapperFieldModel < T , R > ) keys . get ( RANGE ) ; |
public class Reflect { /** * This method is used to get catual { @ link CommunicationMode } os service method .
* < p > The following modes are supported :
* < ul >
* < li > { @ link CommunicationMode # REQUEST _ CHANNEL } - service has at least one parameter , and the
* first parameter is either of type return... | Class < ? > returnType = method . getReturnType ( ) ; if ( isRequestChannel ( method ) ) { return REQUEST_CHANNEL ; } else if ( returnType . isAssignableFrom ( Flux . class ) ) { return REQUEST_STREAM ; } else if ( returnType . isAssignableFrom ( Mono . class ) ) { return REQUEST_RESPONSE ; } else if ( returnType . isA... |
public class CmsLockReportDialog { /** * Returns the dialog message for the given lock . < p >
* @ param lockIcon the lock icon
* @ param hasLockedChildren < code > true < / code > if the given resource has locked children
* @ return the dialog message */
private String getMessageForLock ( LockIcon lockIcon , boo... | String result = "" ; if ( ! hasLockedChildren && ( ( lockIcon == null ) || ( lockIcon == LockIcon . NONE ) ) ) { result = Messages . get ( ) . key ( Messages . GUI_LOCK_REPORT_NOTHING_LOCKED_0 ) ; } else if ( ( lockIcon == LockIcon . OPEN ) || ( lockIcon == LockIcon . SHARED_OPEN ) ) { if ( hasLockedChildren ) { result... |
public class StringUtils { /** * Appends the suffix to the end of the string if the string does not
* already end , case insensitive , with any of the suffixes .
* < pre >
* StringUtils . appendIfMissingIgnoreCase ( null , null ) = null
* StringUtils . appendIfMissingIgnoreCase ( " abc " , null ) = " abc "
* ... | return appendIfMissing ( str , suffix , true , suffixes ) ; |
public class HostProfileManager { /** * SDK4.1 signature for back compatibility */
public ApplyProfile createDefaultProfile ( String profileType ) throws RuntimeFault , RemoteException { } } | return createDefaultProfile ( profileType , null , null ) ; |
public class WebUtils { /** * Gets http servlet request geo location .
* @ param servletRequest the servlet request
* @ return the http servlet request geo location */
public static GeoLocationRequest getHttpServletRequestGeoLocation ( final HttpServletRequest servletRequest ) { } } | if ( servletRequest != null ) { return HttpRequestUtils . getHttpServletRequestGeoLocation ( servletRequest ) ; } return null ; |
public class ToastBuilder { /** * Build a Toast using the options specified in the builder .
* @ return The constructed Toast . */
@ SuppressLint ( "ShowToast" ) public Toast build ( ) { } } | Toast toast = Toast . makeText ( context , message , duration ) ; TextView toastMessage = setupToastView ( toast ) ; setToastMessageTextColor ( toastMessage ) ; setToastGravity ( toast ) ; return toast ; |
public class JsoupCssInliner { /** * Transfers styles from the < code > data - cssstyle < / code > attribute to the
* < code > style < / code > attribute .
* @ param doc
* the html document */
private void applyStyles ( Document doc ) { } } | Elements allStyledElements = doc . getElementsByAttribute ( TEMP_STYLE_ATTR ) ; for ( Element e : allStyledElements ) { String newStyle = e . attr ( TEMP_STYLE_ATTR ) ; String oldStyle = e . attr ( STYLE_ATTR ) ; e . attr ( STYLE_ATTR , ( newStyle + "; " + oldStyle ) . replaceAll ( ";+" , ";" ) . trim ( ) ) ; e . remov... |
public class PtoPMessageItemStream { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . store . itemstreams . SIMPItemStream # getPersistentData ( java . io . ObjectOutputStream ) */
public void getPersistentData ( ObjectOutputStream oos ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getPersistentData" , oos ) ; try { HashMap < String , Object > hm = new HashMap < String , Object > ( ) ; addPersistentDestinationData ( hm ) ; oos . writeObject ( hm ) ; } catch ( Exception e ) { FFDCFilter . processExcept... |
public class CommandBuilder { /** * Finds option by setting
* @ param key setting name
* @ return found option or null if none found */
private CommandOption < ? > findBySetting ( String key ) { } } | Assert . notNullOrEmptyTrimmed ( key , "Missing setting key!" ) ; Optional < CommandOption > found = options . stream ( ) . filter ( o -> o . getSetting ( ) . equals ( key ) ) . findFirst ( ) ; return found . orElse ( null ) ; |
public class SimpleSipServlet { /** * { @ inheritDoc } */
protected void doInvite ( SipServletRequest request ) throws ServletException , IOException { } } | if ( logger . isInfoEnabled ( ) ) { logger . info ( "Simple Servlet: Got request:\n" + request . getMethod ( ) ) ; } SipServletResponse sipServletResponse = request . createResponse ( SipServletResponse . SC_RINGING ) ; sipServletResponse . send ( ) ; sipServletResponse = request . createResponse ( SipServletResponse .... |
public class BootstrapConfig { /** * If necessary , verify the existence of the server . If - - create was
* specified indicating a new server should be created , then verify that the
* server does not already exist . Otherwise , verify that the server already
* exists ; if the server is ' defaultServer ' and is ... | if ( verifyServer == null || verifyServer == VerifyServer . SKIP ) { return ; } boolean generatePassword = createOptions == null || createOptions . getOption ( "no-password" ) == null ; if ( ! configDir . exists ( ) ) { if ( verifyServer == VerifyServer . CREATE || ( verifyServer == VerifyServer . CREATE_DEFAULT && get... |
public class TopicAdminClient { /** * Lists matching topics .
* < p > Sample code :
* < pre > < code >
* try ( TopicAdminClient topicAdminClient = TopicAdminClient . create ( ) ) {
* ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ;
* for ( Topic element : topicAdminClient . listTopics ( project . ... | ListTopicsRequest request = ListTopicsRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return listTopics ( request ) ; |
public class ConstantsSummaryBuilder { /** * Return true if the given package has constant fields to document .
* @ param pkg the package being checked .
* @ return true if the given package has constant fields to document . */
private boolean hasConstantField ( PackageDoc pkg ) { } } | ClassDoc [ ] classes = ( pkg . name ( ) . length ( ) > 0 ) ? pkg . allClasses ( ) : configuration . classDocCatalog . allClasses ( DocletConstants . DEFAULT_PACKAGE_NAME ) ; boolean found = false ; for ( ClassDoc doc : classes ) { if ( doc . isIncluded ( ) && hasConstantField ( doc ) ) { found = true ; } } return found... |
public class UserService { /** * Returns the set of users with the given query parameters .
* @ param queryParams The query parameters
* @ return The set of users */
public Collection < User > list ( List < String > queryParams ) { } } | return HTTP . GET ( "/v2/users.json" , null , queryParams , USERS ) . get ( ) ; |
public class DefaultEntityTagFunction { /** * Appends a byte if it ' s not a leading zero . */
private static int appendByte ( byte [ ] dst , int offset , long value ) { } } | if ( value == 0 ) { return offset ; } dst [ offset ] = ( byte ) value ; return offset + 1 ; |
public class MailPart { /** * wrap a single line
* @ param str
* @ return wraped Line */
private String wrapLine ( String str ) { } } | int wtl = wraptext ; if ( str . length ( ) <= wtl ) return str ; String sub = str . substring ( 0 , wtl ) ; String rest = str . substring ( wtl ) ; char firstR = rest . charAt ( 0 ) ; String ls = System . getProperty ( "line.separator" ) ; if ( firstR == ' ' || firstR == '\t' ) return sub + ls + wrapLine ( rest . lengt... |
public class CharSlice { /** * Checks if the byte array is contained in the slice .
* @ param a The byte array to find .
* @ return True if the byte array was found . */
public final boolean contains ( char [ ] a ) { } } | final int last_pos = off + len - a . length ; outer : for ( int pos = off ; pos <= last_pos ; ++ pos ) { for ( int a_off = 0 ; a_off < a . length ; ++ a_off ) { if ( a [ a_off ] != fb [ pos + a_off ] ) { continue outer ; } } return true ; } return false ; |
public class BsonWriter { /** * Write to the supplied output the binary BSON representation of the supplied in - memory { @ link Document } .
* @ param object the BSON object or BSON value ; may not be null
* @ param output the output ; may not be null
* @ throws IOException if there was a problem writing to the ... | ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; write ( object , stream ) ; stream . flush ( ) ; byte [ ] bytes = stream . toByteArray ( ) ; output . write ( bytes ) ; |
public class ChunkedWriteHandler { /** * Continues to fetch the chunks from the input . */
public void resumeTransfer ( ) { } } | final ChannelHandlerContext ctx = this . ctx ; if ( ctx == null ) { return ; } if ( ctx . executor ( ) . inEventLoop ( ) ) { resumeTransfer0 ( ctx ) ; } else { // let the transfer resume on the next event loop round
ctx . executor ( ) . execute ( new Runnable ( ) { @ Override public void run ( ) { resumeTransfer0 ( ctx... |
public class OffsetDateTimeField { /** * Set the specified amount of offset units to the specified time instant .
* @ param instant the time instant in millis to update .
* @ param value value of units to set .
* @ return the updated time instant .
* @ throws IllegalArgumentException if value is too large or to... | FieldUtils . verifyValueBounds ( this , value , iMin , iMax ) ; return super . set ( instant , value - iOffset ) ; |
public class MatFileWriter { /** * Writes < code > MLArrays < / code > into < code > File < / code >
* @ param file
* the MAT - file to which data is written
* @ param data
* the collection of < code > { @ link MLArray } < / code > objects
* @ throws IOException
* if error occurred during MAT - file writing... | FileOutputStream fos = new FileOutputStream ( file ) ; try { write ( fos . getChannel ( ) , data ) ; } catch ( IOException e ) { throw e ; } finally { fos . close ( ) ; } |
public class AppUtil { /** * Starts the settings app in order to show the information about a specific app .
* @ param context
* The context , the settings app should be started from , as an instance of the class
* { @ link Context } . The context may not be null
* @ param packageName
* The fully qualified pa... | Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; Condition . INSTANCE . ensureNotNull ( packageName , "The package name may not be null" ) ; Condition . INSTANCE . ensureNotEmpty ( packageName , "The package name may not be empty" ) ; Intent intent = new Intent ( ) ; intent . setAction... |
public class ParameterUtil { /** * Get values for a parameter from a database
* If a parameter is dependent of another parameter ( s ) his values will not be loaded
* @ param con connection to database
* @ param parameter parameter
* @ return a list of parameter values
* @ throws SQLException if an error to s... | List < IdName > values = new ArrayList < IdName > ( ) ; if ( parameter == null ) { return values ; } String source = parameter . getSource ( ) ; if ( parameter . isManualSource ( ) ) { if ( ! parameter . isDependent ( ) ) { values = getSelectValues ( con , source , true , parameter . getOrderBy ( ) ) ; } } else { int i... |
public class TagMagix { /** * Alter the HTML document in page , updating URLs in the attrName attributes
* of all tagName tags such that :
* 1 ) absolute URLs are prefixed with : wmPrefix + pageTS 2 ) server - relative
* URLs are prefixed with : wmPrefix + pageTS + ( host of page ) 3)
* path - relative URLs are... | Pattern tagPat = getPattern ( tagName , attrName ) ; markupTagREURIC ( page , uriConverter , captureDate , baseUrl , tagPat ) ; |
public class InternalCssScriptResourceRenderer { /** * This methods generates the HTML code of the current b : internalCssScriptResource .
* @ param context the FacesContext .
* @ param component the current b : internalCssScriptResource .
* @ throws IOException thrown if something goes wrong when writing the HTM... | if ( ! component . isRendered ( ) ) { return ; } InternalCssScriptResource internalCssScriptResource = ( InternalCssScriptResource ) component ; ResponseWriter rw = context . getResponseWriter ( ) ; rw . startElement ( "link" , internalCssScriptResource ) ; rw . writeAttribute ( "type" , "text/css" , null ) ; rw . writ... |
public class DeleteResults { /** * Checks whether particular object was deleted
* @ param object object to check
* @ return true if object was deleted , false otherwise */
public boolean wasDeleted ( @ NonNull T object ) { } } | final DeleteResult result = results . get ( object ) ; return result != null && result . numberOfRowsDeleted ( ) > 0 ; |
public class StatementManager { /** * returns an Array with an Objects PK VALUES
* @ throws PersistenceBrokerException if there is an erros accessing o field values */
protected ValueContainer [ ] getKeyValues ( PersistenceBroker broker , ClassDescriptor cld , Object obj ) throws PersistenceBrokerException { } } | return broker . serviceBrokerHelper ( ) . getKeyValues ( cld , obj ) ; |
public class Jenkins { /** * Called by { @ link Job # renameTo ( String ) } to update relevant data structure .
* assumed to be synchronized on Jenkins by the caller . */
public void onRenamed ( TopLevelItem job , String oldName , String newName ) throws IOException { } } | items . remove ( oldName ) ; items . put ( newName , job ) ; // For compatibility with old views :
for ( View v : views ) v . onJobRenamed ( job , oldName , newName ) ; |
public class ClosableCharArrayWriter { /** * Writes the specified single character .
* @ param c the single character to be written .
* @ throws java . io . IOException if an I / O error occurs .
* In particular , an < tt > IOException < / tt > may be thrown
* if this writer has been { @ link # close ( ) closed... | checkClosed ( ) ; int newcount = count + 1 ; if ( newcount > buf . length ) { buf = copyOf ( buf , Math . max ( buf . length << 1 , newcount ) ) ; } buf [ count ] = ( char ) c ; count = newcount ; |
public class CompressUtil { /** * compress a source file / directory to a zip file
* @ param sources
* @ param target
* @ param filter
* @ throws IOException */
public static void compressZip ( Resource [ ] sources , Resource target , ResourceFilter filter ) throws IOException { } } | ZipOutputStream zos = null ; try { zos = new ZipOutputStream ( IOUtil . toBufferedOutputStream ( target . getOutputStream ( ) ) ) ; compressZip ( "" , sources , zos , filter ) ; } finally { IOUtil . closeEL ( zos ) ; } |
public class UpdateGatewayRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateGatewayRequest updateGatewayRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateGatewayRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateGatewayRequest . getGatewayArn ( ) , GATEWAYARN_BINDING ) ; protocolMarshaller . marshall ( updateGatewayRequest . getName ( ) , NAME_BINDING ) ; protocolMars... |
public class HasInputStream { /** * Create a new object with a supplier that can be read only once .
* @ param aISP
* { @ link InputStream } provider . May not be < code > null < / code > .
* @ return Never < code > null < / code > . */
@ Nonnull @ ReturnsMutableCopy public static HasInputStream once ( @ Nonnull ... | return new HasInputStream ( aISP , false ) ; |
public class Strings { /** * Performs a null - safe { @ code toString ( ) } operation on each
* element of the set .
* @ param target the set of objects on which toString will be executed
* @ return for each element : the result of calling { @ code target . toString ( ) }
* if target is not null , { @ code null... | if ( target == null ) { return null ; } final Set < String > result = new LinkedHashSet < String > ( target . size ( ) + 2 ) ; for ( final Object element : target ) { result . add ( toString ( element ) ) ; } return result ; |
public class ThreadCpuStats { /** * Convert time in nanoseconds to a duration string . This is used to provide a more human
* readable order of magnitude for the duration . We assume standard fixed size quantities for
* all units . */
public static String toDuration ( long inputTime ) { } } | final long second = 1000000000L ; final long minute = 60 * second ; final long hour = 60 * minute ; final long day = 24 * hour ; final long week = 7 * day ; long time = inputTime ; final StringBuilder buf = new StringBuilder ( ) ; buf . append ( 'P' ) ; time = append ( buf , 'W' , week , time ) ; time = append ( buf , ... |
public class ValidationConfigurator { /** * Load the class on the application class loader given the class name . More specifically ,
* the class will be loaded using which ever class loader already loaded the class , which
* is handled by { @ link # loadClass ( String ) } .
* @ param < T > the type of the class ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "instantiateClass" , clazz ) ; } T object = null ; try { object = clazz . newInstance ( ) ; } catch ( Throwable e ) { Tr . error ( tc , BVNLSConstants . BVKEY_CLASS_NOT_FOUND , new Object [ ] { ivBVContext . getPath ( ) , cla... |
public class AbstractDiskMap { /** * TODO : better with an Iterator */
public final Set < K > keySet ( ) { } } | try { Set < K > set = new HashSet < K > ( ) ; listFilesToSet ( getPath ( ) , set ) ; return set ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } |
public class SqlEntityQueryImpl { /** * { @ inheritDoc }
* s * @ see jp . co . future . uroborosql . fluent . SqlEntityQuery # desc ( java . lang . String , jp . co . future . uroborosql . fluent . SqlEntityQuery . Nulls ) */
@ Override public SqlEntityQuery < E > desc ( final String col , final Nulls nulls ) { } } | this . sortOrders . add ( new SortOrder ( col , Order . DESCENDING , nulls ) ) ; return this ; |
public class WonderPush { /** * Provides or withdraws user consent .
* < p > Call this method after { @ link # initialize ( Context ) } . < / p >
* @ param value Whether the user provided or withdrew consent .
* @ see # setRequiresUserConsent ( boolean ) */
public static void setUserConsent ( boolean value ) { } ... | boolean hadUserConsent = hasUserConsent ( ) ; WonderPushConfiguration . setUserConsent ( value ) ; boolean nowHasUserConsent = hasUserConsent ( ) ; if ( sIsInitialized && hadUserConsent != nowHasUserConsent ) { hasUserConsentChanged ( nowHasUserConsent ) ; } |
public class LByteIntConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LByteIntConsumer byteIntConsumerFrom ( Consumer < LByteIntConsumerBuilder > buildingFunction ) { } } | LByteIntConsumerBuilder builder = new LByteIntConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class TerminalConsoleAppender { /** * Closes the JLine { @ link Terminal } ( if available ) and restores the original
* terminal settings .
* @ throws IOException If an I / O error occurs */
public synchronized static void close ( ) throws IOException { } } | if ( initialized ) { initialized = false ; reader = null ; if ( terminal != null ) { try { terminal . close ( ) ; } finally { terminal = null ; } } } |
public class HamtPMap { /** * Internal recursive version of pivot . If parent is null then the result is used for the value in
* the returned map . The value , if found , is stored in the ' result ' array as a secondary return . */
private HamtPMap < K , V > pivot ( K key , int hash , HamtPMap < K , V > parent , V [ ... | int newMask = mask ; HamtPMap < K , V > [ ] newChildren = this . children ; if ( hash == this . hash && key . equals ( this . key ) ) { // Found the key : swap out this key / value with the parent and return the result in the holder .
result [ 0 ] = this . value ; } else { // Otherwise , see if the value might be prese... |
public class Instant { /** * Returns a copy of this instant with the specified duration in nanoseconds subtracted .
* This instance is immutable and unaffected by this method call .
* @ param nanosToSubtract the nanoseconds to subtract , positive or negative
* @ return an { @ code Instant } based on this instant ... | if ( nanosToSubtract == Long . MIN_VALUE ) { return plusNanos ( Long . MAX_VALUE ) . plusNanos ( 1 ) ; } return plusNanos ( - nanosToSubtract ) ; |
public class TrileadVersionSupportManager { /** * Craetes an instance of TrileadVersionSupport that can provide functionality relevant to the version of Trilead
* available in the current executing instance of Jenkins .
* @ return an instance of TrileadVersionSupport that provides functionality relevant for the ver... | try { if ( isAfterTrilead8 ( ) ) { return createVersion9Instance ( ) ; } } catch ( Exception | LinkageError e ) { LOGGER . log ( Level . WARNING , "Could not create Trilead support class. Using legacy Trilead features" , e ) ; } // We ' re on an old version of Triilead or couldn ' t create a new handler , fall back to ... |
public class SimpleParser { /** * { @ inheritDoc } */
@ Override public TemporalDataModelIF < Long , Long > parseTemporalData ( final File f ) throws IOException { } } | return parseData ( f , "\t" , true ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertPGDYpgBaseToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class SeekBarPreference { /** * Obtains the number of decimals of the floating point numbers , the preference allows to
* choose , from a specific typed array .
* @ param typedArray
* The typed array , the number of decimals should be obtained from , as an instance of
* the class { @ link TypedArray } . ... | int defaultValue = getContext ( ) . getResources ( ) . getInteger ( R . integer . seek_bar_preference_default_decimals ) ; setDecimals ( typedArray . getInteger ( R . styleable . SeekBarPreference_decimals , defaultValue ) ) ; |
public class JmsSysEventListener { /** * Close and release resources . */
public void close ( ) { } } | if ( consumer != null ) { try { consumer . close ( ) ; } catch ( Throwable t ) { warn ( t . getMessage ( ) ) ; } } conn . close ( ) ; |
public class AUUtils { /** * ABNF Definition
* PlayAnnParmList = PlayAnnParm * ( WSP PlayAnnParm ) ; PlayAnnParm = (
* AnnouncementParm / IterationsParm / IntervalParm / DurationParm /
* SpeedParm / VolumeParm ) ; AnnouncementParm = AnParmToken EQUALS
* Segmentlist ; Segmentlist = SegmentDescriptor * ( COMMA Se... | boolean f = decode_PlayAnnParm ( ) ; if ( ! f ) { throw new ParserException ( "Parsing of AnnParm failed" ) ; } while ( f ) { f = decode_WSP ( ) ; if ( f ) { f = decode_PlayAnnParm ( ) ; } } return value ; |
public class SourceStream { /** * This method is called when the totalMessages on the stream
* falls and we have the possibility of sending a message
* because it is now inside the sendWindow */
private synchronized TickRange msgRemoved ( long tick , StateStream ststream , TransactionCommon tran ) throws SIResource... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "msgRemoved" , new Object [ ] { Long . valueOf ( tick ) , ststream , tran } ) ; TickRange tr1 = null ; boolean sendMessage = false ; long stamp = tick ; // We know we have reduced the number of messages in the stream
... |
public class SubCountHandler { /** * Reset the field count .
* @ param bDisableListeners Disable the field listeners ( used for grid count verification )
* @ param iMoveMode Move mode . */
public int setCount ( double dFieldCount , boolean bDisableListeners , int iMoveMode ) { } } | int iErrorCode = DBConstants . NORMAL_RETURN ; if ( m_fldMain != null ) { boolean [ ] rgbEnabled = null ; if ( bDisableListeners ) rgbEnabled = m_fldMain . setEnableListeners ( false ) ; int iOriginalValue = ( int ) m_fldMain . getValue ( ) ; boolean bOriginalModified = m_fldMain . isModified ( ) ; int iOldOpenMode = m... |
public class AssociationRule { /** * Append to a string buffer .
* @ param buf Buffer
* @ param meta Relation metadata ( for labels )
* @ return String buffer for chaining . */
public StringBuilder appendTo ( StringBuilder buf , VectorFieldTypeInformation < BitVector > meta ) { } } | this . antecedent . appendTo ( buf , meta ) ; buf . append ( " --> " ) ; this . consequent . appendItemsTo ( buf , meta ) ; buf . append ( ": " ) ; buf . append ( union . getSupport ( ) ) ; buf . append ( " : " ) ; buf . append ( this . measure ) ; return buf ; |
public class ChessboardCornerGraph { /** * Convert into a generic graph . */
public void convert ( FeatureGraph2D graph ) { } } | graph . nodes . resize ( corners . size ) ; graph . reset ( ) ; for ( int i = 0 ; i < corners . size ; i ++ ) { Node c = corners . get ( i ) ; FeatureGraph2D . Node n = graph . nodes . grow ( ) ; n . reset ( ) ; n . set ( c . x , c . y ) ; n . index = c . index ; } for ( int i = 0 ; i < corners . size ; i ++ ) { Node c... |
public class FlatFileWriter { /** * Writes a flat file block to an output stream . Does not write
* anything if the line is empty . */
protected void writeBlock ( Writer writer , String header , String block ) throws IOException { } } | writeBlock ( writer , null , header , block ) ; |
public class DeleteLaunchTemplateVersionsResult { /** * Information about the launch template versions that were successfully deleted .
* @ return Information about the launch template versions that were successfully deleted . */
public java . util . List < DeleteLaunchTemplateVersionsResponseSuccessItem > getSuccess... | if ( successfullyDeletedLaunchTemplateVersions == null ) { successfullyDeletedLaunchTemplateVersions = new com . amazonaws . internal . SdkInternalList < DeleteLaunchTemplateVersionsResponseSuccessItem > ( ) ; } return successfullyDeletedLaunchTemplateVersions ; |
public class TCPReadRequestContextImpl { /** * @ see com . ibm . wsspi . tcpchannel . TCPReadRequestContext # read ( long , int ) */
@ Override public long read ( long numBytes , int time ) throws IOException { } } | int timeout = time ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "read(" + numBytes + "," + timeout + ")" ) ; } long bytesRead = 0L ; getTCPConnLink ( ) . incrementNumReads ( ) ; if ( getConfig ( ) . getDumpStatsInterval ( ) > 0 ) { getTCPConnLink ( ) . getTCPChannel (... |
public class IncrementalDomSrcMain { /** * Generates Incremental DOM JS source code given a Soy parse tree , an options object , and an
* optional bundle of translated messages .
* @ param soyTree The Soy parse tree to generate JS source code for .
* @ param registry The template registry that contains all the te... | SoyJsSrcOptions incrementalJSSrcOptions = options . toJsSrcOptions ( ) ; BidiGlobalDir bidiGlobalDir = SoyBidiUtils . decodeBidiGlobalDirFromJsOptions ( incrementalJSSrcOptions . getBidiGlobalDir ( ) , incrementalJSSrcOptions . getUseGoogIsRtlForBidiGlobalDir ( ) ) ; try ( SoyScopedData . InScope inScope = apiCallScope... |
public class ToStringStyle { /** * < p > Sets the field separator text . < / p >
* < p > < code > null < / code > is accepted , but will be converted to
* an empty String . < / p >
* @ param fieldSeparator the new field separator text */
protected void setFieldSeparator ( String fieldSeparator ) { } } | if ( fieldSeparator == null ) { fieldSeparator = StringUtils . EMPTY ; } this . fieldSeparator = fieldSeparator ; |
public class Encoder { /** * Encodes a pseudo - Boolean constraint .
* @ param s the solver
* @ param lits the literals of the constraint
* @ param coeffs the coefficients of the constraints
* @ param rhs the right hand side of the constraint
* @ throws IllegalStateException if the pseudo - Boolean encoding i... | switch ( this . pbEncoding ) { case SWC : this . swc . encode ( s , lits , coeffs , rhs ) ; break ; default : throw new IllegalStateException ( "Unknown pseudo-Boolean encoding: " + this . pbEncoding ) ; } |
public class NbboBenchmark { /** * Create a Timer task to display performance data on the Vote procedure
* It calls printStatistics ( ) every displayInterval seconds */
public void schedulePeriodicStats ( ) { } } | timer = new Timer ( ) ; TimerTask statsPrinting = new TimerTask ( ) { @ Override public void run ( ) { printStatistics ( ) ; } } ; timer . scheduleAtFixedRate ( statsPrinting , config . displayinterval * 1000 , config . displayinterval * 1000 ) ; |
public class BasicAuthHttpInvokerRequestExecutor { /** * Called every time a HTTP invocation is made .
* Simply allows the parent to setup the connection , and then adds an
* < code > Authorization < / code > HTTP header property that will be used for
* BASIC authentication . Following that a call to
* { @ link... | super . prepareConnection ( con , contentLength ) ; Authentication auth = getAuthenticationToken ( ) ; if ( ( auth != null ) && ( auth . getName ( ) != null ) && ( auth . getCredentials ( ) != null ) ) { String base64 = auth . getName ( ) + ":" + auth . getCredentials ( ) . toString ( ) ; con . setRequestProperty ( "Au... |
public class lbvserver_dospolicy_binding { /** * Use this API to fetch lbvserver _ dospolicy _ binding resources of given name . */
public static lbvserver_dospolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | lbvserver_dospolicy_binding obj = new lbvserver_dospolicy_binding ( ) ; obj . set_name ( name ) ; lbvserver_dospolicy_binding response [ ] = ( lbvserver_dospolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class AbstractExtraLanguageValidator { /** * Create the instance of the type converter .
* @ param initializer the converter initializer .
* @ param context the generation context .
* @ return the type converter . */
@ SuppressWarnings ( "static-method" ) protected ExtraLanguageTypeConverter createTypeConv... | return new ExtraLanguageTypeConverter ( initializer , context ) ; |
public class ClassifierAdapter { /** * { @ inheritDoc } */
@ Override @ SuppressWarnings ( "unchecked" ) public T classify ( C classifiable ) { } } | if ( this . classifier != null ) { return this . classifier . classify ( classifiable ) ; } return ( T ) this . invoker . invokeMethod ( classifiable ) ; |
public class Postcard { /** * Inserts a short value into the mapping of this Bundle , replacing
* any existing value for the given key .
* @ param key a String , or null
* @ param value a short
* @ return current */
public Postcard withShort ( @ Nullable String key , short value ) { } } | mBundle . putShort ( key , value ) ; return this ; |
public class CausticUtil { /** * Converts the components of a color , as specified by the HSB model , to an equivalent set of values for the default RGB model . The < code > saturation < / code > and < code > brightness < / code > components
* should be floating - point values between zero and one ( numbers in the ra... | float r = 0 ; float g = 0 ; float b = 0 ; if ( saturation == 0 ) { r = g = b = brightness ; } else { final float h = ( hue - GenericMath . floor ( hue ) ) * 6 ; final float f = h - GenericMath . floor ( h ) ; final float p = brightness * ( 1 - saturation ) ; final float q = brightness * ( 1 - saturation * f ) ; final f... |
public class BackedHashMap { /** * hasTimedOut - check if given session has timed out */
private boolean hasTimedOut ( BackedSession d , long now ) { } } | boolean timedOut = false ; int timeout = d . getMaxInactiveInterval ( ) ; // Zero means we just read the session from database
if ( timeout > 0 ) { long lastTouch = d . getCurrentAccessTime ( ) ; long invalidLastTouch = now - ( 1000 * ( long ) timeout ) ; // PK90548
if ( lastTouch <= invalidLastTouch ) { timedOut = tru... |
public class AbstractSoapAttachmentValidator { /** * Validating SOAP attachment content id .
* @ param receivedAttachment
* @ param controlAttachment */
protected void validateAttachmentContentId ( SoapAttachment receivedAttachment , SoapAttachment controlAttachment ) { } } | // in case contentId was not set in test case , skip validation
if ( ! StringUtils . hasText ( controlAttachment . getContentId ( ) ) ) { return ; } if ( receivedAttachment . getContentId ( ) != null ) { Assert . isTrue ( controlAttachment . getContentId ( ) != null , buildValidationErrorMessage ( "Values not equal for... |
public class PluginWSCommons { /** * Write the update properties to the specified jsonwriter .
* < pre >
* " status " : " COMPATIBLE " ,
* " requires " : [
* " key " : " java " ,
* " name " : " Java " ,
* " description " : " SonarQube rule engine . "
* < / pre > */
public static void writeUpdateProperties... | jsonWriter . prop ( PROPERTY_STATUS , toJSon ( pluginUpdate . getStatus ( ) ) ) ; jsonWriter . name ( ARRAY_REQUIRES ) . beginArray ( ) ; Release release = pluginUpdate . getRelease ( ) ; for ( Plugin child : filter ( transform ( release . getOutgoingDependencies ( ) , Release :: getArtifact ) , Plugin . class ) ) { js... |
public class AeshCommandResolver { /** * try to return the command in the given registry if the given registry do
* not find the command , check if we have a internal registry and if its
* there .
* @ param commandName command name
* @ param line command line
* @ return command
* @ throws CommandNotFoundExc... | try { return registry . getCommand ( commandName , line ) ; } catch ( CommandNotFoundException e ) { // Lookup in aliases
return registry . getCommandByAlias ( commandName ) ; } |
public class JsonModelGenerator { /** * Get JSON key string .
* @ param element
* @ return JSON key string
* @ author vvakame */
String getElementKeyString ( Element element ) { } } | JsonKey key = element . getAnnotation ( JsonKey . class ) ; JsonModel model = element . getEnclosingElement ( ) . getAnnotation ( JsonModel . class ) ; if ( ! "" . equals ( key . value ( ) ) ) { return key . value ( ) ; } else if ( "" . equals ( key . value ( ) ) && key . decamelize ( ) ) { return decamelize ( element ... |
public class ZonedDateTime { /** * Obtains an instance of { @ code ZonedDateTime } strictly validating the
* combination of local date - time , offset and zone ID .
* This creates a zoned date - time ensuring that the offset is valid for the
* local date - time according to the rules of the specified zone .
* I... | Jdk8Methods . requireNonNull ( localDateTime , "localDateTime" ) ; Jdk8Methods . requireNonNull ( offset , "offset" ) ; Jdk8Methods . requireNonNull ( zone , "zone" ) ; ZoneRules rules = zone . getRules ( ) ; if ( rules . isValidOffset ( localDateTime , offset ) == false ) { ZoneOffsetTransition trans = rules . getTran... |
public class UnionSet { /** * Triggers combining .
* @ see # addAll ( java . util . Set ) */
@ Override public boolean addAll ( Collection < ? extends E > c ) { } } | if ( c . isEmpty ( ) ) return false ; combine ( ) ; if ( combined == null ) { combined = new HashSet < > ( c ) ; return true ; } else { return combined . addAll ( c ) ; } |
public class XmlDescriptorHelper { /** * Create a description descriptor .
* @ param descriptionType
* The XML description type .
* @ param store
* The store .
* @ return The description descriptor . */
public static DescriptionDescriptor createDescription ( DescriptionType descriptionType , Store store ) { }... | DescriptionDescriptor descriptionDescriptor = store . create ( DescriptionDescriptor . class ) ; descriptionDescriptor . setLang ( descriptionType . getLang ( ) ) ; descriptionDescriptor . setValue ( descriptionType . getValue ( ) ) ; return descriptionDescriptor ; |
public class FullDemo { /** * addLocalizedPickerAndLabel , This creates a date picker whose locale is set to the specified
* language . This also sets the picker to today ' s date , creates a label for the date picker , and
* adds the components to the language panel . */
private static void addLocalizedPickerAndLa... | // Create the localized date picker and label .
Locale locale = new Locale ( languageCode ) ; DatePickerSettings settings = new DatePickerSettings ( locale ) ; // Set a minimum size for the localized date pickers , to improve the look of the demo .
settings . setSizeTextFieldMinimumWidth ( 125 ) ; settings . setSizeTex... |
public class KDTree { /** * Returns the value of the named measure .
* @ param additionalMeasureNamethe name of
* the measure to query for its value .
* @ return The value of the named measure
* @ throws IllegalArgumentExceptionIf the named measure
* is not supported . */
public double getMeasure ( String add... | if ( additionalMeasureName . compareToIgnoreCase ( "measureMaxDepth" ) == 0 ) { return measureMaxDepth ( ) ; } else if ( additionalMeasureName . compareToIgnoreCase ( "measureTreeSize" ) == 0 ) { return measureTreeSize ( ) ; } else if ( additionalMeasureName . compareToIgnoreCase ( "measureNumLeaves" ) == 0 ) { return ... |
public class JdbcRepositories { /** * Gets the repository definitions , lazy load .
* @ return repository definitions */
public static List < RepositoryDefinition > getRepositoryDefinitions ( ) { } } | if ( null == repositoryDefinitions ) { try { initRepositoryDefinitions ( ) ; } catch ( final Exception e ) { LOGGER . log ( Level . ERROR , "Init repository definitions failed" , e ) ; } } return repositoryDefinitions ; |
public class syslog_server { /** * < pre >
* Use this operation to get all the syslog servers .
* < / pre > */
public static syslog_server [ ] get ( nitro_service client ) throws Exception { } } | syslog_server resource = new syslog_server ( ) ; resource . validate ( "get" ) ; return ( syslog_server [ ] ) resource . get_resources ( client ) ; |
public class AbstractPreferenceFragment { /** * Initializes the elevation of the button bar .
* @ param sharedPreferences
* The shared preferences , which should be used , as an instance of the type { @ link
* SharedPreferences } */
private void initializeButtonBarElevation ( final SharedPreferences sharedPrefere... | String key = getString ( R . string . preference_fragment_button_bar_elevation_preference_key ) ; String defaultValue = getString ( R . string . preference_fragment_button_bar_elevation_preference_default_value ) ; int elevation = Integer . valueOf ( sharedPreferences . getString ( key , defaultValue ) ) ; setButtonBar... |
public class AwtPoiPersistenceManager { /** * { @ inheritDoc } */
@ Override public synchronized void close ( ) { } } | if ( isClosed ( ) ) { return ; } // Close statements
if ( this . findCatByIDStatement != null ) { try { this . findCatByIDStatement . close ( ) ; } catch ( SQLException e ) { LOGGER . log ( Level . SEVERE , e . getMessage ( ) , e ) ; } } if ( this . findDataByIDStatement != null ) { try { this . findDataByIDStatement .... |
public class SortTileRecursiveBulkSplit { /** * Recursively partition .
* @ param objs Object list
* @ param start Subinterval start
* @ param end Subinterval end
* @ param depth Iteration depth ( must be less than dimensionality ! )
* @ param dims Total number of dimensions
* @ param maxEntries Maximum pag... | final int p = ( int ) FastMath . ceil ( ( end - start ) / ( double ) maxEntries ) ; final int s = ( int ) FastMath . ceil ( FastMath . pow ( p , 1.0 / ( dims - depth ) ) ) ; final double len = end - start ; // double intentional !
for ( int i = 0 ; i < s ; i ++ ) { // We don ' t completely sort , but only ensure the qu... |
public class DescribeConfigurationSettingsResult { /** * A list of < a > ConfigurationSettingsDescription < / a > .
* @ return A list of < a > ConfigurationSettingsDescription < / a > . */
public java . util . List < ConfigurationSettingsDescription > getConfigurationSettings ( ) { } } | if ( configurationSettings == null ) { configurationSettings = new com . amazonaws . internal . SdkInternalList < ConfigurationSettingsDescription > ( ) ; } return configurationSettings ; |
public class ProxyUtil { /** * Creates a composite service using all of the given
* services and implementing the given interfaces .
* @ param classLoader the { @ link ClassLoader }
* @ param services the service objects
* @ param serviceInterfaces the service interfaces
* @ param allowMultipleInheritance whe... | Set < Class < ? > > interfaces = collectInterfaces ( services , serviceInterfaces ) ; final Map < Class < ? > , Object > serviceClassToInstanceMapping = buildServiceMap ( services , allowMultipleInheritance , interfaces ) ; // now create the proxy
return Proxy . newProxyInstance ( classLoader , interfaces . toArray ( n... |
public class ChainedProperty { /** * Returns true if any property in the chain can be null .
* @ see com . amazon . carbonado . Nullable
* @ since 1.2 */
public boolean isNullable ( ) { } } | if ( mPrime . isNullable ( ) ) { return true ; } if ( mChain != null ) { for ( StorableProperty < ? > prop : mChain ) { if ( prop . isNullable ( ) ) { return true ; } } } return false ; |
public class GetLabelDetectionResult { /** * An array of labels detected in the video . Each element contains the detected label and the time , in milliseconds
* from the start of the video , that the label was detected .
* @ param labels
* An array of labels detected in the video . Each element contains the dete... | if ( labels == null ) { this . labels = null ; return ; } this . labels = new java . util . ArrayList < LabelDetection > ( labels ) ; |
public class XMemcachedClient { /** * ( non - Javadoc )
* @ see net . rubyeye . xmemcached . MemcachedClient # gets ( java . lang . String , long ,
* net . rubyeye . xmemcached . transcoders . Transcoder ) */
@ SuppressWarnings ( "unchecked" ) public final < T > GetsResponse < T > gets ( final String key , final lo... | return ( GetsResponse < T > ) this . get0 ( key , timeout , CommandType . GETS_ONE , transcoder ) ; |
public class DocTreeScanner { /** * { @ inheritDoc } This implementation scans the children in left to right order .
* @ param node { @ inheritDoc }
* @ param p { @ inheritDoc }
* @ return the result of scanning */
@ Override public R visitLink ( LinkTree node , P p ) { } } | R r = scan ( node . getReference ( ) , p ) ; r = scanAndReduce ( node . getLabel ( ) , p , r ) ; return r ; |
public class TimeSection { /** * Defines the time when the section ends
* @ param STOP */
public void setStop ( final LocalTime STOP ) { } } | if ( null == stop ) { _stop = STOP ; } else { stop . set ( STOP ) ; } |
public class NetworkAddressUtils { /** * Gets the local hostname to be used by the client . If this isn ' t configured , a
* non - loopback local hostname will be looked up .
* @ param conf Alluxio configuration
* @ return the local hostname for the client
* @ deprecated This should not be used anymore as the U... | if ( conf . isSet ( PropertyKey . USER_HOSTNAME ) ) { return conf . get ( PropertyKey . USER_HOSTNAME ) ; } return getLocalHostName ( ( int ) conf . getMs ( PropertyKey . NETWORK_HOST_RESOLUTION_TIMEOUT_MS ) ) ; |
public class PipelineDeclaration { /** * The stage in which to perform the action .
* @ param stages
* The stage in which to perform the action . */
public void setStages ( java . util . Collection < StageDeclaration > stages ) { } } | if ( stages == null ) { this . stages = null ; return ; } this . stages = new java . util . ArrayList < StageDeclaration > ( stages ) ; |
public class CreateAcceleratorRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateAcceleratorRequest createAcceleratorRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createAcceleratorRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createAcceleratorRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createAcceleratorRequest . getIpAddressType ( ) , IPADDRESSTYPE_BINDIN... |
public class XmlUtils { /** * Returns the given document as a XML string in a " pretty " format .
* @ param document
* @ return the document as an XML string */
public static String documentToPrettyString ( Document document ) { } } | StringWriter stringWriter = new StringWriter ( ) ; OutputFormat prettyPrintFormat = OutputFormat . createPrettyPrint ( ) ; XMLWriter xmlWriter = new XMLWriter ( stringWriter , prettyPrintFormat ) ; try { xmlWriter . write ( document ) ; } catch ( IOException e ) { // Ignore , shouldn ' t happen .
} return stringWriter ... |
public class SessionManager { /** * Create and return a new ExtWebDriver instance . The instance is
* constructed with default options , with the provided Map of key / value
* pairs overriding the corresponding pairs in the options . This new
* ExtWebDriver instance will then become the current session .
* @ pa... | return getNewSession ( override , true ) ; |
public class JavaLexer { /** * $ ANTLR start " T _ _ 93" */
public final void mT__93 ( ) throws RecognitionException { } } | try { int _type = T__93 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 74:7 : ( ' interface ' )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 74:9 : ' interface '
{ match ( "interface" )... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.