signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ComponentDescriptorFactory { /** * Create a component descriptor for the passed component implementation class , hint and component role class .
* @ param componentClass the component implementation class
* @ param hint the hint
* @ param componentRoleType the component role type
* @ return the component descriptor with resolved component dependencies */
private ComponentDescriptor createComponentDescriptor ( Class < ? > componentClass , String hint , Type componentRoleType ) { } }
|
DefaultComponentDescriptor descriptor = new DefaultComponentDescriptor ( ) ; descriptor . setRoleType ( componentRoleType ) ; descriptor . setImplementation ( componentClass ) ; descriptor . setRoleHint ( hint ) ; descriptor . setInstantiationStrategy ( createComponentInstantiationStrategy ( componentClass ) ) ; // Set the injected fields .
// Note : that we need to find all fields since we can have some inherited fields which are annotated in a
// superclass . Since Java doesn ' t offer a method to return all fields we have to traverse all parent classes
// looking for declared fields .
for ( Field field : ReflectionUtils . getAllFields ( componentClass ) ) { ComponentDependency dependency = createComponentDependency ( field ) ; if ( dependency != null ) { descriptor . addComponentDependency ( dependency ) ; } } return descriptor ;
|
public class Text { /** * Performs variable replacement on the given string value . Each < code > $ { . . . } < / code > sequence
* within the given value is replaced with the value of the named parser variable . If a variable
* is not found in the properties an IllegalArgumentException is thrown unless
* < code > ignoreMissing < / code > is < code > true < / code > . In the later case , the missing variable is
* replaced by the empty string .
* @ param variables
* variables
* @ param value
* the original value
* @ param ignoreMissing
* if < code > true < / code > , missing variables are replaced by the empty string .
* @ return value after variable replacements
* @ throws IllegalArgumentException
* if the replacement of a referenced variable is not found */
public static String replaceVariables ( Properties variables , String value , boolean ignoreMissing ) throws IllegalArgumentException { } }
|
StringBuilder result = new StringBuilder ( ) ; // Value :
// | | p | - - > | q | - - > |
int p = 0 , q = value . indexOf ( "${" ) ; // Find first $ {
while ( q != - 1 ) { result . append ( value . substring ( p , q ) ) ; // Text before $ {
p = q ; q = value . indexOf ( "}" , q + 2 ) ; // Find }
if ( q != - 1 ) { String variable = value . substring ( p + 2 , q ) ; String replacement = variables . getProperty ( variable ) ; if ( replacement == null ) { if ( ignoreMissing ) { replacement = "" ; } else { throw new IllegalArgumentException ( "Replacement not found for ${" + variable + "}." ) ; } } result . append ( replacement ) ; p = q + 1 ; q = value . indexOf ( "${" , p ) ; // Find next $ {
} } result . append ( value . substring ( p , value . length ( ) ) ) ; // Trailing text
return result . toString ( ) ;
|
public class CheckArg { /** * Check that the argument is non - positive ( < = 0 ) .
* @ param argument The argument
* @ param name The name of the argument
* @ throws IllegalArgumentException If argument is positive ( > 0) */
public static void isNonPositive ( int argument , String name ) { } }
|
if ( argument > 0 ) { throw new IllegalArgumentException ( CommonI18n . argumentMayNotBePositive . text ( name , argument ) ) ; }
|
public class JFapDiscriminator { /** * begin F188491 */
public void cleanUpState ( VirtualConnection vc ) { } }
|
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cleanUpState" , vc ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cleanUpState" ) ;
|
public class TransactionLogger { /** * Start component timer for current instance
* @ param type - of component */
public static void startTimer ( final String type ) { } }
|
TransactionLogger instance = getInstance ( ) ; if ( instance == null ) { return ; } instance . components . putIfAbsent ( type , new Component ( type ) ) ; instance . components . get ( type ) . startTimer ( ) ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "coordinateOperationName" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "name" ) public JAXBElement < CodeType > createCoordinateOperationName ( CodeType value ) { } }
|
return new JAXBElement < CodeType > ( _CoordinateOperationName_QNAME , CodeType . class , null , value ) ;
|
import java . util . * ; class LuckyNumbers { /** * This function generates the first ' limit ' number of lucky numbers . Lucky numbers are numbers in a list
* where numbers with indices being multiples of the index of the previous lucky number are eliminated . */
public static ArrayList < Integer > generateLuckyNumbers ( int limit ) { } } Note : Please note that due to the difference in how Python and Java handle list / array slicing and list comprehension , the Java implementation seems more complex and it might not work correctly for larger inputs due to performance constraints .
|
ArrayList < Integer > sequence = new ArrayList < > ( ) ; for ( int i = - 1 ; i <= limit * limit + 9 ; i += 2 ) { sequence . add ( i ) ; } int index = 2 ; while ( index < sequence . size ( ) ) { int num = sequence . get ( index ) ; sequence . removeIf ( n -> sequence . indexOf ( n ) != sequence . lastIndexOf ( n ) && sequence . indexOf ( n ) % num == 0 ) ; index ++ ; } sequence . remove ( 0 ) ; while ( sequence . size ( ) > limit ) { sequence . remove ( sequence . size ( ) - 1 ) ; } return sequence ;
|
public class Scoreds { /** * Comparator which compares Scoreds first by score , then by item , where the item ordering to use
* is explicitly specified . */
public static final < T extends Comparable < T > > Ordering < Scored < T > > ByScoreThenByItem ( Ordering < T > itemOrdering ) { } }
|
final Ordering < Scored < T > > byItem = itemOrdering . onResultOf ( Scoreds . < T > itemsOnly ( ) ) ; final Ordering < Scored < T > > byScore = Scoreds . < T > ByScoreOnly ( ) ; return Ordering . compound ( ImmutableList . of ( byScore , byItem ) ) ;
|
public class JsonStringToJsonIntermediateConverter { /** * Parses primitive types
* @ param schema
* @ param value
* @ return
* @ throws DataConversionException */
private JsonElement parsePrimitiveType ( JsonSchema schema , JsonElement value ) throws DataConversionException { } }
|
if ( ( schema . isType ( NULL ) || schema . isNullable ( ) ) && value . isJsonNull ( ) ) { return JsonNull . INSTANCE ; } if ( ( schema . isType ( NULL ) && ! value . isJsonNull ( ) ) || ( ! schema . isType ( NULL ) && value . isJsonNull ( ) ) ) { throw new DataConversionException ( "Type mismatch for " + value . toString ( ) + " of type " + schema . getDataTypes ( ) . toString ( ) ) ; } if ( schema . isType ( FIXED ) ) { int expectedSize = schema . getSizeOfFixedData ( ) ; if ( value . getAsString ( ) . length ( ) == expectedSize ) { return value ; } else { throw new DataConversionException ( "Fixed type value is not same as defined value expected fieldsCount: " + expectedSize ) ; } } else { return value ; }
|
public class NodeEntryFactory { /** * Create NodeEntryImpl from map data . It will convert " tags " of type String as a comma separated list of tags , or
* " tags " a collection of strings into a set . It will remove properties excluded from allowed import .
* @ param map input map data
* @ return new entry
* @ throws IllegalArgumentException if name is not set */
@ SuppressWarnings ( "unchecked" ) public static NodeEntryImpl createFromMap ( final Map < String , Object > map ) throws IllegalArgumentException { } }
|
final NodeEntryImpl nodeEntry = new NodeEntryImpl ( ) ; final HashMap < String , Object > newmap = new HashMap < String , Object > ( map ) ; for ( final String excludeProp : excludeProps ) { newmap . remove ( excludeProp ) ; } if ( null != newmap . get ( "tags" ) && newmap . get ( "tags" ) instanceof String ) { String tags = ( String ) newmap . get ( "tags" ) ; String [ ] data ; if ( "" . equals ( tags . trim ( ) ) ) { data = new String [ 0 ] ; } else { data = tags . split ( "," ) ; } final HashSet set = new HashSet ( ) ; for ( final String s : data ) { if ( null != s && ! "" . equals ( s . trim ( ) ) ) { set . add ( s . trim ( ) ) ; } } newmap . put ( "tags" , set ) ; } else if ( null != newmap . get ( "tags" ) && newmap . get ( "tags" ) instanceof Collection ) { Collection tags = ( Collection ) newmap . get ( "tags" ) ; HashSet data = new HashSet ( ) ; for ( final Object tag : tags ) { if ( null != tag && ! "" . equals ( tag . toString ( ) . trim ( ) ) ) { data . add ( tag . toString ( ) . trim ( ) ) ; } } newmap . put ( "tags" , data ) ; } else if ( null != newmap . get ( "tags" ) ) { Object o = newmap . get ( "tags" ) ; newmap . put ( "tags" , new HashSet ( Arrays . asList ( o . toString ( ) . trim ( ) ) ) ) ; } try { BeanUtils . populate ( nodeEntry , newmap ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { e . printStackTrace ( ) ; } if ( null == nodeEntry . getNodename ( ) ) { throw new IllegalArgumentException ( "Required property 'nodename' was not specified" ) ; } if ( null == nodeEntry . getAttributes ( ) ) { nodeEntry . setAttributes ( new HashMap < String , String > ( ) ) ; } // populate attributes with any keys outside of nodeprops
for ( final Map . Entry < String , Object > entry : newmap . entrySet ( ) ) { if ( ! ResourceXMLConstants . allPropSet . contains ( entry . getKey ( ) ) ) { Object value = entry . getValue ( ) ; if ( null != value ) { nodeEntry . setAttribute ( entry . getKey ( ) , value . toString ( ) ) ; } } } return nodeEntry ;
|
public class SendableTextMessage { /** * This builder will be created with the text you provide already added with HTML formatting enabled .
* @ param text The text you would like the builder to be created with
* @ return A SendableTextMessageBuilder object with the text provided already added to it in HTML format . Used
* to construct the SendableTextMessage object */
public static SendableTextMessageBuilder html ( String text ) { } }
|
return builder ( ) . message ( text ) . parseMode ( ParseMode . HTML ) ;
|
public class CircularBufferDouble { /** * Adds a new value .
* @ param value new value */
public void addDouble ( double value ) { } }
|
data [ endOffset ] = value ; endOffset ++ ; // Grow the buffer if needed
if ( endOffset == data . length && ! reachedMax ) resize ( ) ; // Loop over and advance the start point if needed
if ( endOffset == data . length ) { endOffset = 0 ; } if ( endOffset == startOffset ) startOffset ++ ; if ( startOffset == data . length ) startOffset = 0 ;
|
public class SimpleSocketPoolImpl { /** * 创建连接池
* @ param parameters
* Socket连接池参数对象 */
public synchronized void buildThriftSocketPool ( ClientSocketPoolParameters parameters ) { } }
|
if ( ! ServerUtil . checkHostAndPort ( parameters . getHost ( ) , parameters . getPort ( ) ) ) throw new IllegalArgumentException ( "Server host or port is null !" ) ; SimpleSocketPoolImpl self = selfMap . get ( parameters . getKey ( ) ) ; if ( self == null ) self = init ( parameters ) ; try { for ( byte i = 0 ; i < size ; i ++ ) { self . socketPool . put ( new Byte ( i ) , parameters . buildClientThriftSocket ( ) ) ; self . socketStatusArray [ i ] = Boolean . FALSE ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
|
public class TitanFactory { /** * Load a properties file containing a Titan graph configuration .
* < ol >
* < li > Load the file contents into a { @ link org . apache . commons . configuration . PropertiesConfiguration } < / li >
* < li > For each key that points to a configuration object that is either a directory
* or local file , check
* whether the associated value is a non - null , non - absolute path . If so ,
* then prepend the absolute path of the parent directory of the provided configuration { @ code file } .
* This has the effect of making non - absolute backend
* paths relative to the config file ' s directory rather than the JVM ' s
* working directory .
* < li > Return the { @ link ReadConfiguration } for the prepared configuration file < / li >
* < / ol >
* @ param file A properties file to load
* @ return A configuration derived from { @ code file } */
@ SuppressWarnings ( "unchecked" ) private static ReadConfiguration getLocalConfiguration ( File file ) { } }
|
Preconditions . checkArgument ( file != null && file . exists ( ) && file . isFile ( ) && file . canRead ( ) , "Need to specify a readable configuration file, but was given: %s" , file . toString ( ) ) ; try { PropertiesConfiguration configuration = new PropertiesConfiguration ( file ) ; final File tmpParent = file . getParentFile ( ) ; final File configParent ; if ( null == tmpParent ) { /* * null usually means we were given a Titan config file path
* string like " foo . properties " that refers to the current
* working directory of the process . */
configParent = new File ( System . getProperty ( "user.dir" ) ) ; } else { configParent = tmpParent ; } Preconditions . checkNotNull ( configParent ) ; Preconditions . checkArgument ( configParent . isDirectory ( ) ) ; // TODO this mangling logic is a relic from the hardcoded string days ; it should be deleted and rewritten as a setting on ConfigOption
final Pattern p = Pattern . compile ( "(" + Pattern . quote ( STORAGE_NS . getName ( ) ) + "\\..*" + "(" + Pattern . quote ( STORAGE_DIRECTORY . getName ( ) ) + "|" + Pattern . quote ( STORAGE_CONF_FILE . getName ( ) ) + ")" + "|" + Pattern . quote ( INDEX_NS . getName ( ) ) + "\\..*" + "(" + Pattern . quote ( INDEX_DIRECTORY . getName ( ) ) + "|" + Pattern . quote ( INDEX_CONF_FILE . getName ( ) ) + ")" + ")" ) ; final Iterator < String > keysToMangle = Iterators . filter ( configuration . getKeys ( ) , new Predicate < String > ( ) { @ Override public boolean apply ( String key ) { if ( null == key ) return false ; return p . matcher ( key ) . matches ( ) ; } } ) ; while ( keysToMangle . hasNext ( ) ) { String k = keysToMangle . next ( ) ; Preconditions . checkNotNull ( k ) ; String s = configuration . getString ( k ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( s ) , "Invalid Configuration: key %s has null empty value" , k ) ; configuration . setProperty ( k , getAbsolutePath ( configParent , s ) ) ; } return new CommonsConfiguration ( configuration ) ; } catch ( ConfigurationException e ) { throw new IllegalArgumentException ( "Could not load configuration at: " + file , e ) ; }
|
public class AbstractGpxParserTrk { /** * Fires whenever an XML end markup is encountered . It catches attributes of
* trackPoints , trackSegments or routes and saves them in corresponding
* values [ ] .
* @ param uri URI of the local element
* @ param localName Name of the local element ( without prefix )
* @ param qName qName of the local element ( with prefix )
* @ throws SAXException Any SAX exception , possibly wrapping another
* exception */
@ Override public void endElement ( String uri , String localName , String qName ) throws SAXException { } }
|
// currentElement represents the last string encountered in the document
setCurrentElement ( getElementNames ( ) . pop ( ) ) ; if ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TRK ) ) { // parent . setTrksegID ( getTrksegID ( ) ) ;
// parent . setTrkptID ( getTrkptID ( ) ) ;
// Set the track geometry .
MultiLineString geometry = getGeometryFactory ( ) . createMultiLineString ( trkList . toArray ( new LineString [ 0 ] ) ) ; geometry . setSRID ( 4326 ) ; getCurrentLine ( ) . setGeometry ( geometry ) ; // if < / trk > markup is found , the currentLine is added in the table rtedbd and the default contentHandler is setted .
try { PreparedStatement pStm = getTrkPreparedStmt ( ) ; int i = 1 ; Object [ ] values = getCurrentLine ( ) . getValues ( ) ; for ( Object object : values ) { pStm . setObject ( i , object ) ; i ++ ; } pStm . execute ( ) ; } catch ( SQLException ex ) { throw new SAXException ( "Cannot import the track line " , ex ) ; } getReader ( ) . setContentHandler ( parent ) ; } else if ( getCurrentElement ( ) . compareToIgnoreCase ( "trkseg" ) == 0 ) { Coordinate [ ] trksegArray = trksegList . toArray ( new Coordinate [ 0 ] ) ; // If there are more than one trackpoint , we can set a geometry to the track segment
if ( trksegList . size ( ) > 1 ) { LineString geometry = getGeometryFactory ( ) . createLineString ( trksegArray ) ; geometry . setSRID ( 4326 ) ; getCurrentSegment ( ) . setGeometry ( geometry ) ; trkList . add ( geometry ) ; } // if < / trkseg > markup is found , the currentSegment is added in the table trksegdbd .
try { PreparedStatement pStm = getTrkSegmentsPreparedStmt ( ) ; int i = 1 ; Object [ ] values = getCurrentSegment ( ) . getValues ( ) ; for ( Object object : values ) { pStm . setObject ( i , object ) ; i ++ ; } pStm . execute ( ) ; } catch ( SQLException ex ) { throw new SAXException ( "Cannot import the track segment " , ex ) ; } } else if ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TRKPT ) ) { // if < / trkpt > markup is found , the currentPoint is added in the table trkptdbd .
point = false ; try { PreparedStatement pStm = getTrkPointsPreparedStmt ( ) ; int i = 1 ; Object [ ] values = getCurrentPoint ( ) . getValues ( ) ; for ( Object object : values ) { pStm . setObject ( i , object ) ; i ++ ; } pStm . execute ( ) ; } catch ( SQLException ex ) { throw new SAXException ( "Cannot import the track waypoints." , ex ) ; } } else if ( point ) { getCurrentPoint ( ) . setAttribute ( getCurrentElement ( ) , getContentBuffer ( ) ) ; } else if ( segment ) { getCurrentSegment ( ) . setExtensions ( ) ; } else { getCurrentLine ( ) . setAttribute ( getCurrentElement ( ) , getContentBuffer ( ) ) ; }
|
public class IoUtils { /** * Copy input stream to output stream and close them both
* @ param is input stream
* @ param os output stream
* @ throws IOException for any error */
public static void copyStreamAndClose ( InputStream is , OutputStream os ) throws IOException { } }
|
try { copyStream ( is , os , DEFAULT_BUFFER_SIZE ) ; // throw an exception if the close fails since some data might be lost
is . close ( ) ; os . close ( ) ; } finally { // . . . but still guarantee that they ' re both closed
safeClose ( is ) ; safeClose ( os ) ; }
|
public class AdjunctManager { /** * Controls whether the given resource can be served to browsers .
* This method can be overridden by the sub classes to change the access control behavior .
* { @ link AdjunctManager } is capable of serving all the resources visible
* in the classloader by default . If the resource files need to be kept private ,
* return false , which causes the request to fail with 401.
* Otherwise return true , in which case the resource will be served . */
protected boolean allowResourceToBeServed ( String absolutePath ) { } }
|
// does it have an adjunct directory marker ?
int idx = absolutePath . lastIndexOf ( '/' ) ; if ( idx > 0 && classLoader . getResource ( absolutePath . substring ( 0 , idx ) + "/.adjunct" ) != null ) return true ; // backward compatible behaviour
return absolutePath . endsWith ( ".gif" ) || absolutePath . endsWith ( ".png" ) || absolutePath . endsWith ( ".css" ) || absolutePath . endsWith ( ".js" ) ;
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcProductSelect ( ) { } }
|
if ( ifcProductSelectEClass == null ) { ifcProductSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1151 ) ; } return ifcProductSelectEClass ;
|
public class ModelBatch { /** * Convenience function to write the current state of the modelBatch out to a file , including all factors .
* WARNING : These files can get quite large , if you ' re using large embeddings as features .
* @ param filename the file to write the batch to
* @ throws IOException */
public void writeToFile ( String filename ) throws IOException { } }
|
FileOutputStream fos = new FileOutputStream ( filename ) ; writeToStream ( fos ) ; fos . close ( ) ;
|
public class PointLocationFormatter { /** * Formats a longitude as an ISO 6709 string .
* @ param longitude
* Longitude to format
* @ param formatType
* Format type
* @ return Formatted string
* @ throws FormatterException
* On an exception */
public static String formatLongitude ( final Longitude longitude , final PointLocationFormatType formatType ) throws FormatterException { } }
|
if ( longitude == null ) { throw new FormatterException ( "No point location provided" ) ; } if ( formatType == null ) { throw new FormatterException ( "No format type provided" ) ; } final String formatted ; switch ( formatType ) { case HUMAN_LONG : formatted = longitude . toString ( ) ; break ; case HUMAN_MEDIUM : formatted = formatLongitudeHumanMedium ( longitude ) ; break ; case LONG : formatted = formatLongitudeLong ( longitude ) ; break ; case MEDIUM : formatted = formatLongitudeMedium ( longitude ) ; break ; case SHORT : formatted = formatLongitudeShort ( longitude ) ; break ; case DECIMAL : formatted = formatLongitudeWithDecimals ( longitude ) ; break ; default : throw new FormatterException ( "Unsupported format type" ) ; } return formatted ;
|
public class WorkingDirectories { /** * Get the directory where the compiled jasper reports should be put .
* @ param configuration the configuration for the current app . */
public final File getJasperCompilation ( final Configuration configuration ) { } }
|
File jasperCompilation = new File ( getWorking ( configuration ) , "jasper-bin" ) ; createIfMissing ( jasperCompilation , "Jasper Compilation" ) ; return jasperCompilation ;
|
public class JacksonUtils { /** * Extract value from a { @ link JsonNode } .
* @ param node
* @ param clazz
* @ return */
public static < T > T asValue ( JsonNode node , Class < T > clazz ) { } }
|
return node != null ? ValueUtils . convertValue ( node , clazz ) : null ;
|
public class Ginv { /** * Swap components in the two columns .
* @ param matrix
* the matrix to modify
* @ param col1
* the first row
* @ param col2
* the second row */
public static void swapCols ( double [ ] [ ] matrix , int col1 , int col2 ) { } }
|
double temp = 0 ; int rows = matrix . length ; double [ ] r = null ; for ( int row = 0 ; row < rows ; row ++ ) { r = matrix [ row ] ; temp = r [ col1 ] ; r [ col1 ] = r [ col2 ] ; r [ col2 ] = temp ; }
|
public class MailProvider { /** * Creates and saves a new mail */
public Observable < Mail > addMailWithDelay ( final Mail mail ) { } }
|
return Observable . defer ( new Func0 < Observable < Mail > > ( ) { @ Override public Observable < Mail > call ( ) { delay ( ) ; Observable o = checkExceptions ( ) ; if ( o != null ) { return o ; } return Observable . just ( mail ) ; } } ) . flatMap ( new Func1 < Mail , Observable < Mail > > ( ) { @ Override public Observable < Mail > call ( Mail mail ) { return addMail ( mail ) ; } } ) ;
|
public class FuncExtFunction { /** * Execute the function . The function must return
* a valid object .
* @ param xctxt The current execution context .
* @ return A valid XObject .
* @ throws javax . xml . transform . TransformerException */
public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } }
|
if ( xctxt . isSecureProcessing ( ) ) throw new javax . xml . transform . TransformerException ( XPATHMessages . createXPATHMessage ( XPATHErrorResources . ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED , new Object [ ] { toString ( ) } ) ) ; XObject result ; Vector argVec = new Vector ( ) ; int nArgs = m_argVec . size ( ) ; for ( int i = 0 ; i < nArgs ; i ++ ) { Expression arg = ( Expression ) m_argVec . elementAt ( i ) ; XObject xobj = arg . execute ( xctxt ) ; /* * Should cache the arguments for func : function */
xobj . allowDetachToRelease ( false ) ; argVec . addElement ( xobj ) ; } // dml
ExtensionsProvider extProvider = ( ExtensionsProvider ) xctxt . getOwnerObject ( ) ; Object val = extProvider . extFunction ( this , argVec ) ; if ( null != val ) { result = XObject . create ( val , xctxt ) ; } else { result = new XNull ( ) ; } return result ;
|
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > long < / code > .
* If no such property is specified , or if the specified value is not a valid
* < code > long < / code > , then < code > defaultValue < / code > is returned .
* @ param name property name .
* @ param defaultValue default value .
* @ return property value as a < code > long < / code > ,
* or < code > defaultValue < / code > . */
public long getLong ( String name , long defaultValue ) { } }
|
String valueString = get ( name ) ; if ( valueString == null ) return defaultValue ; try { String hexString = getHexDigits ( valueString ) ; if ( hexString != null ) { return Long . parseLong ( hexString , 16 ) ; } return Long . parseLong ( valueString ) ; } catch ( NumberFormatException e ) { return defaultValue ; }
|
public class HibernateClient { /** * ( non - Javadoc )
* @ see com . impetus . kundera . client . Client # getColumnsById ( java . lang . String ,
* java . lang . String , java . lang . String , java . lang . String , java . lang . Object ,
* java . lang . Class ) */
@ Override public < E > List < E > getColumnsById ( String schemaName , String joinTableName , String joinColumnName , String inverseJoinColumnName , Object parentId , Class columnJavaType ) { } }
|
StringBuffer sqlQuery = new StringBuffer ( ) ; sqlQuery . append ( "SELECT " ) . append ( inverseJoinColumnName ) . append ( " FROM " ) . append ( getFromClause ( schemaName , joinTableName ) ) . append ( " WHERE " ) . append ( joinColumnName ) . append ( "='" ) . append ( parentId ) . append ( "'" ) ; Session s = getSession ( ) ; SQLQuery query = s . createSQLQuery ( sqlQuery . toString ( ) ) ; List < E > foreignKeys = new ArrayList < E > ( ) ; foreignKeys = query . list ( ) ; return foreignKeys ;
|
public class BasicAnnotationProcessor { /** * Returns the previously deferred elements . */
private ImmutableMap < String , Optional < ? extends Element > > deferredElements ( ) { } }
|
ImmutableMap . Builder < String , Optional < ? extends Element > > deferredElements = ImmutableMap . builder ( ) ; for ( ElementName elementName : deferredElementNames ) { deferredElements . put ( elementName . name ( ) , elementName . getElement ( elements ) ) ; } return deferredElements . build ( ) ;
|
public class ApplicationModule { /** * Override for customizing XmlMapper and ObjectMapper */
public void bindMappers ( ) { } }
|
JacksonXmlModule xmlModule = new JacksonXmlModule ( ) ; xmlModule . setDefaultUseWrapper ( false ) ; XmlMapper xmlMapper = new XmlMapper ( xmlModule ) ; xmlMapper . enable ( ToXmlGenerator . Feature . WRITE_XML_DECLARATION ) ; this . bind ( XmlMapper . class ) . toInstance ( xmlMapper ) ; ObjectMapper objectMapper = new ObjectMapper ( ) ; objectMapper . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; objectMapper . configure ( DeserializationFeature . ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT , true ) ; objectMapper . configure ( DeserializationFeature . ACCEPT_EMPTY_STRING_AS_NULL_OBJECT , true ) ; objectMapper . configure ( DeserializationFeature . EAGER_DESERIALIZER_FETCH , true ) ; objectMapper . configure ( DeserializationFeature . ACCEPT_SINGLE_VALUE_AS_ARRAY , true ) ; objectMapper . configure ( DeserializationFeature . USE_BIG_DECIMAL_FOR_FLOATS , true ) ; objectMapper . registerModule ( new AfterburnerModule ( ) ) ; objectMapper . registerModule ( new Jdk8Module ( ) ) ; this . bind ( ObjectMapper . class ) . toInstance ( objectMapper ) ; this . requestStaticInjection ( Extractors . class ) ; this . requestStaticInjection ( ServerResponse . class ) ;
|
public class Element { /** * Waits for specific element at locator to be not visible within period of
* specified time
* @ param time
* Milliseconds
* @ throws WidgetException */
public void waitForNotVisible ( final long time ) throws WidgetException { } }
|
try { waitForCommand ( new ITimerCallback ( ) { @ Override public boolean execute ( ) throws WidgetException { return ! isVisible ( ) ; } @ Override public String toString ( ) { return "Waiting for element with locator: " + locator + " to not be visible" ; } } , time ) ; } catch ( Exception e ) { throw new WidgetException ( "Error while waiting for element to be not visible" , locator , e ) ; }
|
public class OptionsDoclet { /** * Tests the validity of command - line arguments passed to this doclet . Returns true if the option
* usage is valid , and false otherwise . This method is automatically invoked by Javadoc .
* < p > Also sets fields from the command - line arguments .
* @ param options the command - line options to be checked : an array of 1 - or 2 - element arrays ,
* where the length depends on { @ link # optionLength } applied to the first element
* @ param reporter where to report errors
* @ return true iff the command - line options are valid
* @ see < a
* href = " https : / / docs . oracle . com / javase / 8 / docs / technotes / guides / javadoc / doclet / overview . html " > Doclet
* overview < / a > */
@ SuppressWarnings ( "index" ) // dependent : os [ 1 ] is legal when optionLength ( os [ 0 ] ) = = 2
public static boolean validOptions ( String [ ] @ MinLen ( 1 ) [ ] options , DocErrorReporter reporter ) { } }
|
boolean hasDocFile = false ; boolean hasOutFile = false ; boolean hasDestDir = false ; boolean hasFormat = false ; boolean inPlace = false ; String docFile = null ; String outFile = null ; for ( int oi = 0 ; oi < options . length ; oi ++ ) { String [ ] os = options [ oi ] ; String opt = os [ 0 ] . toLowerCase ( ) ; if ( opt . equals ( "-docfile" ) ) { if ( hasDocFile ) { reporter . printError ( "-docfile option specified twice" ) ; return false ; } docFile = os [ 1 ] ; File f = new File ( docFile ) ; if ( ! f . exists ( ) ) { reporter . printError ( "-docfile file not found: " + docFile ) ; return false ; } hasDocFile = true ; } if ( opt . equals ( "-outfile" ) ) { if ( hasOutFile ) { reporter . printError ( "-outfile option specified twice" ) ; return false ; } if ( inPlace ) { reporter . printError ( "-i and -outfile can not be used at the same time" ) ; return false ; } outFile = os [ 1 ] ; hasOutFile = true ; } if ( opt . equals ( "-i" ) ) { if ( hasOutFile ) { reporter . printError ( "-i and -outfile can not be used at the same time" ) ; return false ; } inPlace = true ; } if ( opt . equals ( "-format" ) ) { if ( hasFormat ) { reporter . printError ( "-format option specified twice" ) ; return false ; } String format = os [ 1 ] ; if ( ! format . equals ( "javadoc" ) && ! format . equals ( "html" ) ) { reporter . printError ( "unrecognized output format: " + format ) ; return false ; } hasFormat = true ; } if ( opt . equals ( "-d" ) ) { if ( hasDestDir ) { reporter . printError ( "-d specified twice" ) ; return false ; } hasDestDir = true ; } } if ( docFile != null && outFile != null && outFile . equals ( docFile ) ) { reporter . printError ( "docfile must be different from outfile" ) ; return false ; } if ( inPlace && docFile == null ) { reporter . printError ( "-i supplied but -docfile was not" ) ; return false ; } return true ;
|
public class HeaderHandlingDispatcherPortlet { /** * Processes the actual dispatching to the handler for render requests .
* < p > The handler will be obtained by applying the portlet ' s HandlerMappings in order . The
* HandlerAdapter will be obtained by querying the portlet ' s installed HandlerAdapters to find
* the first that supports the handler class .
* < p > For two - phase render processing
* < ol >
* < li > the interceptors and exception handlers should handle the two phases appropriately ( if
* not idempotent skip processing during RENDER _ HEADERS phase ) .
* < li > Though a streaming portlet likely will invoke RENDER _ HEADERS before RENDER _ MARKUP ,
* there is no guarantee of order of execution ; e . g . render _ markup may be called before
* render _ header . The only guarantee is that the resulting markup is inserted in the
* appropriate order .
* < / ol >
* < p > For single - phase render , this method executes following normal conventions .
* < p > For two - phase render , this method will delegate < code > RENDER _ MARKUP < / code > of a two - phase
* render processing to the parent class for normal processing . Ideally for the < code >
* RENDER _ HEADERS < / code > phase it would invoke the portlet if there were no exceptions from the
* Action Phase ( leave ACTION _ EXCEPTION _ SESSION _ ATTRIBUTE in session and leave rethrowing the
* exception for the RENDER _ MARKUP phase ) and probably render no output if there was an
* exception . However triggerAfterRenderCompletion in the superclass is a private method so it
* cannot be executed in a subclass . For now we can only have RENDER _ HEADERS perform the normal
* processing until Spring Framework Portlet MVC code incorporates this behavior .
* @ param request current portlet render request
* @ param response current portlet render response
* @ throws Exception in case of any kind of processing failure */
@ Override protected void doRenderService ( RenderRequest request , RenderResponse response ) throws Exception { } }
|
super . doRenderService ( request , response ) ;
|
public class PasswordImpl { /** * reads the password defined in the Lucee configuration , this can also in older formats ( only
* hashed or encrypted )
* @ param el
* @ param salt
* @ param isDefault
* @ return */
public static Password readFromXML ( Element el , String salt , boolean isDefault ) { } }
|
String prefix = isDefault ? "default-" : "" ; // first we look for the hashed and salted password
String pw = el . getAttribute ( prefix + "hspw" ) ; if ( ! StringUtil . isEmpty ( pw , true ) ) { // password is only of use when there is a salt as well
if ( salt == null ) return null ; return new PasswordImpl ( ORIGIN_HASHED_SALTED , pw , salt , HASHED_SALTED ) ; } // fall back to password that is hashed but not salted
pw = el . getAttribute ( prefix + "pw" ) ; if ( ! StringUtil . isEmpty ( pw , true ) ) { return new PasswordImpl ( ORIGIN_HASHED , pw , null , HASHED ) ; } // fall back to encrypted password
String pwEnc = el . getAttribute ( prefix + "password" ) ; if ( ! StringUtil . isEmpty ( pwEnc , true ) ) { String rawPassword = new BlowfishEasy ( "tpwisgh" ) . decryptString ( pwEnc ) ; return new PasswordImpl ( ORIGIN_ENCRYPTED , rawPassword , salt ) ; } return null ;
|
public class RemoteRecordOwner { /** * Get the database owner for this recordowner .
* Typically , the Environment is returned .
* If you are using transactions , then the recordowner is returned , as the recordowner
* needs private database connections to track transactions .
* Just remember , if you are managing transactions , you need to call commit or your trxs are toast .
* Also , you have to set the AUTO _ COMMIT to false , before you init your records , so the database
* object will be attached to the recordowner rather than the environment .
* @ return The database owner . */
public DatabaseOwner getDatabaseOwner ( ) { } }
|
DatabaseOwner databaseOwner = null ; if ( DBConstants . FALSE . equalsIgnoreCase ( this . getProperty ( SQLParams . AUTO_COMMIT_PARAM ) ) ) databaseOwner = this ; // If auto - commit is off , I am the db owner .
else if ( ! Utility . getSystemSuffix ( this . getProperty ( DBConstants . SYSTEM_NAME ) , null ) . equalsIgnoreCase ( Utility . getSystemSuffix ( this . getTask ( ) . getApplication ( ) . getProperty ( DBConstants . SYSTEM_NAME ) , null ) ) ) databaseOwner = this ; // If the system database is different than my parent , I am the db owner .
else databaseOwner = ( BaseApplication ) this . getTask ( ) . getApplication ( ) ; return databaseOwner ;
|
public class Sha256Hash { /** * Calculates the hash of hash on the given chunks of bytes . This is equivalent to concatenating the two
* chunks and then passing the result to { @ link # hashTwice ( byte [ ] ) } . */
public static byte [ ] hashTwice ( byte [ ] input1 , byte [ ] input2 ) { } }
|
MessageDigest digest = newDigest ( ) ; digest . update ( input1 ) ; digest . update ( input2 ) ; return digest . digest ( digest . digest ( ) ) ;
|
public class POIProxy { /** * This method is used to get the pois from a service and return a GeoJSON
* document with the data retrieved given a Z / X / Y tile .
* @ param id
* The id of the service
* @ param z
* The zoom level
* @ param x
* The x tile
* @ param y
* The y tile
* @ return The GeoJSON response from the original service response */
public String getPOIs ( String id , int z , int x , int y , List < Param > optionalParams ) throws Exception { } }
|
DescribeService describeService = getDescribeServiceByID ( id ) ; Extent e1 = TileConversor . tileOSMMercatorBounds ( x , y , z ) ; double [ ] minXY = ConversionCoords . reproject ( e1 . getMinX ( ) , e1 . getMinY ( ) , CRSFactory . getCRS ( MERCATOR_SRS ) , CRSFactory . getCRS ( GEODETIC_SRS ) ) ; double [ ] maxXY = ConversionCoords . reproject ( e1 . getMaxX ( ) , e1 . getMaxY ( ) , CRSFactory . getCRS ( MERCATOR_SRS ) , CRSFactory . getCRS ( GEODETIC_SRS ) ) ; POIProxyEvent beforeEvent = new POIProxyEvent ( POIProxyEventEnum . BeforeBrowseZXY , describeService , e1 , z , y , x , null , null , null , null , null , null ) ; notifyListenersBeforeRequest ( beforeEvent ) ; String geoJSON = getCacheData ( beforeEvent ) ; boolean fromCache = true ; if ( geoJSON == null ) { fromCache = false ; geoJSON = getResponseAsGeoJSON ( id , optionalParams , describeService , minXY [ 0 ] , minXY [ 1 ] , maxXY [ 0 ] , maxXY [ 1 ] , 0 , 0 , beforeEvent ) ; } POIProxyEvent afterEvent = new POIProxyEvent ( POIProxyEventEnum . AfterBrowseZXY , describeService , e1 , z , y , x , null , null , null , null , geoJSON , null ) ; if ( ! fromCache ) { storeData ( afterEvent ) ; } notifyListenersAfterParse ( afterEvent ) ; return geoJSON ;
|
public class JobsImpl { /** * Adds a job to the specified account .
* The Batch service supports two ways to control the work done as part of a job . In the first approach , the user specifies a Job Manager task . The Batch service launches this task when it is ready to start the job . The Job Manager task controls all other tasks that run under this job , by using the Task APIs . In the second approach , the user directly controls the execution of tasks under an active job , by using the Task APIs . Also note : when naming jobs , avoid including sensitive information such as user names or secret project names . This information may appear in telemetry logs accessible to Microsoft Support engineers .
* @ param job The job to be added .
* @ param jobAddOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws BatchErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void add ( JobAddParameter job , JobAddOptions jobAddOptions ) { } }
|
addWithServiceResponseAsync ( job , jobAddOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class Matcher { /** * Returns the input subsequence captured by the given group during the
* previous match operation .
* < p > For a matcher < i > m < / i > , input sequence < i > s < / i > , and group index
* < i > g < / i > , the expressions < i > m . < / i > < tt > group ( < / tt > < i > g < / i > < tt > ) < / tt > and
* < i > s . < / i > < tt > substring ( < / tt > < i > m . < / i > < tt > start ( < / tt > < i > g < / i > < tt > ) , < / tt > & nbsp ; < i > m . < / i > < tt > end ( < / tt > < i > g < / i > < tt > ) ) < / tt >
* are equivalent . < / p >
* < p > < a href = " Pattern . html # cg " > Capturing groups < / a > are indexed from left
* to right , starting at one . Group zero denotes the entire pattern , so
* the expression < tt > m . group ( 0 ) < / tt > is equivalent to < tt > m . group ( ) < / tt > .
* < p > If the match was successful but the group specified failed to match
* any part of the input sequence , then < tt > null < / tt > is returned . Note
* that some groups , for example < tt > ( a * ) < / tt > , match the empty string .
* This method will return the empty string when such a group successfully
* matches the empty string in the input . < / p >
* @ param group
* The index of a capturing group in this matcher ' s pattern
* @ return The ( possibly empty ) subsequence captured by the group
* during the previous match , or < tt > " " < / tt > if the group
* failed to match part of the input */
public String group ( int group ) { } }
|
MemReg mr = bounds ( group ) ; if ( mr == null ) return null ; return getString ( mr . in , mr . out ) ;
|
public class nat64 { /** * Use this API to update nat64. */
public static base_response update ( nitro_service client , nat64 resource ) throws Exception { } }
|
nat64 updateresource = new nat64 ( ) ; updateresource . name = resource . name ; updateresource . acl6name = resource . acl6name ; updateresource . netprofile = resource . netprofile ; return updateresource . update_resource ( client ) ;
|
public class QueryParameterWrap { /** * 添加命名的参数 : propertyName - > 命名的参数
* @ param name
* @ param values
* @ return */
public QueryParameterWrap addParameters ( String name , Collection < ? > values ) { } }
|
this . namedParameter . put ( name , values ) ; return this ;
|
public class BlurImageOps { /** * Applies a mean box filter .
* @ param input Input image . Not modified .
* @ param output ( Optional ) Storage for output image , Can be null . Modified .
* @ param radius Radius of the box blur function .
* @ param storage ( Optional ) Storage for intermediate results . Same size as input image . Can be null .
* @ return Output blurred image . */
public static GrayF64 mean ( GrayF64 input , @ Nullable GrayF64 output , int radius , @ Nullable GrayF64 storage , @ Nullable DWorkArrays workVert ) { } }
|
if ( radius <= 0 ) throw new IllegalArgumentException ( "Radius must be > 0" ) ; output = InputSanityCheck . checkDeclare ( input , output ) ; storage = InputSanityCheck . checkDeclare ( input , storage ) ; boolean processed = BOverrideBlurImageOps . invokeNativeMean ( input , output , radius , storage ) ; if ( ! processed ) { ConvolveImageMean . horizontal ( input , storage , radius ) ; ConvolveImageMean . vertical ( storage , output , radius , workVert ) ; } return output ;
|
public class Murmur64 { /** * Calculates hash from a buffer */
public static long generate ( long hash , final byte [ ] buffer , final int offset , final int length ) { } }
|
final long m = 0xc6a4a7935bd1e995L ; final int r = 47 ; hash ^= length * m ; int len8 = length / 8 ; for ( int i = 0 ; i < len8 ; i ++ ) { final int index = i * 8 + offset ; long k = ( ( buffer [ index + 0 ] & 0xffL ) | ( ( buffer [ index + 1 ] & 0xffL ) << 8 ) | ( ( buffer [ index + 2 ] & 0xffL ) << 16 ) | ( ( buffer [ index + 3 ] & 0xffL ) << 24 ) | ( ( buffer [ index + 4 ] & 0xffL ) << 32 ) | ( ( buffer [ index + 5 ] & 0xffL ) << 40 ) | ( ( buffer [ index + 6 ] & 0xffL ) << 48 ) | ( ( buffer [ index + 7 ] & 0xffL ) << 56 ) ) ; k *= m ; k ^= k >>> r ; k *= m ; hash ^= k ; hash *= m ; } final int off = offset + ( length & ~ 0x7 ) ; switch ( length % 8 ) { case 7 : hash ^= ( buffer [ off + 6 ] & 0xffL ) << 48 ; case 6 : hash ^= ( buffer [ off + 5 ] & 0xffL ) << 40 ; case 5 : hash ^= ( buffer [ off + 4 ] & 0xffL ) << 32 ; case 4 : hash ^= ( buffer [ off + 3 ] & 0xffL ) << 24 ; case 3 : hash ^= ( buffer [ off + 2 ] & 0xffL ) << 16 ; case 2 : hash ^= ( buffer [ off + 1 ] & 0xffL ) << 8 ; case 1 : hash ^= ( buffer [ off + 0 ] & 0xffL ) ; hash *= m ; } hash ^= hash >>> r ; hash *= m ; hash ^= hash >>> r ; return hash ;
|
public class LinkedOptionalMap { /** * Creates an { @ code LinkedOptionalMap } from the provided map .
* < p > This method is the equivalent of { @ link Optional # of ( Object ) } but for maps . To support more than one { @ code NULL }
* key , an optional map requires a unique string name to be associated with each key ( provided by keyNameGetter )
* @ param sourceMap a source map to wrap as an optional map .
* @ param keyNameGetter function that assigns a unique name to the keys of the source map .
* @ param < K > key type
* @ param < V > value type
* @ return an { @ code LinkedOptionalMap } with optional named keys , and optional values . */
public static < K , V > LinkedOptionalMap < K , V > optionalMapOf ( Map < K , V > sourceMap , Function < K , String > keyNameGetter ) { } }
|
LinkedHashMap < String , KeyValue < K , V > > underlyingMap = new LinkedHashMap < > ( sourceMap . size ( ) ) ; sourceMap . forEach ( ( k , v ) -> { String keyName = keyNameGetter . apply ( k ) ; underlyingMap . put ( keyName , new KeyValue < > ( k , v ) ) ; } ) ; return new LinkedOptionalMap < > ( underlyingMap ) ;
|
public class CubicInterpolation { /** * Used by HllEstimators */
static double usingXArrAndYStride ( final double [ ] xArr , final double yStride , final double x ) { } }
|
final int xArrLen = xArr . length ; final int xArrLenM1 = xArrLen - 1 ; final int offset ; assert ( ( xArrLen >= 4 ) && ( x >= xArr [ 0 ] ) && ( x <= xArr [ xArrLenM1 ] ) ) ; if ( x == xArr [ xArrLenM1 ] ) { /* corner case */
return ( yStride * ( xArrLenM1 ) ) ; } offset = findStraddle ( xArr , x ) ; // uses recursion
final int xArrLenM2 = xArrLen - 2 ; assert ( ( offset >= 0 ) && ( offset <= ( xArrLenM2 ) ) ) ; if ( offset == 0 ) { /* corner case */
return ( interpolateUsingXArrAndYStride ( xArr , yStride , ( offset - 0 ) , x ) ) ; } else if ( offset == xArrLenM2 ) { /* corner case */
return ( interpolateUsingXArrAndYStride ( xArr , yStride , ( offset - 2 ) , x ) ) ; } /* main case */
return ( interpolateUsingXArrAndYStride ( xArr , yStride , ( offset - 1 ) , x ) ) ;
|
public class CPDefinitionSpecificationOptionValueLocalServiceUtil { /** * Returns the cp definition specification option value matching the UUID and group .
* @ param uuid the cp definition specification option value ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp definition specification option value , or < code > null < / code > if a matching cp definition specification option value could not be found */
public static com . liferay . commerce . product . model . CPDefinitionSpecificationOptionValue fetchCPDefinitionSpecificationOptionValueByUuidAndGroupId ( String uuid , long groupId ) { } }
|
return getService ( ) . fetchCPDefinitionSpecificationOptionValueByUuidAndGroupId ( uuid , groupId ) ;
|
public class SasFileParser { /** * The function to process element of row .
* @ param source an array of bytes containing required data .
* @ param offset the offset in source of required data .
* @ param currentColumnIndex index of the current element .
* @ return object storing the data of the element . */
private Object processElement ( byte [ ] source , int offset , int currentColumnIndex ) { } }
|
byte [ ] temp ; int length = columnsDataLength . get ( currentColumnIndex ) ; if ( columns . get ( currentColumnIndex ) . getType ( ) == Number . class ) { temp = Arrays . copyOfRange ( source , offset + ( int ) ( long ) columnsDataOffset . get ( currentColumnIndex ) , offset + ( int ) ( long ) columnsDataOffset . get ( currentColumnIndex ) + length ) ; if ( columnsDataLength . get ( currentColumnIndex ) <= 2 ) { return bytesToShort ( temp ) ; } else { if ( columns . get ( currentColumnIndex ) . getFormat ( ) . getName ( ) . isEmpty ( ) ) { return convertByteArrayToNumber ( temp ) ; } else { if ( DATE_TIME_FORMAT_STRINGS . contains ( columns . get ( currentColumnIndex ) . getFormat ( ) . getName ( ) ) ) { return bytesToDateTime ( temp ) ; } else { if ( DATE_FORMAT_STRINGS . contains ( columns . get ( currentColumnIndex ) . getFormat ( ) . getName ( ) ) ) { return bytesToDate ( temp ) ; } else { return convertByteArrayToNumber ( temp ) ; } } } } } else { byte [ ] bytes = trimBytesArray ( source , offset + columnsDataOffset . get ( currentColumnIndex ) . intValue ( ) , length ) ; if ( byteOutput ) { return bytes ; } else { try { return ( bytes == null ? null : bytesToString ( bytes ) ) ; } catch ( UnsupportedEncodingException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } } } return null ;
|
public class AbstractSaml20ObjectBuilder { /** * Inflate authn request string .
* @ param decodedBytes the decoded bytes
* @ return the string */
protected String inflateAuthnRequest ( final byte [ ] decodedBytes ) { } }
|
val inflated = CompressionUtils . inflate ( decodedBytes ) ; if ( ! StringUtils . isEmpty ( inflated ) ) { return inflated ; } return CompressionUtils . decodeByteArrayToString ( decodedBytes ) ;
|
public class Report { /** * create */
public static Report create ( Map < String , Object > params ) throws EasyPostException { } }
|
return create ( params , null ) ;
|
public class J4pReadRequest { /** * { @ inheritDoc } */
@ Override List < String > getRequestParts ( ) { } }
|
if ( hasSingleAttribute ( ) ) { List < String > ret = super . getRequestParts ( ) ; ret . add ( getAttribute ( ) ) ; addPath ( ret , path ) ; return ret ; } else if ( hasAllAttributes ( ) && path == null ) { return super . getRequestParts ( ) ; } // A GET request cant be used for multiple attribute fetching or for fetching
// all attributes with a path
return null ;
|
public class ComponentNameSpaceConfiguration { /** * Returns a list of EJB ( Remote ) References ( & lt ; ejb - ref > ) configured
* for the component . */
public List < ? extends EJBRef > getEJBRefs ( ) { } }
|
if ( ivJNDIEnvironmentRefs != null && ivJNDIEnvironmentRefs . containsKey ( EJBRef . class ) ) { throw new IllegalStateException ( ) ; } return ivEJBRefs ;
|
public class StoreTxLogEngine { /** * 追加一条事务日志 */
public StoreTxLogPosition append ( Operation op , K key , V value ) throws DBException { } }
|
try { try { return this . append ( storeTxLog , op , key , value ) ; } catch ( CapacityNotEnoughException notEnough ) { // 要新建一个文件
return this . append ( nextNewStoreTxLog ( ) , op , key , value ) ; } } catch ( Exception e ) { throw new DBException ( "append dbLog error:" + e . getMessage ( ) , e ) ; }
|
public class SessionContext { /** * For remote InvalidateAll processing . . . calls remoteInvalidate method on the
* store */
public void remoteInvalidate ( String sessionId , boolean backendUpdate ) { } }
|
IStore iStore = _coreHttpSessionManager . getIStore ( ) ; ( ( MemoryStore ) iStore ) . remoteInvalidate ( sessionId , backendUpdate ) ;
|
public class X500Principal { /** * Returns a string representation of the X . 500 distinguished name
* using the specified format . Valid values for the format are
* " RFC1779 " and " RFC2253 " ( case insensitive ) . " CANONICAL " is not
* permitted and an { @ code IllegalArgumentException } will be thrown .
* < p > This method returns Strings in the format as specified in
* { @ link # getName ( String ) } and also emits additional attribute type
* keywords for OIDs that have entries in the { @ code oidMap }
* parameter . OID entries in the oidMap take precedence over the default
* OIDs recognized by { @ code getName ( String ) } .
* Improperly specified OIDs are ignored ; however if an OID
* in the name maps to an improperly specified keyword , an
* { @ code IllegalArgumentException } is thrown .
* < p > Additional standard formats may be introduced in the future .
* < p > Warning : additional attribute type keywords may not be recognized
* by other implementations ; therefore do not use this method if
* you are unsure if these keywords will be recognized by other
* implementations .
* @ param format the format to use
* @ param oidMap an OID map , where each key is an object identifier in
* String form ( a sequence of nonnegative integers separated by periods )
* that maps to a corresponding attribute type keyword String .
* The map may be empty but never { @ code null } .
* @ return a string representation of this { @ code X500Principal }
* using the specified format
* @ throws IllegalArgumentException if the specified format is invalid ,
* null , or an OID in the name maps to an improperly specified keyword
* @ throws NullPointerException if { @ code oidMap } is { @ code null }
* @ since 1.6 */
public String getName ( String format , Map < String , String > oidMap ) { } }
|
if ( oidMap == null ) { throw new NullPointerException ( sun . security . util . ResourcesMgr . getString ( "provided.null.OID.map" ) ) ; } if ( format != null ) { if ( format . equalsIgnoreCase ( RFC1779 ) ) { return thisX500Name . getRFC1779Name ( oidMap ) ; } else if ( format . equalsIgnoreCase ( RFC2253 ) ) { return thisX500Name . getRFC2253Name ( oidMap ) ; } } throw new IllegalArgumentException ( "invalid format specified" ) ;
|
public class OpenSSLFactory { /** * Creates the server socket . */
public ServerSocketBar create ( InetAddress addr , int port ) throws ConfigException , IOException { } }
|
synchronized ( _sslInitLock ) { if ( _stdServerSocket != null ) throw new IOException ( L . l ( "Can't create duplicate ssl factory." ) ) ; initConfig ( ) ; _stdServerSocket = ServerSocketJni . createJNI ( addr , port ) ; initSSL ( ) ; return this ; }
|
public class PdfStamperImp { /** * Sets the display duration for the page ( for presentations )
* @ param seconds the number of seconds to display the page . A negative value removes the entry
* @ param page the page where the duration will be applied . The first page is 1 */
void setDuration ( int seconds , int page ) { } }
|
PdfDictionary pg = reader . getPageN ( page ) ; if ( seconds < 0 ) pg . remove ( PdfName . DUR ) ; else pg . put ( PdfName . DUR , new PdfNumber ( seconds ) ) ; markUsed ( pg ) ;
|
public class ServiceLoaderHelper { /** * Uses the { @ link ServiceLoader } to load all SPI implementations of the
* passed class and return only the first instance .
* @ param < T >
* The implementation type to be loaded
* @ param aSPIClass
* The SPI interface class . May not be < code > null < / code > .
* @ param aLogger
* An optional logger to use . May be < code > null < / code > .
* @ return A collection of all currently available plugins . Never
* < code > null < / code > . */
@ Nullable public static < T > T getFirstSPIImplementation ( @ Nonnull final Class < T > aSPIClass , @ Nullable final Logger aLogger ) { } }
|
return getFirstSPIImplementation ( aSPIClass , ClassLoaderHelper . getDefaultClassLoader ( ) , aLogger ) ;
|
public class JDBC4Statement { /** * Executes the given SQL statement , which may return multiple results . */
@ Override public boolean execute ( String sql ) throws SQLException { } }
|
checkClosed ( ) ; VoltSQL query = VoltSQL . parseSQL ( sql ) ; return this . execute ( query ) ;
|
public class PreprocessorContext { /** * Find value among local and global variables for a name . It finds in the order : special processors , local variables , global variables
* @ param name the name for the needed variable , it will be normalized to the supported format
* @ param enforceUnknownVarAsNull if true then state of the unknownVariableAsFalse flag in context will be ignored
* @ return false if either the variable is not found or the name is null , otherwise the variable value */
@ Nullable public Value findVariableForName ( @ Nullable final String name , final boolean enforceUnknownVarAsNull ) { } }
|
if ( name == null ) { return null ; } final String normalized = assertNotNull ( PreprocessorUtils . normalizeVariableName ( name ) ) ; if ( normalized . isEmpty ( ) ) { return null ; } final SpecialVariableProcessor processor = mapVariableNameToSpecialVarProcessor . get ( normalized ) ; if ( processor != null ) { return processor . getVariable ( normalized , this ) ; } final Value val = getLocalVariable ( normalized ) ; if ( val != null ) { return val ; } Value result = globalVarTable . get ( normalized ) ; if ( result == null && ! enforceUnknownVarAsNull && this . unknownVariableAsFalse ) { logDebug ( "Unknown variable '" + name + "' is replaced by FALSE!" ) ; result = Value . BOOLEAN_FALSE ; } return result ;
|
public class BaseGraph { /** * Determine next free edgeId and ensure byte capacity to store edge
* @ return next free edgeId */
protected int nextEdgeId ( ) { } }
|
int nextEdge = edgeCount ; edgeCount ++ ; if ( edgeCount < 0 ) throw new IllegalStateException ( "too many edges. new edge id would be negative. " + toString ( ) ) ; edges . ensureCapacity ( ( ( long ) edgeCount + 1 ) * edgeEntryBytes ) ; return nextEdge ;
|
public class JerseyBinding { /** * Binds jersey specific component ( component implements jersey interface or extends class ) .
* Specific binding is required for types directly supported by jersey ( e . g . ExceptionMapper ) .
* Such types must be bound to target interface directly , otherwise jersey would not be able to resolve them .
* < p > If type is { @ link HK2Managed } , binds directly .
* Otherwise , use guice " bridge " factory to lazily bind type . < / p >
* @ param binder HK2 binder
* @ param injector guice injector
* @ param type type which implements specific jersey interface or extends class
* @ param specificType specific jersey type ( interface or abstract class )
* @ param hkManaged true if bean must be managed by HK2 , false to bind guice managed instance
* @ param singleton true to force singleton scope */
public static void bindSpecificComponent ( final AbstractBinder binder , final Injector injector , final Class < ? > type , final Class < ? > specificType , final boolean hkManaged , final boolean singleton ) { } }
|
// resolve generics of specific type
final GenericsContext context = GenericsResolver . resolve ( type ) . type ( specificType ) ; final List < Type > genericTypes = context . genericTypes ( ) ; final Type [ ] generics = genericTypes . toArray ( new Type [ 0 ] ) ; final Type bindingType = generics . length > 0 ? new ParameterizedTypeImpl ( specificType , generics ) : specificType ; if ( hkManaged ) { optionalSingleton ( binder . bind ( type ) . to ( type ) . to ( bindingType ) , singleton ) ; } else { optionalSingleton ( binder . bindFactory ( new GuiceComponentFactory < > ( injector , type ) ) . to ( type ) . to ( bindingType ) , singleton ) ; }
|
public class NamespacesInner { /** * Patches the existing namespace .
* @ param resourceGroupName The name of the resource group .
* @ param namespaceName The namespace name .
* @ param parameters Parameters supplied to patch a Namespace Resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the NamespaceResourceInner object */
public Observable < NamespaceResourceInner > patchAsync ( String resourceGroupName , String namespaceName , NamespacePatchParameters parameters ) { } }
|
return patchWithServiceResponseAsync ( resourceGroupName , namespaceName , parameters ) . map ( new Func1 < ServiceResponse < NamespaceResourceInner > , NamespaceResourceInner > ( ) { @ Override public NamespaceResourceInner call ( ServiceResponse < NamespaceResourceInner > response ) { return response . body ( ) ; } } ) ;
|
public class GapPenalties { /** * Create and return a new gap penalties with the specified penalties .
* @ param match match penalty
* @ param replace replace penalty
* @ param insert insert penalty
* @ param delete delete penalty
* @ param extend extend penalty
* @ return a new gap penalties with the specified penalties */
public static GapPenalties create ( final int match , final int replace , final int insert , final int delete , final int extend ) { } }
|
return new GapPenalties ( ( short ) match , ( short ) replace , ( short ) insert , ( short ) delete , ( short ) extend ) ;
|
public class SoapHeaderScanner { /** * Returns true if the index points to an XML preamble of the following example form :
* < pre >
* & lt ; ? xml version = " 1.0 " ? >
* < / pre >
* @ param index */
private boolean isPreamble ( int index ) { } }
|
if ( index <= buffer . length ( ) - 6 ) { if ( buffer . get ( index ) == '<' && buffer . get ( index + 1 ) == '?' && buffer . get ( index + 2 ) == 'x' && buffer . get ( index + 3 ) == 'm' && buffer . get ( index + 4 ) == 'l' && buffer . get ( index + 5 ) == ' ' ) { return true ; } } return false ;
|
public class Cashflow { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime .
* Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discounted to evaluation time .
* cash - flows prior evaluationTime are not considered .
* @ param evaluationTime The time on which this products value should be observed .
* @ param model The model used to price the product .
* @ return The random variable representing the value of the product discounted to evaluation time
* @ throws net . finmath . exception . CalculationException Thrown if the valuation fails , specific cause may be available via the < code > cause ( ) < / code > method . */
@ Override public RandomVariable getValue ( double evaluationTime , LIBORModelMonteCarloSimulationModel model ) throws CalculationException { } }
|
// Note : We use > here . To distinguish an end of day valuation use hour of day for cash flows and evaluation date .
if ( evaluationTime > flowDate ) { return model . getRandomVariableForConstant ( 0.0 ) ; } RandomVariable values = model . getRandomVariableForConstant ( flowAmount ) ; if ( isPayer ) { values = values . mult ( - 1.0 ) ; } // Rebase to evaluationTime
if ( flowDate != evaluationTime ) { // Get random variables
RandomVariable numeraire = model . getNumeraire ( flowDate ) ; RandomVariable numeraireAtEval = model . getNumeraire ( evaluationTime ) ; // RandomVariablemonteCarloProbabilities = model . getMonteCarloWeights ( getPaymentDate ( ) ) ;
values = values . div ( numeraire ) . mult ( numeraireAtEval ) ; } // Return values
return values ;
|
public class CookieUtils { /** * 默认按照应用上下文进行设置
* @ param request
* @ param response
* @ param name
* @ param value
* @ param age
* @ throws Exception */
public static void addCookie ( HttpServletRequest request , HttpServletResponse response , String name , String value , int age ) { } }
|
String contextPath = request . getContextPath ( ) ; if ( ! contextPath . endsWith ( "/" ) ) { contextPath += "/" ; } addCookie ( request , response , name , value , contextPath , age ) ;
|
public class ByteBuffer { /** * Writes the given long to the current position and increases the position by 8.
* The long is converted to bytes using the current byte order .
* @ param value the long to write .
* @ return this buffer .
* @ exception BufferOverflowException if position is greater than { @ code limit - 8 } .
* @ exception ReadOnlyBufferException if no changes may be made to the contents of this buffer . */
public ByteBuffer putLong ( long value ) { } }
|
int newPosition = position + 8 ; // if ( newPosition > limit ) {
// throw new BufferOverflowException ( ) ;
putLong ( position , value ) ; position = newPosition ; return this ;
|
public class Maybe { /** * Converts this Maybe into a Single instance composing disposal
* through and turning an empty Maybe into a Single that emits the given
* value through onSuccess .
* < dl >
* < dt > < b > Scheduler : < / b > < / dt >
* < dd > { @ code toSingle } does not operate by default on a particular { @ link Scheduler } . < / dd >
* < / dl >
* @ param defaultValue the default item to signal in Single if this Maybe is empty
* @ return the new Single instance */
@ CheckReturnValue @ SchedulerSupport ( SchedulerSupport . NONE ) public final Single < T > toSingle ( T defaultValue ) { } }
|
ObjectHelper . requireNonNull ( defaultValue , "defaultValue is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeToSingle < T > ( this , defaultValue ) ) ;
|
public class DelegatingLinkRelationProvider { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . server . LinkRelationProvider # getCollectionResourceRelFor ( java . lang . Class ) */
@ Override public LinkRelation getCollectionResourceRelFor ( java . lang . Class < ? > type ) { } }
|
LookupContext context = LookupContext . forCollectionResourceRelLookup ( type ) ; return providers . getRequiredPluginFor ( context ) . getCollectionResourceRelFor ( type ) ;
|
public class JSDefinedClass { /** * Adds a field to the list of field members of this defined class .
* @ param sName
* Name of this field
* @ return Newly generated field */
@ Nonnull public JSFieldVar field ( @ Nonnull @ Nonempty final String sName ) { } }
|
return field ( sName , null ) ;
|
public class UTemplater { /** * Returns a template based on a method . One - line methods starting with a { @ code return } statement
* are guessed to be expression templates , and all other methods are guessed to be block
* templates . */
public static Template < ? > createTemplate ( Context context , MethodTree decl ) { } }
|
MethodSymbol declSym = ASTHelpers . getSymbol ( decl ) ; ImmutableClassToInstanceMap < Annotation > annotations = UTemplater . annotationMap ( declSym ) ; ImmutableMap < String , VarSymbol > freeExpressionVars = freeExpressionVariables ( decl ) ; Context subContext = new SubContext ( context ) ; final UTemplater templater = new UTemplater ( freeExpressionVars , subContext ) ; ImmutableMap < String , UType > expressionVarTypes = ImmutableMap . copyOf ( Maps . transformValues ( freeExpressionVars , ( VarSymbol sym ) -> templater . template ( sym . type ) ) ) ; UType genericType = templater . template ( declSym . type ) ; List < UTypeVar > typeParameters ; UMethodType methodType ; if ( genericType instanceof UForAll ) { UForAll forAllType = ( UForAll ) genericType ; typeParameters = forAllType . getTypeVars ( ) ; methodType = ( UMethodType ) forAllType . getQuantifiedType ( ) ; } else if ( genericType instanceof UMethodType ) { typeParameters = ImmutableList . of ( ) ; methodType = ( UMethodType ) genericType ; } else { throw new IllegalArgumentException ( "Expected genericType to be either a ForAll or a UMethodType, but was " + genericType ) ; } List < ? extends StatementTree > bodyStatements = decl . getBody ( ) . getStatements ( ) ; if ( bodyStatements . size ( ) == 1 && Iterables . getOnlyElement ( bodyStatements ) . getKind ( ) == Kind . RETURN && context . get ( REQUIRE_BLOCK_KEY ) == null ) { ExpressionTree expression = ( ( ReturnTree ) Iterables . getOnlyElement ( bodyStatements ) ) . getExpression ( ) ; return ExpressionTemplate . create ( annotations , typeParameters , expressionVarTypes , templater . template ( expression ) , methodType . getReturnType ( ) ) ; } else { List < UStatement > templateStatements = new ArrayList < > ( ) ; for ( StatementTree statement : bodyStatements ) { templateStatements . add ( templater . template ( statement ) ) ; } return BlockTemplate . create ( annotations , typeParameters , expressionVarTypes , templateStatements ) ; }
|
public class PluginAssets { /** * Sort JS files in the intended load order , so templates don ' t need to care about it . */
List < String > sortedJsFiles ( ) { } }
|
return jsFiles ( ) . stream ( ) . sorted ( ( file1 , file2 ) -> { // Vendor JS scripts go first
if ( vendorJsFiles . contains ( file1 ) ) { return - 1 ; } if ( vendorJsFiles . contains ( file2 ) ) { return 1 ; } // Polyfill JS script goes second
if ( file1 . equals ( polyfillJsFile ) ) { return - 1 ; } if ( file2 . equals ( polyfillJsFile ) ) { return 1 ; } // Builtins JS script goes third
if ( file1 . equals ( builtinsJsFile ) ) { return - 1 ; } if ( file2 . equals ( builtinsJsFile ) ) { return 1 ; } // App JS script goes last , as plugins need to be loaded before
return file2 . compareTo ( file1 ) ; } ) . collect ( Collectors . toList ( ) ) ;
|
public class WordShapeClassifier { /** * That is , of size 6 , which become 8 , since HashMaps are powers of 2 . Still , it ' s half the size */
private static String wordShapeChris2Long ( String s , boolean omitIfInBoundary , int len , Collection < String > knownLCWords ) { } }
|
final char [ ] beginChars = new char [ BOUNDARY_SIZE ] ; final char [ ] endChars = new char [ BOUNDARY_SIZE ] ; int beginUpto = 0 ; int endUpto = 0 ; final Set < Character > seenSet = new TreeSet < Character > ( ) ; // TreeSet guarantees stable ordering ; has no size parameter
boolean nonLetters = false ; for ( int i = 0 ; i < len ; i ++ ) { int iIncr = 0 ; char c = s . charAt ( i ) ; char m = c ; if ( Character . isDigit ( c ) ) { m = 'd' ; } else if ( Character . isLowerCase ( c ) ) { m = 'x' ; } else if ( Character . isUpperCase ( c ) || Character . isTitleCase ( c ) ) { m = 'X' ; } for ( String gr : greek ) { if ( s . startsWith ( gr , i ) ) { m = 'g' ; // System . out . println ( s + " : : " + s . substring ( i + 1 ) ) ;
iIncr = gr . length ( ) - 1 ; break ; } } if ( m != 'x' && m != 'X' ) { nonLetters = true ; } if ( i < BOUNDARY_SIZE ) { beginChars [ beginUpto ++ ] = m ; } else if ( i < len - BOUNDARY_SIZE ) { seenSet . add ( Character . valueOf ( m ) ) ; } else { endChars [ endUpto ++ ] = m ; } i += iIncr ; // System . out . println ( " Position skips to " + i ) ;
} // Calculate size . This may be an upperbound , but is often correct
int sbSize = beginUpto + endUpto + seenSet . size ( ) ; if ( knownLCWords != null ) { sbSize ++ ; } final StringBuilder sb = new StringBuilder ( sbSize ) ; // put in the beginning chars
sb . append ( beginChars , 0 , beginUpto ) ; // put in the stored ones sorted
if ( omitIfInBoundary ) { for ( Character chr : seenSet ) { char ch = chr . charValue ( ) ; boolean insert = true ; for ( int i = 0 ; i < beginUpto ; i ++ ) { if ( beginChars [ i ] == ch ) { insert = false ; break ; } } for ( int i = 0 ; i < endUpto ; i ++ ) { if ( endChars [ i ] == ch ) { insert = false ; break ; } } if ( insert ) { sb . append ( ch ) ; } } } else { for ( Character chr : seenSet ) { sb . append ( chr . charValue ( ) ) ; } } // and add end ones
sb . append ( endChars , 0 , endUpto ) ; if ( knownLCWords != null ) { if ( ! nonLetters && knownLCWords . contains ( s . toLowerCase ( ) ) ) { sb . append ( 'k' ) ; } } // System . out . println ( s + " became " + sb ) ;
return sb . toString ( ) ;
|
public class SVNCommands { /** * Performs a " svn status " and returns any conflicting change that is found in the svn tree at the given directory
* in the format that the svn command provides them ( including the leading ' C ' ) .
* @ param directory The local working directory
* @ return A stream which returns the textual list of conflicts as reported by " svn status "
* @ throws IOException Execution of the SVN sub - process failed or the
* sub - process returned a exit value indicating a failure */
public static String getConflicts ( File directory ) throws IOException { } }
|
try ( InputStream stream = getPendingCheckins ( directory ) ) { StringBuilder result = new StringBuilder ( ) ; List < String > lines = IOUtils . readLines ( stream , "UTF-8" ) ; for ( String line : lines ) { // first char " C " is a normal conflict , C at second position is a property - conflict
if ( line . length ( ) >= 2 && ( line . charAt ( 0 ) == 'C' || line . charAt ( 1 ) == 'C' ) ) { result . append ( line ) . append ( "\n" ) ; } } return result . toString ( ) ; }
|
public class RawCodec { /** * / * ( non - Javadoc )
* @ see StreamingEncoder # encodeToStream ( Encoder , java . lang . CharSequence , int , int , EncodedAppender , EncodingState ) */
public void encodeToStream ( Encoder thisInstance , CharSequence source , int offset , int len , EncodedAppender appender , EncodingState encodingState ) throws IOException { } }
|
appender . appendEncoded ( thisInstance , encodingState , source , offset , len ) ;
|
public class GrammarFactory { /** * No user defined schema information is generated for processing the EXI
* body ; however , the built - in XML schema types are available for use in the
* EXI body .
* @ return built - in XSD EXI grammars
* @ throws EXIException
* EXI exception */
public Grammars createXSDTypesOnlyGrammars ( ) throws EXIException { } }
|
grammarBuilder . loadXSDTypesOnlyGrammars ( ) ; SchemaInformedGrammars g = grammarBuilder . toGrammars ( ) ; g . setBuiltInXMLSchemaTypesOnly ( true ) ; // builtInXMLSchemaTypesOnly
return g ;
|
public class Channel { /** * Serialize channel to a file using Java serialization .
* Deserialized channel will NOT be in an initialized state .
* @ param file file
* @ throws IOException
* @ throws InvalidArgumentException */
public void serializeChannel ( File file ) throws IOException , InvalidArgumentException { } }
|
if ( null == file ) { throw new InvalidArgumentException ( "File parameter may not be null" ) ; } Files . write ( Paths . get ( file . getAbsolutePath ( ) ) , serializeChannel ( ) , StandardOpenOption . CREATE , StandardOpenOption . TRUNCATE_EXISTING , StandardOpenOption . WRITE ) ;
|
public class ResourcesInner { /** * Deletes a resource .
* @ param resourceGroupName The name of the resource group that contains the resource to delete . The name is case insensitive .
* @ param resourceProviderNamespace The namespace of the resource provider .
* @ param parentResourcePath The parent resource identity .
* @ param resourceType The resource type .
* @ param resourceName The name of the resource to delete .
* @ param apiVersion The API version to use for the operation .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > beginDeleteAsync ( String resourceGroupName , String resourceProviderNamespace , String parentResourcePath , String resourceType , String resourceName , String apiVersion , final ServiceCallback < Void > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( beginDeleteWithServiceResponseAsync ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , apiVersion ) , serviceCallback ) ;
|
public class JaxbExtensions { /** * Marshall an object to a xml { @ code String } .
* @ param self a Marshaller which can marshall the type of the given object
* @ param jaxbElement object to marshall to a { @ code String }
* @ return { @ code String } representing the object as xml */
public static < T > String marshal ( Marshaller self , T jaxbElement ) throws JAXBException { } }
|
StringWriter sw = new StringWriter ( ) ; self . marshal ( jaxbElement , sw ) ; return sw . toString ( ) ;
|
public class ConfiguratorFactory { /** * Returns a protocol stack configurator based on the XML configuration provided by the specified XML element .
* @ param element a XML element containing a JGroups XML configuration .
* @ return a { @ code ProtocolStackConfigurator } containing the stack configuration .
* @ throws Exception if problems occur during the configuration of the protocol stack . */
public static ProtocolStackConfigurator getStackConfigurator ( Element element ) throws Exception { } }
|
checkForNullConfiguration ( element ) ; return XmlConfigurator . getInstance ( element ) ;
|
public class Java { /** * Write a comment indent only .
* @ param fp
* @ param text
* @ param indent
* @ return */
private static String emitCommentIndentNOnly ( PrintWriter fp , String text , int indent ) { } }
|
synchronized ( lock ) { return ( emitCommentIndentNOnly ( fp , text , indent , true ) ) ; }
|
public class ServerImpl { /** * Sets the self - muted state of the user with the given id .
* @ param userId The id of the user .
* @ param muted Whether the user with the given id is self - muted or not . */
public void setSelfMuted ( long userId , boolean muted ) { } }
|
if ( muted ) { selfMuted . add ( userId ) ; } else { selfMuted . remove ( userId ) ; }
|
public class MessageFieldDesc { /** * Get the property names and classes that are part of the standard message payload .
* @ param mapPropertyNames
* @ return */
public Map < String , Class < ? > > getPayloadPropertyNames ( Map < String , Class < ? > > mapPropertyNames ) { } }
|
mapPropertyNames = super . getPayloadPropertyNames ( mapPropertyNames ) ; if ( ( this . getKeyInformation ( ) & STANDARD_PARAM ) != 0 ) { // Add this name and class to the map of property names
if ( mapPropertyNames == null ) mapPropertyNames = new HashMap < String , Class < ? > > ( ) ; mapPropertyNames . put ( this . getFullKey ( null ) , this . getRawClassType ( ) ) ; } return mapPropertyNames ;
|
public class GeoDistanceConditionBuilder { /** * Returns the { @ link GeoDistanceCondition } represented by this builder .
* @ return a new geo distance condition */
@ Override public GeoDistanceCondition build ( ) { } }
|
GeoDistance min = minDistance == null ? null : GeoDistance . parse ( minDistance ) ; GeoDistance max = maxDistance == null ? null : GeoDistance . parse ( maxDistance ) ; return new GeoDistanceCondition ( boost , field , latitude , longitude , min , max ) ;
|
public class InternalMailUtil { /** * 将一个地址字符串解析为多个地址 < br >
* 地址间使用 " " 、 " , " 、 " ; " 分隔
* @ param address 地址字符串
* @ param charset 编码
* @ return 地址列表 */
public static InternetAddress [ ] parseAddress ( String address , Charset charset ) { } }
|
InternetAddress [ ] addresses ; try { addresses = InternetAddress . parse ( address ) ; } catch ( AddressException e ) { throw new MailException ( e ) ; } // 编码用户名
if ( ArrayUtil . isNotEmpty ( addresses ) ) { for ( InternetAddress internetAddress : addresses ) { try { internetAddress . setPersonal ( internetAddress . getPersonal ( ) , charset . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new MailException ( e ) ; } } } return addresses ;
|
public class Matrix4d { /** * Set this matrix to be an orthographic projection transformation for a right - handed coordinate system .
* This method is equivalent to calling { @ link # setOrtho ( double , double , double , double , double , double ) setOrtho ( ) } with
* < code > zNear = - 1 < / code > and < code > zFar = + 1 < / code > .
* In order to apply the orthographic projection to an already existing transformation ,
* use { @ link # ortho2D ( double , double , double , double ) ortho2D ( ) } .
* Reference : < a href = " http : / / www . songho . ca / opengl / gl _ projectionmatrix . html # ortho " > http : / / www . songho . ca < / a >
* @ see # setOrtho ( double , double , double , double , double , double )
* @ see # ortho2D ( double , double , double , double )
* @ param left
* the distance from the center to the left frustum edge
* @ param right
* the distance from the center to the right frustum edge
* @ param bottom
* the distance from the center to the bottom frustum edge
* @ param top
* the distance from the center to the top frustum edge
* @ return this */
public Matrix4d setOrtho2D ( double left , double right , double bottom , double top ) { } }
|
if ( ( properties & PROPERTY_IDENTITY ) == 0 ) _identity ( ) ; m00 = 2.0 / ( right - left ) ; m11 = 2.0 / ( top - bottom ) ; m22 = - 1.0 ; m30 = ( right + left ) / ( left - right ) ; m31 = ( top + bottom ) / ( bottom - top ) ; properties = PROPERTY_AFFINE ; return this ;
|
public class Serialiser { /** * Deserialises the given { @ link InputStream } to a JSON String .
* @ param input The stream to deserialise .
* @ param requestMessageType The message type to deserialise into .
* @ param < O > The type to deserialise to .
* @ return A new instance of the given type .
* @ throws IOException If an error occurs in reading from the input stream . */
public static < O > O deserialise ( InputStream input , Class < O > requestMessageType ) throws IOException { } }
|
Gson gson = getBuilder ( ) . create ( ) ; try ( InputStreamReader streamReader = new InputStreamReader ( input , StandardCharsets . UTF_8 ) ) { return gson . fromJson ( streamReader , requestMessageType ) ; }
|
public class SampleOfLongs { /** * 0 < rank < 1 */
public double rankLatency ( float rank ) { } }
|
if ( sample . length == 0 ) return 0 ; int index = ( int ) ( rank * sample . length ) ; if ( index >= sample . length ) index = sample . length - 1 ; return sample [ index ] * 0.000001d ;
|
public class TwoDScrollView { /** * Finds the next focusable component that fits in the specified bounds .
* @ param topFocus look for a candidate is the one at the top of the bounds
* if topFocus is true , or at the bottom of the bounds if topFocus is
* false
* @ param top the top offset of the bounds in which a focusable must be
* found
* @ param bottom the bottom offset of the bounds in which a focusable must
* be found
* @ return the next focusable component in the bounds or null if none can
* be found */
private View findFocusableViewInBounds ( boolean topFocus , int top , int bottom , boolean leftFocus , int left , int right ) { } }
|
List < View > focusables = getFocusables ( View . FOCUS_FORWARD ) ; View focusCandidate = null ; /* * A fully contained focusable is one where its top is below the bound ' s
* top , and its bottom is above the bound ' s bottom . A partially
* contained focusable is one where some part of it is within the
* bounds , but it also has some part that is not within bounds . A fully contained
* focusable is preferred to a partially contained focusable . */
boolean foundFullyContainedFocusable = false ; int count = focusables . size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { View view = focusables . get ( i ) ; int viewTop = view . getTop ( ) ; int viewBottom = view . getBottom ( ) ; int viewLeft = view . getLeft ( ) ; int viewRight = view . getRight ( ) ; if ( top < viewBottom && viewTop < bottom && left < viewRight && viewLeft < right ) { /* * the focusable is in the target area , it is a candidate for
* focusing */
final boolean viewIsFullyContained = ( top < viewTop ) && ( viewBottom < bottom ) && ( left < viewLeft ) && ( viewRight < right ) ; if ( focusCandidate == null ) { /* No candidate , take this one */
focusCandidate = view ; foundFullyContainedFocusable = viewIsFullyContained ; } else { final boolean viewIsCloserToVerticalBoundary = ( topFocus && viewTop < focusCandidate . getTop ( ) ) || ( ! topFocus && viewBottom > focusCandidate . getBottom ( ) ) ; final boolean viewIsCloserToHorizontalBoundary = ( leftFocus && viewLeft < focusCandidate . getLeft ( ) ) || ( ! leftFocus && viewRight > focusCandidate . getRight ( ) ) ; if ( foundFullyContainedFocusable ) { if ( viewIsFullyContained && viewIsCloserToVerticalBoundary && viewIsCloserToHorizontalBoundary ) { /* * We ' re dealing with only fully contained views , so
* it has to be closer to the boundary to beat our
* candidate */
focusCandidate = view ; } } else { if ( viewIsFullyContained ) { /* Any fully contained view beats a partially contained view */
focusCandidate = view ; foundFullyContainedFocusable = true ; } else if ( viewIsCloserToVerticalBoundary && viewIsCloserToHorizontalBoundary ) { /* * Partially contained view beats another partially
* contained view if it ' s closer */
focusCandidate = view ; } } } } } return focusCandidate ;
|
public class BoardPanel { /** * Removes all the drawn elements */
public void clear ( ) { } }
|
assertEDT ( ) ; log . debug ( "[clear] Cleaning board" ) ; for ( int row = 0 ; row < SIZE ; row ++ ) { for ( int col = 0 ; col < SIZE ; col ++ ) { removeItem ( new Point ( col , row ) ) ; } }
|
public class XtextPackageImpl { /** * Creates the meta - model objects for the package . This method is
* guarded to have no affect on any invocation but its first .
* < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void createPackageContents ( ) { } }
|
if ( isCreated ) return ; isCreated = true ; // Create classes and their features
grammarEClass = createEClass ( GRAMMAR ) ; createEAttribute ( grammarEClass , GRAMMAR__NAME ) ; createEReference ( grammarEClass , GRAMMAR__USED_GRAMMARS ) ; createEAttribute ( grammarEClass , GRAMMAR__DEFINES_HIDDEN_TOKENS ) ; createEReference ( grammarEClass , GRAMMAR__HIDDEN_TOKENS ) ; createEReference ( grammarEClass , GRAMMAR__METAMODEL_DECLARATIONS ) ; createEReference ( grammarEClass , GRAMMAR__RULES ) ; abstractRuleEClass = createEClass ( ABSTRACT_RULE ) ; createEAttribute ( abstractRuleEClass , ABSTRACT_RULE__NAME ) ; createEReference ( abstractRuleEClass , ABSTRACT_RULE__TYPE ) ; createEReference ( abstractRuleEClass , ABSTRACT_RULE__ALTERNATIVES ) ; createEReference ( abstractRuleEClass , ABSTRACT_RULE__ANNOTATIONS ) ; abstractMetamodelDeclarationEClass = createEClass ( ABSTRACT_METAMODEL_DECLARATION ) ; createEReference ( abstractMetamodelDeclarationEClass , ABSTRACT_METAMODEL_DECLARATION__EPACKAGE ) ; createEAttribute ( abstractMetamodelDeclarationEClass , ABSTRACT_METAMODEL_DECLARATION__ALIAS ) ; generatedMetamodelEClass = createEClass ( GENERATED_METAMODEL ) ; createEAttribute ( generatedMetamodelEClass , GENERATED_METAMODEL__NAME ) ; referencedMetamodelEClass = createEClass ( REFERENCED_METAMODEL ) ; parserRuleEClass = createEClass ( PARSER_RULE ) ; createEAttribute ( parserRuleEClass , PARSER_RULE__DEFINES_HIDDEN_TOKENS ) ; createEReference ( parserRuleEClass , PARSER_RULE__HIDDEN_TOKENS ) ; createEReference ( parserRuleEClass , PARSER_RULE__PARAMETERS ) ; createEAttribute ( parserRuleEClass , PARSER_RULE__FRAGMENT ) ; createEAttribute ( parserRuleEClass , PARSER_RULE__WILDCARD ) ; typeRefEClass = createEClass ( TYPE_REF ) ; createEReference ( typeRefEClass , TYPE_REF__METAMODEL ) ; createEReference ( typeRefEClass , TYPE_REF__CLASSIFIER ) ; abstractElementEClass = createEClass ( ABSTRACT_ELEMENT ) ; createEAttribute ( abstractElementEClass , ABSTRACT_ELEMENT__CARDINALITY ) ; createEAttribute ( abstractElementEClass , ABSTRACT_ELEMENT__PREDICATED ) ; createEAttribute ( abstractElementEClass , ABSTRACT_ELEMENT__FIRST_SET_PREDICATED ) ; actionEClass = createEClass ( ACTION ) ; createEReference ( actionEClass , ACTION__TYPE ) ; createEAttribute ( actionEClass , ACTION__FEATURE ) ; createEAttribute ( actionEClass , ACTION__OPERATOR ) ; keywordEClass = createEClass ( KEYWORD ) ; createEAttribute ( keywordEClass , KEYWORD__VALUE ) ; ruleCallEClass = createEClass ( RULE_CALL ) ; createEReference ( ruleCallEClass , RULE_CALL__RULE ) ; createEReference ( ruleCallEClass , RULE_CALL__ARGUMENTS ) ; createEAttribute ( ruleCallEClass , RULE_CALL__EXPLICITLY_CALLED ) ; assignmentEClass = createEClass ( ASSIGNMENT ) ; createEAttribute ( assignmentEClass , ASSIGNMENT__FEATURE ) ; createEAttribute ( assignmentEClass , ASSIGNMENT__OPERATOR ) ; createEReference ( assignmentEClass , ASSIGNMENT__TERMINAL ) ; crossReferenceEClass = createEClass ( CROSS_REFERENCE ) ; createEReference ( crossReferenceEClass , CROSS_REFERENCE__TYPE ) ; createEReference ( crossReferenceEClass , CROSS_REFERENCE__TERMINAL ) ; terminalRuleEClass = createEClass ( TERMINAL_RULE ) ; createEAttribute ( terminalRuleEClass , TERMINAL_RULE__FRAGMENT ) ; abstractNegatedTokenEClass = createEClass ( ABSTRACT_NEGATED_TOKEN ) ; createEReference ( abstractNegatedTokenEClass , ABSTRACT_NEGATED_TOKEN__TERMINAL ) ; negatedTokenEClass = createEClass ( NEGATED_TOKEN ) ; untilTokenEClass = createEClass ( UNTIL_TOKEN ) ; wildcardEClass = createEClass ( WILDCARD ) ; enumRuleEClass = createEClass ( ENUM_RULE ) ; enumLiteralDeclarationEClass = createEClass ( ENUM_LITERAL_DECLARATION ) ; createEReference ( enumLiteralDeclarationEClass , ENUM_LITERAL_DECLARATION__ENUM_LITERAL ) ; createEReference ( enumLiteralDeclarationEClass , ENUM_LITERAL_DECLARATION__LITERAL ) ; alternativesEClass = createEClass ( ALTERNATIVES ) ; unorderedGroupEClass = createEClass ( UNORDERED_GROUP ) ; groupEClass = createEClass ( GROUP ) ; createEReference ( groupEClass , GROUP__GUARD_CONDITION ) ; characterRangeEClass = createEClass ( CHARACTER_RANGE ) ; createEReference ( characterRangeEClass , CHARACTER_RANGE__LEFT ) ; createEReference ( characterRangeEClass , CHARACTER_RANGE__RIGHT ) ; compoundElementEClass = createEClass ( COMPOUND_ELEMENT ) ; createEReference ( compoundElementEClass , COMPOUND_ELEMENT__ELEMENTS ) ; eofEClass = createEClass ( EOF ) ; parameterEClass = createEClass ( PARAMETER ) ; createEAttribute ( parameterEClass , PARAMETER__NAME ) ; namedArgumentEClass = createEClass ( NAMED_ARGUMENT ) ; createEReference ( namedArgumentEClass , NAMED_ARGUMENT__PARAMETER ) ; createEReference ( namedArgumentEClass , NAMED_ARGUMENT__VALUE ) ; createEAttribute ( namedArgumentEClass , NAMED_ARGUMENT__CALLED_BY_NAME ) ; conditionEClass = createEClass ( CONDITION ) ; conjunctionEClass = createEClass ( CONJUNCTION ) ; negationEClass = createEClass ( NEGATION ) ; createEReference ( negationEClass , NEGATION__VALUE ) ; disjunctionEClass = createEClass ( DISJUNCTION ) ; compositeConditionEClass = createEClass ( COMPOSITE_CONDITION ) ; createEReference ( compositeConditionEClass , COMPOSITE_CONDITION__LEFT ) ; createEReference ( compositeConditionEClass , COMPOSITE_CONDITION__RIGHT ) ; parameterReferenceEClass = createEClass ( PARAMETER_REFERENCE ) ; createEReference ( parameterReferenceEClass , PARAMETER_REFERENCE__PARAMETER ) ; literalConditionEClass = createEClass ( LITERAL_CONDITION ) ; createEAttribute ( literalConditionEClass , LITERAL_CONDITION__TRUE ) ; annotationEClass = createEClass ( ANNOTATION ) ; createEAttribute ( annotationEClass , ANNOTATION__NAME ) ;
|
public class EnsemblRestClientFactory { /** * Create and return a new lookup service with the specified endpoint URL .
* @ since 2.0
* @ param endpointUrl endpoint URL , must not be null
* @ return a new overlap service with the specified endpoint URL */
public OverlapService createOverlapService ( final String endpointUrl ) { } }
|
return new RestAdapter . Builder ( ) . setEndpoint ( endpointUrl ) . setErrorHandler ( errorHandler ) . setConverter ( new JacksonOverlapConverter ( jsonFactory ) ) . build ( ) . create ( OverlapService . class ) ;
|
public class IExplorerConfigReader { /** * If you ' re using Selenium Grid , make sure the selenium server is in the same folder with the IEDriverServer
* or include the path to the ChromeDriver in command line when registering the node :
* - Dwebdriver . chrome . driver = % { path to chrome driver }
* @ return Internet Explorer capabilities */
private InternetExplorerOptions getOptions ( ) { } }
|
InternetExplorerOptions options = new InternetExplorerOptions ( ) ; setOptions ( options ) ; String driverPath = getProperty ( "browser.driver.path" ) ; if ( ! "" . equals ( driverPath ) ) { System . setProperty ( "webdriver.ie.driver" , driverPath ) ; } return options ;
|
public class DiagnosticsInner { /** * List Site Detector Responses .
* List Site Detector Responses .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param siteName Site Name
* @ param slot Slot Name
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; DetectorResponseInner & gt ; object */
public Observable < Page < DetectorResponseInner > > listSiteDetectorResponsesSlotAsync ( final String resourceGroupName , final String siteName , final String slot ) { } }
|
return listSiteDetectorResponsesSlotWithServiceResponseAsync ( resourceGroupName , siteName , slot ) . map ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Page < DetectorResponseInner > > ( ) { @ Override public Page < DetectorResponseInner > call ( ServiceResponse < Page < DetectorResponseInner > > response ) { return response . body ( ) ; } } ) ;
|
public class MessageEventProvider { /** * Parses a MessageEvent stanza ( extension sub - packet ) .
* @ param parser the XML parser , positioned at the starting element of the extension .
* @ return a PacketExtension .
* @ throws IOException
* @ throws XmlPullParserException */
@ Override public MessageEvent parse ( XmlPullParser parser , int initialDepth , XmlEnvironment xmlEnvironment ) throws XmlPullParserException , IOException { } }
|
MessageEvent messageEvent = new MessageEvent ( ) ; boolean done = false ; while ( ! done ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { if ( parser . getName ( ) . equals ( "id" ) ) messageEvent . setStanzaId ( parser . nextText ( ) ) ; if ( parser . getName ( ) . equals ( MessageEvent . COMPOSING ) ) messageEvent . setComposing ( true ) ; if ( parser . getName ( ) . equals ( MessageEvent . DELIVERED ) ) messageEvent . setDelivered ( true ) ; if ( parser . getName ( ) . equals ( MessageEvent . DISPLAYED ) ) messageEvent . setDisplayed ( true ) ; if ( parser . getName ( ) . equals ( MessageEvent . OFFLINE ) ) messageEvent . setOffline ( true ) ; } else if ( eventType == XmlPullParser . END_TAG ) { if ( parser . getName ( ) . equals ( "x" ) ) { done = true ; } } } return messageEvent ;
|
public class DailyCalendar { /** * Sets the time range for the < CODE > DailyCalendar < / CODE > to the times
* represented in the specified values .
* @ param rangeStartingHourOfDay
* the hour of the start of the time range
* @ param rangeStartingMinute
* the minute of the start of the time range
* @ param rangeStartingSecond
* the second of the start of the time range
* @ param rangeStartingMillis
* the millisecond of the start of the time range
* @ param rangeEndingHourOfDay
* the hour of the end of the time range
* @ param rangeEndingMinute
* the minute of the end of the time range
* @ param rangeEndingSecond
* the second of the end of the time range
* @ param rangeEndingMillis
* the millisecond of the start of the time range */
public final void setTimeRange ( final int rangeStartingHourOfDay , final int rangeStartingMinute , final int rangeStartingSecond , final int rangeStartingMillis , final int rangeEndingHourOfDay , final int rangeEndingMinute , final int rangeEndingSecond , final int rangeEndingMillis ) { } }
|
_validate ( rangeStartingHourOfDay , rangeStartingMinute , rangeStartingSecond , rangeStartingMillis ) ; _validate ( rangeEndingHourOfDay , rangeEndingMinute , rangeEndingSecond , rangeEndingMillis ) ; final Calendar startCal = createJavaCalendar ( ) ; startCal . set ( Calendar . HOUR_OF_DAY , rangeStartingHourOfDay ) ; startCal . set ( Calendar . MINUTE , rangeStartingMinute ) ; startCal . set ( Calendar . SECOND , rangeStartingSecond ) ; startCal . set ( Calendar . MILLISECOND , rangeStartingMillis ) ; final Calendar endCal = createJavaCalendar ( ) ; endCal . set ( Calendar . HOUR_OF_DAY , rangeEndingHourOfDay ) ; endCal . set ( Calendar . MINUTE , rangeEndingMinute ) ; endCal . set ( Calendar . SECOND , rangeEndingSecond ) ; endCal . set ( Calendar . MILLISECOND , rangeEndingMillis ) ; if ( ! startCal . before ( endCal ) ) { throw new IllegalArgumentException ( invalidTimeRange + rangeStartingHourOfDay + ":" + rangeStartingMinute + ":" + rangeStartingSecond + ":" + rangeStartingMillis + separator + rangeEndingHourOfDay + ":" + rangeEndingMinute + ":" + rangeEndingSecond + ":" + rangeEndingMillis ) ; } m_nRangeStartingHourOfDay = rangeStartingHourOfDay ; m_nRangeStartingMinute = rangeStartingMinute ; m_nRangeStartingSecond = rangeStartingSecond ; m_nRangeStartingMillis = rangeStartingMillis ; m_nRangeEndingHourOfDay = rangeEndingHourOfDay ; m_nRangeEndingMinute = rangeEndingMinute ; m_nRangeEndingSecond = rangeEndingSecond ; m_nRangeEndingMillis = rangeEndingMillis ;
|
public class NodeSupport { /** * Gets the { @ link INodeDesc } value describing the framework node
* @ return the singleton { @ link INodeDesc } object for this framework instance */
@ Override public INodeDesc getNodeDesc ( ) { } }
|
if ( null == nodedesc ) { nodedesc = NodeEntryImpl . create ( getFrameworkNodeHostname ( ) , getFrameworkNodeName ( ) ) ; } return nodedesc ;
|
public class DebugUtil { /** * Invokes a given method of every object in a { @ code java . util . Map } to { @ code System . out } .
* The method called must have no formal parameters .
* If an exception is throwed during the method invocation , the element ' s { @ code toString ( ) } method is called . < br >
* For bulk data types , recursive invocations and invocations of other methods in this class , are used .
* @ param pMap the { @ code java . util . Map } to be printed .
* @ param pMethodName a { @ code java . lang . String } holding the name of the method to be invoked on each mapped object .
* @ see < a href = " http : / / java . sun . com / products / jdk / 1.3 / docs / api / java / util / Map . html " > { @ code java . util . Map } < / a > */
public static void printDebug ( final Map pMap , final String pMethodName ) { } }
|
printDebug ( pMap , pMethodName , System . out ) ;
|
public class MSExcelParser { /** * Adds a linked workbook that is referred from this workbook . If the filename is already in the list then it is not processed twice . Note that the inputStream is closed after parsing
* @ param name fileName ( without path ) of the workbook
* @ param inputStream content of the linked workbook
* @ param password if document is encrypted , null if not encrypted
* @ return true if it has been added , false if it has been already added
* @ throws org . zuinnote . hadoop . office . format . common . parser . FormatNotUnderstoodException in case there are issues reading from the Excel file */
@ Override public boolean addLinkedWorkbook ( String name , InputStream inputStream , String password ) throws FormatNotUnderstoodException { } }
|
// check if already added
if ( this . addedFormulaEvaluators . containsKey ( name ) ) { return false ; } LOG . debug ( "Start adding \"" + name + "\" to current workbook" ) ; // create new parser , select all sheets , no linkedworkbookpasswords , no metadatafilter
HadoopOfficeReadConfiguration linkedWBHOCR = new HadoopOfficeReadConfiguration ( ) ; linkedWBHOCR . setLocale ( this . hocr . getLocale ( ) ) ; linkedWBHOCR . setSheets ( null ) ; linkedWBHOCR . setIgnoreMissingLinkedWorkbooks ( this . hocr . getIgnoreMissingLinkedWorkbooks ( ) ) ; linkedWBHOCR . setFileName ( name ) ; linkedWBHOCR . setPassword ( password ) ; linkedWBHOCR . setMetaDataFilter ( null ) ; MSExcelParser linkedWBMSExcelParser = new MSExcelParser ( linkedWBHOCR , null ) ; // parse workbook
linkedWBMSExcelParser . parse ( inputStream ) ; // add linked workbook
this . addedWorkbooks . add ( linkedWBMSExcelParser . getCurrentWorkbook ( ) ) ; this . addedFormulaEvaluators . put ( name , linkedWBMSExcelParser . getCurrentFormulaEvaluator ( ) ) ; this . formulaEvaluator . setupReferencedWorkbooks ( addedFormulaEvaluators ) ; return true ;
|
public class LambdaFunctionTimedOutEventDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( LambdaFunctionTimedOutEventDetails lambdaFunctionTimedOutEventDetails , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( lambdaFunctionTimedOutEventDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaFunctionTimedOutEventDetails . getError ( ) , ERROR_BINDING ) ; protocolMarshaller . marshall ( lambdaFunctionTimedOutEventDetails . getCause ( ) , CAUSE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class ActorRef { /** * Sending message before all other messages
* @ param message message
* @ param sender sender */
public void sendFirst ( Object message , ActorRef sender ) { } }
|
endpoint . getMailbox ( ) . scheduleFirst ( new Envelope ( message , endpoint . getScope ( ) , endpoint . getMailbox ( ) , sender ) ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.