signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class XMLParser { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . xml . XmlPullParser # getColumnNumber ( ) */
@ Override public int getColumnNumber ( ) { } } | int result = bufferStartColumn ; for ( int i = 0 ; i < position ; i ++ ) { if ( buffer [ i ] == '\n' ) { result = 0 ; } else { result ++ ; } } return result + 1 ; // the first column is ' 1' |
public class ParquetDataWriterBuilder { /** * Build a { @ link ParquetWriter < Group > } for given file path with a block size .
* @ param blockSize
* @ param stagingFile
* @ return
* @ throws IOException */
public ParquetWriter < Group > getWriter ( int blockSize , Path stagingFile ) throws IOException { } } | State state = this . destination . getProperties ( ) ; int pageSize = state . getPropAsInt ( getProperty ( WRITER_PARQUET_PAGE_SIZE ) , DEFAULT_PAGE_SIZE ) ; int dictPageSize = state . getPropAsInt ( getProperty ( WRITER_PARQUET_DICTIONARY_PAGE_SIZE ) , DEFAULT_BLOCK_SIZE ) ; boolean enableDictionary = state . getPropAsBoolean ( getProperty ( WRITER_PARQUET_DICTIONARY ) , DEFAULT_IS_DICTIONARY_ENABLED ) ; boolean validate = state . getPropAsBoolean ( getProperty ( WRITER_PARQUET_VALIDATE ) , DEFAULT_IS_VALIDATING_ENABLED ) ; String rootURI = state . getProp ( WRITER_FILE_SYSTEM_URI , LOCAL_FS_URI ) ; Path absoluteStagingFile = new Path ( rootURI , stagingFile ) ; CompressionCodecName codec = getCodecFromConfig ( ) ; GroupWriteSupport support = new GroupWriteSupport ( ) ; Configuration conf = new Configuration ( ) ; GroupWriteSupport . setSchema ( this . schema , conf ) ; ParquetProperties . WriterVersion writerVersion = getWriterVersion ( ) ; return new ParquetWriter < > ( absoluteStagingFile , support , codec , blockSize , pageSize , dictPageSize , enableDictionary , validate , writerVersion , conf ) ; |
public class SleepBuilder { /** * Interval is used by { @ code SleepBuilder } to sleep between invocations of
* breaking condition .
* @ param interval used to sleep between invocations of statement
* @ param timeUnit of passed interval
* @ return { @ code SleepBuilder } with comparer */
public SleepBuilder < T > withInterval ( long interval , TimeUnit timeUnit ) { } } | this . interval = timeUnit . toMillis ( interval ) ; return this ; |
public class CommerceRegionPersistenceImpl { /** * Removes the commerce region where commerceCountryId = & # 63 ; and code = & # 63 ; from the database .
* @ param commerceCountryId the commerce country ID
* @ param code the code
* @ return the commerce region that was removed */
@ Override public CommerceRegion removeByC_C ( long commerceCountryId , String code ) throws NoSuchRegionException { } } | CommerceRegion commerceRegion = findByC_C ( commerceCountryId , code ) ; return remove ( commerceRegion ) ; |
public class CmsGalleryController { /** * Sets the locale to the search object . < p >
* @ param locale the locale to set */
public void addLocale ( String locale ) { } } | m_searchObject . setLocale ( locale ) ; m_searchObjectChanged = true ; ValueChangeEvent . fire ( this , m_searchObject ) ; |
public class GetAllContent { /** * Runs the example .
* @ param adManagerServices the services factory .
* @ param session the session .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session ) throws RemoteException { } } | // Get the ContentService .
ContentServiceInterface contentService = adManagerServices . get ( session , ContentServiceInterface . class ) ; // Create a statement to get all content .
StatementBuilder statementBuilder = new StatementBuilder ( ) . orderBy ( "id ASC" ) . limit ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; // Default for total result set size .
int totalResultSetSize = 0 ; do { // Get content by statement .
ContentPage page = contentService . getContentByStatement ( statementBuilder . toStatement ( ) ) ; if ( page . getResults ( ) != null ) { totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( Content content : page . getResults ( ) ) { System . out . printf ( "%d) Content with ID %d and name '%s' was found.%n" , i ++ , content . getId ( ) , content . getName ( ) ) ; } } statementBuilder . increaseOffsetBy ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; } while ( statementBuilder . getOffset ( ) < totalResultSetSize ) ; System . out . printf ( "Number of results found: %d%n" , totalResultSetSize ) ; |
public class Messenger { /** * Finding peers by type
* @ param type type of peer
* @ return found peers */
@ ObjectiveCName ( "findPeersWithType:" ) public Command < List < PeerSearchEntity > > findPeers ( PeerSearchType type ) { } } | return callback -> modules . getSearchModule ( ) . findPeers ( type ) . then ( v -> callback . onResult ( v ) ) . failure ( e -> callback . onError ( e ) ) ; |
public class DbPersistenceManager { /** * { @ inheritDoc } */
public synchronized List < NodeId > getAllNodeIds ( NodeId bigger , int maxCount ) throws ItemStateException , RepositoryException { } } | ResultSet rs = null ; try { String sql = bundleSelectAllIdsSQL ; NodeId lowId = null ; Object [ ] keys = new Object [ 0 ] ; if ( bigger != null ) { sql = bundleSelectAllIdsFromSQL ; lowId = bigger ; keys = getKey ( bigger ) ; } if ( getStorageModel ( ) == SM_LONGLONG_KEYS && maxCount > 0 ) { // get some more rows , in case the first row is smaller
// only required for SM _ LONGLONG _ KEYS
// probability is very low to get get the wrong first key , < 1 : 2 ^ 64
// see also bundleSelectAllIdsFrom SQL statement
maxCount += 10 ; } rs = conHelper . exec ( sql , keys , false , maxCount ) ; ArrayList < NodeId > result = new ArrayList < NodeId > ( ) ; while ( ( maxCount == 0 || result . size ( ) < maxCount ) && rs . next ( ) ) { NodeId current ; if ( getStorageModel ( ) == SM_BINARY_KEYS ) { current = new NodeId ( rs . getBytes ( 1 ) ) ; } else { long high = rs . getLong ( 1 ) ; long low = rs . getLong ( 2 ) ; current = new NodeId ( high , low ) ; if ( lowId != null ) { // skip the keys that are smaller or equal ( see above , maxCount + = 10)
// only required for SM _ LONGLONG _ KEYS
if ( current . compareTo ( lowId ) <= 0 ) { continue ; } } } result . add ( current ) ; } return result ; } catch ( SQLException e ) { String msg = "getAllNodeIds failed." ; log . error ( msg , e ) ; throw new ItemStateException ( msg , e ) ; } finally { DbUtility . close ( rs ) ; } |
public class ModelFactory { /** * Create a simple equity hybrid LIBOR market model with a calibration of the equity processes
* to a given Black - Scholes implied volatility .
* @ param baseModel LIBOR model providing the stochastic numeraire .
* @ param brownianMotion { @ link BrownianMotionInterface } for the asset process .
* @ param initialValues Initial value of the asset process .
* @ param riskFreeRate Not used ( internally used to generate paths , will be later adjusted )
* @ param correlations Correlation of the asset processes .
* @ param maturities Maturities of the options ( one for each asset process ) .
* @ param strikes Strikes of the options ( one for each asset process ) .
* @ param volatilities Implied volatilities of the options ( one for each asset process ) .
* @ param discountCurve Discount curve used for the final hybrid model ( not used in calibration ) .
* @ return An object implementing { @ link HybridAssetLIBORModelMonteCarloSimulationInterface } , where each asset process is calibrated to a given option .
* @ throws CalculationException Thrown if calibration fails . */
public HybridAssetLIBORModelMonteCarloSimulationInterface getHybridAssetLIBORModel ( final LIBORModelMonteCarloSimulationInterface baseModel , final BrownianMotionInterface brownianMotion , final double [ ] initialValues , final double riskFreeRate , final double [ ] [ ] correlations , final double [ ] maturities , final double [ ] strikes , final double [ ] volatilities , final DiscountCurveInterface discountCurve ) throws CalculationException { } } | OptimizerInterface optimizer = new LevenbergMarquardt ( volatilities /* initialParameters */
, volatilities /* targetValues */
, 100 /* maxIteration */
, 1 /* numberOfThreads */
) { private static final long serialVersionUID = - 9199565564991442848L ; @ Override public void setValues ( double [ ] parameters , double [ ] values ) throws SolverException { AssetModelMonteCarloSimulationInterface model = new MonteCarloMultiAssetBlackScholesModel ( brownianMotion , initialValues , riskFreeRate , parameters , correlations ) ; HybridAssetLIBORModelMonteCarloSimulation hybridModel = new HybridAssetLIBORModelMonteCarloSimulation ( baseModel , model ) ; try { for ( int assetIndex = 0 ; assetIndex < values . length ; assetIndex ++ ) { double df = hybridModel . getNumeraire ( maturities [ assetIndex ] ) . invert ( ) . getAverage ( ) ; double spot = hybridModel . getAssetValue ( 0.0 , assetIndex ) . getAverage ( ) ; EuropeanOption option = new EuropeanOption ( maturities [ assetIndex ] , strikes [ assetIndex ] , assetIndex ) ; double valueOptoin = option . getValue ( hybridModel ) ; double impliedVol = AnalyticFormulas . blackScholesOptionImpliedVolatility ( spot / df , maturities [ assetIndex ] /* optionMaturity */
, strikes [ assetIndex ] /* optionStrike */
, df /* payoffUnit */
, valueOptoin ) ; values [ assetIndex ] = impliedVol ; } } catch ( CalculationException e ) { throw new SolverException ( e ) ; } } } ; try { optimizer . run ( ) ; } catch ( SolverException e ) { if ( e . getCause ( ) instanceof CalculationException ) { throw ( CalculationException ) e . getCause ( ) ; } else { throw new CalculationException ( e ) ; } } AssetModelMonteCarloSimulationInterface model = new MonteCarloMultiAssetBlackScholesModel ( brownianMotion , initialValues , riskFreeRate , optimizer . getBestFitParameters ( ) , correlations ) ; /* * Test calibration */
HybridAssetLIBORModelMonteCarloSimulation hybridModelWithoutDiscountAdjustment = new HybridAssetLIBORModelMonteCarloSimulation ( baseModel , model , null ) ; for ( int assetIndex = 0 ; assetIndex < volatilities . length ; assetIndex ++ ) { double df = hybridModelWithoutDiscountAdjustment . getNumeraire ( maturities [ assetIndex ] ) . invert ( ) . getAverage ( ) ; double spot = hybridModelWithoutDiscountAdjustment . getAssetValue ( 0.0 , assetIndex ) . getAverage ( ) ; EuropeanOption option = new EuropeanOption ( maturities [ assetIndex ] , strikes [ assetIndex ] , assetIndex ) ; double valueOptoin = option . getValue ( hybridModelWithoutDiscountAdjustment ) ; double impliedVol = AnalyticFormulas . blackScholesOptionImpliedVolatility ( spot / df , maturities [ assetIndex ] /* optionMaturity */
, strikes [ assetIndex ] /* optionStrike */
, df /* payoffUnit */
, valueOptoin ) ; if ( Math . abs ( impliedVol - volatilities [ assetIndex ] ) > 0.01 ) { throw new CalculationException ( "Calibration failed" ) ; } } /* * Construct model with discounting ( options will then use the discounting spread adjustment ) . */
HybridAssetLIBORModelMonteCarloSimulation hybridModel = new HybridAssetLIBORModelMonteCarloSimulation ( baseModel , model , discountCurve ) ; return hybridModel ; |
public class PippoUtils { /** * Simply reads a property resource file that contains the version of this
* Pippo build . Helps to identify the Pippo version currently running .
* @ return The version of Pippo . Eg . " 1.6 - SNAPSHOT " while developing of " 1.6 " when released . */
public static String getPippoVersion ( ) { } } | // and the key inside the properties file .
String pippoVersionPropertyKey = "pippo.version" ; String pippoVersion ; try { Properties prop = new Properties ( ) ; URL url = ClasspathUtils . locateOnClasspath ( PippoConstants . LOCATION_OF_PIPPO_BUILTIN_PROPERTIES ) ; InputStream stream = url . openStream ( ) ; prop . load ( stream ) ; pippoVersion = prop . getProperty ( pippoVersionPropertyKey ) ; } catch ( Exception e ) { // this should not happen . Never .
throw new PippoRuntimeException ( "Something is wrong with your build. Cannot find resource {}" , PippoConstants . LOCATION_OF_PIPPO_BUILTIN_PROPERTIES ) ; } return pippoVersion ; |
public class FieldListener { /** * Set this cloned listener to the same state at this listener .
* @ param field The field this new listener will be added to .
* @ param The new listener to sync to this .
* @ param Has the init method been called ?
* @ return True if I called init . */
public boolean syncClonedListener ( BaseField field , FieldListener listener , boolean bInitCalled ) { } } | if ( ! bInitCalled ) listener . init ( null ) ; listener . setRespondsToMode ( DBConstants . INIT_MOVE , m_bInitMove ) ; listener . setRespondsToMode ( DBConstants . READ_MOVE , m_bReadMove ) ; listener . setRespondsToMode ( DBConstants . SCREEN_MOVE , m_bScreenMove ) ; return true ; |
public class Sorting { /** * Quicksort - style partitioning , using the Hoare partition scheme as coded by
* Sedgewick at https : / / algs4 . cs . princeton . edu / 23quicksort / Quick . java . html .
* Use the " median of three " method to determine which index to pivot on , and then
* separate the array into two halves based on the pivot . */
private static int partition ( Object [ ] a , int start , int end , Comparator < Object > cmp ) { } } | final int p = median ( a , start , end , cmp ) ; final Object pivot = a [ p ] ; a [ p ] = a [ start ] ; a [ start ] = pivot ; int i = start ; int j = end + 1 ; while ( true ) { while ( cmp . compare ( a [ ++ i ] , pivot ) < 0 ) { if ( i == end ) { break ; } } while ( cmp . compare ( a [ -- j ] , pivot ) >= 0 ) { if ( j == start ) { break ; } } if ( i >= j ) { break ; } swap ( a , i , j ) ; } swap ( a , start , j ) ; return j ; |
public class FieldTable { /** * Returns the record at this absolute row position .
* Be careful , if a record at a row is deleted , this method will return a new
* ( empty ) record , so you need to check the record status before updating it .
* @ param iRelPosition Absolute position of the record to retrieve .
* @ return The record at this location ( or an Integer with the record status or null if not found ) .
* @ exception DBException File exception . */
public Object get ( int iRowIndex ) throws DBException { } } | if ( ! m_bIsOpen ) this . open ( ) ; this . getRecord ( ) . setEditMode ( Constants . EDIT_NONE ) ; Object objData = this . doGet ( iRowIndex ) ; if ( objData instanceof Integer ) { int iRecordStatus = ( ( Integer ) objData ) . intValue ( ) ; if ( iRecordStatus == DELETED_RECORD . intValue ( ) ) // DBConstants . RECORD _ NEW
{ // Probably a deleted record ( just return a blank record ) .
this . addNew ( ) ; this . getRecord ( ) . setEditMode ( Constants . EDIT_NONE ) ; // Invalid record
return m_record ; } else if ( iRecordStatus == EOF_RECORD . intValue ( ) ) // DBConstants . RECORD _ NEW
{ return null ; // EOF
} } else if ( objData != null ) { this . setDataSource ( objData ) ; // m _ tableRemote . dataToFields ( ) ;
this . dataToFields ( this . getRecord ( ) ) ; // Usually you would setDataSource ( null ) , but the datasource is required for remove , etc .
this . getRecord ( ) . setEditMode ( Constants . EDIT_CURRENT ) ; return m_record ; } return null ; // EOF |
public class UserIndexer { /** * Entry point for Byteman tests . See directory tests / resilience .
* The parameter " logins " is used only by the Byteman script . */
private void postCommit ( DbSession dbSession , Collection < String > logins , Collection < EsQueueDto > items ) { } } | index ( dbSession , items ) ; |
public class SRTServletRequest { /** * Returns the session as an HttpSession . This does all of the " magic "
* to create the session if it doesn ' t already exist . */
public HttpSession getSession ( boolean create ) { } } | // 321485
if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "getSession" , "create " + String . valueOf ( create ) + ", this -> " + this ) ; } if ( WCCustomProperties . CHECK_REQUEST_OBJECT_IN_USE ) { checkRequestObjectInUse ( ) ; } // return _ connContext . getSessionAPISupport ( ) . getSession ( create ) ;
return _requestContext . getSession ( create , ( ( WebAppDispatcherContext ) this . getDispatchContext ( ) ) . getWebApp ( ) ) ; |
public class AbstractXmlProcessor { /** * Returns the object value for the given VTD XML node and field name
* @ param node
* the node
* @ param fieldName
* the field name
* @ return the object value for the given VTD XML node and field name */
private Object getObjectValue ( XmlNode node , String fieldName ) { } } | // we have to take into account the fact that fieldName will be in the lower case
if ( node != null ) { String name = node . getName ( ) ; switch ( node . getType ( ) ) { case XmlNode . ATTRIBUTE_NODE : return name . equalsIgnoreCase ( fieldName ) ? node : null ; case XmlNode . ELEMENT_NODE : { if ( name . equalsIgnoreCase ( fieldName ) ) { return new XmlNodeArray ( node . getChildren ( ) ) ; } else { Map < String , XmlNode > attributes = node . getAttributes ( ) ; for ( Map . Entry < String , XmlNode > entry : attributes . entrySet ( ) ) { String attributeName = entry . getKey ( ) ; if ( attributeName . equalsIgnoreCase ( fieldName ) ) { return entry . getValue ( ) ; } } return null ; } } default : return null ; } } return null ; |
public class ParaClient { /** * Returns only the permissions for a given subject ( user ) of the current app .
* @ param subjectid the subject id ( user id )
* @ return a map of subject ids to resource names to a list of allowed methods */
public Map < String , Map < String , List < String > > > resourcePermissions ( String subjectid ) { } } | return getEntity ( invokeGet ( Utils . formatMessage ( "_permissions/{0}" , subjectid ) , null ) , Map . class ) ; |
public class BeanUtil { /** * Returns setter method for < code > property < / code > in specified < code > beanClass < / code >
* @ param beanClass bean class
* @ param property name of the property
* @ return setter method . null if < code > property < / code > is not found , or it is readonly property
* @ see # getSetterMethod ( Class , String , Class ) */
public static Method getSetterMethod ( Class < ? > beanClass , String property ) { } } | Method getter = getGetterMethod ( beanClass , property ) ; if ( getter == null ) return null ; else return getSetterMethod ( beanClass , property , getter . getReturnType ( ) ) ; |
public class DeleteModelPackageRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteModelPackageRequest deleteModelPackageRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteModelPackageRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteModelPackageRequest . getModelPackageName ( ) , MODELPACKAGENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ResourceCache { /** * Adds resource to cache .
* @ param identifier resource identifier
* @ param resource resource
* @ throws IllegalStateException in case < code > init ( ) < / code > was not called */
public void cache ( String identifier , Object resource ) { } } | verifyState ( ) ; if ( ! cacheLocked . get ( ) ) { resourceCache . get ( ) . put ( identifier , resource ) ; } |
public class FrameworkSerializer { /** * Can be overridden to avoid boxing a float where appropriate */
public void serializePrimitive ( S rec , String fieldName , float value ) { } } | serializePrimitive ( rec , fieldName , Float . valueOf ( value ) ) ; |
public class Measure { /** * Measure the invokation time of the given Callable . */
public < V > V call ( Callable < V > callable ) throws Exception { } } | initStartTotal ( ) ; long startInvokation = System . currentTimeMillis ( ) ; V result = callable . call ( ) ; invoked ( System . currentTimeMillis ( ) - startInvokation ) ; return result ; |
public class RangeSet { /** * Converts a possibly overlapping collection of RangesSet ' s into a non overlapping
* RangeSet that accepts the same characters .
* @ param rangeSets
* @ return */
public static RangeSet split ( Collection < RangeSet > rangeSets ) { } } | RangeSet result = new RangeSet ( ) ; SortedSet < Integer > ss = new TreeSet < Integer > ( ) ; for ( RangeSet rs : rangeSets ) { for ( CharRange r : rs ) { ss . add ( r . getFrom ( ) ) ; ss . add ( r . getTo ( ) ) ; } } Iterator < Integer > i = ss . iterator ( ) ; if ( i . hasNext ( ) ) { int from = i . next ( ) ; while ( i . hasNext ( ) ) { int to = i . next ( ) ; if ( from != to ) { for ( RangeSet rs : rangeSets ) { if ( rs . contains ( from , to ) ) { result . add ( from , to ) ; break ; } } } from = to ; } } return result ; |
public class Trace { /** * Factory method used to create a Trace instance from a String . The format of the input string
* have to be something like : " 02-07 17:45:33.014 D / Any debug trace "
* @ param logcatTrace the logcat string
* @ return a new Trace instance
* @ throws IllegalTraceException if the string argument is an invalid string */
public static Trace fromString ( String logcatTrace ) throws IllegalTraceException { } } | if ( logcatTrace == null || logcatTrace . length ( ) < MIN_TRACE_SIZE || logcatTrace . charAt ( 20 ) != TRACE_LEVEL_SEPARATOR ) { throw new IllegalTraceException ( "You are trying to create a Trace object from a invalid String. Your trace have to be " + "something like: '02-07 17:45:33.014 D/Any debug trace'." ) ; } TraceLevel level = TraceLevel . getTraceLevel ( logcatTrace . charAt ( TRACE_LEVEL_INDEX ) ) ; String date = logcatTrace . substring ( 0 , END_OF_DATE_INDEX ) ; String message = logcatTrace . substring ( START_OF_MESSAGE_INDEX , logcatTrace . length ( ) ) ; return new Trace ( level , date + " " + message ) ; |
public class MinMaxScaler { /** * Performs the actual rescaling handling corner cases .
* @ param value
* @ param min
* @ param max
* @ return */
private Double scale ( Double value , Double min , Double max ) { } } | if ( min . equals ( max ) ) { if ( value > max ) { return 1.0 ; } else if ( value == max && value != 0.0 ) { return 1.0 ; } else { return 0.0 ; } } else { return ( value - min ) / ( max - min ) ; } |
public class Properties { /** * To avoid < code > NullPointerException < / code > for primitive type if the target property is null or not set .
* @ param targetClass
* @ param propName
* @ return */
@ SuppressWarnings ( "unchecked" ) public < T > T get ( Class < T > targetClass , Object propName ) { } } | return N . convert ( values . get ( propName ) , targetClass ) ; |
public class AbstractMappingHTTPResponseHandler { /** * This function returns the requested value from the object data . < br >
* The path is a set of key names seperated by ' ; ' .
* @ param object
* The object holding all the data
* @ param path
* The path to the value ( elements seperated by ; )
* @ return The value ( null if not found ) */
protected String findValue ( T object , String path ) { } } | String value = null ; if ( ( path != null ) && ( object != null ) ) { // find value
value = this . findValueImpl ( object , path ) ; if ( value != null ) { value = value . trim ( ) ; if ( value . length ( ) == 0 ) { value = null ; } } } return value ; |
public class JNote { /** * Sets the Unicode values of the stem [ 0 ] and the
* note head [ 1 ] for head inverted note
* @ return char [ 2 ] [ ] */
protected char [ ] [ ] valuateInvertedNoteChars ( ) { } } | short noteDuration = note . getStrictDuration ( ) ; char [ ] c1 = null , c2 = null ; if ( note . isRest ( ) ) { c1 = new char [ ] { getMusicalFont ( ) . getRestChar ( noteDuration ) } ; } else { if ( noteDuration <= Note . HALF ) { if ( isStemUp ( ) ) c1 = new char [ ] { getMusicalFont ( ) . getStemWithoutNoteUpChar ( noteDuration ) } ; else c1 = new char [ ] { getMusicalFont ( ) . getStemWithoutNoteDownChar ( noteDuration ) } ; } c2 = new char [ ] { getMusicalFont ( ) . getNoteWithoutStem ( noteDuration ) } ; // if the note in valuateNoteChar is without stem
// remove the stem char ( c1)
// e . g . : JChordNote , JNotePartOfGroup
if ( c2 [ 0 ] == noteChars [ 0 ] ) { c1 = null ; } } return new char [ ] [ ] { c1 , c2 } ; |
public class XsdAsmInterfaces { /** * Iterates in a given { @ link XsdAbstractElement } object in order to obtain all the contained { @ link XsdElement } objects .
* @ param element The element to iterate on .
* @ return All the { @ link XsdElement } objects contained in the received element . */
private List < XsdElement > getAllElementsRecursively ( XsdAbstractElement element ) { } } | List < XsdElement > allGroupElements = new ArrayList < > ( ) ; List < XsdAbstractElement > directElements = element . getXsdElements ( ) . collect ( Collectors . toList ( ) ) ; allGroupElements . addAll ( directElements . stream ( ) . filter ( elem1 -> elem1 instanceof XsdElement ) . map ( elem1 -> ( XsdElement ) elem1 ) . collect ( Collectors . toList ( ) ) ) ; for ( XsdAbstractElement elem : directElements ) { if ( ( elem instanceof XsdMultipleElements || elem instanceof XsdGroup ) && elem . getXsdElements ( ) != null ) { allGroupElements . addAll ( getAllElementsRecursively ( elem ) ) ; } } return allGroupElements ; |
public class AspectranWebService { /** * Returns a new instance of { @ code AspectranWebService } .
* @ param servlet the web activity servlet
* @ return the instance of { @ code AspectranWebService } */
public static AspectranWebService create ( WebActivityServlet servlet ) { } } | ServletContext servletContext = servlet . getServletContext ( ) ; ServletConfig servletConfig = servlet . getServletConfig ( ) ; String aspectranConfigParam = servletConfig . getInitParameter ( ASPECTRAN_CONFIG_PARAM ) ; if ( aspectranConfigParam == null ) { log . warn ( "No specified servlet initialization parameter for instantiating AspectranWebService" ) ; } AspectranWebService service = create ( servletContext , aspectranConfigParam ) ; String attrName = STANDALONE_WEB_SERVICE_ATTRIBUTE_PREFIX + servlet . getServletName ( ) ; servletContext . setAttribute ( attrName , service ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "The AspectranWebService attribute in ServletContext has been created; " + attrName + ": " + service ) ; } return service ; |
public class GoPluginDescriptorParser { /** * used by digester */
public void createVendor ( String name , String url ) { } } | vendor = new GoPluginDescriptor . Vendor ( name , url ) ; |
public class PropsVectors { /** * points to the start of a row . */
private int findRow ( int rangeStart ) { } } | int index = 0 ; // check the vicinity of the last - seen row ( start
// searching with an unrolled loop )
index = prevRow * columns ; if ( rangeStart >= v [ index ] ) { if ( rangeStart < v [ index + 1 ] ) { // same row as last seen
return index ; } else { index += columns ; if ( rangeStart < v [ index + 1 ] ) { ++ prevRow ; return index ; } else { index += columns ; if ( rangeStart < v [ index + 1 ] ) { prevRow += 2 ; return index ; } else if ( ( rangeStart - v [ index + 1 ] ) < 10 ) { // we are close , continue looping
prevRow += 2 ; do { ++ prevRow ; index += columns ; } while ( rangeStart >= v [ index + 1 ] ) ; return index ; } } } } else if ( rangeStart < v [ 1 ] ) { // the very first row
prevRow = 0 ; return 0 ; } // do a binary search for the start of the range
int start = 0 ; int mid = 0 ; int limit = rows ; while ( start < limit - 1 ) { mid = ( start + limit ) / 2 ; index = columns * mid ; if ( rangeStart < v [ index ] ) { limit = mid ; } else if ( rangeStart < v [ index + 1 ] ) { prevRow = mid ; return index ; } else { start = mid ; } } // must be found because all ranges together always cover
// all of Unicode
prevRow = start ; index = start * columns ; return index ; |
public class JobRequest { /** * Cancel this request if it has been scheduled . Note that if the job isn ' t periodic , then the
* time passed since the job has been scheduled is subtracted from the time frame . For example
* a job should run between 4 and 6 seconds from now . You cancel the scheduled job after 2
* seconds , then the job will run between 2 and 4 seconds after it ' s been scheduled again .
* @ return A builder to modify the parameters . */
public Builder cancelAndEdit ( ) { } } | // create a temporary variable , because . cancel ( ) will reset mScheduledAt
long scheduledAt = mScheduledAt ; JobManager . instance ( ) . cancel ( getJobId ( ) ) ; Builder builder = new Builder ( this . mBuilder ) ; mStarted = false ; if ( ! isPeriodic ( ) ) { long offset = JobConfig . getClock ( ) . currentTimeMillis ( ) - scheduledAt ; long minValue = 1L ; // 1ms
builder . setExecutionWindow ( Math . max ( minValue , getStartMs ( ) - offset ) , Math . max ( minValue , getEndMs ( ) - offset ) ) ; } return builder ; |
public class StringSupport { /** * Replaces a series of possible occurrences by a series of substitutes .
* @ param haystack
* @ param needle
* @ param newNeedle
* @ return */
public static String replaceAll ( String haystack , String [ ] needle , String newNeedle [ ] ) { } } | if ( needle . length != newNeedle . length ) { throw new IllegalArgumentException ( "length of original and replace values do not match (" + needle . length + " != " + newNeedle . length + " )" ) ; } StringBuffer buf = new StringBuffer ( haystack ) ; for ( int i = 0 ; i < needle . length ; i ++ ) { // TODO not very elegant
replaceAll ( buf , needle [ i ] , newNeedle [ i ] ) ; } return buf . toString ( ) ; |
public class RegxFunctionUtil { /** * 根据正则表达式进行切分
* @ param str 查找的字符串
* @ param regex 正则表达式
* @ param limit 分成的字符串的个数
* @ return 切分后的字符串 */
public List < String > splitLimit ( String str , String regex , int limit ) { } } | if ( str == null || regex == null ) return new ArrayList < String > ( ) ; return Arrays . asList ( str . split ( regex , limit ) ) ; |
public class QueryStringParser { /** * Get the name of the current parameter .
* Calling this method is only allowed if { @ link # next ( ) } has been called
* previously and the result of this call was < code > true < / code > . Otherwise the
* result of this method is undefined .
* @ return the name of the current parameter */
public String getName ( ) { } } | if ( paramName == null ) { paramName = queryString . substring ( paramBegin , paramNameEnd ) ; } return paramName ; |
public class URI { /** * Parse the authority component .
* @ param original the original character sequence of authority component
* @ param escaped < code > true < / code > if < code > original < / code > is escaped
* @ throws URIException If an error occurs . */
protected void parseAuthority ( String original , boolean escaped ) throws URIException { } } | // Reset flags
_is_reg_name = _is_server = _is_hostname = _is_IPv4address = _is_IPv6reference = false ; // set the charset to do escape encoding
String charset = getProtocolCharset ( ) ; boolean hasPort = true ; int from = 0 ; int next = original . indexOf ( '@' ) ; if ( next != - 1 ) { // neither - 1 and 0
// each protocol extented from URI supports the specific userinfo
_userinfo = ( escaped ) ? original . substring ( 0 , next ) . toCharArray ( ) : encode ( original . substring ( 0 , next ) , allowed_userinfo , charset ) ; from = next + 1 ; } next = original . indexOf ( '[' , from ) ; if ( next >= from ) { next = original . indexOf ( ']' , from ) ; if ( next == - 1 ) { throw new URIException ( URIException . PARSING , "IPv6reference" ) ; } else { next ++ ; } // In IPv6reference , ' [ ' , ' ] ' should be excluded
_host = ( escaped ) ? original . substring ( from , next ) . toCharArray ( ) : encode ( original . substring ( from , next ) , allowed_IPv6reference , charset ) ; // Set flag
_is_IPv6reference = true ; } else { // only for ! _ is _ IPv6reference
next = original . indexOf ( ':' , from ) ; if ( next == - 1 ) { next = original . length ( ) ; hasPort = false ; } // REMINDME : it doesn ' t need the pre - validation
_host = original . substring ( from , next ) . toCharArray ( ) ; if ( validate ( _host , IPv4address ) ) { // Set flag
_is_IPv4address = true ; } else if ( validate ( _host , hostname ) ) { // Set flag
_is_hostname = true ; } else { // Set flag
_is_reg_name = true ; } } if ( _is_reg_name ) { // Reset flags for a server - based naming authority
_is_server = _is_hostname = _is_IPv4address = _is_IPv6reference = false ; // set a registry - based naming authority
if ( escaped ) { _authority = original . toCharArray ( ) ; if ( ! validate ( _authority , reg_name ) ) { throw new URIException ( "Invalid authority" ) ; } } else { _authority = encode ( original , allowed_reg_name , charset ) ; } } else { if ( original . length ( ) - 1 > next && hasPort && original . charAt ( next ) == ':' ) { // not empty
from = next + 1 ; try { _port = Integer . parseInt ( original . substring ( from ) ) ; } catch ( NumberFormatException error ) { throw new URIException ( URIException . PARSING , "invalid port number" ) ; } } // set a server - based naming authority
StringBuffer buf = new StringBuffer ( ) ; if ( _userinfo != null ) { // has _ userinfo
buf . append ( _userinfo ) ; buf . append ( '@' ) ; } if ( _host != null ) { buf . append ( _host ) ; if ( _port != - 1 ) { buf . append ( ':' ) ; buf . append ( _port ) ; } } _authority = buf . toString ( ) . toCharArray ( ) ; // Set flag
_is_server = true ; } |
public class PQ { /** * Loads the persistent index in memory .
* @ throws Exception */
private void loadIndexInMemory ( ) throws Exception { } } | // create the memory objects with the appropriate initial size
if ( numProductCentroids <= 256 ) { pqByteCodes = new TByteArrayList ( maxNumVectors * numSubVectors ) ; } else { pqShortCodes = new TShortArrayList ( maxNumVectors * numSubVectors ) ; } long start = System . currentTimeMillis ( ) ; System . out . println ( "Loading persistent index in memory." ) ; DatabaseEntry foundKey = new DatabaseEntry ( ) ; DatabaseEntry foundData = new DatabaseEntry ( ) ; ForwardCursor cursor = null ; if ( useDiskOrderedCursor ) { // disk ordered cursor
DiskOrderedCursorConfig docc = new DiskOrderedCursorConfig ( ) ; cursor = iidToPqDB . openCursor ( docc ) ; } else { cursor = iidToPqDB . openCursor ( null , null ) ; } int counter = 0 ; while ( cursor . getNext ( foundKey , foundData , LockMode . DEFAULT ) == OperationStatus . SUCCESS && counter < maxNumVectors ) { TupleInput input = TupleBinding . entryToInput ( foundData ) ; if ( numProductCentroids <= 256 ) { byte [ ] code = new byte [ numSubVectors ] ; for ( int i = 0 ; i < numSubVectors ; i ++ ) { code [ i ] = input . readByte ( ) ; } pqByteCodes . add ( code ) ; // update ram based index
} else { short [ ] code = new short [ numSubVectors ] ; for ( int i = 0 ; i < numSubVectors ; i ++ ) { code [ i ] = input . readShort ( ) ; } pqShortCodes . add ( code ) ; // update ram based index
} counter ++ ; if ( counter % 1000 == 0 ) { System . out . println ( counter + " vectors loaded in memory!" ) ; } } cursor . close ( ) ; long end = System . currentTimeMillis ( ) ; System . out . println ( counter + " vectors loaded in " + ( end - start ) + " ms!" ) ; |
public class AbstractLayout3DPC { /** * Build the minimum spanning tree .
* @ param mat Similarity matrix
* @ param layout Layout to write to
* @ return Root node id */
protected N buildSpanningTree ( int dim , double [ ] mat , Layout layout ) { } } | assert ( layout . edges == null || layout . edges . size ( ) == 0 ) ; int [ ] iedges = PrimsMinimumSpanningTree . processDense ( mat , new LowerTriangularAdapter ( dim ) ) ; int root = findOptimalRoot ( iedges ) ; // Convert edges :
ArrayList < Edge > edges = new ArrayList < > ( iedges . length >> 1 ) ; for ( int i = 1 ; i < iedges . length ; i += 2 ) { edges . add ( new Edge ( iedges [ i - 1 ] , iedges [ i ] ) ) ; } layout . edges = edges ; // Prefill nodes array with nulls .
ArrayList < N > nodes = new ArrayList < > ( dim ) ; for ( int i = 0 ; i < dim ; i ++ ) { nodes . add ( null ) ; } layout . nodes = nodes ; N rootnode = buildTree ( iedges , root , - 1 , nodes ) ; return rootnode ; |
public class GetMethodResponseResult { /** * Specifies the < a > Model < / a > resources used for the response ' s content - type . Response models are represented as a
* key / value map , with a content - type as the key and a < a > Model < / a > name as the value .
* @ param responseModels
* Specifies the < a > Model < / a > resources used for the response ' s content - type . Response models are represented
* as a key / value map , with a content - type as the key and a < a > Model < / a > name as the value .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetMethodResponseResult withResponseModels ( java . util . Map < String , String > responseModels ) { } } | setResponseModels ( responseModels ) ; return this ; |
public class AbstractJcrNode { /** * Get the JCR node for the named child .
* @ param name the child name ; may not be null
* @ param expectedType the expected implementation type for the node , or null if it is not known
* @ return the JCR node ; never null
* @ throws PathNotFoundException if there is no child with the supplied name
* @ throws ItemNotFoundException if this node or the referenced child no longer exist or cannot be found
* @ throws InvalidItemStateException if this node has been removed in this session ' s transient state */
protected final AbstractJcrNode childNode ( Name name , Type expectedType ) throws PathNotFoundException , ItemNotFoundException , InvalidItemStateException { } } | ChildReference ref = node ( ) . getChildReferences ( sessionCache ( ) ) . getChild ( name ) ; if ( ref == null ) { String msg = JcrI18n . childNotFoundUnderNode . text ( readable ( name ) , location ( ) , session . workspaceName ( ) ) ; throw new PathNotFoundException ( msg ) ; } return session ( ) . node ( ref . getKey ( ) , expectedType , key ( ) ) ; |
public class WikipediaInfo { /** * If the return value has been already computed , it is returned , else it is computed at retrieval time .
* @ param pWiki The wikipedia object .
* @ param catGraph The category graph .
* @ return The number of categorized articles , i . e . articles that have at least one category . */
public int getNumberOfCategorizedArticles ( Wikipedia pWiki , CategoryGraph catGraph ) throws WikiApiException { } } | if ( categorizedArticleSet == null ) { // has not been initialized yet
iterateCategoriesGetArticles ( pWiki , catGraph ) ; } return categorizedArticleSet . size ( ) ; |
public class appqoecustomresp { /** * Use this API to Import appqoecustomresp resources . */
public static base_responses Import ( nitro_service client , appqoecustomresp resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { appqoecustomresp Importresources [ ] = new appqoecustomresp [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { Importresources [ i ] = new appqoecustomresp ( ) ; Importresources [ i ] . src = resources [ i ] . src ; Importresources [ i ] . name = resources [ i ] . name ; } result = perform_operation_bulk_request ( client , Importresources , "Import" ) ; } return result ; |
public class Version { /** * Use { @ link # getBetaSettingsMap ( ) } instead . */
@ java . lang . Deprecated public java . util . Map < java . lang . String , java . lang . String > getBetaSettings ( ) { } } | return getBetaSettingsMap ( ) ; |
public class JavaManagementServerBean { /** * Get the second rmi port from the init parameters or calculate it
* @ param portOne Base port to calculate the second port from if needed .
* @ return The second port */
protected int calculatePortTwo ( final int portOne ) { } } | int portTwo = this . portTwo ; if ( portTwo <= 0 ) { portTwo = portOne + 1 ; } if ( this . logger . isDebugEnabled ( ) ) { this . logger . debug ( "Using " + portTwo + " for portTwo." ) ; } return portTwo ; |
public class Workbook { /** * Returns an existing workbook object .
* @ param filename The filename of the workbook
* @ param stream The input stream for the workbook
* @ return The existing workbook object
* @ throws IOException if the file cannot be read */
public static Workbook getWorkbook ( String filename , InputStream stream ) throws IOException { } } | Workbook ret = null ; String lowerFilename = filename . toLowerCase ( ) ; if ( lowerFilename . endsWith ( "." + CommonFiles . XLS_EXT ) ) { ret = XlsWorkbook . getWorkbook ( stream ) ; } else if ( lowerFilename . endsWith ( "." + CommonFiles . XLSX_EXT ) ) { XlsxWorkbook . initJaxbContexts ( ) ; ret = XlsxWorkbook . getWorkbook ( stream ) ; } return ret ; |
public class JKDebugUtil { /** * Gets the main class name .
* @ return the main class name */
public static String getMainClassName ( ) { } } | StackTraceElement trace [ ] = Thread . currentThread ( ) . getStackTrace ( ) ; if ( trace . length > 0 ) { return trace [ trace . length - 1 ] . getClassName ( ) ; } return "Unknown" ; |
public class LdapConfiguration { /** * Add an authentication filter to the web application context if edison . ldap property is set to { @ code enabled } ' .
* All routes starting with the value of the { @ code edison . ldap . prefix } property will be secured by LDAP . If no
* property is set this will default to all routes starting with ' / internal ' .
* @ param ldapProperties the properties used to configure LDAP
* @ return FilterRegistrationBean */
@ Bean @ ConditionalOnMissingBean ( LdapConnectionFactory . class ) public LdapConnectionFactory ldapConnectionFactory ( final LdapProperties ldapProperties ) { } } | if ( ldapProperties . getEncryptionType ( ) == EncryptionType . SSL ) { return new SSLLdapConnectionFactory ( ldapProperties ) ; } return new StartTlsLdapConnectionFactory ( ldapProperties ) ; |
public class Launch { /** * Add a Quartz JobData to the one used to launch the Program . This JobData
* is used to initialize Programs arguments for launching .
* @ param jobDataMap
* A JobDatamap
* @ return This Launch instance . */
@ SuppressWarnings ( "unchecked" ) public synchronized Launch addDatas ( final JobDataMap jobDataMap ) { } } | Map < String , Object > data = new HashMap < > ( ) ; for ( String key : jobDataMap . getKeys ( ) ) { data . put ( key , jobDataMap . get ( key ) ) ; } this . launch . addParameters ( data ) ; return this ; |
public class Net { /** * Unblock IPv6 source */
static void unblock4 ( FileDescriptor fd , int group , int interf , int source ) throws IOException { } } | blockOrUnblock4 ( false , fd , group , interf , source ) ; |
public class CmsEditablePositionCalculator { /** * Checks whether two positions intersect vertically . < p >
* @ param p1 the first position
* @ param p2 the second position
* @ return if the positions intersect vertically */
protected boolean intersectsVertically ( CmsPositionBean p1 , CmsPositionBean p2 ) { } } | return intersectIntervals ( p1 . getTop ( ) , p1 . getTop ( ) + HEIGHT , p2 . getTop ( ) , p2 . getTop ( ) + HEIGHT ) ; |
public class VOMSFQANNamingScheme { /** * This method extracts group name information from the FQAN passed as
* argument .
* @ param containerName
* the FQAN
* @ return < ul >
* < li > A string containing the group name , if found < / li >
* < li > null , if no group information is contained in the FQAN passed
* as argument
* < / ul > */
public static String getGroupName ( String containerName ) { } } | checkSyntax ( containerName ) ; // If it ' s a container and it ' s not a role or a qualified role , then
// it ' s a group !
if ( ! isRole ( containerName ) && ! isQualifiedRole ( containerName ) ) return containerName ; Matcher m = fqanPattern . matcher ( containerName ) ; if ( m . matches ( ) ) { String groupName = m . group ( 2 ) ; if ( groupName . endsWith ( "/" ) ) return groupName . substring ( 0 , groupName . length ( ) - 1 ) ; else return groupName ; } return null ; |
public class SipSessionImpl { /** * Update the sip session state upon sending / receiving a response
* Covers JSR 289 Section 6.2.1 along with updateStateOnRequest method
* @ param response the response received / to send
* @ param receive true if the response has been received , false if it is to be sent . */
public void updateStateOnResponse ( MobicentsSipServletResponse response , boolean receive ) { } } | final String method = response . getMethod ( ) ; if ( sipSessionSecurity != null && response . getStatus ( ) >= 200 && response . getStatus ( ) < 300 ) { // Issue 2173 http : / / code . google . com / p / mobicents / issues / detail ? id = 2173
// it means some credentials were cached need to check if we need to store the nextnonce if the response have one
AuthenticationInfoHeader authenticationInfoHeader = ( AuthenticationInfoHeader ) response . getMessage ( ) . getHeader ( AuthenticationInfoHeader . NAME ) ; if ( authenticationInfoHeader != null ) { String nextNonce = authenticationInfoHeader . getNextNonce ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Storing nextNonce " + nextNonce + " for session " + key ) ; } sipSessionSecurity . setNextNonce ( nextNonce ) ; } } // JSR 289 Section 6.2.1 Point 2 of rules governing the state of SipSession
// In general , whenever a non - dialog creating request is sent or received ,
// the SipSession state remains unchanged . Similarly , a response received
// for a non - dialog creating request also leaves the SipSession state unchanged .
// The exception to the general rule is that it does not apply to requests ( e . g . BYE , CANCEL )
// that are dialog terminating according to the appropriate RFC rules relating to the kind of dialog .
if ( ! JainSipUtils . DIALOG_CREATING_METHODS . contains ( method ) && ! JainSipUtils . DIALOG_TERMINATING_METHODS . contains ( method ) ) { if ( getSessionCreatingDialog ( ) == null && proxy == null ) { // Fix for issue http : / / code . google . com / p / mobicents / issues / detail ? id = 2116
// avoid creating derived sessions for non dialogcreating requests
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "resetting the to tag since a response to a non dialog creating and terminating method has been received for non proxy session with no dialog in state " + state ) ; } key . setToTag ( null , false ) ; // https : / / github . com / Mobicents / sip - servlets / issues / 36
// Memory leak : SipAppSession and contained SipSessions are not cleaned - up
// for non dialog creating requests after a 2xx response is received .
// This code sets these SipSessions to ReadyToInvalidate .
// Applications that want to create susbequent requests ( re REGISTER ) should call sipSession . setInvalidateWhenReady ( false ) ;
if ( state != null && State . INITIAL . equals ( state ) && response . getStatus ( ) >= 200 && response . getStatus ( ) != 407 && response . getStatus ( ) != 401 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Setting SipSession " + getKey ( ) + " for response " + response . getStatus ( ) + " to a non dialog creating or terminating request " + method + " in state " + state + " to ReadyToInvalidate=true" ) ; } setReadyToInvalidate ( true ) ; } } return ; } // Mapping to the sip session state machine ( proxy is covered here too )
if ( ( State . INITIAL . equals ( state ) || State . EARLY . equals ( state ) ) && response . getStatus ( ) >= 200 && response . getStatus ( ) < 300 && ! JainSipUtils . DIALOG_TERMINATING_METHODS . contains ( method ) ) { this . setState ( State . CONFIRMED ) ; if ( this . proxy != null && response . getProxyBranch ( ) != null && ! response . getProxyBranch ( ) . getRecordRoute ( ) ) { // Section 6.2.4.1.2 Invalidate When Ready Mechanism :
// " The container determines the SipSession to be in the ready - to - invalidate state under any of the following conditions :
// 2 . A SipSession transitions to the CONFIRMED state when it is acting as a non - record - routing proxy . "
setReadyToInvalidate ( true ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; } } // Mapping to the sip session state machine
// We will transition from INITIAL to EARLY here for 100 Trying ( not clear from the spec )
// Figure 6-1 The SIP Dialog State Machine
// and Figure 6-2 The SipSession State Machine
if ( State . INITIAL . equals ( state ) && response . getStatus ( ) >= 100 && response . getStatus ( ) < 200 ) { this . setState ( State . EARLY ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; } } if ( ( State . INITIAL . equals ( state ) || State . EARLY . equals ( state ) ) && response . getStatus ( ) >= 300 && response . getStatus ( ) < 700 && JainSipUtils . DIALOG_CREATING_METHODS . contains ( method ) && ! JainSipUtils . DIALOG_TERMINATING_METHODS . contains ( method ) ) { // If the servlet acts as a UAC and sends a dialog creating request ,
// then the SipSession state tracks directly the SIP dialog state except
// that non - 2XX final responses received in the EARLY or INITIAL states
// cause the SipSession state to return to the INITIAL state rather than going to TERMINATED .
// If the servlet acts as a proxy for a dialog creating request then
// the SipSession state tracks the SIP dialog state except that non - 2XX
// final responses received from downstream in the EARLY or INITIAL states
// cause the SipSession state to return to INITIAL rather than going to TERMINATED .
if ( receive ) { if ( proxy == null ) { // Fix for issue http : / / code . google . com / p / mobicents / issues / detail ? id = 2083
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "resetting the to tag since a non 2xx response has been received for non proxy session in state " + state ) ; } key . setToTag ( null , false ) ; } setState ( State . INITIAL ) ; // readyToInvalidate = true ;
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; } } // If the servlet acts as a UAS and receives a dialog creating request ,
// then the SipSession state directly tracks the SIP dialog state .
// Unlike a UAC , a non - 2XX final response sent by the UAS in the EARLY or INITIAL
// states causes the SipSession state to go directly to the TERMINATED state .
// This enables proxy servlets to proxy requests to additional destinations
// when called by the container in the doResponse ( ) method for a tentative
// non - 2XX best response .
// After all such additional proxy branches have been responded to and after
// considering any servlet created responses , the container eventually arrives at
// the overall best response and forwards this response upstream .
// If this best response is a non - 2XX final response , then when the forwarding takes place ,
// the state of the SipSession object becomes TERMINATED .
else { setState ( State . TERMINATED ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; } } } if ( ( ( State . CONFIRMED . equals ( state ) || State . TERMINATED . equals ( state ) ) && response . getStatus ( ) >= 200 && Request . BYE . equals ( method ) // https : / / code . google . com / p / sipservlets / issues / detail ? id = 194
&& response . getStatus ( ) != 407 && response . getStatus ( ) != 401 ) // http : / / code . google . com / p / mobicents / issues / detail ? id = 1438
// Sip Session become TERMINATED after receiving 487 response to subsequent request = > ! confirmed clause added
|| ( ! State . CONFIRMED . equals ( state ) && response . getStatus ( ) == 487 ) ) { boolean hasOngoingSubscriptions = false ; if ( subscriptions != null ) { if ( subscriptions . size ( ) > 0 ) { hasOngoingSubscriptions = true ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has " + subscriptions . size ( ) + " subscriptions" ) ; } if ( ! hasOngoingSubscriptions ) { if ( sessionCreatingDialog != null ) { sessionCreatingDialog . delete ( ) ; } } } if ( ! hasOngoingSubscriptions ) { if ( getProxy ( ) == null || response . getStatus ( ) != 487 ) { setState ( State . TERMINATED ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; logger . debug ( "the following sip session " + getKey ( ) + " is ready to be invalidated " ) ; } } } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "the following sip session " + getKey ( ) + " has its state updated to " + state ) ; } okToByeSentOrReceived = true ; } // we send the CANCEL only for 1xx responses
if ( response . getTransactionApplicationData ( ) . isCanceled ( ) && response . getStatus ( ) < 200 && ! response . getMethod ( ) . equals ( Request . CANCEL ) ) { SipServletRequestImpl request = ( SipServletRequestImpl ) response . getTransactionApplicationData ( ) . getSipServletMessage ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "request to cancel " + request + " routingstate " + request . getRoutingState ( ) + " requestCseq " + ( ( MessageExt ) request . getMessage ( ) ) . getCSeqHeader ( ) . getSeqNumber ( ) + " responseCseq " + ( ( MessageExt ) response . getMessage ( ) ) . getCSeqHeader ( ) . getSeqNumber ( ) ) ; } if ( ! request . getRoutingState ( ) . equals ( RoutingState . CANCELLED ) && ( ( MessageExt ) request . getMessage ( ) ) . getCSeqHeader ( ) . getSeqNumber ( ) == ( ( MessageExt ) response . getMessage ( ) ) . getCSeqHeader ( ) . getSeqNumber ( ) ) { if ( response . getStatus ( ) > 100 ) { request . setRoutingState ( RoutingState . CANCELLED ) ; } try { request . createCancel ( ) . send ( ) ; } catch ( IOException e ) { if ( logger . isEnabledFor ( Priority . WARN ) ) { logger . warn ( "Couldn't send CANCEL for a transaction that has been CANCELLED but " + "CANCEL was not sent because there was no response from the other side. We" + " just stopped the retransmissions." + response + "\nThe transaction" + response . getTransaction ( ) , e ) ; } } } } |
public class BlackDuckService { public String post ( BlackDuckPath blackDuckPath , BlackDuckComponent blackDuckComponent ) throws IntegrationException { } } | String uri = pieceTogetherUri ( blackDuckHttpClient . getBaseUrl ( ) , blackDuckPath . getPath ( ) ) ; return post ( uri , blackDuckComponent ) ; |
public class Components { /** * Adds the { @ code ids } to the collection of IDs to be rendered .
* Any leading { @ link UINamingContainer # getSeparatorChar ( FacesContext ) separator char } will be stripped .
* @ param context a { @ link FacesContext }
* @ param ids collection of fully qualified IDs */
static void render ( FacesContext context , final Set < String > ids ) { } } | if ( ids . isEmpty ( ) ) { return ; } final Collection < String > renderIds = context . getPartialViewContext ( ) . getRenderIds ( ) ; final char separatorChar = getSeparatorChar ( context ) ; for ( String id : ids ) { renderIds . add ( id . substring ( id . indexOf ( separatorChar ) + 1 ) ) ; } |
public class ReportToolbar { /** * Controls for a report screen . */
public void setupMiddleSFields ( ) { } } | new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . DISPLAY ) ; new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , null , ScreenConstants . DEFAULT_DISPLAY , MenuConstants . PRINT ) ; |
public class NavigationCase { /** * < p class = " changed _ added _ 2_0 " > Construct an absolute URL suitable for a
* " redirect " to this < code > NavigationCase < / code > instance using { @ link
* javax . faces . application . ViewHandler # getRedirectURL } on the path
* portion of the url . < / p >
* @ param context the { @ link FacesContext } for the current request
* @ throws MalformedURLException if the process of constructing the
* URL causes this exception to be thrown . */
public URL getRedirectURL ( FacesContext context ) throws MalformedURLException { } } | ExternalContext extContext = context . getExternalContext ( ) ; return new URL ( extContext . getRequestScheme ( ) , extContext . getRequestServerName ( ) , extContext . getRequestServerPort ( ) , context . getApplication ( ) . getViewHandler ( ) . getRedirectURL ( context , getToViewId ( context ) , SharedUtils . evaluateExpressions ( context , getParameters ( ) ) , isIncludeViewParams ( ) ) ) ; |
public class BaseJob { /** * Obtains Spring ' s application context .
* @ param context job execution context
* @ return application context
* @ throws SchedulerException */
protected ApplicationContext getApplicationContext ( JobExecutionContext context ) throws SchedulerException { } } | final SchedulerContext schedulerContext = context . getScheduler ( ) . getContext ( ) ; ApplicationContext applicationContext = ( ApplicationContext ) schedulerContext . get ( APPLICATION_CONTEXT_KEY ) ; // show keys in context
if ( applicationContext == null ) { logger . error ( APPLICATION_CONTEXT_KEY + " is empty in " + schedulerContext + ":" ) ; if ( schedulerContext . getKeys ( ) != null ) { for ( String key : schedulerContext . getKeys ( ) ) { Object value = schedulerContext . get ( key ) ; String valueText = value != null ? value . toString ( ) : "<NULL>" ; logger . info ( " {} = {}" , key , valueText ) ; } } } return applicationContext ; |
public class CSVOutput { /** * { @ inheritDoc } */
@ Override public boolean listenToException ( final AbstractPerfidixMethodException exec ) { } } | final PrintStream currentWriter = setUpNewPrintStream ( false , "Exceptions" ) ; if ( ! firstException ) { currentWriter . append ( "\n" ) ; } currentWriter . append ( exec . getRelatedAnno ( ) . getSimpleName ( ) ) ; currentWriter . append ( "," ) ; if ( exec . getMethod ( ) != null ) { currentWriter . append ( exec . getMethod ( ) . getDeclaringClass ( ) . getSimpleName ( ) ) ; currentWriter . append ( "#" ) ; currentWriter . append ( exec . getMethod ( ) . getName ( ) ) ; currentWriter . append ( "," ) ; } exec . getExec ( ) . printStackTrace ( currentWriter ) ; currentWriter . flush ( ) ; firstException = false ; return true ; |
public class ThriftClient { /** * Retrieves IDs for a given column .
* @ param schemaName
* the schema name
* @ param tableName
* the table name
* @ param pKeyName
* the key name
* @ param columnName
* the column name
* @ param columnValue
* the column value
* @ param entityClazz
* the entity clazz
* @ return the object [ ] */
@ Override public Object [ ] findIdsByColumn ( String schemaName , String tableName , String pKeyName , String columnName , Object columnValue , Class entityClazz ) { } } | List < Object > rowKeys = new ArrayList < Object > ( ) ; if ( getCqlVersion ( ) . equalsIgnoreCase ( CassandraConstants . CQL_VERSION_3_0 ) ) { rowKeys = findIdsByColumnUsingCql ( schemaName , tableName , pKeyName , columnName , columnValue , entityClazz ) ; } else { EntityMetadata metadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClazz ) ; SlicePredicate slicePredicate = new SlicePredicate ( ) ; slicePredicate . setSlice_range ( new SliceRange ( ByteBufferUtil . EMPTY_BYTE_BUFFER , ByteBufferUtil . EMPTY_BYTE_BUFFER , false , Integer . MAX_VALUE ) ) ; String childIdStr = PropertyAccessorHelper . getString ( columnValue ) ; IndexExpression ie = new IndexExpression ( UTF8Type . instance . decompose ( columnName + Constants . JOIN_COLUMN_NAME_SEPARATOR + childIdStr ) , IndexOperator . EQ , UTF8Type . instance . decompose ( childIdStr ) ) ; List < IndexExpression > expressions = new ArrayList < IndexExpression > ( ) ; expressions . add ( ie ) ; IndexClause ix = new IndexClause ( ) ; ix . setStart_key ( ByteBufferUtil . EMPTY_BYTE_BUFFER ) ; ix . setCount ( Integer . MAX_VALUE ) ; ix . setExpressions ( expressions ) ; ColumnParent columnParent = new ColumnParent ( tableName ) ; Connection conn = null ; try { conn = getConnection ( ) ; List < KeySlice > keySlices = conn . getClient ( ) . get_indexed_slices ( columnParent , ix , slicePredicate , getConsistencyLevel ( ) ) ; rowKeys = ThriftDataResultHelper . getRowKeys ( keySlices , metadata ) ; } catch ( InvalidRequestException e ) { log . error ( "Error while fetching key slices of column family {} for column name {} , Caused by: ." , tableName , columnName , e ) ; throw new KunderaException ( e ) ; } catch ( UnavailableException e ) { log . error ( "Error while fetching key slices of column family {} for column name {} , Caused by: ." , tableName , columnName , e ) ; throw new KunderaException ( e ) ; } catch ( TimedOutException e ) { log . error ( "Error while fetching key slices of column family {} for column name {} , Caused by: ." , tableName , columnName , e ) ; throw new KunderaException ( e ) ; } catch ( TException e ) { log . error ( "Error while fetching key slices of column family {} for column name {} , Caused by: ." , tableName , columnName , e ) ; throw new KunderaException ( e ) ; } finally { releaseConnection ( conn ) ; } } if ( rowKeys != null && ! rowKeys . isEmpty ( ) ) { return rowKeys . toArray ( new Object [ 0 ] ) ; } if ( log . isInfoEnabled ( ) ) { log . info ( "No record found!, returning null." ) ; } return null ; |
public class PatternBox { /** * Pattern for a ProteinReference has a member PhysicalEntity that is controlling a reaction
* that changes cellular location of a small molecule .
* @ param blacklist a skip - list of ubiquitous molecules
* @ return the pattern */
public static Pattern controlsTransportOfChemical ( Blacklist blacklist ) { } } | Pattern p = new Pattern ( SequenceEntityReference . class , "controller ER" ) ; p . add ( linkedER ( true ) , "controller ER" , "controller generic ER" ) ; p . add ( erToPE ( ) , "controller generic ER" , "controller simple PE" ) ; p . add ( linkToComplex ( ) , "controller simple PE" , "controller PE" ) ; p . add ( peToControl ( ) , "controller PE" , "Control" ) ; p . add ( controlToConv ( ) , "Control" , "Conversion" ) ; p . add ( new Participant ( RelType . INPUT , blacklist , true ) , "Control" , "Conversion" , "input PE" ) ; p . add ( linkToSimple ( blacklist ) , "input PE" , "input simple PE" ) ; p . add ( new Type ( SmallMolecule . class ) , "input simple PE" ) ; p . add ( notGeneric ( ) , "input simple PE" ) ; p . add ( peToER ( ) , "input simple PE" , "changed generic SMR" ) ; p . add ( new ConversionSide ( ConversionSide . Type . OTHER_SIDE , blacklist , RelType . OUTPUT ) , "input PE" , "Conversion" , "output PE" ) ; p . add ( equal ( false ) , "input PE" , "output PE" ) ; p . add ( linkToSimple ( blacklist ) , "output PE" , "output simple PE" ) ; p . add ( new Type ( SmallMolecule . class ) , "output simple PE" ) ; p . add ( notGeneric ( ) , "output simple PE" ) ; p . add ( peToER ( ) , "output simple PE" , "changed generic SMR" ) ; p . add ( linkedER ( false ) , "changed generic SMR" , "changed SMR" ) ; p . add ( new OR ( new MappedConst ( hasDifferentCompartments ( ) , 0 , 1 ) , new MappedConst ( hasDifferentCompartments ( ) , 2 , 3 ) ) , "input simple PE" , "output simple PE" , "input PE" , "output PE" ) ; return p ; |
public class XmlHelper { /** * Returns the namespace URIs found in the given XML file */
public static Set < String > getNamespaces ( InputSource source ) throws ParserConfigurationException , SAXException , IOException { } } | XmlNamespaceFinder finder = createNamespaceFinder ( ) ; Set < String > answer = finder . parseContents ( source ) ; if ( factory == null ) { factory = finder . getFactory ( ) ; } return answer ; |
public class af_config_info { /** * < pre >
* Use this operation to get a value for a Property based on Key . .
* < / pre > */
public static af_config_info [ ] get ( nitro_service client ) throws Exception { } } | af_config_info resource = new af_config_info ( ) ; resource . validate ( "get" ) ; return ( af_config_info [ ] ) resource . get_resources ( client ) ; |
public class NonSnarlIdpMetadataManager { /** * / * @ Override
* protected void initializeProviderFilters ( ExtendedMetadataDelegate provider ) throws MetadataProviderException {
* getManager ( ) . initializeProviderFilters ( provider ) ; */
@ Override public Set < String > getIDPEntityNames ( ) { } } | Set < String > result = new HashSet < > ( ) ; ExtendedMetadataDelegate delegate = null ; try { delegate = getLocalIdp ( ) ; String idp = getProviderIdpAlias ( delegate ) ; if ( StringUtils . hasText ( idp ) ) { result . add ( idp ) ; } } catch ( MetadataProviderException e ) { log . error ( "Unable to get IDP alias for:" + delegate , e ) ; } return result ; |
public class ApiOvhPackxdsl { /** * Migrate to the selected offer
* REST : POST / pack / xdsl / { packName } / migration / migrate
* @ param nicShipping [ required ] nicShipping if a shipping is needed
* @ param floor [ required ] Floor identifier , " _ NA _ " if no identifier is available
* @ param buildingReference [ required ] Building reference for FTTH offers
* @ param mondialRelayId [ required ] Mondial relay ID if a shipping is needed
* @ param otpReference [ required ] Reference of the Optical Termination Point
* @ param offerName [ required ] Reference of the new offer
* @ param options [ required ] Options wanted in the new offer
* @ param acceptContracts [ required ] You explicitly accept the terms of the contract corresponding to your new offer
* @ param stair [ required ] Stair identifier , " _ NA _ " if no identifier is available
* @ param engageMonths [ required ] Number of months of re - engagement
* @ param otp [ required ] Do you have an Optical Termination Point ( Point de Terminaison Optique ) at home ?
* @ param subServicesToDelete [ required ] List of domains of services to delete if needed
* @ param packName [ required ] The internal name of your pack */
public OvhTask packName_migration_migrate_POST ( String packName , Boolean acceptContracts , String buildingReference , Long engageMonths , String floor , Long mondialRelayId , String nicShipping , String offerName , OvhOfferOption [ ] options , Boolean otp , String otpReference , String stair , OvhOfferServiceToDelete [ ] subServicesToDelete ) throws IOException { } } | String qPath = "/pack/xdsl/{packName}/migration/migrate" ; StringBuilder sb = path ( qPath , packName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "acceptContracts" , acceptContracts ) ; addBody ( o , "buildingReference" , buildingReference ) ; addBody ( o , "engageMonths" , engageMonths ) ; addBody ( o , "floor" , floor ) ; addBody ( o , "mondialRelayId" , mondialRelayId ) ; addBody ( o , "nicShipping" , nicShipping ) ; addBody ( o , "offerName" , offerName ) ; addBody ( o , "options" , options ) ; addBody ( o , "otp" , otp ) ; addBody ( o , "otpReference" , otpReference ) ; addBody ( o , "stair" , stair ) ; addBody ( o , "subServicesToDelete" , subServicesToDelete ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; |
public class BrowserController { /** * Return the ip info of where the web host lives that supports the browser
* app .
* @ return the ip addr info
* @ throws UnknownHostException if something goes wrong */
@ GET @ Path ( "/ipAddrInfo" ) public String getIPAddrInfo ( ) throws UnknownHostException { } } | Properties clientProps = getPropeSenderProps ( ) ; StringBuffer buf = new StringBuffer ( ) ; InetAddress localhost = null ; NetworkInterface ni = null ; try { localhost = InetAddress . getLocalHost ( ) ; LOGGER . debug ( "Network Interface name not specified. Using the NI for localhost " + localhost . getHostAddress ( ) ) ; ni = NetworkInterface . getByInetAddress ( localhost ) ; } catch ( UnknownHostException | SocketException e ) { LOGGER . error ( "Error occured dealing with network interface name lookup " , e ) ; } buf . append ( "<p>" ) . append ( "<span style='color: red'> IP Address: </span>" ) . append ( localhost . getHostAddress ( ) ) ; buf . append ( "<span style='color: red'> Host name: </span>" ) . append ( localhost . getCanonicalHostName ( ) ) ; if ( ni == null ) { buf . append ( "<span style='color: red'> Network Interface is NULL </span>" ) ; } else { buf . append ( "<span style='color: red'> Network Interface name: </span>" ) . append ( ni . getDisplayName ( ) ) ; } buf . append ( "</p><p>" ) ; buf . append ( "Sending probes to " + respondToAddresses . size ( ) + " addresses - " ) ; for ( ProbeRespondToAddress rta : respondToAddresses ) { buf . append ( "<span style='color: red'> Probe to: </span>" ) . append ( rta . respondToAddress + ":" + rta . respondToPort ) ; } buf . append ( "</p>" ) ; return buf . toString ( ) ; |
public class DefaultDataEditorWidget { /** * { @ inheritDoc } */
@ Override public void onAboutToHide ( ) { } } | log . debug ( getId ( ) + ": onAboutToHide with refreshPolicy: " + dataProvider . getRefreshPolicy ( ) ) ; super . onAboutToHide ( ) ; this . dataProvider . removeDataProviderListener ( this ) ; unRegisterListeners ( ) ; if ( detailForm instanceof Widget ) { ( ( Widget ) detailForm ) . onAboutToHide ( ) ; } if ( dataProvider . getRefreshPolicy ( ) == DataProvider . RefreshPolicy . ALLWAYS ) { getTableWidget ( ) . setRows ( Collections . EMPTY_LIST ) ; } |
public class CmsEditModuleForm { /** * Adds another entry to the list of export points in the export point tab . < p >
* @ param src the export point source
* @ param target the export point target */
public void addExportPointRow ( String src , String target ) { } } | CmsExportPointWidget exportPointWidget = new CmsExportPointWidget ( src , target ) ; m_exportPointGroup . addRow ( exportPointWidget ) ; // row . addStyleName ( COMPLEX _ ROW ) ;
// m _ exportPoints . addComponent ( row ) ; |
public class CaseInsensitiveMap { /** * Return a list of code point characters ( not including the input value )
* that can be substituted in a case insensitive match */
static public int [ ] get ( int codePoint ) { } } | if ( mapBuilt == Boolean . FALSE ) { synchronized ( mapBuilt ) { if ( mapBuilt == Boolean . FALSE ) { buildCaseInsensitiveMap ( ) ; } } // synchronized
} // if mapBuilt
return ( codePoint < 0x10000 ) ? getMapping ( codePoint ) : null ; |
public class ColumnBuilder { /** * Adds a property to the column being created . < / br >
* @ return ColumnBuilder */
public ColumnBuilder setColumnProperty ( String propertyName , String valueClassName ) { } } | this . columnProperty = new ColumnProperty ( propertyName , valueClassName ) ; return this ; |
public class JavacTrees { /** * called reflectively from Trees . instance ( CompilationTask task ) */
public static JavacTrees instance ( JavaCompiler . CompilationTask task ) { } } | if ( ! ( task instanceof BasicJavacTask ) ) throw new IllegalArgumentException ( ) ; return instance ( ( ( BasicJavacTask ) task ) . getContext ( ) ) ; |
public class IconImpl { /** * { @ inheritDoc } */
public Icon copy ( ) { } } | return new IconImpl ( CopyUtil . clone ( smallIcon ) , CopyUtil . clone ( largeIcon ) , CopyUtil . cloneString ( lang ) , CopyUtil . cloneString ( id ) ) ; |
public class DynamicAccessModule { /** * Get the method defintions for a given dynamic disseminator that
* is associated with the digital object . The dynamic disseminator is
* identified by the sDefPID .
* @ param context
* @ param PID
* identifier of digital object being reflected upon
* @ param sDefPID
* identifier of dynamic service definition
* @ param asOfDateTime
* @ return an array of method definitions
* @ throws ServerException */
public MethodDef [ ] getMethods ( Context context , String PID , String sDefPID , Date asOfDateTime ) throws ServerException { } } | // m _ ipRestriction . enforce ( context ) ;
return da . getMethods ( context , PID , sDefPID , asOfDateTime ) ; |
public class UpdateScheduleOverrideRequest { /** * check the parameters for validation .
* @ throws OpsGenieClientValidationException when alias is null ! */
@ Override public void validate ( ) throws OpsGenieClientValidationException { } } | super . validate ( ) ; if ( getAlias ( ) == null ) throw OpsGenieClientValidationException . missingMandatoryProperty ( OpsGenieClientConstants . API . ALIAS ) ; |
public class UserSearchManager { /** * Returns a collection of search services found on the server .
* @ return a Collection of search services found on the server .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public List < DomainBareJid > getSearchServices ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | ServiceDiscoveryManager discoManager = ServiceDiscoveryManager . getInstanceFor ( con ) ; return discoManager . findServices ( UserSearch . NAMESPACE , false , false ) ; |
public class CmsFileExplorer { /** * Adds the given properties to the tree container . < p >
* @ param properties the properties tom add */
private void addTreeContainerProperties ( CmsResourceTableProperty ... properties ) { } } | for ( CmsResourceTableProperty property : properties ) { m_treeContainer . addContainerProperty ( property , property . getColumnType ( ) , property . getDefaultValue ( ) ) ; } |
public class VFSUtils { /** * Get the virtual URL for a virtual file . This URL can be used to access the virtual file ; however , taking the file
* part of the URL and attempting to use it with the { @ link java . io . File } class may fail if the file is not present
* on the physical filesystem , and in general should not be attempted .
* < b > Note : < / b > if the given VirtualFile refers to a directory < b > at the time of this
* method invocation < / b > , a trailing slash will be appended to the URL ; this means that invoking
* this method may require a filesystem access , and in addition , may not produce consistent results
* over time .
* @ param file the virtual file
* @ return the URL
* @ throws MalformedURLException if the file cannot be coerced into a URL for some reason
* @ see VirtualFile # asDirectoryURL ( )
* @ see VirtualFile # asFileURL ( ) */
public static URL getVirtualURL ( VirtualFile file ) throws MalformedURLException { } } | try { final URI uri = getVirtualURI ( file ) ; final String scheme = uri . getScheme ( ) ; return AccessController . doPrivileged ( new PrivilegedExceptionAction < URL > ( ) { @ Override public URL run ( ) throws MalformedURLException { if ( VFS_PROTOCOL . equals ( scheme ) ) { return new URL ( null , uri . toString ( ) , VFS_URL_HANDLER ) ; } else if ( "file" . equals ( scheme ) ) { return new URL ( null , uri . toString ( ) , FILE_URL_HANDLER ) ; } else { return uri . toURL ( ) ; } } } ) ; } catch ( URISyntaxException e ) { throw new MalformedURLException ( e . getMessage ( ) ) ; } catch ( PrivilegedActionException e ) { throw ( MalformedURLException ) e . getException ( ) ; } |
public class D6Crud { /** * Set object to the preparedStatement
* @ param parameterIndex
* @ param preparedStmt
* @ param value
* @ throws SQLException */
private void setObject ( int parameterIndex , PreparedStatement preparedStmt , Object value ) throws SQLException { } } | preparedStmt . setObject ( parameterIndex , value ) ; |
public class RecombeeClient { /** * / * End of the generated code */
public BatchResponse [ ] send ( Batch batchRequest ) throws ApiException { } } | if ( batchRequest . getRequests ( ) . size ( ) > this . BATCH_MAX_SIZE ) { return sendMultipartBatchRequest ( batchRequest ) ; } String responseStr = sendRequest ( batchRequest ) ; try { Object [ ] responses = this . mapper . readValue ( responseStr , Object [ ] . class ) ; BatchResponse [ ] result = new BatchResponse [ responses . length ] ; for ( int i = 0 ; i < responses . length ; i ++ ) { Map < String , Object > response = ( Map < String , Object > ) responses [ i ] ; int status = ( Integer ) response . get ( "code" ) ; Object parsedResponse = response . get ( "json" ) ; Request request = batchRequest . getRequests ( ) . get ( i ) ; if ( status != 200 && status != 201 ) { Map < String , Object > exceptionMap = ( Map < String , Object > ) parsedResponse ; parsedResponse = new ResponseException ( request , status , ( String ) exceptionMap . get ( "error" ) ) ; } else { if ( ( request instanceof ItemBasedRecommendation ) || ( request instanceof UserBasedRecommendation ) ) { boolean returnProperties = false ; if ( request instanceof ItemBasedRecommendation ) returnProperties = ( ( ItemBasedRecommendation ) request ) . getReturnProperties ( ) ; if ( request instanceof UserBasedRecommendation ) returnProperties = ( ( UserBasedRecommendation ) request ) . getReturnProperties ( ) ; if ( returnProperties ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Recommendation [ ] ar = new Recommendation [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Recommendation ( ( String ) array . get ( j ) . get ( "itemId" ) , array . get ( j ) ) ; parsedResponse = ar ; } else { ArrayList < String > array = ( ArrayList < String > ) parsedResponse ; Recommendation [ ] ar = new Recommendation [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Recommendation ( array . get ( j ) ) ; parsedResponse = ar ; } } else if ( request instanceof ListItems ) { boolean returnProperties = ( ( ListItems ) request ) . getReturnProperties ( ) ; if ( returnProperties ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Item [ ] ar = new Item [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Item ( ( String ) array . get ( j ) . get ( "itemId" ) , array . get ( j ) ) ; parsedResponse = ar ; } else { ArrayList < String > array = ( ArrayList < String > ) parsedResponse ; Item [ ] ar = new Item [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Item ( array . get ( j ) ) ; parsedResponse = ar ; } } else if ( request instanceof ListUsers ) { boolean returnProperties = ( ( ListUsers ) request ) . getReturnProperties ( ) ; if ( returnProperties ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; User [ ] ar = new User [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new User ( ( String ) array . get ( j ) . get ( "userId" ) , array . get ( j ) ) ; parsedResponse = ar ; } else { ArrayList < String > array = ( ArrayList < String > ) parsedResponse ; User [ ] ar = new User [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new User ( array . get ( j ) ) ; parsedResponse = ar ; } } else if ( ( request instanceof RecommendItemsToUser ) || ( request instanceof RecommendUsersToUser ) || ( request instanceof RecommendItemsToItem ) || ( request instanceof RecommendUsersToItem ) ) { parsedResponse = mapper . convertValue ( parsedResponse , RecommendationResponse . class ) ; } /* Start of the generated code */
else if ( request instanceof GetItemPropertyInfo ) { Map < String , Object > obj = ( Map < String , Object > ) parsedResponse ; parsedResponse = new PropertyInfo ( obj ) ; } else if ( request instanceof ListItemProperties ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; PropertyInfo [ ] ar = new PropertyInfo [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new PropertyInfo ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListSeries ) { ArrayList < String > array = ( ArrayList < String > ) parsedResponse ; Series [ ] ar = new Series [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Series ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListSeriesItems ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; SeriesItem [ ] ar = new SeriesItem [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new SeriesItem ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListGroups ) { ArrayList < String > array = ( ArrayList < String > ) parsedResponse ; Group [ ] ar = new Group [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Group ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListGroupItems ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; GroupItem [ ] ar = new GroupItem [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new GroupItem ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof GetUserPropertyInfo ) { Map < String , Object > obj = ( Map < String , Object > ) parsedResponse ; parsedResponse = new PropertyInfo ( obj ) ; } else if ( request instanceof ListUserProperties ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; PropertyInfo [ ] ar = new PropertyInfo [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new PropertyInfo ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemDetailViews ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; DetailView [ ] ar = new DetailView [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new DetailView ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserDetailViews ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; DetailView [ ] ar = new DetailView [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new DetailView ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemPurchases ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Purchase [ ] ar = new Purchase [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Purchase ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserPurchases ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Purchase [ ] ar = new Purchase [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Purchase ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemRatings ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Rating [ ] ar = new Rating [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Rating ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserRatings ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Rating [ ] ar = new Rating [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Rating ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemCartAdditions ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; CartAddition [ ] ar = new CartAddition [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new CartAddition ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserCartAdditions ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; CartAddition [ ] ar = new CartAddition [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new CartAddition ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemBookmarks ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Bookmark [ ] ar = new Bookmark [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Bookmark ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserBookmarks ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; Bookmark [ ] ar = new Bookmark [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new Bookmark ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListItemViewPortions ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; ViewPortion [ ] ar = new ViewPortion [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new ViewPortion ( array . get ( j ) ) ; parsedResponse = ar ; } else if ( request instanceof ListUserViewPortions ) { ArrayList < Map < String , Object > > array = ( ArrayList < Map < String , Object > > ) parsedResponse ; ViewPortion [ ] ar = new ViewPortion [ array . size ( ) ] ; for ( int j = 0 ; j < ar . length ; j ++ ) ar [ j ] = new ViewPortion ( array . get ( j ) ) ; parsedResponse = ar ; } /* End of the generated code */
} result [ i ] = new BatchResponse ( status , parsedResponse ) ; } return result ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; |
public class Message { /** * Publishes a message via the given channel while using the specified delivery options .
* @ param channel The channel used to publish the message on
* @ param deliveryOptions The delivery options to use
* @ throws IOException */
public void publish ( Channel channel , DeliveryOptions deliveryOptions ) throws IOException { } } | // Assure to have a timestamp
if ( basicProperties . getTimestamp ( ) == null ) { basicProperties . builder ( ) . timestamp ( new Date ( ) ) ; } boolean mandatory = deliveryOptions == DeliveryOptions . MANDATORY ; boolean immediate = deliveryOptions == DeliveryOptions . IMMEDIATE ; LOGGER . info ( "Publishing message to exchange '{}' with routing key '{}' (deliveryOptions: {}, persistent: {})" , new Object [ ] { exchange , routingKey , deliveryOptions , basicProperties . getDeliveryMode ( ) == 2 } ) ; channel . basicPublish ( exchange , routingKey , mandatory , immediate , basicProperties , bodyContent ) ; LOGGER . info ( "Successfully published message to exchange '{}' with routing key '{}'" , exchange , routingKey ) ; |
public class rnat6_nsip6_binding { /** * Use this API to fetch rnat6 _ nsip6 _ binding resources of given name . */
public static rnat6_nsip6_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | rnat6_nsip6_binding obj = new rnat6_nsip6_binding ( ) ; obj . set_name ( name ) ; rnat6_nsip6_binding response [ ] = ( rnat6_nsip6_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class FairScheduler { /** * Get the jobs that were not admitted and all the info needed for
* display . The reasons of why the jobs were not admitted were set by
* the fair scheduler , but will be adjusted when this method is called
* based on the current job initializer admission control data .
* @ return Collection of jobs that were not admitted and their reasons . */
synchronized Collection < NotAdmittedJobInfo > getNotAdmittedJobs ( ) { } } | List < NotAdmittedJobInfo > jobInfoList = new ArrayList < NotAdmittedJobInfo > ( infos . size ( ) ) ; AdmissionControlData admissionControlData = jobInitializer . getAdmissionControlData ( ) ; float averageWaitMsecsPerHardAdmissionJob = jobInitializer . getAverageWaitMsecsPerHardAdmissionJob ( ) ; for ( Map . Entry < JobInProgress , JobInfo > entry : infos . entrySet ( ) ) { JobInProgress job = entry . getKey ( ) ; JobInfo jobInfo = entry . getValue ( ) ; if ( ! jobInfo . needsInitializing ) { continue ; } String poolName = poolMgr . getPoolName ( job ) ; // Adjust the not admitted reason with admission control data for
// any soft or hard limits
BlockedAdmissionReason reason = adjustClusterwideReason ( admissionControlData , jobInfo . reason , poolName ) ; jobInfoList . add ( new NotAdmittedJobInfo ( job . getStartTime ( ) , job . getJobID ( ) . toString ( ) , job . getJobConf ( ) . getUser ( ) , poolName , job . getPriority ( ) . toString ( ) , reason , jobInfo . reasonLimit , jobInfo . actualValue , jobInfo . hardAdmissionPosition , averageWaitMsecsPerHardAdmissionJob ) ) ; } return jobInfoList ; |
public class PRJUtil { /** * Get a valid SRID value from a prj file .
* If the the prj file
* - is null ,
* - doesn ' t contain a valid srid code ,
* - is empty *
* then a default srid equals to 0 is added .
* @ param connection
* @ param prjFile
* @ return
* @ throws SQLException
* @ throws IOException */
public static int getValidSRID ( Connection connection , File prjFile ) throws SQLException , IOException { } } | int srid = getSRID ( prjFile ) ; if ( ! isSRIDValid ( srid , connection ) ) { srid = 0 ; } return srid ; |
public class BccClient { /** * Modifying the special attribute to new value of the instance .
* You can reboot the instance only when the instance is Running or Stopped ,
* otherwise , it ' s will get < code > 409 < / code > errorCode .
* @ param request The request containing all options for modifying the instance attribute . */
public void modifyInstanceAttributes ( ModifyInstanceAttributesRequest request ) { } } | checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; checkStringNotEmpty ( request . getName ( ) , "request name should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , INSTANCE_PREFIX , request . getInstanceId ( ) ) ; internalRequest . addParameter ( InstanceAction . modifyAttribute . name ( ) , null ) ; fillPayload ( internalRequest , request ) ; this . invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ; |
public class WebAppConfiguration { /** * PM84305 - start */
public void setDisableStaticMappingCache ( ) { } } | if ( this . contextParams != null ) { String value = ( String ) this . contextParams . get ( "com.ibm.ws.webcontainer.DISABLE_STATIC_MAPPING_CACHE" ) ; if ( value != null ) { if ( value . equalsIgnoreCase ( "true" ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "cxtParam disable static mapping cache for application -> " + applicationName ) ; this . setDisableStaticMappingCache ( true ) ; } return ; } } if ( WCCustomProperties . DISABLE_STATIC_MAPPING_CACHE != null ) { String disableStaticMappingCacheApp = WCCustomProperties . DISABLE_STATIC_MAPPING_CACHE ; if ( disableStaticMappingCacheApp . equals ( "*" ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "disable static mapping cache for all apps." ) ; this . setDisableStaticMappingCache ( true ) ; return ; } else { String [ ] parsedStr = disableStaticMappingCacheApp . split ( "," ) ; for ( String toCheckStr : parsedStr ) { toCheckStr = toCheckStr . trim ( ) ; if ( applicationName != null && applicationName . equalsIgnoreCase ( toCheckStr ) ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "setDisableStaticMappingCache" , "disable static mapping cache for application -> " + applicationName ) ; this . setDisableStaticMappingCache ( true ) ; return ; } } } } |
public class RequestUtil { /** * Retrieves a number in the selectors and returns it if present otherwise the default value .
* @ param request the request object with the selector info
* @ param groupPattern the regex to extract the value - as group ' 1 ' ; e . g . ' key ( [ \ d ] + ) '
* @ param defaultValue the default number value */
public static int getIntSelector ( SlingHttpServletRequest request , Pattern groupPattern , int defaultValue ) { } } | String [ ] selectors = request . getRequestPathInfo ( ) . getSelectors ( ) ; for ( String selector : selectors ) { Matcher matcher = groupPattern . matcher ( selector ) ; if ( matcher . matches ( ) ) { try { return Integer . parseInt ( matcher . group ( 1 ) ) ; } catch ( NumberFormatException nfex ) { // ok , try next
} } } return defaultValue ; |
public class IntegerSequence { /** * Returns the next generated value .
* @ return the next generated value .
* @ throws java . util . NoSuchElementException if the iteration has no more value . */
@ Override public Integer next ( ) { } } | if ( ! hasNext ( ) ) { throw new NoSuchElementException ( toString ( ) + " ended" ) ; } current = next ; next = next + increment ; return current ( ) ; |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1266:1 : classCreatorRest : arguments ( classBody ) ? ; */
public final void classCreatorRest ( ) throws RecognitionException { } } | int classCreatorRest_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 134 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1267:5 : ( arguments ( classBody ) ? )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1267:7 : arguments ( classBody ) ?
{ pushFollow ( FOLLOW_arguments_in_classCreatorRest6179 ) ; arguments ( ) ; state . _fsp -- ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1267:17 : ( classBody ) ?
int alt185 = 2 ; int LA185_0 = input . LA ( 1 ) ; if ( ( LA185_0 == 121 ) ) { alt185 = 1 ; } switch ( alt185 ) { case 1 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1267:17 : classBody
{ pushFollow ( FOLLOW_classBody_in_classCreatorRest6181 ) ; classBody ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving
if ( state . backtracking > 0 ) { memoize ( input , 134 , classCreatorRest_StartIndex ) ; } } |
public class ParseLog { /** * / * [ deutsch ]
* < p > Bereitet diese Instanz auf die Wiederverwendung f & uuml ; r einen
* neuen Interpretierungsvorgang vor . < / p >
* @ since 3.0 */
public void reset ( ) { } } | this . pp . setIndex ( 0 ) ; this . pp . setErrorIndex ( - 1 ) ; this . errorMessage = "" ; this . warning = false ; this . rawValues = null ; |
public class ListLocalDisksResult { /** * A JSON object containing the following fields :
* < ul >
* < li >
* < a > ListLocalDisksOutput $ Disks < / a >
* < / li >
* < / ul >
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDisks ( java . util . Collection ) } or { @ link # withDisks ( java . util . Collection ) } if you want to override the
* existing values .
* @ param disks
* A JSON object containing the following fields : < / p >
* < ul >
* < li >
* < a > ListLocalDisksOutput $ Disks < / a >
* < / li >
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListLocalDisksResult withDisks ( Disk ... disks ) { } } | if ( this . disks == null ) { setDisks ( new com . amazonaws . internal . SdkInternalList < Disk > ( disks . length ) ) ; } for ( Disk ele : disks ) { this . disks . add ( ele ) ; } return this ; |
public class DetectionPoint { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } } | if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case ID : return isSetId ( ) ; case CATEGORY : return isSetCategory ( ) ; case LABEL : return isSetLabel ( ) ; case THRESHOLD : return isSetThreshold ( ) ; case RESPONSES : return isSetResponses ( ) ; } throw new IllegalStateException ( ) ; |
public class PatchedBigQueryTableRowIterator { /** * Delete the given dataset . This will fail if the given dataset has any tables . */
private void deleteDataset ( String datasetId ) throws IOException , InterruptedException { } } | executeWithBackOff ( client . datasets ( ) . delete ( projectId , datasetId ) , String . format ( "Error when trying to delete the temporary dataset %s in project %s. " + "Manual deletion may be required." , datasetId , projectId ) ) ; |
public class DolphinServlet { /** * Creates a new instance of { @ code DefaultServerDolphin } .
* Subclasses may override this method to customize how this instance should be created .
* @ return a newly created { @ code DefaultServerDolphin } . */
protected DefaultServerDolphin createServerDolphin ( ) { } } | ServerModelStore modelStore = createServerModelStore ( ) ; ServerConnector connector = createServerConnector ( modelStore , createCodec ( ) ) ; return new DefaultServerDolphin ( modelStore , connector ) ; |
public class IoUtil { /** * Writes the specified { @ code message } to the specified { @ code sessions } .
* If the specified { @ code message } is an { @ link IoBuffer } , the buffer is
* automatically duplicated using { @ link IoBuffer # duplicate ( ) } . */
public static List < WriteFuture > broadcast ( Object message , Iterator < IoSession > sessions ) { } } | List < WriteFuture > answer = new ArrayList < > ( ) ; broadcast ( message , sessions , answer ) ; return answer ; |
public class JavacParser { /** * BracketsOpt = { [ Annotations ] " [ " " ] " } *
* < code > annotations < / code > is the list of annotations targeting
* the expression < code > t < / code > . */
private JCExpression bracketsOpt ( JCExpression t , List < JCAnnotation > annotations ) { } } | List < JCAnnotation > nextLevelAnnotations = typeAnnotationsOpt ( ) ; if ( token . kind == LBRACKET ) { int pos = token . pos ; nextToken ( ) ; t = bracketsOptCont ( t , pos , nextLevelAnnotations ) ; } else if ( ! nextLevelAnnotations . isEmpty ( ) ) { if ( permitTypeAnnotationsPushBack ) { this . typeAnnotationsPushedBack = nextLevelAnnotations ; } else { return illegal ( nextLevelAnnotations . head . pos ) ; } } if ( ! annotations . isEmpty ( ) ) { t = toP ( F . at ( token . pos ) . AnnotatedType ( annotations , t ) ) ; } return t ; |
public class Exceptions { /** * Generate a { @ link RuntimeAssertion }
* @ param cause
* Existing { @ link Throwable } to wrap in a new
* { @ code IllegalArgumentException }
* @ param pattern
* { @ link String # format ( String , Object . . . ) String . format ( ) }
* pattern
* @ param parameters
* { @ code String . format ( ) } parameters
* @ return A new { @ code IllegalArgumentException } */
public static RuntimeAssertion RuntimeAssertion ( Throwable cause , String pattern , Object ... parameters ) { } } | return strip ( new RuntimeAssertion ( String . format ( pattern , parameters ) , cause ) ) ; |
public class JsonWriter { /** * Encodes { @ code value } . Output is < code > true < / code > or < code > false < / code > .
* @ throws org . sonar . api . utils . text . WriterException on any failure */
public JsonWriter value ( boolean value ) { } } | try { stream . value ( value ) ; return this ; } catch ( Exception e ) { throw rethrow ( e ) ; } |
public class OkapiUI { /** * GEN - LAST : event _ exitButtonActionPerformed */
private void loadDataButtonActionPerformed ( java . awt . event . ActionEvent evt ) { } } | // GEN - FIRST : event _ loadDataButtonActionPerformed
// Load more data from file
MoreData addme = new MoreData ( ) ; addme . setLocationRelativeTo ( this ) ; addme . setVisible ( true ) ; |
public class ProcessExecutor { /** * Sets the allowed exit values for the process being executed .
* @ param exitValues set of exit values or < code > null < / code > if all exit values are allowed .
* @ return This process executor . */
public ProcessExecutor exitValues ( Integer ... exitValues ) { } } | allowedExitValues = exitValues == null ? null : new HashSet < Integer > ( Arrays . asList ( exitValues ) ) ; return this ; |
public class FontChooser { /** * Set the style of the selected font .
* @ param style the size of the selected font .
* < code > Font . PLAIN < / code > , < code > Font . BOLD < / code > ,
* < code > Font . ITALIC < / code > , or
* < code > Font . BOLD | Font . ITALIC < / code > .
* @ see java . awt . Font # PLAIN
* @ see java . awt . Font # BOLD
* @ see java . awt . Font # ITALIC
* @ see # getSelectedFontStyle */
public FontChooser setSelectedFontStyle ( int style ) { } } | for ( int i = 0 ; i < FONT_STYLE_CODES . length ; i ++ ) { if ( FONT_STYLE_CODES [ i ] == style ) { getFontStyleList ( ) . setSelectedIndex ( i ) ; break ; } } updateSampleFont ( ) ; return this ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.