signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JsfActionListener { /** * { @ inheritDoc } */ @ Override public void processAction ( ActionEvent event ) { } }
// throws FacesException // cette méthode est appelée par JSF RI ( Mojarra ) if ( DISABLED || ! JSF_COUNTER . isDisplayed ( ) ) { delegateActionListener . processAction ( event ) ; return ; } boolean systemError = false ; try { final String actionName = getRequestName ( event ) ; JSF_COUNTER . bindContextIncludingCpu ( actionName ) ; delegateActionListener . processAction ( event ) ; } catch ( final Error e ) { // on catche Error pour avoir les erreurs systèmes // mais pas Exception qui sont fonctionnelles en général systemError = true ; throw e ; } finally { // on enregistre la requête dans les statistiques JSF_COUNTER . addRequestForCurrentContext ( systemError ) ; }
public class CFMLEngineFactorySupport { /** * replace path placeholder with the real path , placeholders are * [ { temp - directory } , { system - directory } , { home - directory } ] * @ param path * @ return updated path */ public static String parsePlaceHolder ( String path ) { } }
if ( path == null ) return path ; // Temp if ( path . startsWith ( "{temp" ) ) { if ( path . startsWith ( "}" , 5 ) ) path = new File ( getTempDirectory ( ) , path . substring ( 6 ) ) . toString ( ) ; else if ( path . startsWith ( "-dir}" , 5 ) ) path = new File ( getTempDirectory ( ) , path . substring ( 10 ) ) . toString ( ) ; else if ( path . startsWith ( "-directory}" , 5 ) ) path = new File ( getTempDirectory ( ) , path . substring ( 16 ) ) . toString ( ) ; } // System else if ( path . startsWith ( "{system" ) ) { if ( path . charAt ( 7 ) == ':' ) { // now we read the properties name int end = path . indexOf ( '}' , 8 ) ; if ( end > 8 ) { String name = path . substring ( 8 , end ) ; String prop = System . getProperty ( name ) ; if ( prop != null ) return new File ( new File ( prop ) , path . substring ( end + 1 ) ) . getAbsolutePath ( ) ; } } else if ( path . startsWith ( "}" , 7 ) ) path = new File ( getSystemDirectory ( ) , path . substring ( 8 ) ) . toString ( ) ; else if ( path . startsWith ( "-dir}" , 7 ) ) path = new File ( getSystemDirectory ( ) , path . substring ( 12 ) ) . toString ( ) ; else if ( path . startsWith ( "-directory}" , 7 ) ) path = new File ( getSystemDirectory ( ) , path . substring ( 18 ) ) . toString ( ) ; } // env else if ( path . startsWith ( "{env:" ) ) { // now we read the properties name int end = path . indexOf ( '}' , 5 ) ; if ( end > 5 ) { String name = path . substring ( 5 , end ) ; String env = System . getenv ( name ) ; if ( env != null ) return new File ( new File ( env ) , path . substring ( end + 1 ) ) . getAbsolutePath ( ) ; } } // Home else if ( path . startsWith ( "{home" ) ) { if ( path . startsWith ( "}" , 5 ) ) path = new File ( getHomeDirectory ( ) , path . substring ( 6 ) ) . toString ( ) ; else if ( path . startsWith ( "-dir}" , 5 ) ) path = new File ( getHomeDirectory ( ) , path . substring ( 10 ) ) . toString ( ) ; else if ( path . startsWith ( "-directory}" , 5 ) ) path = new File ( getHomeDirectory ( ) , path . substring ( 16 ) ) . toString ( ) ; } // ClassLoaderDir if ( path . startsWith ( "{classloader" ) ) { if ( path . startsWith ( "}" , 12 ) ) path = new File ( getClassLoaderDirectory ( ) , path . substring ( 13 ) ) . toString ( ) ; else if ( path . startsWith ( "-dir}" , 12 ) ) path = new File ( getClassLoaderDirectory ( ) , path . substring ( 17 ) ) . toString ( ) ; else if ( path . startsWith ( "-directory}" , 12 ) ) path = new File ( getClassLoaderDirectory ( ) , path . substring ( 23 ) ) . toString ( ) ; } return path ;
public class Util { /** * Decodes a natural number from an { @ link InputStream } using vByte . * @ param is an input stream . * @ return a natural number decoded from { @ code is } using vByte . */ public static int readVByte ( final InputStream is ) throws IOException { } }
for ( int x = 0 ; ; ) { final int b = is . read ( ) ; x |= b & 0x7F ; if ( ( b & 0x80 ) == 0 ) return x ; x <<= 7 ; }
public class EchoAutoReply { /** * { @ inheritDoc } It replies with the last received message . */ public FbBotMillResponse createResponse ( MessageEnvelope envelope ) { } }
String lastMessage = safeGetMessage ( envelope ) ; return ReplyFactory . addTextMessageOnly ( lastMessage ) . build ( envelope ) ;
public class ConciseSet { /** * Gets the literal word that represents the first 31 bits of the given the * word ( i . e . the first block of a sequence word , or the bits of a literal word ) . * If the word is a literal , it returns the unmodified word . In case of a * sequence , it returns a literal that represents the first 31 bits of the * given sequence word . * @ param word word to check * @ return the literal contained within the given word , < i > with the most * significant bit set to 1 < / i > . */ private /* static */ int getLiteral ( int word ) { } }
if ( isLiteral ( word ) ) { return word ; } if ( simulateWAH ) { return isZeroSequence ( word ) ? ConciseSetUtils . ALL_ZEROS_LITERAL : ConciseSetUtils . ALL_ONES_LITERAL ; } // get bits from 30 to 26 and use them to set the corresponding bit // NOTE : " 1 < < ( word > > > 25 ) " and " 1 < < ( ( word > > > 25 ) & 0x000001F ) " are equivalent // NOTE : " > > > 1 " is required since 00000 represents no bits and 00001 the LSB bit set int literal = ( 1 << ( word >>> 25 ) ) >>> 1 ; return isZeroSequence ( word ) ? ( ConciseSetUtils . ALL_ZEROS_LITERAL | literal ) : ( ConciseSetUtils . ALL_ONES_LITERAL & ~ literal ) ;
public class IntervalCollection { /** * / * [ deutsch ] * < p > Ermittelt , ob das angegebene Intervall in dieser Menge gespeichert ist . < / p > * @ param interval the interval to be checked * @ return boolean * @ since 3.35/4.30 */ public boolean contains ( ChronoInterval < T > interval ) { } }
for ( ChronoInterval < T > i : this . intervals ) { if ( i . equals ( interval ) ) { return true ; } } return false ;
public class SARLReadAndWriteTracking { /** * Mark the given object as an assigned object after its initialization . * < p > The given object has its value changed by a assignment operation . * @ param object the written object . * @ return { @ code true } if the write flag has changed . */ public boolean markAssignmentAccess ( EObject object ) { } }
assert object != null ; if ( ! isAssigned ( object ) ) { return object . eAdapters ( ) . add ( ASSIGNMENT_MARKER ) ; } return false ;
public class Matrix2D { /** * Multiply a two element vector against this matrix . * If out is null or not length four , a new double array will be returned . * The values for vec and out can be the same ( though that ' s less efficient ) . */ public double [ ] mult ( double [ ] vec , double [ ] out ) { } }
if ( out == null || out . length != 2 ) { out = new double [ 2 ] ; } if ( vec == out ) { double tx = m00 * vec [ 0 ] + m01 * vec [ 1 ] + m02 ; double ty = m10 * vec [ 0 ] + m11 * vec [ 1 ] + m12 ; out [ 0 ] = tx ; out [ 1 ] = ty ; } else { out [ 0 ] = m00 * vec [ 0 ] + m01 * vec [ 1 ] + m02 ; out [ 1 ] = m10 * vec [ 0 ] + m11 * vec [ 1 ] + m12 ; } return out ;
public class IfElse { /** * Perform the if statement . It will pop a boolean from the data stack . If * that boolean is false the next operand if popped from the operand stack ; * if true , nothing is done . */ @ Override public Element execute ( Context context ) { } }
assert ( ops . length == 2 || ops . length == 3 ) ; // Pop the condition from the data stack . boolean condition = false ; try { condition = ( ( BooleanProperty ) ops [ 0 ] . execute ( context ) ) . getValue ( ) ; } catch ( ClassCastException cce ) { throw new EvaluationException ( MessageUtils . format ( MSG_INVALID_IF_ELSE_TEST ) , sourceRange ) ; } // Choose the correct operation and execute it . Operation op = null ; if ( condition ) { op = ops [ 1 ] ; } else if ( ops . length > 2 ) { op = ops [ 2 ] ; } else { op = Undef . VALUE ; } return op . execute ( context ) ;
public class CookieConfigTypeImpl { /** * Returns the < code > max - age < / code > element * @ return the node defined for the element < code > max - age < / code > */ public Integer getMaxAge ( ) { } }
if ( childNode . getTextValueForPatternName ( "max-age" ) != null && ! childNode . getTextValueForPatternName ( "max-age" ) . equals ( "null" ) ) { return Integer . valueOf ( childNode . getTextValueForPatternName ( "max-age" ) ) ; } return null ;
public class ThreadDumpFactory { /** * Create runtime from thread dump . * @ throws IOException File could not be loaded . */ public @ Nonnull ThreadDumpRuntime fromFile ( @ Nonnull File threadDump ) throws IOException { } }
FileInputStream fis = new FileInputStream ( threadDump ) ; try { return fromStream ( fis ) ; } finally { fis . close ( ) ; }
public class ModelImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case PureXbasePackage . MODEL__IMPORT_SECTION : return getImportSection ( ) ; case PureXbasePackage . MODEL__BLOCK : return getBlock ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class FileTag { /** * check if the content type is permitted * @ param contentType * @ throws PageException */ private static void checkContentType ( String contentType , String accept , String ext , boolean strict ) throws PageException { } }
if ( ! StringUtil . isEmpty ( ext , true ) ) { ext = ext . trim ( ) . toLowerCase ( ) ; if ( ext . startsWith ( "*." ) ) ext = ext . substring ( 2 ) ; if ( ext . startsWith ( "." ) ) ext = ext . substring ( 1 ) ; String blacklistedTypes = SystemUtil . getSystemPropOrEnvVar ( SystemUtil . SETTING_UPLOAD_EXT_BLACKLIST , SystemUtil . DEFAULT_UPLOAD_EXT_BLACKLIST ) . toLowerCase ( ) ; Array blacklist = ListUtil . listToArrayRemoveEmpty ( blacklistedTypes , ',' ) ; for ( int i = blacklist . size ( ) ; i > 0 ; i -- ) { if ( ext . equals ( Caster . toString ( blacklist . getE ( i ) ) . trim ( ) ) ) { throw new ApplicationException ( "Upload of files with extension [" + ext + "] is not permitted. " + "You can configure the " + SystemUtil . SETTING_UPLOAD_EXT_BLACKLIST + " System property or the " + SystemUtil . convertSystemPropToEnvVar ( SystemUtil . SETTING_UPLOAD_EXT_BLACKLIST ) + " Environment variable to allow that file type." ) ; } } } else ext = null ; if ( StringUtil . isEmpty ( accept , true ) ) return ; MimeType mt = MimeType . getInstance ( contentType ) , sub ; Array whishedTypes = ListUtil . listToArrayRemoveEmpty ( accept , ',' ) ; int len = whishedTypes . size ( ) ; for ( int i = 1 ; i <= len ; i ++ ) { String whishedType = Caster . toString ( whishedTypes . getE ( i ) ) . trim ( ) . toLowerCase ( ) ; if ( whishedType . equals ( "*" ) ) return ; // check mimetype if ( ListUtil . len ( whishedType , "/" , true ) == 2 ) { sub = MimeType . getInstance ( whishedType ) ; if ( mt . match ( sub ) ) return ; } // check extension if ( ext != null && ! strict ) { if ( whishedType . startsWith ( "*." ) ) whishedType = whishedType . substring ( 2 ) ; if ( whishedType . startsWith ( "." ) ) whishedType = whishedType . substring ( 1 ) ; if ( ext . equals ( whishedType ) ) return ; } } throw new ApplicationException ( "The MIME type of the uploaded file [" + contentType + "] was not accepted by the server." , "only this [" + accept + "] mime type are accepted" ) ;
public class Conversion { /** * Converts an array of Char into a long using the default ( little endian , Lsb0 ) byte and * bit ordering . * @ param src the hex string to convert * @ param srcPos the position in { @ code src } , in Char unit , from where to start the * conversion * @ param dstInit initial value of the destination long * @ param dstPos the position of the lsb , in bits , in the result long * @ param nHex the number of Chars to convert * @ return a long containing the selected bits * @ throws IllegalArgumentException if { @ code ( nHexs - 1 ) * 4 + dstPos > = 64} */ public static long hexToLong ( final String src , final int srcPos , final long dstInit , final int dstPos , final int nHex ) { } }
if ( 0 == nHex ) { return dstInit ; } if ( ( nHex - 1 ) * 4 + dstPos >= 64 ) { throw new IllegalArgumentException ( "(nHexs-1)*4+dstPos is greater or equal to than 64" ) ; } long out = dstInit ; for ( int i = 0 ; i < nHex ; i ++ ) { final int shift = i * 4 + dstPos ; final long bits = ( 0xfL & hexDigitToInt ( src . charAt ( i + srcPos ) ) ) << shift ; final long mask = 0xfL << shift ; out = ( out & ~ mask ) | bits ; } return out ;
public class JobConfigurationUtils { /** * Put all configuration properties in a given { @ link State } object into a given * { @ link Configuration } object . * @ param state the given { @ link State } object * @ param configuration the given { @ link Configuration } object */ public static void putStateIntoConfiguration ( State state , Configuration configuration ) { } }
for ( String key : state . getPropertyNames ( ) ) { configuration . set ( key , state . getProp ( key ) ) ; }
public class IPAddress { /** * Does a reverse name lookup to get the canonical host name . * Note that the canonical host name may differ on different systems , as it aligns with { @ link InetAddress # getCanonicalHostName ( ) } * In particular , on some systems the loopback address has canonical host localhost and on others the canonical host is the same loopback address . */ public HostName toCanonicalHostName ( ) { } }
HostName host = canonicalHost ; if ( host == null ) { if ( isMultiple ( ) ) { throw new IncompatibleAddressException ( this , "ipaddress.error.unavailable.numeric" ) ; } InetAddress inetAddress = toInetAddress ( ) ; String hostStr = inetAddress . getCanonicalHostName ( ) ; // note : this does not return ipv6 addresses enclosed in brackets [ ] if ( hostStr . equals ( inetAddress . getHostAddress ( ) ) ) { // we got back the address , so the host is me host = new HostName ( hostStr , new ParsedHost ( hostStr , getProvider ( ) ) ) ; host . resolvedAddress = this ; } else { // the reverse lookup succeeded in finding a host string // we might not be the default resolved address for the host , so we don ' t set that field host = new HostName ( hostStr ) ; } } return host ;
public class GPathResult { /** * Replaces the MetaClass of this GPathResult . * @ param metaClass the new MetaClass */ @ Override public void setMetaClass ( final MetaClass metaClass ) { } }
final MetaClass newMetaClass = new DelegatingMetaClass ( metaClass ) { @ Override public Object getAttribute ( final Object object , final String attribute ) { return GPathResult . this . getProperty ( "@" + attribute ) ; } @ Override public void setAttribute ( final Object object , final String attribute , final Object newValue ) { GPathResult . this . setProperty ( "@" + attribute , newValue ) ; } } ; super . setMetaClass ( newMetaClass ) ;
public class CmsDomUtil { /** * Utility method to determine if the given element has a set background image . < p > * @ param element the element * @ return < code > true < / code > if the element has a background image set */ public static boolean hasBackgroundImage ( Element element ) { } }
String backgroundImage = CmsDomUtil . getCurrentStyle ( element , Style . backgroundImage ) ; if ( ( backgroundImage == null ) || ( backgroundImage . trim ( ) . length ( ) == 0 ) || backgroundImage . equals ( StyleValue . none . toString ( ) ) ) { return false ; } return true ;
public class Basic1DMatrix { /** * Parses { @ link Basic1DMatrix } from the given Matrix Market . * @ param is the input stream in Matrix Market format * @ return a parsed matrix * @ exception IOException if an I / O error occurs . */ public static Basic1DMatrix fromMatrixMarket ( InputStream is ) throws IOException { } }
return Matrix . fromMatrixMarket ( is ) . to ( Matrices . BASIC_1D ) ;
public class DefaultGroovyMethods { /** * Sorts all Iterable members into ( sub ) groups determined by the supplied * mapping closures . Each closure should return the key that this item * should be grouped by . The returned LinkedHashMap will have an entry for each * distinct ' key path ' returned from the closures , with each value being a list * of items for that ' group path ' . * Example usage : * < pre class = " groovyTestCase " > def result = [ 1,2,3,4,5,6 ] . groupBy ( { it % 2 } , { it { @ code < } 4 } ) * assert result = = [ 1 : [ ( true ) : [ 1 , 3 ] , ( false ) : [ 5 ] ] , 0 : [ ( true ) : [ 2 ] , ( false ) : [ 4 , 6 ] ] ] < / pre > * Another example : * < pre > def sql = groovy . sql . Sql . newInstance ( / & ast ; . . . & ast ; / ) * def data = sql . rows ( " SELECT * FROM a _ table " ) . groupBy ( { it . column1 } , { it . column2 } , { it . column3 } ) * if ( data . val1 . val2 . val3 ) { * / / there exists a record where : * / / a _ table . column1 = = val1 * / / a _ table . column2 = = val2 , and * / / a _ table . column3 = = val3 * } else { * / / there is no such record * } < / pre > * If an empty array of closures is supplied the IDENTITY Closure will be used . * @ param self a collection to group * @ param closures an array of closures , each mapping entries on keys * @ return a new Map grouped by keys on each criterion * @ since 2.2.0 * @ see Closure # IDENTITY */ public static Map groupBy ( Iterable self , Object ... closures ) { } }
final Closure head = closures . length == 0 ? Closure . IDENTITY : ( Closure ) closures [ 0 ] ; @ SuppressWarnings ( "unchecked" ) Map < Object , List > first = groupBy ( self , head ) ; if ( closures . length < 2 ) return first ; final Object [ ] tail = new Object [ closures . length - 1 ] ; System . arraycopy ( closures , 1 , tail , 0 , closures . length - 1 ) ; // Arrays . copyOfRange only since JDK 1.6 // inject ( [ : ] ) { a , e { @ code - > } a { @ code < < } [ ( e . key ) : e . value . groupBy ( tail ) ] } Map < Object , Map > acc = new LinkedHashMap < Object , Map > ( ) ; for ( Map . Entry < Object , List > item : first . entrySet ( ) ) { acc . put ( item . getKey ( ) , groupBy ( ( Iterable ) item . getValue ( ) , tail ) ) ; } return acc ;
public class TldTaglibTypeImpl { /** * If not already created , a new < code > taglib - extension < / code > element will be created and returned . * Otherwise , the first existing < code > taglib - extension < / code > element will be returned . * @ return the instance defined for the element < code > taglib - extension < / code > */ public TldExtensionType < TldTaglibType < T > > getOrCreateTaglibExtension ( ) { } }
List < Node > nodeList = childNode . get ( "taglib-extension" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new TldExtensionTypeImpl < TldTaglibType < T > > ( this , "taglib-extension" , childNode , nodeList . get ( 0 ) ) ; } return createTaglibExtension ( ) ;
public class AmazonRoute53Client { /** * Updates the comment for a specified traffic policy version . * @ param updateTrafficPolicyCommentRequest * A complex type that contains information about the traffic policy that you want to update the comment for . * @ return Result of the UpdateTrafficPolicyComment operation returned by the service . * @ throws InvalidInputException * The input is not valid . * @ throws NoSuchTrafficPolicyException * No traffic policy exists with the specified ID . * @ throws ConcurrentModificationException * Another user submitted a request to create , update , or delete the object at the same time that you did . * Retry the request . * @ sample AmazonRoute53 . UpdateTrafficPolicyComment * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / route53-2013-04-01 / UpdateTrafficPolicyComment " * target = " _ top " > AWS API Documentation < / a > */ @ Override public UpdateTrafficPolicyCommentResult updateTrafficPolicyComment ( UpdateTrafficPolicyCommentRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateTrafficPolicyComment ( request ) ;
public class DrawerView { /** * Removes all items from the drawer view */ public DrawerView clearItems ( ) { } }
for ( DrawerItem item : mAdapter . getItems ( ) ) { item . detach ( ) ; } mAdapter . clear ( ) ; updateList ( ) ; return this ;
public class JoltUtils { /** * Helper / overridden method for listKeyChain ( source ) , it accepts a key - value pair for convenience * note : " key " : value ( an item in map ) and [ value ] ( an item in list ) is generalized here * as [ value ] is interpreted in json path as 1 : value * @ param key * @ param value * @ return list of Object [ ] representing path to every leaf element starting with provided root key */ public static List < Object [ ] > listKeyChains ( final Object key , final Object value ) { } }
List < Object [ ] > keyChainList = new LinkedList < > ( ) ; List < Object [ ] > childKeyChainList = listKeyChains ( value ) ; if ( childKeyChainList . size ( ) > 0 ) { for ( Object [ ] childKeyChain : childKeyChainList ) { Object [ ] keyChain = new Object [ childKeyChain . length + 1 ] ; keyChain [ 0 ] = key ; System . arraycopy ( childKeyChain , 0 , keyChain , 1 , childKeyChain . length ) ; keyChainList . add ( keyChain ) ; } } else { keyChainList . add ( new Object [ ] { key } ) ; } return keyChainList ;
public class DescribeAcceleratorRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeAcceleratorRequest describeAcceleratorRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeAcceleratorRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeAcceleratorRequest . getAcceleratorArn ( ) , ACCELERATORARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SimpleDateFormat { /** * Returns a DateFormat . Field constant associated with the specified format pattern * character . * @ param ch The pattern character * @ return DateFormat . Field associated with the pattern character */ protected DateFormat . Field patternCharToDateFormatField ( char ch ) { } }
int patternCharIndex = getIndexFromChar ( ch ) ; if ( patternCharIndex != - 1 ) { return PATTERN_INDEX_TO_DATE_FORMAT_ATTRIBUTE [ patternCharIndex ] ; } return null ;
public class CmsSystemInfo { /** * Returns the path to a configuration file . < p > * This will either be a file below / system / config / or in case an override file exists below / system / config / overrides / . < p > * @ param cms the cms ontext * @ param configFile the config file path within / system / config / * @ return the file path */ public String getConfigFilePath ( CmsObject cms , String configFile ) { } }
String path = CmsStringUtil . joinPaths ( VFS_CONFIG_OVERRIDE_FOLDER , configFile ) ; if ( ! cms . existsResource ( path ) ) { path = CmsStringUtil . joinPaths ( VFS_CONFIG_FOLDER , configFile ) ; } return path ;
public class Blob { /** * { @ inheritDoc } */ public long position ( final java . sql . Blob pattern , final long start ) throws SQLException { } }
synchronized ( this ) { if ( this . underlying == null ) { if ( start > 1 ) { throw new SQLException ( "Invalid offset: " + start ) ; } // end of if return - 1L ; } // end of if return this . underlying . position ( pattern , start ) ; } // end of sync
public class PubSubOutputHandler { /** * Creates a FLUSHED message for sending * @ param target The target cellule ( er ME ) for the message . * @ param stream The UUID of the stream the message should be sent on * @ return the new FLUSHED message * @ throws SIResourceException if the message can ' t be created . */ private ControlFlushed createControlFlushed ( SIBUuid8 target , SIBUuid12 stream ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createControlFlushed" , stream ) ; ControlFlushed flushedMsg ; // Create new message try { flushedMsg = _cmf . createNewControlFlushed ( ) ; } catch ( MessageCreateFailedException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.createControlFlushed" , "1:1424:1.164.1.5" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createControlFlushed" , e ) ; } SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler" , "1:1436:1.164.1.5" , e } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler" , "1:1444:1.164.1.5" , e } , null ) , e ) ; } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want . SIMPUtils . setGuaranteedDeliveryProperties ( flushedMsg , _messageProcessor . getMessagingEngineUuid ( ) , null , stream , null , _destinationHandler . getUuid ( ) , ProtocolType . PUBSUBINPUT , GDConfig . PROTOCOL_VERSION ) ; flushedMsg . setPriority ( SIMPConstants . CTRL_MSG_PRIORITY ) ; flushedMsg . setReliability ( Reliability . ASSURED_PERSISTENT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createControlFlushed" ) ; return flushedMsg ;
public class ClassGenerator { /** * Generate a list of import declarations given a set of imported types . */ List < String > generateImports ( Set < String > importedTypes ) { } }
List < String > importDecls = new ArrayList < > ( ) ; for ( String it : importedTypes ) { importDecls . add ( StubKind . IMPORT . format ( it ) ) ; } return importDecls ;
public class CmsContainerpageHandler { /** * Fills in label and checkbox of a menu entry . < p > * @ param entry the menu entry * @ param name the label * @ param checked true if checkbox should be shown */ protected void decorateMenuEntry ( CmsContextMenuEntry entry , String name , boolean checked ) { } }
CmsContextMenuEntryBean bean = new CmsContextMenuEntryBean ( ) ; bean . setLabel ( name ) ; bean . setActive ( true ) ; bean . setVisible ( true ) ; I_CmsInputCss inputCss = I_CmsInputLayoutBundle . INSTANCE . inputCss ( ) ; bean . setIconClass ( checked ? inputCss . checkBoxImageChecked ( ) : "" ) ; entry . setBean ( bean ) ;
public class MutableBigInteger { /** * If this MutableBigInteger cannot hold len words , increase the size * of the value array to len words . */ private final void ensureCapacity ( int len ) { } }
if ( value . length < len ) { value = new int [ len ] ; offset = 0 ; intLen = len ; }
public class KeyVaultClientBaseImpl { /** * Lists deleted SAS definitions for the specified vault and storage account . * The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft - delete . This operation requires the storage / listsas permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param storageAccountName The name of the storage account . * @ param maxresults Maximum number of results to return in a page . If not specified the service will return up to 25 results . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the PagedList & lt ; DeletedSasDefinitionItem & gt ; object wrapped in { @ link ServiceResponse } if successful . */ public Observable < ServiceResponse < Page < DeletedSasDefinitionItem > > > getDeletedSasDefinitionsSinglePageAsync ( final String vaultBaseUrl , final String storageAccountName , final Integer maxresults ) { } }
if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( storageAccountName == null ) { throw new IllegalArgumentException ( "Parameter storageAccountName is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.apiVersion() is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{vaultBaseUrl}" , vaultBaseUrl ) ; return service . getDeletedSasDefinitions ( storageAccountName , maxresults , this . apiVersion ( ) , this . acceptLanguage ( ) , parameterizedHost , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < DeletedSasDefinitionItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DeletedSasDefinitionItem > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < DeletedSasDefinitionItem > > result = getDeletedSasDefinitionsDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < DeletedSasDefinitionItem > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class Reflecter { /** * Auto exchange when the Field class type is primitive or wrapped primitive or Date * @ return */ public Reflecter < T > autoExchange ( ) { } }
if ( ! this . autoExchangeAdd ) { exchange ( Funcs . TO_BOOLEAN , booleanD ) ; exchange ( Funcs . TO_BYTE , byteD ) ; exchange ( Funcs . TO_DOUBLE , doubleD ) ; exchange ( Funcs . TO_FLOAT , floatD ) ; exchange ( Funcs . TO_INTEGER , integerD ) ; exchange ( Funcs . TO_LONG , longD ) ; exchange ( Funcs . TO_SHORT , shortD ) ; exchange ( Funcs . TO_DATE , dateD ) ; exchange ( Funcs . TO_CHARACTER , characterD ) ; exchange ( Funcs . TO_STRING , stringD ) ; exchange ( Funcs . TO_BIGDECIMAL , bigDecimalD ) ; exchange ( Funcs . TO_BIGINTEGER , bigIntegerD ) ; this . autoExchangeAdd = true ; } this . autoExchange = Boolean . TRUE ; return this ;
public class S { /** * Generalize format parameter for the sake of dynamic evaluation * @ param o * @ param pattern * @ return a formatted string representation of the object */ public static String format ( Object o , String pattern , Locale locale , String timezone ) { } }
if ( null == o ) return "" ; return format ( null , o , pattern , locale , timezone ) ;
public class IntFloatVectorSlice { /** * Gets the index of the first element in this vector with the specified * value , or - 1 if it is not present . * @ param value The value to search for . * @ param delta The delta with which to evaluate equality . * @ return The index or - 1 if not present . */ public int lookupIndex ( float value , float delta ) { } }
for ( int i = 0 ; i < size ; i ++ ) { if ( Primitives . equals ( elements [ i + start ] , value , delta ) ) { return i ; } } return - 1 ;
public class FedoraAPIMImpl { /** * ( non - Javadoc ) * @ see org . fcrepo . server . management . FedoraAPIMMTOM # modifyObject ( String pid * , ) String state , ) String label , ) String ownerId , ) String logMessage ) * */ @ Override public String modifyObject ( String pid , String state , String label , String ownerId , String logMessage ) { } }
LOG . debug ( "start: modifyObject, {}" , pid ) ; assertInitialized ( ) ; try { MessageContext ctx = context . getMessageContext ( ) ; return DateUtility . convertDateToString ( m_management . modifyObject ( ReadOnlyContext . getSoapContext ( ctx ) , pid , state , label , ownerId , logMessage , null ) ) ; } catch ( Throwable th ) { LOG . error ( "Error modifying object" , th ) ; throw CXFUtility . getFault ( th ) ; } finally { LOG . debug ( "end: modifyObject, {}" , pid ) ; }
public class Sheet { /** * Swap the positions of the two specified columns . * @ param columnKeyA * @ param columnKeyB */ public void swapColumns ( Object columnKeyA , Object columnKeyB ) { } }
checkFrozen ( ) ; final int columnIndexA = this . getColumnIndex ( columnKeyA ) ; final int columnIndexB = this . getColumnIndex ( columnKeyB ) ; final List < C > tmp = new ArrayList < > ( rowLength ( ) ) ; tmp . addAll ( _columnKeySet ) ; final C tmpColumnKeyA = tmp . get ( columnIndexA ) ; tmp . set ( columnIndexA , tmp . get ( columnIndexB ) ) ; tmp . set ( columnIndexB , tmpColumnKeyA ) ; _columnKeySet . clear ( ) ; _columnKeySet . addAll ( tmp ) ; _columnKeyIndexMap . forcePut ( tmp . get ( columnIndexA ) , columnIndexA ) ; _columnKeyIndexMap . forcePut ( tmp . get ( columnIndexB ) , columnIndexB ) ; if ( _initialized && _columnList . size ( ) > 0 ) { final List < E > tmpColumnA = _columnList . get ( columnIndexA ) ; _columnList . set ( columnIndexA , _columnList . get ( columnIndexB ) ) ; _columnList . set ( columnIndexB , tmpColumnA ) ; }
public class BaseDfuImpl { /** * A method that creates the bond to given device on API lower than Android 5. * @ param device the target device * @ return false if bonding failed ( no hidden createBond ( ) method in BluetoothDevice , or this method returned false */ private boolean createBondApi18 ( @ NonNull final BluetoothDevice device ) { } }
/* * There is a createBond ( ) method in BluetoothDevice class but for now it ' s hidden . We will call it using reflections . It has been revealed in KitKat ( Api19) */ try { final Method createBond = device . getClass ( ) . getMethod ( "createBond" ) ; mService . sendLogBroadcast ( DfuBaseService . LOG_LEVEL_DEBUG , "gatt.getDevice().createBond() (hidden)" ) ; return ( Boolean ) createBond . invoke ( device ) ; } catch ( final Exception e ) { Log . w ( TAG , "An exception occurred while creating bond" , e ) ; } return false ;
public class ShakeAroundAPI { /** * 从分组中移除设备 * @ param accessToken accessToken * @ param deviceGroupDeleteDevice deviceGroupDeleteDevice * @ return result */ public static DeviceGroupDeleteDeviceResult deviceGroupDeleteDevice ( String accessToken , DeviceGroupDeleteDevice deviceGroupDeleteDevice ) { } }
return deviceGroupDeleteDevice ( accessToken , JsonUtil . toJSONString ( deviceGroupDeleteDevice ) ) ;
public class InternalSARLParser { /** * InternalSARL . g : 13947:1 : ruleXClosure returns [ EObject current = null ] : ( ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) otherlv _ 7 = ' ] ' ) ; */ public final EObject ruleXClosure ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_1 = null ; Token otherlv_3 = null ; Token lv_explicitSyntax_5_0 = null ; Token otherlv_7 = null ; EObject lv_declaredFormalParameters_2_0 = null ; EObject lv_declaredFormalParameters_4_0 = null ; EObject lv_expression_6_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 13953:2 : ( ( ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) otherlv _ 7 = ' ] ' ) ) // InternalSARL . g : 13954:2 : ( ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) otherlv _ 7 = ' ] ' ) { // InternalSARL . g : 13954:2 : ( ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) otherlv _ 7 = ' ] ' ) // InternalSARL . g : 13955:3 : ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) otherlv _ 7 = ' ] ' { // InternalSARL . g : 13955:3 : ( ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) ) // InternalSARL . g : 13956:4 : ( ( ( ) ' [ ' ) ) = > ( ( ) otherlv _ 1 = ' [ ' ) { // InternalSARL . g : 13962:4 : ( ( ) otherlv _ 1 = ' [ ' ) // InternalSARL . g : 13963:5 : ( ) otherlv _ 1 = ' [ ' { // InternalSARL . g : 13963:5 : ( ) // InternalSARL . g : 13964:6: { if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getXClosureAccess ( ) . getXClosureAction_0_0_0 ( ) , current ) ; } } otherlv_1 = ( Token ) match ( input , 55 , FOLLOW_133 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_1 , grammarAccess . getXClosureAccess ( ) . getLeftSquareBracketKeyword_0_0_1 ( ) ) ; } } } // InternalSARL . g : 13976:3 : ( ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) ) ? int alt333 = 2 ; alt333 = dfa333 . predict ( input ) ; switch ( alt333 ) { case 1 : // InternalSARL . g : 13977:4 : ( ( ( ( ( ruleJvmFormalParameter ) ) ( ' , ' ( ( ruleJvmFormalParameter ) ) ) * ) ? ( ( ' | ' ) ) ) ) = > ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) { // InternalSARL . g : 14000:4 : ( ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) ) // InternalSARL . g : 14001:5 : ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) { // InternalSARL . g : 14001:5 : ( ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * ) ? int alt332 = 2 ; int LA332_0 = input . LA ( 1 ) ; if ( ( LA332_0 == RULE_ID || ( LA332_0 >= 44 && LA332_0 <= 45 ) || ( LA332_0 >= 92 && LA332_0 <= 95 ) ) ) { alt332 = 1 ; } switch ( alt332 ) { case 1 : // InternalSARL . g : 14002:6 : ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * { // InternalSARL . g : 14002:6 : ( ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) ) // InternalSARL . g : 14003:7 : ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) { // InternalSARL . g : 14003:7 : ( lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter ) // InternalSARL . g : 14004:8 : lv _ declaredFormalParameters _ 2_0 = ruleJvmFormalParameter { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXClosureAccess ( ) . getDeclaredFormalParametersJvmFormalParameterParserRuleCall_1_0_0_0_0 ( ) ) ; } pushFollow ( FOLLOW_134 ) ; lv_declaredFormalParameters_2_0 = ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXClosureRule ( ) ) ; } add ( current , "declaredFormalParameters" , lv_declaredFormalParameters_2_0 , "io.sarl.lang.SARL.JvmFormalParameter" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 14021:6 : ( otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) ) * loop331 : do { int alt331 = 2 ; int LA331_0 = input . LA ( 1 ) ; if ( ( LA331_0 == 32 ) ) { alt331 = 1 ; } switch ( alt331 ) { case 1 : // InternalSARL . g : 14022:7 : otherlv _ 3 = ' , ' ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) { otherlv_3 = ( Token ) match ( input , 32 , FOLLOW_75 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_3 , grammarAccess . getXClosureAccess ( ) . getCommaKeyword_1_0_0_1_0 ( ) ) ; } // InternalSARL . g : 14026:7 : ( ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) ) // InternalSARL . g : 14027:8 : ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) { // InternalSARL . g : 14027:8 : ( lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter ) // InternalSARL . g : 14028:9 : lv _ declaredFormalParameters _ 4_0 = ruleJvmFormalParameter { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXClosureAccess ( ) . getDeclaredFormalParametersJvmFormalParameterParserRuleCall_1_0_0_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_134 ) ; lv_declaredFormalParameters_4_0 = ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXClosureRule ( ) ) ; } add ( current , "declaredFormalParameters" , lv_declaredFormalParameters_4_0 , "io.sarl.lang.SARL.JvmFormalParameter" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop331 ; } } while ( true ) ; } break ; } // InternalSARL . g : 14047:5 : ( ( lv _ explicitSyntax _ 5_0 = ' | ' ) ) // InternalSARL . g : 14048:6 : ( lv _ explicitSyntax _ 5_0 = ' | ' ) { // InternalSARL . g : 14048:6 : ( lv _ explicitSyntax _ 5_0 = ' | ' ) // InternalSARL . g : 14049:7 : lv _ explicitSyntax _ 5_0 = ' | ' { lv_explicitSyntax_5_0 = ( Token ) match ( input , 97 , FOLLOW_135 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( lv_explicitSyntax_5_0 , grammarAccess . getXClosureAccess ( ) . getExplicitSyntaxVerticalLineKeyword_1_0_1_0 ( ) ) ; } if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElement ( grammarAccess . getXClosureRule ( ) ) ; } setWithLastConsumed ( current , "explicitSyntax" , true , "|" ) ; } } } } } break ; } // InternalSARL . g : 14063:3 : ( ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) ) // InternalSARL . g : 14064:4 : ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) { // InternalSARL . g : 14064:4 : ( lv _ expression _ 6_0 = ruleXExpressionInClosure ) // InternalSARL . g : 14065:5 : lv _ expression _ 6_0 = ruleXExpressionInClosure { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXClosureAccess ( ) . getExpressionXExpressionInClosureParserRuleCall_2_0 ( ) ) ; } pushFollow ( FOLLOW_63 ) ; lv_expression_6_0 = ruleXExpressionInClosure ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXClosureRule ( ) ) ; } set ( current , "expression" , lv_expression_6_0 , "org.eclipse.xtext.xbase.Xbase.XExpressionInClosure" ) ; afterParserOrEnumRuleCall ( ) ; } } } otherlv_7 = ( Token ) match ( input , 56 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_7 , grammarAccess . getXClosureAccess ( ) . getRightSquareBracketKeyword_3 ( ) ) ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class DockerClientExecutor { /** * EXecutes command to given container returning the inspection object as well . This method does 3 calls to * dockerhost . Create , Start and Inspect . * @ param containerId * to execute command . */ public ExecInspection execStartVerbose ( String containerId , String ... commands ) { } }
this . readWriteLock . readLock ( ) . lock ( ) ; try { String id = execCreate ( containerId , commands ) ; CubeOutput output = execStartOutput ( id ) ; return new ExecInspection ( output , inspectExec ( id ) ) ; } finally { this . readWriteLock . readLock ( ) . unlock ( ) ; }
public class AnalysisRunnerJobDelegate { /** * Prevents that any row processing components have input from different * tables . * @ param sourceColumnFinder * @ param componentJobs */ private void validateSingleTableInput ( final SourceColumnFinder sourceColumnFinder , final Collection < ? extends ComponentJob > componentJobs ) { } }
for ( final ComponentJob componentJob : componentJobs ) { if ( ! componentJob . getDescriptor ( ) . isMultiStreamComponent ( ) ) { Table originatingTable = null ; final InputColumn < ? > [ ] input = componentJob . getInput ( ) ; for ( final InputColumn < ? > inputColumn : input ) { final Table table = sourceColumnFinder . findOriginatingTable ( inputColumn ) ; if ( table != null ) { if ( originatingTable == null ) { originatingTable = table ; } else { if ( ! originatingTable . equals ( table ) ) { throw new IllegalArgumentException ( "Input columns in " + componentJob + " originate from different tables" ) ; } } } } } final OutputDataStreamJob [ ] outputDataStreamJobs = componentJob . getOutputDataStreamJobs ( ) ; for ( final OutputDataStreamJob outputDataStreamJob : outputDataStreamJobs ) { validateSingleTableInput ( outputDataStreamJob . getJob ( ) ) ; } }
public class AbstractRenderer { /** * The target method for paintChemModel , paintReaction , and paintMolecule . * @ param drawVisitor * the visitor to draw with * @ param diagram * the IRenderingElement tree to render */ protected void paint ( IDrawVisitor drawVisitor , IRenderingElement diagram ) { } }
if ( diagram == null ) return ; // cache the diagram for quick - redraw this . cachedDiagram = diagram ; fontManager . setFontName ( rendererModel . getParameter ( FontName . class ) . getValue ( ) ) ; fontManager . setFontStyle ( rendererModel . getParameter ( UsedFontStyle . class ) . getValue ( ) ) ; drawVisitor . setFontManager ( this . fontManager ) ; drawVisitor . setTransform ( this . transform ) ; drawVisitor . setRendererModel ( this . rendererModel ) ; diagram . accept ( drawVisitor ) ;
public class SessionDataManager { /** * Check when it ' s a Node and is versionable will a version history removed . Case of last version * in version history . * @ throws RepositoryException * @ throws ConstraintViolationException * @ throws VersionException */ public void removeVersionHistory ( String vhID , QPath containingHistory , QPath ancestorToSave ) throws RepositoryException , ConstraintViolationException , VersionException { } }
NodeData vhnode = ( NodeData ) getItemData ( vhID ) ; if ( vhnode == null ) { ItemState vhState = changesLog . getItemState ( vhID ) ; if ( vhState != null && vhState . isDeleted ( ) ) { return ; } LOG . debug ( "Version history is not found. UUID: " + vhID + ". Context item (ancestor to save) " + ancestorToSave . getAsString ( ) ) ; return ; } // mix : versionable // we have to be sure that any versionable node somewhere in repository // doesn ' t refers to a VH of the node being deleted . RepositoryImpl rep = ( RepositoryImpl ) session . getRepository ( ) ; for ( String wsName : rep . getWorkspaceNames ( ) ) { SessionImpl wsSession = session . getWorkspace ( ) . getName ( ) . equals ( wsName ) ? session : ( SessionImpl ) rep . getSystemSession ( wsName ) ; try { for ( PropertyData sref : wsSession . getTransientNodesManager ( ) . getReferencesData ( vhID , false ) ) { // Check if this VH isn ' t referenced from somewhere in workspace // or isn ' t contained in another one as a child history . // Ask ALL references incl . properties from version storage . if ( sref . getQPath ( ) . isDescendantOf ( Constants . JCR_VERSION_STORAGE_PATH ) ) { if ( ! sref . getQPath ( ) . isDescendantOf ( vhnode . getQPath ( ) ) && ( containingHistory != null ? ! sref . getQPath ( ) . isDescendantOf ( containingHistory ) : true ) ) { // has a reference to the VH in version storage , // it ' s a REFERENCE property jcr : childVersionHistory of // nt : versionedChild // i . e . this VH is a child history in an another history . // We can ' t remove this VH now . return ; } } else if ( wsSession != session ) // NOSONAR { // has a reference to the VH in traversed workspace , // it ' s not a version storage , i . e . it ' s a property of versionable // node somewhere in ws . // We can ' t remove this VH now . return ; } // else - - if we has a references in workspace where the VH is being // deleted we can remove VH now . } } finally { if ( wsSession != session ) // NOSONAR { wsSession . logout ( ) ; } } } // remove child versions from VH ( if found ) ChildVersionRemoveVisitor cvremover = new ChildVersionRemoveVisitor ( session . getTransientNodesManager ( ) , session . getWorkspace ( ) . getNodeTypesHolder ( ) , vhnode . getQPath ( ) , ancestorToSave ) ; vhnode . accept ( cvremover ) ; // remove VH delete ( vhnode , ancestorToSave , true ) ;
public class NodeCommmunicationClient { /** * 指定manager , 进行event调用 */ public Object callManager ( final Event event ) { } }
CommunicationException ex = null ; Object object = null ; for ( int i = index ; i < index + managerAddress . size ( ) ; i ++ ) { // 循环一次manager的所有地址 String address = managerAddress . get ( i % managerAddress . size ( ) ) ; try { object = delegate . call ( address , event ) ; index = i ; // 更新一下上一次成功的地址 return object ; } catch ( CommunicationException e ) { // retry next address ; ex = e ; } } throw ex ; // 走到这一步 , 说明肯定有出错了
public class RecurlyClient { /** * Get Account Adjustments * @ param accountCode recurly account id * @ param type { @ link com . ning . billing . recurly . model . Adjustments . AdjustmentType } * @ param state { @ link com . ning . billing . recurly . model . Adjustments . AdjustmentState } * @ return the adjustments on the account */ public Adjustments getAccountAdjustments ( final String accountCode , final Adjustments . AdjustmentType type , final Adjustments . AdjustmentState state ) { } }
return getAccountAdjustments ( accountCode , type , state , new QueryParams ( ) ) ;
public class SoyListData { /** * Important : Do not use outside of Soy code ( treat as superpackage - private ) . * < p > Puts data into this data object at the specified key . * @ param key An individual key . * @ param value The data to put at the specified key . */ @ Override public void putSingle ( String key , SoyData value ) { } }
set ( Integer . parseInt ( key ) , value ) ;
public class FormatUtils { /** * Converts an integer to a string , prepended with a variable amount of ' 0' * pad characters , and writes it to the given writer . * < p > This method is optimized for converting small values to strings . * @ param out receives integer converted to a string * @ param value value to convert to a string * @ param size minimum amount of digits to append */ public static void writePaddedInteger ( Writer out , int value , int size ) throws IOException { } }
if ( value < 0 ) { out . write ( '-' ) ; if ( value != Integer . MIN_VALUE ) { value = - value ; } else { for ( ; size > 10 ; size -- ) { out . write ( '0' ) ; } out . write ( "" + - ( long ) Integer . MIN_VALUE ) ; return ; } } if ( value < 10 ) { for ( ; size > 1 ; size -- ) { out . write ( '0' ) ; } out . write ( value + '0' ) ; } else if ( value < 100 ) { for ( ; size > 2 ; size -- ) { out . write ( '0' ) ; } // Calculate value div / mod by 10 without using two expensive // division operations . ( 2 ^ 27 ) / 10 = 13421772 . Add one to // value to correct rounding error . int d = ( ( value + 1 ) * 13421772 ) >> 27 ; out . write ( d + '0' ) ; // Append remainder by calculating ( value - d * 10 ) . out . write ( value - ( d << 3 ) - ( d << 1 ) + '0' ) ; } else { int digits ; if ( value < 1000 ) { digits = 3 ; } else if ( value < 10000 ) { digits = 4 ; } else { digits = ( int ) ( Math . log ( value ) / LOG_10 ) + 1 ; } for ( ; size > digits ; size -- ) { out . write ( '0' ) ; } out . write ( Integer . toString ( value ) ) ; }
public class ClinAsserTraitType { /** * Gets the value of the attributeSet property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the attributeSet property . * For example , to add a new item , do as follows : * < pre > * getAttributeSet ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link ClinAsserTraitType . AttributeSet } */ public List < ClinAsserTraitType . AttributeSet > getAttributeSet ( ) { } }
if ( attributeSet == null ) { attributeSet = new ArrayList < ClinAsserTraitType . AttributeSet > ( ) ; } return this . attributeSet ;
public class LongConverter { /** * Converts an { @ link Object } of { @ link Class type S } into an { @ link Object } of { @ link Class type T } . * @ param value { @ link Object } of { @ link Class type S } to convert . * @ return the converted { @ link Object } of { @ link Class type T } . * @ throws ConversionException if the { @ link Object } cannot be converted . * @ see org . cp . elements . data . conversion . ConversionService # convert ( Object , Class ) * @ see # convert ( Object , Class ) */ @ Override public Long convert ( Object value ) { } }
if ( value instanceof Number ) { return ( ( Number ) value ) . longValue ( ) ; } else if ( value instanceof Calendar ) { return ( ( Calendar ) value ) . getTimeInMillis ( ) ; } else if ( value instanceof Date ) { return ( ( Date ) value ) . getTime ( ) ; } else if ( value instanceof String && StringUtils . containsDigits ( value . toString ( ) . trim ( ) ) ) { try { return Long . parseLong ( value . toString ( ) . trim ( ) ) ; } catch ( NumberFormatException cause ) { throw newConversionException ( cause , "[%s] is not a valid Long" , value ) ; } } else { return super . convert ( value ) ; }
public class RelationGraph { /** * Renders the graph in the specified format to the specified output location . * @ param output the location to save the rendered graph . * @ param format the graphic format to save the rendered graph in * @ throws IOException Something went wrong rendering the graph */ public void render ( @ NonNull Resource output , @ NonNull GraphViz . Format format ) throws IOException { } }
GraphViz < Annotation > graphViz = new GraphViz < > ( ) ; graphViz . setVertexEncoder ( v -> new Vertex ( v . toString ( ) + "_" + v . getPOS ( ) . toString ( ) , Collections . emptyMap ( ) ) ) ; graphViz . setEdgeEncoder ( e -> map ( "label" , Cast . < RelationEdge > as ( e ) . getRelation ( ) ) ) ; graphViz . setFormat ( format ) ; graphViz . render ( this , output ) ;
public class DBEngineVersion { /** * A list of engine versions that this database engine version can be upgraded to . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setValidUpgradeTarget ( java . util . Collection ) } or { @ link # withValidUpgradeTarget ( java . util . Collection ) } if * you want to override the existing values . * @ param validUpgradeTarget * A list of engine versions that this database engine version can be upgraded to . * @ return Returns a reference to this object so that method calls can be chained together . */ public DBEngineVersion withValidUpgradeTarget ( UpgradeTarget ... validUpgradeTarget ) { } }
if ( this . validUpgradeTarget == null ) { setValidUpgradeTarget ( new java . util . ArrayList < UpgradeTarget > ( validUpgradeTarget . length ) ) ; } for ( UpgradeTarget ele : validUpgradeTarget ) { this . validUpgradeTarget . add ( ele ) ; } return this ;
public class ExpandableArrayBuffer { public float getFloat ( final int index , final ByteOrder byteOrder ) { } }
boundsCheck0 ( index , SIZE_OF_FLOAT ) ; if ( NATIVE_BYTE_ORDER != byteOrder ) { final int bits = UNSAFE . getInt ( byteArray , ARRAY_BASE_OFFSET + index ) ; return Float . intBitsToFloat ( Integer . reverseBytes ( bits ) ) ; } else { return UNSAFE . getFloat ( byteArray , ARRAY_BASE_OFFSET + index ) ; }
public class OmemoManager { /** * Encrypt a message for all recipients in the MultiUserChat . * @ param muc multiUserChat * @ param message message to send * @ return encrypted message * @ throws UndecidedOmemoIdentityException when there are undecided devices . * @ throws CryptoFailedException * @ throws XMPPException . XMPPErrorException * @ throws SmackException . NotConnectedException * @ throws InterruptedException * @ throws SmackException . NoResponseException * @ throws NoOmemoSupportException When the muc doesn ' t support OMEMO . * @ throws SmackException . NotLoggedInException */ public OmemoMessage . Sent encrypt ( MultiUserChat muc , String message ) throws UndecidedOmemoIdentityException , CryptoFailedException , XMPPException . XMPPErrorException , SmackException . NotConnectedException , InterruptedException , SmackException . NoResponseException , NoOmemoSupportException , SmackException . NotLoggedInException { } }
synchronized ( LOCK ) { if ( ! multiUserChatSupportsOmemo ( muc ) ) { throw new NoOmemoSupportException ( ) ; } Set < BareJid > recipients = new HashSet < > ( ) ; for ( EntityFullJid e : muc . getOccupants ( ) ) { recipients . add ( muc . getOccupant ( e ) . getJid ( ) . asBareJid ( ) ) ; } return encrypt ( recipients , message ) ; }
public class DatabaseConnectionRequest { /** * Set the Auth0 Database Connection used for this request using its name . * @ param connection name * @ return itself */ public DatabaseConnectionRequest < T , U > setConnection ( String connection ) { } }
request . addParameter ( ParameterBuilder . CONNECTION_KEY , connection ) ; return this ;
public class CSSURI { /** * Set the URI string of this object . This may either be a regular URI or a * data URL string ( starting with " data : " ) . The passed string may not start * with the prefix " url ( " and end with " ) " . * @ param sURI * The URI to be set . May not be < code > null < / code > but may be empty * ( even though an empty URL usually does not make sense ) . * @ return this */ @ Nonnull public CSSURI setURI ( @ Nonnull final String sURI ) { } }
ValueEnforcer . notNull ( sURI , "URI" ) ; if ( CSSURLHelper . isURLValue ( sURI ) ) throw new IllegalArgumentException ( "Only the URI and not the CSS-URI value must be passed!" ) ; m_sURI = sURI ; return this ;
public class HelpFormatter { /** * Print the help for < code > options < / code > with the specified command line * syntax . This method prints help information to System . out . * @ param sCmdLineSyntax * the syntax for this application * @ param sHeader * the banner to display at the beginning of the help * @ param aOptions * the Options instance * @ param sFooter * the banner to display at the end of the help */ public void printHelp ( @ Nonnull @ Nonempty final String sCmdLineSyntax , @ Nullable final String sHeader , @ Nonnull final Options aOptions , @ Nullable final String sFooter ) { } }
printHelp ( sCmdLineSyntax , sHeader , aOptions , sFooter , false ) ;
public class AbstractMessage { /** * / * ( non - Javadoc ) * @ see javax . jms . Message # setDoubleProperty ( java . lang . String , double ) */ @ Override public final void setDoubleProperty ( String name , double value ) throws JMSException { } }
setProperty ( name , new Double ( value ) ) ;
public class Graphite { /** * Push samples from the given registry to Graphite at the given interval . */ public Thread start ( CollectorRegistry registry , int intervalSeconds ) { } }
Thread thread = new PushThread ( registry , intervalSeconds ) ; thread . setDaemon ( true ) ; thread . start ( ) ; return thread ;
public class AbstractSockJsMessageCodec { /** * { @ inheritDoc } */ @ Override public String encode ( String ... messages ) { } }
Assert . notNull ( messages , "messages must not be null" ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "a[" ) ; for ( int i = 0 ; i < messages . length ; i ++ ) { sb . append ( '"' ) ; char [ ] quotedChars = applyJsonQuoting ( messages [ i ] ) ; sb . append ( escapeSockJsSpecialChars ( quotedChars ) ) ; sb . append ( '"' ) ; if ( i < messages . length - 1 ) { sb . append ( ',' ) ; } } sb . append ( ']' ) ; return sb . toString ( ) ;
public class ExpressionUtils { /** * Rounding for decimals with support for negative digits */ public static BigDecimal decimalRound ( BigDecimal number , int numDigits , RoundingMode rounding ) { } }
BigDecimal rounded = number . setScale ( numDigits , rounding ) ; if ( numDigits < 0 ) { rounded = rounded . setScale ( 0 , BigDecimal . ROUND_UNNECESSARY ) ; } return rounded ;
public class JettyCombinedLdapLoginModule { /** * Override to perform behavior of " ignoreRoles " option * @ param dirContext context * @ param username username * @ return empty or supplemental roles list only if " ignoreRoles " is true , otherwise performs normal LDAP lookup * @ throws LoginException * @ throws NamingException */ @ Override protected List getUserRoles ( final DirContext dirContext , final String username ) throws LoginException , NamingException { } }
if ( _ignoreRoles ) { ArrayList < String > strings = new ArrayList < > ( ) ; addSupplementalRoles ( strings ) ; return strings ; } else { return super . getUserRoles ( dirContext , username ) ; }
public class SimpleDigitalSkin { /** * * * * * * Canvas * * * * * */ private void setBar ( final double VALUE ) { } }
barCtx . clearRect ( 0 , 0 , size , size ) ; barCtx . setLineCap ( StrokeLineCap . BUTT ) ; barCtx . setStroke ( barColor ) ; barCtx . setLineWidth ( barWidth ) ; if ( sectionsVisible ) { int listSize = sections . size ( ) ; for ( int i = 0 ; i < listSize ; i ++ ) { Section section = sections . get ( i ) ; if ( section . contains ( VALUE ) ) { barCtx . setStroke ( section . getColor ( ) ) ; break ; } } } if ( thresholdVisible && VALUE > gauge . getThreshold ( ) ) { barCtx . setStroke ( thresholdColor ) ; } double v = ( VALUE - minValue ) * angleStep ; int minValueAngle = ( int ) ( - minValue * angleStep ) ; if ( ! isStartFromZero ) { for ( int i = 0 ; i < 280 ; i ++ ) { if ( i % 10 == 0 && i < v ) { barCtx . strokeArc ( barWidth * 0.5 + barWidth * 0.1 , barWidth * 0.5 + barWidth * 0.1 , size - barWidth - barWidth * 0.2 , size - barWidth - barWidth * 0.2 , ( - i - 139 ) , 9.2 , ArcType . OPEN ) ; } } } else { if ( Double . compare ( VALUE , 0 ) != 0 ) { if ( VALUE < 0 ) { for ( int i = Math . min ( minValueAngle , 280 ) - 1 ; i >= 0 ; i -- ) { if ( i % 10 == 0 && i > v - 10 ) { barCtx . strokeArc ( barWidth * 0.5 + barWidth * 0.1 , barWidth * 0.5 + barWidth * 0.1 , size - barWidth - barWidth * 0.2 , size - barWidth - barWidth * 0.2 , ( - i - 139 ) , 9.2 , ArcType . OPEN ) ; } } } else { for ( int i = Math . max ( minValueAngle , 0 ) - 5 ; i < 280 ; i ++ ) { if ( i % 10 == 0 && i < v ) { barCtx . strokeArc ( barWidth * 0.5 + barWidth * 0.1 , barWidth * 0.5 + barWidth * 0.1 , size - barWidth - barWidth * 0.2 , size - barWidth - barWidth * 0.2 , ( - i - 139 ) , 9.2 , ArcType . OPEN ) ; } } } } } valueText . setText ( formatNumber ( gauge . getLocale ( ) , gauge . getFormatString ( ) , gauge . getDecimals ( ) , VALUE ) ) ; valueText . setLayoutX ( valueBkgText . getLayoutBounds ( ) . getMaxX ( ) - valueText . getLayoutBounds ( ) . getWidth ( ) ) ;
public class BoxDeveloperEditionAPIConnection { /** * Creates a new Box Developer Edition connection with enterprise token . * @ param enterpriseId the enterprise ID to use for requesting access token . * @ param clientId the client ID to use when exchanging the JWT assertion for an access token . * @ param clientSecret the client secret to use when exchanging the JWT assertion for an access token . * @ param encryptionPref the encryption preferences for signing the JWT . * @ return a new instance of BoxAPIConnection . * @ deprecated Use the version of this method that accepts an IAccessTokenCache to prevent unneeded * requests to Box for access tokens . */ @ Deprecated public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection ( String enterpriseId , String clientId , String clientSecret , JWTEncryptionPreferences encryptionPref ) { } }
BoxDeveloperEditionAPIConnection connection = new BoxDeveloperEditionAPIConnection ( enterpriseId , DeveloperEditionEntityType . ENTERPRISE , clientId , clientSecret , encryptionPref ) ; connection . authenticate ( ) ; return connection ;
public class CloudantDatabaseService { /** * Returns the underlying cloudantClient object for this database and the provided resource config * @ param info The ResourceConfig used with the associated cloudantDatabase lookup * @ return the cloudantClient object , or null * @ throws Exception */ public Object getCloudantClient ( ResourceInfo info ) throws Exception { } }
return cloudantSvc . getCloudantClient ( info == null ? ResourceInfo . AUTH_APPLICATION : info . getAuth ( ) , info == null ? null : info . getLoginPropertyList ( ) ) ;
public class XMLStreamReader { /** * Shortcut to move forward to the first START _ ELEMENT event , skipping the header or comments . */ public void startRootElement ( ) throws XMLException , IOException { } }
start ( ) ; while ( ! Type . START_ELEMENT . equals ( event . type ) ) next ( ) ;
public class JavaMethodInfo { private IType [ ] convertTypes ( IJavaClassType [ ] genParamTypes , IType ownersType ) { } }
IType ot = ownersType == null ? getOwnersType ( ) : ownersType ; TypeVarToTypeMap actualParamByVarName = TypeLord . mapTypeByVarName ( ot , _md . getMethod ( ) . getEnclosingClass ( ) . getJavaType ( ) ) ; for ( IGenericTypeVariable tv : getTypeVariables ( ) ) { if ( actualParamByVarName . isEmpty ( ) ) { actualParamByVarName = new TypeVarToTypeMap ( ) ; } actualParamByVarName . put ( tv . getTypeVariableDefinition ( ) . getType ( ) , tv . getTypeVariableDefinition ( ) . getType ( ) ) ; } IType [ ] types = new IType [ genParamTypes . length ] ; for ( int i = 0 ; i < genParamTypes . length ; i ++ ) { types [ i ] = genParamTypes [ i ] . getActualType ( actualParamByVarName , true ) ; } return types ;
public class EndpointInfoBuilder { /** * Sets the default { @ link MediaType } . */ public EndpointInfoBuilder defaultMimeType ( MediaType defaultMimeType ) { } }
requireNonNull ( defaultMimeType , "defaultMimeType" ) ; this . defaultMimeType = defaultMimeType ; if ( availableMimeTypes == null ) { availableMimeTypes = ImmutableSet . of ( defaultMimeType ) ; } else if ( ! availableMimeTypes . contains ( defaultMimeType ) ) { availableMimeTypes = addDefaultMimeType ( defaultMimeType , availableMimeTypes ) ; } return this ;
public class OkHttp { /** * Download the resource at the URL and write it to the file . * @ return Response whose body has already been consumed and closed */ public Response download ( String url , File destination ) throws IOException { } }
return download ( url , destination , ( String [ ] ) null ) ;
public class JavaClass { /** * Adds an interface . */ public void addInterface ( String className ) { } }
_interfaces . add ( className ) ; if ( _isWrite ) getConstantPool ( ) . addClass ( className ) ;
public class DiscordRecord { /** * The simple comparator based on the distance . Note that discord is " better " if the NN distance * is greater . * @ param other The discord record this one is compared to . * @ return True if equals . */ @ Override public int compareTo ( DiscordRecord other ) { } }
if ( null == other ) { throw new NullPointerException ( "Unable compare to null!" ) ; } return Double . compare ( other . getNNDistance ( ) , this . nnDistance ) ;
public class ESJPImporter { /** * This Method extracts the package name and sets the name of this Java * definition ( the name is the package name together with the name of the * file excluding the < code > . java < / code > ) . * @ return class name of the ESJP */ @ Override protected String evalProgramName ( ) { } }
final String urlPath = getUrl ( ) . getPath ( ) ; String name = urlPath . substring ( urlPath . lastIndexOf ( '/' ) + 1 ) ; name = name . substring ( 0 , name . lastIndexOf ( '.' ) ) ; // regular expression for the package name final Pattern pckPattern = Pattern . compile ( "package +[^;]+;" ) ; final Matcher pckMatcher = pckPattern . matcher ( getCode ( ) ) ; if ( pckMatcher . find ( ) ) { final String pkg = pckMatcher . group ( ) . replaceFirst ( "^(package) +" , "" ) . replaceFirst ( ";$" , "" ) ; name = pkg + "." + name ; } return name ;
public class Validation { /** * method to check the attachment point ' s existence * @ param mon * Monomer * @ param str * Attachment point * @ throws AttachmentException * if the Attachment point is not there */ private static void checkAttachmentPoint ( Monomer mon , String str ) throws AttachmentException { } }
if ( ! ( mon . getAttachmentListString ( ) . contains ( str ) ) ) { if ( ! ( str . equals ( "?" ) || str . equals ( "pair" ) ) && ! mon . getAlternateId ( ) . equals ( "?" ) ) { LOG . info ( "Attachment point for source is not there" ) ; throw new AttachmentException ( "Attachment point for source is not there: " + str ) ; } }
public class ApiOvhDedicatedserver { /** * Alter this object properties * REST : PUT / dedicated / server / { serviceName } / burst * @ param body [ required ] New object properties * @ param serviceName [ required ] The internal name of your dedicated server */ public void serviceName_burst_PUT ( String serviceName , OvhServerBurst body ) throws IOException { } }
String qPath = "/dedicated/server/{serviceName}/burst" ; StringBuilder sb = path ( qPath , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class BusNetwork { /** * Replies the list of the bus stops of the bus network . * @ return a list of bus stops */ @ Pure public Iterable < BusStop > busStops ( ) { } }
final MultiCollection < BusStop > col = new MultiCollection < > ( ) ; col . addCollection ( this . validBusStops ) ; col . addCollection ( this . invalidBusStops ) ; return Iterables . unmodifiableIterable ( col ) ;
public class CompilerUtils { /** * Copy a classpath resource to the given location on a filesystem . */ public void copyResource ( String name , String destinationFilename ) { } }
ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( classLoader == null ) { String error = "Can not obtain classloader instance" ; throw new IllegalStateException ( error ) ; } try ( InputStream stream = classLoader . getResourceAsStream ( name ) ) { if ( stream == null ) { String error = "Could not copy file, source file not found: " + name ; throw new IllegalStateException ( error ) ; } Path path = Paths . get ( destinationFilename ) ; FileUtils . copyInputStreamToFile ( stream , path . toFile ( ) ) ; } catch ( IOException e ) { throw new GeneratorException ( "Could not copy %s" , e , name ) ; }
public class HullWhiteModel { /** * Calculates \ ( B ( t , T ) = \ int _ { t } ^ { T } \ exp ( - \ int _ { s } ^ { T } a ( \ tau ) \ mathrm { d } \ tau ) \ mathrm { d } s \ ) , where a is the mean reversion parameter . * For a constant \ ( a \ ) this results in \ ( \ frac { 1 - \ exp ( - a ( T - t ) } { a } \ ) , but the method also supports piecewise constant \ ( a \ ) ' s . * @ param time The parameter t . * @ param maturity The parameter T . * @ return The value of B ( t , T ) . */ private RandomVariable getB ( double time , double maturity ) { } }
int timeIndexStart = volatilityModel . getTimeDiscretization ( ) . getTimeIndex ( time ) ; if ( timeIndexStart < 0 ) { timeIndexStart = - timeIndexStart - 2 ; // Get timeIndex corresponding to previous point } int timeIndexEnd = volatilityModel . getTimeDiscretization ( ) . getTimeIndex ( maturity ) ; if ( timeIndexEnd < 0 ) { timeIndexEnd = - timeIndexEnd - 2 ; // Get timeIndex corresponding to previous point } RandomVariable integral = new Scalar ( 0.0 ) ; double timePrev = time ; double timeNext ; for ( int timeIndex = timeIndexStart + 1 ; timeIndex <= timeIndexEnd ; timeIndex ++ ) { timeNext = volatilityModel . getTimeDiscretization ( ) . getTime ( timeIndex ) ; RandomVariable meanReversion = volatilityModel . getMeanReversion ( timeIndex - 1 ) ; integral = integral . add ( getMRTime ( timeNext , maturity ) . mult ( - 1.0 ) . exp ( ) . sub ( getMRTime ( timePrev , maturity ) . mult ( - 1.0 ) . exp ( ) ) . div ( meanReversion ) ) ; timePrev = timeNext ; } RandomVariable meanReversion = volatilityModel . getMeanReversion ( timeIndexEnd ) ; timeNext = maturity ; integral = integral . add ( getMRTime ( timeNext , maturity ) . mult ( - 1.0 ) . exp ( ) . sub ( getMRTime ( timePrev , maturity ) . mult ( - 1.0 ) . exp ( ) ) . div ( meanReversion ) ) ; return integral ;
public class Kryo { /** * Reads the class and object or null using the registered serializer . * @ return May be null . */ public Object readClassAndObject ( Input input ) { } }
if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; beginObject ( ) ; try { Registration registration = readClass ( input ) ; if ( registration == null ) return null ; Class type = registration . getType ( ) ; Object object ; if ( references ) { int stackSize = readReferenceOrNull ( input , type , false ) ; if ( stackSize == REF ) return readObject ; object = registration . getSerializer ( ) . read ( this , input , type ) ; if ( stackSize == readReferenceIds . size ) reference ( object ) ; } else object = registration . getSerializer ( ) . read ( this , input , type ) ; if ( TRACE || ( DEBUG && depth == 1 ) ) log ( "Read" , object , input . position ( ) ) ; return object ; } finally { if ( -- depth == 0 && autoReset ) reset ( ) ; }
public class SimpleJob { /** * This method is to determine automatically join the Simple and Big . * @ param masterLabels label of master data * @ param masterColumn master column * @ param dataColumn data column * @ param masterPath master data HDFS path * @ param separator separator * @ param regex master join is regex * @ param threshold auto join threshold size ( MB ) . Default 600MB . * @ return this * @ throws URISyntaxException * @ throws IOException */ public SimpleJob setJoin ( String [ ] masterLabels , String masterColumn , String dataColumn , String masterPath , String separator , boolean regex , int threshold ) throws IOException , URISyntaxException { } }
if ( regex ) { return setSimpleJoin ( masterLabels , masterColumn , dataColumn , masterPath , separator , regex ) ; } String javaOpt = conf . get ( "mapred.child.java.opts" ) ; String xmx = StringUtil . getXmx ( javaOpt ) ; int xmxSize = SizeUtils . xmx2MB ( xmx ) ; int masterSize = SizeUtils . byte2Mbyte ( pathUtils . getFileSize ( masterPath ) ) ; int freeSize = xmxSize - DEFALUT_CHILD_MEM_SIZE - masterSize ; if ( freeSize < threshold ) { return setBigJoin ( masterLabels , masterColumn , dataColumn , masterPath , separator ) ; } return setSimpleJoin ( masterLabels , masterColumn , dataColumn , masterPath , separator , regex ) ;
public class Rational { /** * return a + b , staving off overflow */ public Rational plus ( final Rational pOther ) { } }
// special cases if ( equals ( ZERO ) ) { return pOther ; } if ( pOther . equals ( ZERO ) ) { return this ; } // Find gcd of numerators and denominators long f = gcd ( numerator , pOther . numerator ) ; long g = gcd ( denominator , pOther . denominator ) ; // add cross - product terms for numerator // multiply back in return new Rational ( ( ( numerator / f ) * ( pOther . denominator / g ) + ( pOther . numerator / f ) * ( denominator / g ) ) * f , lcm ( denominator , pOther . denominator ) ) ;
public class Review { /** * Retrieves a < code > Review < / code > object . */ public static Review retrieve ( String review , Map < String , Object > params , RequestOptions options ) throws StripeException { } }
String url = String . format ( "%s%s" , Stripe . getApiBase ( ) , String . format ( "/v1/reviews/%s" , ApiResource . urlEncodeId ( review ) ) ) ; return request ( ApiResource . RequestMethod . GET , url , params , Review . class , options ) ;
public class ReferenceEntityLockService { /** * Returns a lock for the entity , lock type and owner if no conflicting locks exist . * @ return org . apereo . portal . groups . IEntityLock * @ param entityID org . apereo . portal . EntityIdentifier * @ param lockType int * @ param owner String * @ param durationSecs int * @ exception LockingException */ @ Override public IEntityLock newLock ( EntityIdentifier entityID , int lockType , String owner , int durationSecs ) throws LockingException { } }
return newLock ( entityID . getType ( ) , entityID . getKey ( ) , lockType , owner , durationSecs ) ;
public class ResourceManager { /** * Callback method when current resourceManager is granted leadership . * @ param newLeaderSessionID unique leadershipID */ @ Override public void grantLeadership ( final UUID newLeaderSessionID ) { } }
final CompletableFuture < Boolean > acceptLeadershipFuture = clearStateFuture . thenComposeAsync ( ( ignored ) -> tryAcceptLeadership ( newLeaderSessionID ) , getUnfencedMainThreadExecutor ( ) ) ; final CompletableFuture < Void > confirmationFuture = acceptLeadershipFuture . thenAcceptAsync ( ( acceptLeadership ) -> { if ( acceptLeadership ) { // confirming the leader session ID might be blocking , leaderElectionService . confirmLeaderSessionID ( newLeaderSessionID ) ;
public class AWSSimpleSystemsManagementClient { /** * Describes one or more of your Systems Manager documents . * @ param listDocumentsRequest * @ return Result of the ListDocuments operation returned by the service . * @ throws InternalServerErrorException * An error occurred on the server side . * @ throws InvalidNextTokenException * The specified token is not valid . * @ throws InvalidFilterKeyException * The specified key is not valid . * @ sample AWSSimpleSystemsManagement . ListDocuments * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / ListDocuments " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ListDocumentsResult listDocuments ( ListDocumentsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListDocuments ( request ) ;
public class UnixPath { /** * Returns { @ code other } resolved against parent of { @ code path } . * @ see java . nio . file . Path # resolveSibling ( java . nio . file . Path ) */ public UnixPath resolveSibling ( UnixPath other ) { } }
checkNotNull ( other ) ; UnixPath parent = getParent ( ) ; return parent == null ? other : parent . resolve ( other ) ;
public class Nameserver { /** * Glue IP address of a name server entry . Glue IP addresses are required only when the name of the name server is a * subdomain of the domain . For example , if your domain is example . com and the name server for the domain is * ns . example . com , you need to specify the IP address for ns . example . com . * Constraints : The list can contain only one IPv4 and one IPv6 address . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setGlueIps ( java . util . Collection ) } or { @ link # withGlueIps ( java . util . Collection ) } if you want to override * the existing values . * @ param glueIps * Glue IP address of a name server entry . Glue IP addresses are required only when the name of the name * server is a subdomain of the domain . For example , if your domain is example . com and the name server for * the domain is ns . example . com , you need to specify the IP address for ns . example . com . < / p > * Constraints : The list can contain only one IPv4 and one IPv6 address . * @ return Returns a reference to this object so that method calls can be chained together . */ public Nameserver withGlueIps ( String ... glueIps ) { } }
if ( this . glueIps == null ) { setGlueIps ( new com . amazonaws . internal . SdkInternalList < String > ( glueIps . length ) ) ; } for ( String ele : glueIps ) { this . glueIps . add ( ele ) ; } return this ;
public class AvatarShellCommand { /** * Check if either - zero - one or - address are specified . */ void eitherZeroOrOneOrAddress ( String command ) { } }
if ( ! isAddressCommand && ! ( isZeroCommand ^ isOneCommand ) ) { throwException ( CMD + command + ": (zero|one) specified incorrectly" ) ; } if ( isAddressCommand && ( isZeroCommand || isOneCommand ) ) { throwException ( CMD + command + ": cannot specify address with (zero|one)" ) ; }
public class Say { /** * Attributes to set on the generated XML element * @ return A Map of attribute keys to values */ protected Map < String , String > getElementAttributes ( ) { } }
// Preserve order of attributes Map < String , String > attrs = new HashMap < > ( ) ; if ( this . getVoice ( ) != null ) { attrs . put ( "voice" , this . getVoice ( ) . toString ( ) ) ; } if ( this . getLoop ( ) != null ) { attrs . put ( "loop" , this . getLoop ( ) . toString ( ) ) ; } if ( this . getLanguage ( ) != null ) { attrs . put ( "language" , this . getLanguage ( ) . toString ( ) ) ; } return attrs ;
public class StructureController { /** * Branch access */ @ RequestMapping ( value = "entity/branch/{project}/{branch:.*}" , method = RequestMethod . GET ) public Branch branch ( @ PathVariable String project , @ PathVariable String branch ) { } }
return structureService . findBranchByName ( project , branch ) . orElseThrow ( ( ) -> new BranchNotFoundException ( project , branch ) ) ;
public class JsMessageHandleImpl { /** * Flattens the SIMessageHandle to a String . * This flattened format can be restored into a SIMessageHandle by using * com . ibm . wsspi . sib . core . SIMessageHandleRestorer . restoreFromString ( String data ) * @ see com . ibm . wsspi . sib . core . SIMessageHandleRestorer # restoreFromString ( String ) * @ return String The flattened SIMessageHandle . */ public String flattenToString ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "flattenToString" ) ; StringBuffer buffer = new StringBuffer ( ) ; byte [ ] bytes = this . flattenToBytes ( ) ; HexString . binToHex ( bytes , 0 , bytes . length , buffer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "flattenToString" ) ; return new String ( buffer ) ;
public class RegionManager { /** * Merges all outstanding dirty regions into a single list of rectangles and returns that to * the caller . Internally , the list of accumulated dirty regions is cleared out and prepared * for the next frame . */ public Rectangle [ ] getDirtyRegions ( ) { } }
List < Rectangle > merged = Lists . newArrayList ( ) ; for ( int ii = _dirty . size ( ) - 1 ; ii >= 0 ; ii -- ) { // pop the next rectangle from the dirty list Rectangle mr = _dirty . remove ( ii ) ; // merge in any overlapping rectangles for ( int jj = ii - 1 ; jj >= 0 ; jj -- ) { Rectangle r = _dirty . get ( jj ) ; if ( mr . intersects ( r ) ) { // remove the overlapping rectangle from the list _dirty . remove ( jj ) ; ii -- ; // grow the merged dirty rectangle mr . add ( r ) ; } } // add the merged rectangle to the list merged . add ( mr ) ; } return merged . toArray ( new Rectangle [ merged . size ( ) ] ) ;
public class MessageLogger { /** * Logs a message by the provided key to the provided { @ link Logger } at info level after substituting the parameters in the message by the provided objects . * @ param logger the logger to log to * @ param messageKey the key of the message in the bundle * @ param objects the substitution parameters */ public final void logInfo ( final Logger logger , final String messageKey , final Object ... objects ) { } }
logger . info ( getMessage ( messageKey , objects ) ) ;
public class AuthenticationFilter { /** * Parses the Authorization request header into a username and password . * @ param authHeader the auth header */ private Creds parseAuthorizationBasic ( String authHeader ) { } }
String userpassEncoded = authHeader . substring ( 6 ) ; String data = StringUtils . newStringUtf8 ( Base64 . decodeBase64 ( userpassEncoded ) ) ; int sepIdx = data . indexOf ( ':' ) ; if ( sepIdx > 0 ) { String username = data . substring ( 0 , sepIdx ) ; String password = data . substring ( sepIdx + 1 ) ; return new Creds ( username , password ) ; } else { return new Creds ( data , null ) ; }
public class PerlinNoise { /** * Ordinary noise function . * @ param x X Value . * @ param y Y Value . * @ return */ private double Noise ( int x , int y ) { } }
int n = x + y * 57 ; n = ( n << 13 ) ^ n ; return ( 1.0 - ( ( n * ( n * n * 15731 + 789221 ) + 1376312589 ) & 0x7fffffff ) / 1073741824.0 ) ;
public class ExpressRouteCrossConnectionsInner { /** * Update the specified ExpressRouteCrossConnection . * @ param resourceGroupName The name of the resource group . * @ param crossConnectionName The name of the ExpressRouteCrossConnection . * @ param parameters Parameters supplied to the update express route crossConnection operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ExpressRouteCrossConnectionInner object if successful . */ public ExpressRouteCrossConnectionInner createOrUpdate ( String resourceGroupName , String crossConnectionName , ExpressRouteCrossConnectionInner parameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , crossConnectionName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class Crowd { /** * / could not be added . */ public int addAgent ( float [ ] pos , CrowdAgentParams params ) { } }
// Find empty slot . int idx = - 1 ; for ( int i = 0 ; i < m_maxAgents ; ++ i ) { if ( ! m_agents [ i ] . active ) { idx = i ; break ; } } if ( idx == - 1 ) { return - 1 ; } CrowdAgent ag = m_agents [ idx ] ; updateAgentParameters ( idx , params ) ; // Find nearest position on navmesh and place the agent there . Result < FindNearestPolyResult > nearestPoly = m_navquery . findNearestPoly ( pos , m_ext , m_filters [ ag . params . queryFilterType ] ) ; float [ ] nearest = nearestPoly . succeeded ( ) ? nearestPoly . result . getNearestPos ( ) : pos ; long ref = nearestPoly . succeeded ( ) ? nearestPoly . result . getNearestRef ( ) : 0L ; ag . corridor . reset ( ref , nearest ) ; ag . boundary . reset ( ) ; ag . partial = false ; ag . topologyOptTime = 0 ; ag . targetReplanTime = 0 ; vSet ( ag . dvel , 0 , 0 , 0 ) ; vSet ( ag . nvel , 0 , 0 , 0 ) ; vSet ( ag . vel , 0 , 0 , 0 ) ; vCopy ( ag . npos , nearest ) ; ag . desiredSpeed = 0 ; if ( ref != 0 ) { ag . state = CrowdAgentState . DT_CROWDAGENT_STATE_WALKING ; } else { ag . state = CrowdAgentState . DT_CROWDAGENT_STATE_INVALID ; } ag . targetState = MoveRequestState . DT_CROWDAGENT_TARGET_NONE ; ag . active = true ; return idx ;
public class MayNotContainSpacesValidator { /** * ( non - Javadoc ) * @ see * com . fs . commons . desktop . validation . Validator # validate ( com . fs . commons . desktop . * validation . Problems , java . lang . String , java . lang . Object ) */ @ Override public boolean validate ( final Problems problems , final String compName , final String model ) { } }
final char [ ] chars = model . toCharArray ( ) ; for ( final char c : chars ) { if ( Character . isWhitespace ( c ) ) { problems . add ( ValidationBundle . getMessage ( MayNotContainSpacesValidator . class , "MAY_NOT_CONTAIN_WHITESPACE" , compName ) ) ; // NOI18N return false ; } } return true ;
public class DescriptorFactory { /** * Get a MethodDescriptor . * @ param className * name of the class containing the method , in VM format ( e . g . , * " java / lang / String " ) * @ param name * name of the method * @ param signature * signature of the method * @ param isStatic * true if method is static , false otherwise * @ return MethodDescriptor */ public MethodDescriptor getMethodDescriptor ( @ SlashedClassName String className , String name , String signature , boolean isStatic ) { } }
if ( className == null ) { throw new NullPointerException ( "className must be nonnull" ) ; } MethodDescriptor methodDescriptor = new MethodDescriptor ( className , name , signature , isStatic ) ; MethodDescriptor existing = methodDescriptorMap . get ( methodDescriptor ) ; if ( existing == null ) { methodDescriptorMap . put ( methodDescriptor , methodDescriptor ) ; existing = methodDescriptor ; } return existing ;
public class CommonXml { /** * Write the interfaces including the criteria elements . * @ param writer the xml stream writer * @ param modelNode the model * @ throws XMLStreamException */ protected void writeInterfaces ( final XMLExtendedStreamWriter writer , final ModelNode modelNode ) throws XMLStreamException { } }
interfacesXml . writeInterfaces ( writer , modelNode ) ;