signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CommerceShippingFixedOptionUtil { /** * Returns a range of all the commerce shipping fixed options where commerceShippingMethodId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceShippingFixedOptionModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param commerceShippingMethodId the commerce shipping method ID * @ param start the lower bound of the range of commerce shipping fixed options * @ param end the upper bound of the range of commerce shipping fixed options ( not inclusive ) * @ return the range of matching commerce shipping fixed options */ public static List < CommerceShippingFixedOption > findByCommerceShippingMethodId ( long commerceShippingMethodId , int start , int end ) { } }
return getPersistence ( ) . findByCommerceShippingMethodId ( commerceShippingMethodId , start , end ) ;
public class RestClient { /** * Print the base 64 string differently depending on JDK level because * on JDK 7/8 we have JAX - B , and on JDK 8 + we have java . util . Base64 */ private static String encode ( byte [ ] bytes ) { } }
try { if ( System . getProperty ( "java.version" ) . startsWith ( "1." ) ) { // return DatatypeConverter . printBase64Binary ( str ) ; Class < ? > DatatypeConverter = Class . forName ( "javax.xml.bind.DatatypeConverter" ) ; return ( String ) DatatypeConverter . getMethod ( "printBase64Binary" , byte [ ] . class ) . invoke ( null , bytes ) ; } else { // return Base64 . getEncoder ( ) . encode ( ) ; Class < ? > Base64 = Class . forName ( "java.util.Base64" ) ; Object encodeObject = Base64 . getMethod ( "getEncoder" ) . invoke ( null ) ; return ( String ) encodeObject . getClass ( ) . getMethod ( "encodeToString" , byte [ ] . class ) . invoke ( encodeObject , bytes ) ; } } catch ( Exception e ) { return null ; }
public class IndexedRepositoryDecorator { /** * Checks if the underlying repository can handle this query . Queries with unsupported operators , * queries that use attributes with computed values or queries with nested query rule field are * delegated to the index . */ private boolean querySupported ( Query < Entity > q ) { } }
return ! containsAnyOperator ( q , unsupportedOperators ) && ! containsComputedAttribute ( q , getEntityType ( ) ) && ! containsNestedQueryRuleField ( q ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "conjugate" ) public JAXBElement < ArithType > createConjugate ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Conjugate_QNAME , ArithType . class , null , value ) ;
public class DataModel { /** * < p > Remove an existing { @ link DataModelListener } from the set * interested in notifications from this { @ link DataModel } . < / p > * @ param listener The old { @ link DataModelListener } to be deregistered * @ throws NullPointerException if < code > listener < / code > * is < code > null < / code > */ public void removeDataModelListener ( DataModelListener listener ) { } }
if ( listener == null ) { throw new NullPointerException ( ) ; } if ( listeners != null ) { listeners . remove ( listener ) ; if ( listeners . isEmpty ( ) ) { listeners = null ; } }
public class LocalLog { /** * Read in our levels from our configuration file . */ static List < PatternLevel > readLevelResourceFile ( InputStream stream ) { } }
List < PatternLevel > levels = null ; if ( stream != null ) { try { levels = configureClassLevels ( stream ) ; } catch ( IOException e ) { System . err . println ( "IO exception reading the log properties file '" + LOCAL_LOG_PROPERTIES_FILE + "': " + e ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { // ignore close exception } } } return levels ;
public class URI { /** * Set the scheme for this URI . The scheme is converted to lowercase * before it is set . * @ param p _ scheme the scheme for this URI ( cannot be null ) * @ throws MalformedURIException if p _ scheme is not a conformant * scheme name */ public void setScheme ( String p_scheme ) throws MalformedURIException { } }
if ( p_scheme == null ) { throw new MalformedURIException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_SCHEME_FROM_NULL_STRING , null ) ) ; // " Cannot set scheme from null string ! " ) ; } if ( ! isConformantSchemeName ( p_scheme ) ) { throw new MalformedURIException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_SCHEME_NOT_CONFORMANT , null ) ) ; // " The scheme is not conformant . " ) ; } m_scheme = p_scheme . toLowerCase ( ) ;
public class DatabaseMetaData { /** * { @ inheritDoc } */ public ResultSet getProcedures ( final String catalog , final String schemaPatterns , final String procedureNamePattern ) throws SQLException { } }
return RowLists . rowList8 ( String . class , String . class , String . class , Object . class , Object . class , Object . class , String . class , Short . class ) . withLabel ( 1 , "PROCEDURE_CAT" ) . withLabel ( 2 , "PROCEDURE_SCHEM" ) . withLabel ( 3 , "PROCEDURE_NAME" ) . withLabel ( 7 , "REMARKS" ) . withLabel ( 8 , "PROCEDURE_TYPE" ) . resultSet ( ) ;
public class CircuitBreakerBuilder { /** * Sets the duration of OPEN state . * Defaults to { @ value Defaults # CIRCUIT _ OPEN _ WINDOW _ SECONDS } seconds if unspecified . */ public CircuitBreakerBuilder circuitOpenWindow ( Duration circuitOpenWindow ) { } }
requireNonNull ( circuitOpenWindow , "circuitOpenWindow" ) ; if ( circuitOpenWindow . isNegative ( ) || circuitOpenWindow . isZero ( ) ) { throw new IllegalArgumentException ( "circuitOpenWindow: " + circuitOpenWindow + " (expected: > 0)" ) ; } this . circuitOpenWindow = circuitOpenWindow ; return this ;
public class RelativeToEasterSundayParser { /** * Adds the given day to the list of holidays . * @ param aDate * The day * @ param sPropertiesKey * a { @ link java . lang . String } object . * @ param aHolidayType * a { @ link HolidayType } object . * @ param holidays * a { @ link java . util . Set } object . */ protected final void addChrstianHoliday ( final ChronoLocalDate aDate , final String sPropertiesKey , final IHolidayType aHolidayType , final HolidayMap holidays ) { } }
final LocalDate convertedDate = LocalDate . from ( aDate ) ; holidays . add ( convertedDate , new ResourceBundleHoliday ( aHolidayType , sPropertiesKey ) ) ;
public class Streams { /** * Writes the JSON element to the writer , recursively . */ public static void write ( JsonElement element , JsonWriter writer ) throws IOException { } }
TypeAdapters . JSON_ELEMENT . write ( writer , element ) ;
public class Classfile { /** * Compare a string in the constant pool with a given ASCII string , without constructing the constant pool * String object . * @ param cpIdx * the constant pool index * @ param asciiString * the ASCII string to compare to * @ return true , if successful * @ throws ClassfileFormatException * If a problem occurs . * @ throws IOException * If an IO exception occurs . */ private boolean constantPoolStringEquals ( final int cpIdx , final String asciiString ) throws ClassfileFormatException , IOException { } }
final int strOffset = getConstantPoolStringOffset ( cpIdx , /* subFieldIdx = */ 0 ) ; if ( strOffset == 0 ) { return asciiString == null ; } else if ( asciiString == null ) { return false ; } final int strLen = inputStreamOrByteBuffer . readUnsignedShort ( strOffset ) ; final int otherLen = asciiString . length ( ) ; if ( strLen != otherLen ) { return false ; } final int strStart = strOffset + 2 ; for ( int i = 0 ; i < strLen ; i ++ ) { if ( ( char ) ( inputStreamOrByteBuffer . buf [ strStart + i ] & 0xff ) != asciiString . charAt ( i ) ) { return false ; } } return true ;
public class SunburstChart { /** * * * * * * Resizing * * * * * */ private void resize ( ) { } }
width = getWidth ( ) - getInsets ( ) . getLeft ( ) - getInsets ( ) . getRight ( ) ; height = getHeight ( ) - getInsets ( ) . getTop ( ) - getInsets ( ) . getBottom ( ) ; size = width < height ? width : height ; if ( width > 0 && height > 0 ) { pane . setMaxSize ( size , size ) ; pane . setPrefSize ( size , size ) ; pane . relocate ( ( getWidth ( ) - size ) * 0.5 , ( getHeight ( ) - size ) * 0.5 ) ; segmentPane . setPrefSize ( size , size ) ; chartCanvas . setWidth ( size ) ; chartCanvas . setHeight ( size ) ; centerX = size * 0.5 ; centerY = centerX ; redraw ( ) ; }
public class QRDecomposition { /** * Generate and return the ( economy - sized ) orthogonal factor * @ return Q */ @ Nonnull @ ReturnsMutableCopy public Matrix getQ ( ) { } }
final Matrix aNewMatrix = new Matrix ( m_nRows , m_nCols ) ; final double [ ] [ ] aNewArray = aNewMatrix . internalGetArray ( ) ; for ( int k = m_nCols - 1 ; k >= 0 ; k -- ) { final double [ ] aQRk = m_aQR [ k ] ; for ( int nRow = 0 ; nRow < m_nRows ; nRow ++ ) aNewArray [ nRow ] [ k ] = 0.0 ; aNewArray [ k ] [ k ] = 1.0 ; for ( int j = k ; j < m_nCols ; j ++ ) { if ( aQRk [ k ] != 0 ) { double s = 0.0 ; for ( int i = k ; i < m_nRows ; i ++ ) s += m_aQR [ i ] [ k ] * aNewArray [ i ] [ j ] ; s = - s / aQRk [ k ] ; for ( int i = k ; i < m_nRows ; i ++ ) { aNewArray [ i ] [ j ] += s * m_aQR [ i ] [ k ] ; } } } } return aNewMatrix ;
public class AuthTokenUtil { /** * Validates an auth token . This checks the expiration time of the token against * the current system time . It also checks the validity of the signature . * @ param token the authentication token * @ throws IllegalArgumentException when the token is invalid */ public static final void validateToken ( AuthToken token ) throws IllegalArgumentException { } }
if ( token . getExpiresOn ( ) . before ( new Date ( ) ) ) { throw new IllegalArgumentException ( "Authentication token expired: " + token . getExpiresOn ( ) ) ; // $ NON - NLS - 1 $ } String validSig = generateSignature ( token ) ; if ( token . getSignature ( ) == null || ! token . getSignature ( ) . equals ( validSig ) ) { throw new IllegalArgumentException ( "Missing or invalid signature on the auth token." ) ; // $ NON - NLS - 1 $ }
public class JMElasticsearchBulk { /** * Send with bulk processor and object mapper . * @ param object the object * @ param index the index * @ param type the type * @ param id the id */ public void sendWithBulkProcessorAndObjectMapper ( Object object , String index , String type , String id ) { } }
sendWithBulkProcessor ( buildIndexRequest ( index , type , id ) . source ( JMElasticsearchUtil . buildSourceByJsonMapper ( object ) ) ) ;
public class FindDeadLocalStores { /** * Is instruction at given location a store ? * @ param location * the location * @ return true if instruction at given location is a store , false if not */ private boolean isStore ( Location location ) { } }
Instruction ins = location . getHandle ( ) . getInstruction ( ) ; return ( ins instanceof StoreInstruction ) || ( ins instanceof IINC ) ;
public class BoundedSize { /** * Returns this size as pixel size . Neither requires the component list nor the specified * measures . Honors the lower and upper bound . < p > * Invoked by { @ code FormSpec } to determine the size of a column or row . * @ param container the layout container * @ param components the list of components to measure * @ param minMeasure the measure used to determine the minimum size * @ param prefMeasure the measure used to determine the preferred size * @ param defaultMeasure the measure used to determine the default size * @ return the maximum size in pixels * @ see FormSpec # maximumSize ( Container , List , FormLayout . Measure , FormLayout . Measure , * FormLayout . Measure ) */ @ Override public int maximumSize ( Container container , List components , FormLayout . Measure minMeasure , FormLayout . Measure prefMeasure , FormLayout . Measure defaultMeasure ) { } }
int size = basis . maximumSize ( container , components , minMeasure , prefMeasure , defaultMeasure ) ; if ( lowerBound != null ) { size = Math . max ( size , lowerBound . maximumSize ( container , components , minMeasure , prefMeasure , defaultMeasure ) ) ; } if ( upperBound != null ) { size = Math . min ( size , upperBound . maximumSize ( container , components , minMeasure , prefMeasure , defaultMeasure ) ) ; } return size ;
public class HamtPMap { /** * Internal recursive implementation of equivalent ( HamtPMap , BiPredicate ) . */ private static < K , V > boolean equivalent ( @ Nullable HamtPMap < K , V > t1 , @ Nullable HamtPMap < K , V > t2 , BiPredicate < V , V > equivalence ) { } }
if ( t1 == t2 ) { return true ; } else if ( t1 == null || t2 == null ) { return false ; } if ( t1 . hash != t2 . hash ) { // Due to our invariant , we can safely conclude that there ' s a discrepancy in the // keys without any extra work . return false ; } else if ( ! t1 . key . equals ( t2 . key ) ) { // Hash collision : try to rearrange t2 to have the same root as t1 t2 = t2 . pivot ( t1 . key , t1 . hash ) ; if ( t2 . key == null ) { // t1 . key not found in t2 return false ; } } if ( ! equivalence . test ( t1 . value , t2 . value ) ) { return false ; } int mask = t1 . mask | t2 . mask ; while ( mask != 0 ) { int childBit = Integer . lowestOneBit ( mask ) ; mask &= ~ childBit ; if ( ! equivalent ( t1 . getChild ( childBit ) , t2 . getChild ( childBit ) , equivalence ) ) { return false ; } } return true ;
public class AbstractPlatform { /** * Delivers { @ code error } to { @ code callback } on the next game tick ( on the PlayN thread ) . */ public void notifyFailure ( final Callback < ? > callback , final Throwable error ) { } }
invokeLater ( new Runnable ( ) { public void run ( ) { callback . onFailure ( error ) ; } } ) ;
public class AmazonWebServiceClient { /** * Fluent method for { @ link # setRegion ( Region ) } . * < pre > * Example : * AmazonDynamoDBClient client = new AmazonDynamoDBClient ( . . . ) . < AmazonDynamoDBClient > withRegion ( . . . ) ; * < / pre > * @ see # setRegion ( Region ) * @ deprecated use { @ link AwsClientBuilder # withRegion ( Region ) } for example : * { @ code AmazonSNSClientBuilder . standard ( ) . withRegion ( region ) . build ( ) ; } */ @ Deprecated public < T extends AmazonWebServiceClient > T withRegion ( Region region ) { } }
setRegion ( region ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ;
public class MockDriverRestartContext { /** * Pass these active contexts to the { @ link org . apache . reef . driver . parameters . DriverRestartContextActiveHandlers } . * These active contexts have no tasks running . * @ return */ public List < MockActiveContext > getIdleActiveContexts ( ) { } }
final List < MockActiveContext > idleActiveContexts = new ArrayList < > ( ) ; final Set < String > activeContextsWithRunningTasks = new HashSet < > ( ) ; for ( final MockRunningTask task : this . runningTasks ) { activeContextsWithRunningTasks . add ( task . getActiveContext ( ) . getEvaluatorId ( ) ) ; } for ( final MockActiveContext context : this . activeContexts ) { if ( ! activeContextsWithRunningTasks . contains ( context . getEvaluatorId ( ) ) ) { idleActiveContexts . add ( context ) ; } } return idleActiveContexts ;
public class CronTriggerImpl { /** * Called when the < code > { @ link Scheduler } < / code > has decided to ' fire ' the trigger ( execute the * associated < code > Job < / code > ) , in order to give the < code > Trigger < / code > a chance to update * itself for its next triggering ( if any ) . * @ see # executionComplete ( JobExecutionContext , JobExecutionException ) */ @ Override public void triggered ( org . quartz . core . Calendar calendar ) { } }
previousFireTime = nextFireTime ; nextFireTime = getFireTimeAfter ( nextFireTime ) ; while ( nextFireTime != null && calendar != null && ! calendar . isTimeIncluded ( nextFireTime . getTime ( ) ) ) { nextFireTime = getFireTimeAfter ( nextFireTime ) ; }
public class MPSImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MPS__RG_LENGTH : return RG_LENGTH_EDEFAULT == null ? rgLength != null : ! RG_LENGTH_EDEFAULT . equals ( rgLength ) ; case AfplibPackage . MPS__RESERVED : return RESERVED_EDEFAULT == null ? reserved != null : ! RESERVED_EDEFAULT . equals ( reserved ) ; case AfplibPackage . MPS__FIXED_LENGTH_RG : return fixedLengthRG != null && ! fixedLengthRG . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class SkbShellFactory { /** * Returns a new shell with a given identifier and STGroup plus console activated . * @ param id new shell with identifier * @ param renderer a renderer for help messages * @ return new shell */ public static SkbShell newShell ( String id , MessageRenderer renderer ) { } }
return SkbShellFactory . newShell ( id , renderer , true ) ;
public class GetTranscriptionJobRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetTranscriptionJobRequest getTranscriptionJobRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getTranscriptionJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getTranscriptionJobRequest . getTranscriptionJobName ( ) , TRANSCRIPTIONJOBNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SpotifyApi { /** * Get the current user ’ s followed artists . * @ param type The ID type : currently only artist is supported . * @ return A { @ link GetUsersFollowedArtistsRequest . Builder } . * @ see < a href = " https : / / developer . spotify . com / web - api / user - guide / # spotify - uris - and - ids " > Spotify : URLs & amp ; IDs < / a > */ public GetUsersFollowedArtistsRequest . Builder getUsersFollowedArtists ( ModelObjectType type ) { } }
return new GetUsersFollowedArtistsRequest . Builder ( accessToken ) . setDefaults ( httpManager , scheme , host , port ) . type ( type ) ;
public class KeyStoreHelper { /** * Load a key store from a resource . * @ param aKeyStoreType * Type of key store . May not be < code > null < / code > . * @ param sKeyStorePath * The path pointing to the key store . May not be < code > null < / code > . * @ param aKeyStorePassword * The key store password . May be < code > null < / code > to indicate that no * password is required . * @ return The Java key - store object . * @ see KeyStore # load ( InputStream , char [ ] ) * @ throws GeneralSecurityException * In case of a key store error * @ throws IOException * In case key store loading fails * @ throws IllegalArgumentException * If the key store path is invalid */ @ Nonnull public static KeyStore loadKeyStoreDirect ( @ Nonnull final IKeyStoreType aKeyStoreType , @ Nonnull final String sKeyStorePath , @ Nullable final char [ ] aKeyStorePassword ) throws GeneralSecurityException , IOException { } }
ValueEnforcer . notNull ( aKeyStoreType , "KeyStoreType" ) ; ValueEnforcer . notNull ( sKeyStorePath , "KeyStorePath" ) ; // Open the resource stream final InputStream aIS = getResourceProvider ( ) . getInputStream ( sKeyStorePath ) ; if ( aIS == null ) throw new IllegalArgumentException ( "Failed to open key store '" + sKeyStorePath + "'" ) ; try { final KeyStore aKeyStore = aKeyStoreType . getKeyStore ( ) ; aKeyStore . load ( aIS , aKeyStorePassword ) ; return aKeyStore ; } catch ( final KeyStoreException ex ) { throw new IllegalStateException ( "No provider can handle key stores of type " + aKeyStoreType , ex ) ; } finally { StreamHelper . close ( aIS ) ; }
public class JdbcFragment { /** * Get the prepared statement parameter value ( s ) contained within this fragment . * @ param context A ControlBeanContext instance . * @ param method The annotated method . * @ param args The method ' s arguments . * @ return null if this fragment doesn ' t contain a parameter value . */ Object [ ] getParameterValues ( ControlBeanContext context , Method method , Object [ ] args ) { } }
ArrayList < Object > values = new ArrayList < Object > ( ) ; for ( SqlFragment sf : _children ) { if ( sf . hasParamValue ( ) ) { Object [ ] moreValues = sf . getParameterValues ( context , method , args ) ; for ( Object o : moreValues ) { values . add ( o ) ; } } } return values . toArray ( ) ;
public class IoUtils { /** * Copy input stream to output stream without closing streams . Flushes output stream when done . * @ param is input stream * @ param os output stream * @ param bufferSize the buffer size to use * @ throws IOException for any error */ private static void copyStream ( InputStream is , OutputStream os , int bufferSize ) throws IOException { } }
Assert . checkNotNullParam ( "is" , is ) ; Assert . checkNotNullParam ( "os" , os ) ; byte [ ] buff = new byte [ bufferSize ] ; int rc ; while ( ( rc = is . read ( buff ) ) != - 1 ) os . write ( buff , 0 , rc ) ; os . flush ( ) ;
public class MainScene { /** * Register a listener for { @ link OnScaledListener # onScaled ( float ) * onScaled ( ) } notifications . * Newly registered listeners are immediately called with the current * scaling . * @ param listener An implementation of { @ link OnScaledListener } . * @ return { @ code True } if the listener is not already added , { @ code false } * if it has already been registered . */ public boolean addOnScaledListener ( OnScaledListener listener ) { } }
final boolean added = mOnScaledListeners . add ( listener ) ; if ( added ) { listener . onScaled ( mSceneRootObject . getTransform ( ) . getScaleX ( ) ) ; } return added ;
public class SimpleRequestManager { @ Override public HttpServletRequest getRequest ( ) { } }
final HttpServletRequest request = LaRequestUtil . getRequest ( ) ; if ( request == null ) { throw new IllegalStateException ( "Not found the request, not web environment?" ) ; } return request ;
public class ProcessorBuilder { /** * Find or create the scope . * @ param scope the scope configuration * @ return scope scope */ ProcScope createScope ( Scope scope ) { } }
ProcScope created = scopes . get ( scope ) ; if ( created == null ) { created = new ProcScope ( scope . getName ( ) ) ; scopes . put ( scope , created ) ; created . setStrong ( scope . isStrong ( ) ) ; created . setIgnoreText ( scope . isIgnoreText ( ) ) ; if ( scope . getParent ( ) != null ) { created . setParent ( createScope ( scope . getParent ( ) ) ) ; } Set < ProcCode > scopeCodes = new HashSet < ProcCode > ( ) ; for ( Code code : scope . getCodes ( ) ) { scopeCodes . add ( createCode ( code ) ) ; } created . setScopeCodes ( scopeCodes ) ; created . setMin ( scope . getMin ( ) ) ; created . setMax ( scope . getMax ( ) ) ; } return created ;
public class Lists { /** * Checks whether the list has the given size . A null list is treated like a list without * entries . * @ param list The list to check * @ param size The size to check * @ return true when the list has the given size or when size = 0 and the list is null , false * otherwise */ public static boolean sizeIs ( final List < ? > list , final int size ) { } }
if ( size == 0 ) { return list == null || list . isEmpty ( ) ; } else { return list != null && list . size ( ) == size ; }
public class InclusiveAnnotationIntrospector { /** * Indicates whether the given type is a " serializable " type . */ private boolean isSerializableType ( Class < ? > type ) { } }
Boolean serializable = cache . get ( type ) ; if ( serializable != null ) { return serializable ; } if ( type == Object . class ) { return true ; } if ( primitiveTypes . contains ( type ) ) { cache . put ( type , true ) ; return true ; } if ( JsonSerializable . class . isAssignableFrom ( type ) ) { cache . put ( type , true ) ; return true ; } for ( Class < ? > clazz : serializableTypes ) { if ( clazz . isAssignableFrom ( type ) ) { cache . put ( type , true ) ; return true ; } } cache . put ( type , false ) ; return false ;
public class DriverFactory { /** * Registers new { @ linkplain Driver } under provided name with specified properties . * @ param name * the name of the instance * @ param props * the { @ link Properties } for the instance */ public static void configure ( String name , Properties props ) { } }
put ( name , createDriver ( name , props ) ) ;
public class JMatrix { /** * Sort eigenvalues and eigenvectors . */ protected static void sort ( double [ ] d , double [ ] e , DenseMatrix V ) { } }
int i = 0 ; int n = d . length ; double [ ] temp = new double [ n ] ; for ( int j = 1 ; j < n ; j ++ ) { double real = d [ j ] ; double img = e [ j ] ; for ( int k = 0 ; k < n ; k ++ ) { temp [ k ] = V . get ( k , j ) ; } for ( i = j - 1 ; i >= 0 ; i -- ) { if ( d [ i ] >= d [ j ] ) { break ; } d [ i + 1 ] = d [ i ] ; e [ i + 1 ] = e [ i ] ; for ( int k = 0 ; k < n ; k ++ ) { V . set ( k , i + 1 , V . get ( k , i ) ) ; } } d [ i + 1 ] = real ; e [ i + 1 ] = img ; for ( int k = 0 ; k < n ; k ++ ) { V . set ( k , i + 1 , temp [ k ] ) ; } }
public class SecurityUtility { /** * Drive the logic of the program . * @ param args */ SecurityUtilityReturnCodes runProgram ( String [ ] args ) { } }
if ( stdin == null ) { stderr . println ( CommandUtils . getMessage ( "error.missingIO" , "stdin" ) ) ; return SecurityUtilityReturnCodes . ERR_GENERIC ; } if ( stdout == null ) { stderr . println ( CommandUtils . getMessage ( "error.missingIO" , "stdout" ) ) ; return SecurityUtilityReturnCodes . ERR_GENERIC ; } if ( stderr == null ) { stdout . println ( CommandUtils . getMessage ( "error.missingIO" , "stderr" ) ) ; return SecurityUtilityReturnCodes . ERR_GENERIC ; } // Help is always available HelpTask help = new HelpTask ( SCRIPT_NAME , tasks ) ; registerTask ( help ) ; if ( args . length == 0 ) { stdout . println ( help . getScriptUsage ( ) ) ; return SecurityUtilityReturnCodes . OK ; } // Convenience : If the first argument can reasonably be interpreted as " help " , do so . // Note NLS issue and presumption that none of the other commands rhyme with help . . . // which is part of why I ' m checking starts / ends rather than contains . if ( args [ 0 ] . toLowerCase ( ) . endsWith ( help . getTaskName ( ) . toLowerCase ( ) ) ) { args [ 0 ] = help . getTaskName ( ) ; } SecurityUtilityTask task = getTask ( args [ 0 ] ) ; if ( task == null ) { stderr . println ( CommandUtils . getMessage ( "task.unknown" , args [ 0 ] ) ) ; stderr . println ( help . getScriptUsage ( ) ) ; // It is unfortunate that this returns 0 ( OK ) but that ' s what it used to do , // so don ' t break anything . return SecurityUtilityReturnCodes . OK ; } else { try { return task . handleTask ( stdin , stdout , stderr , args ) ; } catch ( IllegalArgumentException e ) { stderr . println ( "" ) ; stderr . println ( CommandUtils . getMessage ( "error" , e . getMessage ( ) ) ) ; stderr . println ( help . getTaskUsage ( task ) ) ; return SecurityUtilityReturnCodes . ERR_GENERIC ; } catch ( Exception e ) { stderr . println ( "" ) ; stderr . println ( CommandUtils . getMessage ( "error" , e . toString ( ) ) ) ; stderr . println ( help . getTaskUsage ( task ) ) ; return SecurityUtilityReturnCodes . ERR_GENERIC ; } }
public class Engine { /** * Get template by file name */ public Template getTemplate ( String fileName ) { } }
if ( fileName . charAt ( 0 ) != '/' ) { char [ ] arr = new char [ fileName . length ( ) + 1 ] ; fileName . getChars ( 0 , fileName . length ( ) , arr , 1 ) ; arr [ 0 ] = '/' ; fileName = new String ( arr ) ; } Template template = templateCache . get ( fileName ) ; if ( template == null ) { template = buildTemplateBySourceFactory ( fileName ) ; templateCache . put ( fileName , template ) ; } else if ( devMode ) { if ( template . isModified ( ) ) { template = buildTemplateBySourceFactory ( fileName ) ; templateCache . put ( fileName , template ) ; } } return template ;
public class AbstractContext { /** * / * ( non - Javadoc ) * @ see com . abubusoft . kripton . BinderContext # serialize ( java . lang . Object ) */ @ SuppressWarnings ( "unchecked" ) @ Override public < E > String serialize ( E object ) { } }
if ( object == null ) return null ; SegmentedStringWriter source = new SegmentedStringWriter ( buffer . get ( ) ) ; try ( SerializerWrapper serializer = createSerializer ( source ) ) { mapperFor ( ( Class < E > ) object . getClass ( ) ) . serialize ( this , serializer , object ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new KriptonRuntimeException ( e ) ; } return source . getAndClear ( ) ;
public class InstanceHelpers { /** * Finds the name of an instance from its path . * @ param instancePath a non - null instance path * @ return an instance name , or the path itself if it is not valid ( e . g . no slash ) */ public static String findInstanceName ( String instancePath ) { } }
String instanceName = "" ; Matcher m = Pattern . compile ( "([^/]+)$" ) . matcher ( instancePath ) ; if ( m . find ( ) ) instanceName = m . group ( 1 ) ; return instanceName ;
public class IOGroovyMethods { /** * Allows this AutoCloseable to be used within the closure , ensuring that it * is closed once the closure has been executed and before this method returns . * As with the try - with - resources statement , if multiple exceptions are thrown * the exception from the closure will be returned and the exception from closing * will be added as a suppressed exception . * @ param self the AutoCloseable * @ param action the closure taking the AutoCloseable as parameter * @ return the value returned by the closure * @ throws Exception if an Exception occurs . * @ since 2.5.0 */ public static < T , U extends AutoCloseable > T withCloseable ( U self , @ ClosureParams ( value = FirstParam . class ) Closure < T > action ) throws Exception { } }
Throwable thrown = null ; try { return action . call ( self ) ; } catch ( Throwable e ) { thrown = e ; throw e ; } finally { if ( thrown != null ) { Throwable suppressed = tryClose ( self , true ) ; if ( suppressed != null ) { thrown . addSuppressed ( suppressed ) ; } } else { self . close ( ) ; } }
public class LocationAttributes { /** * Returns the column number of an element ( DOM flavor ) * @ param elem * the element that holds the location information * @ return the element ' s column number or < code > - 1 < / code > if * < code > elem < / code > has no location information . */ public static int getColumn ( Element elem ) { } }
Attr attr = elem . getAttributeNodeNS ( URI , COL_ATTR ) ; return attr != null ? Integer . parseInt ( attr . getValue ( ) ) : - 1 ;
public class Region { /** * Merge the supplied region into this region ( if they are adjoining ) . * @ param r region to merge */ public void merge ( Region r ) { } }
if ( this . start == r . end + 1 ) { this . start = r . start ; } else if ( this . end == r . start - 1 ) { this . end = r . end ; } else { throw new AssertionError ( "Ranges : Merge called on non contiguous values : [this]:" + this + " and " + r ) ; } updateAvailable ( ) ;
public class NewServiceDescriptorImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getInputs ( ) { } }
return ( EList < String > ) eGet ( StorePackage . Literals . NEW_SERVICE_DESCRIPTOR__INPUTS , true ) ;
public class ServerConfig { /** * Set configuration parameters from the given YAML - loaded map . */ private static void setParams ( Map < String , ? > map ) { } }
for ( String name : map . keySet ( ) ) { setParam ( name , map . get ( name ) ) ; }
public class NaetherImpl { /** * / * ( non - Javadoc ) * @ see com . tobedevoured . naether . api . Naether # addDependency ( java . lang . String , java . lang . String ) */ public void addDependency ( String notation , String scope ) { } }
log . debug ( "Add dep {} {}" , notation , scope ) ; DefaultArtifact artifact = new DefaultArtifact ( notation ) ; if ( Const . TEST . equals ( artifact . getClassifier ( ) ) || Const . TEST_JAR . equals ( artifact . getClassifier ( ) ) ) { ArtifactType artifactType = new DefaultArtifactType ( Const . TEST_JAR , Const . JAR , Const . TEST_JAR , null ) ; artifact = new DefaultArtifact ( artifact . getGroupId ( ) , artifact . getArtifactId ( ) , null , Const . JAR , artifact . getBaseVersion ( ) , artifactType ) ; } Dependency dependency = new Dependency ( artifact , scope ) ; addDependency ( dependency ) ;
public class SearchParameterMap { /** * This method creates a URL query string representation of the parameters in this * object , excluding the part before the parameters , e . g . * < code > ? name = smith & amp ; _ sort = Patient : family < / code > * This method < b > excludes < / b > the < code > _ count < / code > parameter , * as it doesn ' t affect the substance of the results returned */ public String toNormalizedQueryString ( FhirContext theCtx ) { } }
StringBuilder b = new StringBuilder ( ) ; ArrayList < String > keys = new ArrayList < > ( keySet ( ) ) ; Collections . sort ( keys ) ; for ( String nextKey : keys ) { List < List < IQueryParameterType > > nextValuesAndsIn = get ( nextKey ) ; List < List < IQueryParameterType > > nextValuesAndsOut = new ArrayList < > ( ) ; for ( List < ? extends IQueryParameterType > nextValuesAndIn : nextValuesAndsIn ) { List < IQueryParameterType > nextValuesOrsOut = new ArrayList < > ( ) ; for ( IQueryParameterType nextValueOrIn : nextValuesAndIn ) { if ( nextValueOrIn . getMissing ( ) != null || isNotBlank ( nextValueOrIn . getValueAsQueryToken ( theCtx ) ) ) { nextValuesOrsOut . add ( nextValueOrIn ) ; } } nextValuesOrsOut . sort ( new QueryParameterTypeComparator ( theCtx ) ) ; if ( nextValuesOrsOut . size ( ) > 0 ) { nextValuesAndsOut . add ( nextValuesOrsOut ) ; } } // for AND nextValuesAndsOut . sort ( new QueryParameterOrComparator ( theCtx ) ) ; for ( List < IQueryParameterType > nextValuesAnd : nextValuesAndsOut ) { addUrlParamSeparator ( b ) ; IQueryParameterType firstValue = nextValuesAnd . get ( 0 ) ; b . append ( UrlUtil . escapeUrlParam ( nextKey ) ) ; if ( nextKey . equals ( Constants . PARAM_HAS ) ) { b . append ( ':' ) ; } if ( firstValue . getMissing ( ) != null ) { b . append ( Constants . PARAMQUALIFIER_MISSING ) ; b . append ( '=' ) ; if ( firstValue . getMissing ( ) ) { b . append ( Constants . PARAMQUALIFIER_MISSING_TRUE ) ; } else { b . append ( Constants . PARAMQUALIFIER_MISSING_FALSE ) ; } continue ; } if ( isNotBlank ( firstValue . getQueryParameterQualifier ( ) ) ) { b . append ( firstValue . getQueryParameterQualifier ( ) ) ; } b . append ( '=' ) ; for ( int i = 0 ; i < nextValuesAnd . size ( ) ; i ++ ) { IQueryParameterType nextValueOr = nextValuesAnd . get ( i ) ; if ( i > 0 ) { b . append ( ',' ) ; } String valueAsQueryToken = nextValueOr . getValueAsQueryToken ( theCtx ) ; b . append ( UrlUtil . escapeUrlParam ( valueAsQueryToken ) ) ; } } } // for keys SortSpec sort = getSort ( ) ; boolean first = true ; while ( sort != null ) { if ( isNotBlank ( sort . getParamName ( ) ) ) { if ( first ) { addUrlParamSeparator ( b ) ; b . append ( Constants . PARAM_SORT ) ; b . append ( '=' ) ; first = false ; } else { b . append ( ',' ) ; } if ( sort . getOrder ( ) == SortOrderEnum . DESC ) { b . append ( '-' ) ; } b . append ( sort . getParamName ( ) ) ; } Validate . isTrue ( sort != sort . getChain ( ) ) ; // just in case , shouldn ' t happen sort = sort . getChain ( ) ; } addUrlIncludeParams ( b , Constants . PARAM_INCLUDE , getIncludes ( ) ) ; addUrlIncludeParams ( b , Constants . PARAM_REVINCLUDE , getRevIncludes ( ) ) ; if ( getLastUpdated ( ) != null ) { DateParam lb = getLastUpdated ( ) . getLowerBound ( ) ; addLastUpdateParam ( b , lb ) ; DateParam ub = getLastUpdated ( ) . getUpperBound ( ) ; addLastUpdateParam ( b , ub ) ; } if ( getCount ( ) != null ) { addUrlParamSeparator ( b ) ; b . append ( Constants . PARAM_COUNT ) ; b . append ( '=' ) ; b . append ( getCount ( ) ) ; } // Summary if ( getSummaryMode ( ) != null ) { addUrlParamSeparator ( b ) ; b . append ( Constants . PARAM_SUMMARY ) ; b . append ( '=' ) ; b . append ( getSummaryMode ( ) . getCode ( ) ) ; } if ( b . length ( ) == 0 ) { b . append ( '?' ) ; } return b . toString ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcBooleanOperator ( ) { } }
if ( ifcBooleanOperatorEEnum == null ) { ifcBooleanOperatorEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 787 ) ; } return ifcBooleanOperatorEEnum ;
public class AvatarNode { /** * Returns the name of the http server of the local namenode */ static String getRemoteNamenodeHttpName ( Configuration conf , InstanceId instance ) throws IOException { } }
if ( instance == InstanceId . NODEZERO ) { return conf . get ( "dfs.http.address1" ) ; } else if ( instance == InstanceId . NODEONE ) { return conf . get ( "dfs.http.address0" ) ; } else { throw new IOException ( "Unknown instance " + instance ) ; }
public class Clientlib { /** * Removes invalid chars ( according to { @ link # CATEGORYNAME _ CHARS } ) from a category ; returns null if there is * nothing left / was empty , anyway . */ public static String sanitizeCategory ( String category ) { } }
String res = null ; if ( StringUtils . isNotBlank ( category ) ) { res = category . trim ( ) . replaceAll ( "[^" + CATEGORYNAME_CHARS + "]" , "" ) ; if ( ! res . equals ( category ) ) LOG . error ( "Invalid characters in category {}" , category ) ; } return res ;
public class IOUtils { /** * Locates this file either in the CLASSPATH or in the file system . The CLASSPATH takes priority * @ param fn * @ throws FileNotFoundException * if the file does not exist */ private static InputStream findStreamInClasspathOrFileSystem ( String fn ) throws FileNotFoundException { } }
// ms 10-04-2010: // - even though this may look like a regular file , it may be a path inside a jar in the CLASSPATH // - check for this first . This takes precedence over the file system . InputStream is = IOUtils . class . getClassLoader ( ) . getResourceAsStream ( fn ) ; // if not found in the CLASSPATH , load from the file system if ( is == null ) is = new FileInputStream ( fn ) ; return is ;
public class GenericUtils { /** * Utility method to skip past data in an array until it runs out of space * or finds the target character . * @ param data * @ param start * @ param target * @ return int ( return index , equals data . length if not found ) */ static public int skipToChar ( byte [ ] data , int start , byte target ) { } }
int index = start ; while ( index < data . length && target != data [ index ] ) { index ++ ; } return index ;
public class AmazonWebServiceClient { /** * Notify request handlers that we are about to start execution . */ protected final < T extends AmazonWebServiceRequest > T beforeClientExecution ( T request ) { } }
T local = request ; for ( RequestHandler2 handler : requestHandler2s ) { local = ( T ) handler . beforeExecution ( local ) ; } return local ;
public class AppendableExpression { /** * Returns a similar { @ link AppendableExpression } but with the given ( char valued ) expression * appended to it . */ AppendableExpression appendChar ( Expression exp ) { } }
return withNewDelegate ( delegate . invoke ( APPEND_CHAR , exp ) , true ) ;
public class HijriCalendar { /** * / * [ deutsch ] * < p > Liefert die L & auml ; nge des aktuellen islamischen Jahres in Tagen . < / p > * @ return int * @ since 3.6/4.4 * @ throws ChronoException if data are not available for the whole year ( edge case ) */ public int lengthOfYear ( ) { } }
try { return this . getCalendarSystem ( ) . getLengthOfYear ( HijriEra . ANNO_HEGIRAE , this . hyear ) ; } catch ( IllegalArgumentException iae ) { throw new ChronoException ( iae . getMessage ( ) , iae ) ; }
public class ObjectAnimator { /** * Constructs and returns an ObjectAnimator that animates between float values . A single * value implies that that value is the one being animated to . Two values imply a starting * and ending values . More than two values imply a starting value , values to animate through * along the way , and an ending value ( these values will be distributed evenly across * the duration of the animation ) . * @ param target The object whose property is to be animated . This object should * have a public method on it called < code > setName ( ) < / code > , where < code > name < / code > is * the value of the < code > propertyName < / code > parameter . * @ param propertyName The name of the property being animated . * @ param values A set of values that the animation will animate between over time . * @ return An ObjectAnimator object that is set up to animate between the given values . */ public static ObjectAnimator ofFloat ( Object target , String propertyName , float ... values ) { } }
ObjectAnimator anim = new ObjectAnimator ( target , propertyName ) ; anim . setFloatValues ( values ) ; return anim ;
public class ZipExploder { /** * Explode source JAR files into a target directory * @ param jarNames * names of source files * @ param destDir * target directory name ( should already exist ) * @ exception IOException * error creating a target file * @ deprecated use { @ link # processJars ( File [ ] , File ) } for a type save * variant */ @ Deprecated public void processJars ( String [ ] jarNames , String destDir ) throws IOException { } }
// Delegation to preferred method processJars ( FileUtils . pathNamesToFiles ( jarNames ) , new File ( destDir ) ) ;
public class Counters { /** * Returns the counter with keys modified according to function F . Eager * evaluation . */ public static < T1 , T2 > Counter < T2 > transform ( Counter < T1 > c , Function < T1 , T2 > f ) { } }
Counter < T2 > c2 = new ClassicCounter < T2 > ( ) ; for ( T1 key : c . keySet ( ) ) { c2 . setCount ( f . apply ( key ) , c . getCount ( key ) ) ; } return c2 ;
public class AbstractGuiceServletConfig { /** * ( non - Javadoc ) * @ see * com . google . inject . servlet . GuiceServletContextListener # contextInitialized * ( javax . servlet . ServletContextEvent ) */ @ Override public void contextInitialized ( ServletContextEvent servletContextEvent ) { } }
// The jerseyServletModule injects the servicing classes using guice , // instead of letting jersey do it natively AbstractJoynrServletModule jerseyServletModule = getJoynrServletModule ( ) ; List < Module > joynrModules = getJoynrModules ( ) ; joynrModules . add ( jerseyServletModule ) ; injector = Guice . createInjector ( joynrModules ) ; // registerGuiceFilter ( servletContextEvent ) ; super . contextInitialized ( servletContextEvent ) ;
public class EJSContainer { /** * LI3294-35 d496060 */ public WSEJBEndpointManager createWebServiceEndpointManager ( J2EEName j2eeName , Class < ? > provider , // d492780 , F87951 Method [ ] methods ) throws EJBException , EJBConfigurationException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createWebServiceEndpointManager : " + j2eeName , new Object [ ] { provider , methods } ) ; EJSHome home = ( EJSHome ) homeOfHomes . getHome ( j2eeName ) ; // If a WebService request comes in after a home has been uninstalled , // then it won ' t be found . d547849 if ( home == null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createWebServiceEndpointManager could not find home for : " + j2eeName ) ; throw ExceptionUtil . EJBException ( "Unable to find EJB component: " + j2eeName , null ) ; } BeanMetaData bmd = home . beanMetaData ; Method [ ] endpointMethods = methods ; // If this is the first time the endpoint has been accessed , // then resolve the methods to insure this is a valid configuration // and JITDeploy the WSEJBProxy class if there are around invoke // interceptors . d497921 synchronized ( bmd ) { if ( ! bmd . ivWebServiceEndpointCreated ) { if ( provider != null ) { // The Web Service Endpoint Interface from ejb - jar . xml is for // JAX - RPC , and cannot be used with a JAX - WS Provider . if ( bmd . webserviceEndpointInterfaceClass != null ) { // Log the error and throw meaningful exception . Tr . error ( tc , "WS_ENDPOINT_PROVIDER_CONFLICT_CNTR0176E" , new Object [ ] { bmd . webserviceEndpointInterfaceClass . getName ( ) , bmd . j2eeName . getComponent ( ) , bmd . j2eeName . getModule ( ) , bmd . j2eeName . getApplication ( ) } ) ; throw new EJBConfigurationException ( "Web Service Provider interface conflicts with the " + "configured Web Service Endpoint interface " + bmd . webserviceEndpointInterfaceClass . getName ( ) + " for the " + bmd . j2eeName . getComponent ( ) + " bean in the " + bmd . j2eeName . getModule ( ) + " module of the " + bmd . j2eeName . getApplication ( ) + " application." ) ; } endpointMethods = provider . getMethods ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "provider methods : " , ( Object [ ] ) endpointMethods ) ; } // Resolve the Web Service Endpoint methods . This will make sure that // the bean actually implements the methods , but will also remove any // excess methodInfos for the webservice endpoint interface in BMD . // Until now , EJBContainer is not aware of what the endpoint methods // are , so assumes all methods on the bean may be endpoint methods . boolean hasAroundInvoke = WSEJBWrapper . resolveWebServiceEndpointMethods ( bmd , endpointMethods ) ; // Finally , if any of the methods have around invoke interceptors , // then a WSEJBProxy must be created by JITDeploy . An instance of // the proxy will be returned to WebServices component to invoke // the bean method , instead of an actual bean instance . if ( hasAroundInvoke ) { try { bmd . ivWebServiceEndpointProxyClass = JITDeploy . generateWSEJBProxy ( bmd . classLoader , bmd . ivWebServiceEndpointProxyName , provider , endpointMethods , bmd . wsEndpointMethodInfos , bmd . enterpriseBeanClassName , bmd . j2eeName . toString ( ) , getEJBRuntime ( ) . getClassDefiner ( ) ) ; // F70650 } catch ( ClassNotFoundException ex ) { // Log the error and throw meaningful exception . Tr . error ( tc , "WS_EJBPROXY_FAILURE_CNTR0177E" , new Object [ ] { bmd . j2eeName . getComponent ( ) , bmd . j2eeName . getModule ( ) , bmd . j2eeName . getApplication ( ) , ex } ) ; throw ExceptionUtil . EJBException ( "Failure occurred attempting to create a Web service " + "endpoint proxy for the " + bmd . j2eeName . getComponent ( ) + " bean in the " + bmd . j2eeName . getModule ( ) + " module of the " + bmd . j2eeName . getApplication ( ) + " application." , ex ) ; } } bmd . ivWebServiceEndpointCreated = true ; // Dump the BeanMetaData now that the endpoint methodinfos are set . bmd . dump ( ) ; } } // end synchronization d521886 // Create a new instance of the generic Web Services Endpoint EJB Wrapper , // and initialize it specific to the requested bean type . WSEJBWrapper wrapper = new WSEJBWrapper ( ) ; wrapper . container = this ; wrapper . wrapperManager = wrapperManager ; wrapper . ivCommon = null ; // Not cached wrapper . isManagedWrapper = false ; // Not managed wrapper . ivInterface = WrapperInterface . SERVICE_ENDPOINT ; // Now , fill in the home specific information . wrapper . beanId = home . ivStatelessId ; wrapper . bmd = bmd ; wrapper . methodInfos = bmd . wsEndpointMethodInfos ; wrapper . methodNames = bmd . wsEndpointMethodNames ; wrapper . isolationAttrs = null ; // not used for EJB 2 . x wrapper . ivPmiBean = home . pmiBean ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createWebServiceEndpointManager : " + wrapper ) ; return wrapper ;
public class SymbolManager { /** * Set the TextPitchAlignment property * Orientation of text when map is pitched . * @ param value property wrapper value around String */ public void setTextPitchAlignment ( @ Property . TEXT_PITCH_ALIGNMENT String value ) { } }
PropertyValue propertyValue = textPitchAlignment ( value ) ; constantPropertyUsageMap . put ( PROPERTY_TEXT_PITCH_ALIGNMENT , propertyValue ) ; layer . setProperties ( propertyValue ) ;
public class RetinaApiUtils { /** * Generate the base path for the retina . * @ param ip : retina server ip . * @ param port : retina service port . * @ return : the retina ' s API base path . */ public static String generateBasepath ( final String ip , Short port ) { } }
if ( isEmpty ( ip ) ) { throw new IllegalArgumentException ( NULL_SERVER_IP_MSG ) ; } if ( port == null ) { port = 80 ; } StringBuilder basePath = new StringBuilder ( ) ; basePath . append ( "http://" ) . append ( ip ) . append ( ":" ) . append ( port ) . append ( "/rest" ) ; return basePath . toString ( ) ;
public class appflowparam { /** * Use this API to unset the properties of appflowparam resource . * Properties that need to be unset are specified in args array . */ public static base_response unset ( nitro_service client , appflowparam resource , String [ ] args ) throws Exception { } }
appflowparam unsetresource = new appflowparam ( ) ; return unsetresource . unset_resource ( client , args ) ;
public class AWSBackupClient { /** * Returns a valid JSON document specifying a backup plan or an error . * @ param getBackupPlanFromJSONRequest * @ return Result of the GetBackupPlanFromJSON operation returned by the service . * @ throws LimitExceededException * A limit in the request has been exceeded ; for example , a maximum number of items allowed in a request . * @ throws InvalidParameterValueException * Indicates that something is wrong with a parameter ' s value . For example , the value is out of range . * @ throws MissingParameterValueException * Indicates that a required parameter is missing . * @ throws ServiceUnavailableException * The request failed due to a temporary failure of the server . * @ throws InvalidRequestException * Indicates that something is wrong with the input to the request . For example , a parameter is of the wrong * type . * @ sample AWSBackup . GetBackupPlanFromJSON * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / backup - 2018-11-15 / GetBackupPlanFromJSON " target = " _ top " > AWS * API Documentation < / a > */ @ Override public GetBackupPlanFromJSONResult getBackupPlanFromJSON ( GetBackupPlanFromJSONRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetBackupPlanFromJSON ( request ) ;
public class Rule { /** * The metric filter matching all metrics that have been registered by this pipeline . * Commonly used to remove the relevant metrics from the registry upon deletion of the pipeline . * @ return the filter matching this pipeline ' s metrics */ public MetricFilter metricsFilter ( ) { } }
if ( id ( ) == null ) { return ( name , metric ) -> false ; } return ( name , metric ) -> metricNames . contains ( name ) ;
public class ZonalDateTime { /** * / * [ deutsch ] * < p > Vergleicht diese Instanz mit der angegebenen Instanz auf der lokalen Zeitachse . < / p > * < p > Die UTC - Zeiten werden genau dann in Betracht gezogen , wenn die lokalen Zeitstempel gleich sind . < / p > * @ param zdt other instance to be compared with * @ return negative , zero or positive integer if this instance is earlier , simultaneous or later than given arg * @ see # compareByMoment ( ZonalDateTime ) * @ since 3.16/4.13 */ public int compareByLocalTimestamp ( ZonalDateTime zdt ) { } }
int cmp = this . timestamp . compareTo ( zdt . timestamp ) ; if ( cmp == 0 ) { cmp = this . moment . compareTo ( zdt . moment ) ; } return cmp ;
public class Entity { /** * 获得rowid * @ param field rowid属性名 * @ return RowId */ public RowId getRowId ( String field ) { } }
Object obj = this . get ( field ) ; if ( null == obj ) { return null ; } if ( obj instanceof RowId ) { return ( RowId ) obj ; } throw new DbRuntimeException ( "Value of field [{}] is not a rowid!" , field ) ;
public class HttpsFileUploader { /** * Determines if there are upload items where the size is * unknown in advance . This means we cannot predict the total upload size . * @ param uploadItems * @ return */ private static boolean byteSizeIsKnown ( Collection < ? extends UploadItem > uploadItems ) { } }
for ( UploadItem uploadItem : uploadItems ) { if ( uploadItem . getSizeInBytes ( ) == - 1 ) { return false ; } } return true ;
public class PublicationManagerImpl { /** * Called every time a provider is registered to check whether there are already * subscriptionRequests waiting . * @ param providerId provider id * @ param providerContainer provider container */ private void restoreQueuedSubscription ( String providerId , ProviderContainer providerContainer ) { } }
Collection < PublicationInformation > queuedRequests = queuedSubscriptionRequests . get ( providerId ) ; Iterator < PublicationInformation > queuedRequestsIterator = queuedRequests . iterator ( ) ; while ( queuedRequestsIterator . hasNext ( ) ) { PublicationInformation publicationInformation = queuedRequestsIterator . next ( ) ; queuedRequestsIterator . remove ( ) ; if ( ! isExpired ( publicationInformation ) ) { addSubscriptionRequest ( publicationInformation . getProxyParticipantId ( ) , publicationInformation . getProviderParticipantId ( ) , publicationInformation . subscriptionRequest , providerContainer ) ; } }
public class RollingUpdateOpFactory { /** * Don ' t advance to the next task - - yield and have the current task be executed again in the * next iteration . * @ return { @ link RollingUpdateOp } */ public RollingUpdateOp yield ( ) { } }
// Do nothing return new RollingUpdateOp ( ImmutableList . < ZooKeeperOperation > of ( ) , ImmutableList . < Map < String , Object > > of ( ) ) ;
public class DirtyFieldMixin { /** * Will check all components that extends to { @ link HasValue } and * registers a { @ link com . google . gwt . event . logical . shared . ValueChangeEvent } . * Once value has been changed then we mark that our content wrapping it is dirty . */ protected void detectDirtyFields ( Widget parent ) { } }
if ( parent instanceof HasWidgets ) { for ( Widget widget : ( HasWidgets ) parent ) { if ( widget instanceof HasValue ) { HasValue valueWidget = ( HasValue ) widget ; registrations . add ( valueWidget . addValueChangeHandler ( event -> { if ( valueWidget . getValue ( ) != null && ! valueWidget . getValue ( ) . equals ( "" ) ) { setDirty ( true ) ; } } ) ) ; } else { if ( propagateToChildren ) { detectDirtyFields ( widget ) ; } } } }
public class DependsFileParser { /** * Extracts all build - time dependency information from a dependencies . properties file * embedded in this plugin ' s JAR . * @ param anURL The non - empty URL to a dependencies . properties file . * @ return A SortedMap holding all entries in the dependencies . properties file , plus its build * time which is found under the { @ code buildtime } key . * @ throws java . lang . IllegalStateException if no artifact in the current Thread ' s context ClassLoader * contained the supplied artifactNamePart . */ public static SortedMap < String , String > getVersionMap ( final URL anURL ) { } }
// Check sanity Validate . notNull ( anURL , "anURL" ) ; final SortedMap < String , String > toReturn = new TreeMap < String , String > ( ) ; try { final BufferedReader in = new BufferedReader ( new InputStreamReader ( anURL . openStream ( ) ) ) ; String aLine = null ; while ( ( aLine = in . readLine ( ) ) != null ) { final String trimmedLine = aLine . trim ( ) ; if ( trimmedLine . contains ( GENERATION_PREFIX ) ) { toReturn . put ( BUILDTIME_KEY , aLine . substring ( GENERATION_PREFIX . length ( ) ) ) ; } else if ( "" . equals ( trimmedLine ) || trimmedLine . startsWith ( "#" ) ) { // Empty lines and comments should be ignored . continue ; } else if ( trimmedLine . contains ( "=" ) ) { // Stash this for later use . StringTokenizer tok = new StringTokenizer ( trimmedLine , KEY_VALUE_SEPARATOR , false ) ; Validate . isTrue ( tok . countTokens ( ) == 2 , "Found incorrect dependency.properties line [" + aLine + "]" ) ; final String key = tok . nextToken ( ) . trim ( ) ; final String value = tok . nextToken ( ) . trim ( ) ; toReturn . put ( key , value ) ; } } } catch ( IOException e ) { throw new IllegalStateException ( "Could not parse dependency properties '" + anURL . toString ( ) + "'" , e ) ; } // All done . return toReturn ;
public class KeyrefModule { /** * Recursively walk map and process topics that have keyrefs . */ void walkMap ( final Element elem , final KeyScope scope , final List < ResolveTask > res ) { } }
List < KeyScope > ss = Collections . singletonList ( scope ) ; if ( elem . getAttributeNode ( ATTRIBUTE_NAME_KEYSCOPE ) != null ) { ss = new ArrayList < > ( ) ; for ( final String keyscope : elem . getAttribute ( ATTRIBUTE_NAME_KEYSCOPE ) . trim ( ) . split ( "\\s+" ) ) { final KeyScope s = scope . getChildScope ( keyscope ) ; assert s != null ; ss . add ( s ) ; } } Attr hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_COPY_TO ) ; if ( hrefNode == null ) { hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_HREF ) ; } if ( hrefNode == null && SUBMAP . matches ( elem ) ) { hrefNode = elem . getAttributeNode ( ATTRIBUTE_NAME_DITA_OT_ORIG_HREF ) ; } final boolean isResourceOnly = isResourceOnly ( elem ) ; for ( final KeyScope s : ss ) { if ( hrefNode != null ) { final URI href = stripFragment ( job . getInputMap ( ) . resolve ( hrefNode . getValue ( ) ) ) ; final FileInfo fi = job . getFileInfo ( href ) ; if ( fi != null && fi . hasKeyref ) { final int count = usage . getOrDefault ( fi . uri , 0 ) ; final Optional < ResolveTask > existing = res . stream ( ) . filter ( rt -> rt . scope . equals ( s ) && rt . in . uri . equals ( fi . uri ) ) . findAny ( ) ; if ( count != 0 && existing . isPresent ( ) ) { final ResolveTask resolveTask = existing . get ( ) ; if ( resolveTask . out != null ) { final URI value = tempFileNameScheme . generateTempFileName ( resolveTask . out . result ) ; hrefNode . setValue ( value . toString ( ) ) ; } } else { final ResolveTask resolveTask = processTopic ( fi , s , isResourceOnly ) ; res . add ( resolveTask ) ; final Integer used = usage . get ( fi . uri ) ; if ( used > 1 ) { final URI value = tempFileNameScheme . generateTempFileName ( resolveTask . out . result ) ; hrefNode . setValue ( value . toString ( ) ) ; } } } } for ( final Element child : getChildElements ( elem , MAP_TOPICREF ) ) { walkMap ( child , s , res ) ; } }
public class ResourceReaderImpl { /** * / * ( non - Javadoc ) * @ see net . crowmagnumb . util . ResourceReader # getStringList ( java . lang . String , java . lang . String ) */ @ Override public List < String > getStringList ( final String key , final String delim ) { } }
return formatStringList ( key , getFormattedPropValue ( key ) , delim ) ;
public class ReflectUtil { /** * 获得指定类本类及其父类中的Public方法名 < br > * 去重重载的方法 * @ param clazz 类 * @ return 方法名Set */ public static Set < String > getPublicMethodNames ( Class < ? > clazz ) { } }
final HashSet < String > methodSet = new HashSet < String > ( ) ; final Method [ ] methodArray = getPublicMethods ( clazz ) ; if ( ArrayUtil . isNotEmpty ( methodArray ) ) { for ( Method method : methodArray ) { methodSet . add ( method . getName ( ) ) ; } } return methodSet ;
public class AbstractHttp2ConnectionHandlerBuilder { /** * Sets if { @ link # build ( ) } will to create a { @ link Http2Connection } in server mode ( { @ code true } ) * or client mode ( { @ code false } ) . */ protected B server ( boolean isServer ) { } }
enforceConstraint ( "server" , "connection" , connection ) ; enforceConstraint ( "server" , "codec" , decoder ) ; enforceConstraint ( "server" , "codec" , encoder ) ; this . isServer = isServer ; return self ( ) ;
public class WrappingExecutorService { /** * Wraps a { @ code Runnable } for submission to the underlying executor . The * default implementation delegates to { @ link # wrapTask ( Callable ) } . */ protected Runnable wrapTask ( Runnable command ) { } }
final Callable < Object > wrapped = wrapTask ( Executors . callable ( command , null ) ) ; return new Runnable ( ) { @ Override public void run ( ) { try { wrapped . call ( ) ; } catch ( Exception e ) { Throwables . propagate ( e ) ; } } } ;
public class ClassName { /** * Similar to { @ code ClassName # asString } but uses unqualified type names */ public String asSimpleString ( ) { } }
int dotIndex = asString . lastIndexOf ( '.' ) ; if ( dotIndex > 0 ) { return asString ( ) . substring ( dotIndex + 1 ) ; } return asString ( ) ;
public class ResourceGroupsInner { /** * Updates a resource group . * Resource groups can be updated through a simple PATCH operation to a group address . The format of the request is the same as that for creating a resource group . If a field is unspecified , the current value is retained . * @ param resourceGroupName The name of the resource group to update . The name is case insensitive . * @ param parameters Parameters supplied to update a resource group . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ResourceGroupInner object */ public Observable < ResourceGroupInner > patchAsync ( String resourceGroupName , ResourceGroupInner parameters ) { } }
return patchWithServiceResponseAsync ( resourceGroupName , parameters ) . map ( new Func1 < ServiceResponse < ResourceGroupInner > , ResourceGroupInner > ( ) { @ Override public ResourceGroupInner call ( ServiceResponse < ResourceGroupInner > response ) { return response . body ( ) ; } } ) ;
public class BatchAppenderatorDriver { /** * Publish all segments . * @ param publisher segment publisher * @ return a { @ link ListenableFuture } for the publish task */ public ListenableFuture < SegmentsAndMetadata > publishAll ( final TransactionalSegmentPublisher publisher ) { } }
final Map < String , SegmentsForSequence > snapshot ; synchronized ( segments ) { snapshot = ImmutableMap . copyOf ( segments ) ; } return publishInBackground ( new SegmentsAndMetadata ( snapshot . values ( ) . stream ( ) . flatMap ( SegmentsForSequence :: allSegmentStateStream ) . map ( segmentWithState -> Preconditions . checkNotNull ( segmentWithState . getDataSegment ( ) , "dataSegment for segmentId[%s]" , segmentWithState . getSegmentIdentifier ( ) ) ) . collect ( Collectors . toList ( ) ) , null ) , publisher ) ;
public class IndexSelector { /** * Takes the index in the user data ( the second parameter ) and checks the component ' s type . * @ throws QTasteTestFailException if the component is not a JComboBox or a JList . */ @ Override protected void prepareActions ( ) throws QTasteTestFailException { } }
mIndex = Integer . parseInt ( mData [ 0 ] . toString ( ) ) ; if ( component instanceof JComboBox ) { JComboBox combo = ( JComboBox ) component ; if ( combo . getItemCount ( ) < mIndex ) { throw new QTasteTestFailException ( "Specified index is out of bounds" ) ; } } else if ( component instanceof JList ) { JList list = ( JList ) component ; if ( list . getModel ( ) . getSize ( ) < mIndex ) { throw new QTasteTestFailException ( "Specified index is out of bounds" ) ; } } else { throw new QTasteTestFailException ( "Unsupported component" ) ; }
public class PathParser { /** * we just have something like " foo " or " foo . bar " */ private static Path speculativeFastParsePath ( String path ) { } }
String s = ConfigImplUtil . unicodeTrim ( path ) ; if ( looksUnsafeForFastParser ( s ) ) return null ; return fastPathBuild ( null , s , s . length ( ) ) ;
public class XmlPullParserFactory { /** * Creates a new instance of a XML Pull Parser * using the currently configured factory features . * @ return A new instance of a XML Pull Parser . */ public XmlPullParser newPullParser ( ) throws XmlPullParserException { } }
final XmlPullParser pp = getParserInstance ( ) ; for ( Map . Entry < String , Boolean > entry : features . entrySet ( ) ) { // NOTE : This test is needed for compatibility reasons . We guarantee // that we only set a feature on a parser if its value is true . if ( entry . getValue ( ) ) { pp . setFeature ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return pp ;
public class ManagedClustersInner { /** * Reset Service Principal Profile of a managed cluster . * Update the service principal Profile for a managed cluster . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the managed cluster resource . * @ param parameters Parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster . * @ 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 > beginResetServicePrincipalProfileAsync ( String resourceGroupName , String resourceName , ManagedClusterServicePrincipalProfile parameters , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginResetServicePrincipalProfileWithServiceResponseAsync ( resourceGroupName , resourceName , parameters ) , serviceCallback ) ;
public class TypeUtil { /** * Get the generic arguments for a type . * @ param type the type to get arguments * @ return the generic arguments , empty if type is not parameterized */ public static Type [ ] getTypeArguments ( Type type ) { } }
if ( ! ( type instanceof ParameterizedType ) ) { return new Type [ 0 ] ; } return ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ;
public class CommerceTaxMethodUtil { /** * Returns the first commerce tax method in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce tax method , or < code > null < / code > if a matching commerce tax method could not be found */ public static CommerceTaxMethod fetchByGroupId_First ( long groupId , OrderByComparator < CommerceTaxMethod > orderByComparator ) { } }
return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ;
public class LinkedConverter { /** * For binary fields , set the current state . * @ param state The state to set this field . * @ param bDisplayOption Display changed fields if true . * @ param iMoveMode The move mode . * @ return The error code ( or NORMAL _ RETURN ) . */ public int setState ( boolean state , boolean bDisplayOption , int iMoveMode ) { } }
// Must be overidden if ( this . getNextConverter ( ) != null ) return this . getNextConverter ( ) . setState ( state , bDisplayOption , iMoveMode ) ; else return super . setState ( state , bDisplayOption , iMoveMode ) ;
public class SplitAmongBuilder { /** * Build a constraint . * @ param args the parameters of the constraint . Must be 2 non - empty set of virtual machines . * @ return the constraint */ @ Override public List < ? extends SatConstraint > buildConstraint ( BtrPlaceTree t , List < BtrpOperand > args ) { } }
if ( checkConformance ( t , args ) ) { @ SuppressWarnings ( "unchecked" ) Collection < Collection < VM > > vs = ( Collection < Collection < VM > > ) params [ 0 ] . transform ( this , t , args . get ( 0 ) ) ; @ SuppressWarnings ( "unchecked" ) Collection < Collection < Node > > ps = ( Collection < Collection < Node > > ) params [ 1 ] . transform ( this , t , args . get ( 1 ) ) ; return vs != null && ps != null ? Collections . singletonList ( new SplitAmong ( vs , ps , false ) ) : Collections . emptyList ( ) ; } return Collections . emptyList ( ) ;
public class FlowTypeUtils { /** * Given an array of record types , filter out those which do not contain exactly * the given set of fields . For example , consider this snippet : * < pre > * method f ( int x ) : * { int f } | { int g } xs = { f : x } * < / pre > * When type checking the expression < code > { f : x } < / code > the flow type checker * will attempt to determine an < i > expected < / i > record type . In order to then * determine the appropriate expected type for field initialiser expression * < code > x < / code > it filters < code > { int f } | { int g } < / code > down to just * < code > { int f } < / code > . * @ param types * @ param fields * @ param resolver * @ return */ public static Type . Record [ ] typeRecordFieldFilter ( Type . Record [ ] types , Tuple < Identifier > fields ) { } }
Type . Record [ ] result = new Type . Record [ types . length ] ; for ( int i = 0 ; i != result . length ; ++ i ) { Type . Record ith = types [ i ] ; if ( compareFields ( ith , fields ) ) { result [ i ] = ith ; } } return ArrayUtils . removeAll ( result , null ) ;
public class CollapseProperties { /** * Declares global variables to serve as aliases for the values in an object literal , optionally * removing all of the object literal ' s keys and values . * @ param alias The object literal ' s flattened name ( e . g . " a $ b $ c " ) * @ param objlit The OBJLIT node * @ param varNode The VAR node to which new global variables should be added as children * @ param nameToAddAfter The child of { @ code varNode } after which new variables should be added * ( may be null ) * @ param varParent { @ code varNode } ' s parent */ private void declareVariablesForObjLitValues ( Name objlitName , String alias , Node objlit , Node varNode , Node nameToAddAfter , Node varParent ) { } }
int arbitraryNameCounter = 0 ; boolean discardKeys = ! objlitName . shouldKeepKeys ( ) ; for ( Node key = objlit . getFirstChild ( ) , nextKey ; key != null ; key = nextKey ) { Node value = key . getFirstChild ( ) ; nextKey = key . getNext ( ) ; // A computed property , or a get or a set can not be rewritten as a VAR . We don ' t know what // properties will be generated by a spread . switch ( key . getToken ( ) ) { case GETTER_DEF : case SETTER_DEF : case COMPUTED_PROP : case SPREAD : continue ; case STRING_KEY : case MEMBER_FUNCTION_DEF : break ; default : throw new IllegalStateException ( "Unexpected child of OBJECTLIT: " + key . toStringTree ( ) ) ; } // We generate arbitrary names for keys that aren ' t valid JavaScript // identifiers , since those keys are never referenced . ( If they were , // this object literal ' s child names wouldn ' t be collapsible . ) The only // reason that we don ' t eliminate them entirely is the off chance that // their values are expressions that have side effects . boolean isJsIdentifier = ! key . isNumber ( ) && TokenStream . isJSIdentifier ( key . getString ( ) ) ; String propName = isJsIdentifier ? key . getString ( ) : String . valueOf ( ++ arbitraryNameCounter ) ; // If the name cannot be collapsed , skip it . String qName = objlitName . getFullName ( ) + '.' + propName ; Name p = nameMap . get ( qName ) ; if ( p != null && ! canCollapse ( p ) ) { continue ; } String propAlias = appendPropForAlias ( alias , propName ) ; Node refNode = null ; if ( discardKeys ) { objlit . removeChild ( key ) ; value . detach ( ) ; // Don ' t report a change here because the objlit has already been removed from the tree . } else { // Substitute a reference for the value . refNode = IR . name ( propAlias ) ; if ( key . getBooleanProp ( Node . IS_CONSTANT_NAME ) ) { refNode . putBooleanProp ( Node . IS_CONSTANT_NAME , true ) ; } key . replaceChild ( value , refNode ) ; compiler . reportChangeToEnclosingScope ( refNode ) ; } // Declare the collapsed name as a variable with the original value . Node nameNode = IR . name ( propAlias ) ; nameNode . addChildToFront ( value ) ; if ( key . getBooleanProp ( Node . IS_CONSTANT_NAME ) ) { nameNode . putBooleanProp ( Node . IS_CONSTANT_NAME , true ) ; } Node newVar = IR . var ( nameNode ) . useSourceInfoIfMissingFromForTree ( key ) ; if ( nameToAddAfter != null ) { varParent . addChildAfter ( newVar , nameToAddAfter ) ; } else { varParent . addChildBefore ( newVar , varNode ) ; } compiler . reportChangeToEnclosingScope ( newVar ) ; nameToAddAfter = newVar ; // Update the global name ' s node ancestry if it hasn ' t already been // done . ( Duplicate keys in an object literal can bring us here twice // for the same global name . ) if ( isJsIdentifier && p != null ) { if ( ! discardKeys ) { p . addAliasingGetClonedFromDeclaration ( refNode ) ; } p . updateRefNode ( p . getDeclaration ( ) , nameNode ) ; if ( value . isFunction ( ) ) { checkForHosedThisReferences ( value , key . getJSDocInfo ( ) , p ) ; } } }
public class ApiOvhIp { /** * Get this object properties * REST : GET / ip / { ip } / delegation / { target } * @ param ip [ required ] * @ param target [ required ] NS target for delegation */ public OvhReverseDelegation ip_delegation_target_GET ( String ip , String target ) throws IOException { } }
String qPath = "/ip/{ip}/delegation/{target}" ; StringBuilder sb = path ( qPath , ip , target ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhReverseDelegation . class ) ;
public class JournalNodeRpcServer { /** * register fast protocol */ public static void init ( ) { } }
try { FastProtocolRegister . register ( FastProtocolId . SERIAL_VERSION_ID_1 , QJournalProtocol . class . getMethod ( "journal" , JournalRequestInfo . class ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class AiMesh { /** * Returns the y - coordinate of a vertex position . * @ param vertex the vertex index * @ return the y coordinate */ public float getPositionY ( int vertex ) { } }
if ( ! hasPositions ( ) ) { throw new IllegalStateException ( "mesh has no positions" ) ; } checkVertexIndexBounds ( vertex ) ; return m_vertices . getFloat ( ( vertex * 3 + 1 ) * SIZEOF_FLOAT ) ;
public class JAXWSBundle { /** * Publish JAX - WS protected endpoint using Dropwizard BasicAuthentication with Dropwizard Hibernate Bundle * integration . Service is scanned for @ UnitOfWork annotations . EndpointBuilder is published relative to the CXF * servlet path . * @ param path Relative endpoint path . * @ param service Service implementation . * @ param auth BasicAuthentication implementation . * @ param sessionFactory Hibernate session factory . * @ return javax . xml . ws . Endpoint * @ deprecated Use the { @ link # publishEndpoint ( EndpointBuilder ) } publishEndpoint } method instead . */ public Endpoint publishEndpoint ( String path , Object service , BasicAuthentication auth , SessionFactory sessionFactory ) { } }
checkArgument ( service != null , "Service is null" ) ; checkArgument ( path != null , "Path is null" ) ; checkArgument ( ( path ) . trim ( ) . length ( ) > 0 , "Path is empty" ) ; return this . publishEndpoint ( new EndpointBuilder ( path , service ) . authentication ( auth ) . sessionFactory ( sessionFactory ) ) ;
public class ClientUtils { /** * Display type string from class name string . */ public static String displayType ( String className , Object value ) { } }
if ( className == null ) { return null ; } boolean array = false ; if ( className . equals ( "[J" ) ) { array = true ; if ( value == null ) { className = "unknown" ; } else if ( value instanceof boolean [ ] ) { className = "boolean" ; } else if ( value instanceof byte [ ] ) { className = "byte" ; } else if ( value instanceof char [ ] ) { className = "char" ; } else if ( value instanceof short [ ] ) { className = "short" ; } else if ( value instanceof int [ ] ) { className = "int" ; } else if ( value instanceof long [ ] ) { className = "long" ; } else if ( value instanceof float [ ] ) { className = "float" ; } else if ( value instanceof double [ ] ) { className = "double" ; } else { className = "unknown" ; } } else if ( className . startsWith ( "[L" ) ) { className = className . substring ( 2 , className . length ( ) - 1 ) ; } if ( className . startsWith ( "java.lang." ) ) { className = className . substring ( 10 ) ; } else if ( className . startsWith ( "javax.management.openmbean." ) ) { className = className . substring ( 27 ) ; } if ( array ) { return "array of " + className ; } else { return className ; }
public class AbstractObjectStore { /** * Set the identifier of the Object Store , unique within this ObjectManager . * @ param identifier the assigned objectStore identifier * @ throws ObjectManagerException */ public void setIdentifier ( int identifier ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setIdentifier" , new Object [ ] { new Integer ( identifier ) } ) ; // We can only set this once . if ( objectStoreIdentifier != IDENTIFIER_NOT_SET ) { InvalidConditionException invalidConditionException = new InvalidConditionException ( this , "objectStoreIdentifier" , Integer . toString ( objectStoreIdentifier ) + "not equal IDENTIFIER_NOT_SET" ) ; ObjectManager . ffdc . processException ( this , cclass , "setIdentifier" , invalidConditionException , "1:623:1.31" , new Object [ ] { new Integer ( objectStoreIdentifier ) } ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setIdentifier" , invalidConditionException ) ; throw invalidConditionException ; } // if ( objectStoreIdentifier ! = IDENTIFIER _ NOT _ SET ) . objectStoreIdentifier = identifier ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setIdentifier" ) ;
public class Renderer { /** * Render the supplied content to a file . * @ param content The content to renderDocument * @ throws Exception if IOException or SecurityException are raised */ public void render ( Map < String , Object > content ) throws Exception { } }
String docType = ( String ) content . get ( Crawler . Attributes . TYPE ) ; String outputFilename = config . getDestinationFolder ( ) . getPath ( ) + File . separatorChar + content . get ( Attributes . URI ) ; if ( outputFilename . lastIndexOf ( '.' ) > outputFilename . lastIndexOf ( File . separatorChar ) ) { outputFilename = outputFilename . substring ( 0 , outputFilename . lastIndexOf ( '.' ) ) ; } // delete existing versions if they exist in case status has changed either way String outputExtension = config . getOutputExtensionByDocType ( docType ) ; File draftFile = new File ( outputFilename , config . getDraftSuffix ( ) + outputExtension ) ; if ( draftFile . exists ( ) ) { draftFile . delete ( ) ; } File publishedFile = new File ( outputFilename + outputExtension ) ; if ( publishedFile . exists ( ) ) { publishedFile . delete ( ) ; } if ( content . get ( Crawler . Attributes . STATUS ) . equals ( Crawler . Attributes . Status . DRAFT ) ) { outputFilename = outputFilename + config . getDraftSuffix ( ) ; } File outputFile = new File ( outputFilename + outputExtension ) ; Map < String , Object > model = new HashMap < String , Object > ( ) ; model . put ( "content" , content ) ; model . put ( "renderer" , renderingEngine ) ; try { try ( Writer out = createWriter ( outputFile ) ) { renderingEngine . renderDocument ( model , findTemplateName ( docType ) , out ) ; } LOGGER . info ( "Rendering [{}]... done!" , outputFile ) ; } catch ( Exception e ) { LOGGER . error ( "Rendering [{}]... failed!" , outputFile , e ) ; throw new Exception ( "Failed to render file " + outputFile . getAbsolutePath ( ) + ". Cause: " + e . getMessage ( ) , e ) ; }
public class Word { /** * for debug only */ public String __toString ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( value ) ; sb . append ( '/' ) ; // append the cx if ( partspeech != null ) { for ( int j = 0 ; j < partspeech . length ; j ++ ) { if ( j == 0 ) { sb . append ( partspeech [ j ] ) ; } else { sb . append ( ',' ) ; sb . append ( partspeech [ j ] ) ; } } } else { sb . append ( "null" ) ; } sb . append ( '/' ) ; sb . append ( pinyin ) ; sb . append ( '/' ) ; if ( syn != null ) { List < IWord > synsList = syn . getList ( ) ; synchronized ( synsList ) { for ( int i = 0 ; i < synsList . size ( ) ; i ++ ) { if ( i == 0 ) { sb . append ( synsList . get ( i ) ) ; } else { sb . append ( ',' ) ; sb . append ( synsList . get ( i ) ) ; } } } } else { sb . append ( "null" ) ; } if ( value . length ( ) == 1 ) { sb . append ( '/' ) ; sb . append ( fre ) ; } if ( entity != null ) { sb . append ( '/' ) ; sb . append ( ArrayUtil . implode ( "|" , entity ) ) ; } if ( parameter != null ) { sb . append ( '/' ) ; sb . append ( parameter ) ; } return sb . toString ( ) ;
public class Box { /** * @ description * Generates a new random key pair for box and * returns it as an object with publicKey and secretKey members : */ public static KeyPair keyPair ( ) { } }
KeyPair kp = new KeyPair ( ) ; crypto_box_keypair ( kp . getPublicKey ( ) , kp . getSecretKey ( ) ) ; return kp ;