signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AppServicePlansInner { /** * Create or update a Virtual Network route in an App Service plan .
* Create or update a Virtual Network route in an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param vnetName Name of the Virtual Network .
* @ param routeName Name of the Virtual Network route .
* @ param route Definition of the Virtual Network route .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the VnetRouteInner object */
public Observable < VnetRouteInner > createOrUpdateVnetRouteAsync ( String resourceGroupName , String name , String vnetName , String routeName , VnetRouteInner route ) { } } | return createOrUpdateVnetRouteWithServiceResponseAsync ( resourceGroupName , name , vnetName , routeName , route ) . map ( new Func1 < ServiceResponse < VnetRouteInner > , VnetRouteInner > ( ) { @ Override public VnetRouteInner call ( ServiceResponse < VnetRouteInner > response ) { return response . body ( ) ; } } ) ; |
public class ReportBreakScreen { /** * Get the value to break on .
* By default , use the first field of the current key ( as long as it isn ' t the counter ) .
* @ return The break value . */
public Object getBreakValue ( ) { } } | BaseField field = null ; if ( this . getMainRecord ( ) != null ) field = this . getMainRecord ( ) . getKeyArea ( ) . getField ( 0 ) ; if ( field != null ) if ( ! ( field instanceof CounterField ) ) return field . getData ( ) ; return INITIAL_VALUE ; // Override this |
public class TemperatureConversion { /** * Convert a temperature value from the Kelvin temperature scale to another .
* @ param to TemperatureScale
* @ param temperature value in Kelvin
* @ return converted temperature value in the requested to scale */
public static double convertFromKelvin ( TemperatureScale to , double temperature ) { } } | switch ( to ) { case FARENHEIT : return convertKelvinToFarenheit ( temperature ) ; case CELSIUS : return convertKelvinToCelsius ( temperature ) ; case KELVIN : return temperature ; case RANKINE : return convertKelvinToRankine ( temperature ) ; default : throw ( new RuntimeException ( "Invalid termpature conversion" ) ) ; } |
public class TableInfo { /** * Returns a { @ code TableInfo } object given table identity and definition . Use { @ link
* StandardTableDefinition } to create simple BigQuery table . Use { @ link ViewDefinition } to create
* a BigQuery view . Use { @ link ExternalTableDefinition } to create a BigQuery a table backed by
* external data . */
public static TableInfo of ( TableId tableId , TableDefinition definition ) { } } | return newBuilder ( tableId , definition ) . build ( ) ; |
public class CertificatesInner { /** * Verify certificate ' s private key possession .
* Verifies the certificate ' s private key possession by providing the leaf cert issued by the verifying pre uploaded certificate .
* @ param resourceGroupName The name of the resource group that contains the IoT hub .
* @ param resourceName The name of the IoT hub .
* @ param certificateName The name of the certificate
* @ param ifMatch ETag of the Certificate .
* @ param certificate base - 64 representation of X509 certificate . cer file or just . pem file content .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the CertificateDescriptionInner object */
public Observable < CertificateDescriptionInner > verifyAsync ( String resourceGroupName , String resourceName , String certificateName , String ifMatch , String certificate ) { } } | return verifyWithServiceResponseAsync ( resourceGroupName , resourceName , certificateName , ifMatch , certificate ) . map ( new Func1 < ServiceResponse < CertificateDescriptionInner > , CertificateDescriptionInner > ( ) { @ Override public CertificateDescriptionInner call ( ServiceResponse < CertificateDescriptionInner > response ) { return response . body ( ) ; } } ) ; |
public class FilterFileSystem { /** * The src files are on the local disk . Add it to FS at
* the given dst name .
* delSrc indicates if the source should be removed */
public void copyFromLocalFile ( boolean delSrc , boolean overwrite , Path [ ] srcs , Path dst ) throws IOException { } } | fs . copyFromLocalFile ( delSrc , overwrite , srcs , dst ) ; |
public class RowMapperSkinny { /** * { @ inheritDoc } */
@ Override public Columns columns ( Row row ) { } } | Columns columns = new Columns ( ) ; columns . addAll ( partitionKeyMapper . columns ( row ) ) ; columns . addAll ( regularCellsMapper . columns ( row ) ) ; return columns ; |
public class ESigList { /** * Adds a sig item to the list . Requests to add items already in the list are ignored . If an
* item is successfully added , an ESIG . ADD event is fired .
* @ param item A sig item .
* @ return The item that was added . */
public ESigItem add ( ESigItem item ) { } } | if ( ! items . contains ( item ) ) { items . add ( item ) ; fireEvent ( "ADD" , item ) ; } return item ; |
public class SessionStateEventDispatcher { /** * Method sessionMaxInactiveTimeSet
* @ see com . ibm . wsspi . session . ISessionStateObserver # sessionMaxInactiveTimeSet ( com . ibm . wsspi . session . ISession , int , int ) */
public void sessionMaxInactiveTimeSet ( ISession session , int old , int newval ) { } } | // ArrayList sessionStateObservers = null ;
/* * Check to see if there is a non - empty list of sessionStateObservers . */
if ( _sessionStateObservers == null || _sessionStateObservers . size ( ) < 1 ) { return ; } // synchronized ( _ sessionStateObservers ) {
// sessionStateObservers = ( ArrayList ) _ sessionStateObservers . clone ( ) ;
ISessionStateObserver sessionStateObserver = null ; for ( int i = 0 ; i < _sessionStateObservers . size ( ) ; i ++ ) { sessionStateObserver = ( ISessionStateObserver ) _sessionStateObservers . get ( i ) ; sessionStateObserver . sessionMaxInactiveTimeSet ( session , old , newval ) ; } |
public class C40Encoder { /** * Handle " end of data " situations
* @ param context the encoder context
* @ param buffer the buffer with the remaining encoded characters */
void handleEOD ( EncoderContext context , StringBuilder buffer ) { } } | int unwritten = ( buffer . length ( ) / 3 ) * 2 ; int rest = buffer . length ( ) % 3 ; int curCodewordCount = context . getCodewordCount ( ) + unwritten ; context . updateSymbolInfo ( curCodewordCount ) ; int available = context . getSymbolInfo ( ) . getDataCapacity ( ) - curCodewordCount ; if ( rest == 2 ) { buffer . append ( '\0' ) ; // Shift 1
while ( buffer . length ( ) >= 3 ) { writeNextTriplet ( context , buffer ) ; } if ( context . hasMoreCharacters ( ) ) { context . writeCodeword ( HighLevelEncoder . C40_UNLATCH ) ; } } else if ( available == 1 && rest == 1 ) { while ( buffer . length ( ) >= 3 ) { writeNextTriplet ( context , buffer ) ; } if ( context . hasMoreCharacters ( ) ) { context . writeCodeword ( HighLevelEncoder . C40_UNLATCH ) ; } // else no unlatch
context . pos -- ; } else if ( rest == 0 ) { while ( buffer . length ( ) >= 3 ) { writeNextTriplet ( context , buffer ) ; } if ( available > 0 || context . hasMoreCharacters ( ) ) { context . writeCodeword ( HighLevelEncoder . C40_UNLATCH ) ; } } else { throw new IllegalStateException ( "Unexpected case. Please report!" ) ; } context . signalEncoderChange ( HighLevelEncoder . ASCII_ENCODATION ) ; |
public class Module { /** * Converts this module to a normal module with the given dependences
* @ throws IllegalArgumentException if this module is not an automatic module */
public Module toNormalModule ( Map < String , Boolean > requires ) { } } | if ( ! isAutomatic ( ) ) { throw new IllegalArgumentException ( name ( ) + " not an automatic module" ) ; } return new NormalModule ( this , requires ) ; |
public class ACModelProperties { /** * - - Model type */
protected void setType ( ACModelType type ) { } } | Validate . notNull ( type ) ; setProperty ( ACModelProperty . MODEL_TYPE , type . toString ( ) ) ; |
public class AppServicePlansInner { /** * Get all routes that are associated with a Virtual Network in an App Service plan .
* Get all routes that are associated with a Virtual Network in an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @ param vnetName Name of the Virtual Network .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the List & lt ; VnetRouteInner & gt ; object if successful . */
public List < VnetRouteInner > listRoutesForVnet ( String resourceGroupName , String name , String vnetName ) { } } | return listRoutesForVnetWithServiceResponseAsync ( resourceGroupName , name , vnetName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class GlazedTableModel { /** * Create the text for the column headers . Use the model Id ( if any ) and the column property name to generate a
* series of message keys . Resolve those keys using the configured message source .
* @ param propertyColumnNames
* @ return array of column header text */
protected String [ ] createColumnNames ( String [ ] propertyColumnNames ) { } } | int size = propertyColumnNames . length ; String [ ] columnNames = new String [ size ] ; FieldFaceSource source = getFieldFaceSource ( ) ; for ( int i = 0 ; i < size ; i ++ ) { columnNames [ i ] = source . getFieldFace ( propertyColumnNames [ i ] , getModelId ( ) ) . getLabelInfo ( ) . getText ( ) ; } return columnNames ; |
public class MtasCQLParserSentencePartCondition { /** * Sets the first occurence .
* @ param min the min
* @ param max the max
* @ throws ParseException the parse exception */
public void setFirstOccurence ( int min , int max ) throws ParseException { } } | if ( fullCondition == null ) { if ( ( min < 0 ) || ( min > max ) || ( max < 1 ) ) { throw new ParseException ( "Illegal number {" + min + "," + max + "}" ) ; } if ( min == 0 ) { firstOptional = true ; } firstMinimumOccurence = Math . max ( 1 , min ) ; firstMaximumOccurence = max ; } else { throw new ParseException ( "fullCondition already generated" ) ; } |
public class PlatformBitmapFactory { /** * Creates a bitmap of the specified width and height .
* The bitmap will be created with the default ARGB _ 8888 configuration
* @ param width the width of the bitmap
* @ param height the height of the bitmap
* @ param callerContext the Tag to track who create the Bitmap
* @ return a reference to the bitmap
* @ throws TooManyBitmapsException if the pool is full
* @ throws java . lang . OutOfMemoryError if the Bitmap cannot be allocated */
public CloseableReference < Bitmap > createBitmap ( int width , int height , @ Nullable Object callerContext ) { } } | return createBitmap ( width , height , Bitmap . Config . ARGB_8888 , callerContext ) ; |
public class SmoothedChartTileSkin { /** * * * * * * Methods * * * * * */
@ Override protected void handleEvents ( final String EVENT_TYPE ) { } } | super . handleEvents ( EVENT_TYPE ) ; if ( "VISIBILITY" . equals ( EVENT_TYPE ) ) { chart . setSymbolsVisible ( tile . getDataPointsVisible ( ) ) ; } else if ( "SERIES" . equals ( EVENT_TYPE ) ) { switch ( tile . getChartType ( ) ) { case AREA : chart . setChartType ( SmoothedChart . ChartType . AREA ) ; break ; default : chart . setChartType ( SmoothedChart . ChartType . LINE ) ; break ; } if ( chart . getData ( ) . isEmpty ( ) ) { chart . getData ( ) . setAll ( tile . getTilesFXSeries ( ) . stream ( ) . map ( tilesFxSeries -> tilesFxSeries . getSeries ( ) ) . collect ( Collectors . toList ( ) ) ) ; tile . getTilesFXSeries ( ) . stream ( ) . forEach ( series -> chart . setSeriesColor ( series . getSeries ( ) , series . getStroke ( ) , series . getFill ( ) , series . getSymbolBackground ( ) , series . getLegendSymbolFill ( ) ) ) ; } } |
public class AppCfgArgs { /** * Returns { @ code [ - - name ] } if value = true , { @ code [ ] } if value = false / null . */
public static List < String > get ( String name , @ Nullable Boolean value ) { } } | if ( Boolean . TRUE . equals ( value ) ) { return Collections . singletonList ( "--" + name ) ; } return Collections . emptyList ( ) ; |
public class WxPayApiConfig { /** * 构建支付中签约Map
* @ return 支付中签约Map */
public Map < String , String > contractorderBuild ( ) { } } | Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "appid" , getAppId ( ) ) ; map . put ( "mch_id" , getMchId ( ) ) ; map . put ( "contract_appid" , getAppId ( ) ) ; map . put ( "contract_mchid" , getMchId ( ) ) ; map . put ( "out_trade_no" , getOutTradeNo ( ) ) ; map . put ( "nonce_str" , getNonceStr ( ) ) ; map . put ( "body" , getBody ( ) ) ; map . put ( "attach" , getAttach ( ) ) ; map . put ( "notify_url" , getNotifyUrl ( ) ) ; map . put ( "total_fee" , getTotalFee ( ) ) ; map . put ( "spbill_create_ip" , getSpbillCreateIp ( ) ) ; map . put ( "trade_type" , getTradeType ( ) . name ( ) ) ; if ( getTradeType ( ) . equals ( TradeType . JSAPI ) ) { map . put ( "openid" , getOpenId ( ) ) ; } map . put ( "plan_id" , getPlanId ( ) ) ; map . put ( "contract_code" , getContractCode ( ) ) ; map . put ( "request_serial" , getRequestSerial ( ) ) ; map . put ( "contract_display_account" , getContractDisplayAccount ( ) ) ; map . put ( "contract_notify_url" , getContractNotifyUrl ( ) ) ; map . put ( "sign" , PaymentKit . createSign ( map , getPaternerKey ( ) ) ) ; return map ; |
public class TAudioFileReader { /** * Get an AudioInputStream object for an InputStream . This method calls
* getAudioInputStream ( InputStream , long ) . Subclasses should not override
* this method unless there are really severe reasons . Normally , it is
* sufficient to implement getAudioFileFormat ( InputStream , long ) and perhaps
* override getAudioInputStream ( InputStream , long ) .
* @ param inputStreamthe stream to read from .
* @ returnan AudioInputStream instance containing the audio data from this
* stream .
* @ throws javax . sound . sampled . UnsupportedAudioFileException
* @ throws java . io . IOException */
@ Override public AudioInputStream getAudioInputStream ( InputStream inputStream ) throws UnsupportedAudioFileException , IOException { } } | LOG . log ( Level . FINE , "TAudioFileReader.getAudioInputStream(InputStream): begin (class: {0})" , getClass ( ) . getSimpleName ( ) ) ; long lFileLengthInBytes = AudioSystem . NOT_SPECIFIED ; AudioInputStream audioInputStream = null ; if ( ! inputStream . markSupported ( ) ) { inputStream = new BufferedInputStream ( inputStream , getMarkLimit ( ) ) ; } inputStream . mark ( getMarkLimit ( ) ) ; try { audioInputStream = getAudioInputStream ( inputStream , lFileLengthInBytes ) ; } catch ( UnsupportedAudioFileException e ) { inputStream . reset ( ) ; throw e ; } catch ( IOException e ) { try { inputStream . reset ( ) ; } catch ( IOException e2 ) { if ( e2 . getCause ( ) == null ) { e2 . initCause ( e ) ; throw e2 ; } } throw e ; } LOG . log ( Level . FINE , "TAudioFileReader.getAudioInputStream(InputStream): end" ) ; return audioInputStream ; |
public class FontUtils { /** * Gets the default font with the specified style and size , correctly scaled
* @ param style
* @ param size
* @ return */
public static Font getFont ( int style , Size size ) { } } | return getFont ( getDefaultFont ( ) , size ) . deriveFont ( style ) ; |
public class ViewMover { /** * Checks whether previous animation on the view completed
* @ return true if previous animation on the view completed , otherwise false */
boolean isPreviousAnimationCompleted ( ) { } } | Animation previousAnimation = view . getAnimation ( ) ; boolean previousAnimationCompleted = previousAnimation == null || previousAnimation . hasEnded ( ) ; if ( ! previousAnimationCompleted ) { LOGGER . warn ( "Unable to move the view. View is being currently moving" ) ; } return previousAnimationCompleted ; |
public class JSONObject { /** * Returns the value mapped by { @ code name } if it exists and is a { @ code
* JSONObject } . Returns null otherwise .
* @ param name the name of the property
* @ return the value or { @ code null } */
public JSONObject optJSONObject ( String name ) { } } | Object object = opt ( name ) ; return object instanceof JSONObject ? ( JSONObject ) object : null ; |
public class Hierarchy { /** * Resolve possible instance method call targets .
* @ param receiverType
* type of the receiver object
* @ param invokeInstruction
* the InvokeInstruction
* @ param cpg
* the ConstantPoolGen
* @ param receiverTypeIsExact
* if true , the receiver type is known exactly , which should
* allow a precise result
* @ return Set of methods which might be called
* @ throws ClassNotFoundException */
public static Set < JavaClassAndMethod > resolveMethodCallTargets ( ReferenceType receiverType , InvokeInstruction invokeInstruction , ConstantPoolGen cpg , boolean receiverTypeIsExact ) throws ClassNotFoundException { } } | HashSet < JavaClassAndMethod > result = new HashSet < > ( ) ; if ( invokeInstruction . getOpcode ( ) == Const . INVOKESTATIC ) { throw new IllegalArgumentException ( ) ; } String methodName = invokeInstruction . getName ( cpg ) ; String methodSig = invokeInstruction . getSignature ( cpg ) ; // Array method calls aren ' t virtual .
// They should just resolve to Object methods .
if ( receiverType instanceof ArrayType ) { JavaClass javaLangObject = AnalysisContext . currentAnalysisContext ( ) . lookupClass ( Values . DOTTED_JAVA_LANG_OBJECT ) ; JavaClassAndMethod classAndMethod = findMethod ( javaLangObject , methodName , methodSig , INSTANCE_METHOD ) ; if ( classAndMethod != null ) { result . add ( classAndMethod ) ; } return result ; } if ( receiverType instanceof NullType ) { return Collections . < JavaClassAndMethod > emptySet ( ) ; } AnalysisContext analysisContext = AnalysisContext . currentAnalysisContext ( ) ; // Get the receiver class .
String receiverClassName = ( ( ObjectType ) receiverType ) . getClassName ( ) ; JavaClass receiverClass = analysisContext . lookupClass ( receiverClassName ) ; ClassDescriptor receiverDesc = DescriptorFactory . createClassDescriptorFromDottedClassName ( receiverClassName ) ; // Figure out the upper bound for the method .
// This is what will be called if this is not a virtual call site .
JavaClassAndMethod upperBound = findMethod ( receiverClass , methodName , methodSig , CONCRETE_METHOD ) ; if ( upperBound == null ) { upperBound = findInvocationLeastUpperBound ( receiverClass , methodName , methodSig , CONCRETE_METHOD , false ) ; } if ( upperBound != null ) { if ( DEBUG_METHOD_LOOKUP ) { System . out . println ( "Adding upper bound: " + SignatureConverter . convertMethodSignature ( upperBound . getJavaClass ( ) , upperBound . getMethod ( ) ) ) ; } result . add ( upperBound ) ; } // Is this a virtual call site ?
boolean virtualCall = ( invokeInstruction . getOpcode ( ) == Const . INVOKEVIRTUAL || invokeInstruction . getOpcode ( ) == Const . INVOKEINTERFACE ) && ( upperBound == null || ! upperBound . getJavaClass ( ) . isFinal ( ) && ! upperBound . getMethod ( ) . isFinal ( ) ) && ! receiverTypeIsExact ; if ( virtualCall ) { if ( ! Values . DOTTED_JAVA_LANG_OBJECT . equals ( receiverClassName ) ) { // This is a true virtual call : assume that any concrete
// subtype method may be called .
Set < ClassDescriptor > subTypeSet = analysisContext . getSubtypes2 ( ) . getSubtypes ( receiverDesc ) ; for ( ClassDescriptor subtype : subTypeSet ) { XMethod concreteSubtypeMethod = findMethod ( subtype , methodName , methodSig , false ) ; if ( concreteSubtypeMethod != null && ( concreteSubtypeMethod . getAccessFlags ( ) & Const . ACC_ABSTRACT ) == 0 ) { result . add ( new JavaClassAndMethod ( concreteSubtypeMethod ) ) ; } } if ( false && subTypeSet . size ( ) > 500 ) { new RuntimeException ( receiverClassName + " has " + subTypeSet . size ( ) + " subclasses, " + result . size ( ) + " of which implement " + methodName + methodSig + " " + invokeInstruction ) . printStackTrace ( System . out ) ; } } } return result ; |
public class UniverseApi { /** * Get names and categories for a set of IDs Resolve a set of IDs to names
* and categories . Supported ID & # 39 ; s for resolving are : Characters ,
* Corporations , Alliances , Stations , Solar Systems , Constellations ,
* Regions , Types , Factions - - -
* @ param requestBody
* The ids to resolve ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ return ApiResponse & lt ; List & lt ; UniverseNamesResponse & gt ; & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < List < UniverseNamesResponse > > postUniverseNamesWithHttpInfo ( List < Integer > requestBody , String datasource ) throws ApiException { } } | com . squareup . okhttp . Call call = postUniverseNamesValidateBeforeCall ( requestBody , datasource , null ) ; Type localVarReturnType = new TypeToken < List < UniverseNamesResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class CassandraUtil { /** * Returns keys that concatenate the serviceName associated with an annotation or tag .
* @ see QueryRequest # annotationQuery ( ) */
static Set < String > annotationKeys ( Span span ) { } } | Set < String > annotationKeys = new LinkedHashSet < > ( ) ; String localServiceName = span . localServiceName ( ) ; if ( localServiceName == null ) return Collections . emptySet ( ) ; for ( Annotation a : span . annotations ( ) ) { // don ' t index core annotations as they aren ' t queryable
if ( CORE_ANNOTATIONS . contains ( a . value ( ) ) ) continue ; annotationKeys . add ( localServiceName + ":" + a . value ( ) ) ; } for ( Map . Entry < String , String > e : span . tags ( ) . entrySet ( ) ) { if ( e . getValue ( ) . length ( ) <= LONGEST_VALUE_TO_INDEX ) { annotationKeys . add ( localServiceName + ":" + e . getKey ( ) ) ; annotationKeys . add ( localServiceName + ":" + e . getKey ( ) + ":" + e . getValue ( ) ) ; } } return annotationKeys ; |
public class CarbonManager { /** * Notify server to change the carbons state . This method blocks
* some time until the server replies to the IQ and returns true on
* success .
* You should first check for support using isSupportedByServer ( ) .
* @ param new _ state whether carbons should be enabled or disabled
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public synchronized void setCarbonsEnabled ( final boolean new_state ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | if ( enabled_state == new_state ) return ; IQ setIQ = carbonsEnabledIQ ( new_state ) ; connection ( ) . createStanzaCollectorAndSend ( setIQ ) . nextResultOrThrow ( ) ; enabled_state = new_state ; |
public class MediaHttpDownloader { /** * Sets the media content length from the HTTP Content - Range header ( E . g a header of
* " Content - Range : 0-55/1000 " would cause 1000 to be set . < code > null < / code > headers do not set
* anything .
* @ param rangeHeader in the HTTP response */
private void setMediaContentLength ( String rangeHeader ) { } } | if ( rangeHeader == null ) { return ; } if ( mediaContentLength == 0 ) { mediaContentLength = Long . parseLong ( rangeHeader . substring ( rangeHeader . indexOf ( '/' ) + 1 ) ) ; } |
public class DRL6Expressions { /** * $ ANTLR start synpred9 _ DRL6Expressions */
public final void synpred9_DRL6Expressions_fragment ( ) throws RecognitionException { } } | // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 396:5 : ( operator | LEFT _ PAREN )
int alt98 = 2 ; int LA98_0 = input . LA ( 1 ) ; if ( ( LA98_0 == EQUALS || ( LA98_0 >= GREATER && LA98_0 <= GREATER_EQUALS ) || ( LA98_0 >= LESS && LA98_0 <= LESS_EQUALS ) || LA98_0 == NOT_EQUALS || LA98_0 == TILDE ) ) { alt98 = 1 ; } else if ( ( LA98_0 == ID ) && ( ( ( ( helper . validateIdentifierKey ( DroolsSoftKeywords . NOT ) ) ) || ( ( helper . isPluggableEvaluator ( false ) ) ) ) ) ) { alt98 = 1 ; } else if ( ( LA98_0 == LEFT_PAREN ) ) { alt98 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 98 , 0 , input ) ; throw nvae ; } switch ( alt98 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 396:7 : operator
{ pushFollow ( FOLLOW_operator_in_synpred9_DRL6Expressions1846 ) ; operator ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; case 2 : // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 396:18 : LEFT _ PAREN
{ match ( input , LEFT_PAREN , FOLLOW_LEFT_PAREN_in_synpred9_DRL6Expressions1850 ) ; if ( state . failed ) return ; } break ; } |
public class XAResourceWrapperStatImpl { /** * { @ inheritDoc } */
public int prepare ( Xid xid ) throws XAException { } } | long l1 = System . currentTimeMillis ( ) ; try { return super . prepare ( xid ) ; } finally { xastat . deltaPrepare ( System . currentTimeMillis ( ) - l1 ) ; } |
public class DescribeTagsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeTagsRequest describeTagsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeTagsRequest . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( describeTagsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeTagsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AbstractWarningsParser { /** * Creates a new instance of { @ link Warning } using the parser ' s group as
* warning type .
* @ param fileName
* the name of the file
* @ param start
* the first line of the line range
* @ param category
* the warning category
* @ param message
* the message of the warning
* @ return the warning */
public Warning createWarning ( final String fileName , final int start , final String category , final String message ) { } } | return new Warning ( fileName , start , getGroup ( ) , category , message ) ; |
public class IfcFillAreaStyleImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcFillStyleSelect > getFillStyles ( ) { } } | return ( EList < IfcFillStyleSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_FILL_AREA_STYLE__FILL_STYLES , true ) ; |
public class SparkLine { /** * Returns the value smoothed by a hermite interpolation function
* @ param Y0
* @ param Y1
* @ param Y2
* @ param Y3
* @ param MU
* @ param TENSION
* @ param BIAS
* @ return the value smoothed by a hermite interpolation function */
private double hermiteInterpolate ( final double Y0 , final double Y1 , final double Y2 , final double Y3 , final double MU , final double TENSION , final double BIAS ) { } } | double m0 ; double m1 ; final double MU2 ; final double Mu3 ; final double A0 ; final double A1 ; final double A2 ; final double A3 ; MU2 = MU * MU ; Mu3 = MU2 * MU ; m0 = ( Y1 - Y0 ) * ( 1 + BIAS ) * ( 1 - TENSION ) / 2 ; m0 += ( Y2 - Y1 ) * ( 1 - BIAS ) * ( 1 - TENSION ) / 2 ; m1 = ( Y2 - Y1 ) * ( 1 + BIAS ) * ( 1 - TENSION ) / 2 ; m1 += ( Y3 - Y2 ) * ( 1 - BIAS ) * ( 1 - TENSION ) / 2 ; A0 = ( 2 * Mu3 ) - ( 3 * MU2 ) + 1 ; A1 = Mu3 - ( 2 * MU2 ) + MU ; A2 = Mu3 - MU2 ; A3 = ( - 2 * Mu3 ) + ( 3 * MU2 ) ; return ( ( A0 * Y1 ) + ( A1 * m0 ) + ( A2 * m1 ) + ( A3 * Y2 ) ) ; |
public class Event { /** * Wraps given { @ code params } as { @ link EventResult } and passes them to
* { @ link # postResult ( EventResult ) } . */
public Event postResult ( Object ... params ) { } } | return postResult ( EventResult . create ( ) . result ( params ) . build ( ) ) ; |
public class ClientInterface { /** * Check for dead connections by providing each connection with the current
* time so it can calculate the delta between now and the time the oldest message was
* queued for sending .
* @ param now Current time in milliseconds */
private final void checkForDeadConnections ( final long now ) { } } | final ArrayList < Pair < Connection , Integer > > connectionsToRemove = new ArrayList < Pair < Connection , Integer > > ( ) ; for ( final ClientInterfaceHandleManager cihm : m_cihm . values ( ) ) { // Internal connections don ' t implement calculatePendingWriteDelta ( ) , so check for real connection first
if ( VoltPort . class == cihm . connection . getClass ( ) ) { final int delta = cihm . connection . writeStream ( ) . calculatePendingWriteDelta ( now ) ; if ( delta > CLIENT_HANGUP_TIMEOUT ) { connectionsToRemove . add ( Pair . of ( cihm . connection , delta ) ) ; } } } for ( final Pair < Connection , Integer > p : connectionsToRemove ) { Connection c = p . getFirst ( ) ; networkLog . warn ( "Closing connection to " + c + " because it hasn't read a response that was pending for " + p . getSecond ( ) + " milliseconds" ) ; c . unregister ( ) ; } |
public class Traits { /** * Returns the name of a method without the super trait specific prefix . If the method name
* doesn ' t correspond to a super trait method call , the result will be null .
* @ param origName the name of a method
* @ return null if the name doesn ' t start with the super trait prefix , otherwise the name without the prefix */
public static String [ ] decomposeSuperCallName ( String origName ) { } } | if ( origName . contains ( SUPER_TRAIT_METHOD_PREFIX ) ) { int endIndex = origName . indexOf ( SUPER_TRAIT_METHOD_PREFIX ) ; String tName = origName . substring ( 0 , endIndex ) . replace ( '_' , '.' ) . replace ( ".." , "_" ) ; String fName = origName . substring ( endIndex + SUPER_TRAIT_METHOD_PREFIX . length ( ) ) ; return new String [ ] { tName , fName } ; } return null ; |
public class JsonSlurperClassic { /** * Parse a JSON data structure from content at a given URL .
* @ param url URL containing JSON content
* @ param params connection parameters
* @ param charset the charset for this File
* @ return a data structure of lists and maps
* @ since 2.2.0 */
public Object parse ( URL url , Map params , String charset ) { } } | return parseURL ( url , params , charset ) ; |
public class HtmlRenderKitImpl { /** * Put the renderer on the double map
* @ param componentFamily
* @ param rendererType
* @ param renderer */
synchronized private void _put ( String componentFamily , String rendererType , Renderer renderer ) { } } | Map < String , Renderer > familyRendererMap = _renderers . get ( componentFamily ) ; if ( familyRendererMap == null ) { familyRendererMap = new ConcurrentHashMap < String , Renderer > ( 8 , 0.75f , 1 ) ; _renderers . put ( componentFamily , familyRendererMap ) ; } else { if ( familyRendererMap . get ( rendererType ) != null ) { // this is not necessarily an error , but users do need to be
// very careful about jar processing order when overriding
// some component ' s renderer with an alternate renderer .
log . fine ( "Overwriting renderer with family = " + componentFamily + " rendererType = " + rendererType + " renderer class = " + renderer . getClass ( ) . getName ( ) ) ; } } familyRendererMap . put ( rendererType , renderer ) ; |
public class Database { /** * Alias for { @ code findOptional ( cl , query ) . orElse ( null ) } . */
public @ Nullable < T > T findUniqueOrNull ( @ NotNull Class < T > cl , @ NotNull SqlQuery query ) { } } | return findOptional ( cl , query ) . orElse ( null ) ; |
public class CommonG { /** * Evaluate an expression .
* Object o could be a string or a list .
* @ param o object to be evaluated
* @ param condition condition to compare
* @ param result expected result */
public void evaluateJSONElementOperation ( Object o , String condition , String result ) throws Exception { } } | if ( o instanceof String ) { String value = ( String ) o ; switch ( condition ) { case "equal" : assertThat ( value ) . as ( "Evaluate JSONPath does not match with proposed value" ) . isEqualTo ( result ) ; break ; case "not equal" : assertThat ( value ) . as ( "Evaluate JSONPath match with proposed value" ) . isNotEqualTo ( result ) ; break ; case "contains" : assertThat ( value ) . as ( "Evaluate JSONPath does not contain proposed value" ) . contains ( result ) ; break ; case "does not contain" : assertThat ( value ) . as ( "Evaluate JSONPath contain proposed value" ) . doesNotContain ( result ) ; break ; case "size" : JsonValue jsonObject = JsonValue . readHjson ( value ) ; if ( jsonObject . isArray ( ) ) { assertThat ( jsonObject . asArray ( ) ) . as ( "Keys size does not match" ) . hasSize ( Integer . parseInt ( result ) ) ; } else { Assertions . fail ( "Expected array for size operation check" ) ; } break ; default : Assertions . fail ( "Not implemented condition" ) ; break ; } } else if ( o instanceof List ) { List < String > keys = ( List < String > ) o ; switch ( condition ) { case "contains" : assertThat ( keys ) . as ( "Keys does not contain that name" ) . contains ( result ) ; break ; case "size" : assertThat ( keys ) . as ( "Keys size does not match" ) . hasSize ( Integer . parseInt ( result ) ) ; break ; default : Assertions . fail ( "Operation not implemented for JSON keys" ) ; } } |
public class SipServletMessageImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipServletMessage # getCallId ( ) */
public String getCallId ( ) { } } | CallIdHeader id = ( CallIdHeader ) this . message . getHeader ( getCorrectHeaderName ( CallIdHeader . NAME ) ) ; if ( id != null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getCallId - return=" + id . getCallId ( ) ) ; } return id . getCallId ( ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getCallId - returning null" ) ; } return null ; } |
public class MPJwtNoMpJwtConfig { /** * login - config does exist in web . xml , and is set to MP - JWT
* login - config does exist in the app , but is set to BASIC
* the mpJwt feature is NOT enabled
* We should receive a 401 status in an exception
* @ throws Exception */
@ Test public void MPJwtNoMpJwtConfig_mpJwtInWebXML_basicInApp ( ) throws Exception { } } | genericLoginConfigVariationTest ( MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_BASIC_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . LOGINCONFIG_MP_JWT_IN_WEB_XML_SERVLET_BASIC_IN_APP , MpJwtFatConstants . MPJWT_APP_CLASS_LOGIN_CONFIG_MPJWTINWEBXML_BASICINAPP , ExpectedResult . BAD ) ; |
public class BaseMessagingEngineImpl { /** * Determine whether the conditions permitting a " server started " notification
* to be sent are met .
* @ return boolean a value indicating whether the notification can be sent */
private boolean okayToSendServerStarted ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "okayToSendServerStarted" , this ) ; synchronized ( lockObject ) { if ( ! _sentServerStarted ) { if ( ( _state == STATE_STARTED ) && _mainImpl . isServerStarted ( ) ) { _sentServerStarted = true ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "okayToSendServerStarted" , new Boolean ( _sentServerStarted ) ) ; return _sentServerStarted ; |
public class ModelRegistry { /** * Finds all { @ link OsgiModelSource model sources } representing models for the given
* { @ link Resource } .
* @ param resource must not be < code > null < / code > .
* @ param compatibleType can be < code > null < / code > . If provided , only models
* compatible to the given type are returned .
* @ param resolveMostSpecific whether to resolve only the most specific models .
* @ return never < code > null < / code > but rather an empty collection . */
private Collection < LookupResult > resolveModelSources ( Resource resource , Class < ? > compatibleType , boolean resolveMostSpecific ) { } } | Collection < LookupResult > sources = new ArrayList < > ( 64 ) ; for ( final String resourceType : mappableTypeHierarchyOf ( resource ) ) { Collection < OsgiModelSource < ? > > allSourcesForType = this . typeNameToModelSourcesMap . get ( resourceType ) ; Collection < OsgiModelSource < ? > > sourcesForCompatibleType = filter ( allSourcesForType , compatibleType ) ; if ( sourcesForCompatibleType != null && ! sourcesForCompatibleType . isEmpty ( ) ) { sources . addAll ( sourcesForCompatibleType . stream ( ) . map ( source -> new LookupResult ( source , resourceType ) ) . collect ( Collectors . toList ( ) ) ) ; if ( resolveMostSpecific ) { break ; } } } return unmodifiableCollection ( sources ) ; |
public class dnsnameserver { /** * Use this API to fetch filtered set of dnsnameserver resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static dnsnameserver [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | dnsnameserver obj = new dnsnameserver ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; dnsnameserver [ ] response = ( dnsnameserver [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class CmsJspInstanceDateBean { /** * Adjust the date according to the whole day options .
* @ param date the date to adjust .
* @ param isEnd flag , indicating if the date is the end of the event ( in contrast to the beginning )
* @ return the adjusted date , which will be exactly the beginning or the end of the provide date ' s day . */
private Date adjustForWholeDay ( Date date , boolean isEnd ) { } } | Calendar result = new GregorianCalendar ( ) ; result . setTime ( date ) ; result . set ( Calendar . HOUR_OF_DAY , 0 ) ; result . set ( Calendar . MINUTE , 0 ) ; result . set ( Calendar . SECOND , 0 ) ; result . set ( Calendar . MILLISECOND , 0 ) ; if ( isEnd ) { result . add ( Calendar . DATE , 1 ) ; } return result . getTime ( ) ; |
public class SystemPublicMetrics { /** * Add thread metrics .
* @ param result the result */
protected void addThreadMetrics ( Collection < Metric < ? > > result ) { } } | ThreadMXBean threadMxBean = ManagementFactory . getThreadMXBean ( ) ; result . add ( new Metric < > ( "threads.peak" , ( long ) threadMxBean . getPeakThreadCount ( ) ) ) ; result . add ( new Metric < > ( "threads.daemon" , ( long ) threadMxBean . getDaemonThreadCount ( ) ) ) ; result . add ( new Metric < > ( "threads.totalStarted" , threadMxBean . getTotalStartedThreadCount ( ) ) ) ; result . add ( new Metric < > ( "threads" , ( long ) threadMxBean . getThreadCount ( ) ) ) ; |
public class BigQueryOutputConfiguration { /** * Helper function that validates the output configuration . Ensures the project id , dataset id ,
* and table id exist in the configuration . This also ensures that if a schema is provided , that
* it is properly formatted .
* @ param conf the configuration to validate .
* @ throws IOException if the configuration is missing a key , or there ' s an issue while parsing
* the schema in the configuration . */
public static void validateConfiguration ( Configuration conf ) throws IOException { } } | // Ensure the BigQuery output information is valid .
ConfigurationUtil . getMandatoryConfig ( conf , REQUIRED_KEYS ) ; // Run through the individual getters as they manage error handling .
getProjectId ( conf ) ; getTableSchema ( conf ) ; getFileFormat ( conf ) ; getFileOutputFormat ( conf ) ; getGcsOutputPath ( conf ) ; |
public class DifferenceEngine { /** * Compare two DocumentType nodes
* @ param control
* @ param test
* @ param listener
* @ throws DifferenceFoundException */
protected void compareDocumentType ( DocumentType control , DocumentType test , DifferenceListener listener ) throws DifferenceFoundException { } } | compare ( control . getName ( ) , test . getName ( ) , control , test , listener , DOCTYPE_NAME ) ; compare ( control . getPublicId ( ) , test . getPublicId ( ) , control , test , listener , DOCTYPE_PUBLIC_ID ) ; compare ( control . getSystemId ( ) , test . getSystemId ( ) , control , test , listener , DOCTYPE_SYSTEM_ID ) ; |
public class QrCodeDecoderBits { /** * Decodes alphanumeric messages
* @ param qr QR code
* @ param data encoded data
* @ return Location it has read up to in bits */
private int decodeAlphanumeric ( QrCode qr , PackedBits8 data , int bitLocation ) { } } | int lengthBits = QrCodeEncoder . getLengthBitsAlphanumeric ( qr . version ) ; int length = data . read ( bitLocation , lengthBits , true ) ; bitLocation += lengthBits ; while ( length >= 2 ) { if ( data . size < bitLocation + 11 ) { qr . failureCause = QrCode . Failure . MESSAGE_OVERFLOW ; return - 1 ; } int chunk = data . read ( bitLocation , 11 , true ) ; bitLocation += 11 ; int valA = chunk / 45 ; int valB = chunk - valA * 45 ; workString . append ( valueToAlphanumeric ( valA ) ) ; workString . append ( valueToAlphanumeric ( valB ) ) ; length -= 2 ; } if ( length == 1 ) { if ( data . size < bitLocation + 6 ) { qr . failureCause = QrCode . Failure . MESSAGE_OVERFLOW ; return - 1 ; } int valA = data . read ( bitLocation , 6 , true ) ; bitLocation += 6 ; workString . append ( valueToAlphanumeric ( valA ) ) ; } return bitLocation ; |
public class GEDEstimator { /** * Grow the log [ i ] cache .
* @ param len Required size */
private synchronized void precomputeLogs ( int len ) { } } | if ( len <= ilogs . length ) { return ; // Probably done by another thread .
} double [ ] logs = Arrays . copyOf ( ilogs , len ) ; for ( int i = ilogs . length ; i < len ; i ++ ) { logs [ i ] = FastMath . log1p ( i ) ; } this . ilogs = logs ; |
public class CommandParser { /** * designed as a class in case we add config */
public Command [ ] toArgs ( final String line ) { } } | if ( line == null || line . isEmpty ( ) ) { throw new IllegalArgumentException ( "Empty command." ) ; } final List < Command > commands = new ArrayList < > ( ) ; final List < String > result = new ArrayList < > ( ) ; final StringBuilder current = new StringBuilder ( ) ; char waitChar = ' ' ; boolean copyNextChar = false ; boolean inEscaped = false ; for ( final char c : line . toCharArray ( ) ) { if ( copyNextChar ) { current . append ( c ) ; copyNextChar = false ; } else if ( waitChar == c ) { if ( current . length ( ) > 0 ) { result . add ( current . toString ( ) ) ; current . setLength ( 0 ) ; } waitChar = ' ' ; inEscaped = false ; } else { switch ( c ) { case '"' : case '\'' : if ( ! inEscaped ) { waitChar = c ; inEscaped = true ; break ; } else { current . append ( c ) ; } break ; case '\\' : copyNextChar = true ; break ; case '|' : flush ( commands , result , current ) ; break ; default : current . append ( c ) ; } } } if ( waitChar != ' ' ) { throw new IllegalStateException ( "Missing closing " + Character . toString ( waitChar ) ) ; } flush ( commands , result , current ) ; return commands . toArray ( new Command [ commands . size ( ) ] ) ; |
public class Slidr { /** * Attach a slider mechanism to a fragment view replacing an internal view
* @ param oldScreen the view within a fragment to replace
* @ param config the slider configuration to attach with
* @ return a { @ link com . r0adkll . slidr . model . SlidrInterface } that allows
* the user to lock / unlock the sliding mechanism for whatever purpose . */
@ NonNull public static SlidrInterface replace ( @ NonNull final View oldScreen , @ NonNull final SlidrConfig config ) { } } | ViewGroup parent = ( ViewGroup ) oldScreen . getParent ( ) ; ViewGroup . LayoutParams params = oldScreen . getLayoutParams ( ) ; parent . removeView ( oldScreen ) ; // Setup the slider panel and attach it
final SliderPanel panel = new SliderPanel ( oldScreen . getContext ( ) , oldScreen , config ) ; panel . setId ( R . id . slidable_panel ) ; oldScreen . setId ( R . id . slidable_content ) ; panel . addView ( oldScreen ) ; parent . addView ( panel , 0 , params ) ; // Set the panel slide listener for when it becomes closed or opened
panel . setOnPanelSlideListener ( new FragmentPanelSlideListener ( oldScreen , config ) ) ; // Return the lock interface
return panel . getDefaultInterface ( ) ; |
public class UrlTool { /** * Gets REST url .
* @ param urlKey Url key .
* @ param addClientId Denotes whether client identifier should be composed into final url .
* @ param pagination Pagination object .
* @ param additionalUrlParams Additional parameters .
* @ return Final REST url .
* @ throws UnsupportedEncodingException */
public String getRestUrl ( String urlKey , Boolean addClientId , Pagination pagination , Map < String , String > additionalUrlParams ) throws UnsupportedEncodingException { } } | String url ; if ( ! addClientId ) { url = "/v2.01" + urlKey ; } else { url = "/v2.01/" + root . getConfig ( ) . getClientId ( ) + urlKey ; } Boolean paramsAdded = false ; if ( pagination != null ) { url += "?page=" + pagination . getPage ( ) + "&per_page=" + pagination . getItemsPerPage ( ) ; paramsAdded = true ; } if ( additionalUrlParams != null ) { for ( Entry < String , String > entry : additionalUrlParams . entrySet ( ) ) { url += paramsAdded ? "&" : "?" ; url += entry . getKey ( ) + "=" + URLEncoder . encode ( entry . getValue ( ) , "ISO-8859-1" ) ; paramsAdded = true ; } } return url ; |
public class RuleBasedBreakIterator { /** * Sets the iterator to refer to the last boundary position before the
* specified position .
* @ param offset The position to begin searching for a break from .
* @ return The position of the last boundary before the starting position . */
@ Override public int preceding ( int offset ) { } } | CharacterIterator text = getText ( ) ; // if we have no cached break positions , or " offset " is outside the
// range covered by the cache , we can just call the inherited routine
// ( which will eventually call other routines in this class that may
// refresh the cache )
if ( fCachedBreakPositions == null || offset <= fCachedBreakPositions [ 0 ] || offset > fCachedBreakPositions [ fCachedBreakPositions . length - 1 ] ) { fCachedBreakPositions = null ; return rulesPreceding ( offset ) ; } // on the other hand , if " offset " is within the range covered by the cache ,
// then all we have to do is search the cache for the last break position
// before " offset "
else { fPositionInCache = 0 ; while ( fPositionInCache < fCachedBreakPositions . length && offset > fCachedBreakPositions [ fPositionInCache ] ) ++ fPositionInCache ; -- fPositionInCache ; text . setIndex ( fCachedBreakPositions [ fPositionInCache ] ) ; return text . getIndex ( ) ; } |
public class EbeanUtils { /** * < p > checkQuery . < / p >
* @ param query a { @ link io . ebeaninternal . api . SpiQuery } object .
* @ param whitelist a { @ link java . util . Set } object .
* @ param blacklist a { @ link java . util . Set } object .
* @ param ignoreUnknown a boolean . */
public static void checkQuery ( SpiQuery < ? > query , Set < String > whitelist , Set < String > blacklist , boolean ignoreUnknown ) { } } | checkQuery ( query , new ListExpressionValidation ( query . getBeanDescriptor ( ) , whitelist , blacklist ) , ignoreUnknown ) ; |
public class VimGenerator2 { /** * Append elements to the Vim top cluster .
* @ param it the receiver of the generated elements .
* @ param element0 the first element to add into the cluster .
* @ param elements the other elements to add into the cluster .
* @ return { @ code it } . */
protected IStyleAppendable appendCluster ( IStyleAppendable it , String element0 , String ... elements ) { } } | return appendCluster ( it , true , element0 , elements ) ; |
public class DenseFlowPyramidBase { /** * Processes the raw input images . Normalizes them and creates image pyramids from them . */
public void process ( T image1 , T image2 ) { } } | // declare image data structures
if ( pyr1 == null || pyr1 . getInputWidth ( ) != image1 . width || pyr1 . getInputHeight ( ) != image1 . height ) { pyr1 = UtilDenseOpticalFlow . standardPyramid ( image1 . width , image1 . height , scale , sigma , 5 , maxLayers , GrayF32 . class ) ; pyr2 = UtilDenseOpticalFlow . standardPyramid ( image1 . width , image1 . height , scale , sigma , 5 , maxLayers , GrayF32 . class ) ; pyr1 . initialize ( image1 . width , image1 . height ) ; pyr2 . initialize ( image1 . width , image1 . height ) ; } norm1 . reshape ( image1 . width , image1 . height ) ; norm2 . reshape ( image1 . width , image1 . height ) ; // normalize input image to make sure alpha is image independent
imageNormalization ( image1 , image2 , norm1 , norm2 ) ; // create image pyramid
pyr1 . process ( norm1 ) ; pyr2 . process ( norm2 ) ; // compute flow from pyramid
process ( pyr1 , pyr2 ) ; |
public class JavaStringConverter { /** * Resolve Java control character sequences to the actual character value .
* Optionally handle unicode escape sequences , too . */
public String convertFromJavaString ( String string , boolean useUnicode ) { } } | int firstEscapeSequence = string . indexOf ( '\\' ) ; if ( firstEscapeSequence == - 1 ) { return string ; } int length = string . length ( ) ; StringBuilder result = new StringBuilder ( length ) ; appendRegion ( string , 0 , firstEscapeSequence , result ) ; return convertFromJavaString ( string , useUnicode , firstEscapeSequence , result ) ; |
public class StatefulSessionActivationStrategy { /** * This method will be invoked when the server invokes one of passivate
* or passivateAll on the ManagedContainer interface .
* On z / OS , this method will be invoked when the server invokes one of passivateAll
* on the ManagedContainer interface or during normal server stop ,
* starting at EJSContainer . stopBean - > Activator . uninstallBean . This is not
* the same as Distributed . In Distributed the atUninstall method is called
* on this class because for some reason they feel that normal server
* stop is like server going down . And they want to get rid of all the Stateful
* session beans , cached and passivated . See atUninstall description . */
@ Override public void atPassivate ( BeanId beanId ) throws RemoteException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "atPassivate " + beanId ) ; BeanO bean = null ; MasterKey key = new MasterKey ( beanId ) ; try { synchronized ( locks . getLock ( key ) ) { if ( ( bean = ( BeanO ) cache . findDontPinNAdjustPinCount ( key , 0 ) ) != null ) { bean . passivate ( ) ; cache . remove ( key , false ) ; bean . ivCacheKey = null ; // d199233
if ( EJSPlatformHelper . isZOS ( ) || // LIDB2775-23.4
passivationPolicy . equals ( PassivationPolicy . ON_DEMAND ) ) { reaper . remove ( beanId ) ; } } } } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".atPassivate" , "525" , this ) ; Tr . warning ( tc , "UNABLE_TO_PASSIVATE_EJB_CNTR0005W" , new Object [ ] { bean , this , ex } ) ; // p111002.3
throw ex ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "atPassivate" ) ; |
public class Context { /** * Add annotated classes with { @ code Java4Cpp } annotation to the current
* list of class to be processed by introspecting jar files . */
private void addClassToDoFromJars ( ) { } } | if ( ! Utils . isNullOrEmpty ( settings . getJarFiles ( ) ) ) { try { String [ ] files = settings . getJarFiles ( ) . split ( ";" ) ; for ( String path : files ) { File file = new File ( path ) ; if ( ! file . isFile ( ) ) { String jarPath = classLoader . getJar ( path ) ; if ( jarPath == null ) { getFileManager ( ) . logInfo ( "can't find " + path ) ; } file = new File ( new URI ( jarPath ) ) ; } getFileManager ( ) . logInfo ( "searching classes to wrappe in " + file . getAbsolutePath ( ) ) ; JarFile jf = new JarFile ( file ) ; Enumeration < JarEntry > entries = jf . entries ( ) ; while ( entries . hasMoreElements ( ) ) { String clName = entries . nextElement ( ) . getName ( ) ; if ( clName . endsWith ( ".class" ) ) { Class < ? > clazz = classLoader . loadClass ( clName . split ( "\\." ) [ 0 ] . replace ( '/' , '.' ) ) ; if ( clazz . isAnnotationPresent ( Java4Cpp . class ) ) { addClassToDo ( clazz ) ; } } } } } catch ( Exception e ) { throw new RuntimeException ( "Failed to load jar " + e . getMessage ( ) ) ; } } |
public class TaggableThread { /** * Adds a tag , if current thread is TaggableThread , otherwise does nothing .
* @ param key
* @ param value */
public static void tag ( Object key , Object value ) { } } | Thread currentThread = Thread . currentThread ( ) ; if ( currentThread instanceof TaggableThread ) { TaggableThread taggableThread = ( TaggableThread ) currentThread ; taggableThread . tagMe ( key , value ) ; } |
public class Connections { /** * If the connection is not in { @ link Connection # getAutoCommit ( ) auto - commit mode } , roll it back
* and put it in auto - commit mode before closing the connection .
* @ param con
* may be null */
public static void close ( @ Nullable Connection con ) throws SQLException { } } | if ( con != null && ! con . isClosed ( ) ) { if ( ! con . getAutoCommit ( ) ) { con . rollback ( ) ; con . setAutoCommit ( true ) ; } con . close ( ) ; } |
public class CommentUtils { /** * Returns the TreePath / DocCommentTree duo for html sources . */
public DocCommentDuo getHtmlCommentDuo ( Element e ) { } } | FileObject fo = null ; PackageElement pe = null ; switch ( e . getKind ( ) ) { case OTHER : fo = configuration . getOverviewPath ( ) ; pe = configuration . workArounds . getUnnamedPackage ( ) ; break ; case PACKAGE : fo = configuration . workArounds . getJavaFileObject ( ( PackageElement ) e ) ; pe = ( PackageElement ) e ; break ; default : return null ; } if ( fo == null ) { return null ; } DocCommentTree dcTree = trees . getDocCommentTree ( fo ) ; if ( dcTree == null ) { return null ; } DocTreePath treePath = trees . getDocTreePath ( fo , pe ) ; return new DocCommentDuo ( treePath . getTreePath ( ) , dcTree ) ; |
public class UpdateDocumentationPartRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateDocumentationPartRequest updateDocumentationPartRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateDocumentationPartRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDocumentationPartRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( updateDocumentationPartRequest . getDocumentationPartId ( ) , DOCUMENTATIONPARTID_BINDING ) ; protocolMarshaller . marshall ( updateDocumentationPartRequest . getPatchOperations ( ) , PATCHOPERATIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class TrieNode { /** * Traverse trie node .
* @ param str the str
* @ return the trie node */
public TrieNode traverse ( String str ) { } } | if ( str . isEmpty ( ) ) { return this ; } return getChild ( str . charAt ( 0 ) ) . map ( n -> n . traverse ( str . substring ( 1 ) ) ) . orElse ( this ) ; |
public class CmsContainerpageController { /** * Method to determine whether a container element should be shown in the current template context . < p >
* @ param elementData the element data
* @ return true if the element should be shown */
public boolean shouldShowInContext ( CmsContainerElementData elementData ) { } } | CmsTemplateContextInfo contextInfo = getData ( ) . getTemplateContextInfo ( ) ; if ( contextInfo . getCurrentContext ( ) == null ) { return true ; } CmsDefaultSet < String > allowedContexts = contextInfo . getAllowedContexts ( ) . get ( elementData . getResourceType ( ) ) ; if ( ( allowedContexts != null ) && ! allowedContexts . contains ( contextInfo . getCurrentContext ( ) ) ) { return false ; } String settingValue = elementData . getSettings ( ) . get ( CmsTemplateContextInfo . SETTING ) ; return ( settingValue == null ) || settingValue . contains ( contextInfo . getCurrentContext ( ) ) ; |
public class GetTemplateSummaryResult { /** * The capabilities found within the template . If your template contains IAM resources , you must specify the
* CAPABILITY _ IAM or CAPABILITY _ NAMED _ IAM value for this parameter when you use the < a > CreateStack < / a > or
* < a > UpdateStack < / a > actions with your template ; otherwise , those actions return an InsufficientCapabilities error .
* For more information , see < a
* href = " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / using - iam - template . html # capabilities "
* > Acknowledging IAM Resources in AWS CloudFormation Templates < / a > .
* @ param capabilities
* The capabilities found within the template . If your template contains IAM resources , you must specify the
* CAPABILITY _ IAM or CAPABILITY _ NAMED _ IAM value for this parameter when you use the < a > CreateStack < / a > or
* < a > UpdateStack < / a > actions with your template ; otherwise , those actions return an InsufficientCapabilities
* error . < / p >
* For more information , see < a href =
* " https : / / docs . aws . amazon . com / AWSCloudFormation / latest / UserGuide / using - iam - template . html # capabilities "
* > Acknowledging IAM Resources in AWS CloudFormation Templates < / a > .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see Capability */
public GetTemplateSummaryResult withCapabilities ( Capability ... capabilities ) { } } | com . amazonaws . internal . SdkInternalList < String > capabilitiesCopy = new com . amazonaws . internal . SdkInternalList < String > ( capabilities . length ) ; for ( Capability value : capabilities ) { capabilitiesCopy . add ( value . toString ( ) ) ; } if ( getCapabilities ( ) == null ) { setCapabilities ( capabilitiesCopy ) ; } else { getCapabilities ( ) . addAll ( capabilitiesCopy ) ; } return this ; |
public class FullyQualifiedNameImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setFQNFormat ( Integer newFQNFormat ) { } } | Integer oldFQNFormat = fqnFormat ; fqnFormat = newFQNFormat ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FULLY_QUALIFIED_NAME__FQN_FORMAT , oldFQNFormat , fqnFormat ) ) ; |
public class UaaException { /** * Creates an { @ link UaaException } from a { @ link Map } .
* @ param errorParams a map with additional error information
* @ return the exception with error information */
public static UaaException valueOf ( Map < String , String > errorParams ) { } } | String errorCode = errorParams . get ( ERROR ) ; String errorMessage = errorParams . containsKey ( DESCRIPTION ) ? errorParams . get ( DESCRIPTION ) : null ; int status = DEFAULT_STATUS ; if ( errorParams . containsKey ( STATUS ) ) { try { status = Integer . valueOf ( errorParams . get ( STATUS ) ) ; } catch ( NumberFormatException e ) { // ignore
} } UaaException ex = new UaaException ( errorCode , errorMessage , status ) ; Set < Map . Entry < String , String > > entries = errorParams . entrySet ( ) ; for ( Map . Entry < String , String > entry : entries ) { String key = entry . getKey ( ) ; if ( ! ERROR . equals ( key ) && ! DESCRIPTION . equals ( key ) ) { ex . addAdditionalInformation ( key , entry . getValue ( ) ) ; } } return ex ; |
public class CGMinimizer { private static String arrayToString ( double [ ] x , int num ) { } } | StringBuilder sb = new StringBuilder ( "(" ) ; if ( num > x . length ) { num = x . length ; } for ( int j = 0 ; j < num ; j ++ ) { sb . append ( x [ j ] ) ; if ( j != x . length - 1 ) { sb . append ( ", " ) ; } } if ( num < x . length ) { sb . append ( "..." ) ; } sb . append ( ")" ) ; return sb . toString ( ) ; |
public class FileUtils { /** * Close the given { @ link java . io . Closeable } instance , ignoring nulls , and
* logging any thrown { @ link java . io . IOException } .
* @ param closeable to be closed */
public static void close ( @ Nullable final Closeable closeable ) { } } | if ( null != closeable ) { try { closeable . close ( ) ; } catch ( IOException ex ) { LOGGER . trace ( "" , ex ) ; } } |
public class EmailProviderEntity { /** * Update the existing Email Provider . A token with scope update : email _ provider is needed .
* See https : / / auth0 . com / docs / api / management / v2 # ! / Emails / patch _ provider
* @ param emailProvider the email provider data to set .
* @ return a Request to execute . */
public Request < EmailProvider > update ( EmailProvider emailProvider ) { } } | Asserts . assertNotNull ( emailProvider , "email provider" ) ; String url = baseUrl . newBuilder ( ) . addPathSegments ( "api/v2/emails/provider" ) . build ( ) . toString ( ) ; CustomRequest < EmailProvider > request = new CustomRequest < > ( this . client , url , "PATCH" , new TypeReference < EmailProvider > ( ) { } ) ; request . addHeader ( "Authorization" , "Bearer " + apiToken ) ; request . setBody ( emailProvider ) ; return request ; |
public class DescriptorExtensionList { /** * List up all the legacy instances currently in use . */
public static Iterable < Descriptor > listLegacyInstances ( ) { } } | return new Iterable < Descriptor > ( ) { public Iterator < Descriptor > iterator ( ) { return new AdaptedIterator < ExtensionComponent < Descriptor > , Descriptor > ( new FlattenIterator < ExtensionComponent < Descriptor > , CopyOnWriteArrayList < ExtensionComponent < Descriptor > > > ( legacyDescriptors . values ( ) ) { protected Iterator < ExtensionComponent < Descriptor > > expand ( CopyOnWriteArrayList < ExtensionComponent < Descriptor > > v ) { return v . iterator ( ) ; } } ) { protected Descriptor adapt ( ExtensionComponent < Descriptor > item ) { return item . getInstance ( ) ; } } ; } } ; |
public class MBeans { /** * ( non - Javadoc )
* @ see com . ibm . websphere . cache . CacheAdminMBean # getUsedCacheSize ( ) */
@ Override public int getUsedCacheSize ( ) { } } | DCache cache = null ; if ( ServerCache . servletCacheEnabled ) { cache = ServerCache . cache ; } int size = - 1 ; if ( cache != null ) { size = cache . getNumberCacheEntries ( ) ; } else { // DYNA1059W = DYNA1059W : WebSphere Dynamic Cache instance named { 0 } cannot be used because of Dynamic Servlet cache service has not be started .
Tr . error ( tc , "DYNA1059W" , new Object [ ] { DCacheBase . DEFAULT_CACHE_NAME } ) ; } return size ; |
public class StreamMessageImpl { /** * ( non - Javadoc )
* @ see javax . jms . StreamMessage # writeObject ( java . lang . Object ) */
@ Override public void writeObject ( Object value ) throws JMSException { } } | if ( value != null ) { // Check supported types
if ( ! ( value instanceof Boolean || value instanceof Byte || value instanceof Character || value instanceof Short || value instanceof Integer || value instanceof Long || value instanceof Float || value instanceof Double || value instanceof String || value instanceof byte [ ] ) ) throw new MessageFormatException ( "Unsupported value type : " + value . getClass ( ) . getName ( ) ) ; } write ( value ) ; |
public class Validator { /** * Validates a field by a given regular expression pattern
* It is required to pass a pre - compiled pattern , e . g .
* Pattern pattern = Pattern . compile ( " [ a - Z , 0-9 ] " )
* @ param name The field to check
* @ param pattern The pre - compiled pattern */
public void expectRegex ( String name , Pattern pattern ) { } } | expectRegex ( name , pattern , messages . get ( Validation . REGEX_KEY . name ( ) , name ) ) ; |
public class DOM2DTM { /** * Given a node handle , return its DOM - style namespace URI
* ( As defined in Namespaces , this is the declared URI which this node ' s
* prefix - - or default in lieu thereof - - was mapped to . )
* < p > % REVIEW % Null or " " ? - sb < / p >
* @ param nodeHandle the id of the node .
* @ return String URI value of this node ' s namespace , or null if no
* namespace was resolved . */
public String getNamespaceURI ( int nodeHandle ) { } } | if ( JJK_NEWCODE ) { int id = makeNodeIdentity ( nodeHandle ) ; if ( id == NULL ) return null ; Node node = ( Node ) m_nodes . elementAt ( id ) ; return node . getNamespaceURI ( ) ; } else { String nsuri ; short type = getNodeType ( nodeHandle ) ; switch ( type ) { case DTM . ATTRIBUTE_NODE : case DTM . ELEMENT_NODE : case DTM . ENTITY_REFERENCE_NODE : case DTM . NAMESPACE_NODE : case DTM . PROCESSING_INSTRUCTION_NODE : { Node node = getNode ( nodeHandle ) ; // assume not null .
nsuri = node . getNamespaceURI ( ) ; // % TBD % Handle DOM1?
} break ; default : nsuri = null ; } return nsuri ; } |
public class GoogleTransporter { /** * - - - PUBLISH - - - */
@ Override public void publish ( String channel , Tree message ) { } } | if ( connected . get ( ) ) { try { if ( debug && ( debugHeartbeats || ! channel . endsWith ( heartbeatChannel ) ) ) { logger . info ( "Submitting message to channel \"" + channel + "\":\r\n" + message . toString ( ) ) ; } byte [ ] bytes = serializer . write ( message ) ; PubsubMessage msg = PubsubMessage . newBuilder ( ) . setData ( ByteString . copyFrom ( bytes ) ) . build ( ) ; getOrCreatePublisher ( channel ) . publish ( msg ) ; } catch ( Exception cause ) { logger . warn ( "Unable to send message to Google Cloud service!" , cause ) ; } } |
public class KryoInstantiator { /** * Use Thread . currentThread ( ) . getContextClassLoader ( ) as the ClassLoader where ther newKryo is called */
public KryoInstantiator setThreadContextClassLoader ( ) { } } | return new KryoInstantiator ( ) { public Kryo newKryo ( ) { Kryo k = KryoInstantiator . this . newKryo ( ) ; k . setClassLoader ( Thread . currentThread ( ) . getContextClassLoader ( ) ) ; return k ; } } ; |
public class Element { /** * Determines if the element is displayed . If it isn ' t , it ' ll wait up to the
* default time ( 5 seconds ) for the element to be displayed
* @ param action - what action is occurring
* @ param expected - what is the expected result
* @ param extra - what actually is occurring
* @ return Boolean : is the element enabled ? */
private boolean isNotEnabled ( String action , String expected , String extra ) { } } | // wait for element to be displayed
if ( ! is . enabled ( ) ) { waitForState . enabled ( ) ; } if ( ! is . enabled ( ) ) { reporter . fail ( action , expected , extra + prettyOutput ( ) + NOT_ENABLED ) ; // indicates element not enabled
return true ; } return false ; |
public class RepositoryApi { /** * Get a Pager of repository branches from a project , sorted by name alphabetically .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / branches < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param itemsPerPage the number of Project instances that will be fetched per page
* @ return the list of repository branches for the specified project ID
* @ throws GitLabApiException if any exception occurs */
public Pager < Branch > getBranches ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { } } | return ( new Pager < Branch > ( this , Branch . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" ) ) ; |
public class SimpleCheckBoxControl { /** * { @ inheritDoc } */
@ Override public void setupValueChangedListeners ( ) { } } | super . setupValueChangedListeners ( ) ; field . itemsProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> { createCheckboxes ( ) ; setupCheckboxBindings ( ) ; setupCheckboxEventHandlers ( ) ; } ) ; field . selectionProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> { for ( int i = 0 ; i < checkboxes . size ( ) ; i ++ ) { checkboxes . get ( i ) . setSelected ( field . getSelection ( ) . contains ( field . getItems ( ) . get ( i ) ) ) ; } } ) ; field . errorMessagesProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> toggleTooltip ( node , checkboxes . get ( checkboxes . size ( ) - 1 ) ) ) ; field . tooltipProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> toggleTooltip ( node , checkboxes . get ( checkboxes . size ( ) - 1 ) ) ) ; for ( int i = 0 ; i < checkboxes . size ( ) ; i ++ ) { checkboxes . get ( i ) . focusedProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> toggleTooltip ( node , checkboxes . get ( checkboxes . size ( ) - 1 ) ) ) ; } |
public class DescribeConfigurationAggregatorsResult { /** * Returns a ConfigurationAggregators object .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setConfigurationAggregators ( java . util . Collection ) } or
* { @ link # withConfigurationAggregators ( java . util . Collection ) } if you want to override the existing values .
* @ param configurationAggregators
* Returns a ConfigurationAggregators object .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeConfigurationAggregatorsResult withConfigurationAggregators ( ConfigurationAggregator ... configurationAggregators ) { } } | if ( this . configurationAggregators == null ) { setConfigurationAggregators ( new com . amazonaws . internal . SdkInternalList < ConfigurationAggregator > ( configurationAggregators . length ) ) ; } for ( ConfigurationAggregator ele : configurationAggregators ) { this . configurationAggregators . add ( ele ) ; } return this ; |
public class ResourceModelCaches { /** * Stores the model representing the result of the
* { @ link Resource # adaptTo ( Class ) adaptation } of the given resource
* to the given target type .
* @ param resource must not be < code > null < / code > .
* @ param key must not be < code > null < / code > .
* @ param model can be < code > null < / code > . */
public < T > void store ( @ Nonnull Resource resource , @ Nonnull Key key , @ Nonnull Optional < T > model ) { } } | if ( resource == null ) { throw new IllegalArgumentException ( "Method argument resource must not be null" ) ; } if ( key == null ) { throw new IllegalArgumentException ( "Method argument key must not be null" ) ; } if ( model == null ) { throw new IllegalArgumentException ( "Method argument model must not be null" ) ; } if ( this . caches . isEmpty ( ) ) { return ; } final Key lookupKey = key ( resource , key ) ; for ( ResourceModelCache cache : this . caches ) { cache . put ( resource , model , lookupKey ) ; } |
public class ItemMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Item item , ProtocolMarshaller protocolMarshaller ) { } } | if ( item == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( item . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( item . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( item . getETag ( ) , ETAG_BINDING ) ; protocolMarshaller . marshall ( item . getLastModified ( ) , LASTMODIFIED_BINDING ) ; protocolMarshaller . marshall ( item . getContentType ( ) , CONTENTTYPE_BINDING ) ; protocolMarshaller . marshall ( item . getContentLength ( ) , CONTENTLENGTH_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AWSIotClient { /** * List the thing groups to which the specified thing belongs .
* @ param listThingGroupsForThingRequest
* @ return Result of the ListThingGroupsForThing operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws InternalFailureException
* An unexpected error has occurred .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ sample AWSIot . ListThingGroupsForThing */
@ Override public ListThingGroupsForThingResult listThingGroupsForThing ( ListThingGroupsForThingRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListThingGroupsForThing ( request ) ; |
public class SSTableInputFormat { /** * If we have a directory recursively gather the files we care about for this job .
* @ param file Root file / directory .
* @ param job Job context .
* @ return All files we care about .
* @ throws IOException */
private Collection < FileStatus > handleFile ( final FileStatus file , final JobContext job ) throws IOException { } } | final List < FileStatus > results = Lists . newArrayList ( ) ; if ( file . isDir ( ) ) { final Path p = file . getPath ( ) ; LOG . debug ( "Expanding {}" , p ) ; final FileSystem fs = p . getFileSystem ( job . getConfiguration ( ) ) ; final FileStatus [ ] children = fs . listStatus ( p ) ; for ( FileStatus child : children ) { results . addAll ( handleFile ( child , job ) ) ; } } else { results . add ( file ) ; } return results ; |
public class SpotifyApi { /** * Get multiple tracks .
* @ param ids The Spotify IDs of all tracks you ' re trying to retrieve . Maximum : 50 IDs .
* @ return A { @ link GetSeveralTracksRequest . Builder } .
* @ see < a href = " https : / / developer . spotify . com / web - api / user - guide / # spotify - uris - and - ids " > Spotify : URLs & amp ; IDs < / a > */
public GetSeveralTracksRequest . Builder getSeveralTracks ( String ... ids ) { } } | return new GetSeveralTracksRequest . Builder ( accessToken ) . setDefaults ( httpManager , scheme , host , port ) . ids ( concat ( ids , ',' ) ) ; |
public class Director { /** * Gets the licenses for the specified server XML file
* @ param serverXML The server XML file
* @ param offlineOnly if features should be only retrieved locally
* @ param locale Locale for the licenses
* @ return Set of InstallLicenses for the features found in the server XML file
* @ throws InstallException
* @ throws IOException */
public Set < InstallLicense > getServerFeatureLicense ( File serverXML , boolean offlineOnly , Locale locale ) throws InstallException , IOException { } } | if ( null != serverXML ) { return getFeatureLicense ( new ServerAsset ( serverXML ) . getRequiredFeatures ( ) , locale , null , null ) ; } return new HashSet < InstallLicense > ( ) ; |
public class PathUtil { /** * Removes all . . / and . / entries from within the given path . If there are extra . . s that move
* beyond the first directory given , they are removed .
* Examples :
* " a / b / . . / c " results in " a / c "
* " . / foo / . / . . / bar " results in " bar "
* " a / . . " results in " "
* " a / . . / . . / foo " results in " foo "
* @ param path The path to remove dots from .
* @ return The path with all dots collapsed . */
public static String collapseDots ( String path ) { } } | path = removeExtraneousSlashes ( path ) ; // Optimization : Most paths don ' t contain dots .
if ( ! path . contains ( "." ) ) { return path ; } List < String > dstFragments = new ArrayList < > ( ) ; for ( String fragment : Splitter . on ( '/' ) . split ( path ) ) { if ( fragment . equals ( ".." ) ) { if ( ! dstFragments . isEmpty ( ) ) { dstFragments . remove ( dstFragments . size ( ) - 1 ) ; } } else if ( ! fragment . equals ( "." ) ) { dstFragments . add ( fragment ) ; } } // Special case for Join . join ( [ " " ] ) ; - > " / "
if ( dstFragments . size ( ) == 1 && dstFragments . get ( 0 ) . isEmpty ( ) ) { return "/" ; } return Joiner . on ( "/" ) . join ( dstFragments ) ; |
public class FileSetType { /** * Returns the set of files . */
public ArrayList < PathImpl > getPaths ( ArrayList < PathImpl > paths ) { } } | PathListCallback cb = new PathListCallback ( paths ) ; filterPaths ( cb ) ; Collections . sort ( paths ) ; return paths ; |
public class ByteRangeList { /** * Merge into this list all the ranges contained
* in the given vector using merge ( ByteRange ) .
* @ param other the Vector of ByteRange objects */
public void merge ( final Vector other ) { } } | for ( int i = 0 ; i < other . size ( ) ; i ++ ) { this . merge ( ( ByteRange ) other . elementAt ( i ) ) ; } |
public class BufferedServletOutputStream { /** * Sets an observer for this output stream . The observer will be
* notified when the stream is first written to . */
public void addObserver ( IOutputStreamObserver obs ) { } } | if ( obs == null ) { this . obs = obs ; } else { if ( obsList == null ) { this . obsList = new ArrayList < IOutputStreamObserver > ( ) ; } this . obsList . add ( obs ) ; } |
public class DruidQuerySignature { /** * Create as an " immutable " " aggregate " signature for a grouping , so that post aggregations and having filters
* can not define new virtual columns
* @ param sourceSignature
* @ return */
public DruidQuerySignature asAggregateSignature ( RowSignature sourceSignature ) { } } | return new DruidQuerySignature ( sourceSignature , virtualColumnPrefix , virtualColumnsByExpression , virtualColumnsByName , true ) ; |
public class Chars { /** * Returns an array containing the same values as { @ code array } , but
* guaranteed to be of a specified minimum length . If { @ code array } already
* has a length of at least { @ code minLength } , it is returned directly .
* Otherwise , a new array of size { @ code minLength + padding } is returned ,
* containing the values of { @ code array } , and zeroes in the remaining places .
* @ param array the source array
* @ param minLength the minimum length the returned array must guarantee
* @ param padding an extra amount to " grow " the array by if growth is
* necessary
* @ throws IllegalArgumentException if { @ code minLength } or { @ code padding } is
* negative
* @ return an array containing the values of { @ code array } , with guaranteed
* minimum length { @ code minLength } */
public static char [ ] ensureCapacity ( char [ ] array , int minLength , int padding ) { } } | checkArgument ( minLength >= 0 , "Invalid minLength: %s" , minLength ) ; checkArgument ( padding >= 0 , "Invalid padding: %s" , padding ) ; return ( array . length < minLength ) ? copyOf ( array , minLength + padding ) : array ; |
public class SliceBigArray { /** * Sets the element of this big array at specified index .
* @ param index a position in this big array . */
public void set ( long index , Slice value ) { } } | updateRetainedSize ( index , value ) ; array . set ( index , value ) ; |
public class LDAPClient { /** * sets the secure Level
* @ param secureLevel [ SECURE _ CFSSL _ BASIC , SECURE _ CFSSL _ CLIENT _ AUTH , SECURE _ NONE ]
* @ throws ClassNotFoundException
* @ throws ClassException */
public void setSecureLevel ( short secureLevel ) throws ClassException { } } | // Security
if ( secureLevel == SECURE_CFSSL_BASIC ) { env . put ( "java.naming.security.protocol" , "ssl" ) ; env . put ( "java.naming.ldap.factory.socket" , "javax.net.ssl.SSLSocketFactory" ) ; ClassUtil . loadClass ( "com.sun.net.ssl.internal.ssl.Provider" ) ; Security . addProvider ( new com . sun . net . ssl . internal . ssl . Provider ( ) ) ; } else if ( secureLevel == SECURE_CFSSL_CLIENT_AUTH ) { env . put ( "java.naming.security.protocol" , "ssl" ) ; env . put ( "java.naming.security.authentication" , "EXTERNAL" ) ; } else { env . put ( "java.naming.security.authentication" , "simple" ) ; env . remove ( "java.naming.security.protocol" ) ; env . remove ( "java.naming.ldap.factory.socket" ) ; } |
public class TreeNode { /** * Validates the tree to preemptively catch errors . */
public final void validate ( ) { } } | this . accept ( new TreeVisitor ( ) { @ Override public boolean preVisit ( TreeNode node ) { node . validateInner ( ) ; return true ; } } ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.