signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FormInterceptor { /** * Override preparePaint in order to perform processing specific to this interceptor . * @ param request the request being responded to . */ @ Override public void preparePaint ( final Request request ) { } }
// Reset the form encoding type before painting the content . UIContext uic = UIContextHolder . getCurrent ( ) ; uic . getEnvironment ( ) . setFormEncType ( null ) ; super . preparePaint ( request ) ;
public class MemcachedSessionService { /** * Initialize this manager . The memcachedClient parameter is there for testing * purposes . If the memcachedClient is provided it ' s used , otherwise a " real " / new * memcached client is created based on the configuration ( like { @ link # setMemcachedNodes ( String ) }...
if ( storage == null ) _storage = null ; else _storage = storage ; startInternal ( ) ;
public class ShellActivity { /** * Prints a description for the { @ code Translet } . */ private void showDescription ( ) { } }
if ( service . isVerbose ( ) ) { String description = getTranslet ( ) . getDescription ( ) ; if ( description != null ) { console . writeLine ( description ) ; } }
public class DefaultGroovyMethods { /** * Returns the items from the Iterable excluding the first item . * < pre class = " groovyTestCase " > * def list = [ 3 , 4 , 2] * assert list . tail ( ) = = [ 4 , 2] * assert list = = [ 3 , 4 , 2] * < / pre > * @ param self an Iterable * @ return a collection withou...
if ( ! self . iterator ( ) . hasNext ( ) ) { throw new NoSuchElementException ( "Cannot access tail() for an empty iterable" ) ; } Collection < T > result = createSimilarCollection ( self ) ; addAll ( result , tail ( self . iterator ( ) ) ) ; return result ;
public class ICUResourceBundleReader { /** * Gets the full name of the resource with suffix . */ public static String getFullName ( String baseName , String localeName ) { } }
if ( baseName == null || baseName . length ( ) == 0 ) { if ( localeName . length ( ) == 0 ) { return localeName = ULocale . getDefault ( ) . toString ( ) ; } return localeName + ICU_RESOURCE_SUFFIX ; } else { if ( baseName . indexOf ( '.' ) == - 1 ) { if ( baseName . charAt ( baseName . length ( ) - 1 ) != '/' ) { retu...
public class Convert { /** * 转换值为指定类型 * @ param < T > 目标类型 * @ param reference 类型参考 , 用于持有转换后的泛型类型 * @ param value 值 * @ return 转换后的值 * @ throws ConvertException 转换器不存在 */ public static < T > T convert ( TypeReference < T > reference , Object value ) throws ConvertException { } }
return convert ( reference . getType ( ) , value , null ) ;
public class ZipUtil { /** * Unwraps a ZIP file to the given directory shaving of root dir . * If there are multiple root dirs or entries in the root of zip , * ZipException is thrown . * The output directory must not be a file . * @ param zip * input ZIP file . * @ param outputDir * output directory ( cr...
unwrap ( zip , outputDir , IdentityNameMapper . INSTANCE ) ;
public class CPDisplayLayoutPersistenceImpl { /** * Caches the cp display layouts in the entity cache if it is enabled . * @ param cpDisplayLayouts the cp display layouts */ @ Override public void cacheResult ( List < CPDisplayLayout > cpDisplayLayouts ) { } }
for ( CPDisplayLayout cpDisplayLayout : cpDisplayLayouts ) { if ( entityCache . getResult ( CPDisplayLayoutModelImpl . ENTITY_CACHE_ENABLED , CPDisplayLayoutImpl . class , cpDisplayLayout . getPrimaryKey ( ) ) == null ) { cacheResult ( cpDisplayLayout ) ; } else { cpDisplayLayout . resetOriginalValues ( ) ; } }
public class BasicBondGenerator { /** * Generate rendering element ( s ) for the current bond , including ring * elements if this bond is part of a ring . * @ param currentBond the bond to use when generating elements * @ param model the renderer model * @ return one or more rendering elements */ public IRender...
IRing ring = RingSetManipulator . getHeaviestRing ( ringSet , currentBond ) ; if ( ring != null ) { return generateRingElements ( currentBond , ring , model ) ; } else { return generateBond ( currentBond , model ) ; }
public class CommandBuilderUtils { /** * Throws IllegalStateException with the given message if the check is false . */ static void checkState ( boolean check , String msg , Object ... args ) { } }
if ( ! check ) { throw new IllegalStateException ( String . format ( msg , args ) ) ; }
public class HList { /** * Static factory method for creating a 3 - element HList . * @ param _ 1 the head element * @ param _ 2 the second element * @ param _ 3 the third element * @ param < _ 1 > the head element type * @ param < _ 2 > the second element type * @ param < _ 3 > the third element type * @...
return tuple ( _2 , _3 ) . cons ( _1 ) ;
public class HBaseClient { /** * Handles find by range query for given start and end row key range values . * @ param < E > * parameterized entity class . * @ param entityClass * entity class . * @ param metadata * entity metadata * @ param startRow * start row . * @ param endRow * end row . * @ p...
EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClass ) ; // columnFamily has a different meaning for HBase , so it won ' t be used // here String tableName = entityMetadata . getSchema ( ) ; List results = new ArrayList ( ) ; FilterList filter = new FilterList ( ) ;...
public class DeclarationTransformerImpl { /** * Converts TermIdent into value of enum of given class and stores it into * properties map under key property * @ param < T > * Enum & amp ; CSSProperty limitation * @ param type * Type of enum which instance is retrieved * @ param term * Term with value to be...
T property = genericPropertyRaw ( type , null , term ) ; if ( property == null || ( avoidInherit && property . equalsInherit ( ) ) ) return false ; properties . put ( propertyName , property ) ; return true ;
public class LongDoubleSortedVector { /** * Computes the dot product of this vector with the other vector . */ public double dot ( LongDoubleVector y ) { } }
if ( y instanceof LongDoubleSortedVector ) { LongDoubleSortedVector other = ( ( LongDoubleSortedVector ) y ) ; double dot = 0 ; int oc = 0 ; for ( int c = 0 ; c < used ; c ++ ) { while ( oc < other . used ) { if ( other . indices [ oc ] < indices [ c ] ) { oc ++ ; } else if ( indices [ c ] == other . indices [ oc ] ) {...
public class AbstractStreamMetadataStore { /** * Delete a scope with given name . * @ param scopeName Name of scope to be deleted * @ return DeleteScopeStatus future . */ @ Override public CompletableFuture < DeleteScopeStatus > deleteScope ( final String scopeName ) { } }
return getScope ( scopeName ) . deleteScope ( ) . handle ( ( result , e ) -> { Throwable ex = Exceptions . unwrap ( e ) ; if ( ex == null ) { return DeleteScopeStatus . newBuilder ( ) . setStatus ( DeleteScopeStatus . Status . SUCCESS ) . build ( ) ; } if ( ex instanceof StoreException . DataNotFoundException ) { retur...
public class PropertyCodeGenerator { /** * Add the final assignment of the property to the partial value object ' s source code . */ public void addPartialFieldAssignment ( SourceBuilder code , Excerpt finalField , String builder ) { } }
addFinalFieldAssignment ( code , finalField , builder ) ;
public class Iso8601UtilLimitedImpl { /** * This method reads two digits from the given { @ code scanner } . * @ param scanner is the scanner potentially pointing to the digits . * @ return { @ code - 1 } if the { @ code scanner } does NOT point to a digit or the number represented by the two * digits consumed fr...
int highDigit = scanner . readDigit ( ) ; if ( highDigit == - 1 ) { return - 1 ; } int lowDigit = scanner . readDigit ( ) ; if ( lowDigit == - 1 ) { throw new IllegalDateFormatException ( scanner . getOriginalString ( ) ) ; } return ( highDigit * 10 ) + lowDigit ;
public class DeleteIntentVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteIntentVersionRequest deleteIntentVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteIntentVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteIntentVersionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( deleteIntentVersionRequest . getVersion ( ) , VERSION_BINDING ) ; ...
public class DirContextAdapter { /** * { @ inheritDoc } */ @ Override public String getNameInNamespace ( ) { } }
if ( base . size ( ) == 0 ) { return dn . toString ( ) ; } try { LdapName result = ( LdapName ) dn . clone ( ) ; result . addAll ( 0 , base ) ; return result . toString ( ) ; } catch ( InvalidNameException e ) { throw new org . springframework . ldap . InvalidNameException ( e ) ; }
public class AstUtil { /** * Return true only if the Statement represents a method call for the specified method object ( receiver ) , * method name , and with the specified number of arguments . * @ param stmt - the AST Statement * @ param methodObject - the name of the method object ( receiver ) * @ param met...
if ( stmt instanceof ExpressionStatement ) { Expression expression = ( ( ExpressionStatement ) stmt ) . getExpression ( ) ; if ( expression instanceof MethodCallExpression ) { return isMethodCall ( expression , methodObject , methodName , numArguments ) ; } } return false ;
public class AbstractFilter { /** * Changes the target for filter output . */ public void setTarget ( File target ) { } }
try { OutputStream targetStream = target == null ? null : new FileOutputStream ( target ) ; setTarget ( targetStream ) ; } catch ( Exception e ) { throw new RuntimeException ( "Can't create target stream" , e ) ; }
public class ServletPmiModule { /** * / * ( non - Javadoc ) * @ see com . ibm . wsspi . pmi . factory . StatisticActionListener # statisticCreated ( com . ibm . wsspi . pmi . stat . SPIStatistic ) */ public void statisticCreated ( SPIStatistic data ) { } }
switch ( data . getId ( ) ) { case WebAppModule . TOTAL_REQUESTS : totalRequests = ( CountStatisticImpl ) data ; break ; case WebAppModule . NUM_ERRORS : numErrors = ( CountStatisticImpl ) data ; break ; case WebAppModule . RESPONSE_TIME : responseTime = ( TimeStatisticImpl ) data ; break ; case WebAppModule . CONCURRE...
public class AbstractMavenScroogeMojo { /** * Find all { @ code . java } and { @ code . scala } files in the given directory . */ private ImmutableSet < File > findGeneratedFilesInDirectory ( File directory ) throws IOException { } }
if ( directory == null || ! directory . isDirectory ( ) ) return ImmutableSet . of ( ) ; List < File > sourceFilesInDirectory = getFiles ( directory , "**/*.java" , null ) ; sourceFilesInDirectory . addAll ( getFiles ( directory , "**/*.scala" , null ) ) ; return ImmutableSet . copyOf ( sourceFilesInDirectory ) ;
public class Reflections { /** * Returns the filtered set of instance methods of the given class , including * those inherited from the super - classes . * @ param clazz * the class whose methods are being retrieved . * @ param filter * an optional filter ; to get all methods pass in a { @ code null } value ....
return getMethods ( clazz , new And < Method > ( filter != null ? filter : new True < Method > ( ) , new Not < Method > ( new IsStatic < Method > ( ) ) , new Not < Method > ( new IsOverridden < Method > ( ) ) ) ) ;
public class ClassLoaderResolver { /** * Creates a new < code > ClassLoader < / code > instance . * @ param parent the parent < code > ClassLoader < / code > for the created instance . * @ return an instance of the < code > ClassLoader < / code > subtype specified in this instance ' s constructor , having * as pa...
String msg = "Cannot create a classloader." ; try { return ( ClassLoader ) constructor . newInstance ( parent ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( msg , e ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( msg , e ) ; } catch ( InvocationTargetException ...
public class BaseClassFinderService { /** * Convert this encoded string back to a Java Object . * @ param string The string to convert . * @ return The java object . */ public Object findConvertStringToObject ( String className , String versionRange , String string ) { } }
Object object = this . convertStringToObject ( null , className , versionRange , string ) ; if ( object == null ) { Object resource = this . deployThisResource ( ClassFinderActivator . getPackageName ( className , false ) , versionRange , false ) ; if ( resource != null ) { object = this . convertStringToObject ( null ...
public class MediaApi { /** * Turn off Do Not Disturb * Turn off Do Not Disturb for the current agent on all media channels . * @ param mediaDndOffData Request parameters . ( optional ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the...
ApiResponse < ApiSuccessResponse > resp = dndOffWithHttpInfo ( mediaDndOffData ) ; return resp . getData ( ) ;
public class CommonG { /** * Checks the different results of a previous query to Elasticsearch database * @ param expectedResults A DataTable Object with all data needed for check the results . The DataTable must contains at least 2 columns : * a ) A field column from the result * b ) Occurrences column ( Integer...
if ( getElasticsearchResults ( ) != null ) { List < List < String > > expectedResultList = expectedResults . raw ( ) ; // Check size assertThat ( expectedResultList . size ( ) - 1 ) . overridingErrorMessage ( "Expected number of columns to be" + ( expectedResultList . size ( ) - 1 ) + "but was " + previousElasticsearch...
public class XMLUtils { /** * Removes text nodes that are only containing whitespace characters * inside a DOM tree . * @ param element the root node to normalize . */ public static void stripWhitespaceNodes ( Node element ) { } }
Node node , child ; for ( child = element . getFirstChild ( ) ; child != null ; child = node ) { node = child . getNextSibling ( ) ; stripWhitespaceNodes ( child ) ; } if ( element . getNodeType ( ) == Node . TEXT_NODE && element . getNodeValue ( ) . trim ( ) . length ( ) == 0 ) { element . getParentNode ( ) . removeCh...
public class EarDescriptorBuilder { /** * Writes WEB part to application . xml . * @ param filename name of module * @ param context context */ private void writeWebModule ( String filename , String context ) { } }
Element element = writeModule ( ) ; Element web = doc . createElement ( "web" ) ; element . appendChild ( web ) ; Element webUri = doc . createElement ( "web-uri" ) ; Element contextRoot = doc . createElement ( "context-root" ) ; web . appendChild ( webUri ) ; web . appendChild ( contextRoot ) ; webUri . setTextContent...
public class JsonPropertyMeta { /** * Gets a new instance of property builder for the given key name . * @ param name * @ return a new property builder instance * @ author vvakame */ public JsonPropertyBuilder < T , P > name ( String name ) { } }
return new JsonPropertyBuilder < T , P > ( coderClass , name , null , null ) ;
public class Card { /** * For virtual cards only . Retrieves an Issuing < code > Card _ details < / code > object that contains < a * href = " / docs / issuing / cards / management # virtual - card - info " > the sensitive details < / a > of a virtual * card . */ public CardDetails details ( Map < String , Object >...
String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/issuing/cards/%s/details" , ApiResource . urlEncodeId ( this . getId ( ) ) ) ) ; return request ( ApiResource . RequestMethod . GET , url , params , CardDetails . class , options ) ;
public class ImageFileChooser { /** * Ouvre la boîte de dialogue de choix de fichier image . * < br > Retourne le fichier choisi , ou null si annulé . * @ param parent Component * @ param openOrSave boolean * @ param fileName String * @ return File */ public static File chooseImage ( Component parent , bool...
final int result ; if ( fileName != null ) { IMAGE_FILE_CHOOSER . setSelectedFile ( new File ( fileName ) ) ; } if ( openOrSave ) { result = IMAGE_FILE_CHOOSER . showOpenDialog ( parent ) ; } else { result = IMAGE_FILE_CHOOSER . showSaveDialog ( parent ) ; } if ( result == JFileChooser . APPROVE_OPTION ) { File file = ...
public class Math { /** * The Euclidean distance . */ public static double distance ( SparseArray x , SparseArray y ) { } }
return Math . sqrt ( squaredDistance ( x , y ) ) ;
public class DescribeProvisioningParametersResult { /** * Any additional metadata specifically related to the provisioning of the product . For example , see the * < code > Version < / code > field of the CloudFormation template . * @ param usageInstructions * Any additional metadata specifically related to the p...
if ( usageInstructions == null ) { this . usageInstructions = null ; return ; } this . usageInstructions = new java . util . ArrayList < UsageInstruction > ( usageInstructions ) ;
public class FluentWebElement { /** * These are as they would be in the WebElement API */ public FluentWebElement sendKeys ( final CharSequence ... keysToSend ) { } }
executeAndWrapReThrowIfNeeded ( new SendKeys ( keysToSend ) , Context . singular ( context , "sendKeys" , null , charSeqArrayAsHumanString ( keysToSend ) ) , true ) ; return new FluentWebElement ( delegate , currentElement , context , monitor , booleanInsteadOfNotFoundException ) ;
public class HomographyInducedStereo3Pts { /** * Estimates the homography from view 1 to view 2 induced by a plane from 3 point associations . * Each pair must pass the epipolar constraint . This can fail if the points are colinear . * @ param p1 Associated point observation * @ param p2 Associated point observat...
// Fill rows of M with observations from image 1 fillM ( p1 . p1 , p2 . p1 , p3 . p1 ) ; // Compute ' b ' vector b . x = computeB ( p1 . p2 ) ; b . y = computeB ( p2 . p2 ) ; b . z = computeB ( p3 . p2 ) ; // A _ inv _ b = inv ( A ) * b if ( ! solver . setA ( M ) ) return false ; GeometryMath_F64 . toMatrix ( b , temp0...
public class HeatChart { /** * Determines what colour a heat map cell should be based upon the cell values . */ private Color getCellColour ( double data , double min , double max ) { } }
double range = max - min ; double position = data - min ; // What proportion of the way through the possible values is that . double percentPosition = position / range ; // Which colour group does that put us in . // int colourPosition = getColourPosition ( percentPosition ) ; int r = ( int ) ( 255 * red ( percentPosit...
public class JNStorage { /** * Find an edits file spanning the given transaction ID range . * If no such file exists , an exception is thrown . */ File findFinalizedEditsFile ( long startTxId , long endTxId ) throws IOException { } }
File ret = new File ( sd . getCurrentDir ( ) , NNStorage . getFinalizedEditsFileName ( startTxId , endTxId ) ) ; if ( ! ret . exists ( ) ) { throw new IOException ( "No edits file for range " + startTxId + "-" + endTxId ) ; } return ret ;
public class StreamletImpl { /** * Return a new KVStreamlet < K , R > by applying key extractor to each element of this Streamlet * @ param keyExtractor The function applied to a tuple of this streamlet to get the key */ @ Override public < K > KVStreamlet < K , R > keyBy ( SerializableFunction < R , K > keyExtractor...
return keyBy ( keyExtractor , ( a ) -> a ) ;
public class CompletionContext { /** * Return the whole word the cursor is in , or { @ code null } if the cursor is past the last word . */ public String currentWord ( ) { } }
return wordIndex >= 0 && wordIndex < words . size ( ) ? words . get ( wordIndex ) : null ;
public class YourValveOption { public List < Valve > getValveList ( ) { } }
// read - only return valveList != null ? Collections . unmodifiableList ( valveList ) : Collections . emptyList ( ) ;
public class GroupService { /** * Refers to the PropertiesManager to get the key for the group associated with ' name ' and asks * the group store implementation for the corresponding < code > IEntityGroup < / code > . */ public static IEntityGroup getDistinguishedGroup ( String name ) throws GroupsException { } }
LOGGER . trace ( "Invoking getDistinguishedGroup for name='{}'" , name ) ; return instance ( ) . igetDistinguishedGroup ( name ) ;
public class Locales { /** * Gets locale . * @ return locale */ public static Locale getLocale ( ) { } }
final Locale ret = LOCALE . get ( ) ; if ( null == ret ) { return Latkes . getLocale ( ) ; } return ret ;
public class PrintInlineListener { /** * Returns an HTML / XML entity corresponding to the specified special symbol . * Depending on implementation it can be real entities ( like & amp ; amp ; * & amp ; lt ; & amp ; gt ; or the corresponding digital codes ( like & amp ; # 38 ; , * & amp ; # & amp ; # 38 ; or & am...
String entity = null ; if ( isHtmlEntities ( ) ) { entity = WikiEntityUtil . getHtmlSymbol ( str ) ; } else { int code = WikiEntityUtil . getHtmlCodeByWikiSymbol ( str ) ; if ( code > 0 ) { entity = "#" + Integer . toString ( code ) ; } } if ( entity != null ) { entity = "&" + entity + ";" ; if ( str . startsWith ( " -...
public class MvpPresenter { /** * Set view state to presenter * @ param viewState that implements type , setted as View generic param */ @ SuppressWarnings ( { } }
"unchecked" , "unused" } ) public void setViewState ( MvpViewState < View > viewState ) { mViewStateAsView = ( View ) viewState ; mViewState = ( MvpViewState ) viewState ;
public class JKSTrustStore { /** * This method is used to check if certificate is trusted or not . * @ param certificate * instance of PKI X . 509 certificate . not null . * @ param certStore * additional certificates to be used to check if certificate chain is trusted or not . * @ return true if certificate ...
try { if ( certificate == null ) { throw new CryptoException ( "Invalid input parameter. Certificate can not be null" ) ; } LOGGER . info ( "Checking if certificate with subjectDN={} is trusted" , certificate . getSubjectDN ( ) ) ; Store certificateStore = certStore ; if ( certificateStore == null ) { certificateStore ...
public class SafeServiceLoader { /** * Parses a META - INF / services resource and returns the list of service provider class names * defined in that resource . * @ param url a URL of a META - INF / services resource * @ return list of service class names ( not null , but possibly empty ) */ private List < String...
InputStream is = null ; BufferedReader reader = null ; List < String > names = new ArrayList < String > ( ) ; try { is = url . openStream ( ) ; reader = new BufferedReader ( new InputStreamReader ( is , "UTF-8" ) ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { parseLine ( names , line ) ; ...
public class OpenTSDBMain { /** * Starts the TSD . * @ param args The command line arguments */ private static void launchTSD ( String [ ] args ) { } }
ConfigArgP cap = new ConfigArgP ( args ) ; Config config = cap . getConfig ( ) ; ArgP argp = cap . getArgp ( ) ; applyCommandLine ( cap , argp ) ; config . loadStaticVariables ( ) ; // All options are now correctly set in config setJVMName ( config . getInt ( "tsd.network.port" ) , config . getString ( "tsd.network.bin...
public class VersionInfoSqlMapDao { /** * used only in tests */ void deleteAll ( ) { } }
transactionTemplate . execute ( new TransactionCallbackWithoutResult ( ) { @ Override protected void doInTransactionWithoutResult ( TransactionStatus status ) { sessionFactory . getCurrentSession ( ) . createQuery ( "DELETE FROM VersionInfo" ) . executeUpdate ( ) ; } } ) ;
public class TSProcessor { /** * Normalizes data in interval 0-1. * @ param data the dataset . * @ return normalized dataset . */ public double [ ] normOne ( double [ ] data ) { } }
double [ ] res = new double [ data . length ] ; double max = max ( data ) ; for ( int i = 0 ; i < data . length ; i ++ ) { res [ i ] = data [ i ] / max ; } return res ;
public class SymbolTable { /** * Similar to { link # findSymbol } , but will not add passed in symbol * if it is not in symbol table yet . */ public String findSymbolIfExists ( char [ ] buffer , int start , int len , int hash ) { } }
// Sanity check : if ( len < 1 ) { return EMPTY_STRING ; } hash &= mIndexMask ; String sym = mSymbols [ hash ] ; // Optimal case ; checking existing primary symbol for hash index : if ( sym != null ) { // Let ' s inline primary String equality checking : if ( sym . length ( ) == len ) { int i = 0 ; do { if ( sym . char...
public class AbstractCalendarAndExceptionFactory { /** * Process an individual work week day . * @ param data calendar data * @ param offset current offset into data * @ param week parent week * @ param day current day */ private void processWorkWeekDay ( byte [ ] data , int offset , ProjectCalendarWeek week , ...
// System . out . println ( ByteArrayHelper . hexdump ( data , offset , 60 , false ) ) ; int dayType = MPPUtility . getShort ( data , offset + 0 ) ; if ( dayType == 1 ) { week . setWorkingDay ( day , DayType . DEFAULT ) ; } else { ProjectCalendarHours hours = week . addCalendarHours ( day ) ; int rangeCount = MPPUtilit...
public class MutableLightMetaProperty { /** * Creates an instance from a { @ code Field } . * @ param < P > the property type * @ param metaBean the meta bean , not null * @ param field the field , not null * @ param constructorIndex the index of the property in the constructor * @ return the property , not n...
PropertyGetter getter = new PropertyGetter ( ) { @ Override public Object get ( Bean bean ) { try { return field . get ( bean ) ; } catch ( IllegalArgumentException | IllegalAccessException ex ) { throw new UnsupportedOperationException ( "Property cannot be read: " + propertyName , ex ) ; } } } ; PropertySetter setter...
public class BytesUtils { /** * Adds a big - endian 4 - byte integer to a sorted array of bytes . * @ param arr This byte array is assumed to be sorted array * of signed ints . * @ param n value to add . * @ return new array with the added value . */ public static byte [ ] add ( byte [ ] arr , int n ) { } }
int index = binarySearch ( arr , n ) ; byte [ ] arr2 = new byte [ arr . length + 4 ] ; System . arraycopy ( arr , 0 , arr2 , 0 , index ) ; System . arraycopy ( arr , index , arr2 , index + 4 , arr . length - index ) ; org . deephacks . confit . internal . hbase . Bytes . setInt ( arr2 , n , index ) ; return arr2 ;
public class StreamingJsonBuilder { /** * If you use named arguments and a closure as last argument , * the key / value pairs of the map ( as named arguments ) * and the key / value pairs represented in the closure * will be merged together & mdash ; * the closure properties overriding the map key / values * ...
writer . write ( JsonOutput . OPEN_BRACE ) ; writer . write ( generator . toJson ( name ) ) ; writer . write ( COLON_WITH_OPEN_BRACE ) ; boolean first = true ; for ( Object it : map . entrySet ( ) ) { if ( ! first ) { writer . write ( JsonOutput . COMMA ) ; } else { first = false ; } Map . Entry entry = ( Map . Entry )...
public class AWSJavaMailTransport { /** * Sends an email using AWS E - mail Service and notifies listeners * @ param m * Message used to notify users * @ param req * Raw email to be sent */ private void sendEmail ( Message m , SendRawEmailRequest req ) throws SendFailedException , MessagingException { } }
Address [ ] sent = null ; Address [ ] unsent = null ; Address [ ] invalid = null ; try { appendUserAgent ( req , USER_AGENT ) ; SendRawEmailResult resp = this . emailService . sendRawEmail ( req ) ; lastMessageId = resp . getMessageId ( ) ; sent = m . getAllRecipients ( ) ; unsent = new Address [ 0 ] ; invalid = new Ad...
public class LocalDateTime { /** * Returns a copy of this datetime with the value of the specified * field increased . * If the addition is zero or the field is null , then < code > this < / code > is returned . * These three lines are equivalent : * < pre > * LocalDateTime added = dt . withFieldAdded ( Durat...
if ( fieldType == null ) { throw new IllegalArgumentException ( "Field must not be null" ) ; } if ( amount == 0 ) { return this ; } long instant = fieldType . getField ( getChronology ( ) ) . add ( getLocalMillis ( ) , amount ) ; return withLocalMillis ( instant ) ;
public class DRConsumerDrIdTracker { /** * Check if this tracker contains the given range . If the given range is * before the safe point , it always returns true . * @ return true if the given range can be covered by the tracker . */ public boolean contains ( long startDrId , long endDrId ) { } }
assert startDrId <= endDrId ; return endDrId <= getSafePointDrId ( ) || m_map . encloses ( range ( startDrId , endDrId ) ) ;
public class FeaturesImpl { /** * Gets phraselist feature info . * @ param appId The application ID . * @ param versionId The version ID . * @ param phraselistId The ID of the feature to be retrieved . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to th...
return getPhraseListWithServiceResponseAsync ( appId , versionId , phraselistId ) . map ( new Func1 < ServiceResponse < PhraseListFeatureInfo > , PhraseListFeatureInfo > ( ) { @ Override public PhraseListFeatureInfo call ( ServiceResponse < PhraseListFeatureInfo > response ) { return response . body ( ) ; } } ) ;
public class StoryState { /** * Cleans inline whitespace in the following way : * - Removes all whitespace from the start and end of line ( including just before a \ n ) * - Turns all consecutive space and tab runs into single spaces ( HTML style ) */ String cleanOutputWhitespace ( String str ) { } }
StringBuilder sb = new StringBuilder ( str . length ( ) ) ; int currentWhitespaceStart = - 1 ; int startOfLine = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char c = str . charAt ( i ) ; boolean isInlineWhitespace = c == ' ' || c == '\t' ; if ( isInlineWhitespace && currentWhitespaceStart == - 1 ) currentWhit...
public class Templator { /** * Merges from string as template . * @ param template template content , with placeholders like : { { name } } * @ param values map with values to merge */ public static String mergeFromTemplate ( String template , Map < String , ? > values ) { } }
for ( String param : values . keySet ( ) ) { template = template . replace ( "{{" + param + "}}" , values . get ( param ) == null ? "" : values . get ( param ) . toString ( ) ) ; } return template . replaceAll ( "\n|\r| " , "" ) ;
public class Utils { /** * Decodes a URL - encoded string . * @ param s a string * @ return the decoded string */ public static String urlDecode ( String s ) { } }
if ( s == null ) { return "" ; } String decoded = s ; try { decoded = URLDecoder . decode ( s , Config . DEFAULT_ENCODING ) ; } catch ( UnsupportedEncodingException ex ) { logger . error ( null , ex ) ; } return decoded ;
public class OutputStreamLogger { /** * Writer that keeps track of when it hasn ' t seen a newline yet , will * auto - insert newlines except when lines start with a carriage return . */ @ Override public void write ( char [ ] cbuf , int off , int len ) throws IOException { } }
if ( len <= 0 ) { return ; } // if we havn ' t last seen a newline , and don ' t get a CR , insert a newline . if ( charsSinceNewline > 0 ) { if ( cbuf [ off ] != CARRIAGE_RETURN ) { super . write ( NEWLINEC , 0 , NEWLINEC . length ) ; charsSinceNewline = 0 ; } else { // length of this line : int nonnl = countNonNewlin...
public class OWLDisjointClassesAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the * { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } . * @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to rea...
deserialize ( streamReader , instance ) ;
public class ExecutionGraph { /** * Reconstructs the execution pipelines for the entire execution graph . */ private void reconstructExecutionPipelines ( ) { } }
final Iterator < ExecutionStage > it = this . stages . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . reconstructExecutionPipelines ( ) ; }
public class HpelBaseTraceService { /** * { @ inheritDoc } */ @ Override public void publishLogRecord ( LogRecord logRecord ) { } }
String formattedMsg = null ; String formattedVerboseMsg = null ; Level level = logRecord . getLevel ( ) ; int levelValue = level . intValue ( ) ; if ( levelValue >= Level . INFO . intValue ( ) ) { formattedMsg = formatter . formatMessage ( logRecord ) ; formattedVerboseMsg = formatter . formatVerboseMessage ( logRecord...
public class CountryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Country country , ProtocolMarshaller protocolMarshaller ) { } }
if ( country == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( country . getCountryCode ( ) , COUNTRYCODE_BINDING ) ; protocolMarshaller . marshall ( country . getCountryName ( ) , COUNTRYNAME_BINDING ) ; } catch ( Exception e ) { throw new...
public class AmazonEC2Waiters { /** * Builds a VpcPeeringConnectionDeleted waiter by using custom parameters waiterParameters and other parameters * defined in the waiters specification , and then polls until it determines whether the resource entered the desired * state or not , where polling criteria is bound by ...
return new WaiterBuilder < DescribeVpcPeeringConnectionsRequest , DescribeVpcPeeringConnectionsResult > ( ) . withSdkFunction ( new DescribeVpcPeeringConnectionsFunction ( client ) ) . withAcceptors ( new VpcPeeringConnectionDeleted . IsDeletedMatcher ( ) , new VpcPeeringConnectionDeleted . IsInvalidVpcPeeringConnectio...
public class MainFrame { /** * GEN - LAST : event _ trackingStopMenuItemActionPerformed */ private void readmeMenuItemActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ readmeMenuItemActionPerformed try { JTextArea textArea = new JTextArea ( ) ; Font font = textArea . getFont ( ) ; textArea . setFont ( new Font ( "Monospaced" , font . getStyle ( ) , font . getSize ( ) ) ) ; textArea . setEditable ( false ) ; String text = "" ; BufferedReader r = new BufferedRe...
public class CPDefinitionVirtualSettingLocalServiceBaseImpl { /** * Returns a range of all the cp definition virtual settings . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are inde...
return cpDefinitionVirtualSettingPersistence . findAll ( start , end ) ;
public class ExTagSupport { /** * Gets the resource associated with the given relative path for the * current JSP page request . * The path may be absolute , or relative to the current context root . * @ param pPath the path * @ return a path relative to the current context root */ public InputStream getResourc...
// throws MalformedURLException { String path = pPath ; if ( pPath != null && ! pPath . startsWith ( "/" ) ) { path = getContextPath ( ) + pPath ; } return pageContext . getServletContext ( ) . getResourceAsStream ( path ) ;
public class SimpleFacetAndHighlightQuery { /** * ( non - Javadoc ) * @ see org . springframework . data . solr . core . query . FacetQuery # setFacetOptions ( org . springframework . data . solr . core . query . FacetOptions ) */ @ SuppressWarnings ( "unchecked" ) @ Override public final < T extends SolrDataQuery > ...
if ( facetOptions != null ) { Assert . isTrue ( facetOptions . hasFacets ( ) , "Cannot set facet options having neither fields nor queries." ) ; } this . facetOptions = facetOptions ; return ( T ) this ;
public class DoubleStream { /** * Performs a reduction on the elements of this stream , using the provided * identity value and an associative accumulation function , and returns the * reduced value . * < p > The { @ code identity } value must be an identity for the accumulator * function . This means that for ...
double result = identity ; while ( iterator . hasNext ( ) ) { final double value = iterator . nextDouble ( ) ; result = accumulator . applyAsDouble ( result , value ) ; } return result ;
public class JvmDelegateTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public JvmTypeReference getDelegate ( ) { } }
if ( delegate != null && delegate . eIsProxy ( ) ) { InternalEObject oldDelegate = ( InternalEObject ) delegate ; delegate = ( JvmTypeReference ) eResolveProxy ( oldDelegate ) ; if ( delegate != oldDelegate ) { if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . RESOLVE , TypesPacka...
public class WalkingIteratorSorted { /** * This function is used to perform some extra analysis of the iterator . * @ param vars List of QNames that correspond to variables . This list * should be searched backwards for the first qualified name that * corresponds to the variable reference qname . The position of ...
super . fixupVariables ( vars , globalsSize ) ; int analysis = getAnalysisBits ( ) ; if ( WalkerFactory . isNaturalDocOrder ( analysis ) ) { m_inNaturalOrderStatic = true ; } else { m_inNaturalOrderStatic = false ; // System . out . println ( " Setting natural doc order to false : " + // WalkerFactory . getAnalysisStri...
public class SPX { /** * / * [ deutsch ] * < p > Implementierungsmethode des Interface { @ link Externalizable } . < / p > * @ param in input stream * @ throws IOException in case of I / O - problems * @ throws ClassNotFoundException if class - loading fails */ @ Override public void readExternal ( ObjectInput ...
byte header = in . readByte ( ) ; switch ( ( header & 0xFF ) >> 4 ) { case FALLBACK_TIMEZONE_TYPE : this . obj = this . readFallback ( in , header ) ; break ; case TRANSITION_RESOLVER_TYPE : this . obj = this . readStrategy ( header ) ; break ; case HISTORIZED_TIMEZONE_TYPE : this . obj = this . readZone ( in , header ...
public class CountMin64 { /** * The estimate is correct within epsilon * ( total item count ) , with probability confidence . */ public long estimateCount ( long item ) { } }
long count = Long . MAX_VALUE ; for ( int i = 0 ; i < depth ; ++ i ) { count = Math . min ( count , table [ i ] [ hash ( item , i ) ] ) ; } return count ;
public class RegionInstanceGroupClient { /** * Lists the instances in the specified instance group and displays information about the named * ports . Depending on the specified options , this method can list all instances or only the * instances that are running . * < p > Sample code : * < pre > < code > * tr...
ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest . newBuilder ( ) . setInstanceGroup ( instanceGroup ) . setRegionInstanceGroupsListInstancesRequestResource ( regionInstanceGroupsListInstancesRequestResource ) . build ( ) ; return listInstancesRegionInstanceGroups ( re...
public class FileFormatDataSchemaParser { /** * Whether a source file has already been resolved to data schemas . * @ param schemaSourceFile provides the source file . * @ return true if this source file has already been resolved to data schemas . */ private boolean wasResolved ( File schemaSourceFile ) { } }
final FileDataSchemaLocation schemaLocation = new FileDataSchemaLocation ( schemaSourceFile ) ; return _schemaResolver . locationResolved ( schemaLocation ) ;
public class EmoUriComponent { /** * Decode the path component of a URI as path segments . * @ param u the URI . If the path component is an absolute path component * then the leading ' / ' is ignored and is not considered a delimiator * of a path segment . * @ param decode true if the path segments of the path...
String rawPath = u . getRawPath ( ) ; if ( rawPath != null && rawPath . length ( ) > 0 && rawPath . charAt ( 0 ) == '/' ) { rawPath = rawPath . substring ( 1 ) ; } return decodePath ( rawPath , decode ) ;
public class ApiClients { /** * Gets the client name from the properties file * @ param fileName Properties file name * @ param defaultClientName Default client name * @ return The client name */ public static String getApiClient ( final Class < ? > apiClass , final String fileName , final String defaultClientNam...
InputStream propertiesStream = null ; try { propertiesStream = apiClass . getResourceAsStream ( fileName ) ; if ( propertiesStream != null ) { Properties props = new Properties ( ) ; props . load ( propertiesStream ) ; String name = ( String ) props . get ( "api-client.name" ) ; String version = ( String ) props . get ...
public class Distance { /** * Estimates the weighted euclidean distance of two Associative Arrays . * @ param a1 * @ param a2 * @ param columnWeights * @ return */ public static double euclideanWeighted ( AssociativeArray a1 , AssociativeArray a2 , Map < Object , Double > columnWeights ) { } }
Map < Object , Double > columnDistances = columnDistances ( a1 , a2 , columnWeights . keySet ( ) ) ; double distance = 0.0 ; for ( Map . Entry < Object , Double > entry : columnDistances . entrySet ( ) ) { double columnDistance = entry . getValue ( ) ; distance += ( columnDistance * columnDistance ) * columnWeights . g...
public class AlluxioFuseUtils { /** * Gets the group name from the group id . * @ param gid the group id * @ return group name */ public static String getGroupName ( long gid ) throws IOException { } }
if ( OSUtils . isLinux ( ) ) { String script = "getent group " + gid + " | cut -d: -f1" ; return ShellUtils . execCommand ( "bash" , "-c" , script ) . trim ( ) ; } else if ( OSUtils . isMacOS ( ) ) { String script = "dscl . list /Groups PrimaryGroupID | awk '($2 == \"" + gid + "\") { print $1 }'" ; return ShellUtils . ...
public class AnalyticsContext { /** * Fill this instance with library information . */ void putLibrary ( ) { } }
Map < String , Object > library = createMap ( ) ; library . put ( LIBRARY_NAME_KEY , "analytics-android" ) ; library . put ( LIBRARY_VERSION_KEY , BuildConfig . VERSION_NAME ) ; put ( LIBRARY_KEY , library ) ;
public class IpHelper { /** * Returns a list of local InetAddresses for this machine * @ param pruneSiteLocal * boolean Set to true if site local ( 10/8 , for example ) addresses should be pruned * @ param pruneDown * boolean Set to true to prune out interfaces whose . isUp ( ) return false * @ return List [ ...
try { Enumeration < NetworkInterface > nics = NetworkInterface . getNetworkInterfaces ( ) ; List < InetAddress > addresses = new Vector < InetAddress > ( ) ; while ( nics . hasMoreElements ( ) ) { NetworkInterface iface = nics . nextElement ( ) ; Enumeration < InetAddress > addrs = iface . getInetAddresses ( ) ; if ( !...
public class CmsUpdateDBContentTables { /** * Creates the CMS _ CONTENTS table if it does not exist yet . < p > * @ param dbCon the db connection interface * @ throws SQLException if something goes wrong */ @ Override protected void createContentsTable ( CmsSetupDb dbCon ) throws SQLException { } }
System . out . println ( new Exception ( ) . getStackTrace ( ) [ 0 ] . toString ( ) ) ; if ( ! dbCon . hasTableOrColumn ( TABLE_CMS_CONTENTS , null ) ) { String query = readQuery ( QUERY_CREATE_CMS_CONTENTS_TABLE_MYSQL ) ; Map < String , String > replacer = Collections . singletonMap ( "${tableEngine}" , m_poolData . g...
public class PreferenceFragment { /** * Initializes the custom dialog . */ private void initializeCustomDialog ( ) { } }
MaterialDialog . Builder builder = new MaterialDialog . Builder ( getActivity ( ) ) ; configureHeaderDialogBuilder ( builder ) ; configureButtonBarDialogBuilder ( builder ) ; builder . setView ( R . layout . custom_dialog_content ) ; builder . setCustomTitle ( R . layout . custom_dialog_title ) ; builder . setCustomMes...
public class AbstractViewQuery { /** * Register listener on double - tap gesture for view * @ param listener * @ return view */ public T doubleTap ( final GestureDetector . OnDoubleTapListener listener ) { } }
if ( view != null ) { final GestureDetector detector = new GestureDetector ( view . getContext ( ) , new GestureDetector . SimpleOnGestureListener ( ) ) ; detector . setOnDoubleTapListener ( listener ) ; view . setOnTouchListener ( new View . OnTouchListener ( ) { @ Override public boolean onTouch ( View v , MotionEven...
public class MutableBigInteger { /** * Right shift this MutableBigInteger n bits , where n is * less than 32. * Assumes that intLen > 0 , n > 0 for speed */ private final void primitiveRightShift ( int n ) { } }
int [ ] val = value ; int n2 = 32 - n ; for ( int i = offset + intLen - 1 , c = val [ i ] ; i > offset ; i -- ) { int b = c ; c = val [ i - 1 ] ; val [ i ] = ( c << n2 ) | ( b >>> n ) ; } val [ offset ] >>>= n ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertRenderingIntentReservedToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class RecipientDsnFields { /** * Additional X - headers to include in the DSN . * @ param extensionFields * Additional X - headers to include in the DSN . */ public void setExtensionFields ( java . util . Collection < ExtensionField > extensionFields ) { } }
if ( extensionFields == null ) { this . extensionFields = null ; return ; } this . extensionFields = new com . amazonaws . internal . SdkInternalList < ExtensionField > ( extensionFields ) ;
public class PathBuilder { /** * append an SVG Path command to this instance */ public PathBuilder append ( String cmd , double ... coords ) { } }
s . append ( cmd ) . append ( " " ) ; for ( double a : coords ) { s . append ( a ) . append ( " " ) ; } return this ;
public class ComponentSupport { /** * Used in conjunction with markForDeletion where any UIComponent marked will be removed . * @ deprecated use FaceletCompositionContext . finalizeForDeletion * @ param component * UIComponent to finalize */ @ Deprecated public static void finalizeForDeletion ( UIComponent compon...
// remove any existing marks of deletion component . getAttributes ( ) . remove ( MARK_DELETED ) ; // finally remove any children marked as deleted if ( component . getChildCount ( ) > 0 ) { for ( Iterator < UIComponent > iter = component . getChildren ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { UIComponent child = i...
public class CommerceDiscountUserSegmentRelUtil { /** * Returns the commerce discount user segment rels before and after the current commerce discount user segment rel in the ordered set where commerceDiscountId = & # 63 ; . * @ param commerceDiscountUserSegmentRelId the primary key of the current commerce discount u...
return getPersistence ( ) . findByCommerceDiscountId_PrevAndNext ( commerceDiscountUserSegmentRelId , commerceDiscountId , orderByComparator ) ;
public class ClobReplicationTrigger { /** * Returns null if no Clobs need to be replicated . */ static < S extends Storable > ClobReplicationTrigger < S > create ( Storage < S > masterStorage ) { } }
Map < String , ? extends StorableProperty < S > > properties = StorableIntrospector . examine ( masterStorage . getStorableType ( ) ) . getDataProperties ( ) ; List < String > clobNames = new ArrayList < String > ( 2 ) ; for ( StorableProperty < S > property : properties . values ( ) ) { if ( property . getType ( ) == ...
public class DnDManager { /** * Add the specified component as a drop target . * @ param autoremove if true , the source will automatically be removed * from the DnD system when it is removed from the component hierarchy . */ public static void addDropTarget ( DropTarget target , JComponent comp , boolean autoremov...
singleton . addTarget ( target , comp , autoremove ) ;
public class Reflections { /** * 获取指定位置的泛型 * @ param cls * @ param index * @ return */ public static Class getGeneric ( final Class cls , final int index ) { } }
Type [ ] generics = getGenerics ( cls ) ; if ( $ . notEmpty ( generics ) ) { return ( Class ) generics [ index ] ; } return null ;
public class AbstractBenchmark { /** * Initialize the environment for the executor . */ public void setup ( ExecutorType clientExecutor , ExecutorType serverExecutor , MessageSize requestSize , MessageSize responseSize , FlowWindowSize windowSize , ChannelType channelType , int maxConcurrentStreams , int channelCount )...
NettyServerBuilder serverBuilder ; NettyChannelBuilder channelBuilder ; if ( channelType == ChannelType . LOCAL ) { LocalAddress address = new LocalAddress ( "netty-e2e-benchmark" ) ; serverBuilder = NettyServerBuilder . forAddress ( address ) ; serverBuilder . channelType ( LocalServerChannel . class ) ; channelBuilde...
public class FaxClientFactory { /** * This function creates a new fax client based on the provided configuration . * @ param type * The fax client type ( may be null for default type ) * @ param configuration * The fax client configuration ( may be null ) * @ return The fax client instance */ public static Fa...
return FaxClientFactory . createFaxClientImpl ( type , configuration ) ;