signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PanButton { /** * Paint this pan button ! */ public void accept ( PainterVisitor visitor , Object group , Bbox bounds , boolean recursive ) { } }
// First place the image at the correct location : image . setBounds ( new Bbox ( getUpperLeftCorner ( ) . getX ( ) , getUpperLeftCorner ( ) . getY ( ) , getWidth ( ) , getHeight ( ) ) ) ; // Then draw : if ( parent != null ) { map . getVectorContext ( ) . drawImage ( parent , getId ( ) , image . getHref ( ) , image . getBounds ( ) , ( PictureStyle ) image . getStyle ( ) ) ; } else { map . getVectorContext ( ) . drawImage ( group , getId ( ) , image . getHref ( ) , image . getBounds ( ) , ( PictureStyle ) image . getStyle ( ) ) ; } map . getVectorContext ( ) . setCursor ( parent , getId ( ) , Cursor . POINTER . getValue ( ) ) ;
public class CacheMapUtil { /** * retrival the cached map * @ param cacheConfigBean the datasource configuration of the cache * @ param key the key * @ param kClazz the key ' s class * @ param vClazz the values ' s class * @ param < K > the generic type of the key * @ param < V > the generic type of the value * @ return the whole map */ @ SuppressWarnings ( "all" ) public static < K , V > Maybe < Map < K , V > > getAll ( CacheConfigBean cacheConfigBean , String key , Class < K > kClazz , Class < V > vClazz ) { } }
return SingleRxXian . call ( CacheService . CACHE_SERVICE , "cacheMapGetAll" , new JSONObject ( ) { { put ( "cacheConfig" , cacheConfigBean ) ; put ( "key" , key ) ; } } ) . flatMapMaybe ( unitResponse -> { unitResponse . throwExceptionIfNotSuccess ( ) ; if ( unitResponse . getData ( ) == null ) return Maybe . empty ( ) ; else { JSONObject map = unitResponse . dataToJson ( ) ; if ( map == null || map . isEmpty ( ) ) return Maybe . just ( new HashMap < > ( ) ) ; Map < K , V > maps = new HashMap < > ( ) ; map . forEach ( ( _key , _value ) -> maps . put ( Reflection . toType ( _key , kClazz ) , Reflection . toType ( _value , vClazz ) ) ) ; return Maybe . just ( maps ) ; } } ) ;
public class TaskRuntime { /** * Run the task : Fire TaskStart , call Task . call ( ) , fire TaskStop . */ @ Override public void run ( ) { } }
try { // Change state and inform the Driver this . taskLifeCycleHandlers . beforeTaskStart ( ) ; LOG . log ( Level . FINEST , "Informing registered EventHandler<TaskStart>." ) ; this . currentStatus . setRunning ( ) ; // Call Task . call ( ) final byte [ ] result = this . runTask ( ) ; // Inform the Driver about it this . currentStatus . setResult ( result ) ; LOG . log ( Level . FINEST , "Informing registered EventHandler<TaskStop>." ) ; this . taskLifeCycleHandlers . afterTaskExit ( ) ; } catch ( final TaskStartHandlerFailure taskStartHandlerFailure ) { LOG . log ( Level . WARNING , "Caught an exception during TaskStart handler execution." , taskStartHandlerFailure ) ; this . currentStatus . setException ( taskStartHandlerFailure . getCause ( ) ) ; } catch ( final TaskStopHandlerFailure taskStopHandlerFailure ) { LOG . log ( Level . WARNING , "Caught an exception during TaskStop handler execution." , taskStopHandlerFailure ) ; this . currentStatus . setException ( taskStopHandlerFailure . getCause ( ) ) ; } catch ( final TaskCallFailure e ) { LOG . log ( Level . WARNING , "Caught an exception during Task.call()." , e . getCause ( ) ) ; this . currentStatus . setException ( e ) ; }
public class BasicRecordStoreLoader { /** * Loads the values for the provided keys in batches and invokes * partition operations to put the loaded entry batches into the * record store . * @ param keys the keys for which entries are loaded and put into the * record store * @ return the list of futures representing the pending completion of * the operations storing the loaded entries into the partition record * store */ private List < Future > doBatchLoad ( List < Data > keys ) { } }
Queue < List < Data > > batchChunks = createBatchChunks ( keys ) ; int size = batchChunks . size ( ) ; List < Future > futures = new ArrayList < > ( size ) ; while ( ! batchChunks . isEmpty ( ) ) { List < Data > chunk = batchChunks . poll ( ) ; List < Data > keyValueSequence = loadAndGet ( chunk ) ; if ( keyValueSequence . isEmpty ( ) ) { continue ; } futures . add ( sendOperation ( keyValueSequence ) ) ; } return futures ;
public class PeerAwareInstanceRegistryImpl { /** * Replicates all instance changes to peer eureka nodes except for * replication traffic to this node . */ private void replicateInstanceActionsToPeers ( Action action , String appName , String id , InstanceInfo info , InstanceStatus newStatus , PeerEurekaNode node ) { } }
try { InstanceInfo infoFromRegistry = null ; CurrentRequestVersion . set ( Version . V2 ) ; switch ( action ) { case Cancel : node . cancel ( appName , id ) ; break ; case Heartbeat : InstanceStatus overriddenStatus = overriddenInstanceStatusMap . get ( id ) ; infoFromRegistry = getInstanceByAppAndId ( appName , id , false ) ; node . heartbeat ( appName , id , infoFromRegistry , overriddenStatus , false ) ; break ; case Register : node . register ( info ) ; break ; case StatusUpdate : infoFromRegistry = getInstanceByAppAndId ( appName , id , false ) ; node . statusUpdate ( appName , id , newStatus , infoFromRegistry ) ; break ; case DeleteStatusOverride : infoFromRegistry = getInstanceByAppAndId ( appName , id , false ) ; node . deleteStatusOverride ( appName , id , infoFromRegistry ) ; break ; } } catch ( Throwable t ) { logger . error ( "Cannot replicate information to {} for action {}" , node . getServiceUrl ( ) , action . name ( ) , t ) ; }
public class AbstractStoreResource { /** * The output stream is written with the content of the file . From method { @ link # read ( ) } the input stream is used * and copied into the output stream . * @ param _ out output stream where the file content must be written * @ throws EFapsException if an error occurs * @ see # read ( ) */ @ Override public void read ( final OutputStream _out ) throws EFapsException { } }
StoreResourceInputStream in = null ; try { in = ( StoreResourceInputStream ) read ( ) ; if ( in != null ) { int length = 1 ; while ( length > 0 ) { length = in . read ( this . buffer ) ; if ( length > 0 ) { _out . write ( this . buffer , 0 , length ) ; } } } } catch ( final IOException e ) { throw new EFapsException ( AbstractStoreResource . class , "read.IOException" , e ) ; } finally { if ( in != null ) { try { in . closeWithoutCommit ( ) ; } catch ( final IOException e ) { AbstractStoreResource . LOG . warn ( "Catched IOException in class: " + this . getClass ( ) ) ; } } }
public class ApiOvhLicenseoffice { /** * Get this object properties * REST : GET / license / office / { serviceName } / domain / { domainName } * @ param serviceName [ required ] The unique identifier of your Office service * @ param domainName [ required ] Domain name */ public OvhOfficeDomain serviceName_domain_domainName_GET ( String serviceName , String domainName ) throws IOException { } }
String qPath = "/license/office/{serviceName}/domain/{domainName}" ; StringBuilder sb = path ( qPath , serviceName , domainName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOfficeDomain . class ) ;
public class SMailHonestPostie { protected void send ( Postcard postcard , SMailPostingMessage message ) { } }
if ( needsAsync ( postcard ) ) { asyncStrategy . async ( postcard , ( ) -> doSend ( postcard , message ) ) ; } else { doSend ( postcard , message ) ; }
public class JWT { /** * Creates the plain text JWT . */ protected String createPlainTextJWT ( ) { } }
com . google . gson . JsonObject header = createHeader ( ) ; com . google . gson . JsonObject payload = createPayload ( ) ; String plainTextTokenString = computeBaseString ( header , payload ) ; StringBuffer sb = new StringBuffer ( plainTextTokenString ) ; sb . append ( "." ) . append ( "" ) ; return sb . toString ( ) ;
public class J2EEServerMBeanImpl { /** * { @ inheritDoc } */ @ Override public String [ ] getjavaVMs ( ) { } }
ArrayList < String > javaVMs = new ArrayList < String > ( ) ; // There will be only one MBean registered javaVMs . addAll ( MBeanServerHelper . queryObjectName ( createPropertyPatternObjectName ( J2EEManagementObjectNameFactory . TYPE_JVM ) ) ) ; return javaVMs . toArray ( new String [ javaVMs . size ( ) ] ) ;
public class FluentMatching { /** * Specifies an match on a decomposing matcher with 0 extracted fields and then returns a fluent * interface for specifying the action to take if the value matches this case . */ public < U extends T > InitialMatching0 < T , U > when ( DecomposableMatchBuilder0 < U > decomposableMatchBuilder ) { } }
return new InitialMatching0 < > ( decomposableMatchBuilder . build ( ) , value ) ;
public class ElementDefinition { /** * syntactic sugar */ public ElementDefinition addCode ( Coding t ) { } }
if ( t == null ) return this ; if ( this . code == null ) this . code = new ArrayList < Coding > ( ) ; this . code . add ( t ) ; return this ;
public class AbstractSphere3F { /** * { @ inheritDoc } */ @ Pure @ Override public double distance ( Point3D p ) { } }
double d = FunctionalPoint3D . distancePointPoint ( getX ( ) , getY ( ) , getZ ( ) , p . getX ( ) , p . getY ( ) , p . getZ ( ) ) - getRadius ( ) ; return MathUtil . max ( 0. , d ) ;
public class Calc { /** * Calculate the RMSD of two Atom arrays , already superposed . * @ param x * array of Atoms superposed to y * @ param y * array of Atoms superposed to x * @ return RMSD */ public static double rmsd ( Atom [ ] x , Atom [ ] y ) { } }
return CalcPoint . rmsd ( atomsToPoints ( x ) , atomsToPoints ( y ) ) ;
public class CacheScheduler { /** * This method should be used from { @ link CacheGenerator # generateCache } implementations , to obtain a { @ link * VersionedCache } to be returned . * @ param entryId an object uniquely corresponding to the { @ link CacheScheduler . Entry } , for which VersionedCache is * created * @ param version version , associated with the cache */ public VersionedCache createVersionedCache ( @ Nullable EntryImpl < ? extends ExtractionNamespace > entryId , String version ) { } }
updatesStarted . incrementAndGet ( ) ; return new VersionedCache ( String . valueOf ( entryId ) , version ) ;
public class DataError { /** * Returns the data error for the given json doc in the list */ public static DataError findErrorForDoc ( List < DataError > list , JsonNode node ) { } }
for ( DataError x : list ) { if ( x . entityData == node ) { return x ; } } return null ;
public class Multisets { /** * Delegate that cares about the element types in multisetToModify . */ private static < E > boolean removeOccurrencesImpl ( Multiset < E > multisetToModify , Multiset < ? > occurrencesToRemove ) { } }
// TODO ( user ) : generalize to removing an Iterable , perhaps checkNotNull ( multisetToModify ) ; checkNotNull ( occurrencesToRemove ) ; boolean changed = false ; Iterator < Entry < E > > entryIterator = multisetToModify . entrySet ( ) . iterator ( ) ; while ( entryIterator . hasNext ( ) ) { Entry < E > entry = entryIterator . next ( ) ; int removeCount = occurrencesToRemove . count ( entry . getElement ( ) ) ; if ( removeCount >= entry . getCount ( ) ) { entryIterator . remove ( ) ; changed = true ; } else if ( removeCount > 0 ) { multisetToModify . remove ( entry . getElement ( ) , removeCount ) ; changed = true ; } } return changed ;
public class CmsSearchWidgetDialog { /** * Sets the last modification date the resources have to have as minimum . < p > * @ param minDateLastModified the last modification date the resources have to have as minimum to set */ public void setMinDateLastModified ( String minDateLastModified ) { } }
if ( ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( minDateLastModified ) ) && ( ! minDateLastModified . equals ( "0" ) ) ) { m_searchParams . setMinDateLastModified ( Long . parseLong ( minDateLastModified ) ) ; } else { m_searchParams . setMinDateLastModified ( Long . MIN_VALUE ) ; }
public class JMXMonConnectionPool { /** * Close all active connections by closing linked { @ link JMXConnector } */ public void closeAll ( ) { } }
for ( Object connection : pool . values ( ) ) { JMXMonConnection jmxcon = ( JMXMonConnection ) connection ; if ( jmxcon . connector != null ) { try { jmxcon . connector . close ( ) ; log . debug ( "jmx connector is closed" ) ; } catch ( Exception ex ) { log . debug ( "Can't close jmx connector, but continue" ) ; } } else { log . debug ( "jmxConnector == null, don't try to close connection" ) ; } jmxcon . connector = null ; jmxcon = null ; } /* erase pool informations for this run but will be recreate for the next run */ pool . clear ( ) ;
public class GrantEntitlementRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GrantEntitlementRequest grantEntitlementRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( grantEntitlementRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( grantEntitlementRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( grantEntitlementRequest . getEncryption ( ) , ENCRYPTION_BINDING ) ; protocolMarshaller . marshall ( grantEntitlementRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( grantEntitlementRequest . getSubscribers ( ) , SUBSCRIBERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class TraceSummary { /** * A list of resource ARNs for any resource corresponding to the trace segments . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResourceARNs ( java . util . Collection ) } or { @ link # withResourceARNs ( java . util . Collection ) } if you want to * override the existing values . * @ param resourceARNs * A list of resource ARNs for any resource corresponding to the trace segments . * @ return Returns a reference to this object so that method calls can be chained together . */ public TraceSummary withResourceARNs ( ResourceARNDetail ... resourceARNs ) { } }
if ( this . resourceARNs == null ) { setResourceARNs ( new java . util . ArrayList < ResourceARNDetail > ( resourceARNs . length ) ) ; } for ( ResourceARNDetail ele : resourceARNs ) { this . resourceARNs . add ( ele ) ; } return this ;
public class TrustGraphNode { /** * called to perform limited advertisement of this node ' s * information ( represented by message ) . The advertisement * will try to target the number of nodes specified in * getIdealReach ( ) by sending the message down some number * of random routes . The inboundTTL and sender of the * message are ignored . * @ param message the TrustGraphAdvertisement to send * through the trust network . */ public void advertiseSelf ( TrustGraphAdvertisement message ) { } }
/* * Choose the route length and number of neighbors to * advertise to based on the number of neighbors this * node has . The product of these two values determines * the intended reach . The route length is bounded by * the minimum and maximum route length paramters and the * number of neighbors is bounded by the degree . * If there are more neighbors available than are needed , * the random ordering kept by the routing table is used * to select the subset to advertise to . * If there are too many neighbors to use ( ie more than * reach / min route len ) The largest subset of neighbors * is chosen and each is sent a route approximately * reach / min in length . * TR2008-918 does not explicitly outline how to allocate * inexact divisions of route length or what to do in the * case that neither boundary condition is violated . * This implementation assumes that all neighbors should * be advertised to and that the strategy for allocating * route lengths to sum to the intended reach should * be repeatable in keeping with the intent of the * limited advertisement . */ final int idealReach = getIdealReach ( ) ; final int minRouteLength = getMinRouteLength ( ) ; final int maxRouteLength = getMaxRouteLength ( ) ; final List < TrustGraphNodeId > neighbors = getRoutingTable ( ) . getOrderedNeighbors ( ) ; final int neighborCount = neighbors . size ( ) ; /* if there are not enough neighbors to reach the * ideal number with maximum route length per neighbor , * just use them all . */ if ( neighborCount * maxRouteLength < idealReach ) { for ( TrustGraphNodeId n : neighbors ) { sendAdvertisement ( message , n , maxRouteLength ) ; } } /* Otherwise , use as many neigbors as possible . * The number of usable neighbors is bounded above * by idealReach / minRouteLength . */ else { // use as many neighbors as possible final int routes ; // too many neighbors , if all were used at min route length if ( neighborCount * minRouteLength > idealReach ) { routes = idealReach / minRouteLength ; } // can use all else { routes = neighborCount ; } /* distribute route lengths between min and max that sum to * idealReach . * floor ( idealReach / routes is the base length of each route , and * any remainder is spread out as one extra hop on each of the * first ' remainder ' routes . */ final int stdLen = idealReach / routes ; final int remainder = idealReach % routes ; /* send the actual adverstisements . Use the first ' routes ' neighbors * in the random ordering assigned by the routing table . */ Iterator < TrustGraphNodeId > it = neighbors . iterator ( ) ; for ( int i = 0 ; i < routes ; i ++ ) { int routeLength = stdLen ; if ( i < remainder ) { routeLength += 1 ; } sendAdvertisement ( message , it . next ( ) , routeLength ) ; } }
public class JSONUtils { /** * Tests if the String possibly represents a valid JSON String . < br > * Valid JSON strings are : * < ul > * < li > " null " < / li > * < li > starts with " [ " and ends with " ] " < / li > * < li > starts with " { " and ends with " } " < / li > * < / ul > */ public static boolean mayBeJSON ( String string ) { } }
return string != null && ( "null" . equals ( string ) || ( string . startsWith ( "[" ) && string . endsWith ( "]" ) ) || ( string . startsWith ( "{" ) && string . endsWith ( "}" ) ) ) ;
public class SkuManager { /** * Returns a base internal SKU by a store - specific SKU . * @ throws java . lang . IllegalArgumentException If the store name or a store SKU is empty or null . * @ see # mapSku ( String , String , String ) */ @ NotNull public String getSku ( @ NotNull String appstoreName , @ NotNull String storeSku ) { } }
checkSkuMappingParams ( appstoreName , storeSku ) ; Map < String , String > skuMap = storeSku2skuMappings . get ( appstoreName ) ; if ( skuMap != null && skuMap . containsKey ( storeSku ) ) { final String s = skuMap . get ( storeSku ) ; Logger . d ( "getSku() restore sku from storeSku: " , storeSku , " -> " , s ) ; return s ; } return storeSku ;
public class DropWizardMetrics { /** * Returns a { @ code Metric } collected from { @ link Meter } . * @ param dropwizardName the metric name . * @ param meter the meter object to collect * @ return a { @ code Metric } . */ private Metric collectMeter ( String dropwizardName , Meter meter ) { } }
String metricName = DropWizardUtils . generateFullMetricName ( dropwizardName , "meter" ) ; String metricDescription = DropWizardUtils . generateFullMetricDescription ( dropwizardName , meter ) ; MetricDescriptor metricDescriptor = MetricDescriptor . create ( metricName , metricDescription , DEFAULT_UNIT , Type . CUMULATIVE_INT64 , Collections . < LabelKey > emptyList ( ) ) ; TimeSeries timeSeries = TimeSeries . createWithOnePoint ( Collections . < LabelValue > emptyList ( ) , Point . create ( Value . longValue ( meter . getCount ( ) ) , clock . now ( ) ) , cumulativeStartTimestamp ) ; return Metric . createWithOneTimeSeries ( metricDescriptor , timeSeries ) ;
public class VDMJ { /** * The main method . This validates the arguments , then parses and type checks the files provided ( if any ) , and * finally enters the interpreter if required . * @ param args * Arguments passed to the program . */ @ SuppressWarnings ( "unchecked" ) public static void main ( String [ ] args ) { } }
List < File > filenames = new Vector < File > ( ) ; List < File > pathnames = new Vector < File > ( ) ; List < String > largs = Arrays . asList ( args ) ; VDMJ controller = null ; Dialect dialect = Dialect . VDM_SL ; String remoteName = null ; Class < RemoteControl > remoteClass = null ; String defaultName = null ; Properties . init ( ) ; // Read properties file , if any Settings . usingCmdLine = true ; if ( largs . contains ( "-version" ) ) { println ( getOvertureVersion ( ) ) ; System . exit ( 0 ) ; } for ( Iterator < String > i = largs . iterator ( ) ; i . hasNext ( ) ; ) { String arg = i . next ( ) ; if ( arg . equals ( "-vdmsl" ) ) { controller = new VDMSL ( ) ; dialect = Dialect . VDM_SL ; } else if ( arg . equals ( "-vdmpp" ) ) { controller = new VDMPP ( ) ; dialect = Dialect . VDM_PP ; } else if ( arg . equals ( "-vdmrt" ) ) { controller = new VDMRT ( ) ; dialect = Dialect . VDM_RT ; } else if ( arg . equals ( "-w" ) ) { warnings = false ; } else if ( arg . equals ( "-i" ) ) { interpret = true ; } else if ( arg . equals ( "-p" ) ) { pog = true ; } else if ( arg . equals ( "-q" ) ) { quiet = true ; } else if ( arg . equals ( "-e" ) ) { Settings . usingCmdLine = false ; interpret = true ; pog = false ; if ( i . hasNext ( ) ) { script = i . next ( ) ; } else { usage ( "-e option requires an expression" ) ; } } else if ( arg . equals ( "-o" ) ) { if ( i . hasNext ( ) ) { if ( outfile != null ) { usage ( "Only one -o option allowed" ) ; } outfile = i . next ( ) ; } else { usage ( "-o option requires a filename" ) ; } } else if ( arg . equals ( "-c" ) ) { if ( i . hasNext ( ) ) { filecharset = validateCharset ( i . next ( ) ) ; } else { usage ( "-c option requires a charset name" ) ; } } else if ( arg . equals ( "-t" ) ) { if ( i . hasNext ( ) ) { Console . setCharset ( validateCharset ( i . next ( ) ) ) ; } else { usage ( "-t option requires a charset name" ) ; } } else if ( arg . equals ( "-r" ) ) { if ( i . hasNext ( ) ) { Settings . release = Release . lookup ( i . next ( ) ) ; if ( Settings . release == null ) { usage ( "-r option must be " + Release . list ( ) ) ; } } else { usage ( "-r option requires a VDM release" ) ; } } else if ( arg . equals ( "-pre" ) ) { Settings . prechecks = false ; } else if ( arg . equals ( "-post" ) ) { Settings . postchecks = false ; } else if ( arg . equals ( "-inv" ) ) { Settings . invchecks = false ; } else if ( arg . equals ( "-dtc" ) ) { // NB . Turn off both when no DTC Settings . invchecks = false ; Settings . dynamictypechecks = false ; } else if ( arg . equals ( "-measures" ) ) { Settings . measureChecks = false ; } else if ( arg . equals ( "-log" ) ) { if ( i . hasNext ( ) ) { logfile = i . next ( ) ; } else { usage ( "-log option requires a filename" ) ; } } else if ( arg . equals ( "-remote" ) ) { if ( i . hasNext ( ) ) { interpret = true ; remoteName = i . next ( ) ; } else { usage ( "-remote option requires a Java classname" ) ; } } else if ( arg . equals ( "-default" ) ) { if ( i . hasNext ( ) ) { defaultName = i . next ( ) ; } else { usage ( "-default option requires a name" ) ; } } else if ( arg . equals ( "-path" ) ) { if ( i . hasNext ( ) ) { File path = new File ( i . next ( ) ) ; if ( path . isDirectory ( ) ) { pathnames . add ( path ) ; } else { usage ( path + " is not a directory" ) ; } } else { usage ( "-path option requires a directory" ) ; } } else if ( arg . equals ( "-baseDir" ) ) { if ( i . hasNext ( ) ) { try { Settings . baseDir = new File ( i . next ( ) ) ; } catch ( IllegalArgumentException e ) { usage ( e . getMessage ( ) + ": " + arg ) ; } } else { usage ( "-baseDir option requires a folder name" ) ; } } else if ( arg . startsWith ( "-" ) ) { usage ( "Unknown option " + arg ) ; } else { // It ' s a file or a directory File file = new File ( arg ) ; if ( file . isDirectory ( ) ) { for ( File subFile : file . listFiles ( dialect . getFilter ( ) ) ) { if ( subFile . isFile ( ) ) { filenames . add ( subFile ) ; } } } else { if ( file . exists ( ) ) { filenames . add ( file ) ; } else { boolean OK = false ; for ( File path : pathnames ) { File pfile = new File ( path , arg ) ; if ( pfile . exists ( ) ) { filenames . add ( pfile ) ; OK = true ; break ; } } if ( ! OK ) { usage ( "Cannot find file " + file ) ; } } } } } if ( controller == null ) { usage ( "You must specify either -vdmsl, -vdmpp or -vdmrt" ) ; } if ( logfile != null && ! ( controller instanceof VDMRT ) ) { usage ( "The -log option can only be used with -vdmrt" ) ; } if ( remoteName != null ) { try { Class < ? > cls = ClassLoader . getSystemClassLoader ( ) . loadClass ( remoteName ) ; remoteClass = ( Class < RemoteControl > ) cls ; } catch ( ClassNotFoundException e ) { usage ( "Cannot locate " + remoteName + " on the CLASSPATH" ) ; } } ExitStatus status = null ; if ( filenames . isEmpty ( ) && ( ! interpret || remoteClass != null ) ) { usage ( "You didn't specify any files" ) ; status = ExitStatus . EXIT_ERRORS ; } else { do { if ( filenames . isEmpty ( ) ) { status = controller . interpret ( filenames , null ) ; } else { status = controller . parse ( filenames ) ; if ( status == ExitStatus . EXIT_OK ) { status = controller . typeCheck ( ) ; if ( status == ExitStatus . EXIT_OK && interpret ) { if ( remoteClass == null ) { status = controller . interpret ( filenames , defaultName ) ; } else { try { final RemoteControl remote = remoteClass . newInstance ( ) ; Interpreter i = controller . getInterpreter ( ) ; if ( defaultName != null ) { i . setDefaultName ( defaultName ) ; } i . init ( null ) ; try { // remote . run ( new RemoteInterpreter ( i , null ) ) ; final RemoteInterpreter remoteInterpreter = new RemoteInterpreter ( i , null ) ; Thread remoteThread = new Thread ( new Runnable ( ) { public void run ( ) { try { remote . run ( remoteInterpreter ) ; } catch ( Exception e ) { println ( e . getMessage ( ) ) ; // status = ExitStatus . EXIT _ ERRORS ; } } } ) ; remoteThread . setName ( "RemoteControl runner" ) ; remoteThread . setDaemon ( true ) ; remoteThread . start ( ) ; remoteInterpreter . processRemoteCalls ( ) ; status = ExitStatus . EXIT_OK ; } catch ( Exception e ) { println ( e . getMessage ( ) ) ; status = ExitStatus . EXIT_ERRORS ; } } catch ( InstantiationException e ) { usage ( "Cannot instantiate " + remoteName ) ; } catch ( Exception e ) { usage ( e . getMessage ( ) ) ; } } } } } } while ( status == ExitStatus . RELOAD ) ; } if ( interpret ) { infoln ( "Bye" ) ; } System . exit ( status == ExitStatus . EXIT_OK ? 0 : 1 ) ;
public class Hashes { /** * Constant - time MurmurHash3 128 - bit hashing reusing precomputed state * partially . * < strong > Warning < / strong > : this code is still experimental . * @ param bv * a bit vector . * @ param prefixLength * the length of the prefix of < code > bv < / code > over which the * hash must be computed . * @ param hh1 * the first component of the state array returned by * { @ link # preprocessMurmur3 ( BitVector , long ) } . * @ param hh2 * the second component of the state array returned by * { @ link # preprocessMurmur3 ( BitVector , long ) } . * @ param cc1 * the third component of the state array returned by * { @ link # preprocessMurmur3 ( BitVector , long ) } . * @ param cc2 * the fourth component of the state array returned by * { @ link # preprocessMurmur3 ( BitVector , long ) } . * @ param lcp * the length of the longest common prefix between * < code > bv < / code > and the vector over which < code > state < / code > * was computed . * @ param h * a pair of long values in which the two generated hashes will * be saved . */ public static void murmur3 ( final BitVector bv , final long prefixLength , final long [ ] hh1 , final long [ ] hh2 , final long [ ] cc1 , final long cc2 [ ] , final long lcp , final long h [ ] ) { } }
final int startStateWord = ( int ) ( Math . min ( lcp , prefixLength ) / ( 2 * Long . SIZE ) ) ; long from = startStateWord * 2L * Long . SIZE ; long h1 = hh1 [ startStateWord ] ; long h2 = hh2 [ startStateWord ] ; long c1 = cc1 [ startStateWord ] ; long c2 = cc2 [ startStateWord ] ; long k1 , k2 ; while ( prefixLength - from >= Long . SIZE * 2 ) { k1 = bv . getLong ( from , from + Long . SIZE ) ; k2 = bv . getLong ( from + Long . SIZE , from += 2 * Long . SIZE ) ; k1 *= c1 ; k1 = Long . rotateLeft ( k1 , 23 ) ; k1 *= c2 ; h1 ^= k1 ; h1 += h2 ; h2 = Long . rotateLeft ( h2 , 41 ) ; k2 *= c2 ; k2 = Long . rotateLeft ( k2 , 23 ) ; k2 *= c1 ; h2 ^= k2 ; h2 += h1 ; h1 = h1 * 3 + 0x52dce729 ; h2 = h2 * 3 + 0x38495ab5 ; c1 = c1 * 5 + 0x7b7d159c ; c2 = c2 * 5 + 0x6bce6396 ; } if ( prefixLength - from != 0 ) { if ( prefixLength - from > Long . SIZE ) { k1 = bv . getLong ( from , from + Long . SIZE ) ; k2 = bv . getLong ( from + Long . SIZE , prefixLength ) ; } else { k1 = bv . getLong ( from , prefixLength ) ; k2 = 0 ; } k1 *= c1 ; k1 = Long . rotateLeft ( k1 , 23 ) ; k1 *= c2 ; h1 ^= k1 ; h1 += h2 ; h2 = Long . rotateLeft ( h2 , 41 ) ; k2 *= c2 ; k2 = Long . rotateLeft ( k2 , 23 ) ; k2 *= c1 ; h2 ^= k2 ; h2 += h1 ; h1 = h1 * 3 + 0x52dce729 ; h2 = h2 * 3 + 0x38495ab5 ; c1 = c1 * 5 + 0x7b7d159c ; c2 = c2 * 5 + 0x6bce6396 ; } h2 ^= prefixLength ; h1 += h2 ; h2 += h1 ; h1 = finalizeMurmur3 ( h1 ) ; h2 = finalizeMurmur3 ( h2 ) ; h1 += h2 ; h2 += h1 ; h [ 0 ] = h1 ; h [ 1 ] = h2 ;
public class Main { /** * com . sun . star . frame . XDispatchProvider : */ public com . sun . star . frame . XDispatch queryDispatch ( com . sun . star . util . URL aURL , String sTargetFrameName , int iSearchFlags ) { } }
if ( aURL . Protocol . compareTo ( "org.cogroo.addon:" ) == 0 ) { if ( aURL . Path . compareTo ( "ReportError" ) == 0 ) return this ; } return null ;
public class CreateRepositoryRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateRepositoryRequest createRepositoryRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createRepositoryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createRepositoryRequest . getRepositoryName ( ) , REPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( createRepositoryRequest . getRepositoryDescription ( ) , REPOSITORYDESCRIPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LogFactory { /** * < p > Construct ( if necessary ) and return a < code > Log < / code > instance , * using the factory ' s current set of configuration attributes . < / p > * < p > < strong > NOTE < / strong > - Depending upon the implementation of * the < code > LogFactory < / code > you are using , the < code > Log < / code > * instance you are returned may or may not be local to the current * application , and may or may not be returned again on a subsequent * call with the same name argument . < / p > * @ param name Logical name of the < code > Log < / code > instance to be * returned ( the meaning of this name is only known to the underlying * logging implementation that is being wrapped ) * @ exception LogConfigurationException if a suitable < code > Log < / code > * instance cannot be returned */ public Log getInstance ( String name ) throws LogConfigurationException { } }
Log log = loggers . get ( name ) ; if ( log == null ) { log = new Jdk14Logger ( name ) ; Log log2 = loggers . putIfAbsent ( name , log ) ; if ( log2 != null ) { return log2 ; } } return log ;
public class AtomicAllocator { /** * This method should be called to make sure that data on host side is actualized * @ param array */ @ Override public void synchronizeHostData ( INDArray array ) { } }
if ( array . isEmpty ( ) || array . isS ( ) ) return ; val buffer = array . data ( ) . originalDataBuffer ( ) == null ? array . data ( ) : array . data ( ) . originalDataBuffer ( ) ; synchronizeHostData ( buffer ) ;
public class RevisionInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RevisionInfo revisionInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( revisionInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( revisionInfo . getRevisionLocation ( ) , REVISIONLOCATION_BINDING ) ; protocolMarshaller . marshall ( revisionInfo . getGenericRevisionInfo ( ) , GENERICREVISIONINFO_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Cell { /** * Adds { @ link # LEFT } and clears { @ link # RIGHT } for the alignment of the widget within the cell . */ public Cell < C , T > left ( ) { } }
if ( align == null ) align = LEFT ; else { align |= LEFT ; align &= ~ RIGHT ; } return this ;
public class SameDiff { /** * Updates the variable name property on the passed in variables , its reference in samediff , and returns the variable . * @ param variablesToUpdate the variable to update * @ param newVariableNames the new variable name * @ return the updated , passed in variables */ public SDVariable [ ] updateVariableNamesAndReferences ( SDVariable [ ] variablesToUpdate , String [ ] newVariableNames ) { } }
int numVariables = variablesToUpdate . length ; SDVariable [ ] updatedVariables = new SDVariable [ numVariables ] ; for ( int i = 0 ; i < numVariables ; i ++ ) { SDVariable varToUpdate = variablesToUpdate [ i ] ; String name = newVariableNames == null ? null : newVariableNames [ i ] ; updatedVariables [ i ] = updateVariableNameAndReference ( varToUpdate , name ) ; } return updatedVariables ;
public class JawrRequestHandler { /** * Initialize the Jawr context ( config , cache manager , application config * manager . . . ) * @ param props * the Jawr properties * @ throws ServletException * if an exception occurs */ protected void initializeJawrContext ( Properties props ) throws ServletException { } }
// Initialize config initializeJawrConfig ( props ) ; // initialize the cache manager initializeApplicationCacheManager ( ) ; // initialize the Application config manager JawrApplicationConfigManager appConfigMgr = initApplicationConfigManager ( ) ; JmxUtils . initJMXBean ( appConfigMgr , servletContext , resourceType , props . getProperty ( JawrConstant . JAWR_JMX_MBEAN_PREFIX ) ) ;
public class MetricName { /** * Add tags to a metric name and return the newly created MetricName . * @ param add Tags to add . * @ return A newly created metric name with the specified tags associated with it . */ public MetricName tagged ( Map < String , String > add ) { } }
final Map < String , String > tags = new HashMap < > ( add ) ; tags . putAll ( this . tags ) ; return new MetricName ( key , tags ) ;
public class Utils { /** * Search for intermediate shape model by its c2j name . * @ return ShapeModel or null if the shape doesn ' t exist ( if it ' s primitive or container type for example ) */ public static ShapeModel findShapeModelByC2jNameIfExists ( IntermediateModel intermediateModel , String shapeC2jName ) { } }
for ( ShapeModel shape : intermediateModel . getShapes ( ) . values ( ) ) { if ( shape . getC2jName ( ) . equals ( shapeC2jName ) ) { return shape ; } } return null ;
public class DrizzleDataSource { /** * < p > Attempts to establish a connection with the data source that this < code > DataSource < / code > object represents . * @ param username the database user on whose behalf the connection is being made * @ param password the user ' s password * @ return a connection to the data source * @ throws java . sql . SQLException if a database access error occurs * @ since 1.4 */ public Connection getConnection ( final String username , final String password ) throws SQLException { } }
try { return new DrizzleConnection ( new MySQLProtocol ( hostname , port , database , username , password , new Properties ( ) ) , new DrizzleQueryFactory ( ) ) ; } catch ( QueryException e ) { throw SQLExceptionMapper . get ( e ) ; }
public class UrlsApi { /** * Returns a user NSID , given the url to a user ' s photos or profile . * This method does not require authentication . * @ param url url to the user ' s profile or photos page . Required . * @ return user id and username . * @ throws JinxException if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . urls . lookupUser . html " > flickr . urls . lookupUser < / a > */ public UserUrls lookupUser ( String url ) throws JinxException { } }
JinxUtils . validateParams ( url ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.urls.lookupUser" ) ; params . put ( "url" , url ) ; return jinx . flickrGet ( params , UserUrls . class ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcDynamicViscosityMeasure ( ) { } }
if ( ifcDynamicViscosityMeasureEClass == null ) { ifcDynamicViscosityMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 798 ) ; } return ifcDynamicViscosityMeasureEClass ;
public class Site { /** * Java level related stuffs that are also needed to roll back * @ param undoLog * @ param undo */ private static void handleUndoLog ( List < UndoAction > undoLog , boolean undo ) { } }
if ( undoLog == null ) { return ; } if ( undo ) { undoLog = Lists . reverse ( undoLog ) ; } for ( UndoAction action : undoLog ) { if ( undo ) { action . undo ( ) ; } else { action . release ( ) ; } } if ( undo ) { undoLog . clear ( ) ; }
public class FastSerializer { /** * Get a ascii - string - safe version of the binary value using a * hex encoding . * @ return A hex - encoded string value representing the serialized * objects . */ public String getHexEncodedBytes ( ) { } }
buffer . b ( ) . flip ( ) ; byte bytes [ ] = new byte [ buffer . b ( ) . remaining ( ) ] ; buffer . b ( ) . get ( bytes ) ; String hex = Encoder . hexEncode ( bytes ) ; buffer . discard ( ) ; return hex ;
public class ReviewsImpl { /** * Returns review details for the review Id passed . * @ param teamName Your Team Name . * @ param reviewId Id of the review . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Review object */ public Observable < ServiceResponse < Review > > getReviewWithServiceResponseAsync ( String teamName , String reviewId ) { } }
if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } if ( teamName == null ) { throw new IllegalArgumentException ( "Parameter teamName is required and cannot be null." ) ; } if ( reviewId == null ) { throw new IllegalArgumentException ( "Parameter reviewId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{baseUrl}" , this . client . baseUrl ( ) ) ; return service . getReview ( teamName , reviewId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Review > > > ( ) { @ Override public Observable < ServiceResponse < Review > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Review > clientResponse = getReviewDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class OAuth2SecurityExpressionMethods { /** * Check if the current OAuth2 authentication has one of the scopes specified . * @ param scopes the scopes to check * @ return true if the OAuth2 token has one of these scopes * @ throws AccessDeniedException if the scope is invalid and we the flag is set to throw the exception */ public boolean hasAnyScope ( String ... scopes ) { } }
boolean result = OAuth2ExpressionUtils . hasAnyScope ( authentication , scopes ) ; if ( ! result ) { missingScopes . addAll ( Arrays . asList ( scopes ) ) ; } return result ;
public class Index { /** * Save a query rule * @ param objectID the objectId of the query rule to save * @ param rule the content of this query rule */ public JSONObject saveRule ( String objectID , JSONObject rule ) throws AlgoliaException { } }
return saveRule ( objectID , rule , false ) ;
public class JspViewDeclarationLanguageBase { /** * Render the view now - properly setting and resetting the response writer * [ MF ] Modified to return a boolean so subclass that delegates can determine * whether the rendering succeeded or not . TRUE means success . */ protected boolean actuallyRenderView ( FacesContext facesContext , UIViewRoot viewToRender ) throws IOException { } }
// Set the new ResponseWriter into the FacesContext , saving the old one aside . ResponseWriter responseWriter = facesContext . getResponseWriter ( ) ; // Now we actually render the document // Call startDocument ( ) on the ResponseWriter . responseWriter . startDocument ( ) ; // Call encodeAll ( ) on the UIViewRoot viewToRender . encodeAll ( facesContext ) ; // Call endDocument ( ) on the ResponseWriter responseWriter . endDocument ( ) ; responseWriter . flush ( ) ; // rendered successfully - - forge ahead return true ;
public class nstrafficdomain { /** * Use this API to disable nstrafficdomain . */ public static base_response disable ( nitro_service client , nstrafficdomain resource ) throws Exception { } }
nstrafficdomain disableresource = new nstrafficdomain ( ) ; disableresource . td = resource . td ; disableresource . state = resource . state ; return disableresource . perform_operation ( client , "disable" ) ;
public class CmsListColumnDefinition { /** * Sets the data formatter . < p > * @ param formatter the data formatter to set */ public void setFormatter ( I_CmsListFormatter formatter ) { } }
m_formatter = formatter ; // set the formatter for all default actions Iterator < CmsListDefaultAction > it = m_defaultActions . iterator ( ) ; while ( it . hasNext ( ) ) { CmsListDefaultAction action = it . next ( ) ; action . setColumnForLink ( this ) ; }
public class Validator { /** * 验证是否为货币 * @ param < T > 字符串类型 * @ param value 值 * @ param errorMsg 验证错误的信息 * @ return 验证后的值 * @ throws ValidateException 验证异常 */ public static < T extends CharSequence > T validateMoney ( T value , String errorMsg ) throws ValidateException { } }
if ( false == isMoney ( value ) ) { throw new ValidateException ( errorMsg ) ; } return value ;
public class ScheduleLambdaFunctionDecisionAttributesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ScheduleLambdaFunctionDecisionAttributes scheduleLambdaFunctionDecisionAttributes , ProtocolMarshaller protocolMarshaller ) { } }
if ( scheduleLambdaFunctionDecisionAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scheduleLambdaFunctionDecisionAttributes . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( scheduleLambdaFunctionDecisionAttributes . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( scheduleLambdaFunctionDecisionAttributes . getControl ( ) , CONTROL_BINDING ) ; protocolMarshaller . marshall ( scheduleLambdaFunctionDecisionAttributes . getInput ( ) , INPUT_BINDING ) ; protocolMarshaller . marshall ( scheduleLambdaFunctionDecisionAttributes . getStartToCloseTimeout ( ) , STARTTOCLOSETIMEOUT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ScriptEngineActivator { /** * This method is used to register available script engines in OSGi contexts . < br / > * < b > Attention : < / b > This method is not unused but only called via reflective calls ! * @ param context BundleContext to bind the ScriptEngineManager to */ public static void registerOsgiScriptEngineManager ( BundleContext context ) { } }
OSGiScriptEngineManager scriptEngineManager = new OSGiScriptEngineManager ( context ) ; ScriptEngineManagerContext . setScriptEngineManager ( scriptEngineManager ) ; if ( LOGGER . isFinestEnabled ( ) ) { LOGGER . finest ( scriptEngineManager . printScriptEngines ( ) ) ; }
public class Key { /** * Builds Key from Type and annotation types * @ param type target type * @ param annTypes associated annotations * @ param < T > type * @ return instance of a Key */ public static < T > Key < T > of ( Type type , Class < ? extends Annotation > [ ] annTypes ) { } }
return new Key < > ( type , annTypes ) ;
public class RequestDelegator { /** * Checks whether the given service can serve given request . */ private boolean canDelegate ( RequestDelegationService delegate , HttpServletRequest request ) { } }
try { return delegate . canDelegate ( request ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , String . format ( "The delegation service can't check the delegability of the request: %s" , e . getCause ( ) ) , e . getCause ( ) ) ; return false ; }
public class ContainerTx { /** * Remove the given < code > BeanO < / code > in this container transaction . * @ return true if the specified BeanO was successfully removed from the * transaction ; returns false if the bean was not enlisted . */ public boolean delist ( BeanO beanO ) throws TransactionRolledbackException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "delist" , new Object [ ] { Boolean . valueOf ( globalTransaction ) , this , beanO } ) ; boolean removed = false ; // d145697 ensureActive ( ) ; if ( beanOs == null ) { // d111555 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "delist : false : no beanOs" ) ; return removed ; } // synchronized ( beanOs ) / / d173022.2 // Can ' t delist after beforeCompletion d132828 if ( origLock == true ) { if ( isTraceOn && tc . isEventEnabled ( ) ) // d144064 Tr . event ( tc , "Attempt to delist after beforeCompletion" ) ; throw new RuntimeException ( "Delisted after starting beforeCompletion" ) ; } else { // Only remove the BeanO from the transaction if it was already // enlisted . Note that only this specific BeanO is removed , not // just any BeanO that may have the same beanId . d145697 if ( beanOList . contains ( beanO ) ) { beanOs . remove ( beanO . beanId ) ; beanOList . remove ( beanOList . indexOf ( beanO ) ) ; afterList . remove ( afterList . indexOf ( beanO ) ) ; removed = true ; // If CMP 2.0 bean , remove from CMP 2.0 list that is sorted // by home . . . . used for intelligent flush . d140003.22 if ( beanO . home . beanMetaData . cmpVersion == InternalConstants . CMP_VERSION_2_X ) { ArrayList < BeanO > bundle = homesForPMManagedBeans . get ( beanO . home ) ; bundle . remove ( bundle . lastIndexOf ( beanO ) ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) // d144064 Tr . exit ( tc , "delist : " + removed ) ; return removed ; // d145697
public class ExpressionTagQueryParser { /** * Grammar errors */ @ Override public void visitErrorNode ( ErrorNode node ) { } }
if ( error ) { errorMsg = "Error " + errorMsg + " on node " + node . getText ( ) ; } else { errorMsg = "Error on node " + node . getText ( ) ; error = true ; }
public class AbstractRegionPainter { /** * Convenience method which creates a temporary graphics object by creating * a clone of the passed in one , configuring it , drawing with it , disposing * it . These steps have to be taken to ensure that any hints set on the * graphics are removed subsequent to painting . * @ param g the Graphics2D context to paint with . * @ param c the component to paint . * @ param w the component width . * @ param h the component height . * @ param extendedCacheKeys extended cache keys . */ private void paintDirectly ( Graphics2D g , JComponent c , int w , int h , Object [ ] extendedCacheKeys ) { } }
g = ( Graphics2D ) g . create ( ) ; configureGraphics ( g ) ; doPaint ( g , c , w , h , extendedCacheKeys ) ; g . dispose ( ) ;
public class Stream { /** * Checks if the next element in this stream is of the expected types . * @ param < T > represents the element type of this stream , removes the * " unchecked generic array creation for varargs parameter " * warnings * @ param expected the expected types * @ return { @ code true } if the next element is of the expected types * or { @ code false } otherwise */ public < T extends ElementType < E > > boolean positiveLookahead ( T ... expected ) { } }
for ( ElementType < E > type : expected ) { if ( type . isMatchedBy ( lookahead ( 1 ) ) ) { return true ; } } return false ;
public class Log { /** * Send a { @ link # Constants . WARN } log message and log the exception . * @ param tr * An exception to log */ public static int w ( String tag , Throwable tr ) { } }
collectLogEntry ( Constants . WARN , tag , "" , null ) ; if ( isLoggable ( tag , Constants . WARN ) ) { return android . util . Log . w ( tag , tr ) ; } return 0 ;
public class Text { /** * Converts the provided String to bytes using the * UTF - 8 encoding . If < code > replace < / code > is true , then * malformed input is replaced with the * substitution character , which is U + FFFD . Otherwise the * method throws a MalformedInputException . * @ return ByteBuffer : bytes stores at ByteBuffer . array ( ) * and length is ByteBuffer . limit ( ) */ public static ByteBuffer encode ( String string , boolean replace ) throws CharacterCodingException { } }
CharsetEncoder encoder = ENCODER_FACTORY . get ( ) ; if ( replace ) { encoder . onMalformedInput ( CodingErrorAction . REPLACE ) ; encoder . onUnmappableCharacter ( CodingErrorAction . REPLACE ) ; } ByteBuffer bytes = encoder . encode ( CharBuffer . wrap ( string . toCharArray ( ) ) ) ; if ( replace ) { encoder . onMalformedInput ( CodingErrorAction . REPORT ) ; encoder . onUnmappableCharacter ( CodingErrorAction . REPORT ) ; } return bytes ;
public class DialogAbortAPDUImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . tcap . asn . Encodable # decode ( org . mobicents . protocols . asn . AsnInputStream ) */ public void decode ( AsnInputStream ais ) throws ParseException { } }
try { AsnInputStream localAis = ais . readSequenceStream ( ) ; int tag = localAis . readTag ( ) ; if ( tag != AbortSource . _TAG || localAis . getTagClass ( ) != Tag . CLASS_CONTEXT_SPECIFIC ) throw new ParseException ( PAbortCauseType . IncorrectTxPortion , null , "Error decoding DialogAbortAPDU.abort-source: bad tag or tagClass, found tag=" + tag + ", tagClass=" + localAis . getTagClass ( ) ) ; this . abortSource = TcapFactory . createAbortSource ( localAis ) ; // optional sequence . if ( localAis . available ( ) == 0 ) return ; tag = localAis . readTag ( ) ; if ( tag != UserInformation . _TAG || localAis . getTagClass ( ) != Tag . CLASS_CONTEXT_SPECIFIC ) throw new ParseException ( PAbortCauseType . IncorrectTxPortion , null , "Error decoding DialogAbortAPDU.user-information: bad tag or tagClass, found tag=" + tag + ", tagClass=" + localAis . getTagClass ( ) ) ; this . userInformation = TcapFactory . createUserInformation ( localAis ) ; } catch ( IOException e ) { throw new ParseException ( PAbortCauseType . BadlyFormattedTxPortion , null , "IOException while decoding DialogAbortAPDU: " + e . getMessage ( ) , e ) ; } catch ( AsnException e ) { throw new ParseException ( PAbortCauseType . BadlyFormattedTxPortion , null , "AsnException while decoding DialogAbortAPDU: " + e . getMessage ( ) , e ) ; }
public class AutoQuantilesCallback { /** * Get the bucket values attribute . */ @ SuppressWarnings ( "unchecked" ) private List < Long > getBucketsValues ( final Stopwatch stopwatch ) { } }
return ( List < Long > ) stopwatch . getAttribute ( ATTR_NAME_BUCKETS_VALUES ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcHeatExchangerTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class LocalizationMessageService { /** * Finds localized message template by code and current locale from config . If not found it * takes message from message bundle or from default message first , depends on flag . * @ param code the message code * @ param firstFindInMessageBundle indicates where try to find message first when config has * returned NULL * @ param defaultMessage the default message * @ return localized message */ public String getMessage ( String code , Map < String , String > substitutes , boolean firstFindInMessageBundle , String defaultMessage ) { } }
Locale locale = authContextHolder . getContext ( ) . getDetailsValue ( LANGUAGE ) . map ( Locale :: forLanguageTag ) . orElse ( LocaleContextHolder . getLocale ( ) ) ; String localizedMessage = getFromConfig ( code , locale ) . orElseGet ( ( ) -> { if ( firstFindInMessageBundle ) { return messageSource . getMessage ( code , null , defaultMessage , locale ) ; } else { return defaultMessage != null ? defaultMessage : messageSource . getMessage ( code , null , locale ) ; } } ) ; if ( MapUtils . isNotEmpty ( substitutes ) ) { localizedMessage = new StringSubstitutor ( substitutes ) . replace ( localizedMessage ) ; } return localizedMessage ;
public class ApiOvhCloud { /** * Start a new cloud project * REST : POST / cloud / createProject * @ param credit [ required ] Amount of cloud credit to purchase . Unit is base currency . * @ param description [ required ] Project description * @ param voucher [ required ] Voucher code */ public OvhNewProject createProject_POST ( Long credit , String description , String voucher ) throws IOException { } }
String qPath = "/cloud/createProject" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "credit" , credit ) ; addBody ( o , "description" , description ) ; addBody ( o , "voucher" , voucher ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhNewProject . class ) ;
public class Node { /** * syck _ node _ type _ id _ set */ @ JRubyMethod ( name = "type_id=" ) public static IRubyObject set_type_id ( IRubyObject self , IRubyObject type_id ) { } }
org . yecht . Node node = ( org . yecht . Node ) self . dataGetStructChecked ( ) ; if ( ! type_id . isNil ( ) ) { node . type_id = type_id . convertToString ( ) . toString ( ) ; } ( ( RubyObject ) self ) . fastSetInstanceVariable ( "@type_id" , type_id ) ; return type_id ;
public class OverviewDocumentExtension { /** * Returns title level offset from 1 to apply to content * @ param context context * @ return title level offset */ protected int levelOffset ( Context context ) { } }
// TODO : Unused method , make sure this is never used and then remove it . int levelOffset ; switch ( context . position ) { case DOCUMENT_BEFORE : case DOCUMENT_AFTER : levelOffset = 0 ; break ; case DOCUMENT_BEGIN : case DOCUMENT_END : levelOffset = 1 ; break ; default : throw new RuntimeException ( String . format ( "Unknown position '%s'" , context . position ) ) ; } return levelOffset ;
public class RouterMiddleware { /** * Helper method . Checks if the < code > path < / code > is in the array of < code > paths < / code > . * @ param path the path we want to check . * @ param paths the paths to match . * @ return true if the < code > path < / code > matches the < code > paths < / code > ( at least one ) , false otherwise . */ private boolean matches ( String path , String ... paths ) { } }
if ( paths . length == 0 ) { return true ; } for ( String p : paths ) { /* TODO we should use the same mechanism servlets use to match paths */ if ( p . equalsIgnoreCase ( path ) ) { return true ; } } return false ;
public class JavascriptGenerator { /** * Generate the javascript code . * @ param settings * the settings * @ param methodName * the method name * @ return the string */ public String generateJs ( final Settings settings , final String methodName ) { } }
// 1 . Create an empty map . . . final Map < String , Object > variables = initializeVariables ( settings . asSet ( ) ) ; // 4 . Generate the js template with the map and the method name . . . final String stringTemplateContent = generateJavascriptTemplateContent ( variables , methodName ) ; // 5 . Create the StringTextTemplate with the generated template . . . final StringTextTemplate stringTextTemplate = new StringTextTemplate ( stringTemplateContent ) ; // 6 . Interpolate the template with the values of the map . . . stringTextTemplate . interpolate ( variables ) ; try { // 7 . return it as String . . . return stringTextTemplate . asString ( ) ; } finally { try { stringTextTemplate . close ( ) ; } catch ( final IOException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } }
public class Step { /** * Click on html element by Javascript . * @ param toClick * html element * @ param args * list of arguments to format the found selector with * @ throws TechnicalException * is thrown if you have a technical error ( format , configuration , datas , . . . ) in NoraUi . * Exception with { @ value com . github . noraui . utils . Messages # FAIL _ MESSAGE _ UNABLE _ TO _ OPEN _ ON _ CLICK } message ( with screenshot , with exception ) * @ throws FailureException * if the scenario encounters a functional error */ protected void clickOnByJs ( PageElement toClick , Object ... args ) throws TechnicalException , FailureException { } }
displayMessageAtTheBeginningOfMethod ( "clickOnByJs: %s in %s" , toClick . toString ( ) , toClick . getPage ( ) . getApplication ( ) ) ; try { Context . waitUntil ( ExpectedConditions . elementToBeClickable ( Utilities . getLocator ( toClick , args ) ) ) ; ( ( JavascriptExecutor ) getDriver ( ) ) . executeScript ( "document.evaluate(\"" + Utilities . getLocatorValue ( toClick , args ) . replace ( "\"" , "\\\"" ) + "\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(0).click();" ) ; } catch ( final Exception e ) { new Result . Failure < > ( e . getMessage ( ) , Messages . format ( Messages . getMessage ( Messages . FAIL_MESSAGE_UNABLE_TO_OPEN_ON_CLICK ) , toClick , toClick . getPage ( ) . getApplication ( ) ) , true , toClick . getPage ( ) . getCallBack ( ) ) ; }
public class IDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . IDD__UNITBASE : return UNITBASE_EDEFAULT == null ? unitbase != null : ! UNITBASE_EDEFAULT . equals ( unitbase ) ; case AfplibPackage . IDD__XRESOL : return XRESOL_EDEFAULT == null ? xresol != null : ! XRESOL_EDEFAULT . equals ( xresol ) ; case AfplibPackage . IDD__YRESOL : return YRESOL_EDEFAULT == null ? yresol != null : ! YRESOL_EDEFAULT . equals ( yresol ) ; case AfplibPackage . IDD__XSIZE : return XSIZE_EDEFAULT == null ? xsize != null : ! XSIZE_EDEFAULT . equals ( xsize ) ; case AfplibPackage . IDD__YSIZE : return YSIZE_EDEFAULT == null ? ysize != null : ! YSIZE_EDEFAULT . equals ( ysize ) ; case AfplibPackage . IDD__SDFS : return sdfs != null && ! sdfs . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 646:1 : annotationTypeElementDeclarations : ( annotationTypeElementDeclaration ) ( annotationTypeElementDeclaration ) * ; */ public final void annotationTypeElementDeclarations ( ) throws RecognitionException { } }
int annotationTypeElementDeclarations_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 73 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:5 : ( ( annotationTypeElementDeclaration ) ( annotationTypeElementDeclaration ) * ) // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:7 : ( annotationTypeElementDeclaration ) ( annotationTypeElementDeclaration ) * { // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:7 : ( annotationTypeElementDeclaration ) // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:8 : annotationTypeElementDeclaration { pushFollow ( FOLLOW_annotationTypeElementDeclaration_in_annotationTypeElementDeclarations2523 ) ; annotationTypeElementDeclaration ( ) ; state . _fsp -- ; if ( state . failed ) return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:42 : ( annotationTypeElementDeclaration ) * loop95 : while ( true ) { int alt95 = 2 ; int LA95_0 = input . LA ( 1 ) ; if ( ( LA95_0 == ENUM || LA95_0 == Identifier || LA95_0 == 58 || LA95_0 == 63 || LA95_0 == 65 || LA95_0 == 67 || ( LA95_0 >= 71 && LA95_0 <= 72 ) || LA95_0 == 77 || LA95_0 == 83 || LA95_0 == 85 || ( LA95_0 >= 92 && LA95_0 <= 94 ) || LA95_0 == 96 || ( LA95_0 >= 100 && LA95_0 <= 102 ) || ( LA95_0 >= 105 && LA95_0 <= 107 ) || LA95_0 == 110 || LA95_0 == 114 || LA95_0 == 119 ) ) { alt95 = 1 ; } switch ( alt95 ) { case 1 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 647:43 : annotationTypeElementDeclaration { pushFollow ( FOLLOW_annotationTypeElementDeclaration_in_annotationTypeElementDeclarations2527 ) ; annotationTypeElementDeclaration ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; default : break loop95 ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving if ( state . backtracking > 0 ) { memoize ( input , 73 , annotationTypeElementDeclarations_StartIndex ) ; } }
public class GenericExtendedSet { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public boolean contains ( Object o ) { } }
if ( elements instanceof List < ? > ) { try { return Collections . binarySearch ( ( List < T > ) elements , ( T ) o ) >= 0 ; } catch ( ClassCastException e ) { return false ; } } return elements . contains ( o ) ;
public class FIMTDD { /** * Method for updating ( training ) the model using a new instance */ public void trainOnInstanceImpl ( Instance inst ) { } }
checkRoot ( ) ; examplesSeen += inst . weight ( ) ; sumOfValues += inst . weight ( ) * inst . classValue ( ) ; sumOfSquares += inst . weight ( ) * inst . classValue ( ) * inst . classValue ( ) ; for ( int i = 0 ; i < inst . numAttributes ( ) - 1 ; i ++ ) { int aIndex = modelAttIndexToInstanceAttIndex ( i , inst ) ; sumOfAttrValues . addToValue ( i , inst . weight ( ) * inst . value ( aIndex ) ) ; sumOfAttrSquares . addToValue ( i , inst . weight ( ) * inst . value ( aIndex ) * inst . value ( aIndex ) ) ; } double prediction = treeRoot . getPrediction ( inst ) ; processInstance ( inst , treeRoot , prediction , getNormalizedError ( inst , prediction ) , true , false ) ;
public class ResourceInjection { /** * Determines the injection target { @ link Resource } by its mapped name * @ param name * the mapped name for the resoure * @ return this { @ link ResourceInjection } */ public ResourceInjection byMappedName ( final String name ) { } }
final ResourceLiteral resource = new ResourceLiteral ( ) ; resource . setMappedName ( name ) ; matchingResources . add ( resource ) ; return this ;
public class BatchJobUploader { /** * Post - processes the request content to conform to the requirements of Google Cloud Storage . * @ param content the content produced by the { @ link BatchJobUploadBodyProvider } . * @ param isFirstRequest if this is the first request for the batch job . * @ param isLastRequest if this is the last request for the batch job . */ private ByteArrayContent postProcessContent ( ByteArrayContent content , boolean isFirstRequest , boolean isLastRequest ) throws IOException { } }
if ( isFirstRequest && isLastRequest ) { return content ; } String serializedRequest = Streams . readAll ( content . getInputStream ( ) , UTF_8 ) ; serializedRequest = trimStartEndElements ( serializedRequest , isFirstRequest , isLastRequest ) ; // The request is part of a set of incremental uploads , so pad to the required content // length . This is not necessary if all operations for the job are being uploaded in a // single request . int numBytes = serializedRequest . getBytes ( UTF_8 ) . length ; int remainder = numBytes % REQUIRED_CONTENT_LENGTH_INCREMENT ; if ( remainder > 0 ) { int pad = REQUIRED_CONTENT_LENGTH_INCREMENT - remainder ; serializedRequest = Strings . padEnd ( serializedRequest , numBytes + pad , ' ' ) ; } return new ByteArrayContent ( content . getType ( ) , serializedRequest . getBytes ( UTF_8 ) ) ;
public class PortableFinderEnumerator { /** * Obtain all of the remaining elements from the enumeration */ public synchronized Object [ ] allRemainingElements ( ) throws RemoteException , EnumeratorException { } }
if ( ! hasMoreElementsR ( ) ) { throw new NoMoreElementsException ( ) ; } EJBObject [ ] remainder = null ; if ( ! exhausted ) { // We must fetch the remaining elements from the remote // result set try { // 110799 remainder = vEnum . allRemainingElements ( ) ; } catch ( NoMoreElementsException ex ) { // FFDCFilter . processException ( ex , CLASS _ NAME + " . allRemainingElements " , // "313 " , this ) ; } catch ( java . rmi . NoSuchObjectException exc ) { // FFDCFilter . processException ( exc , CLASS _ NAME + " . allRemainingElements " , // "319 " , this ) ; throw new com . ibm . ejs . container . finder . CollectionCannotBeFurtherAccessedException ( "Cannot access finder result outside transaction" ) ; } // 110799 finally { exhausted = true ; vEnum = null ; } } // Concatenate the unenumerated elements from our local cache // and the remaining elements from the remote result set . final int numCached = elements . length - index ; final int numRemaining = remainder != null ? remainder . length : 0 ; final EJBObject [ ] result = new EJBObject [ numCached + numRemaining ] ; System . arraycopy ( elements , index , result , 0 , numCached ) ; if ( remainder != null ) { System . arraycopy ( remainder , 0 , result , numCached , numRemaining ) ; } elements = null ; return result ;
public class OMVRBTreeEntryMemory { /** * Returns the successor of the current Entry only by traversing the memory , or null if no such . */ @ Override public OMVRBTreeEntryMemory < K , V > getNextInMemory ( ) { } }
OMVRBTreeEntryMemory < K , V > t = this ; OMVRBTreeEntryMemory < K , V > p = null ; if ( t . right != null ) { p = t . right ; while ( p . left != null ) p = p . left ; } else { p = t . parent ; while ( p != null && t == p . right ) { t = p ; p = p . parent ; } } return p ;
public class ExtensionHandler { /** * This method loads a class using the context class loader if we ' re * running under Java2 or higher . * @ param className Name of the class to load */ static Class getClassForName ( String className ) throws ClassNotFoundException { } }
// Hack for backwards compatibility with XalanJ1 stylesheets if ( className . equals ( "org.apache.xalan.xslt.extensions.Redirect" ) ) { className = "org.apache.xalan.lib.Redirect" ; } return ObjectFactory . findProviderClass ( className , ObjectFactory . findClassLoader ( ) , true ) ;
public class Matcher { /** * Returns the start index of the subsequence captured by the given group * during this match . * < br > * Capturing groups are indexed from left * to right , starting at one . Group zero denotes the entire pattern , so * the expression < i > m . < / i > < tt > start ( 0 ) < / tt > is equivalent to * < i > m . < / i > < tt > start ( ) < / tt > . * @ param id * The index of a capturing group in this matcher ' s pattern * @ return The index of the first character captured by the group , * or < tt > - 1 < / tt > if the match was successful but the group * itself did not match anything */ public final int start ( int id ) { } }
MemReg b = bounds ( id ) ; if ( b == null ) return - 1 ; return b . in - offset ;
public class ST_Split { /** * Splits a MultiPolygon using a LineString . * @ param multiPolygon * @ param lineString * @ return */ private static Geometry splitMultiPolygonWithLine ( MultiPolygon multiPolygon , LineString lineString ) throws SQLException { } }
ArrayList < Polygon > allPolygons = new ArrayList < Polygon > ( ) ; for ( int i = 0 ; i < multiPolygon . getNumGeometries ( ) ; i ++ ) { Collection < Polygon > polygons = splitPolygonizer ( ( Polygon ) multiPolygon . getGeometryN ( i ) , lineString ) ; if ( polygons != null ) { allPolygons . addAll ( polygons ) ; } } if ( ! allPolygons . isEmpty ( ) ) { return FACTORY . buildGeometry ( allPolygons ) ; } return null ;
public class BucketManager { /** * 对于设置了镜像存储的空间 , 从镜像源站抓取指定名称的资源并存储到该空间中 * 如果该空间中已存在该名称的资源 , 则会将镜像源站的资源覆盖空间中相同名称的资源 * @ param bucket 空间名称 * @ param key 文件名称 * @ throws QiniuException */ public void prefetch ( String bucket , String key ) throws QiniuException { } }
String resource = encodedEntry ( bucket , key ) ; String path = String . format ( "/prefetch/%s" , resource ) ; Response res = ioPost ( bucket , path ) ; if ( ! res . isOK ( ) ) { throw new QiniuException ( res ) ; } res . close ( ) ;
public class CommercePriceListUserSegmentEntryRelPersistenceImpl { /** * Returns an ordered range of all the commerce price list user segment entry rels where commercePriceListId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommercePriceListUserSegmentEntryRelModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param commercePriceListId the commerce price list ID * @ param start the lower bound of the range of commerce price list user segment entry rels * @ param end the upper bound of the range of commerce price list user segment entry rels ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ return the ordered range of matching commerce price list user segment entry rels */ @ Override public List < CommercePriceListUserSegmentEntryRel > findByCommercePriceListId ( long commercePriceListId , int start , int end , OrderByComparator < CommercePriceListUserSegmentEntryRel > orderByComparator ) { } }
return findByCommercePriceListId ( commercePriceListId , start , end , orderByComparator , true ) ;
public class OtpCookedConnection { /** * send to remote name dest is recipient ' s registered name , the nodename is * implied by the choice of connection . */ @ SuppressWarnings ( "resource" ) void send ( final OtpErlangPid from , final String dest , final OtpErlangObject msg ) throws IOException { } }
// encode and send the message sendBuf ( from , dest , new OtpOutputStream ( msg ) ) ;
public class DynamoDBMapper { /** * Saves the objects given using one or more calls to the * { @ link AmazonDynamoDB # batchWriteItem ( BatchWriteItemRequest ) } API . * @ see DynamoDBMapper # batchWrite ( List , List , DynamoDBMapperConfig ) */ public void batchSave ( Object ... objectsToSave ) { } }
batchWrite ( Arrays . asList ( objectsToSave ) , Collections . emptyList ( ) , this . config ) ;
public class RulesController { /** * GET / rules / : id * Retrieves the rule with the given id . * @ param id * @ return */ public ModelAndView getRule ( long id ) { } }
Rule rule = ruleDao . getRule ( id ) ; if ( rule == null ) { return new ModelAndView ( view , "object" , new SimpleError ( "Rule " + id + " does not exist." , 404 ) ) ; } return new ModelAndView ( view , "object" , rule ) ;
public class DdthCipherInputStream { /** * { @ inheritDoc } */ @ Override public long skip ( long n ) throws IOException { } }
int temp = ofinish - ostart ; if ( n > temp ) { n = temp ; } if ( n < 0 ) { return 0 ; } else { ostart = ( int ) ( ostart + n ) ; return n ; }
public class DefaultDataSet { /** * Sets the absolute position of the record pointer * @ param localPointer * - int * @ exception IndexOutOfBoundsException if wrong index */ @ Override public void absolute ( final int localPointer ) { } }
if ( localPointer < 0 || localPointer >= rows . size ( ) ) { throw new IndexOutOfBoundsException ( "INVALID POINTER LOCATION: " + localPointer ) ; } pointer = localPointer ; currentRecord = new RowRecord ( rows . get ( pointer ) , metaData , parser . isColumnNamesCaseSensitive ( ) , pzConvertProps , strictNumericParse , upperCase , lowerCase , parser . isNullEmptyStrings ( ) ) ;
public class BaseBundleActivator { /** * Bundle starting up . * Don ' t override this , override startupService . */ public void start ( BundleContext context ) throws Exception { } }
ClassServiceUtility . log ( context , LogService . LOG_INFO , "Starting " + this . getClass ( ) . getName ( ) + " Bundle" ) ; this . context = context ; this . init ( ) ; // Setup the properties String interfaceClassName = getInterfaceClassName ( ) ; this . setProperty ( BundleConstants . ACTIVATOR , this . getClass ( ) . getName ( ) ) ; // In case I have to find this service by activator class try { context . addServiceListener ( this , ClassServiceUtility . addToFilter ( ( String ) null , Constants . OBJECTCLASS , interfaceClassName ) ) ; } catch ( InvalidSyntaxException e ) { e . printStackTrace ( ) ; } if ( service == null ) { boolean allStarted = this . checkDependentServices ( context ) ; if ( allStarted ) { service = this . startupService ( context ) ; this . registerService ( service ) ; } }
public class VirtualCdj { /** * Ask a device for information about the media mounted in a particular slot . Will update the * { @ link MetadataFinder } when a response is received . * @ param slot the slot holding media we want to know about . * @ throws IOException if there is a problem sending the request . */ public void sendMediaQuery ( SlotReference slot ) throws IOException { } }
final DeviceAnnouncement announcement = DeviceFinder . getInstance ( ) . getLatestAnnouncementFrom ( slot . player ) ; if ( announcement == null ) { throw new IllegalArgumentException ( "Device for " + slot + " not found on network." ) ; } ensureRunning ( ) ; byte [ ] payload = new byte [ MEDIA_QUERY_PAYLOAD . length ] ; System . arraycopy ( MEDIA_QUERY_PAYLOAD , 0 , payload , 0 , MEDIA_QUERY_PAYLOAD . length ) ; payload [ 2 ] = getDeviceNumber ( ) ; System . arraycopy ( announcementBytes , 44 , payload , 5 , 4 ) ; // Copy in our IP address . payload [ 12 ] = ( byte ) slot . player ; payload [ 16 ] = slot . slot . protocolValue ; assembleAndSendPacket ( Util . PacketType . MEDIA_QUERY , payload , announcement . getAddress ( ) , UPDATE_PORT ) ;
public class RestartableSet { /** * Unsubscribes and dismisses the current observable of a given { @ link Restartable } . * @ param id a { @ link Restartable } id . */ @ Override public void dismiss ( int id ) { } }
if ( restartables . get ( id ) != null ) restartables . get ( id ) . dismiss ( ) ;
public class SRTInputStream31 { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . webcontainer . srt . SRTInputStream # read ( ) */ @ Override public int read ( ) throws IOException { } }
// Return - 1 here because if we are closed or finished , we ' re at the end of the stream if ( isClosed || isFinished ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Nothing to read, stream is closed : " + isClosed + ", or finished : " + isFinished ( ) ) ; return - 1 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "read" , "SRTInputStream31.read()" ) ; } int returnByte ; if ( this . request . isAsyncStarted ( ) && ( this . getReadListener ( ) != null ) ) { synchronized ( this ) { // Check if isReady had returned false . If it did then an IllegalArgumentException will be thrown if a listener is set isReadyFalseCheck ( ) ; returnByte = super . read ( ) ; } } else { returnByte = super . read ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "read" , "SRTInputStream31.read() : " + returnByte ) ; } return returnByte ;
public class FileChunk { /** * Sets the byte [ ] and indicates which pool this array is from . */ public void setBah ( ByteArrayHolder bah , ObjectPool < ByteArrayHolder > pool ) { } }
this . bah = bah ; this . pool = pool ;
public class BuildWithDetails { /** * Update < code > displayName < / code > of a build . * @ param displayName The new displayName which should be set . * @ param crumbFlag < code > true < / code > or < code > false < / code > . * @ throws IOException in case of errors . */ public BuildWithDetails updateDisplayName ( String displayName , boolean crumbFlag ) throws IOException { } }
Objects . requireNonNull ( displayName , "displayName is not allowed to be null." ) ; String description = getDescription ( ) == null ? "" : getDescription ( ) ; Map < String , String > params = new HashMap < > ( ) ; params . put ( "displayName" , displayName ) ; params . put ( "description" , description ) ; // TODO : Check what the " core : apply " means ? params . put ( "core:apply" , "" ) ; params . put ( "Submit" , "Save" ) ; client . post_form ( this . getUrl ( ) + "/configSubmit?" , params , crumbFlag ) ; return this ;
public class DataTable { /** * setter for caption - sets * @ generated * @ param v value to set into the feature */ public void setCaption ( String v ) { } }
if ( DataTable_Type . featOkTst && ( ( DataTable_Type ) jcasType ) . casFeat_caption == null ) jcasType . jcas . throwFeatMissing ( "caption" , "ch.epfl.bbp.uima.types.DataTable" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( DataTable_Type ) jcasType ) . casFeatCode_caption , v ) ;
public class JawrRequestHandler { /** * Returns true if the bundle is a valid bundle * @ param requestedPath * the requested path * @ return true if the bundle is a valid bundle */ protected BundleHashcodeType isValidBundle ( String requestedPath ) { } }
BundleHashcodeType bundleHashcodeType = BundleHashcodeType . VALID_HASHCODE ; if ( ! jawrConfig . isDebugModeOn ( ) ) { bundleHashcodeType = bundlesHandler . getBundleHashcodeType ( requestedPath ) ; } return bundleHashcodeType ;
public class RegionAutoscalerClient { /** * Deletes the specified autoscaler . * < p > Sample code : * < pre > < code > * try ( RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient . create ( ) ) { * ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ AUTOSCALER ] " ) ; * Operation response = regionAutoscalerClient . deleteRegionAutoscaler ( autoscaler . toString ( ) ) ; * < / code > < / pre > * @ param autoscaler Name of the autoscaler to delete . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation deleteRegionAutoscaler ( String autoscaler ) { } }
DeleteRegionAutoscalerHttpRequest request = DeleteRegionAutoscalerHttpRequest . newBuilder ( ) . setAutoscaler ( autoscaler ) . build ( ) ; return deleteRegionAutoscaler ( request ) ;
public class MonitorFileWriterImpl { /** * Method setting the number of services and metadata length */ private void setServicesCount ( ) { } }
servicesCount = MAX_SERVICE_COUNT ; metadataLength = NUMBER_OF_INTS_IN_HEADER * BitUtil . SIZE_OF_INT + SIZEOF_STRING + servicesCount * ( SIZEOF_STRING + NUMBER_OF_INTS_PER_SERVICE * BitUtil . SIZE_OF_INT ) ; endOfMetadata = BitUtil . align ( metadataLength + BitUtil . SIZE_OF_INT , BitUtil . CACHE_LINE_LENGTH ) ; serviceRefSection = endOfMetadata - servicesCount * OFFSETS_PER_SERVICE * BitUtil . SIZE_OF_INT ;
public class BouncyCastleCertProcessingFactory { /** * Creates a new proxy credential from the specified certificate chain and a private key , * using the given delegation mode . * @ see # createCredential ( X509Certificate [ ] , PrivateKey , int , int , GSIConstants . CertificateType , X509ExtensionSet , String ) * createCredential */ public X509Credential createCredential ( X509Certificate [ ] certs , PrivateKey privateKey , int bits , int lifetime , GSIConstants . DelegationType delegType ) throws GeneralSecurityException { } }
return createCredential ( certs , privateKey , bits , lifetime , delegType , ( X509ExtensionSet ) null , null ) ;
public class AbstractOperation { /** * A utility method which calls < code > execute < / code > on each of this * operation ' s arguments and returns an array of the results . * @ param context * evaluation context to use * @ return array of the results of executing the arguments */ protected Element [ ] calculateArgs ( Context context ) throws EvaluationException { } }
Element [ ] results = new Element [ ops . length ] ; for ( int i = 0 ; i < ops . length ; i ++ ) { results [ i ] = ops [ i ] . execute ( context ) ; } return results ;
public class LogbackMarkerFilter { /** * Filter the logging event according to the provided marker * @ param event The logging event * @ return FilterReply . NEUTRAL if the event ' s marker is the same as the provided marker ; FilterReply . DENY otherwise */ @ Override public FilterReply decide ( final ILoggingEvent event ) { } }
final Marker marker = event . getMarker ( ) ; if ( marker == this . marker ) { return FilterReply . NEUTRAL ; } else { return FilterReply . DENY ; }