signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CommandBasedTaskService { /** * TODO : does not filter on language */ public List < TaskSummary > getTasksByStatusByProcessInstanceId ( long processInstanceId , List < Status > status , String language ) { } }
return executor . execute ( new GetTasksByStatusByProcessInstanceIdCommand ( processInstanceId , status ) ) ;
public class NodeTypes { /** * Obtain a new version of this cache with the specified node types removed from the new cache . * @ param removedNodeTypes the node types that are to be removed from the resulting cache ; may not be null but may be empty * @ return the resulting cache that contains all of the node types...
if ( removedNodeTypes . isEmpty ( ) ) return this ; Collection < JcrNodeType > nodeTypes = new HashSet < JcrNodeType > ( this . nodeTypes . values ( ) ) ; nodeTypes . removeAll ( removedNodeTypes ) ; return new NodeTypes ( this . context , nodeTypes , getVersion ( ) + 1 ) ;
public class Node { /** * Get the double value of another map in the current node position . * @ param map the map from which to get the value . * @ return the double value or a novalue . */ public double getDoubleValueFromMap ( RandomIter map ) { } }
try { if ( map == null ) { return HMConstants . doubleNovalue ; } double value = map . getSampleDouble ( col , row , 0 ) ; return value ; } catch ( Exception e ) { // ignore and return novalue return HMConstants . doubleNovalue ; }
public class CmsImportVersion7 { /** * Returns the list of properties to ignore during import . < p > * @ return the list of properties to ignore during import */ protected List < String > getIgnoredProperties ( ) { } }
if ( m_ignoredProperties == null ) { // get list of ignored properties m_ignoredProperties = OpenCms . getImportExportManager ( ) . getIgnoredProperties ( ) ; if ( m_ignoredProperties == null ) { m_ignoredProperties = Collections . emptyList ( ) ; } } return m_ignoredProperties ;
public class AbstractPlugin { /** * Enable this test */ @ Override public void setEnabled ( boolean enabled ) { } }
if ( this . enabled != enabled ) { this . enabled = enabled ; setProperty ( "enabled" , Boolean . toString ( enabled ) ) ; if ( enabled && getAlertThreshold ( ) == AlertThreshold . OFF ) { setAlertThreshold ( AlertThreshold . DEFAULT ) ; } }
public class KeyValueHandler { /** * Helper method to reset the reader index of the content so if downstream components * on outbound did modify it , it can be reused ( looking at you , SSLHandler ) . * @ param request the request which may have content that needs to be reset . */ private static void resetContentRe...
ByteBuf content = contentFromWriteRequest ( request ) ; if ( content != null ) { try { content . readerIndex ( 0 ) ; } catch ( Exception ex ) { LOGGER . warn ( "Exception while resetting the content reader index to 0, " + "please report this as a bug." , ex ) ; } }
public class NginxMetrics { /** * Get NginxMetrics by their names . Order of NginxMetrics in the resulting list * is constant and does not depend on order of metric names . * { @ link # HANDLED } is added to the result even if its name is not passed . * @ param metricsNames names of metrics . * @ return list of...
if ( metricsNames == null || metricsNames . isEmpty ( ) ) { return Collections . singletonList ( NginxMetrics . HANDLED ) ; } final List < NginxMetrics > result = new ArrayList < > ( metricsNames . size ( ) ) ; for ( NginxMetrics metric : getMetricsOfType ( NginxMetrics . class ) ) { if ( metricsNames . contains ( metr...
public class TransactionServiceMain { /** * Invoked by jsvc to start the program . */ public void start ( ) throws Exception { } }
Injector injector = Guice . createInjector ( new ConfigModule ( conf ) , new ZKModule ( ) , new DiscoveryModules ( ) . getDistributedModules ( ) , new TransactionModules ( ) . getDistributedModules ( ) , new TransactionClientModule ( ) ) ; ZKClientService zkClientService = injector . getInstance ( ZKClientService . cla...
public class YarnUtils { /** * Returns the host names for all nodes in yarnClient ' s YARN cluster . * @ param yarnClient the client to use to look up node information * @ return the set of host names */ public static Set < String > getNodeHosts ( YarnClient yarnClient ) throws YarnException , IOException { } }
ImmutableSet . Builder < String > nodeHosts = ImmutableSet . builder ( ) ; for ( NodeReport runningNode : yarnClient . getNodeReports ( USABLE_NODE_STATES ) ) { nodeHosts . add ( runningNode . getNodeId ( ) . getHost ( ) ) ; } return nodeHosts . build ( ) ;
public class RasterReliefType { /** * Gets the value of the genericApplicationPropertyOfRasterRelief property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there...
if ( _GenericApplicationPropertyOfRasterRelief == null ) { _GenericApplicationPropertyOfRasterRelief = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfRasterRelief ;
public class FSEditLog { /** * Add generation stamp record to edit log */ public void logGenerationStamp ( long genstamp ) { } }
SetGenstampOp op = SetGenstampOp . getInstance ( ) ; op . set ( genstamp ) ; logEdit ( op ) ;
public class CurrentGpsInfo { /** * Method to add a new { @ link GSVSentence } . * @ param gsv the sentence to add . */ public void addGSV ( GSVSentence gsv ) { } }
try { if ( gsv . isValid ( ) ) satelliteInfo = gsv . getSatelliteInfo ( ) ; } catch ( Exception e ) { // ignore it , this should be handled in the isValid , // if an exception is thrown , we can ' t deal with it here . }
public class JSONObject { /** * get float value . * @ param key key . * @ param def default value . * @ return value or default value . */ public float getFloat ( String key , float def ) { } }
Object tmp = objectMap . get ( key ) ; return tmp != null && tmp instanceof Number ? ( ( Number ) tmp ) . floatValue ( ) : def ;
public class Query { /** * Adds the GROUP BY columns . * @ param groupbyColumns The columns . * @ return This expression . */ public Query groupby ( final Collection < ? extends Expression > groupbyColumns ) { } }
if ( groupbyColumns == null ) { return this ; } this . groupbyColumns . addAll ( groupbyColumns ) ; return this ;
public class HttpHeaders { /** * @ deprecated Use { @ link # getInt ( CharSequence ) } instead . * Returns the integer header value with the specified header name . If * there are more than one header value for the specified header name , the * first value is returned . * @ return the header value * @ throws ...
String value = message . headers ( ) . get ( name ) ; if ( value == null ) { throw new NumberFormatException ( "header not found: " + name ) ; } return Integer . parseInt ( value ) ;
public class WsLogger { /** * @ see java . util . logging . Logger # config ( java . lang . String ) */ @ Override public void config ( String msg ) { } }
if ( isLoggable ( Level . CONFIG ) ) { log ( Level . CONFIG , msg ) ; }
public class OmsSaintGeo { /** * Use Gaukler - Strickler formula for the evaluation of the initial condition * ( hypotesis of steady flow ) . * @ param q : discharge * @ param level : the level * @ param sectionsList */ private void calculateGauklerStrickler ( double q , double [ ] level , List < RiverPoint > s...
double toll , conta_cicli ; double IF , max_tir , tir_dx , tir_sx , tir_med , val_dx , val_sx , val_med ; double [ ] [ ] idrgeo ; /* create a complete list to proceed with the next elaborations */ int imax = sectionsList . size ( ) ; double [ ] minsez = new double [ imax ] ; double [ ] maxsez = new double [ imax ] ; fo...
public class SnorocketOWLReasoner { /** * Performs a full classification on the current ontology . */ private void classify ( ) { } }
// Classify monitor . taskStarted ( "Classifying" ) ; monitor . taskBusy ( ) ; reasoner = reasoner . classify ( ) ; monitor . taskEnded ( ) ; monitor . taskStarted ( "Building taxonomy" ) ; monitor . taskBusy ( ) ; taxonomy = reasoner . getClassifiedOntology ( ) ; monitor . taskEnded ( ) ;
public class ProtoLexer { /** * $ ANTLR start " HEX " */ public final void mHEX ( ) throws RecognitionException { } }
try { int _type = HEX ; int _channel = DEFAULT_TOKEN_CHANNEL ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 252:5 : ( ( MINUS ) ? ' 0 ' ( ' x ' | ' X ' ) ( HEX _ DIGIT ) + ) // com / dyuproject / protostuff / parser / ProtoLexer . g : 252:9 : ( MINUS ) ? ' 0 ' ( ' x ' | ' X ' ) ( HEX _ DIGIT ) + { // co...
public class PersianCalendar { /** * / * [ deutsch ] * < p > Pr & uuml ; ft , ob die angegebenen Parameter ein wohldefiniertes Kalenderdatum beschreiben . < / p > * @ param yearOfEra the year of era to be checked * @ param month the month to be checked * @ param dayOfMonth the day of month to be checked * @ r...
return CALSYS . isValid ( PersianEra . ANNO_PERSICO , yearOfEra , month , dayOfMonth ) ;
public class CudaZeroHandler { /** * This method returns sets of allocation tracking IDs for specific bucket * @ param bucketId * @ return */ @ Override public Set < Long > getHostTrackingPoints ( Long bucketId ) { } }
if ( ! zeroAllocations . containsKey ( bucketId ) ) { return new HashSet < > ( ) ; } return zeroAllocations . get ( bucketId ) . keySet ( ) ;
public class Driver { /** * < p > Try to make a database connection to the given URL . The driver should return " null " if it * realizes it is the wrong kind of driver to connect to the given URL . This will be common , as * when the JDBC driverManager is asked to connect to a given URL , it passes the URL to each...
if ( url == null ) { throw new SQLException ( "url is null" ) ; } // get defaults Properties defaults ; if ( ! url . startsWith ( "jdbc:postgresql:" ) ) { return null ; } try { defaults = getDefaultProperties ( ) ; } catch ( IOException ioe ) { throw new PSQLException ( GT . tr ( "Error loading default settings from dr...
public class DropboxAuth { /** * Start the process of getting a Dropbox API access token for the user ' s Dropbox account . */ public void doStart ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }
if ( ! common . checkPost ( request , response ) ) return ; User user = common . requireLoggedInUser ( request , response ) ; if ( user == null ) return ; // Start the authorization process with Dropbox . DbxWebAuth . Request authRequest = DbxWebAuth . newRequestBuilder ( ) // After we redirect the user to the Dropbox ...
public class WIMXPathInterpreter { /** * Simple grammar * < LocationPath > : = " / / " < Noun > ( < Predicate > ) < Predicate > : = " [ " * < PredicateExpr > " ] " < RelationaExpr > : = < FAName > < comp _ operator > * ( < Literal > | < Number > ) / / add negative numbers support < comp _ operator > : = * ' < '...
_metaDataMapper = aMetaDataMapper ; if ( _metaDataMapper != null ) { checkLocation = true ; } XPath ( ) ; { if ( true ) return node ; } throw new Error ( "Missing return statement in function" ) ;
public class Exceptional { /** * Applies custom operator on { @ code Exceptional } . * @ param < R > the type of the result * @ param function a transforming function * @ return a result of the transforming function * @ throws NullPointerException if { @ code function } is null * @ since 1.1.9 */ @ Nullable p...
Objects . requireNonNull ( function ) ; return function . apply ( this ) ;
public class Shortcode { /** * Appends an attribute value with appropriate quoting . * @ param value The value . * @ param buf The buffer to append to . * @ return The input buffer . */ private StringBuilder appendAttributeValue ( final String value , final StringBuilder buf ) { } }
if ( value . contains ( "\"" ) ) { buf . append ( "\'" ) . append ( escapeAttribute ( value ) ) . append ( "\'" ) ; } else if ( value . contains ( " " ) || value . contains ( "\'" ) || value . contains ( "=" ) ) { buf . append ( "\"" ) . append ( escapeAttribute ( value ) ) . append ( "\"" ) ; } else { buf . append ( e...
public class CmsModuleUpdater { /** * Reads the module data from an import zip file . < p > * @ param cms the CMS context * @ param importFile the import file * @ param report the report to write to * @ return the module data * @ throws CmsException if something goes wrong */ public static CmsModuleImportData...
CmsModuleImportData result = new CmsModuleImportData ( ) ; CmsModule module = CmsModuleImportExportHandler . readModuleFromImport ( importFile ) ; cms = OpenCms . initCmsObject ( cms ) ; String importSite = module . getImportSite ( ) ; if ( ! CmsStringUtil . isEmptyOrWhitespaceOnly ( importSite ) ) { cms . getRequestCo...
public class DbPro { /** * Batch update records using the columns names of the first record in recordList . * Ensure all the records can use the same sql as the first record . * @ param tableName the table name * @ param primaryKey the primary key of the table , composite primary key is separated by comma charact...
if ( recordList == null || recordList . size ( ) == 0 ) return new int [ 0 ] ; String [ ] pKeys = primaryKey . split ( "," ) ; config . dialect . trimPrimaryKeys ( pKeys ) ; Record record = recordList . get ( 0 ) ; Map < String , Object > cols = record . getColumns ( ) ; List < String > colNames = new ArrayList < Strin...
public class ModifyDBClusterSnapshotAttributeRequest { /** * A list of DB cluster snapshot attributes to add to the attribute specified by < code > AttributeName < / code > . * To authorize other AWS accounts to copy or restore a manual DB cluster snapshot , set this list to include one or * more AWS account IDs . ...
if ( valuesToAdd == null ) { this . valuesToAdd = null ; return ; } this . valuesToAdd = new java . util . ArrayList < String > ( valuesToAdd ) ;
public class ClassDescriptorConstraints { /** * Makes sure that the class descriptor has a table attribute if it requires it ( i . e . it is * relevant for the repository descriptor ) . * @ param classDef The class descriptor * @ param checkLevel The current check level ( this constraint is checked in all levels ...
if ( classDef . getBooleanProperty ( PropertyHelper . OJB_PROPERTY_OJB_PERSISTENT , false ) ) { if ( ! classDef . hasProperty ( PropertyHelper . OJB_PROPERTY_TABLE ) ) { classDef . setProperty ( PropertyHelper . OJB_PROPERTY_TABLE , classDef . getDefaultTableName ( ) ) ; } }
public class CmsNewResourceTypeDialog { /** * Checks if form is valid . < p > * @ return true if form is valid */ private boolean isValid ( ) { } }
return m_typeID . isValid ( ) && m_typeShortName . isValid ( ) && m_parentFormatter . isValid ( ) && m_parentSchema . isValid ( ) && m_bundle . isValid ( ) && m_config . isValid ( ) && m_typeDescription . isValid ( ) && m_typeName . isValid ( ) && m_typeXPathName . isValid ( ) ;
public class OperaProfile { /** * Converts this instance to its JSON representation . * @ return the JSON representation of this profile * @ throws IOException if an I / O error occurs */ public JSONObject toJson ( ) throws IOException { } }
String base64 = new Zip ( ) . zip ( getDirectory ( ) ) ; Map < String , String > map = ImmutableMap . of ( "className" , this . getClass ( ) . getName ( ) , BASE64_JSON_KEY , base64 ) ; return new JSONObject ( map ) ;
public class TaskProxy { /** * Build a new remote session and initialize it . * NOTE : This is convenience method to create a task below the current APPLICATION ( not below this task ) * @ param properties to create the new remote task * @ return The remote Task . */ public RemoteTask createRemoteTask ( Map < Str...
// Note : This new task ' s parent is MY application ! BaseTransport transport = this . createProxyTransport ( CREATE_REMOTE_TASK ) ; // Don ' t use my method yet , since I don ' t have the returned ID transport . addParam ( PROPERTIES , properties ) ; String strID = ( String ) transport . sendMessageAndGetReply ( ) ; ...
public class FsInfoSector { /** * Creates an new { @ code FsInfoSector } where the specified * { @ code Fat32BootSector } indicates it should be . * @ param bs the boot sector specifying the FS info sector storage * @ return the FS info sector instance that was created * @ throws IOException on write error * ...
final int offset = offset ( bs ) ; if ( offset == 0 ) throw new IOException ( "creating a FS info sector at offset 0 is strange" ) ; final FsInfoSector result = new FsInfoSector ( bs . getDevice ( ) , offset ( bs ) ) ; result . init ( ) ; result . write ( ) ; return result ;
public class JsonWriter { /** * Changes the writer to treat the next value as a string name . This is useful for map adapters so * that arbitrary type adapters can use { @ link # value } to write a name value . */ final void promoteValueToName ( ) throws IOException { } }
int context = peekScope ( ) ; if ( context != NONEMPTY_OBJECT && context != EMPTY_OBJECT ) { throw new IllegalStateException ( "Nesting problem." ) ; } promoteValueToName = true ;
public class LockFile { /** * Retrieves the interval , in milliseconds , that < tt > pollHeartbeat < / tt > * waits between failed invocations of < tt > checkHeartbeat < / tt > . * The value is obtained in the following manner : < p > * < ol > * < li > interval is assigned < tt > 10 + ( HEARTBEAT _ INTERVAL _ P...
int retries = getPollHeartbeatRetries ( ) ; long interval = 10 + ( HEARTBEAT_INTERVAL_PADDED / retries ) ; try { interval = Long . getLong ( POLL_INTERVAL_PROPERTY , interval ) . longValue ( ) ; } catch ( Exception e ) { } if ( interval <= 0 ) { interval = 10 + ( HEARTBEAT_INTERVAL_PADDED / retries ) ; } return interva...
public class StylesheetHandler { /** * Flush the characters buffer . * @ throws org . xml . sax . SAXException */ private void flushCharacters ( ) throws org . xml . sax . SAXException { } }
XSLTElementProcessor elemProcessor = getCurrentProcessor ( ) ; if ( null != elemProcessor ) elemProcessor . startNonText ( this ) ;
public class RemoteConsumerReceiver { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPDeliveryReceiverControllable # getStreamID ( ) */ public SIBUuid12 getStreamID ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getStreamID" ) ; SIBUuid12 returnValue = aiStream . getStreamId ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getStreamID" , returnValue ) ; return returnValue ;
public class AliasStrings { /** * Replaces a string literal with a reference to the string ' s alias variable . */ private void replaceStringWithAliasName ( StringOccurrence occurrence , String name , StringInfo info ) { } }
Node nameNode = IR . name ( name ) ; occurrence . parent . replaceChild ( occurrence . node , nameNode ) ; info . isAliased = true ; compiler . reportChangeToEnclosingScope ( nameNode ) ;
public class PrintStmt { /** * Gets the esjp select . * @ param _ instances the _ instances * @ return the esjp select * @ throws Exception the exception */ private Map < String , IEsjpSelect > getEsjpSelect ( final List < Instance > _instances ) throws Exception { } }
final Map < String , IEsjpSelect > ret = new HashMap < > ( ) ; if ( ! _instances . isEmpty ( ) ) { for ( final Entry < String , AbstractSelect > entry : getAlias2Selects ( ) . entrySet ( ) ) { if ( entry . getValue ( ) instanceof ExecSelect ) { final Class < ? > clazz = Class . forName ( entry . getValue ( ) . getSelec...
public class HeatChart { /** * Sets the x - values which are plotted along the x - axis . The x - values are calculated based upon * the indexes of the z - values array : * < pre > * { @ code * < pre > * x - value = x - offset + ( column - index * x - interval ) * < / pre > * < / pre > * The x - interva...
// Update the x - values according to the offset and interval . xValues = new Object [ zValues [ 0 ] . length ] ; for ( int i = 0 ; i < zValues [ 0 ] . length ; i ++ ) { xValues [ i ] = xOffset + ( i * xInterval ) ; }
public class PerformanceMonitorBeanDefinitionDecorator { /** * Gets the value of an attribute and returns true if it is set to " true " * ( case - insensitive ) , otherwise returns false . * @ param source An Attribute node from the spring configuration * @ return boolean */ private boolean getBooleanAttributeVal...
Attr attribute = ( Attr ) source ; String value = attribute . getValue ( ) ; return "true" . equalsIgnoreCase ( value ) ;
public class AnnotationParser { /** * Handle a file with an annotation handler . * @ param file * @ param ah * @ throws java . lang . Exception */ public static void handle ( File srcFile , AnnotationHandler ah ) throws Exception { } }
FileInputStream fis = new FileInputStream ( srcFile ) ; FileChannel fc = fis . getChannel ( ) ; // Get a CharBuffer from the source file ByteBuffer bb = fc . map ( FileChannel . MapMode . READ_ONLY , 0 , fc . size ( ) ) ; CharsetDecoder cd = Charset . forName ( "8859_1" ) . newDecoder ( ) ; CharBuffer cb = cd . decode ...
public class BoundingBox { /** * This takes the currently defined values found inside this instance and converts it to a GeoJson * string . * @ return a JSON string which represents this Bounding box * @ since 3.0.0 */ public final String toJson ( ) { } }
Gson gson = new GsonBuilder ( ) . registerTypeAdapter ( BoundingBox . class , new BoundingBoxTypeAdapter ( ) ) . create ( ) ; return gson . toJson ( this , BoundingBox . class ) ;
public class CATAsynchConsumer { /** * This method will send the message to our peer in chunks as given to us by MFP . This is much * easier on the Java memory manager as it doesn ' t require the allocation of an enormous byte * array . * @ param sibMessage * @ return Returns true if the message was sent . * ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendChunkedMessage" , new Object [ ] { sibMessage , lastMsg , priority } ) ; // Flag to indicate a Comms error so that we stop sending messages boolean ok = true ; int jfapPriority = JFapChannelConstants . getJFAPPri...
public class HubState { /** * Starts the hub . */ @ CommandArgument public void start ( ) { } }
System . out . println ( "Starting hub" ) ; try { Class . forName ( "org.apache.derby.jdbc.EmbeddedDriver" ) ; EmbeddedDataSource ds = new EmbeddedDataSource ( ) ; ds . setConnectionAttributes ( "create=true" ) ; ds . setDatabaseName ( "classes" ) ; JobHub . prepareDataSource ( ds ) ; logger . info ( "Initializing serv...
public class ServerOperations { /** * START SNIPPET : searchParamAdvanced */ @ Operation ( name = "$find-matches" , idempotent = true ) public Parameters findMatchesAdvanced ( @ OperationParam ( name = "dateRange" ) DateRangeParam theDate , @ OperationParam ( name = "name" ) List < StringParam > theName , @ OperationPa...
Parameters retVal = new Parameters ( ) ; // Populate bundle with matching resources return retVal ;
public class AppCacheLinker { /** * Standard linker that also outputs a manifest file based on the public * resources */ @ Override public ArtifactSet link ( TreeLogger logger , LinkerContext context , ArtifactSet artifacts ) throws UnableToCompleteException { } }
ArtifactSet toReturn = super . link ( logger , context , artifacts ) ; // Create the general cache - manifest resource for the landing page : toReturn . add ( emitLandingPageCacheManifest ( context , logger , toReturn , staticCachedFiles ( ) ) ) ; return toReturn ;
public class SimpleExpression { /** * Create a { @ code this not in right } expression * @ param right rhs of the comparison * @ return this not in right */ public final BooleanExpression notIn ( Expression < ? extends T > ... right ) { } }
return Expressions . booleanOperation ( Ops . NOT_IN , mixin , Expressions . list ( right ) ) ;
public class KryoInstantiator { /** * Use this to set a specific classloader */ public KryoInstantiator setClassLoader ( final ClassLoader cl ) { } }
return new KryoInstantiator ( ) { public Kryo newKryo ( ) { Kryo k = KryoInstantiator . this . newKryo ( ) ; k . setClassLoader ( cl ) ; return k ; } } ;
public class BitmapAdapter { @ Override public void prepareSlide ( int position ) { } }
BitmapCache bc = cachedBitmaps . get ( position ) ; if ( bc != null && bc . bitmap != null && bc . bitmap . get ( ) != null ) { bc . bitmap . get ( ) . recycle ( ) ; bc . bitmap . clear ( ) ; } bc = new BitmapCache ( ) ; cachedBitmaps . put ( position , bc ) ; loadBitmap ( position ) ;
public class Matrix4x3d { /** * Apply a projection transformation to this matrix that projects onto the plane specified via the general plane equation * < code > x * a + y * b + z * c + d = 0 < / code > as if casting a shadow from a given light position / direction < code > light < / code > . * If < code > light . ...
return shadow ( light . x ( ) , light . y ( ) , light . z ( ) , light . w ( ) , a , b , c , d , this ) ;
public class DistanceMatrixPrinter { /** * Print a matrix representation of the distances between each pair of * categories of the given study . */ public void print ( final PrintStream out , final ICodingAnnotationStudy study , final IDistanceFunction distanceFunction ) { } }
doPrint ( out , study . getCategories ( ) , study , distanceFunction ) ;
public class ListRegexPatternSetsResult { /** * An array of < a > RegexPatternSetSummary < / a > objects . * @ param regexPatternSets * An array of < a > RegexPatternSetSummary < / a > objects . */ public void setRegexPatternSets ( java . util . Collection < RegexPatternSetSummary > regexPatternSets ) { } }
if ( regexPatternSets == null ) { this . regexPatternSets = null ; return ; } this . regexPatternSets = new java . util . ArrayList < RegexPatternSetSummary > ( regexPatternSets ) ;
public class ParquetGroupConverter { /** * check if a parquet type is a valid ' map ' type */ private static boolean isLogicalMapType ( Type groupType ) { } }
OriginalType ot = groupType . getOriginalType ( ) ; if ( groupType . isPrimitive ( ) || ot == null || groupType . isRepetition ( Type . Repetition . REPEATED ) ) { return false ; } if ( groupType . getOriginalType ( ) . equals ( OriginalType . MAP ) || groupType . getOriginalType ( ) . equals ( OriginalType . MAP_KEY_V...
public class NumberUtil { /** * 将给定范围内的整数添加到已有集合中 * @ param start 开始 ( 包含 ) * @ param stop 结束 ( 包含 ) * @ param step 步进 * @ param values 集合 * @ return 集合 */ public static Collection < Integer > appendRange ( int start , int stop , int step , Collection < Integer > values ) { } }
if ( start < stop ) { step = Math . abs ( step ) ; } else if ( start > stop ) { step = - Math . abs ( step ) ; } else { // start = = end values . add ( start ) ; return values ; } for ( int i = start ; ( step > 0 ) ? i <= stop : i >= stop ; i += step ) { values . add ( i ) ; } return values ;
public class JavascriptEngine { /** * Evaluates the script * @ param scriptName * the script name * @ param reader * the script reader * @ return the result */ public Object evaluate ( String scriptName , Reader reader ) { } }
try { scriptEngine . put ( ScriptEngine . FILENAME , scriptName ) ; return scriptEngine . eval ( reader ) ; } catch ( ScriptException e ) { throw new BundlingProcessException ( "Error while evaluating script : " + scriptName , e ) ; }
public class StreamManager { /** * To take into account overhead due to underlying protocols ( e . g . TCP / IP ) * @ param payloadPercentage a ] 0 , 100 ] value . where 100 means that the required * downstream / upstream bandwidth will be full used for * sending payload . * Default value is 95 % . * The defa...
if ( ! ( payloadPercentage > 0 && payloadPercentage <= 100 ) ) { // if an invalid percentage is given payloadPercentage = 95 ; } this . actualPayloadPercentage = ( double ) payloadPercentage / 100 ; setMaxBps ( this . downStream , this . downStream . maxBps ) ; setMaxBps ( this . upStream , this . upStream . maxBps ) ;
public class NestedClassWriterImpl { /** * { @ inheritDoc } */ @ Override protected void addInheritedSummaryLink ( TypeElement typeElement , Element member , Content linksTree ) { } }
linksTree . addContent ( writer . getLink ( new LinkInfoImpl ( configuration , LinkInfoImpl . Kind . MEMBER , ( TypeElement ) member ) ) ) ;
public class VoiceApi { /** * Switch to listen in * Switch to the listen in monitoring mode . When listen in is enabled and the agent receives a call , the supervisor is able to listen to the agent and the customer , but they can & # 39 ; t hear the supervisor . * @ param id The connection ID of the call being moni...
com . squareup . okhttp . Call call = switchToListenInValidateBeforeCall ( id , monitoringScopeData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class SeaGlassGraphicsUtils { /** * Paints an icon and text . This will render the text as html , if necessary , * and offset the location by the insets of the component . * @ param ss * SynthContext * @ param g * Graphics to render string and icon into * @ param text * Text to layout * @ param i...
if ( ( icon == null ) && ( text == null ) ) { return ; } Graphics2D g2d = ( Graphics2D ) g . create ( ) ; g2d . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; JComponent c = ss . getComponent ( ) ; FontMetrics fm = SwingUtilities2 . getFontMetrics ( c , g2d ) ; ...
public class XmlPackageReader { /** * Read a < code > RuleSet < / code > from a < code > Reader < / code > . * @ param reader * The reader containing the rule - set . * @ return The rule - set . */ public PackageDescr read ( final Reader reader ) throws SAXException , IOException { } }
this . packageDescr = ( PackageDescr ) this . parser . read ( reader ) ; return this . packageDescr ;
public class StateHandler { /** * Check the current state . * @ param state The state to check . * @ return < code > true < / code > if it is this state , < code > false < / code > else . */ public boolean isState ( Class < ? extends State > state ) { } }
if ( current != null ) { return current . getClass ( ) . equals ( state ) ; } return false ;
public class AssertSoapFault { /** * Constructs the control soap fault holding all expected fault information * like faultCode , faultString and faultDetail . * @ return the constructed SoapFault instance . */ private SoapFault constructControlFault ( TestContext context ) { } }
SoapFault controlFault = new SoapFault ( ) ; if ( StringUtils . hasText ( faultActor ) ) { controlFault . faultActor ( context . replaceDynamicContentInString ( faultActor ) ) ; } controlFault . faultCode ( context . replaceDynamicContentInString ( faultCode ) ) ; controlFault . faultString ( context . replaceDynamicCo...
public class DOType { /** * Answer a list of all field names declared by this type and all it ' s super types . * @ return */ public List < String > getFieldNames ( ) { } }
List < String > ret = new ArrayList < String > ( ) ; DOType typ = this ; while ( typ != null ) { ret . addAll ( typ . getDeclaredFieldNames ( ) ) ; typ = typ . getSuperType ( ) ; } return ret ;
public class CnvBnRsToEntity { /** * < p > Convert RS to entity ( fill only ID ) . < / p > * @ param pAddParam additional params , e . g . entity class UserRoleTomcat * to reveal derived columns for its composite ID , or field Enum class * to reveal Enum value by index . * @ param pFrom from a bean * @ param ...
// foreign entity ' s ID map Map < String , Object > idNmValMap = new HashMap < String , Object > ( ) ; TableSql tableSql = this . tablesMap . get ( pFieldClass . getSimpleName ( ) ) ; for ( String idFldNm : tableSql . getIdColumnsNames ( ) ) { Object idVal ; Field rapiFld = this . fieldsRapiHolder . getFor ( pFieldCla...
public class EncryptionAlgorithmOptions { /** * The set of accepted encryption algorithms that are allowed in an AWS Signer job . * @ param allowedValues * The set of accepted encryption algorithms that are allowed in an AWS Signer job . * @ return Returns a reference to this object so that method calls can be ch...
java . util . ArrayList < String > allowedValuesCopy = new java . util . ArrayList < String > ( allowedValues . length ) ; for ( EncryptionAlgorithm value : allowedValues ) { allowedValuesCopy . add ( value . toString ( ) ) ; } if ( getAllowedValues ( ) == null ) { setAllowedValues ( allowedValuesCopy ) ; } else { getA...
public class ClassWriter { /** * Write method parameter annotations ; * return number of attributes written . */ int writeParameterAttrs ( MethodSymbol m ) { } }
boolean hasVisible = false ; boolean hasInvisible = false ; if ( m . params != null ) { for ( VarSymbol s : m . params ) { for ( Attribute . Compound a : s . getRawAttributes ( ) ) { switch ( types . getRetention ( a ) ) { case SOURCE : break ; case CLASS : hasInvisible = true ; break ; case RUNTIME : hasVisible = true...
public class FileUtilities { /** * Write a list of lines to a file . * @ param lines the list of lines to write . * @ param filePath the path to the file to write to . * @ throws IOException */ public static void writeFile ( List < String > lines , String filePath ) throws IOException { } }
writeFile ( lines , new File ( filePath ) ) ;
public class Database { /** * Creates an attachment from the specified InputStream and a new document with a generated * document ID . * < P > Example usage : < / P > * < pre > * { @ code * byte [ ] bytesToDB = " binary data " . getBytes ( ) ; * ByteArrayInputStream bytesIn = new ByteArrayInputStream ( byte...
Response couchDbResponse = db . saveAttachment ( in , name , contentType ) ; com . cloudant . client . api . model . Response response = new com . cloudant . client . api . model . Response ( couchDbResponse ) ; return response ;
public class ListUtil { /** * Clears out the first element that is referentially equal to the * supplied element ( < code > list [ idx ] = = element < / code > ) . * @ return the element that was removed or null if it was not found . */ public static Object clearRef ( Object [ ] list , Object element ) { } }
return clear ( REFERENCE_COMP , list , element ) ;
public class Application { /** * Change the current user to this user and ( optionally ) validate password . * @ param strPassword * @ param strDomain The domain * @ param strUser * @ return normal _ return if successful */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) public int login ( Task task , String strUserName , String strPassword , String strDomain ) { boolean bCreateServer = false ; if ( ( this . getProperty ( Params . REMOTE_HOST ) != null ) && ( this . getProperty ( Params . REMOTE_HOST ) . length ( ) > 0 ) ) bCreateServer = true ; org . jbund...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getSTOBORNTION ( ) { } }
if ( stoborntionEEnum == null ) { stoborntionEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 73 ) ; } return stoborntionEEnum ;
public class ConnectionUtils { /** * Remove all { @ link ConnectionData } associated to the specified provider ID . * @ param profile the profile where to remove the data from * @ param providerId the provider ID of the connection */ public static void removeConnectionData ( Profile profile , String providerId ) { ...
Map < String , List < Map < String , Object > > > allConnections = profile . getAttribute ( CONNECTIONS_ATTRIBUTE_NAME ) ; if ( MapUtils . isNotEmpty ( allConnections ) ) { allConnections . remove ( providerId ) ; }
public class Parameters { /** * Given a list of strings , returns the first string in the list which exists as a parameter . If * none do , a { @ link ParameterException } is thrown . */ public String getFirstExistingParamName ( String [ ] paramNames ) { } }
for ( final String paramName : paramNames ) { if ( isPresent ( paramName ) ) { return paramName ; } } throw new ParameterException ( "One of " + Arrays . toString ( paramNames ) + " must be present" ) ;
public class Particles { /** * Creates and returns a GVRSceneObject with the specified mesh attributes . * @ param vertices the vertex positions of that make up the mesh . ( x1 , y1 , z1 , x2 , y2 , z2 , . . . ) * @ param velocities the velocity attributes for each vertex . ( vx1 , vy1 , vz1 , vx2 , vy2 , vz2 . . ....
mParticleMesh = new GVRMesh ( mGVRContext ) ; // pass the particle positions as vertices , velocities as normals , and // spawning times as texture coordinates . mParticleMesh . setVertices ( vertices ) ; mParticleMesh . setNormals ( velocities ) ; mParticleMesh . setTexCoords ( particleTimeStamps ) ; particleID = new ...
public class RelationalOperations { /** * Returns true if multipoint _ a is within point _ b . */ private static boolean multiPointWithinPoint_ ( MultiPoint multipoint_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { } }
return multiPointEqualsPoint_ ( multipoint_a , point_b , tolerance , progress_tracker ) ;
public class IntegerTermsSet { /** * Serialize the list of terms to the { @ link StreamOutput } . * < br > * Given the low performance of { @ link org . elasticsearch . common . io . stream . BytesStreamOutput } when writing a large number * of longs ( 5 to 10 times slower than writing directly to a byte [ ] ) , ...
// Encode flag out . writeBoolean ( this . isPruned ( ) ) ; // Encode size of list out . writeInt ( set . size ( ) ) ; // Encode ints BytesRef buffer = new BytesRef ( new byte [ 1024 * 8 ] ) ; Iterator < IntCursor > it = set . iterator ( ) ; while ( it . hasNext ( ) ) { Bytes . writeVInt ( buffer , it . next ( ) . valu...
public class StringUtil { /** * Trims the argument string for whitespace on the left side only . * @ param pString the string to trim * @ return the string with no whitespace on the left , or { @ code null } if * the string argument is { @ code null } . * @ see # rtrim * @ see String # trim ( ) */ public stat...
if ( ( pString == null ) || ( pString . length ( ) == 0 ) ) { return pString ; // Null or empty string } for ( int i = 0 ; i < pString . length ( ) ; i ++ ) { if ( ! Character . isWhitespace ( pString . charAt ( i ) ) ) { if ( i == 0 ) { return pString ; // First char is not whitespace } else { return pString . substri...
public class CPDefinitionInventoryLocalServiceBaseImpl { /** * Creates a new cp definition inventory with the primary key . Does not add the cp definition inventory to the database . * @ param CPDefinitionInventoryId the primary key for the new cp definition inventory * @ return the new cp definition inventory */ @...
return cpDefinitionInventoryPersistence . create ( CPDefinitionInventoryId ) ;
public class SendRoutingInfoForLCSRequestImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . map . api . primitives . MAPAsnPrimitive # encodeData * ( org . mobicents . protocols . asn . AsnOutputStream ) */ public void encodeData ( AsnOutputStream asnOs ) throws MAPException { } }
if ( this . mlcNumber == null ) { throw new MAPException ( "Encoding of " + _PrimitiveName + " failed. Manadatory parameter mlcNumber [0] ISDN-AddressString is not set" ) ; } if ( this . targetMS == null ) { throw new MAPException ( "Encoding of " + _PrimitiveName + " failed. Manadatory parameter targetMS [1] Subscribe...
public class PersistingUnit { /** * Handles the success case , which by default posts a response to a ConfirmListener . * If you need something else , or to repond to a ResultListener , you ' ll need to override this . */ public void handleSuccess ( ) { } }
if ( _listener instanceof InvocationService . ConfirmListener ) { reportRequestProcessed ( ) ; } else if ( _listener instanceof InvocationService . ResultListener && _resultSet ) { reportRequestProcessed ( _result ) ; }
public class Config { /** * Resolve variables string . * @ param string the string * @ return the string */ static String resolveVariables ( String string ) { } }
if ( string == null ) { return null ; } String rval = string ; Matcher m = STRING_SUBSTITUTION . matcher ( string ) ; while ( m . find ( ) ) { if ( getInstance ( ) . properties . containsKey ( m . group ( 1 ) ) ) { rval = rval . replaceAll ( Pattern . quote ( m . group ( 0 ) ) , get ( m . group ( 1 ) ) . asString ( ) )...
public class OnEntryScriptTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case DroolsPackage . ON_ENTRY_SCRIPT_TYPE__SCRIPT : setScript ( SCRIPT_EDEFAULT ) ; return ; case DroolsPackage . ON_ENTRY_SCRIPT_TYPE__SCRIPT_FORMAT : setScriptFormat ( SCRIPT_FORMAT_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class LongStream { /** * Skips first { @ code n } elements and returns { @ code LongStream } with remaining elements . * If this stream contains fewer than { @ code n } elements , then an * empty stream will be returned . * < p > This is a stateful intermediate operation . * < p > Example : * < pre > ...
if ( n < 0 ) throw new IllegalArgumentException ( "n cannot be negative" ) ; if ( n == 0 ) return this ; return new LongStream ( params , new LongSkip ( iterator , n ) ) ;
public class CmsSerialDateValue { /** * Generates the JSON object storing the pattern information . * @ return the JSON object storing the pattern information . */ private JSONObject patternToJson ( ) { } }
JSONObject pattern = new JSONObject ( ) ; if ( null != getPatternType ( ) ) { pattern . put ( JsonKey . PATTERN_TYPE , new JSONString ( getPatternType ( ) . toString ( ) ) ) ; switch ( getPatternType ( ) ) { case DAILY : if ( isEveryWorkingDay ( ) ) { pattern . put ( JsonKey . PATTERN_EVERYWORKINGDAY , JSONBoolean . ge...
public class OvrViewManager { /** * Called when the surface is created or recreated . Avoided because this can * be called twice at the beginning . */ void onSurfaceChanged ( int width , int height ) { } }
Log . v ( TAG , "onSurfaceChanged" ) ; final VrAppSettings . EyeBufferParams . DepthFormat depthFormat = mApplication . getAppSettings ( ) . getEyeBufferParams ( ) . getDepthFormat ( ) ; mApplication . getConfigurationManager ( ) . configureRendering ( VrAppSettings . EyeBufferParams . DepthFormat . DEPTH_24_STENCIL_8 ...
public class PcHttpUtils { /** * ! ! ! ! ASSUMPTION : all VAR exists in HTTP Header must of type : * APIVARREPLACE _ NAME _ PREFIX _ HTTP _ HEADER * 20140310 This may be costly ( O ( n ^ 2 ) ) of the updated related # of headers ; * # of parameters in the requests . * Better to only do it when there are some re...
boolean needToReplaceVarInHttpHeader = false ; for ( String parameter : requestParameters . keySet ( ) ) { if ( parameter . contains ( PcConstants . NODE_REQUEST_PREFIX_REPLACE_VAR ) ) { needToReplaceVarInHttpHeader = true ; break ; } } if ( ! needToReplaceVarInHttpHeader ) { logger . debug ( "No need to replace. Since...
public class Exceptions { /** * Invoke { @ code Throwable # addSuppressed ( Throwable ) } reflectively if it is available . * It is not available on JRE & lt ; 1.7 * @ since 2.8 */ public static void addSuppressed ( Throwable owner , Throwable add ) { } }
try { Method method = owner . getClass ( ) . getMethod ( "addSuppressed" , Throwable . class ) ; method . invoke ( owner , add ) ; } catch ( NoSuchMethodException e ) { // ignore , will happen for JRE < 1.7 } catch ( SecurityException e ) { throwUncheckedException ( e ) ; } catch ( IllegalAccessException e ) { throwUnc...
public class SeaGlassSynthPainterImpl { /** * Paint the provided painter using the provided transform at the specified * position and size . Handles if g is a non 2D Graphics by painting via a * BufferedImage . * @ param p the painter to use . * @ param ctx the SynthContext describing the component / region , t...
if ( p != null ) { if ( g instanceof Graphics2D ) { Graphics2D gfx = ( Graphics2D ) g ; if ( transform != null ) { gfx . transform ( transform ) ; } gfx . translate ( x , y ) ; p . paint ( gfx , ctx . getComponent ( ) , w , h ) ; gfx . translate ( - x , - y ) ; if ( transform != null ) { try { gfx . transform ( transfo...
public class ValueMap { /** * Constructs ValueMap using a sequence of key - value arguments . * Keys should be String , values should fit { @ link Parcel # writeValue ( Object ) } argument * requirements . */ public static ValueMap map ( Object ... map ) { } }
if ( map . length / 2 * 2 != map . length ) throw new IllegalArgumentException ( "Arguments should be <String> key - <?> value pairs" ) ; Builder builder = new Builder ( ) ; for ( int i = 0 ; i < map . length ; i += 2 ) builder . put ( ( String ) map [ i ] , map [ i + 1 ] ) ; return builder . build ( ) ;
public class Vector3i { /** * / * ( non - Javadoc ) * @ see org . joml . Vector3ic # distanceSquared ( org . joml . Vector3ic ) */ public long distanceSquared ( Vector3ic v ) { } }
return distanceSquared ( v . x ( ) , v . y ( ) , v . z ( ) ) ;
public class Reflection { /** * get super class ' s generic types . * eg . A extends B ( T1 , T2 ) will return [ T1 , T2 ] . < br > * if no generic type is defined for the parent class , null is returned . * It is not recommended to use this method when you want to get a { @ link Unit unit } ' s * { @ link Grou...
if ( Proxy . isProxyClass ( object . getClass ( ) ) ) { object = ProxyBuilder . getProxyBuilder ( object . hashCode ( ) ) . getMostOriginalObject ( ) ; } return getSupperGenericType ( object . getClass ( ) ) ;
public class FormatterMojo { /** * Format file . * @ param file * the file * @ param rc * the rc * @ param hashCache * the hash cache * @ param basedirPath * the basedir path */ private void formatFile ( File file , ResultCollector rc , Properties hashCache , String basedirPath ) throws MojoFailureExcep...
try { doFormatFile ( file , rc , hashCache , basedirPath , false ) ; } catch ( IOException | MalformedTreeException | BadLocationException e ) { rc . failCount ++ ; getLog ( ) . warn ( e ) ; }
public class Lz4Codec { /** * Create a new { @ link Compressor } for use by this { @ link CompressionCodec } . * @ return a new compressor for use by this codec */ @ Override public Compressor createCompressor ( ) { } }
if ( ! isNativeCodeLoaded ( ) ) { throw new RuntimeException ( "native lz4 library not available" ) ; } int bufferSize = conf . getInt ( IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY , IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_DEFAULT ) ; boolean useLz4HC = conf . getBoolean ( IO_COMPRESSION_CODEC_LZ4_USELZ4HC_KEY , IO_COMPRESSION...
public class CRLReasonCodeExtension { /** * Get the attribute value . */ public Integer get ( String name ) throws IOException { } }
if ( name . equalsIgnoreCase ( REASON ) ) { return new Integer ( reasonCode ) ; } else { throw new IOException ( "Name not supported by CRLReasonCodeExtension" ) ; }
public class AmazonS3Client { /** * Adds the specified parameter to the specified request , if the parameter * value is not null . * @ param request * The request to add the parameter to . * @ param paramName * The parameter name . * @ param paramValue * The parameter value . */ private static void addPar...
if ( paramValue != null ) { addParameterIfNotNull ( request , paramName , paramValue . toString ( ) ) ; }
public class CNDStreamWriter { /** * Write given list of node types to output stream . * @ param nodeTypes * List of NodeTypes to write . * @ param os * OutputStream to write to . * @ throws RepositoryException */ public void write ( List < NodeTypeData > nodeTypes , OutputStream os ) throws RepositoryExcepti...
OutputStreamWriter out = new OutputStreamWriter ( os ) ; try { for ( NodeTypeData nodeType : nodeTypes ) { printNamespaces ( nodeType , out ) ; printNodeTypeDeclaration ( nodeType , out ) ; } out . close ( ) ; } catch ( IOException e ) { throw new RepositoryException ( e . getMessage ( ) , e ) ; }
public class BsElevateWordToLabelCA { public void filter ( String name , EsAbstractConditionQuery . OperatorCall < BsElevateWordToLabelCQ > queryLambda , ConditionOptionCall < FilterAggregationBuilder > opLambda , OperatorCall < BsElevateWordToLabelCA > aggsLambda ) { } }
ElevateWordToLabelCQ cq = new ElevateWordToLabelCQ ( ) ; if ( queryLambda != null ) { queryLambda . callback ( cq ) ; } FilterAggregationBuilder builder = regFilterA ( name , cq . getQuery ( ) ) ; if ( opLambda != null ) { opLambda . callback ( builder ) ; } if ( aggsLambda != null ) { ElevateWordToLabelCA ca = new Ele...
public class AbstractSupplier { /** * Void for most suppliers */ @ Override public void setPrimaryKey ( WV value , Mapper mapper , String column , K primaryKey , Object Entity ) { } }