signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TaskManagerTabPanel { /** * Opens a previously saved configuration
* @ param path */
public void openConfig ( String path ) { } } | Properties properties = new Properties ( ) ; try { properties . load ( new FileInputStream ( path ) ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( this , "Problems reading the properties file" , "Error" , JOptionPane . ERROR_MESSAGE ) ; } // read datasets
this . jTextFieldProcess . setText ( properties . getProperty ( "processors" ) ) ; this . jTextFieldTask . setText ( properties . getProperty ( "task" ) ) ; try { this . currentTask = ( MainTask ) ClassOption . cliStringToObject ( this . jTextFieldTask . getText ( ) , MainTask . class , null ) ; } catch ( Exception ex ) { Logger . getLogger ( TaskManagerTabPanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } this . jTextFieldDir . setText ( properties . getProperty ( "ResultsDir" ) ) ; this . resultsPath = this . jTextFieldDir . getText ( ) ; String [ ] streamShortNames = properties . getProperty ( "streamShortNames" ) . split ( "," ) ; String [ ] streamCommand = properties . getProperty ( "streamCommand" ) . split ( "," ) ; String [ ] algShortNames = properties . getProperty ( "algorithmShortNames" ) . split ( "," ) ; String [ ] algorithmCommand = properties . getProperty ( "algorithmCommand" ) . split ( "," ) ; cleanTables ( ) ; for ( int i = 0 ; i < streamShortNames . length ; i ++ ) { this . streamModel . addRow ( new Object [ ] { streamCommand [ i ] , streamShortNames [ i ] } ) ; } for ( int i = 0 ; i < algShortNames . length ; i ++ ) { this . algoritmModel . addRow ( new Object [ ] { algorithmCommand [ i ] , algShortNames [ i ] } ) ; } |
public class CleverTapAPI { /** * InApp */
private void runOnNotificationQueue ( final Runnable runnable ) { } } | try { final boolean executeSync = Thread . currentThread ( ) . getId ( ) == NOTIFICATION_THREAD_ID ; if ( executeSync ) { runnable . run ( ) ; } else { ns . submit ( new Runnable ( ) { @ Override public void run ( ) { NOTIFICATION_THREAD_ID = Thread . currentThread ( ) . getId ( ) ; try { runnable . run ( ) ; } catch ( Throwable t ) { getConfigLogger ( ) . verbose ( getAccountId ( ) , "Notification executor service: Failed to complete the scheduled task" , t ) ; } } } ) ; } } catch ( Throwable t ) { getConfigLogger ( ) . verbose ( getAccountId ( ) , "Failed to submit task to the notification executor service" , t ) ; } |
public class AspFactoryImpl { /** * ( non - Javadoc )
* @ see org . mobicents . protocols . api . AssociationListener # inValidStreamId ( org . mobicents . protocols . api . PayloadData ) */
@ Override public void inValidStreamId ( org . mobicents . protocols . api . PayloadData payloadData ) { } } | logger . error ( String . format ( "Tx : PayloadData with streamNumber=%d which is greater than or equal to maxSequenceNumber=%d. Droping PayloadData=%s" , payloadData . getStreamNumber ( ) , this . maxOutboundStreams , payloadData ) ) ; |
public class DRL6Expressions { /** * $ ANTLR start synpred36 _ DRL6Expressions */
public final void synpred36_DRL6Expressions_fragment ( ) throws RecognitionException { } } | // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 600:15 : ( NULL _ SAFE _ DOT ID )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 600:16 : NULL _ SAFE _ DOT ID
{ match ( input , NULL_SAFE_DOT , FOLLOW_NULL_SAFE_DOT_in_synpred36_DRL6Expressions3477 ) ; if ( state . failed ) return ; match ( input , ID , FOLLOW_ID_in_synpred36_DRL6Expressions3479 ) ; if ( state . failed ) return ; } |
public class UpdateDoublesSketch { /** * Returns a compact version of this sketch . If passing in a Memory object , the compact sketch
* will use that direct memory ; otherwise , an on - heap sketch will be returned .
* @ param dstMem An optional target memory to hold the sketch .
* @ return A compact version of this sketch */
public CompactDoublesSketch compact ( final WritableMemory dstMem ) { } } | if ( dstMem == null ) { return HeapCompactDoublesSketch . createFromUpdateSketch ( this ) ; } return DirectCompactDoublesSketch . createFromUpdateSketch ( this , dstMem ) ; |
public class PropertyFilter { /** * Returns another PropertyFilter instance which is bound to the given constant value .
* @ throws IllegalArgumentException if value is not compatible with property type */
public PropertyFilter < S > constant ( Object value ) { } } | if ( mBindID == BOUND_CONSTANT ) { if ( mConstant == null ) { if ( value == null ) { return this ; } } else if ( mConstant . equals ( value ) ) { return this ; } } return getCanonical ( mProperty , mOp , adaptValue ( value ) ) ; |
public class CommerceAccountUserRelLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows .
* @ param dynamicQuery the dynamic query
* @ return the matching rows */
@ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } } | return commerceAccountUserRelPersistence . findWithDynamicQuery ( dynamicQuery ) ; |
public class FormCreator { /** * automatically fills the line to the end */
public FormCreator field ( Widget widget ) { } } | return field ( widget , totalWidth - currentlyUsedWidth - ( fFirstItem ? 0 : spacing ) ) ; |
public class JWTPayload { /** * Sets the audience claim that identifies the audience that the JWT is intended for ( should
* either be a { @ code String } or a { @ code List < String > } ) or { @ code null } for none .
* Overriding is only supported for the purpose of calling the super implementation and changing
* the return type , but nothing else . */
public JWTPayload setAudience ( Object audience ) { } } | this . audience = audience ; this . put ( PayloadConstants . AUDIENCE , audience ) ; return this ; |
public class KiteConnect { /** * This method returns array of cellprocessor for parsing mutual funds csv .
* @ return CellProcessor [ ] array */
private CellProcessor [ ] getMfProcessors ( ) { } } | CellProcessor [ ] processors = new CellProcessor [ ] { new org . supercsv . cellprocessor . Optional ( ) , // tradingsymbol
new org . supercsv . cellprocessor . Optional ( ) , // amc
new org . supercsv . cellprocessor . Optional ( ) , // name
new org . supercsv . cellprocessor . Optional ( new ParseBool ( ) ) , // purchase _ allowed
new org . supercsv . cellprocessor . Optional ( new ParseBool ( ) ) , // redemption _ allowed
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // minimum _ purchase _ amount
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // purchase _ amount _ multiplier
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // minimum _ additional _ purchase _ amount
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // minimum _ redemption _ quantity
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // redemption _ quantity _ multiplier
new org . supercsv . cellprocessor . Optional ( ) , // dividend _ type
new org . supercsv . cellprocessor . Optional ( ) , // scheme _ type
new org . supercsv . cellprocessor . Optional ( ) , // plan
new org . supercsv . cellprocessor . Optional ( ) , // settlement _ type
new org . supercsv . cellprocessor . Optional ( new ParseDouble ( ) ) , // last _ price
new org . supercsv . cellprocessor . Optional ( new ParseDate ( "yyyy-MM-dd" ) ) // last _ price _ date
} ; return processors ; |
public class BaseXMLBuilder { /** * Construct an XML Document with a default namespace with the given
* root element .
* @ param name
* the name of the document ' s root element .
* @ param namespaceURI
* default namespace URI for document , ignored if null or empty .
* @ param enableExternalEntities
* enable external entities ; beware of XML External Entity ( XXE ) injection .
* @ param isNamespaceAware
* enable or disable namespace awareness in the underlying
* { @ link DocumentBuilderFactory }
* @ return
* an XML Document .
* @ throws FactoryConfigurationError
* @ throws ParserConfigurationException */
protected static Document createDocumentImpl ( String name , String namespaceURI , boolean enableExternalEntities , boolean isNamespaceAware ) throws ParserConfigurationException , FactoryConfigurationError { } } | DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; factory . setNamespaceAware ( isNamespaceAware ) ; enableOrDisableExternalEntityParsing ( factory , enableExternalEntities ) ; DocumentBuilder builder = factory . newDocumentBuilder ( ) ; Document document = builder . newDocument ( ) ; Element rootElement = null ; if ( namespaceURI != null && namespaceURI . length ( ) > 0 ) { rootElement = document . createElementNS ( namespaceURI , name ) ; } else { rootElement = document . createElement ( name ) ; } document . appendChild ( rootElement ) ; return document ; |
public class UserRepository { /** * Inserts the supplied user record into the user database , assigning it a userid in the
* process , which is returned . */
protected int insertUser ( final User user ) throws UserExistsException , PersistenceException { } } | executeUpdate ( new Operation < Object > ( ) { public Object invoke ( Connection conn , DatabaseLiaison liaison ) throws PersistenceException , SQLException { try { _utable . insert ( conn , user ) ; // update the userid now that it ' s known
user . userId = liaison . lastInsertedId ( conn , null , _utable . getName ( ) , "userId" ) ; // nothing to return
return null ; } catch ( SQLException sqe ) { if ( liaison . isDuplicateRowException ( sqe ) ) { throw new UserExistsException ( "error.user_exists" ) ; } else { throw sqe ; } } } } ) ; return user . userId ; |
public class LOiToByteFunctionBuilder { /** * 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 < T > LOiToByteFunction < T > oiToByteFunctionFrom ( Consumer < LOiToByteFunctionBuilder < T > > buildingFunction ) { } } | LOiToByteFunctionBuilder builder = new LOiToByteFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class Cache { /** * Writes out all modified cached Rows . */
synchronized void saveAll ( ) { } } | Iterator it = new BaseHashIterator ( ) ; int savecount = 0 ; for ( ; it . hasNext ( ) ; ) { CachedObject r = ( CachedObject ) it . next ( ) ; if ( r . hasChanged ( ) ) { rowTable [ savecount ++ ] = r ; } } saveRows ( savecount ) ; Error . printSystemOut ( saveAllTimer . elapsedTimeToMessage ( "Cache.saveRow() total row save time" ) ) ; Error . printSystemOut ( "Cache.saveRow() total row save count = " + saveRowCount ) ; Error . printSystemOut ( makeRowTimer . elapsedTimeToMessage ( "Cache.makeRow() total row load time" ) ) ; Error . printSystemOut ( "Cache.makeRow() total row load count = " + makeRowCount ) ; Error . printSystemOut ( sortTimer . elapsedTimeToMessage ( "Cache.sort() total time" ) ) ; |
public class ApplicationsImpl { /** * Lists all of the applications available in the specified account .
* This operation returns only applications and versions that are available for use on compute nodes ; that is , that can be used in an application package reference . For administrator information about applications and versions that are not yet available to compute nodes , use the Azure portal or the Azure Resource Manager API .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ApplicationSummary & gt ; object */
public Observable < ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > > listNextWithServiceResponseAsync ( final String nextPageLink ) { } } | return listNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > , Observable < ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > > > ( ) { @ Override public Observable < ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > > call ( ServiceResponseWithHeaders < Page < ApplicationSummary > , ApplicationListHeaders > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listNextWithServiceResponseAsync ( nextPageLink , null ) ) ; } } ) ; |
public class ConvertKit { /** * string转outputStream按编码
* @ param string 字符串
* @ param charsetName 编码格式
* @ return 输入流 */
public static OutputStream string2OutputStream ( final String string , final String charsetName ) { } } | if ( string == null || isSpace ( charsetName ) ) return null ; try { return bytes2OutputStream ( string . getBytes ( charsetName ) ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; } |
public class TaskListHeaders { /** * Set the time at which the resource was last modified .
* @ param lastModified the lastModified value to set
* @ return the TaskListHeaders object itself . */
public TaskListHeaders withLastModified ( DateTime lastModified ) { } } | if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ; |
public class AlignedBox3d { /** * Replies the point on the shape that is closest to the given point .
* @ param minx x coordinate of the lower point of the box .
* @ param miny y coordinate of the lower point of the box .
* @ param minz z coordinate of the lower point of the box .
* @ param maxx x coordinate of the upper point of the box .
* @ param maxy y coordinate of the upper point of the box .
* @ param maxz z coordinate of the upper point of the box .
* @ param x x coordinate of the point .
* @ param y y coordinate of the point .
* @ param z z coordinate of the point .
* @ return the closest point on the shape ; or the point itself
* if it is inside the shape . */
@ Pure public static Point3d computeClosestPoint ( double minx , double miny , double minz , double maxx , double maxy , double maxz , double x , double y , double z ) { } } | Point3d closest = new Point3d ( ) ; if ( x < minx ) { closest . setX ( minx ) ; } else if ( x > maxx ) { closest . setX ( maxx ) ; } else { closest . setX ( x ) ; } if ( y < miny ) { closest . setY ( miny ) ; } else if ( y > maxy ) { closest . setY ( maxy ) ; } else { closest . setY ( y ) ; } if ( z < minz ) { closest . setZ ( minz ) ; } else if ( z > maxz ) { closest . setZ ( maxz ) ; } else { closest . setZ ( z ) ; } return closest ; |
public class AggregationDistinctQueryMetaData { /** * Get aggregation distinct column index .
* @ param derivedSumIndex derived sum index
* @ return aggregation distinct column index */
public int getAggregationDistinctColumnIndex ( final int derivedSumIndex ) { } } | for ( Entry < Integer , Integer > entry : aggregationDistinctColumnIndexAndSumColumnIndexes . entrySet ( ) ) { if ( entry . getValue ( ) . equals ( derivedSumIndex ) ) { return entry . getKey ( ) ; } } throw new ShardingException ( "Can not get aggregation distinct column index." ) ; |
public class FadableImageSprite { /** * Puts this sprite on the specified path and fades it out over the specified duration .
* @ param path the path to move along
* @ param pathDuration the duration of the path
* @ param fadePortion the portion of time to spend fading out , from 0.0f ( no time ) to 1.0f
* ( the entire time ) */
public void moveAndFadeOut ( Path path , long pathDuration , float fadePortion ) { } } | move ( path ) ; setAlpha ( 1.0f ) ; _fadeStamp = 0 ; _pathDuration = pathDuration ; _fadeOutDuration = ( long ) ( pathDuration * fadePortion ) ; _fadeDelay = _pathDuration - _fadeOutDuration ; |
public class HppResponse { /** * Base64 decodes the HPP response values .
* @ param charset
* @ return HppResponse
* @ throws UnsupportedEncodingException */
public HppResponse decode ( String charset ) throws UnsupportedEncodingException { } } | if ( null != this . merchantId ) { this . merchantId = new String ( Base64 . decodeBase64 ( this . merchantId . getBytes ( charset ) ) , charset ) ; } if ( null != this . account ) { this . account = new String ( Base64 . decodeBase64 ( this . account . getBytes ( charset ) ) , charset ) ; } if ( null != this . amount ) { this . amount = new String ( Base64 . decodeBase64 ( this . amount . getBytes ( charset ) ) , charset ) ; } if ( null != this . authCode ) { this . authCode = new String ( Base64 . decodeBase64 ( this . authCode . getBytes ( charset ) ) , charset ) ; } if ( null != this . batchId ) { this . batchId = new String ( Base64 . decodeBase64 ( this . batchId . getBytes ( charset ) ) , charset ) ; } if ( null != this . cavv ) { this . cavv = new String ( Base64 . decodeBase64 ( this . cavv . getBytes ( charset ) ) , charset ) ; } if ( null != this . cvnResult ) { this . cvnResult = new String ( Base64 . decodeBase64 ( this . cvnResult . getBytes ( charset ) ) , charset ) ; } if ( null != this . eci ) { this . eci = new String ( Base64 . decodeBase64 ( this . eci . getBytes ( charset ) ) , charset ) ; } if ( null != this . commentOne ) { this . commentOne = new String ( Base64 . decodeBase64 ( this . commentOne . getBytes ( charset ) ) , charset ) ; } if ( null != this . commentTwo ) { this . commentTwo = new String ( Base64 . decodeBase64 ( this . commentTwo . getBytes ( charset ) ) , charset ) ; } if ( null != this . message ) { this . message = new String ( Base64 . decodeBase64 ( this . message . getBytes ( charset ) ) , charset ) ; } if ( null != this . pasRef ) { this . pasRef = new String ( Base64 . decodeBase64 ( this . pasRef . getBytes ( charset ) ) , charset ) ; } if ( null != this . hash ) { this . hash = new String ( Base64 . decodeBase64 ( this . hash . getBytes ( charset ) ) , charset ) ; } if ( null != this . result ) { this . result = new String ( Base64 . decodeBase64 ( this . result . getBytes ( charset ) ) , charset ) ; } if ( null != this . xid ) { this . xid = new String ( Base64 . decodeBase64 ( this . xid . getBytes ( charset ) ) , charset ) ; } if ( null != this . orderId ) { this . orderId = new String ( Base64 . decodeBase64 ( this . orderId . getBytes ( charset ) ) , charset ) ; } if ( null != this . timeStamp ) { this . timeStamp = new String ( Base64 . decodeBase64 ( this . timeStamp . getBytes ( charset ) ) , charset ) ; } if ( null != this . tss ) { Map < String , String > tssMap = new HashMap < String , String > ( ) ; for ( String key : tss . keySet ( ) ) { tssMap . put ( key , new String ( Base64 . decodeBase64 ( tss . get ( key ) . getBytes ( charset ) ) , charset ) ) ; } this . tss = new HashMap < String , String > ( ) ; this . tss = tssMap ; } if ( null != this . supplementaryData ) { Map < String , String > supplementaryDataMap = new HashMap < String , String > ( ) ; for ( String key : supplementaryData . keySet ( ) ) { supplementaryDataMap . put ( key , new String ( Base64 . decodeBase64 ( supplementaryData . get ( key ) . getBytes ( charset ) ) , charset ) ) ; } this . supplementaryData = new HashMap < String , String > ( ) ; this . supplementaryData . putAll ( supplementaryDataMap ) ; } return this ; |
public class ConnectionDialog { /** * This method initializes buttonPanel
* @ return javax . swing . JPanel */
private JPanel getButtonPanel ( ) { } } | if ( buttonPanel == null ) { buttonPanel = new JPanel ( ) ; buttonPanel . setLayout ( new GridBagLayout ( ) ) ; GridBagConstraints c1 = new GridBagConstraints ( ) ; c1 . anchor = GridBagConstraints . EAST ; c1 . gridx = 0 ; c1 . gridy = 0 ; c1 . weightx = 1.0D ; c1 . insets = new Insets ( 5 , 5 , 5 , 5 ) ; buttonPanel . add ( getOkButton ( ) , c1 ) ; GridBagConstraints c2 = new GridBagConstraints ( ) ; c2 . gridx = 1 ; c2 . gridy = 0 ; c2 . weightx = 0.0D ; c2 . insets = new Insets ( 5 , 5 , 5 , 5 ) ; buttonPanel . add ( getCancelButton ( ) , c2 ) ; } return buttonPanel ; |
public class ElementUtil { /** * Creates a { @ link MapMapping } based on the list of input elements .
* Only supports { @ link Type # ATTRIBUTE } elements . */
public static MapMapping createMapMapping ( List < Element > inputElements ) { } } | if ( inputElements == null || inputElements . isEmpty ( ) ) { return null ; } MapMapping result = new MapMapping ( ) ; for ( Element element : inputElements ) { String name = element . getString ( 1 ) ; result . addEntryMapping ( name , createInputMapping ( element . getObject ( 0 ) ) ) ; } return result ; |
public class UpdateProjectRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateProjectRequest updateProjectRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateProjectRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateProjectRequest . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( updateProjectRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( updateProjectRequest . getDefaultJobTimeoutMinutes ( ) , DEFAULTJOBTIMEOUTMINUTES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ManagedPoolDataSource { /** * Closes the session wrapper . The call to close ( ) will in turn result in a call to this pools
* connectionClosed or connectionErrorOccurred method . These methods will remove the PooledConnection
* and SessionConnectionWrapper instances from the connectionsInUse and sessionConnectionWrappers collections ,
* and do any necessary cleanup afterwards . That is why this method only calls sessionWrapper . close ( ) ;
* @ param sessionWrapper The session wrapper to close .
* @ param logText The text to write to the log if the close fails . */
private void closeSessionWrapper ( SessionConnectionWrapper sessionWrapper , String logText ) { } } | try { sessionWrapper . close ( ) ; } catch ( SQLException e ) { // ignore exception . The connection will automatically be removed from the pool .
logInfo ( logText , e ) ; } |
public class Ix { /** * Caches and replays the elements of this sequence for the duration of the given transform function
* without consuming this sequence multiple times .
* The result ' s iterator ( ) doesn ' t support remove ( ) .
* @ param < R > the result value type
* @ param transform the function receiving a view into the cache and returns an Iterable sequence whose
* elements will be emitted by this Ix .
* @ return the new Ix instance
* @ throws NullPointerException if transform is null
* @ since 1.0 */
public final < R > Ix < R > replay ( IxFunction < ? super Ix < T > , ? extends Iterable < ? extends R > > transform ) { } } | return new IxReplaySelector < T , R > ( this , nullCheck ( transform , "transform is null" ) ) ; |
public class DateRangeValueExpression { /** * / * ( non - Javadoc )
* @ see com . github . mkolisnyk . aerial . expressions . ValueExpression # getMatchPattern ( ) */
@ Override public String getMatchPattern ( ) { } } | String dateMatchPattern = "([mMdDnYyhHsS\\-/:]+)" ; return String . format ( "%s%s%s%s;%s%s%s%s, Format: %s%s" , OPEN_RANGE_BRACKET_PATTERN , SPACE_DELIMITER_PATTERN , DATE_PATTERN , SPACE_DELIMITER_PATTERN , SPACE_DELIMITER_PATTERN , DATE_PATTERN , SPACE_DELIMITER_PATTERN , CLOSE_RANGE_BRACKET_PATTERN , SPACE_DELIMITER_PATTERN , dateMatchPattern ) ; |
public class JavaURLContextFactory { /** * Creates a JavaURLContext for resolving java : urls . It should only be
* called by an OSGi JNDI spec implementation . There is no support for
* non - null Name and Context parameters for this method in accordance with
* the OSGi specification for JNDI .
* < UL >
* < LI > If the parameter o is null a new { @ link JavaURLContext } is returned .
* < LI > If o is a URL String then the Object returned is the result of
* looking up the String on a { @ link JavaURLContext } .
* < LI > If o is an array of URL Strings then an { @ link OperationNotSupportedException } is thrown as there is no
* sub - context support in this implementation from which to lookup multiple
* names .
* < LI > If o is any other Object an { @ link OperationNotSupportedException } is
* thrown .
* < / UL >
* @ param o
* { @ inheritDoc }
* @ param n
* must be null ( OSGi JNDI spec )
* @ param c
* must be null ( OSGi JNDI spec )
* @ param envmt
* { @ inheritDoc }
* @ return
* @ throws OperationNotSupportedException
* if the Object passed in is not null or a String . */
@ Override public Object getObjectInstance ( Object o , Name n , Context c , Hashtable < ? , ? > envmt ) throws Exception { } } | // by OSGi JNDI spec Name and Context should be null
// if they are not then this code is being called in
// the wrong way
if ( n != null || c != null ) return null ; // Object is String , String [ ] or null
// Hashtable contains any environment properties
if ( o == null ) { return new JavaURLContext ( envmt , helperServices ) ; } else if ( o instanceof String ) { return new JavaURLContext ( envmt , helperServices ) . lookup ( ( String ) o ) ; } else { throw new OperationNotSupportedException ( ) ; } |
public class WARCInputFormat { /** * Opens a WARC file ( possibly compressed ) for reading , and returns a RecordReader for accessing it . */
@ Override public RecordReader < LongWritable , WARCWritable > getRecordReader ( InputSplit split , JobConf job , Reporter reporter ) throws IOException { } } | reporter . setStatus ( split . toString ( ) ) ; return new WARCReader ( job , ( FileSplit ) split ) ; |
public class StartStopSupport { /** * Begins the startup procedure without an argument by calling { @ link # doStart ( Object ) } , ensuring that
* neither { @ link # doStart ( Object ) } nor { @ link # doStop ( Object ) } is invoked concurrently . When the startup
* fails , { @ link # stop ( ) } will be invoked automatically to roll back the side effect caused by this method
* and any exceptions that occurred during the rollback will be reported to
* { @ link # rollbackFailed ( Throwable ) } . This method is a shortcut of
* { @ code start ( arg , null , failIfStarted ) } .
* @ param arg the argument to pass to { @ link # doStart ( Object ) } ,
* or { @ code null } to pass no argument .
* @ param failIfStarted whether to fail the returned { @ link CompletableFuture } with
* an { @ link IllegalStateException } when the startup procedure is already
* in progress or done */
public final CompletableFuture < V > start ( @ Nullable T arg , boolean failIfStarted ) { } } | return start ( arg , null , failIfStarted ) ; |
public class DirectoryIdProvider { /** * Transfers ownership from the id currently associated with < code > srcDirFilePath < / code > to < code > dstDirFilePath < / code > . Usefule during folder move operations .
* This method has no effect if the content of the source dirFile is not currently cached .
* @ param srcDirFilePath The dirFile that contained the cached id until now .
* @ param dstDirFilePath The dirFile that will contain the id from now on . */
public void move ( Path srcDirFilePath , Path dstDirFilePath ) { } } | String id = ids . getIfPresent ( srcDirFilePath ) ; if ( id != null ) { ids . put ( dstDirFilePath , id ) ; ids . invalidate ( srcDirFilePath ) ; } |
public class GenericInsdcHeaderFormat { /** * Format a feature qualifier using the MAX _ WIDTH ( default 80)
* @ param key
* @ param value
* @ param quote */
private String _write_feature_qualifier ( String key , String value , boolean quote ) { } } | String line = "" ; if ( null == value ) { line = QUALIFIER_INDENT_STR + "/" + key + lineSep ; return line ; } if ( quote ) { // quote should be true for numerics
line = QUALIFIER_INDENT_STR + "/" + key + "=\"" + value + "\"" ; } else { line = QUALIFIER_INDENT_STR + "/" + key + "=" + value ; } if ( line . length ( ) <= MAX_WIDTH ) { return line + lineSep ; } String goodlines = "" ; while ( ! "" . equals ( line . replaceAll ( "^\\s+" , "" ) ) ) { if ( line . length ( ) <= MAX_WIDTH ) { goodlines += line + lineSep ; break ; } // Insert line break . . .
int index ; for ( index = Math . min ( line . length ( ) - 1 , MAX_WIDTH ) ; index > QUALIFIER_INDENT ; index -- ) { if ( ' ' == line . charAt ( index ) ) { break ; } } if ( ' ' != line . charAt ( index ) ) { // no nice place to break . . .
index = MAX_WIDTH ; } assert index <= MAX_WIDTH ; goodlines += line . substring ( 0 , index ) + lineSep ; line = QUALIFIER_INDENT_STR + line . substring ( index ) . replaceAll ( "^\\s+" , "" ) ; } return goodlines ; |
public class CommerceDiscountUserSegmentRelUtil { /** * Returns an ordered range of all the commerce discount user segment rels where commerceDiscountId = & # 63 ; .
* 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 are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceDiscountUserSegmentRelModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param commerceDiscountId the commerce discount ID
* @ param start the lower bound of the range of commerce discount user segment rels
* @ param end the upper bound of the range of commerce discount user segment rels ( not inclusive )
* @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > )
* @ return the ordered range of matching commerce discount user segment rels */
public static List < CommerceDiscountUserSegmentRel > findByCommerceDiscountId ( long commerceDiscountId , int start , int end , OrderByComparator < CommerceDiscountUserSegmentRel > orderByComparator ) { } } | return getPersistence ( ) . findByCommerceDiscountId ( commerceDiscountId , start , end , orderByComparator ) ; |
public class ClassName { /** * Converts from signature to slashed class name
* ( e . g . , from Ljava / lang / String ; to java / lang / String ) .
* Returns null if it is the signature for an array or
* primitive type . */
public static @ CheckForNull @ SlashedClassName String fromFieldSignature ( String signature ) { } } | if ( signature . charAt ( 0 ) != 'L' ) { return null ; } return signature . substring ( 1 , signature . length ( ) - 1 ) ; |
public class ObjectMapperCreator { /** * Extract the parameter ' s type .
* @ param clazz the name of the interface
* @ param parameterizedType the parameterized type
* @ return the extracted type
* @ throws UnableToCompleteException if the type contains zero or more than one parameter */
private JClassType extractParameterizedType ( String clazz , JParameterizedType parameterizedType ) throws UnableToCompleteException { } } | if ( parameterizedType == null ) { logger . log ( TreeLogger . Type . ERROR , "Expected the " + clazz + " declaration to specify a parameterized type." ) ; throw new UnableToCompleteException ( ) ; } JClassType [ ] typeParameters = parameterizedType . getTypeArgs ( ) ; if ( typeParameters == null || typeParameters . length != 1 ) { logger . log ( TreeLogger . Type . ERROR , "Expected the " + clazz + " declaration to specify 1 parameterized type." ) ; throw new UnableToCompleteException ( ) ; } return typeParameters [ 0 ] ; |
public class ReferenceCountingSegment { /** * Returns a { @ link Closeable } which action is to call { @ link # decrement ( ) } only once . If close ( ) is called on the
* returned Closeable object for the second time , it won ' t call { @ link # decrement ( ) } again . */
public Closeable decrementOnceCloseable ( ) { } } | AtomicBoolean decremented = new AtomicBoolean ( false ) ; return ( ) -> { if ( decremented . compareAndSet ( false , true ) ) { decrement ( ) ; } else { log . warn ( "close() is called more than once on ReferenceCountingSegment.decrementOnceCloseable()" ) ; } } ; |
public class SimpleSoundEngine { /** * < editor - fold defaultstate = " collapsed " desc = " SoundEngine " > */
public void init ( ) { } } | if ( ! initiated ) { try { AL . create ( ) ; // init the listener
FloatBuffer listenerOri = BufferUtils . createFloatBuffer ( 6 ) . put ( new float [ ] { 0.0f , 0.0f , - 1.0f , 0.0f , 1.0f , 0.0f } ) ; FloatBuffer listenerVel = BufferUtils . createFloatBuffer ( 3 ) . put ( new float [ ] { 0.0f , 0.0f , 0.0f } ) ; FloatBuffer listenerPos = BufferUtils . createFloatBuffer ( 3 ) . put ( new float [ ] { 0.0f , 0.0f , 0.0f } ) ; listenerPos . flip ( ) ; listenerVel . flip ( ) ; listenerOri . flip ( ) ; AL10 . alListener ( AL10 . AL_POSITION , listenerPos ) ; AL10 . alListener ( AL10 . AL_VELOCITY , listenerVel ) ; AL10 . alListener ( AL10 . AL_ORIENTATION , listenerOri ) ; // init streamer
musicStreamer . init ( ) ; // pregenerate sound sources
int validSources = 0 ; for ( int i = 0 ; i < MAX_SOURCES ; i ++ ) { SoundSourceEntry e = new SoundSourceEntry ( ) ; AL10 . alGenSources ( e . sourceId ) ; if ( AL10 . alGetError ( ) == AL10 . AL_NO_ERROR ) { sources . add ( e ) ; validSources ++ ; } } logger . log ( Level . INFO , "SoundEngine initiated with {0} sources" , validSources ) ; initiated = true ; } catch ( LWJGLException ex ) { logger . log ( Level . WARNING , "Initiating sound engine" , ex ) ; } } |
public class Matrix4d { /** * Set this matrix to a mirror / reflection transformation that reflects about the given plane
* specified via the equation < code > x * a + y * b + z * c + d = 0 < / code > .
* The vector < code > ( a , b , c ) < / code > must be a unit vector .
* Reference : < a href = " https : / / msdn . microsoft . com / en - us / library / windows / desktop / bb281733 ( v = vs . 85 ) . aspx " > msdn . microsoft . com < / a >
* @ param a
* the x factor in the plane equation
* @ param b
* the y factor in the plane equation
* @ param c
* the z factor in the plane equation
* @ param d
* the constant in the plane equation
* @ return this */
public Matrix4d reflection ( double a , double b , double c , double d ) { } } | double da = a + a , db = b + b , dc = c + c , dd = d + d ; m00 = 1.0 - da * a ; m01 = - da * b ; m02 = - da * c ; m03 = 0.0 ; m10 = - db * a ; m11 = 1.0 - db * b ; m12 = - db * c ; m13 = 0.0 ; m20 = - dc * a ; m21 = - dc * b ; m22 = 1.0 - dc * c ; m23 = 0.0 ; m30 = - dd * a ; m31 = - dd * b ; m32 = - dd * c ; m33 = 1.0 ; properties = PROPERTY_AFFINE | PROPERTY_ORTHONORMAL ; return this ; |
public class PersistenceDelegator { /** * Find object based on primary key either form persistence cache or from
* database
* @ param entityClass
* @ param primaryKey
* @ return */
public < E > E findById ( final Class < E > entityClass , final Object primaryKey ) { } } | E e = find ( entityClass , primaryKey ) ; if ( e == null ) { return null ; } // Return a copy of this entity
return ( E ) ( e ) ; |
public class HashMapImpl { /** * Get an item from the cache and make it most recently used .
* @ param key key to lookup the item
* @ return the matching object in the cache */
@ Override public V get ( Object key ) { } } | if ( key == null ) return _nullValue ; int hash = key . hashCode ( ) & _mask ; int count = _size + 1 ; K [ ] keys = _keys ; for ( ; count > 0 ; count -- ) { K mapKey = keys [ hash ] ; if ( mapKey == null ) return null ; if ( key . equals ( _keys [ hash ] ) ) return _values [ hash ] ; hash = ( hash + 1 ) & _mask ; } return null ; |
public class Parser { /** * When there is a need to add a target callback manually use this method . */
public Parser < RECORD > addParseTarget ( final String setterMethodName , final String fieldValue ) throws NoSuchMethodException { } } | addParseTarget ( setterMethodName , ALWAYS , fieldValue ) ; return this ; |
public class DocSchema { /** * Returns the schema for the stores on this annotation class whose name matches the provided
* name . This method returns null if no field matches . */
public StoreSchema getStore ( final String name ) { } } | for ( StoreSchema store : storeSchemas ) if ( store . getName ( ) . equals ( name ) ) return store ; return null ; |
public class ApiOvhDomain { /** * Change password of the DynHost login
* REST : POST / domain / zone / { zoneName } / dynHost / login / { login } / changePassword
* @ param password [ required ] New password of the DynHost login
* @ param zoneName [ required ] The internal name of your zone
* @ param login [ required ] Login */
public void zone_zoneName_dynHost_login_login_changePassword_POST ( String zoneName , String login , String password ) throws IOException { } } | String qPath = "/domain/zone/{zoneName}/dynHost/login/{login}/changePassword" ; StringBuilder sb = path ( qPath , zoneName , login ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "password" , password ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ; |
public class AmazonConnectClient { /** * The < code > GetCurrentMetricData < / code > operation retrieves current metric data from your Amazon Connect instance .
* If you are using an IAM account , it must have permission to the < code > connect : GetCurrentMetricData < / code > action .
* @ param getCurrentMetricDataRequest
* @ return Result of the GetCurrentMetricData operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws InvalidParameterException
* One or more of the parameters provided to the operation are not valid .
* @ throws InternalServiceException
* Request processing failed due to an error or failure with the service .
* @ throws ThrottlingException
* The throttling limit has been exceeded .
* @ throws ResourceNotFoundException
* The specified resource was not found .
* @ sample AmazonConnect . GetCurrentMetricData
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / connect - 2017-08-08 / GetCurrentMetricData " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public GetCurrentMetricDataResult getCurrentMetricData ( GetCurrentMetricDataRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetCurrentMetricData ( request ) ; |
public class ExternalSessionKey { /** * Extract the external key from the server response for a selenium2 new session request .
* The response body is expected to be of the form { " status " : 0 , " sessionId " : " XXXX " , . . . } .
* @ param responseBody the response body to parse
* @ return the extracted ExternalKey , or null if one was not found . */
public static ExternalSessionKey fromJsonResponseBody ( String responseBody ) { } } | try { Map < String , Object > json = new Json ( ) . toType ( responseBody , MAP_TYPE ) ; if ( json . get ( "sessionId" ) instanceof String ) { return new ExternalSessionKey ( ( String ) json . get ( "sessionId" ) ) ; } // W3C response
if ( json . get ( "value" ) instanceof Map ) { Map < ? , ? > value = ( Map < ? , ? > ) json . get ( "value" ) ; if ( value . get ( "sessionId" ) instanceof String ) { return new ExternalSessionKey ( ( String ) value . get ( "sessionId" ) ) ; } } } catch ( JsonException | ClassCastException e ) { return null ; } return null ; |
public class CmsDefaultXmlContentHandler { /** * Initializes the tabs for this content handler . < p >
* @ param root the " tabs " element from the appinfo node of the XML content definition
* @ param contentDefinition the content definition the tabs belong to */
protected void initTabs ( Element root , CmsXmlContentDefinition contentDefinition ) { } } | if ( Boolean . valueOf ( root . attributeValue ( APPINFO_ATTR_USEALL , CmsStringUtil . FALSE ) ) . booleanValue ( ) ) { // all first level elements should be treated as tabs
Iterator < I_CmsXmlSchemaType > i = contentDefinition . getTypeSequence ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { // get the type
I_CmsXmlSchemaType type = i . next ( ) ; m_tabs . add ( new CmsXmlContentTab ( type . getName ( ) ) ) ; } } else { // manual definition of tabs
Iterator < Element > i = CmsXmlGenericWrapper . elementIterator ( root , APPINFO_TAB ) ; while ( i . hasNext ( ) ) { // iterate all " tab " elements in the " tabs " node
Element element = i . next ( ) ; // this is a tab node
String elementName = element . attributeValue ( APPINFO_ATTR_ELEMENT ) ; String collapseValue = element . attributeValue ( APPINFO_ATTR_COLLAPSE , CmsStringUtil . TRUE ) ; Node descriptionNode = element . selectSingleNode ( APPINFO_ATTR_DESCRIPTION + "/text()" ) ; String description = null ; if ( descriptionNode != null ) { description = descriptionNode . getText ( ) ; } else { description = element . attributeValue ( APPINFO_ATTR_DESCRIPTION ) ; } String tabName = element . attributeValue ( APPINFO_ATTR_NAME , elementName ) ; if ( elementName != null ) { // add the element tab
m_tabs . add ( new CmsXmlContentTab ( elementName , Boolean . valueOf ( collapseValue ) . booleanValue ( ) , tabName , description ) ) ; } } // check if first element has been defined as tab
I_CmsXmlSchemaType type = contentDefinition . getTypeSequence ( ) . get ( 0 ) ; CmsXmlContentTab tab = new CmsXmlContentTab ( type . getName ( ) ) ; if ( ! m_tabs . contains ( tab ) ) { m_tabs . add ( 0 , tab ) ; } } |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcThermalLoadTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class VMath { /** * Sets the < code > c < / code > th column of this matrix to the specified column .
* @ param m1 Input matrix
* @ param c the index of the column to be set
* @ param column the value of the column to be set */
public static void setCol ( final double [ ] [ ] m1 , final int c , final double [ ] column ) { } } | assert column . length == m1 . length : ERR_DIMENSIONS ; for ( int i = 0 ; i < m1 . length ; i ++ ) { m1 [ i ] [ c ] = column [ i ] ; } |
public class FutureUtil { /** * This ExceptionHandler rethrows { @ link java . util . concurrent . ExecutionException } s and logs
* { @ link com . hazelcast . core . MemberLeftException } s to the log .
* @ param logger the ILogger instance to be used for logging
* @ param level the log level to be used for logging */
@ PrivateApi public static ExceptionHandler logAllExceptions ( final ILogger logger , final Level level ) { } } | if ( logger . isLoggable ( level ) ) { return new ExceptionHandler ( ) { @ Override public void handleException ( Throwable throwable ) { logger . log ( level , "Exception occurred" , throwable ) ; } } ; } return IGNORE_ALL_EXCEPTIONS ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcTendon ( ) { } } | if ( ifcTendonEClass == null ) { ifcTendonEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 598 ) ; } return ifcTendonEClass ; |
public class StandaloneCommandExecutor { /** * Project operations */
private CompletableFuture < Void > createProject ( CreateProjectCommand c ) { } } | return CompletableFuture . supplyAsync ( ( ) -> { projectManager . create ( c . projectName ( ) , c . timestamp ( ) , c . author ( ) ) ; return null ; } , repositoryWorker ) ; |
public class LoggingHelper { /** * log message using the String . format API
* @ param logger
* the logger that will be used to log the message
* @ param format
* the format string ( the template string )
* @ param params
* the parameters to be formatted into it the string format */
public static void error ( final Logger logger , final String format , final Object ... params ) { } } | error ( logger , format , null , params ) ; |
public class TaggedArgumentParser { /** * Reject attempts to use hybrid Barclay / legacy syntax that contains embedded " = " . Most of the time
* this works because jopt accepts " - O = value " . But if " value " contains what appears to be tagging
* syntax ( ie . , an embedded " : " ) , the tag parser will fail and give misleading error messages . So instead of
* allowing it some cases and having strange failures in others , require users to always use correct
* ( Barclay style ) syntax .
* @ param optionName name of the option being inspected */
private void detectAndRejectHybridSyntax ( final String optionName ) { } } | if ( optionName . contains ( ARGUMENT_KEY_VALUE_SEPARATOR ) ) { throw new CommandLineException ( String . format ( "Can't parse option name containing an embedded '=' (%s)" , optionName ) ) ; } |
public class ManagementLocksInner { /** * Delete a management lock by scope .
* @ param scope The scope for the lock .
* @ param lockName The name of lock .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void deleteByScope ( String scope , String lockName ) { } } | deleteByScopeWithServiceResponseAsync ( scope , lockName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Elements { /** * Returns an iterator over the given array - like . The iterator does < strong > not < / strong > support the
* { @ link Iterator # remove ( ) } operation . */
public static < E > Iterator < E > iterator ( JsArrayLike < E > data ) { } } | return data != null ? new JsArrayLikeIterator < > ( data ) : emptyIterator ( ) ; |
public class SystemHooksApi { /** * Deletes a system hook . This method requires admin access .
* < pre > < code > GitLab Endpoint : DELETE / hooks / : hook _ id < / code > < / pre >
* @ param hookId the ID of the system hook to delete
* @ throws GitLabApiException if any exception occurs */
public void deleteSystemHook ( Integer hookId ) throws GitLabApiException { } } | if ( hookId == null ) { throw new RuntimeException ( "hookId cannot be null" ) ; } Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "hooks" , hookId ) ; |
public class BigtableTableAdminClient { /** * Creates a new table with the specified configuration asynchronously
* < p > Sample code :
* < pre > { @ code
* ApiFuture < Table > tableFuture = client . createTableAsync (
* CreateTableRequest . of ( " my - table " )
* . addFamily ( " cf " , GCRules . GCRULES . maxVersions ( 1 ) )
* ApiFutures . addCallback (
* tableFuture ,
* new ApiFutureCallback < Table > ( ) {
* public void onSuccess ( Table table ) {
* System . out . println ( " Created table : " + table . getTableName ( ) ) ;
* public void onFailure ( Throwable t ) {
* t . printStackTrace ( ) ;
* MoreExecutors . directExecutor ( )
* } < / pre >
* @ see CreateTableRequest for available options . */
@ SuppressWarnings ( "WeakerAccess" ) public ApiFuture < Table > createTableAsync ( CreateTableRequest request ) { } } | return transformToTableResponse ( this . stub . createTableCallable ( ) . futureCall ( request . toProto ( projectId , instanceId ) ) ) ; |
public class Matrix3 { /** * Copies the contents of another matrix .
* @ return a reference to this matrix , for chaining . */
public Matrix3 set ( IMatrix3 other ) { } } | return set ( other . m00 ( ) , other . m10 ( ) , other . m20 ( ) , other . m01 ( ) , other . m11 ( ) , other . m21 ( ) , other . m02 ( ) , other . m12 ( ) , other . m22 ( ) ) ; |
public class CleverTapAPI { /** * Set a collection of unique values as a multi - value user profile property , any existing value will be overwritten .
* Max 100 values , on reaching 100 cap , oldest value ( s ) will be removed .
* Values must be Strings and are limited to 512 characters .
* @ param key String
* @ param values { @ link ArrayList } with String values */
@ SuppressWarnings ( { } } | "unused" , "WeakerAccess" } ) public void setMultiValuesForKey ( final String key , final ArrayList < String > values ) { postAsyncSafely ( "setMultiValuesForKey" , new Runnable ( ) { @ Override public void run ( ) { _handleMultiValues ( values , key , Constants . COMMAND_SET ) ; } } ) ; |
public class WSRdbManagedConnectionImpl { /** * Get the transactionIsolation level */
public final int getTransactionIsolation ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { try { Tr . debug ( this , tc , "The current isolation level from our tracking is: " , currentTransactionIsolation ) ; Tr . debug ( this , tc , "Isolation reported by the JDBC driver: " , sqlConn . getTransactionIsolation ( ) ) ; } catch ( Throwable x ) { // NO FFDC needed
// do nothing as we are taking the isolation level here for debugging reasons only
} } return currentTransactionIsolation ; |
public class AmazonDynamoDBClient { /** * The < code > Scan < / code > operation returns one or more items and item attributes by accessing every item in a table
* or a secondary index . To have DynamoDB return fewer items , you can provide a < code > FilterExpression < / code >
* operation .
* If the total number of scanned items exceeds the maximum data set size limit of 1 MB , the scan stops and results
* are returned to the user as a < code > LastEvaluatedKey < / code > value to continue the scan in a subsequent operation .
* The results also include the number of items exceeding the limit . A scan can result in no table data meeting the
* filter criteria .
* A single < code > Scan < / code > operation will read up to the maximum number of items set ( if using the
* < code > Limit < / code > parameter ) or a maximum of 1 MB of data and then apply any filtering to the results using
* < code > FilterExpression < / code > . If < code > LastEvaluatedKey < / code > is present in the response , you will need to
* paginate the result set . For more information , see < a
* href = " https : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Scan . html # Scan . Pagination " > Paginating the
* Results < / a > in the < i > Amazon DynamoDB Developer Guide < / i > .
* < code > Scan < / code > operations proceed sequentially ; however , for faster performance on a large table or secondary
* index , applications can request a parallel < code > Scan < / code > operation by providing the < code > Segment < / code > and
* < code > TotalSegments < / code > parameters . For more information , see < a
* href = " https : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Scan . html # Scan . ParallelScan " > Parallel
* Scan < / a > in the < i > Amazon DynamoDB Developer Guide < / i > .
* < code > Scan < / code > uses eventually consistent reads when accessing the data in a table ; therefore , the result set
* might not include the changes to data in the table immediately before the operation began . If you need a
* consistent copy of the data , as of the time that the < code > Scan < / code > begins , you can set the
* < code > ConsistentRead < / code > parameter to < code > true < / code > .
* @ param scanRequest
* Represents the input of a < code > Scan < / code > operation .
* @ return Result of the Scan operation returned by the service .
* @ throws ProvisionedThroughputExceededException
* Your request rate is too high . The AWS SDKs for DynamoDB automatically retry requests that receive this
* exception . Your request is eventually successful , unless your retry queue is too large to finish . Reduce
* the frequency of requests and use exponential backoff . For more information , go to < a href =
* " https : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Programming . Errors . html # Programming . Errors . RetryAndBackoff "
* > Error Retries and Exponential Backoff < / a > in the < i > Amazon DynamoDB Developer Guide < / i > .
* @ throws ResourceNotFoundException
* The operation tried to access a nonexistent table or index . The resource might not be specified
* correctly , or its status might not be < code > ACTIVE < / code > .
* @ throws RequestLimitExceededException
* Throughput exceeds the current throughput limit for your account . Please contact AWS Support at < a
* href = " https : / / docs . aws . amazon . com / https : / aws . amazon . com / support " > AWS Support < / a > to request a limit
* increase .
* @ throws InternalServerErrorException
* An error occurred on the server side .
* @ sample AmazonDynamoDB . Scan
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / dynamodb - 2012-08-10 / Scan " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public ScanResult scan ( ScanRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeScan ( request ) ; |
public class AbstractJTACrud { /** * Executes the given runnable in a transaction . If the block throws an exception , the transaction is rolled back .
* This method may not be supported by all persistent technologies , as they are not necessary supporting
* transactions . In that case , this method throw a { @ link java . lang . UnsupportedOperationException } .
* @ param callable the block to execute in a transaction
* @ return A the result
* @ throws HasBeenRollBackException if the transaction has been rollback .
* @ throws java . lang . UnsupportedOperationException if transactions are not supported .
* @ throws org . wisdom . api . model . InitTransactionException if an exception occurred before running the transaction block .
* @ throws RollBackHasCauseAnException if an exception occurred when the transaction is rollback . */
@ Override public < A > A executeTransactionalBlock ( Callable < A > callable ) throws HasBeenRollBackException { } } | return inTransaction ( callable ) ; |
public class DiffBase { /** * Given the location of the ' middle snake ' , split the diff in two parts
* and recurse .
* @ param text1 Old string to be diffed .
* @ param text2 New string to be diffed .
* @ param x Index of split point in text1.
* @ param y Index of split point in text2.
* @ return LinkedList of DiffBase objects . */
private LinkedList < Change > bisectSplit ( String text1 , String text2 , int x , int y ) { } } | String text1a = text1 . substring ( 0 , x ) ; String text2a = text2 . substring ( 0 , y ) ; String text1b = text1 . substring ( x ) ; String text2b = text2 . substring ( y ) ; // Compute both diffs serially .
LinkedList < Change > diffs = main ( text1a , text2a , false ) ; LinkedList < Change > diffsb = main ( text1b , text2b , false ) ; diffs . addAll ( diffsb ) ; return diffs ; |
public class WorkerNetAddress { /** * < code > optional . alluxio . grpc . TieredIdentity tieredIdentity = 6 ; < / code > */
public alluxio . grpc . TieredIdentityOrBuilder getTieredIdentityOrBuilder ( ) { } } | return tieredIdentity_ == null ? alluxio . grpc . TieredIdentity . getDefaultInstance ( ) : tieredIdentity_ ; |
public class Builder { /** * - - document builder */
public static synchronized DocumentBuilder createDocumentBuilder ( ) { } } | DocumentBuilder result ; try { result = FACTORY_NON_VALIDATING . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException e ) { throw new RuntimeException ( "createDocumentBuilder failed" , e ) ; } result . setErrorHandler ( ERROR_HANDLER ) ; return result ; |
public class ActivatedRuleMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ActivatedRule activatedRule , ProtocolMarshaller protocolMarshaller ) { } } | if ( activatedRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( activatedRule . getPriority ( ) , PRIORITY_BINDING ) ; protocolMarshaller . marshall ( activatedRule . getRuleId ( ) , RULEID_BINDING ) ; protocolMarshaller . marshall ( activatedRule . getAction ( ) , ACTION_BINDING ) ; protocolMarshaller . marshall ( activatedRule . getOverrideAction ( ) , OVERRIDEACTION_BINDING ) ; protocolMarshaller . marshall ( activatedRule . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( activatedRule . getExcludedRules ( ) , EXCLUDEDRULES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class TcpServer { /** * Setups a callback called when { @ link io . netty . channel . ServerChannel } is
* unbound .
* @ param doOnUnbind a consumer observing server stop event
* @ return a new { @ link TcpServer } */
public final TcpServer doOnUnbound ( Consumer < ? super DisposableServer > doOnUnbind ) { } } | Objects . requireNonNull ( doOnUnbind , "doOnUnbound" ) ; return new TcpServerDoOn ( this , null , null , doOnUnbind ) ; |
public class RSAUtils { /** * Sign a message with RSA private key , using { @ link # DEFAULT _ SIGNATURE _ ALGORITHM } .
* @ param keyData
* RSA private key data ( value of { @ link RSAPrivateKey # getEncoded ( ) } )
* @ param message
* @ return
* @ throws InvalidKeyException
* @ throws NoSuchAlgorithmException
* @ throws InvalidKeySpecException
* @ throws SignatureException */
public static byte [ ] signMessageWithPrivateKey ( byte [ ] keyData , byte [ ] message ) throws InvalidKeyException , NoSuchAlgorithmException , InvalidKeySpecException , SignatureException { } } | return signMessageWithPrivateKey ( keyData , message , DEFAULT_SIGNATURE_ALGORITHM ) ; |
public class QualifiedElementModel { /** * Adds a modifier to this element . This method ensures that exactly
* one visibility modifier is set . */
@ Requires ( "modifier != null" ) @ Ensures ( "getModifiers().contains(modifier)" ) public void addModifier ( ElementModifier modifier ) { } } | switch ( modifier ) { case PRIVATE : case PACKAGE_PRIVATE : case PROTECTED : case PUBLIC : modifiers . remove ( ElementModifier . PRIVATE ) ; modifiers . remove ( ElementModifier . PACKAGE_PRIVATE ) ; modifiers . remove ( ElementModifier . PROTECTED ) ; modifiers . remove ( ElementModifier . PUBLIC ) ; } modifiers . add ( modifier ) ; |
public class Camera { /** * Check vertical limit on move .
* @ param extrp The extrapolation value .
* @ param vy The vertical movement . */
private void checkVerticalLimit ( double extrp , double vy ) { } } | // Inside interval
if ( mover . getY ( ) >= limitBottom && mover . getY ( ) <= limitTop && limitBottom != Integer . MIN_VALUE && limitTop != Integer . MAX_VALUE ) { offset . moveLocation ( extrp , 0 , vy ) ; // Block offset on its limits
if ( offset . getY ( ) < - intervalVertical ) { offset . teleportY ( - intervalVertical ) ; } else if ( offset . getY ( ) > intervalVertical ) { offset . teleportY ( intervalVertical ) ; } } // Outside interval
if ( ( int ) offset . getY ( ) == - intervalVertical || ( int ) offset . getY ( ) == intervalVertical ) { mover . moveLocationY ( extrp , vy ) ; } applyVerticalLimit ( ) ; |
public class String2PinyinConverter { /** * 将所有音调都转为1
* @ param pinyinList
* @ return */
public static List < Pinyin > makeToneToTheSame ( List < Pinyin > pinyinList ) { } } | ListIterator < Pinyin > listIterator = pinyinList . listIterator ( ) ; while ( listIterator . hasNext ( ) ) { listIterator . set ( convert2Tone5 ( listIterator . next ( ) ) ) ; } return pinyinList ; |
public class GetMasterInfoPResponse { /** * < code > optional . alluxio . grpc . meta . MasterInfo masterInfo = 1 ; < / code > */
public alluxio . grpc . MasterInfoOrBuilder getMasterInfoOrBuilder ( ) { } } | return masterInfo_ == null ? alluxio . grpc . MasterInfo . getDefaultInstance ( ) : masterInfo_ ; |
public class SARLLabelProvider { /** * Replies the text for the given element .
* @ param element the element .
* @ return the text . */
protected StyledString text ( SarlBehaviorUnit element ) { } } | final StyledString text = new StyledString ( "on " , StyledString . DECORATIONS_STYLER ) ; // $ NON - NLS - 1 $
text . append ( getHumanReadableName ( element . getName ( ) ) ) ; if ( element . getGuard ( ) != null ) { String txt = null ; final ICompositeNode node = NodeModelUtils . getNode ( element . getGuard ( ) ) ; if ( node != null ) { txt = node . getText ( ) . trim ( ) ; } if ( Strings . isNullOrEmpty ( txt ) ) { txt = "[" + Messages . SARLLabelProvider_2 + "]" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} else { assert txt != null ; final String dots = "..." ; // $ NON - NLS - 1 $
if ( txt . length ( ) > BEHAVIOR_UNIT_TEXT_LENGTH + dots . length ( ) ) { txt = "[" + txt . substring ( 0 , BEHAVIOR_UNIT_TEXT_LENGTH ) + dots + "]" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} else { txt = "[" + txt + "]" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
} } text . append ( " " ) ; // $ NON - NLS - 1 $
text . append ( txt , StyledString . DECORATIONS_STYLER ) ; } return text ; |
public class SdkContext { /** * Generates the specified number of random resource names with the same prefix .
* @ param prefix the prefix to be used if possible
* @ param maxLen the maximum length for the random generated name
* @ param count the number of names to generate
* @ return random names */
public static String [ ] randomResourceNames ( String prefix , int maxLen , int count ) { } } | String [ ] names = new String [ count ] ; ResourceNamer resourceNamer = SdkContext . getResourceNamerFactory ( ) . createResourceNamer ( "" ) ; for ( int i = 0 ; i < count ; i ++ ) { names [ i ] = resourceNamer . randomName ( prefix , maxLen ) ; } return names ; |
public class GetBucket { /** * Returns some or all ( up to 1,000 ) of the objects in a bucket . You can use the request parameters as selection criteria
* to return a subset of the objects in a bucket . A 200 OK response can contain valid or invalid XML . Make sure to
* design your application to parse the contents of the response and handle it appropriately . To use this implementation
* of the operation , you must have READ access to the bucket .
* Note : This section describe the latest revision of the API . We recommend that you use this revised API , GET Bucket
* ( List Objects ) version 2 , for application development . For backward compatibility , Amazon S3 continues to support
* the prior version of this API , GET Bucket ( List Objects ) version 1 . For more information about the previous version ,
* see GET Bucket ( List Objects ) Version 1 : http : / / docs . aws . amazon . com / AmazonS3 / latest / API / RESTBucketGET . html
* @ param endpoint Optional - Endpoint to which request will be sent .
* Default : " https : / / s3 . amazonaws . com "
* @ param identity ID of the secret access key associated with your Amazon AWS or IAM account .
* Example : " AKIAIOSFODNN7EXAMPLE "
* @ param credential Secret access key associated with your Amazon AWS or IAM account .
* Example : " wJalrXUtnFEMI / K7MDENG / bPxRfiCYEXAMPLEKEY "
* @ param proxyHost Optional - proxy server used to connect to Amazon API . If empty no proxy will be used .
* Default : " "
* @ param proxyPort Optional - proxy server port . You must either specify values for both < proxyHost > and
* < proxyPort > inputs or leave them both empty .
* Default : " "
* @ param proxyUsername Optional - proxy server user name .
* Default : " "
* @ param proxyPassword Optional - proxy server password associated with the < proxyUsername > input value .
* @ param headers Optional - string containing the headers to use for the request separated by new line ( CRLF ) .
* The header name - value pair will be separated by " : "
* Format : Conforming with HTTP standard for headers ( RFC 2616)
* Examples : " Accept : text / plain "
* Default : " "
* @ param queryParams Optional - string containing query parameters that will be appended to the URL . The names
* and the values must not be URL encoded because if they are encoded then a double encoded
* will occur . The separator between name - value pairs is " & " symbol . The query name will be
* separated from query value by " = "
* Examples : " parameterName1 = parameterValue1 & parameterName2 = parameterValue2"
* Default : " "
* @ param version Optional - Version of the web service to made the call against it .
* Example : " 2006-03-01"
* Default : " 2006-03-01"
* @ param bucketName Optional - HTTP Host Header Bucket Specification as it is described in Virtual Hosting of
* Buckets API Guide : http : / / docs . aws . amazon . com / AmazonS3 / latest / dev / VirtualHosting . html
* Default : " "
* @ param continuationToken Optional - When the Amazon S3 response to this API call is truncated ( that is , IsTruncated
* response element value is true ) , the response also includes the NextContinuationToken element ,
* the value of which you can use in the next request as the continuation - token to list the
* next set of objects . The continuation token is an opaque value that Amazon S3 understands .
* Amazon S3 lists objects in UTF - 8 character encoding in lexicographical order .
* Default : " "
* @ param delimiter Optional - Character you use to group keys . If you specify a prefix , all keys that contain
* the same string between the prefix and the first occurrence of the delimiter after the prefix
* are grouped under a single result element called CommonPrefixes . If you don ' t specify the
* prefix parameter , the substring starts at the beginning of the key . The keys that are grouped
* under the CommonPrefixes result element are not returned elsewhere in the response .
* Default : " "
* @ param encodingType Optional - Requests Amazon S3 to encode the response and specifies the encoding method to use .
* An object key can contain any Unicode character . However , XML 1.0 parsers cannot parse some
* characters , such as characters with an ASCII value from 0 to 10 . For characters that are not
* supported in XML 1.0 , you can add this parameter to request that Amazon S3 encode the keys in
* the response .
* Examples : " url "
* Default : " "
* @ param fetchOwner Optional - By default , the API does not return the Owner information in the response .
* If you want the owner information in the response , you can specify this parameter with the
* value set to true .
* Valid values : " false " , " true "
* Default : " false "
* @ param maxKeys Optional - Sets the maximum number of keys returned in the response body . If you want to
* retrieve fewer than the default 1,000 keys , you can add this to your request . The response
* might contain fewer keys , but it will never contain more . If there are additional keys
* that satisfy the search criteria , but these keys were not returned because max - keys was
* exceeded , the response contains < IsTruncated > true < / IsTruncated > . To return the additional
* keys , see NextContinuationToken .
* Examples : " 3"
* Default : " 1000"
* @ param prefix Optional - Limits the response to keys that begin with the specified prefix . You can use
* prefixes to separate a bucket into different groupings of keys . ( You can think of using
* prefix to make groups in the same way you ' d use a folder in a file system . )
* Examples : " E "
* Default : " "
* @ param startAfter Optional - If you want the API to return key names after a specific object key in your
* key space , you can add this parameter . Amazon S3 lists objects in UTF - 8 character encoding
* in lexicographical order . This parameter is valid only in your first request . In case the
* response is truncated , you can specify this parameter along with the continuation - token
* parameter , and then Amazon S3 will ignore this parameter .
* Examples : " ExampleGuide . pdf "
* Default : " "
* @ return A map with strings as keys and strings as values that contains : outcome of the action ( or failure message
* and the exception if there is one ) , returnCode of the operation and the ID of the request */
@ Action ( name = "Get Bucket" , outputs = { } } | @ Output ( RETURN_CODE ) , @ Output ( RETURN_RESULT ) , @ Output ( EXCEPTION ) } , responses = { @ Response ( text = SUCCESS , field = RETURN_CODE , value = ReturnCodes . SUCCESS , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ Response ( text = FAILURE , field = RETURN_CODE , value = ReturnCodes . FAILURE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . ERROR , isOnFail = true ) } ) public Map < String , String > execute ( @ Param ( value = ENDPOINT ) String endpoint , @ Param ( value = IDENTITY , required = true ) String identity , @ Param ( value = CREDENTIAL , required = true , encrypted = true ) String credential , @ Param ( value = PROXY_HOST ) String proxyHost , @ Param ( value = PROXY_PORT ) String proxyPort , @ Param ( value = PROXY_USERNAME ) String proxyUsername , @ Param ( value = PROXY_PASSWORD , encrypted = true ) String proxyPassword , @ Param ( value = HEADERS ) String headers , @ Param ( value = QUERY_PARAMS ) String queryParams , @ Param ( value = VERSION ) String version , @ Param ( value = BUCKET_NAME ) String bucketName , @ Param ( value = CONTINUATION_TOKEN ) String continuationToken , @ Param ( value = DELIMITER ) String delimiter , @ Param ( value = ENCODING_TYPE ) String encodingType , @ Param ( value = FETCH_OWNER ) String fetchOwner , @ Param ( value = MAX_KEYS ) String maxKeys , @ Param ( value = PREFIX ) String prefix , @ Param ( value = START_AFTER ) String startAfter ) { try { version = getDefaultStringInput ( version , STORAGE_DEFAULT_API_VERSION ) ; final CommonInputs commonInputs = new CommonInputs . Builder ( ) . withEndpoint ( endpoint , S3_API , bucketName ) . withIdentity ( identity ) . withCredential ( credential ) . withProxyHost ( proxyHost ) . withProxyPort ( proxyPort ) . withProxyUsername ( proxyUsername ) . withProxyPassword ( proxyPassword ) . withHeaders ( headers ) . withQueryParams ( queryParams ) . withVersion ( version ) . withDelimiter ( delimiter ) . withAction ( GET_BUCKET ) . withApiService ( S3_API ) . withRequestUri ( EMPTY ) . withRequestPayload ( EMPTY ) . withHttpClientMethod ( HTTP_CLIENT_METHOD_GET ) . build ( ) ; final StorageInputs storageInputs = new StorageInputs . Builder ( ) . withBucketName ( bucketName ) . withContinuationToken ( continuationToken ) . withEncodingType ( encodingType ) . withFetchOwner ( fetchOwner ) . withMaxKeys ( maxKeys ) . withPrefix ( prefix ) . withStartAfter ( startAfter ) . build ( ) ; return new QueryApiExecutor ( ) . execute ( commonInputs , storageInputs ) ; } catch ( Exception exception ) { return ExceptionProcessor . getExceptionResult ( exception ) ; } |
public class WebSiteManagementClientImpl { /** * Gets a list of meters for a given location .
* Gets a list of meters for a given location .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; BillingMeterInner & gt ; object */
public Observable < Page < BillingMeterInner > > listBillingMetersAsync ( ) { } } | return listBillingMetersWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < BillingMeterInner > > , Page < BillingMeterInner > > ( ) { @ Override public Page < BillingMeterInner > call ( ServiceResponse < Page < BillingMeterInner > > response ) { return response . body ( ) ; } } ) ; |
public class ChineseCalendar { /** * Return the Chinese new year of the given Gregorian year .
* @ param gyear a Gregorian year
* @ return days after January 1 , 1970 0:00 astronomical base zone of the
* Chinese new year of the given year ( this will be a new moon ) */
private int newYear ( int gyear ) { } } | long cacheValue = newYearCache . get ( gyear ) ; if ( cacheValue == CalendarCache . EMPTY ) { int solsticeBefore = winterSolstice ( gyear - 1 ) ; int solsticeAfter = winterSolstice ( gyear ) ; int newMoon1 = newMoonNear ( solsticeBefore + 1 , true ) ; int newMoon2 = newMoonNear ( newMoon1 + SYNODIC_GAP , true ) ; int newMoon11 = newMoonNear ( solsticeAfter + 1 , false ) ; if ( synodicMonthsBetween ( newMoon1 , newMoon11 ) == 12 && ( hasNoMajorSolarTerm ( newMoon1 ) || hasNoMajorSolarTerm ( newMoon2 ) ) ) { cacheValue = newMoonNear ( newMoon2 + SYNODIC_GAP , true ) ; } else { cacheValue = newMoon2 ; } newYearCache . put ( gyear , cacheValue ) ; } return ( int ) cacheValue ; |
public class FSNamesystem { /** * Register the FSNamesystem MBean using the name
* " hadoop : service = NameNode , name = FSNamesystemState " */
void registerMBean ( Configuration conf ) { } } | // We wrap to bypass standard mbean naming convention .
// This wraping can be removed in java 6 as it is more flexible in
// package naming for mbeans and their impl .
StandardMBean bean ; try { versionBeanName = VersionInfo . registerJMX ( "NameNode" ) ; myFSMetrics = new FSNamesystemMetrics ( conf , this ) ; bean = new StandardMBean ( this , FSNamesystemMBean . class ) ; mbeanName = MBeanUtil . registerMBean ( "NameNode" , "FSNamesystemState" , bean ) ; } catch ( NotCompliantMBeanException e ) { e . printStackTrace ( ) ; } LOG . info ( "Registered FSNamesystemStatusMBean" ) ; |
public class AbstractFormModel { /** * Fires the necessary property change event for changes to the dirty
* property . Must be called whenever the value of dirty is changed . */
protected void dirtyUpdated ( ) { } } | boolean dirty = isDirty ( ) ; if ( hasChanged ( oldDirty , dirty ) ) { oldDirty = dirty ; firePropertyChange ( DIRTY_PROPERTY , ! dirty , dirty ) ; } |
public class StringConvert { /** * Finds a converter searching registered and annotated .
* @ param < T > the type of the converter
* @ param cls the class to find a method for , not null
* @ return the converter , not null
* @ throws RuntimeException if invalid */
@ SuppressWarnings ( "unchecked" ) private < T > TypedStringConverter < T > findAnyConverter ( final Class < T > cls ) { } } | // check factories
for ( StringConverterFactory factory : factories ) { StringConverter < T > factoryConv = ( StringConverter < T > ) factory . findConverter ( cls ) ; if ( factoryConv != null ) { return TypedAdapter . adapt ( cls , factoryConv ) ; } } return null ; |
public class MapboxStaticMap { /** * Build a new { @ link MapboxStaticMap } object with the initial values set for
* { @ link # baseUrl ( ) } , { @ link # user ( ) } , { @ link # attribution ( ) } , { @ link # styleId ( ) } ,
* and { @ link # retina ( ) } .
* @ return a { @ link Builder } object for creating this object
* @ since 3.0.0 */
public static Builder builder ( ) { } } | return new AutoValue_MapboxStaticMap . Builder ( ) . styleId ( StaticMapCriteria . STREET_STYLE ) . baseUrl ( Constants . BASE_API_URL ) . user ( Constants . MAPBOX_USER ) . cameraPoint ( Point . fromLngLat ( 0d , 0d ) ) . cameraAuto ( false ) . attribution ( true ) . width ( 250 ) . logo ( true ) . attribution ( true ) . retina ( true ) . height ( 250 ) . cameraZoom ( 0 ) . cameraPitch ( 0 ) . cameraBearing ( 0 ) . precision ( 0 ) . retina ( false ) ; |
public class FitRuleForInterpreter { /** * { @ inheritDoc } */
@ Override protected void doCell ( Column column , Example cell ) { } } | try { if ( column instanceof ExpectedColumn && ! hasExecuted ) { ( ( ColumnFixture ) fixture . getTarget ( ) ) . execute ( ) ; hasExecuted = true ; } Statistics cellStats = column . doCell ( cell ) ; if ( ! cell . hasSibling ( ) ) ( ( ColumnFixture ) fixture . getTarget ( ) ) . reset ( ) ; stats . tally ( cellStats ) ; } catch ( Exception e ) { cell . annotate ( exception ( e ) ) ; stats . exception ( ) ; } finally { if ( ! cell . hasSibling ( ) ) hasExecuted = false ; } |
public class AbstractGenericController { /** * ( non - Javadoc ) .
* @ param key
* the key
* @ param controller
* the controller
* @ return the object */
@ Override public Object setChild ( final String key , final Controller < M , V > controller ) { } } | if ( null != controller . getParent ( ) ) { // controller . getParent ( ) . re
} return children . put ( key , controller ) ; |
public class ArbitrateCommmunicationClient { /** * 指定对应的Node节点 , 进行event调用
* < pre >
* 注意 : 该方法为异步调用
* < / pre > */
public void call ( Long nid , Event event , final Callback callback ) { } } | delegate . call ( convertToAddress ( nid ) , event , callback ) ; |
public class RedBlackTree { /** * Once a side is found to be deeper , unzip it to the bottom */
private List < Tree < K , V > > unzip ( List < Tree < K , V > > zipper , boolean leftMost ) { } } | Tree < K , V > next = leftMost ? zipper . get ( 0 ) . getLeft ( ) : zipper . get ( 0 ) . getRight ( ) ; if ( next == null ) return zipper ; return unzip ( cons ( next , zipper ) , leftMost ) ; |
public class GlobalSyncRedis { /** * remove cache from memory .
* @ param name */
public static void removeSyncCache ( String name ) { } } | if ( StrKit . isBlank ( name ) ) { return ; } if ( GlobalSyncRedis . caches . containsKey ( name ) ) { GlobalSyncRedis . caches . remove ( name ) ; } |
public class Functions { /** * Takes a string and randomizes which letters in the text are upper or
* lower case
* @ param text
* @ return */
@ Function public static String randomizeLetterCase ( String text ) { } } | StringBuilder result = new StringBuilder ( ) ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { char c = text . charAt ( i ) ; if ( RANDOM . nextBoolean ( ) ) { c = toUpperCase ( c ) ; } else { c = toLowerCase ( c ) ; } result . append ( c ) ; } return result . toString ( ) ; |
public class LogNode { /** * Append a line to the log output , indenting this log entry according to tree structure .
* @ param timeStampStr
* the timestamp string
* @ param indentLevel
* the indent level
* @ param line
* the line to log
* @ param buf
* the buf */
private void appendLine ( final String timeStampStr , final int indentLevel , final String line , final StringBuilder buf ) { } } | buf . append ( timeStampStr ) ; buf . append ( '\t' ) ; buf . append ( ClassGraph . class . getSimpleName ( ) ) ; buf . append ( '\t' ) ; final int numDashes = 2 * ( indentLevel - 1 ) ; for ( int i = 0 ; i < numDashes ; i ++ ) { buf . append ( '-' ) ; } if ( numDashes > 0 ) { buf . append ( ' ' ) ; } buf . append ( line ) ; buf . append ( '\n' ) ; |
public class IResponseImpl { /** * Convert the transport cookie to a J2EE cookie .
* @ param cookie
* @ return Cookie */
private Cookie convertHttpCookie ( HttpCookie cookie ) { } } | Cookie rc = new Cookie ( cookie . getName ( ) , cookie . getValue ( ) ) ; rc . setVersion ( cookie . getVersion ( ) ) ; if ( null != cookie . getPath ( ) ) { rc . setPath ( cookie . getPath ( ) ) ; } if ( null != cookie . getDomain ( ) ) { rc . setDomain ( cookie . getDomain ( ) ) ; } rc . setMaxAge ( cookie . getMaxAge ( ) ) ; rc . setSecure ( cookie . isSecure ( ) ) ; return rc ; |
public class AndroidUtil { /** * Compute the minimum cache size for a view , using the size of the map view .
* For the view size we use the frame buffer calculated dimension .
* @ param tileSize the tile size
* @ param overdrawFactor the overdraw factor applied to the mapview
* @ param width the width of the map view
* @ param height the height of the map view
* @ return the minimum cache size for the view */
public static int getMinimumCacheSize ( int tileSize , double overdrawFactor , int width , int height ) { } } | // height * overdrawFactor / tileSize calculates the number of tiles that would cover
// the view port , adding 1 is required since we can have part tiles on either side ,
// adding 2 adds another row / column as spare and ensures that we will generally have
// a larger number of tiles in the cache than a TileLayer will render for a view .
// For any size we need a minimum of 4 ( as the intersection of 4 tiles can always be in the
// middle of a view .
Dimension dimension = FrameBufferController . calculateFrameBufferDimension ( new Dimension ( width , height ) , overdrawFactor ) ; return Math . max ( 4 , ( 2 + ( dimension . height / tileSize ) ) * ( 2 + ( dimension . width / tileSize ) ) ) ; |
public class QueuedKeyedResourcePool { /** * Create a new queued pool with key type K , request type R , and value type
* @ param factory The factory that creates objects
* @ param config The pool config
* @ return The created pool */
public static < K , V > QueuedKeyedResourcePool < K , V > create ( ResourceFactory < K , V > factory , ResourcePoolConfig config ) { } } | return new QueuedKeyedResourcePool < K , V > ( factory , config ) ; |
public class UkaseController { /** * = = = = = Renderer API controllers = = = = = */
@ RequestMapping ( value = "/html" , method = RequestMethod . POST ) public ResponseEntity < String > generateHtml ( @ RequestBody @ Valid UkasePayload payload ) { } } | String result = htmlRenderer . render ( payload ) ; return ResponseEntity . ok ( result ) ; |
public class Cipher { /** * Wrap a key .
* @ param key the key to be wrapped .
* @ return the wrapped key .
* @ exception IllegalStateException if this cipher is in a wrong
* state ( e . g . , has not been initialized ) .
* @ exception IllegalBlockSizeException if this cipher is a block
* cipher , no padding has been requested , and the length of the
* encoding of the key to be wrapped is not a
* multiple of the block size .
* @ exception InvalidKeyException if it is impossible or unsafe to
* wrap the key with this cipher ( e . g . , a hardware protected key is
* being passed to a software - only cipher ) . */
public final byte [ ] wrap ( Key key ) throws IllegalBlockSizeException , InvalidKeyException { } } | if ( ! ( this instanceof NullCipher ) ) { if ( ! initialized ) { throw new IllegalStateException ( "Cipher not initialized" ) ; } if ( opmode != Cipher . WRAP_MODE ) { throw new IllegalStateException ( "Cipher not initialized " + "for wrapping keys" ) ; } } updateProviderIfNeeded ( ) ; return spi . engineWrap ( key ) ; |
public class SamplingRatiosImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . SAMPLING_RATIOS__RG : getRg ( ) . clear ( ) ; getRg ( ) . addAll ( ( Collection < ? extends SamplingRatiosRG > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcWorkControlTypeEnum createIfcWorkControlTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcWorkControlTypeEnum result = IfcWorkControlTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class ExtensionScript { /** * Gets the numbers of scripts for the given directory for the currently registered script engines and types .
* @ param dir the directory to check .
* @ return the number of scripts .
* @ since 2.4.1 */
public int getScriptCount ( File dir ) { } } | int scripts = 0 ; for ( ScriptType type : this . getScriptTypes ( ) ) { File locDir = new File ( dir , type . getName ( ) ) ; if ( locDir . exists ( ) ) { for ( File f : locDir . listFiles ( ) ) { String ext = f . getName ( ) . substring ( f . getName ( ) . lastIndexOf ( "." ) + 1 ) ; String engineName = this . getEngineNameForExtension ( ext ) ; if ( engineName != null ) { scripts ++ ; } } } } return scripts ; |
public class Configuration { /** * Checks whether there is an entry for the given config option .
* @ param configOption The configuration option
* @ return < tt > true < / tt > if a valid ( current or deprecated ) key of the config option is stored ,
* < tt > false < / tt > otherwise */
@ PublicEvolving public boolean contains ( ConfigOption < ? > configOption ) { } } | synchronized ( this . confData ) { // first try the current key
if ( this . confData . containsKey ( configOption . key ( ) ) ) { return true ; } else if ( configOption . hasFallbackKeys ( ) ) { // try the fallback keys
for ( FallbackKey fallbackKey : configOption . fallbackKeys ( ) ) { if ( this . confData . containsKey ( fallbackKey . getKey ( ) ) ) { loggingFallback ( fallbackKey , configOption ) ; return true ; } } } return false ; } |
public class BaseMessageManager { /** * Remove all the filters that have this as a listener .
* @ param listener Filters with this listener will be removed . */
public void freeFiltersWithListener ( JMessageListener listener ) { } } | if ( m_messageMap != null ) { for ( BaseMessageQueue messageQueue : m_messageMap . values ( ) ) { if ( messageQueue != null ) messageQueue . freeFiltersWithListener ( listener ) ; } } |
public class CsvSink { /** * Gets the directory where the CSV files are created .
* @ return the polling directory set by properties . If it is not set , a default value / tmp / is
* returned . */
private String getPollDir ( ) { } } | String pollDir = mProperties . getProperty ( CSV_KEY_DIR ) ; return pollDir != null ? pollDir : CSV_DEFAULT_DIR ; |
public class ConcurrentHeapQuickSelectSketch { /** * Advances the epoch while there is no background propagation
* This ensures a propagation invoked before the reset cannot affect the sketch after the reset
* is completed . */
@ SuppressFBWarnings ( value = "VO_VOLATILE_INCREMENT" , justification = "False Positive" ) private void advanceEpoch ( ) { } } | awaitBgPropagationTermination ( ) ; startEagerPropagation ( ) ; ConcurrentPropagationService . resetExecutorService ( Thread . currentThread ( ) . getId ( ) ) ; // noinspection NonAtomicOperationOnVolatileField
// this increment of a volatile field is done within the scope of the propagation
// synchronization and hence is done by a single thread
// Ignore a FindBugs warning
epoch_ ++ ; endPropagation ( null , true ) ; initBgPropagationService ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.