signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Engine { /** * Add directive * < pre > * 示例 : * addDirective ( " now " , NowDirective . class ) * < / pre > */ public Engine addDirective ( String directiveName , Class < ? extends Directive > directiveClass ) { } }
config . addDirective ( directiveName , directiveClass ) ; return this ;
public class OcciVMUtils { /** * Deletes a VM ( OCCI / VMWare ) . * @ param hostIpPort IP and port of OCCI server ( eg . " 172.16.225.91:8080 " ) * @ param id Unique VM ID * @ return true if deletion OK , false otherwise */ public static boolean deleteVM ( String hostIpPort , String id ) throws TargetException { } }
if ( id . startsWith ( "urn:uuid:" ) ) id = id . substring ( 9 ) ; String ret = null ; URL url = null ; try { CookieHandler . setDefault ( new CookieManager ( null , CookiePolicy . ACCEPT_ALL ) ) ; url = new URL ( "http://" + hostIpPort + "/" + id ) ; } catch ( MalformedURLException e ) { throw new TargetException ( e ) ; } HttpURLConnection httpURLConnection = null ; DataInputStream in = null ; try { httpURLConnection = ( HttpURLConnection ) url . openConnection ( ) ; httpURLConnection . setRequestMethod ( "DELETE" ) ; httpURLConnection . setRequestProperty ( "Content-Type" , "text/occi" ) ; httpURLConnection . setRequestProperty ( "Accept" , "*/*" ) ; in = new DataInputStream ( httpURLConnection . getInputStream ( ) ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; Utils . copyStreamSafely ( in , out ) ; ret = out . toString ( "UTF-8" ) ; } catch ( IOException e ) { throw new TargetException ( e ) ; } finally { Utils . closeQuietly ( in ) ; if ( httpURLConnection != null ) { httpURLConnection . disconnect ( ) ; } } return ( "OK" . equalsIgnoreCase ( ret ) ) ;
public class XMLStreamReader { /** * / * Private methods */ private void readTag ( ) throws XMLException , IOException { } }
try { char c ; if ( ( c = stream . read ( ) ) == '!' ) { readTagExclamation ( ) ; } else if ( c == '?' ) { readProcessingInstruction ( ) ; } else if ( c == '/' ) { readEndTag ( ) ; } else if ( isNameStartChar ( c ) ) { readStartTag ( c ) ; } else { throw new XMLException ( getPosition ( ) , "Unexpected character" , Character . valueOf ( c ) ) ; } } catch ( EOFException e ) { throw new XMLException ( getPosition ( ) , new LocalizableString ( "lc.xml.error" , "Unexpected end" ) , new LocalizableString ( "lc.xml.error" , "in XML document" ) ) ; }
public class TerminalEmulatorPalette { /** * Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background * color and if we want to use the bright version . * @ param color Which ANSI color we want to extract * @ param isForeground Is this color we extract going to be used as a background color ? * @ param useBrightTones If true , we should return the bright version of the color * @ return AWT color extracted from this palette for the input parameters */ public Color get ( TextColor . ANSI color , boolean isForeground , boolean useBrightTones ) { } }
if ( useBrightTones ) { switch ( color ) { case BLACK : return brightBlack ; case BLUE : return brightBlue ; case CYAN : return brightCyan ; case DEFAULT : return isForeground ? defaultBrightColor : defaultBackgroundColor ; case GREEN : return brightGreen ; case MAGENTA : return brightMagenta ; case RED : return brightRed ; case WHITE : return brightWhite ; case YELLOW : return brightYellow ; } } else { switch ( color ) { case BLACK : return normalBlack ; case BLUE : return normalBlue ; case CYAN : return normalCyan ; case DEFAULT : return isForeground ? defaultColor : defaultBackgroundColor ; case GREEN : return normalGreen ; case MAGENTA : return normalMagenta ; case RED : return normalRed ; case WHITE : return normalWhite ; case YELLOW : return normalYellow ; } } throw new IllegalArgumentException ( "Unknown text color " + color ) ;
public class RedwoodConfiguration { /** * Hide the following channels . * @ param channels The names of the channels to hide . * @ return this */ public RedwoodConfiguration hideChannels ( final Object [ ] channels ) { } }
tasks . add ( new Runnable ( ) { public void run ( ) { Redwood . hideChannels ( channels ) ; } } ) ; return this ;
public class FctBnAccEntitiesProcessors { /** * < p > Get PrcReplicationAccMethodSave ( create and put into map ) . < / p > * @ param pAddParam additional param * @ return requested PrcReplicationAccMethodSave * @ throws Exception - an exception */ protected final PrcReplicationAccMethodSave < RS > createPutPrcReplicationAccMethodSave ( final Map < String , Object > pAddParam ) throws Exception { } }
PrcReplicationAccMethodSave < RS > proc = new PrcReplicationAccMethodSave < RS > ( ) ; proc . setSrvAccSettings ( getSrvAccSettings ( ) ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; // assigning fully initialized object : this . processorsMap . put ( PrcReplicationAccMethodSave . class . getSimpleName ( ) , proc ) ; return proc ;
public class GetLabelDetectionResult { /** * An array of labels detected in the video . Each element contains the detected label and the time , in milliseconds * from the start of the video , that the label was detected . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLabels ( java . util . Collection ) } or { @ link # withLabels ( java . util . Collection ) } if you want to override the * existing values . * @ param labels * An array of labels detected in the video . Each element contains the detected label and the time , in * milliseconds from the start of the video , that the label was detected . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetLabelDetectionResult withLabels ( LabelDetection ... labels ) { } }
if ( this . labels == null ) { setLabels ( new java . util . ArrayList < LabelDetection > ( labels . length ) ) ; } for ( LabelDetection ele : labels ) { this . labels . add ( ele ) ; } return this ;
public class JPAEMPool { /** * Prohibit access to the metamodel via the pool . * @ throws UnsupportedOperationException */ @ Override public Metamodel getMetamodel ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getMetamodel : " + this ) ; throw new UnsupportedOperationException ( "This operation is not supported on a pooling EntityManagerFactory." ) ;
public class HttpInboundServiceContextImpl { /** * Send the given body buffers for the outgoing response synchronously . * If chunked encoding is set or if the partialbody flag is set , then * these buffers will be considered a " chunk " and encoded * as such . If the message is Content - Length defined , then the buffers * will simply be sent out with no modifications . This marks the end * of the outgoing message . * Note : if headers have not already been sent , then the first call to this * method will send the headers . If this was a chunked encoded message , then * the zero - length chunk is automatically appended . * @ param body * ( last set of buffers to send , null if no body data ) * @ throws IOException * - - if a socket exception occurs * @ throws MessageSentException * - - if a finishMessage API was already used */ @ Override public void finishResponseMessage ( WsByteBuffer [ ] body ) throws IOException , MessageSentException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finishResponseMessage(body)" ) ; } if ( ! headersParsed ( ) ) { // request message must have the headers parsed prior to sending // any data out ( this is a completely invalid state in the channel // above ) IOException ioe = new IOException ( "Request not read yet" ) ; FFDCFilter . processException ( ioe , CLASS_NAME + ".finishResponseMessage" , "941" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Attempt to send response without a request msg" ) ; } throw ioe ; } if ( isMessageSent ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Message already sent" ) ; } throw new MessageSentException ( "Message already sent" ) ; } // if headers haven ' t been sent and chunked encoding is not explicitly // configured , then set this up for Content - Length if ( ! headersSent ( ) && ! getResponseImpl ( ) . isChunkedEncodingSet ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "finishMessage() setting partial body false" ) ; } setPartialBody ( false ) ; } if ( getHttpConfig ( ) . runningOnZOS ( ) ) { // @311734 - add this to notify the xmem channel of our final write getVC ( ) . getStateMap ( ) . put ( HttpConstants . FINAL_WRITE_MARK , "true" ) ; } try { sendFullOutgoing ( body , getResponseImpl ( ) ) ; } finally { logFinalResponse ( getNumBytesWritten ( ) ) ; } HttpInvalidMessageException inv = checkResponseValidity ( ) ; if ( null != inv ) { throw inv ; }
public class BaseBarChart { /** * Calculates the bar width and bar margin based on the _ DataSize and settings and starts the boundary * calculation in child classes . * @ param _ DataSize Amount of data sets */ protected void calculateBarPositions ( int _DataSize ) { } }
int dataSize = mScrollEnabled ? mVisibleBars : _DataSize ; float barWidth = mBarWidth ; float margin = mBarMargin ; if ( ! mFixedBarWidth ) { // calculate the bar width if the bars should be dynamically displayed barWidth = ( mAvailableScreenSize / _DataSize ) - margin ; } else { if ( _DataSize < mVisibleBars ) { dataSize = _DataSize ; } // calculate margin between bars if the bars have a fixed width float cumulatedBarWidths = barWidth * dataSize ; float remainingScreenSize = mAvailableScreenSize - cumulatedBarWidths ; margin = remainingScreenSize / dataSize ; } boolean isVertical = this instanceof VerticalBarChart ; int calculatedSize = ( int ) ( ( barWidth * _DataSize ) + ( margin * _DataSize ) ) ; int contentWidth = isVertical ? mGraphWidth : calculatedSize ; int contentHeight = isVertical ? calculatedSize : mGraphHeight ; mContentRect = new Rect ( 0 , 0 , contentWidth , contentHeight ) ; mCurrentViewport = new RectF ( 0 , 0 , mGraphWidth , mGraphHeight ) ; calculateBounds ( barWidth , margin ) ; mLegend . invalidate ( ) ; mGraph . invalidate ( ) ;
public class RemoteTopicConnection { /** * / * ( non - Javadoc ) * @ see javax . jms . TopicConnection # createConnectionConsumer ( javax . jms . Topic , java . lang . String , javax . jms . ServerSessionPool , int ) */ @ Override public synchronized ConnectionConsumer createConnectionConsumer ( Topic topic , String messageSelector , ServerSessionPool sessionPool , int maxMessages ) throws JMSException { } }
checkNotClosed ( ) ; throw new FFMQException ( "Unsupported feature" , "UNSUPPORTED_FEATURE" ) ;
public class OptionsMapper { /** * Directly map system property value to option . * Directly mapped properties excluded from mass processing in { @ link # props ( String ) } , but direct mapping * must appear before mass - processing . * @ param name property name * @ param option option * @ param converter value converter ( may be null to use default converters ) * @ param < T > helper option type * @ param < V > value type * @ return mapper instance for chained calls */ public < V , T extends Enum & Option > OptionsMapper prop ( final String name , final T option , final Function < String , V > converter ) { } }
mappedProps . add ( name ) ; register ( PROP_PREFIX + name , option , System . getProperty ( name ) , converter ) ; return this ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCoolingTower ( ) { } }
if ( ifcCoolingTowerEClass == null ) { ifcCoolingTowerEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 145 ) ; } return ifcCoolingTowerEClass ;
public class FctBnAccEntitiesProcessors { /** * < p > Get PrcWageSave ( create and put into map ) . < / p > * @ param pAddParam additional param * @ return requested PrcWageSave * @ throws Exception - an exception */ protected final PrcWageSave < RS > createPutPrcWageSave ( final Map < String , Object > pAddParam ) throws Exception { } }
PrcWageSave < RS > proc = new PrcWageSave < RS > ( ) ; proc . setSrvAccSettings ( getSrvAccSettings ( ) ) ; proc . setSrvAccEntry ( getSrvAccEntry ( ) ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setSrvI18n ( getSrvI18n ( ) ) ; proc . setFactoryAppBeans ( getFactoryAppBeans ( ) ) ; // assigning fully initialized object : this . processorsMap . put ( PrcWageSave . class . getSimpleName ( ) , proc ) ; return proc ;
public class ManagedChannelImpl { /** * May only be called in constructor or syncContext */ private void handleServiceConfigUpdate ( ) { } }
waitingForServiceConfig = false ; serviceConfigInterceptor . handleUpdate ( lastServiceConfig ) ; if ( retryEnabled ) { throttle = ServiceConfigUtil . getThrottlePolicy ( lastServiceConfig ) ; }
public class ContentTypeUtils { /** * Register a new contentType to charSet mapping . * @ param contentType Content - type to register * @ param charSet charSet associated with the content - type */ public void registerCharsetMapping ( String contentType , String charSet ) { } }
if ( knownCharsets . contains ( contentType ) ) { log . warn ( "{} is already registered; re-registering" ) ; } knownCharsets . put ( contentType , charSet ) ;
public class MainRemote { /** * Read port number from file . * @ param file The file * @ return Port number * @ throws Exception If fails */ private static int port ( final File file ) throws Exception { } }
while ( ! file . exists ( ) ) { TimeUnit . MILLISECONDS . sleep ( 1L ) ; } final int port ; try ( InputStream input = Files . newInputStream ( file . toPath ( ) ) ) { // @ checkstyle MagicNumber ( 1 line ) final byte [ ] buf = new byte [ 10 ] ; while ( true ) { if ( input . read ( buf ) > 0 ) { break ; } } port = Integer . parseInt ( new TrimmedText ( new Utf8String ( buf ) ) . asString ( ) ) ; } return port ;
public class ServerBuilder { /** * Returns a newly - created { @ link Server } based on the configuration properties set so far . */ public Server build ( ) { } }
final VirtualHost defaultVirtualHost ; if ( this . defaultVirtualHost != null ) { defaultVirtualHost = this . defaultVirtualHost . decorate ( decorator ) ; } else { defaultVirtualHost = defaultVirtualHostBuilder . build ( ) . decorate ( decorator ) ; } virtualHostBuilders . forEach ( vhb -> virtualHosts . add ( vhb . build ( ) ) ) ; final List < VirtualHost > virtualHosts ; if ( decorator != null ) { virtualHosts = this . virtualHosts . stream ( ) . map ( h -> h . decorate ( decorator ) ) . collect ( Collectors . toList ( ) ) ; } else { virtualHosts = this . virtualHosts ; } // Gets the access logger for each virtual host . virtualHosts . forEach ( vh -> { if ( vh . accessLoggerOrNull ( ) == null ) { final Logger logger = accessLoggerMapper . apply ( vh ) ; checkState ( logger != null , "accessLoggerMapper.apply() has returned null for virtual host: %s." , vh . hostnamePattern ( ) ) ; vh . accessLogger ( logger ) ; } // combine content preview factories ( one for VirtualHost , the other for Server ) vh . requestContentPreviewerFactory ( ContentPreviewerFactory . of ( vh . requestContentPreviewerFactory ( ) , requestContentPreviewerFactory ) ) ; vh . responseContentPreviewerFactory ( ContentPreviewerFactory . of ( vh . responseContentPreviewerFactory ( ) , responseContentPreviewerFactory ) ) ; } ) ; if ( defaultVirtualHost . accessLoggerOrNull ( ) == null ) { final Logger logger = accessLoggerMapper . apply ( defaultVirtualHost ) ; checkState ( logger != null , "accessLoggerMapper.apply() has returned null for the default virtual host." ) ; defaultVirtualHost . accessLogger ( logger ) ; } defaultVirtualHost . requestContentPreviewerFactory ( ContentPreviewerFactory . of ( defaultVirtualHost . requestContentPreviewerFactory ( ) , requestContentPreviewerFactory ) ) ; defaultVirtualHost . responseContentPreviewerFactory ( ContentPreviewerFactory . of ( defaultVirtualHost . responseContentPreviewerFactory ( ) , responseContentPreviewerFactory ) ) ; // Pre - populate the domain name mapping for later matching . final DomainNameMapping < SslContext > sslContexts ; final SslContext defaultSslContext = findDefaultSslContext ( defaultVirtualHost , virtualHosts ) ; final Collection < ServerPort > ports ; this . ports . forEach ( port -> checkState ( port . protocols ( ) . stream ( ) . anyMatch ( p -> p != PROXY ) , "protocols: %s (expected: at least one %s or %s)" , port . protocols ( ) , HTTP , HTTPS ) ) ; if ( defaultSslContext == null ) { sslContexts = null ; if ( ! this . ports . isEmpty ( ) ) { ports = resolveDistinctPorts ( this . ports ) ; for ( final ServerPort p : ports ) { if ( p . hasTls ( ) ) { throw new IllegalArgumentException ( "TLS not configured; cannot serve HTTPS" ) ; } } } else { ports = ImmutableList . of ( new ServerPort ( 0 , HTTP ) ) ; } } else { if ( ! this . ports . isEmpty ( ) ) { ports = resolveDistinctPorts ( this . ports ) ; } else { ports = ImmutableList . of ( new ServerPort ( 0 , HTTPS ) ) ; } final DomainNameMappingBuilder < SslContext > mappingBuilder = new DomainNameMappingBuilder < > ( defaultSslContext ) ; for ( VirtualHost h : virtualHosts ) { final SslContext sslCtx = h . sslContext ( ) ; if ( sslCtx != null ) { mappingBuilder . add ( h . hostnamePattern ( ) , sslCtx ) ; } } sslContexts = mappingBuilder . build ( ) ; } final Server server = new Server ( new ServerConfig ( ports , normalizeDefaultVirtualHost ( defaultVirtualHost , defaultSslContext ) , virtualHosts , workerGroup , shutdownWorkerGroupOnStop , startStopExecutor , maxNumConnections , idleTimeoutMillis , defaultRequestTimeoutMillis , defaultMaxRequestLength , verboseResponses , http2InitialConnectionWindowSize , http2InitialStreamWindowSize , http2MaxStreamsPerConnection , http2MaxFrameSize , http2MaxHeaderListSize , http1MaxInitialLineLength , http1MaxHeaderSize , http1MaxChunkSize , gracefulShutdownQuietPeriod , gracefulShutdownTimeout , blockingTaskExecutor , shutdownBlockingTaskExecutorOnStop , meterRegistry , serviceLoggerPrefix , accessLogWriter , shutdownAccessLogWriterOnStop , proxyProtocolMaxTlvSize , channelOptions , childChannelOptions , clientAddressSources , clientAddressTrustedProxyFilter , clientAddressFilter ) , sslContexts ) ; serverListeners . forEach ( server :: addListener ) ; return server ;
public class Actions { /** * Releases the depressed left mouse button , in the middle of the given element . * This is equivalent to : * < i > Actions . moveToElement ( onElement ) . release ( ) < / i > * Invoking this action without invoking { @ link # clickAndHold ( ) } first will result in * undefined behaviour . * @ param target Element to release the mouse button above . * @ return A self reference . */ public Actions release ( WebElement target ) { } }
if ( isBuildingActions ( ) ) { action . addAction ( new ButtonReleaseAction ( jsonMouse , ( Locatable ) target ) ) ; } return moveInTicks ( target , 0 , 0 ) . tick ( defaultMouse . createPointerUp ( LEFT . asArg ( ) ) ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPhysicalSimpleQuantity ( ) { } }
if ( ifcPhysicalSimpleQuantityEClass == null ) { ifcPhysicalSimpleQuantityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 353 ) ; } return ifcPhysicalSimpleQuantityEClass ;
public class MMFF94BasedParameterSetReader { /** * Read a text based configuration file out of the force field mm2 file * @ throws Exception Description of the Exception */ private void setAtomTypeData ( ) throws Exception { } }
key = "data" + sid ; List data = new Vector ( ) ; String sradius = st . nextToken ( ) ; String swell = st . nextToken ( ) ; String sapol = st . nextToken ( ) ; String sNeff = st . nextToken ( ) ; // st . nextToken ( ) ; String sDA = st . nextToken ( ) ; String sq0 = st . nextToken ( ) ; String spbci = st . nextToken ( ) ; String sfcadj = st . nextToken ( ) ; stvdW . nextToken ( ) ; stvdW . nextToken ( ) ; String sA = stvdW . nextToken ( ) ; String sG = stvdW . nextToken ( ) ; try { double well = new Double ( swell ) . doubleValue ( ) ; double apol = new Double ( sapol ) . doubleValue ( ) ; double Neff = new Double ( sNeff ) . doubleValue ( ) ; double fcadj = new Double ( sfcadj ) . doubleValue ( ) ; // double pbci = new Double ( spbci ) . doubleValue ( ) ; double a = new Double ( sA ) . doubleValue ( ) ; double g = new Double ( sG ) . doubleValue ( ) ; data . add ( new Double ( well ) ) ; data . add ( new Double ( apol ) ) ; data . add ( new Double ( Neff ) ) ; data . add ( new String ( sDA ) ) ; data . add ( new Double ( fcadj ) ) ; data . add ( new Double ( spbci ) ) ; data . add ( new Double ( a ) ) ; data . add ( new Double ( g ) ) ; } catch ( NumberFormatException nfe ) { throw new IOException ( "Data: Malformed Number due to:" + nfe ) ; } LOG . debug ( "data : well,apol,Neff,sDA,fcadj,spbci,a,g " + data ) ; parameterSet . put ( key , data ) ; key = "vdw" + sid ; data = new Vector ( ) ; try { double radius = new Double ( sradius ) . doubleValue ( ) ; data . add ( new Double ( radius ) ) ; } catch ( NumberFormatException nfe2 ) { LOG . debug ( "vdwError: Malformed Number due to:" + nfe2 ) ; } parameterSet . put ( key , data ) ; key = "charge" + sid ; data = new Vector ( ) ; try { double q0 = new Double ( sq0 ) . doubleValue ( ) ; data . add ( new Double ( q0 ) ) ; } catch ( NumberFormatException nfe3 ) { System . err . println ( "Charge: Malformed Number due to:" + nfe3 ) ; } parameterSet . put ( key , data ) ;
public class QuickHull3D { /** * Constructs the convex hull of a set of points . * @ param points * input points * @ param nump * number of input points * @ throws IllegalArgumentException * the number of input points is less than four or greater then * the length of < code > points < / code > , or the points appear to be * coincident , colinear , or coplanar . */ public void build ( Point3d [ ] points , int nump ) throws IllegalArgumentException { } }
if ( nump < 4 ) { throw new IllegalArgumentException ( "Less than four input points specified" ) ; } if ( points . length < nump ) { throw new IllegalArgumentException ( "Point array too small for specified number of points" ) ; } initBuffers ( nump ) ; setPoints ( points , nump ) ; buildHull ( ) ;
public class CommerceWarehousePersistenceImpl { /** * Removes all the commerce warehouses where groupId = & # 63 ; and commerceCountryId = & # 63 ; from the database . * @ param groupId the group ID * @ param commerceCountryId the commerce country ID */ @ Override public void removeByG_C ( long groupId , long commerceCountryId ) { } }
for ( CommerceWarehouse commerceWarehouse : findByG_C ( groupId , commerceCountryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceWarehouse ) ; }
public class GifDecoder { /** * Reads the next chunk for the intermediate work buffer . */ private void readChunkIfNeeded ( ) { } }
if ( workBufferSize > workBufferPosition ) { return ; } if ( workBuffer == null ) { workBuffer = bitmapProvider . obtainByteArray ( WORK_BUFFER_SIZE ) ; } workBufferPosition = 0 ; workBufferSize = Math . min ( rawData . remaining ( ) , WORK_BUFFER_SIZE ) ; rawData . get ( workBuffer , 0 , workBufferSize ) ;
public class WriteRequest { /** * < code > optional . alluxio . grpc . block . Chunk chunk = 2 ; < / code > */ public alluxio . grpc . ChunkOrBuilder getChunkOrBuilder ( ) { } }
if ( valueCase_ == 2 ) { return ( alluxio . grpc . Chunk ) value_ ; } return alluxio . grpc . Chunk . getDefaultInstance ( ) ;
public class Strings { /** * Trims the specified string and , if the resulting string is empty , will return { @ literal null } instead . * @ param s * the string to be trimmed ( may be { @ literal null } ) * @ return The trimmed { @ code s } or { @ literal null } if { @ code s } is { @ literal null } before or after being trimmed . */ public static String trimToNull ( String s ) { } }
s = trim ( s ) ; return isNotEmpty ( s ) ? s : null ;
public class Surface { /** * Pre - concatenates { @ code xf } onto this surface ' s transform . */ public Surface preConcatenate ( AffineTransform xf ) { } }
AffineTransform txf = tx ( ) ; Transforms . multiply ( xf . m00 , xf . m01 , xf . m10 , xf . m11 , xf . tx , xf . ty , txf , txf ) ; return this ;
public class HalCachingLinkResolver { /** * Sort the resolved resources to ensure consistent order of resolved resources . */ protected void sortResolvedResources ( List < HalResource < ? > > resolvedResources ) { } }
Comparator < HalResource < ? > > comparator = getResourceComparator ( ) ; if ( comparator != null ) { Collections . sort ( resolvedResources , comparator ) ; }
public class CyclicYear { /** * / * [ deutsch ] * < p > Interpretiert den sprachabh & auml ; ngigen Namen als zyklisches Jahr . < / p > * @ param text the text to be parsed * @ param pp when to start parsing * @ param locale language * @ return parsed cyclic year or { @ code null } if the text cannot be parsed */ static CyclicYear parse ( CharSequence text , ParsePosition pp , Locale locale , boolean lenient ) { } }
int pos = pp . getIndex ( ) ; int len = text . length ( ) ; boolean root = locale . getLanguage ( ) . isEmpty ( ) ; if ( ( pos + 1 >= len ) || ( pos < 0 ) ) { pp . setErrorIndex ( pos ) ; return null ; } Stem stem = null ; Branch branch = null ; if ( LANGS_WITHOUT_SEP . contains ( locale . getLanguage ( ) ) ) { for ( Stem s : Stem . values ( ) ) { if ( s . getDisplayName ( locale ) . charAt ( 0 ) == text . charAt ( pos ) ) { stem = s ; break ; } } if ( stem != null ) { for ( Branch b : Branch . values ( ) ) { if ( b . getDisplayName ( locale ) . charAt ( 0 ) == text . charAt ( pos + 1 ) ) { branch = b ; pos += 2 ; break ; } } } } else { int sep = - 1 ; for ( int i = pos + 1 ; i < len ; i ++ ) { if ( text . charAt ( i ) == '-' ) { sep = i ; break ; } } if ( sep == - 1 ) { pp . setErrorIndex ( pos ) ; return null ; } for ( Stem s : Stem . values ( ) ) { String test = s . getDisplayName ( locale ) ; for ( int i = pos ; i < sep ; i ++ ) { int offset = i - pos ; char c = text . charAt ( i ) ; if ( root ) { c = toASCII ( c ) ; } if ( ( offset < test . length ( ) ) && ( test . charAt ( offset ) == c ) ) { if ( offset + 1 == test . length ( ) ) { stem = s ; break ; } } else { break ; // not found } } } if ( stem == null ) { if ( lenient && ! root && ( sep + 1 < len ) ) { return parse ( text , pp , Locale . ROOT , true ) ; // recursive } else { pp . setErrorIndex ( pos ) ; return null ; } } for ( Branch b : Branch . values ( ) ) { String test = b . getDisplayName ( locale ) ; for ( int i = sep + 1 ; i < len ; i ++ ) { int offset = i - sep - 1 ; char c = text . charAt ( i ) ; if ( root ) { c = toASCII ( c ) ; } if ( ( offset < test . length ( ) ) && ( test . charAt ( offset ) == c ) ) { if ( offset + 1 == test . length ( ) ) { branch = b ; pos = i + 1 ; break ; } } else { break ; // not found } } } } if ( ( stem == null ) || ( branch == null ) ) { if ( lenient && ! root ) { return parse ( text , pp , Locale . ROOT , true ) ; // recursive } else { pp . setErrorIndex ( pos ) ; return null ; } } pp . setIndex ( pos ) ; return CyclicYear . of ( stem , branch ) ;
public class AbstractFileRoutesLoader { /** * Helper method . Builds a { @ link Route } object from the received arguments instantiating the controller and the * method . It uses the { @ link # loadController ( String ) } method that has to be defined by concrete implementations . * @ param httpMethod the HTTP method to which the route will respond . * @ param path the HTTP path to which the route will respond . * @ param controllerName the name of the controller that will handle this route . * @ param methodName the name of the method that will handle this route . * @ return a { @ link Route } object . * @ throws RoutesException if there is a problem loading the controller or the method . */ private Route buildRoute ( String httpMethod , String path , String controllerName , String methodName ) throws RoutesException { } }
Object controller = controllerLoader . load ( controllerName ) ; Method method = getMethod ( controller , methodName ) ; return new Route ( HttpMethod . valueOf ( httpMethod . toUpperCase ( ) ) , path , controller , method ) ;
public class SimonPreparedStatement { /** * Measure and execute prepared SQL operation . * @ return count of updated rows * @ throws java . sql . SQLException if real calls fails */ @ Override public final int executeUpdate ( ) throws SQLException { } }
Split split = prepare ( ) ; try { return stmt . executeUpdate ( ) ; } finally { finish ( split ) ; }
public class WDDXConverter { /** * serialize a DateTime * @ param dateTime DateTime to serialize * @ return serialized dateTime * @ throws ConverterException */ private String _serializeDateTime ( DateTime dateTime ) { } }
// try { String strDate = new lucee . runtime . format . DateFormat ( Locale . US ) . format ( dateTime , "yyyy-m-d" , TimeZoneConstants . UTC ) ; String strTime = new lucee . runtime . format . TimeFormat ( Locale . US ) . format ( dateTime , "H:m:s" , TimeZoneConstants . UTC ) ; return goIn ( ) + "<dateTime>" + strDate + "T" + strTime + "+0:0" + "</dateTime>" ; /* * } catch ( PageException e ) { throw new ConverterException ( e ) ; } */
public class DatabaseAdminClient { /** * Returns the schema of a Cloud Spanner database as a list of formatted DDL statements . This * method does not show pending schema updates , those may be queried using the * [ Operations ] [ google . longrunning . Operations ] API . * < p > Sample code : * < pre > < code > * try ( DatabaseAdminClient databaseAdminClient = DatabaseAdminClient . create ( ) ) { * DatabaseName database = DatabaseName . of ( " [ PROJECT ] " , " [ INSTANCE ] " , " [ DATABASE ] " ) ; * GetDatabaseDdlResponse response = databaseAdminClient . getDatabaseDdl ( database ) ; * < / code > < / pre > * @ param database Required . The database whose schema we wish to get . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final GetDatabaseDdlResponse getDatabaseDdl ( DatabaseName database ) { } }
GetDatabaseDdlRequest request = GetDatabaseDdlRequest . newBuilder ( ) . setDatabase ( database == null ? null : database . toString ( ) ) . build ( ) ; return getDatabaseDdl ( request ) ;
public class JsonDBTemplate { /** * / * ( non - Javadoc ) * @ see io . jsondb . JsonDBOperations # findAllAndModify ( java . lang . String , io . jsondb . query . Update , java . lang . Class ) */ @ Override public < T > List < T > findAllAndModify ( String jxQuery , Update update , Class < T > entityClass ) { } }
return findAllAndModify ( jxQuery , update , Util . determineCollectionName ( entityClass ) ) ;
public class RowMapper { /** * @ param rs * @ param columnNameArray * @ return * @ throws java . sql . SQLException */ public final List < Element > mapRowToList ( final ResultSet rs , final String columnNameArray ) throws SQLException { } }
if ( rs == null ) { return Collections . emptyList ( ) ; } final Array sqlArray = rs . getArray ( columnNameArray ) ; if ( sqlArray == null ) { return Collections . emptyList ( ) ; } else { final ResultSet resultSet = sqlArray . getResultSet ( ) ; final List < String > l = new ArrayList < String > ( ) ; while ( resultSet . next ( ) ) { String test = resultSet . getString ( 2 ) ; l . add ( test ) ; } List < Element > elements = new ArrayList < Element > ( l . size ( ) ) ; for ( String s : l ) { try { List < String > resultList = ParseUtils . postgresROW2StringList ( s ) ; Element element = new Element ( ) ; element . setRowList ( resultList ) ; elements . add ( element ) ; } catch ( Exception e ) { LOG . error ( "Problem parsing received ROW value [{}]: {}" , new Object [ ] { s , e . getMessage ( ) , e } ) ; } } return elements ; }
public class CmsJspImageBean { /** * Returns the image ratio . < p > * The ratio is in the form ' width - height ' , for example ' 4-3 ' or ' 16-9 ' . * In case no ratio was set , the pixel dimensions of the image are returned . < p > * @ return the image ratio */ public String getRatio ( ) { } }
if ( m_ratio == null ) { m_ratio = "" + getScaler ( ) . getWidth ( ) + "-" + getScaler ( ) . getHeight ( ) ; } return m_ratio ;
public class CmsLanguageCopyFolderAndLanguageSelectDialog { /** * Returns a list with the possible < code > { @ link Locale } < / code > selections based on the OpenCms configuration . * @ return a list with the possible < code > { @ link Locale } < / code > selections based on the OpenCms configuration . */ private List < CmsSelectWidgetOption > getLanguageSelections ( ) { } }
List < CmsSelectWidgetOption > result = new LinkedList < CmsSelectWidgetOption > ( ) ; List < Locale > sysLocales = OpenCms . getLocaleManager ( ) . getAvailableLocales ( ) ; CmsSelectWidgetOption option ; boolean first = true ; for ( Locale locale : sysLocales ) { option = new CmsSelectWidgetOption ( locale . toString ( ) , first , locale . getDisplayName ( getLocale ( ) ) ) ; first = false ; result . add ( option ) ; } return result ;
public class Slider2Renderer { /** * Returns converted value of the provided float value ( to the type that is used on the component ' s value * attribute ) . * @ param component Component to convert value for . * @ param value Float value to convert . * @ return Converted value of the provided float value ( to the type that is used on the component ' s value * attribute ) . */ private Number convert ( UIComponent component , Float value ) { } }
return convert ( ( Class < ? extends Number > ) getValueType ( component ) , value ) ;
public class SimpleRequestCache { /** * Removes a saved request from cache . * @ param request HTTP request * @ param response HTTP response */ @ Override public void removeRequest ( HttpServletRequest request , HttpServletResponse response ) { } }
HttpUtils . removeStateParam ( Config . RETURNTO_COOKIE , request , response ) ;
public class BigFloat { /** * Returns the { @ link BigFloat } that is < code > exp ( x ) < / code > . * @ param x the value * @ return the resulting { @ link BigFloat } * @ see BigDecimalMath # exp ( BigDecimal , MathContext ) */ public static BigFloat exp ( BigFloat x ) { } }
if ( x . isSpecial ( ) ) return x != NEGATIVE_INFINITY ? x : x . context . ZERO ; return x . context . valueOf ( BigDecimalMath . exp ( x . value , x . context . mathContext ) ) ;
public class NetworkManager { /** * Called when a component instance is ready . */ private void handleReady ( String address ) { } }
log . debug ( String . format ( "%s - Received ready message from %s" , NetworkManager . this , address ) ) ; ready . add ( address ) ; checkReady ( ) ;
public class ConditionMessage { /** * Factory method to create a new { @ link ConditionMessage } comprised of the specified * messages . * @ param messages the source messages ( may be { @ code null } ) * @ return a new { @ link ConditionMessage } instance */ public static ConditionMessage of ( Collection < ? extends ConditionMessage > messages ) { } }
ConditionMessage result = new ConditionMessage ( ) ; if ( messages != null ) { for ( ConditionMessage message : messages ) { result = new ConditionMessage ( result , message . toString ( ) ) ; } } return result ;
public class GrammarError { /** * getter for replace - gets * @ generated */ public String getReplace ( ) { } }
if ( GrammarError_Type . featOkTst && ( ( GrammarError_Type ) jcasType ) . casFeat_replace == null ) jcasType . jcas . throwFeatMissing ( "replace" , "cogroo.uima.GrammarError" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( GrammarError_Type ) jcasType ) . casFeatCode_replace ) ;
public class KriptonXmlContext { /** * / * ( non - Javadoc ) * @ see com . abubusoft . kripton . AbstractContext # createParser ( java . lang . String ) */ public XmlWrapperParser createParser ( String content ) { } }
try { ByteArrayInputStream inputStream = new ByteArrayInputStream ( content . getBytes ( JsonEncoding . UTF8 . toString ( ) ) ) ; return new XmlWrapperParser ( this , inputStream , getSupportedFormat ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new KriptonRuntimeException ( e ) ; }
public class SharedPreferencesHelper { /** * Retrieve a long value from the preferences . * @ param key The name of the preference to retrieve * @ param defaultValue Value to return if this preference does not exist * @ return the preference value if it exists , or defaultValue . */ public Long loadPreferenceAsLong ( String key , Long defaultValue ) { } }
Long value = defaultValue ; if ( hasPreference ( key ) ) { value = getSharedPreferences ( ) . getLong ( key , 0L ) ; } logLoad ( key , value ) ; return value ;
public class ManagementException { /** * Description of the error . * important : You should avoid displaying description to the user , it ' s meant for debugging only . * @ return the error description . */ public String getDescription ( ) { } }
if ( description != null ) { return description ; } if ( UNKNOWN_ERROR . equals ( getCode ( ) ) ) { return String . format ( "Received error with code %s" , getCode ( ) ) ; } return "Failed with unknown error" ;
public class AuthenticationMethod { /** * Sets the logged out indicator pattern . * @ param loggedOutIndicatorPattern the new logged out indicator pattern */ public void setLoggedOutIndicatorPattern ( String loggedOutIndicatorPattern ) { } }
if ( loggedOutIndicatorPattern == null || loggedOutIndicatorPattern . trim ( ) . length ( ) == 0 ) { this . loggedOutIndicatorPattern = null ; } else { this . loggedOutIndicatorPattern = Pattern . compile ( loggedOutIndicatorPattern ) ; }
public class LazyIterate { /** * Creates a deferred filtering and transforming iterable for the specified iterable */ public static < T , V > LazyIterable < V > collectIf ( Iterable < T > iterable , Predicate < ? super T > predicate , Function < ? super T , ? extends V > function ) { } }
return LazyIterate . select ( iterable , predicate ) . collect ( function ) ;
public class Para { /** * Executes a { @ link java . lang . Runnable } asynchronously . * @ param runnable a task */ public static void asyncExecute ( Runnable runnable ) { } }
if ( runnable != null ) { try { Para . getExecutorService ( ) . execute ( runnable ) ; } catch ( RejectedExecutionException ex ) { logger . warn ( ex . getMessage ( ) ) ; try { runnable . run ( ) ; } catch ( Exception e ) { logger . error ( null , e ) ; } } }
public class RestRouter { /** * Provide an injector to getInstance classes where needed * @ param provider class type */ public static void injectWith ( Class < InjectionProvider > provider ) { } }
try { injectionProvider = ( InjectionProvider ) ClassFactory . newInstanceOf ( provider ) ; log . info ( "Registered injection provider: " + injectionProvider . getClass ( ) . getName ( ) ) ; } catch ( ClassFactoryException e ) { log . error ( "Failed to instantiate injection provider: " , e ) ; throw new IllegalArgumentException ( e ) ; }
public class PrivateIpAddressDetailsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PrivateIpAddressDetails privateIpAddressDetails , ProtocolMarshaller protocolMarshaller ) { } }
if ( privateIpAddressDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( privateIpAddressDetails . getPrivateDnsName ( ) , PRIVATEDNSNAME_BINDING ) ; protocolMarshaller . marshall ( privateIpAddressDetails . getPrivateIpAddress ( ) , PRIVATEIPADDRESS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DAOGenerator { /** * transform the listing of table groups , according to table */ private Map < String , Set < String [ ] > > transformGroup ( List < String [ ] > tableGroups ) { } }
Map < String , Set < String [ ] > > model_tableGroup = new LinkedHashMap < String , Set < String [ ] > > ( ) ; for ( String [ ] list : tableGroups ) { for ( String table : list ) { if ( model_tableGroup . containsKey ( table ) ) { Set < String [ ] > tableGroupSet = model_tableGroup . get ( table ) ; tableGroupSet . add ( list ) ; } else { Set < String [ ] > tableGroupSet = new HashSet < String [ ] > ( ) ; tableGroupSet . add ( list ) ; model_tableGroup . put ( table , tableGroupSet ) ; } } } return model_tableGroup ;
public class CmsUploadButtonConnector { /** * Creates a button handler according to the component state . < p > * @ return the button handler */ private I_CmsUploadButtonHandler createButtonHandler ( ) { } }
I_CmsUploadButtonHandler buttonHandler = null ; switch ( getState ( ) . getUploadType ( ) ) { case singlefile : buttonHandler = new CmsSingleFileUploadHandler ( new ButtonContextSupplier ( ) , getState ( ) . getDialogTitle ( ) ) ; ( ( CmsSingleFileUploadHandler ) buttonHandler ) . setTargetFolderPath ( getState ( ) . getTargetFolderRootPath ( ) ) ; ( ( CmsSingleFileUploadHandler ) buttonHandler ) . setTargetFileName ( getState ( ) . getTargetFileName ( ) ) ; ( ( CmsSingleFileUploadHandler ) buttonHandler ) . setTargetFileNamePrefix ( getState ( ) . getTargetFileNamePrefix ( ) ) ; break ; case multifile : default : buttonHandler = new CmsDialogUploadButtonHandler ( new ButtonContextSupplier ( ) ) ; ( ( CmsDialogUploadButtonHandler ) buttonHandler ) . setIsTargetRootPath ( true ) ; ( ( CmsDialogUploadButtonHandler ) buttonHandler ) . setTargetFolder ( getState ( ) . getTargetFolderRootPath ( ) ) ; break ; } return buttonHandler ;
public class Store { /** * Method to get the properties for the resource . * @ param _ id id of the resource * @ throws EFapsException on error */ private void loadResourceProperties ( final long _id ) throws EFapsException { } }
this . resourceProperties . clear ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( CIAdminCommon . Property ) ; queryBldr . addWhereAttrEqValue ( CIAdminCommon . Property . Abstract , _id ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIAdminCommon . Property . Name , CIAdminCommon . Property . Value ) ; multi . executeWithoutAccessCheck ( ) ; while ( multi . next ( ) ) { this . resourceProperties . put ( multi . < String > getAttribute ( CIAdminCommon . Property . Name ) , multi . < String > getAttribute ( CIAdminCommon . Property . Value ) ) ; }
public class Vertex { /** * 创建一个地名实例 * @ param realWord 数字对应的真实字串 * @ return 地名顶点 */ public static Vertex newAddressInstance ( String realWord ) { } }
return new Vertex ( Predefine . TAG_PLACE , realWord , new CoreDictionary . Attribute ( Nature . ns , 1000 ) ) ;
public class ClusterForkLiftTool { /** * Return args parser * @ return program parser */ private static OptionParser getParser ( ) { } }
OptionParser parser = new OptionParser ( ) ; parser . accepts ( "help" , "print help information" ) ; parser . accepts ( "src-url" , "[REQUIRED] bootstrap URL of source cluster" ) . withRequiredArg ( ) . describedAs ( "source-bootstrap-url" ) . ofType ( String . class ) ; parser . accepts ( "dst-url" , "[REQUIRED] bootstrap URL of destination cluster" ) . withRequiredArg ( ) . describedAs ( "destination-bootstrap-url" ) . ofType ( String . class ) ; parser . accepts ( "stores" , "Store names to forklift. Comma delimited list or singleton. [Default: ALL SOURCE STORES]" ) . withRequiredArg ( ) . describedAs ( "stores" ) . withValuesSeparatedBy ( ',' ) . ofType ( String . class ) ; parser . accepts ( "partitions" , "partitions to forklift. Comma delimited list or singleton. [Default: ALL SOURCE PARTITIONS]" ) . withRequiredArg ( ) . describedAs ( "partitions" ) . withValuesSeparatedBy ( ',' ) . ofType ( Integer . class ) ; parser . accepts ( "max-puts-per-second" , "Maximum number of put(...) operations issued against destination cluster per second. [Default: " + DEFAULT_MAX_PUTS_PER_SEC + " ]" ) . withRequiredArg ( ) . describedAs ( "maxPutsPerSecond" ) . ofType ( Integer . class ) ; parser . accepts ( "progress-period-ops" , "Number of operations between progress info is displayed. [Default: " + DEFAULT_PROGRESS_PERIOD_OPS + " ]" ) . withRequiredArg ( ) . describedAs ( "progressPeriodOps" ) . ofType ( Integer . class ) ; parser . accepts ( "parallelism" , "Number of partitions to fetch in parallel. [Default: " + DEFAULT_PARTITION_PARALLELISM + " ]" ) . withRequiredArg ( ) . describedAs ( "partitionParallelism" ) . ofType ( Integer . class ) ; parser . accepts ( "mode" , "Determines if a thorough global resolution needs to be done, by comparing all replicas. [Default: " + ForkLiftTaskMode . primary_resolution . toString ( ) + " Fetch from primary alone ]" ) . withOptionalArg ( ) . describedAs ( "mode" ) . ofType ( String . class ) ; parser . accepts ( OVERWRITE_OPTION , OVERWRITE_WARNING_MESSAGE ) . withOptionalArg ( ) . describedAs ( "overwriteExistingValue" ) . ofType ( Boolean . class ) . defaultsTo ( false ) ; parser . accepts ( IGNORE_SCHEMA_MISMATCH , IGNORE_SCHEMA_WARNING_MESSAGE ) . withOptionalArg ( ) . describedAs ( "ignoreSchemaMismatch" ) . ofType ( Boolean . class ) . defaultsTo ( false ) ; return parser ;
public class YamlConfig { /** * Adds a serializer for the specified scalar type . */ public void setScalarSerializer ( Class type , ScalarSerializer serializer ) { } }
if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; if ( serializer == null ) throw new IllegalArgumentException ( "serializer cannot be null." ) ; scalarSerializers . put ( type , serializer ) ;
public class BaseMessageProcessor { /** * Given the message ( code ) name , get the message processor . * @ param taskParent Task to pass to new process . * @ param recordMain Record to pass to the new process . * @ param properties Properties to pass to the new process . * @ param strMessageName The name of the message to get the processor from ( the message code or ID in the MessageInfo file ) . * @ param mapMessageInfo Return the message properties in this map . * @ return The new MessageProcessor . */ public static BaseMessageProcessor getMessageProcessor ( Task taskParent , BaseMessage externalTrxMessage , String strDefaultProcessorClass ) { } }
BaseMessageProcessor messageProcessor = null ; String strClass = null ; if ( externalTrxMessage != null ) strClass = ( String ) ( ( TrxMessageHeader ) externalTrxMessage . getMessageHeader ( ) ) . get ( TrxMessageHeader . MESSAGE_PROCESSOR_CLASS ) ; if ( ( strClass == null ) || ( strClass . length ( ) == 0 ) ) strClass = strDefaultProcessorClass ; String strPackage = null ; if ( externalTrxMessage != null ) strPackage = ( String ) ( ( TrxMessageHeader ) externalTrxMessage . getMessageHeader ( ) ) . get ( TrxMessageHeader . BASE_PACKAGE ) ; strClass = ClassServiceUtility . getFullClassName ( strPackage , strClass ) ; messageProcessor = ( BaseMessageProcessor ) ClassServiceUtility . getClassService ( ) . makeObjectFromClassName ( strClass ) ; if ( messageProcessor != null ) messageProcessor . init ( taskParent , null , null ) ; else Utility . getLogger ( ) . warning ( "Message processor not found: " + strClass ) ; return messageProcessor ;
public class AbstractWebAppMain { /** * Performs pre start - up environment check . * @ return * false if a check fails . Webapp will fail to boot in this case . */ protected boolean checkEnvironment ( ) { } }
home = getHomeDir ( ) . getAbsoluteFile ( ) ; home . mkdirs ( ) ; LOGGER . info ( getApplicationName ( ) + " home directory: " + home ) ; // check that home exists ( as mkdirs could have failed silently ) , otherwise throw a meaningful error if ( ! home . exists ( ) ) { context . setAttribute ( APP , new NoHomeDirError ( home ) ) ; return false ; } return true ;
public class Attributr { /** * Open the third party licenses activity with the supplied configuration file * @ param ctx the context reference to launch the activity with * @ param configResId the XML configuration resource id * @ param title the Activity / Screen title you want to use */ public static void openLicenses ( Context ctx , @ XmlRes int configResId , String title ) { } }
Intent intent = new Intent ( ctx , LicenseActivity . class ) ; intent . putExtra ( com . ftinc . kit . attributr . ui . LicenseActivity . EXTRA_CONFIG , configResId ) ; intent . putExtra ( com . ftinc . kit . attributr . ui . LicenseActivity . EXTRA_TITLE , title ) ; ctx . startActivity ( intent ) ;
public class FastMath { /** * Compute the inverse ( reciprocal of ) the square root . Note this is a " fast " * version based on * < a href = " http : / / en . wikipedia . org / wiki / Methods _ of _ computing _ square _ roots # Reciprocal _ of _ the _ square _ root " > Greg Walsh ' s algorithm < / a > . * Basic testing shows this to be accurate within an epsilon of at least * < code > 0.000001 < / code > . * @ param a a number on which evaluation is done * @ return inverse square root of a */ public static float invSqrtFast ( final float a ) { } }
final float half_a = 0.5f * a ; float ux = a ; final int ui = 0x5f3759df - ( Float . floatToIntBits ( ux ) >> 1 ) ; final float floatBits = Float . intBitsToFloat ( ui ) ; ux = floatBits * ( 1.5f - half_a * floatBits * floatBits ) ; // After the first computation of ' ux ' above , we no longer have to use ' floatBits ' . // We can just use ' ux ' as is . Note that this line can be repeated arbitrarily // many times to increase accuracy . Based on a few tests , I see that two // iterations produces the same result as 1 / Math . sqrt ( ) does . ux = ux * ( 1.5f - half_a * ux * ux ) ; return ux ;
public class SplitlogLoggerFactory { /** * Force Splitlog ' s internal logging to be disabled . */ public synchronized static void silenceLogging ( ) { } }
if ( SplitlogLoggerFactory . state == SplitlogLoggingState . OFF ) { return ; } SplitlogLoggerFactory . state = SplitlogLoggingState . OFF ; SplitlogLoggerFactory . messageCounter . set ( 0 ) ; /* * intentionally using the original logger so that this message can not * be silenced */ LoggerFactory . getLogger ( SplitlogLoggerFactory . class ) . info ( "Forcibly disabled Splitlog's internal logging." ) ;
public class DownloadMojo { /** * Downloads the files */ @ Override public void execute ( ) throws MojoExecutionException , MojoFailureException { } }
if ( isSkip ( ) ) { return ; } PackageDownloader downloader = new PackageDownloader ( getPackageManagerProperties ( ) , getLoggerWrapper ( ) ) ; File outputFileObject = downloader . downloadFile ( getPackageFile ( ) , this . outputFile ) ; if ( this . unpack ) { unpackFile ( outputFileObject ) ; }
public class Settings { /** * This entry routine of the library prints information to the standard * output stream ( System . out ) , mainly for user information . * Recognized options for output : * < ul > * < li > no options : default library header information and bundle listing < / li > * < li > - v , - - version : prints library name and version < / li > * < / ul > * @ param args argument list with options controlling output information */ public static void main ( String [ ] args ) { } }
if ( args . length > 0 && ( args [ 0 ] . equals ( "--version" ) || args [ 0 ] . equals ( "-v" ) ) ) out ( getLibraryHeader ( false ) ) ; else { out ( getLibraryHeader ( true ) ) ; out ( "available bundles:" ) ; out ( getBundleListing ( ) ) ; }
public class Es6RewriteModules { /** * Rewrite a single ES6 module file to a global script version . */ private void processFile ( Node root ) { } }
checkArgument ( isEs6ModuleRoot ( root ) , root ) ; clearState ( ) ; root . putBooleanProp ( Node . TRANSPILED , true ) ; NodeTraversal . traverse ( compiler , root , this ) ;
import java . util . ArrayList ; import java . util . List ; public class MinimumPath { /** * Given a square grid of dimensions NxN , where each cell contains a unique integer within [ 1 , N * N ] , * returns the lexicographically smallest path of specified length starting from any cell . Movement * can be made to any neighbouring cell ( possibly revisiting the cells ) , but staying within the grid boundaries . * Args : * matrix : The grid represented as a 2D list of integers . * length : The path length . * Returns : * A list of integers in cell values representing the lexicographically smallest path . * Examples : * minimum _ path ( [ [ 1,2,3 ] , [ 4,5,6 ] , [ 7,8,9 ] ] , 3 ) - > [ 1 , 2 , 1] * minimum _ path ( [ [ 5,9,3 ] , [ 4,1,6 ] , [ 7,8,2 ] ] , 1 ) - > [ 1] */ public static List < Integer > minimumPath ( int [ ] [ ] matrix , int length ) { } }
int gridSize = matrix . length ; int smallestValue = gridSize * gridSize + 1 ; for ( int row = 0 ; row < gridSize ; row ++ ) { for ( int col = 0 ; col < gridSize ; col ++ ) { if ( matrix [ row ] [ col ] == 1 ) { List < Integer > neighbours = new ArrayList < > ( ) ; if ( row != 0 ) { neighbours . add ( matrix [ row - 1 ] [ col ] ) ; } if ( col != 0 ) { neighbours . add ( matrix [ row ] [ col - 1 ] ) ; } if ( row != gridSize - 1 ) { neighbours . add ( matrix [ row + 1 ] [ col ] ) ; } if ( col != gridSize - 1 ) { neighbours . add ( matrix [ row ] [ col + 1 ] ) ; } for ( int neighbour : neighbours ) { smallestValue = Math . min ( smallestValue , neighbour ) ; } } } } List < Integer > path = new ArrayList < > ( ) ; for ( int i = 0 ; i < length ; i ++ ) { path . add ( ( i % 2 == 0 ) ? 1 : smallestValue ) ; } return path ;
public class CatalogUtil { /** * Print procedure detail , such as statement text , frag id and json plan . * @ Param proc Catalog procedure */ public static String printUserProcedureDetail ( Procedure proc ) { } }
PureJavaCrc32C crc = new PureJavaCrc32C ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Procedure:" + proc . getTypeName ( ) ) . append ( "\n" ) ; for ( Statement stmt : proc . getStatements ( ) ) { // compute hash for determinism check String sqlText = stmt . getSqltext ( ) ; crc . reset ( ) ; crc . update ( sqlText . getBytes ( Constants . UTF8ENCODING ) ) ; int hash = ( int ) crc . getValue ( ) ; sb . append ( "Statement Hash: " ) . append ( hash ) ; sb . append ( ", Statement SQL: " ) . append ( sqlText ) ; for ( PlanFragment frag : stmt . getFragments ( ) ) { byte [ ] planHash = Encoder . hexDecode ( frag . getPlanhash ( ) ) ; long planId = ActivePlanRepository . getFragmentIdForPlanHash ( planHash ) ; String stmtText = ActivePlanRepository . getStmtTextForPlanHash ( planHash ) ; byte [ ] jsonPlan = ActivePlanRepository . planForFragmentId ( planId ) ; sb . append ( "Plan Stmt Text:" ) . append ( stmtText ) ; sb . append ( ", Plan Fragment Id:" ) . append ( planId ) ; sb . append ( ", Json Plan:" ) . append ( new String ( jsonPlan ) ) ; } sb . append ( "\n" ) ; } return sb . toString ( ) ;
public class EngineProperties { /** * Get number of milliseconds the exporter will wait after RECORDS _ YIELD are exported * @ return number of milliseconds the exporter will wait after RECORDS _ YIELD are exported */ public static int getMillisYield ( ) { } }
String s = System . getProperty ( MILLIS_YIELD_PROPERTY ) ; int millis = DEFAULT_MILLIS_YIELD ; if ( s != null ) { try { millis = Integer . parseInt ( s ) ; } catch ( NumberFormatException ex ) { // records remains DEFAULT _ MILLIS _ YIELD } } return millis ;
public class IsNotNull { /** * ( non - Javadoc ) * @ see net . leadware . persistence . tools . api . utils . restrictions . Predicate # generateJPAPredicate ( javax . persistence . criteria . CriteriaBuilder , javax . persistence . criteria . Root ) */ public Predicate generateJPAPredicate ( CriteriaBuilder criteriaBuilder , Root < ? > root ) { } }
// On retourne le predicat return criteriaBuilder . isNotNull ( this . < Boolean > buildPropertyPath ( root , property ) ) ;
public class KxPublisherActor { /** * see onError ( ) comment */ public void _onNext ( IN in ) { } }
if ( subscribers == null ) return ; openRequested -- ; try { OUT apply = processor . apply ( in ) ; if ( apply != null ) { forwardMessage ( apply ) ; } else { emitRequestNext ( ) ; } } catch ( Throwable err ) { err . printStackTrace ( ) ; forwardError ( err ) ; }
public class ShuttleList { /** * Move the selected items in the chosen list to the source list . I . e . , * remove them from our selection model . */ protected void moveRightToLeft ( ) { } }
Object [ ] chosenSelectedValues = chosenList . getSelectedValues ( ) ; int nChosenSelected = chosenSelectedValues . length ; int [ ] chosenSelected = new int [ nChosenSelected ] ; if ( nChosenSelected == 0 ) { return ; // Nothing to move } // Get our current selection int [ ] currentSelected = helperList . getSelectedIndices ( ) ; int nCurrentSelected = currentSelected . length ; // Fill the chosenSelected array with the indices of the selected chosen // items for ( int i = 0 ; i < nChosenSelected ; i ++ ) { chosenSelected [ i ] = indexOf ( chosenSelectedValues [ i ] ) ; } // Construct the new selected indices . Loop through the current list // and compare to the head of the chosen list . If not equal , then add // to the new list . If equal , skip it and bump the head pointer on the // chosen list . int newSelection [ ] = new int [ nCurrentSelected - nChosenSelected ] ; int newSelPos = 0 ; int chosenPos = 0 ; for ( int i = 0 ; i < nCurrentSelected ; i ++ ) { int currentIdx = currentSelected [ i ] ; if ( chosenPos < nChosenSelected && currentIdx == chosenSelected [ chosenPos ] ) { chosenPos += 1 ; } else { newSelection [ newSelPos ++ ] = currentIdx ; } } // Install the new selection helperList . setSelectedIndices ( newSelection ) ; update ( ) ;
public class InstanceFailoverGroupsInner { /** * Lists the failover groups in a location . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param locationName The name of the region where the resource is located . * @ 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 PagedList & lt ; InstanceFailoverGroupInner & gt ; object if successful . */ public PagedList < InstanceFailoverGroupInner > listByLocation ( final String resourceGroupName , final String locationName ) { } }
ServiceResponse < Page < InstanceFailoverGroupInner > > response = listByLocationSinglePageAsync ( resourceGroupName , locationName ) . toBlocking ( ) . single ( ) ; return new PagedList < InstanceFailoverGroupInner > ( response . body ( ) ) { @ Override public Page < InstanceFailoverGroupInner > nextPage ( String nextPageLink ) { return listByLocationNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class NestedMatcher { /** * Appends description of { @ code s } to { @ code d } , * enclosed in parantheses if necessary . * @ param description * @ param nested * @ param message */ protected void nestedDescribe ( SelfDescribing nested , Description description , String message ) { } }
Nested . describeTo ( this , nested , description , message ) ;
public class FeatureReport { /** * Add a new feature to this report . * @ param name * The name of the feature ( must not be null ) * @ param path * The location of the feature ( can be null ) * @ param value * The value of the feature ( can be null ) */ public void report ( FeatureEnum name , EPUBLocation location , String value ) { } }
features . put ( name , new Feature ( name , location , value ) ) ;
public class SystemContextView { /** * Adds all software systems and people that are directly connected to the specified element . * @ param element an Element */ @ Override public void addNearestNeighbours ( @ Nonnull Element element ) { } }
if ( element == null ) { throw new IllegalArgumentException ( "An element must be specified." ) ; } if ( element instanceof Person || element instanceof SoftwareSystem ) { super . addNearestNeighbours ( element , Person . class ) ; super . addNearestNeighbours ( element , SoftwareSystem . class ) ; } else { throw new IllegalArgumentException ( "A person or software system must be specified." ) ; }
public class EnumLookup { /** * Creates an EnumLookup instance for the enumerate of the given class */ public static < K extends Enum < K > & Keyed < String > > EnumLookup < K , String > of ( final Class < K > enumClass , final boolean caseSensitive ) { } }
return new EnumLookup < K , String > ( enumClass , - 1 , caseSensitive ) ;
public class Utilities { /** * Returns whether the session ID is encoded into the URL . * @ param encodedUrl * the url to check * @ param sessionIdName * the name of the session ID , e . g . jsessionid * @ return boolean value , true if session ID is encoded into the URL . */ public static boolean isSessionEncodedInUrl ( String encodedUrl , String sessionIdName ) { } }
int sessionIdIndex = encodedUrl . indexOf ( getSessionIdSubstring ( sessionIdName ) ) ; return sessionIdIndex >= 0 ;
public class NodeRegisterImpl { /** * { @ inheritDoc } */ public Node stickSessionToNode ( String callID , Node sipNode ) { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "sticking CallId " + callID + " to node " + null ) ; } return null ;
public class HttpRequest { /** * 设置Cookie < br > * 自定义Cookie后会覆盖Hutool的默认Cookie行为 * @ param cookies Cookie值数组 , 如果为 { @ code null } 则设置无效 , 使用默认Cookie行为 * @ return this * @ since 3.1.1 */ public HttpRequest cookie ( HttpCookie ... cookies ) { } }
if ( ArrayUtil . isEmpty ( cookies ) ) { return disableCookie ( ) ; } return cookie ( ArrayUtil . join ( cookies , ";" ) ) ;
public class RelationalOperations { /** * Returns true if polygon _ a touches polyline _ b . */ private static boolean polygonTouchesPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { } }
// Quick rasterize test to see whether the the geometries are disjoint , // or if one is contained in the other . int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains ) return false ; return polygonTouchesPolylineImpl_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ;
public class XPath10ParserImpl { /** * Parse the XPath Selector expression . * @ param selector * @ throws InvalidXPathSyntaxException */ private void parseSelector ( String selector ) throws InvalidXPathSyntaxException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "parseSelector" , "selector: " + selector ) ; // Set the locationStep to - 1 locationStep = - 1 ; int start = 0 ; // find number of path separators // Pre - check selector for multi - level wildcards . We can ' t handle these in // the optimised code . Simply wrap the entire expression int posWildCard = selector . indexOf ( "//" , start ) ; if ( posWildCard >= 0 ) { // We have a multi - level wildcard , process the whole thing locationStep = 0 ; selOperands . add ( createIdentifierForWildExpression ( selector ) ) ; return ; } // Locate the first path separator int posSeparator = selector . indexOf ( "/" , start ) ; // Handle an initial separator character if ( posSeparator == 0 ) { // An initial slash String step = selector . substring ( start , start + 1 ) ; // Add an IdentifierImpl for the location step to the array list selOperands . add ( createIdentifierForSubExpression ( step , step , true , false ) ) ; // Bump the start counter start ++ ; } // Now iterate over the rest of the selector string attempting to isolate // Individual location path steps . int stepEnd = 0 ; while ( stepEnd >= 0 ) { StepProperties stepProperties = new StepProperties ( ) ; // Drive the method that isolates the next step isolateNextStep ( selector , start , stepProperties ) ; stepEnd = stepProperties . endOfStep ; // Useful debug if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( stepEnd < 0 ) { tc . debug ( this , cclass , "parsePredicate" , "isolated Step: " + selector . substring ( start ) + " and wrapStep is " + stepProperties . wrapStep ) ; } else { tc . debug ( this , cclass , "parsePredicate" , "isolated Step: " + selector . substring ( start , stepEnd ) + " and wrapStep is " + stepProperties . wrapStep ) ; } } // Should the entire location step be wrapped in an Identifier if ( stepProperties . wrapStep ) { if ( stepEnd < 0 ) { // Wrap entire location step in an Identifier wrapLastLocationStep ( selector , start , true ) ; } else { // Wrap intermediate location step in an Identifier wrapLocationStep ( selector , start , stepEnd ) ; } } else { // We can attempt to parse the step using the MatchParser if ( stepEnd < 0 ) { // This is the final location step parseLastLocationStep ( selector , start ) ; } else { // An intermediate location step parseLocationStep ( selector , start , stepEnd ) ; } } // Bump the start parameter and then look for next step if ( stepEnd >= 0 ) start = stepEnd + 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "parseSelector" ) ;
public class RtfStylesheetList { /** * Register a RtfParagraphStyle with this RtfStylesheetList . * @ param rtfParagraphStyle The RtfParagraphStyle to add . */ public void registerParagraphStyle ( RtfParagraphStyle rtfParagraphStyle ) { } }
RtfParagraphStyle tempStyle = new RtfParagraphStyle ( this . document , rtfParagraphStyle ) ; tempStyle . handleInheritance ( ) ; tempStyle . setStyleNumber ( this . styleMap . size ( ) ) ; this . styleMap . put ( tempStyle . getStyleName ( ) , tempStyle ) ;
public class LambdaToMethod { /** * < editor - fold defaultstate = " collapsed " desc = " Translation helper methods " > */ private JCBlock makeLambdaBody ( JCLambda tree , JCMethodDecl lambdaMethodDecl ) { } }
return tree . getBodyKind ( ) == JCLambda . BodyKind . EXPRESSION ? makeLambdaExpressionBody ( ( JCExpression ) tree . body , lambdaMethodDecl ) : makeLambdaStatementBody ( ( JCBlock ) tree . body , lambdaMethodDecl , tree . canCompleteNormally ) ;
public class SystemContextBean { private Map < String , Object > getScopeMap ( Scope scope ) { } }
switch ( scope ) { case FLASH : if ( flashAttributesFactoryBean != null ) { return flashAttributesFactoryBean . getAttributesMap ( ) ; } else { return getAttributesMap ( flashAttributesFactoryBeanName ) ; } case REQUEST : return getAttributesMap ( requestAttributesFactoryBeanName ) ; case SESSION : return getAttributesMap ( sessionAttributesFactoryBeanName ) ; case USER : return getAttributesMap ( userAttributesFactoryBeanName ) ; case CLIENTIP : return getAttributesMap ( clientIPAttributesFactoryBeanName ) ; case INSTANCE : return getAttributesMap ( instanceAttributesFactoryBeanName ) ; case GLOBAL : return getAttributesMap ( globalAttributesFactoryBeanName ) ; } return null ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcLogicalOperatorEnum ( ) { } }
if ( ifcLogicalOperatorEnumEEnum == null ) { ifcLogicalOperatorEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 857 ) ; } return ifcLogicalOperatorEnumEEnum ;
public class MetaDataService { /** * Delete entity * @ param entity entity * @ return is success */ public boolean deleteEntity ( Entity entity ) { } }
String entityName = entity . getName ( ) ; checkEntityIsEmpty ( entityName ) ; QueryPart < Entity > queryPart = new Query < Entity > ( "entities" ) . path ( entityName , true ) ; return httpClientManager . updateMetaData ( queryPart , delete ( ) ) ;
public class UnderFileSystemBlockReader { /** * Closes the block reader . After this , this block reader should not be used anymore . * This is recommended to be called after the client finishes reading the block . It is usually * triggered when the client unlocks the block . */ @ Override public void close ( ) throws IOException { } }
if ( mClosed ) { return ; } try { // This aborts the block if the block is not fully read . updateBlockWriter ( mBlockMeta . getBlockSize ( ) ) ; if ( mUnderFileSystemInputStream != null ) { mUfsInstreamManager . release ( mUnderFileSystemInputStream ) ; mUnderFileSystemInputStream = null ; } if ( mBlockWriter != null ) { mBlockWriter . close ( ) ; } mUfsResource . close ( ) ; } finally { mClosed = true ; }
public class DateUtil { /** * 偏移小时 * @ param date 日期 * @ param offset 偏移小时数 , 正数向未来偏移 , 负数向历史偏移 * @ return 偏移后的日期 */ public static DateTime offsetHour ( Date date , int offset ) { } }
return offset ( date , DateField . HOUR_OF_DAY , offset ) ;
public class CustomerAccountUrl { /** * Get Resource Url for GetCustomersPurchaseOrderAccounts * @ param accountType * @ param pageSize When creating paged results from a query , this value indicates the zero - based offset in the complete result set where the returned entities begin . For example , with this parameter set to 25 , to get the 51st through the 75th items , set startIndex to 50. * @ 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 . * @ param sortBy The element to sort the results by and the channel in which the results appear . Either ascending ( a - z ) or descending ( z - a ) channel . Optional . Refer to [ Sorting and Filtering ] ( . . / . . / . . / . . / Developer / api - guides / sorting - filtering . htm ) for more information . * @ param startIndex When creating paged results from a query , this value indicates the zero - based offset in the complete result set where the returned entities begin . For example , with pageSize set to 25 , to get the 51st through the 75th items , set this parameter to 50. * @ return String Resource Url */ public static MozuUrl getCustomersPurchaseOrderAccountsUrl ( String accountType , Integer pageSize , String responseFields , String sortBy , Integer startIndex ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/purchaseOrderAccounts?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&accountType={accountType}&responseFields={responseFields}" ) ; formatter . formatUrl ( "accountType" , accountType ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "sortBy" , sortBy ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class Tr { /** * Print the provided translated message if the input trace component allows * audit level messages . * @ param tc * the non - null < code > TraceComponent < / code > the event is * associated with . * @ param msgKey * the message key identifying an NLS message for this event . * This message must be in the resource bundle currently * associated with the < code > TraceComponent < / code > . * @ param objs * a number of < code > Objects < / code > to include as substitution * text in the message . The number of objects passed must equal * the number of substitution parameters the message expects . * Null is tolerated . */ public static final void audit ( TraceComponent tc , String msgKey , Object ... objs ) { } }
TrConfigurator . getDelegate ( ) . audit ( tc , msgKey , objs ) ;
public class UNIQUACActivityModel { @ Override public double tau ( Compound cj , Compound ci , ActivityModelBinaryParameter deltaU , double temperature ) { } }
double u = u ( cj , ci , deltaU , temperature ) ; return Math . exp ( - u / ( Constants . R * temperature ) ) ;
public class Transforms { /** * Multiplies the supplied two affine transforms , storing the result in { @ code into } . { @ code * into } may refer to the same instance as { @ code a } or { @ code b } . * @ return { @ code into } for chaining . */ public static < T extends Transform > T multiply ( AffineTransform a , AffineTransform b , T into ) { } }
return multiply ( a . m00 , a . m01 , a . m10 , a . m11 , a . tx , a . ty , b . m00 , b . m01 , b . m10 , b . m11 , b . tx , b . ty , into ) ;
public class CatalogAccessor { /** * Creates the catalog . */ public Catalog createCatalog ( ) { } }
final List < CatalogService > services = new ArrayList < > ( ) ; for ( BrokerServiceAccessor serviceAccessor : serviceAccessors ) { services . add ( serviceAccessor . getServiceDescription ( ) ) ; } return new Catalog ( services ) ;
public class JDBCConnection { /** * < ! - - start generic documentation - - > * Retrieves this < code > Connection < / code > object ' s current * transaction isolation level . * < ! - - end generic documentation - - > * < ! - - start release - specific documentation - - > * < div class = " ReleaseSpecificDocumentation " > * < h3 > HSQLDB - Specific Information : < / h3 > < p > * HSQLDB 2.0 supports all isolation levels . If database transaction * control is MVCC , < code > Connection . TRANSACTION _ READ _ UNCOMMITED < / code > * is promoted to < code > Connection . TRANSACTION _ READ _ COMMITED < / code > . * < / div > < ! - - end release - specific documentation - - > * @ return the current transaction isolation level , which will be one * of the following constants : * < code > Connection . TRANSACTION _ READ _ UNCOMMITTED < / code > , * < code > Connection . TRANSACTION _ READ _ COMMITTED < / code > , * < code > Connection . TRANSACTION _ REPEATABLE _ READ < / code > , * < code > Connection . TRANSACTION _ SERIALIZABLE < / code > , or * < code > Connection . TRANSACTION _ NONE < / code > . * @ exception SQLException if a database access error occurs * ( JDBC4 Clarification : ) * or this method is called on a closed connection * @ see JDBCDatabaseMetaData # supportsTransactionIsolationLevel * @ see # setTransactionIsolation */ public synchronized int getTransactionIsolation ( ) throws SQLException { } }
checkClosed ( ) ; try { return sessionProxy . getIsolation ( ) ; } catch ( HsqlException e ) { throw Util . sqlException ( e ) ; }
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the first commerce notification attachment in the ordered set where commerceNotificationQueueEntryId = & # 63 ; . * @ param commerceNotificationQueueEntryId the commerce notification queue entry ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce notification attachment * @ throws NoSuchNotificationAttachmentException if a matching commerce notification attachment could not be found */ @ Override public CommerceNotificationAttachment findByCommerceNotificationQueueEntryId_First ( long commerceNotificationQueueEntryId , OrderByComparator < CommerceNotificationAttachment > orderByComparator ) throws NoSuchNotificationAttachmentException { } }
CommerceNotificationAttachment commerceNotificationAttachment = fetchByCommerceNotificationQueueEntryId_First ( commerceNotificationQueueEntryId , orderByComparator ) ; if ( commerceNotificationAttachment != null ) { return commerceNotificationAttachment ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceNotificationQueueEntryId=" ) ; msg . append ( commerceNotificationQueueEntryId ) ; msg . append ( "}" ) ; throw new NoSuchNotificationAttachmentException ( msg . toString ( ) ) ;
public class XsdAsmEnum { /** * Creates an { @ link Enum } class based on the information received . * @ param attribute The { @ link XsdAttribute } that has the restrictions that are used to create the { @ link Enum } class . * @ param enumerations The { @ link List } of { @ link XsdEnumeration } that contains all the values that will be used in * the generated { @ link Enum } class . * @ param apiName The name of the generated fluent interface . */ static void createEnum ( XsdAttribute attribute , List < XsdEnumeration > enumerations , String apiName ) { } }
String enumName = getEnumName ( attribute ) ; String enumType = getFullClassTypeName ( enumName , apiName ) ; String enumTypeDesc = getFullClassTypeNameDesc ( enumName , apiName ) ; String fullJavaTypeDesc = getFullJavaType ( attribute ) ; String fullJavaType = fullJavaTypeDesc . substring ( 1 , fullJavaTypeDesc . length ( ) - 1 ) ; ClassWriter cw = generateClass ( enumName , "java/lang/Enum" , new String [ ] { ENUM_INTERFACE } , "Ljava/lang/Enum<" + enumTypeDesc + ">;L" + enumInterfaceType + "<" + fullJavaTypeDesc + ">;" , ACC_PUBLIC + ACC_FINAL + ACC_SUPER + ACC_ENUM , apiName ) ; FieldVisitor fVisitor ; enumerations . forEach ( enumElem -> { FieldVisitor fieldVisitor = cw . visitField ( ACC_PUBLIC + ACC_FINAL + ACC_STATIC + ACC_ENUM , validateElemName ( enumerations , enumElem ) , enumTypeDesc , null , null ) ; fieldVisitor . visitEnd ( ) ; } ) ; fVisitor = cw . visitField ( ACC_PRIVATE + ACC_FINAL , "value" , fullJavaTypeDesc , null , null ) ; fVisitor . visitEnd ( ) ; fVisitor = cw . visitField ( ACC_PRIVATE + ACC_FINAL + ACC_STATIC + ACC_SYNTHETIC , "$VALUES" , "[" + enumTypeDesc , null , null ) ; fVisitor . visitEnd ( ) ; MethodVisitor mVisitor = cw . visitMethod ( ACC_PUBLIC + ACC_STATIC , "values" , "()[" + enumTypeDesc , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitFieldInsn ( GETSTATIC , enumType , "$VALUES" , "[" + enumTypeDesc ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , "[" + enumTypeDesc , "clone" , "()Ljava/lang/Object;" , false ) ; mVisitor . visitTypeInsn ( CHECKCAST , "[" + enumTypeDesc ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 0 ) ; mVisitor . visitEnd ( ) ; mVisitor = cw . visitMethod ( ACC_PUBLIC + ACC_STATIC , "valueOf" , "(Ljava/lang/String;)" + enumTypeDesc , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitLdcInsn ( Type . getType ( enumTypeDesc ) ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKESTATIC , "java/lang/Enum" , "valueOf" , "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;" , false ) ; mVisitor . visitTypeInsn ( CHECKCAST , enumType ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 2 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = cw . visitMethod ( ACC_PRIVATE , CONSTRUCTOR , "(Ljava/lang/String;I" + fullJavaTypeDesc + ")V" , "(" + fullJavaTypeDesc + ")V" , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 1 ) ; mVisitor . visitVarInsn ( ILOAD , 2 ) ; mVisitor . visitMethodInsn ( INVOKESPECIAL , "java/lang/Enum" , CONSTRUCTOR , "(Ljava/lang/String;I)V" , false ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitVarInsn ( ALOAD , 3 ) ; mVisitor . visitFieldInsn ( PUTFIELD , enumType , "value" , fullJavaTypeDesc ) ; mVisitor . visitInsn ( RETURN ) ; mVisitor . visitMaxs ( 3 , 4 ) ; mVisitor . visitEnd ( ) ; mVisitor = cw . visitMethod ( ACC_PUBLIC + ACC_FINAL , "getValue" , "()" + fullJavaTypeDesc , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitFieldInsn ( GETFIELD , enumType , "value" , fullJavaTypeDesc ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; mVisitor = cw . visitMethod ( ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC , "getValue" , "()Ljava/lang/Object;" , null , null ) ; mVisitor . visitCode ( ) ; mVisitor . visitVarInsn ( ALOAD , 0 ) ; mVisitor . visitMethodInsn ( INVOKEVIRTUAL , enumType , "getValue" , "()" + fullJavaTypeDesc , false ) ; mVisitor . visitInsn ( ARETURN ) ; mVisitor . visitMaxs ( 1 , 1 ) ; mVisitor . visitEnd ( ) ; MethodVisitor staticConstructor = cw . visitMethod ( ACC_STATIC , STATIC_CONSTRUCTOR , "()V" , null , null ) ; staticConstructor . visitCode ( ) ; int iConst = 0 ; for ( XsdEnumeration enumElem : enumerations ) { String elemName = validateElemName ( enumerations , enumElem ) ; staticConstructor . visitTypeInsn ( NEW , enumType ) ; staticConstructor . visitInsn ( DUP ) ; staticConstructor . visitLdcInsn ( elemName ) ; staticConstructor . visitIntInsn ( BIPUSH , iConst ) ; Object object = null ; try { object = Class . forName ( fullJavaType . replaceAll ( "/" , "." ) ) . getConstructor ( String . class ) . newInstance ( enumElem . getValue ( ) ) ; } catch ( ClassNotFoundException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e ) { throw new AsmException ( "Exception when creating Enum classes." , e ) ; } if ( object instanceof Boolean ) { object = String . valueOf ( object ) ; } staticConstructor . visitLdcInsn ( object ) ; staticConstructor . visitMethodInsn ( INVOKESTATIC , fullJavaType , "valueOf" , "(" + JAVA_OBJECT_DESC + ")" + fullJavaTypeDesc , false ) ; staticConstructor . visitMethodInsn ( INVOKESPECIAL , enumType , CONSTRUCTOR , "(Ljava/lang/String;I" + fullJavaTypeDesc + ")V" , false ) ; staticConstructor . visitFieldInsn ( PUTSTATIC , enumType , elemName , enumTypeDesc ) ; iConst += 1 ; } staticConstructor . visitIntInsn ( BIPUSH , enumerations . size ( ) ) ; staticConstructor . visitTypeInsn ( ANEWARRAY , enumType ) ; iConst = 0 ; for ( XsdEnumeration enumElem : enumerations ) { staticConstructor . visitInsn ( DUP ) ; staticConstructor . visitIntInsn ( BIPUSH , iConst ) ; staticConstructor . visitFieldInsn ( GETSTATIC , enumType , getEnumElementName ( enumElem ) , enumTypeDesc ) ; staticConstructor . visitInsn ( AASTORE ) ; iConst += 1 ; } staticConstructor . visitFieldInsn ( PUTSTATIC , enumType , "$VALUES" , "[" + enumTypeDesc ) ; staticConstructor . visitInsn ( RETURN ) ; staticConstructor . visitMaxs ( 6 , 0 ) ; staticConstructor . visitEnd ( ) ; writeClassToFile ( enumName , cw , apiName ) ;
public class AttributeDefinition { /** * Gets localized text from the given { @ link java . util . ResourceBundle } for the attribute . * @ param bundle the resource bundle . Cannot be { @ code null } * @ param prefix a prefix to dot - prepend to the attribute name to form a key to resolve in the bundle * @ return the resolved text */ public String getAttributeTextDescription ( final ResourceBundle bundle , final String prefix ) { } }
final String bundleKey = prefix == null ? name : ( prefix + "." + name ) ; return bundle . getString ( bundleKey ) ;
public class ServiceServices { /** * Return all services present in application * [ { " name " : " instancename " , methods = [ { " name " : " methodname " , " returntype " : " void " , " argtypes " : [ " " , " " ] , " argnames " : [ " name1 " , " name2 " ] , " argtemplates " : [ " " , " " ] } ] } ] * @ param httpSession * @ return */ public List < OcelotService > getServices ( HttpSession httpSession ) { } }
List < OcelotService > result = new ArrayList < > ( ) ; Options options = ( Options ) httpSession . getAttribute ( Constants . Options . OPTIONS ) ; if ( options == null ) { options = new Options ( ) ; httpSession . setAttribute ( Constants . Options . OPTIONS , options ) ; } options . setMonitor ( true ) ; for ( Object dataservice : dataservices ) { Class < ? > cls = unProxyClassServices . getRealClass ( dataservice . getClass ( ) ) ; if ( ! cls . isAnnotationPresent ( DashboardOnDebug . class ) || options . isDebug ( ) ) { OcelotService ocelotService = new OcelotService ( serviceTools . getInstanceNameFromDataservice ( cls ) ) ; result . add ( ocelotService ) ; addMethodsToMethodsService ( cls . getMethods ( ) , ocelotService . getMethods ( ) ) ; } } return result ;
public class EffectUtils { /** * Clear a transparent image to 100 % transparent * @ param img The image to clear */ static void clearImage ( BufferedImage img ) { } }
Graphics2D g2 = img . createGraphics ( ) ; g2 . setComposite ( AlphaComposite . Clear ) ; g2 . fillRect ( 0 , 0 , img . getWidth ( ) , img . getHeight ( ) ) ; g2 . dispose ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcColourSpecification ( ) { } }
if ( ifcColourSpecificationEClass == null ) { ifcColourSpecificationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 103 ) ; } return ifcColourSpecificationEClass ;