signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class XMLConverter { /** * serialize a Query * @ param query Query to serialize * @ param done * @ return serialized query * @ throws ConverterException */ private String _serializeQuery ( Query query , Map < Object , String > done , String id ) throws ConverterException { } }
/* * < QUERY ID = " 1 " > < COLUMNNAMES > < COLUMN NAME = " a " > < / COLUMN > < COLUMN NAME = " b " > < / COLUMN > < / COLUMNNAMES > * < ROWS > < ROW > < COLUMN TYPE = " STRING " > a1 < / COLUMN > < COLUMN TYPE = " STRING " > b1 < / COLUMN > < / ROW > < ROW > * < COLUMN TYPE = " STRING " > a2 < / COLUMN > < COLUMN...
public class ServiceManagerSparql { /** * Given the URI of a type ( i . e . , a modelReference ) , this method figures out all the operations * that have this as part of their inputs . * @ param modelReference the type of output sought for * @ return a Set of URIs of operations that generate this output type . */...
return this . listEntitiesByDataModel ( MSM . Operation , MSM . hasOutput , modelReference ) ;
public class AbstractPlanNode { /** * Collect read tables read and index names used in the current node subquery expressions . * @ param tablesRead Set of table aliases read potentially added to at each recursive level . * @ param indexes Set of index names used in the plan tree * Only the current node is of inte...
for ( AbstractExpression expr : findAllSubquerySubexpressions ( ) ) { assert ( expr instanceof AbstractSubqueryExpression ) ; AbstractSubqueryExpression subquery = ( AbstractSubqueryExpression ) expr ; AbstractPlanNode subqueryNode = subquery . getSubqueryNode ( ) ; assert ( subqueryNode != null ) ; subqueryNode . getT...
public class ResourceBundleHelper { /** * Clear the complete resource bundle cache using the specified class loader ! * @ param aClassLoader * The class loader to be used . May not be < code > null < / code > . */ public static void clearCache ( @ Nonnull final ClassLoader aClassLoader ) { } }
ResourceBundle . clearCache ( aClassLoader ) ; if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Cache was cleared: " + ResourceBundle . class . getName ( ) + "; classloader=" + aClassLoader ) ;
public class Processor { /** * Set output directory . * @ param output absolute output directory * @ return this Process object */ public Processor setOutputDir ( final File output ) { } }
if ( ! output . isAbsolute ( ) ) { throw new IllegalArgumentException ( "Output directory path must be absolute: " + output ) ; } if ( output . exists ( ) && ! output . isDirectory ( ) ) { throw new IllegalArgumentException ( "Output directory exists and is not a directory: " + output ) ; } args . put ( "output.dir" , ...
public class CreateOTAUpdateRequest { /** * The files to be streamed by the OTA update . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setFiles ( java . util . Collection ) } or { @ link # withFiles ( java . util . Collection ) } if you want to override the...
if ( this . files == null ) { setFiles ( new java . util . ArrayList < OTAUpdateFile > ( files . length ) ) ; } for ( OTAUpdateFile ele : files ) { this . files . add ( ele ) ; } return this ;
public class Request { /** * / * - - - - - [ Bean ] - - - - - */ @ Override @ SuppressWarnings ( "StringEquality" ) public Object getField ( String name ) throws UnresolvedException { } }
if ( name == "method" ) return method == null ? null : method . toString ( ) ; else if ( name == "uri" ) return uri ; else if ( name == "line" ) return method + " " + uri + ' ' + version ; else if ( name == "query_string" ) { if ( uri == null ) return null ; int question = uri . indexOf ( '?' ) ; return question == - 1...
public class Tree { /** * Inserts the specified byte array at the specified position in this List . * @ param index * index at which the specified element is to be inserted * @ param value * array value to be inserted * @ param asBase64String * store byte array as BASE64 String * @ return this node * @ ...
if ( asBase64String ) { return insertObjectInternal ( index , BASE64 . encode ( value ) ) ; } return insertObjectInternal ( index , value ) ;
public class KafkaClient { /** * Sets an { @ link ExecutorService } to be used for async task . * @ param executorService * @ return */ public KafkaClient setExecutorService ( ExecutorService executorService ) { } }
if ( this . executorService != null ) { this . executorService . shutdown ( ) ; } this . executorService = executorService ; myOwnExecutorService = false ; return this ;
public class SqlInfoPrinter { /** * 打印SqlInfo的日志信息 . * @ param nameSpace XML命名空间 * @ param zealotId XML中的zealotId * @ param sqlInfo 要打印的SqlInfo对象 * @ param hasXml 是否包含xml的打印信息 */ public void printZealotSqlInfo ( SqlInfo sqlInfo , boolean hasXml , String nameSpace , String zealotId ) { } }
// 如果可以配置的打印SQL信息 , 且日志级别是info级别 , 则打印SQL信息 . if ( NormalConfig . getInstance ( ) . isPrintSqlInfo ( ) ) { StringBuilder sb = new StringBuilder ( LINE_BREAK ) ; sb . append ( PRINT_START ) . append ( LINE_BREAK ) ; // 如果是xml版本的SQL , 则打印xml的相关信息 . if ( hasXml ) { sb . append ( "--zealot xml: " ) . append ( XmlContext . ...
public class CreateSubnetGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateSubnetGroupRequest createSubnetGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createSubnetGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createSubnetGroupRequest . getSubnetGroupName ( ) , SUBNETGROUPNAME_BINDING ) ; protocolMarshaller . marshall ( createSubnetGroupRequest . getDescription ( ) , ...
public class RaftSessionConnection { /** * Resends a request due to a request failure , resetting the connection if necessary . */ @ SuppressWarnings ( "unchecked" ) protected < T extends RaftRequest > void retryRequest ( Throwable cause , T request , BiFunction sender , int count , int selectionId , CompletableFuture ...
// If the connection has not changed , reset it and connect to the next server . if ( this . selectionId == selectionId ) { log . trace ( "Resetting connection. Reason: {}" , cause . getMessage ( ) ) ; this . currentNode = null ; } // Attempt to send the request again . sendRequest ( request , sender , count , future )...
public class UntagResourceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UntagResourceRequest untagResourceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( untagResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( untagResourceRequest . getResourceName ( ) , RESOURCENAME_BINDING ) ; protocolMarshaller . marshall ( untagResourceRequest . getTagKeys ( ) , TAGKEYS_BINDING ) ; } ...
public class CmsPropertyPanel { /** * Preprocesses the fields to find out which fields need to displayed at the top / bottom later . < p > * @ param fields the fields * @ return the set of property names of the preprocessed fields */ private Set < String > preprocessFields ( Collection < I_CmsFormField > fields ) {...
Set < String > displaySet = Sets . newHashSet ( ) ; for ( I_CmsFormField field : fields ) { boolean hasValue = ! CmsStringUtil . isEmpty ( field . getWidget ( ) . getApparentValue ( ) ) ; if ( hasValue || Boolean . TRUE . toString ( ) . equals ( field . getLayoutData ( ) . get ( LD_DISPLAY_VALUE ) ) ) { String propName...
public class TermEquivalencer { /** * { @ inheritDoc } */ @ Override public int equivalence ( ) { } }
int eqct = 0 ; final List < String > nodes = pnt . getProtoNodes ( ) ; final Map < Integer , Integer > nodeTerms = pnt . getNodeTermIndex ( ) ; final int termct = nodeTerms . size ( ) ; final Map < EquivalentTerm , Integer > nodeCache = sizedHashMap ( termct ) ; final Map < Integer , Integer > eqn = pnt . getEquivalenc...
public class RolloverLogBase { /** * Sets the archive name format */ public void setArchiveFormat ( String format ) { } }
if ( format . endsWith ( ".gz" ) ) { _archiveFormat = format . substring ( 0 , format . length ( ) - ".gz" . length ( ) ) ; _archiveSuffix = ".gz" ; } else if ( format . endsWith ( ".zip" ) ) { _archiveFormat = format . substring ( 0 , format . length ( ) - ".zip" . length ( ) ) ; _archiveSuffix = ".zip" ; } else { _ar...
public class HlsEncryptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HlsEncryption hlsEncryption , ProtocolMarshaller protocolMarshaller ) { } }
if ( hlsEncryption == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hlsEncryption . getConstantInitializationVector ( ) , CONSTANTINITIALIZATIONVECTOR_BINDING ) ; protocolMarshaller . marshall ( hlsEncryption . getEncryptionMethod ( ) , EN...
public class EnumConstantWriterImpl { /** * { @ inheritDoc } */ public Content getEnumConstantsDetailsTreeHeader ( ClassDoc classDoc , Content memberDetailsTree ) { } }
memberDetailsTree . addContent ( HtmlConstants . START_OF_ENUM_CONSTANT_DETAILS ) ; Content enumConstantsDetailsTree = writer . getMemberTreeHeader ( ) ; enumConstantsDetailsTree . addContent ( writer . getMarkerAnchor ( SectionName . ENUM_CONSTANT_DETAIL ) ) ; Content heading = HtmlTree . HEADING ( HtmlConstants . DET...
public class BytecodeUtils { /** * Returns an { @ link Expression } that can load the given double constant . */ public static Expression constant ( final double value ) { } }
return new Expression ( Type . DOUBLE_TYPE , Feature . CHEAP ) { @ Override protected void doGen ( CodeBuilder mv ) { mv . pushDouble ( value ) ; } } ;
public class CmsSolrFieldConfiguration { /** * Retrieves the locales for an content , that is whether an XML content nor an XML page . < p > * Uses following strategy : * < ul > * < li > first by file name < / li > * < li > then by detection and < / li > * < li > otherwise take the first configured default lo...
// try to detect locale by filename Locale detectedLocale = CmsStringUtil . getLocaleForName ( resource . getRootPath ( ) ) ; if ( ! OpenCms . getLocaleManager ( ) . getAvailableLocales ( cms , resource ) . contains ( detectedLocale ) ) { detectedLocale = null ; } // try to detect locale by language detector if ( getIn...
public class AbstractComponentDecoration { /** * Calculates and updates the clipped bounds of the decoration painter in layered pane coordinates . * @ param layeredPane Layered pane containing the decoration painter . * @ param relativeLocationToOwner Location of the decoration painter relatively to the decorated c...
if ( layeredPane == null ) { decorationPainter . setClipBounds ( null ) ; } else { JComponent clippingComponent = getEffectiveClippingAncestor ( ) ; if ( clippingComponent == null ) { LOGGER . error ( "No decoration clipping component can be found for decorated component: " + decoratedComponent ) ; decorationPainter . ...
public class AWSGlueClient { /** * Changes the schedule state of the specified crawler to < code > SCHEDULED < / code > , unless the crawler is already * running or the schedule state is already < code > SCHEDULED < / code > . * @ param startCrawlerScheduleRequest * @ return Result of the StartCrawlerSchedule ope...
request = beforeClientExecution ( request ) ; return executeStartCrawlerSchedule ( request ) ;
public class JvmFieldImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setTransient ( boolean newTransient ) { } }
boolean oldTransient = transient_ ; transient_ = newTransient ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , TypesPackage . JVM_FIELD__TRANSIENT , oldTransient , transient_ ) ) ;
public class FaceSearchSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FaceSearchSettings faceSearchSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( faceSearchSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( faceSearchSettings . getCollectionId ( ) , COLLECTIONID_BINDING ) ; protocolMarshaller . marshall ( faceSearchSettings . getFaceMatchThreshold ( ) , FACEMATCHTHRESHOL...
public class ValueStatistics { /** * Returns a { @ link ValueStatistic } that caches the value of a statistic for at least a specific amount of time . * This method does not block . * When the delay expires , if several threads are coming at the same time to read the expired value , then only one will * do the up...
return new MemoizingValueStatistic < > ( delay , unit , valueStatistic ) ;
public class ConvexHull { /** * Determine the winding of three points . The winding is the sign of the space - the parity . * @ param a first point * @ param b second point * @ param c third point * @ return winding , - 1 = cw , 0 = straight , + 1 = ccw */ private static int winding ( Point2D a , Point2D b , Po...
return ( int ) Math . signum ( ( b . getX ( ) - a . getX ( ) ) * ( c . getY ( ) - a . getY ( ) ) - ( b . getY ( ) - a . getY ( ) ) * ( c . getX ( ) - a . getX ( ) ) ) ;
public class InfoWindow { /** * close all InfoWindows currently opened on this MapView * @ param mapView */ public static void closeAllInfoWindowsOn ( MapView mapView ) { } }
ArrayList < InfoWindow > opened = getOpenedInfoWindowsOn ( mapView ) ; for ( InfoWindow infoWindow : opened ) { infoWindow . close ( ) ; }
public class CommunicationChannelRepository { /** * endregion */ @ Programmatic public SortedSet < CommunicationChannel > findByOwner ( final Object owner ) { } }
final List < CommunicationChannelOwnerLink > links = linkRepository . findByOwner ( owner ) ; return Sets . newTreeSet ( Iterables . transform ( links , CommunicationChannelOwnerLink . Functions . communicationChannel ( ) ) ) ;
public class HourRanges { /** * If the hour ranges represent two different days , this method returns two hour ranges , one for each day . Example : * ' 09:00-14:00 + 18:00-03:00 ' will be splitted into ' 09:00-14:00 + 18:00-24:00 ' and ' 00:00-03:00 ' . * @ return This range or range for today and tomorrow . */ pu...
final List < HourRange > today = new ArrayList < > ( ) ; final List < HourRange > tommorrow = new ArrayList < > ( ) ; for ( final HourRange range : ranges ) { final List < HourRange > nr = range . normalize ( ) ; if ( nr . size ( ) == 1 ) { today . add ( nr . get ( 0 ) ) ; } else if ( nr . size ( ) == 2 ) { today . add...
public class Collectors { /** * Note : Generally it ' s much slower than other { @ code Collectors } . * @ param supplier * @ param streamingCollector * @ param maxWaitIntervalInMillis * @ return * @ see Stream # observe ( BlockingQueue , Predicate , long ) * @ see Stream # asyncCall ( Try . Function ) */ @...
final T NULL = ( T ) NONE ; final Supplier < Tuple4 < BlockingQueue < T > , MutableBoolean , MutableBoolean , Holder < ContinuableFuture < R > > > > supplier = new Supplier < Tuple4 < BlockingQueue < T > , MutableBoolean , MutableBoolean , Holder < ContinuableFuture < R > > > > ( ) { @ Override public Tuple4 < Blocking...
public class WikipediaCleaner { /** * Removes any tokens not allowed by the { @ link * edu . ucla . sspace . text . TokenFilter } in the article . */ private String filterTokens ( String article ) { } }
Iterator < String > filteredTokens = IteratorFactory . tokenize ( article ) ; StringBuilder sb = new StringBuilder ( article . length ( ) ) ; while ( filteredTokens . hasNext ( ) ) { sb . append ( filteredTokens . next ( ) ) ; if ( filteredTokens . hasNext ( ) ) sb . append ( " " ) ; } return sb . toString ( ) ;
public class CustomLogProperties { /** * Returns the Resource Factory associated with this log * implementation * @ return ResourceFactory associated with this log * implementation */ public ResourceFactory resourceFactory ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resourceFactory" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resourceFactory" , _resourceFactory ) ; return _resourceFactory ;
public class AdditionalNamespaceResolver { /** * { @ inheritDoc } */ public String getURI ( String prefix ) throws NamespaceException { } }
String uri = prefixToURI . getProperty ( prefix ) ; if ( uri != null ) { return uri ; } else { throw new NamespaceException ( "Unknown namespace prefix " + prefix + "." ) ; }
public class Distribution { /** * Contribution to numerator for GBM ' s leaf node prediction * @ param w weight * @ param y response * @ param z residual * @ param f predicted value ( including offset ) * @ return weighted contribution to numerator */ public double gammaNum ( double w , double y , double z , ...
switch ( distribution ) { case gaussian : case bernoulli : case quasibinomial : case multinomial : return w * z ; case poisson : return w * y ; case gamma : return w * ( z + 1 ) ; // z + 1 = = y * exp ( - f ) case tweedie : return w * y * exp ( f * ( 1 - tweediePower ) ) ; case modified_huber : double yf = ( 2 * y - 1 ...
public class CommerceShippingFixedOptionRelLocalServiceBaseImpl { /** * Deletes the commerce shipping fixed option rel with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceShippingFixedOptionRelId the primary key of the commerce shipping fixed option rel * @ ret...
return commerceShippingFixedOptionRelPersistence . remove ( commerceShippingFixedOptionRelId ) ;
public class Transforms { /** * Element - wise tan function . Copies the array * @ param ndArray Input array */ public static INDArray tan ( INDArray ndArray , boolean dup ) { } }
return exec ( dup ? new Tan ( ndArray , ndArray . ulike ( ) ) : new Tan ( ndArray ) ) ;
public class ListEntitlementsResult { /** * A list of entitlements that have been granted to you from other AWS accounts . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEntitlements ( java . util . Collection ) } or { @ link # withEntitlements ( java . u...
if ( this . entitlements == null ) { setEntitlements ( new java . util . ArrayList < ListedEntitlement > ( entitlements . length ) ) ; } for ( ListedEntitlement ele : entitlements ) { this . entitlements . add ( ele ) ; } return this ;
public class DefaultEntityHandler { /** * IFコメントでSQLをラップする * @ param original SQL * @ param addParts IFコメントの中に含まれるSQLパーツ * @ param col カラム情報 * @ return SQL */ private StringBuilder wrapIfComment ( final StringBuilder original , final StringBuilder addParts , final TableMetadata . Column col ) { } }
String camelColName = col . getCamelColumnName ( ) ; // フィールドがセットされていない場合はカラム自体を削る if ( isStringType ( col . getDataType ( ) ) ) { if ( emptyStringEqualsNull ) { original . append ( "/*IF SF.isNotEmpty(" ) . append ( camelColName ) . append ( ") */" ) . append ( System . lineSeparator ( ) ) ; } else { original . appe...
public class AbstractPool { /** * Returns a value for the given key , which is lazily created and * pooled . If multiple threads are requesting upon the same key * concurrently , at most one thread attempts to lazily create the * value . The others wait for it to become available . */ public V get ( K key ) throw...
// Quick check without locking . V value = mValues . get ( key ) ; if ( value != null ) { return value ; } // Check again with key lock held . Lock lock = mLockPool . get ( key ) ; lock . lock ( ) ; try { value = mValues . get ( key ) ; if ( value == null ) { try { value = create ( key ) ; mValues . put ( key , value )...
public class UrlUtil { /** * Switch zip protocol ( used by Weblogic ) to jar protocol ( supported by DropWizard ) . * @ param resourceUrl the URL to switch protocol eventually * @ return the URL with eventually switched protocol */ public static URL switchFromZipToJarProtocolIfNeeded ( URL resourceUrl ) throws Malf...
final String protocol = resourceUrl . getProtocol ( ) ; // If zip protocol switch to jar protocol if ( "zip" . equals ( protocol ) && resourceUrl . getPath ( ) . contains ( ".jar" + JAR_URL_SEPARATOR ) ) { String filePath = resourceUrl . getFile ( ) ; if ( ! filePath . startsWith ( "/" ) ) { filePath = "/" + filePath ;...
public class CoreStitchAuth { /** * Performs a request against Stitch using the provided { @ link StitchAuthRequest } object , and * decodes the JSON body of the response into a T value as specified by the provided class type . * The type will be decoded using the codec found for T in the codec registry given . *...
final Response response = doAuthenticatedRequest ( stitchReq ) ; try { final String bodyStr = IoUtils . readAllToString ( response . getBody ( ) ) ; final JsonReader bsonReader = new JsonReader ( bodyStr ) ; // We must check this condition because the decoder will throw trying to decode null if ( bsonReader . readBsonT...
public class Config { /** * Retrieves a configuration value with the given key * @ param key The key of the configuration value ( e . g . application . name ) * @ param defaultValue The default value to return of no key is found * @ return The configured value as int or the passed defautlValue if the key is not c...
final String value = this . props . getValue ( key ) ; if ( StringUtils . isBlank ( value ) ) { return defaultValue ; } return Integer . parseInt ( value ) ;
public class PhotosGeoApi { /** * Get permissions for who may view geo data for a photo . * < br > * This method requires authentication with ' read ' permission . * @ param photoId ( Required ) The id of the photo to get permissions for . * @ return object with the geo permissions for the specified photo . *...
JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.geo.getPerms" ) ; params . put ( "photo_id" , photoId ) ; return jinx . flickrGet ( params , GeoPerms . class ) ;
public class StateAnimator { /** * Called by View */ public void setState ( int [ ] state ) { } }
Tuple match = null ; final int count = mTuples . size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { final Tuple tuple = mTuples . get ( i ) ; if ( StateSet . stateSetMatches ( tuple . mSpecs , state ) ) { match = tuple ; break ; } } if ( match == lastMatch ) { return ; } if ( lastMatch != null ) { cancel ( ) ; } lastMat...
public class FileAuthStore { /** * ( non - Javadoc ) * @ see com . flickr4java . flickr . util . AuthStore # store ( com . flickr4java . flickr . auth . Auth ) */ public void store ( Auth token ) throws IOException { } }
this . auths . put ( token . getUser ( ) . getId ( ) , token ) ; this . authsByUser . put ( token . getUser ( ) . getUsername ( ) , token ) ; String filename = token . getUser ( ) . getId ( ) + ".auth" ; File outFile = new File ( this . authStoreDir , filename ) ; outFile . createNewFile ( ) ; ObjectOutputStream authSt...
public class FullDTDReader { /** * Specialized method that handles potentially suppressable entity * declaration . Specifically : at this point it is known that first * letter is ' E ' , that we are outputting flattened DTD info , * and that parameter entity declarations are to be suppressed . * Furthermore , f...
String keyw ; char c = dtdNextFromCurr ( ) ; if ( c == 'N' ) { keyw = checkDTDKeyword ( "TITY" ) ; if ( keyw == null ) { handleEntityDecl ( true ) ; return ; } keyw = "EN" + keyw ; mFlattenWriter . enableOutput ( mInputPtr ) ; // error condition . . . } else { mFlattenWriter . enableOutput ( mInputPtr ) ; mFlattenWrite...
public class DeviceAttributeDAODefaultImpl { public AttributeValue_3 getAttributeValueObject_3 ( ) throws DevFailed { } }
// Build a DeviceAttribute _ 3 from this final DeviceAttribute_3 att = new DeviceAttribute_3 ( ) ; att . setAttributeValue ( this ) ; // And return the AttributeValue _ 3 object return att . getAttributeValueObject_3 ( ) ;
public class nspbr_stats { /** * Use this API to fetch the statistics of all nspbr _ stats resources that are configured on netscaler . */ public static nspbr_stats [ ] get ( nitro_service service ) throws Exception { } }
nspbr_stats obj = new nspbr_stats ( ) ; nspbr_stats [ ] response = ( nspbr_stats [ ] ) obj . stat_resources ( service ) ; return response ;
public class WebSocketHandler { /** * { @ inheritDoc } */ @ Override public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { } }
log . warn ( "Exception (session: {})" , session . getId ( ) , cause ) ; // get the existing reference to a ws connection WebSocketConnection conn = ( WebSocketConnection ) session . getAttribute ( Constants . CONNECTION ) ; if ( conn != null ) { // close the socket conn . close ( ) ; }
public class CellRepeater { /** * Set the HTML style class that is rendered on each HTML table row that * is opened by this tag . For example , if the row class is " rowClass " , * each opening table row tag is : * < pre > * & lt ; tr class = " rowClass " & gt ; * < / pre > * @ param rowClass the name of a ...
if ( "" . equals ( rowClass ) ) return ; _trState = new TrTag . State ( ) ; _trState . styleClass = rowClass ;
public class OcelotServices { /** * Subscribe to topic * @ param topic * @ param session * @ return * @ throws IllegalAccessException */ @ JsTopic @ WsDataService public Integer subscribe ( @ JsTopicName ( prefix = Constants . Topic . SUBSCRIBERS ) String topic , Session session ) throws IllegalAccessException ...
return topicManager . registerTopicSession ( topic , session ) ;
public class StringConverter { /** * Hsqldb specific encoding used only for log files . The SQL statements that * need to be written to the log file ( input ) are Java Unicode strings . * input is converted into a 7bit escaped ASCII string ( output ) with the * following transformations . All characters outside t...
final int len = s . length ( ) ; char [ ] chars ; int extras = 0 ; if ( s == null || len == 0 ) { return ; } chars = s . toCharArray ( ) ; b . ensureRoom ( len * 2 + 5 ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = chars [ i ] ; if ( c == '\\' ) { if ( ( i < len - 1 ) && ( chars [ i + 1 ] == 'u' ) ) { b . writeNoChe...
public class KeyVaultClientBaseImpl { /** * List the versions of a certificate . * The GetCertificateVersions operation returns the versions of a certificate in the specified key vault . This operation requires the certificates / list permission . * @ param vaultBaseUrl The vault name , for example https : / / myva...
return getCertificateVersionsWithServiceResponseAsync ( vaultBaseUrl , certificateName , maxresults ) . map ( new Func1 < ServiceResponse < Page < CertificateItem > > , Page < CertificateItem > > ( ) { @ Override public Page < CertificateItem > call ( ServiceResponse < Page < CertificateItem > > response ) { return res...
public class ListFileFilter { /** * Check the record locally . */ public boolean doLocalCriteria ( StringBuffer strbFilter , boolean bIncludeFileName , Vector < BaseField > vParamList ) { } }
Object objTargetValue = m_fldTarget . getData ( ) ; if ( ( m_hsFilter != null ) && ( ! m_hsFilter . isEmpty ( ) ) && ( ! m_hsFilter . contains ( objTargetValue ) ) ) return false ; return super . doLocalCriteria ( strbFilter , bIncludeFileName , vParamList ) ;
public class HashGeneratorMaker { /** * Generate different hash codes for stereoisomers . The currently supported * geometries are : * < ul > * < li > Tetrahedral < / li > * < li > Double Bond < / li > * < li > Cumulative Double Bonds < / li > * < / ul > * @ return fluent API reference ( self ) */ public ...
this . stereoEncoders . add ( new GeometricTetrahedralEncoderFactory ( ) ) ; this . stereoEncoders . add ( new GeometricDoubleBondEncoderFactory ( ) ) ; this . stereoEncoders . add ( new GeometricCumulativeDoubleBondFactory ( ) ) ; this . stereoEncoders . add ( new TetrahedralElementEncoderFactory ( ) ) ; this . stereo...
public class base_resource { /** * This method , forms the http DELETE request , applies on the MPS . * Reads the response from the MPS and converts it to base response . * @ param service * @ param req _ args * @ return * @ throws Exception */ private String _delete ( nitro_service service , String req_args ...
StringBuilder responseStr = new StringBuilder ( ) ; HttpURLConnection httpURLConnection = null ; try { String urlstr ; String ipaddress = service . get_ipaddress ( ) ; String version = service . get_version ( ) ; String sessionid = service . get_sessionid ( ) ; String objtype = get_object_type ( ) ; String protocol = s...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcTankType ( ) { } }
if ( ifcTankTypeEClass == null ) { ifcTankTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 595 ) ; } return ifcTankTypeEClass ;
public class CharacterizingSets { /** * Computes a characterizing set for the given automaton . * @ param automaton * the automaton for which to determine the characterizing set . * @ param inputs * the input alphabets to consider * @ param result * the collection in which to store the characterizing words ...
findIncrementalCharacterizingSet ( automaton , inputs , Collections . emptyList ( ) , result ) ;
public class CircuitPresenter { /** * When this method is called it ' s guaranteed that the presenter is visible . */ protected void onError ( Action action , String reason ) { } }
Console . error ( Console . CONSTANTS . lastActionError ( ) , reason ) ;
public class LinearSparseVector { /** * 计算x + y * w * @ param sv * @ param w */ public void plus ( LinearSparseVector sv , float w ) { } }
if ( sv == null ) return ; for ( int i = 0 ; i < sv . length ; i ++ ) { float val = ( float ) sv . data [ i ] * w ; add ( sv . index [ i ] , val ) ; }
public class BaseXMLBuilder { /** * Add a named and namespaced XML element to the document as a child of * this builder ' s node . * @ param name * the name of the XML element . * @ param namespaceURI * a namespace URI * @ return * @ throws IllegalStateException * if you attempt to add a child element t...
assertElementContainsNoOrWhitespaceOnlyTextNodes ( this . xmlNode ) ; if ( namespaceURI == null ) { return getDocument ( ) . createElement ( name ) ; } else { return getDocument ( ) . createElementNS ( namespaceURI , name ) ; }
public class RepositoryReaderImpl { /** * Returns log directory used by this reader . * @ return absolute path to log directory . */ public String getLogLocation ( ) { } }
if ( logInstanceBrowser instanceof MainLogRepositoryBrowserImpl ) { return ( ( MainLogRepositoryBrowserImpl ) logInstanceBrowser ) . getLocation ( ) . getAbsolutePath ( ) ; } else { return ( ( OneInstanceBrowserImpl ) logInstanceBrowser ) . getLocation ( ) . getAbsolutePath ( ) ; }
public class AllureThreadContext { /** * Adds new uuid . */ public void start ( final String uuid ) { } }
Objects . requireNonNull ( uuid , "step uuid" ) ; context . get ( ) . push ( uuid ) ;
public class FlyWeightFlatXmlProducer { /** * IDataSetProducer interface */ @ Override public void setConsumer ( IDataSetConsumer consumer ) { } }
logger . debug ( "setConsumer(consumer) - start" ) ; if ( this . _columnSensing ) { _consumer = new BufferedConsumer ( consumer ) ; } else { _consumer = consumer ; }
public class ServerLogReaderPreTransactional { /** * Called after we read a null operation from the transaction log . * @ throws IOException when a fatal error occurred . */ private void handleNullRead ( ) throws IOException { } }
if ( curStreamFinished && readNullAfterStreamFinished ) { // If we read a null operation after the NameNode closed // the stream , then we surely reached the end of the file . curStreamConsumed = true ; } else { try { // This affects how much we wait after we reached the end of the // current stream . Thread . sleep ( ...
public class SipSession { /** * This sendUnidirectionalRequest ( ) method sends out a request message with no response expected . * A Request object is constructed from the string parameter passed in . * Example : < code > * StringBuffer invite = new StringBuffer ( " INVITE sip : becky @ " * + PROXY _ HOST + ' ...
Request request = parent . getMessageFactory ( ) . createRequest ( reqMessage ) ; return sendUnidirectionalRequest ( request , viaProxy ) ;
public class AutoConfigurationImportSelector { /** * Return the appropriate { @ link AnnotationAttributes } from the * { @ link AnnotationMetadata } . By default this method will return attributes for * { @ link # getAnnotationClass ( ) } . * @ param metadata the annotation metadata * @ return annotation attrib...
String name = getAnnotationClass ( ) . getName ( ) ; AnnotationAttributes attributes = AnnotationAttributes . fromMap ( metadata . getAnnotationAttributes ( name , true ) ) ; Assert . notNull ( attributes , ( ) -> "No auto-configuration attributes found. Is " + metadata . getClassName ( ) + " annotated with " + ClassUt...
public class JavaUtils { /** * Get the corresponding primitive for a give wrapper type . * Also handles arrays of which . */ public static Class < ? > getPrimitiveType ( Class < ? > javaType ) { } }
if ( javaType == Integer . class ) return int . class ; if ( javaType == Short . class ) return short . class ; if ( javaType == Boolean . class ) return boolean . class ; if ( javaType == Byte . class ) return byte . class ; if ( javaType == Long . class ) return long . class ; if ( javaType == Double . class ) return...
public class BaseJdbcDao { /** * { @ inheritDoc } */ @ Override public < T > List < T > executeSelect ( IRowMapper < T > rowMapper , String sql , Object ... bindValues ) { } }
return jdbcHelper . executeSelect ( rowMapper , sql , bindValues ) ;
public class Range { /** * Returns a list of all allowed values within the range * @ return a list of all allowed values within the range */ public List < Integer > listValues ( ) { } }
ArrayList < Integer > list = new ArrayList < Integer > ( getRange ( ) ) ; for ( int i = getMin ( ) ; i <= getMax ( ) ; i ++ ) { list . add ( i ) ; } return list ;
public class JSONUtil { /** * JSON转换为List * @ param json * @ return */ public List < ? > formatJSON2List ( String json ) { } }
List < ? > list = null ; try { list = MAPPER . readValue ( json , List . class ) ; } catch ( Exception e ) { LOGGER . error ( "formatJSON2List error, json = " + json , e ) ; } return list ;
public class CmsClientUserSettingConverter { /** * Loads the current user ' s preferences into a CmsUserSettingsBean . < p > * @ return the bean representing the current user ' s preferences */ public CmsUserSettingsBean loadSettings ( ) { } }
CmsUserSettingsBean result = new CmsUserSettingsBean ( ) ; CmsDefaultUserSettings currentSettings = new CmsDefaultUserSettings ( ) ; currentSettings . init ( m_currentPreferences . getUser ( ) ) ; for ( I_CmsPreference pref : OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getPreferences ( ) . values (...
public class Contract { /** * syntactic sugar */ public AgentComponent addAgent ( ) { } }
AgentComponent t = new AgentComponent ( ) ; if ( this . agent == null ) this . agent = new ArrayList < AgentComponent > ( ) ; this . agent . add ( t ) ; return t ;
public class ApplicationGatewaysInner { /** * Deletes the specified application gateway . * @ param resourceGroupName The name of the resource group . * @ param applicationGatewayName The name of the application gateway . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return th...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( applicationGatewayName == null ) { throw new IllegalArgumentException ( "Parameter applicationGatewayName is required and cannot be null." ) ; } if ( this . client . subscript...
public class CheckClassAdapter { /** * Returns the signature car at the given index . * @ param signature * a signature . * @ param pos * an index in signature . * @ return the character at the given index , or 0 if there is no such * character . */ private static char getChar ( final String signature , int...
return pos < signature . length ( ) ? signature . charAt ( pos ) : ( char ) 0 ;
public class Content { /** * Sets the cmsSources value for this Content . * @ param cmsSources * Information about the content from the CMS it was ingested * from . * This attribute is read - only . */ public void setCmsSources ( com . google . api . ads . admanager . axis . v201811 . CmsContent [ ] cmsSources ) ...
this . cmsSources = cmsSources ;
public class Application { /** * Replaces application bindings for a given prefix . * @ param externalExportPrefix an external export prefix ( not null ) * @ param applicationNames a non - null set of application names * @ return true if bindings were modified , false otherwise */ public boolean replaceApplicatio...
// There is a change if the set do not have the same size or if they do not contain the same // number of element . If no binding had been registered previously , then we only check whether // the new set contains something . boolean changed = false ; Set < String > oldApplicationNames = this . applicationBindings . re...
public class Settings { /** * Get a property by name * @ param key the property name */ public boolean getBooleanProperty ( String key , boolean defaultValue ) { } }
String value = SystemTools . replaceSystemProperties ( settings . getProperty ( key ) ) ; if ( value == null ) return defaultValue ; return Boolean . valueOf ( value . trim ( ) ) . booleanValue ( ) ;
public class WordlistsProcessor { /** * Processes the word list . * @ return true , if successful */ public boolean process ( ) { } }
boolean continueIterate = true ; boolean found = false ; String attempt = getCurrentAttempt ( ) ; while ( continueIterate ) { if ( attempt . equals ( toCheckAgainst ) ) { found = true ; break ; } attempt = getCurrentAttempt ( ) ; continueIterate = increment ( ) ; } return found ;
public class LambdaIterable { /** * { @ inheritDoc } */ @ Override public < B > LambdaIterable < B > fmap ( Function < ? super A , ? extends B > fn ) { } }
return wrap ( map ( fn , as ) ) ;
public class JaasAuthenticationHandler { /** * Gets login context . * @ param credential the credential * @ return the login context * @ throws GeneralSecurityException the general security exception */ protected LoginContext getLoginContext ( final UsernamePasswordCredential credential ) throws GeneralSecurityEx...
val callbackHandler = new UsernamePasswordCallbackHandler ( credential . getUsername ( ) , credential . getPassword ( ) ) ; if ( this . loginConfigurationFile != null && StringUtils . isNotBlank ( this . loginConfigType ) && this . loginConfigurationFile . exists ( ) && this . loginConfigurationFile . canRead ( ) ) { f...
public class SelectWhereDSLCodeGen { /** * ClassSignatureInfo lastSignature ) ; */ public List < TypeSpec > buildWhereClasses ( GlobalParsingContext context , EntityMetaSignature signature ) { } }
SelectWhereDSLCodeGen selectWhereDSLCodeGen = context . selectWhereDSLCodeGen ( ) ; final List < FieldSignatureInfo > partitionKeys = getPartitionKeysSignatureInfo ( signature . fieldMetaSignatures ) ; final List < FieldSignatureInfo > clusteringCols = getClusteringColsSignatureInfo ( signature . fieldMetaSignatures ) ...
public class CacheMapUtil { /** * batch remove the elements in the cached map * @ param batchRemoves Map ( key , fields ) the sub map you want to remvoe */ @ SuppressWarnings ( "unused" ) public static Completable batchRemove ( Map < String , List < String > > batchRemoves ) { } }
return batchRemove ( CacheService . CACHE_CONFIG_BEAN , batchRemoves ) ;
public class GridStory { /** * Here we specify the configuration , starting from default MostUsefulConfiguration , and changing only what is needed */ @ Override public Configuration configuration ( ) { } }
return new MostUsefulConfiguration ( ) // where to find the stories . useStoryLoader ( new LoadFromClasspath ( this . getClass ( ) ) ) // CONSOLE and TXT reporting . useStoryReporterBuilder ( new StoryReporterBuilder ( ) . withDefaultFormats ( ) . withFormats ( Format . CONSOLE , Format . TXT ) ) ;
public class TransitionUtils { /** * Creates a View using the bitmap copy of < code > view < / code > . If < code > view < / code > is large , * the copy will use a scaled bitmap of the given view . * @ param sceneRoot The ViewGroup in which the view copy will be displayed . * @ param view The view to create a co...
Matrix matrix = new Matrix ( ) ; matrix . setTranslate ( - parent . getScrollX ( ) , - parent . getScrollY ( ) ) ; ViewUtils . transformMatrixToGlobal ( view , matrix ) ; ViewUtils . transformMatrixToLocal ( sceneRoot , matrix ) ; RectF bounds = new RectF ( 0 , 0 , view . getWidth ( ) , view . getHeight ( ) ) ; matrix ...
public class MessageStoreImpl { /** * JsMonitoredComponent Implementation / / */ @ Override public final JsHealthState getHealthState ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getHealthState" ) ; SibTr . exit ( this , tc , "getHealthState" , "return=" + _healthState ) ; } return _healthState ;
public class WithMavenStepExecution2 { /** * Reads the config file from Config File Provider , expands the credentials and stores it in a file on the temp * folder to use it with the maven wrapper script * @ param mavenSettingsConfigId config file id from Config File Provider * @ param mavenSettingsFile path to w...
Config c = ConfigFiles . getByIdOrNull ( build , mavenSettingsConfigId ) ; if ( c == null ) { throw new AbortException ( "Could not find the Maven settings.xml config file id:" + mavenSettingsConfigId + ". Make sure it exists on Managed Files" ) ; } if ( StringUtils . isBlank ( c . content ) ) { throw new AbortExceptio...
public class StringExpression { /** * Create a { @ code this . startsWith ( str ) } expression * < p > Return true if this starts with str < / p > * @ param str string * @ return this . startsWith ( str ) * @ see java . lang . String # startsWith ( String ) */ public BooleanExpression startsWith ( Expression < ...
return Expressions . booleanOperation ( Ops . STARTS_WITH , mixin , str ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCenterLineProfileDef ( ) { } }
if ( ifcCenterLineProfileDefEClass == null ) { ifcCenterLineProfileDefEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 86 ) ; } return ifcCenterLineProfileDefEClass ;
public class TransactionScope { /** * Registers the given cursor against the active transaction , allowing it * to be closed on transaction exit or transaction manager close . If there * is no active transaction in scope , the cursor is registered as not part * of a transaction . Cursors should register when crea...
mLock . lock ( ) ; try { checkClosed ( ) ; if ( mCursors == null ) { mCursors = new IdentityHashMap < Class < ? > , CursorList < TransactionImpl < Txn > > > ( ) ; } CursorList < TransactionImpl < Txn > > cursorList = mCursors . get ( type ) ; if ( cursorList == null ) { cursorList = new CursorList < TransactionImpl < T...
public class DescribeFpgaImagesRequest { /** * Filters the AFI by owner . Specify an AWS account ID , < code > self < / code > ( owner is the sender of the request ) , or * an AWS owner alias ( valid values are < code > amazon < / code > | < code > aws - marketplace < / code > ) . * @ return Filters the AFI by owne...
if ( owners == null ) { owners = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return owners ;
public class HttpRequest { /** * Parses a new HttpMessage using { @ link # parse ( InputStream ) } with out as * null . * @ param in The InputStream to parse * @ return An HttpMessage object parsed from the InputStream * @ throws java . io . IOException Any IO Exceptions will be thrown */ public static HttpRequ...
HttpRequest m = new HttpRequest ( ) ; m . parse ( in ) ; return m ;
public class DependencyQueryBuilder { /** * Creates a { @ link DependencyQueryBuilder } based on a { @ link DependencyQuery } */ public static DependencyQueryBuilder create ( DependencyQuery query ) { } }
DependencyQueryBuilder builder = new DependencyQueryBuilder ( ) ; builder . setCoordinate ( query . getCoordinate ( ) ) ; builder . setFilter ( query . getDependencyFilter ( ) ) ; builder . setRepositories ( query . getDependencyRepositories ( ) ) ; builder . setScopeType ( query . getScopeType ( ) ) ; return builder ;
public class Grid { /** * Returns model for given combination of model parameters or null if the model does not exist . * @ param params parameters of the model * @ return A model run with these parameters , or null if the model does not exist . */ public Model getModel ( MP params ) { } }
Key < Model > mKey = getModelKey ( params ) ; return mKey != null ? mKey . get ( ) : null ;
public class StringUtil { /** * Checks if a string contains only digits . * @ return True if the string0 only contains digits , or false otherwise . */ static public boolean containsOnlyDigits ( String string0 ) { } }
// are they all digits ? for ( int i = 0 ; i < string0 . length ( ) ; i ++ ) { if ( ! Character . isDigit ( string0 . charAt ( i ) ) ) { return false ; } } return true ;
public class ReadCoilsResponse { /** * Convenience method that returns the state * of the bit at the given index . * @ param index the index of the coil for which * the status should be returned . * @ return true if set , false otherwise . * @ throws IndexOutOfBoundsException if the * index is out of bounds...
if ( index < 0 ) { throw new IllegalArgumentException ( index + " < 0" ) ; } if ( index > coils . size ( ) ) { throw new IndexOutOfBoundsException ( index + " > " + coils . size ( ) ) ; } return coils . getBit ( index ) ;
public class PropertiesConfigHelper { /** * Returns the map , where the key is the 2 group of the pattern and the * value is the property value * @ param keyPattern * the pattern of the key * @ return the map . */ private Map < String , String > getCustomMap ( Pattern keyPattern ) { } }
Map < String , String > map = new HashMap < > ( ) ; for ( Iterator < Object > it = props . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String key = ( String ) it . next ( ) ; Matcher matcher = keyPattern . matcher ( key ) ; if ( matcher . matches ( ) ) { String id = matcher . group ( 2 ) ; String propertyValue =...
public class WebSecurityPropagatorImpl { /** * Gets the security metadata from the web app config * @ param webAppConfig the webAppConfig representing the deployed module * @ return the security metadata */ private SecurityMetadata getSecurityMetadata ( WebAppConfig webAppConfig ) { } }
WebModuleMetaData wmmd = ( ( WebAppConfigExtended ) webAppConfig ) . getMetaData ( ) ; return ( SecurityMetadata ) wmmd . getSecurityMetaData ( ) ;
public class HttpResponseMessageImpl { /** * Query whether or not a body is allowed to be present for this * message . This is not whether a body is present , but rather only * whether it is allowed to be present . * @ return boolean ( true if allowed ) */ @ Override public boolean isBodyAllowed ( ) { } }
if ( super . isBodyAllowed ( ) ) { // sending a body with the response is not valid for a HEAD request if ( getServiceContext ( ) . getRequestMethod ( ) . equals ( MethodValues . HEAD ) ) { return false ; } // if that worked , then check the status code flag return this . myStatusCode . isBodyAllowed ( ) ; } // no body...
public class ScalarValueMakerFactory { /** * produce a maker for given settable * @ param settable * settable * @ return maker */ public Maker from ( Settable settable ) { } }
Optional < Maker < ? > > makerOptional = context . getPreferredValueMakers ( ) . getMaker ( settable ) ; if ( makerOptional . isPresent ( ) ) { return makerOptional . get ( ) ; } Type type = settable . getType ( ) ; Class < ? > rawType = ClassUtil . getRawType ( type ) ; if ( ClassUtil . isPrimitive ( type ) ) { return...