signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ExtendedObservation { /** * Resets the moment observations . < br > * If there are no observations yet , new observations are created and added to the map . < br > * Otherwise existing observations are reset . */ private void resetMomentObservation ( ) { } }
if ( momentObservation . isEmpty ( ) ) { Observation o ; for ( int i : momentDegrees ) { o = new Observation ( "moment " + i , true ) ; o . setStandardPrecision ( momentPrecision ) ; momentObservation . put ( i , o ) ; } } else { for ( Observation o : momentObservation . values ( ) ) o . reset ( ) ; }
public class ConnectionPoolSegment { /** * Determine if this segment is currently idle . * @ return Is the segment idle ? */ final boolean isIdle ( ) { } }
for ( ConnectionPoolConnection conn : connections ) { if ( conn . state . get ( ) == ConnectionPoolConnection . STATE_OPEN ) { return false ; } } return true ;
public class RandomAccessReader { /** * Get a 32 - bit unsigned integer from the buffer , returning it as a long . * @ param index position within the data buffer to read first byte * @ return the unsigned 32 - bit int value as a long , between 0x00000 and 0xFFFFF * @ throws IOException the buffer does not contai...
validateIndex ( index , 4 ) ; if ( _isMotorolaByteOrder ) { // Motorola - MSB first ( big endian ) return ( ( ( long ) getByte ( index ) ) << 24 & 0xFF000000L ) | ( ( ( long ) getByte ( index + 1 ) ) << 16 & 0xFF0000L ) | ( ( ( long ) getByte ( index + 2 ) ) << 8 & 0xFF00L ) | ( ( ( long ) getByte ( index + 3 ) ) & 0xF...
public class Wro4jAutoConfiguration { /** * This cache strategy will be configured if there ' s not already a cache * strategy , a { @ link CacheManager } is present and the name of the cache to * use is configured . * @ param < K > Type of the cache keys * @ param < V > Type of the cache values * @ param cac...
LOGGER . debug ( "Creating cache strategy 'SpringCacheStrategy'" ) ; return new SpringCacheStrategy < > ( cacheManager , wro4jProperties . getCacheName ( ) ) ;
public class Arguments { /** * Initializes this Args instance with a set of command line args . * The args will be processed in conjunction with the full set of * command line options , including - help , - version etc . * The args may also contain class names and filenames . * Any errors during this call , and...
this . ownName = ownName ; errorMode = ErrorMode . LOG ; files = new LinkedHashSet < > ( ) ; deferredFileManagerOptions = new LinkedHashMap < > ( ) ; fileObjects = null ; classNames = new LinkedHashSet < > ( ) ; processArgs ( List . from ( args ) , Option . getJavaCompilerOptions ( ) , cmdLineHelper , true , false ) ; ...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMassFlowRateMeasure ( ) { } }
if ( ifcMassFlowRateMeasureEClass == null ) { ifcMassFlowRateMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 706 ) ; } return ifcMassFlowRateMeasureEClass ;
public class UserPage { /** * Returns an iterator over this page ' s { @ code results } that : * < ul > * < li > Will not be { @ code null } . < / li > * < li > Will not support { @ link java . util . Iterator # remove ( ) } . < / li > * < / ul > * @ return a non - null iterator . */ @ Override public java . ...
if ( results == null ) { return java . util . Collections . < com . google . api . ads . admanager . axis . v201805 . User > emptyIterator ( ) ; } return java . util . Arrays . < com . google . api . ads . admanager . axis . v201805 . User > asList ( results ) . iterator ( ) ;
public class Procedure { /** * syntactic sugar */ public Reference addReport ( ) { } }
Reference t = new Reference ( ) ; if ( this . report == null ) this . report = new ArrayList < Reference > ( ) ; this . report . add ( t ) ; return t ;
public class AioTCPChannel { /** * @ see * com . ibm . ws . tcpchannel . internal . TCPChannel # createInboundSocketIOChannel ( * java . nio . channels . SocketChannel ) */ public SocketIOChannel createInboundSocketIOChannel ( SocketChannel sc ) throws IOException { } }
AsyncSocketChannel asc = new AsyncSocketChannel ( sc , getAsyncChannelGroup ( ) ) ; return AioSocketIOChannel . createIOChannel ( sc . socket ( ) , asc , this ) ;
public class JavacProcessingEnvironment { /** * Convert import - style string for supported annotations into a * regex matching that string . If the string is a valid * import - style string , return a regex that won ' t match anything . */ private static Pattern importStringToPattern ( String s , Processor p , Log...
if ( isValidImportString ( s ) ) { return validImportStringToPattern ( s ) ; } else { log . warning ( "proc.malformed.supported.string" , s , p . getClass ( ) . getName ( ) ) ; return noMatches ; // won ' t match any valid identifier }
public class PiBondingMovementReaction { /** * Initiate process . * It is needed to call the addExplicitHydrogensToSatisfyValency * from the class tools . HydrogenAdder . * @ exception CDKException Description of the Exception * @ param reactants reactants of the reaction . * @ param agents agents of the reac...
logger . debug ( "initiate reaction: PiBondingMovementReaction" ) ; if ( reactants . getAtomContainerCount ( ) != 1 ) { throw new CDKException ( "PiBondingMovementReaction only expects one reactant" ) ; } if ( agents != null ) { throw new CDKException ( "PiBondingMovementReaction don't expects agents" ) ; } IReactionSe...
public class StoreImpl { /** * / * ( non - Javadoc ) * @ see com . att . env . Store # get ( com . att . env . StaticSlot T defaultObject ) */ @ SuppressWarnings ( "unchecked" ) public < T > T get ( StaticSlot sslot , T dflt ) { } }
T t = ( T ) staticState [ sslot . slot ] ; return t == null ? dflt : t ;
public class IterableExtensions { /** * Concatenates two iterables into a single iterable . The returned iterable has an iterator that traverses the * elements in { @ code a } , followed by the elements in { @ code b } . The resulting iterable is effectivly a view on the * source iterables . That is , the source it...
return Iterables . concat ( a , b ) ;
public class Graphics { /** * Get the current graphics context background color * @ return The background color of this graphics context */ public Color getBackground ( ) { } }
predraw ( ) ; FloatBuffer buffer = BufferUtils . createFloatBuffer ( 16 ) ; GL . glGetFloat ( SGL . GL_COLOR_CLEAR_VALUE , buffer ) ; postdraw ( ) ; return new Color ( buffer ) ;
public class SingleNumericalValue { /** * Parses an integer value from a { @ link String } encoded in Base64 format . * This method does not check the passed { @ link String } before parsing , so this method should only be used on string * which are certain to match the required format . * @ param value a { @ lin...
final String s = value . substring ( 2 ) ; // crop " 0b " / " 0B " at the beginning final int length = s . length ( ) ; int result = 0 ; for ( int i = 0 ; i < length ; ++ i ) { final char c = s . charAt ( length - 1 - i ) ; result += base64ValueOf ( c ) * Math . pow ( 64 , i ) ; } return result ;
public class CmsPrincipalSelectDialog { /** * Init table . < p > * @ param type WidgetType to initialize */ void initTable ( WidgetType type ) { } }
IndexedContainer data ; try { data = getContainerForType ( type , m_realOnly , ( String ) m_ouCombo . getValue ( ) ) ; m_table . updateContainer ( data ) ; m_tableFilter . setValue ( "" ) ; } catch ( CmsException e ) { LOG . error ( "Can't read principals" , e ) ; }
public class GRPCUtils { /** * Create exception info from exception object . * @ param exceptionCodec to encode exception into bytes * @ param ex exception object * @ return ExceptionInfo */ public static ExceptionInfo createExceptionInfo ( final ExceptionCodec exceptionCodec , final Throwable ex ) { } }
return ExceptionInfo . newBuilder ( ) . setName ( ex . getCause ( ) != null ? ex . getCause ( ) . toString ( ) : ex . toString ( ) ) . setMessage ( StringUtils . isNotEmpty ( ex . getMessage ( ) ) ? ex . getMessage ( ) : ex . toString ( ) ) . setData ( ByteString . copyFrom ( exceptionCodec . toBytes ( ex ) ) ) . build...
public class ClientPropertiesResultMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ClientPropertiesResult clientPropertiesResult , ProtocolMarshaller protocolMarshaller ) { } }
if ( clientPropertiesResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( clientPropertiesResult . getResourceId ( ) , RESOURCEID_BINDING ) ; protocolMarshaller . marshall ( clientPropertiesResult . getClientProperties ( ) , CLIENTPROPE...
public class Mode { /** * Compute the display output given full context and values */ String format ( String field , FormatCase fc , FormatAction fa , FormatWhen fw , FormatResolve fr , FormatUnresolved fu , FormatErrors fe , String name , String type , String value , String unresolved , List < String > errorLines ) { ...
// Convert the context into a bit representation used as selectors for store field formats long bits = bits ( fc , fa , fw , fr , fu , fe ) ; String fname = name == null ? "" : name ; String ftype = type == null ? "" : type ; // Compute the representation of value String fvalue = truncateValue ( value , bits ) ; String...
public class WbsRowComparatorXER { /** * { @ inheritDoc } */ @ Override public int compare ( Row o1 , Row o2 ) { } }
Integer parent1 = o1 . getInteger ( "parent_wbs_id" ) ; Integer parent2 = o2 . getInteger ( "parent_wbs_id" ) ; int result = NumberHelper . compare ( parent1 , parent2 ) ; if ( result == 0 ) { Integer seq1 = o1 . getInteger ( "seq_num" ) ; Integer seq2 = o2 . getInteger ( "seq_num" ) ; result = NumberHelper . compare (...
public class Options { /** * Adds an YAxis to the chart . You can use { @ link # setyAxis ( Axis ) } if you want * to define a single axis only . * @ param yAxis the YAxis to add . * @ return the { @ link Options } object for chaining . */ public Options addyAxis ( final Axis yAxis ) { } }
if ( this . getyAxis ( ) == null ) { this . setyAxis ( new ArrayList < Axis > ( ) ) ; } this . getyAxis ( ) . add ( yAxis ) ; return this ;
public class Datatype_Builder { /** * Resets the state of this builder . * @ return this { @ code Builder } object */ public Datatype . Builder clear ( ) { } }
Datatype_Builder defaults = new Datatype . Builder ( ) ; type = defaults . type ; interfaceType = defaults . interfaceType ; builder = defaults . builder ; extensible = defaults . extensible ; builderFactory = defaults . builderFactory ; generatedBuilder = defaults . generatedBuilder ; valueType = defaults . valueType ...
public class HashUtilities { /** * Generates a MD5 Hash for a specific string * @ param input The string to be converted into an MD5 hash . * @ return The MD5 Hash string of the input string . */ public static String generateMD5 ( final String input ) { } }
try { return generateMD5 ( input . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { LOG . debug ( "An error occurred generating the MD5 Hash of the input string" , e ) ; return null ; }
public class StatusDots { /** * Adding Dot objects to layout * @ param length Length of PIN entered so far */ private void addDots ( int length ) { } }
removeAllViews ( ) ; final int pinLength = styledAttributes . getInt ( R . styleable . PinLock_pinLength , 4 ) ; for ( int i = 0 ; i < pinLength ; i ++ ) { Dot dot = new Dot ( context , styledAttributes , i < length ) ; addView ( dot ) ; }
public class RootDocImpl { /** * Classes and interfaces specified on the command line . */ public ClassDoc [ ] specifiedClasses ( ) { } }
ListBuffer < ClassDocImpl > classesToDocument = new ListBuffer < ClassDocImpl > ( ) ; for ( ClassDocImpl cd : cmdLineClasses ) { cd . addAllClasses ( classesToDocument , true ) ; } return ( ClassDoc [ ] ) classesToDocument . toArray ( new ClassDocImpl [ classesToDocument . length ( ) ] ) ;
public class CensusTracingModule { /** * Creates a { @ link ClientCallTracer } for a new call . */ @ VisibleForTesting ClientCallTracer newClientCallTracer ( @ Nullable Span parentSpan , MethodDescriptor < ? , ? > method ) { } }
return new ClientCallTracer ( parentSpan , method ) ;
public class A_CmsHtmlIconButton { /** * Generates a default html code for icon buttons . < p > * @ param style the style of the button * @ param id the id * @ param name the name * @ param helpText the help text * @ param enabled if enabled or not * @ param iconPath the path to the icon * @ param confirm...
return defaultButtonHtml ( style , id , id , name , helpText , enabled , iconPath , confirmationMessage , onClick , false , null ) ;
public class VJournalUserAgent { /** * < pre > * 3.5.1 . PUBLISH * The " PUBLISH " method in a " VJOURNAL " calendar component has no * associated response . It is simply a posting of an iCalendar object * that may be added to a calendar . It MUST have an " Organizer " . It * MUST NOT have " Attendees " . The...
Calendar published = wrap ( Method . PUBLISH , component ) ; published . validate ( ) ; return published ;
public class policyhttpcallout { /** * Use this API to update policyhttpcallout . */ public static base_response update ( nitro_service client , policyhttpcallout resource ) throws Exception { } }
policyhttpcallout updateresource = new policyhttpcallout ( ) ; updateresource . name = resource . name ; updateresource . ipaddress = resource . ipaddress ; updateresource . port = resource . port ; updateresource . vserver = resource . vserver ; updateresource . returntype = resource . returntype ; updateresource . ht...
public class IteratorExtensions { /** * Finds the first element in the given iterator that fulfills the predicate . If none is found or the iterator is * empty , < code > null < / code > is returned . * @ param iterator * the iterator . May not be < code > null < / code > . * @ param predicate * the predicate...
if ( predicate == null ) throw new NullPointerException ( "predicate" ) ; while ( iterator . hasNext ( ) ) { T t = iterator . next ( ) ; if ( predicate . apply ( t ) ) return t ; } return null ;
public class MultiLayerNetwork { /** * Compute activations from input to output of the output layer . * As per { @ link # feedForward ( INDArray , boolean ) } but using the inputs that have previously been set using { @ link # setInput ( INDArray ) } * @ return the list of activations for each layer */ public List ...
try { return ffToLayerActivationsDetached ( train , FwdPassType . STANDARD , false , layers . length - 1 , input , mask , null , true ) ; } catch ( OutOfMemoryError e ) { CrashReportingUtil . writeMemoryCrashDump ( this , e ) ; throw e ; }
public class BeansDescriptorImpl { /** * If not already created , a new < code > interceptors < / code > element will be created and returned . Otherwise , the first * existing < code > interceptors < / code > element will be returned . * @ return the instance defined for the element < code > interceptors < / code ...
List < Node > nodeList = model . get ( "interceptors" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new InterceptorsImpl < BeansDescriptor > ( this , "interceptors" , model , nodeList . get ( 0 ) ) ; } return createInterceptors ( ) ;
public class CmsDriverManager { /** * Gets the correct driver interface to use for proxying a specific driver instance . < p > * @ param obj the driver instance * @ return the interface to use for proxying */ private Class < ? > getDriverInterfaceForProxy ( Object obj ) { } }
for ( Class < ? > interfaceClass : new Class [ ] { I_CmsUserDriver . class , I_CmsVfsDriver . class , I_CmsProjectDriver . class , I_CmsHistoryDriver . class , I_CmsSubscriptionDriver . class } ) { if ( interfaceClass . isAssignableFrom ( obj . getClass ( ) ) ) { return interfaceClass ; } } return null ;
public class GeoPackageCoreImpl { /** * { @ inheritDoc } */ @ Override public boolean isFeatureOrTileTable ( String table ) { } }
boolean isType = false ; Contents contents = getTableContents ( table ) ; if ( contents != null ) { ContentsDataType dataType = contents . getDataType ( ) ; isType = dataType != null && ( dataType == ContentsDataType . FEATURES || dataType == ContentsDataType . TILES ) ; } return isType ;
public class OnlineAccuracyUpdatedEnsemble { /** * Computes the weight of a learner before training a given example . * @ param i the identifier ( in terms of array learners ) * of the classifier for which the weight is supposed to be computed * @ param example the newest example * @ return the computed weight ...
int d = this . windowSize ; int t = this . processedInstances - this . ensemble [ i ] . birthday ; double e_it = 0 ; double mse_it = 0 ; double voteSum = 0 ; try { double [ ] votes = this . ensemble [ i ] . classifier . getVotesForInstance ( example ) ; for ( double element : votes ) { voteSum += element ; } if ( voteS...
public class IFD { /** * Gets the metadata . * @ param name the name * @ return the metadata */ public TagValue getTag ( String name ) { } }
TagValue tv = null ; int id = TiffTags . getTagId ( name ) ; if ( tags . containsTagId ( id ) ) tv = tags . get ( id ) ; return tv ;
public class MPPUtility { /** * Reads a color value represented by three bytes , for R , G , and B * components , plus a flag byte indicating if this is an automatic color . * Returns null if the color type is " Automatic " . * @ param data byte array of data * @ param offset offset into array * @ return new ...
Color result = null ; if ( getByte ( data , offset + 3 ) == 0 ) { int r = getByte ( data , offset ) ; int g = getByte ( data , offset + 1 ) ; int b = getByte ( data , offset + 2 ) ; result = new Color ( r , g , b ) ; } return result ;
public class Either { /** * Create a Left value of Either */ public static < L , R > Either < L , R > Left ( L value ) { } }
return new Left < L , R > ( value ) ;
public class GeometryEngine { /** * Constructs a new geometry by union an array of geometries . All inputs * must be of the same type of geometries and share one spatial reference . * See OperatorUnion . * @ param geometries * The geometries to union . * @ param spatialReference * The spatial reference of t...
OperatorUnion op = ( OperatorUnion ) factory . getOperator ( Operator . Type . Union ) ; SimpleGeometryCursor inputGeometries = new SimpleGeometryCursor ( geometries ) ; GeometryCursor result = op . execute ( inputGeometries , spatialReference , null ) ; return result . next ( ) ;
public class AVObject { /** * judge operations ' value include circle reference or not . * notice : internal used , pls not invoke it . * @ param markMap * @ return */ public boolean hasCircleReference ( Map < AVObject , Boolean > markMap ) { } }
if ( null == markMap ) { return false ; } markMap . put ( this , true ) ; boolean rst = false ; for ( ObjectFieldOperation op : operations . values ( ) ) { rst = rst || op . checkCircleReference ( markMap ) ; } return rst ;
public class QuadPoseEstimator { /** * Given the found solution , compute the the observed pixel would appear on the marker ' s surface . * pixel - > normalized pixel - > rotated - > projected on to plane * @ param pixelX ( Input ) pixel coordinate * @ param pixelY ( Input ) pixel coordinate * @ param marker ( ...
// find pointing vector in camera reference frame pixelToNorm . compute ( pixelX , pixelY , marker ) ; cameraP3 . set ( marker . x , marker . y , 1 ) ; // rotate into marker reference frame GeometryMath_F64 . multTran ( outputFiducialToCamera . R , cameraP3 , ray . slope ) ; GeometryMath_F64 . multTran ( outputFiducial...
public class DefaultCassandraSessionFactory { /** * Destroy . */ @ Override public void destroy ( ) { } }
try { LOGGER . debug ( "Closing Cassandra session" ) ; session . close ( ) ; } catch ( final Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } try { LOGGER . debug ( "Closing Cassandra cluster" ) ; cluster . close ( ) ; } catch ( final Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; }
public class IndexTermReader { /** * Update the target name of each IndexTerm , recursively . */ private void updateIndexTermTargetName ( final IndexTerm indexterm ) { } }
final int targetSize = indexterm . getTargetList ( ) . size ( ) ; final int subtermSize = indexterm . getSubTerms ( ) . size ( ) ; for ( int i = 0 ; i < targetSize ; i ++ ) { final IndexTermTarget target = indexterm . getTargetList ( ) . get ( i ) ; final String uri = target . getTargetURI ( ) ; final int indexOfSharp ...
public class JaxbPortalDataHandlerService { /** * Ant path matching patterns that files must match to be included */ @ javax . annotation . Resource ( name = "dataFileIncludes" ) public void setDataFileIncludes ( Set < String > dataFileIncludes ) { } }
this . dataFileIncludes = dataFileIncludes ;
public class IntrospectionLevelMember { /** * Return either null ( if the value doesn ' t need further introspection ) or * the object reference if it does require further introspection * @ param value * The object that might require further introspection * @ return null if the object doesn ' t require further ...
Object answer = null ; // Assume we don ' t require further introspection // until proved otherwise if ( value != null ) { Class < ? > objClass = value . getClass ( ) ; if ( objClass . isArray ( ) ) { // Array ' s need further introspection if they ' re bigger than // length 0 // AND of non - primitive type if ( Array ...
public class JKFormatUtil { /** * Format double . * @ param amount the amount * @ param pattern the pattern * @ return the string */ public static String formatDouble ( final Double amount , String pattern ) { } }
if ( pattern == null || pattern . equals ( "" ) ) { pattern = JKFormatUtil . DEFAULT_DOUBLE_FORMAT ; } return JKFormatUtil . getNumberFormatter ( pattern ) . format ( amount ) ;
public class WebcamComponent { /** * Returns the first webcam . */ public Webcam getWebcam ( Dimension dimension ) { } }
if ( webcams . size ( ) == 0 ) { throw new IllegalStateException ( "No webcams found" ) ; } Webcam webcam = webcams . values ( ) . iterator ( ) . next ( ) ; openWebcam ( webcam , dimension ) ; return webcam ;
public class RandomVariableUniqueVariable { /** * Apply the AAD algorithm to this very variable * NOTE : in this case it is indeed correct to assume that the output dimension is " one " * meaning that there is only one { @ link RandomVariableUniqueVariable } as an output . * @ return gradient for the built up fun...
// for now let us take the case for output - dimension equal to one ! int numberOfVariables = getNumberOfVariablesInList ( ) ; int numberOfCalculationSteps = factory . getNumberOfEntriesInList ( ) ; RandomVariable [ ] omega_hat = new RandomVariable [ numberOfCalculationSteps ] ; // first entry gets initialized omega_ha...
public class LdapHelper { /** * Returns a new Instance of LdapHelper . * @ param instance the identifyer of the LDAP Instance ( e . g . ldap1) * @ return a new Instance . */ public static LdapHelper getInstance ( String instance ) { } }
if ( ! helpers . containsKey ( instance ) ) { helpers . put ( instance , new LdapHelper ( instance ) ) ; } LdapHelper helper = helpers . get ( instance ) ; if ( ! helper . online ) { helper . loadProperties ( ) ; } return helper ;
public class CmsPropertyviewDialog { /** * Initializes the dialog object . */ private void initDialogObject ( ) { } }
Object o = getDialogObject ( ) ; if ( o != null ) { m_settings = ( CmsPropertyviewDialogSettings ) o ; } else { m_settings = new CmsPropertyviewDialogSettings ( ) ; setDialogObject ( m_settings ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link UserDefinedCSRefType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link UserDefinedCSRefType } { @ ...
return new JAXBElement < UserDefinedCSRefType > ( _UserDefinedCSRef_QNAME , UserDefinedCSRefType . class , null , value ) ;
public class UriComponentsBuilder { /** * Creates a new { @ code UriComponents } object from the string HTTP URL . * < p > < strong > Note : < / strong > The presence of reserved characters can prevent * correct parsing of the URI string . For example if a query parameter * contains { @ code ' = ' } or { @ code '...
Assert . notNull ( httpUrl , "'httpUrl' must not be null" ) ; Matcher matcher = HTTP_URL_PATTERN . matcher ( httpUrl ) ; if ( matcher . matches ( ) ) { UriComponentsBuilder builder = new UriComponentsBuilder ( ) ; String scheme = matcher . group ( 1 ) ; builder . scheme ( scheme != null ? scheme . toLowerCase ( ) : nul...
public class Searches { /** * Given a number of search fields , compute the SQL fragment * used to order the searched / found rows * ORDER BY least ( coalesce ( nullif ( position ( lower ( ? ) IN lower ( title ) ) , 0 ) , 9999 ) , * coalesce ( nullif ( position ( lower ( ? ) IN lower ( notes ) ) , 0 ) , 9999 ) . ...
if ( 0 == searchFields . size ( ) ) { return "" ; } return " ORDER BY " + computeSelectScore ( searchFields ) ;
public class Controller { /** * This method returns a host name of a web server if this container is fronted by one , such that * it sets a header < code > X - Forwarded - Host < / code > on the request and forwards it to the Java container . * If such header is not present , than the { @ link # host ( ) } method i...
String forwarded = header ( "X-Forwarded-Host" ) ; if ( StringUtil . blank ( forwarded ) ) { return host ( ) ; } String [ ] forwards = forwarded . split ( "," ) ; return forwards [ 0 ] . trim ( ) ;
public class HibernateObjStore { /** * protected Logger log = LoggerFactory . getLogger ( HibernateDataObjectStore . class ) ; */ public Obj get ( String type , String id ) throws Exception { } }
return get ( type , id , type ) ;
public class AcroFields { /** * Replaces the designated field with a new pushbutton . The pushbutton can be created with * { @ link # getNewPushbuttonFromField ( String , int ) } from the same document or it can be a * generic PdfFormField of the type pushbutton . * @ param field the field name * @ param button...
if ( getFieldType ( field ) != FIELD_TYPE_PUSHBUTTON ) return false ; Item item = getFieldItem ( field ) ; if ( order >= item . size ( ) ) return false ; PdfDictionary merged = item . getMerged ( order ) ; PdfDictionary values = item . getValue ( order ) ; PdfDictionary widgets = item . getWidget ( order ) ; for ( int ...
public class NetUtils { /** * This is used to get all the resolutions that were added using * { @ link NetUtils # addStaticResolution ( String , String ) } . The return * value is a List each element of which contains an array of String * of the form String [ 0 ] = hostname , String [ 1 ] = resolved - hostname ...
synchronized ( hostToResolved ) { Set < Entry < String , String > > entries = hostToResolved . entrySet ( ) ; if ( entries . size ( ) == 0 ) { return null ; } List < String [ ] > l = new ArrayList < String [ ] > ( entries . size ( ) ) ; for ( Entry < String , String > e : entries ) { l . add ( new String [ ] { e . getK...
public class MessageProcessorMatching { /** * Method addConsumerDispatcherMatchTarget * Used to add a ConsumerDispatcher to the MatchSpace . * @ param handler The consumer to add * @ param topicSpace The name of the topic space to add against * @ param discriminator The topic name * @ param selector The filte...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addConsumerDispatcherMatchTarget" , new Object [ ] { consumerDispatcher , topicSpace , criteria } ) ; // Combine the topicSpace and topic String topicSpaceStr = topicSpace . toString ( ) ; String theTopic = buildAddTopicExp...
public class AbstractSequenceClassifier { /** * Load a classifier from the specified InputStream . The classifier is * reinitialized from the flags serialized in the classifier . This does not * close the InputStream . * @ param in * The InputStream to load the serialized classifier from * @ param props * T...
loadClassifier ( new ObjectInputStream ( in ) , props ) ;
public class OutParameter { /** * ステートメントに出力パラメータを登録 。 * @ param callableStatement コーラブルステートメント * @ param index パラメータインデックス * @ return 次のパラメータインデックス * @ throws SQLException SQL例外 */ protected int setOutParameter ( final CallableStatement callableStatement , int index ) throws SQLException { } }
callableStatement . registerOutParameter ( index , sqlType . getVendorTypeNumber ( ) ) ; parameterLog ( index ) ; index ++ ; return index ;
public class GeneratorsGenerator { /** * / * ( non - Javadoc ) * @ see org . opoo . press . Generator # generate ( org . opoo . press . Site ) */ @ Override public void generate ( Site site ) { } }
if ( generators != null ) { for ( Generator g : generators ) { g . generate ( site ) ; } }
public class CursorLoader { /** * Get a cursor based on a image reference on the classpath * @ param ref The reference to the image to be loaded * @ param x The x - coordinate of the cursor hotspot ( left - > right ) * @ param y The y - coordinate of the cursor hotspot ( bottom - > top ) * @ return The create c...
LoadableImageData imageData = null ; imageData = ImageDataFactory . getImageDataFor ( ref ) ; imageData . configureEdging ( false ) ; ByteBuffer buf = imageData . loadImage ( ResourceLoader . getResourceAsStream ( ref ) , true , true , null ) ; for ( int i = 0 ; i < buf . limit ( ) ; i += 4 ) { byte red = buf . get ( i...
public class LogFileHeader { /** * Calculate the length in byte of this header . This method may be used by the * log file handle to determine the size of the header when writing all pending * records during a force . * @ exception LogIncompatibleException The target object represents an incompatible * header ....
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "length" ) ; if ( ! _compatible ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "length" , "LogIncompatibleException" ) ; throw new LogIncompatibleException ( ) ; } if ( _status == STATUS_INVALID ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "length" , "LogHead...
public class GoogleWebmasterExtractor { /** * Currently , the filter group is just one filter at a time , there is no cross - dimension filters combination . * TODO : May need to implement this feature in the future based on use cases . */ private Iterable < Map < GoogleWebmasterFilter . Dimension , ApiDimensionFilte...
List < Map < GoogleWebmasterFilter . Dimension , ApiDimensionFilter > > filters = new ArrayList < > ( ) ; for ( String filter : splitter . split ( wuState . getProp ( GoogleWebMasterSource . KEY_REQUEST_FILTERS ) ) ) { String [ ] parts = Iterables . toArray ( Splitter . on ( "." ) . split ( filter ) , String . class ) ...
public class SeleniumElementSteps { /** * When */ @ When ( "^I drag the \"([^\"]*)\" onto the \"([^\"]*)\"$" ) public void I_drag_the_onto_the ( String draggableLocator , String dragReceiverLocator ) throws Throwable { } }
seleniumElementService . waitForLoaders ( ) ; seleniumElementService . dragElementTo ( draggableLocator , dragReceiverLocator , 5000 ) ;
public class LogServlet { /** * This method get the Logs file directory * @ return A { @ link File } that represents the location where the logs can be found . */ private File getLogsDirectory ( ) { } }
if ( logsDirectory != null ) { return logsDirectory ; } logsDirectory = new File ( SeLionGridConstants . LOGS_DIR ) ; if ( ! logsDirectory . exists ( ) ) { logsDirectory . mkdirs ( ) ; } return logsDirectory ;
public class SharedPreferenceUtils { /** * Checks if debug menu item clicked or not . * @ param context * : context to start activity if debug item handled . * @ param item * : Menu item whose click is to be checked . * @ return : < code > true < / code > if debug menu item is clicked , it will automatically ...
int id = item . getItemId ( ) ; if ( id == R . id . action_debug ) { startActivity ( context ) ; return true ; } return false ;
public class OutputChannel { public void requestClose ( ) throws IOException , InterruptedException { } }
if ( this . senderCloseRequested ) { return ; } this . senderCloseRequested = true ; Envelope envelope = createNextEnvelope ( ) ; envelope . serializeEventList ( Arrays . asList ( new ChannelCloseEvent ( ) ) ) ; this . envelopeDispatcher . dispatchFromOutputChannel ( envelope ) ;
public class J2CSecurityHelper { /** * Method to handle the GroupPrincipalCallback thereby establishing group principals within the argument subject . * This callback is passed in by the Resource Adapter and handled by the J2CSecurityCallbackHandler that the * Application Server implements . * @ param callback Th...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "handleGroupPrincipalCallback" , objectId ( callback ) ) ; } invocations [ 1 ] = Invocation . GROUPPRINCIPALCALLBACK ; Subject callSubject = callback . getSubject ( ) ; if ( ! executionSubject . equals ( callSubject ) ) { Tr ...
public class SpringContainerHelper { /** * adds hooks to capture autowired constructor args and add them as dependencies * @ return */ private static DefaultListableBeanFactory createBeanFactory ( ) { } }
return new DefaultListableBeanFactory ( ) { { final InstantiationStrategy is = getInstantiationStrategy ( ) ; setInstantiationStrategy ( new InstantiationStrategy ( ) { @ Override public Object instantiate ( RootBeanDefinition beanDefinition , String beanName , BeanFactory owner ) throws BeansException { return is . in...
public class CmsTwoListsDialog { /** * Returns the html code for the default action content . < p > * @ return html code */ protected String defaultActionHtmlContent ( ) { } }
StringBuffer result = new StringBuffer ( 2048 ) ; result . append ( "<table id='twolists' cellpadding='0' cellspacing='0' align='center' width='100%'>\n" ) ; result . append ( "\t<tr>\n" ) ; result . append ( "\t\t<td width='50%' valign='top'>\n" ) ; result . append ( "\t\t\t" ) . append ( m_firstWp . defaultActionHtml...
public class PresenterManager { /** * Get the Activity of a context . This is typically used to determine the hosting activity of a * { @ link View } * @ param context The context * @ return The Activity or throws an Exception if Activity couldnt be determined */ @ NonNull public static Activity getActivity ( @ N...
if ( context == null ) { throw new NullPointerException ( "context == null" ) ; } if ( context instanceof Activity ) { return ( Activity ) context ; } while ( context instanceof ContextWrapper ) { if ( context instanceof Activity ) { return ( Activity ) context ; } context = ( ( ContextWrapper ) context ) . getBaseCont...
public class SecurityController { /** * Create { @ link GeneratedClassLoader } with restrictions imposed by * staticDomain and all current stack frames . * The method uses the SecurityController instance associated with the * current { @ link Context } to construct proper dynamic domain and create * correspondi...
Context cx = Context . getContext ( ) ; if ( parent == null ) { parent = cx . getApplicationClassLoader ( ) ; } SecurityController sc = cx . getSecurityController ( ) ; GeneratedClassLoader loader ; if ( sc == null ) { loader = cx . createClassLoader ( parent ) ; } else { Object dynamicDomain = sc . getDynamicSecurityD...
public class TheMovieDbApi { /** * This method is used to retrieve all of the basic movie information . * It will return the single highest rated poster and backdrop . * ApiExceptionType . MOVIE _ ID _ NOT _ FOUND will be thrown if there are no movies * found . * @ param movieId movieId * @ param language lan...
return tmdbMovies . getMovieInfo ( movieId , language , appendToResponse ) ;
public class SVGPlot { /** * Clone the SVGPlot document for transcoding . * This will usually be necessary for exporting the SVG document if it is * currently being displayed : otherwise , we break the Batik rendering trees . * ( Discovered by Simon ) . * @ return cloned document */ protected SVGDocument cloneD...
return ( SVGDocument ) new CloneInlineImages ( ) { @ Override public Node cloneNode ( Document doc , Node eold ) { // Skip elements with noexport attribute set if ( eold instanceof Element ) { Element eeold = ( Element ) eold ; String vis = eeold . getAttribute ( NO_EXPORT_ATTRIBUTE ) ; if ( vis != null && vis . length...
public class SqlGeneratorDefaultImpl { /** * Answer the SQL - Clause for a NullCriteria * @ param c NullCriteria */ private String toSQLClause ( NullCriteria c ) { } }
String colName = ( String ) c . getAttribute ( ) ; return colName + c . getClause ( ) ;
public class LogHelper { /** * Configures JUL ( java . util . logging ) using the logging . properties file located in this package . * Only use this method for testing purposes , clients should configure logging themselves - that * is you need to provide a logging bridge for SLF4J compatible to your logging infras...
try ( InputStream is = LogHelper . class . getResourceAsStream ( "logging.properties" ) ) { if ( is == null ) { throw new IOException ( "Can't find/open logging.properties" ) ; } LogManager logMan = LogManager . getLogManager ( ) ; logMan . readConfiguration ( is ) ; } catch ( final IOException e ) { java . util . logg...
public class TypeUtil { /** * Get the super type for a type in its super type chain , which has * a raw class that matches the specified class . * @ param subType the sub type to find super type for * @ param rawSuperType the raw class for the super type * @ return the super type that matches the requirement */...
while ( subType != null && getRawClass ( subType ) != rawSuperType ) { subType = getSuperType ( subType ) ; } return subType ;
public class DisableEnhancedMonitoringResult { /** * Represents the list of all the metrics that would be in the enhanced state after the operation . * @ return Represents the list of all the metrics that would be in the enhanced state after the operation . * @ see MetricsName */ public java . util . List < String ...
if ( desiredShardLevelMetrics == null ) { desiredShardLevelMetrics = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return desiredShardLevelMetrics ;
public class hqlLexer { /** * $ ANTLR start " WS " */ public final void mWS ( ) throws RecognitionException { } }
try { int _type = WS ; int _channel = DEFAULT_TOKEN_CHANNEL ; // hql . g : 791:5 : ( ( ' ' | ' \ \ t ' | ' \ \ r ' ' \ \ n ' | ' \ \ n ' | ' \ \ r ' ) ) // hql . g : 791:9 : ( ' ' | ' \ \ t ' | ' \ \ r ' ' \ \ n ' | ' \ \ n ' | ' \ \ r ' ) { // hql . g : 791:9 : ( ' ' | ' \ \ t ' | ' \ \ r ' ' \ \ n ' | ' \ \ n ' | ' \...
public class TechnologyTargeting { /** * Gets the mobileDeviceTargeting value for this TechnologyTargeting . * @ return mobileDeviceTargeting * The mobile devices being targeted by the { @ link LineItem } . */ public com . google . api . ads . admanager . axis . v201808 . MobileDeviceTargeting getMobileDeviceTargetin...
return mobileDeviceTargeting ;
public class MPXWriter { /** * This method formats a time unit . * @ param timeUnit time unit instance * @ return formatted time unit instance */ private String formatTimeUnit ( TimeUnit timeUnit ) { } }
int units = timeUnit . getValue ( ) ; String result ; String [ ] [ ] unitNames = LocaleData . getStringArrays ( m_locale , LocaleData . TIME_UNITS_ARRAY ) ; if ( units < 0 || units >= unitNames . length ) { result = "" ; } else { result = unitNames [ units ] [ 0 ] ; } return ( result ) ;
public class TransformFilter { /** * Initializes the filter . */ protected void initializeFilter ( InputStream filterInput , OutputStream filterOutput ) { } }
try { // Create Transformer object . Source transform = getTransform ( ) ; if ( transform == null ) { throw new IllegalStateException ( "No XSLT transform specified" ) ; } TransformerFactory factory = TransformerFactory . newInstance ( ) ; factory . setErrorListener ( this ) ; transformer_ = factory . newTransformer ( ...
public class DateUtils { /** * Parses the specified date string as a compressedIso8601DateFormat ( " yyyyMMdd ' T ' HHmmss ' Z ' " ) and returns the Date * object . * @ param dateString * The date string to parse . * @ return The parsed Date object . */ public static Date parseCompressedISO8601Date ( String dat...
try { return new Date ( compressedIso8601DateFormat . parseMillis ( dateString ) ) ; } catch ( RuntimeException ex ) { throw handleException ( ex ) ; }
public class AssociationExecutionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AssociationExecution associationExecution , ProtocolMarshaller protocolMarshaller ) { } }
if ( associationExecution == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( associationExecution . getAssociationId ( ) , ASSOCIATIONID_BINDING ) ; protocolMarshaller . marshall ( associationExecution . getAssociationVersion ( ) , ASSOCIATI...
public class MainForm { /** * set the selected look and feel * @ since 01.07.2006 * @ param lookAndFeelClassName * @ return */ private void setLookAndFeel ( String lookAndFeelClassName ) { } }
try { javax . swing . UIManager . setLookAndFeel ( lookAndFeelClassName ) ; } catch ( Throwable e ) { showMessage ( "The selected Look&Feel is not supported or not reachable through the classpath. Switching to system default..." ) ; try { lookAndFeelClassName = javax . swing . UIManager . getSystemLookAndFeelClassName ...
public class TmdbPeople { /** * Get the images that have been tagged with a specific person id . * We return all of the image results with a media object mapped for each * image . * @ param personId * @ param page * @ param language * @ return * @ throws com . omertron . themoviedbapi . MovieDbException *...
TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , personId ) ; parameters . add ( Param . PAGE , page ) ; parameters . add ( Param . LANGUAGE , language ) ; URL url = new ApiUrl ( apiKey , MethodBase . PERSON ) . subMethod ( MethodSub . TAGGED_IMAGES ) . buildUrl ( parameters ) ; Wrap...
public class StringUtils { /** * Constructs and returns a string object that is the result of interposing a separator between the elements of the list */ public static < T > String join ( List < T > list , String separator ) { } }
StringBuilder builder = new StringBuilder ( ) ; int i = 0 ; for ( T t : list ) { builder . append ( t ) ; if ( ++ i < list . size ( ) ) builder . append ( separator ) ; } return builder . toString ( ) ;
public class DefaultGroovyMethods { /** * Iterates through the map transforming items using the supplied closure * and collecting any non - null results . * If the closure takes two parameters , the entry key and value are passed . * If the closure takes one parameter , the Map . Entry object is passed . * Exam...
List < T > result = new ArrayList < T > ( ) ; for ( Map . Entry < K , V > entry : self . entrySet ( ) ) { T transformed = callClosureForMapEntry ( filteringTransform , entry ) ; if ( transformed != null ) { result . add ( transformed ) ; } } return result ;
public class LineDrawer { /** * Draws line ( p1 , p2 ) by plotting points using plot * @ param p1 * @ param p2 * @ param plot * @ param color */ public static void drawLine ( Point p1 , Point p2 , PlotOperator plot ) { } }
drawLine ( p1 . x , p1 . y , p2 . x , p2 . y , plot ) ;
public class ScoreTemplate { /** * Returns position of a field * @ param field * one of { @ link ScoreElements } constants * @ return an array of 2 bytes : [ VerticalPosition . xxx , HorizontalAlign . xxx ] * < TT > null < / TT > if position has not been defined */ public byte [ ] getPosition ( byte field ) { }...
Iterator it = m_fieldsPosition . keySet ( ) . iterator ( ) ; Byte B = field ; while ( it . hasNext ( ) ) { Position p = ( Position ) it . next ( ) ; if ( ( ( Vector ) m_fieldsPosition . get ( p ) ) . contains ( B ) ) { return new byte [ ] { p . m_vertical , p . m_horizontal } ; } } if ( field != ScoreElements . _DEFAUL...
public class Variable { /** * Add a fuzzy member to this variable . * @ param memberName member name * @ param functionCall the function call * @ return the member */ public Member addMember ( String memberName , FunctionCall functionCall ) { } }
if ( haveMember ( memberName ) ) { throw new FuzzerException ( memberName + ": member already exists of variable '" + name + "'" ) ; } Member member = new Member ( memberName , functionCall ) ; members . add ( member ) ; return member ;
public class CalendarSystem { /** * Returns a < code > CalendarSystem < / code > specified by the calendar * name . The calendar name has to be one of the supported calendar * names . * @ param calendarName the calendar name * @ return the < code > CalendarSystem < / code > specified by * < code > calendarNam...
if ( "gregorian" . equals ( calendarName ) ) { return GregorianHolder . INSTANCE ; } else if ( "julian" . equals ( calendarName ) ) { return JulianHolder . INSTANCE ; } return null ; /* J2ObjC changed : Only " gregorian " and " julian " calendars are supported . CalendarSystem cal = calendars . get ( calendarName ) ;...
public class SpringUtils { /** * Extracts all routes from the annotated class * @ param controllerClazz * Instrospected class * @ return At least 1 route value ( empty string ) */ public static String [ ] getControllerResquestMapping ( Class < ? > controllerClazz ) { } }
String [ ] controllerRequestMappingValues = { } ; // Determine if we will use class - level requestmapping or dummy string RequestMapping classRequestMapping = AnnotationUtils . findAnnotation ( controllerClazz , RequestMapping . class ) ; if ( classRequestMapping != null ) { controllerRequestMappingValues = classReque...
public class Queue { /** * Instantiate the Queues BatchProcessServer . Will ask the parent Queue * to instantiate its BatchProcessServer if this Queue doesn ' t have one . */ public BatchProcessServer getBatchProcessServer ( ) { } }
if ( process_server_class != null ) { try { return process_server_class . newInstance ( ) ; } catch ( Exception e ) { throw new QueujException ( e ) ; } } if ( parent_queue != null ) return parent_queue . getBatchProcessServer ( ) ; // else throw new QueujException ( "No BatchProcessServer exists for Queue" ) ;
public class IabHelper { /** * Workaround to bug where sometimes response codes come as Long instead of Integer */ int getResponseCodeFromBundle ( Bundle b ) { } }
Object o = b . get ( RESPONSE_CODE ) ; if ( o == null ) { logDebug ( "Bundle with null response code, assuming OK (known issue)" ) ; return BILLING_RESPONSE_RESULT_OK ; } else if ( o instanceof Integer ) return ( ( Integer ) o ) . intValue ( ) ; else if ( o instanceof Long ) return ( int ) ( ( Long ) o ) . longValue ( ...
public class InfluxDBEventReporter { /** * Extracts the event and its metadata from { @ link GobblinTrackingEvent } and creates * timestamped name value pairs * @ param event { @ link GobblinTrackingEvent } to be reported * @ throws IOException */ private void pushEvent ( GobblinTrackingEvent event ) throws IOExc...
Map < String , String > metadata = event . getMetadata ( ) ; String name = getMetricName ( metadata , event . getName ( ) ) ; long timestamp = event . getTimestamp ( ) ; MultiPartEvent multiPartEvent = MultiPartEvent . getEvent ( metadata . get ( EventSubmitter . EVENT_TYPE ) ) ; if ( multiPartEvent == null ) { influxD...
public class CollaboratorHelperImpl { /** * Returns true / false to indicate whether there is a ' real ' collaborator registered for the current application ( based on the SecurityDomain * specified by the application ) . */ public static boolean getCurrentSecurityEnabled ( ) { } }
boolean enabled = false ; ICollaboratorHelper instance = getCurrentInstance ( ) ; if ( instance != null ) enabled = ( ( CollaboratorHelperImpl ) instance ) . isSecurityEnabled ( ) ; return enabled ;
public class MemoryStorage { /** * { @ inheritDoc } */ @ Override public Collection < ? extends SagaState > load ( final String type , final Object instanceKey ) { } }
Collection < ? extends SagaState > items ; synchronized ( sync ) { items = new ArrayList < > ( instanceKeyMap . get ( SagaMultiKey . create ( type , instanceKey ) ) ) ; } return items ;
public class SailthruClient { /** * get information about a blast * @ param blastId * @ return JsonResponse * @ throws IOException */ public JsonResponse getBlast ( Integer blastId ) throws IOException { } }
Blast blast = new Blast ( ) ; blast . setBlastId ( blastId ) ; return apiGet ( blast ) ;