signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ListStackSetOperationsResult { /** * A list of < code > StackSetOperationSummary < / code > structures that contain summary information about operations for * the specified stack set . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSummaries ( java . util . Collection ) } or { @ link # withSummaries ( java . util . Collection ) } if you want to * override the existing values . * @ param summaries * A list of < code > StackSetOperationSummary < / code > structures that contain summary information about * operations for the specified stack set . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListStackSetOperationsResult withSummaries ( StackSetOperationSummary ... summaries ) { } }
if ( this . summaries == null ) { setSummaries ( new com . amazonaws . internal . SdkInternalList < StackSetOperationSummary > ( summaries . length ) ) ; } for ( StackSetOperationSummary ele : summaries ) { this . summaries . add ( ele ) ; } return this ;
public class MavenDependencies { /** * Creates a new { @ link MavenDependencyExclusion } instance from the specified , required arguments * @ param groupId A groupId of the new { @ link MavenDependencyExclusion } instance . * @ param artifactId An artifactId of the new { @ link MavenDependencyExclusion } instance . * @ return The new { @ link MavenDependencyExclusion } instance . * @ throws IllegalArgumentException * If either argument is not specified */ public static MavenDependencyExclusion createExclusion ( final String groupId , final String artifactId ) throws IllegalArgumentException { } }
if ( groupId == null || groupId . length ( ) == 0 ) { throw new IllegalArgumentException ( "groupId must be specified" ) ; } if ( artifactId == null || artifactId . length ( ) == 0 ) { throw new IllegalArgumentException ( "groupId must be specified" ) ; } final MavenDependencyExclusion exclusion = new MavenDependencyExclusionImpl ( groupId , artifactId ) ; return exclusion ;
public class Ui { /** * Get Background color if the attr is color value * @ param context Context * @ param attrs AttributeSet * @ return Color */ public static int getBackgroundColor ( Context context , AttributeSet attrs ) { } }
int color = Color . TRANSPARENT ; if ( isHaveAttribute ( attrs , "background" ) ) { int styleId = attrs . getStyleAttribute ( ) ; int [ ] attributesArray = new int [ ] { android . R . attr . background } ; try { TypedArray typedArray = context . obtainStyledAttributes ( styleId , attributesArray ) ; if ( typedArray . length ( ) > 0 ) color = typedArray . getColor ( 0 , color ) ; typedArray . recycle ( ) ; } catch ( Resources . NotFoundException e ) { e . printStackTrace ( ) ; } } return color ;
public class RedisClusterClient { /** * Connect asynchronously to a Redis Cluster using pub / sub connections . Use the supplied { @ link RedisCodec codec } to * encode / decode keys and values . Connecting asynchronously requires an initialized topology . Call { @ link # getPartitions ( ) } * first , otherwise the connect will fail with a { @ link IllegalStateException } . * What to expect from this connection : * < ul > * < li > A < i > default < / i > connection is created to the node with the least number of clients < / li > * < li > Pub / sub commands are sent to the node with the least number of clients < / li > * < li > Keyless commands are send to the default connection < / li > * < li > Single - key keyspace commands are routed to the appropriate node < / li > * < li > Multi - key keyspace commands require the same slot - hash and are routed to the appropriate node < / li > * < / ul > * @ param codec Use this codec to encode / decode keys and values , must not be { @ literal null } * @ param < K > Key type * @ param < V > Value type * @ return a { @ link CompletableFuture } that is notified with the connection progress . * @ since 5.1 */ @ SuppressWarnings ( "unchecked" ) public < K , V > CompletableFuture < StatefulRedisClusterPubSubConnection < K , V > > connectPubSubAsync ( RedisCodec < K , V > codec ) { } }
return transformAsyncConnectionException ( connectClusterPubSubAsync ( codec ) , getInitialUris ( ) ) ;
public class DateUtils { /** * Converts a { @ code Date } into a { @ code Calendar } . * @ param date the date to convert to a Calendar * @ return the created Calendar * @ throws NullPointerException if null is passed in * @ since 3.0 */ public static Calendar toCalendar ( final Date date ) { } }
final Calendar c = Calendar . getInstance ( ) ; c . setTime ( date ) ; return c ;
public class DFAs { /** * Calculates the complement ( negation ) of a DFA , and returns the result as a new DFA . * Note that unlike { @ link MutableDFA # flipAcceptance ( ) } , undefined transitions are treated as leading to a rejecting * sink state ( and are thus turned into an accepting sink ) . * @ param dfa * the DFA to complement * @ param inputAlphabet * the input alphabet * @ return a new DFA representing the complement of the specified DFA */ public static < I > CompactDFA < I > complement ( DFA < ? , I > dfa , Alphabet < I > inputAlphabet ) { } }
return complement ( dfa , inputAlphabet , new CompactDFA < > ( inputAlphabet ) ) ;
public class AcceptHeaders { /** * Gets the strings from a comma - separated list . * All " * " entries are replaced with { @ code null } keys . * @ param header the header value . * @ return the listed items in order of appearance or { @ code null } if the header didn ' t contain any entries . */ public static Map < String , QualityValue > getStringQualityValues ( String header ) { } }
if ( header == null ) return null ; header = header . trim ( ) ; if ( header . length ( ) == 0 ) return null ; Map < String , QualityValue > result = new LinkedHashMap < String , QualityValue > ( ) ; int offset = 0 ; while ( true ) { int endIndex = header . indexOf ( ',' , offset ) ; String content ; if ( endIndex < 0 ) content = header . substring ( offset ) ; else content = header . substring ( offset , endIndex ) ; QualityValue qualityValue = QualityValue . DEFAULT ; int qualityIndex = content . indexOf ( ';' ) ; if ( qualityIndex >= 0 ) { String parameter = content . substring ( qualityIndex + 1 ) ; content = content . substring ( 0 , qualityIndex ) ; int equalsIndex = parameter . indexOf ( '=' ) ; if ( equalsIndex < 0 ) throw new IllegalArgumentException ( "Malformed parameter: " + parameter ) ; String name = parameter . substring ( 0 , equalsIndex ) . trim ( ) ; if ( ! "q" . equals ( name ) ) throw new IllegalArgumentException ( "Unsupported parameter: " + name ) ; String value = parameter . substring ( equalsIndex + 1 ) . trim ( ) ; qualityValue = QualityValue . valueOf ( value ) ; } content = content . trim ( ) ; if ( content . length ( ) == 0 ) throw new IllegalArgumentException ( "Empty field in: " + header + "." ) ; if ( content . equals ( "*" ) ) result . put ( null , qualityValue ) ; else result . put ( content , qualityValue ) ; if ( endIndex < 0 ) break ; offset = endIndex + 1 ; } ; if ( logger . isDebugEnabled ( ) ) logger . debug ( result . toString ( ) ) ; return result ;
public class WaitQueue { /** * The calling thread MUST be the thread that uses the signal . * If the Signal is waited on , context . stop ( ) will be called when the wait times out , the Signal is signalled , * or the waiting thread is interrupted . * @ return */ public Signal register ( TimerContext context ) { } }
assert context != null ; RegisteredSignal signal = new TimedSignal ( context ) ; queue . add ( signal ) ; return signal ;
public class Constants { /** * Returns the value of the system property * { @ link SDKGlobalConfiguration # DEFAULT _ S3 _ STREAM _ BUFFER _ SIZE } as an * Integer ; or null if not set . This method exists for backward * compatibility reasons . */ public static Integer getS3StreamBufferSize ( ) { } }
String s = System . getProperty ( SDKGlobalConfiguration . DEFAULT_S3_STREAM_BUFFER_SIZE ) ; if ( s == null ) return null ; try { return Integer . valueOf ( s ) ; } catch ( Exception e ) { log . warn ( "Unable to parse buffer size override from value: " + s ) ; } return null ;
public class ClassObj { /** * This returns an ordered list of the Predicates which underly the class ' s * MethodObjs , with no duplicate elements . This is valuable because a single * predicate may be the basis for multiple MethodObjs ( getters , setters , etc . ) * @ return */ public List < KbPredicate > getMethodPredicates ( ) { } }
Set < KbPredicate > set = new HashSet < KbPredicate > ( ) ; for ( MethodObj method : getMethods ( ) ) { set . add ( method . getPredicate ( ) ) ; } List < KbPredicate > list = new ArrayList ( set ) ; Collections . sort ( list , new Comparator < KbPredicate > ( ) { @ Override public int compare ( KbPredicate o1 , KbPredicate o2 ) { if ( ( o2 == null ) || ! ( o2 instanceof KbPredicate ) ) { return 1 ; } return o1 . toString ( ) . compareTo ( o2 . toString ( ) ) ; } } ) ; return list ;
public class CertificateManager { /** * This method decodes a PKCS12 format key store from its encrypted byte stream . * @ param base64String The base 64 encoded , password encrypted PKCS12 byte stream . * @ param password The password that was used to encrypt the byte stream . * @ return The PKCS12 format key store . */ public final KeyStore decodeKeyStore ( String base64String , char [ ] password ) { } }
logger . entry ( ) ; byte [ ] bytes = Base64Utils . decode ( base64String ) ; try ( ByteArrayInputStream in = new ByteArrayInputStream ( bytes ) ) { KeyStore keyStore = KeyStore . getInstance ( KEY_STORE_FORMAT ) ; keyStore . load ( in , password ) ; logger . exit ( ) ; return keyStore ; } catch ( IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException e ) { RuntimeException exception = new RuntimeException ( "An unexpected exception occurred while attempting to decode a keystore." , e ) ; logger . error ( exception . toString ( ) ) ; throw exception ; }
public class OHCacher { /** * - - - IMPLEMENTED CACHE METHODS - - - */ @ Override public Promise get ( String key ) { } }
try { byte [ ] bytes = cache . get ( keyToBytes ( key ) ) ; if ( bytes != null ) { return Promise . resolve ( bytesToValue ( bytes ) ) ; } } catch ( Throwable cause ) { logger . warn ( "Unable to read data from off-heap cache!" , cause ) ; } return Promise . resolve ( ( Object ) null ) ;
public class FileUtil { /** * Finds a free file ( i . e non - existing ) in specified directory , using specified pattern . * for example : * findFreeFile ( myDir , " sample $ { i } . xml " , false ) * will search for free file in order : * sample1 . xml , sample2 . xml , sample3 . xml and so on * if tryEmptyVar is true , it it seaches for free file in order : * sample . xml , sample2 . xml , sample3 . xml and so on * the given pattern must have variable part $ { i } */ public static File findFreeFile ( final File dir , String pattern , boolean tryEmptyVar ) { } }
String name = StringUtil . suggest ( new Filter < String > ( ) { @ Override public boolean select ( String name ) { return ! new File ( dir , name ) . exists ( ) ; } } , pattern , tryEmptyVar ) ; return new File ( dir , name ) ;
public class BaseProxySelector { /** * { @ inheritDoc } */ @ Override public void connectFailed ( final URI uri , final SocketAddress sa , final IOException ioe ) { } }
if ( uri == null || sa == null || ioe == null ) { throw new IllegalArgumentException ( "Arguments can not be null." ) ; } final ProxyDecorator p = proxies . get ( sa ) ; if ( p != null ) { if ( p . failed ( ) >= 3 ) { proxies . remove ( sa ) ; } } else { if ( defaultSelector != null ) { defaultSelector . connectFailed ( uri , sa , ioe ) ; } }
public class ProgramHelper { /** * Calls a program and returns any output generated . * @ param response details of what to invoke ( output will be added ) . * @ param timeout maximum time ( in milliseconds ) for program execution . */ public void execute ( ProgramResponse response , int timeout ) { } }
ProcessBuilder builder = createProcessBuilder ( response ) ; invokeProgram ( builder , response , timeout ) ;
public class PrettyTimeFormat { /** * Convenience format method . * @ param ref * The date of reference . * @ param then * The future date . * @ return a relative format date as text representation */ public String format ( Date ref , Date then ) { } }
return prettyTime . format ( DurationHelper . calculateDuration ( ref , then , prettyTime . getUnits ( ) ) ) ;
public class X509CRLImpl { /** * return the DeltaCRLIndicatorExtension , if any . * @ returns DeltaCRLIndicatorExtension or null ( if no such extension ) * @ throws IOException on error */ public DeltaCRLIndicatorExtension getDeltaCRLIndicatorExtension ( ) throws IOException { } }
Object obj = getExtension ( PKIXExtensions . DeltaCRLIndicator_Id ) ; return ( DeltaCRLIndicatorExtension ) obj ;
public class QuadTree { /** * Returns the cell of this element * @ param coordinates * @ return */ protected QuadTree findIndex ( INDArray coordinates ) { } }
// Compute the sector for the coordinates boolean left = ( coordinates . getDouble ( 0 ) <= ( boundary . getX ( ) + boundary . getHw ( ) / 2 ) ) ; boolean top = ( coordinates . getDouble ( 1 ) <= ( boundary . getY ( ) + boundary . getHh ( ) / 2 ) ) ; // top left QuadTree index = getNorthWest ( ) ; if ( left ) { // left side if ( ! top ) { // bottom left index = getSouthWest ( ) ; } } else { // right side if ( top ) { // top right index = getNorthEast ( ) ; } else { // bottom right index = getSouthEast ( ) ; } } return index ;
public class JcrStorageDao { /** * TODO remove */ public DataSource [ ] getDataSources ( ) { } }
Entity [ ] entities ; try { entities = getEntitiesByClassName ( StorageConstants . DATASOURCES_ROOT , DataSource . class . getName ( ) ) ; } catch ( NotFoundException e ) { // never happening throw new RuntimeException ( e ) ; } DataSource [ ] dataSources = new DataSource [ entities . length ] ; System . arraycopy ( entities , 0 , dataSources , 0 , entities . length ) ; return dataSources ;
public class WTree { /** * Map item ids to the row index . * @ param expandedOnly include expanded only * @ return the map of item ids to their row index . */ private Map < String , List < Integer > > createItemIdIndexMap ( final boolean expandedOnly ) { } }
Map < String , List < Integer > > map = new HashMap < > ( ) ; TreeItemModel treeModel = getTreeModel ( ) ; int rows = treeModel . getRowCount ( ) ; Set < String > expanded = null ; WTree . ExpandMode mode = getExpandMode ( ) ; if ( expandedOnly ) { expanded = getExpandedRows ( ) ; if ( mode == WTree . ExpandMode . LAZY ) { expanded = new HashSet < > ( expanded ) ; expanded . addAll ( getPrevExpandedRows ( ) ) ; } } for ( int i = 0 ; i < rows ; i ++ ) { List < Integer > index = new ArrayList < > ( ) ; index . add ( i ) ; processItemIdIndexMapping ( map , index , treeModel , expanded ) ; } return Collections . unmodifiableMap ( map ) ;
public class TableSawQuandlSession { /** * Create a Quandl session with detailed SessionOptions . No attempt will be made to read the java property < em > quandl . auth . token < / em > even * if available . Note creating this object does not make any actual API requests , the token is used in subsequent requests . * @ param sessionOptions a user created SessionOptions instance , not null * @ param restDataProvider an alternative REST data provider , usually for testing or data collection , not null * @ return an instance of the Quandl session , not null */ public static TableSawQuandlSession create ( final SessionOptions sessionOptions , final TableSawRESTDataProvider restDataProvider ) { } }
ArgumentChecker . notNull ( sessionOptions , "sessionOptions" ) ; ArgumentChecker . notNull ( restDataProvider , "restDataProvider" ) ; return new TableSawQuandlSession ( sessionOptions , restDataProvider , new ClassicMetaDataPackager ( ) ) ;
public class NewJFrame { /** * Validate and set the datetime field on the screen given a date . * @ param dateTime The datetime object */ public void setDateTime ( Date dateTime ) { } }
String dateTimeString = "" ; if ( dateTime != null ) dateTimeString = dateTimeFormat . format ( dateTime ) ; jTextField4 . setText ( dateTimeString ) ;
public class Builder { /** * Add the exceptions to ignore / retry - on . * @ param exceptions retry should continue when such exceptions are thrown * @ return the Builder for chaining */ @ SafeVarargs public final Builder retryOn ( Class < ? extends Exception > ... exceptions ) { } }
for ( Class < ? extends Exception > exception : exceptions ) { retriableExceptions . add ( checkNotNull ( exception ) ) ; } return this ;
public class Attributes { /** * / * [ deutsch ] * < p > Erzeugt einen neuen Attributschl & uuml ; ssel . < / p > * @ param < A > generic immutable type of attribute value * @ param name name of attribute * @ param type type of attribute * @ return new attribute key * @ since 3.13/4.10 */ public static < A > AttributeKey < A > createKey ( String name , Class < A > type ) { } }
return PredefinedKey . valueOf ( name , type ) ;
public class MonitoringController { /** * jmxValue = x | y | z pourra aussi être utilisé par munin notamment */ private void doJmxValue ( HttpServletResponse httpResponse , String jmxValueParameter ) throws IOException { } }
httpResponse . setContentType ( "text/plain" ) ; httpResponse . getWriter ( ) . write ( MBeans . getConvertedAttributes ( jmxValueParameter ) ) ; httpResponse . flushBuffer ( ) ;
public class MDAGMap { /** * 前缀查询 * @ param key * @ return */ public LinkedList < Entry < String , V > > commonPrefixSearchWithValue ( String key ) { } }
return commonPrefixSearchWithValue ( key . toCharArray ( ) , 0 ) ;
public class AbstractJsonDeserializer { /** * Convenience method for subclasses . * @ param paramName the name of the parameter * @ param errorMessage the errormessage to add to the exception if the param does not exist . * @ param mapToUse The map to use as inputsource for parameters . Should not be null . * @ return a stringparameter with given name . If it does not exist and the errormessage is provided , * an IOException is thrown with that message . if the errormessage is not provided , null is returned . * @ throws IOException Exception if the paramname does not exist and an errormessage is provided . */ protected Boolean getBooleanParam ( String paramName , String errorMessage , Map < String , Object > mapToUse ) throws IOException { } }
Boolean result = getTypedParam ( paramName , errorMessage , Boolean . class , mapToUse ) ; if ( result == null ) { String s = getTypedParam ( paramName , errorMessage , String . class , mapToUse ) ; if ( s != null ) { return Boolean . parseBoolean ( s ) ; } } return result ;
public class SmoothieMap { /** * If the specified key is not already associated with a value ( or is mapped to { @ code null } ) , * attempts to compute its value using the given mapping function and enters it into this map * unless { @ code null } . * < p > If the function returns { @ code null } no mapping is recorded . If the function itself throws * an ( unchecked ) exception , the exception is rethrown , and no mapping is recorded . The most * common usage is to construct a new object serving as an initial mapped value or memoized * result , as in : * < pre > { @ code * map . computeIfAbsent ( key , k - > new Value ( f ( k ) ) ) ; * } < / pre > * < p > Or to implement a multi - value map , { @ code Map < K , Collection < V > > } , * supporting multiple values per key : * < pre > { @ code * map . computeIfAbsent ( key , k - > new HashSet < V > ( ) ) . add ( v ) ; * } < / pre > * @ param key key with which the specified value is to be associated * @ param mappingFunction the function to compute a value * @ return the current ( existing or computed ) value associated with * the specified key , or null if the computed value is null * @ throws NullPointerException if the mappingFunction is null */ @ Override public final V computeIfAbsent ( K key , Function < ? super K , ? extends V > mappingFunction ) { } }
if ( mappingFunction == null ) throw new NullPointerException ( ) ; long hash ; return segment ( segmentIndex ( hash = keyHashCode ( key ) ) ) . computeIfAbsent ( this , hash , key , mappingFunction ) ;
public class NodeUtil { /** * Determines whether the given name can appear on the right side of the dot operator . Many * properties ( like reserved words ) cannot , in ES3. */ static boolean isValidPropertyName ( FeatureSet mode , String name ) { } }
if ( isValidSimpleName ( name ) ) { return true ; } else { return mode . has ( Feature . KEYWORDS_AS_PROPERTIES ) && TokenStream . isKeyword ( name ) ; }
public class XMLUtil { /** * Write an enumeration value . * @ param < T > is the type of the enumeration . * @ param document is the XML document to explore . * @ param type is the type of the enumeration . * @ param value is the value to put in the document . * @ param path is the list of and ended by the attribute ' s name . * @ return < code > true < / code > if written , < code > false < / code > if not written . */ public static < T extends Enum < T > > boolean setAttributeEnum ( Node document , Class < T > type , T value , String ... path ) { } }
assert document != null : AssertMessages . notNullParameter ( 0 ) ; return setAttributeEnum ( document , type , true , value , path ) ;
public class RpcProtocolVersionsUtil { /** * Returns true if first Rpc Protocol Version is greater than or equal to the second one . Returns * false otherwise . */ @ VisibleForTesting static boolean isGreaterThanOrEqualTo ( Version first , Version second ) { } }
if ( ( first . getMajor ( ) > second . getMajor ( ) ) || ( first . getMajor ( ) == second . getMajor ( ) && first . getMinor ( ) >= second . getMinor ( ) ) ) { return true ; } return false ;
public class ThreadPoolJobManager { /** * Called by spring after constructing the java bean . */ @ PostConstruct public final void init ( ) { } }
long timeToKeepAfterAccessInMillis = this . jobQueue . getTimeToKeepAfterAccessInMillis ( ) ; if ( timeToKeepAfterAccessInMillis >= 0 ) { if ( TimeUnit . SECONDS . toMillis ( this . abandonedTimeout ) >= this . jobQueue . getTimeToKeepAfterAccessInMillis ( ) ) { final String msg = String . format ( "%s abandonTimeout must be smaller than %s timeToKeepAfterAccess" , getClass ( ) . getName ( ) , this . jobQueue . getClass ( ) . getName ( ) ) ; throw new IllegalStateException ( msg ) ; } if ( TimeUnit . SECONDS . toMillis ( this . timeout ) >= this . jobQueue . getTimeToKeepAfterAccessInMillis ( ) ) { final String msg = String . format ( "%s timeout must be smaller than %s timeToKeepAfterAccess" , getClass ( ) . getName ( ) , this . jobQueue . getClass ( ) . getName ( ) ) ; throw new IllegalStateException ( msg ) ; } } CustomizableThreadFactory threadFactory = new CustomizableThreadFactory ( ) ; threadFactory . setDaemon ( true ) ; threadFactory . setThreadNamePrefix ( "PrintJobManager-" ) ; PriorityBlockingQueue < Runnable > queue = new PriorityBlockingQueue < > ( this . maxNumberOfWaitingJobs , ( o1 , o2 ) -> { if ( o1 instanceof JobFutureTask < ? > && o2 instanceof JobFutureTask < ? > ) { Callable < ? > callable1 = ( ( JobFutureTask < ? > ) o1 ) . getCallable ( ) ; Callable < ? > callable2 = ( ( JobFutureTask < ? > ) o2 ) . getCallable ( ) ; if ( callable1 instanceof PrintJob ) { if ( callable2 instanceof PrintJob ) { return ThreadPoolJobManager . this . jobPriorityComparator . compare ( ( PrintJob ) callable1 , ( PrintJob ) callable2 ) ; } return 1 ; } else if ( callable2 instanceof PrintJob ) { return - 1 ; } } return 0 ; } ) ; /* The ThreadPoolExecutor uses a unbounded queue ( though we are enforcing a limit in ` submit ( ) ` ) . * Because of that , the executor creates only ` corePoolSize ` threads . But to use all threads , * we set both ` corePoolSize ` and ` maximumPoolSize ` to ` maxNumberOfRunningPrintJobs ` . As a * consequence , the ` maxIdleTime ` will be ignored , idle threads will not be terminated . */ this . executor = new ThreadPoolExecutor ( this . maxNumberOfRunningPrintJobs , this . maxNumberOfRunningPrintJobs , this . maxIdleTime , TimeUnit . SECONDS , queue , threadFactory ) { @ Override protected < T > RunnableFuture < T > newTaskFor ( final Callable < T > callable ) { return new JobFutureTask < > ( callable ) ; } @ Override protected void beforeExecute ( final Thread t , final Runnable runnable ) { if ( ! ThreadPoolJobManager . this . clustered && runnable instanceof JobFutureTask < ? > ) { JobFutureTask < ? > task = ( JobFutureTask < ? > ) runnable ; if ( task . getCallable ( ) instanceof PrintJob ) { PrintJob printJob = ( PrintJob ) task . getCallable ( ) ; try { ThreadPoolJobManager . this . jobQueue . start ( printJob . getEntry ( ) . getReferenceId ( ) ) ; } catch ( RuntimeException e ) { LOGGER . error ( "failed to mark job as running" , e ) ; } catch ( NoSuchReferenceException e ) { LOGGER . error ( "tried to mark non-existing job as 'running': {}" , printJob . getEntry ( ) . getReferenceId ( ) , e ) ; } } } super . beforeExecute ( t , runnable ) ; } } ; this . timer = Executors . newScheduledThreadPool ( 1 , timerTask -> { final Thread thread = new Thread ( timerTask , "Post result to registry" ) ; thread . setDaemon ( true ) ; return thread ; } ) ; this . timer . scheduleAtFixedRate ( new RegistryTask ( ) , RegistryTask . CHECK_INTERVAL , RegistryTask . CHECK_INTERVAL , TimeUnit . MILLISECONDS ) ; if ( this . oldFileCleanUp ) { this . cleanUpTimer = Executors . newScheduledThreadPool ( 1 , timerTask -> { final Thread thread = new Thread ( timerTask , "Clean up old files" ) ; thread . setDaemon ( true ) ; return thread ; } ) ; this . cleanUpTimer . scheduleAtFixedRate ( this . workingDirectories . getCleanUpTask ( ) , 0 , this . oldFileCleanupInterval , TimeUnit . SECONDS ) ; }
public class HttpInputStream { /** * Returns the number of bytes that can be read without blocking . * @ return the number of available bytes * @ exception IOException if an I / O error has occurred */ public int available ( ) throws IOException { } }
// PK79219 start long longLeft = limit - total ; if ( longLeft > Integer . MAX_VALUE ) return ( ( count - pos ) + in . available ( ) ) ; else return Math . min ( ( count - pos ) + in . available ( ) , ( int ) longLeft ) ; // PK79219 end
public class Beta { /** * Inverse of regularized incomplete beta function . */ public static double inverseRegularizedIncompleteBetaFunction ( double alpha , double beta , double p ) { } }
final double EPS = 1.0E-8 ; double pp , t , u , err , x , al , h , w , afac ; double a1 = alpha - 1. ; double b1 = beta - 1. ; if ( p <= 0.0 ) { return 0.0 ; } if ( p >= 1.0 ) { return 1.0 ; } if ( alpha >= 1. && beta >= 1. ) { pp = ( p < 0.5 ) ? p : 1. - p ; t = Math . sqrt ( - 2. * Math . log ( pp ) ) ; x = ( 2.30753 + t * 0.27061 ) / ( 1. + t * ( 0.99229 + t * 0.04481 ) ) - t ; if ( p < 0.5 ) { x = - x ; } al = ( x * x - 3. ) / 6. ; h = 2. / ( 1. / ( 2. * alpha - 1. ) + 1. / ( 2. * beta - 1. ) ) ; w = ( x * Math . sqrt ( al + h ) / h ) - ( 1. / ( 2. * beta - 1 ) - 1. / ( 2. * alpha - 1. ) ) * ( al + 5. / 6. - 2. / ( 3. * h ) ) ; x = alpha / ( alpha + beta * Math . exp ( 2. * w ) ) ; } else { double lna = Math . log ( alpha / ( alpha + beta ) ) ; double lnb = Math . log ( beta / ( alpha + beta ) ) ; t = Math . exp ( alpha * lna ) / alpha ; u = Math . exp ( beta * lnb ) / beta ; w = t + u ; if ( p < t / w ) { x = Math . pow ( alpha * w * p , 1. / alpha ) ; } else { x = 1. - Math . pow ( beta * w * ( 1. - p ) , 1. / beta ) ; } } afac = - Gamma . lgamma ( alpha ) - Gamma . lgamma ( beta ) + Gamma . lgamma ( alpha + beta ) ; for ( int j = 0 ; j < 10 ; j ++ ) { if ( x == 0. || x == 1. ) { return x ; } err = regularizedIncompleteBetaFunction ( alpha , beta , x ) - p ; t = Math . exp ( a1 * Math . log ( x ) + b1 * Math . log ( 1. - x ) + afac ) ; u = err / t ; x -= ( t = u / ( 1. - 0.5 * Math . min ( 1. , u * ( a1 / x - b1 / ( 1. - x ) ) ) ) ) ; if ( x <= 0. ) { x = 0.5 * ( x + t ) ; } if ( x >= 1. ) { x = 0.5 * ( x + t + 1. ) ; } if ( Math . abs ( t ) < EPS * x && j > 0 ) { break ; } } return x ;
public class RestUriVariablesFactory { /** * Returns the uri variables needed for a " query " request * @ param entityInfo * @ param where * @ param fieldSet * @ param params * @ return all uriVariables needed for the api call */ public Map < String , String > getUriVariablesForQuery ( BullhornEntityInfo entityInfo , String where , Set < String > fieldSet , QueryParams params ) { } }
Map < String , String > uriVariables = params . getParameterMap ( ) ; this . addCommonUriVariables ( fieldSet , entityInfo , uriVariables ) ; uriVariables . put ( WHERE , where ) ; return uriVariables ;
public class StatsValues { /** * Helper method to parse string representation * of value item to number or boolean type * @ param value string representation of value item * @ return parsed value item */ private Object parseValue ( String value ) { } }
// Try to parse value as number try { return Double . valueOf ( value ) ; } catch ( NumberFormatException ignored ) { } if ( value . equals ( "true" ) || value . equals ( "false" ) ) return Boolean . valueOf ( value ) ; throw new IllegalArgumentException ( "Only number or boolean stats values allowed" ) ;
public class HealthPinger { /** * Helper method to perform the proper health conversion . * @ param input the response input * @ return the converted output . */ private static Observable < PingServiceHealth > mapToServiceHealth ( final String scope , final ServiceType type , final Observable < ? extends CouchbaseResponse > input , final AtomicReference < CouchbaseRequest > request , final long timeout , final TimeUnit timeUnit ) { } }
return input . map ( new Func1 < CouchbaseResponse , PingServiceHealth > ( ) { @ Override public PingServiceHealth call ( CouchbaseResponse response ) { DiagnosticRequest request = ( DiagnosticRequest ) response . request ( ) ; String id = "0x" + Integer . toHexString ( request . localSocket ( ) . hashCode ( ) ) ; return new PingServiceHealth ( type , PingServiceHealth . PingState . OK , id , TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - response . request ( ) . creationTime ( ) ) , request . localSocket ( ) , request . remoteSocket ( ) , scope ) ; } } ) . onErrorReturn ( new Func1 < Throwable , PingServiceHealth > ( ) { @ Override public PingServiceHealth call ( Throwable throwable ) { SocketAddress local = ( ( DiagnosticRequest ) request . get ( ) ) . localSocket ( ) ; SocketAddress remote = ( ( DiagnosticRequest ) request . get ( ) ) . remoteSocket ( ) ; String id = local == null ? "0x0000" : "0x" + Integer . toHexString ( local . hashCode ( ) ) ; if ( throwable instanceof TimeoutException ) { return new PingServiceHealth ( type , PingServiceHealth . PingState . TIMEOUT , id , timeUnit . toMicros ( timeout ) , local , remote , scope ) ; } else { LOGGER . warn ( "Error while running PingService for {}" , type , throwable ) ; return new PingServiceHealth ( type , PingServiceHealth . PingState . ERROR , id , TimeUnit . NANOSECONDS . toMicros ( System . nanoTime ( ) - request . get ( ) . creationTime ( ) ) , local , remote , scope ) ; } } } ) ;
public class GoogleGeoCoder { /** * { @ inheritDoc } */ @ Override public GeocodingResult [ ] geocode ( final String placeName ) { } }
logger . debug ( "Querying Google APIs for place: " + placeName ) ; final GeoApiContext context = new GeoApiContext . Builder ( ) . apiKey ( key ) . build ( ) ; GeocodingResult [ ] results ; try { results = GeocodingApi . geocode ( context , placeName ) . await ( ) ; } catch ( Exception e ) { logger . error ( "Problem querying the place: " + placeName , e ) ; results = new GeocodingResult [ 0 ] ; } return results ;
public class YarnRegistryViewForProviders { /** * Get the absolute path to where the service has registered itself . * This includes the base registry path * Null until the service is registered * @ return the service registration path . */ public String getAbsoluteSelfRegistrationPath ( ) { } }
if ( selfRegistrationPath == null ) { return null ; } String root = registryOperations . getConfig ( ) . getTrimmed ( RegistryConstants . KEY_REGISTRY_ZK_ROOT , RegistryConstants . DEFAULT_ZK_REGISTRY_ROOT ) ; return RegistryPathUtils . join ( root , selfRegistrationPath ) ;
public class Util { /** * Join several objects into a string */ static < T > String join ( Iterable < T > elems , String delim ) { } }
if ( elems == null ) return "" ; StringBuilder result = new StringBuilder ( ) ; for ( T elem : elems ) result . append ( elem ) . append ( delim ) ; if ( result . length ( ) > 0 ) result . setLength ( result . length ( ) - delim . length ( ) ) ; return result . toString ( ) ;
public class ModuleAssets { /** * Process an Asset . * @ param asset Asset * @ param locale Locale * @ return integer representing the success ( 204 = no content ) of processing * @ throws IllegalArgumentException if asset is null . * @ throws IllegalArgumentException if asset has no id . * @ throws IllegalArgumentException if asset has no space . * @ throws IllegalArgumentException if locale is null . */ public Integer process ( CMAAsset asset , String locale ) { } }
assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . process ( spaceId , environmentId , assetId , locale ) . blockingFirst ( ) . code ( ) ;
public class AbstractFedoraBinary { /** * ( non - Javadoc ) * @ see org . fcrepo . kernel . api . models . FedoraBinary # setProxyURL ( ) */ @ Override public void setProxyURL ( final String url ) throws RepositoryRuntimeException { } }
try { getNode ( ) . setProperty ( PROXY_FOR , url ) ; // clear redirect property , in case it used to be a redirect getNode ( ) . setProperty ( REDIRECTS_TO , ( Value ) null ) ; } catch ( final RepositoryException e ) { throw new RepositoryRuntimeException ( e ) ; }
public class Datatype_Builder { /** * Replaces the value to be returned by { @ link Datatype # getHasToBuilderMethod ( ) } by applying * { @ code mapper } to it and using the result . * @ return this { @ code Builder } object * @ throws NullPointerException if { @ code mapper } is null or returns null * @ throws IllegalStateException if the field has not been set */ public Datatype . Builder mapHasToBuilderMethod ( UnaryOperator < Boolean > mapper ) { } }
Objects . requireNonNull ( mapper ) ; return setHasToBuilderMethod ( mapper . apply ( getHasToBuilderMethod ( ) ) ) ;
public class ProxyBranchImpl { /** * Call this method when a subsequent request must be proxied through the branch . * @ param request */ public void proxySubsequentRequest ( MobicentsSipServletRequest sipServletRequest ) { } }
SipServletRequestImpl request = ( SipServletRequestImpl ) sipServletRequest ; MobicentsSipServletResponse lastFinalResponse = ( MobicentsSipServletResponse ) request . getLastFinalResponse ( ) ; if ( lastFinalResponse != null && lastFinalResponse . isMessageSent ( ) ) { // https : / / code . google . com / p / sipservlets / issues / detail ? id = 21 if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Not proxying request as final response has already been sent for " + request ) ; } return ; } addTransaction ( request ) ; // A re - INVITE needs special handling without going through the dialog - stateful methods if ( request . getMethod ( ) . equalsIgnoreCase ( "INVITE" ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Proxying reinvite request " + request ) ; } proxyDialogStateless ( request ) ; return ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Proxying subsequent request " + request ) ; } // Update the last proxied request request . setRoutingState ( RoutingState . PROXIED ) ; if ( ! request . getMethod ( ) . equalsIgnoreCase ( Request . ACK ) ) { proxy . setOriginalRequest ( request ) ; this . originalRequest = request ; } // No proxy params , sine the target is already in the Route headers // final ProxyParams params = new ProxyParams ( null , null , null , null ) ; Request clonedRequest = null ; if ( request . getMethod ( ) . equalsIgnoreCase ( Request . NOTIFY ) || request . getMethod ( ) . equalsIgnoreCase ( Request . SUBSCRIBE ) ) { // https : / / github . com / RestComm / sip - servlets / issues / 121 http : / / tools . ietf . org / html / rfc6665 # section - 4.3 clonedRequest = ProxyUtils . createProxiedRequest ( request , this , null , outboundInterface , recordRouteURI , null ) ; } else { clonedRequest = ProxyUtils . createProxiedRequest ( request , this , null , null , null , null ) ; } // There is no need for that , it makes application composition fail ( The subsequent request is not dispatched to the next application since the route header is removed ) // RouteHeader routeHeader = ( RouteHeader ) clonedRequest . getHeader ( RouteHeader . NAME ) ; // if ( routeHeader ! = null ) { // if ( ! ( ( SipApplicationDispatcherImpl ) proxy . getSipFactoryImpl ( ) . getSipApplicationDispatcher ( ) ) . isRouteExternal ( routeHeader ) ) { // clonedRequest . removeFirst ( RouteHeader . NAME ) ; // https : / / telestax . atlassian . net / browse / MSS - 153 perf optimization : we update the timer only on non ACK if ( ! clonedRequest . getMethod ( ) . equalsIgnoreCase ( Request . ACK ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "proxySubsequentRequest - calling updateTimer - request " + request ) ; } updateTimer ( false , request . getSipApplicationSession ( false ) ) ; } try { // Reset the proxy supervised state to default Chapter 6.2.1 - page down list bullet number 6 proxy . setSupervised ( true ) ; if ( clonedRequest . getMethod ( ) . equalsIgnoreCase ( Request . ACK ) ) { // | | clonedRequest . getMethod ( ) . equalsIgnoreCase ( Request . PRACK ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "proxySubsequentRequest - clonedRequest is ACK - request " + request ) ; } // we mark them as accessed so that HA replication can occur final MobicentsSipSession sipSession = request . getSipSession ( ) ; final MobicentsSipApplicationSession sipApplicationSession = sipSession . getSipApplicationSession ( ) ; sipSession . access ( ) ; if ( sipApplicationSession != null ) { sipApplicationSession . access ( ) ; } final String transport = JainSipUtils . findTransport ( clonedRequest ) ; SipFactoryImpl sipFactoryImpl = proxy . getSipFactoryImpl ( ) ; SipNetworkInterfaceManager sipNetworkInterfaceManager = sipFactoryImpl . getSipNetworkInterfaceManager ( ) ; final SipProvider sipProvider = sipNetworkInterfaceManager . findMatchingListeningPoint ( transport , false ) . getSipProvider ( ) ; SipConnector sipConnector = StaticServiceHolder . sipStandardService . findSipConnector ( transport ) ; // Optimizing the routing for AR ( if any ) if ( sipConnector . isUseStaticAddress ( ) ) { JainSipUtils . optimizeRouteHeaderAddressForInternalRoutingrequest ( sipConnector , clonedRequest , sipSession , sipFactoryImpl , transport ) ; try { JainSipUtils . optimizeViaHeaderAddressForStaticAddress ( sipConnector , clonedRequest , sipFactoryImpl , transport ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } try { RFC5626Helper . checkRequest ( this , clonedRequest , originalRequest ) ; } catch ( IncorrectFlowIdentifierException e1 ) { logger . warn ( e1 . getMessage ( ) ) ; this . cancel ( ) ; return ; } sipProvider . sendRequest ( clonedRequest ) ; sipFactoryImpl . getSipApplicationDispatcher ( ) . updateRequestsStatistics ( clonedRequest , false ) ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "proxySubsequentRequest - calling forwardRequest - request " + request ) ; } forwardRequest ( clonedRequest , true ) ; } } catch ( SipException e ) { logger . error ( "A problem occured while proxying a subsequent request" , e ) ; }
public class AddOnWrapper { /** * Sets the issues that the wrapped add - on or its extensions might have that prevent them from being run . * The contents should be in HTML . * @ param runningIssues the running issues of the add - on or its extensions , empty if there ' s no issues . * @ param addOnIssues { @ code true } if the issues are caused by the add - on , { @ code false } if are caused by the extensions * @ since 2.4.0 * @ see # getRunningIssues ( ) */ public void setRunningIssues ( String runningIssues , boolean addOnIssues ) { } }
Validate . notNull ( runningIssues , "Parameter runningIssues must not be null." ) ; this . runningIssues = runningIssues ; this . addOnRunningIssues = addOnIssues ;
public class WaiterList { /** * Adds waiter to queue and waits until releaseAll method call or thread is * interrupted . * @ param waiter * @ return */ public Reason wait ( T waiter ) { } }
return wait ( waiter , Long . MAX_VALUE , TimeUnit . MILLISECONDS ) ;
public class JarDiffHandler { /** * so it can be used to generate jardiff */ private String getRealPath ( String path ) throws IOException { } }
URL fileURL = _servletContext . getResource ( path ) ; File tempDir = ( File ) _servletContext . getAttribute ( "javax.servlet.context.tempdir" ) ; // download file into temp dir if ( fileURL != null ) { File newFile = File . createTempFile ( "temp" , ".jar" , tempDir ) ; if ( download ( fileURL , newFile ) ) { String filePath = newFile . getPath ( ) ; return filePath ; } } return null ;
public class ConditionEvaluationReport { /** * Attempt to find the { @ link ConditionEvaluationReport } for the specified bean * factory . * @ param beanFactory the bean factory ( may be { @ code null } ) * @ return the { @ link ConditionEvaluationReport } or { @ code null } */ public static ConditionEvaluationReport find ( BeanFactory beanFactory ) { } }
if ( beanFactory != null && beanFactory instanceof ConfigurableBeanFactory ) { return ConditionEvaluationReport . get ( ( ConfigurableListableBeanFactory ) beanFactory ) ; } return null ;
public class InChITautomerGenerator { /** * Public method to get tautomers for an input molecule , based on the InChI which will be calculated by JNI - InChI . * @ param mol molecule for which to generate tautomers * @ return a list of tautomers , if any * @ throws CDKException * @ throws CloneNotSupportedException */ public List < IAtomContainer > getTautomers ( IAtomContainer mol ) throws CDKException , CloneNotSupportedException { } }
String opt = "" ; if ( ( flags & KETO_ENOL ) != 0 ) opt += " -KET" ; if ( ( flags & ONE_FIVE_SHIFT ) != 0 ) opt += " -15T" ; InChIGenerator gen = InChIGeneratorFactory . getInstance ( ) . getInChIGenerator ( mol , opt ) ; String inchi = gen . getInchi ( ) ; String aux = gen . getAuxInfo ( ) ; long [ ] amap = new long [ mol . getAtomCount ( ) ] ; InChINumbersTools . parseAuxInfo ( aux , amap ) ; if ( inchi == null ) throw new CDKException ( InChIGenerator . class + " failed to create an InChI for the provided molecule, InChI -> null." ) ; return getTautomers ( mol , inchi , amap ) ;
public class AuthyClientInstance { /** * Gets or create user . * @ param principal the principal * @ return the or create user */ @ SneakyThrows public User getOrCreateUser ( final Principal principal ) { } }
val attributes = principal . getAttributes ( ) ; if ( ! attributes . containsKey ( this . mailAttribute ) ) { throw new IllegalArgumentException ( "No email address found for " + principal . getId ( ) ) ; } if ( ! attributes . containsKey ( this . phoneAttribute ) ) { throw new IllegalArgumentException ( "No phone number found for " + principal . getId ( ) ) ; } val email = attributes . get ( this . mailAttribute ) . get ( 0 ) . toString ( ) ; val phone = attributes . get ( this . phoneAttribute ) . get ( 0 ) . toString ( ) ; return this . authyUsers . createUser ( email , phone , this . countryCode ) ;
public class IfmapJ { /** * Create a new { @ link SSRC } object to operate on the given configuration * using basic authentication . * @ param config * the configuration parameter for the new SSRC * @ return a new { @ link SSRC } that uses basic authentication * @ throws InitializationException * if the SSRC initialization fails */ public static SSRC createSsrc ( BasicAuthConfig config ) throws InitializationException { } }
TrustManager [ ] trustManagers = IfmapJHelper . getTrustManagers ( config . trustStorePath , config . trustStorePassword ) ; SSRC ssrc = new SsrcImpl ( config . url , config . username , config . password , trustManagers , config . initialConnectionTimeout ) ; if ( config . threadSafe ) { return new ThreadSafeSsrc ( ssrc ) ; } else { return ssrc ; }
public class AbstractClient { /** * Tries to execute an RPC defined as a { @ link RpcCallable } . Metrics will be recorded based on * the provided rpc name . * If a { @ link UnavailableException } occurs , a reconnection will be tried through * { @ link # connect ( ) } and the action will be re - executed . * @ param rpc the RPC call to be executed * @ param rpcName the human readable name of the RPC call * @ param < V > type of return value of the RPC call * @ return the return value of the RPC call */ protected synchronized < V > V retryRPC ( RpcCallable < V > rpc , String rpcName ) throws AlluxioStatusException { } }
try ( Timer . Context ctx = MetricsSystem . timer ( getQualifiedMetricName ( rpcName ) ) . time ( ) ) { return retryRPCInternal ( rpc , ( ) -> { MetricsSystem . counter ( getQualifiedRetryMetricName ( rpcName ) ) . inc ( ) ; return null ; } ) ; } catch ( Exception e ) { MetricsSystem . counter ( getQualifiedFailureMetricName ( rpcName ) ) . inc ( ) ; throw e ; }
public class WSRdbSpiLocalTransactionImpl { /** * Rollback a local transaction * @ exception ResourceException - Possible causes for this exception are : * 1 ) if there is no transaction active that can be rolledback * 2 ) rollback was called from an invalid transaction state */ public void rollback ( ) throws ResourceException { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "rollback" , ivMC ) ; // if the MC marked Stale , it means the user requested a purge pool with an immediate option // so don ' t allow any work on the mc if ( ivMC . _mcStale ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "MC is stale" ) ; throw new DataStoreAdapterException ( "INVALID_CONNECTION" , AdapterUtil . staleX ( ) , WSRdbSpiLocalTransactionImpl . class ) ; } if ( ! ivMC . isTransactional ( ) ) { // do nothing if no enlistment if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "rollback" , "no-op. Enlistment disabled" ) ; return ; } ResourceException re ; if ( tc . isDebugEnabled ( ) ) { String cId = null ; try { cId = ivMC . mcf . getCorrelator ( ivMC ) ; } catch ( SQLException x ) { // will just log the exception here and ignore it since its in trace Tr . debug ( tc , "got an exception trying to get the correlator, exception is: " , x ) ; } if ( cId != null ) { StringBuffer stbuf = new StringBuffer ( 200 ) ; stbuf . append ( "Correlator: DB2, ID: " ) ; stbuf . append ( cId ) ; stbuf . append ( " Transaction : " ) ; stbuf . append ( this ) ; stbuf . append ( "ROLLBACK" ) ; Tr . debug ( this , tc , stbuf . toString ( ) ) ; } } re = ivStateManager . isValid ( WSStateManager . LT_ROLLBACK ) ; if ( re == null ) try { // If no work was done during the transaction , the autoCommit value may still // be on . In this case , just no - op , since some drivers like ConnectJDBC 3.1 // don ' t allow commit / rollback when autoCommit is on . // here the autocommit is always false , so we can call commit . ivConnection . rollback ( ) ; // Note this exception is not caught - This is because // 1 ) it is of type ResourceException so it can be thrown from the method // 2 ) if isValid is okay , this should never fail . If isValid is not okay // an exception is thrown from there // Already validated the state in this sync block , so just set it . ivStateManager . transtate = WSStateManager . NO_TRANSACTION_ACTIVE ; } catch ( SQLException se ) { if ( ! ivMC . isAborted ( ) ) FFDCFilter . processException ( se , getClass ( ) . getName ( ) , "192" , this ) ; ResourceException resX = AdapterUtil . translateSQLException ( se , ivMC , true , currClass ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "rollback" , "Exception" ) ; throw resX ; } else { // state change was not valid LocalTransactionException local_tran_excep = new LocalTransactionException ( re . getMessage ( ) ) ; DataStoreAdapterException dsae = new DataStoreAdapterException ( "WS_INTERNAL_ERROR" , local_tran_excep , currClass , "Cannot rollback SPI local transaction." , "" , local_tran_excep . getMessage ( ) ) ; // Use FFDC to log the possible components list . FFDCFilter . processException ( dsae , "com.ibm.ws.rsadapter.spi.WSRdbSpiLocalTransactionImpl.rollback" , "291" , this , new Object [ ] { " Possible components: WebSphere J2C Implementation" } ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "rollback" , "Exception" ) ; throw dsae ; } // Reset so we can deferred enlist in a future global transaction . ivMC . wasLazilyEnlistedInGlobalTran = false ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "SpiLocalTransaction rolled back. ManagedConnection state is " + ivMC . getTransactionStateAsString ( ) ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "rollback" ) ;
public class SentryAppender { /** * Transforms a { @ link Level } into an { @ link Event . Level } . * @ param level original level as defined in logback . * @ return log level used within sentry . */ protected static Event . Level formatLevel ( Level level ) { } }
if ( level . isGreaterOrEqual ( Level . ERROR ) ) { return Event . Level . ERROR ; } else if ( level . isGreaterOrEqual ( Level . WARN ) ) { return Event . Level . WARNING ; } else if ( level . isGreaterOrEqual ( Level . INFO ) ) { return Event . Level . INFO ; } else if ( level . isGreaterOrEqual ( Level . ALL ) ) { return Event . Level . DEBUG ; } else { return null ; }
public class TypedValue { /** * Get UTF - 8 byte array from int . The given byte array yields a string * representation if read with parseString ( ) . * @ param mValue * Int to encode as UTF - 8 byte array . * @ return UTF - 8 - encoded byte array of int . */ public static byte [ ] getBytes ( final int mValue ) { } }
final byte [ ] tmpBytes = new byte [ 5 ] ; int position = 0 ; tmpBytes [ position ++ ] = ( byte ) ( mValue ) ; if ( mValue > 63 || mValue < - 64 ) { tmpBytes [ position - 1 ] |= 128 ; tmpBytes [ position ++ ] = ( byte ) ( mValue >> 7 ) ; if ( mValue > 8191 || mValue < - 8192 ) { tmpBytes [ position - 1 ] |= 128 ; tmpBytes [ position ++ ] = ( byte ) ( mValue >> 14 ) ; if ( mValue > 1048575 || mValue < - 1048576 ) { tmpBytes [ position - 1 ] |= 128 ; tmpBytes [ position ++ ] = ( byte ) ( mValue >> 21 ) ; if ( mValue > 268435455 || mValue < - 268435456 ) { tmpBytes [ position - 1 ] |= 128 ; tmpBytes [ position ++ ] = ( byte ) ( mValue >> 28 ) ; } else { tmpBytes [ position - 1 ] &= 127 ; } } else { tmpBytes [ position - 1 ] &= 127 ; } } else { tmpBytes [ position - 1 ] &= 127 ; } } else { tmpBytes [ position - 1 ] &= 127 ; } final byte [ ] bytes = new byte [ position ] ; System . arraycopy ( tmpBytes , 0 , bytes , 0 , position ) ; return bytes ;
public class CmsSiteManagerImpl { /** * Checks whether a given root path is a site root . < p > * @ param rootPath a root path * @ return true if the given path is the path of a site root */ public boolean isSiteRoot ( String rootPath ) { } }
String siteRoot = getSiteRoot ( rootPath ) ; rootPath = CmsStringUtil . joinPaths ( rootPath , "/" ) ; return rootPath . equals ( siteRoot ) ;
public class MutableRoaringBitmap { /** * If present remove the specified integers ( effectively , sets its bit value to false ) * @ param x integer value representing the index in a bitmap */ @ Override public void remove ( final int x ) { } }
final short hb = BufferUtil . highbits ( x ) ; final int i = highLowContainer . getIndex ( hb ) ; if ( i < 0 ) { return ; } getMappeableRoaringArray ( ) . setContainerAtIndex ( i , highLowContainer . getContainerAtIndex ( i ) . remove ( BufferUtil . lowbits ( x ) ) ) ; if ( highLowContainer . getContainerAtIndex ( i ) . isEmpty ( ) ) { getMappeableRoaringArray ( ) . removeAtIndex ( i ) ; }
public class ChartComputator { /** * Translates chart value into raw pixel value . Returned value is absolute pixel X coordinate . If this method * return * 0 that means left most pixel of the screen . */ public float computeRawX ( float valueX ) { } }
// TODO : ( contentRectMinusAllMargins . width ( ) / currentViewport . width ( ) ) can be recalculated only when viewport // change . final float pixelOffset = ( valueX - currentViewport . left ) * ( contentRectMinusAllMargins . width ( ) / currentViewport . width ( ) ) ; return contentRectMinusAllMargins . left + pixelOffset ;
public class MessagingContext { /** * Builds a list of messaging contexts . * @ param domain the domain * @ param applicationName the name of the agent ' s application * @ param instance the current instance * @ param thoseThat whether we target " those that import " or " those that export " * @ return a non - null list */ public static Collection < MessagingContext > forImportedVariables ( String domain , String applicationName , Instance instance , ThoseThat thoseThat ) { } }
Map < String , MessagingContext > result = new HashMap < > ( ) ; for ( ImportedVariable var : ComponentHelpers . findAllImportedVariables ( instance . getComponent ( ) ) . values ( ) ) { String componentOrApplicationTemplateName = VariableHelpers . parseVariableName ( var . getName ( ) ) . getKey ( ) ; if ( result . containsKey ( componentOrApplicationTemplateName ) ) continue ; // When we import a variable , it is either internal or external , but not both ! RecipientKind kind = var . isExternal ( ) ? RecipientKind . INTER_APP : RecipientKind . AGENTS ; MessagingContext ctx = new MessagingContext ( kind , domain , componentOrApplicationTemplateName , thoseThat , applicationName ) ; result . put ( componentOrApplicationTemplateName , ctx ) ; } return result . values ( ) ;
public class JSONUtil { /** * JSON字符串转为实体类对象 , 转换异常将被抛出 * @ param < T > Bean类型 * @ param jsonString JSON字符串 * @ param beanType 实体类对象类型 * @ return 实体类对象 * @ since 4.3.2 */ public static < T > T toBean ( String jsonString , Type beanType , boolean ignoreError ) { } }
return toBean ( parseObj ( jsonString ) , beanType , ignoreError ) ;
public class EventHandlerCache { /** * returns the cached path - based external event * @ param bucket * @ return Cached Item */ public static List < ExternalEvent > getPathExternalEvents ( String bucket ) { } }
if ( myPathCache . get ( bucket ) != null ) return myPathCache . get ( bucket ) ; else if ( bucket . indexOf ( '/' ) > 0 ) { // We could have a sub - path return getPathExternalEvents ( bucket . substring ( 0 , bucket . lastIndexOf ( '/' ) ) ) ; } return null ;
public class FastMath { /** * Sine function . * @ param x Argument . * @ return sin ( x ) */ public static double sin ( double x ) { } }
boolean negative = false ; int quadrant = 0 ; double xa ; double xb = 0.0 ; /* Take absolute value of the input */ xa = x ; if ( x < 0 ) { negative = true ; xa = - xa ; } /* Check for zero and negative zero */ if ( xa == 0.0 ) { long bits = Double . doubleToLongBits ( x ) ; if ( bits < 0 ) { return - 0.0 ; } return 0.0 ; } if ( xa != xa || xa == Double . POSITIVE_INFINITY ) { return Double . NaN ; } /* Perform any argument reduction */ if ( xa > 3294198.0 ) { // PI * ( 2 * * 20) // Argument too big for CodyWaite reduction . Must use // PayneHanek . double reduceResults [ ] = new double [ 3 ] ; reducePayneHanek ( xa , reduceResults ) ; quadrant = ( ( int ) reduceResults [ 0 ] ) & 3 ; xa = reduceResults [ 1 ] ; xb = reduceResults [ 2 ] ; } else if ( xa > 1.5707963267948966 ) { final CodyWaite cw = new CodyWaite ( xa ) ; quadrant = cw . getK ( ) & 3 ; xa = cw . getRemA ( ) ; xb = cw . getRemB ( ) ; } if ( negative ) { quadrant ^= 2 ; // Flip bit 1 } switch ( quadrant ) { case 0 : return sinQ ( xa , xb ) ; case 1 : return cosQ ( xa , xb ) ; case 2 : return - sinQ ( xa , xb ) ; case 3 : return - cosQ ( xa , xb ) ; default : return Double . NaN ; }
public class MediaManagementApi { /** * Release the snapshot * Release the snapshot specified . * @ param snapshotId Id of the snapshot ( required ) * @ param releaseSnapshotBody ( optional ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiSuccessResponse releaseSnapshot ( String snapshotId , ReleaseSnapshotBody releaseSnapshotBody ) throws ApiException { } }
ApiResponse < ApiSuccessResponse > resp = releaseSnapshotWithHttpInfo ( snapshotId , releaseSnapshotBody ) ; return resp . getData ( ) ;
public class Table { /** * To put a table within the existing table at the given position * generateTable will of course re - arrange the widths of the columns . * @ param aTable the table you want to insert * @ param aLocation a < CODE > Point < / CODE > */ public void insertTable ( Table aTable , Point aLocation ) { } }
if ( aTable == null ) { throw new NullPointerException ( "insertTable - table has null-value" ) ; } if ( aLocation == null ) { throw new NullPointerException ( "insertTable - point has null-value" ) ; } mTableInserted = true ; aTable . complete ( ) ; if ( aLocation . y > columns ) { throw new IllegalArgumentException ( "insertTable -- wrong columnposition(" + aLocation . y + ") of location; max =" + columns ) ; } int rowCount = aLocation . x + 1 - rows . size ( ) ; int i = 0 ; if ( rowCount > 0 ) { // create new rows ? for ( ; i < rowCount ; i ++ ) { rows . add ( new Row ( columns ) ) ; } } rows . get ( aLocation . x ) . setElement ( aTable , aLocation . y ) ; setCurrentLocationToNextValidPosition ( aLocation ) ;
public class CmsImportExportManager { /** * Sets whether colliding resources should be overwritten during the import for a * specified import implementation . < p > * v1 and v2 imports ( without resource UUIDs in the manifest ) * MUST * overwrite colliding * resources . Don ' t forget to set this flag back to it ' s original value in v1 and v2 * import implementations ! < p > * This flag must be set to false to force imports > v2 to move colliding resources to * / system / lost - found / . < p > * The import implementation has to take care to set this flag correct ! < p > * @ param overwriteCollidingResources true if colliding resources should be overwritten during the import */ public void setOverwriteCollidingResources ( boolean overwriteCollidingResources ) { } }
if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_IMPORTEXPORT_SET_OVERWRITE_PARAMETER_1 , Boolean . toString ( overwriteCollidingResources ) ) ) ; } m_overwriteCollidingResources = overwriteCollidingResources ;
public class StereoTool { /** * Gets the tetrahedral handedness of four atoms - three of which form the * ' base ' of the tetrahedron , and the other the apex . Note that it assumes * a right - handed coordinate system , and that the points { A , B , C } are in * a counter - clockwise order in the plane they share . * @ param baseAtomA the first atom in the base of the tetrahedron * @ param baseAtomB the second atom in the base of the tetrahedron * @ param baseAtomC the third atom in the base of the tetrahedron * @ param apexAtom the atom in the point of the tetrahedron * @ return the sign of the tetrahedron */ public static TetrahedralSign getHandedness ( IAtom baseAtomA , IAtom baseAtomB , IAtom baseAtomC , IAtom apexAtom ) { } }
Point3d pointA = baseAtomA . getPoint3d ( ) ; Point3d pointB = baseAtomB . getPoint3d ( ) ; Point3d pointC = baseAtomC . getPoint3d ( ) ; Point3d pointD = apexAtom . getPoint3d ( ) ; return StereoTool . getHandedness ( pointA , pointB , pointC , pointD ) ;
public class InfinispanCache { /** * An advanced cache that does not return the value of the previous value in * case of replacement . * @ param _ cacheName cache wanted * @ param < K > Key * @ param < V > Value * @ return an AdvancedCache from Infinispan with Ignore return values */ public < K , V > AdvancedCache < K , V > getIgnReCache ( final String _cacheName ) { } }
return this . container . < K , V > getCache ( _cacheName , true ) . getAdvancedCache ( ) . withFlags ( Flag . IGNORE_RETURN_VALUES , Flag . SKIP_REMOTE_LOOKUP , Flag . SKIP_CACHE_LOAD ) ;
public class RMQSink { /** * Called when new data arrives to the sink , and forwards it to RMQ . * @ param value * The incoming data */ @ Override public void invoke ( IN value ) { } }
try { byte [ ] msg = schema . serialize ( value ) ; if ( publishOptions == null ) { channel . basicPublish ( "" , queueName , null , msg ) ; } else { boolean mandatory = publishOptions . computeMandatory ( value ) ; boolean immediate = publishOptions . computeImmediate ( value ) ; Preconditions . checkState ( ! ( returnListener == null && ( mandatory || immediate ) ) , "Setting mandatory and/or immediate flags to true requires a ReturnListener." ) ; String rk = publishOptions . computeRoutingKey ( value ) ; String exchange = publishOptions . computeExchange ( value ) ; channel . basicPublish ( exchange , rk , mandatory , immediate , publishOptions . computeProperties ( value ) , msg ) ; } } catch ( IOException e ) { if ( logFailuresOnly ) { LOG . error ( "Cannot send RMQ message {} at {}" , queueName , rmqConnectionConfig . getHost ( ) , e ) ; } else { throw new RuntimeException ( "Cannot send RMQ message " + queueName + " at " + rmqConnectionConfig . getHost ( ) , e ) ; } }
public class DZcs_print { /** * Prints a sparse matrix . * @ param A * sparse matrix ( triplet ot column - compressed ) * @ param brief * print all of A if false , a few entries otherwise * @ return true if successful , false on error */ public static boolean cs_print ( DZcs A , boolean brief , OutputStream output ) { } }
int p , j , m , n , nzmax , nz , Ap [ ] , Ai [ ] ; DZcsa Ax = new DZcsa ( ) ; PrintStream out = new PrintStream ( output ) ; if ( A == null ) { out . print ( "(null)\n" ) ; return ( false ) ; } m = A . m ; n = A . n ; Ap = A . p ; Ai = A . i ; Ax . x = A . x ; nzmax = A . nzmax ; nz = A . nz ; /* out . printf ( " CXSparseJ Version % d . % d . % d , % s . % s \ n " , DZcs _ common . CS _ VER , DZcs _ common . CS _ SUBVER , DZcs _ common . CS _ SUBSUB , DZcs _ common . CS _ DATE , DZcs _ common . CS _ COPYRIGHT ) ; */ if ( nz < 0 ) { out . printf ( "%d-by-%d, nzmax: %d nnz: %d, 1-norm: %g\n" , m , n , nzmax , Ap [ n ] , cs_norm ( A ) ) ; for ( j = 0 ; j < n ; j ++ ) { out . printf ( " col %d : locations %d to %d\n" , j , Ap [ j ] , Ap [ j + 1 ] - 1 ) ; for ( p = Ap [ j ] ; p < Ap [ j + 1 ] ; p ++ ) { out . printf ( " %d : (%g, %g)\n" , Ai [ p ] , Ax . x != null ? cs_creal ( Ax . get ( p ) ) : 1 , Ax . x != null ? cs_cimag ( Ax . get ( p ) ) : 0 ) ; if ( brief && p > 20 ) { out . print ( " ...\n" ) ; return ( true ) ; } } } } else { out . printf ( "triplet: %d-by-%d, nzmax: %d nnz: %d\n" , m , n , nzmax , nz ) ; for ( p = 0 ; p < nz ; p ++ ) { out . printf ( " %d %d : (%g, %g)\n" , Ai [ p ] , Ap [ p ] , Ax . x != null ? cs_creal ( Ax . get ( p ) ) : 1 , Ax . x != null ? cs_cimag ( Ax . get ( p ) ) : 0 ) ; if ( brief && p > 20 ) { out . print ( " ...\n" ) ; return ( true ) ; } } } return ( true ) ;
public class ApiBuilder { public static void sse ( @ NotNull String path , @ NotNull Consumer < SseClient > client ) { } }
staticInstance ( ) . sse ( prefixPath ( path ) , client ) ;
public class AliasDestinationImpl { /** * Returns the appropriate destination reliability based out of SIBDestinationReliabilityType * @ param reliability * @ return */ private String getDestinationReliability ( String reliability ) { } }
String rel = null ; if ( reliability . equals ( JsAdminConstants . BESTEFFORTNONPERSISTENT ) ) { rel = SIBDestinationReliabilityType . BEST_EFFORT_NONPERSISTENT ; } else if ( reliability . equals ( JsAdminConstants . EXPRESSNONPERSISTENT ) ) { rel = SIBDestinationReliabilityType . EXPRESS_NONPERSISTENT ; } else if ( reliability . equals ( JsAdminConstants . RELIABLENONPERSISTENT ) ) { rel = SIBDestinationReliabilityType . RELIABLE_NONPERSISTENT ; } else if ( reliability . equals ( JsAdminConstants . RELIABLEPERSISTENT ) ) { rel = SIBDestinationReliabilityType . RELIABLE_PERSISTENT ; } else if ( reliability . equals ( JsAdminConstants . ASSUREDPERSISTENT ) ) { rel = SIBDestinationReliabilityType . ASSURED_PERSISTENT ; } else if ( reliability . equals ( JsAdminConstants . INHERIT ) ) { rel = SIBDestinationReliabilityInheritType . INHERIT ; } return rel ;
public class GzipHeader { /** * Read a byte . * We do not expect to get a - 1 reading . If we do , we throw exception . * Update the crc as we go . * @ param in InputStream to read . * @ param crc CRC to update . * @ param buffer Buffer to read into . * @ param offset Offset to start filling buffer at . * @ param length How much to read . * @ return Bytes read . * @ throws IOException */ protected int readByte ( InputStream in , CRC32 crc , byte [ ] buffer , int offset , int length ) throws IOException { } }
for ( int i = offset ; i < length ; i ++ ) { buffer [ offset + i ] = ( byte ) readByte ( in , crc ) ; } return length ;
public class EncryptionUtil { /** * Provides basic encryption on a String . */ public String encrypt ( String toEncrypt ) throws DuraCloudRuntimeException { } }
try { byte [ ] input = toEncrypt . getBytes ( "UTF-8" ) ; cipher . init ( Cipher . ENCRYPT_MODE , key ) ; byte [ ] cipherText = cipher . doFinal ( input ) ; return encodeBytes ( cipherText ) ; } catch ( Exception e ) { throw new DuraCloudRuntimeException ( e ) ; }
public class ExceptionUtils { /** * Re - throws the given { @ code Throwable } in scenarios where the signatures allows only IOExceptions * ( and RuntimeException and Error ) . * < p > Throws this exception directly , if it is an IOException , a RuntimeException , or an Error . Otherwise it * wraps it in an IOException and throws it . * @ param t The Throwable to be thrown . */ public static void rethrowIOException ( Throwable t ) throws IOException { } }
if ( t instanceof IOException ) { throw ( IOException ) t ; } else if ( t instanceof RuntimeException ) { throw ( RuntimeException ) t ; } else if ( t instanceof Error ) { throw ( Error ) t ; } else { throw new IOException ( t . getMessage ( ) , t ) ; }
public class CmsPublishManager { /** * Publishes the current project , printing messages to a shell report . < p > * @ param cms the cms request context * @ return the publish history id of the published project * @ throws Exception if something goes wrong * @ see CmsShellReport */ public CmsUUID publishProject ( CmsObject cms ) throws Exception { } }
return publishProject ( cms , new CmsShellReport ( cms . getRequestContext ( ) . getLocale ( ) ) ) ;
public class FNCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setXUnitBase ( Integer newXUnitBase ) { } }
Integer oldXUnitBase = xUnitBase ; xUnitBase = newXUnitBase ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FNC__XUNIT_BASE , oldXUnitBase , xUnitBase ) ) ;
public class FileLogSet { /** * Adds a file name to the files list at the specified index . If adding * this file would cause the number of files to exceed the maximum , remove * all files after the specified index , and then remove the oldest files * until the number is reduced to the maximum . * @ param index the index in the files list to insert the file * @ param file the file name */ private void addFile ( int index , String file ) { } }
if ( maxFiles > 0 ) { int numFiles = files . size ( ) ; int maxDateFiles = getMaxDateFiles ( ) ; // If there is no max or we have fewer than max , then we ' re done . if ( maxDateFiles <= 0 || numFiles < maxDateFiles ) { files . add ( index , file ) ; } else { // The file names we deal with ( messages _ xx . xx . xx _ xx . xx . xx . log ) // have dates , and we want to always be using the " most recent " , // so delete everything " newer " ( index and after ) , which might be // present if the system clock goes backwards , and then delete // the oldest files until only maxDateFiles - 1 remain . while ( files . size ( ) > index ) { removeFile ( files . size ( ) - 1 ) ; } while ( files . size ( ) >= maxDateFiles ) { removeFile ( 0 ) ; } files . add ( file ) ; } }
public class OrgAPI { /** * Creates a new organization * @ param data * The data for the new organization * @ return The data for the newly created organization */ public OrganizationCreateResponse createOrganization ( OrganizationCreate data ) { } }
return getResourceFactory ( ) . getApiResource ( "/org/" ) . entity ( data , MediaType . APPLICATION_JSON_TYPE ) . post ( OrganizationCreateResponse . class ) ;
public class BccClient { /** * Creating a customized image which can be used for creating instance in the future . * You can create an image from an instance or you can create from an snapshot . * The parameters of instanceId and snapshotId can no be null simultaneously . * when both instanceId and snapshotId are assigned , only instanceId will be used . * While creating an image from an instance , the instance must be Running or Stopped , * otherwise , it ' s will get < code > 409 < / code > errorCode . * You can create the image only from system snapshot . * While creating an image from a system snapshot , the snapshot must be Available , * otherwise , it ' s will get < code > 409 < / code > errorCode . * This is an asynchronous interface , * you can get the latest status by invoke { @ link # getImage ( GetImageRequest ) } * @ param request The request containing all options for creating a new image . * @ return The response with id of image newly created . */ public CreateImageResponse createImage ( CreateImageRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; if ( Strings . isNullOrEmpty ( request . getClientToken ( ) ) ) { request . setClientToken ( this . generateClientToken ( ) ) ; } checkStringNotEmpty ( request . getImageName ( ) , "request imageName should not be empty." ) ; if ( Strings . isNullOrEmpty ( request . getInstanceId ( ) ) && Strings . isNullOrEmpty ( request . getSnapshotId ( ) ) ) { throw new IllegalArgumentException ( "request instanceId or snapshotId should not be empty ." ) ; } InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . POST , IMAGE_PREFIX ) ; internalRequest . addParameter ( "clientToken" , request . getClientToken ( ) ) ; fillPayload ( internalRequest , request ) ; return invokeHttpClient ( internalRequest , CreateImageResponse . class ) ;
public class Program { /** * Create a new , random program tree from the given ( non ) terminal * operations with the desired depth . The created program tree is a * < em > full < / em > tree . * @ param depth the desired depth of the program tree * @ param operations the list of < em > non < / em > - terminal operations * @ param terminals the list of terminal operations * @ param < A > the operational type * @ return a new program tree * @ throws NullPointerException if one of the given operations is * { @ code null } * @ throws IllegalArgumentException if the given tree depth is smaller than * zero */ public static < A > TreeNode < Op < A > > of ( final int depth , final ISeq < ? extends Op < A > > operations , final ISeq < ? extends Op < A > > terminals ) { } }
return of ( depth , operations , terminals , RandomRegistry . getRandom ( ) ) ;
public class VFSUtils { /** * Get the name . * @ param uri the uri * @ return name from uri ' s path */ public static String getName ( URI uri ) { } }
if ( uri == null ) { throw MESSAGES . nullArgument ( "uri" ) ; } String name = uri . getPath ( ) ; if ( name != null ) { // TODO : Not correct for certain uris like jar : . . . ! / int lastSlash = name . lastIndexOf ( '/' ) ; if ( lastSlash > 0 ) { name = name . substring ( lastSlash + 1 ) ; } } return name ;
public class NotificationHubsInner { /** * Creates / Updates an authorization rule for a NotificationHub . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name . * @ param notificationHubName The notification hub name . * @ param authorizationRuleName Authorization Rule Name . * @ param properties Properties of the Namespace AuthorizationRules . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the SharedAccessAuthorizationRuleResourceInner object */ public Observable < ServiceResponse < SharedAccessAuthorizationRuleResourceInner > > createOrUpdateAuthorizationRuleWithServiceResponseAsync ( String resourceGroupName , String namespaceName , String notificationHubName , String authorizationRuleName , SharedAccessAuthorizationRuleProperties properties ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( namespaceName == null ) { throw new IllegalArgumentException ( "Parameter namespaceName is required and cannot be null." ) ; } if ( notificationHubName == null ) { throw new IllegalArgumentException ( "Parameter notificationHubName is required and cannot be null." ) ; } if ( authorizationRuleName == null ) { throw new IllegalArgumentException ( "Parameter authorizationRuleName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( properties == null ) { throw new IllegalArgumentException ( "Parameter properties is required and cannot be null." ) ; } Validator . validate ( properties ) ; SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters ( ) ; parameters . withProperties ( properties ) ; return service . createOrUpdateAuthorizationRule ( resourceGroupName , namespaceName , notificationHubName , authorizationRuleName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , parameters , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < SharedAccessAuthorizationRuleResourceInner > > > ( ) { @ Override public Observable < ServiceResponse < SharedAccessAuthorizationRuleResourceInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < SharedAccessAuthorizationRuleResourceInner > clientResponse = createOrUpdateAuthorizationRuleDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class UniversalNamespaceCache { /** * This method looks at an attribute and stores it , if it is a namespace * attribute . * @ param attribute * to examine */ private void storeAttribute ( Attr attribute ) { } }
// examine the attributes in namespace xmlns if ( attribute . getNamespaceURI ( ) != null && attribute . getNamespaceURI ( ) . equals ( XMLConstants . XMLNS_ATTRIBUTE_NS_URI ) ) { // Default namespace xmlns = " uri goes here " if ( attribute . getNodeName ( ) . equals ( XMLConstants . XMLNS_ATTRIBUTE ) ) { putInCache ( DEFAULT_NS , attribute . getNodeValue ( ) ) ; } else { // Here are the defined prefixes stored putInCache ( attribute . getLocalName ( ) , attribute . getNodeValue ( ) ) ; } }
public class FollowUpPromptMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FollowUpPrompt followUpPrompt , ProtocolMarshaller protocolMarshaller ) { } }
if ( followUpPrompt == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( followUpPrompt . getPrompt ( ) , PROMPT_BINDING ) ; protocolMarshaller . marshall ( followUpPrompt . getRejectionStatement ( ) , REJECTIONSTATEMENT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class UcsApi { /** * Get the lucene indexes for ucs * This request returns all the lucene indexes for contact . * @ param luceneIndexesData Request parameters . ( optional ) * @ return ApiResponse & lt ; ConfigResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ConfigResponse > getLuceneIndexesWithHttpInfo ( LuceneIndexesData luceneIndexesData ) throws ApiException { } }
com . squareup . okhttp . Call call = getLuceneIndexesValidateBeforeCall ( luceneIndexesData , null , null ) ; Type localVarReturnType = new TypeToken < ConfigResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ApiOvhOrder { /** * Create order * REST : POST / order / dedicated / server / { serviceName } / bandwidth / { duration } * @ param bandwidth [ required ] Bandwidth to allocate * @ param type [ required ] bandwidth type * @ param serviceName [ required ] The internal name of your dedicated server * @ param duration [ required ] Duration */ public OvhOrder dedicated_server_serviceName_bandwidth_duration_POST ( String serviceName , String duration , OvhBandwidthOrderEnum bandwidth , OvhBandwidthOrderTypeEnum type ) throws IOException { } }
String qPath = "/order/dedicated/server/{serviceName}/bandwidth/{duration}" ; StringBuilder sb = path ( qPath , serviceName , duration ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "bandwidth" , bandwidth ) ; addBody ( o , "type" , type ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOrder . class ) ;
public class DSLMapLexer { /** * $ ANTLR start " RIGHT _ SQUARE " */ public final void mRIGHT_SQUARE ( ) throws RecognitionException { } }
try { int _type = RIGHT_SQUARE ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 301:9 : ( ' ] ' ) // src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 301:11 : ' ] ' { match ( ']' ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class AtomicUndoManager { /** * Utility method that records a change that can be undone / redone . */ @ SuppressWarnings ( "UnusedDeclaration" ) public void recordChange ( StateEditable change ) { } }
beginUndoAtom ( ) ; try { StateEdit transaction = new StateEdit ( change ) ; transaction . end ( ) ; addEdit ( transaction ) ; } finally { endUndoAtom ( ) ; }
public class GroupsApi { /** * Join a public group as a member . * < br > * This method requires authentication with ' write ' permission . * < br > * @ param groupId ( Required ) The NSID of the group to join . * @ param acceptRules If the group has rules , they must be displayed to the user prior to joining . * Passing a true value for this argument specifies that the application has displayed the group * rules to the user , and that the user has agreed to them . * @ return object with response from Flickr indicating ok or fail . * @ throws JinxException if required parameters are missing , or if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . groups . join . html " > flickr . groups . join < / a > */ public Response join ( String groupId , boolean acceptRules ) throws JinxException { } }
JinxUtils . validateParams ( groupId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.groups.join" ) ; params . put ( "group_id" , groupId ) ; if ( acceptRules ) { params . put ( "accept_rules" , "true" ) ; } return jinx . flickrPost ( params , Response . class ) ;
public class SetterUtil { /** * Sets the given parameter on the object while smartly parsing the value . * For example , if the value can be interpreted as an integer , will invoke * the setFoo ( int ) or setFoo ( Integer ) methods of the given object as opposed * to just dummily invoking the setFoo ( String ) method . * The setFoo ( String ) method is always tried as the last resort . * @ param obj Object to invoke the setter on * @ param method The setter ( e . g . " setFoo " ) . * @ param value Value to set . * @ throws NoSuchMethodException If there is no applicable method to set this value . */ public static void set ( Object obj , String method , String value ) throws NoSuchMethodException { } }
for ( Setter s : c_setters ) { try { s . set ( obj , method , value ) ; return ; } catch ( Exception e ) { } } throw new NoSuchMethodException ( "No valid setter found for " + method + "(\"" + value + "\")" ) ;
public class RelationalOperationsMatrix { /** * with the interior of Point B . */ private void boundaryAreaInteriorPoint_ ( int cluster , int id_a , int id_b ) { } }
if ( m_matrix [ MatrixPredicate . BoundaryInterior ] == 0 ) return ; int clusterParentage = m_topo_graph . getClusterParentage ( cluster ) ; if ( ( clusterParentage & id_a ) != 0 && ( clusterParentage & id_b ) != 0 ) { m_matrix [ MatrixPredicate . BoundaryInterior ] = 0 ; }
public class RelationalOperationsMatrix { /** * Returns true if the relation holds . */ static boolean polylineRelatePolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , String scl , ProgressTracker progress_tracker ) { } }
RelationalOperationsMatrix relOps = new RelationalOperationsMatrix ( ) ; relOps . resetMatrix_ ( ) ; relOps . setPredicates_ ( scl ) ; relOps . setLineLinePredicates_ ( ) ; Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; polyline_b . queryEnvelope2D ( env_b ) ; boolean bRelationKnown = false ; boolean b_disjoint = RelationalOperations . envelopeDisjointEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; if ( b_disjoint ) { relOps . lineLineDisjointPredicates_ ( polyline_a , polyline_b ) ; bRelationKnown = true ; } if ( ! bRelationKnown ) { // Quick rasterize test to see whether the the geometries are // disjoint , or if one is contained in the other . int relation = RelationalOperations . tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) ; if ( relation == RelationalOperations . Relation . disjoint ) { relOps . lineLineDisjointPredicates_ ( polyline_a , polyline_b ) ; bRelationKnown = true ; } } if ( ! bRelationKnown ) { EditShape edit_shape = new EditShape ( ) ; int geom_a = edit_shape . addGeometry ( polyline_a ) ; int geom_b = edit_shape . addGeometry ( polyline_b ) ; relOps . setEditShapeCrackAndCluster_ ( edit_shape , tolerance , progress_tracker ) ; relOps . m_cluster_index_a = relOps . m_topo_graph . createUserIndexForClusters ( ) ; relOps . m_cluster_index_b = relOps . m_topo_graph . createUserIndexForClusters ( ) ; markClusterEndPoints_ ( geom_a , relOps . m_topo_graph , relOps . m_cluster_index_a ) ; markClusterEndPoints_ ( geom_b , relOps . m_topo_graph , relOps . m_cluster_index_b ) ; relOps . computeMatrixTopoGraphHalfEdges_ ( geom_a , geom_b ) ; relOps . m_topo_graph . deleteUserIndexForClusters ( relOps . m_cluster_index_a ) ; relOps . m_topo_graph . deleteUserIndexForClusters ( relOps . m_cluster_index_b ) ; relOps . m_topo_graph . removeShape ( ) ; } boolean bRelation = relationCompare_ ( relOps . m_matrix , relOps . m_scl ) ; return bRelation ;
public class CapsuleUtils { /** * Compute the squash operation used in CapsNet * The formula is ( | | s | | ^ 2 / ( 1 + | | s | | ^ 2 ) ) * ( s / | | s | | ) . * Canceling one | | s | | gives | | s | | * s / ( ( 1 + | | s | | ^ 2) * @ param SD The SameDiff environment * @ param x The variable to squash * @ return squash ( x ) */ public static SDVariable squash ( SameDiff SD , SDVariable x , int dim ) { } }
SDVariable squaredNorm = SD . math . square ( x ) . sum ( true , dim ) ; SDVariable scale = SD . math . sqrt ( squaredNorm . plus ( 1e-5 ) ) ; return x . times ( squaredNorm ) . div ( squaredNorm . plus ( 1.0 ) . times ( scale ) ) ;
public class AWSWAFRegionalClient { /** * Inserts or deletes < a > SizeConstraint < / a > objects ( filters ) in a < a > SizeConstraintSet < / a > . For each * < code > SizeConstraint < / code > object , you specify the following values : * < ul > * < li > * Whether to insert or delete the object from the array . If you want to change a * < code > SizeConstraintSetUpdate < / code > object , you delete the existing object and add a new one . * < / li > * < li > * The part of a web request that you want AWS WAF to evaluate , such as the length of a query string or the length * of the < code > User - Agent < / code > header . * < / li > * < li > * Whether to perform any transformations on the request , such as converting it to lowercase , before checking its * length . Note that transformations of the request body are not supported because the AWS resource forwards only * the first < code > 8192 < / code > bytes of your request to AWS WAF . * You can only specify a single type of TextTransformation . * < / li > * < li > * A < code > ComparisonOperator < / code > used for evaluating the selected part of the request against the specified * < code > Size < / code > , such as equals , greater than , less than , and so on . * < / li > * < li > * The length , in bytes , that you want AWS WAF to watch for in selected part of the request . The length is computed * after applying the transformation . * < / li > * < / ul > * For example , you can add a < code > SizeConstraintSetUpdate < / code > object that matches web requests in which the * length of the < code > User - Agent < / code > header is greater than 100 bytes . You can then configure AWS WAF to block * those requests . * To create and configure a < code > SizeConstraintSet < / code > , perform the following steps : * < ol > * < li > * Create a < code > SizeConstraintSet . < / code > For more information , see < a > CreateSizeConstraintSet < / a > . * < / li > * < li > * Use < a > GetChangeToken < / a > to get the change token that you provide in the < code > ChangeToken < / code > parameter of * an < code > UpdateSizeConstraintSet < / code > request . * < / li > * < li > * Submit an < code > UpdateSizeConstraintSet < / code > request to specify the part of the request that you want AWS WAF * to inspect ( for example , the header or the URI ) and the value that you want AWS WAF to watch for . * < / li > * < / ol > * For more information about how to use the AWS WAF API to allow or block HTTP requests , see the < a * href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / " > AWS WAF Developer Guide < / a > . * @ param updateSizeConstraintSetRequest * @ return Result of the UpdateSizeConstraintSet operation returned by the service . * @ throws WAFStaleDataException * The operation failed because you tried to create , update , or delete an object by using a change token * that has already been used . * @ throws WAFInternalErrorException * The operation failed because of a system problem , even though the request was valid . Retry your request . * @ throws WAFInvalidAccountException * The operation failed because you tried to create , update , or delete an object by using an invalid account * identifier . * @ throws WAFInvalidOperationException * The operation failed because there was nothing to do . For example : < / p > * < ul > * < li > * You tried to remove a < code > Rule < / code > from a < code > WebACL < / code > , but the < code > Rule < / code > isn ' t in * the specified < code > WebACL < / code > . * < / li > * < li > * You tried to remove an IP address from an < code > IPSet < / code > , but the IP address isn ' t in the specified * < code > IPSet < / code > . * < / li > * < li > * You tried to remove a < code > ByteMatchTuple < / code > from a < code > ByteMatchSet < / code > , but the * < code > ByteMatchTuple < / code > isn ' t in the specified < code > WebACL < / code > . * < / li > * < li > * You tried to add a < code > Rule < / code > to a < code > WebACL < / code > , but the < code > Rule < / code > already exists * in the specified < code > WebACL < / code > . * < / li > * < li > * You tried to add a < code > ByteMatchTuple < / code > to a < code > ByteMatchSet < / code > , but the * < code > ByteMatchTuple < / code > already exists in the specified < code > WebACL < / code > . * < / li > * @ throws WAFInvalidParameterException * The operation failed because AWS WAF didn ' t recognize a parameter in the request . For example : < / p > * < ul > * < li > * You specified an invalid parameter name . * < / li > * < li > * You specified an invalid value . * < / li > * < li > * You tried to update an object ( < code > ByteMatchSet < / code > , < code > IPSet < / code > , < code > Rule < / code > , or * < code > WebACL < / code > ) using an action other than < code > INSERT < / code > or < code > DELETE < / code > . * < / li > * < li > * You tried to create a < code > WebACL < / code > with a < code > DefaultAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to create a < code > RateBasedRule < / code > with a < code > RateKey < / code > value other than * < code > IP < / code > . * < / li > * < li > * You tried to update a < code > WebACL < / code > with a < code > WafAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > FieldToMatch < / code > < code > Type < / code > other * than HEADER , METHOD , QUERY _ STRING , URI , or BODY . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > Field < / code > of < code > HEADER < / code > but no * value for < code > Data < / code > . * < / li > * < li > * Your request references an ARN that is malformed , or corresponds to a resource with which a web ACL * cannot be associated . * < / li > * @ throws WAFNonexistentContainerException * The operation failed because you tried to add an object to or delete an object from another object that * doesn ' t exist . For example : < / p > * < ul > * < li > * You tried to add a < code > Rule < / code > to or delete a < code > Rule < / code > from a < code > WebACL < / code > that * doesn ' t exist . * < / li > * < li > * You tried to add a < code > ByteMatchSet < / code > to or delete a < code > ByteMatchSet < / code > from a * < code > Rule < / code > that doesn ' t exist . * < / li > * < li > * You tried to add an IP address to or delete an IP address from an < code > IPSet < / code > that doesn ' t exist . * < / li > * < li > * You tried to add a < code > ByteMatchTuple < / code > to or delete a < code > ByteMatchTuple < / code > from a * < code > ByteMatchSet < / code > that doesn ' t exist . * < / li > * @ throws WAFNonexistentItemException * The operation failed because the referenced object doesn ' t exist . * @ throws WAFReferencedItemException * The operation failed because you tried to delete an object that is still in use . For example : < / p > * < ul > * < li > * You tried to delete a < code > ByteMatchSet < / code > that is still referenced by a < code > Rule < / code > . * < / li > * < li > * You tried to delete a < code > Rule < / code > that is still referenced by a < code > WebACL < / code > . * < / li > * @ throws WAFLimitsExceededException * The operation exceeds a resource limit , for example , the maximum number of < code > WebACL < / code > objects * that you can create for an AWS account . For more information , see < a * href = " https : / / docs . aws . amazon . com / waf / latest / developerguide / limits . html " > Limits < / a > in the < i > AWS WAF * Developer Guide < / i > . * @ sample AWSWAFRegional . UpdateSizeConstraintSet * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / waf - regional - 2016-11-28 / UpdateSizeConstraintSet " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateSizeConstraintSetResult updateSizeConstraintSet ( UpdateSizeConstraintSetRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateSizeConstraintSet ( request ) ;
public class CollectionDef { /** * < code > optional . tensorflow . CollectionDef . BytesList bytes _ list = 2 ; < / code > */ public org . tensorflow . framework . CollectionDef . BytesList getBytesList ( ) { } }
if ( kindCase_ == 2 ) { return ( org . tensorflow . framework . CollectionDef . BytesList ) kind_ ; } return org . tensorflow . framework . CollectionDef . BytesList . getDefaultInstance ( ) ;
public class DB { /** * Selects a taxonomy term . * @ param taxonomy The taxonomy name . * @ param name The term name . * @ return The taxonomy term or { @ code null } if none . * @ throws SQLException on database error . */ public TaxonomyTerm selectTaxonomyTerm ( final String taxonomy , final String name ) throws SQLException { } }
Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; long taxonomyTermId = 0L ; long termId = 0L ; String description = "" ; Timer . Context ctx = metrics . selectTaxonomyTermTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( selectTaxonomyTermSQL ) ; stmt . setString ( 1 , name ) ; stmt . setString ( 2 , taxonomy ) ; rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { taxonomyTermId = rs . getLong ( 1 ) ; termId = rs . getLong ( 2 ) ; description = rs . getString ( 3 ) ; } else { return null ; } } finally { ctx . stop ( ) ; closeQuietly ( conn , stmt , rs ) ; } return new TaxonomyTerm ( taxonomyTermId , taxonomy , selectTerm ( termId ) , description ) ;
public class TimeExpression { /** * Create a minutes expression ( range 0-59) * @ return minute */ public NumberExpression < Integer > minute ( ) { } }
if ( minutes == null ) { minutes = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . MINUTE , mixin ) ; } return minutes ;
public class TypeWrapper { /** * Unwrap the given type , effectively returning the original non - serializable type . * @ param type the type to unwrap * @ return the original non - serializable type */ @ SuppressWarnings ( "unchecked" ) public static < T extends Type > T unwrap ( T type ) { } }
Type unwrapped = type ; while ( unwrapped instanceof SerializableTypeProxy ) { unwrapped = ( ( SerializableTypeProxy ) type ) . getTypeProvider ( ) . getType ( ) ; } return ( T ) unwrapped ;
public class BasePersonAttributeDao { /** * Takes a & lt ; String , List & lt ; Object & gt ; & gt ; Map and coverts it to a & lt ; String , Object & gt ; Map . This implementation takes * the first value of each List to use as the value for the new Map . * @ param multivaluedUserAttributes The attribute map to flatten . * @ return A flattened version of the Map , null if the argument was null . * @ deprecated This method is just used internally and will be removed with this class in 1.6 */ @ Deprecated protected Map < String , Object > flattenResults ( final Map < String , List < Object > > multivaluedUserAttributes ) { } }
if ( ! this . enabled ) { return null ; } if ( multivaluedUserAttributes == null ) { return null ; } // Convert the < String , List < Object > results map to a < String , Object > map using the first value of each List final Map < String , Object > userAttributes = new LinkedHashMap < > ( multivaluedUserAttributes . size ( ) ) ; for ( final Map . Entry < String , List < Object > > attrEntry : multivaluedUserAttributes . entrySet ( ) ) { final String attrName = attrEntry . getKey ( ) ; final List < Object > attrValues = attrEntry . getValue ( ) ; final Object value ; if ( attrValues == null || attrValues . size ( ) == 0 ) { value = null ; } else { value = attrValues . get ( 0 ) ; } userAttributes . put ( attrName , value ) ; } logger . debug ( "Flattened Map='{}' into Map='{}'" , multivaluedUserAttributes , userAttributes ) ; return userAttributes ;
public class JdbcUtil { /** * Executes the specified SQL with the specified connection . * @ param sql the specified SQL * @ param connection connection the specified connection * @ param isDebug the specified debug flag * @ return { @ code true } if success , returns { @ false } otherwise * @ throws SQLException SQLException */ public static boolean executeSql ( final String sql , final Connection connection , final boolean isDebug ) throws SQLException { } }
if ( isDebug || LOGGER . isTraceEnabled ( ) ) { LOGGER . log ( Level . INFO , "Executing SQL [" + sql + "]" ) ; } final Statement statement = connection . createStatement ( ) ; final boolean isSuccess = ! statement . execute ( sql ) ; statement . close ( ) ; return isSuccess ;