signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class JPAUserTxCallBackHandler { /** * ( non - Javadoc )
* @ see com . ibm . ws . Transaction . UOWCallback # contextChange ( int ,
* com . ibm . ws . Transaction . UOWCoordinator ) */
public void contextChange ( int typeOfChange , UOWCoordinator UOW ) throws IllegalStateException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "contextChange : " + typeOfChange + ", " + UOW ) ; String changeType = "Unknown" ; // Determine the Tx change type and process
switch ( typeOfChange ) { case PRE_BEGIN : changeType = "Pre_Begin" ; break ; case POST_BEGIN : changeType = "Post_Begin" ; handleUserTxCallback ( true ) ; break ; case PRE_END : changeType = "Pre_End" ; break ; case POST_END : changeType = "Post_End" ; handleUserTxCallback ( false ) ; break ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "contextChange : " + changeType ) ;
|
public class JmsFactoryFactoryImpl { /** * This method is called by the application to create a jms administered
* queue object . */
@ Override public JmsQueue createQueue ( String name ) throws JMSException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createQueue" , name ) ; JmsQueue queue = null ; // if name string is null , empty or just " queue : / / " , throw exception
if ( ( name == null ) || ( "" . equals ( name ) ) || ( JmsQueueImpl . QUEUE_PREFIX . equals ( name ) ) ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0003" , new Object [ ] { "Queue name" , name } , tc ) ; } // if name is " topic : / / " throw exception
if ( name . startsWith ( JmsTopicImpl . TOPIC_PREFIX ) ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "MALFORMED_DESCRIPTOR_CWSIA0047" , new Object [ ] { "Queue" , name } , tc ) ; } name = name . trim ( ) ; queue = ( JmsQueue ) destCreator . createDestinationFromString ( name , URIDestinationCreator . DestType . QUEUE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createQueue" , queue ) ; return queue ;
|
public class StringHelper { /** * Escape meta characters with backslash .
* @ param value original string
* @ param metachars characters that need to be escaped
* @ return modified string with meta characters escaped with backslashes */
public static String escapeWithBackslash ( String value , String metachars ) { } }
|
StringBuffer sb = new StringBuffer ( ) ; int i , n = value . length ( ) ; char ch ; for ( i = 0 ; i < n ; i ++ ) { ch = value . charAt ( i ) ; if ( ch == '\\' || metachars . indexOf ( ch ) >= 0 ) { sb . append ( '\\' ) ; } sb . append ( ch ) ; } return sb . toString ( ) ;
|
public class AnnotatedExtensions { /** * Invokes the given method mapping named parameters to positions based on a
* given list of parameter names .
* @ param method Method to invoke
* @ param paramNames Positioned list of parameter names to map direct mapping
* @ param params Named parameters to use
* @ param instance Instance to invoke method on
* @ return Result of method invocation
* @ throws Throwable */
public static Object exec ( Method method , String [ ] paramNames , Map < String , ? > params , Object instance ) throws Throwable { } }
|
Object [ ] paramValues = new Object [ paramNames . length ] ; for ( int c = 0 ; c < paramNames . length ; ++ c ) { paramValues [ c ] = params . get ( paramNames [ c ] ) ; } try { return method . invoke ( instance , paramValues ) ; } catch ( IllegalAccessException e ) { // Shouldn ' t happen
throw new RuntimeException ( e ) ; } catch ( IllegalArgumentException e ) { throw new InvocationException ( "invalid arguments" , e , null ) ; } catch ( InvocationTargetException e ) { throw e . getTargetException ( ) ; }
|
public class RestClientUtil { /** * 检索索引所有数据
* @ param index
* @ param fetchSize
* @ param type
* @ param < T >
* @ return
* @ throws ElasticSearchException */
public < T > ESDatas < T > searchAll ( String index , int fetchSize , Class < T > type ) throws ElasticSearchException { } }
|
return searchAll ( index , fetchSize , ( ScrollHandler < T > ) null , type ) ;
|
public class ReservedInstancesListing { /** * The number of instances in this state .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setInstanceCounts ( java . util . Collection ) } or { @ link # withInstanceCounts ( java . util . Collection ) } if you want
* to override the existing values .
* @ param instanceCounts
* The number of instances in this state .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ReservedInstancesListing withInstanceCounts ( InstanceCount ... instanceCounts ) { } }
|
if ( this . instanceCounts == null ) { setInstanceCounts ( new com . amazonaws . internal . SdkInternalList < InstanceCount > ( instanceCounts . length ) ) ; } for ( InstanceCount ele : instanceCounts ) { this . instanceCounts . add ( ele ) ; } return this ;
|
public class SuffixParser { /** * Parse the suffix as resource paths , return the first resource from the suffix ( relativ to the current page ' s
* content ) that matches the given filter .
* @ param filter a filter that selects only the resource you ' re interested in .
* @ return the resource or null if no such resource was selected by suffix */
public @ Nullable Resource getResource ( @ NotNull Predicate < Resource > filter ) { } }
|
return getResource ( filter , ( Resource ) null ) ;
|
public class DBQuery { /** * The array field contains all of the given values
* @ param field The field to compare
* @ param values The values to compare to
* @ return the query */
public static Query all ( String field , Collection < ? > values ) { } }
|
return new Query ( ) . all ( field , values ) ;
|
public class SafeServiceLoader { /** * Loads a class with the given name from the given class loader .
* @ param className fully qualified class name
* @ param classLoader class loader
* @ return class with given name , or null */
@ SuppressWarnings ( "unchecked" ) private < T > Class < T > loadClassIfVisible ( String className , ClassLoader classLoader ) { } }
|
try { Class < T > klass = ( Class < T > ) classLoader . loadClass ( className ) ; return klass ; } catch ( ClassNotFoundException e ) { return null ; }
|
public class WriterState { /** * Records the fact that an iteration started .
* @ param timer The reference timer . */
void recordIterationStarted ( AbstractTimer timer ) { } }
|
this . iterationId . incrementAndGet ( ) ; this . currentIterationStartTime . set ( timer . getElapsed ( ) ) ; this . lastIterationError . set ( false ) ;
|
public class AbstractEnvironment { /** * Returns the set of default profiles explicitly set via
* { @ link # setDefaultProfiles ( String . . . ) } , then check for the presence of the
* { @ value # DEFAULT _ PROFILES _ PROPERTY _ NAME } property and assign its value ( if any )
* to the set of default profiles . */
private Set < String > doGetDefaultProfiles ( ) { } }
|
synchronized ( defaultProfiles ) { if ( defaultProfiles . isEmpty ( ) ) { String [ ] profiles = getProfilesFromSystemProperty ( DEFAULT_PROFILES_PROPERTY_NAME ) ; if ( profiles != null ) { setDefaultProfiles ( profiles ) ; String [ ] defaultProfiles = getDefaultProfiles ( ) ; if ( defaultProfiles . length > 0 ) { log . info ( "Default profiles [" + StringUtils . joinCommaDelimitedList ( defaultProfiles ) + "]" ) ; } } } return defaultProfiles ; }
|
public class User { /** * Gets the specific property , or null . */
public < T extends UserProperty > T getProperty ( Class < T > clazz ) { } }
|
for ( UserProperty p : properties ) { if ( clazz . isInstance ( p ) ) return clazz . cast ( p ) ; } return null ;
|
public class LogNode { /** * Flush out the log to stderr , and clear the log contents . Only call this on the toplevel log node , when
* threads do not have access to references of internal log nodes so that they cannot add more log entries
* inside the tree , otherwise log entries may be lost . */
public void flush ( ) { } }
|
if ( parent != null ) { throw new IllegalArgumentException ( "Only flush the toplevel LogNode" ) ; } if ( ! children . isEmpty ( ) ) { final String logOutput = this . toString ( ) ; this . children . clear ( ) ; log . info ( logOutput ) ; }
|
public class MixedFileUpload { /** * Checks whether we exceed the max allowed file size .
* @ param newSize the expected size once the current chunk is consumed
* @ param maxSize the max allowed size .
* @ param upload the upload */
private void checkSize ( long newSize , long maxSize , HttpServerFileUpload upload ) { } }
|
if ( maxSize >= 0 && newSize > maxSize ) { upload . handler ( null ) ; report ( new IllegalStateException ( "Size exceed allowed maximum capacity" ) ) ; }
|
public class BrokerConfigurationKeyGenerator { /** * Generate a { @ link org . apache . gobblin . broker . iface . SharedResourcesBroker } configuration key for a particular { @ link SharedResourceFactory } ,
* { @ link SharedResourceKey } and { @ link ScopeType } .
* Example :
* If the broker configuration contains a key - value pair with key :
* generateKey ( myFactory , myKey , myScopeType , " sample . key " )
* when requesting a resource created by myFactory , with the provided key and scope , the factory will be able to see
* the key - value pair specified .
* Note :
* { @ link SharedResourceKey } and { @ link ScopeType } may be null . In this case , the key - value pair will be visible to
* the factory regardless of the key and scope requested by the user . */
@ Builder public static String generateKey ( @ Nonnull SharedResourceFactory factory , SharedResourceKey key , ScopeType scopeType , @ Nonnull String configKey ) { } }
|
return JOINER . join ( BrokerConstants . GOBBLIN_BROKER_CONFIG_PREFIX , factory . getName ( ) , scopeType == null ? null : scopeType . name ( ) , key == null ? null : key . toConfigurationKey ( ) , configKey ) ;
|
public class Application { /** * Get the connection type .
* @ return */
public int getConnectionType ( ) { } }
|
int iConnectionType = DEFAULT_CONNECTION_TYPE ; if ( this . getMuffinManager ( ) != null ) if ( this . getMuffinManager ( ) . isServiceAvailable ( ) ) iConnectionType = PROXY ; // HACK - Webstart gives a warning when using RMI
String strConnectionType = this . getProperty ( Params . CONNECTION_TYPE ) ; if ( strConnectionType != null ) { if ( "proxy" . equalsIgnoreCase ( strConnectionType ) ) iConnectionType = PROXY ; // x if ( " rmi " . equalsIgnoreCase ( strConnectionType ) )
// x iConnectionType = RMI ;
if ( Util . isNumeric ( strConnectionType ) ) iConnectionType = Integer . parseInt ( strConnectionType ) ; } if ( ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) == null ) iConnectionType = PROXY ; // No OSGi
/* if ( iConnectionType = = RMI )
try {
Hashtable < String , String > env = new Hashtable < String , String > ( ) ;
env . put ( Context . INITIAL _ CONTEXT _ FACTORY , " com . sun . jndi . rmi . registry . RegistryContextFactory " ) ;
env . put ( Context . PROVIDER _ URL , " rmi : / / " + strServer ) ; / / + " : 1099 " ) ; / / The RMI server port
Context initial = new InitialContext ( env ) ;
Object objref = initial . lookup ( strRemoteApp ) ;
if ( objref = = null )
return null ; / / Ahhhhh , The app is not registered .
appServer = ( ApplicationServer ) PortableRemoteObject . narrow ( objref , org . jbundle . thin . base . remote . ApplicationServer . class ) ;
} catch ( NameNotFoundException ex ) {
return null ; / / Error - not found
} catch ( ServiceUnavailableException ex ) {
return null ; / / Error - not found
} catch ( Exception ex ) {
ex . printStackTrace ( ) ;
/ / } catch ( java . net . ConnectException ex ) {
/ / Try tunneling through http
iConnectionType = PROXY ; */
return iConnectionType ;
|
public class DescribeExportConfigurationsResult { /** * @ param exportsInfo */
public void setExportsInfo ( java . util . Collection < ExportInfo > exportsInfo ) { } }
|
if ( exportsInfo == null ) { this . exportsInfo = null ; return ; } this . exportsInfo = new java . util . ArrayList < ExportInfo > ( exportsInfo ) ;
|
public class BootstrapSecurityUI { /** * Create a tooltip with all the requirements for a password
* @ param aDisplayLocale
* Display locale to use .
* @ return < code > null < / code > if not special constraints are defined . */
@ Nullable public static ICommonsList < IHCNode > createPasswordConstraintTip ( @ Nonnull final Locale aDisplayLocale ) { } }
|
final ICommonsList < String > aTexts = GlobalPasswordSettings . getPasswordConstraintList ( ) . getAllPasswordConstraintDescriptions ( aDisplayLocale ) ; if ( aTexts . isEmpty ( ) ) return null ; return HCExtHelper . list2divList ( aTexts ) ;
|
public class AppliedDiscountUrl { /** * Get Resource Url for ApplyCoupon
* @ param checkoutId The unique identifier of the checkout .
* @ param couponCode Code associated with the coupon to remove from the cart .
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss .
* @ return String Resource Url */
public static MozuUrl applyCouponUrl ( String checkoutId , String couponCode , String responseFields ) { } }
|
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/coupons/{couponCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "couponCode" , couponCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
|
public class xHelmNotationParser { /** * Extracts the complex notation string from the root node of the XHELM
* document
* @ param rootElement root element
* @ return the complex notation string */
public static String getComplexNotationString ( Element rootElement ) { } }
|
Element helmNotationElement = rootElement . getChild ( "HelmNotation" ) ; return helmNotationElement . getText ( ) ;
|
public class CmsLocationPopupContent { /** * Sets the field visibility . < p >
* @ param visible < code > true < / code > to show the field */
protected void setTypeVisible ( boolean visible ) { } }
|
Style style = m_typeLabel . getElement ( ) . getParentElement ( ) . getStyle ( ) ; if ( visible ) { style . clearDisplay ( ) ; } else { style . setDisplay ( Display . NONE ) ; }
|
public class BackedHashMap { /** * cleanUpCache */
protected Enumeration cleanUpCache ( long now ) { } }
|
// create local variable - JIT performance improvement
final boolean isTraceOn = com . ibm . websphere . ras . TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_WAS . entering ( methodClassName , methodNames [ CLEAN_UP_CACHE ] ) ; } Vector timedOutSessions = new Vector ( ) ; Enumeration sessionIds = tableKeys ( ) ; while ( sessionIds . hasMoreElements ( ) ) { String id = ( String ) sessionIds . nextElement ( ) ; BackedSession backedSess = ( BackedSession ) superGet ( id ) ; if ( backedSess != null ) { try { if ( hasTimedOut ( backedSess , now ) ) { if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , methodNames [ CLEAN_UP_CACHE ] , "adding to inval list " + backedSess . getId ( ) ) ; } timedOutSessions . addElement ( backedSess . getId ( ) ) ; } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.session.store.common.BackedHashMap.cleanUpCache" , "951" , backedSess ) ; timedOutSessions . addElement ( backedSess . getId ( ) ) ; } } } Enumeration timedOutEnum = timedOutSessions . elements ( ) ; handleDiscardedCacheItems ( timedOutEnum ) ; if ( isTraceOn && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_WAS . exiting ( methodClassName , methodNames [ CLEAN_UP_CACHE ] , timedOutSessions . elements ( ) ) ; } return timedOutSessions . elements ( ) ;
|
public class GreenPepperXmlRpcServer { /** * { @ inheritDoc } */
public String updateRunner ( String oldRunnerName , Vector < Object > runnerParams ) { } }
|
try { Runner runner = XmlRpcDataMarshaller . toRunner ( runnerParams ) ; service . updateRunner ( oldRunnerName , runner ) ; log . debug ( "Updated Runner: " + oldRunnerName ) ; return SUCCESS ; } catch ( Exception e ) { return errorAsString ( e , RUNNER_UPDATE_FAILED ) ; }
|
public class BatchDescribeSimulationJobResult { /** * A list of unprocessed simulation job Amazon Resource Names ( ARNs ) .
* @ param unprocessedJobs
* A list of unprocessed simulation job Amazon Resource Names ( ARNs ) . */
public void setUnprocessedJobs ( java . util . Collection < String > unprocessedJobs ) { } }
|
if ( unprocessedJobs == null ) { this . unprocessedJobs = null ; return ; } this . unprocessedJobs = new java . util . ArrayList < String > ( unprocessedJobs ) ;
|
public class WaveformDetailComponent { /** * Look up all recorded playback state information .
* @ return the playback state recorded for any player
* @ since 0.5.0 */
public Set < PlaybackState > getPlaybackState ( ) { } }
|
Set < PlaybackState > result = new HashSet < PlaybackState > ( playbackStateMap . values ( ) ) ; return Collections . unmodifiableSet ( result ) ;
|
public class StreamRecord { /** * The item in the DynamoDB table as it appeared before it was modified .
* @ param oldImage
* The item in the DynamoDB table as it appeared before it was modified .
* @ return Returns a reference to this object so that method calls can be chained together . */
public StreamRecord withOldImage ( java . util . Map < String , AttributeValue > oldImage ) { } }
|
setOldImage ( oldImage ) ; return this ;
|
public class TranscoderUtils { /** * Helper method to encode a String into UTF8 via fast - path methods .
* @ param source the source document .
* @ return the encoded byte buffer . */
public static ByteBuf encodeStringAsUtf8 ( String source ) { } }
|
ByteBuf target = Unpooled . buffer ( source . length ( ) ) ; ByteBufUtil . writeUtf8 ( target , source ) ; return target ;
|
public class Logger { /** * Logs fatal ( unrecoverable ) message that caused the process to crash .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param message a human - readable message to log .
* @ param args arguments to parameterize the message . */
public void fatal ( String correlationId , String message , Object ... args ) { } }
|
formatAndWrite ( LogLevel . Fatal , correlationId , null , message , args ) ;
|
public class Memoizer { /** * < p > memoize . < / p >
* @ param function a { @ link java . util . function . Function } object .
* @ param < T > a T object .
* @ param < U > a U object .
* @ return a { @ link java . util . function . Function } object . */
public static < T , U > Function < T , U > memoize ( final Function < T , U > function ) { } }
|
return new Memoizer < T , U > ( ) . doMemoize ( function ) ;
|
public class ClassFileTypeSignatureParser { /** * parse a java id
* @ return */
private String parseJavaId ( ) { } }
|
StringBuilder sb = new StringBuilder ( ) ; int ch ; while ( true ) { ch = peekChar ( ) ; if ( ch == EOS || ! isJavaIdentifierPart ( ch ) ) { return sb . toString ( ) ; } sb . append ( ( char ) ch ) ; nextChar ( ) ; }
|
public class JoinTableImpl { /** * If not already created , a new < code > inverse - foreign - key < / code > element with the given value will be created .
* Otherwise , the existing < code > inverse - foreign - key < / code > element will be returned .
* @ return a new or existing instance of < code > ForeignKey < JoinTable < T > > < / code > */
public ForeignKey < JoinTable < T > > getOrCreateInverseForeignKey ( ) { } }
|
Node node = childNode . getOrCreate ( "inverse-foreign-key" ) ; ForeignKey < JoinTable < T > > inverseForeignKey = new ForeignKeyImpl < JoinTable < T > > ( this , "inverse-foreign-key" , childNode , node ) ; return inverseForeignKey ;
|
public class IdentityPatchRunner { /** * Check whether the patch can be applied to a given target .
* @ param condition the conditions
* @ param target the target
* @ throws PatchingException */
static void checkUpgradeConditions ( final UpgradeCondition condition , final InstallationManager . MutablePatchingTarget target ) throws PatchingException { } }
|
// See if the prerequisites are met
for ( final String required : condition . getRequires ( ) ) { if ( ! target . isApplied ( required ) ) { throw PatchLogger . ROOT_LOGGER . requiresPatch ( required ) ; } } // Check for incompatibilities
for ( final String incompatible : condition . getIncompatibleWith ( ) ) { if ( target . isApplied ( incompatible ) ) { throw PatchLogger . ROOT_LOGGER . incompatiblePatch ( incompatible ) ; } }
|
public class ExcelWriter { /** * 処理行の列名に対応するセルの値を設定する 。
* @ param column
* @ param value
* @ return */
private void writeCellValue ( Object value , Map < String , Integer > schema , String column , Row row ) { } }
|
if ( column == null || value == null ) { return ; } Cell cell = row . getCell ( schema . get ( column ) , Row . CREATE_NULL_AS_BLANK ) ; if ( NumberUtils . isNumber ( value . toString ( ) ) ) { cell . setCellValue ( Double . parseDouble ( value . toString ( ) ) ) ; } else { if ( value . toString ( ) . contains ( "\n" ) ) { cell . getCellStyle ( ) . setWrapText ( true ) ; } cell . setCellValue ( value . toString ( ) ) ; }
|
public class GVRFutureOnGlThread { /** * Where the call actually happens . If you submit the call through
* GVRContext . runOnGlThread ( ) . This will be automatically called in GL
* thread . You can also directly call this function while in GL thread . */
@ Override public void run ( ) { } }
|
synchronized ( lock ) { if ( mIsDone || mIsCancelled ) { return ; } mIsStarted = true ; } try { t = mCallable . call ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } synchronized ( lock ) { mIsDone = true ; lock . notifyAll ( ) ; }
|
public class AmazonECRClient { /** * Deletes a list of specified images within a specified repository . Images are specified with either
* < code > imageTag < / code > or < code > imageDigest < / code > .
* You can remove a tag from an image by specifying the image ' s tag in your request . When you remove the last tag
* from an image , the image is deleted from your repository .
* You can completely delete an image ( and all of its tags ) by specifying the image ' s digest in your request .
* @ param batchDeleteImageRequest
* Deletes specified images within a specified repository . Images are specified with either the
* < code > imageTag < / code > or < code > imageDigest < / code > .
* @ return Result of the BatchDeleteImage operation returned by the service .
* @ throws ServerException
* These errors are usually caused by a server - side issue .
* @ throws InvalidParameterException
* The specified parameter is invalid . Review the available parameters for the API request .
* @ throws RepositoryNotFoundException
* The specified repository could not be found . Check the spelling of the specified repository and ensure
* that you are performing operations on the correct registry .
* @ sample AmazonECR . BatchDeleteImage
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ecr - 2015-09-21 / BatchDeleteImage " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public BatchDeleteImageResult batchDeleteImage ( BatchDeleteImageRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeBatchDeleteImage ( request ) ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link WasInvalidatedBy } { @ code > } } */
@ XmlElementDecl ( namespace = PROV_NS , name = "wasInvalidatedBy" ) public JAXBElement < WasInvalidatedBy > createWasInvalidatedBy ( WasInvalidatedBy value ) { } }
|
return new JAXBElement < WasInvalidatedBy > ( _WasInvalidatedBy_QNAME , WasInvalidatedBy . class , null , value ) ;
|
public class DB2iNativeHelper { /** * This method returns the indicator whether the backend supports the isolation level switching on a connection
* @ return boolean : indicates the backend whether supports the isolation level switching */
@ Override public boolean isIsolationLevelSwitchingSupport ( ) { } }
|
// We assume that we are running on the local server so we can determine the os version
// Check that the OS is V5R3 or higher and set isolationLevelSwitchingSupported to true .
// Note : isolationLevelSwitchingSupport is defaulted to false
if ( ! switchingSupportDetermined ) { os400Version_ = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return System . getProperty ( "os.version" ) ; } } ) ; os400VersionNum_ = generateVersionNumber ( os400Version_ ) ; if ( os400VersionNum_ >= 530 ) { isolationLevelSwitchingSupport = true ; } switchingSupportDetermined = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "isolationSwitchingSupported has a value of " + isolationLevelSwitchingSupport ) ; // The variable ' isolationLevelSwitchingSupport ' is initialized to false .
// If it was changed , it was done so in one of two places :
// 1 ) In the code in this method - ie . switchingSupportDetermined was false and os . version dictates its value .
// 2 ) In the setProperties ( ) method of this class . A datasource property ( isolationLevelSwitchingSupport ) was set
// to true , and that takes precedence over the os . version WAS is running on ( remote DB access is being done )
// and switchingSupportDetermined is then set to true .
return isolationLevelSwitchingSupport ;
|
public class LineWrapper { /** * Emit either a space or a newline character . */
void wrappingSpace ( int indentLevel ) throws IOException { } }
|
if ( closed ) throw new IllegalStateException ( "closed" ) ; if ( this . nextFlush != null ) flush ( nextFlush ) ; column ++ ; // Increment the column even though the space is deferred to next call to flush ( ) .
this . nextFlush = FlushType . SPACE ; this . indentLevel = indentLevel ;
|
public class AbstractRequestContextBuilder { /** * Returns a fake { @ link Channel } which is required internally when creating a context . */
protected final Channel fakeChannel ( ) { } }
|
if ( channel == null ) { channel = new FakeChannel ( eventLoop ( ) , alloc ( ) , remoteAddress ( ) , localAddress ( ) ) ; } return channel ;
|
public class MomentInterval { /** * / * [ deutsch ]
* < p > Interpretiert den angegebenen Text als Intervall mit Hilfe des angegebenen
* Intervallmusters . < / p >
* < p > Zur Verwendung siehe auch : { @ link DateInterval # parse ( String , ChronoParser , String ) } . < / p >
* @ param text text to be parsed
* @ param parser format object for parsing start and end components
* @ param intervalPattern interval pattern containing placeholders { 0 } and { 1 } ( for start and end )
* @ return parsed interval
* @ throws IndexOutOfBoundsException if given text is empty
* @ throws ParseException if the text is not parseable
* @ since 3.9/4.6 */
public static MomentInterval parse ( String text , ChronoParser < Moment > parser , String intervalPattern ) throws ParseException { } }
|
return IntervalParser . parsePattern ( text , MomentIntervalFactory . INSTANCE , parser , intervalPattern ) ;
|
public class SessionDataManager { /** * Returns all REFERENCE properties that refer to this node .
* @ see org . exoplatform . services . jcr . dataflow . ItemDataConsumer # getReferencesData ( String , boolean ) */
public List < PropertyData > getReferencesData ( String identifier , boolean skipVersionStorage ) throws RepositoryException { } }
|
List < PropertyData > persisted = transactionableManager . getReferencesData ( identifier , skipVersionStorage ) ; List < PropertyData > sessionTransient = new ArrayList < PropertyData > ( ) ; for ( PropertyData p : persisted ) { sessionTransient . add ( p ) ; } return sessionTransient ;
|
public class DOMBuilder { /** * A helper method to parse the given text as XML .
* @ param text the XML text to parse
* @ return the root node of the parsed tree of Nodes
* @ throws SAXException Any SAX exception , possibly wrapping another exception .
* @ throws IOException An IO exception from the parser , possibly from a byte
* stream or character stream supplied by the application .
* @ throws ParserConfigurationException if a DocumentBuilder cannot be created which satisfies
* the configuration requested .
* @ see # parse ( Reader ) */
public Document parseText ( String text ) throws SAXException , IOException , ParserConfigurationException { } }
|
return parse ( new StringReader ( text ) ) ;
|
public class TextFormatter { /** * Formats the given { @ code pattern } replacing any placeholder of the form { 0 } , { 1 } , { 2 } and so on with the
* corresponding object from { @ code args } converted to a string with { @ code toString ( ) } , so without taking into
* account the locale .
* This method only implements a small subset of the grammar supported by { @ link java . text . MessageFormat } .
* Especially , placeholder are only made up of an index ; neither the type nor the style are supported .
* If nothing has been replaced this implementation returns the pattern itself .
* @ param pattern the pattern
* @ param args the arguments
* @ return the formatted pattern
* @ exception IllegalArgumentException if the pattern is invalid */
public String format ( final String pattern , final Object ... args ) { } }
|
buffer . setLength ( 0 ) ; boolean changed = false ; int placeholder = - 1 ; final int patternLength = pattern . length ( ) ; for ( int i = 0 ; i < patternLength ; ++ i ) { final char ch = pattern . charAt ( i ) ; if ( placeholder < 0 ) { // processing constant part
if ( ch == '{' ) { changed = true ; if ( i + 1 < patternLength && pattern . charAt ( i + 1 ) == '{' ) { buffer . append ( ch ) ; // handle escaped ' { '
++ i ; } else { placeholder = 0 ; // switch to placeholder part
} } else { buffer . append ( ch ) ; } } else { // processing placeholder part
if ( ch == '}' ) { if ( placeholder >= args . length ) { throw new IllegalArgumentException ( "Argument index out of bounds: " + placeholder ) ; } if ( pattern . charAt ( i - 1 ) == '{' ) { throw new IllegalArgumentException ( "Missing argument index after a left curly brace" ) ; } if ( args [ placeholder ] == null ) { buffer . append ( "null" ) ; // append null argument
} else { buffer . append ( args [ placeholder ] . toString ( ) ) ; // append actual argument
} placeholder = - 1 ; // switch to constant part
} else { if ( ch < '0' || ch > '9' ) { throw new IllegalArgumentException ( "Unexpected '" + ch + "' while parsing argument index" ) ; } placeholder = placeholder * 10 + ch - '0' ; } } } if ( placeholder >= 0 ) { throw new IllegalArgumentException ( "Unmatched braces in the pattern." ) ; } return changed ? buffer . toString ( ) : pattern ;
|
public class BatchTask { /** * Closes all chained tasks , in the order as they are stored in the array . The closing process
* creates a standardized log info message .
* @ param tasks The tasks to be closed .
* @ param parent The parent task , used to obtain parameters to include in the log message .
* @ throws Exception Thrown , if the closing encounters an exception . */
public static void closeChainedTasks ( List < ChainedDriver < ? , ? > > tasks , AbstractInvokable parent ) throws Exception { } }
|
for ( int i = 0 ; i < tasks . size ( ) ; i ++ ) { final ChainedDriver < ? , ? > task = tasks . get ( i ) ; task . closeTask ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( constructLogString ( "Finished task code" , task . getTaskName ( ) , parent ) ) ; } }
|
public class GetGlue { /** * Request an access token from tvtag . Builds the request with { @ link # getAccessTokenRequest ( String , String , String ,
* String ) } and executes it , then returns the response which includes the access and refresh tokens .
* @ param clientId The OAuth client id obtained from tvtag .
* @ param clientSecret The OAuth client secret obtained from tvtag .
* @ param redirectUri The redirect URI previously used for obtaining the auth code .
* @ param authCode A previously obtained auth code .
* @ return A new OAuth access and refresh token from tvtag .
* @ throws OAuthSystemException
* @ throws OAuthProblemException */
public static OAuthAccessTokenResponse getAccessTokenResponse ( String clientId , String clientSecret , String redirectUri , String authCode ) throws OAuthSystemException , OAuthProblemException { } }
|
OAuthClientRequest request = getAccessTokenRequest ( clientId , clientSecret , redirectUri , authCode ) ; // create HTTP client which is able to follow protocol redirects ( tvtag likes to redirect from HTTPS to HTTP )
OAuthClient client = new OAuthClient ( new GetGlueHttpClient ( ) ) ; return client . accessToken ( request ) ;
|
public class RelatedTablesCoreExtension { /** * Remove a specific relationship from the GeoPackage
* @ param extendedRelation
* extended relation */
public void removeRelationship ( ExtendedRelation extendedRelation ) { } }
|
try { if ( extendedRelationsDao . isTableExists ( ) ) { geoPackage . deleteTable ( extendedRelation . getMappingTableName ( ) ) ; extendedRelationsDao . delete ( extendedRelation ) ; } } catch ( SQLException e ) { throw new GeoPackageException ( "Failed to remove relationship '" + extendedRelation . getRelationName ( ) + "' between " + extendedRelation . getBaseTableName ( ) + " and " + extendedRelation . getRelatedTableName ( ) + " with mapping table " + extendedRelation . getMappingTableName ( ) , e ) ; }
|
public class Choice4 { /** * { @ inheritDoc } */
@ Override public < E > Choice4 < A , B , C , D > discardR ( Applicative < E , Choice4 < A , B , C , ? > > appB ) { } }
|
return Monad . super . discardR ( appB ) . coerce ( ) ;
|
public class CommerceUserSegmentEntryPersistenceImpl { /** * Removes the commerce user segment entry where groupId = & # 63 ; and key = & # 63 ; from the database .
* @ param groupId the group ID
* @ param key the key
* @ return the commerce user segment entry that was removed */
@ Override public CommerceUserSegmentEntry removeByG_K ( long groupId , String key ) throws NoSuchUserSegmentEntryException { } }
|
CommerceUserSegmentEntry commerceUserSegmentEntry = findByG_K ( groupId , key ) ; return remove ( commerceUserSegmentEntry ) ;
|
public class SarlAssertExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } }
|
switch ( featureID ) { case SarlPackage . SARL_ASSERT_EXPRESSION__CONDITION : return condition != null ; case SarlPackage . SARL_ASSERT_EXPRESSION__MESSAGE : return MESSAGE_EDEFAULT == null ? message != null : ! MESSAGE_EDEFAULT . equals ( message ) ; case SarlPackage . SARL_ASSERT_EXPRESSION__IS_STATIC : return isStatic != IS_STATIC_EDEFAULT ; } return super . eIsSet ( featureID ) ;
|
public class TemplateParser { /** * Validate that all the required properties of a local components are present on a the HTML
* { @ link Element } that represents it .
* @ param localComponent The { @ link LocalComponent } we want to check
* @ param foundProps The props we found on the HTML { @ link Element } during processing */
private void validateRequiredProps ( LocalComponent localComponent , Set < LocalComponentProp > foundProps ) { } }
|
String missingRequiredProps = localComponent . getRequiredProps ( ) . stream ( ) . filter ( prop -> ! foundProps . contains ( prop ) ) . map ( prop -> "\"" + propNameToAttributeName ( prop . getPropName ( ) ) + "\"" ) . collect ( Collectors . joining ( "," ) ) ; if ( ! missingRequiredProps . isEmpty ( ) ) { logger . error ( "Missing required property: " + missingRequiredProps + " on child component \"" + localComponent . getComponentTagName ( ) + "\"" ) ; }
|
public class Filter { /** * Returns a { @ code Filter } that only runs the single method described by
* { @ code desiredDescription } */
public static Filter matchMethodDescription ( final Description desiredDescription ) { } }
|
return new Filter ( ) { @ Override public boolean shouldRun ( Description description ) { if ( description . isTest ( ) ) { return desiredDescription . equals ( description ) ; } // explicitly check if any children want to run
for ( Description each : description . getChildren ( ) ) { if ( shouldRun ( each ) ) { return true ; } } return false ; } @ Override public String describe ( ) { return String . format ( "Method %s" , desiredDescription . getDisplayName ( ) ) ; } } ;
|
public class SDMath { /** * As per { @ link # eye ( String , int , int , DataType ) } but with the default datatype , { @ link Eye # DEFAULT _ DTYPE } */
public SDVariable eye ( String name , int rows , int cols ) { } }
|
return eye ( name , rows , cols , Eye . DEFAULT_DTYPE ) ;
|
public class GetPatchBaselineResult { /** * Patch groups included in the patch baseline .
* @ param patchGroups
* Patch groups included in the patch baseline . */
public void setPatchGroups ( java . util . Collection < String > patchGroups ) { } }
|
if ( patchGroups == null ) { this . patchGroups = null ; return ; } this . patchGroups = new com . amazonaws . internal . SdkInternalList < String > ( patchGroups ) ;
|
public class JSONJacksonImpl { /** * { @ inheritDoc } */
@ Override public void serializeToFile ( File out , Object pojo ) throws JSONMarshallException { } }
|
try { mapper . writeValue ( out , pojo ) ; } catch ( JsonMappingException e ) { throw new JSONMarshallException ( "Unable to parse non-well-formed content" , e ) ; } catch ( JsonGenerationException e ) { throw new JSONMarshallException ( "Error during JSON writing" , e ) ; } catch ( IOException e ) { throw new JSONMarshallException ( "I/O exception of some sort has occurred" , e ) ; }
|
public class ContextedRuntimeException { /** * Adds information helpful to a developer in diagnosing and correcting the problem .
* For the information to be meaningful , the value passed should have a reasonable
* toString ( ) implementation .
* Different values can be added with the same label multiple times .
* Note : This exception is only serializable if the object added is serializable .
* @ param label a textual label associated with information , { @ code null } not recommended
* @ param value information needed to understand exception , may be { @ code null }
* @ return { @ code this } , for method chaining , not { @ code null } */
@ Override public ContextedRuntimeException addContextValue ( final String label , final Object value ) { } }
|
exceptionContext . addContextValue ( label , value ) ; return this ;
|
public class TupleCombiner { /** * Returns all valid tuples of values for the given input variables . */
private static Collection < Tuple > getTuples ( List < VarDef > varDefs , int varStart , int varEnd , int tupleSize ) { } }
|
Collection < Tuple > tuples = new ArrayList < Tuple > ( ) ; // For each variable up to the last included . . .
for ( int i = varStart ; i < varEnd ; i ++ ) { // Combine each valid value . . .
VarDef nextVar = varDefs . get ( i ) ; Iterator < VarValueDef > values = nextVar . getValidValues ( ) ; if ( ! values . hasNext ( ) ) { throw new IllegalStateException ( "Can't complete tuples -- no valid values defined for var=" + nextVar ) ; } // With all subtuples from the remaining variables .
Collection < Tuple > subTuples = tupleSize == 1 ? null : getTuples ( varDefs , i + 1 , varEnd + 1 , tupleSize - 1 ) ; // Only one variable to combine ?
if ( subTuples == null ) { // Yes , return list of 1 - tuples for this variable .
while ( values . hasNext ( ) ) { tuples . add ( new Tuple ( new VarBindingDef ( nextVar , values . next ( ) ) ) ) ; } } // Any compatible subtuples for remaining variables ?
else if ( ! subTuples . isEmpty ( ) ) { // Yes , add all compatible combinations with values for this variable .
while ( values . hasNext ( ) ) { VarBindingDef nextBinding = new VarBindingDef ( nextVar , values . next ( ) ) ; for ( Tuple subTuple : subTuples ) { Tuple nextTuple = new Tuple ( nextBinding ) . addAll ( subTuple ) ; if ( nextTuple . isCompatible ( ) ) { tuples . add ( nextTuple ) ; } } } } } return tuples ;
|
public class BaseSingleFieldPeriod { /** * Calculates the number of whole units between the two specified datetimes .
* @ param start the start instant , validated to not be null
* @ param end the end instant , validated to not be null
* @ param field the field type to use , must not be null
* @ return the period
* @ throws IllegalArgumentException if the instants are null or invalid */
protected static int between ( ReadableInstant start , ReadableInstant end , DurationFieldType field ) { } }
|
if ( start == null || end == null ) { throw new IllegalArgumentException ( "ReadableInstant objects must not be null" ) ; } Chronology chrono = DateTimeUtils . getInstantChronology ( start ) ; int amount = field . getField ( chrono ) . getDifference ( end . getMillis ( ) , start . getMillis ( ) ) ; return amount ;
|
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcGridAxis ( ) { } }
|
if ( ifcGridAxisEClass == null ) { ifcGridAxisEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 272 ) ; } return ifcGridAxisEClass ;
|
public class CmsJspStatusBean { /** * Include a template part to display on the error page . < p >
* @ param target the target uri of the file in the OpenCms VFS ( can be relative or absolute )
* @ param element the element ( template selector ) to display from the target
* @ param parameterMap a map of the request parameters
* @ throws JspException in case there were problems including the target */
public void includeTemplatePart ( String target , String element , Map < String , Object > parameterMap ) throws JspException { } }
|
// store current site root and URI
String currentSiteRoot = getRequestContext ( ) . getSiteRoot ( ) ; String currentUri = getRequestContext ( ) . getUri ( ) ; try { // set site root and URI to display template part correct
getRequestContext ( ) . setSiteRoot ( getSiteRoot ( ) ) ; getRequestContext ( ) . setUri ( getTemplateUri ( ) ) ; // include the template part
include ( target , element , parameterMap ) ; } finally { // reset site root and requested URI to status JSP
getRequestContext ( ) . setSiteRoot ( currentSiteRoot ) ; getRequestContext ( ) . setUri ( currentUri ) ; }
|
public class CmsSitemapTreeItem { /** * Given the path of a sitemap entry , this method returns the URL which should be displayed to the user . < p >
* @ param sitePath the site path of a sitemap entry
* @ return the URL which should be displayed to the user */
public String getDisplayedUrl ( String sitePath ) { } }
|
if ( getSitemapEntry ( ) . isLeafType ( ) && sitePath . endsWith ( "/" ) ) { sitePath = sitePath . substring ( 0 , sitePath . length ( ) - 1 ) ; } CmsSitemapController controller = CmsSitemapView . getInstance ( ) . getController ( ) ; String exportProp = controller . getEffectiveProperty ( getSitemapEntry ( ) , "export" ) ; if ( "true" . equals ( exportProp ) ) { String exportName = getSitemapEntry ( ) . getExportName ( ) ; if ( exportName == null ) { exportName = CmsCoreProvider . get ( ) . getSiteRoot ( ) ; } String rfsPrefix = CmsSitemapView . getInstance ( ) . getController ( ) . getData ( ) . getExportRfsPrefix ( ) ; if ( rfsPrefix != null ) { return CmsStringUtil . joinPaths ( rfsPrefix , exportName , sitePath ) ; } } return CmsCoreProvider . get ( ) . link ( sitePath ) ;
|
public class ChatApi { /** * Accept a chat
* Accept the specified chat interaction .
* @ param id The ID of the chat interaction . ( required )
* @ param acceptData Request parameters . ( optional )
* @ return ApiSuccessResponse
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiSuccessResponse acceptChat ( String id , AcceptData acceptData ) throws ApiException { } }
|
ApiResponse < ApiSuccessResponse > resp = acceptChatWithHttpInfo ( id , acceptData ) ; return resp . getData ( ) ;
|
public class VoltFile { /** * Do some basic checking to make sure that the root for all the subroots
* exists and can be manipulated */
private static void ensureUserRootExists ( ) throws IOException { } }
|
if ( ! m_root . exists ( ) ) { if ( ! m_root . mkdir ( ) ) { throw new IOException ( "Unable to create \"" + m_root + "\"" ) ; } } if ( ! m_root . isDirectory ( ) ) { throw new IOException ( "\"" + m_root + "\" exists but is not a directory" ) ; } if ( ! m_root . canRead ( ) ) { throw new IOException ( "\"" + m_root + "\" exists but is not readable" ) ; } if ( ! m_root . canWrite ( ) ) { throw new IOException ( "\"" + m_root + "\" exists but is not writable" ) ; } if ( ! m_root . canExecute ( ) ) { throw new IOException ( "\"" + m_root + "\" exists but is not executable" ) ; }
|
public class FigShareClient { /** * Upload a file to an article .
* @ param articleId article ID
* @ param file java . io . File file
* @ return org . biouno . figshare . v1 . model . File uploaded file , without the thumbnail URL */
public org . biouno . figshare . v1 . model . File uploadFile ( long articleId , File file ) { } }
|
HttpClient httpClient = null ; try { final String method = String . format ( "my_data/articles/%d/files" , articleId ) ; // create an HTTP request to a protected resource
final String url = getURL ( endpoint , version , method ) ; // create an HTTP request to a protected resource
final HttpPut request = new HttpPut ( url ) ; MultipartEntityBuilder builder = MultipartEntityBuilder . create ( ) ; ContentBody body = new FileBody ( file ) ; FormBodyPart part = FormBodyPartBuilder . create ( "filedata" , body ) . build ( ) ; builder . addPart ( part ) ; HttpEntity entity = builder . build ( ) ; request . setEntity ( entity ) ; // sign the request
consumer . sign ( request ) ; // send the request
httpClient = HttpClientBuilder . create ( ) . build ( ) ; HttpResponse response = httpClient . execute ( request ) ; HttpEntity responseEntity = response . getEntity ( ) ; String json = EntityUtils . toString ( responseEntity ) ; org . biouno . figshare . v1 . model . File uploadedFile = readFileFromJson ( json ) ; return uploadedFile ; } catch ( OAuthCommunicationException e ) { throw new FigShareClientException ( "Failed to get articles: " + e . getMessage ( ) , e ) ; } catch ( OAuthMessageSignerException e ) { throw new FigShareClientException ( "Failed to get articles: " + e . getMessage ( ) , e ) ; } catch ( OAuthExpectationFailedException e ) { throw new FigShareClientException ( "Failed to get articles: " + e . getMessage ( ) , e ) ; } catch ( ClientProtocolException e ) { throw new FigShareClientException ( "Failed to get articles: " + e . getMessage ( ) , e ) ; } catch ( IOException e ) { throw new FigShareClientException ( "Failed to get articles: " + e . getMessage ( ) , e ) ; }
|
public class CyclicBarrier { /** * Waits until all { @ linkplain # getParties parties } have invoked
* { @ code await } on this barrier , or the specified waiting time elapses .
* < p > If the current thread is not the last to arrive then it is
* disabled for thread scheduling purposes and lies dormant until
* one of the following things happens :
* < ul >
* < li > The last thread arrives ; or
* < li > The specified timeout elapses ; or
* < li > Some other thread { @ linkplain Thread # interrupt interrupts }
* the current thread ; or
* < li > Some other thread { @ linkplain Thread # interrupt interrupts }
* one of the other waiting threads ; or
* < li > Some other thread times out while waiting for barrier ; or
* < li > Some other thread invokes { @ link # reset } on this barrier .
* < / ul >
* < p > If the current thread :
* < ul >
* < li > has its interrupted status set on entry to this method ; or
* < li > is { @ linkplain Thread # interrupt interrupted } while waiting
* < / ul >
* then { @ link InterruptedException } is thrown and the current thread ' s
* interrupted status is cleared .
* < p > If the specified waiting time elapses then { @ link TimeoutException }
* is thrown . If the time is less than or equal to zero , the
* method will not wait at all .
* < p > If the barrier is { @ link # reset } while any thread is waiting ,
* or if the barrier { @ linkplain # isBroken is broken } when
* { @ code await } is invoked , or while any thread is waiting , then
* { @ link BrokenBarrierException } is thrown .
* < p > If any thread is { @ linkplain Thread # interrupt interrupted } while
* waiting , then all other waiting threads will throw { @ link
* BrokenBarrierException } and the barrier is placed in the broken
* state .
* < p > If the current thread is the last thread to arrive , and a
* non - null barrier action was supplied in the constructor , then the
* current thread runs the action before allowing the other threads to
* continue .
* If an exception occurs during the barrier action then that exception
* will be propagated in the current thread and the barrier is placed in
* the broken state .
* @ param timeout the time to wait for the barrier
* @ param unit the time unit of the timeout parameter
* @ return the arrival index of the current thread , where index
* { @ code getParties ( ) - 1 } indicates the first
* to arrive and zero indicates the last to arrive
* @ throws InterruptedException if the current thread was interrupted
* while waiting
* @ throws TimeoutException if the specified timeout elapses .
* In this case the barrier will be broken .
* @ throws BrokenBarrierException if < em > another < / em > thread was
* interrupted or timed out while the current thread was
* waiting , or the barrier was reset , or the barrier was broken
* when { @ code await } was called , or the barrier action ( if
* present ) failed due to an exception */
public int await ( long timeout , TimeUnit unit ) throws InterruptedException , BrokenBarrierException , TimeoutException { } }
|
return dowait ( true , unit . toNanos ( timeout ) ) ;
|
public class NativeImageLoader { /** * Read multipage tiff and load into INDArray
* @ param bytes
* @ return INDArray
* @ throws IOException */
private INDArray asMatrix ( BytePointer bytes , long length ) throws IOException { } }
|
PIXA pixa ; pixa = pixaReadMemMultipageTiff ( bytes , length ) ; INDArray data ; INDArray currentD ; INDArrayIndex [ ] index = null ; switch ( this . multiPageMode ) { case MINIBATCH : data = Nd4j . create ( pixa . n ( ) , 1 , pixa . pix ( 0 ) . h ( ) , pixa . pix ( 0 ) . w ( ) ) ; break ; case CHANNELS : data = Nd4j . create ( 1 , pixa . n ( ) , pixa . pix ( 0 ) . h ( ) , pixa . pix ( 0 ) . w ( ) ) ; break ; case FIRST : data = Nd4j . create ( 1 , 1 , pixa . pix ( 0 ) . h ( ) , pixa . pix ( 0 ) . w ( ) ) ; PIX pix = pixa . pix ( 0 ) ; currentD = asMatrix ( convert ( pix ) ) ; pixDestroy ( pix ) ; index = new INDArrayIndex [ ] { NDArrayIndex . point ( 0 ) , NDArrayIndex . point ( 0 ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) } ; data . put ( index , currentD . get ( NDArrayIndex . all ( ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) ) ) ; return data ; default : throw new UnsupportedOperationException ( "Unsupported MultiPageMode: " + multiPageMode ) ; } for ( int i = 0 ; i < pixa . n ( ) ; i ++ ) { PIX pix = pixa . pix ( i ) ; currentD = asMatrix ( convert ( pix ) ) ; pixDestroy ( pix ) ; // TODO to change when 16 - bit image is supported
switch ( this . multiPageMode ) { case MINIBATCH : index = new INDArrayIndex [ ] { NDArrayIndex . point ( i ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) } ; break ; case CHANNELS : index = new INDArrayIndex [ ] { NDArrayIndex . all ( ) , NDArrayIndex . point ( i ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) } ; break ; default : throw new UnsupportedOperationException ( "Unsupported MultiPageMode: " + multiPageMode ) ; } data . put ( index , currentD . get ( NDArrayIndex . all ( ) , NDArrayIndex . all ( ) , NDArrayIndex . all ( ) ) ) ; } return data ;
|
public class Parser { /** * syck _ parser _ str */
public void str ( Pointer ptr , int len , IoStrRead read ) { } }
|
resetCursor ( ) ; io_type = IOType . Str ; JechtIO . Str ss = new JechtIO . Str ( ) ; io = ss ; ss . beg = ptr . start ; ss . ptr = ptr ; ss . end = ptr . start + len ; if ( read == null ) { ss . read = new IoStrRead . Default ( ) ; } else { ss . read = read ; }
|
public class AzkabanClient { /** * Execute a flow with flow parameters . The project and flow should be created first .
* @ param projectName project name
* @ param flowName flow name
* @ param flowParameters flow parameters
* @ return The status object which contains success status and execution id . */
public AzkabanExecuteFlowStatus executeFlow ( String projectName , String flowName , Map < String , String > flowParameters ) throws AzkabanClientException { } }
|
return executeFlowWithOptions ( projectName , flowName , null , flowParameters ) ;
|
public class Sha1Hasher { /** * Creates a base 64 encoded SHA - 1 hash of the specified string .
* @ param str The string to hash .
* @ return The hashed and encoded string . */
public static String hash ( final String str ) { } }
|
try { final MessageDigest md = new Sha1 ( ) ; final byte [ ] hashed = md . digest ( str . getBytes ( "UTF-8" ) ) ; final byte [ ] encoded = Base64 . encodeBase64 ( hashed ) ; return new String ( encoded , "UTF-8" ) ; } catch ( final UnsupportedEncodingException e ) { LOG . error ( "Encoding error??" , e ) ; return "" ; }
|
public class SalesforceApi { /** * Salesforce API requires to use TLSv1.1 or upper .
* Java 8 have TLS 1.2 enabled by default . java 7 - no , you should invoke this method or turn TLS & gt ; = 1.1 somehow
* else < / p >
* @ throws java . security . NoSuchAlgorithmException in case your jvm doesn ' t support TLSv1.1 or higher
* @ throws java . security . KeyManagementException unexpected Exception from
* { @ link SSLContext # init ( javax . net . ssl . KeyManager [ ] , javax . net . ssl . TrustManager [ ] , java . security . SecureRandom ) }
* @ throws java . io . IOException unexpected Exception from { @ link javax . net . ssl . SSLSocketFactory # createSocket ( ) } */
public static void initTLSv11orUpper ( ) throws NoSuchAlgorithmException , KeyManagementException , IOException { } }
|
final SSLSocket socket = ( SSLSocket ) SSLContext . getDefault ( ) . getSocketFactory ( ) . createSocket ( ) ; if ( isTLSv11orUpperEnabled ( socket ) ) { return ; } final String [ ] supportedProtocols = socket . getSupportedProtocols ( ) ; Arrays . sort ( supportedProtocols ) ; for ( int i = supportedProtocols . length - 1 ; i >= 0 ; i -- ) { final String supportedProtocol = supportedProtocols [ i ] ; if ( supportedProtocol . startsWith ( "TLSv1." ) ) { final SSLContext context = SSLContext . getInstance ( supportedProtocol ) ; context . init ( null , null , null ) ; SSLContext . setDefault ( context ) ; return ; } } throw new NoSuchAlgorithmException ( "for Salesforce API to work you need jvm with TLS 1.1 or higher support" ) ;
|
public class Proposal { /** * Sets the actualExpiryTime value for this Proposal .
* @ param actualExpiryTime * The actual date and time at which the inventory reserved by
* the { @ link Proposal } will expire .
* < span class = " constraint Applicable " > This attribute
* is applicable when : < ul > < li > using programmatic guaranteed , using sales
* management . < / li > < li > not using programmatic , using sales management . < / li > < / ul > < / span >
* < span class = " constraint ReadOnly " > This attribute is read - only when : < ul > < li > using
* programmatic guaranteed , using sales management . < / li > < li > not using
* programmatic , using sales management . < / li > < / ul > < / span > */
public void setActualExpiryTime ( com . google . api . ads . admanager . axis . v201902 . DateTime actualExpiryTime ) { } }
|
this . actualExpiryTime = actualExpiryTime ;
|
public class PluginController { /** * Returns an entity containing settings for a plugin or null if no settings exist .
* @ return entity or null */
@ SuppressWarnings ( "WeakerAccess" ) public Entity getPluginSettings ( ) { } }
|
String entityTypeId = DefaultSettingsEntityType . getSettingsEntityName ( getId ( ) ) ; return RunAsSystemAspect . runAsSystem ( ( ) -> getPluginSettings ( entityTypeId ) ) ;
|
public class JsType { /** * Returns a type expression for a record member . In some cases this requires additional parens . */
public String typeExprForRecordMember ( boolean isOptional ) { } }
|
if ( typeExpressions . size ( ) > 1 || isOptional ) { // needs parens
return "(" + typeExpr ( ) + ( isOptional && ! typeExpressions . contains ( "undefined" ) ? "|undefined" : "" ) + ")" ; } return typeExpr ( ) ;
|
public class TemplateRest { /** * Deletes a template given the corresponding template _ id
* < pre >
* DELETE / templates / { template _ id }
* Request :
* DELETE / templates HTTP / 1.1
* Response :
* { @ code
* < ? xml version = " 1.0 " encoding = " UTF - 8 " standalone = " yes " ? >
* < message code = " 204 " message = " The template with uuid : contract - template - 2007-12-04 was deleted successfully " / >
* < / pre >
* Example : < li > curl - X DELETE
* localhost : 8080 / sla - service / templates / contract - template - 2007-12-04 < / li >
* @ param id
* of the template
* @ throws Exception */
@ DELETE @ Path ( "{uuid}" ) @ Produces ( MediaType . APPLICATION_XML ) public Response deleteTemplate ( @ PathParam ( "uuid" ) String uuid ) { } }
|
logger . debug ( "DELETE /templates/" + uuid ) ; TemplateHelper templateRestService = getTemplateHelper ( ) ; boolean deleted ; try { deleted = templateRestService . deleteTemplateByUuid ( uuid ) ; if ( deleted ) return buildResponse ( 204 , printMessage ( 204 , "The template with uuid:" + uuid + " was deleted successfully" ) ) ; else return buildResponse ( 404 , printError ( 404 , "There is no template with uuid " + uuid + " in the SLA Repository Database" ) ) ; } catch ( HelperException e ) { // TODO Auto - generated catch block
return buildResponse ( e ) ; }
|
public class RelationalOperationsMatrix { /** * with the boundary of Line B . */
private void boundaryAreaBoundaryLine_ ( int half_edge , int id_a , int id_b , int cluster_index_b ) { } }
|
if ( m_matrix [ MatrixPredicate . BoundaryBoundary ] == 0 ) return ; if ( m_topo_graph . getHalfEdgeUserIndex ( m_topo_graph . getHalfEdgePrev ( m_topo_graph . getHalfEdgeTwin ( half_edge ) ) , m_visited_index ) != 1 ) { int cluster = m_topo_graph . getHalfEdgeTo ( half_edge ) ; int clusterParentage = m_topo_graph . getClusterParentage ( cluster ) ; if ( ( clusterParentage & id_a ) != 0 ) { int index = m_topo_graph . getClusterUserIndex ( cluster , cluster_index_b ) ; if ( ( clusterParentage & id_b ) != 0 && ( index % 2 != 0 ) ) { assert ( index != - 1 ) ; m_matrix [ MatrixPredicate . BoundaryBoundary ] = 0 ; } } }
|
public class KeyVaultClientBaseImpl { /** * Deletes a SAS definition from a specified storage account . This operation requires the storage / deletesas permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param storageAccountName The name of the storage account .
* @ param sasDefinitionName The name of the SAS definition .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws KeyVaultErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the DeletedSasDefinitionBundle object if successful . */
public DeletedSasDefinitionBundle deleteSasDefinition ( String vaultBaseUrl , String storageAccountName , String sasDefinitionName ) { } }
|
return deleteSasDefinitionWithServiceResponseAsync ( vaultBaseUrl , storageAccountName , sasDefinitionName ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class AdTrackingBenchmark { /** * Main routine creates a benchmark instance and kicks off the run method .
* @ param args Command line arguments .
* @ throws Exception if anything goes wrong .
* @ see { @ link VoterConfig } */
public static void main ( String [ ] args ) throws Exception { } }
|
AdPerformanceConfig config = new AdPerformanceConfig ( ) ; config . parse ( AdTrackingBenchmark . class . getName ( ) , args ) ; AdTrackingBenchmark benchmark = new AdTrackingBenchmark ( config ) ; benchmark . runBenchmark ( ) ;
|
public class KappaShapeIndicesDescriptor { /** * calculates the kier shape indices for an atom container
* @ param container AtomContainer
* @ return kier1 , kier2 and kier3 are returned as arrayList of doubles */
@ Override public DescriptorValue calculate ( IAtomContainer container ) { } }
|
IAtomContainer atomContainer ; try { atomContainer = ( IAtomContainer ) container . clone ( ) ; } catch ( CloneNotSupportedException e ) { DoubleArrayResult kierValues = new DoubleArrayResult ( 3 ) ; kierValues . add ( Double . NaN ) ; kierValues . add ( Double . NaN ) ; kierValues . add ( Double . NaN ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , kierValues , getDescriptorNames ( ) ) ; } atomContainer = AtomContainerManipulator . removeHydrogens ( atomContainer ) ; // org . openscience . cdk . interfaces . IAtom [ ] atoms = atomContainer . getAtoms ( ) ;
java . util . List firstAtomNeighboors ; java . util . List secondAtomNeighboors ; java . util . List thirdAtomNeighboors ; DoubleArrayResult kierValues = new DoubleArrayResult ( 3 ) ; double bond1 ; double bond2 ; double bond3 ; double kier1 ; double kier2 ; double kier3 ; double atomsCount = atomContainer . getAtomCount ( ) ; ArrayList < Double > singlePaths = new ArrayList < Double > ( ) ; ArrayList < String > doublePaths = new ArrayList < String > ( ) ; ArrayList < String > triplePaths = new ArrayList < String > ( ) ; double [ ] sorterFirst = new double [ 2 ] ; double [ ] sorterSecond = new double [ 3 ] ; String tmpbond2 ; String tmpbond3 ; for ( int a1 = 0 ; a1 < atomsCount ; a1 ++ ) { bond1 = 0 ; firstAtomNeighboors = atomContainer . getConnectedAtomsList ( atomContainer . getAtom ( a1 ) ) ; for ( int a2 = 0 ; a2 < firstAtomNeighboors . size ( ) ; a2 ++ ) { bond1 = atomContainer . indexOf ( atomContainer . getBond ( atomContainer . getAtom ( a1 ) , ( IAtom ) firstAtomNeighboors . get ( a2 ) ) ) ; if ( ! singlePaths . contains ( new Double ( bond1 ) ) ) { singlePaths . add ( bond1 ) ; java . util . Collections . sort ( singlePaths ) ; } secondAtomNeighboors = atomContainer . getConnectedAtomsList ( ( IAtom ) firstAtomNeighboors . get ( a2 ) ) ; for ( int a3 = 0 ; a3 < secondAtomNeighboors . size ( ) ; a3 ++ ) { bond2 = atomContainer . indexOf ( atomContainer . getBond ( ( IAtom ) firstAtomNeighboors . get ( a2 ) , ( IAtom ) secondAtomNeighboors . get ( a3 ) ) ) ; if ( ! singlePaths . contains ( new Double ( bond2 ) ) ) { singlePaths . add ( bond2 ) ; } sorterFirst [ 0 ] = bond1 ; sorterFirst [ 1 ] = bond2 ; java . util . Arrays . sort ( sorterFirst ) ; tmpbond2 = sorterFirst [ 0 ] + "+" + sorterFirst [ 1 ] ; if ( ! doublePaths . contains ( tmpbond2 ) && ( bond1 != bond2 ) ) { doublePaths . add ( tmpbond2 ) ; } thirdAtomNeighboors = atomContainer . getConnectedAtomsList ( ( IAtom ) secondAtomNeighboors . get ( a3 ) ) ; for ( int a4 = 0 ; a4 < thirdAtomNeighboors . size ( ) ; a4 ++ ) { bond3 = atomContainer . indexOf ( atomContainer . getBond ( ( IAtom ) secondAtomNeighboors . get ( a3 ) , ( IAtom ) thirdAtomNeighboors . get ( a4 ) ) ) ; if ( ! singlePaths . contains ( new Double ( bond3 ) ) ) { singlePaths . add ( bond3 ) ; } sorterSecond [ 0 ] = bond1 ; sorterSecond [ 1 ] = bond2 ; sorterSecond [ 2 ] = bond3 ; java . util . Arrays . sort ( sorterSecond ) ; tmpbond3 = sorterSecond [ 0 ] + "+" + sorterSecond [ 1 ] + "+" + sorterSecond [ 2 ] ; if ( ! triplePaths . contains ( tmpbond3 ) ) { if ( ( bond1 != bond2 ) && ( bond1 != bond3 ) && ( bond2 != bond3 ) ) { triplePaths . add ( tmpbond3 ) ; } } } } } } if ( atomsCount == 1 ) { kier1 = 0 ; kier2 = 0 ; kier3 = 0 ; } else { kier1 = ( ( ( atomsCount ) * ( ( atomsCount - 1 ) * ( atomsCount - 1 ) ) ) / ( singlePaths . size ( ) * singlePaths . size ( ) ) ) ; if ( atomsCount == 2 ) { kier2 = 0 ; kier3 = 0 ; } else { if ( doublePaths . size ( ) == 0 ) kier2 = Double . NaN ; else kier2 = ( ( ( atomsCount - 1 ) * ( ( atomsCount - 2 ) * ( atomsCount - 2 ) ) ) / ( doublePaths . size ( ) * doublePaths . size ( ) ) ) ; if ( atomsCount == 3 ) { kier3 = 0 ; } else { if ( atomsCount % 2 != 0 ) { if ( triplePaths . size ( ) == 0 ) kier3 = Double . NaN ; else kier3 = ( ( ( atomsCount - 1 ) * ( ( atomsCount - 3 ) * ( atomsCount - 3 ) ) ) / ( triplePaths . size ( ) * triplePaths . size ( ) ) ) ; } else { if ( triplePaths . size ( ) == 0 ) kier3 = Double . NaN ; else kier3 = ( ( ( atomsCount - 3 ) * ( ( atomsCount - 2 ) * ( atomsCount - 2 ) ) ) / ( triplePaths . size ( ) * triplePaths . size ( ) ) ) ; } } } } kierValues . add ( kier1 ) ; kierValues . add ( kier2 ) ; kierValues . add ( kier3 ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , kierValues , getDescriptorNames ( ) ) ;
|
public class ClassConverter { /** * Get string representation for given Java class instance . Return class canonical name . */
@ Override public String asString ( Object object ) { } }
|
assert object != null ; assert object instanceof Class ; return ( ( Class < ? > ) object ) . getCanonicalName ( ) ;
|
public class RelationType { /** * < p > Creates a new or retrieves an existing instance of RelationType with the given name . < / p >
* @ param name the name
* @ return The instance of RelationType corresponding th the give name . */
public static RelationType create ( @ NonNull String name ) { } }
|
RelationType toReturn = DynamicEnum . register ( new RelationType ( name ) ) ; values . add ( toReturn ) ; return toReturn ;
|
public class PropertyManager { /** * Loads the given property file , plus any files that are referenced by
* # include statements */
private void loadProperties ( final String filename , final int depth ) { } }
|
logger . warning ( "Loading file '" + filename + "'" ) ; final Properties properties = new Properties ( ) ; try { // Load our properties file .
for ( final InputStream io : getInputStreamsForFile ( filename ) ) { properties . load ( io ) ; logger . info ( "Property file loaded successfully (" + filename + ")" ) ; io . close ( ) ; } } catch ( final java . io . FileNotFoundException ex ) { logger . warning ( "Property file not found (" + filename + ")" ) ; } catch ( final java . io . IOException ex ) { logger . warning ( "IOException loading file: " + ex . getMessage ( ) ) ; logger . log ( Logging . Priority . FATAL . getLevel ( ) , "Error occured while loading properties file (" + filename + ")" , ex ) ; } allProperties . putAll ( properties ) ; final String includeFiles [ ] = readIncludeFiles ( filename , depth ) ; for ( final String includeFile : includeFiles ) { loadProperties ( includeFile , depth + 1 ) ; }
|
public class ProducerSequenceFactory { /** * Creates a new fetch sequence that just needs the source producer .
* @ param inputProducer the source producer
* @ return the new sequence */
private Producer < CloseableReference < CloseableImage > > newBitmapCacheGetToLocalTransformSequence ( Producer < EncodedImage > inputProducer ) { } }
|
ThumbnailProducer < EncodedImage > [ ] defaultThumbnailProducers = new ThumbnailProducer [ 1 ] ; defaultThumbnailProducers [ 0 ] = mProducerFactory . newLocalExifThumbnailProducer ( ) ; return newBitmapCacheGetToLocalTransformSequence ( inputProducer , defaultThumbnailProducers ) ;
|
public class SimpleDoubleControl { /** * { @ inheritDoc } */
@ Override public void setupValueChangedListeners ( ) { } }
|
super . setupValueChangedListeners ( ) ; field . tooltipProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> toggleTooltip ( editableSpinner ) ) ; field . errorMessagesProperty ( ) . addListener ( ( observable , oldValue , newValue ) -> toggleTooltip ( editableSpinner ) ) ;
|
public class Validate { /** * < p > Validate that the specified argument array is neither
* < code > null < / code > nor contains any elements that are < code > null < / code > ;
* otherwise throwing an exception .
* < pre > Validate . noNullElements ( myArray ) ; < / pre >
* < p > If the array is < code > null < / code > , then the message in the exception
* is & quot ; The validated object is null & quot ; . < / p >
* < p > If the array has a < code > null < / code > element , then the message in the
* exception is & quot ; The validated array contains null element at index :
* & quot ; followed by the index . < / p >
* @ param array the array to check
* @ throws IllegalArgumentException if the array is < code > null < / code > or
* an element in the array is < code > null < / code > */
public static void noNullElements ( Object [ ] array ) { } }
|
Validate . notNull ( array ) ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] == null ) { throw new IllegalArgumentException ( "The validated array contains null element at index: " + i ) ; } }
|
public class IOUtils { /** * Closes an input stream , catching and logging any exceptions .
* @ param aInputStream A supplied input stream to close */
public static void closeQuietly ( final InputStream aInputStream ) { } }
|
if ( aInputStream != null ) { try { aInputStream . close ( ) ; } catch ( final IOException details ) { LOGGER . error ( details . getMessage ( ) , details ) ; } }
|
public class DefaultEncodingStateRegistry { /** * / * ( non - Javadoc )
* @ see EncodingStateRegistry # isEncodedWith ( Encoder , java . lang . CharSequence ) */
public boolean isEncodedWith ( Encoder encoder , CharSequence string ) { } }
|
return getIdentityHashCodesForEncoder ( encoder ) . contains ( System . identityHashCode ( string ) ) ;
|
public class Call { static Flowable < Notification < TupleN < Object > > > createWithNParameters ( Single < Connection > connection , String sql , Flowable < List < Object > > parameterGroups , List < ParameterPlaceholder > parameterPlaceholders , List < Class < ? > > outClasses ) { } }
|
return connection . toFlowable ( ) . flatMap ( con -> createWithParameters ( con , sql , parameterGroups , parameterPlaceholders , ( stmt , parameters ) -> createWithNParameters ( stmt , parameters , parameterPlaceholders , outClasses ) ) ) ;
|
public class File { /** * To upload a file to Stripe , you ’ ll need to send a request of type { @ code multipart / form - data } .
* The request should contain the file you would like to upload , as well as the parameters for
* creating a file . */
public static File create ( FileCreateParams params , RequestOptions options ) throws StripeException { } }
|
checkNullTypedParams ( classUrl ( File . class , Stripe . getUploadBase ( ) ) , params ) ; return create ( params . toMap ( ) , options ) ;
|
public class ExceptionUtil { /** * d366807 */
static public Throwable findCause ( Throwable throwable ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "findCause: " + throwable ) ; Throwable cause = throwable . getCause ( ) ; if ( cause == null && throwable instanceof EJBException ) cause = ( ( EJBException ) throwable ) . getCausedByException ( ) ; if ( cause != null ) { // If the cause happens to be a WebSphere specific subclass of
// EJBException or RemoteException , then convert it to a plain
// EJBException or unwrap it , and continue looking for a
// non - internal WebSphere specific exception .
String causeMessage = null ; while ( cause instanceof ContainerException || cause instanceof UncheckedException || cause instanceof EJSPersistenceException || cause instanceof CPIException || cause instanceof CPMIException || cause instanceof CSIException || cause instanceof InjectionException || // d436080
( cause instanceof EJBException && cause instanceof WsNestedException ) ) { Throwable nextCause = cause . getCause ( ) ; if ( nextCause == null ) { // Nothing was nested in the WebSphere specific exception ,
// so convert to EJBException , copying the message and stack .
StackTraceElement [ ] stackTrace = cause . getStackTrace ( ) ; if ( causeMessage == null ) { causeMessage = cause . getMessage ( ) ; } cause = new EJBException ( causeMessage ) ; cause . setStackTrace ( stackTrace ) ; } else { if ( cause instanceof InjectionException ) { causeMessage = cause . getMessage ( ) ; } cause = nextCause ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "findCause: " + cause ) ; return cause ;
|
public class TokenCachingStrategy { /** * Puts the last refresh date into a Bundle .
* @ param bundle
* A Bundle in which the last refresh date should be stored .
* @ param value
* The long representing the last refresh date in milliseconds
* since the epoch .
* @ throws NullPointerException if the passed in Bundle is null */
public static void putLastRefreshMilliseconds ( Bundle bundle , long value ) { } }
|
Validate . notNull ( bundle , "bundle" ) ; bundle . putLong ( LAST_REFRESH_DATE_KEY , value ) ;
|
public class Task { /** * Retrieves the task mode .
* @ return task mode */
public TaskMode getTaskMode ( ) { } }
|
return BooleanHelper . getBoolean ( ( Boolean ) getCachedValue ( TaskField . TASK_MODE ) ) ? TaskMode . MANUALLY_SCHEDULED : TaskMode . AUTO_SCHEDULED ;
|
public class OperationParkerImpl { /** * Invalidates all parked operations for the migrated partition and sends a { @ link PartitionMigratingException } as a
* response .
* Invoked on the migration destination . This is executed under partition migration lock ! */
public void onPartitionMigrate ( MigrationInfo migrationInfo ) { } }
|
if ( migrationInfo . getSource ( ) == null || ! migrationInfo . getSource ( ) . isIdentical ( nodeEngine . getLocalMember ( ) ) ) { return ; } for ( WaitSet waitSet : waitSetMap . values ( ) ) { waitSet . onPartitionMigrate ( migrationInfo ) ; }
|
public class AwtImage { /** * Executes the given side effecting function on each pixel .
* @ param fn a function that accepts 3 parameters - the x , y coordinate and the pixel at that coordinate */
public void foreach ( PixelFunction fn ) { } }
|
Arrays . stream ( points ( ) ) . forEach ( p -> fn . apply ( p . x , p . y , pixel ( p ) ) ) ;
|
public class ConstraintFactory { /** * This method returns the class object of which a new instance shall be generated . To achieve
* this the class attribute of the passed element will be used to determine the class name */
private Class < ? extends Constraint > getClassObject ( final Element element ) throws ClassNotFoundException { } }
|
String className = element . getAttributeValue ( XMLTags . CLASS ) ; className = className . indexOf ( '.' ) > 0 ? className : getClass ( ) . getPackage ( ) . getName ( ) + '.' + className ; return Class . forName ( className ) . asSubclass ( Constraint . class ) ;
|
public class ExtendedSwidProcessor { /** * Defines product extended information ( tag : extended _ information ) .
* @ param extendedInformationList
* product extended information
* @ return a reference to this object . */
public ExtendedSwidProcessor setExtendedInformation ( final JAXBElement < Object > ... extendedInformationList ) { } }
|
ExtendedInformationComplexType eict = new ExtendedInformationComplexType ( ) ; if ( extendedInformationList . length > 0 ) { for ( JAXBElement < Object > extendedInformation : extendedInformationList ) { eict . getAny ( ) . add ( extendedInformation ) ; } } swidTag . getExtendedInformation ( ) . add ( eict ) ; return this ;
|
public class AppEngineResourceManager { /** * Deletes the specified entity from the Google App Engine Datastore .
* @ param entity An entity instance to be deleted . */
@ Override public void delete ( Object entity ) { } }
|
if ( entity == null ) { throw new IllegalArgumentException ( "'entity' must not be [" + entity + "]" ) ; } if ( operation != Log . Operation . GET ) { throw new IllegalStateException ( "Log [" + operation + "] -> [" + Log . Operation . DELETE + "] is not allowed: previous operation must be [" + Log . Operation . GET + "]" ) ; } operation = Log . Operation . DELETE ;
|
public class CaffeineConfiguration { /** * Set the { @ link Factory } for the { @ link Expiry } .
* @ param factory the { @ link Expiry } { @ link Factory } */
@ SuppressWarnings ( "unchecked" ) public void setExpiryFactory ( Optional < Factory < ? extends Expiry < K , V > > > factory ) { } }
|
expiryFactory = ( Factory < Expiry < K , V > > ) factory . orElse ( null ) ;
|
public class PollThread { void poll_cmd ( final WorkItem to_do ) throws DevFailed { } }
|
Util . out5 . println ( "poll_cmd --> Time = " + now . tv_sec + "," + now . tv_usec + " Dev name = " + to_do . dev . get_name ( ) + ", Cmd name = " + to_do . name ) ; Any argout ; final TimeVal before_cmd = new TimeVal ( ) ; final TimeVal after_cmd = new TimeVal ( ) ; TimeVal needed_time ; try { long ctm = System . currentTimeMillis ( ) ; before_cmd . tv_sec = ( int ) ( ctm / 1000 ) ; before_cmd . tv_usec = ( int ) ( ctm - 1000 * before_cmd . tv_sec ) * 1000 ; before_cmd . tv_sec = before_cmd . tv_sec - Tango_DELTA_T ; // Execute the command
final Any in_any = fr . esrf . TangoApi . ApiUtil . get_orb ( ) . create_any ( ) ; argout = to_do . dev . command_inout ( to_do . name , in_any ) ; ctm = System . currentTimeMillis ( ) ; after_cmd . tv_sec = ( int ) ( ctm / 1000 ) ; after_cmd . tv_usec = ( int ) ( ctm - 1000 * after_cmd . tv_sec ) * 1000 ; after_cmd . tv_sec = after_cmd . tv_sec - Tango_DELTA_T ; needed_time = time_diff ( before_cmd , after_cmd ) ; to_do . dev . get_dev_monitor ( ) . get_monitor ( ) ; final PollObj poll_obj = to_do . dev . get_polled_obj_by_type_name ( to_do . type , to_do . name ) ; poll_obj . insert_data ( argout , before_cmd , needed_time ) ; to_do . dev . get_dev_monitor ( ) . rel_monitor ( ) ; } catch ( final DevFailed e ) { final long ctm = System . currentTimeMillis ( ) ; after_cmd . tv_sec = ( int ) ( ctm / 1000 ) ; after_cmd . tv_usec = ( int ) ( ctm - 1000 * after_cmd . tv_sec ) * 1000 ; after_cmd . tv_sec = after_cmd . tv_sec - Tango_DELTA_T ; needed_time = time_diff ( before_cmd , after_cmd ) ; // to _ do . dev . get _ dev _ monitor ( ) . get _ monitor ( ) ;
try { final PollObj poll_obj = to_do . dev . get_polled_obj_by_type_name ( to_do . type , to_do . name ) ; poll_obj . insert_except ( e , before_cmd , needed_time ) ; } catch ( final DevFailed ex ) { } to_do . dev . get_dev_monitor ( ) . rel_monitor ( ) ; }
|
public class OSMParser { /** * Check if one table already exists
* @ param connection
* @ param isH2
* @ param requestedTable
* @ param osmTableName
* @ throws SQLException */
private void checkOSMTables ( Connection connection , boolean isH2 , TableLocation requestedTable , String osmTableName ) throws SQLException { } }
|
String [ ] omsTables = new String [ ] { OSMTablesFactory . TAG , OSMTablesFactory . NODE , OSMTablesFactory . NODE_TAG , OSMTablesFactory . WAY , OSMTablesFactory . WAY_NODE , OSMTablesFactory . WAY_TAG , OSMTablesFactory . RELATION , OSMTablesFactory . RELATION_TAG , OSMTablesFactory . NODE_MEMBER , OSMTablesFactory . WAY_MEMBER , OSMTablesFactory . RELATION_MEMBER } ; for ( String omsTableSuffix : omsTables ) { String osmTable = TableUtilities . caseIdentifier ( requestedTable , osmTableName + omsTableSuffix , isH2 ) ; if ( JDBCUtilities . tableExists ( connection , osmTable ) ) { throw new SQLException ( "The table " + osmTable + " already exists." ) ; } }
|
public class OperatorFromFunctionals { /** * Subscriber function that invokes an action and returns the given result . */
public static < R > OnSubscribe < R > fromAction ( Action0 action , R result ) { } }
|
return new InvokeAsync < R > ( Actions . toFunc ( action , result ) ) ;
|
public class HttpContext { /** * Log a HTTP error response .
* @ param uri The URI used for the HTTP call
* @ param response The HTTP call response */
private void logResponse ( URI uri , Response response ) { } }
|
if ( logger . isLoggable ( Level . FINE ) ) logger . fine ( uri . toString ( ) + " => " + response . getStatus ( ) ) ; if ( response . getStatus ( ) > 300 ) logger . warning ( response . toString ( ) ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.